X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=_source%2Fplugins%2Fspecialchar%2Fplugin.js;h=d474e73382bd2645eb175b788727dd1b51842987;hb=9afde8772159bd3436f1f5b7862960307710ae5a;hp=e6b02a7f3dd006aa0d405ffc583725b4f4264920;hpb=941b0a9ba4e673e292510d80a5a86806994b8ea6;p=ckeditor.git diff --git a/_source/plugins/specialchar/plugin.js b/_source/plugins/specialchar/plugin.js index e6b02a7..d474e73 100644 --- a/_source/plugins/specialchar/plugin.js +++ b/_source/plugins/specialchar/plugin.js @@ -9,15 +9,35 @@ For licensing, see LICENSE.html or http://ckeditor.com/license CKEDITOR.plugins.add( 'specialchar', { + // List of available localizations. + availableLangs : { en:1 }, + init : function( editor ) { - var pluginName = 'specialchar'; + var pluginName = 'specialchar', + plugin = this; // Register the dialog. CKEDITOR.dialog.add( pluginName, this.path + 'dialogs/specialchar.js' ); - // Register the command. - editor.addCommand( pluginName, new CKEDITOR.dialogCommand( pluginName ) ); + editor.addCommand( pluginName, + { + exec : function() + { + var langCode = editor.langCode; + langCode = plugin.availableLangs[ langCode ] ? langCode : 'en'; + + CKEDITOR.scriptLoader.load( + CKEDITOR.getUrl( plugin.path + 'lang/' + langCode + '.js' ), + function() + { + CKEDITOR.tools.extend( editor.lang.specialChar, plugin.lang[ langCode ] ); + editor.openDialog( pluginName ); + }); + }, + modes : { wysiwyg:1 }, + canUndo : false + }); // Register the toolbar button. editor.ui.addButton( 'SpecialChar', @@ -27,3 +47,24 @@ CKEDITOR.plugins.add( 'specialchar', }); } } ); + +/** + * The list of special characters visible in Special Character dialog. + * @type Array + * @example + * config.specialChars = [ '"', '’', [ '&custom;', 'Custom label' ] ]; + * config.specialChars = config.specialChars.concat( [ '"', [ '’', 'Custom label' ] ] ); + */ +CKEDITOR.config.specialChars = + [ + '!','"','#','$','%','&',"'",'(',')','*','+','-','.','/', + '0','1','2','3','4','5','6','7','8','9',':',';', + '<','=','>','?','@', + 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O', + 'P','Q','R','S','T','U','V','W','X','Y','Z', + '[',']','^','_','`', + 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p', + 'q','r','s','t','u','v','w','x','y','z', + '{','|','}','~', + "€", "‘", "’", "“", "”", "–", "—", "¡", "¢", "£", "¤", "¥", "¦", "§", "¨", "©", "ª", "«", "¬", "®", "¯", "°", "&", "²", "³", "´", "µ", "¶", "·", "¸", "¹", "º", "&", "¼", "½", "¾", "¿", "À", "Á", "Â", "Ã", "Ä", "Å", "Æ", "Ç", "È", "É", "Ê", "Ë", "Ì", "Í", "Î", "Ï", "Ð", "Ñ", "Ò", "Ó", "Ô", "Õ", "Ö", "×", "Ø", "Ù", "Ú", "Û", "Ü", "Ý", "Þ", "ß", "à", "á", "â", "ã", "ä", "å", "æ", "ç", "è", "é", "ê", "ë", "ì", "í", "î", "ï", "ð", "ñ", "ò", "ó", "ô", "õ", "ö", "÷", "ø", "ù", "ú", "û", "ü", "ü", "ý", "þ", "ÿ", "Œ", "œ", "Ŵ", "Ŷ", "ŵ", "ŷ", "‚", "‛", "„", "…", "™", "►", "•", "→", "⇒", "⇔", "♦", "≈" + ];