( function() {
var saveCmd = {
readOnly: 1,
exec: function( editor ) {
if ( editor.fire( 'save' ) ) {
var $form = editor.element.$.form;
if ( $form ) {
try {
$form.submit();
} catch ( e ) {
// If there's a button named "submit" then the form.submit
// function is masked and can't be called in IE/FF, so we
// call the click() method of that button.
if ( $form.submit.click )
$form.submit.click();
}
}
}
}
};
// Register a plugin named "allowsave".
CKEDITOR.plugins.add( 'allowsave', {
lang: 'de', // %REMOVE_LINE_CORE%
icons: 'save', // %REMOVE_LINE_CORE%
hidpi: true, // %REMOVE_LINE_CORE%
init: function( editor ) {
var command = editor.addCommand( 'save', saveCmd );
command.modes = { wysiwyg: 1, source: 1 };
editor.ui.addButton && editor.ui.addButton( 'Save', {
label: editor.lang.allowsave.toolbar,
command: 'save',
toolbar: 'document,10'
} );
}
} );
} )();