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