diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php
index d7e9bda13dd..93efffa687e 100644
--- a/htdocs/core/tpl/login.tpl.php
+++ b/htdocs/core/tpl/login.tpl.php
@@ -87,7 +87,7 @@ if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
$disablenofollow = 0;
}
-print top_htmlhead('', $titleofloginpage, 0, 0, $arrayofjs, array(), 0, $disablenofollow);
+print top_htmlhead('', $titleofloginpage, 0, 0, $arrayofjs, array(), 1, $disablenofollow);
$colorbackhmenu1 = '60,70,100'; // topmenu
diff --git a/htdocs/core/tpl/passwordforgotten.tpl.php b/htdocs/core/tpl/passwordforgotten.tpl.php
index d33533a3f97..97edcc1d3f2 100644
--- a/htdocs/core/tpl/passwordforgotten.tpl.php
+++ b/htdocs/core/tpl/passwordforgotten.tpl.php
@@ -60,7 +60,18 @@ $php_self = str_replace('action=validatenewpassword', '', $php_self);
$titleofpage = $langs->trans('SendNewPassword');
-print top_htmlhead('', $titleofpage);
+// Javascript code on logon page only to detect user tz, dst_observed, dst_first, dst_second
+$arrayofjs = array();
+
+$disablenofollow = 1;
+if (!preg_match('/'.constant('DOL_APPLICATION_TITLE').'/', $title)) {
+ $disablenofollow = 0;
+}
+if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
+ $disablenofollow = 0;
+}
+
+print top_htmlhead('', $titleofpage, 0, 0, $arrayofjs, array(), 1, $disablenofollow);
$colorbackhmenu1 = '60,70,100'; // topmenu
diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php
index 657b17434d7..4b5c851adf0 100644
--- a/htdocs/main.inc.php
+++ b/htdocs/main.inc.php
@@ -1404,11 +1404,11 @@ function top_httphead($contenttype = 'text/html', $forcenocache = 0)
* @param int $disablehead Disable head output
* @param array $arrayofjs Array of complementary js files
* @param array $arrayofcss Array of complementary css files
- * @param int $disablejmobile Disable jmobile (No more used)
+ * @param int $disableforlogin Do not load heavy js and css for login pages
* @param int $disablenofollow Disable no follow tag
* @return void
*/
-function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $disablejmobile = 0, $disablenofollow = 0)
+function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arrayofjs = '', $arrayofcss = '', $disableforlogin = 0, $disablenofollow = 0)
{
global $db, $conf, $langs, $user, $mysoc, $hookmanager;
@@ -1646,15 +1646,16 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
} else {
print ''."\n";
}
- if (!defined('DISABLE_JQUERY_TABLEDND')) {
- print ''."\n";
- }
// jQuery jnotify
if (empty($conf->global->MAIN_DISABLE_JQUERY_JNOTIFY) && !defined('DISABLE_JQUERY_JNOTIFY')) {
print ''."\n";
}
+ // Table drag and drop lines
+ if (empty($disableforlogin) && !defined('DISABLE_JQUERY_TABLEDND')) {
+ print ''."\n";
+ }
// Chart
- if ((empty($conf->global->MAIN_JS_GRAPH) || $conf->global->MAIN_JS_GRAPH == 'chart') && !defined('DISABLE_JS_GRAPH')) {
+ if (empty($disableforlogin) && (empty($conf->global->MAIN_JS_GRAPH) || $conf->global->MAIN_JS_GRAPH == 'chart') && !defined('DISABLE_JS_GRAPH')) {
print ''."\n";
}
@@ -1694,7 +1695,7 @@ function top_htmlhead($head, $title = '', $disablejs = 0, $disablehead = 0, $arr
if (!$disablejs && !empty($conf->use_javascript_ajax)) {
// CKEditor
- if ((!empty($conf->fckeditor->enabled) && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor') && !defined('DISABLE_CKEDITOR')) || defined('FORCE_CKEDITOR')) {
+ if (empty($disableforlogin) && (!empty($conf->fckeditor->enabled) && (empty($conf->global->FCKEDITOR_EDITORNAME) || $conf->global->FCKEDITOR_EDITORNAME == 'ckeditor') && !defined('DISABLE_CKEDITOR')) || defined('FORCE_CKEDITOR')) {
print ''."\n";
$pathckeditor = DOL_URL_ROOT.'/includes/ckeditor/ckeditor/';
$jsckeditor = 'ckeditor.js';