spiderfw 0.6.38 → 0.6.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,64 @@
|
|
1
|
+
/**
|
2
|
+
* Dimensions.js
|
3
|
+
*
|
4
|
+
* Released under LGPL License.
|
5
|
+
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved
|
6
|
+
*
|
7
|
+
* License: http://www.tinymce.com/license
|
8
|
+
* Contributing: http://www.tinymce.com/contributing
|
9
|
+
*/
|
10
|
+
|
11
|
+
/**
|
12
|
+
* This module measures nodes and returns client rects. The client rects has an
|
13
|
+
* extra node property.
|
14
|
+
*
|
15
|
+
* @private
|
16
|
+
* @class tinymce.dom.Dimensions
|
17
|
+
*/
|
18
|
+
define("tinymce/dom/Dimensions", [
|
19
|
+
"tinymce/util/Arr",
|
20
|
+
"tinymce/dom/NodeType",
|
21
|
+
"tinymce/geom/ClientRect"
|
22
|
+
], function(Arr, NodeType, ClientRect) {
|
23
|
+
|
24
|
+
function getClientRects(node) {
|
25
|
+
function toArrayWithNode(clientRects) {
|
26
|
+
return Arr.map(clientRects, function(clientRect) {
|
27
|
+
clientRect = ClientRect.clone(clientRect);
|
28
|
+
clientRect.node = node;
|
29
|
+
|
30
|
+
return clientRect;
|
31
|
+
});
|
32
|
+
}
|
33
|
+
|
34
|
+
if (Arr.isArray(node)) {
|
35
|
+
return Arr.reduce(node, function(result, node) {
|
36
|
+
return result.concat(getClientRects(node));
|
37
|
+
}, []);
|
38
|
+
}
|
39
|
+
|
40
|
+
if (NodeType.isElement(node)) {
|
41
|
+
return toArrayWithNode(node.getClientRects());
|
42
|
+
}
|
43
|
+
|
44
|
+
if (NodeType.isText(node)) {
|
45
|
+
var rng = node.ownerDocument.createRange();
|
46
|
+
|
47
|
+
rng.setStart(node, 0);
|
48
|
+
rng.setEnd(node, node.data.length);
|
49
|
+
|
50
|
+
return toArrayWithNode(rng.getClientRects());
|
51
|
+
}
|
52
|
+
}
|
53
|
+
|
54
|
+
return {
|
55
|
+
/**
|
56
|
+
* Returns the client rects for a specific node.
|
57
|
+
*
|
58
|
+
* @method getClientRects
|
59
|
+
* @param {Array/DOMNode} node Node or array of nodes to get client rects on.
|
60
|
+
* @param {Array} Array of client rects with a extra node property.
|
61
|
+
*/
|
62
|
+
getClientRects: getClientRects
|
63
|
+
};
|
64
|
+
});
|
@@ -0,0 +1,1578 @@
|
|
1
|
+
/**
|
2
|
+
* DomQuery.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 mimics most of the jQuery API:
|
13
|
+
*
|
14
|
+
* This is whats currently implemented:
|
15
|
+
* - Utility functions
|
16
|
+
* - DOM traversial
|
17
|
+
* - DOM manipulation
|
18
|
+
* - Event binding
|
19
|
+
*
|
20
|
+
* This is not currently implemented:
|
21
|
+
* - Dimension
|
22
|
+
* - Ajax
|
23
|
+
* - Animation
|
24
|
+
* - Advanced chaining
|
25
|
+
*
|
26
|
+
* @example
|
27
|
+
* var $ = tinymce.dom.DomQuery;
|
28
|
+
* $('p').attr('attr', 'value').addClass('class');
|
29
|
+
*
|
30
|
+
* @class tinymce.dom.DomQuery
|
31
|
+
*/
|
32
|
+
define("tinymce/dom/DomQuery", [
|
33
|
+
"tinymce/dom/EventUtils",
|
34
|
+
"tinymce/dom/Sizzle",
|
35
|
+
"tinymce/util/Tools",
|
36
|
+
"tinymce/Env"
|
37
|
+
], function(EventUtils, Sizzle, Tools, Env) {
|
38
|
+
var doc = document, push = Array.prototype.push, slice = Array.prototype.slice;
|
39
|
+
var rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/;
|
40
|
+
var Event = EventUtils.Event, undef;
|
41
|
+
var skipUniques = Tools.makeMap('children,contents,next,prev');
|
42
|
+
|
43
|
+
function isDefined(obj) {
|
44
|
+
return typeof obj !== 'undefined';
|
45
|
+
}
|
46
|
+
|
47
|
+
function isString(obj) {
|
48
|
+
return typeof obj === 'string';
|
49
|
+
}
|
50
|
+
|
51
|
+
function isWindow(obj) {
|
52
|
+
return obj && obj == obj.window;
|
53
|
+
}
|
54
|
+
|
55
|
+
function createFragment(html, fragDoc) {
|
56
|
+
var frag, node, container;
|
57
|
+
|
58
|
+
fragDoc = fragDoc || doc;
|
59
|
+
container = fragDoc.createElement('div');
|
60
|
+
frag = fragDoc.createDocumentFragment();
|
61
|
+
container.innerHTML = html;
|
62
|
+
|
63
|
+
while ((node = container.firstChild)) {
|
64
|
+
frag.appendChild(node);
|
65
|
+
}
|
66
|
+
|
67
|
+
return frag;
|
68
|
+
}
|
69
|
+
|
70
|
+
function domManipulate(targetNodes, sourceItem, callback, reverse) {
|
71
|
+
var i;
|
72
|
+
|
73
|
+
if (isString(sourceItem)) {
|
74
|
+
sourceItem = createFragment(sourceItem, getElementDocument(targetNodes[0]));
|
75
|
+
} else if (sourceItem.length && !sourceItem.nodeType) {
|
76
|
+
sourceItem = DomQuery.makeArray(sourceItem);
|
77
|
+
|
78
|
+
if (reverse) {
|
79
|
+
for (i = sourceItem.length - 1; i >= 0; i--) {
|
80
|
+
domManipulate(targetNodes, sourceItem[i], callback, reverse);
|
81
|
+
}
|
82
|
+
} else {
|
83
|
+
for (i = 0; i < sourceItem.length; i++) {
|
84
|
+
domManipulate(targetNodes, sourceItem[i], callback, reverse);
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
return targetNodes;
|
89
|
+
}
|
90
|
+
|
91
|
+
if (sourceItem.nodeType) {
|
92
|
+
i = targetNodes.length;
|
93
|
+
while (i--) {
|
94
|
+
callback.call(targetNodes[i], sourceItem);
|
95
|
+
}
|
96
|
+
}
|
97
|
+
|
98
|
+
return targetNodes;
|
99
|
+
}
|
100
|
+
|
101
|
+
function hasClass(node, className) {
|
102
|
+
return node && className && (' ' + node.className + ' ').indexOf(' ' + className + ' ') !== -1;
|
103
|
+
}
|
104
|
+
|
105
|
+
function wrap(elements, wrapper, all) {
|
106
|
+
var lastParent, newWrapper;
|
107
|
+
|
108
|
+
wrapper = DomQuery(wrapper)[0];
|
109
|
+
|
110
|
+
elements.each(function() {
|
111
|
+
var self = this;
|
112
|
+
|
113
|
+
if (!all || lastParent != self.parentNode) {
|
114
|
+
lastParent = self.parentNode;
|
115
|
+
newWrapper = wrapper.cloneNode(false);
|
116
|
+
self.parentNode.insertBefore(newWrapper, self);
|
117
|
+
newWrapper.appendChild(self);
|
118
|
+
} else {
|
119
|
+
newWrapper.appendChild(self);
|
120
|
+
}
|
121
|
+
});
|
122
|
+
|
123
|
+
return elements;
|
124
|
+
}
|
125
|
+
|
126
|
+
var numericCssMap = Tools.makeMap('fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom', ' ');
|
127
|
+
var booleanMap = Tools.makeMap('checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected', ' ');
|
128
|
+
var propFix = {
|
129
|
+
'for': 'htmlFor',
|
130
|
+
'class': 'className',
|
131
|
+
'readonly': 'readOnly'
|
132
|
+
};
|
133
|
+
var cssFix = {
|
134
|
+
'float': 'cssFloat'
|
135
|
+
};
|
136
|
+
|
137
|
+
var attrHooks = {}, cssHooks = {};
|
138
|
+
|
139
|
+
function DomQuery(selector, context) {
|
140
|
+
/*eslint new-cap:0 */
|
141
|
+
return new DomQuery.fn.init(selector, context);
|
142
|
+
}
|
143
|
+
|
144
|
+
function inArray(item, array) {
|
145
|
+
var i;
|
146
|
+
|
147
|
+
if (array.indexOf) {
|
148
|
+
return array.indexOf(item);
|
149
|
+
}
|
150
|
+
|
151
|
+
i = array.length;
|
152
|
+
while (i--) {
|
153
|
+
if (array[i] === item) {
|
154
|
+
return i;
|
155
|
+
}
|
156
|
+
}
|
157
|
+
|
158
|
+
return -1;
|
159
|
+
}
|
160
|
+
|
161
|
+
var whiteSpaceRegExp = /^\s*|\s*$/g;
|
162
|
+
|
163
|
+
function trim(str) {
|
164
|
+
return (str === null || str === undef) ? '' : ("" + str).replace(whiteSpaceRegExp, '');
|
165
|
+
}
|
166
|
+
|
167
|
+
function each(obj, callback) {
|
168
|
+
var length, key, i, undef, value;
|
169
|
+
|
170
|
+
if (obj) {
|
171
|
+
length = obj.length;
|
172
|
+
|
173
|
+
if (length === undef) {
|
174
|
+
// Loop object items
|
175
|
+
for (key in obj) {
|
176
|
+
if (obj.hasOwnProperty(key)) {
|
177
|
+
value = obj[key];
|
178
|
+
if (callback.call(value, key, value) === false) {
|
179
|
+
break;
|
180
|
+
}
|
181
|
+
}
|
182
|
+
}
|
183
|
+
} else {
|
184
|
+
// Loop array items
|
185
|
+
for (i = 0; i < length; i++) {
|
186
|
+
value = obj[i];
|
187
|
+
if (callback.call(value, i, value) === false) {
|
188
|
+
break;
|
189
|
+
}
|
190
|
+
}
|
191
|
+
}
|
192
|
+
}
|
193
|
+
|
194
|
+
return obj;
|
195
|
+
}
|
196
|
+
|
197
|
+
function grep(array, callback) {
|
198
|
+
var out = [];
|
199
|
+
|
200
|
+
each(array, function(i, item) {
|
201
|
+
if (callback(item, i)) {
|
202
|
+
out.push(item);
|
203
|
+
}
|
204
|
+
});
|
205
|
+
|
206
|
+
return out;
|
207
|
+
}
|
208
|
+
|
209
|
+
function getElementDocument(element) {
|
210
|
+
if (!element) {
|
211
|
+
return doc;
|
212
|
+
}
|
213
|
+
|
214
|
+
if (element.nodeType == 9) {
|
215
|
+
return element;
|
216
|
+
}
|
217
|
+
|
218
|
+
return element.ownerDocument;
|
219
|
+
}
|
220
|
+
|
221
|
+
DomQuery.fn = DomQuery.prototype = {
|
222
|
+
constructor: DomQuery,
|
223
|
+
|
224
|
+
/**
|
225
|
+
* Selector for the current set.
|
226
|
+
*
|
227
|
+
* @property selector
|
228
|
+
* @type String
|
229
|
+
*/
|
230
|
+
selector: "",
|
231
|
+
|
232
|
+
/**
|
233
|
+
* Context used to create the set.
|
234
|
+
*
|
235
|
+
* @property context
|
236
|
+
* @type Element
|
237
|
+
*/
|
238
|
+
context: null,
|
239
|
+
|
240
|
+
/**
|
241
|
+
* Number of items in the current set.
|
242
|
+
*
|
243
|
+
* @property length
|
244
|
+
* @type Number
|
245
|
+
*/
|
246
|
+
length: 0,
|
247
|
+
|
248
|
+
/**
|
249
|
+
* Constructs a new DomQuery instance with the specified selector or context.
|
250
|
+
*
|
251
|
+
* @constructor
|
252
|
+
* @method init
|
253
|
+
* @param {String/Array/DomQuery} selector Optional CSS selector/Array or array like object or HTML string.
|
254
|
+
* @param {Document/Element} context Optional context to search in.
|
255
|
+
*/
|
256
|
+
init: function(selector, context) {
|
257
|
+
var self = this, match, node;
|
258
|
+
|
259
|
+
if (!selector) {
|
260
|
+
return self;
|
261
|
+
}
|
262
|
+
|
263
|
+
if (selector.nodeType) {
|
264
|
+
self.context = self[0] = selector;
|
265
|
+
self.length = 1;
|
266
|
+
|
267
|
+
return self;
|
268
|
+
}
|
269
|
+
|
270
|
+
if (context && context.nodeType) {
|
271
|
+
self.context = context;
|
272
|
+
} else {
|
273
|
+
if (context) {
|
274
|
+
return DomQuery(selector).attr(context);
|
275
|
+
}
|
276
|
+
|
277
|
+
self.context = context = document;
|
278
|
+
}
|
279
|
+
|
280
|
+
if (isString(selector)) {
|
281
|
+
self.selector = selector;
|
282
|
+
|
283
|
+
if (selector.charAt(0) === "<" && selector.charAt(selector.length - 1) === ">" && selector.length >= 3) {
|
284
|
+
match = [null, selector, null];
|
285
|
+
} else {
|
286
|
+
match = rquickExpr.exec(selector);
|
287
|
+
}
|
288
|
+
|
289
|
+
if (match) {
|
290
|
+
if (match[1]) {
|
291
|
+
node = createFragment(selector, getElementDocument(context)).firstChild;
|
292
|
+
|
293
|
+
while (node) {
|
294
|
+
push.call(self, node);
|
295
|
+
node = node.nextSibling;
|
296
|
+
}
|
297
|
+
} else {
|
298
|
+
node = getElementDocument(context).getElementById(match[2]);
|
299
|
+
|
300
|
+
if (!node) {
|
301
|
+
return self;
|
302
|
+
}
|
303
|
+
|
304
|
+
if (node.id !== match[2]) {
|
305
|
+
return self.find(selector);
|
306
|
+
}
|
307
|
+
|
308
|
+
self.length = 1;
|
309
|
+
self[0] = node;
|
310
|
+
}
|
311
|
+
} else {
|
312
|
+
return DomQuery(context).find(selector);
|
313
|
+
}
|
314
|
+
} else {
|
315
|
+
this.add(selector, false);
|
316
|
+
}
|
317
|
+
|
318
|
+
return self;
|
319
|
+
},
|
320
|
+
|
321
|
+
/**
|
322
|
+
* Converts the current set to an array.
|
323
|
+
*
|
324
|
+
* @method toArray
|
325
|
+
* @return {Array} Array of all nodes in set.
|
326
|
+
*/
|
327
|
+
toArray: function() {
|
328
|
+
return Tools.toArray(this);
|
329
|
+
},
|
330
|
+
|
331
|
+
/**
|
332
|
+
* Adds new nodes to the set.
|
333
|
+
*
|
334
|
+
* @method add
|
335
|
+
* @param {Array/tinymce.dom.DomQuery} items Array of all nodes to add to set.
|
336
|
+
* @param {Boolean} sort Optional sort flag that enables sorting of elements.
|
337
|
+
* @return {tinymce.dom.DomQuery} New instance with nodes added.
|
338
|
+
*/
|
339
|
+
add: function(items, sort) {
|
340
|
+
var self = this, nodes, i;
|
341
|
+
|
342
|
+
if (isString(items)) {
|
343
|
+
return self.add(DomQuery(items));
|
344
|
+
}
|
345
|
+
|
346
|
+
if (sort !== false) {
|
347
|
+
nodes = DomQuery.unique(self.toArray().concat(DomQuery.makeArray(items)));
|
348
|
+
self.length = nodes.length;
|
349
|
+
for (i = 0; i < nodes.length; i++) {
|
350
|
+
self[i] = nodes[i];
|
351
|
+
}
|
352
|
+
} else {
|
353
|
+
push.apply(self, DomQuery.makeArray(items));
|
354
|
+
}
|
355
|
+
|
356
|
+
return self;
|
357
|
+
},
|
358
|
+
|
359
|
+
/**
|
360
|
+
* Sets/gets attributes on the elements in the current set.
|
361
|
+
*
|
362
|
+
* @method attr
|
363
|
+
* @param {String/Object} name Name of attribute to get or an object with attributes to set.
|
364
|
+
* @param {String} value Optional value to set.
|
365
|
+
* @return {tinymce.dom.DomQuery/String} Current set or the specified attribute when only the name is specified.
|
366
|
+
*/
|
367
|
+
attr: function(name, value) {
|
368
|
+
var self = this, hook;
|
369
|
+
|
370
|
+
if (typeof name === "object") {
|
371
|
+
each(name, function(name, value) {
|
372
|
+
self.attr(name, value);
|
373
|
+
});
|
374
|
+
} else if (isDefined(value)) {
|
375
|
+
this.each(function() {
|
376
|
+
var hook;
|
377
|
+
|
378
|
+
if (this.nodeType === 1) {
|
379
|
+
hook = attrHooks[name];
|
380
|
+
if (hook && hook.set) {
|
381
|
+
hook.set(this, value);
|
382
|
+
return;
|
383
|
+
}
|
384
|
+
|
385
|
+
if (value === null) {
|
386
|
+
this.removeAttribute(name, 2);
|
387
|
+
} else {
|
388
|
+
this.setAttribute(name, value, 2);
|
389
|
+
}
|
390
|
+
}
|
391
|
+
});
|
392
|
+
} else {
|
393
|
+
if (self[0] && self[0].nodeType === 1) {
|
394
|
+
hook = attrHooks[name];
|
395
|
+
if (hook && hook.get) {
|
396
|
+
return hook.get(self[0], name);
|
397
|
+
}
|
398
|
+
|
399
|
+
if (booleanMap[name]) {
|
400
|
+
return self.prop(name) ? name : undef;
|
401
|
+
}
|
402
|
+
|
403
|
+
value = self[0].getAttribute(name, 2);
|
404
|
+
|
405
|
+
if (value === null) {
|
406
|
+
value = undef;
|
407
|
+
}
|
408
|
+
}
|
409
|
+
|
410
|
+
return value;
|
411
|
+
}
|
412
|
+
|
413
|
+
return self;
|
414
|
+
},
|
415
|
+
|
416
|
+
/**
|
417
|
+
* Removes attributse on the elements in the current set.
|
418
|
+
*
|
419
|
+
* @method removeAttr
|
420
|
+
* @param {String/Object} name Name of attribute to remove.
|
421
|
+
* @return {tinymce.dom.DomQuery/String} Current set.
|
422
|
+
*/
|
423
|
+
removeAttr: function(name) {
|
424
|
+
return this.attr(name, null);
|
425
|
+
},
|
426
|
+
|
427
|
+
/**
|
428
|
+
* Sets/gets properties on the elements in the current set.
|
429
|
+
*
|
430
|
+
* @method attr
|
431
|
+
* @param {String/Object} name Name of property to get or an object with properties to set.
|
432
|
+
* @param {String} value Optional value to set.
|
433
|
+
* @return {tinymce.dom.DomQuery/String} Current set or the specified property when only the name is specified.
|
434
|
+
*/
|
435
|
+
prop: function(name, value) {
|
436
|
+
var self = this;
|
437
|
+
|
438
|
+
name = propFix[name] || name;
|
439
|
+
|
440
|
+
if (typeof name === "object") {
|
441
|
+
each(name, function(name, value) {
|
442
|
+
self.prop(name, value);
|
443
|
+
});
|
444
|
+
} else if (isDefined(value)) {
|
445
|
+
this.each(function() {
|
446
|
+
if (this.nodeType == 1) {
|
447
|
+
this[name] = value;
|
448
|
+
}
|
449
|
+
});
|
450
|
+
} else {
|
451
|
+
if (self[0] && self[0].nodeType && name in self[0]) {
|
452
|
+
return self[0][name];
|
453
|
+
}
|
454
|
+
|
455
|
+
return value;
|
456
|
+
}
|
457
|
+
|
458
|
+
return self;
|
459
|
+
},
|
460
|
+
|
461
|
+
/**
|
462
|
+
* Sets/gets styles on the elements in the current set.
|
463
|
+
*
|
464
|
+
* @method css
|
465
|
+
* @param {String/Object} name Name of style to get or an object with styles to set.
|
466
|
+
* @param {String} value Optional value to set.
|
467
|
+
* @return {tinymce.dom.DomQuery/String} Current set or the specified style when only the name is specified.
|
468
|
+
*/
|
469
|
+
css: function(name, value) {
|
470
|
+
var self = this, elm, hook;
|
471
|
+
|
472
|
+
function camel(name) {
|
473
|
+
return name.replace(/-(\D)/g, function(a, b) {
|
474
|
+
return b.toUpperCase();
|
475
|
+
});
|
476
|
+
}
|
477
|
+
|
478
|
+
function dashed(name) {
|
479
|
+
return name.replace(/[A-Z]/g, function(a) {
|
480
|
+
return '-' + a;
|
481
|
+
});
|
482
|
+
}
|
483
|
+
|
484
|
+
if (typeof name === "object") {
|
485
|
+
each(name, function(name, value) {
|
486
|
+
self.css(name, value);
|
487
|
+
});
|
488
|
+
} else {
|
489
|
+
if (isDefined(value)) {
|
490
|
+
name = camel(name);
|
491
|
+
|
492
|
+
// Default px suffix on these
|
493
|
+
if (typeof value === 'number' && !numericCssMap[name]) {
|
494
|
+
value += 'px';
|
495
|
+
}
|
496
|
+
|
497
|
+
self.each(function() {
|
498
|
+
var style = this.style;
|
499
|
+
|
500
|
+
hook = cssHooks[name];
|
501
|
+
if (hook && hook.set) {
|
502
|
+
hook.set(this, value);
|
503
|
+
return;
|
504
|
+
}
|
505
|
+
|
506
|
+
try {
|
507
|
+
this.style[cssFix[name] || name] = value;
|
508
|
+
} catch (ex) {
|
509
|
+
// Ignore
|
510
|
+
}
|
511
|
+
|
512
|
+
if (value === null || value === '') {
|
513
|
+
if (style.removeProperty) {
|
514
|
+
style.removeProperty(dashed(name));
|
515
|
+
} else {
|
516
|
+
style.removeAttribute(name);
|
517
|
+
}
|
518
|
+
}
|
519
|
+
});
|
520
|
+
} else {
|
521
|
+
elm = self[0];
|
522
|
+
|
523
|
+
hook = cssHooks[name];
|
524
|
+
if (hook && hook.get) {
|
525
|
+
return hook.get(elm);
|
526
|
+
}
|
527
|
+
|
528
|
+
if (elm.ownerDocument.defaultView) {
|
529
|
+
try {
|
530
|
+
return elm.ownerDocument.defaultView.getComputedStyle(elm, null).getPropertyValue(dashed(name));
|
531
|
+
} catch (ex) {
|
532
|
+
return undef;
|
533
|
+
}
|
534
|
+
} else if (elm.currentStyle) {
|
535
|
+
return elm.currentStyle[camel(name)];
|
536
|
+
}
|
537
|
+
}
|
538
|
+
}
|
539
|
+
|
540
|
+
return self;
|
541
|
+
},
|
542
|
+
|
543
|
+
/**
|
544
|
+
* Removes all nodes in set from the document.
|
545
|
+
*
|
546
|
+
* @method remove
|
547
|
+
* @return {tinymce.dom.DomQuery} Current set with the removed nodes.
|
548
|
+
*/
|
549
|
+
remove: function() {
|
550
|
+
var self = this, node, i = this.length;
|
551
|
+
|
552
|
+
while (i--) {
|
553
|
+
node = self[i];
|
554
|
+
Event.clean(node);
|
555
|
+
|
556
|
+
if (node.parentNode) {
|
557
|
+
node.parentNode.removeChild(node);
|
558
|
+
}
|
559
|
+
}
|
560
|
+
|
561
|
+
return this;
|
562
|
+
},
|
563
|
+
|
564
|
+
/**
|
565
|
+
* Empties all elements in set.
|
566
|
+
*
|
567
|
+
* @method empty
|
568
|
+
* @return {tinymce.dom.DomQuery} Current set with the empty nodes.
|
569
|
+
*/
|
570
|
+
empty: function() {
|
571
|
+
var self = this, node, i = this.length;
|
572
|
+
|
573
|
+
while (i--) {
|
574
|
+
node = self[i];
|
575
|
+
while (node.firstChild) {
|
576
|
+
node.removeChild(node.firstChild);
|
577
|
+
}
|
578
|
+
}
|
579
|
+
|
580
|
+
return this;
|
581
|
+
},
|
582
|
+
|
583
|
+
/**
|
584
|
+
* Sets or gets the HTML of the current set or first set node.
|
585
|
+
*
|
586
|
+
* @method html
|
587
|
+
* @param {String} value Optional innerHTML value to set on each element.
|
588
|
+
* @return {tinymce.dom.DomQuery/String} Current set or the innerHTML of the first element.
|
589
|
+
*/
|
590
|
+
html: function(value) {
|
591
|
+
var self = this, i;
|
592
|
+
|
593
|
+
if (isDefined(value)) {
|
594
|
+
i = self.length;
|
595
|
+
|
596
|
+
try {
|
597
|
+
while (i--) {
|
598
|
+
self[i].innerHTML = value;
|
599
|
+
}
|
600
|
+
} catch (ex) {
|
601
|
+
// Workaround for "Unknown runtime error" when DIV is added to P on IE
|
602
|
+
DomQuery(self[i]).empty().append(value);
|
603
|
+
}
|
604
|
+
|
605
|
+
return self;
|
606
|
+
}
|
607
|
+
|
608
|
+
return self[0] ? self[0].innerHTML : '';
|
609
|
+
},
|
610
|
+
|
611
|
+
/**
|
612
|
+
* Sets or gets the text of the current set or first set node.
|
613
|
+
*
|
614
|
+
* @method text
|
615
|
+
* @param {String} value Optional innerText value to set on each element.
|
616
|
+
* @return {tinymce.dom.DomQuery/String} Current set or the innerText of the first element.
|
617
|
+
*/
|
618
|
+
text: function(value) {
|
619
|
+
var self = this, i;
|
620
|
+
|
621
|
+
if (isDefined(value)) {
|
622
|
+
i = self.length;
|
623
|
+
while (i--) {
|
624
|
+
if ("innerText" in self[i]) {
|
625
|
+
self[i].innerText = value;
|
626
|
+
} else {
|
627
|
+
self[0].textContent = value;
|
628
|
+
}
|
629
|
+
}
|
630
|
+
|
631
|
+
return self;
|
632
|
+
}
|
633
|
+
|
634
|
+
return self[0] ? (self[0].innerText || self[0].textContent) : '';
|
635
|
+
},
|
636
|
+
|
637
|
+
/**
|
638
|
+
* Appends the specified node/html or node set to the current set nodes.
|
639
|
+
*
|
640
|
+
* @method append
|
641
|
+
* @param {String/Element/Array/tinymce.dom.DomQuery} content Content to append to each element in set.
|
642
|
+
* @return {tinymce.dom.DomQuery} Current set.
|
643
|
+
*/
|
644
|
+
append: function() {
|
645
|
+
return domManipulate(this, arguments, function(node) {
|
646
|
+
// Either element or Shadow Root
|
647
|
+
if (this.nodeType === 1 || (this.host && this.host.nodeType === 1)) {
|
648
|
+
this.appendChild(node);
|
649
|
+
}
|
650
|
+
});
|
651
|
+
},
|
652
|
+
|
653
|
+
/**
|
654
|
+
* Prepends the specified node/html or node set to the current set nodes.
|
655
|
+
*
|
656
|
+
* @method prepend
|
657
|
+
* @param {String/Element/Array/tinymce.dom.DomQuery} content Content to prepend to each element in set.
|
658
|
+
* @return {tinymce.dom.DomQuery} Current set.
|
659
|
+
*/
|
660
|
+
prepend: function() {
|
661
|
+
return domManipulate(this, arguments, function(node) {
|
662
|
+
// Either element or Shadow Root
|
663
|
+
if (this.nodeType === 1 || (this.host && this.host.nodeType === 1)) {
|
664
|
+
this.insertBefore(node, this.firstChild);
|
665
|
+
}
|
666
|
+
}, true);
|
667
|
+
},
|
668
|
+
|
669
|
+
/**
|
670
|
+
* Adds the specified elements before current set nodes.
|
671
|
+
*
|
672
|
+
* @method before
|
673
|
+
* @param {String/Element/Array/tinymce.dom.DomQuery} content Content to add before to each element in set.
|
674
|
+
* @return {tinymce.dom.DomQuery} Current set.
|
675
|
+
*/
|
676
|
+
before: function() {
|
677
|
+
var self = this;
|
678
|
+
|
679
|
+
if (self[0] && self[0].parentNode) {
|
680
|
+
return domManipulate(self, arguments, function(node) {
|
681
|
+
this.parentNode.insertBefore(node, this);
|
682
|
+
});
|
683
|
+
}
|
684
|
+
|
685
|
+
return self;
|
686
|
+
},
|
687
|
+
|
688
|
+
/**
|
689
|
+
* Adds the specified elements after current set nodes.
|
690
|
+
*
|
691
|
+
* @method after
|
692
|
+
* @param {String/Element/Array/tinymce.dom.DomQuery} content Content to add after to each element in set.
|
693
|
+
* @return {tinymce.dom.DomQuery} Current set.
|
694
|
+
*/
|
695
|
+
after: function() {
|
696
|
+
var self = this;
|
697
|
+
|
698
|
+
if (self[0] && self[0].parentNode) {
|
699
|
+
return domManipulate(self, arguments, function(node) {
|
700
|
+
this.parentNode.insertBefore(node, this.nextSibling);
|
701
|
+
}, true);
|
702
|
+
}
|
703
|
+
|
704
|
+
return self;
|
705
|
+
},
|
706
|
+
|
707
|
+
/**
|
708
|
+
* Appends the specified set nodes to the specified selector/instance.
|
709
|
+
*
|
710
|
+
* @method appendTo
|
711
|
+
* @param {String/Element/Array/tinymce.dom.DomQuery} val Item to append the current set to.
|
712
|
+
* @return {tinymce.dom.DomQuery} Current set with the appended nodes.
|
713
|
+
*/
|
714
|
+
appendTo: function(val) {
|
715
|
+
DomQuery(val).append(this);
|
716
|
+
|
717
|
+
return this;
|
718
|
+
},
|
719
|
+
|
720
|
+
/**
|
721
|
+
* Prepends the specified set nodes to the specified selector/instance.
|
722
|
+
*
|
723
|
+
* @method prependTo
|
724
|
+
* @param {String/Element/Array/tinymce.dom.DomQuery} val Item to prepend the current set to.
|
725
|
+
* @return {tinymce.dom.DomQuery} Current set with the prepended nodes.
|
726
|
+
*/
|
727
|
+
prependTo: function(val) {
|
728
|
+
DomQuery(val).prepend(this);
|
729
|
+
|
730
|
+
return this;
|
731
|
+
},
|
732
|
+
|
733
|
+
/**
|
734
|
+
* Replaces the nodes in set with the specified content.
|
735
|
+
*
|
736
|
+
* @method replaceWith
|
737
|
+
* @param {String/Element/Array/tinymce.dom.DomQuery} content Content to replace nodes with.
|
738
|
+
* @return {tinymce.dom.DomQuery} Set with replaced nodes.
|
739
|
+
*/
|
740
|
+
replaceWith: function(content) {
|
741
|
+
return this.before(content).remove();
|
742
|
+
},
|
743
|
+
|
744
|
+
/**
|
745
|
+
* Wraps all elements in set with the specified wrapper.
|
746
|
+
*
|
747
|
+
* @method wrap
|
748
|
+
* @param {String/Element/Array/tinymce.dom.DomQuery} content Content to wrap nodes with.
|
749
|
+
* @return {tinymce.dom.DomQuery} Set with wrapped nodes.
|
750
|
+
*/
|
751
|
+
wrap: function(content) {
|
752
|
+
return wrap(this, content);
|
753
|
+
},
|
754
|
+
|
755
|
+
/**
|
756
|
+
* Wraps all nodes in set with the specified wrapper. If the nodes are siblings all of them
|
757
|
+
* will be wrapped in the same wrapper.
|
758
|
+
*
|
759
|
+
* @method wrapAll
|
760
|
+
* @param {String/Element/Array/tinymce.dom.DomQuery} content Content to wrap nodes with.
|
761
|
+
* @return {tinymce.dom.DomQuery} Set with wrapped nodes.
|
762
|
+
*/
|
763
|
+
wrapAll: function(content) {
|
764
|
+
return wrap(this, content, true);
|
765
|
+
},
|
766
|
+
|
767
|
+
/**
|
768
|
+
* Wraps all elements inner contents in set with the specified wrapper.
|
769
|
+
*
|
770
|
+
* @method wrapInner
|
771
|
+
* @param {String/Element/Array/tinymce.dom.DomQuery} content Content to wrap nodes with.
|
772
|
+
* @return {tinymce.dom.DomQuery} Set with wrapped nodes.
|
773
|
+
*/
|
774
|
+
wrapInner: function(content) {
|
775
|
+
this.each(function() {
|
776
|
+
DomQuery(this).contents().wrapAll(content);
|
777
|
+
});
|
778
|
+
|
779
|
+
return this;
|
780
|
+
},
|
781
|
+
|
782
|
+
/**
|
783
|
+
* Unwraps all elements by removing the parent element of each item in set.
|
784
|
+
*
|
785
|
+
* @method unwrap
|
786
|
+
* @return {tinymce.dom.DomQuery} Set with unwrapped nodes.
|
787
|
+
*/
|
788
|
+
unwrap: function() {
|
789
|
+
return this.parent().each(function() {
|
790
|
+
DomQuery(this).replaceWith(this.childNodes);
|
791
|
+
});
|
792
|
+
},
|
793
|
+
|
794
|
+
/**
|
795
|
+
* Clones all nodes in set.
|
796
|
+
*
|
797
|
+
* @method clone
|
798
|
+
* @return {tinymce.dom.DomQuery} Set with cloned nodes.
|
799
|
+
*/
|
800
|
+
clone: function() {
|
801
|
+
var result = [];
|
802
|
+
|
803
|
+
this.each(function() {
|
804
|
+
result.push(this.cloneNode(true));
|
805
|
+
});
|
806
|
+
|
807
|
+
return DomQuery(result);
|
808
|
+
},
|
809
|
+
|
810
|
+
/**
|
811
|
+
* Adds the specified class name to the current set elements.
|
812
|
+
*
|
813
|
+
* @method addClass
|
814
|
+
* @param {String} className Class name to add.
|
815
|
+
* @return {tinymce.dom.DomQuery} Current set.
|
816
|
+
*/
|
817
|
+
addClass: function(className) {
|
818
|
+
return this.toggleClass(className, true);
|
819
|
+
},
|
820
|
+
|
821
|
+
/**
|
822
|
+
* Removes the specified class name to the current set elements.
|
823
|
+
*
|
824
|
+
* @method removeClass
|
825
|
+
* @param {String} className Class name to remove.
|
826
|
+
* @return {tinymce.dom.DomQuery} Current set.
|
827
|
+
*/
|
828
|
+
removeClass: function(className) {
|
829
|
+
return this.toggleClass(className, false);
|
830
|
+
},
|
831
|
+
|
832
|
+
/**
|
833
|
+
* Toggles the specified class name on the current set elements.
|
834
|
+
*
|
835
|
+
* @method toggleClass
|
836
|
+
* @param {String} className Class name to add/remove.
|
837
|
+
* @param {Boolean} state Optional state to toggle on/off.
|
838
|
+
* @return {tinymce.dom.DomQuery} Current set.
|
839
|
+
*/
|
840
|
+
toggleClass: function(className, state) {
|
841
|
+
var self = this;
|
842
|
+
|
843
|
+
// Functions are not supported
|
844
|
+
if (typeof className != 'string') {
|
845
|
+
return self;
|
846
|
+
}
|
847
|
+
|
848
|
+
if (className.indexOf(' ') !== -1) {
|
849
|
+
each(className.split(' '), function() {
|
850
|
+
self.toggleClass(this, state);
|
851
|
+
});
|
852
|
+
} else {
|
853
|
+
self.each(function(index, node) {
|
854
|
+
var existingClassName, classState;
|
855
|
+
|
856
|
+
classState = hasClass(node, className);
|
857
|
+
if (classState !== state) {
|
858
|
+
existingClassName = node.className;
|
859
|
+
|
860
|
+
if (classState) {
|
861
|
+
node.className = trim((" " + existingClassName + " ").replace(' ' + className + ' ', ' '));
|
862
|
+
} else {
|
863
|
+
node.className += existingClassName ? ' ' + className : className;
|
864
|
+
}
|
865
|
+
}
|
866
|
+
});
|
867
|
+
}
|
868
|
+
|
869
|
+
return self;
|
870
|
+
},
|
871
|
+
|
872
|
+
/**
|
873
|
+
* Returns true/false if the first item in set has the specified class.
|
874
|
+
*
|
875
|
+
* @method hasClass
|
876
|
+
* @param {String} className Class name to check for.
|
877
|
+
* @return {Boolean} True/false if the set has the specified class.
|
878
|
+
*/
|
879
|
+
hasClass: function(className) {
|
880
|
+
return hasClass(this[0], className);
|
881
|
+
},
|
882
|
+
|
883
|
+
/**
|
884
|
+
* Executes the callback function for each item DomQuery collection. If you return false in the
|
885
|
+
* callback it will break the loop.
|
886
|
+
*
|
887
|
+
* @method each
|
888
|
+
* @param {function} callback Callback function to execute for each item.
|
889
|
+
* @return {tinymce.dom.DomQuery} Current set.
|
890
|
+
*/
|
891
|
+
each: function(callback) {
|
892
|
+
return each(this, callback);
|
893
|
+
},
|
894
|
+
|
895
|
+
/**
|
896
|
+
* Binds an event with callback function to the elements in set.
|
897
|
+
*
|
898
|
+
* @method on
|
899
|
+
* @param {String} name Name of the event to bind.
|
900
|
+
* @param {function} callback Callback function to execute when the event occurs.
|
901
|
+
* @return {tinymce.dom.DomQuery} Current set.
|
902
|
+
*/
|
903
|
+
on: function(name, callback) {
|
904
|
+
return this.each(function() {
|
905
|
+
Event.bind(this, name, callback);
|
906
|
+
});
|
907
|
+
},
|
908
|
+
|
909
|
+
/**
|
910
|
+
* Unbinds an event with callback function to the elements in set.
|
911
|
+
*
|
912
|
+
* @method off
|
913
|
+
* @param {String} name Optional name of the event to bind.
|
914
|
+
* @param {function} callback Optional callback function to execute when the event occurs.
|
915
|
+
* @return {tinymce.dom.DomQuery} Current set.
|
916
|
+
*/
|
917
|
+
off: function(name, callback) {
|
918
|
+
return this.each(function() {
|
919
|
+
Event.unbind(this, name, callback);
|
920
|
+
});
|
921
|
+
},
|
922
|
+
|
923
|
+
/**
|
924
|
+
* Triggers the specified event by name or event object.
|
925
|
+
*
|
926
|
+
* @method trigger
|
927
|
+
* @param {String/Object} name Name of the event to trigger or event object.
|
928
|
+
* @return {tinymce.dom.DomQuery} Current set.
|
929
|
+
*/
|
930
|
+
trigger: function(name) {
|
931
|
+
return this.each(function() {
|
932
|
+
if (typeof name == 'object') {
|
933
|
+
Event.fire(this, name.type, name);
|
934
|
+
} else {
|
935
|
+
Event.fire(this, name);
|
936
|
+
}
|
937
|
+
});
|
938
|
+
},
|
939
|
+
|
940
|
+
/**
|
941
|
+
* Shows all elements in set.
|
942
|
+
*
|
943
|
+
* @method show
|
944
|
+
* @return {tinymce.dom.DomQuery} Current set.
|
945
|
+
*/
|
946
|
+
show: function() {
|
947
|
+
return this.css('display', '');
|
948
|
+
},
|
949
|
+
|
950
|
+
/**
|
951
|
+
* Hides all elements in set.
|
952
|
+
*
|
953
|
+
* @method hide
|
954
|
+
* @return {tinymce.dom.DomQuery} Current set.
|
955
|
+
*/
|
956
|
+
hide: function() {
|
957
|
+
return this.css('display', 'none');
|
958
|
+
},
|
959
|
+
|
960
|
+
/**
|
961
|
+
* Slices the current set.
|
962
|
+
*
|
963
|
+
* @method slice
|
964
|
+
* @param {Number} start Start index to slice at.
|
965
|
+
* @param {Number} end Optional end index to end slice at.
|
966
|
+
* @return {tinymce.dom.DomQuery} Sliced set.
|
967
|
+
*/
|
968
|
+
slice: function() {
|
969
|
+
return new DomQuery(slice.apply(this, arguments));
|
970
|
+
},
|
971
|
+
|
972
|
+
/**
|
973
|
+
* Makes the set equal to the specified index.
|
974
|
+
*
|
975
|
+
* @method eq
|
976
|
+
* @param {Number} index Index to set it equal to.
|
977
|
+
* @return {tinymce.dom.DomQuery} Single item set.
|
978
|
+
*/
|
979
|
+
eq: function(index) {
|
980
|
+
return index === -1 ? this.slice(index) : this.slice(index, +index + 1);
|
981
|
+
},
|
982
|
+
|
983
|
+
/**
|
984
|
+
* Makes the set equal to first element in set.
|
985
|
+
*
|
986
|
+
* @method first
|
987
|
+
* @return {tinymce.dom.DomQuery} Single item set.
|
988
|
+
*/
|
989
|
+
first: function() {
|
990
|
+
return this.eq(0);
|
991
|
+
},
|
992
|
+
|
993
|
+
/**
|
994
|
+
* Makes the set equal to last element in set.
|
995
|
+
*
|
996
|
+
* @method last
|
997
|
+
* @return {tinymce.dom.DomQuery} Single item set.
|
998
|
+
*/
|
999
|
+
last: function() {
|
1000
|
+
return this.eq(-1);
|
1001
|
+
},
|
1002
|
+
|
1003
|
+
/**
|
1004
|
+
* Finds elements by the specified selector for each element in set.
|
1005
|
+
*
|
1006
|
+
* @method find
|
1007
|
+
* @param {String} selector Selector to find elements by.
|
1008
|
+
* @return {tinymce.dom.DomQuery} Set with matches elements.
|
1009
|
+
*/
|
1010
|
+
find: function(selector) {
|
1011
|
+
var i, l, ret = [];
|
1012
|
+
|
1013
|
+
for (i = 0, l = this.length; i < l; i++) {
|
1014
|
+
DomQuery.find(selector, this[i], ret);
|
1015
|
+
}
|
1016
|
+
|
1017
|
+
return DomQuery(ret);
|
1018
|
+
},
|
1019
|
+
|
1020
|
+
/**
|
1021
|
+
* Filters the current set with the specified selector.
|
1022
|
+
*
|
1023
|
+
* @method filter
|
1024
|
+
* @param {String/function} selector Selector to filter elements by.
|
1025
|
+
* @return {tinymce.dom.DomQuery} Set with filtered elements.
|
1026
|
+
*/
|
1027
|
+
filter: function(selector) {
|
1028
|
+
if (typeof selector == 'function') {
|
1029
|
+
return DomQuery(grep(this.toArray(), function(item, i) {
|
1030
|
+
return selector(i, item);
|
1031
|
+
}));
|
1032
|
+
}
|
1033
|
+
|
1034
|
+
return DomQuery(DomQuery.filter(selector, this.toArray()));
|
1035
|
+
},
|
1036
|
+
|
1037
|
+
/**
|
1038
|
+
* Gets the current node or any parent matching the specified selector.
|
1039
|
+
*
|
1040
|
+
* @method closest
|
1041
|
+
* @param {String/Element/tinymce.dom.DomQuery} selector Selector or element to find.
|
1042
|
+
* @return {tinymce.dom.DomQuery} Set with closest elements.
|
1043
|
+
*/
|
1044
|
+
closest: function(selector) {
|
1045
|
+
var result = [];
|
1046
|
+
|
1047
|
+
if (selector instanceof DomQuery) {
|
1048
|
+
selector = selector[0];
|
1049
|
+
}
|
1050
|
+
|
1051
|
+
this.each(function(i, node) {
|
1052
|
+
while (node) {
|
1053
|
+
if (typeof selector == 'string' && DomQuery(node).is(selector)) {
|
1054
|
+
result.push(node);
|
1055
|
+
break;
|
1056
|
+
} else if (node == selector) {
|
1057
|
+
result.push(node);
|
1058
|
+
break;
|
1059
|
+
}
|
1060
|
+
|
1061
|
+
node = node.parentNode;
|
1062
|
+
}
|
1063
|
+
});
|
1064
|
+
|
1065
|
+
return DomQuery(result);
|
1066
|
+
},
|
1067
|
+
|
1068
|
+
/**
|
1069
|
+
* Returns the offset of the first element in set or sets the top/left css properties of all elements in set.
|
1070
|
+
*
|
1071
|
+
* @method offset
|
1072
|
+
* @param {Object} offset Optional offset object to set on each item.
|
1073
|
+
* @return {Object/tinymce.dom.DomQuery} Returns the first element offset or the current set if you specified an offset.
|
1074
|
+
*/
|
1075
|
+
offset: function(offset) {
|
1076
|
+
var elm, doc, docElm;
|
1077
|
+
var x = 0, y = 0, pos;
|
1078
|
+
|
1079
|
+
if (!offset) {
|
1080
|
+
elm = this[0];
|
1081
|
+
|
1082
|
+
if (elm) {
|
1083
|
+
doc = elm.ownerDocument;
|
1084
|
+
docElm = doc.documentElement;
|
1085
|
+
|
1086
|
+
if (elm.getBoundingClientRect) {
|
1087
|
+
pos = elm.getBoundingClientRect();
|
1088
|
+
x = pos.left + (docElm.scrollLeft || doc.body.scrollLeft) - docElm.clientLeft;
|
1089
|
+
y = pos.top + (docElm.scrollTop || doc.body.scrollTop) - docElm.clientTop;
|
1090
|
+
}
|
1091
|
+
}
|
1092
|
+
|
1093
|
+
return {
|
1094
|
+
left: x,
|
1095
|
+
top: y
|
1096
|
+
};
|
1097
|
+
}
|
1098
|
+
|
1099
|
+
return this.css(offset);
|
1100
|
+
},
|
1101
|
+
|
1102
|
+
push: push,
|
1103
|
+
sort: [].sort,
|
1104
|
+
splice: [].splice
|
1105
|
+
};
|
1106
|
+
|
1107
|
+
// Static members
|
1108
|
+
Tools.extend(DomQuery, {
|
1109
|
+
/**
|
1110
|
+
* Extends the specified object with one or more objects.
|
1111
|
+
*
|
1112
|
+
* @static
|
1113
|
+
* @method extend
|
1114
|
+
* @param {Object} target Target object to extend with new items.
|
1115
|
+
* @param {Object..} object Object to extend the target with.
|
1116
|
+
* @return {Object} Extended input object.
|
1117
|
+
*/
|
1118
|
+
extend: Tools.extend,
|
1119
|
+
|
1120
|
+
/**
|
1121
|
+
* Creates an array out of an array like object.
|
1122
|
+
*
|
1123
|
+
* @static
|
1124
|
+
* @method makeArray
|
1125
|
+
* @param {Object} object Object to convert to array.
|
1126
|
+
* @return {Array} Array produced from object.
|
1127
|
+
*/
|
1128
|
+
makeArray: function(object) {
|
1129
|
+
if (isWindow(object) || object.nodeType) {
|
1130
|
+
return [object];
|
1131
|
+
}
|
1132
|
+
|
1133
|
+
return Tools.toArray(object);
|
1134
|
+
},
|
1135
|
+
|
1136
|
+
/**
|
1137
|
+
* Returns the index of the specified item inside the array.
|
1138
|
+
*
|
1139
|
+
* @static
|
1140
|
+
* @method inArray
|
1141
|
+
* @param {Object} item Item to look for.
|
1142
|
+
* @param {Array} array Array to look for item in.
|
1143
|
+
* @return {Number} Index of the item or -1.
|
1144
|
+
*/
|
1145
|
+
inArray: inArray,
|
1146
|
+
|
1147
|
+
/**
|
1148
|
+
* Returns true/false if the specified object is an array or not.
|
1149
|
+
*
|
1150
|
+
* @static
|
1151
|
+
* @method isArray
|
1152
|
+
* @param {Object} array Object to check if it's an array or not.
|
1153
|
+
* @return {Boolean} True/false if the object is an array.
|
1154
|
+
*/
|
1155
|
+
isArray: Tools.isArray,
|
1156
|
+
|
1157
|
+
/**
|
1158
|
+
* Executes the callback function for each item in array/object. If you return false in the
|
1159
|
+
* callback it will break the loop.
|
1160
|
+
*
|
1161
|
+
* @static
|
1162
|
+
* @method each
|
1163
|
+
* @param {Object} obj Object to iterate.
|
1164
|
+
* @param {function} callback Callback function to execute for each item.
|
1165
|
+
*/
|
1166
|
+
each: each,
|
1167
|
+
|
1168
|
+
/**
|
1169
|
+
* Removes whitespace from the beginning and end of a string.
|
1170
|
+
*
|
1171
|
+
* @static
|
1172
|
+
* @method trim
|
1173
|
+
* @param {String} str String to remove whitespace from.
|
1174
|
+
* @return {String} New string with removed whitespace.
|
1175
|
+
*/
|
1176
|
+
trim: trim,
|
1177
|
+
|
1178
|
+
/**
|
1179
|
+
* Filters out items from the input array by calling the specified function for each item.
|
1180
|
+
* If the function returns false the item will be excluded if it returns true it will be included.
|
1181
|
+
*
|
1182
|
+
* @static
|
1183
|
+
* @method grep
|
1184
|
+
* @param {Array} array Array of items to loop though.
|
1185
|
+
* @param {function} callback Function to call for each item. Include/exclude depends on it's return value.
|
1186
|
+
* @return {Array} New array with values imported and filtered based in input.
|
1187
|
+
* @example
|
1188
|
+
* // Filter out some items, this will return an array with 4 and 5
|
1189
|
+
* var items = DomQuery.grep([1, 2, 3, 4, 5], function(v) {return v > 3;});
|
1190
|
+
*/
|
1191
|
+
grep: grep,
|
1192
|
+
|
1193
|
+
// Sizzle
|
1194
|
+
find: Sizzle,
|
1195
|
+
expr: Sizzle.selectors,
|
1196
|
+
unique: Sizzle.uniqueSort,
|
1197
|
+
text: Sizzle.getText,
|
1198
|
+
contains: Sizzle.contains,
|
1199
|
+
filter: function(expr, elems, not) {
|
1200
|
+
var i = elems.length;
|
1201
|
+
|
1202
|
+
if (not) {
|
1203
|
+
expr = ":not(" + expr + ")";
|
1204
|
+
}
|
1205
|
+
|
1206
|
+
while (i--) {
|
1207
|
+
if (elems[i].nodeType != 1) {
|
1208
|
+
elems.splice(i, 1);
|
1209
|
+
}
|
1210
|
+
}
|
1211
|
+
|
1212
|
+
if (elems.length === 1) {
|
1213
|
+
elems = DomQuery.find.matchesSelector(elems[0], expr) ? [elems[0]] : [];
|
1214
|
+
} else {
|
1215
|
+
elems = DomQuery.find.matches(expr, elems);
|
1216
|
+
}
|
1217
|
+
|
1218
|
+
return elems;
|
1219
|
+
}
|
1220
|
+
});
|
1221
|
+
|
1222
|
+
function dir(el, prop, until) {
|
1223
|
+
var matched = [], cur = el[prop];
|
1224
|
+
|
1225
|
+
if (typeof until != 'string' && until instanceof DomQuery) {
|
1226
|
+
until = until[0];
|
1227
|
+
}
|
1228
|
+
|
1229
|
+
while (cur && cur.nodeType !== 9) {
|
1230
|
+
if (until !== undefined) {
|
1231
|
+
if (cur === until) {
|
1232
|
+
break;
|
1233
|
+
}
|
1234
|
+
|
1235
|
+
if (typeof until == 'string' && DomQuery(cur).is(until)) {
|
1236
|
+
break;
|
1237
|
+
}
|
1238
|
+
}
|
1239
|
+
|
1240
|
+
if (cur.nodeType === 1) {
|
1241
|
+
matched.push(cur);
|
1242
|
+
}
|
1243
|
+
|
1244
|
+
cur = cur[prop];
|
1245
|
+
}
|
1246
|
+
|
1247
|
+
return matched;
|
1248
|
+
}
|
1249
|
+
|
1250
|
+
function sibling(node, siblingName, nodeType, until) {
|
1251
|
+
var result = [];
|
1252
|
+
|
1253
|
+
if (until instanceof DomQuery) {
|
1254
|
+
until = until[0];
|
1255
|
+
}
|
1256
|
+
|
1257
|
+
for (; node; node = node[siblingName]) {
|
1258
|
+
if (nodeType && node.nodeType !== nodeType) {
|
1259
|
+
continue;
|
1260
|
+
}
|
1261
|
+
|
1262
|
+
if (until !== undefined) {
|
1263
|
+
if (node === until) {
|
1264
|
+
break;
|
1265
|
+
}
|
1266
|
+
|
1267
|
+
if (typeof until == 'string' && DomQuery(node).is(until)) {
|
1268
|
+
break;
|
1269
|
+
}
|
1270
|
+
}
|
1271
|
+
|
1272
|
+
result.push(node);
|
1273
|
+
}
|
1274
|
+
|
1275
|
+
return result;
|
1276
|
+
}
|
1277
|
+
|
1278
|
+
function firstSibling(node, siblingName, nodeType) {
|
1279
|
+
for (node = node[siblingName]; node; node = node[siblingName]) {
|
1280
|
+
if (node.nodeType == nodeType) {
|
1281
|
+
return node;
|
1282
|
+
}
|
1283
|
+
}
|
1284
|
+
|
1285
|
+
return null;
|
1286
|
+
}
|
1287
|
+
|
1288
|
+
each({
|
1289
|
+
/**
|
1290
|
+
* Returns a new collection with the parent of each item in current collection matching the optional selector.
|
1291
|
+
*
|
1292
|
+
* @method parent
|
1293
|
+
* @param {Element/tinymce.dom.DomQuery} node Node to match parents against.
|
1294
|
+
* @return {tinymce.dom.DomQuery} New DomQuery instance with all matching parents.
|
1295
|
+
*/
|
1296
|
+
parent: function(node) {
|
1297
|
+
var parent = node.parentNode;
|
1298
|
+
|
1299
|
+
return parent && parent.nodeType !== 11 ? parent : null;
|
1300
|
+
},
|
1301
|
+
|
1302
|
+
/**
|
1303
|
+
* Returns a new collection with the all the parents of each item in current collection matching the optional selector.
|
1304
|
+
*
|
1305
|
+
* @method parents
|
1306
|
+
* @param {Element/tinymce.dom.DomQuery} node Node to match parents against.
|
1307
|
+
* @return {tinymce.dom.DomQuery} New DomQuery instance with all matching parents.
|
1308
|
+
*/
|
1309
|
+
parents: function(node) {
|
1310
|
+
return dir(node, "parentNode");
|
1311
|
+
},
|
1312
|
+
|
1313
|
+
/**
|
1314
|
+
* Returns a new collection with next sibling of each item in current collection matching the optional selector.
|
1315
|
+
*
|
1316
|
+
* @method next
|
1317
|
+
* @param {Element/tinymce.dom.DomQuery} node Node to match the next element against.
|
1318
|
+
* @return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements.
|
1319
|
+
*/
|
1320
|
+
next: function(node) {
|
1321
|
+
return firstSibling(node, 'nextSibling', 1);
|
1322
|
+
},
|
1323
|
+
|
1324
|
+
/**
|
1325
|
+
* Returns a new collection with previous sibling of each item in current collection matching the optional selector.
|
1326
|
+
*
|
1327
|
+
* @method prev
|
1328
|
+
* @param {Element/tinymce.dom.DomQuery} node Node to match the previous element against.
|
1329
|
+
* @return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements.
|
1330
|
+
*/
|
1331
|
+
prev: function(node) {
|
1332
|
+
return firstSibling(node, 'previousSibling', 1);
|
1333
|
+
},
|
1334
|
+
|
1335
|
+
/**
|
1336
|
+
* Returns all child elements matching the optional selector.
|
1337
|
+
*
|
1338
|
+
* @method children
|
1339
|
+
* @param {Element/tinymce.dom.DomQuery} node Node to match the elements against.
|
1340
|
+
* @return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements.
|
1341
|
+
*/
|
1342
|
+
children: function(node) {
|
1343
|
+
return sibling(node.firstChild, 'nextSibling', 1);
|
1344
|
+
},
|
1345
|
+
|
1346
|
+
/**
|
1347
|
+
* Returns all child nodes matching the optional selector.
|
1348
|
+
*
|
1349
|
+
* @method contents
|
1350
|
+
* @param {Element/tinymce.dom.DomQuery} node Node to get the contents of.
|
1351
|
+
* @return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements.
|
1352
|
+
*/
|
1353
|
+
contents: function(node) {
|
1354
|
+
return Tools.toArray((node.nodeName === "iframe" ? node.contentDocument || node.contentWindow.document : node).childNodes);
|
1355
|
+
}
|
1356
|
+
}, function(name, fn) {
|
1357
|
+
DomQuery.fn[name] = function(selector) {
|
1358
|
+
var self = this, result = [];
|
1359
|
+
|
1360
|
+
self.each(function() {
|
1361
|
+
var nodes = fn.call(result, this, selector, result);
|
1362
|
+
|
1363
|
+
if (nodes) {
|
1364
|
+
if (DomQuery.isArray(nodes)) {
|
1365
|
+
result.push.apply(result, nodes);
|
1366
|
+
} else {
|
1367
|
+
result.push(nodes);
|
1368
|
+
}
|
1369
|
+
}
|
1370
|
+
});
|
1371
|
+
|
1372
|
+
// If traversing on multiple elements we might get the same elements twice
|
1373
|
+
if (this.length > 1) {
|
1374
|
+
if (!skipUniques[name]) {
|
1375
|
+
result = DomQuery.unique(result);
|
1376
|
+
}
|
1377
|
+
|
1378
|
+
if (name.indexOf('parents') === 0) {
|
1379
|
+
result = result.reverse();
|
1380
|
+
}
|
1381
|
+
}
|
1382
|
+
|
1383
|
+
result = DomQuery(result);
|
1384
|
+
|
1385
|
+
if (selector) {
|
1386
|
+
return result.filter(selector);
|
1387
|
+
}
|
1388
|
+
|
1389
|
+
return result;
|
1390
|
+
};
|
1391
|
+
});
|
1392
|
+
|
1393
|
+
each({
|
1394
|
+
/**
|
1395
|
+
* Returns a new collection with the all the parents until the matching selector/element
|
1396
|
+
* of each item in current collection matching the optional selector.
|
1397
|
+
*
|
1398
|
+
* @method parentsUntil
|
1399
|
+
* @param {Element/tinymce.dom.DomQuery} node Node to find parent of.
|
1400
|
+
* @param {String/Element/tinymce.dom.DomQuery} until Until the matching selector or element.
|
1401
|
+
* @return {tinymce.dom.DomQuery} New DomQuery instance with all matching parents.
|
1402
|
+
*/
|
1403
|
+
parentsUntil: function(node, until) {
|
1404
|
+
return dir(node, "parentNode", until);
|
1405
|
+
},
|
1406
|
+
|
1407
|
+
/**
|
1408
|
+
* Returns a new collection with all next siblings of each item in current collection matching the optional selector.
|
1409
|
+
*
|
1410
|
+
* @method nextUntil
|
1411
|
+
* @param {Element/tinymce.dom.DomQuery} node Node to find next siblings on.
|
1412
|
+
* @param {String/Element/tinymce.dom.DomQuery} until Until the matching selector or element.
|
1413
|
+
* @return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements.
|
1414
|
+
*/
|
1415
|
+
nextUntil: function(node, until) {
|
1416
|
+
return sibling(node, 'nextSibling', 1, until).slice(1);
|
1417
|
+
},
|
1418
|
+
|
1419
|
+
/**
|
1420
|
+
* Returns a new collection with all previous siblings of each item in current collection matching the optional selector.
|
1421
|
+
*
|
1422
|
+
* @method prevUntil
|
1423
|
+
* @param {Element/tinymce.dom.DomQuery} node Node to find previous siblings on.
|
1424
|
+
* @param {String/Element/tinymce.dom.DomQuery} until Until the matching selector or element.
|
1425
|
+
* @return {tinymce.dom.DomQuery} New DomQuery instance with all matching elements.
|
1426
|
+
*/
|
1427
|
+
prevUntil: function(node, until) {
|
1428
|
+
return sibling(node, 'previousSibling', 1, until).slice(1);
|
1429
|
+
}
|
1430
|
+
}, function(name, fn) {
|
1431
|
+
DomQuery.fn[name] = function(selector, filter) {
|
1432
|
+
var self = this, result = [];
|
1433
|
+
|
1434
|
+
self.each(function() {
|
1435
|
+
var nodes = fn.call(result, this, selector, result);
|
1436
|
+
|
1437
|
+
if (nodes) {
|
1438
|
+
if (DomQuery.isArray(nodes)) {
|
1439
|
+
result.push.apply(result, nodes);
|
1440
|
+
} else {
|
1441
|
+
result.push(nodes);
|
1442
|
+
}
|
1443
|
+
}
|
1444
|
+
});
|
1445
|
+
|
1446
|
+
// If traversing on multiple elements we might get the same elements twice
|
1447
|
+
if (this.length > 1) {
|
1448
|
+
result = DomQuery.unique(result);
|
1449
|
+
|
1450
|
+
if (name.indexOf('parents') === 0 || name === 'prevUntil') {
|
1451
|
+
result = result.reverse();
|
1452
|
+
}
|
1453
|
+
}
|
1454
|
+
|
1455
|
+
result = DomQuery(result);
|
1456
|
+
|
1457
|
+
if (filter) {
|
1458
|
+
return result.filter(filter);
|
1459
|
+
}
|
1460
|
+
|
1461
|
+
return result;
|
1462
|
+
};
|
1463
|
+
});
|
1464
|
+
|
1465
|
+
/**
|
1466
|
+
* Returns true/false if the current set items matches the selector.
|
1467
|
+
*
|
1468
|
+
* @method is
|
1469
|
+
* @param {String} selector Selector to match the elements against.
|
1470
|
+
* @return {Boolean} True/false if the current set matches the selector.
|
1471
|
+
*/
|
1472
|
+
DomQuery.fn.is = function(selector) {
|
1473
|
+
return !!selector && this.filter(selector).length > 0;
|
1474
|
+
};
|
1475
|
+
|
1476
|
+
DomQuery.fn.init.prototype = DomQuery.fn;
|
1477
|
+
|
1478
|
+
DomQuery.overrideDefaults = function(callback) {
|
1479
|
+
var defaults;
|
1480
|
+
|
1481
|
+
function sub(selector, context) {
|
1482
|
+
defaults = defaults || callback();
|
1483
|
+
|
1484
|
+
if (arguments.length === 0) {
|
1485
|
+
selector = defaults.element;
|
1486
|
+
}
|
1487
|
+
|
1488
|
+
if (!context) {
|
1489
|
+
context = defaults.context;
|
1490
|
+
}
|
1491
|
+
|
1492
|
+
return new sub.fn.init(selector, context);
|
1493
|
+
}
|
1494
|
+
|
1495
|
+
DomQuery.extend(sub, this);
|
1496
|
+
|
1497
|
+
return sub;
|
1498
|
+
};
|
1499
|
+
|
1500
|
+
function appendHooks(targetHooks, prop, hooks) {
|
1501
|
+
each(hooks, function(name, func) {
|
1502
|
+
targetHooks[name] = targetHooks[name] || {};
|
1503
|
+
targetHooks[name][prop] = func;
|
1504
|
+
});
|
1505
|
+
}
|
1506
|
+
|
1507
|
+
if (Env.ie && Env.ie < 8) {
|
1508
|
+
appendHooks(attrHooks, 'get', {
|
1509
|
+
maxlength: function(elm) {
|
1510
|
+
var value = elm.maxLength;
|
1511
|
+
|
1512
|
+
if (value === 0x7fffffff) {
|
1513
|
+
return undef;
|
1514
|
+
}
|
1515
|
+
|
1516
|
+
return value;
|
1517
|
+
},
|
1518
|
+
|
1519
|
+
size: function(elm) {
|
1520
|
+
var value = elm.size;
|
1521
|
+
|
1522
|
+
if (value === 20) {
|
1523
|
+
return undef;
|
1524
|
+
}
|
1525
|
+
|
1526
|
+
return value;
|
1527
|
+
},
|
1528
|
+
|
1529
|
+
'class': function(elm) {
|
1530
|
+
return elm.className;
|
1531
|
+
},
|
1532
|
+
|
1533
|
+
style: function(elm) {
|
1534
|
+
var value = elm.style.cssText;
|
1535
|
+
|
1536
|
+
if (value.length === 0) {
|
1537
|
+
return undef;
|
1538
|
+
}
|
1539
|
+
|
1540
|
+
return value;
|
1541
|
+
}
|
1542
|
+
});
|
1543
|
+
|
1544
|
+
appendHooks(attrHooks, 'set', {
|
1545
|
+
'class': function(elm, value) {
|
1546
|
+
elm.className = value;
|
1547
|
+
},
|
1548
|
+
|
1549
|
+
style: function(elm, value) {
|
1550
|
+
elm.style.cssText = value;
|
1551
|
+
}
|
1552
|
+
});
|
1553
|
+
}
|
1554
|
+
|
1555
|
+
if (Env.ie && Env.ie < 9) {
|
1556
|
+
/*jshint sub:true */
|
1557
|
+
/*eslint dot-notation: 0*/
|
1558
|
+
cssFix['float'] = 'styleFloat';
|
1559
|
+
|
1560
|
+
appendHooks(cssHooks, 'set', {
|
1561
|
+
opacity: function(elm, value) {
|
1562
|
+
var style = elm.style;
|
1563
|
+
|
1564
|
+
if (value === null || value === '') {
|
1565
|
+
style.removeAttribute('filter');
|
1566
|
+
} else {
|
1567
|
+
style.zoom = 1;
|
1568
|
+
style.filter = 'alpha(opacity=' + (value * 100) + ')';
|
1569
|
+
}
|
1570
|
+
}
|
1571
|
+
});
|
1572
|
+
}
|
1573
|
+
|
1574
|
+
DomQuery.attrHooks = attrHooks;
|
1575
|
+
DomQuery.cssHooks = cssHooks;
|
1576
|
+
|
1577
|
+
return DomQuery;
|
1578
|
+
});
|