]> CRI, Mines Paris - PSL - ckeditor.git/blobdiff - skins/ckeditor/_source/plugins/basicstyles/plugin.js
Mimimum syndical pour en faire un produit zope / cmf.
[ckeditor.git] / skins / ckeditor / _source / plugins / basicstyles / plugin.js
diff --git a/skins/ckeditor/_source/plugins/basicstyles/plugin.js b/skins/ckeditor/_source/plugins/basicstyles/plugin.js
new file mode 100644 (file)
index 0000000..aa00e9a
--- /dev/null
@@ -0,0 +1,101 @@
+/*\r
+Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.\r
+For licensing, see LICENSE.html or http://ckeditor.com/license\r
+*/\r
+\r
+CKEDITOR.plugins.add( 'basicstyles',\r
+{\r
+       requires : [ 'styles', 'button' ],\r
+\r
+       init : function( editor )\r
+       {\r
+               // All buttons use the same code to register. So, to avoid\r
+               // duplications, let's use this tool function.\r
+               var addButtonCommand = function( buttonName, buttonLabel, commandName, styleDefiniton )\r
+               {\r
+                       var style = new CKEDITOR.style( styleDefiniton );\r
+\r
+                       editor.attachStyleStateChange( style, function( state )\r
+                               {\r
+                                       !editor.readOnly && editor.getCommand( commandName ).setState( state );\r
+                               });\r
+\r
+                       editor.addCommand( commandName, new CKEDITOR.styleCommand( style ) );\r
+\r
+                       editor.ui.addButton( buttonName,\r
+                               {\r
+                                       label : buttonLabel,\r
+                                       command : commandName\r
+                               });\r
+               };\r
+\r
+               var config = editor.config,\r
+                       lang = editor.lang;\r
+\r
+               addButtonCommand( 'Bold'                , lang.bold             , 'bold'                , config.coreStyles_bold );\r
+               addButtonCommand( 'Italic'              , lang.italic           , 'italic'              , config.coreStyles_italic );\r
+               addButtonCommand( 'Underline'   , lang.underline                , 'underline'   , config.coreStyles_underline );\r
+               addButtonCommand( 'Strike'              , lang.strike           , 'strike'              , config.coreStyles_strike );\r
+               addButtonCommand( 'Subscript'   , lang.subscript                , 'subscript'   , config.coreStyles_subscript );\r
+               addButtonCommand( 'Superscript' , lang.superscript              , 'superscript' , config.coreStyles_superscript );\r
+       }\r
+});\r
+\r
+// Basic Inline Styles.\r
+\r
+/**\r
+ * The style definition to be used to apply the bold style in the text.\r
+ * @type Object\r
+ * @example\r
+ * config.coreStyles_bold = { element : 'b', overrides : 'strong' };\r
+ * @example\r
+ * config.coreStyles_bold = { element : 'span', attributes : {'class': 'Bold'} };\r
+ */\r
+CKEDITOR.config.coreStyles_bold = { element : 'strong', overrides : 'b' };\r
+\r
+/**\r
+ * The style definition to be used to apply the italic style in the text.\r
+ * @type Object\r
+ * @default { element : 'em', overrides : 'i' }\r
+ * @example\r
+ * config.coreStyles_italic = { element : 'i', overrides : 'em' };\r
+ * @example\r
+ * CKEDITOR.config.coreStyles_italic = { element : 'span', attributes : {'class': 'Italic'} };\r
+ */\r
+CKEDITOR.config.coreStyles_italic = { element : 'em', overrides : 'i' };\r
+\r
+/**\r
+ * The style definition to be used to apply the underline style in the text.\r
+ * @type Object\r
+ * @default { element : 'u' }\r
+ * @example\r
+ * CKEDITOR.config.coreStyles_underline = { element : 'span', attributes : {'class': 'Underline'}};\r
+ */\r
+CKEDITOR.config.coreStyles_underline = { element : 'u' };\r
+\r
+/**\r
+ * The style definition to be used to apply the strike style in the text.\r
+ * @type Object\r
+ * @default { element : 'strike' }\r
+ * @example\r
+ * CKEDITOR.config.coreStyles_strike = { element : 'span', attributes : {'class': 'StrikeThrough'}, overrides : 'strike' };\r
+ */\r
+CKEDITOR.config.coreStyles_strike = { element : 'strike' };\r
+\r
+/**\r
+ * The style definition to be used to apply the subscript style in the text.\r
+ * @type Object\r
+ * @default { element : 'sub' }\r
+ * @example\r
+ * CKEDITOR.config.coreStyles_subscript = { element : 'span', attributes : {'class': 'Subscript'}, overrides : 'sub' };\r
+ */\r
+CKEDITOR.config.coreStyles_subscript = { element : 'sub' };\r
+\r
+/**\r
+ * The style definition to be used to apply the superscript style in the text.\r
+ * @type Object\r
+ * @default { element : 'sup' }\r
+ * @example\r
+ * CKEDITOR.config.coreStyles_superscript = { element : 'span', attributes : {'class': 'Superscript'}, overrides : 'sup' };\r
+ */\r
+CKEDITOR.config.coreStyles_superscript = { element : 'sup' };\r