esp-ckeditor 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/MIT-LICENSE +20 -0
- data/README.rdoc +32 -0
- data/Rakefile +28 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/_bootstrap.js +87 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/ckeditor.js +141 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/ckeditor_base.js +227 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/ckeditor_basic.js +238 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/command.js +209 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/commanddefinition.js +129 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/config.js +423 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/dataprocessor.js +65 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/dom/comment.js +32 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/dom/document.js +251 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/dom/documentfragment.js +49 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/dom/domobject.js +258 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/dom/element.js +1691 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/dom/elementpath.js +119 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/dom/event.js +145 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/dom/node.js +696 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/dom/nodelist.js +26 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/dom/range.js +2054 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/dom/rangelist.js +213 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/dom/text.js +128 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/dom/walker.js +462 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/dom/window.js +96 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/dom.js +20 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/dtd.js +266 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/editor.js +1060 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/editor_basic.js +186 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/env.js +305 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/event.js +342 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/eventInfo.js +120 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/focusmanager.js +152 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/htmlparser/basicwriter.js +145 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/htmlparser/cdata.js +43 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/htmlparser/comment.js +60 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/htmlparser/element.js +308 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/htmlparser/filter.js +288 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/htmlparser/fragment.js +518 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/htmlparser/text.js +53 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/htmlparser.js +224 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/lang.js +157 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/loader.js +240 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/plugindefinition.js +83 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/plugins.js +103 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/resourcemanager.js +238 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/scriptloader.js +180 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/skins.js +184 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/themes.js +19 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/tools.js +763 -0
- data/app/assets/javascripts/esp-ckeditor/_source/core/ui.js +128 -0
- data/app/assets/javascripts/esp-ckeditor/_source/lang/_languages.js +27 -0
- data/app/assets/javascripts/esp-ckeditor/_source/lang/en.js +815 -0
- data/app/assets/javascripts/esp-ckeditor/_source/lang/ru.js +815 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/a11yhelp/dialogs/a11yhelp.js +222 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/a11yhelp/lang/en.js +108 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/a11yhelp/lang/he.js +216 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/a11yhelp/plugin.js +47 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/basicstyles/plugin.js +129 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/button/plugin.js +290 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/clipboard/dialogs/paste.js +223 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/clipboard/plugin.js +453 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/contextmenu/plugin.js +179 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/dialog/dialogDefinition.js +1166 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/dialog/plugin.js +3308 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/dialogadvtab/plugin.js +208 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/dialogui/plugin.js +1541 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/domiterator/plugin.js +361 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/editingblock/plugin.js +278 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/elementspath/plugin.js +218 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/enterkey/plugin.js +433 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/entities/plugin.js +250 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_attachment/dialogs/esp_attachment.js +234 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_attachment/images/esp_attachment.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_attachment/lang/en.js +22 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_attachment/lang/ru.js +22 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_attachment/lang/uk.js +22 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_attachment/plugin.js +23 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_audio/dialogs/esp_audio.js +207 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_audio/images/esp_audio.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_audio/images/placeholder.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_audio/lang/en.js +18 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_audio/lang/ru.js +18 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_audio/lang/uk.js +18 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_audio/plugin.js +182 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_blockquote/dialogs/esp_blockquote.js +132 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_blockquote/plugin.js +235 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_image/dialogs/esp_image.js +1414 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_image/images/esp_image.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_image/lang/en.js +9 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_image/lang/ru.js +9 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_image/lang/uk.js +9 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_image/plugin.js +80 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_link/dialogs/esp_anchor.js +145 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_link/dialogs/esp_link.js +1396 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_link/images/anchor.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_link/images/esp_anchor.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_link/images/esp_link.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_link/images/esp_unlink.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_link/lang/en.js +8 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_link/lang/ru.js +8 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_link/lang/uk.js +8 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_link/plugin.js +379 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/images/block_address.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/images/block_blockquote.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/images/block_div.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/images/block_h1.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/images/block_h2.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/images/block_h3.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/images/block_h4.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/images/block_h5.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/images/block_h6.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/images/block_p.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/images/block_pre.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/images/esp_showblocks.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_showblocks/plugin.js +163 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_video/dialogs/esp_video.js +277 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_video/images/esp_video.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_video/images/placeholder.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_video/lang/en.js +19 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_video/lang/ru.js +19 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_video/lang/uk.js +19 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/esp_video/plugin.js +182 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/fakeobjects/plugin.js +175 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/filebrowser/plugin.js +534 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/find/dialogs/find.js +915 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/find/plugin.js +47 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/floatpanel/plugin.js +428 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/format/plugin.js +197 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/htmldataprocessor/plugin.js +596 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/htmlwriter/plugin.js +319 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/image/dialogs/image.js +1407 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/image/plugin.js +81 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/indent/plugin.js +461 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/justify/plugin.js +253 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/keystrokes/plugin.js +225 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/list/plugin.js +774 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/listblock/plugin.js +266 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/liststyle/dialogs/liststyle.js +225 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/liststyle/plugin.js +66 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/maximize/plugin.js +353 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/menu/plugin.js +541 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/panel/plugin.js +400 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/pastefromword/filter/default.js +1367 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/pastefromword/plugin.js +141 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/pastetext/dialogs/pastetext.js +67 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/pastetext/plugin.js +98 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/popup/plugin.js +64 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/removeformat/plugin.js +185 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/resize/plugin.js +168 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/richcombo/plugin.js +381 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/selection/plugin.js +1729 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/showborders/plugin.js +207 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/sourcearea/plugin.js +209 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/styles/plugin.js +1700 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/styles/styles/default.js +88 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/stylescombo/plugin.js +218 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/tab/plugin.js +367 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/table/dialogs/table.js +623 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/table/plugin.js +78 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/tabletools/dialogs/tableCell.js +525 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/tabletools/plugin.js +1194 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/toolbar/plugin.js +545 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/undo/plugin.js +578 -0
- data/app/assets/javascripts/esp-ckeditor/_source/plugins/wysiwygarea/plugin.js +1347 -0
- data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/dialog.css +988 -0
- data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/editor.css +25 -0
- data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/elementspath.css +73 -0
- data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/icons.css +367 -0
- data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/icons.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/icons_rtl.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/images/dialog_sides.gif +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/images/dialog_sides.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/images/dialog_sides_rtl.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/images/mini.gif +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/images/noimage.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/images/sprites.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/images/sprites_ie6.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/images/toolbar_start.gif +0 -0
- data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/mainui.css +209 -0
- data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/menu.css +232 -0
- data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/panel.css +227 -0
- data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/presets.css +49 -0
- data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/reset.css +85 -0
- data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/richcombo.css +287 -0
- data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/skin.js +236 -0
- data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/templates.css +88 -0
- data/app/assets/javascripts/esp-ckeditor/_source/skins/kama/toolbar.css +412 -0
- data/app/assets/javascripts/esp-ckeditor/_source/themes/default/theme.js +407 -0
- data/app/assets/javascripts/esp-ckeditor/application.js +8 -0
- data/app/assets/javascripts/esp-ckeditor/ckeditor.js +137 -0
- data/app/assets/javascripts/esp-ckeditor/ckeditor.pack +194 -0
- data/app/assets/javascripts/esp-ckeditor/ckeditor_source.js +35 -0
- data/app/assets/javascripts/esp-ckeditor/ckpackager.jar +0 -0
- data/app/assets/javascripts/esp-ckeditor/ckpackager.txt +2 -0
- data/app/assets/javascripts/esp-ckeditor/config.js +147 -0
- data/app/assets/javascripts/esp-ckeditor/contents.css +38 -0
- data/app/assets/javascripts/esp-ckeditor/images/spacer.gif +0 -0
- data/app/assets/javascripts/esp-ckeditor/init_ckeditor.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/a11yhelp/lang/en.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/a11yhelp/lang/he.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/a11yhelp/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/basicstyles/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/button/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/clipboard/dialogs/paste.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/clipboard/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/contextmenu/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/dialog/dialogDefinition.js +0 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/dialog/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/dialogadvtab/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/dialogui/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/domiterator/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/editingblock/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/elementspath/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/enterkey/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/entities/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_attachment/dialogs/esp_attachment.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_attachment/images/esp_attachment.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_attachment/lang/en.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_attachment/lang/ru.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_attachment/lang/uk.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_attachment/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_audio/dialogs/esp_audio.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_audio/images/esp_audio.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_audio/images/placeholder.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_audio/lang/en.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_audio/lang/ru.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_audio/lang/uk.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_audio/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_blockquote/dialogs/esp_blockquote.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_blockquote/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_image/dialogs/esp_image.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_image/images/esp_image.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_image/lang/en.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_image/lang/ru.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_image/lang/uk.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_image/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_link/dialogs/esp_anchor.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_link/dialogs/esp_link.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_link/images/anchor.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_link/images/esp_anchor.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_link/images/esp_link.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_link/images/esp_unlink.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_link/lang/en.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_link/lang/ru.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_link/lang/uk.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_link/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/images/block_address.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/images/block_blockquote.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/images/block_div.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/images/block_h1.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/images/block_h2.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/images/block_h3.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/images/block_h4.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/images/block_h5.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/images/block_h6.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/images/block_p.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/images/block_pre.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/images/esp_showblocks.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_showblocks/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_video/dialogs/esp_video.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_video/images/esp_video.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_video/images/placeholder.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_video/lang/en.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_video/lang/ru.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_video/lang/uk.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/esp_video/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/fakeobjects/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/filebrowser/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/find/dialogs/find.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/find/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/floatpanel/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/format/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/htmldataprocessor/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/htmlwriter/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/image/dialogs/image.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/image/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/indent/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/justify/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/keystrokes/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/list/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/listblock/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/liststyle/dialogs/liststyle.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/liststyle/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/maximize/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/menu/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/panel/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/pastefromword/filter/default.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/pastefromword/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/pastetext/dialogs/pastetext.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/pastetext/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/popup/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/removeformat/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/resize/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/richcombo/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/selection/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/showborders/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/sourcearea/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/styles/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/styles/styles/default.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/stylescombo/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/tab/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/table/dialogs/table.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/table/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/tabletools/dialogs/tableCell.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/tabletools/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/toolbar/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/undo/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/plugins/wysiwygarea/plugin.js +1 -0
- data/app/assets/javascripts/esp-ckeditor/skins/kama/dialog.css +988 -0
- data/app/assets/javascripts/esp-ckeditor/skins/kama/editor.css +25 -0
- data/app/assets/javascripts/esp-ckeditor/skins/kama/elementspath.css +73 -0
- data/app/assets/javascripts/esp-ckeditor/skins/kama/icons.css +367 -0
- data/app/assets/javascripts/esp-ckeditor/skins/kama/icons.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/skins/kama/icons_rtl.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/skins/kama/images/dialog_sides.gif +0 -0
- data/app/assets/javascripts/esp-ckeditor/skins/kama/images/dialog_sides.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/skins/kama/images/dialog_sides_rtl.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/skins/kama/images/mini.gif +0 -0
- data/app/assets/javascripts/esp-ckeditor/skins/kama/images/noimage.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/skins/kama/images/sprites.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/skins/kama/images/sprites_ie6.png +0 -0
- data/app/assets/javascripts/esp-ckeditor/skins/kama/images/toolbar_start.gif +0 -0
- data/app/assets/javascripts/esp-ckeditor/skins/kama/mainui.css +209 -0
- data/app/assets/javascripts/esp-ckeditor/skins/kama/menu.css +232 -0
- data/app/assets/javascripts/esp-ckeditor/skins/kama/panel.css +227 -0
- data/app/assets/javascripts/esp-ckeditor/skins/kama/presets.css +49 -0
- data/app/assets/javascripts/esp-ckeditor/skins/kama/reset.css +85 -0
- data/app/assets/javascripts/esp-ckeditor/skins/kama/richcombo.css +287 -0
- data/app/assets/javascripts/esp-ckeditor/skins/kama/skin.js +236 -0
- data/app/assets/javascripts/esp-ckeditor/skins/kama/templates.css +88 -0
- data/app/assets/javascripts/esp-ckeditor/skins/kama/toolbar.css +412 -0
- data/app/inputs/ckeditor_input.rb +42 -0
- data/config/routes.rb +2 -0
- data/lib/esp-ckeditor/engine.rb +9 -0
- data/lib/esp-ckeditor/version.rb +3 -0
- data/lib/esp-ckeditor.rb +17 -0
- data/lib/tasks/esp-ckeditor_tasks.rake +4 -0
- metadata +434 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
|
|
3
|
+
For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @file Justify commands.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
(function()
|
|
11
|
+
{
|
|
12
|
+
function getState( editor, path )
|
|
13
|
+
{
|
|
14
|
+
var firstBlock = path.block || path.blockLimit;
|
|
15
|
+
|
|
16
|
+
if ( !firstBlock || firstBlock.getName() == 'body' )
|
|
17
|
+
return CKEDITOR.TRISTATE_OFF;
|
|
18
|
+
|
|
19
|
+
return ( getAlignment( firstBlock, editor.config.useComputedState ) == this.value ) ?
|
|
20
|
+
CKEDITOR.TRISTATE_ON :
|
|
21
|
+
CKEDITOR.TRISTATE_OFF;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function getAlignment( element, useComputedState )
|
|
25
|
+
{
|
|
26
|
+
useComputedState = useComputedState === undefined || useComputedState;
|
|
27
|
+
|
|
28
|
+
var align;
|
|
29
|
+
if ( useComputedState )
|
|
30
|
+
align = element.getComputedStyle( 'text-align' );
|
|
31
|
+
else
|
|
32
|
+
{
|
|
33
|
+
while ( !element.hasAttribute || !( element.hasAttribute( 'align' ) || element.getStyle( 'text-align' ) ) )
|
|
34
|
+
{
|
|
35
|
+
var parent = element.getParent();
|
|
36
|
+
if ( !parent )
|
|
37
|
+
break;
|
|
38
|
+
element = parent;
|
|
39
|
+
}
|
|
40
|
+
align = element.getStyle( 'text-align' ) || element.getAttribute( 'align' ) || '';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
align && ( align = align.replace( /-moz-|-webkit-|start|auto/i, '' ) );
|
|
44
|
+
|
|
45
|
+
!align && useComputedState && ( align = element.getComputedStyle( 'direction' ) == 'rtl' ? 'right' : 'left' );
|
|
46
|
+
|
|
47
|
+
return align;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function onSelectionChange( evt )
|
|
51
|
+
{
|
|
52
|
+
if ( evt.editor.readOnly )
|
|
53
|
+
return;
|
|
54
|
+
|
|
55
|
+
var command = evt.editor.getCommand( this.name );
|
|
56
|
+
command.state = getState.call( this, evt.editor, evt.data.path );
|
|
57
|
+
command.fire( 'state' );
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function justifyCommand( editor, name, value )
|
|
61
|
+
{
|
|
62
|
+
this.name = name;
|
|
63
|
+
this.value = value;
|
|
64
|
+
|
|
65
|
+
var classes = editor.config.justifyClasses;
|
|
66
|
+
if ( classes )
|
|
67
|
+
{
|
|
68
|
+
switch ( value )
|
|
69
|
+
{
|
|
70
|
+
case 'left' :
|
|
71
|
+
this.cssClassName = classes[0];
|
|
72
|
+
break;
|
|
73
|
+
case 'center' :
|
|
74
|
+
this.cssClassName = classes[1];
|
|
75
|
+
break;
|
|
76
|
+
case 'right' :
|
|
77
|
+
this.cssClassName = classes[2];
|
|
78
|
+
break;
|
|
79
|
+
case 'justify' :
|
|
80
|
+
this.cssClassName = classes[3];
|
|
81
|
+
break;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
this.cssClassRegex = new RegExp( '(?:^|\\s+)(?:' + classes.join( '|' ) + ')(?=$|\\s)' );
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function onDirChanged( e )
|
|
89
|
+
{
|
|
90
|
+
var editor = e.editor;
|
|
91
|
+
|
|
92
|
+
var range = new CKEDITOR.dom.range( editor.document );
|
|
93
|
+
range.setStartBefore( e.data.node );
|
|
94
|
+
range.setEndAfter( e.data.node );
|
|
95
|
+
|
|
96
|
+
var walker = new CKEDITOR.dom.walker( range ),
|
|
97
|
+
node;
|
|
98
|
+
|
|
99
|
+
while ( ( node = walker.next() ) )
|
|
100
|
+
{
|
|
101
|
+
if ( node.type == CKEDITOR.NODE_ELEMENT )
|
|
102
|
+
{
|
|
103
|
+
// A child with the defined dir is to be ignored.
|
|
104
|
+
if ( !node.equals( e.data.node ) && node.getDirection() )
|
|
105
|
+
{
|
|
106
|
+
range.setStartAfter( node );
|
|
107
|
+
walker = new CKEDITOR.dom.walker( range );
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Switch the alignment.
|
|
112
|
+
var classes = editor.config.justifyClasses;
|
|
113
|
+
if ( classes )
|
|
114
|
+
{
|
|
115
|
+
// The left align class.
|
|
116
|
+
if ( node.hasClass( classes[ 0 ] ) )
|
|
117
|
+
{
|
|
118
|
+
node.removeClass( classes[ 0 ] );
|
|
119
|
+
node.addClass( classes[ 2 ] );
|
|
120
|
+
}
|
|
121
|
+
// The right align class.
|
|
122
|
+
else if ( node.hasClass( classes[ 2 ] ) )
|
|
123
|
+
{
|
|
124
|
+
node.removeClass( classes[ 2 ] );
|
|
125
|
+
node.addClass( classes[ 0 ] );
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Always switch CSS margins.
|
|
130
|
+
var style = 'text-align';
|
|
131
|
+
var align = node.getStyle( style );
|
|
132
|
+
|
|
133
|
+
if ( align == 'left' )
|
|
134
|
+
node.setStyle( style, 'right' );
|
|
135
|
+
else if ( align == 'right' )
|
|
136
|
+
node.setStyle( style, 'left' );
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
justifyCommand.prototype = {
|
|
142
|
+
exec : function( editor )
|
|
143
|
+
{
|
|
144
|
+
var selection = editor.getSelection(),
|
|
145
|
+
enterMode = editor.config.enterMode;
|
|
146
|
+
|
|
147
|
+
if ( !selection )
|
|
148
|
+
return;
|
|
149
|
+
|
|
150
|
+
var bookmarks = selection.createBookmarks(),
|
|
151
|
+
ranges = selection.getRanges( true );
|
|
152
|
+
|
|
153
|
+
var cssClassName = this.cssClassName,
|
|
154
|
+
iterator,
|
|
155
|
+
block;
|
|
156
|
+
|
|
157
|
+
var useComputedState = editor.config.useComputedState;
|
|
158
|
+
useComputedState = useComputedState === undefined || useComputedState;
|
|
159
|
+
|
|
160
|
+
for ( var i = ranges.length - 1 ; i >= 0 ; i-- )
|
|
161
|
+
{
|
|
162
|
+
iterator = ranges[ i ].createIterator();
|
|
163
|
+
iterator.enlargeBr = enterMode != CKEDITOR.ENTER_BR;
|
|
164
|
+
|
|
165
|
+
while ( ( block = iterator.getNextParagraph( enterMode == CKEDITOR.ENTER_P ? 'p' : 'div' ) ) )
|
|
166
|
+
{
|
|
167
|
+
block.removeAttribute( 'align' );
|
|
168
|
+
block.removeStyle( 'text-align' );
|
|
169
|
+
|
|
170
|
+
// Remove any of the alignment classes from the className.
|
|
171
|
+
var className = cssClassName && ( block.$.className =
|
|
172
|
+
CKEDITOR.tools.ltrim( block.$.className.replace( this.cssClassRegex, '' ) ) );
|
|
173
|
+
|
|
174
|
+
var apply =
|
|
175
|
+
( this.state == CKEDITOR.TRISTATE_OFF ) &&
|
|
176
|
+
( !useComputedState || ( getAlignment( block, true ) != this.value ) );
|
|
177
|
+
|
|
178
|
+
if ( cssClassName )
|
|
179
|
+
{
|
|
180
|
+
// Append the desired class name.
|
|
181
|
+
if ( apply )
|
|
182
|
+
block.addClass( cssClassName );
|
|
183
|
+
else if ( !className )
|
|
184
|
+
block.removeAttribute( 'class' );
|
|
185
|
+
}
|
|
186
|
+
else if ( apply )
|
|
187
|
+
block.setStyle( 'text-align', this.value );
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
editor.focus();
|
|
193
|
+
editor.forceNextSelectionCheck();
|
|
194
|
+
selection.selectBookmarks( bookmarks );
|
|
195
|
+
}
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
CKEDITOR.plugins.add( 'justify',
|
|
199
|
+
{
|
|
200
|
+
init : function( editor )
|
|
201
|
+
{
|
|
202
|
+
var left = new justifyCommand( editor, 'justifyleft', 'left' ),
|
|
203
|
+
center = new justifyCommand( editor, 'justifycenter', 'center' ),
|
|
204
|
+
right = new justifyCommand( editor, 'justifyright', 'right' ),
|
|
205
|
+
justify = new justifyCommand( editor, 'justifyblock', 'justify' );
|
|
206
|
+
|
|
207
|
+
editor.addCommand( 'justifyleft', left );
|
|
208
|
+
editor.addCommand( 'justifycenter', center );
|
|
209
|
+
editor.addCommand( 'justifyright', right );
|
|
210
|
+
editor.addCommand( 'justifyblock', justify );
|
|
211
|
+
|
|
212
|
+
editor.ui.addButton( 'JustifyLeft',
|
|
213
|
+
{
|
|
214
|
+
label : editor.lang.justify.left,
|
|
215
|
+
command : 'justifyleft'
|
|
216
|
+
} );
|
|
217
|
+
editor.ui.addButton( 'JustifyCenter',
|
|
218
|
+
{
|
|
219
|
+
label : editor.lang.justify.center,
|
|
220
|
+
command : 'justifycenter'
|
|
221
|
+
} );
|
|
222
|
+
editor.ui.addButton( 'JustifyRight',
|
|
223
|
+
{
|
|
224
|
+
label : editor.lang.justify.right,
|
|
225
|
+
command : 'justifyright'
|
|
226
|
+
} );
|
|
227
|
+
editor.ui.addButton( 'JustifyBlock',
|
|
228
|
+
{
|
|
229
|
+
label : editor.lang.justify.block,
|
|
230
|
+
command : 'justifyblock'
|
|
231
|
+
} );
|
|
232
|
+
|
|
233
|
+
editor.on( 'selectionChange', CKEDITOR.tools.bind( onSelectionChange, left ) );
|
|
234
|
+
editor.on( 'selectionChange', CKEDITOR.tools.bind( onSelectionChange, right ) );
|
|
235
|
+
editor.on( 'selectionChange', CKEDITOR.tools.bind( onSelectionChange, center ) );
|
|
236
|
+
editor.on( 'selectionChange', CKEDITOR.tools.bind( onSelectionChange, justify ) );
|
|
237
|
+
editor.on( 'dirChanged', onDirChanged );
|
|
238
|
+
},
|
|
239
|
+
|
|
240
|
+
requires : [ 'domiterator' ]
|
|
241
|
+
});
|
|
242
|
+
})();
|
|
243
|
+
|
|
244
|
+
/**
|
|
245
|
+
* List of classes to use for aligning the contents. If it's null, no classes will be used
|
|
246
|
+
* and instead the corresponding CSS values will be used. The array should contain 4 members, in the following order: left, center, right, justify.
|
|
247
|
+
* @name CKEDITOR.config.justifyClasses
|
|
248
|
+
* @type Array
|
|
249
|
+
* @default null
|
|
250
|
+
* @example
|
|
251
|
+
* // Use the classes 'AlignLeft', 'AlignCenter', 'AlignRight', 'AlignJustify'
|
|
252
|
+
* config.justifyClasses = [ 'AlignLeft', 'AlignCenter', 'AlignRight', 'AlignJustify' ];
|
|
253
|
+
*/
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright (c) 2003-2011, CKSource - Frederico Knabben. All rights reserved.
|
|
3
|
+
For licensing, see LICENSE.html or http://ckeditor.com/license
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// Register a plugin named "sample".
|
|
7
|
+
CKEDITOR.plugins.add( 'keystrokes',
|
|
8
|
+
{
|
|
9
|
+
beforeInit : function( editor )
|
|
10
|
+
{
|
|
11
|
+
/**
|
|
12
|
+
* Controls keystrokes typing in this editor instance.
|
|
13
|
+
* @name CKEDITOR.editor.prototype.keystrokeHandler
|
|
14
|
+
* @type CKEDITOR.keystrokeHandler
|
|
15
|
+
* @example
|
|
16
|
+
*/
|
|
17
|
+
editor.keystrokeHandler = new CKEDITOR.keystrokeHandler( editor );
|
|
18
|
+
|
|
19
|
+
editor.specialKeys = {};
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
init : function( editor )
|
|
23
|
+
{
|
|
24
|
+
var keystrokesConfig = editor.config.keystrokes,
|
|
25
|
+
blockedConfig = editor.config.blockedKeystrokes;
|
|
26
|
+
|
|
27
|
+
var keystrokes = editor.keystrokeHandler.keystrokes,
|
|
28
|
+
blockedKeystrokes = editor.keystrokeHandler.blockedKeystrokes;
|
|
29
|
+
|
|
30
|
+
for ( var i = 0 ; i < keystrokesConfig.length ; i++ )
|
|
31
|
+
keystrokes[ keystrokesConfig[i][0] ] = keystrokesConfig[i][1];
|
|
32
|
+
|
|
33
|
+
for ( i = 0 ; i < blockedConfig.length ; i++ )
|
|
34
|
+
blockedKeystrokes[ blockedConfig[i] ] = 1;
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Controls keystrokes typing in an editor instance.
|
|
40
|
+
* @constructor
|
|
41
|
+
* @param {CKEDITOR.editor} editor The editor instance.
|
|
42
|
+
* @example
|
|
43
|
+
*/
|
|
44
|
+
CKEDITOR.keystrokeHandler = function( editor )
|
|
45
|
+
{
|
|
46
|
+
if ( editor.keystrokeHandler )
|
|
47
|
+
return editor.keystrokeHandler;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* List of keystrokes associated to commands. Each entry points to the
|
|
51
|
+
* command to be executed.
|
|
52
|
+
* @type Object
|
|
53
|
+
* @example
|
|
54
|
+
*/
|
|
55
|
+
this.keystrokes = {};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* List of keystrokes that should be blocked if not defined at
|
|
59
|
+
* {@link keystrokes}. In this way it is possible to block the default
|
|
60
|
+
* browser behavior for those keystrokes.
|
|
61
|
+
* @type Object
|
|
62
|
+
* @example
|
|
63
|
+
*/
|
|
64
|
+
this.blockedKeystrokes = {};
|
|
65
|
+
|
|
66
|
+
this._ =
|
|
67
|
+
{
|
|
68
|
+
editor : editor
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
return this;
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
(function()
|
|
75
|
+
{
|
|
76
|
+
var cancel;
|
|
77
|
+
|
|
78
|
+
var onKeyDown = function( event )
|
|
79
|
+
{
|
|
80
|
+
// The DOM event object is passed by the "data" property.
|
|
81
|
+
event = event.data;
|
|
82
|
+
|
|
83
|
+
var keyCombination = event.getKeystroke();
|
|
84
|
+
var command = this.keystrokes[ keyCombination ];
|
|
85
|
+
var editor = this._.editor;
|
|
86
|
+
|
|
87
|
+
cancel = ( editor.fire( 'key', { keyCode : keyCombination } ) === true );
|
|
88
|
+
|
|
89
|
+
if ( !cancel )
|
|
90
|
+
{
|
|
91
|
+
if ( command )
|
|
92
|
+
{
|
|
93
|
+
var data = { from : 'keystrokeHandler' };
|
|
94
|
+
cancel = ( editor.execCommand( command, data ) !== false );
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if ( !cancel )
|
|
98
|
+
{
|
|
99
|
+
var handler = editor.specialKeys[ keyCombination ];
|
|
100
|
+
cancel = ( handler && handler( editor ) === true );
|
|
101
|
+
|
|
102
|
+
if ( !cancel )
|
|
103
|
+
cancel = !!this.blockedKeystrokes[ keyCombination ];
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if ( cancel )
|
|
108
|
+
event.preventDefault( true );
|
|
109
|
+
|
|
110
|
+
return !cancel;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
var onKeyPress = function( event )
|
|
114
|
+
{
|
|
115
|
+
if ( cancel )
|
|
116
|
+
{
|
|
117
|
+
cancel = false;
|
|
118
|
+
event.data.preventDefault( true );
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
CKEDITOR.keystrokeHandler.prototype =
|
|
123
|
+
{
|
|
124
|
+
/**
|
|
125
|
+
* Attaches this keystroke handle to a DOM object. Keystrokes typed
|
|
126
|
+
** over this object will get handled by this keystrokeHandler.
|
|
127
|
+
* @param {CKEDITOR.dom.domObject} domObject The DOM object to attach
|
|
128
|
+
* to.
|
|
129
|
+
* @example
|
|
130
|
+
*/
|
|
131
|
+
attach : function( domObject )
|
|
132
|
+
{
|
|
133
|
+
// For most browsers, it is enough to listen to the keydown event
|
|
134
|
+
// only.
|
|
135
|
+
domObject.on( 'keydown', onKeyDown, this );
|
|
136
|
+
|
|
137
|
+
// Some browsers instead, don't cancel key events in the keydown, but in the
|
|
138
|
+
// keypress. So we must do a longer trip in those cases.
|
|
139
|
+
if ( CKEDITOR.env.opera || ( CKEDITOR.env.gecko && CKEDITOR.env.mac ) )
|
|
140
|
+
domObject.on( 'keypress', onKeyPress, this );
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
})();
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* A list of keystrokes to be blocked if not defined in the {@link CKEDITOR.config.keystrokes}
|
|
147
|
+
* setting. In this way it is possible to block the default browser behavior
|
|
148
|
+
* for those keystrokes.
|
|
149
|
+
* @type Array
|
|
150
|
+
* @default (see example)
|
|
151
|
+
* @example
|
|
152
|
+
* // This is actually the default value.
|
|
153
|
+
* config.blockedKeystrokes =
|
|
154
|
+
* [
|
|
155
|
+
* CKEDITOR.CTRL + 66 /*B*/,
|
|
156
|
+
* CKEDITOR.CTRL + 73 /*I*/,
|
|
157
|
+
* CKEDITOR.CTRL + 85 /*U*/
|
|
158
|
+
* ];
|
|
159
|
+
*/
|
|
160
|
+
CKEDITOR.config.blockedKeystrokes =
|
|
161
|
+
[
|
|
162
|
+
CKEDITOR.CTRL + 66 /*B*/,
|
|
163
|
+
CKEDITOR.CTRL + 73 /*I*/,
|
|
164
|
+
CKEDITOR.CTRL + 85 /*U*/
|
|
165
|
+
];
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* A list associating keystrokes to editor commands. Each element in the list
|
|
169
|
+
* is an array where the first item is the keystroke, and the second is the
|
|
170
|
+
* name of the command to be executed.
|
|
171
|
+
* @type Array
|
|
172
|
+
* @default (see example)
|
|
173
|
+
* @example
|
|
174
|
+
* // This is actually the default value.
|
|
175
|
+
* config.keystrokes =
|
|
176
|
+
* [
|
|
177
|
+
* [ CKEDITOR.ALT + 121 /*F10*/, 'toolbarFocus' ],
|
|
178
|
+
* [ CKEDITOR.ALT + 122 /*F11*/, 'elementsPathFocus' ],
|
|
179
|
+
*
|
|
180
|
+
* [ CKEDITOR.SHIFT + 121 /*F10*/, 'contextMenu' ],
|
|
181
|
+
*
|
|
182
|
+
* [ CKEDITOR.CTRL + 90 /*Z*/, 'undo' ],
|
|
183
|
+
* [ CKEDITOR.CTRL + 89 /*Y*/, 'redo' ],
|
|
184
|
+
* [ CKEDITOR.CTRL + CKEDITOR.SHIFT + 90 /*Z*/, 'redo' ],
|
|
185
|
+
*
|
|
186
|
+
* [ CKEDITOR.CTRL + 76 /*L*/, 'link' ],
|
|
187
|
+
*
|
|
188
|
+
* [ CKEDITOR.CTRL + 66 /*B*/, 'bold' ],
|
|
189
|
+
* [ CKEDITOR.CTRL + 73 /*I*/, 'italic' ],
|
|
190
|
+
* [ CKEDITOR.CTRL + 85 /*U*/, 'underline' ],
|
|
191
|
+
*
|
|
192
|
+
* [ CKEDITOR.ALT + 109 /*-*/, 'toolbarCollapse' ]
|
|
193
|
+
* ];
|
|
194
|
+
*/
|
|
195
|
+
CKEDITOR.config.keystrokes =
|
|
196
|
+
[
|
|
197
|
+
[ CKEDITOR.ALT + 121 /*F10*/, 'toolbarFocus' ],
|
|
198
|
+
[ CKEDITOR.ALT + 122 /*F11*/, 'elementsPathFocus' ],
|
|
199
|
+
|
|
200
|
+
[ CKEDITOR.SHIFT + 121 /*F10*/, 'contextMenu' ],
|
|
201
|
+
[ CKEDITOR.CTRL + CKEDITOR.SHIFT + 121 /*F10*/, 'contextMenu' ],
|
|
202
|
+
|
|
203
|
+
[ CKEDITOR.CTRL + 90 /*Z*/, 'undo' ],
|
|
204
|
+
[ CKEDITOR.CTRL + 89 /*Y*/, 'redo' ],
|
|
205
|
+
[ CKEDITOR.CTRL + CKEDITOR.SHIFT + 90 /*Z*/, 'redo' ],
|
|
206
|
+
|
|
207
|
+
[ CKEDITOR.CTRL + 76 /*L*/, 'link' ],
|
|
208
|
+
|
|
209
|
+
[ CKEDITOR.CTRL + 66 /*B*/, 'bold' ],
|
|
210
|
+
[ CKEDITOR.CTRL + 73 /*I*/, 'italic' ],
|
|
211
|
+
[ CKEDITOR.CTRL + 85 /*U*/, 'underline' ],
|
|
212
|
+
|
|
213
|
+
[ CKEDITOR.ALT + ( CKEDITOR.env.ie || CKEDITOR.env.webkit ? 189 : 109 ) /*-*/, 'toolbarCollapse' ],
|
|
214
|
+
[ CKEDITOR.ALT + 48 /*0*/, 'a11yHelp' ]
|
|
215
|
+
];
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Fired when any keyboard key (or combination) is pressed into the editing area.
|
|
219
|
+
* @name CKEDITOR.editor#key
|
|
220
|
+
* @event
|
|
221
|
+
* @param {Number} data.keyCode A number representing the key code (or
|
|
222
|
+
* combination). It is the sum of the current key code and the
|
|
223
|
+
* {@link CKEDITOR.CTRL}, {@link CKEDITOR.SHIFT} and {@link CKEDITOR.ALT}
|
|
224
|
+
* constants, if those are pressed.
|
|
225
|
+
*/
|