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,628 @@
|
|
1
|
+
/**
|
2
|
+
* RangeUtils.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 contains a few utility methods for ranges.
|
13
|
+
*
|
14
|
+
* @class tinymce.dom.RangeUtils
|
15
|
+
*/
|
16
|
+
define("tinymce/dom/RangeUtils", [
|
17
|
+
"tinymce/util/Tools",
|
18
|
+
"tinymce/dom/TreeWalker",
|
19
|
+
"tinymce/dom/NodeType",
|
20
|
+
"tinymce/caret/CaretContainer"
|
21
|
+
], function(Tools, TreeWalker, NodeType, CaretContainer) {
|
22
|
+
var each = Tools.each,
|
23
|
+
isContentEditableFalse = NodeType.isContentEditableFalse,
|
24
|
+
isCaretContainer = CaretContainer.isCaretContainer;
|
25
|
+
|
26
|
+
function getEndChild(container, index) {
|
27
|
+
var childNodes = container.childNodes;
|
28
|
+
|
29
|
+
index--;
|
30
|
+
|
31
|
+
if (index > childNodes.length - 1) {
|
32
|
+
index = childNodes.length - 1;
|
33
|
+
} else if (index < 0) {
|
34
|
+
index = 0;
|
35
|
+
}
|
36
|
+
|
37
|
+
return childNodes[index] || container;
|
38
|
+
}
|
39
|
+
|
40
|
+
function RangeUtils(dom) {
|
41
|
+
/**
|
42
|
+
* Walks the specified range like object and executes the callback for each sibling collection it finds.
|
43
|
+
*
|
44
|
+
* @private
|
45
|
+
* @method walk
|
46
|
+
* @param {Object} rng Range like object.
|
47
|
+
* @param {function} callback Callback function to execute for each sibling collection.
|
48
|
+
*/
|
49
|
+
this.walk = function(rng, callback) {
|
50
|
+
var startContainer = rng.startContainer,
|
51
|
+
startOffset = rng.startOffset,
|
52
|
+
endContainer = rng.endContainer,
|
53
|
+
endOffset = rng.endOffset,
|
54
|
+
ancestor, startPoint,
|
55
|
+
endPoint, node, parent, siblings, nodes;
|
56
|
+
|
57
|
+
// Handle table cell selection the table plugin enables
|
58
|
+
// you to fake select table cells and perform formatting actions on them
|
59
|
+
nodes = dom.select('td[data-mce-selected],th[data-mce-selected]');
|
60
|
+
if (nodes.length > 0) {
|
61
|
+
each(nodes, function(node) {
|
62
|
+
callback([node]);
|
63
|
+
});
|
64
|
+
|
65
|
+
return;
|
66
|
+
}
|
67
|
+
|
68
|
+
/**
|
69
|
+
* Excludes start/end text node if they are out side the range
|
70
|
+
*
|
71
|
+
* @private
|
72
|
+
* @param {Array} nodes Nodes to exclude items from.
|
73
|
+
* @return {Array} Array with nodes excluding the start/end container if needed.
|
74
|
+
*/
|
75
|
+
function exclude(nodes) {
|
76
|
+
var node;
|
77
|
+
|
78
|
+
// First node is excluded
|
79
|
+
node = nodes[0];
|
80
|
+
if (node.nodeType === 3 && node === startContainer && startOffset >= node.nodeValue.length) {
|
81
|
+
nodes.splice(0, 1);
|
82
|
+
}
|
83
|
+
|
84
|
+
// Last node is excluded
|
85
|
+
node = nodes[nodes.length - 1];
|
86
|
+
if (endOffset === 0 && nodes.length > 0 && node === endContainer && node.nodeType === 3) {
|
87
|
+
nodes.splice(nodes.length - 1, 1);
|
88
|
+
}
|
89
|
+
|
90
|
+
return nodes;
|
91
|
+
}
|
92
|
+
|
93
|
+
/**
|
94
|
+
* Collects siblings
|
95
|
+
*
|
96
|
+
* @private
|
97
|
+
* @param {Node} node Node to collect siblings from.
|
98
|
+
* @param {String} name Name of the sibling to check for.
|
99
|
+
* @param {Node} end_node
|
100
|
+
* @return {Array} Array of collected siblings.
|
101
|
+
*/
|
102
|
+
function collectSiblings(node, name, end_node) {
|
103
|
+
var siblings = [];
|
104
|
+
|
105
|
+
for (; node && node != end_node; node = node[name]) {
|
106
|
+
siblings.push(node);
|
107
|
+
}
|
108
|
+
|
109
|
+
return siblings;
|
110
|
+
}
|
111
|
+
|
112
|
+
/**
|
113
|
+
* Find an end point this is the node just before the common ancestor root.
|
114
|
+
*
|
115
|
+
* @private
|
116
|
+
* @param {Node} node Node to start at.
|
117
|
+
* @param {Node} root Root/ancestor element to stop just before.
|
118
|
+
* @return {Node} Node just before the root element.
|
119
|
+
*/
|
120
|
+
function findEndPoint(node, root) {
|
121
|
+
do {
|
122
|
+
if (node.parentNode == root) {
|
123
|
+
return node;
|
124
|
+
}
|
125
|
+
|
126
|
+
node = node.parentNode;
|
127
|
+
} while (node);
|
128
|
+
}
|
129
|
+
|
130
|
+
function walkBoundary(start_node, end_node, next) {
|
131
|
+
var siblingName = next ? 'nextSibling' : 'previousSibling';
|
132
|
+
|
133
|
+
for (node = start_node, parent = node.parentNode; node && node != end_node; node = parent) {
|
134
|
+
parent = node.parentNode;
|
135
|
+
siblings = collectSiblings(node == start_node ? node : node[siblingName], siblingName);
|
136
|
+
|
137
|
+
if (siblings.length) {
|
138
|
+
if (!next) {
|
139
|
+
siblings.reverse();
|
140
|
+
}
|
141
|
+
|
142
|
+
callback(exclude(siblings));
|
143
|
+
}
|
144
|
+
}
|
145
|
+
}
|
146
|
+
|
147
|
+
// If index based start position then resolve it
|
148
|
+
if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) {
|
149
|
+
startContainer = startContainer.childNodes[startOffset];
|
150
|
+
}
|
151
|
+
|
152
|
+
// If index based end position then resolve it
|
153
|
+
if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) {
|
154
|
+
endContainer = getEndChild(endContainer, endOffset);
|
155
|
+
}
|
156
|
+
|
157
|
+
// Same container
|
158
|
+
if (startContainer == endContainer) {
|
159
|
+
return callback(exclude([startContainer]));
|
160
|
+
}
|
161
|
+
|
162
|
+
// Find common ancestor and end points
|
163
|
+
ancestor = dom.findCommonAncestor(startContainer, endContainer);
|
164
|
+
|
165
|
+
// Process left side
|
166
|
+
for (node = startContainer; node; node = node.parentNode) {
|
167
|
+
if (node === endContainer) {
|
168
|
+
return walkBoundary(startContainer, ancestor, true);
|
169
|
+
}
|
170
|
+
|
171
|
+
if (node === ancestor) {
|
172
|
+
break;
|
173
|
+
}
|
174
|
+
}
|
175
|
+
|
176
|
+
// Process right side
|
177
|
+
for (node = endContainer; node; node = node.parentNode) {
|
178
|
+
if (node === startContainer) {
|
179
|
+
return walkBoundary(endContainer, ancestor);
|
180
|
+
}
|
181
|
+
|
182
|
+
if (node === ancestor) {
|
183
|
+
break;
|
184
|
+
}
|
185
|
+
}
|
186
|
+
|
187
|
+
// Find start/end point
|
188
|
+
startPoint = findEndPoint(startContainer, ancestor) || startContainer;
|
189
|
+
endPoint = findEndPoint(endContainer, ancestor) || endContainer;
|
190
|
+
|
191
|
+
// Walk left leaf
|
192
|
+
walkBoundary(startContainer, startPoint, true);
|
193
|
+
|
194
|
+
// Walk the middle from start to end point
|
195
|
+
siblings = collectSiblings(
|
196
|
+
startPoint == startContainer ? startPoint : startPoint.nextSibling,
|
197
|
+
'nextSibling',
|
198
|
+
endPoint == endContainer ? endPoint.nextSibling : endPoint
|
199
|
+
);
|
200
|
+
|
201
|
+
if (siblings.length) {
|
202
|
+
callback(exclude(siblings));
|
203
|
+
}
|
204
|
+
|
205
|
+
// Walk right leaf
|
206
|
+
walkBoundary(endContainer, endPoint);
|
207
|
+
};
|
208
|
+
|
209
|
+
/**
|
210
|
+
* Splits the specified range at it's start/end points.
|
211
|
+
*
|
212
|
+
* @private
|
213
|
+
* @param {Range/RangeObject} rng Range to split.
|
214
|
+
* @return {Object} Range position object.
|
215
|
+
*/
|
216
|
+
this.split = function(rng) {
|
217
|
+
var startContainer = rng.startContainer,
|
218
|
+
startOffset = rng.startOffset,
|
219
|
+
endContainer = rng.endContainer,
|
220
|
+
endOffset = rng.endOffset;
|
221
|
+
|
222
|
+
function splitText(node, offset) {
|
223
|
+
return node.splitText(offset);
|
224
|
+
}
|
225
|
+
|
226
|
+
// Handle single text node
|
227
|
+
if (startContainer == endContainer && startContainer.nodeType == 3) {
|
228
|
+
if (startOffset > 0 && startOffset < startContainer.nodeValue.length) {
|
229
|
+
endContainer = splitText(startContainer, startOffset);
|
230
|
+
startContainer = endContainer.previousSibling;
|
231
|
+
|
232
|
+
if (endOffset > startOffset) {
|
233
|
+
endOffset = endOffset - startOffset;
|
234
|
+
startContainer = endContainer = splitText(endContainer, endOffset).previousSibling;
|
235
|
+
endOffset = endContainer.nodeValue.length;
|
236
|
+
startOffset = 0;
|
237
|
+
} else {
|
238
|
+
endOffset = 0;
|
239
|
+
}
|
240
|
+
}
|
241
|
+
} else {
|
242
|
+
// Split startContainer text node if needed
|
243
|
+
if (startContainer.nodeType == 3 && startOffset > 0 && startOffset < startContainer.nodeValue.length) {
|
244
|
+
startContainer = splitText(startContainer, startOffset);
|
245
|
+
startOffset = 0;
|
246
|
+
}
|
247
|
+
|
248
|
+
// Split endContainer text node if needed
|
249
|
+
if (endContainer.nodeType == 3 && endOffset > 0 && endOffset < endContainer.nodeValue.length) {
|
250
|
+
endContainer = splitText(endContainer, endOffset).previousSibling;
|
251
|
+
endOffset = endContainer.nodeValue.length;
|
252
|
+
}
|
253
|
+
}
|
254
|
+
|
255
|
+
return {
|
256
|
+
startContainer: startContainer,
|
257
|
+
startOffset: startOffset,
|
258
|
+
endContainer: endContainer,
|
259
|
+
endOffset: endOffset
|
260
|
+
};
|
261
|
+
};
|
262
|
+
|
263
|
+
/**
|
264
|
+
* Normalizes the specified range by finding the closest best suitable caret location.
|
265
|
+
*
|
266
|
+
* @private
|
267
|
+
* @param {Range} rng Range to normalize.
|
268
|
+
* @return {Boolean} True/false if the specified range was normalized or not.
|
269
|
+
*/
|
270
|
+
this.normalize = function(rng) {
|
271
|
+
var normalized, collapsed;
|
272
|
+
|
273
|
+
function normalizeEndPoint(start) {
|
274
|
+
var container, offset, walker, body = dom.getRoot(), node, nonEmptyElementsMap;
|
275
|
+
var directionLeft, isAfterNode;
|
276
|
+
|
277
|
+
function isTableCell(node) {
|
278
|
+
return node && /^(TD|TH|CAPTION)$/.test(node.nodeName);
|
279
|
+
}
|
280
|
+
|
281
|
+
function hasBrBeforeAfter(node, left) {
|
282
|
+
var walker = new TreeWalker(node, dom.getParent(node.parentNode, dom.isBlock) || body);
|
283
|
+
|
284
|
+
while ((node = walker[left ? 'prev' : 'next']())) {
|
285
|
+
if (node.nodeName === "BR") {
|
286
|
+
return true;
|
287
|
+
}
|
288
|
+
}
|
289
|
+
}
|
290
|
+
|
291
|
+
function hasContentEditableFalseParent(node) {
|
292
|
+
while (node && node != body) {
|
293
|
+
if (isContentEditableFalse(node)) {
|
294
|
+
return true;
|
295
|
+
}
|
296
|
+
|
297
|
+
node = node.parentNode;
|
298
|
+
}
|
299
|
+
|
300
|
+
return false;
|
301
|
+
}
|
302
|
+
|
303
|
+
function isPrevNode(node, name) {
|
304
|
+
return node.previousSibling && node.previousSibling.nodeName == name;
|
305
|
+
}
|
306
|
+
|
307
|
+
// Walks the dom left/right to find a suitable text node to move the endpoint into
|
308
|
+
// It will only walk within the current parent block or body and will stop if it hits a block or a BR/IMG
|
309
|
+
function findTextNodeRelative(left, startNode) {
|
310
|
+
var walker, lastInlineElement, parentBlockContainer;
|
311
|
+
|
312
|
+
startNode = startNode || container;
|
313
|
+
parentBlockContainer = dom.getParent(startNode.parentNode, dom.isBlock) || body;
|
314
|
+
|
315
|
+
// Lean left before the BR element if it's the only BR within a block element. Gecko bug: #6680
|
316
|
+
// This: <p><br>|</p> becomes <p>|<br></p>
|
317
|
+
if (left && startNode.nodeName == 'BR' && isAfterNode && dom.isEmpty(parentBlockContainer)) {
|
318
|
+
container = startNode.parentNode;
|
319
|
+
offset = dom.nodeIndex(startNode);
|
320
|
+
normalized = true;
|
321
|
+
return;
|
322
|
+
}
|
323
|
+
|
324
|
+
// Walk left until we hit a text node we can move to or a block/br/img
|
325
|
+
walker = new TreeWalker(startNode, parentBlockContainer);
|
326
|
+
while ((node = walker[left ? 'prev' : 'next']())) {
|
327
|
+
// Break if we hit a non content editable node
|
328
|
+
if (dom.getContentEditableParent(node) === "false" || isCaretContainer(node)) {
|
329
|
+
return;
|
330
|
+
}
|
331
|
+
|
332
|
+
// Found text node that has a length
|
333
|
+
if (node.nodeType === 3 && node.nodeValue.length > 0) {
|
334
|
+
container = node;
|
335
|
+
offset = left ? node.nodeValue.length : 0;
|
336
|
+
normalized = true;
|
337
|
+
return;
|
338
|
+
}
|
339
|
+
|
340
|
+
// Break if we find a block or a BR/IMG/INPUT etc
|
341
|
+
if (dom.isBlock(node) || nonEmptyElementsMap[node.nodeName.toLowerCase()]) {
|
342
|
+
return;
|
343
|
+
}
|
344
|
+
|
345
|
+
lastInlineElement = node;
|
346
|
+
}
|
347
|
+
|
348
|
+
// Only fetch the last inline element when in caret mode for now
|
349
|
+
if (collapsed && lastInlineElement) {
|
350
|
+
container = lastInlineElement;
|
351
|
+
normalized = true;
|
352
|
+
offset = 0;
|
353
|
+
}
|
354
|
+
}
|
355
|
+
|
356
|
+
container = rng[(start ? 'start' : 'end') + 'Container'];
|
357
|
+
offset = rng[(start ? 'start' : 'end') + 'Offset'];
|
358
|
+
isAfterNode = container.nodeType == 1 && offset === container.childNodes.length;
|
359
|
+
nonEmptyElementsMap = dom.schema.getNonEmptyElements();
|
360
|
+
directionLeft = start;
|
361
|
+
|
362
|
+
if (isCaretContainer(container)) {
|
363
|
+
return;
|
364
|
+
}
|
365
|
+
|
366
|
+
if (container.nodeType == 1 && offset > container.childNodes.length - 1) {
|
367
|
+
directionLeft = false;
|
368
|
+
}
|
369
|
+
|
370
|
+
// If the container is a document move it to the body element
|
371
|
+
if (container.nodeType === 9) {
|
372
|
+
container = dom.getRoot();
|
373
|
+
offset = 0;
|
374
|
+
}
|
375
|
+
|
376
|
+
// If the container is body try move it into the closest text node or position
|
377
|
+
if (container === body) {
|
378
|
+
// If start is before/after a image, table etc
|
379
|
+
if (directionLeft) {
|
380
|
+
node = container.childNodes[offset > 0 ? offset - 1 : 0];
|
381
|
+
if (node) {
|
382
|
+
if (isCaretContainer(node)) {
|
383
|
+
return;
|
384
|
+
}
|
385
|
+
|
386
|
+
if (nonEmptyElementsMap[node.nodeName] || node.nodeName == "TABLE") {
|
387
|
+
return;
|
388
|
+
}
|
389
|
+
}
|
390
|
+
}
|
391
|
+
|
392
|
+
// Resolve the index
|
393
|
+
if (container.hasChildNodes()) {
|
394
|
+
offset = Math.min(!directionLeft && offset > 0 ? offset - 1 : offset, container.childNodes.length - 1);
|
395
|
+
container = container.childNodes[offset];
|
396
|
+
offset = 0;
|
397
|
+
|
398
|
+
if (hasContentEditableFalseParent(container) || isCaretContainer(container)) {
|
399
|
+
return;
|
400
|
+
}
|
401
|
+
|
402
|
+
// Don't walk into elements that doesn't have any child nodes like a IMG
|
403
|
+
if (container.hasChildNodes() && !/TABLE/.test(container.nodeName)) {
|
404
|
+
// Walk the DOM to find a text node to place the caret at or a BR
|
405
|
+
node = container;
|
406
|
+
walker = new TreeWalker(container, body);
|
407
|
+
|
408
|
+
do {
|
409
|
+
if (isContentEditableFalse(node) || isCaretContainer(node)) {
|
410
|
+
normalized = false;
|
411
|
+
break;
|
412
|
+
}
|
413
|
+
|
414
|
+
// Found a text node use that position
|
415
|
+
if (node.nodeType === 3 && node.nodeValue.length > 0) {
|
416
|
+
offset = directionLeft ? 0 : node.nodeValue.length;
|
417
|
+
container = node;
|
418
|
+
normalized = true;
|
419
|
+
break;
|
420
|
+
}
|
421
|
+
|
422
|
+
// Found a BR/IMG element that we can place the caret before
|
423
|
+
if (nonEmptyElementsMap[node.nodeName.toLowerCase()] && !isTableCell(node)) {
|
424
|
+
offset = dom.nodeIndex(node);
|
425
|
+
container = node.parentNode;
|
426
|
+
|
427
|
+
// Put caret after image when moving the end point
|
428
|
+
if (node.nodeName == "IMG" && !directionLeft) {
|
429
|
+
offset++;
|
430
|
+
}
|
431
|
+
|
432
|
+
normalized = true;
|
433
|
+
break;
|
434
|
+
}
|
435
|
+
} while ((node = (directionLeft ? walker.next() : walker.prev())));
|
436
|
+
}
|
437
|
+
}
|
438
|
+
}
|
439
|
+
|
440
|
+
// Lean the caret to the left if possible
|
441
|
+
if (collapsed) {
|
442
|
+
// So this: <b>x</b><i>|x</i>
|
443
|
+
// Becomes: <b>x|</b><i>x</i>
|
444
|
+
// Seems that only gecko has issues with this
|
445
|
+
if (container.nodeType === 3 && offset === 0) {
|
446
|
+
findTextNodeRelative(true);
|
447
|
+
}
|
448
|
+
|
449
|
+
// Lean left into empty inline elements when the caret is before a BR
|
450
|
+
// So this: <i><b></b><i>|<br></i>
|
451
|
+
// Becomes: <i><b>|</b><i><br></i>
|
452
|
+
// Seems that only gecko has issues with this.
|
453
|
+
// Special edge case for <p><a>x</a>|<br></p> since we don't want <p><a>x|</a><br></p>
|
454
|
+
if (container.nodeType === 1) {
|
455
|
+
node = container.childNodes[offset];
|
456
|
+
|
457
|
+
// Offset is after the containers last child
|
458
|
+
// then use the previous child for normalization
|
459
|
+
if (!node) {
|
460
|
+
node = container.childNodes[offset - 1];
|
461
|
+
}
|
462
|
+
|
463
|
+
if (node && node.nodeName === 'BR' && !isPrevNode(node, 'A') &&
|
464
|
+
!hasBrBeforeAfter(node) && !hasBrBeforeAfter(node, true)) {
|
465
|
+
findTextNodeRelative(true, node);
|
466
|
+
}
|
467
|
+
}
|
468
|
+
}
|
469
|
+
|
470
|
+
// Lean the start of the selection right if possible
|
471
|
+
// So this: x[<b>x]</b>
|
472
|
+
// Becomes: x<b>[x]</b>
|
473
|
+
if (directionLeft && !collapsed && container.nodeType === 3 && offset === container.nodeValue.length) {
|
474
|
+
findTextNodeRelative(false);
|
475
|
+
}
|
476
|
+
|
477
|
+
// Set endpoint if it was normalized
|
478
|
+
if (normalized) {
|
479
|
+
rng['set' + (start ? 'Start' : 'End')](container, offset);
|
480
|
+
}
|
481
|
+
}
|
482
|
+
|
483
|
+
collapsed = rng.collapsed;
|
484
|
+
|
485
|
+
normalizeEndPoint(true);
|
486
|
+
|
487
|
+
if (!collapsed) {
|
488
|
+
normalizeEndPoint();
|
489
|
+
}
|
490
|
+
|
491
|
+
// If it was collapsed then make sure it still is
|
492
|
+
if (normalized && collapsed) {
|
493
|
+
rng.collapse(true);
|
494
|
+
}
|
495
|
+
|
496
|
+
return normalized;
|
497
|
+
};
|
498
|
+
}
|
499
|
+
|
500
|
+
/**
|
501
|
+
* Compares two ranges and checks if they are equal.
|
502
|
+
*
|
503
|
+
* @static
|
504
|
+
* @method compareRanges
|
505
|
+
* @param {DOMRange} rng1 First range to compare.
|
506
|
+
* @param {DOMRange} rng2 First range to compare.
|
507
|
+
* @return {Boolean} true/false if the ranges are equal.
|
508
|
+
*/
|
509
|
+
RangeUtils.compareRanges = function(rng1, rng2) {
|
510
|
+
if (rng1 && rng2) {
|
511
|
+
// Compare native IE ranges
|
512
|
+
if (rng1.item || rng1.duplicate) {
|
513
|
+
// Both are control ranges and the selected element matches
|
514
|
+
if (rng1.item && rng2.item && rng1.item(0) === rng2.item(0)) {
|
515
|
+
return true;
|
516
|
+
}
|
517
|
+
|
518
|
+
// Both are text ranges and the range matches
|
519
|
+
if (rng1.isEqual && rng2.isEqual && rng2.isEqual(rng1)) {
|
520
|
+
return true;
|
521
|
+
}
|
522
|
+
} else {
|
523
|
+
// Compare w3c ranges
|
524
|
+
return rng1.startContainer == rng2.startContainer && rng1.startOffset == rng2.startOffset;
|
525
|
+
}
|
526
|
+
}
|
527
|
+
|
528
|
+
return false;
|
529
|
+
};
|
530
|
+
|
531
|
+
/**
|
532
|
+
* Finds the closest selection rect tries to get the range from that.
|
533
|
+
*/
|
534
|
+
function findClosestIeRange(clientX, clientY, doc) {
|
535
|
+
var element, rng, rects;
|
536
|
+
|
537
|
+
element = doc.elementFromPoint(clientX, clientY);
|
538
|
+
rng = doc.body.createTextRange();
|
539
|
+
|
540
|
+
if (element.tagName == 'HTML') {
|
541
|
+
element = doc.body;
|
542
|
+
}
|
543
|
+
|
544
|
+
rng.moveToElementText(element);
|
545
|
+
rects = Tools.toArray(rng.getClientRects());
|
546
|
+
|
547
|
+
rects = rects.sort(function(a, b) {
|
548
|
+
a = Math.abs(Math.max(a.top - clientY, a.bottom - clientY));
|
549
|
+
b = Math.abs(Math.max(b.top - clientY, b.bottom - clientY));
|
550
|
+
|
551
|
+
return a - b;
|
552
|
+
});
|
553
|
+
|
554
|
+
if (rects.length > 0) {
|
555
|
+
clientY = (rects[0].bottom + rects[0].top) / 2;
|
556
|
+
|
557
|
+
try {
|
558
|
+
rng.moveToPoint(clientX, clientY);
|
559
|
+
rng.collapse(true);
|
560
|
+
|
561
|
+
return rng;
|
562
|
+
} catch (ex) {
|
563
|
+
// At least we tried
|
564
|
+
}
|
565
|
+
}
|
566
|
+
|
567
|
+
return null;
|
568
|
+
}
|
569
|
+
|
570
|
+
/**
|
571
|
+
* Gets the caret range for the given x/y location.
|
572
|
+
*
|
573
|
+
* @static
|
574
|
+
* @method getCaretRangeFromPoint
|
575
|
+
* @param {Number} clientX X coordinate for range
|
576
|
+
* @param {Number} clientY Y coordinate for range
|
577
|
+
* @param {Document} doc Document that x/y are relative to
|
578
|
+
* @returns {Range} caret range
|
579
|
+
*/
|
580
|
+
RangeUtils.getCaretRangeFromPoint = function(clientX, clientY, doc) {
|
581
|
+
var rng, point;
|
582
|
+
|
583
|
+
if (doc.caretPositionFromPoint) {
|
584
|
+
point = doc.caretPositionFromPoint(clientX, clientY);
|
585
|
+
rng = doc.createRange();
|
586
|
+
rng.setStart(point.offsetNode, point.offset);
|
587
|
+
rng.collapse(true);
|
588
|
+
} else if (doc.caretRangeFromPoint) {
|
589
|
+
rng = doc.caretRangeFromPoint(clientX, clientY);
|
590
|
+
} else if (doc.body.createTextRange) {
|
591
|
+
rng = doc.body.createTextRange();
|
592
|
+
|
593
|
+
try {
|
594
|
+
rng.moveToPoint(clientX, clientY);
|
595
|
+
rng.collapse(true);
|
596
|
+
} catch (ex) {
|
597
|
+
rng = findClosestIeRange(clientX, clientY, doc);
|
598
|
+
}
|
599
|
+
}
|
600
|
+
|
601
|
+
return rng;
|
602
|
+
};
|
603
|
+
|
604
|
+
RangeUtils.getSelectedNode = function(range) {
|
605
|
+
var startContainer = range.startContainer,
|
606
|
+
startOffset = range.startOffset;
|
607
|
+
|
608
|
+
if (startContainer.hasChildNodes() && range.endOffset == startOffset + 1) {
|
609
|
+
return startContainer.childNodes[startOffset];
|
610
|
+
}
|
611
|
+
|
612
|
+
return null;
|
613
|
+
};
|
614
|
+
|
615
|
+
RangeUtils.getNode = function(container, offset) {
|
616
|
+
if (container.nodeType == 1 && container.hasChildNodes()) {
|
617
|
+
if (offset >= container.childNodes.length) {
|
618
|
+
offset = container.childNodes.length - 1;
|
619
|
+
}
|
620
|
+
|
621
|
+
container = container.childNodes[offset];
|
622
|
+
}
|
623
|
+
|
624
|
+
return container;
|
625
|
+
};
|
626
|
+
|
627
|
+
return RangeUtils;
|
628
|
+
});
|