summaryrefslogtreecommitdiff
path: root/lib/scripts/edit.js
diff options
context:
space:
mode:
authorAndreas Gohr <gohr@cosmocode.de>2009-08-12 21:40:07 +0200
committerAndreas Gohr <gohr@cosmocode.de>2009-08-12 21:40:07 +0200
commit6392c3b6beffdef6383fc01859567a0e1f8a3f4e (patch)
tree18dc06e63822dceb233d103914551292790a147b /lib/scripts/edit.js
parent0071aa2162e87ac729531c1c625d9bfb31f2adec (diff)
downloadrpg-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/edit.js')
-rw-r--r--lib/scripts/edit.js7
1 files changed, 5 insertions, 2 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();