diff -r 74e03196fd43 -r e45183014778 includes/template.php --- a/includes/template.php Sat Jul 19 21:14:54 2008 -0400 +++ b/includes/template.php Sun Jul 20 13:32:04 2008 -0400 @@ -56,8 +56,8 @@ $this->plugin_blocks = Array(); $this->theme_loaded = false; - $this->fading_button = '
-  + $this->fading_button = '
+
'; $this->theme_list = Array(); @@ -986,6 +986,54 @@ eval($cmd); } + // Set up javascript includes + // these depend heavily on whether we have a CDN to work with or not + if ( getConfig('cdn_path') ) + { + // we're on a CDN, point to static includes + // probably should have a way to compress stuff like this before uploading to CDN + $js_head = ''; + $js_foot = << + // This initializes the Javascript runtime when the DOM is ready - not when the page is + // done loading, because enano-lib-basic still has to load some 15 other script files + // check for the init function - this is a KHTML fix + // This doesn't seem to work properly in IE in 1.1.x - there are some problems with + // tinyMCE and l10n. + if ( typeof ( enano_init ) == 'function' && !IE ) + { + enano_init(); + window.onload = function(e) { }; + } + +JSEOF; + } + else + { + $cdnpath = cdnPath; + // point to jsres compressor + $js_head = << + +JSEOF; + $js_foot = << + + +JSEOF; + } + // Some additional sidebar processing if ( $this->sidebar_extra != '' ) { @@ -1077,8 +1125,9 @@ var title = \''. $urlname_jssafe .'\'; var physical_title = \'' . $physical_urlname_jssafe . '\'; var page_exists = '. ( ( $local_page_exists) ? 'true' : 'false' ) .'; - var scriptPath = \''. scriptPath .'\'; - var contentPath = \''.contentPath.'\'; + var scriptPath = \'' . addslashes(scriptPath) . '\'; + var contentPath = \'' . addslashes(contentPath) . '\'; + var cdnPath = \'' . addslashes(cdnPath) . '\'; var ENANO_SID = \'' . $SID . '\'; var user_level = ' . $session->user_level . '; var auth_level = ' . $session->auth_level . '; @@ -1128,6 +1177,7 @@ 'TOOLBAR'=>$tb, 'SCRIPTPATH'=>scriptPath, 'CONTENTPATH'=>contentPath, + 'CDNPATH' => cdnPath, 'ADMIN_SID_QUES'=>$asq, 'ADMIN_SID_AMP'=>$asa, 'ADMIN_SID_AMP_HTML'=>$ash, @@ -1147,6 +1197,8 @@ 'TEMPLATE_DIR'=>scriptPath.'/themes/'.$this->theme, 'THEME_ID'=>$this->theme, 'STYLE_ID'=>$this->style, + 'JS_HEADER' => $js_head, + 'JS_FOOTER' => $js_foot, 'JS_DYNAMIC_VARS'=>$js_dynamic, 'UNREAD_PMS'=>$session->unread_pms, 'URL_ABOUT_ENANO' => makeUrlNS('Special', 'About_Enano', '', true), @@ -2444,8 +2496,8 @@ $this->toolbar_menu = ''; $this->additional_headers = ''; - $this->fading_button = '
-  + $this->fading_button = '
+
'; // get list of themes