diff options
author | Andreas Gohr <gohr@cosmocode.de> | 2009-08-12 21:40:07 +0200 |
---|---|---|
committer | Andreas Gohr <gohr@cosmocode.de> | 2009-08-12 21:40:07 +0200 |
commit | 6392c3b6beffdef6383fc01859567a0e1f8a3f4e (patch) | |
tree | 18dc06e63822dceb233d103914551292790a147b /lib/scripts | |
parent | 0071aa2162e87ac729531c1c625d9bfb31f2adec (diff) | |
download | rpg-6392c3b6beffdef6383fc01859567a0e1f8a3f4e.tar.gz rpg-6392c3b6beffdef6383fc01859567a0e1f8a3f4e.tar.bz2 |
simplify JavaScript loading
Ignore-this: 7637977e042ed8ba7e9e9097f9e9f03f
This patch removes the differences between the JavaScript loaded in
edit and view modes.
* increases the amount of JavaScript that is loaded initially
* decreases the number of requests
* only one cache for all javascript
* all javascript is available in view mode
The last point is the most important as it makes a lot of functionality
available to plugins working in the view mode. The discussion plugin
now can reuse the toolbar code for example.
Note: development is part of ICKE 2.0 project
http://www.icke-projekt.de
darcs-hash:20090812194007-6e07b-c8a71dedf506065a95d8b84b55aafce67810236c.gz
Diffstat (limited to 'lib/scripts')
-rw-r--r-- | lib/scripts/edit.js | 7 | ||||
-rw-r--r-- | lib/scripts/script.js | 3 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/scripts/edit.js b/lib/scripts/edit.js index 5320c9419..215e647b5 100644 --- a/lib/scripts/edit.js +++ b/lib/scripts/edit.js @@ -341,9 +341,13 @@ function changeCheck(msg){ * JSnocheck class), add handlers to monitor changes * * Sets focus to the editbox as well + * + * @fixme this is old and crappy code. needs to be redone */ function initChangeCheck(msg){ - if(!document.getElementById){ return false; } + var edit_text = document.getElementById('wiki__text'); + if(!edit_text) return; + // add change check for links var links = document.getElementsByTagName('a'); for(var i=0; i < links.length; i++){ @@ -374,7 +378,6 @@ function initChangeCheck(msg){ btn_prev.onclick = function(){ textChanged = false; }; // add change memory setter - var edit_text = document.getElementById('wiki__text'); edit_text.onchange = function(){ textChanged = true; //global var summaryCheck(); diff --git a/lib/scripts/script.js b/lib/scripts/script.js index be3339525..948375a64 100644 --- a/lib/scripts/script.js +++ b/lib/scripts/script.js @@ -17,9 +17,6 @@ if (clientPC.indexOf('opera')!=-1) { var is_opera_seven = (window.opera && document.childNodes); } -// prepare empty toolbar for checks by lazy plugins -var toolbar = ''; - /** * Handy shortcut to document.getElementById * |