From b2ba685edd668bedad8ace5888b91187593e28f4 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 21 Aug 2013 20:22:53 +0000 Subject: [PATCH] remove inline javascript from idots and jerryr templates --- phpgwapi/inc/class.egw_framework.inc.php | 15 ---- phpgwapi/templates/default/head.tpl | 2 - .../idots/class.idots_framework.inc.php | 72 +++++++++++++++---- .../templates/{default => idots}/footer.tpl | 0 phpgwapi/templates/idots/js/idots.js | 44 ++++++++++++ .../templates/idots/js/simple_show_hide.js | 2 +- phpgwapi/templates/idots/js/slidereffects.js | 3 +- .../templates/{default => idots}/navbar.tpl | 23 ++---- .../jerryr/class.jerryr_framework.inc.php | 37 ++++++++++ phpgwapi/templates/jerryr/navbar.tpl | 26 +++---- 10 files changed, 159 insertions(+), 65 deletions(-) rename phpgwapi/templates/{default => idots}/footer.tpl (100%) create mode 100644 phpgwapi/templates/idots/js/idots.js rename phpgwapi/templates/{default => idots}/navbar.tpl (83%) diff --git a/phpgwapi/inc/class.egw_framework.inc.php b/phpgwapi/inc/class.egw_framework.inc.php index 8e201b5fb4..f97ef876b7 100644 --- a/phpgwapi/inc/class.egw_framework.inc.php +++ b/phpgwapi/inc/class.egw_framework.inc.php @@ -383,19 +383,6 @@ abstract class egw_framework } } - if(!$GLOBALS['egw_info']['user']['preferences']['common']['disable_slider_effects']) - { - $slider_effects_src = $GLOBALS['egw_info']['server']['webserver_url'] . '/phpgwapi/templates/idots/js/slidereffects.js'; - $slider_effects = ''; - } - else - { - $simple_show_hide_src = $GLOBALS['egw_info']['server']['webserver_url'] . '/phpgwapi/templates/idots/js/simple_show_hide.js'; - $simple_show_hide = ''; - } - if ($GLOBALS['egw_info']['flags']['app_header']) { $app = $GLOBALS['egw_info']['flags']['app_header']; @@ -426,8 +413,6 @@ abstract class egw_framework 'img_icon' => $var['favicon_file'], 'img_shortcut' => $var['favicon_file'], 'pngfix' => $pngfix, - 'slider_effects' => $slider_effects, - 'simple_show_hide' => $simple_show_hide, 'lang_code' => $lang_code, 'charset' => translation::charset(), 'website_title' => strip_tags($GLOBALS['egw_info']['server']['site_title']. ($app ? " [$app]" : '')), diff --git a/phpgwapi/templates/default/head.tpl b/phpgwapi/templates/default/head.tpl index 339941862c..882de96c3b 100644 --- a/phpgwapi/templates/default/head.tpl +++ b/phpgwapi/templates/default/head.tpl @@ -13,8 +13,6 @@ {meta_robots} - {slider_effects} - {simple_show_hide} {css_file} '; - d.write(strCSS); + jQuery('head').append(strCSS); // alert(strCSS); // this.load() diff --git a/phpgwapi/templates/idots/js/slidereffects.js b/phpgwapi/templates/idots/js/slidereffects.js index 4024681fa1..644d6e9493 100644 --- a/phpgwapi/templates/idots/js/slidereffects.js +++ b/phpgwapi/templates/idots/js/slidereffects.js @@ -62,7 +62,8 @@ function ypSlideOutMenu(id, dir, left, top, width, height,pos) strCSS += '}' strCSS += ''; - d.write(strCSS) + jQuery('head').append(strCSS); + this.load() } diff --git a/phpgwapi/templates/default/navbar.tpl b/phpgwapi/templates/idots/navbar.tpl similarity index 83% rename from phpgwapi/templates/default/navbar.tpl rename to phpgwapi/templates/idots/navbar.tpl index ad8b3c6a17..3e0cde3888 100644 --- a/phpgwapi/templates/default/navbar.tpl +++ b/phpgwapi/templates/idots/navbar.tpl @@ -2,15 +2,10 @@
- - -