# HG changeset patch # User Dan # Date 1247358350 14400 # Node ID bdbb49cf6f1b0834bfdc916921988f7edd6d852c # Parent 374d08d176cbd38c7fad1defa0e0ed6fe76fd19d One word: Internet Explorer 6. This includes a rewrite of $paths->parseAdminTree() that encodes to JSON instead of manually generating JS, so good-bye to stupid parser problems I hope. diff -r 374d08d176cb -r bdbb49cf6f1b includes/clientside/jsres.php --- a/includes/clientside/jsres.php Sat Jul 11 20:24:19 2009 -0400 +++ b/includes/clientside/jsres.php Sat Jul 11 20:25:50 2009 -0400 @@ -197,7 +197,7 @@ $file_contents = file_get_contents("includes/clientside/static/$js_file"); $everything .= jsres_cache_check($js_file, $file_contents) . ' loaded_components[\'' . $js_file . '\'] = true;'; } - $everything .= 'if ( onload_complete ) { console.debug("running hooks from jsres"); runOnloadHooks(); onload_hooks = []; };'; + $everything .= 'if ( onload_complete ) { runOnloadHooks(); onload_hooks = []; };'; } else { @@ -210,7 +210,7 @@ $apex = filemtime("includes/clientside/static/$js_file"); $file_contents = file_get_contents("includes/clientside/static/$js_file"); - $everything = jsres_cache_check($js_file, $file_contents) . ' loaded_components[\'' . $js_file . '\'] = true; if ( onload_complete ) { console.debug("running hooks from jsres"); runOnloadHooks(); onload_hooks = []; };'; + $everything = jsres_cache_check($js_file, $file_contents) . ' loaded_components[\'' . $js_file . '\'] = true; if ( onload_complete ) { runOnloadHooks(); onload_hooks = []; };'; } } else diff -r 374d08d176cb -r bdbb49cf6f1b includes/clientside/static/ajax.js --- a/includes/clientside/static/ajax.js Sat Jul 11 20:24:19 2009 -0400 +++ b/includes/clientside/static/ajax.js Sat Jul 11 20:25:50 2009 -0400 @@ -1658,7 +1658,7 @@ text: $lang.get('acppl_btn_install'), color: 'red', style: { - fontWeight: 'bold', + fontWeight: 'bold' }, onclick: function() { ajaxPluginAction(action + '_confirm', plugin_filename, btnobj, true); diff -r 374d08d176cb -r bdbb49cf6f1b includes/clientside/static/autofill.js --- a/includes/clientside/static/autofill.js Sat Jul 11 20:24:19 2009 -0400 +++ b/includes/clientside/static/autofill.js Sat Jul 11 20:25:50 2009 -0400 @@ -38,7 +38,7 @@ }, tableHeader: '' + $lang.get('user_autofill_heading_suggestions') + '', showWhenNoResults: true, - noResultsHTML: '' + $lang.get('user_autofill_msg_no_suggestions') + '', + noResultsHTML: '' + $lang.get('user_autofill_msg_no_suggestions') + '' }); } } @@ -55,7 +55,7 @@ return html; }, showWhenNoResults: true, - noResultsHTML: '' + $lang.get('user_autofill_msg_no_suggestions') + '', + noResultsHTML: '' + $lang.get('user_autofill_msg_no_suggestions') + '' }); } } @@ -491,7 +491,12 @@ if ( options.tableHeader ) { - ul.innerHTML = options.tableHeader; + // fails in IE6 + try + { + ul.innerHTML = options.tableHeader; + } + catch ( e ) {}; } if ( num == 0 ) diff -r 374d08d176cb -r bdbb49cf6f1b includes/clientside/static/fadefilter.js --- a/includes/clientside/static/fadefilter.js Sat Jul 11 20:24:19 2009 -0400 +++ b/includes/clientside/static/fadefilter.js Sat Jul 11 20:25:50 2009 -0400 @@ -71,7 +71,7 @@ thediv.style.filter = 'alpha(opacity=0)'; thediv.style.backgroundColor = '#000000'; thediv.style.width = '100%'; - thediv.style.height = '100%'; + thediv.style.height = IE ? h + 'px' : '100%'; thediv.style.zIndex = getHighestZ() + 1; thediv.id = layerid; thediv.myOpacVal = opacVal; diff -r 374d08d176cb -r bdbb49cf6f1b includes/clientside/static/functions.js --- a/includes/clientside/static/functions.js Sat Jul 11 20:24:19 2009 -0400 +++ b/includes/clientside/static/functions.js Sat Jul 11 20:25:50 2009 -0400 @@ -940,7 +940,7 @@ // Included only for API-compatibility function ajaxPromptAdminAuth(call_on_ok, level) { - ajaxLogonInit(call_on_ok, level); + ajaxLoginInit(call_on_ok, level); } /** diff -r 374d08d176cb -r bdbb49cf6f1b includes/clientside/static/tinymce-init.js --- a/includes/clientside/static/tinymce-init.js Sat Jul 11 20:24:19 2009 -0400 +++ b/includes/clientside/static/tinymce-init.js Sat Jul 11 20:25:50 2009 -0400 @@ -47,7 +47,7 @@ theme_advanced_statusbar_location : 'bottom', noneditable_noneditable_class : 'mce_readonly', content_css : css_url, - spellchecker_rpc_url : scriptPath + '/includes/clientside/tinymce/plugins/spellchecker/rpc.php', + spellchecker_rpc_url : scriptPath + '/includes/clientside/tinymce/plugins/spellchecker/rpc.php' }; var enano_tinymce_gz_options = { diff -r 374d08d176cb -r bdbb49cf6f1b includes/paths.php --- a/includes/paths.php Sat Jul 11 20:24:19 2009 -0400 +++ b/includes/paths.php Sat Jul 11 20:25:50 2009 -0400 @@ -491,14 +491,20 @@ $i = 0; $ret = ''; $icon = $this->make_sprite_icon(4, 2); - $icon = addslashes($icon); - $ret .= "var TREE_ITEMS = [\n ['$icon" . $lang->get('adm_btn_home') . "', 'javascript:ajaxPage(\'".$this->nslist['Admin']."Home\');',\n "; + $ret .= "var TREE_ITEMS = "; + $tree = array( + array($icon . $lang->get('adm_btn_home'), "javascript:ajaxPage('{$this->nslist['Admin']}Home');") + ); + + $root =& $tree[0]; + foreach($k as $key) { $i++; $name = $lang->get($key); - $ret .= "['".$name."', 'javascript:trees[0].toggle($i)', \n"; - foreach($this->admin_tree[$key] as $c) + $group = array($name, "javascript:trees[0].toggle($i)"); + + foreach($this->admin_tree[$key] as $nodeid => $c) { $i++; $name = $lang->get($c['name']); @@ -519,20 +525,29 @@ { $icon = ''; } - $icon = addslashes($icon); - $ret .= " ['$icon$name', 'javascript:ajaxPage(\\'".$this->nslist['Admin'].$c['pageid']."\\');'],\n"; + $group[] = array("$icon$name", "javascript:ajaxPage('{$this->nslist['Admin']}{$c['pageid']}');"); } - $ret .= " ],\n"; + + $root[] = $group; } $icon = $this->make_sprite_icon(1, 1); - $icon = addslashes($icon); - $ret .= " ['$icon" . $lang->get('adm_btn_logout') . "', 'javascript:ajaxPage(\\'".$this->nslist['Admin']."AdminLogout\\');'],\n"; - $ret .= " ['" . $lang->get('adm_btn_keepalive_loading') . "', 'javascript:ajaxToggleKeepalive();', - ['" . $lang->get('adm_btn_keepalive_about') . "', 'javascript:aboutKeepAlive();'] - ],\n"; + $root[] = array( + $icon . $lang->get('adm_btn_logout'), + "javascript:ajaxPage('{$this->nslist['Admin']}AdminLogout');" + ); + $root[] = array( + "" . $lang->get('adm_btn_keepalive_loading') . "", + "javascript:ajaxToggleKeepalive();", + array( + $lang->get('adm_btn_keepalive_about'), + "javascript:aboutKeepAlive();" + ) + ); + + $ret .= enano_json_encode($tree) . ';'; + // I used this while I painstakingly wrote the Runt code that auto-expands certain nodes based on the value of a bitfield stored in a cookie. *shudders* // $ret .= " ['(debug) Clear menu bitfield', 'javascript:createCookie(\\'admin_menu_state\\', \\'1\\', 365);'],\n"; - $ret .= "]\n];"; return $ret; } diff -r 374d08d176cb -r bdbb49cf6f1b includes/template.php --- a/includes/template.php Sat Jul 11 20:24:19 2009 -0400 +++ b/includes/template.php Sat Jul 11 20:25:50 2009 -0400 @@ -479,45 +479,6 @@ global $lang; global $email; - // IE PNG fixing code - if ( isset($_SERVER['HTTP_USER_AGENT']) && strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE') ) - { - $this->add_header(' - - '); - } - $is_opera = (isset($_SERVER['HTTP_USER_AGENT']) && strstr($_SERVER['HTTP_USER_AGENT'], 'Opera')) ? true : false; $is_msie = (isset($_SERVER['HTTP_USER_AGENT']) && strstr($_SERVER['HTTP_USER_AGENT'], 'MSIE')) ? true : false;