From 9b07f336497dedcf78c0db59dec9bda077858e8e Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 9 Nov 2017 09:50:55 +0100 Subject: [PATCH] Clear code --- htdocs/core/js/lib_foot.js.php | 26 +++++++++++++------------- htdocs/core/lib/functions.lib.php | 6 +++--- htdocs/main.inc.php | 12 ++++++------ 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/htdocs/core/js/lib_foot.js.php b/htdocs/core/js/lib_foot.js.php index ff45a5d1017..e5a025a16fb 100644 --- a/htdocs/core/js/lib_foot.js.php +++ b/htdocs/core/js/lib_foot.js.php @@ -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"; + diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 0882016502f..81e58817d91 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -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'); diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index c884aa678c6..42eb93c6cd9 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1087,6 +1087,8 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs //print ''."\n"; if (empty($disablehead)) { + $ext='version='.urlencode(DOL_VERSION); + print "\n"; if (GETPOST('dol_basehref','alpha')) print ''."\n"; // Displays meta @@ -1110,10 +1112,6 @@ function top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs else print "".dol_htmlentities($appli).""; 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".''."\n"; - print ''."\n"; + print ''."\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) {