New: Update ckeditor to version 4 (part 1)

This commit is contained in:
Laurent Destailleur
2014-03-08 12:11:01 +01:00
parent 32c81588b0
commit c65d681d87
4418 changed files with 147049 additions and 127332 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 668 B

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'ca', {
button: 'Definir l\'idioma',
remove: 'Eliminar idioma'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'cs', {
button: 'Nastavit jazyk',
remove: 'Odstranit jazyk'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'cy', {
button: 'Gosod iaith',
remove: 'Tynnu iaith'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'el', {
button: 'Θέση γλώσσας',
remove: 'Αφαίρεση γλώσσας'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'en-gb', {
button: 'Set language',
remove: 'Remove language'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'en', {
button: 'Set language',
remove: 'Remove language'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'es', {
button: 'Fijar lenguaje',
remove: 'Quitar lenguaje'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'fa', {
button: 'تنظیم زبان',
remove: 'حذف زبان'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'fi', {
button: 'Aseta kieli',
remove: 'Poista kieli'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'fr', {
button: 'Définir la langue',
remove: 'Supprimer la langue'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'gl', {
button: 'Estabelezer o idioma',
remove: 'Retirar o idioma'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'hu', {
button: 'Nyelv beállítása',
remove: 'Nyelv eltávolítása'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'ja', {
button: '言語を設定',
remove: '言語を削除'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'km', {
button: 'កំណត់​ភាសា',
remove: 'លុប​ភាសា'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'nb', {
button: 'Sett språk',
remove: 'Fjern språk'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'nl', {
button: 'Taal instellen',
remove: 'Taal verwijderen'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'no', {
button: 'Sett språk',
remove: 'Fjern språk'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'pl', {
button: 'Ustaw język',
remove: 'Usuń język'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'pt-br', {
button: 'Configure o Idioma',
remove: 'Remover Idioma'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'pt', {
button: 'botão',
remove: 'remover'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'ru', {
button: 'Установка языка',
remove: 'Удалить язык'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'sl', {
button: 'Nastavi jezik',
remove: 'Odstrani jezik'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'sv', {
button: 'Sätt språk',
remove: 'Ta bort språk'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'uk', {
button: 'Установити мову',
remove: 'Вилучити мову'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'zh-cn', {
button: '设置语言',
remove: '移除语言'
} );

View File

@@ -0,0 +1,9 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'language', 'zh', {
button: '設定語言',
remove: '移除語言'
} );

View File

@@ -0,0 +1,166 @@
/**
* @license Copyright (c) 2003-2014, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
/**
* @fileOverview [Language](http://ckeditor.com/addon/language) plugin.
*/
'use strict';
( function() {
var allowedContent = 'span[!lang,!dir]',
requiredContent = 'span[lang,dir]';
CKEDITOR.plugins.add( 'language', {
requires: 'menubutton',
lang: 'ca,cs,cy,el,en,en-gb,es,fa,fi,fr,gl,hu,ja,km,nb,nl,no,pl,pt,pt-br,ru,sl,sv,uk,zh,zh-cn', // %REMOVE_LINE_CORE%
icons: 'language', // %REMOVE_LINE_CORE%
hidpi: true, // %REMOVE_LINE_CORE%
init: function( editor ) {
var languagesConfigStrings = ( editor.config.language_list || [ 'ar:Arabic:rtl', 'fr:French', 'es:Spanish' ] ),
plugin = this,
lang = editor.lang.language,
items = {},
parts,
curLanguageId, // 2-letter language identifier.
languageButtonId, // Will store button namespaced identifier, like "language_en".
i;
// Registers command.
editor.addCommand( 'language', {
allowedContent: allowedContent,
requiredContent: requiredContent,
contextSensitive: true,
exec: function( editor, languageId ) {
var item = items[ 'language_' + languageId ];
if ( item )
editor[ item.style.checkActive( editor.elementPath() ) ? 'removeStyle' : 'applyStyle' ]( item.style );
},
refresh: function( editor, path ) {
this.setState( plugin.getCurrentLangElement( editor ) ?
CKEDITOR.TRISTATE_ON : CKEDITOR.TRISTATE_OFF );
}
} );
// Parse languagesConfigStrings, and create items entry for each lang.
for ( i = 0; i < languagesConfigStrings.length; i++ ) {
parts = languagesConfigStrings[ i ].split( ':' );
curLanguageId = parts[ 0 ];
languageButtonId = 'language_' + curLanguageId;
items[ languageButtonId ] = {
label: parts[ 1 ],
langId: curLanguageId,
group: 'language',
order: i,
// Tells if this language is left-to-right oriented (default: true).
ltr: ( '' + parts[ 2 ] ).toLowerCase() != 'rtl',
onClick: function() {
editor.execCommand( 'language', this.langId );
},
role: 'menuitemcheckbox'
};
// Init style property.
items[ languageButtonId ].style = new CKEDITOR.style( {
element: 'span',
attributes: {
lang: curLanguageId,
dir: items[ languageButtonId ].ltr ? 'ltr' : 'rtl'
}
} );
}
// Remove language indicator button.
items.language_remove = {
label: lang.remove,
group: 'language_remove',
state: CKEDITOR.TRISTATE_DISABLED,
order: items.length,
onClick: function() {
var currentLanguagedElement = plugin.getCurrentLangElement( editor );
if ( currentLanguagedElement )
editor.execCommand( 'language', currentLanguagedElement.getAttribute( 'lang' ) );
}
};
// Initialize groups for menu.
editor.addMenuGroup( 'language', 1 );
editor.addMenuGroup( 'language_remove' ); // Group order is skipped intentionally, it will be placed at the end.
editor.addMenuItems( items );
editor.ui.add( 'Language', CKEDITOR.UI_MENUBUTTON, {
label: lang.button,
// MenuButtons do not (yet) has toFeature method, so we cannot do this:
// toFeature: function( editor ) { return editor.getCommand( 'language' ); }
// Set feature's properties directly on button.
allowedContent: allowedContent,
requiredContent: requiredContent,
toolbar: 'bidi,30',
command: 'language',
onMenu: function() {
var activeItems = {},
currentLanguagedElement = plugin.getCurrentLangElement( editor );
for ( var prop in items )
activeItems[ prop ] = CKEDITOR.TRISTATE_OFF;
activeItems.language_remove = currentLanguagedElement ? CKEDITOR.TRISTATE_OFF : CKEDITOR.TRISTATE_DISABLED;
if ( currentLanguagedElement )
activeItems[ 'language_' + currentLanguagedElement.getAttribute( 'lang' ) ] = CKEDITOR.TRISTATE_ON;
return activeItems;
}
} );
},
// Gets the first language element for the current editor selection.
// @param {CKEDITOR.editor} editor
// @returns {CKEDITOR.dom.element} The language element, if any.
getCurrentLangElement: function( editor ) {
var elementPath = editor.elementPath(),
activePath = elementPath && elementPath.elements,
pathMember, ret;
// IE8: upon initialization if there is no path elementPath() returns null.
if ( elementPath ) {
for ( var i = 0; i < activePath.length; i++ ) {
pathMember = activePath[ i ];
if ( !ret && pathMember.getName() == 'span' && pathMember.hasAttribute( 'dir' ) && pathMember.hasAttribute( 'lang' ) )
ret = pathMember;
}
}
return ret;
}
} );
} )();
/**
* Specifies the list of languages available in the
* [Language](http://ckeditor.com/addon/language) plugin. Each entry
* should be a string in the following format:
*
* <languageCode>:<languageLabel>[:<textDirection>]
*
* * _languageCode_: The language code used for the `lang` attribute in ISO 639 format.
* Language codes can be found [here](http://www.loc.gov/standards/iso639-2/php/English_list.php).
* You can use both 2-letter ISO-639-1 codes and 3-letter ISO-639-2 codes, though
* for consistency it is recommended to stick to ISO-639-1 2-letter codes.
* * _languageLabel_: The label to show for this language in the list.
* * _textDirection_: (optional) One of the following values: `rtl` or `ltr`,
* indicating the reading direction of the language. Defaults to `ltr`.
*
* config.language_list = [ 'he:Hebrew:rtl', 'pt:Portuguese', 'de:German' ];
*
* @cfg {Array} [language_list = [ 'ar:Arabic:rtl', 'fr:French', 'es:Spanish' ]]
* @member CKEDITOR.config
*/