//clean header.tpl and footer.tpl

This commit is contained in:
vAugagneur
2011-11-23 12:59:02 +00:00
parent 2f74741573
commit cf072a67f8
5 changed files with 103 additions and 109 deletions
-92
View File
@@ -55,98 +55,6 @@
{/if}
<script type="text/javascript">
$(document).ready(function(){
var message = $('.toolbarHead');
var view = $(window);
// bind only if message exists. placeholder will be its parent
view.bind("scroll resize", function(e)
{
message.each(function(el){
if (message.length)
{
placeholder = $(this).parent();
if(e.type == 'resize')
$(this).css('width', $(this).parent().width());
placeholderTop = placeholder.offset().top;
var viewTop = view.scrollTop() + 15;
// here we force the toolbar to be "not fixed" when
// the height of the window is really small (toolbar hiding the page is not cool)
window_is_more_than_twice_the_toolbar = view.height() > message.parent().height() * 2;
if (!$(this).hasClass("fix-toolbar") && (window_is_more_than_twice_the_toolbar && (viewTop > placeholderTop)))
{
$(this).css('width', $(this).width());
// fixing parent height will prevent that annoying "pagequake" thing
// the order is important : this has to be set before adding class fix-toolbar
$(this).parent().css('height', $(this).parent().height());
$(this).addClass("fix-toolbar");
}
else if ($(this).hasClass("fix-toolbar") && (!window_is_more_than_twice_the_toolbar || (viewTop <= placeholderTop)) )
{
$(this).removeClass("fix-toolbar");
}
}
});
}); // end bind
// if count errors
$('#hideError').live('click', function(e)
{
e.preventDefault();
$('.error').hide('slow', function (){
$('.error').remove();
});
return false;
});
// if count warnings
$('#linkSeeMore').live('click', function(e){
e.preventDefault();
$('#seeMore').show('slow');
$(this).hide();
$('#linkHide').show();
return false;
});
$('#linkHide').live('click', function(e){
e.preventDefault();
$('#seeMore').hide('slow');
$(this).hide();
$('#linkSeeMore').show();
return false;
});
$('#hideWarn').live('click', function(e){
e.preventDefault();
$('.warn').hide('slow', function (){
$('.warn').remove();
});
return false;
});
if($('.help-context'))
{
$.ajax({
type: 'POST',
url: 'index.php',
data: {
'ajax' : '1',
'action' : 'helpAccess',
'item' : '{$class_name}',
'isoUser' : '{$iso_user}',
'country' : '{$country_iso_code}',
'version' : '{$smarty.const._PS_VERSION_}'
},
async : true,
success: function(msg) {
if(msg.status == 'ok' && msg.content != 'none')
{
$(".help-context").html(msg.content);
$(".help-context").fadeIn("slow").show();
}
}
});
}
});
</script>
</body>
</html>
+7 -16
View File
@@ -31,6 +31,11 @@
<title>{$meta_title} - PrestaShop&trade;</title>
{if $display_header}
<script type="text/javascript">
var class_name = '{$class_name}';
var iso_user = '{$iso_user}';
var country_iso_code = '{$country_iso_code}';
var _PS_VERSION_ = '{$smarty.const._PS_VERSION_}';
var helpboxes = {$help_box};
var roundMode = {$round_mode};
{if isset($shop_context)}
@@ -72,22 +77,8 @@
<script type="text/javascript" src="{$js_uri}"></script>
{/foreach}
{/if}
{if $display_header}
<script type="text/javascript">
$(function() {
$.ajax({
type: 'POST',
url: 'ajax.php',
data: 'helpAccess=1&item={$class_name}&isoUser={$iso_user}&country={$country_iso_code}&version={$version}',
async : true,
success: function(msg) {
$("#help-button").html(msg);
$("#help-button").fadeIn("slow");
}
});
});
</script>
{/if} <link rel="shortcut icon" href="{$img_dir}favicon.ico" />
<link rel="shortcut icon" href="{$img_dir}favicon.ico" />
{if $display_header}
{$HOOK_HEADER}
{/if}
+3 -1
View File
@@ -1503,7 +1503,9 @@ class AdminControllerCore extends Controller
_PS_JS_DIR_.'toggle.js',
_PS_JS_DIR_.'tools.js',
_PS_JS_DIR_.'ajax.js',
_PS_JS_DIR_.'notifications.js'
_PS_JS_DIR_.'notifications.js',
_PS_JS_DIR_.'helpAccess.js',
_PS_JS_DIR_.'toolbar.js'
));
}
/**
+25
View File
@@ -0,0 +1,25 @@
$(document).ready(function(){
if($('.help-context'))
{
$.ajax({
type: 'POST',
url: 'index.php',
data: {
'ajax' : '1',
'action' : 'helpAccess',
'item' : class_name,
'isoUser' : iso_user,
'country' : country_iso_code,
'version' : _PS_VERSION_
},
async : true,
success: function(msg) {
if(msg.status == 'ok' && msg.content != 'none')
{
$(".help-context").html(msg.content);
$(".help-context").fadeIn("slow").show();
}
}
});
}
});
+68
View File
@@ -0,0 +1,68 @@
$(document).ready(function(){
var message = $('.toolbarHead');
var view = $(window);
// bind only if message exists. placeholder will be its parent
view.bind("scroll resize", function(e)
{
message.each(function(el){
if (message.length)
{
placeholder = $(this).parent();
if(e.type == 'resize')
$(this).css('width', $(this).parent().width());
placeholderTop = placeholder.offset().top;
var viewTop = view.scrollTop() + 15;
// here we force the toolbar to be "not fixed" when
// the height of the window is really small (toolbar hiding the page is not cool)
window_is_more_than_twice_the_toolbar = view.height() > message.parent().height() * 2;
if (!$(this).hasClass("fix-toolbar") && (window_is_more_than_twice_the_toolbar && (viewTop > placeholderTop)))
{
$(this).css('width', $(this).width());
// fixing parent height will prevent that annoying "pagequake" thing
// the order is important : this has to be set before adding class fix-toolbar
$(this).parent().css('height', $(this).parent().height());
$(this).addClass("fix-toolbar");
}
else if ($(this).hasClass("fix-toolbar") && (!window_is_more_than_twice_the_toolbar || (viewTop <= placeholderTop)) )
{
$(this).removeClass("fix-toolbar");
}
}
});
}); // end bind
// if count errors
$('#hideError').live('click', function(e)
{
e.preventDefault();
$('.error').hide('slow', function (){
$('.error').remove();
});
return false;
});
// if count warnings
$('#linkSeeMore').live('click', function(e){
e.preventDefault();
$('#seeMore').show('slow');
$(this).hide();
$('#linkHide').show();
return false;
});
$('#linkHide').live('click', function(e){
e.preventDefault();
$('#seeMore').hide('slow');
$(this).hide();
$('#linkSeeMore').show();
return false;
});
$('#hideWarn').live('click', function(e){
e.preventDefault();
$('.warn').hide('slow', function (){
$('.warn').remove();
});
return false;
});
});