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,50 @@
|
|
1
|
+
/**
|
2
|
+
* NodePath.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
|
+
* Handles paths of nodes within an element.
|
13
|
+
*
|
14
|
+
* @private
|
15
|
+
* @class tinymce.dom.NodePath
|
16
|
+
*/
|
17
|
+
define("tinymce/dom/NodePath", [
|
18
|
+
"tinymce/dom/DOMUtils"
|
19
|
+
], function(DOMUtils) {
|
20
|
+
function create(rootNode, targetNode, normalized) {
|
21
|
+
var path = [];
|
22
|
+
|
23
|
+
for (; targetNode && targetNode != rootNode; targetNode = targetNode.parentNode) {
|
24
|
+
path.push(DOMUtils.nodeIndex(targetNode, normalized));
|
25
|
+
}
|
26
|
+
|
27
|
+
return path;
|
28
|
+
}
|
29
|
+
|
30
|
+
function resolve(rootNode, path) {
|
31
|
+
var i, node, children;
|
32
|
+
|
33
|
+
for (node = rootNode, i = path.length - 1; i >= 0; i--) {
|
34
|
+
children = node.childNodes;
|
35
|
+
|
36
|
+
if (path[i] > children.length - 1) {
|
37
|
+
return null;
|
38
|
+
}
|
39
|
+
|
40
|
+
node = children[path[i]];
|
41
|
+
}
|
42
|
+
|
43
|
+
return node;
|
44
|
+
}
|
45
|
+
|
46
|
+
return {
|
47
|
+
create: create,
|
48
|
+
resolve: resolve
|
49
|
+
};
|
50
|
+
});
|
@@ -0,0 +1,110 @@
|
|
1
|
+
/**
|
2
|
+
* NodeType.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
|
+
* Contains various node validation functions.
|
13
|
+
*
|
14
|
+
* @private
|
15
|
+
* @class tinymce.dom.NodeType
|
16
|
+
*/
|
17
|
+
define("tinymce/dom/NodeType", [], function() {
|
18
|
+
function isNodeType(type) {
|
19
|
+
return function(node) {
|
20
|
+
return !!node && node.nodeType == type;
|
21
|
+
};
|
22
|
+
}
|
23
|
+
|
24
|
+
var isElement = isNodeType(1);
|
25
|
+
|
26
|
+
function matchNodeNames(names) {
|
27
|
+
names = names.toLowerCase().split(' ');
|
28
|
+
|
29
|
+
return function(node) {
|
30
|
+
var i, name;
|
31
|
+
|
32
|
+
if (node && node.nodeType) {
|
33
|
+
name = node.nodeName.toLowerCase();
|
34
|
+
|
35
|
+
for (i = 0; i < names.length; i++) {
|
36
|
+
if (name === names[i]) {
|
37
|
+
return true;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
}
|
41
|
+
|
42
|
+
return false;
|
43
|
+
};
|
44
|
+
}
|
45
|
+
|
46
|
+
function matchStyleValues(name, values) {
|
47
|
+
values = values.toLowerCase().split(' ');
|
48
|
+
|
49
|
+
return function(node) {
|
50
|
+
var i, cssValue;
|
51
|
+
|
52
|
+
if (isElement(node)) {
|
53
|
+
for (i = 0; i < values.length; i++) {
|
54
|
+
cssValue = getComputedStyle(node, null).getPropertyValue(name);
|
55
|
+
if (cssValue === values[i]) {
|
56
|
+
return true;
|
57
|
+
}
|
58
|
+
}
|
59
|
+
}
|
60
|
+
|
61
|
+
return false;
|
62
|
+
};
|
63
|
+
}
|
64
|
+
|
65
|
+
function hasPropValue(propName, propValue) {
|
66
|
+
return function(node) {
|
67
|
+
return isElement(node) && node[propName] === propValue;
|
68
|
+
};
|
69
|
+
}
|
70
|
+
|
71
|
+
function hasAttributeValue(attrName, attrValue) {
|
72
|
+
return function(node) {
|
73
|
+
return isElement(node) && node.getAttribute(attrName) === attrValue;
|
74
|
+
};
|
75
|
+
}
|
76
|
+
|
77
|
+
function isBogus(node) {
|
78
|
+
return isElement(node) && node.hasAttribute('data-mce-bogus');
|
79
|
+
}
|
80
|
+
|
81
|
+
function hasContentEditableState(value) {
|
82
|
+
return function(node) {
|
83
|
+
if (isElement(node)) {
|
84
|
+
if (node.contentEditable === value) {
|
85
|
+
return true;
|
86
|
+
}
|
87
|
+
|
88
|
+
if (node.getAttribute('data-mce-contenteditable') === value) {
|
89
|
+
return true;
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
return false;
|
94
|
+
};
|
95
|
+
}
|
96
|
+
|
97
|
+
return {
|
98
|
+
isText: isNodeType(3),
|
99
|
+
isElement: isElement,
|
100
|
+
isComment: isNodeType(8),
|
101
|
+
isBr: matchNodeNames('br'),
|
102
|
+
isContentEditableTrue: hasContentEditableState('true'),
|
103
|
+
isContentEditableFalse: hasContentEditableState('false'),
|
104
|
+
matchNodeNames: matchNodeNames,
|
105
|
+
hasPropValue: hasPropValue,
|
106
|
+
hasAttributeValue: hasAttributeValue,
|
107
|
+
matchStyleValues: matchStyleValues,
|
108
|
+
isBogus: isBogus
|
109
|
+
};
|
110
|
+
});
|
@@ -0,0 +1,785 @@
|
|
1
|
+
/**
|
2
|
+
* Range.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
|
+
* Old IE Range.
|
13
|
+
*
|
14
|
+
* @private
|
15
|
+
* @class tinymce.dom.Range
|
16
|
+
*/
|
17
|
+
define("tinymce/dom/Range", [
|
18
|
+
"tinymce/util/Tools"
|
19
|
+
], function(Tools) {
|
20
|
+
// Range constructor
|
21
|
+
function Range(dom) {
|
22
|
+
var self = this,
|
23
|
+
doc = dom.doc,
|
24
|
+
EXTRACT = 0,
|
25
|
+
CLONE = 1,
|
26
|
+
DELETE = 2,
|
27
|
+
TRUE = true,
|
28
|
+
FALSE = false,
|
29
|
+
START_OFFSET = 'startOffset',
|
30
|
+
START_CONTAINER = 'startContainer',
|
31
|
+
END_CONTAINER = 'endContainer',
|
32
|
+
END_OFFSET = 'endOffset',
|
33
|
+
extend = Tools.extend,
|
34
|
+
nodeIndex = dom.nodeIndex;
|
35
|
+
|
36
|
+
function createDocumentFragment() {
|
37
|
+
return doc.createDocumentFragment();
|
38
|
+
}
|
39
|
+
|
40
|
+
function setStart(n, o) {
|
41
|
+
_setEndPoint(TRUE, n, o);
|
42
|
+
}
|
43
|
+
|
44
|
+
function setEnd(n, o) {
|
45
|
+
_setEndPoint(FALSE, n, o);
|
46
|
+
}
|
47
|
+
|
48
|
+
function setStartBefore(n) {
|
49
|
+
setStart(n.parentNode, nodeIndex(n));
|
50
|
+
}
|
51
|
+
|
52
|
+
function setStartAfter(n) {
|
53
|
+
setStart(n.parentNode, nodeIndex(n) + 1);
|
54
|
+
}
|
55
|
+
|
56
|
+
function setEndBefore(n) {
|
57
|
+
setEnd(n.parentNode, nodeIndex(n));
|
58
|
+
}
|
59
|
+
|
60
|
+
function setEndAfter(n) {
|
61
|
+
setEnd(n.parentNode, nodeIndex(n) + 1);
|
62
|
+
}
|
63
|
+
|
64
|
+
function collapse(ts) {
|
65
|
+
if (ts) {
|
66
|
+
self[END_CONTAINER] = self[START_CONTAINER];
|
67
|
+
self[END_OFFSET] = self[START_OFFSET];
|
68
|
+
} else {
|
69
|
+
self[START_CONTAINER] = self[END_CONTAINER];
|
70
|
+
self[START_OFFSET] = self[END_OFFSET];
|
71
|
+
}
|
72
|
+
|
73
|
+
self.collapsed = TRUE;
|
74
|
+
}
|
75
|
+
|
76
|
+
function selectNode(n) {
|
77
|
+
setStartBefore(n);
|
78
|
+
setEndAfter(n);
|
79
|
+
}
|
80
|
+
|
81
|
+
function selectNodeContents(n) {
|
82
|
+
setStart(n, 0);
|
83
|
+
setEnd(n, n.nodeType === 1 ? n.childNodes.length : n.nodeValue.length);
|
84
|
+
}
|
85
|
+
|
86
|
+
function compareBoundaryPoints(h, r) {
|
87
|
+
var sc = self[START_CONTAINER], so = self[START_OFFSET], ec = self[END_CONTAINER], eo = self[END_OFFSET],
|
88
|
+
rsc = r.startContainer, rso = r.startOffset, rec = r.endContainer, reo = r.endOffset;
|
89
|
+
|
90
|
+
// Check START_TO_START
|
91
|
+
if (h === 0) {
|
92
|
+
return _compareBoundaryPoints(sc, so, rsc, rso);
|
93
|
+
}
|
94
|
+
|
95
|
+
// Check START_TO_END
|
96
|
+
if (h === 1) {
|
97
|
+
return _compareBoundaryPoints(ec, eo, rsc, rso);
|
98
|
+
}
|
99
|
+
|
100
|
+
// Check END_TO_END
|
101
|
+
if (h === 2) {
|
102
|
+
return _compareBoundaryPoints(ec, eo, rec, reo);
|
103
|
+
}
|
104
|
+
|
105
|
+
// Check END_TO_START
|
106
|
+
if (h === 3) {
|
107
|
+
return _compareBoundaryPoints(sc, so, rec, reo);
|
108
|
+
}
|
109
|
+
}
|
110
|
+
|
111
|
+
function deleteContents() {
|
112
|
+
_traverse(DELETE);
|
113
|
+
}
|
114
|
+
|
115
|
+
function extractContents() {
|
116
|
+
return _traverse(EXTRACT);
|
117
|
+
}
|
118
|
+
|
119
|
+
function cloneContents() {
|
120
|
+
return _traverse(CLONE);
|
121
|
+
}
|
122
|
+
|
123
|
+
function insertNode(n) {
|
124
|
+
var startContainer = this[START_CONTAINER],
|
125
|
+
startOffset = this[START_OFFSET], nn, o;
|
126
|
+
|
127
|
+
// Node is TEXT_NODE or CDATA
|
128
|
+
if ((startContainer.nodeType === 3 || startContainer.nodeType === 4) && startContainer.nodeValue) {
|
129
|
+
if (!startOffset) {
|
130
|
+
// At the start of text
|
131
|
+
startContainer.parentNode.insertBefore(n, startContainer);
|
132
|
+
} else if (startOffset >= startContainer.nodeValue.length) {
|
133
|
+
// At the end of text
|
134
|
+
dom.insertAfter(n, startContainer);
|
135
|
+
} else {
|
136
|
+
// Middle, need to split
|
137
|
+
nn = startContainer.splitText(startOffset);
|
138
|
+
startContainer.parentNode.insertBefore(n, nn);
|
139
|
+
}
|
140
|
+
} else {
|
141
|
+
// Insert element node
|
142
|
+
if (startContainer.childNodes.length > 0) {
|
143
|
+
o = startContainer.childNodes[startOffset];
|
144
|
+
}
|
145
|
+
|
146
|
+
if (o) {
|
147
|
+
startContainer.insertBefore(n, o);
|
148
|
+
} else {
|
149
|
+
if (startContainer.nodeType == 3) {
|
150
|
+
dom.insertAfter(n, startContainer);
|
151
|
+
} else {
|
152
|
+
startContainer.appendChild(n);
|
153
|
+
}
|
154
|
+
}
|
155
|
+
}
|
156
|
+
}
|
157
|
+
|
158
|
+
function surroundContents(n) {
|
159
|
+
var f = self.extractContents();
|
160
|
+
|
161
|
+
self.insertNode(n);
|
162
|
+
n.appendChild(f);
|
163
|
+
self.selectNode(n);
|
164
|
+
}
|
165
|
+
|
166
|
+
function cloneRange() {
|
167
|
+
return extend(new Range(dom), {
|
168
|
+
startContainer: self[START_CONTAINER],
|
169
|
+
startOffset: self[START_OFFSET],
|
170
|
+
endContainer: self[END_CONTAINER],
|
171
|
+
endOffset: self[END_OFFSET],
|
172
|
+
collapsed: self.collapsed,
|
173
|
+
commonAncestorContainer: self.commonAncestorContainer
|
174
|
+
});
|
175
|
+
}
|
176
|
+
|
177
|
+
// Private methods
|
178
|
+
|
179
|
+
function _getSelectedNode(container, offset) {
|
180
|
+
var child;
|
181
|
+
|
182
|
+
// TEXT_NODE
|
183
|
+
if (container.nodeType == 3) {
|
184
|
+
return container;
|
185
|
+
}
|
186
|
+
|
187
|
+
if (offset < 0) {
|
188
|
+
return container;
|
189
|
+
}
|
190
|
+
|
191
|
+
child = container.firstChild;
|
192
|
+
while (child && offset > 0) {
|
193
|
+
--offset;
|
194
|
+
child = child.nextSibling;
|
195
|
+
}
|
196
|
+
|
197
|
+
if (child) {
|
198
|
+
return child;
|
199
|
+
}
|
200
|
+
|
201
|
+
return container;
|
202
|
+
}
|
203
|
+
|
204
|
+
function _isCollapsed() {
|
205
|
+
return (self[START_CONTAINER] == self[END_CONTAINER] && self[START_OFFSET] == self[END_OFFSET]);
|
206
|
+
}
|
207
|
+
|
208
|
+
function _compareBoundaryPoints(containerA, offsetA, containerB, offsetB) {
|
209
|
+
var c, offsetC, n, cmnRoot, childA, childB;
|
210
|
+
|
211
|
+
// In the first case the boundary-points have the same container. A is before B
|
212
|
+
// if its offset is less than the offset of B, A is equal to B if its offset is
|
213
|
+
// equal to the offset of B, and A is after B if its offset is greater than the
|
214
|
+
// offset of B.
|
215
|
+
if (containerA == containerB) {
|
216
|
+
if (offsetA == offsetB) {
|
217
|
+
return 0; // equal
|
218
|
+
}
|
219
|
+
|
220
|
+
if (offsetA < offsetB) {
|
221
|
+
return -1; // before
|
222
|
+
}
|
223
|
+
|
224
|
+
return 1; // after
|
225
|
+
}
|
226
|
+
|
227
|
+
// In the second case a child node C of the container of A is an ancestor
|
228
|
+
// container of B. In this case, A is before B if the offset of A is less than or
|
229
|
+
// equal to the index of the child node C and A is after B otherwise.
|
230
|
+
c = containerB;
|
231
|
+
while (c && c.parentNode != containerA) {
|
232
|
+
c = c.parentNode;
|
233
|
+
}
|
234
|
+
|
235
|
+
if (c) {
|
236
|
+
offsetC = 0;
|
237
|
+
n = containerA.firstChild;
|
238
|
+
|
239
|
+
while (n != c && offsetC < offsetA) {
|
240
|
+
offsetC++;
|
241
|
+
n = n.nextSibling;
|
242
|
+
}
|
243
|
+
|
244
|
+
if (offsetA <= offsetC) {
|
245
|
+
return -1; // before
|
246
|
+
}
|
247
|
+
|
248
|
+
return 1; // after
|
249
|
+
}
|
250
|
+
|
251
|
+
// In the third case a child node C of the container of B is an ancestor container
|
252
|
+
// of A. In this case, A is before B if the index of the child node C is less than
|
253
|
+
// the offset of B and A is after B otherwise.
|
254
|
+
c = containerA;
|
255
|
+
while (c && c.parentNode != containerB) {
|
256
|
+
c = c.parentNode;
|
257
|
+
}
|
258
|
+
|
259
|
+
if (c) {
|
260
|
+
offsetC = 0;
|
261
|
+
n = containerB.firstChild;
|
262
|
+
|
263
|
+
while (n != c && offsetC < offsetB) {
|
264
|
+
offsetC++;
|
265
|
+
n = n.nextSibling;
|
266
|
+
}
|
267
|
+
|
268
|
+
if (offsetC < offsetB) {
|
269
|
+
return -1; // before
|
270
|
+
}
|
271
|
+
|
272
|
+
return 1; // after
|
273
|
+
}
|
274
|
+
|
275
|
+
// In the fourth case, none of three other cases hold: the containers of A and B
|
276
|
+
// are siblings or descendants of sibling nodes. In this case, A is before B if
|
277
|
+
// the container of A is before the container of B in a pre-order traversal of the
|
278
|
+
// Ranges' context tree and A is after B otherwise.
|
279
|
+
cmnRoot = dom.findCommonAncestor(containerA, containerB);
|
280
|
+
childA = containerA;
|
281
|
+
|
282
|
+
while (childA && childA.parentNode != cmnRoot) {
|
283
|
+
childA = childA.parentNode;
|
284
|
+
}
|
285
|
+
|
286
|
+
if (!childA) {
|
287
|
+
childA = cmnRoot;
|
288
|
+
}
|
289
|
+
|
290
|
+
childB = containerB;
|
291
|
+
while (childB && childB.parentNode != cmnRoot) {
|
292
|
+
childB = childB.parentNode;
|
293
|
+
}
|
294
|
+
|
295
|
+
if (!childB) {
|
296
|
+
childB = cmnRoot;
|
297
|
+
}
|
298
|
+
|
299
|
+
if (childA == childB) {
|
300
|
+
return 0; // equal
|
301
|
+
}
|
302
|
+
|
303
|
+
n = cmnRoot.firstChild;
|
304
|
+
while (n) {
|
305
|
+
if (n == childA) {
|
306
|
+
return -1; // before
|
307
|
+
}
|
308
|
+
|
309
|
+
if (n == childB) {
|
310
|
+
return 1; // after
|
311
|
+
}
|
312
|
+
|
313
|
+
n = n.nextSibling;
|
314
|
+
}
|
315
|
+
}
|
316
|
+
|
317
|
+
function _setEndPoint(st, n, o) {
|
318
|
+
var ec, sc;
|
319
|
+
|
320
|
+
if (st) {
|
321
|
+
self[START_CONTAINER] = n;
|
322
|
+
self[START_OFFSET] = o;
|
323
|
+
} else {
|
324
|
+
self[END_CONTAINER] = n;
|
325
|
+
self[END_OFFSET] = o;
|
326
|
+
}
|
327
|
+
|
328
|
+
// If one boundary-point of a Range is set to have a root container
|
329
|
+
// other than the current one for the Range, the Range is collapsed to
|
330
|
+
// the new position. This enforces the restriction that both boundary-
|
331
|
+
// points of a Range must have the same root container.
|
332
|
+
ec = self[END_CONTAINER];
|
333
|
+
while (ec.parentNode) {
|
334
|
+
ec = ec.parentNode;
|
335
|
+
}
|
336
|
+
|
337
|
+
sc = self[START_CONTAINER];
|
338
|
+
while (sc.parentNode) {
|
339
|
+
sc = sc.parentNode;
|
340
|
+
}
|
341
|
+
|
342
|
+
if (sc == ec) {
|
343
|
+
// The start position of a Range is guaranteed to never be after the
|
344
|
+
// end position. To enforce this restriction, if the start is set to
|
345
|
+
// be at a position after the end, the Range is collapsed to that
|
346
|
+
// position.
|
347
|
+
if (_compareBoundaryPoints(self[START_CONTAINER], self[START_OFFSET], self[END_CONTAINER], self[END_OFFSET]) > 0) {
|
348
|
+
self.collapse(st);
|
349
|
+
}
|
350
|
+
} else {
|
351
|
+
self.collapse(st);
|
352
|
+
}
|
353
|
+
|
354
|
+
self.collapsed = _isCollapsed();
|
355
|
+
self.commonAncestorContainer = dom.findCommonAncestor(self[START_CONTAINER], self[END_CONTAINER]);
|
356
|
+
}
|
357
|
+
|
358
|
+
function _traverse(how) {
|
359
|
+
var c, endContainerDepth = 0, startContainerDepth = 0, p, depthDiff, startNode, endNode, sp, ep;
|
360
|
+
|
361
|
+
if (self[START_CONTAINER] == self[END_CONTAINER]) {
|
362
|
+
return _traverseSameContainer(how);
|
363
|
+
}
|
364
|
+
|
365
|
+
for (c = self[END_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) {
|
366
|
+
if (p == self[START_CONTAINER]) {
|
367
|
+
return _traverseCommonStartContainer(c, how);
|
368
|
+
}
|
369
|
+
|
370
|
+
++endContainerDepth;
|
371
|
+
}
|
372
|
+
|
373
|
+
for (c = self[START_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) {
|
374
|
+
if (p == self[END_CONTAINER]) {
|
375
|
+
return _traverseCommonEndContainer(c, how);
|
376
|
+
}
|
377
|
+
|
378
|
+
++startContainerDepth;
|
379
|
+
}
|
380
|
+
|
381
|
+
depthDiff = startContainerDepth - endContainerDepth;
|
382
|
+
|
383
|
+
startNode = self[START_CONTAINER];
|
384
|
+
while (depthDiff > 0) {
|
385
|
+
startNode = startNode.parentNode;
|
386
|
+
depthDiff--;
|
387
|
+
}
|
388
|
+
|
389
|
+
endNode = self[END_CONTAINER];
|
390
|
+
while (depthDiff < 0) {
|
391
|
+
endNode = endNode.parentNode;
|
392
|
+
depthDiff++;
|
393
|
+
}
|
394
|
+
|
395
|
+
// ascend the ancestor hierarchy until we have a common parent.
|
396
|
+
for (sp = startNode.parentNode, ep = endNode.parentNode; sp != ep; sp = sp.parentNode, ep = ep.parentNode) {
|
397
|
+
startNode = sp;
|
398
|
+
endNode = ep;
|
399
|
+
}
|
400
|
+
|
401
|
+
return _traverseCommonAncestors(startNode, endNode, how);
|
402
|
+
}
|
403
|
+
|
404
|
+
function _traverseSameContainer(how) {
|
405
|
+
var frag, s, sub, n, cnt, sibling, xferNode, start, len;
|
406
|
+
|
407
|
+
if (how != DELETE) {
|
408
|
+
frag = createDocumentFragment();
|
409
|
+
}
|
410
|
+
|
411
|
+
// If selection is empty, just return the fragment
|
412
|
+
if (self[START_OFFSET] == self[END_OFFSET]) {
|
413
|
+
return frag;
|
414
|
+
}
|
415
|
+
|
416
|
+
// Text node needs special case handling
|
417
|
+
if (self[START_CONTAINER].nodeType == 3) { // TEXT_NODE
|
418
|
+
// get the substring
|
419
|
+
s = self[START_CONTAINER].nodeValue;
|
420
|
+
sub = s.substring(self[START_OFFSET], self[END_OFFSET]);
|
421
|
+
|
422
|
+
// set the original text node to its new value
|
423
|
+
if (how != CLONE) {
|
424
|
+
n = self[START_CONTAINER];
|
425
|
+
start = self[START_OFFSET];
|
426
|
+
len = self[END_OFFSET] - self[START_OFFSET];
|
427
|
+
|
428
|
+
if (start === 0 && len >= n.nodeValue.length - 1) {
|
429
|
+
n.parentNode.removeChild(n);
|
430
|
+
} else {
|
431
|
+
n.deleteData(start, len);
|
432
|
+
}
|
433
|
+
|
434
|
+
// Nothing is partially selected, so collapse to start point
|
435
|
+
self.collapse(TRUE);
|
436
|
+
}
|
437
|
+
|
438
|
+
if (how == DELETE) {
|
439
|
+
return;
|
440
|
+
}
|
441
|
+
|
442
|
+
if (sub.length > 0) {
|
443
|
+
frag.appendChild(doc.createTextNode(sub));
|
444
|
+
}
|
445
|
+
|
446
|
+
return frag;
|
447
|
+
}
|
448
|
+
|
449
|
+
// Copy nodes between the start/end offsets.
|
450
|
+
n = _getSelectedNode(self[START_CONTAINER], self[START_OFFSET]);
|
451
|
+
cnt = self[END_OFFSET] - self[START_OFFSET];
|
452
|
+
|
453
|
+
while (n && cnt > 0) {
|
454
|
+
sibling = n.nextSibling;
|
455
|
+
xferNode = _traverseFullySelected(n, how);
|
456
|
+
|
457
|
+
if (frag) {
|
458
|
+
frag.appendChild(xferNode);
|
459
|
+
}
|
460
|
+
|
461
|
+
--cnt;
|
462
|
+
n = sibling;
|
463
|
+
}
|
464
|
+
|
465
|
+
// Nothing is partially selected, so collapse to start point
|
466
|
+
if (how != CLONE) {
|
467
|
+
self.collapse(TRUE);
|
468
|
+
}
|
469
|
+
|
470
|
+
return frag;
|
471
|
+
}
|
472
|
+
|
473
|
+
function _traverseCommonStartContainer(endAncestor, how) {
|
474
|
+
var frag, n, endIdx, cnt, sibling, xferNode;
|
475
|
+
|
476
|
+
if (how != DELETE) {
|
477
|
+
frag = createDocumentFragment();
|
478
|
+
}
|
479
|
+
|
480
|
+
n = _traverseRightBoundary(endAncestor, how);
|
481
|
+
|
482
|
+
if (frag) {
|
483
|
+
frag.appendChild(n);
|
484
|
+
}
|
485
|
+
|
486
|
+
endIdx = nodeIndex(endAncestor);
|
487
|
+
cnt = endIdx - self[START_OFFSET];
|
488
|
+
|
489
|
+
if (cnt <= 0) {
|
490
|
+
// Collapse to just before the endAncestor, which
|
491
|
+
// is partially selected.
|
492
|
+
if (how != CLONE) {
|
493
|
+
self.setEndBefore(endAncestor);
|
494
|
+
self.collapse(FALSE);
|
495
|
+
}
|
496
|
+
|
497
|
+
return frag;
|
498
|
+
}
|
499
|
+
|
500
|
+
n = endAncestor.previousSibling;
|
501
|
+
while (cnt > 0) {
|
502
|
+
sibling = n.previousSibling;
|
503
|
+
xferNode = _traverseFullySelected(n, how);
|
504
|
+
|
505
|
+
if (frag) {
|
506
|
+
frag.insertBefore(xferNode, frag.firstChild);
|
507
|
+
}
|
508
|
+
|
509
|
+
--cnt;
|
510
|
+
n = sibling;
|
511
|
+
}
|
512
|
+
|
513
|
+
// Collapse to just before the endAncestor, which
|
514
|
+
// is partially selected.
|
515
|
+
if (how != CLONE) {
|
516
|
+
self.setEndBefore(endAncestor);
|
517
|
+
self.collapse(FALSE);
|
518
|
+
}
|
519
|
+
|
520
|
+
return frag;
|
521
|
+
}
|
522
|
+
|
523
|
+
function _traverseCommonEndContainer(startAncestor, how) {
|
524
|
+
var frag, startIdx, n, cnt, sibling, xferNode;
|
525
|
+
|
526
|
+
if (how != DELETE) {
|
527
|
+
frag = createDocumentFragment();
|
528
|
+
}
|
529
|
+
|
530
|
+
n = _traverseLeftBoundary(startAncestor, how);
|
531
|
+
if (frag) {
|
532
|
+
frag.appendChild(n);
|
533
|
+
}
|
534
|
+
|
535
|
+
startIdx = nodeIndex(startAncestor);
|
536
|
+
++startIdx; // Because we already traversed it
|
537
|
+
|
538
|
+
cnt = self[END_OFFSET] - startIdx;
|
539
|
+
n = startAncestor.nextSibling;
|
540
|
+
while (n && cnt > 0) {
|
541
|
+
sibling = n.nextSibling;
|
542
|
+
xferNode = _traverseFullySelected(n, how);
|
543
|
+
|
544
|
+
if (frag) {
|
545
|
+
frag.appendChild(xferNode);
|
546
|
+
}
|
547
|
+
|
548
|
+
--cnt;
|
549
|
+
n = sibling;
|
550
|
+
}
|
551
|
+
|
552
|
+
if (how != CLONE) {
|
553
|
+
self.setStartAfter(startAncestor);
|
554
|
+
self.collapse(TRUE);
|
555
|
+
}
|
556
|
+
|
557
|
+
return frag;
|
558
|
+
}
|
559
|
+
|
560
|
+
function _traverseCommonAncestors(startAncestor, endAncestor, how) {
|
561
|
+
var n, frag, startOffset, endOffset, cnt, sibling, nextSibling;
|
562
|
+
|
563
|
+
if (how != DELETE) {
|
564
|
+
frag = createDocumentFragment();
|
565
|
+
}
|
566
|
+
|
567
|
+
n = _traverseLeftBoundary(startAncestor, how);
|
568
|
+
if (frag) {
|
569
|
+
frag.appendChild(n);
|
570
|
+
}
|
571
|
+
|
572
|
+
startOffset = nodeIndex(startAncestor);
|
573
|
+
endOffset = nodeIndex(endAncestor);
|
574
|
+
++startOffset;
|
575
|
+
|
576
|
+
cnt = endOffset - startOffset;
|
577
|
+
sibling = startAncestor.nextSibling;
|
578
|
+
|
579
|
+
while (cnt > 0) {
|
580
|
+
nextSibling = sibling.nextSibling;
|
581
|
+
n = _traverseFullySelected(sibling, how);
|
582
|
+
|
583
|
+
if (frag) {
|
584
|
+
frag.appendChild(n);
|
585
|
+
}
|
586
|
+
|
587
|
+
sibling = nextSibling;
|
588
|
+
--cnt;
|
589
|
+
}
|
590
|
+
|
591
|
+
n = _traverseRightBoundary(endAncestor, how);
|
592
|
+
|
593
|
+
if (frag) {
|
594
|
+
frag.appendChild(n);
|
595
|
+
}
|
596
|
+
|
597
|
+
if (how != CLONE) {
|
598
|
+
self.setStartAfter(startAncestor);
|
599
|
+
self.collapse(TRUE);
|
600
|
+
}
|
601
|
+
|
602
|
+
return frag;
|
603
|
+
}
|
604
|
+
|
605
|
+
function _traverseRightBoundary(root, how) {
|
606
|
+
var next = _getSelectedNode(self[END_CONTAINER], self[END_OFFSET] - 1), parent, clonedParent;
|
607
|
+
var prevSibling, clonedChild, clonedGrandParent, isFullySelected = next != self[END_CONTAINER];
|
608
|
+
|
609
|
+
if (next == root) {
|
610
|
+
return _traverseNode(next, isFullySelected, FALSE, how);
|
611
|
+
}
|
612
|
+
|
613
|
+
parent = next.parentNode;
|
614
|
+
clonedParent = _traverseNode(parent, FALSE, FALSE, how);
|
615
|
+
|
616
|
+
while (parent) {
|
617
|
+
while (next) {
|
618
|
+
prevSibling = next.previousSibling;
|
619
|
+
clonedChild = _traverseNode(next, isFullySelected, FALSE, how);
|
620
|
+
|
621
|
+
if (how != DELETE) {
|
622
|
+
clonedParent.insertBefore(clonedChild, clonedParent.firstChild);
|
623
|
+
}
|
624
|
+
|
625
|
+
isFullySelected = TRUE;
|
626
|
+
next = prevSibling;
|
627
|
+
}
|
628
|
+
|
629
|
+
if (parent == root) {
|
630
|
+
return clonedParent;
|
631
|
+
}
|
632
|
+
|
633
|
+
next = parent.previousSibling;
|
634
|
+
parent = parent.parentNode;
|
635
|
+
|
636
|
+
clonedGrandParent = _traverseNode(parent, FALSE, FALSE, how);
|
637
|
+
|
638
|
+
if (how != DELETE) {
|
639
|
+
clonedGrandParent.appendChild(clonedParent);
|
640
|
+
}
|
641
|
+
|
642
|
+
clonedParent = clonedGrandParent;
|
643
|
+
}
|
644
|
+
}
|
645
|
+
|
646
|
+
function _traverseLeftBoundary(root, how) {
|
647
|
+
var next = _getSelectedNode(self[START_CONTAINER], self[START_OFFSET]), isFullySelected = next != self[START_CONTAINER];
|
648
|
+
var parent, clonedParent, nextSibling, clonedChild, clonedGrandParent;
|
649
|
+
|
650
|
+
if (next == root) {
|
651
|
+
return _traverseNode(next, isFullySelected, TRUE, how);
|
652
|
+
}
|
653
|
+
|
654
|
+
parent = next.parentNode;
|
655
|
+
clonedParent = _traverseNode(parent, FALSE, TRUE, how);
|
656
|
+
|
657
|
+
while (parent) {
|
658
|
+
while (next) {
|
659
|
+
nextSibling = next.nextSibling;
|
660
|
+
clonedChild = _traverseNode(next, isFullySelected, TRUE, how);
|
661
|
+
|
662
|
+
if (how != DELETE) {
|
663
|
+
clonedParent.appendChild(clonedChild);
|
664
|
+
}
|
665
|
+
|
666
|
+
isFullySelected = TRUE;
|
667
|
+
next = nextSibling;
|
668
|
+
}
|
669
|
+
|
670
|
+
if (parent == root) {
|
671
|
+
return clonedParent;
|
672
|
+
}
|
673
|
+
|
674
|
+
next = parent.nextSibling;
|
675
|
+
parent = parent.parentNode;
|
676
|
+
|
677
|
+
clonedGrandParent = _traverseNode(parent, FALSE, TRUE, how);
|
678
|
+
|
679
|
+
if (how != DELETE) {
|
680
|
+
clonedGrandParent.appendChild(clonedParent);
|
681
|
+
}
|
682
|
+
|
683
|
+
clonedParent = clonedGrandParent;
|
684
|
+
}
|
685
|
+
}
|
686
|
+
|
687
|
+
function _traverseNode(n, isFullySelected, isLeft, how) {
|
688
|
+
var txtValue, newNodeValue, oldNodeValue, offset, newNode;
|
689
|
+
|
690
|
+
if (isFullySelected) {
|
691
|
+
return _traverseFullySelected(n, how);
|
692
|
+
}
|
693
|
+
|
694
|
+
// TEXT_NODE
|
695
|
+
if (n.nodeType == 3) {
|
696
|
+
txtValue = n.nodeValue;
|
697
|
+
|
698
|
+
if (isLeft) {
|
699
|
+
offset = self[START_OFFSET];
|
700
|
+
newNodeValue = txtValue.substring(offset);
|
701
|
+
oldNodeValue = txtValue.substring(0, offset);
|
702
|
+
} else {
|
703
|
+
offset = self[END_OFFSET];
|
704
|
+
newNodeValue = txtValue.substring(0, offset);
|
705
|
+
oldNodeValue = txtValue.substring(offset);
|
706
|
+
}
|
707
|
+
|
708
|
+
if (how != CLONE) {
|
709
|
+
n.nodeValue = oldNodeValue;
|
710
|
+
}
|
711
|
+
|
712
|
+
if (how == DELETE) {
|
713
|
+
return;
|
714
|
+
}
|
715
|
+
|
716
|
+
newNode = dom.clone(n, FALSE);
|
717
|
+
newNode.nodeValue = newNodeValue;
|
718
|
+
|
719
|
+
return newNode;
|
720
|
+
}
|
721
|
+
|
722
|
+
if (how == DELETE) {
|
723
|
+
return;
|
724
|
+
}
|
725
|
+
|
726
|
+
return dom.clone(n, FALSE);
|
727
|
+
}
|
728
|
+
|
729
|
+
function _traverseFullySelected(n, how) {
|
730
|
+
if (how != DELETE) {
|
731
|
+
return how == CLONE ? dom.clone(n, TRUE) : n;
|
732
|
+
}
|
733
|
+
|
734
|
+
n.parentNode.removeChild(n);
|
735
|
+
}
|
736
|
+
|
737
|
+
function toStringIE() {
|
738
|
+
return dom.create('body', null, cloneContents()).outerText;
|
739
|
+
}
|
740
|
+
|
741
|
+
extend(self, {
|
742
|
+
// Initial states
|
743
|
+
startContainer: doc,
|
744
|
+
startOffset: 0,
|
745
|
+
endContainer: doc,
|
746
|
+
endOffset: 0,
|
747
|
+
collapsed: TRUE,
|
748
|
+
commonAncestorContainer: doc,
|
749
|
+
|
750
|
+
// Range constants
|
751
|
+
START_TO_START: 0,
|
752
|
+
START_TO_END: 1,
|
753
|
+
END_TO_END: 2,
|
754
|
+
END_TO_START: 3,
|
755
|
+
|
756
|
+
// Public methods
|
757
|
+
setStart: setStart,
|
758
|
+
setEnd: setEnd,
|
759
|
+
setStartBefore: setStartBefore,
|
760
|
+
setStartAfter: setStartAfter,
|
761
|
+
setEndBefore: setEndBefore,
|
762
|
+
setEndAfter: setEndAfter,
|
763
|
+
collapse: collapse,
|
764
|
+
selectNode: selectNode,
|
765
|
+
selectNodeContents: selectNodeContents,
|
766
|
+
compareBoundaryPoints: compareBoundaryPoints,
|
767
|
+
deleteContents: deleteContents,
|
768
|
+
extractContents: extractContents,
|
769
|
+
cloneContents: cloneContents,
|
770
|
+
insertNode: insertNode,
|
771
|
+
surroundContents: surroundContents,
|
772
|
+
cloneRange: cloneRange,
|
773
|
+
toStringIE: toStringIE
|
774
|
+
});
|
775
|
+
|
776
|
+
return self;
|
777
|
+
}
|
778
|
+
|
779
|
+
// Older IE versions doesn't let you override toString by it's constructor so we have to stick it in the prototype
|
780
|
+
Range.prototype.toString = function() {
|
781
|
+
return this.toStringIE();
|
782
|
+
};
|
783
|
+
|
784
|
+
return Range;
|
785
|
+
});
|