Clear code

This commit is contained in:
Laurent Destailleur 2017-11-09 09:50:55 +01:00
parent d18f65a6e2
commit 9b07f33649
3 changed files with 22 additions and 22 deletions

View File

@ -44,19 +44,6 @@ else header('Cache-Control: no-cache');
//var_dump($conf);
print '/* Reposition management (does not work if a redirect is done after action of submission) */'."\n";
print 'jQuery(document).ready(function() {'."\n";
print '/* If page_y set, we set scollbar with it */'."\n";
print "page_y=getParameterByName('page_y', 0); if (page_y > 0) $('html, body').scrollTop(page_y);\n";
print '/* Set handler to add page_y param on some a href links */'."\n";
print 'jQuery(".reposition").click(function() {
var page_y = $(document).scrollTop();
this.href=this.href+\'&page_y=\'+page_y;
console.log("this.ref is now "+this.href)
});'."\n";
print '});'."\n";
// Wrapper to show tooltips (html or onclick popup)
if (empty($conf->dol_no_mouse_hover))
{
@ -140,3 +127,16 @@ if ($conf->browser->layout != 'phone')
' . "\n";
}
print "\n/* JS CODE TO ENABLE reposition management (does not work if a redirect is done after action of submission) */\n";
print '
jQuery(document).ready(function() {
/* If page_y set, we set scollbar with it */
page_y=getParameterByName(\'page_y\', 0); if (page_y > 0) $(\'html, body\').scrollTop(page_y);
/* Set handler to add page_y param on some a href links */
jQuery(".reposition").click(function() {
var page_y = $(document).scrollTop();
this.href=this.href+\'&page_y=\'+page_y;
console.log("this.ref is now "+this.href)
});
});'."\n";

View File

@ -6377,7 +6377,7 @@ function printCommonFooter($zone='private')
if ($zone == 'private' && empty($conf->dol_use_jmobile))
{
print "\n";
print '/* Set handler to switch left menu page (menuhider) */'."\n";
print '/* JS CODE TO ENABLE to enable handler to switch left menu page (menuhider) */'."\n";
print 'jQuery(".menuhider").click(function() {';
print ' console.log("We click on .menuhider");'."\n";
//print " $('.side-nav').animate({width:'toggle'},200);\n"; // OK with eldy theme but not with md
@ -6392,7 +6392,7 @@ function printCommonFooter($zone='private')
if (($conf->dol_use_jmobile != 4))
{
print "\n";
print "/* Set google analtics tag */\n";
print "/* JS CODE TO ENABLE for google analtics tag */\n";
print ' var _gaq = _gaq || [];'."\n";
print ' _gaq.push([\'_setAccount\', \''.$conf->global->MAIN_GOOGLE_AN_ID.'\']);'."\n";
print ' _gaq.push([\'_trackPageview\']);'."\n";
@ -6409,7 +6409,7 @@ function printCommonFooter($zone='private')
if (! empty($_SERVER['MAIN_SHOW_TUNING_INFO']) || ! empty($conf->global->MAIN_SHOW_TUNING_INFO))
{
print "\n";
print "/* Add memory info */\n";
print "/* JS CODE TO ENABLE to add memory info */\n";
print 'window.console && console.log("';
if (! empty($conf->global->MEMCACHED_SERVER)) print 'MEMCACHED_SERVER='.$conf->global->MEMCACHED_SERVER.' - ';
print 'MAIN_OPTIMIZE_SPEED='.(isset($conf->global->MAIN_OPTIMIZE_SPEED)?$conf->global->MAIN_OPTIMIZE_SPEED:'off');

View File

@ -1087,6 +1087,8 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
//print '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">'."\n";
if (empty($disablehead))
{
$ext='version='.urlencode(DOL_VERSION);
print "<head>\n";
if (GETPOST('dol_basehref','alpha')) print '<base href="'.dol_escape_htmltag(GETPOST('dol_basehref','alpha')).'">'."\n";
// Displays meta
@ -1110,10 +1112,6 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs
else print "<title>".dol_htmlentities($appli)."</title>";
print "\n";
//$ext='';
//if (! empty($conf->dol_use_jmobile)) $ext='version='.urlencode(DOL_VERSION);
$ext='version='.urlencode(DOL_VERSION);
if (GETPOST('version','int')) $ext='version='.GETPOST('version','int'); // usefull to force no cache on css/js
if (GETPOST('testmenuhider','int') || ! empty($conf->global->MAIN_TESTMENUHIDER)) $ext.='&testmenuhider='.(GETPOST('testmenuhider','int')?GETPOST('testmenuhider','int'):$conf->global->MAIN_TESTMENUHIDER);
@ -1871,6 +1869,8 @@ if (! function_exists("llxFooter"))
global $conf, $langs, $user, $object;
global $delayedhtmlcontent;
$ext='version='.urlencode(DOL_VERSION);
// Global html output events ($mesgs, $errors, $warnings)
dol_htmloutput_events($disabledoutputofmessages);
@ -1930,9 +1930,9 @@ if (! function_exists("llxFooter"))
if (! empty($conf->use_javascript_ajax))
{
print "\n".'<!-- Includes JS Footer of Dolibarr -->'."\n";
print '<script type="text/javascript" src="/dolibarr/htdocs/core/js/lib_foot.js.php?lang=fr_FR&amp;version=7.0.0-alpha" async></script>'."\n";
print '<script type="text/javascript" src="/dolibarr/htdocs/core/js/lib_foot.js.php?lang='.$langs->defaultlang.($ext?'&amp;'.$ext:'').'" async></script>'."\n";
}
// Wrapper to add log when clicking on download or preview
if (! empty($conf->blockedlog->enabled) && is_object($object) && $object->id > 0 && $object->statut > 0)
{