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,810 @@
|
|
1
|
+
/**
|
2
|
+
* SelectionOverrides.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 module contains logic overriding the selection with keyboard/mouse
|
13
|
+
* around contentEditable=false regions.
|
14
|
+
*
|
15
|
+
* @example
|
16
|
+
* // Disable the default cE=false selection
|
17
|
+
* tinymce.activeEditor.on('ShowCaret BeforeObjectSelected', function(e) {
|
18
|
+
* e.preventDefault();
|
19
|
+
* });
|
20
|
+
*
|
21
|
+
* @private
|
22
|
+
* @class tinymce.SelectionOverrides
|
23
|
+
*/
|
24
|
+
define("tinymce/SelectionOverrides", [
|
25
|
+
"tinymce/Env",
|
26
|
+
"tinymce/caret/CaretWalker",
|
27
|
+
"tinymce/caret/CaretPosition",
|
28
|
+
"tinymce/caret/CaretContainer",
|
29
|
+
"tinymce/caret/CaretUtils",
|
30
|
+
"tinymce/caret/FakeCaret",
|
31
|
+
"tinymce/caret/LineWalker",
|
32
|
+
"tinymce/caret/LineUtils",
|
33
|
+
"tinymce/dom/NodeType",
|
34
|
+
"tinymce/dom/RangeUtils",
|
35
|
+
"tinymce/geom/ClientRect",
|
36
|
+
"tinymce/util/VK",
|
37
|
+
"tinymce/util/Fun",
|
38
|
+
"tinymce/util/Arr",
|
39
|
+
"tinymce/util/Delay",
|
40
|
+
"tinymce/DragDropOverrides",
|
41
|
+
"tinymce/text/Zwsp"
|
42
|
+
], function(
|
43
|
+
Env, CaretWalker, CaretPosition, CaretContainer, CaretUtils, FakeCaret, LineWalker,
|
44
|
+
LineUtils, NodeType, RangeUtils, ClientRect, VK, Fun, Arr, Delay, DragDropOverrides, Zwsp
|
45
|
+
) {
|
46
|
+
var curry = Fun.curry,
|
47
|
+
isContentEditableTrue = NodeType.isContentEditableTrue,
|
48
|
+
isContentEditableFalse = NodeType.isContentEditableFalse,
|
49
|
+
isElement = NodeType.isElement,
|
50
|
+
isAfterContentEditableFalse = CaretUtils.isAfterContentEditableFalse,
|
51
|
+
isBeforeContentEditableFalse = CaretUtils.isBeforeContentEditableFalse,
|
52
|
+
getSelectedNode = RangeUtils.getSelectedNode;
|
53
|
+
|
54
|
+
function getVisualCaretPosition(walkFn, caretPosition) {
|
55
|
+
while ((caretPosition = walkFn(caretPosition))) {
|
56
|
+
if (caretPosition.isVisible()) {
|
57
|
+
return caretPosition;
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
return caretPosition;
|
62
|
+
}
|
63
|
+
|
64
|
+
function SelectionOverrides(editor) {
|
65
|
+
var rootNode = editor.getBody(), caretWalker = new CaretWalker(rootNode);
|
66
|
+
var getNextVisualCaretPosition = curry(getVisualCaretPosition, caretWalker.next);
|
67
|
+
var getPrevVisualCaretPosition = curry(getVisualCaretPosition, caretWalker.prev),
|
68
|
+
fakeCaret = new FakeCaret(editor.getBody(), isBlock),
|
69
|
+
realSelectionId = 'sel-' + editor.dom.uniqueId(),
|
70
|
+
selectedContentEditableNode, $ = editor.$;
|
71
|
+
|
72
|
+
function isBlock(node) {
|
73
|
+
return editor.dom.isBlock(node);
|
74
|
+
}
|
75
|
+
|
76
|
+
function setRange(range) {
|
77
|
+
//console.log('setRange', range);
|
78
|
+
if (range) {
|
79
|
+
editor.selection.setRng(range);
|
80
|
+
}
|
81
|
+
}
|
82
|
+
|
83
|
+
function getRange() {
|
84
|
+
return editor.selection.getRng();
|
85
|
+
}
|
86
|
+
|
87
|
+
function scrollIntoView(node, alignToTop) {
|
88
|
+
editor.selection.scrollIntoView(node, alignToTop);
|
89
|
+
}
|
90
|
+
|
91
|
+
function showCaret(direction, node, before) {
|
92
|
+
var e;
|
93
|
+
|
94
|
+
e = editor.fire('ShowCaret', {
|
95
|
+
target: node,
|
96
|
+
direction: direction,
|
97
|
+
before: before
|
98
|
+
});
|
99
|
+
|
100
|
+
if (e.isDefaultPrevented()) {
|
101
|
+
return null;
|
102
|
+
}
|
103
|
+
|
104
|
+
scrollIntoView(node, direction === -1);
|
105
|
+
|
106
|
+
return fakeCaret.show(before, node);
|
107
|
+
}
|
108
|
+
|
109
|
+
function selectNode(node) {
|
110
|
+
var e;
|
111
|
+
|
112
|
+
fakeCaret.hide();
|
113
|
+
|
114
|
+
e = editor.fire('BeforeObjectSelected', {target: node});
|
115
|
+
if (e.isDefaultPrevented()) {
|
116
|
+
return null;
|
117
|
+
}
|
118
|
+
|
119
|
+
return getNodeRange(node);
|
120
|
+
}
|
121
|
+
|
122
|
+
function getNodeRange(node) {
|
123
|
+
var rng = node.ownerDocument.createRange();
|
124
|
+
|
125
|
+
rng.selectNode(node);
|
126
|
+
|
127
|
+
return rng;
|
128
|
+
}
|
129
|
+
|
130
|
+
function isMoveInsideSameBlock(fromCaretPosition, toCaretPosition) {
|
131
|
+
var inSameBlock = CaretUtils.isInSameBlock(fromCaretPosition, toCaretPosition);
|
132
|
+
|
133
|
+
// Handle bogus BR <p>abc|<br></p>
|
134
|
+
if (!inSameBlock && NodeType.isBr(fromCaretPosition.getNode())) {
|
135
|
+
return true;
|
136
|
+
}
|
137
|
+
|
138
|
+
return inSameBlock;
|
139
|
+
}
|
140
|
+
|
141
|
+
function getNormalizedRangeEndPoint(direction, range) {
|
142
|
+
range = CaretUtils.normalizeRange(direction, rootNode, range);
|
143
|
+
|
144
|
+
if (direction == -1) {
|
145
|
+
return CaretPosition.fromRangeStart(range);
|
146
|
+
}
|
147
|
+
|
148
|
+
return CaretPosition.fromRangeEnd(range);
|
149
|
+
}
|
150
|
+
|
151
|
+
function isRangeInCaretContainerBlock(range) {
|
152
|
+
return CaretContainer.isCaretContainerBlock(range.startContainer);
|
153
|
+
}
|
154
|
+
|
155
|
+
function moveToCeFalseHorizontally(direction, getNextPosFn, isBeforeContentEditableFalseFn, range) {
|
156
|
+
var node, caretPosition, peekCaretPosition, rangeIsInContainerBlock;
|
157
|
+
|
158
|
+
if (!range.collapsed) {
|
159
|
+
node = getSelectedNode(range);
|
160
|
+
if (isContentEditableFalse(node)) {
|
161
|
+
return showCaret(direction, node, direction == -1);
|
162
|
+
}
|
163
|
+
}
|
164
|
+
|
165
|
+
rangeIsInContainerBlock = isRangeInCaretContainerBlock(range);
|
166
|
+
caretPosition = getNormalizedRangeEndPoint(direction, range);
|
167
|
+
|
168
|
+
if (isBeforeContentEditableFalseFn(caretPosition)) {
|
169
|
+
return selectNode(caretPosition.getNode(direction == -1));
|
170
|
+
}
|
171
|
+
|
172
|
+
caretPosition = getNextPosFn(caretPosition);
|
173
|
+
if (!caretPosition) {
|
174
|
+
if (rangeIsInContainerBlock) {
|
175
|
+
return range;
|
176
|
+
}
|
177
|
+
|
178
|
+
return null;
|
179
|
+
}
|
180
|
+
|
181
|
+
if (isBeforeContentEditableFalseFn(caretPosition)) {
|
182
|
+
return showCaret(direction, caretPosition.getNode(direction == -1), direction == 1);
|
183
|
+
}
|
184
|
+
|
185
|
+
// Peek ahead for handling of ab|c<span cE=false> -> abc|<span cE=false>
|
186
|
+
peekCaretPosition = getNextPosFn(caretPosition);
|
187
|
+
if (isBeforeContentEditableFalseFn(peekCaretPosition)) {
|
188
|
+
if (isMoveInsideSameBlock(caretPosition, peekCaretPosition)) {
|
189
|
+
return showCaret(direction, peekCaretPosition.getNode(direction == -1), direction == 1);
|
190
|
+
}
|
191
|
+
}
|
192
|
+
|
193
|
+
if (rangeIsInContainerBlock) {
|
194
|
+
return renderRangeCaret(caretPosition.toRange());
|
195
|
+
}
|
196
|
+
|
197
|
+
return null;
|
198
|
+
}
|
199
|
+
|
200
|
+
function moveToCeFalseVertically(direction, walkerFn, range) {
|
201
|
+
var caretPosition, linePositions, nextLinePositions,
|
202
|
+
closestNextLineRect, caretClientRect, clientX,
|
203
|
+
dist1, dist2, contentEditableFalseNode;
|
204
|
+
|
205
|
+
contentEditableFalseNode = getSelectedNode(range);
|
206
|
+
caretPosition = getNormalizedRangeEndPoint(direction, range);
|
207
|
+
linePositions = walkerFn(rootNode, LineWalker.isAboveLine(1), caretPosition);
|
208
|
+
nextLinePositions = Arr.filter(linePositions, LineWalker.isLine(1));
|
209
|
+
caretClientRect = Arr.last(caretPosition.getClientRects());
|
210
|
+
|
211
|
+
if (isBeforeContentEditableFalse(caretPosition)) {
|
212
|
+
contentEditableFalseNode = caretPosition.getNode();
|
213
|
+
}
|
214
|
+
|
215
|
+
if (isAfterContentEditableFalse(caretPosition)) {
|
216
|
+
contentEditableFalseNode = caretPosition.getNode(true);
|
217
|
+
}
|
218
|
+
|
219
|
+
if (!caretClientRect) {
|
220
|
+
return null;
|
221
|
+
}
|
222
|
+
|
223
|
+
clientX = caretClientRect.left;
|
224
|
+
|
225
|
+
closestNextLineRect = LineUtils.findClosestClientRect(nextLinePositions, clientX);
|
226
|
+
if (closestNextLineRect) {
|
227
|
+
if (isContentEditableFalse(closestNextLineRect.node)) {
|
228
|
+
dist1 = Math.abs(clientX - closestNextLineRect.left);
|
229
|
+
dist2 = Math.abs(clientX - closestNextLineRect.right);
|
230
|
+
|
231
|
+
return showCaret(direction, closestNextLineRect.node, dist1 < dist2);
|
232
|
+
}
|
233
|
+
}
|
234
|
+
|
235
|
+
if (contentEditableFalseNode) {
|
236
|
+
var caretPositions = LineWalker.positionsUntil(direction, rootNode, LineWalker.isAboveLine(1), contentEditableFalseNode);
|
237
|
+
|
238
|
+
closestNextLineRect = LineUtils.findClosestClientRect(Arr.filter(caretPositions, LineWalker.isLine(1)), clientX);
|
239
|
+
if (closestNextLineRect) {
|
240
|
+
return renderRangeCaret(closestNextLineRect.position.toRange());
|
241
|
+
}
|
242
|
+
|
243
|
+
closestNextLineRect = Arr.last(Arr.filter(caretPositions, LineWalker.isLine(0)));
|
244
|
+
if (closestNextLineRect) {
|
245
|
+
return renderRangeCaret(closestNextLineRect.position.toRange());
|
246
|
+
}
|
247
|
+
}
|
248
|
+
}
|
249
|
+
|
250
|
+
function exitPreBlock(direction, range) {
|
251
|
+
var pre, caretPos, newBlock;
|
252
|
+
|
253
|
+
function createTextBlock() {
|
254
|
+
var textBlock = editor.dom.create(editor.settings.forced_root_block);
|
255
|
+
|
256
|
+
if (!Env.ie || Env.ie >= 11) {
|
257
|
+
textBlock.innerHTML = '<br data-mce-bogus="1">';
|
258
|
+
}
|
259
|
+
|
260
|
+
return textBlock;
|
261
|
+
}
|
262
|
+
|
263
|
+
if (range.collapsed && editor.settings.forced_root_block) {
|
264
|
+
pre = editor.dom.getParent(range.startContainer, 'PRE');
|
265
|
+
if (!pre) {
|
266
|
+
return;
|
267
|
+
}
|
268
|
+
|
269
|
+
if (direction == 1) {
|
270
|
+
caretPos = getNextVisualCaretPosition(CaretPosition.fromRangeStart(range));
|
271
|
+
} else {
|
272
|
+
caretPos = getPrevVisualCaretPosition(CaretPosition.fromRangeStart(range));
|
273
|
+
}
|
274
|
+
|
275
|
+
if (!caretPos) {
|
276
|
+
newBlock = createTextBlock();
|
277
|
+
|
278
|
+
if (direction == 1) {
|
279
|
+
editor.$(pre).after(newBlock);
|
280
|
+
} else {
|
281
|
+
editor.$(pre).before(newBlock);
|
282
|
+
}
|
283
|
+
|
284
|
+
editor.selection.select(newBlock, true);
|
285
|
+
editor.selection.collapse();
|
286
|
+
}
|
287
|
+
}
|
288
|
+
}
|
289
|
+
|
290
|
+
function moveH(direction, getNextPosFn, isBeforeContentEditableFalseFn, range) {
|
291
|
+
var newRange;
|
292
|
+
|
293
|
+
newRange = moveToCeFalseHorizontally(direction, getNextPosFn, isBeforeContentEditableFalseFn, range);
|
294
|
+
if (newRange) {
|
295
|
+
return newRange;
|
296
|
+
}
|
297
|
+
|
298
|
+
newRange = exitPreBlock(direction, range);
|
299
|
+
if (newRange) {
|
300
|
+
return newRange;
|
301
|
+
}
|
302
|
+
|
303
|
+
return null;
|
304
|
+
}
|
305
|
+
|
306
|
+
function moveV(direction, walkerFn, range) {
|
307
|
+
var newRange;
|
308
|
+
|
309
|
+
newRange = moveToCeFalseVertically(direction, walkerFn, range);
|
310
|
+
if (newRange) {
|
311
|
+
return newRange;
|
312
|
+
}
|
313
|
+
|
314
|
+
newRange = exitPreBlock(direction, range);
|
315
|
+
if (newRange) {
|
316
|
+
return newRange;
|
317
|
+
}
|
318
|
+
|
319
|
+
return null;
|
320
|
+
}
|
321
|
+
|
322
|
+
function getBlockCaretContainer() {
|
323
|
+
return $('*[data-mce-caret]')[0];
|
324
|
+
}
|
325
|
+
|
326
|
+
function showBlockCaretContainer(blockCaretContainer) {
|
327
|
+
blockCaretContainer = $(blockCaretContainer);
|
328
|
+
|
329
|
+
if (blockCaretContainer.attr('data-mce-caret')) {
|
330
|
+
fakeCaret.hide();
|
331
|
+
blockCaretContainer.removeAttr('data-mce-caret');
|
332
|
+
blockCaretContainer.removeAttr('data-mce-bogus');
|
333
|
+
blockCaretContainer.removeAttr('style');
|
334
|
+
|
335
|
+
// Removes control rect on IE
|
336
|
+
setRange(getRange());
|
337
|
+
scrollIntoView(blockCaretContainer[0]);
|
338
|
+
}
|
339
|
+
}
|
340
|
+
|
341
|
+
function renderCaretAtRange(range) {
|
342
|
+
var caretPosition, ceRoot;
|
343
|
+
|
344
|
+
range = CaretUtils.normalizeRange(1, rootNode, range);
|
345
|
+
caretPosition = CaretPosition.fromRangeStart(range);
|
346
|
+
|
347
|
+
if (isContentEditableFalse(caretPosition.getNode())) {
|
348
|
+
return showCaret(1, caretPosition.getNode(), !caretPosition.isAtEnd());
|
349
|
+
}
|
350
|
+
|
351
|
+
if (isContentEditableFalse(caretPosition.getNode(true))) {
|
352
|
+
return showCaret(1, caretPosition.getNode(true), false);
|
353
|
+
}
|
354
|
+
|
355
|
+
// TODO: Should render caret before/after depending on where you click on the page forces after now
|
356
|
+
ceRoot = editor.dom.getParent(caretPosition.getNode(), Fun.or(isContentEditableFalse, isContentEditableTrue));
|
357
|
+
if (isContentEditableFalse(ceRoot)) {
|
358
|
+
return showCaret(1, ceRoot, false);
|
359
|
+
}
|
360
|
+
|
361
|
+
fakeCaret.hide();
|
362
|
+
|
363
|
+
return null;
|
364
|
+
}
|
365
|
+
|
366
|
+
function renderRangeCaret(range) {
|
367
|
+
var caretRange;
|
368
|
+
|
369
|
+
if (!range || !range.collapsed) {
|
370
|
+
return range;
|
371
|
+
}
|
372
|
+
|
373
|
+
caretRange = renderCaretAtRange(range);
|
374
|
+
if (caretRange) {
|
375
|
+
return caretRange;
|
376
|
+
}
|
377
|
+
|
378
|
+
return range;
|
379
|
+
}
|
380
|
+
|
381
|
+
function deleteContentEditableNode(node) {
|
382
|
+
var nextCaretPosition, prevCaretPosition, prevCeFalseElm, nextElement;
|
383
|
+
|
384
|
+
if (!isContentEditableFalse(node)) {
|
385
|
+
return null;
|
386
|
+
}
|
387
|
+
|
388
|
+
if (isContentEditableFalse(node.previousSibling)) {
|
389
|
+
prevCeFalseElm = node.previousSibling;
|
390
|
+
}
|
391
|
+
|
392
|
+
prevCaretPosition = getPrevVisualCaretPosition(CaretPosition.before(node));
|
393
|
+
if (!prevCaretPosition) {
|
394
|
+
nextCaretPosition = getNextVisualCaretPosition(CaretPosition.after(node));
|
395
|
+
}
|
396
|
+
|
397
|
+
if (nextCaretPosition && isElement(nextCaretPosition.getNode())) {
|
398
|
+
nextElement = nextCaretPosition.getNode();
|
399
|
+
}
|
400
|
+
|
401
|
+
CaretContainer.remove(node.previousSibling);
|
402
|
+
CaretContainer.remove(node.nextSibling);
|
403
|
+
editor.dom.remove(node);
|
404
|
+
clearContentEditableSelection();
|
405
|
+
|
406
|
+
if (editor.dom.isEmpty(editor.getBody())) {
|
407
|
+
editor.setContent('');
|
408
|
+
editor.focus();
|
409
|
+
return;
|
410
|
+
}
|
411
|
+
|
412
|
+
if (prevCeFalseElm) {
|
413
|
+
return CaretPosition.after(prevCeFalseElm).toRange();
|
414
|
+
}
|
415
|
+
|
416
|
+
if (nextElement) {
|
417
|
+
return CaretPosition.before(nextElement).toRange();
|
418
|
+
}
|
419
|
+
|
420
|
+
if (prevCaretPosition) {
|
421
|
+
return prevCaretPosition.toRange();
|
422
|
+
}
|
423
|
+
|
424
|
+
if (nextCaretPosition) {
|
425
|
+
return nextCaretPosition.toRange();
|
426
|
+
}
|
427
|
+
|
428
|
+
return null;
|
429
|
+
}
|
430
|
+
|
431
|
+
function backspaceDelete(direction, beforeFn, range) {
|
432
|
+
var node, caretPosition;
|
433
|
+
|
434
|
+
if (!range.collapsed) {
|
435
|
+
node = getSelectedNode(range);
|
436
|
+
if (isContentEditableFalse(node)) {
|
437
|
+
return renderRangeCaret(deleteContentEditableNode(node));
|
438
|
+
}
|
439
|
+
}
|
440
|
+
|
441
|
+
caretPosition = getNormalizedRangeEndPoint(direction, range);
|
442
|
+
|
443
|
+
if (beforeFn(caretPosition)) {
|
444
|
+
return renderRangeCaret(deleteContentEditableNode(caretPosition.getNode(direction == -1)));
|
445
|
+
}
|
446
|
+
}
|
447
|
+
|
448
|
+
function registerEvents() {
|
449
|
+
var right = curry(moveH, 1, getNextVisualCaretPosition, isBeforeContentEditableFalse);
|
450
|
+
var left = curry(moveH, -1, getPrevVisualCaretPosition, isAfterContentEditableFalse);
|
451
|
+
var deleteForward = curry(backspaceDelete, 1, isBeforeContentEditableFalse);
|
452
|
+
var backspace = curry(backspaceDelete, -1, isAfterContentEditableFalse);
|
453
|
+
var up = curry(moveV, -1, LineWalker.upUntil);
|
454
|
+
var down = curry(moveV, 1, LineWalker.downUntil);
|
455
|
+
|
456
|
+
function override(evt, moveFn) {
|
457
|
+
var range = moveFn(getRange());
|
458
|
+
|
459
|
+
if (range && !evt.isDefaultPrevented()) {
|
460
|
+
evt.preventDefault();
|
461
|
+
setRange(range);
|
462
|
+
}
|
463
|
+
}
|
464
|
+
|
465
|
+
function getContentEditableRoot(node) {
|
466
|
+
var root = editor.getBody();
|
467
|
+
|
468
|
+
while (node && node != root) {
|
469
|
+
if (isContentEditableTrue(node) || isContentEditableFalse(node)) {
|
470
|
+
return node;
|
471
|
+
}
|
472
|
+
|
473
|
+
node = node.parentNode;
|
474
|
+
}
|
475
|
+
|
476
|
+
return null;
|
477
|
+
}
|
478
|
+
|
479
|
+
function isXYWithinRange(clientX, clientY, range) {
|
480
|
+
if (range.collapsed) {
|
481
|
+
return false;
|
482
|
+
}
|
483
|
+
|
484
|
+
return Arr.reduce(range.getClientRects(), function(state, rect) {
|
485
|
+
return state || ClientRect.containsXY(rect, clientX, clientY);
|
486
|
+
}, false);
|
487
|
+
}
|
488
|
+
|
489
|
+
// Some browsers (Chrome) lets you place the caret after a cE=false
|
490
|
+
// Make sure we render the caret container in this case
|
491
|
+
editor.on('mouseup', function() {
|
492
|
+
var range = getRange();
|
493
|
+
|
494
|
+
if (range.collapsed) {
|
495
|
+
setRange(renderCaretAtRange(range));
|
496
|
+
}
|
497
|
+
});
|
498
|
+
|
499
|
+
editor.on('mousedown', function(e) {
|
500
|
+
var contentEditableRoot;
|
501
|
+
|
502
|
+
contentEditableRoot = getContentEditableRoot(e.target);
|
503
|
+
if (contentEditableRoot) {
|
504
|
+
if (isContentEditableFalse(contentEditableRoot)) {
|
505
|
+
e.preventDefault();
|
506
|
+
setContentEditableSelection(selectNode(contentEditableRoot));
|
507
|
+
} else {
|
508
|
+
clearContentEditableSelection();
|
509
|
+
|
510
|
+
if (!isXYWithinRange(e.clientX, e.clientY, editor.selection.getRng())) {
|
511
|
+
editor.selection.placeCaretAt(e.clientX, e.clientY);
|
512
|
+
}
|
513
|
+
}
|
514
|
+
} else {
|
515
|
+
clearContentEditableSelection();
|
516
|
+
fakeCaret.hide();
|
517
|
+
|
518
|
+
var caretInfo = LineUtils.closestCaret(rootNode, e.clientX, e.clientY);
|
519
|
+
if (caretInfo) {
|
520
|
+
e.preventDefault();
|
521
|
+
editor.getBody().focus();
|
522
|
+
setRange(showCaret(1, caretInfo.node, caretInfo.before));
|
523
|
+
}
|
524
|
+
}
|
525
|
+
});
|
526
|
+
|
527
|
+
editor.on('keydown', function(e) {
|
528
|
+
if (VK.modifierPressed(e)) {
|
529
|
+
return;
|
530
|
+
}
|
531
|
+
|
532
|
+
switch (e.keyCode) {
|
533
|
+
case VK.RIGHT:
|
534
|
+
override(e, right);
|
535
|
+
break;
|
536
|
+
|
537
|
+
case VK.DOWN:
|
538
|
+
override(e, down);
|
539
|
+
break;
|
540
|
+
|
541
|
+
case VK.LEFT:
|
542
|
+
override(e, left);
|
543
|
+
break;
|
544
|
+
|
545
|
+
case VK.UP:
|
546
|
+
override(e, up);
|
547
|
+
break;
|
548
|
+
|
549
|
+
case VK.DELETE:
|
550
|
+
override(e, deleteForward);
|
551
|
+
break;
|
552
|
+
|
553
|
+
case VK.BACKSPACE:
|
554
|
+
override(e, backspace);
|
555
|
+
break;
|
556
|
+
|
557
|
+
default:
|
558
|
+
if (isContentEditableFalse(editor.selection.getNode())) {
|
559
|
+
e.preventDefault();
|
560
|
+
}
|
561
|
+
break;
|
562
|
+
}
|
563
|
+
});
|
564
|
+
|
565
|
+
function paddEmptyContentEditableArea() {
|
566
|
+
var br, ceRoot = getContentEditableRoot(editor.selection.getNode());
|
567
|
+
|
568
|
+
if (isContentEditableTrue(ceRoot) && isBlock(ceRoot) && editor.dom.isEmpty(ceRoot)) {
|
569
|
+
br = editor.dom.create('br', {"data-mce-bogus": "1"});
|
570
|
+
editor.$(ceRoot).empty().append(br);
|
571
|
+
editor.selection.setRng(CaretPosition.before(br).toRange());
|
572
|
+
}
|
573
|
+
}
|
574
|
+
|
575
|
+
function handleBlockContainer(e) {
|
576
|
+
var blockCaretContainer = getBlockCaretContainer();
|
577
|
+
|
578
|
+
if (!blockCaretContainer) {
|
579
|
+
return;
|
580
|
+
}
|
581
|
+
|
582
|
+
if (e.type == 'compositionstart') {
|
583
|
+
e.preventDefault();
|
584
|
+
e.stopPropagation();
|
585
|
+
showBlockCaretContainer(blockCaretContainer);
|
586
|
+
return;
|
587
|
+
}
|
588
|
+
|
589
|
+
if (blockCaretContainer.innerHTML != ' ') {
|
590
|
+
showBlockCaretContainer(blockCaretContainer);
|
591
|
+
}
|
592
|
+
}
|
593
|
+
|
594
|
+
function handleEmptyBackspaceDelete(e) {
|
595
|
+
var prevent;
|
596
|
+
|
597
|
+
switch (e.keyCode) {
|
598
|
+
case VK.DELETE:
|
599
|
+
prevent = paddEmptyContentEditableArea();
|
600
|
+
break;
|
601
|
+
|
602
|
+
case VK.BACKSPACE:
|
603
|
+
prevent = paddEmptyContentEditableArea();
|
604
|
+
break;
|
605
|
+
}
|
606
|
+
|
607
|
+
if (prevent) {
|
608
|
+
e.preventDefault();
|
609
|
+
}
|
610
|
+
}
|
611
|
+
|
612
|
+
// Must be added to "top" since undoManager needs to be executed after
|
613
|
+
editor.on('keyup compositionstart', function(e) {
|
614
|
+
handleBlockContainer(e);
|
615
|
+
handleEmptyBackspaceDelete(e);
|
616
|
+
}, true);
|
617
|
+
|
618
|
+
editor.on('cut', function() {
|
619
|
+
var node = editor.selection.getNode();
|
620
|
+
|
621
|
+
if (isContentEditableFalse(node)) {
|
622
|
+
Delay.setEditorTimeout(editor, function() {
|
623
|
+
setRange(renderRangeCaret(deleteContentEditableNode(node)));
|
624
|
+
});
|
625
|
+
}
|
626
|
+
});
|
627
|
+
|
628
|
+
editor.on('getSelectionRange', function(e) {
|
629
|
+
var rng = e.range;
|
630
|
+
|
631
|
+
if (selectedContentEditableNode) {
|
632
|
+
if (!selectedContentEditableNode.parentNode) {
|
633
|
+
selectedContentEditableNode = null;
|
634
|
+
return;
|
635
|
+
}
|
636
|
+
|
637
|
+
rng = rng.cloneRange();
|
638
|
+
rng.selectNode(selectedContentEditableNode);
|
639
|
+
e.range = rng;
|
640
|
+
}
|
641
|
+
});
|
642
|
+
|
643
|
+
editor.on('setSelectionRange', function(e) {
|
644
|
+
var rng;
|
645
|
+
|
646
|
+
rng = setContentEditableSelection(e.range);
|
647
|
+
if (rng) {
|
648
|
+
e.range = rng;
|
649
|
+
}
|
650
|
+
});
|
651
|
+
|
652
|
+
editor.on('focus', function() {
|
653
|
+
// Make sure we have a proper fake caret on focus
|
654
|
+
Delay.setEditorTimeout(editor, function() {
|
655
|
+
editor.selection.setRng(renderRangeCaret(editor.selection.getRng()));
|
656
|
+
}, 0);
|
657
|
+
});
|
658
|
+
|
659
|
+
DragDropOverrides.init(editor);
|
660
|
+
}
|
661
|
+
|
662
|
+
function addCss() {
|
663
|
+
var styles = editor.contentStyles, rootClass = '.mce-content-body';
|
664
|
+
|
665
|
+
styles.push(fakeCaret.getCss());
|
666
|
+
styles.push(
|
667
|
+
rootClass + ' .mce-offscreen-selection {' +
|
668
|
+
'position: absolute;' +
|
669
|
+
'left: -9999999999px;' +
|
670
|
+
'width: 100px' +
|
671
|
+
'height: 100px' +
|
672
|
+
'}' +
|
673
|
+
rootClass + ' *[contentEditable=false] {' +
|
674
|
+
'cursor: default;' +
|
675
|
+
'}' +
|
676
|
+
rootClass + ' *[contentEditable=true] {' +
|
677
|
+
'cursor: text;' +
|
678
|
+
'}'
|
679
|
+
);
|
680
|
+
}
|
681
|
+
|
682
|
+
function isRangeInCaretContainer(rng) {
|
683
|
+
return CaretContainer.isCaretContainer(rng.startContainer) || CaretContainer.isCaretContainer(rng.endContainer);
|
684
|
+
}
|
685
|
+
|
686
|
+
function setContentEditableSelection(range) {
|
687
|
+
var node, $ = editor.$, dom = editor.dom, $realSelectionContainer, sel,
|
688
|
+
startContainer, startOffset, endOffset, e, caretPosition, targetClone, origTargetClone;
|
689
|
+
|
690
|
+
if (!range) {
|
691
|
+
clearContentEditableSelection();
|
692
|
+
return null;
|
693
|
+
}
|
694
|
+
|
695
|
+
if (range.collapsed) {
|
696
|
+
clearContentEditableSelection();
|
697
|
+
|
698
|
+
if (!isRangeInCaretContainer(range)) {
|
699
|
+
caretPosition = getNormalizedRangeEndPoint(1, range);
|
700
|
+
|
701
|
+
if (isContentEditableFalse(caretPosition.getNode())) {
|
702
|
+
return showCaret(1, caretPosition.getNode(), !caretPosition.isAtEnd());
|
703
|
+
}
|
704
|
+
|
705
|
+
if (isContentEditableFalse(caretPosition.getNode(true))) {
|
706
|
+
return showCaret(1, caretPosition.getNode(true), false);
|
707
|
+
}
|
708
|
+
}
|
709
|
+
|
710
|
+
return null;
|
711
|
+
}
|
712
|
+
|
713
|
+
startContainer = range.startContainer;
|
714
|
+
startOffset = range.startOffset;
|
715
|
+
endOffset = range.endOffset;
|
716
|
+
|
717
|
+
// Normalizes <span cE=false>[</span>] to [<span cE=false></span>]
|
718
|
+
if (startContainer.nodeType == 3 && startOffset == 0 && isContentEditableFalse(startContainer.parentNode)) {
|
719
|
+
startContainer = startContainer.parentNode;
|
720
|
+
startOffset = dom.nodeIndex(startContainer);
|
721
|
+
startContainer = startContainer.parentNode;
|
722
|
+
}
|
723
|
+
|
724
|
+
if (startContainer.nodeType != 1) {
|
725
|
+
clearContentEditableSelection();
|
726
|
+
return null;
|
727
|
+
}
|
728
|
+
|
729
|
+
if (endOffset == startOffset + 1) {
|
730
|
+
node = startContainer.childNodes[startOffset];
|
731
|
+
}
|
732
|
+
|
733
|
+
if (!isContentEditableFalse(node)) {
|
734
|
+
clearContentEditableSelection();
|
735
|
+
return null;
|
736
|
+
}
|
737
|
+
|
738
|
+
targetClone = origTargetClone = node.cloneNode(true);
|
739
|
+
e = editor.fire('ObjectSelected', {target: node, targetClone: targetClone});
|
740
|
+
if (e.isDefaultPrevented()) {
|
741
|
+
clearContentEditableSelection();
|
742
|
+
return null;
|
743
|
+
}
|
744
|
+
|
745
|
+
targetClone = e.targetClone;
|
746
|
+
$realSelectionContainer = $('#' + realSelectionId);
|
747
|
+
if ($realSelectionContainer.length === 0) {
|
748
|
+
$realSelectionContainer = $(
|
749
|
+
'<div data-mce-bogus="all" class="mce-offscreen-selection"></div>'
|
750
|
+
).attr('id', realSelectionId);
|
751
|
+
|
752
|
+
$realSelectionContainer.appendTo(editor.getBody());
|
753
|
+
}
|
754
|
+
|
755
|
+
range = editor.dom.createRng();
|
756
|
+
|
757
|
+
// WHY is IE making things so hard! Copy on <i contentEditable="false">x</i> produces: <em>x</em>
|
758
|
+
if (targetClone === origTargetClone && Env.ie) {
|
759
|
+
$realSelectionContainer.empty().append(Zwsp.ZWSP).append(targetClone).append(Zwsp.ZWSP);
|
760
|
+
range.setStart($realSelectionContainer[0].firstChild, 0);
|
761
|
+
range.setEnd($realSelectionContainer[0].lastChild, 1);
|
762
|
+
} else {
|
763
|
+
$realSelectionContainer.empty().append('\u00a0').append(targetClone).append('\u00a0');
|
764
|
+
range.setStart($realSelectionContainer[0].firstChild, 1);
|
765
|
+
range.setEnd($realSelectionContainer[0].lastChild, 0);
|
766
|
+
}
|
767
|
+
|
768
|
+
$realSelectionContainer.css({
|
769
|
+
top: dom.getPos(node, editor.getBody()).y
|
770
|
+
});
|
771
|
+
|
772
|
+
editor.getBody().focus();
|
773
|
+
$realSelectionContainer[0].focus();
|
774
|
+
sel = editor.selection.getSel();
|
775
|
+
sel.removeAllRanges();
|
776
|
+
sel.addRange(range);
|
777
|
+
|
778
|
+
editor.$('*[data-mce-selected]').removeAttr('data-mce-selected');
|
779
|
+
node.setAttribute('data-mce-selected', 1);
|
780
|
+
selectedContentEditableNode = node;
|
781
|
+
|
782
|
+
return range;
|
783
|
+
}
|
784
|
+
|
785
|
+
function clearContentEditableSelection() {
|
786
|
+
if (selectedContentEditableNode) {
|
787
|
+
selectedContentEditableNode.removeAttribute('data-mce-selected');
|
788
|
+
editor.$('#' + realSelectionId).remove();
|
789
|
+
selectedContentEditableNode = null;
|
790
|
+
}
|
791
|
+
}
|
792
|
+
|
793
|
+
function destroy() {
|
794
|
+
fakeCaret.destroy();
|
795
|
+
selectedContentEditableNode = null;
|
796
|
+
}
|
797
|
+
|
798
|
+
if (Env.ceFalse) {
|
799
|
+
registerEvents();
|
800
|
+
addCss();
|
801
|
+
}
|
802
|
+
|
803
|
+
return {
|
804
|
+
showBlockCaretContainer: showBlockCaretContainer,
|
805
|
+
destroy: destroy
|
806
|
+
};
|
807
|
+
}
|
808
|
+
|
809
|
+
return SelectionOverrides;
|
810
|
+
});
|