From 02097e2a6cbd4191438781890d484326aa60af19 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 17 Apr 2011 09:09:10 +0200 Subject: attach textChanged property to window attempt to fix FS#2196 --- lib/scripts/edit.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/scripts') diff --git a/lib/scripts/edit.js b/lib/scripts/edit.js index 45c1fb111..eaa3030e9 100644 --- a/lib/scripts/edit.js +++ b/lib/scripts/edit.js @@ -261,7 +261,7 @@ function currentHeadlineLevel(textboxId){ /** * global var used for not saved yet warning */ -var textChanged = false; +window.textChanged = false; /** * Delete the draft before leaving the page @@ -305,14 +305,14 @@ addInitEvent(function (){ } var checkfunc = function(){ - textChanged = true; //global var + window.textChanged = true; //global var summaryCheck(); }; addEvent(editform, 'change', checkfunc); addEvent(editform, 'keydown', checkfunc); window.onbeforeunload = function(){ - if(textChanged) { + if(window.textChanged) { return LANG.notsavedyet; } }; @@ -320,17 +320,17 @@ addInitEvent(function (){ // reset change memory var on submit addEvent($('edbtn__save'), 'click', function(){ - textChanged = false; + window.textChanged = false; }); addEvent($('edbtn__preview'), 'click', function(){ - textChanged = false; + window.textChanged = false; window.keepDraft = true; // needed to keep draft on page unload }); var summary = $('edit__summary'); addEvent(summary, 'change', summaryCheck); addEvent(summary, 'keyup', summaryCheck); - if (textChanged) summaryCheck(); + if (window.textChanged) summaryCheck(); }); /** -- cgit v1.2.3 From 7d643c17962849f1c9953b0936b37e8d2175a9d6 Mon Sep 17 00:00:00 2001 From: Guy Brand Date: Sun, 17 Apr 2011 16:04:10 +0200 Subject: Trap onbeforeunload when event fired (attempt to fix FS#2196) --- lib/scripts/edit.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/scripts') diff --git a/lib/scripts/edit.js b/lib/scripts/edit.js index eaa3030e9..e8a59deb9 100644 --- a/lib/scripts/edit.js +++ b/lib/scripts/edit.js @@ -320,9 +320,11 @@ addInitEvent(function (){ // reset change memory var on submit addEvent($('edbtn__save'), 'click', function(){ + window.onbeforeunload = ''; window.textChanged = false; }); addEvent($('edbtn__preview'), 'click', function(){ + window.onbeforeunload = ''; window.textChanged = false; window.keepDraft = true; // needed to keep draft on page unload }); -- cgit v1.2.3 From 342e58c8c048bfd5f57f10bd88cee95aa2732e96 Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Sun, 17 Apr 2011 22:39:21 +0200 Subject: correctly disable unfinished media options popup We disabled the media options shortly before the last release because of an unfixed bug. The disabling was not complete which caused problems with templates not incorporating the needed CSS. Since the option dialog hasn't been fixed yet, this patch also disables the creation of the corresponding HTML to avoid the mentioned template problems. --- lib/scripts/media.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/scripts') diff --git a/lib/scripts/media.js b/lib/scripts/media.js index 57f599163..530e93055 100644 --- a/lib/scripts/media.js +++ b/lib/scripts/media.js @@ -774,6 +774,6 @@ addInitEvent(function(){ media_manager.selectorattach($('media__content')); media_manager.confirmattach($('media__content')); media_manager.attachoptions($('media__opts')); - media_manager.initpopup(); + //media_manager.initpopup(); media_manager.initFlashUpload(); }); -- cgit v1.2.3