mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merged from branches/2.3
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@77032 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
161e7a35c7
commit
2fc1771f93
@ -244,6 +244,7 @@ class HtmlEditorConfig {
|
||||
return "
|
||||
if((typeof tinyMCE != 'undefined')) {
|
||||
tinyMCE.init(" . Convert::raw2json($config) . ");
|
||||
}";
|
||||
}
|
||||
";
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,16 @@
|
||||
class HtmlEditorField extends TextareaField {
|
||||
protected $rows;
|
||||
|
||||
/**
|
||||
* Includes the javascript neccesary for this field to work in the current output.
|
||||
* NOTE: If you are loading a form that includes an HtmlEditorField via Ajax this function must be called in the requesting page, because
|
||||
* javascript is not sent via ajax
|
||||
*/
|
||||
static function include_js() {
|
||||
Requirements::javascript(MCE_ROOT . "tiny_mce_src.js");
|
||||
Requirements::customScript(HtmlEditorConfig::get_active()->generateJS(), 'htmlEditorConfig');
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a new HtmlEditor field
|
||||
*/
|
||||
@ -24,8 +34,8 @@ class HtmlEditorField extends TextareaField {
|
||||
* Returns the a <textarea> field with tinymce="true" set on it
|
||||
*/
|
||||
function Field() {
|
||||
Requirements::javascript(MCE_ROOT . "tiny_mce_src.js");
|
||||
Requirements::customScript(HtmlEditorConfig::get_active()->generateJS(), 'htmlEditorConfig');
|
||||
// Make sure the nessecary javascript is included
|
||||
self::include_js();
|
||||
|
||||
// Don't allow unclosed tags - they will break the whole application ;-)
|
||||
$cleanVal = $this->value;
|
||||
|
Loading…
Reference in New Issue
Block a user