From 5e4fa55472e318fb79be5af9ec0cdb8ed957bb89 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Sat, 21 Nov 2009 03:14:40 +0000 Subject: [PATCH] MINOR Moved tinymce initialization from LeftAndMain.js to LeftAndMain.EditForm.js and converted to use concrete git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92698 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- javascript/LeftAndMain.EditForm.js | 19 +++++++++++++++++++ javascript/LeftAndMain.js | 17 +---------------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/javascript/LeftAndMain.EditForm.js b/javascript/LeftAndMain.EditForm.js index c4612dda..37b0782e 100644 --- a/javascript/LeftAndMain.EditForm.js +++ b/javascript/LeftAndMain.EditForm.js @@ -307,4 +307,23 @@ } }; }); + + /** + * @class Add tinymce to HtmlEditorFields within the CMS. + * @name ss.Form_EditForm.textarea.htmleditor + */ + $('#Form_EditForm textarea.htmleditor').concrete('ss', function($){ + return/** @lends ss.Form_EditForm.Actions.submit */{ + onmatch : function() { + tinyMCE.execCommand("mceAddControl", true, this.attr('id')); + this.isChanged = function() { + return tinyMCE.getInstanceById(this.attr('id')).isDirty(); + } + this.resetChanged = function() { + var inst = tinyMCE.getInstanceById(this.attr('id')); + if (inst) inst.startContent = tinymce.trim(inst.getContent({format : 'raw', no_events : 1})); + } + } + }; + }); }(jQuery)); \ No newline at end of file diff --git a/javascript/LeftAndMain.js b/javascript/LeftAndMain.js index cd27cdce..5ea87535 100644 --- a/javascript/LeftAndMain.js +++ b/javascript/LeftAndMain.js @@ -306,19 +306,4 @@ returnFalse = function() { function nullConverter(url) { return url; -} - -Behaviour.register({ - 'textarea.htmleditor' : { - initialize : function() { - tinyMCE.execCommand("mceAddControl", true, this.id); - this.isChanged = function() { - return tinyMCE.getInstanceById(this.id).isDirty(); - } - this.resetChanged = function() { - inst = tinyMCE.getInstanceById(this.id); - if (inst) inst.startContent = tinymce.trim(inst.getContent({format : 'raw', no_events : 1})); - } - } - } -}); +} \ No newline at end of file