spiderfw 0.6.38 → 0.6.39
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/CHANGELOG +23 -0
- data/VERSION +1 -1
- data/apps/core/admin/views/admin.layout.shtml +6 -0
- data/apps/core/auth/controllers/login_controller.rb +1 -1
- data/apps/core/components/assets.rb +55 -6
- data/apps/core/components/public/bootstrap/scss/_variables.scss +5 -2
- data/apps/core/components/public/bootstrap/scss/bootstrap.css +942 -236
- data/apps/core/components/public/bootstrap/scss/responsive.css +187 -30
- data/apps/core/components/public/css/tinymce/skins/lightgray/AbsoluteLayout.less +17 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Animations.less +10 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Button.less +172 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ButtonGroup.less +71 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Checkbox.less +49 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ColorBox.less +6 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ColorButton.less +72 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ColorPicker.less +80 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ComboBox.less +39 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Container.less +9 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Content.Inline.less +4 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Content.Objects.less +166 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Content.less +27 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/CropRect.less +54 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/FieldSet.less +15 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/FitLayout.less +9 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/FloatPanel.less +69 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/FlowLayout.less +36 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Icons.Ie7.less +136 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Icons.less +180 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Iframe.less +6 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ImagePanel.less +20 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/InfoBox.less +71 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Label.less +38 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ListBox.less +26 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Menu.less +34 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/MenuBar.less +32 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/MenuButton.less +34 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/MenuItem.less +142 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Mixins.less +54 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Notification.less +144 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Panel.less +7 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Path.less +45 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Progress.less +34 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Radio.less +1 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Reset.less +32 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ResizeHandle.less +18 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Scrollable.less +44 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/SelectBox.less +6 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Slider.less +29 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Spacer.less +5 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/SplitButton.less +49 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/StackLayout.less +5 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/TabPanel.less +44 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/TextBox.less +41 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Throbber.less +19 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/TinyMCE.less +159 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ToolTip.less +129 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Variables.less +214 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Window.less +127 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/content.inline.min.css +1 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/content.min.css +1 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/readme.md +1 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce-small.eot +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce-small.json +1277 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce-small.svg +63 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce-small.ttf +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce-small.woff +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce.json +3381 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce.svg +129 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/img/anchor.gif +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/img/loader.gif +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/img/object.gif +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/img/trans.gif +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/skin.dev.less +46 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/skin.ie7.dev.less +46 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/skin.ie7.less +2542 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/skin.ie7.min.css +1 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/skin.less +2586 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/skin.min.css +1 -0
- data/apps/core/components/public/js/bootbox_2/bootbox.js +551 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-it-min.js +4 -0
- data/apps/core/components/public/js/spider.js +7 -3
- data/apps/core/components/public/js/tinymce/classes/AddOnManager.js +265 -0
- data/apps/core/components/public/js/tinymce/classes/Compat.js +90 -0
- data/apps/core/components/public/js/tinymce/classes/DragDropOverrides.js +224 -0
- data/apps/core/components/public/js/tinymce/classes/Editor.js +2221 -0
- data/apps/core/components/public/js/tinymce/classes/EditorCommands.js +1028 -0
- data/apps/core/components/public/js/tinymce/classes/EditorManager.js +715 -0
- data/apps/core/components/public/js/tinymce/classes/EditorObservable.js +204 -0
- data/apps/core/components/public/js/tinymce/classes/EditorUpload.js +191 -0
- data/apps/core/components/public/js/tinymce/classes/EnterKey.js +676 -0
- data/apps/core/components/public/js/tinymce/classes/Env.js +177 -0
- data/apps/core/components/public/js/tinymce/classes/FocusManager.js +266 -0
- data/apps/core/components/public/js/tinymce/classes/ForceBlocks.js +138 -0
- data/apps/core/components/public/js/tinymce/classes/Formatter.js +2378 -0
- data/apps/core/components/public/js/tinymce/classes/LegacyInput.js +82 -0
- data/apps/core/components/public/js/tinymce/classes/Mode.js +54 -0
- data/apps/core/components/public/js/tinymce/classes/NodeChange.js +154 -0
- data/apps/core/components/public/js/tinymce/classes/NotificationManager.js +156 -0
- data/apps/core/components/public/js/tinymce/classes/Register.js +34 -0
- data/apps/core/components/public/js/tinymce/classes/SelectionOverrides.js +810 -0
- data/apps/core/components/public/js/tinymce/classes/Shortcuts.js +172 -0
- data/apps/core/components/public/js/tinymce/classes/UndoManager.js +346 -0
- data/apps/core/components/public/js/tinymce/classes/WindowManager.js +278 -0
- data/apps/core/components/public/js/tinymce/classes/caret/CaretBookmark.js +263 -0
- data/apps/core/components/public/js/tinymce/classes/caret/CaretCandidate.js +86 -0
- data/apps/core/components/public/js/tinymce/classes/caret/CaretContainer.js +151 -0
- data/apps/core/components/public/js/tinymce/classes/caret/CaretPosition.js +371 -0
- data/apps/core/components/public/js/tinymce/classes/caret/CaretUtils.js +302 -0
- data/apps/core/components/public/js/tinymce/classes/caret/CaretWalker.js +215 -0
- data/apps/core/components/public/js/tinymce/classes/caret/FakeCaret.js +192 -0
- data/apps/core/components/public/js/tinymce/classes/caret/LineUtils.js +135 -0
- data/apps/core/components/public/js/tinymce/classes/caret/LineWalker.js +166 -0
- data/apps/core/components/public/js/tinymce/classes/data/Binding.js +79 -0
- data/apps/core/components/public/js/tinymce/classes/data/ObservableArray.js +196 -0
- data/apps/core/components/public/js/tinymce/classes/data/ObservableObject.js +194 -0
- data/apps/core/components/public/js/tinymce/classes/dom/BookmarkManager.js +456 -0
- data/apps/core/components/public/js/tinymce/classes/dom/ControlSelection.js +634 -0
- data/apps/core/components/public/js/tinymce/classes/dom/DOMUtils.js +1853 -0
- data/apps/core/components/public/js/tinymce/classes/dom/Dimensions.js +64 -0
- data/apps/core/components/public/js/tinymce/classes/dom/DomQuery.js +1578 -0
- data/apps/core/components/public/js/tinymce/classes/dom/ElementUtils.js +118 -0
- data/apps/core/components/public/js/tinymce/classes/dom/EventUtils.js +583 -0
- data/apps/core/components/public/js/tinymce/classes/dom/NodePath.js +50 -0
- data/apps/core/components/public/js/tinymce/classes/dom/NodeType.js +110 -0
- data/apps/core/components/public/js/tinymce/classes/dom/Range.js +785 -0
- data/apps/core/components/public/js/tinymce/classes/dom/RangeUtils.js +628 -0
- data/apps/core/components/public/js/tinymce/classes/dom/ScriptLoader.js +254 -0
- data/apps/core/components/public/js/tinymce/classes/dom/Selection.js +1008 -0
- data/apps/core/components/public/js/tinymce/classes/dom/Serializer.js +506 -0
- data/apps/core/components/public/js/tinymce/classes/dom/Sizzle.jQuery.js +23 -0
- data/apps/core/components/public/js/tinymce/classes/dom/Sizzle.js +2039 -0
- data/apps/core/components/public/js/tinymce/classes/dom/StyleSheetLoader.js +190 -0
- data/apps/core/components/public/js/tinymce/classes/dom/TreeWalker.js +127 -0
- data/apps/core/components/public/js/tinymce/classes/dom/TridentSelection.js +508 -0
- data/apps/core/components/public/js/tinymce/classes/file/BlobCache.js +72 -0
- data/apps/core/components/public/js/tinymce/classes/file/Conversions.js +106 -0
- data/apps/core/components/public/js/tinymce/classes/file/ImageScanner.js +145 -0
- data/apps/core/components/public/js/tinymce/classes/file/Uploader.js +193 -0
- data/apps/core/components/public/js/tinymce/classes/fmt/Hooks.js +66 -0
- data/apps/core/components/public/js/tinymce/classes/fmt/Preview.js +151 -0
- data/apps/core/components/public/js/tinymce/classes/geom/ClientRect.js +136 -0
- data/apps/core/components/public/js/tinymce/classes/geom/Rect.js +214 -0
- data/apps/core/components/public/js/tinymce/classes/html/DomParser.js +822 -0
- data/apps/core/components/public/js/tinymce/classes/html/Entities.js +268 -0
- data/apps/core/components/public/js/tinymce/classes/html/Node.js +496 -0
- data/apps/core/components/public/js/tinymce/classes/html/SaxParser.js +474 -0
- data/apps/core/components/public/js/tinymce/classes/html/Schema.js +1004 -0
- data/apps/core/components/public/js/tinymce/classes/html/Serializer.js +158 -0
- data/apps/core/components/public/js/tinymce/classes/html/Styles.js +363 -0
- data/apps/core/components/public/js/tinymce/classes/html/Writer.js +199 -0
- data/apps/core/components/public/js/tinymce/classes/jquery.tinymce.js +377 -0
- data/apps/core/components/public/js/tinymce/classes/text/ExtendingChar.js +53 -0
- data/apps/core/components/public/js/tinymce/classes/text/Zwsp.js +36 -0
- data/apps/core/components/public/js/tinymce/classes/ui/AbsoluteLayout.js +63 -0
- data/apps/core/components/public/js/tinymce/classes/ui/BoxUtils.js +98 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Button.js +199 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ButtonGroup.js +62 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Checkbox.js +162 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ClassList.js +149 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Collection.js +438 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ColorBox.js +72 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ColorButton.js +124 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ColorPicker.js +206 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ComboBox.js +306 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Container.js +506 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Control.js +1301 -0
- data/apps/core/components/public/js/tinymce/classes/ui/DomUtils.js +107 -0
- data/apps/core/components/public/js/tinymce/classes/ui/DragHelper.js +144 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ElementPath.js +79 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Factory.js +105 -0
- data/apps/core/components/public/js/tinymce/classes/ui/FieldSet.js +59 -0
- data/apps/core/components/public/js/tinymce/classes/ui/FilePicker.js +85 -0
- data/apps/core/components/public/js/tinymce/classes/ui/FitLayout.js +48 -0
- data/apps/core/components/public/js/tinymce/classes/ui/FlexLayout.js +246 -0
- data/apps/core/components/public/js/tinymce/classes/ui/FloatPanel.js +409 -0
- data/apps/core/components/public/js/tinymce/classes/ui/FlowLayout.js +46 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Form.js +157 -0
- data/apps/core/components/public/js/tinymce/classes/ui/FormItem.js +56 -0
- data/apps/core/components/public/js/tinymce/classes/ui/FormatControls.js +535 -0
- data/apps/core/components/public/js/tinymce/classes/ui/GridLayout.js +233 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Iframe.js +85 -0
- data/apps/core/components/public/js/tinymce/classes/ui/InfoBox.js +93 -0
- data/apps/core/components/public/js/tinymce/classes/ui/KeyboardNavigation.js +406 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Label.js +144 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Layout.js +120 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ListBox.js +152 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Menu.js +195 -0
- data/apps/core/components/public/js/tinymce/classes/ui/MenuBar.js +33 -0
- data/apps/core/components/public/js/tinymce/classes/ui/MenuButton.js +268 -0
- data/apps/core/components/public/js/tinymce/classes/ui/MenuItem.js +336 -0
- data/apps/core/components/public/js/tinymce/classes/ui/MessageBox.js +202 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Movable.js +200 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Notification.js +154 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Panel.js +67 -0
- data/apps/core/components/public/js/tinymce/classes/ui/PanelButton.js +114 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Path.js +127 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Progress.js +81 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Radio.js +29 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ReflowQueue.js +79 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Resizable.js +68 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ResizeHandle.js +86 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Scrollable.js +141 -0
- data/apps/core/components/public/js/tinymce/classes/ui/SelectBox.js +106 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Selector.js +369 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Slider.js +161 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Spacer.js +39 -0
- data/apps/core/components/public/js/tinymce/classes/ui/SplitButton.js +146 -0
- data/apps/core/components/public/js/tinymce/classes/ui/StackLayout.js +34 -0
- data/apps/core/components/public/js/tinymce/classes/ui/TabPanel.js +178 -0
- data/apps/core/components/public/js/tinymce/classes/ui/TextBox.js +208 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Throbber.js +88 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Toolbar.js +56 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Tooltip.js +73 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Widget.js +151 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Window.js +474 -0
- data/apps/core/components/public/js/tinymce/classes/util/Arr.js +153 -0
- data/apps/core/components/public/js/tinymce/classes/util/Class.js +167 -0
- data/apps/core/components/public/js/tinymce/classes/util/Color.js +235 -0
- data/apps/core/components/public/js/tinymce/classes/util/Delay.js +191 -0
- data/apps/core/components/public/js/tinymce/classes/util/EventDispatcher.js +294 -0
- data/apps/core/components/public/js/tinymce/classes/util/Fun.js +87 -0
- data/apps/core/components/public/js/tinymce/classes/util/I18n.js +116 -0
- data/apps/core/components/public/js/tinymce/classes/util/JSON.js +109 -0
- data/apps/core/components/public/js/tinymce/classes/util/JSONP.js +38 -0
- data/apps/core/components/public/js/tinymce/classes/util/JSONRequest.js +110 -0
- data/apps/core/components/public/js/tinymce/classes/util/LocalStorage.js +213 -0
- data/apps/core/components/public/js/tinymce/classes/util/Observable.js +129 -0
- data/apps/core/components/public/js/tinymce/classes/util/Promise.js +200 -0
- data/apps/core/components/public/js/tinymce/classes/util/Quirks.js +1701 -0
- data/apps/core/components/public/js/tinymce/classes/util/Tools.js +442 -0
- data/apps/core/components/public/js/tinymce/classes/util/URI.js +411 -0
- data/apps/core/components/public/js/tinymce/classes/util/VK.js +37 -0
- data/apps/core/components/public/js/tinymce/classes/util/XHR.js +110 -0
- data/apps/core/components/public/js/tinymce/jquery.tinymce.min.js +1 -0
- data/apps/core/components/public/js/tinymce/langs/it.js +219 -0
- data/apps/core/components/public/js/tinymce/langs/readme.md +3 -0
- data/apps/core/components/public/js/tinymce/license.txt +504 -0
- data/apps/core/components/public/js/tinymce/plugins/advlist/plugin.js +97 -0
- data/apps/core/components/public/js/tinymce/plugins/advlist/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/anchor/plugin.js +55 -0
- data/apps/core/components/public/js/tinymce/plugins/anchor/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/autolink/plugin.js +204 -0
- data/apps/core/components/public/js/tinymce/plugins/autolink/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/autoresize/plugin.js +162 -0
- data/apps/core/components/public/js/tinymce/plugins/autoresize/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/autosave/plugin.js +165 -0
- data/apps/core/components/public/js/tinymce/plugins/autosave/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/bbcode/plugin.js +123 -0
- data/apps/core/components/public/js/tinymce/plugins/bbcode/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/charmap/plugin.js +450 -0
- data/apps/core/components/public/js/tinymce/plugins/charmap/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/code/plugin.js +60 -0
- data/apps/core/components/public/js/tinymce/plugins/code/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/codesample/classes/Dialog.js +121 -0
- data/apps/core/components/public/js/tinymce/plugins/codesample/classes/Plugin.js +95 -0
- data/apps/core/components/public/js/tinymce/plugins/codesample/classes/Prism.js +937 -0
- data/apps/core/components/public/js/tinymce/plugins/codesample/classes/Utils.js +33 -0
- data/apps/core/components/public/js/tinymce/plugins/codesample/css/prism.css +138 -0
- data/apps/core/components/public/js/tinymce/plugins/codesample/plugin.dev.js +141 -0
- data/apps/core/components/public/js/tinymce/plugins/codesample/plugin.js +1299 -0
- data/apps/core/components/public/js/tinymce/plugins/codesample/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/colorpicker/plugin.js +112 -0
- data/apps/core/components/public/js/tinymce/plugins/colorpicker/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/css/dialog.css +118 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/img/buttons.png +0 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/img/icons.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/img/items.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/img/menu_arrow.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/img/menu_check.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/img/progress.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/img/tabs.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/plugin.js +297 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/tiny_mce_popup.js +542 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/utils/editable_selects.js +70 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/utils/form_utils.js +210 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/utils/mctabs.js +164 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/utils/validate.js +252 -0
- data/apps/core/components/public/js/tinymce/plugins/contextmenu/plugin.js +88 -0
- data/apps/core/components/public/js/tinymce/plugins/contextmenu/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/directionality/plugin.js +64 -0
- data/apps/core/components/public/js/tinymce/plugins/directionality/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-cool.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-cry.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-embarassed.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-frown.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-innocent.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-kiss.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-laughing.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-money-mouth.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-sealed.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-smile.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-surprised.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-tongue-out.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-undecided.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-wink.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-yell.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/plugin.js +65 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/example/dialog.html +8 -0
- data/apps/core/components/public/js/tinymce/plugins/example/plugin.js +68 -0
- data/apps/core/components/public/js/tinymce/plugins/example/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/example_dependency/plugin.js +22 -0
- data/apps/core/components/public/js/tinymce/plugins/example_dependency/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/fullpage/plugin.js +490 -0
- data/apps/core/components/public/js/tinymce/plugins/fullpage/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/fullscreen/plugin.js +154 -0
- data/apps/core/components/public/js/tinymce/plugins/fullscreen/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/hr/plugin.js +30 -0
- data/apps/core/components/public/js/tinymce/plugins/hr/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/image/plugin.js +630 -0
- data/apps/core/components/public/js/tinymce/plugins/image/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/config/bolt/atomic.js +6 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/config/bolt/browser.js +6 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/config/bolt/demo.js +8 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/config/bolt/prod.js +6 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/plugin.js +2668 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/src/demo/html/demo.html +16 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/src/demo/js/Demo.js +92 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/src/main/js/CropRect.js +214 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/src/main/js/Dialog.js +485 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/src/main/js/ImagePanel.js +218 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/src/main/js/Plugin.js +411 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/src/main/js/UndoStack.js +57 -0
- data/apps/core/components/public/js/tinymce/plugins/importcss/plugin.js +227 -0
- data/apps/core/components/public/js/tinymce/plugins/importcss/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/insertdatetime/plugin.js +121 -0
- data/apps/core/components/public/js/tinymce/plugins/insertdatetime/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/layer/plugin.js +225 -0
- data/apps/core/components/public/js/tinymce/plugins/layer/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/legacyoutput/plugin.js +211 -0
- data/apps/core/components/public/js/tinymce/plugins/legacyoutput/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/link/plugin.js +403 -0
- data/apps/core/components/public/js/tinymce/plugins/link/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/lists/plugin.js +885 -0
- data/apps/core/components/public/js/tinymce/plugins/lists/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/media/moxieplayer.swf +0 -0
- data/apps/core/components/public/js/tinymce/plugins/media/plugin.js +878 -0
- data/apps/core/components/public/js/tinymce/plugins/media/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/nonbreaking/plugin.js +53 -0
- data/apps/core/components/public/js/tinymce/plugins/nonbreaking/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/noneditable/plugin.js +101 -0
- data/apps/core/components/public/js/tinymce/plugins/noneditable/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/pagebreak/plugin.js +88 -0
- data/apps/core/components/public/js/tinymce/plugins/pagebreak/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/paste/classes/Clipboard.js +672 -0
- data/apps/core/components/public/js/tinymce/plugins/paste/classes/Plugin.js +121 -0
- data/apps/core/components/public/js/tinymce/plugins/paste/classes/Quirks.js +159 -0
- data/apps/core/components/public/js/tinymce/plugins/paste/classes/Utils.js +140 -0
- data/apps/core/components/public/js/tinymce/plugins/paste/classes/WordFilter.js +500 -0
- data/apps/core/components/public/js/tinymce/plugins/paste/plugin.dev.js +142 -0
- data/apps/core/components/public/js/tinymce/plugins/paste/plugin.js +1708 -0
- data/apps/core/components/public/js/tinymce/plugins/paste/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/preview/plugin.js +88 -0
- data/apps/core/components/public/js/tinymce/plugins/preview/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/print/plugin.js +32 -0
- data/apps/core/components/public/js/tinymce/plugins/print/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/save/plugin.js +98 -0
- data/apps/core/components/public/js/tinymce/plugins/save/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/searchreplace/plugin.js +609 -0
- data/apps/core/components/public/js/tinymce/plugins/searchreplace/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/spellchecker/classes/DomTextMatcher.js +480 -0
- data/apps/core/components/public/js/tinymce/plugins/spellchecker/classes/Plugin.js +439 -0
- data/apps/core/components/public/js/tinymce/plugins/spellchecker/plugin.dev.js +139 -0
- data/apps/core/components/public/js/tinymce/plugins/spellchecker/plugin.js +1026 -0
- data/apps/core/components/public/js/tinymce/plugins/spellchecker/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/tabfocus/plugin.js +120 -0
- data/apps/core/components/public/js/tinymce/plugins/tabfocus/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/table/classes/CellSelection.js +202 -0
- data/apps/core/components/public/js/tinymce/plugins/table/classes/Dialogs.js +824 -0
- data/apps/core/components/public/js/tinymce/plugins/table/classes/Plugin.js +599 -0
- data/apps/core/components/public/js/tinymce/plugins/table/classes/Quirks.js +400 -0
- data/apps/core/components/public/js/tinymce/plugins/table/classes/ResizeBars.js +984 -0
- data/apps/core/components/public/js/tinymce/plugins/table/classes/TableGrid.js +941 -0
- data/apps/core/components/public/js/tinymce/plugins/table/classes/Utils.js +36 -0
- data/apps/core/components/public/js/tinymce/plugins/table/plugin.dev.js +142 -0
- data/apps/core/components/public/js/tinymce/plugins/table/plugin.js +4106 -0
- data/apps/core/components/public/js/tinymce/plugins/table/plugin.min.js +2 -0
- data/apps/core/components/public/js/tinymce/plugins/template/plugin.js +270 -0
- data/apps/core/components/public/js/tinymce/plugins/template/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/textcolor/plugin.js +282 -0
- data/apps/core/components/public/js/tinymce/plugins/textcolor/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/textpattern/plugin.js +268 -0
- data/apps/core/components/public/js/tinymce/plugins/textpattern/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/css/visualblocks.css +135 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/address.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/article.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/aside.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/blockquote.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/div.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/dl.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/figure.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/h1.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/h2.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/h3.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/h4.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/h5.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/h6.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/hgroup.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/ol.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/p.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/pre.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/section.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/ul.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/plugin.js +86 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/visualchars/plugin.js +123 -0
- data/apps/core/components/public/js/tinymce/plugins/visualchars/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/wordcount/plugin.js +69 -0
- data/apps/core/components/public/js/tinymce/plugins/wordcount/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/AbsoluteLayout.less +17 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Animations.less +10 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Button.less +172 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ButtonGroup.less +71 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Checkbox.less +49 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ColorBox.less +6 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ColorButton.less +72 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ColorPicker.less +80 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ComboBox.less +39 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Container.less +9 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Content.Inline.less +4 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Content.Objects.less +166 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Content.less +27 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/CropRect.less +54 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/FieldSet.less +15 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/FitLayout.less +9 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/FloatPanel.less +69 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/FlowLayout.less +36 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Icons.Ie7.less +136 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Icons.less +180 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Iframe.less +6 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ImagePanel.less +20 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/InfoBox.less +71 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Label.less +38 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ListBox.less +26 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Menu.less +34 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/MenuBar.less +32 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/MenuButton.less +34 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/MenuItem.less +142 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Mixins.less +54 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Notification.less +144 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Panel.less +7 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Path.less +45 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Progress.less +34 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Radio.less +1 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Reset.less +32 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ResizeHandle.less +18 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Scrollable.less +44 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/SelectBox.less +6 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Slider.less +29 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Spacer.less +5 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/SplitButton.less +49 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/StackLayout.less +5 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/TabPanel.less +44 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/TextBox.less +41 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Throbber.less +19 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/TinyMCE.less +159 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ToolTip.less +129 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Variables.less +214 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Window.less +127 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/content.inline.min.css +1 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/content.min.css +1 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/readme.md +1 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce-small.eot +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce-small.json +1277 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce-small.svg +63 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce-small.woff +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce.json +3381 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce.svg +129 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/img/anchor.gif +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/img/loader.gif +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/img/object.gif +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/img/trans.gif +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/skin.dev.less +46 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/skin.ie7.dev.less +46 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/skin.ie7.less +2542 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/skin.ie7.min.css +1 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/skin.less +2586 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/skin.min.css +1 -0
- data/apps/core/components/public/js/tinymce/themes/modern/theme.js +878 -0
- data/apps/core/components/public/js/tinymce/themes/modern/theme.min.js +1 -0
- data/apps/core/components/public/js/tinymce/tinymce.dev.js +286 -0
- data/apps/core/components/public/js/tinymce/tinymce.js +45811 -0
- data/apps/core/components/public/js/tinymce/tinymce.min.js +13 -0
- data/apps/core/forms/widgets/form/form.rb +3 -1
- data/apps/core/forms/widgets/form/form.shtml +1 -0
- data/apps/core/forms/widgets/inputs/search_select/search_select.rb +1 -1
- data/apps/core/forms/widgets/inputs/select/select.rb +1 -1
- data/apps/core/forms/widgets/inputs/select/select.shtml +0 -1
- data/apps/messenger/backends/sms/skebby.rb +1 -1
- data/apps/messenger/controllers/mixins/messenger_helper.rb +23 -5
- data/lib/spiderfw/config/options/spider.rb +1 -1
- data/lib/spiderfw/controller/mixins/visual.rb +2 -0
- data/lib/spiderfw/http/adapters/rack.rb +10 -5
- data/lib/spiderfw/http/http.rb +4 -2
- data/lib/spiderfw/model/base_model.rb +4 -4
- data/lib/spiderfw/model/mappers/db_mapper.rb +4 -2
- data/lib/spiderfw/model/storage/db/adapters/mysql.rb +2 -1
- data/lib/spiderfw/model/storage/db/db_storage.rb +4 -0
- data/lib/spiderfw/spider.rb +6 -0
- data/lib/spiderfw/templates/layout.rb +1 -1
- data/lib/spiderfw/utils/monkey/object.rb +3 -0
- data/spider.gemspec +6 -2
- metadata +539 -42
- data/blueprints/.DS_Store +0 -0
@@ -0,0 +1,941 @@
|
|
1
|
+
/**
|
2
|
+
* TableGrid.js
|
3
|
+
*
|
4
|
+
* Released under LGPL License.
|
5
|
+
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved
|
6
|
+
*
|
7
|
+
* License: http://www.tinymce.com/license
|
8
|
+
* Contributing: http://www.tinymce.com/contributing
|
9
|
+
*/
|
10
|
+
|
11
|
+
/**
|
12
|
+
* This class creates a grid out of a table element. This
|
13
|
+
* makes it a whole lot easier to handle complex tables with
|
14
|
+
* col/row spans.
|
15
|
+
*
|
16
|
+
* @class tinymce.tableplugin.TableGrid
|
17
|
+
* @private
|
18
|
+
*/
|
19
|
+
define("tinymce/tableplugin/TableGrid", [
|
20
|
+
"tinymce/util/Tools",
|
21
|
+
"tinymce/Env",
|
22
|
+
"tinymce/tableplugin/Utils"
|
23
|
+
], function(Tools, Env, Utils) {
|
24
|
+
var each = Tools.each, getSpanVal = Utils.getSpanVal;
|
25
|
+
|
26
|
+
return function(editor, table, selectedCell) {
|
27
|
+
var grid, gridWidth, startPos, endPos, selection = editor.selection, dom = selection.dom;
|
28
|
+
|
29
|
+
function removeCellSelection() {
|
30
|
+
editor.$('td[data-mce-selected],th[data-mce-selected]').removeAttr('data-mce-selected');
|
31
|
+
}
|
32
|
+
|
33
|
+
function isEditorBody(node) {
|
34
|
+
return node === editor.getBody();
|
35
|
+
}
|
36
|
+
|
37
|
+
function getChildrenByName(node, names) {
|
38
|
+
if (!node) {
|
39
|
+
return [];
|
40
|
+
}
|
41
|
+
|
42
|
+
names = Tools.map(names.split(','), function(name) {
|
43
|
+
return name.toLowerCase();
|
44
|
+
});
|
45
|
+
|
46
|
+
return Tools.grep(node.childNodes, function(node) {
|
47
|
+
return Tools.inArray(names, node.nodeName.toLowerCase()) !== -1;
|
48
|
+
});
|
49
|
+
}
|
50
|
+
|
51
|
+
function buildGrid() {
|
52
|
+
var startY = 0;
|
53
|
+
|
54
|
+
grid = [];
|
55
|
+
gridWidth = 0;
|
56
|
+
|
57
|
+
each(['thead', 'tbody', 'tfoot'], function(part) {
|
58
|
+
var partElm = getChildrenByName(table, part)[0];
|
59
|
+
var rows = getChildrenByName(partElm, 'tr');
|
60
|
+
|
61
|
+
each(rows, function(tr, y) {
|
62
|
+
y += startY;
|
63
|
+
|
64
|
+
each(getChildrenByName(tr, 'td,th'), function(td, x) {
|
65
|
+
var x2, y2, rowspan, colspan;
|
66
|
+
|
67
|
+
// Skip over existing cells produced by rowspan
|
68
|
+
if (grid[y]) {
|
69
|
+
while (grid[y][x]) {
|
70
|
+
x++;
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
// Get col/rowspan from cell
|
75
|
+
rowspan = getSpanVal(td, 'rowspan');
|
76
|
+
colspan = getSpanVal(td, 'colspan');
|
77
|
+
|
78
|
+
// Fill out rowspan/colspan right and down
|
79
|
+
for (y2 = y; y2 < y + rowspan; y2++) {
|
80
|
+
if (!grid[y2]) {
|
81
|
+
grid[y2] = [];
|
82
|
+
}
|
83
|
+
|
84
|
+
for (x2 = x; x2 < x + colspan; x2++) {
|
85
|
+
grid[y2][x2] = {
|
86
|
+
part: part,
|
87
|
+
real: y2 == y && x2 == x,
|
88
|
+
elm: td,
|
89
|
+
rowspan: rowspan,
|
90
|
+
colspan: colspan
|
91
|
+
};
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
gridWidth = Math.max(gridWidth, x + 1);
|
96
|
+
});
|
97
|
+
});
|
98
|
+
|
99
|
+
startY += rows.length;
|
100
|
+
});
|
101
|
+
}
|
102
|
+
|
103
|
+
function fireNewRow(node) {
|
104
|
+
editor.fire('newrow', {
|
105
|
+
node: node
|
106
|
+
});
|
107
|
+
|
108
|
+
return node;
|
109
|
+
}
|
110
|
+
|
111
|
+
function fireNewCell(node) {
|
112
|
+
editor.fire('newcell', {
|
113
|
+
node: node
|
114
|
+
});
|
115
|
+
|
116
|
+
return node;
|
117
|
+
}
|
118
|
+
|
119
|
+
function cloneNode(node, children) {
|
120
|
+
node = node.cloneNode(children);
|
121
|
+
node.removeAttribute('id');
|
122
|
+
|
123
|
+
return node;
|
124
|
+
}
|
125
|
+
|
126
|
+
function getCell(x, y) {
|
127
|
+
var row;
|
128
|
+
|
129
|
+
row = grid[y];
|
130
|
+
if (row) {
|
131
|
+
return row[x];
|
132
|
+
}
|
133
|
+
}
|
134
|
+
|
135
|
+
function setSpanVal(td, name, val) {
|
136
|
+
if (td) {
|
137
|
+
val = parseInt(val, 10);
|
138
|
+
|
139
|
+
if (val === 1) {
|
140
|
+
td.removeAttribute(name, 1);
|
141
|
+
} else {
|
142
|
+
td.setAttribute(name, val, 1);
|
143
|
+
}
|
144
|
+
}
|
145
|
+
}
|
146
|
+
|
147
|
+
function isCellSelected(cell) {
|
148
|
+
return cell && (!!dom.getAttrib(cell.elm, 'data-mce-selected') || cell == selectedCell);
|
149
|
+
}
|
150
|
+
|
151
|
+
function getSelectedRows() {
|
152
|
+
var rows = [];
|
153
|
+
|
154
|
+
each(table.rows, function(row) {
|
155
|
+
each(row.cells, function(cell) {
|
156
|
+
if (dom.getAttrib(cell, 'data-mce-selected') || (selectedCell && cell == selectedCell.elm)) {
|
157
|
+
rows.push(row);
|
158
|
+
return false;
|
159
|
+
}
|
160
|
+
});
|
161
|
+
});
|
162
|
+
|
163
|
+
return rows;
|
164
|
+
}
|
165
|
+
|
166
|
+
function deleteTable() {
|
167
|
+
var rng = dom.createRng();
|
168
|
+
|
169
|
+
if (isEditorBody(table)) {
|
170
|
+
return;
|
171
|
+
}
|
172
|
+
|
173
|
+
rng.setStartAfter(table);
|
174
|
+
rng.setEndAfter(table);
|
175
|
+
|
176
|
+
selection.setRng(rng);
|
177
|
+
|
178
|
+
dom.remove(table);
|
179
|
+
}
|
180
|
+
|
181
|
+
function cloneCell(cell) {
|
182
|
+
var formatNode, cloneFormats = {};
|
183
|
+
|
184
|
+
if (editor.settings.table_clone_elements !== false) {
|
185
|
+
cloneFormats = Tools.makeMap(
|
186
|
+
(editor.settings.table_clone_elements || 'strong em b i span font h1 h2 h3 h4 h5 h6 p div').toUpperCase(),
|
187
|
+
/[ ,]/
|
188
|
+
);
|
189
|
+
}
|
190
|
+
|
191
|
+
// Clone formats
|
192
|
+
Tools.walk(cell, function(node) {
|
193
|
+
var curNode;
|
194
|
+
|
195
|
+
if (node.nodeType == 3) {
|
196
|
+
each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) {
|
197
|
+
if (!cloneFormats[node.nodeName]) {
|
198
|
+
return;
|
199
|
+
}
|
200
|
+
|
201
|
+
node = cloneNode(node, false);
|
202
|
+
|
203
|
+
if (!formatNode) {
|
204
|
+
formatNode = curNode = node;
|
205
|
+
} else if (curNode) {
|
206
|
+
curNode.appendChild(node);
|
207
|
+
}
|
208
|
+
|
209
|
+
curNode = node;
|
210
|
+
});
|
211
|
+
|
212
|
+
// Add something to the inner node
|
213
|
+
if (curNode) {
|
214
|
+
curNode.innerHTML = Env.ie && Env.ie < 10 ? ' ' : '<br data-mce-bogus="1" />';
|
215
|
+
}
|
216
|
+
|
217
|
+
return false;
|
218
|
+
}
|
219
|
+
}, 'childNodes');
|
220
|
+
|
221
|
+
cell = cloneNode(cell, false);
|
222
|
+
fireNewCell(cell);
|
223
|
+
|
224
|
+
setSpanVal(cell, 'rowSpan', 1);
|
225
|
+
setSpanVal(cell, 'colSpan', 1);
|
226
|
+
|
227
|
+
if (formatNode) {
|
228
|
+
cell.appendChild(formatNode);
|
229
|
+
} else {
|
230
|
+
Utils.paddCell(cell);
|
231
|
+
}
|
232
|
+
|
233
|
+
return cell;
|
234
|
+
}
|
235
|
+
|
236
|
+
function cleanup() {
|
237
|
+
var rng = dom.createRng(), row;
|
238
|
+
|
239
|
+
// Empty rows
|
240
|
+
each(dom.select('tr', table), function(tr) {
|
241
|
+
if (tr.cells.length === 0) {
|
242
|
+
dom.remove(tr);
|
243
|
+
}
|
244
|
+
});
|
245
|
+
|
246
|
+
// Empty table
|
247
|
+
if (dom.select('tr', table).length === 0) {
|
248
|
+
rng.setStartBefore(table);
|
249
|
+
rng.setEndBefore(table);
|
250
|
+
selection.setRng(rng);
|
251
|
+
dom.remove(table);
|
252
|
+
return;
|
253
|
+
}
|
254
|
+
|
255
|
+
// Empty header/body/footer
|
256
|
+
each(dom.select('thead,tbody,tfoot', table), function(part) {
|
257
|
+
if (part.rows.length === 0) {
|
258
|
+
dom.remove(part);
|
259
|
+
}
|
260
|
+
});
|
261
|
+
|
262
|
+
// Restore selection to start position if it still exists
|
263
|
+
buildGrid();
|
264
|
+
|
265
|
+
// If we have a valid startPos object
|
266
|
+
if (startPos) {
|
267
|
+
// Restore the selection to the closest table position
|
268
|
+
row = grid[Math.min(grid.length - 1, startPos.y)];
|
269
|
+
if (row) {
|
270
|
+
selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true);
|
271
|
+
selection.collapse(true);
|
272
|
+
}
|
273
|
+
}
|
274
|
+
}
|
275
|
+
|
276
|
+
function fillLeftDown(x, y, rows, cols) {
|
277
|
+
var tr, x2, r, c, cell;
|
278
|
+
|
279
|
+
tr = grid[y][x].elm.parentNode;
|
280
|
+
for (r = 1; r <= rows; r++) {
|
281
|
+
tr = dom.getNext(tr, 'tr');
|
282
|
+
|
283
|
+
if (tr) {
|
284
|
+
// Loop left to find real cell
|
285
|
+
for (x2 = x; x2 >= 0; x2--) {
|
286
|
+
cell = grid[y + r][x2].elm;
|
287
|
+
|
288
|
+
if (cell.parentNode == tr) {
|
289
|
+
// Append clones after
|
290
|
+
for (c = 1; c <= cols; c++) {
|
291
|
+
dom.insertAfter(cloneCell(cell), cell);
|
292
|
+
}
|
293
|
+
|
294
|
+
break;
|
295
|
+
}
|
296
|
+
}
|
297
|
+
|
298
|
+
if (x2 == -1) {
|
299
|
+
// Insert nodes before first cell
|
300
|
+
for (c = 1; c <= cols; c++) {
|
301
|
+
tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]);
|
302
|
+
}
|
303
|
+
}
|
304
|
+
}
|
305
|
+
}
|
306
|
+
}
|
307
|
+
|
308
|
+
function split() {
|
309
|
+
each(grid, function(row, y) {
|
310
|
+
each(row, function(cell, x) {
|
311
|
+
var colSpan, rowSpan, i;
|
312
|
+
|
313
|
+
if (isCellSelected(cell)) {
|
314
|
+
cell = cell.elm;
|
315
|
+
colSpan = getSpanVal(cell, 'colspan');
|
316
|
+
rowSpan = getSpanVal(cell, 'rowspan');
|
317
|
+
|
318
|
+
if (colSpan > 1 || rowSpan > 1) {
|
319
|
+
setSpanVal(cell, 'rowSpan', 1);
|
320
|
+
setSpanVal(cell, 'colSpan', 1);
|
321
|
+
|
322
|
+
// Insert cells right
|
323
|
+
for (i = 0; i < colSpan - 1; i++) {
|
324
|
+
dom.insertAfter(cloneCell(cell), cell);
|
325
|
+
}
|
326
|
+
|
327
|
+
fillLeftDown(x, y, rowSpan - 1, colSpan);
|
328
|
+
}
|
329
|
+
}
|
330
|
+
});
|
331
|
+
});
|
332
|
+
}
|
333
|
+
|
334
|
+
function merge(cell, cols, rows) {
|
335
|
+
var pos, startX, startY, endX, endY, x, y, startCell, endCell, children, count;
|
336
|
+
|
337
|
+
// Use specified cell and cols/rows
|
338
|
+
if (cell) {
|
339
|
+
pos = getPos(cell);
|
340
|
+
startX = pos.x;
|
341
|
+
startY = pos.y;
|
342
|
+
endX = startX + (cols - 1);
|
343
|
+
endY = startY + (rows - 1);
|
344
|
+
} else {
|
345
|
+
startPos = endPos = null;
|
346
|
+
|
347
|
+
// Calculate start/end pos by checking for selected cells in grid works better with context menu
|
348
|
+
each(grid, function(row, y) {
|
349
|
+
each(row, function(cell, x) {
|
350
|
+
if (isCellSelected(cell)) {
|
351
|
+
if (!startPos) {
|
352
|
+
startPos = {x: x, y: y};
|
353
|
+
}
|
354
|
+
|
355
|
+
endPos = {x: x, y: y};
|
356
|
+
}
|
357
|
+
});
|
358
|
+
});
|
359
|
+
|
360
|
+
// Use selection, but make sure startPos is valid before accessing
|
361
|
+
if (startPos) {
|
362
|
+
startX = startPos.x;
|
363
|
+
startY = startPos.y;
|
364
|
+
endX = endPos.x;
|
365
|
+
endY = endPos.y;
|
366
|
+
}
|
367
|
+
}
|
368
|
+
|
369
|
+
// Find start/end cells
|
370
|
+
startCell = getCell(startX, startY);
|
371
|
+
endCell = getCell(endX, endY);
|
372
|
+
|
373
|
+
// Check if the cells exists and if they are of the same part for example tbody = tbody
|
374
|
+
if (startCell && endCell && startCell.part == endCell.part) {
|
375
|
+
// Split and rebuild grid
|
376
|
+
split();
|
377
|
+
buildGrid();
|
378
|
+
|
379
|
+
// Set row/col span to start cell
|
380
|
+
startCell = getCell(startX, startY).elm;
|
381
|
+
setSpanVal(startCell, 'colSpan', (endX - startX) + 1);
|
382
|
+
setSpanVal(startCell, 'rowSpan', (endY - startY) + 1);
|
383
|
+
|
384
|
+
// Remove other cells and add it's contents to the start cell
|
385
|
+
for (y = startY; y <= endY; y++) {
|
386
|
+
for (x = startX; x <= endX; x++) {
|
387
|
+
if (!grid[y] || !grid[y][x]) {
|
388
|
+
continue;
|
389
|
+
}
|
390
|
+
|
391
|
+
cell = grid[y][x].elm;
|
392
|
+
|
393
|
+
/*jshint loopfunc:true */
|
394
|
+
/*eslint no-loop-func:0 */
|
395
|
+
if (cell != startCell) {
|
396
|
+
// Move children to startCell
|
397
|
+
children = Tools.grep(cell.childNodes);
|
398
|
+
each(children, function(node) {
|
399
|
+
startCell.appendChild(node);
|
400
|
+
});
|
401
|
+
|
402
|
+
// Remove bogus nodes if there is children in the target cell
|
403
|
+
if (children.length) {
|
404
|
+
children = Tools.grep(startCell.childNodes);
|
405
|
+
count = 0;
|
406
|
+
each(children, function(node) {
|
407
|
+
if (node.nodeName == 'BR' && count++ < children.length - 1) {
|
408
|
+
startCell.removeChild(node);
|
409
|
+
}
|
410
|
+
});
|
411
|
+
}
|
412
|
+
|
413
|
+
dom.remove(cell);
|
414
|
+
}
|
415
|
+
}
|
416
|
+
}
|
417
|
+
|
418
|
+
// Remove empty rows etc and restore caret location
|
419
|
+
cleanup();
|
420
|
+
}
|
421
|
+
}
|
422
|
+
|
423
|
+
function insertRow(before) {
|
424
|
+
var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan;
|
425
|
+
|
426
|
+
// Find first/last row
|
427
|
+
each(grid, function(row, y) {
|
428
|
+
each(row, function(cell) {
|
429
|
+
if (isCellSelected(cell)) {
|
430
|
+
cell = cell.elm;
|
431
|
+
rowElm = cell.parentNode;
|
432
|
+
newRow = fireNewRow(cloneNode(rowElm, false));
|
433
|
+
posY = y;
|
434
|
+
|
435
|
+
if (before) {
|
436
|
+
return false;
|
437
|
+
}
|
438
|
+
}
|
439
|
+
});
|
440
|
+
|
441
|
+
if (before) {
|
442
|
+
return !posY;
|
443
|
+
}
|
444
|
+
});
|
445
|
+
|
446
|
+
// If posY is undefined there is nothing for us to do here...just return to avoid crashing below
|
447
|
+
if (posY === undefined) {
|
448
|
+
return;
|
449
|
+
}
|
450
|
+
|
451
|
+
for (x = 0; x < grid[0].length; x++) {
|
452
|
+
// Cell not found could be because of an invalid table structure
|
453
|
+
if (!grid[posY][x]) {
|
454
|
+
continue;
|
455
|
+
}
|
456
|
+
|
457
|
+
cell = grid[posY][x].elm;
|
458
|
+
|
459
|
+
if (cell != lastCell) {
|
460
|
+
if (!before) {
|
461
|
+
rowSpan = getSpanVal(cell, 'rowspan');
|
462
|
+
if (rowSpan > 1) {
|
463
|
+
setSpanVal(cell, 'rowSpan', rowSpan + 1);
|
464
|
+
continue;
|
465
|
+
}
|
466
|
+
} else {
|
467
|
+
// Check if cell above can be expanded
|
468
|
+
if (posY > 0 && grid[posY - 1][x]) {
|
469
|
+
otherCell = grid[posY - 1][x].elm;
|
470
|
+
rowSpan = getSpanVal(otherCell, 'rowSpan');
|
471
|
+
if (rowSpan > 1) {
|
472
|
+
setSpanVal(otherCell, 'rowSpan', rowSpan + 1);
|
473
|
+
continue;
|
474
|
+
}
|
475
|
+
}
|
476
|
+
}
|
477
|
+
|
478
|
+
// Insert new cell into new row
|
479
|
+
newCell = cloneCell(cell);
|
480
|
+
setSpanVal(newCell, 'colSpan', cell.colSpan);
|
481
|
+
|
482
|
+
newRow.appendChild(newCell);
|
483
|
+
|
484
|
+
lastCell = cell;
|
485
|
+
}
|
486
|
+
}
|
487
|
+
|
488
|
+
if (newRow.hasChildNodes()) {
|
489
|
+
if (!before) {
|
490
|
+
dom.insertAfter(newRow, rowElm);
|
491
|
+
} else {
|
492
|
+
rowElm.parentNode.insertBefore(newRow, rowElm);
|
493
|
+
}
|
494
|
+
}
|
495
|
+
}
|
496
|
+
|
497
|
+
function insertCol(before) {
|
498
|
+
var posX, lastCell;
|
499
|
+
|
500
|
+
// Find first/last column
|
501
|
+
each(grid, function(row) {
|
502
|
+
each(row, function(cell, x) {
|
503
|
+
if (isCellSelected(cell)) {
|
504
|
+
posX = x;
|
505
|
+
|
506
|
+
if (before) {
|
507
|
+
return false;
|
508
|
+
}
|
509
|
+
}
|
510
|
+
});
|
511
|
+
|
512
|
+
if (before) {
|
513
|
+
return !posX;
|
514
|
+
}
|
515
|
+
});
|
516
|
+
|
517
|
+
each(grid, function(row, y) {
|
518
|
+
var cell, rowSpan, colSpan;
|
519
|
+
|
520
|
+
if (!row[posX]) {
|
521
|
+
return;
|
522
|
+
}
|
523
|
+
|
524
|
+
cell = row[posX].elm;
|
525
|
+
if (cell != lastCell) {
|
526
|
+
colSpan = getSpanVal(cell, 'colspan');
|
527
|
+
rowSpan = getSpanVal(cell, 'rowspan');
|
528
|
+
|
529
|
+
if (colSpan == 1) {
|
530
|
+
if (!before) {
|
531
|
+
dom.insertAfter(cloneCell(cell), cell);
|
532
|
+
fillLeftDown(posX, y, rowSpan - 1, colSpan);
|
533
|
+
} else {
|
534
|
+
cell.parentNode.insertBefore(cloneCell(cell), cell);
|
535
|
+
fillLeftDown(posX, y, rowSpan - 1, colSpan);
|
536
|
+
}
|
537
|
+
} else {
|
538
|
+
setSpanVal(cell, 'colSpan', cell.colSpan + 1);
|
539
|
+
}
|
540
|
+
|
541
|
+
lastCell = cell;
|
542
|
+
}
|
543
|
+
});
|
544
|
+
}
|
545
|
+
|
546
|
+
function getSelectedCells(grid) {
|
547
|
+
return Tools.grep(getAllCells(grid), isCellSelected);
|
548
|
+
}
|
549
|
+
|
550
|
+
function getAllCells(grid) {
|
551
|
+
var cells = [];
|
552
|
+
|
553
|
+
each(grid, function(row) {
|
554
|
+
each(row, function(cell) {
|
555
|
+
cells.push(cell);
|
556
|
+
});
|
557
|
+
});
|
558
|
+
|
559
|
+
return cells;
|
560
|
+
}
|
561
|
+
|
562
|
+
function deleteCols() {
|
563
|
+
var cols = [];
|
564
|
+
|
565
|
+
if (isEditorBody(table)) {
|
566
|
+
if (grid[0].length == 1) {
|
567
|
+
return;
|
568
|
+
}
|
569
|
+
|
570
|
+
if (getSelectedCells(grid).length == getAllCells(grid).length) {
|
571
|
+
return;
|
572
|
+
}
|
573
|
+
}
|
574
|
+
|
575
|
+
// Get selected column indexes
|
576
|
+
each(grid, function(row) {
|
577
|
+
each(row, function(cell, x) {
|
578
|
+
if (isCellSelected(cell) && Tools.inArray(cols, x) === -1) {
|
579
|
+
each(grid, function(row) {
|
580
|
+
var cell = row[x].elm, colSpan;
|
581
|
+
|
582
|
+
colSpan = getSpanVal(cell, 'colSpan');
|
583
|
+
|
584
|
+
if (colSpan > 1) {
|
585
|
+
setSpanVal(cell, 'colSpan', colSpan - 1);
|
586
|
+
} else {
|
587
|
+
dom.remove(cell);
|
588
|
+
}
|
589
|
+
});
|
590
|
+
|
591
|
+
cols.push(x);
|
592
|
+
}
|
593
|
+
});
|
594
|
+
});
|
595
|
+
|
596
|
+
cleanup();
|
597
|
+
}
|
598
|
+
|
599
|
+
function deleteRows() {
|
600
|
+
var rows;
|
601
|
+
|
602
|
+
function deleteRow(tr) {
|
603
|
+
var pos, lastCell;
|
604
|
+
|
605
|
+
// Move down row spanned cells
|
606
|
+
each(tr.cells, function(cell) {
|
607
|
+
var rowSpan = getSpanVal(cell, 'rowSpan');
|
608
|
+
|
609
|
+
if (rowSpan > 1) {
|
610
|
+
setSpanVal(cell, 'rowSpan', rowSpan - 1);
|
611
|
+
pos = getPos(cell);
|
612
|
+
fillLeftDown(pos.x, pos.y, 1, 1);
|
613
|
+
}
|
614
|
+
});
|
615
|
+
|
616
|
+
// Delete cells
|
617
|
+
pos = getPos(tr.cells[0]);
|
618
|
+
each(grid[pos.y], function(cell) {
|
619
|
+
var rowSpan;
|
620
|
+
|
621
|
+
cell = cell.elm;
|
622
|
+
|
623
|
+
if (cell != lastCell) {
|
624
|
+
rowSpan = getSpanVal(cell, 'rowSpan');
|
625
|
+
|
626
|
+
if (rowSpan <= 1) {
|
627
|
+
dom.remove(cell);
|
628
|
+
} else {
|
629
|
+
setSpanVal(cell, 'rowSpan', rowSpan - 1);
|
630
|
+
}
|
631
|
+
|
632
|
+
lastCell = cell;
|
633
|
+
}
|
634
|
+
});
|
635
|
+
}
|
636
|
+
|
637
|
+
// Get selected rows and move selection out of scope
|
638
|
+
rows = getSelectedRows();
|
639
|
+
|
640
|
+
if (isEditorBody(table) && rows.length == table.rows.length) {
|
641
|
+
return;
|
642
|
+
}
|
643
|
+
|
644
|
+
// Delete all selected rows
|
645
|
+
each(rows.reverse(), function(tr) {
|
646
|
+
deleteRow(tr);
|
647
|
+
});
|
648
|
+
|
649
|
+
cleanup();
|
650
|
+
}
|
651
|
+
|
652
|
+
function cutRows() {
|
653
|
+
var rows = getSelectedRows();
|
654
|
+
|
655
|
+
if (isEditorBody(table) && rows.length == table.rows.length) {
|
656
|
+
return;
|
657
|
+
}
|
658
|
+
|
659
|
+
dom.remove(rows);
|
660
|
+
cleanup();
|
661
|
+
|
662
|
+
return rows;
|
663
|
+
}
|
664
|
+
|
665
|
+
function copyRows() {
|
666
|
+
var rows = getSelectedRows();
|
667
|
+
|
668
|
+
each(rows, function(row, i) {
|
669
|
+
rows[i] = cloneNode(row, true);
|
670
|
+
});
|
671
|
+
|
672
|
+
return rows;
|
673
|
+
}
|
674
|
+
|
675
|
+
function pasteRows(rows, before) {
|
676
|
+
var selectedRows = getSelectedRows(),
|
677
|
+
targetRow = selectedRows[before ? 0 : selectedRows.length - 1],
|
678
|
+
targetCellCount = targetRow.cells.length;
|
679
|
+
|
680
|
+
// Nothing to paste
|
681
|
+
if (!rows) {
|
682
|
+
return;
|
683
|
+
}
|
684
|
+
|
685
|
+
// Calc target cell count
|
686
|
+
each(grid, function(row) {
|
687
|
+
var match;
|
688
|
+
|
689
|
+
targetCellCount = 0;
|
690
|
+
each(row, function(cell) {
|
691
|
+
if (cell.real) {
|
692
|
+
targetCellCount += cell.colspan;
|
693
|
+
}
|
694
|
+
|
695
|
+
if (cell.elm.parentNode == targetRow) {
|
696
|
+
match = 1;
|
697
|
+
}
|
698
|
+
});
|
699
|
+
|
700
|
+
if (match) {
|
701
|
+
return false;
|
702
|
+
}
|
703
|
+
});
|
704
|
+
|
705
|
+
if (!before) {
|
706
|
+
rows.reverse();
|
707
|
+
}
|
708
|
+
|
709
|
+
each(rows, function(row) {
|
710
|
+
var i, cellCount = row.cells.length, cell;
|
711
|
+
|
712
|
+
fireNewRow(row);
|
713
|
+
|
714
|
+
// Remove col/rowspans
|
715
|
+
for (i = 0; i < cellCount; i++) {
|
716
|
+
cell = row.cells[i];
|
717
|
+
|
718
|
+
fireNewCell(cell);
|
719
|
+
setSpanVal(cell, 'colSpan', 1);
|
720
|
+
setSpanVal(cell, 'rowSpan', 1);
|
721
|
+
}
|
722
|
+
|
723
|
+
// Needs more cells
|
724
|
+
for (i = cellCount; i < targetCellCount; i++) {
|
725
|
+
row.appendChild(fireNewCell(cloneCell(row.cells[cellCount - 1])));
|
726
|
+
}
|
727
|
+
|
728
|
+
// Needs less cells
|
729
|
+
for (i = targetCellCount; i < cellCount; i++) {
|
730
|
+
dom.remove(row.cells[i]);
|
731
|
+
}
|
732
|
+
|
733
|
+
// Add before/after
|
734
|
+
if (before) {
|
735
|
+
targetRow.parentNode.insertBefore(row, targetRow);
|
736
|
+
} else {
|
737
|
+
dom.insertAfter(row, targetRow);
|
738
|
+
}
|
739
|
+
});
|
740
|
+
|
741
|
+
removeCellSelection();
|
742
|
+
}
|
743
|
+
|
744
|
+
function getPos(target) {
|
745
|
+
var pos;
|
746
|
+
|
747
|
+
each(grid, function(row, y) {
|
748
|
+
each(row, function(cell, x) {
|
749
|
+
if (cell.elm == target) {
|
750
|
+
pos = {x: x, y: y};
|
751
|
+
return false;
|
752
|
+
}
|
753
|
+
});
|
754
|
+
|
755
|
+
return !pos;
|
756
|
+
});
|
757
|
+
|
758
|
+
return pos;
|
759
|
+
}
|
760
|
+
|
761
|
+
function setStartCell(cell) {
|
762
|
+
startPos = getPos(cell);
|
763
|
+
}
|
764
|
+
|
765
|
+
function findEndPos() {
|
766
|
+
var maxX, maxY;
|
767
|
+
|
768
|
+
maxX = maxY = 0;
|
769
|
+
|
770
|
+
each(grid, function(row, y) {
|
771
|
+
each(row, function(cell, x) {
|
772
|
+
var colSpan, rowSpan;
|
773
|
+
|
774
|
+
if (isCellSelected(cell)) {
|
775
|
+
cell = grid[y][x];
|
776
|
+
|
777
|
+
if (x > maxX) {
|
778
|
+
maxX = x;
|
779
|
+
}
|
780
|
+
|
781
|
+
if (y > maxY) {
|
782
|
+
maxY = y;
|
783
|
+
}
|
784
|
+
|
785
|
+
if (cell.real) {
|
786
|
+
colSpan = cell.colspan - 1;
|
787
|
+
rowSpan = cell.rowspan - 1;
|
788
|
+
|
789
|
+
if (colSpan) {
|
790
|
+
if (x + colSpan > maxX) {
|
791
|
+
maxX = x + colSpan;
|
792
|
+
}
|
793
|
+
}
|
794
|
+
|
795
|
+
if (rowSpan) {
|
796
|
+
if (y + rowSpan > maxY) {
|
797
|
+
maxY = y + rowSpan;
|
798
|
+
}
|
799
|
+
}
|
800
|
+
}
|
801
|
+
}
|
802
|
+
});
|
803
|
+
});
|
804
|
+
|
805
|
+
return {x: maxX, y: maxY};
|
806
|
+
}
|
807
|
+
|
808
|
+
function setEndCell(cell) {
|
809
|
+
var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan, x, y;
|
810
|
+
|
811
|
+
endPos = getPos(cell);
|
812
|
+
|
813
|
+
if (startPos && endPos) {
|
814
|
+
// Get start/end positions
|
815
|
+
startX = Math.min(startPos.x, endPos.x);
|
816
|
+
startY = Math.min(startPos.y, endPos.y);
|
817
|
+
endX = Math.max(startPos.x, endPos.x);
|
818
|
+
endY = Math.max(startPos.y, endPos.y);
|
819
|
+
|
820
|
+
// Expand end position to include spans
|
821
|
+
maxX = endX;
|
822
|
+
maxY = endY;
|
823
|
+
|
824
|
+
// Expand startX
|
825
|
+
for (y = startY; y <= maxY; y++) {
|
826
|
+
cell = grid[y][startX];
|
827
|
+
|
828
|
+
if (!cell.real) {
|
829
|
+
if (startX - (cell.colspan - 1) < startX) {
|
830
|
+
startX -= cell.colspan - 1;
|
831
|
+
}
|
832
|
+
}
|
833
|
+
}
|
834
|
+
|
835
|
+
// Expand startY
|
836
|
+
for (x = startX; x <= maxX; x++) {
|
837
|
+
cell = grid[startY][x];
|
838
|
+
|
839
|
+
if (!cell.real) {
|
840
|
+
if (startY - (cell.rowspan - 1) < startY) {
|
841
|
+
startY -= cell.rowspan - 1;
|
842
|
+
}
|
843
|
+
}
|
844
|
+
}
|
845
|
+
|
846
|
+
// Find max X, Y
|
847
|
+
for (y = startY; y <= endY; y++) {
|
848
|
+
for (x = startX; x <= endX; x++) {
|
849
|
+
cell = grid[y][x];
|
850
|
+
|
851
|
+
if (cell.real) {
|
852
|
+
colSpan = cell.colspan - 1;
|
853
|
+
rowSpan = cell.rowspan - 1;
|
854
|
+
|
855
|
+
if (colSpan) {
|
856
|
+
if (x + colSpan > maxX) {
|
857
|
+
maxX = x + colSpan;
|
858
|
+
}
|
859
|
+
}
|
860
|
+
|
861
|
+
if (rowSpan) {
|
862
|
+
if (y + rowSpan > maxY) {
|
863
|
+
maxY = y + rowSpan;
|
864
|
+
}
|
865
|
+
}
|
866
|
+
}
|
867
|
+
}
|
868
|
+
}
|
869
|
+
|
870
|
+
removeCellSelection();
|
871
|
+
|
872
|
+
// Add new selection
|
873
|
+
for (y = startY; y <= maxY; y++) {
|
874
|
+
for (x = startX; x <= maxX; x++) {
|
875
|
+
if (grid[y][x]) {
|
876
|
+
dom.setAttrib(grid[y][x].elm, 'data-mce-selected', '1');
|
877
|
+
}
|
878
|
+
}
|
879
|
+
}
|
880
|
+
}
|
881
|
+
}
|
882
|
+
|
883
|
+
function moveRelIdx(cellElm, delta) {
|
884
|
+
var pos, index, cell;
|
885
|
+
|
886
|
+
pos = getPos(cellElm);
|
887
|
+
index = pos.y * gridWidth + pos.x;
|
888
|
+
|
889
|
+
do {
|
890
|
+
index += delta;
|
891
|
+
cell = getCell(index % gridWidth, Math.floor(index / gridWidth));
|
892
|
+
|
893
|
+
if (!cell) {
|
894
|
+
break;
|
895
|
+
}
|
896
|
+
|
897
|
+
if (cell.elm != cellElm) {
|
898
|
+
selection.select(cell.elm, true);
|
899
|
+
|
900
|
+
if (dom.isEmpty(cell.elm)) {
|
901
|
+
selection.collapse(true);
|
902
|
+
}
|
903
|
+
|
904
|
+
return true;
|
905
|
+
}
|
906
|
+
} while (cell.elm == cellElm);
|
907
|
+
|
908
|
+
return false;
|
909
|
+
}
|
910
|
+
|
911
|
+
table = table || dom.getParent(selection.getStart(true), 'table');
|
912
|
+
|
913
|
+
buildGrid();
|
914
|
+
|
915
|
+
selectedCell = selectedCell || dom.getParent(selection.getStart(true), 'th,td');
|
916
|
+
|
917
|
+
if (selectedCell) {
|
918
|
+
startPos = getPos(selectedCell);
|
919
|
+
endPos = findEndPos();
|
920
|
+
selectedCell = getCell(startPos.x, startPos.y);
|
921
|
+
}
|
922
|
+
|
923
|
+
Tools.extend(this, {
|
924
|
+
deleteTable: deleteTable,
|
925
|
+
split: split,
|
926
|
+
merge: merge,
|
927
|
+
insertRow: insertRow,
|
928
|
+
insertCol: insertCol,
|
929
|
+
deleteCols: deleteCols,
|
930
|
+
deleteRows: deleteRows,
|
931
|
+
cutRows: cutRows,
|
932
|
+
copyRows: copyRows,
|
933
|
+
pasteRows: pasteRows,
|
934
|
+
getPos: getPos,
|
935
|
+
setStartCell: setStartCell,
|
936
|
+
setEndCell: setEndCell,
|
937
|
+
moveRelIdx: moveRelIdx,
|
938
|
+
refresh: buildGrid
|
939
|
+
});
|
940
|
+
};
|
941
|
+
});
|