esp-ckeditor 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- 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,623 @@
|
|
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
|
+
(function()
|
7
|
+
{
|
8
|
+
var defaultToPixel = CKEDITOR.tools.cssLength;
|
9
|
+
|
10
|
+
var commitValue = function( data )
|
11
|
+
{
|
12
|
+
var id = this.id;
|
13
|
+
if ( !data.info )
|
14
|
+
data.info = {};
|
15
|
+
data.info[id] = this.getValue();
|
16
|
+
};
|
17
|
+
|
18
|
+
function tableColumns( table )
|
19
|
+
{
|
20
|
+
var cols = 0, maxCols = 0;
|
21
|
+
for ( var i = 0, row, rows = table.$.rows.length; i < rows; i++ )
|
22
|
+
{
|
23
|
+
row = table.$.rows[ i ], cols = 0;
|
24
|
+
for ( var j = 0, cell, cells = row.cells.length; j < cells; j++ )
|
25
|
+
{
|
26
|
+
cell = row.cells[ j ];
|
27
|
+
cols += cell.colSpan;
|
28
|
+
}
|
29
|
+
|
30
|
+
cols > maxCols && ( maxCols = cols );
|
31
|
+
}
|
32
|
+
|
33
|
+
return maxCols;
|
34
|
+
}
|
35
|
+
|
36
|
+
function tableDialog( editor, command )
|
37
|
+
{
|
38
|
+
var makeElement = function( name )
|
39
|
+
{
|
40
|
+
return new CKEDITOR.dom.element( name, editor.document );
|
41
|
+
};
|
42
|
+
|
43
|
+
var dialogadvtab = editor.plugins.dialogadvtab;
|
44
|
+
|
45
|
+
return {
|
46
|
+
title : editor.lang.table.title,
|
47
|
+
minWidth : 310,
|
48
|
+
minHeight : CKEDITOR.env.ie ? 310 : 280,
|
49
|
+
|
50
|
+
onLoad : function()
|
51
|
+
{
|
52
|
+
var dialog = this;
|
53
|
+
|
54
|
+
var styles = dialog.getContentElement( 'advanced', 'advStyles' );
|
55
|
+
|
56
|
+
if ( styles )
|
57
|
+
{
|
58
|
+
styles.on( 'change', function( evt )
|
59
|
+
{
|
60
|
+
// Synchronize width value.
|
61
|
+
var width = this.getStyle( 'width', '' ),
|
62
|
+
txtWidth = dialog.getContentElement( 'info', 'txtWidth' );
|
63
|
+
|
64
|
+
txtWidth && txtWidth.setValue( width, true );
|
65
|
+
|
66
|
+
// Synchronize height value.
|
67
|
+
var height = this.getStyle( 'height', '' ),
|
68
|
+
txtHeight = dialog.getContentElement( 'info', 'txtHeight' );
|
69
|
+
|
70
|
+
txtHeight && txtHeight.setValue( height, true );
|
71
|
+
});
|
72
|
+
}
|
73
|
+
},
|
74
|
+
|
75
|
+
onShow : function()
|
76
|
+
{
|
77
|
+
// Detect if there's a selected table.
|
78
|
+
var selection = editor.getSelection(),
|
79
|
+
ranges = selection.getRanges(),
|
80
|
+
selectedTable = null;
|
81
|
+
|
82
|
+
var rowsInput = this.getContentElement( 'info', 'txtRows' ),
|
83
|
+
colsInput = this.getContentElement( 'info', 'txtCols' ),
|
84
|
+
widthInput = this.getContentElement( 'info', 'txtWidth' ),
|
85
|
+
heightInput = this.getContentElement( 'info', 'txtHeight' );
|
86
|
+
|
87
|
+
if ( command == 'tableProperties' )
|
88
|
+
{
|
89
|
+
if ( ( selectedTable = selection.getSelectedElement() ) )
|
90
|
+
selectedTable = selectedTable.getAscendant( 'table', true );
|
91
|
+
else if ( ranges.length > 0 )
|
92
|
+
{
|
93
|
+
// Webkit could report the following range on cell selection (#4948):
|
94
|
+
// <table><tr><td>[ </td></tr></table>]
|
95
|
+
if ( CKEDITOR.env.webkit )
|
96
|
+
ranges[ 0 ].shrink( CKEDITOR.NODE_ELEMENT );
|
97
|
+
|
98
|
+
var rangeRoot = ranges[0].getCommonAncestor( true );
|
99
|
+
selectedTable = rangeRoot.getAscendant( 'table', true );
|
100
|
+
}
|
101
|
+
|
102
|
+
// Save a reference to the selected table, and push a new set of default values.
|
103
|
+
this._.selectedElement = selectedTable;
|
104
|
+
}
|
105
|
+
|
106
|
+
// Enable or disable the row, cols, width fields.
|
107
|
+
if ( selectedTable )
|
108
|
+
{
|
109
|
+
this.setupContent( selectedTable );
|
110
|
+
rowsInput && rowsInput.disable();
|
111
|
+
colsInput && colsInput.disable();
|
112
|
+
}
|
113
|
+
else
|
114
|
+
{
|
115
|
+
rowsInput && rowsInput.enable();
|
116
|
+
colsInput && colsInput.enable();
|
117
|
+
}
|
118
|
+
|
119
|
+
// Call the onChange method for the widht and height fields so
|
120
|
+
// they get reflected into the Advanced tab.
|
121
|
+
widthInput && widthInput.onChange();
|
122
|
+
heightInput && heightInput.onChange();
|
123
|
+
},
|
124
|
+
onOk : function()
|
125
|
+
{
|
126
|
+
var selection = editor.getSelection(),
|
127
|
+
bms = this._.selectedElement && selection.createBookmarks();
|
128
|
+
|
129
|
+
var table = this._.selectedElement || makeElement( 'table' ),
|
130
|
+
me = this,
|
131
|
+
data = {};
|
132
|
+
|
133
|
+
this.commitContent( data, table );
|
134
|
+
|
135
|
+
if ( data.info )
|
136
|
+
{
|
137
|
+
var info = data.info;
|
138
|
+
|
139
|
+
// Generate the rows and cols.
|
140
|
+
if ( !this._.selectedElement )
|
141
|
+
{
|
142
|
+
var tbody = table.append( makeElement( 'tbody' ) ),
|
143
|
+
rows = parseInt( info.txtRows, 10 ) || 0,
|
144
|
+
cols = parseInt( info.txtCols, 10 ) || 0;
|
145
|
+
|
146
|
+
for ( var i = 0 ; i < rows ; i++ )
|
147
|
+
{
|
148
|
+
var row = tbody.append( makeElement( 'tr' ) );
|
149
|
+
for ( var j = 0 ; j < cols ; j++ )
|
150
|
+
{
|
151
|
+
var cell = row.append( makeElement( 'td' ) );
|
152
|
+
if ( !CKEDITOR.env.ie )
|
153
|
+
cell.append( makeElement( 'br' ) );
|
154
|
+
}
|
155
|
+
}
|
156
|
+
}
|
157
|
+
|
158
|
+
// Modify the table headers. Depends on having rows and cols generated
|
159
|
+
// correctly so it can't be done in commit functions.
|
160
|
+
|
161
|
+
// Should we make a <thead>?
|
162
|
+
var headers = info.selHeaders;
|
163
|
+
if ( !table.$.tHead && ( headers == 'row' || headers == 'both' ) )
|
164
|
+
{
|
165
|
+
var thead = new CKEDITOR.dom.element( table.$.createTHead() );
|
166
|
+
tbody = table.getElementsByTag( 'tbody' ).getItem( 0 );
|
167
|
+
var theRow = tbody.getElementsByTag( 'tr' ).getItem( 0 );
|
168
|
+
|
169
|
+
// Change TD to TH:
|
170
|
+
for ( i = 0 ; i < theRow.getChildCount() ; i++ )
|
171
|
+
{
|
172
|
+
var th = theRow.getChild( i );
|
173
|
+
// Skip bookmark nodes. (#6155)
|
174
|
+
if ( th.type == CKEDITOR.NODE_ELEMENT && !th.data( 'cke-bookmark' ) )
|
175
|
+
{
|
176
|
+
th.renameNode( 'th' );
|
177
|
+
th.setAttribute( 'scope', 'col' );
|
178
|
+
}
|
179
|
+
}
|
180
|
+
thead.append( theRow.remove() );
|
181
|
+
}
|
182
|
+
|
183
|
+
if ( table.$.tHead !== null && !( headers == 'row' || headers == 'both' ) )
|
184
|
+
{
|
185
|
+
// Move the row out of the THead and put it in the TBody:
|
186
|
+
thead = new CKEDITOR.dom.element( table.$.tHead );
|
187
|
+
tbody = table.getElementsByTag( 'tbody' ).getItem( 0 );
|
188
|
+
|
189
|
+
var previousFirstRow = tbody.getFirst();
|
190
|
+
while ( thead.getChildCount() > 0 )
|
191
|
+
{
|
192
|
+
theRow = thead.getFirst();
|
193
|
+
for ( i = 0; i < theRow.getChildCount() ; i++ )
|
194
|
+
{
|
195
|
+
var newCell = theRow.getChild( i );
|
196
|
+
if ( newCell.type == CKEDITOR.NODE_ELEMENT )
|
197
|
+
{
|
198
|
+
newCell.renameNode( 'td' );
|
199
|
+
newCell.removeAttribute( 'scope' );
|
200
|
+
}
|
201
|
+
}
|
202
|
+
theRow.insertBefore( previousFirstRow );
|
203
|
+
}
|
204
|
+
thead.remove();
|
205
|
+
}
|
206
|
+
|
207
|
+
// Should we make all first cells in a row TH?
|
208
|
+
if ( !this.hasColumnHeaders && ( headers == 'col' || headers == 'both' ) )
|
209
|
+
{
|
210
|
+
for ( row = 0 ; row < table.$.rows.length ; row++ )
|
211
|
+
{
|
212
|
+
newCell = new CKEDITOR.dom.element( table.$.rows[ row ].cells[ 0 ] );
|
213
|
+
newCell.renameNode( 'th' );
|
214
|
+
newCell.setAttribute( 'scope', 'row' );
|
215
|
+
}
|
216
|
+
}
|
217
|
+
|
218
|
+
// Should we make all first TH-cells in a row make TD? If 'yes' we do it the other way round :-)
|
219
|
+
if ( ( this.hasColumnHeaders ) && !( headers == 'col' || headers == 'both' ) )
|
220
|
+
{
|
221
|
+
for ( i = 0 ; i < table.$.rows.length ; i++ )
|
222
|
+
{
|
223
|
+
row = new CKEDITOR.dom.element( table.$.rows[i] );
|
224
|
+
if ( row.getParent().getName() == 'tbody' )
|
225
|
+
{
|
226
|
+
newCell = new CKEDITOR.dom.element( row.$.cells[0] );
|
227
|
+
newCell.renameNode( 'td' );
|
228
|
+
newCell.removeAttribute( 'scope' );
|
229
|
+
}
|
230
|
+
}
|
231
|
+
}
|
232
|
+
|
233
|
+
// Set the width and height.
|
234
|
+
info.txtHeight ? table.setStyle( 'height', info.txtHeight ) : table.removeStyle( 'height' );
|
235
|
+
info.txtWidth ? table.setStyle( 'width', info.txtWidth ) : table.removeStyle( 'width' );
|
236
|
+
|
237
|
+
if ( !table.getAttribute( 'style' ) )
|
238
|
+
table.removeAttribute( 'style' );
|
239
|
+
}
|
240
|
+
|
241
|
+
// Insert the table element if we're creating one.
|
242
|
+
if ( !this._.selectedElement )
|
243
|
+
{
|
244
|
+
editor.insertElement( table );
|
245
|
+
// Override the default cursor position after insertElement to place
|
246
|
+
// cursor inside the first cell (#7959), IE needs a while.
|
247
|
+
setTimeout( function()
|
248
|
+
{
|
249
|
+
var firstCell = new CKEDITOR.dom.element( table.$.rows[ 0 ].cells[ 0 ] );
|
250
|
+
var range = new CKEDITOR.dom.range( editor.document );
|
251
|
+
range.moveToPosition( firstCell, CKEDITOR.POSITION_AFTER_START );
|
252
|
+
range.select( 1 );
|
253
|
+
}, 0 );
|
254
|
+
}
|
255
|
+
// Properly restore the selection, (#4822) but don't break
|
256
|
+
// because of this, e.g. updated table caption.
|
257
|
+
else
|
258
|
+
try { selection.selectBookmarks( bms ); } catch( er ){}
|
259
|
+
},
|
260
|
+
contents : [
|
261
|
+
{
|
262
|
+
id : 'info',
|
263
|
+
label : editor.lang.table.title,
|
264
|
+
elements :
|
265
|
+
[
|
266
|
+
{
|
267
|
+
type : 'hbox',
|
268
|
+
widths : [ null, null ],
|
269
|
+
styles : [ 'vertical-align:top' ],
|
270
|
+
children :
|
271
|
+
[
|
272
|
+
{
|
273
|
+
type : 'vbox',
|
274
|
+
padding : 0,
|
275
|
+
children :
|
276
|
+
[
|
277
|
+
{
|
278
|
+
type : 'text',
|
279
|
+
id : 'txtRows',
|
280
|
+
'default' : 3,
|
281
|
+
label : editor.lang.table.rows,
|
282
|
+
required : true,
|
283
|
+
controlStyle : 'width:5em',
|
284
|
+
validate : function()
|
285
|
+
{
|
286
|
+
var pass = true,
|
287
|
+
value = this.getValue();
|
288
|
+
pass = pass && CKEDITOR.dialog.validate.integer()( value )
|
289
|
+
&& value > 0;
|
290
|
+
if ( !pass )
|
291
|
+
{
|
292
|
+
alert( editor.lang.table.invalidRows );
|
293
|
+
this.select();
|
294
|
+
}
|
295
|
+
return pass;
|
296
|
+
},
|
297
|
+
setup : function( selectedElement )
|
298
|
+
{
|
299
|
+
this.setValue( selectedElement.$.rows.length );
|
300
|
+
},
|
301
|
+
commit : commitValue
|
302
|
+
},
|
303
|
+
{
|
304
|
+
type : 'text',
|
305
|
+
id : 'txtCols',
|
306
|
+
'default' : 2,
|
307
|
+
label : editor.lang.table.columns,
|
308
|
+
required : true,
|
309
|
+
controlStyle : 'width:5em',
|
310
|
+
validate : function()
|
311
|
+
{
|
312
|
+
var pass = true,
|
313
|
+
value = this.getValue();
|
314
|
+
pass = pass && CKEDITOR.dialog.validate.integer()( value )
|
315
|
+
&& value > 0;
|
316
|
+
if ( !pass )
|
317
|
+
{
|
318
|
+
alert( editor.lang.table.invalidCols );
|
319
|
+
this.select();
|
320
|
+
}
|
321
|
+
return pass;
|
322
|
+
},
|
323
|
+
setup : function( selectedTable )
|
324
|
+
{
|
325
|
+
this.setValue( tableColumns( selectedTable ) );
|
326
|
+
},
|
327
|
+
commit : commitValue
|
328
|
+
},
|
329
|
+
{
|
330
|
+
type : 'html',
|
331
|
+
html : ' '
|
332
|
+
},
|
333
|
+
{
|
334
|
+
type : 'select',
|
335
|
+
id : 'selHeaders',
|
336
|
+
'default' : '',
|
337
|
+
label : editor.lang.table.headers,
|
338
|
+
items :
|
339
|
+
[
|
340
|
+
[ editor.lang.table.headersNone, '' ],
|
341
|
+
[ editor.lang.table.headersRow, 'row' ],
|
342
|
+
[ editor.lang.table.headersColumn, 'col' ],
|
343
|
+
[ editor.lang.table.headersBoth, 'both' ]
|
344
|
+
],
|
345
|
+
setup : function( selectedTable )
|
346
|
+
{
|
347
|
+
// Fill in the headers field.
|
348
|
+
var dialog = this.getDialog();
|
349
|
+
dialog.hasColumnHeaders = true;
|
350
|
+
|
351
|
+
// Check if all the first cells in every row are TH
|
352
|
+
for ( var row = 0 ; row < selectedTable.$.rows.length ; row++ )
|
353
|
+
{
|
354
|
+
// If just one cell isn't a TH then it isn't a header column
|
355
|
+
var headCell = selectedTable.$.rows[row].cells[0];
|
356
|
+
if ( headCell && headCell.nodeName.toLowerCase() != 'th' )
|
357
|
+
{
|
358
|
+
dialog.hasColumnHeaders = false;
|
359
|
+
break;
|
360
|
+
}
|
361
|
+
}
|
362
|
+
|
363
|
+
// Check if the table contains <thead>.
|
364
|
+
if ( ( selectedTable.$.tHead !== null) )
|
365
|
+
this.setValue( dialog.hasColumnHeaders ? 'both' : 'row' );
|
366
|
+
else
|
367
|
+
this.setValue( dialog.hasColumnHeaders ? 'col' : '' );
|
368
|
+
},
|
369
|
+
commit : commitValue
|
370
|
+
},
|
371
|
+
{
|
372
|
+
type : 'text',
|
373
|
+
id : 'txtBorder',
|
374
|
+
'default' : 1,
|
375
|
+
label : editor.lang.table.border,
|
376
|
+
controlStyle : 'width:3em',
|
377
|
+
validate : CKEDITOR.dialog.validate['number']( editor.lang.table.invalidBorder ),
|
378
|
+
setup : function( selectedTable )
|
379
|
+
{
|
380
|
+
this.setValue( selectedTable.getAttribute( 'border' ) || '' );
|
381
|
+
},
|
382
|
+
commit : function( data, selectedTable )
|
383
|
+
{
|
384
|
+
if ( this.getValue() )
|
385
|
+
selectedTable.setAttribute( 'border', this.getValue() );
|
386
|
+
else
|
387
|
+
selectedTable.removeAttribute( 'border' );
|
388
|
+
}
|
389
|
+
},
|
390
|
+
{
|
391
|
+
id : 'cmbAlign',
|
392
|
+
type : 'select',
|
393
|
+
'default' : '',
|
394
|
+
label : editor.lang.common.align,
|
395
|
+
items :
|
396
|
+
[
|
397
|
+
[ editor.lang.common.notSet , ''],
|
398
|
+
[ editor.lang.common.alignLeft , 'left'],
|
399
|
+
[ editor.lang.common.alignCenter , 'center'],
|
400
|
+
[ editor.lang.common.alignRight , 'right']
|
401
|
+
],
|
402
|
+
setup : function( selectedTable )
|
403
|
+
{
|
404
|
+
this.setValue( selectedTable.getAttribute( 'align' ) || '' );
|
405
|
+
},
|
406
|
+
commit : function( data, selectedTable )
|
407
|
+
{
|
408
|
+
if ( this.getValue() )
|
409
|
+
selectedTable.setAttribute( 'align', this.getValue() );
|
410
|
+
else
|
411
|
+
selectedTable.removeAttribute( 'align' );
|
412
|
+
}
|
413
|
+
}
|
414
|
+
]
|
415
|
+
},
|
416
|
+
{
|
417
|
+
type : 'vbox',
|
418
|
+
padding : 0,
|
419
|
+
children :
|
420
|
+
[
|
421
|
+
{
|
422
|
+
type : 'hbox',
|
423
|
+
widths : [ '5em' ],
|
424
|
+
children :
|
425
|
+
[
|
426
|
+
{
|
427
|
+
type : 'text',
|
428
|
+
id : 'txtWidth',
|
429
|
+
controlStyle : 'width:5em',
|
430
|
+
label : editor.lang.common.width,
|
431
|
+
title : editor.lang.common.cssLengthTooltip,
|
432
|
+
'default' : 500,
|
433
|
+
getValue : defaultToPixel,
|
434
|
+
validate : CKEDITOR.dialog.validate.cssLength( editor.lang.common.invalidCssLength.replace( '%1', editor.lang.common.width ) ),
|
435
|
+
onChange : function()
|
436
|
+
{
|
437
|
+
var styles = this.getDialog().getContentElement( 'advanced', 'advStyles' );
|
438
|
+
styles && styles.updateStyle( 'width', this.getValue() );
|
439
|
+
},
|
440
|
+
setup : function( selectedTable )
|
441
|
+
{
|
442
|
+
var val = selectedTable.getStyle( 'width' );
|
443
|
+
val && this.setValue( val );
|
444
|
+
},
|
445
|
+
commit : commitValue
|
446
|
+
}
|
447
|
+
]
|
448
|
+
},
|
449
|
+
{
|
450
|
+
type : 'hbox',
|
451
|
+
widths : [ '5em' ],
|
452
|
+
children :
|
453
|
+
[
|
454
|
+
{
|
455
|
+
type : 'text',
|
456
|
+
id : 'txtHeight',
|
457
|
+
controlStyle : 'width:5em',
|
458
|
+
label : editor.lang.common.height,
|
459
|
+
title : editor.lang.common.cssLengthTooltip,
|
460
|
+
'default' : '',
|
461
|
+
getValue : defaultToPixel,
|
462
|
+
validate : CKEDITOR.dialog.validate.cssLength( editor.lang.common.invalidCssLength.replace( '%1', editor.lang.common.height ) ),
|
463
|
+
onChange : function()
|
464
|
+
{
|
465
|
+
var styles = this.getDialog().getContentElement( 'advanced', 'advStyles' );
|
466
|
+
styles && styles.updateStyle( 'height', this.getValue() );
|
467
|
+
},
|
468
|
+
|
469
|
+
setup : function( selectedTable )
|
470
|
+
{
|
471
|
+
var val = selectedTable.getStyle( 'width' );
|
472
|
+
val && this.setValue( val );
|
473
|
+
},
|
474
|
+
commit : commitValue
|
475
|
+
}
|
476
|
+
]
|
477
|
+
},
|
478
|
+
{
|
479
|
+
type : 'html',
|
480
|
+
html : ' '
|
481
|
+
},
|
482
|
+
{
|
483
|
+
type : 'text',
|
484
|
+
id : 'txtCellSpace',
|
485
|
+
controlStyle : 'width:3em',
|
486
|
+
label : editor.lang.table.cellSpace,
|
487
|
+
'default' : 1,
|
488
|
+
validate : CKEDITOR.dialog.validate.number( editor.lang.table.invalidCellSpacing ),
|
489
|
+
setup : function( selectedTable )
|
490
|
+
{
|
491
|
+
this.setValue( selectedTable.getAttribute( 'cellSpacing' ) || '' );
|
492
|
+
},
|
493
|
+
commit : function( data, selectedTable )
|
494
|
+
{
|
495
|
+
if ( this.getValue() )
|
496
|
+
selectedTable.setAttribute( 'cellSpacing', this.getValue() );
|
497
|
+
else
|
498
|
+
selectedTable.removeAttribute( 'cellSpacing' );
|
499
|
+
}
|
500
|
+
},
|
501
|
+
{
|
502
|
+
type : 'text',
|
503
|
+
id : 'txtCellPad',
|
504
|
+
controlStyle : 'width:3em',
|
505
|
+
label : editor.lang.table.cellPad,
|
506
|
+
'default' : 1,
|
507
|
+
validate : CKEDITOR.dialog.validate.number( editor.lang.table.invalidCellPadding ),
|
508
|
+
setup : function( selectedTable )
|
509
|
+
{
|
510
|
+
this.setValue( selectedTable.getAttribute( 'cellPadding' ) || '' );
|
511
|
+
},
|
512
|
+
commit : function( data, selectedTable )
|
513
|
+
{
|
514
|
+
if ( this.getValue() )
|
515
|
+
selectedTable.setAttribute( 'cellPadding', this.getValue() );
|
516
|
+
else
|
517
|
+
selectedTable.removeAttribute( 'cellPadding' );
|
518
|
+
}
|
519
|
+
}
|
520
|
+
]
|
521
|
+
}
|
522
|
+
]
|
523
|
+
},
|
524
|
+
{
|
525
|
+
type : 'html',
|
526
|
+
align : 'right',
|
527
|
+
html : ''
|
528
|
+
},
|
529
|
+
{
|
530
|
+
type : 'vbox',
|
531
|
+
padding : 0,
|
532
|
+
children :
|
533
|
+
[
|
534
|
+
{
|
535
|
+
type : 'text',
|
536
|
+
id : 'txtCaption',
|
537
|
+
label : editor.lang.table.caption,
|
538
|
+
setup : function( selectedTable )
|
539
|
+
{
|
540
|
+
this.enable();
|
541
|
+
|
542
|
+
var nodeList = selectedTable.getElementsByTag( 'caption' );
|
543
|
+
if ( nodeList.count() > 0 )
|
544
|
+
{
|
545
|
+
var caption = nodeList.getItem( 0 );
|
546
|
+
var firstElementChild = caption.getFirst( CKEDITOR.dom.walker.nodeType( CKEDITOR.NODE_ELEMENT ) );
|
547
|
+
|
548
|
+
if ( firstElementChild && !firstElementChild.equals( caption.getBogus() ) )
|
549
|
+
{
|
550
|
+
this.disable();
|
551
|
+
this.setValue( caption.getText() );
|
552
|
+
return;
|
553
|
+
}
|
554
|
+
|
555
|
+
caption = CKEDITOR.tools.trim( caption.getText() );
|
556
|
+
this.setValue( caption );
|
557
|
+
}
|
558
|
+
},
|
559
|
+
commit : function( data, table )
|
560
|
+
{
|
561
|
+
if ( !this.isEnabled() )
|
562
|
+
return;
|
563
|
+
|
564
|
+
var caption = this.getValue(),
|
565
|
+
captionElement = table.getElementsByTag( 'caption' );
|
566
|
+
if ( caption )
|
567
|
+
{
|
568
|
+
if ( captionElement.count() > 0 )
|
569
|
+
{
|
570
|
+
captionElement = captionElement.getItem( 0 );
|
571
|
+
captionElement.setHtml( '' );
|
572
|
+
}
|
573
|
+
else
|
574
|
+
{
|
575
|
+
captionElement = new CKEDITOR.dom.element( 'caption', editor.document );
|
576
|
+
if ( table.getChildCount() )
|
577
|
+
captionElement.insertBefore( table.getFirst() );
|
578
|
+
else
|
579
|
+
captionElement.appendTo( table );
|
580
|
+
}
|
581
|
+
captionElement.append( new CKEDITOR.dom.text( caption, editor.document ) );
|
582
|
+
}
|
583
|
+
else if ( captionElement.count() > 0 )
|
584
|
+
{
|
585
|
+
for ( var i = captionElement.count() - 1 ; i >= 0 ; i-- )
|
586
|
+
captionElement.getItem( i ).remove();
|
587
|
+
}
|
588
|
+
}
|
589
|
+
},
|
590
|
+
{
|
591
|
+
type : 'text',
|
592
|
+
id : 'txtSummary',
|
593
|
+
label : editor.lang.table.summary,
|
594
|
+
setup : function( selectedTable )
|
595
|
+
{
|
596
|
+
this.setValue( selectedTable.getAttribute( 'summary' ) || '' );
|
597
|
+
},
|
598
|
+
commit : function( data, selectedTable )
|
599
|
+
{
|
600
|
+
if ( this.getValue() )
|
601
|
+
selectedTable.setAttribute( 'summary', this.getValue() );
|
602
|
+
else
|
603
|
+
selectedTable.removeAttribute( 'summary' );
|
604
|
+
}
|
605
|
+
}
|
606
|
+
]
|
607
|
+
}
|
608
|
+
]
|
609
|
+
},
|
610
|
+
dialogadvtab && dialogadvtab.createAdvancedTab( editor )
|
611
|
+
]
|
612
|
+
};
|
613
|
+
}
|
614
|
+
|
615
|
+
CKEDITOR.dialog.add( 'table', function( editor )
|
616
|
+
{
|
617
|
+
return tableDialog( editor, 'table' );
|
618
|
+
} );
|
619
|
+
CKEDITOR.dialog.add( 'tableProperties', function( editor )
|
620
|
+
{
|
621
|
+
return tableDialog( editor, 'tableProperties' );
|
622
|
+
} );
|
623
|
+
})();
|