Archived
slight changes to enable wysiwyg editor textareas
This commit is contained in:
@@ -235,6 +235,7 @@
|
|||||||
return;
|
return;
|
||||||
} else if (typeof(CKEDITOR) != 'undefined') {
|
} else if (typeof(CKEDITOR) != 'undefined') {
|
||||||
oEditor = (typeof(isinstance) == 'undefined') ? CKEDITOR.instances[textarea] : isinstance;
|
oEditor = (typeof(isinstance) == 'undefined') ? CKEDITOR.instances[textarea] : isinstance;
|
||||||
|
if (typeof(oEditor) == 'undefined') oEditor = popupEditorInstance;
|
||||||
if (oEditor.mode == "wysiwyg") {
|
if (oEditor.mode == "wysiwyg") {
|
||||||
oEditor.insertHtml(str);
|
oEditor.insertHtml(str);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -23,7 +23,8 @@
|
|||||||
CKEDITOR.plugins.add('{$button.id}', {
|
CKEDITOR.plugins.add('{$button.id}', {
|
||||||
init: function( editor ) {
|
init: function( editor ) {
|
||||||
editor.addCommand( '{$button.name}', {
|
editor.addCommand( '{$button.name}', {
|
||||||
exec : {$button.javascript}
|
popupEditorInstance = editor;
|
||||||
|
( {$button.javascript} () )
|
||||||
});
|
});
|
||||||
editor.ui.addButton('{$button.id}', {
|
editor.ui.addButton('{$button.id}', {
|
||||||
label: '{$button.name}',
|
label: '{$button.name}',
|
||||||
@@ -36,16 +37,17 @@
|
|||||||
{/foreach}
|
{/foreach}
|
||||||
|
|
||||||
|
|
||||||
CKEDITOR.replace($('#'+serendipity.escapeBrackets('{$item}')).get(0), {
|
ckeitem = '{$item}';
|
||||||
customConfig : '{$serendipityHTTPPath}htmlarea/ckeditor/ckeditor_custom_config.js',
|
CKEDITOR.replace($('#'+serendipity.escapeBrackets(ckeitem)).get(0), {
|
||||||
extraPlugins : 's9y_medialibrary{$item}{foreach $buttons as $button},{$button.id}{/foreach}',
|
customConfig : '{$serendipityHTTPPath}htmlarea/ckeditor_custom_config.js',
|
||||||
|
extraPlugins : 'mediaembed,procurator,cheatsheet,s9y_medialibrary{$item}{foreach $buttons as $button},{$button.id}{/foreach}',
|
||||||
|
|
||||||
on: {
|
on: {
|
||||||
instanceReady: function( evt ) {
|
instanceReady: function( evt ) {
|
||||||
CKEDITOR.instances["{$item}"].document.once('keyup', function() {
|
CKEDITOR.instances[ckeitem].document.once('keyup', function() {
|
||||||
setInterval(function() {
|
setInterval(function() {
|
||||||
console.log("save");
|
console.log("save");
|
||||||
serendipity.cache("{$item}", CKEDITOR.instances["{$item}"].getData());
|
serendipity.cache(ckeitem, CKEDITOR.instances[ckeitem].getData());
|
||||||
}, 5000)
|
}, 5000)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user