]>
git.immae.eu Git - perso/Immae/Projets/packagist/connexionswing-ckeditor-component.git/blob - sources/plugins/save/plugin.js
54ac3acdad2698a8c8a9e12a8edc4a005cc653a4
2 * @license Copyright (c) 2003-2015, CKSource - Frederico Knabben. All rights reserved.
3 * For licensing, see LICENSE.md or http://ckeditor.com/license
7 * @fileOverview The Save plugin.
14 exec: function( editor
) {
15 if ( editor
.fire( 'save' ) ) {
16 var $form
= editor
.element
.$.form
;
22 // If there's a button named "submit" then the form.submit
23 // function is masked and can't be called in IE/FF, so we
24 // call the click() method of that button.
25 if ( $form
.submit
.click
)
33 var pluginName
= 'save';
35 // Register a plugin named "save".
36 CKEDITOR
.plugins
.add( pluginName
, {
37 // jscs:disable maximumLineLength
38 lang: 'af,ar,bg,bn,bs,ca,cs,cy,da,de,el,en,en-au,en-ca,en-gb,eo,es,et,eu,fa,fi,fo,fr,fr-ca,gl,gu,he,hi,hr,hu,id,is,it,ja,ka,km,ko,ku,lt,lv,mk,mn,ms,nb,nl,no,pl,pt,pt-br,ro,ru,si,sk,sl,sq,sr,sr-latn,sv,th,tr,tt,ug,uk,vi,zh,zh-cn', // %REMOVE_LINE_CORE%
39 // jscs:enable maximumLineLength
40 icons: 'save', // %REMOVE_LINE_CORE%
41 hidpi: true, // %REMOVE_LINE_CORE%
42 init: function( editor
) {
43 // Save plugin is for replace mode only.
44 if ( editor
.elementMode
!= CKEDITOR
.ELEMENT_MODE_REPLACE
)
47 var command
= editor
.addCommand( pluginName
, saveCmd
);
48 command
.modes
= { wysiwyg: !!( editor
.element
.$.form
) };
50 editor
.ui
.addButton
&& editor
.ui
.addButton( 'Save', {
51 label: editor
.lang
.save
.toolbar
,
53 toolbar: 'document,10'
60 * Fired when the user clicks the Save button on the editor toolbar.
61 * This event allows to overwrite the default Save button behavior.
65 * @member CKEDITOR.editor
66 * @param {CKEDITOR.editor} editor This editor instance.