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
This commit is contained in:
Ingo Schommer 2009-11-21 03:14:40 +00:00
parent ffb6790fe6
commit 5e4fa55472
2 changed files with 20 additions and 16 deletions

View File

@ -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));

View File

@ -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}));
}
}
}
});
}