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,1301 @@
|
|
1
|
+
/**
|
2
|
+
* Control.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
|
+
/*eslint consistent-this:0 */
|
12
|
+
|
13
|
+
/**
|
14
|
+
* This is the base class for all controls and containers. All UI control instances inherit
|
15
|
+
* from this one as it has the base logic needed by all of them.
|
16
|
+
*
|
17
|
+
* @class tinymce.ui.Control
|
18
|
+
*/
|
19
|
+
define("tinymce/ui/Control", [
|
20
|
+
"tinymce/util/Class",
|
21
|
+
"tinymce/util/Tools",
|
22
|
+
"tinymce/util/EventDispatcher",
|
23
|
+
"tinymce/data/ObservableObject",
|
24
|
+
"tinymce/ui/Collection",
|
25
|
+
"tinymce/ui/DomUtils",
|
26
|
+
"tinymce/dom/DomQuery",
|
27
|
+
"tinymce/ui/BoxUtils",
|
28
|
+
"tinymce/ui/ClassList",
|
29
|
+
"tinymce/ui/ReflowQueue"
|
30
|
+
], function(Class, Tools, EventDispatcher, ObservableObject, Collection, DomUtils, $, BoxUtils, ClassList, ReflowQueue) {
|
31
|
+
"use strict";
|
32
|
+
|
33
|
+
var hasMouseWheelEventSupport = "onmousewheel" in document;
|
34
|
+
var hasWheelEventSupport = false;
|
35
|
+
var classPrefix = "mce-";
|
36
|
+
var Control, idCounter = 0;
|
37
|
+
|
38
|
+
var proto = {
|
39
|
+
Statics: {
|
40
|
+
classPrefix: classPrefix
|
41
|
+
},
|
42
|
+
|
43
|
+
isRtl: function() {
|
44
|
+
return Control.rtl;
|
45
|
+
},
|
46
|
+
|
47
|
+
/**
|
48
|
+
* Class/id prefix to use for all controls.
|
49
|
+
*
|
50
|
+
* @final
|
51
|
+
* @field {String} classPrefix
|
52
|
+
*/
|
53
|
+
classPrefix: classPrefix,
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Constructs a new control instance with the specified settings.
|
57
|
+
*
|
58
|
+
* @constructor
|
59
|
+
* @param {Object} settings Name/value object with settings.
|
60
|
+
* @setting {String} style Style CSS properties to add.
|
61
|
+
* @setting {String} border Border box values example: 1 1 1 1
|
62
|
+
* @setting {String} padding Padding box values example: 1 1 1 1
|
63
|
+
* @setting {String} margin Margin box values example: 1 1 1 1
|
64
|
+
* @setting {Number} minWidth Minimal width for the control.
|
65
|
+
* @setting {Number} minHeight Minimal height for the control.
|
66
|
+
* @setting {String} classes Space separated list of classes to add.
|
67
|
+
* @setting {String} role WAI-ARIA role to use for control.
|
68
|
+
* @setting {Boolean} hidden Is the control hidden by default.
|
69
|
+
* @setting {Boolean} disabled Is the control disabled by default.
|
70
|
+
* @setting {String} name Name of the control instance.
|
71
|
+
*/
|
72
|
+
init: function(settings) {
|
73
|
+
var self = this, classes, defaultClasses;
|
74
|
+
|
75
|
+
function applyClasses(classes) {
|
76
|
+
var i;
|
77
|
+
|
78
|
+
classes = classes.split(' ');
|
79
|
+
for (i = 0; i < classes.length; i++) {
|
80
|
+
self.classes.add(classes[i]);
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
self.settings = settings = Tools.extend({}, self.Defaults, settings);
|
85
|
+
|
86
|
+
// Initial states
|
87
|
+
self._id = settings.id || ('mceu_' + (idCounter++));
|
88
|
+
self._aria = {role: settings.role};
|
89
|
+
self._elmCache = {};
|
90
|
+
self.$ = $;
|
91
|
+
|
92
|
+
self.state = new ObservableObject({
|
93
|
+
visible: true,
|
94
|
+
active: false,
|
95
|
+
disabled: false,
|
96
|
+
value: ''
|
97
|
+
});
|
98
|
+
|
99
|
+
self.data = new ObservableObject(settings.data);
|
100
|
+
|
101
|
+
self.classes = new ClassList(function() {
|
102
|
+
if (self.state.get('rendered')) {
|
103
|
+
self.getEl().className = this.toString();
|
104
|
+
}
|
105
|
+
});
|
106
|
+
self.classes.prefix = self.classPrefix;
|
107
|
+
|
108
|
+
// Setup classes
|
109
|
+
classes = settings.classes;
|
110
|
+
if (classes) {
|
111
|
+
if (self.Defaults) {
|
112
|
+
defaultClasses = self.Defaults.classes;
|
113
|
+
|
114
|
+
if (defaultClasses && classes != defaultClasses) {
|
115
|
+
applyClasses(defaultClasses);
|
116
|
+
}
|
117
|
+
}
|
118
|
+
|
119
|
+
applyClasses(classes);
|
120
|
+
}
|
121
|
+
|
122
|
+
Tools.each('title text name visible disabled active value'.split(' '), function(name) {
|
123
|
+
if (name in settings) {
|
124
|
+
self[name](settings[name]);
|
125
|
+
}
|
126
|
+
});
|
127
|
+
|
128
|
+
self.on('click', function() {
|
129
|
+
if (self.disabled()) {
|
130
|
+
return false;
|
131
|
+
}
|
132
|
+
});
|
133
|
+
|
134
|
+
/**
|
135
|
+
* Name/value object with settings for the current control.
|
136
|
+
*
|
137
|
+
* @field {Object} settings
|
138
|
+
*/
|
139
|
+
self.settings = settings;
|
140
|
+
|
141
|
+
self.borderBox = BoxUtils.parseBox(settings.border);
|
142
|
+
self.paddingBox = BoxUtils.parseBox(settings.padding);
|
143
|
+
self.marginBox = BoxUtils.parseBox(settings.margin);
|
144
|
+
|
145
|
+
if (settings.hidden) {
|
146
|
+
self.hide();
|
147
|
+
}
|
148
|
+
},
|
149
|
+
|
150
|
+
// Will generate getter/setter methods for these properties
|
151
|
+
Properties: 'parent,name',
|
152
|
+
|
153
|
+
/**
|
154
|
+
* Returns the root element to render controls into.
|
155
|
+
*
|
156
|
+
* @method getContainerElm
|
157
|
+
* @return {Element} HTML DOM element to render into.
|
158
|
+
*/
|
159
|
+
getContainerElm: function() {
|
160
|
+
return document.body;
|
161
|
+
},
|
162
|
+
|
163
|
+
/**
|
164
|
+
* Returns a control instance for the current DOM element.
|
165
|
+
*
|
166
|
+
* @method getParentCtrl
|
167
|
+
* @param {Element} elm HTML dom element to get parent control from.
|
168
|
+
* @return {tinymce.ui.Control} Control instance or undefined.
|
169
|
+
*/
|
170
|
+
getParentCtrl: function(elm) {
|
171
|
+
var ctrl, lookup = this.getRoot().controlIdLookup;
|
172
|
+
|
173
|
+
while (elm && lookup) {
|
174
|
+
ctrl = lookup[elm.id];
|
175
|
+
if (ctrl) {
|
176
|
+
break;
|
177
|
+
}
|
178
|
+
|
179
|
+
elm = elm.parentNode;
|
180
|
+
}
|
181
|
+
|
182
|
+
return ctrl;
|
183
|
+
},
|
184
|
+
|
185
|
+
/**
|
186
|
+
* Initializes the current controls layout rect.
|
187
|
+
* This will be executed by the layout managers to determine the
|
188
|
+
* default minWidth/minHeight etc.
|
189
|
+
*
|
190
|
+
* @method initLayoutRect
|
191
|
+
* @return {Object} Layout rect instance.
|
192
|
+
*/
|
193
|
+
initLayoutRect: function() {
|
194
|
+
var self = this, settings = self.settings, borderBox, layoutRect;
|
195
|
+
var elm = self.getEl(), width, height, minWidth, minHeight, autoResize;
|
196
|
+
var startMinWidth, startMinHeight, initialSize;
|
197
|
+
|
198
|
+
// Measure the current element
|
199
|
+
borderBox = self.borderBox = self.borderBox || BoxUtils.measureBox(elm, 'border');
|
200
|
+
self.paddingBox = self.paddingBox || BoxUtils.measureBox(elm, 'padding');
|
201
|
+
self.marginBox = self.marginBox || BoxUtils.measureBox(elm, 'margin');
|
202
|
+
initialSize = DomUtils.getSize(elm);
|
203
|
+
|
204
|
+
// Setup minWidth/minHeight and width/height
|
205
|
+
startMinWidth = settings.minWidth;
|
206
|
+
startMinHeight = settings.minHeight;
|
207
|
+
minWidth = startMinWidth || initialSize.width;
|
208
|
+
minHeight = startMinHeight || initialSize.height;
|
209
|
+
width = settings.width;
|
210
|
+
height = settings.height;
|
211
|
+
autoResize = settings.autoResize;
|
212
|
+
autoResize = typeof autoResize != "undefined" ? autoResize : !width && !height;
|
213
|
+
|
214
|
+
width = width || minWidth;
|
215
|
+
height = height || minHeight;
|
216
|
+
|
217
|
+
var deltaW = borderBox.left + borderBox.right;
|
218
|
+
var deltaH = borderBox.top + borderBox.bottom;
|
219
|
+
|
220
|
+
var maxW = settings.maxWidth || 0xFFFF;
|
221
|
+
var maxH = settings.maxHeight || 0xFFFF;
|
222
|
+
|
223
|
+
// Setup initial layout rect
|
224
|
+
self._layoutRect = layoutRect = {
|
225
|
+
x: settings.x || 0,
|
226
|
+
y: settings.y || 0,
|
227
|
+
w: width,
|
228
|
+
h: height,
|
229
|
+
deltaW: deltaW,
|
230
|
+
deltaH: deltaH,
|
231
|
+
contentW: width - deltaW,
|
232
|
+
contentH: height - deltaH,
|
233
|
+
innerW: width - deltaW,
|
234
|
+
innerH: height - deltaH,
|
235
|
+
startMinWidth: startMinWidth || 0,
|
236
|
+
startMinHeight: startMinHeight || 0,
|
237
|
+
minW: Math.min(minWidth, maxW),
|
238
|
+
minH: Math.min(minHeight, maxH),
|
239
|
+
maxW: maxW,
|
240
|
+
maxH: maxH,
|
241
|
+
autoResize: autoResize,
|
242
|
+
scrollW: 0
|
243
|
+
};
|
244
|
+
|
245
|
+
self._lastLayoutRect = {};
|
246
|
+
|
247
|
+
return layoutRect;
|
248
|
+
},
|
249
|
+
|
250
|
+
/**
|
251
|
+
* Getter/setter for the current layout rect.
|
252
|
+
*
|
253
|
+
* @method layoutRect
|
254
|
+
* @param {Object} [newRect] Optional new layout rect.
|
255
|
+
* @return {tinymce.ui.Control/Object} Current control or rect object.
|
256
|
+
*/
|
257
|
+
layoutRect: function(newRect) {
|
258
|
+
var self = this, curRect = self._layoutRect, lastLayoutRect, size, deltaWidth, deltaHeight, undef, repaintControls;
|
259
|
+
|
260
|
+
// Initialize default layout rect
|
261
|
+
if (!curRect) {
|
262
|
+
curRect = self.initLayoutRect();
|
263
|
+
}
|
264
|
+
|
265
|
+
// Set new rect values
|
266
|
+
if (newRect) {
|
267
|
+
// Calc deltas between inner and outer sizes
|
268
|
+
deltaWidth = curRect.deltaW;
|
269
|
+
deltaHeight = curRect.deltaH;
|
270
|
+
|
271
|
+
// Set x position
|
272
|
+
if (newRect.x !== undef) {
|
273
|
+
curRect.x = newRect.x;
|
274
|
+
}
|
275
|
+
|
276
|
+
// Set y position
|
277
|
+
if (newRect.y !== undef) {
|
278
|
+
curRect.y = newRect.y;
|
279
|
+
}
|
280
|
+
|
281
|
+
// Set minW
|
282
|
+
if (newRect.minW !== undef) {
|
283
|
+
curRect.minW = newRect.minW;
|
284
|
+
}
|
285
|
+
|
286
|
+
// Set minH
|
287
|
+
if (newRect.minH !== undef) {
|
288
|
+
curRect.minH = newRect.minH;
|
289
|
+
}
|
290
|
+
|
291
|
+
// Set new width and calculate inner width
|
292
|
+
size = newRect.w;
|
293
|
+
if (size !== undef) {
|
294
|
+
size = size < curRect.minW ? curRect.minW : size;
|
295
|
+
size = size > curRect.maxW ? curRect.maxW : size;
|
296
|
+
curRect.w = size;
|
297
|
+
curRect.innerW = size - deltaWidth;
|
298
|
+
}
|
299
|
+
|
300
|
+
// Set new height and calculate inner height
|
301
|
+
size = newRect.h;
|
302
|
+
if (size !== undef) {
|
303
|
+
size = size < curRect.minH ? curRect.minH : size;
|
304
|
+
size = size > curRect.maxH ? curRect.maxH : size;
|
305
|
+
curRect.h = size;
|
306
|
+
curRect.innerH = size - deltaHeight;
|
307
|
+
}
|
308
|
+
|
309
|
+
// Set new inner width and calculate width
|
310
|
+
size = newRect.innerW;
|
311
|
+
if (size !== undef) {
|
312
|
+
size = size < curRect.minW - deltaWidth ? curRect.minW - deltaWidth : size;
|
313
|
+
size = size > curRect.maxW - deltaWidth ? curRect.maxW - deltaWidth : size;
|
314
|
+
curRect.innerW = size;
|
315
|
+
curRect.w = size + deltaWidth;
|
316
|
+
}
|
317
|
+
|
318
|
+
// Set new height and calculate inner height
|
319
|
+
size = newRect.innerH;
|
320
|
+
if (size !== undef) {
|
321
|
+
size = size < curRect.minH - deltaHeight ? curRect.minH - deltaHeight : size;
|
322
|
+
size = size > curRect.maxH - deltaHeight ? curRect.maxH - deltaHeight : size;
|
323
|
+
curRect.innerH = size;
|
324
|
+
curRect.h = size + deltaHeight;
|
325
|
+
}
|
326
|
+
|
327
|
+
// Set new contentW
|
328
|
+
if (newRect.contentW !== undef) {
|
329
|
+
curRect.contentW = newRect.contentW;
|
330
|
+
}
|
331
|
+
|
332
|
+
// Set new contentH
|
333
|
+
if (newRect.contentH !== undef) {
|
334
|
+
curRect.contentH = newRect.contentH;
|
335
|
+
}
|
336
|
+
|
337
|
+
// Compare last layout rect with the current one to see if we need to repaint or not
|
338
|
+
lastLayoutRect = self._lastLayoutRect;
|
339
|
+
if (lastLayoutRect.x !== curRect.x || lastLayoutRect.y !== curRect.y ||
|
340
|
+
lastLayoutRect.w !== curRect.w || lastLayoutRect.h !== curRect.h) {
|
341
|
+
repaintControls = Control.repaintControls;
|
342
|
+
|
343
|
+
if (repaintControls) {
|
344
|
+
if (repaintControls.map && !repaintControls.map[self._id]) {
|
345
|
+
repaintControls.push(self);
|
346
|
+
repaintControls.map[self._id] = true;
|
347
|
+
}
|
348
|
+
}
|
349
|
+
|
350
|
+
lastLayoutRect.x = curRect.x;
|
351
|
+
lastLayoutRect.y = curRect.y;
|
352
|
+
lastLayoutRect.w = curRect.w;
|
353
|
+
lastLayoutRect.h = curRect.h;
|
354
|
+
}
|
355
|
+
|
356
|
+
return self;
|
357
|
+
}
|
358
|
+
|
359
|
+
return curRect;
|
360
|
+
},
|
361
|
+
|
362
|
+
/**
|
363
|
+
* Repaints the control after a layout operation.
|
364
|
+
*
|
365
|
+
* @method repaint
|
366
|
+
*/
|
367
|
+
repaint: function() {
|
368
|
+
var self = this, style, bodyStyle, bodyElm, rect, borderBox;
|
369
|
+
var borderW, borderH, lastRepaintRect, round, value;
|
370
|
+
|
371
|
+
// Use Math.round on all values on IE < 9
|
372
|
+
round = !document.createRange ? Math.round : function(value) {
|
373
|
+
return value;
|
374
|
+
};
|
375
|
+
|
376
|
+
style = self.getEl().style;
|
377
|
+
rect = self._layoutRect;
|
378
|
+
lastRepaintRect = self._lastRepaintRect || {};
|
379
|
+
|
380
|
+
borderBox = self.borderBox;
|
381
|
+
borderW = borderBox.left + borderBox.right;
|
382
|
+
borderH = borderBox.top + borderBox.bottom;
|
383
|
+
|
384
|
+
if (rect.x !== lastRepaintRect.x) {
|
385
|
+
style.left = round(rect.x) + 'px';
|
386
|
+
lastRepaintRect.x = rect.x;
|
387
|
+
}
|
388
|
+
|
389
|
+
if (rect.y !== lastRepaintRect.y) {
|
390
|
+
style.top = round(rect.y) + 'px';
|
391
|
+
lastRepaintRect.y = rect.y;
|
392
|
+
}
|
393
|
+
|
394
|
+
if (rect.w !== lastRepaintRect.w) {
|
395
|
+
value = round(rect.w - borderW);
|
396
|
+
style.width = (value >= 0 ? value : 0) + 'px';
|
397
|
+
lastRepaintRect.w = rect.w;
|
398
|
+
}
|
399
|
+
|
400
|
+
if (rect.h !== lastRepaintRect.h) {
|
401
|
+
value = round(rect.h - borderH);
|
402
|
+
style.height = (value >= 0 ? value : 0) + 'px';
|
403
|
+
lastRepaintRect.h = rect.h;
|
404
|
+
}
|
405
|
+
|
406
|
+
// Update body if needed
|
407
|
+
if (self._hasBody && rect.innerW !== lastRepaintRect.innerW) {
|
408
|
+
value = round(rect.innerW);
|
409
|
+
|
410
|
+
bodyElm = self.getEl('body');
|
411
|
+
if (bodyElm) {
|
412
|
+
bodyStyle = bodyElm.style;
|
413
|
+
bodyStyle.width = (value >= 0 ? value : 0) + 'px';
|
414
|
+
}
|
415
|
+
|
416
|
+
lastRepaintRect.innerW = rect.innerW;
|
417
|
+
}
|
418
|
+
|
419
|
+
if (self._hasBody && rect.innerH !== lastRepaintRect.innerH) {
|
420
|
+
value = round(rect.innerH);
|
421
|
+
|
422
|
+
bodyElm = bodyElm || self.getEl('body');
|
423
|
+
if (bodyElm) {
|
424
|
+
bodyStyle = bodyStyle || bodyElm.style;
|
425
|
+
bodyStyle.height = (value >= 0 ? value : 0) + 'px';
|
426
|
+
}
|
427
|
+
|
428
|
+
lastRepaintRect.innerH = rect.innerH;
|
429
|
+
}
|
430
|
+
|
431
|
+
self._lastRepaintRect = lastRepaintRect;
|
432
|
+
self.fire('repaint', {}, false);
|
433
|
+
},
|
434
|
+
|
435
|
+
/**
|
436
|
+
* Updates the controls layout rect by re-measuing it.
|
437
|
+
*/
|
438
|
+
updateLayoutRect: function() {
|
439
|
+
var self = this;
|
440
|
+
|
441
|
+
self.parent()._lastRect = null;
|
442
|
+
|
443
|
+
DomUtils.css(self.getEl(), {width: '', height: ''});
|
444
|
+
|
445
|
+
self._layoutRect = self._lastRepaintRect = self._lastLayoutRect = null;
|
446
|
+
self.initLayoutRect();
|
447
|
+
},
|
448
|
+
|
449
|
+
/**
|
450
|
+
* Binds a callback to the specified event. This event can both be
|
451
|
+
* native browser events like "click" or custom ones like PostRender.
|
452
|
+
*
|
453
|
+
* The callback function will be passed a DOM event like object that enables yout do stop propagation.
|
454
|
+
*
|
455
|
+
* @method on
|
456
|
+
* @param {String} name Name of the event to bind. For example "click".
|
457
|
+
* @param {String/function} callback Callback function to execute ones the event occurs.
|
458
|
+
* @return {tinymce.ui.Control} Current control object.
|
459
|
+
*/
|
460
|
+
on: function(name, callback) {
|
461
|
+
var self = this;
|
462
|
+
|
463
|
+
function resolveCallbackName(name) {
|
464
|
+
var callback, scope;
|
465
|
+
|
466
|
+
if (typeof name != 'string') {
|
467
|
+
return name;
|
468
|
+
}
|
469
|
+
|
470
|
+
return function(e) {
|
471
|
+
if (!callback) {
|
472
|
+
self.parentsAndSelf().each(function(ctrl) {
|
473
|
+
var callbacks = ctrl.settings.callbacks;
|
474
|
+
|
475
|
+
if (callbacks && (callback = callbacks[name])) {
|
476
|
+
scope = ctrl;
|
477
|
+
return false;
|
478
|
+
}
|
479
|
+
});
|
480
|
+
}
|
481
|
+
|
482
|
+
if (!callback) {
|
483
|
+
e.action = name;
|
484
|
+
this.fire('execute', e);
|
485
|
+
return;
|
486
|
+
}
|
487
|
+
|
488
|
+
return callback.call(scope, e);
|
489
|
+
};
|
490
|
+
}
|
491
|
+
|
492
|
+
getEventDispatcher(self).on(name, resolveCallbackName(callback));
|
493
|
+
|
494
|
+
return self;
|
495
|
+
},
|
496
|
+
|
497
|
+
/**
|
498
|
+
* Unbinds the specified event and optionally a specific callback. If you omit the name
|
499
|
+
* parameter all event handlers will be removed. If you omit the callback all event handles
|
500
|
+
* by the specified name will be removed.
|
501
|
+
*
|
502
|
+
* @method off
|
503
|
+
* @param {String} [name] Name for the event to unbind.
|
504
|
+
* @param {function} [callback] Callback function to unbind.
|
505
|
+
* @return {tinymce.ui.Control} Current control object.
|
506
|
+
*/
|
507
|
+
off: function(name, callback) {
|
508
|
+
getEventDispatcher(this).off(name, callback);
|
509
|
+
return this;
|
510
|
+
},
|
511
|
+
|
512
|
+
/**
|
513
|
+
* Fires the specified event by name and arguments on the control. This will execute all
|
514
|
+
* bound event handlers.
|
515
|
+
*
|
516
|
+
* @method fire
|
517
|
+
* @param {String} name Name of the event to fire.
|
518
|
+
* @param {Object} [args] Arguments to pass to the event.
|
519
|
+
* @param {Boolean} [bubble] Value to control bubbling. Defaults to true.
|
520
|
+
* @return {Object} Current arguments object.
|
521
|
+
*/
|
522
|
+
fire: function(name, args, bubble) {
|
523
|
+
var self = this;
|
524
|
+
|
525
|
+
args = args || {};
|
526
|
+
|
527
|
+
if (!args.control) {
|
528
|
+
args.control = self;
|
529
|
+
}
|
530
|
+
|
531
|
+
args = getEventDispatcher(self).fire(name, args);
|
532
|
+
|
533
|
+
// Bubble event up to parents
|
534
|
+
if (bubble !== false && self.parent) {
|
535
|
+
var parent = self.parent();
|
536
|
+
while (parent && !args.isPropagationStopped()) {
|
537
|
+
parent.fire(name, args, false);
|
538
|
+
parent = parent.parent();
|
539
|
+
}
|
540
|
+
}
|
541
|
+
|
542
|
+
return args;
|
543
|
+
},
|
544
|
+
|
545
|
+
/**
|
546
|
+
* Returns true/false if the specified event has any listeners.
|
547
|
+
*
|
548
|
+
* @method hasEventListeners
|
549
|
+
* @param {String} name Name of the event to check for.
|
550
|
+
* @return {Boolean} True/false state if the event has listeners.
|
551
|
+
*/
|
552
|
+
hasEventListeners: function(name) {
|
553
|
+
return getEventDispatcher(this).has(name);
|
554
|
+
},
|
555
|
+
|
556
|
+
/**
|
557
|
+
* Returns a control collection with all parent controls.
|
558
|
+
*
|
559
|
+
* @method parents
|
560
|
+
* @param {String} selector Optional selector expression to find parents.
|
561
|
+
* @return {tinymce.ui.Collection} Collection with all parent controls.
|
562
|
+
*/
|
563
|
+
parents: function(selector) {
|
564
|
+
var self = this, ctrl, parents = new Collection();
|
565
|
+
|
566
|
+
// Add each parent to collection
|
567
|
+
for (ctrl = self.parent(); ctrl; ctrl = ctrl.parent()) {
|
568
|
+
parents.add(ctrl);
|
569
|
+
}
|
570
|
+
|
571
|
+
// Filter away everything that doesn't match the selector
|
572
|
+
if (selector) {
|
573
|
+
parents = parents.filter(selector);
|
574
|
+
}
|
575
|
+
|
576
|
+
return parents;
|
577
|
+
},
|
578
|
+
|
579
|
+
/**
|
580
|
+
* Returns the current control and it's parents.
|
581
|
+
*
|
582
|
+
* @method parentsAndSelf
|
583
|
+
* @param {String} selector Optional selector expression to find parents.
|
584
|
+
* @return {tinymce.ui.Collection} Collection with all parent controls.
|
585
|
+
*/
|
586
|
+
parentsAndSelf: function(selector) {
|
587
|
+
return new Collection(this).add(this.parents(selector));
|
588
|
+
},
|
589
|
+
|
590
|
+
/**
|
591
|
+
* Returns the control next to the current control.
|
592
|
+
*
|
593
|
+
* @method next
|
594
|
+
* @return {tinymce.ui.Control} Next control instance.
|
595
|
+
*/
|
596
|
+
next: function() {
|
597
|
+
var parentControls = this.parent().items();
|
598
|
+
|
599
|
+
return parentControls[parentControls.indexOf(this) + 1];
|
600
|
+
},
|
601
|
+
|
602
|
+
/**
|
603
|
+
* Returns the control previous to the current control.
|
604
|
+
*
|
605
|
+
* @method prev
|
606
|
+
* @return {tinymce.ui.Control} Previous control instance.
|
607
|
+
*/
|
608
|
+
prev: function() {
|
609
|
+
var parentControls = this.parent().items();
|
610
|
+
|
611
|
+
return parentControls[parentControls.indexOf(this) - 1];
|
612
|
+
},
|
613
|
+
|
614
|
+
/**
|
615
|
+
* Sets the inner HTML of the control element.
|
616
|
+
*
|
617
|
+
* @method innerHtml
|
618
|
+
* @param {String} html Html string to set as inner html.
|
619
|
+
* @return {tinymce.ui.Control} Current control object.
|
620
|
+
*/
|
621
|
+
innerHtml: function(html) {
|
622
|
+
this.$el.html(html);
|
623
|
+
return this;
|
624
|
+
},
|
625
|
+
|
626
|
+
/**
|
627
|
+
* Returns the control DOM element or sub element.
|
628
|
+
*
|
629
|
+
* @method getEl
|
630
|
+
* @param {String} [suffix] Suffix to get element by.
|
631
|
+
* @return {Element} HTML DOM element for the current control or it's children.
|
632
|
+
*/
|
633
|
+
getEl: function(suffix) {
|
634
|
+
var id = suffix ? this._id + '-' + suffix : this._id;
|
635
|
+
|
636
|
+
if (!this._elmCache[id]) {
|
637
|
+
this._elmCache[id] = $('#' + id)[0];
|
638
|
+
}
|
639
|
+
|
640
|
+
return this._elmCache[id];
|
641
|
+
},
|
642
|
+
|
643
|
+
/**
|
644
|
+
* Sets the visible state to true.
|
645
|
+
*
|
646
|
+
* @method show
|
647
|
+
* @return {tinymce.ui.Control} Current control instance.
|
648
|
+
*/
|
649
|
+
show: function() {
|
650
|
+
return this.visible(true);
|
651
|
+
},
|
652
|
+
|
653
|
+
/**
|
654
|
+
* Sets the visible state to false.
|
655
|
+
*
|
656
|
+
* @method hide
|
657
|
+
* @return {tinymce.ui.Control} Current control instance.
|
658
|
+
*/
|
659
|
+
hide: function() {
|
660
|
+
return this.visible(false);
|
661
|
+
},
|
662
|
+
|
663
|
+
/**
|
664
|
+
* Focuses the current control.
|
665
|
+
*
|
666
|
+
* @method focus
|
667
|
+
* @return {tinymce.ui.Control} Current control instance.
|
668
|
+
*/
|
669
|
+
focus: function() {
|
670
|
+
try {
|
671
|
+
this.getEl().focus();
|
672
|
+
} catch (ex) {
|
673
|
+
// Ignore IE error
|
674
|
+
}
|
675
|
+
|
676
|
+
return this;
|
677
|
+
},
|
678
|
+
|
679
|
+
/**
|
680
|
+
* Blurs the current control.
|
681
|
+
*
|
682
|
+
* @method blur
|
683
|
+
* @return {tinymce.ui.Control} Current control instance.
|
684
|
+
*/
|
685
|
+
blur: function() {
|
686
|
+
this.getEl().blur();
|
687
|
+
|
688
|
+
return this;
|
689
|
+
},
|
690
|
+
|
691
|
+
/**
|
692
|
+
* Sets the specified aria property.
|
693
|
+
*
|
694
|
+
* @method aria
|
695
|
+
* @param {String} name Name of the aria property to set.
|
696
|
+
* @param {String} value Value of the aria property.
|
697
|
+
* @return {tinymce.ui.Control} Current control instance.
|
698
|
+
*/
|
699
|
+
aria: function(name, value) {
|
700
|
+
var self = this, elm = self.getEl(self.ariaTarget);
|
701
|
+
|
702
|
+
if (typeof value === "undefined") {
|
703
|
+
return self._aria[name];
|
704
|
+
}
|
705
|
+
|
706
|
+
self._aria[name] = value;
|
707
|
+
|
708
|
+
if (self.state.get('rendered')) {
|
709
|
+
elm.setAttribute(name == 'role' ? name : 'aria-' + name, value);
|
710
|
+
}
|
711
|
+
|
712
|
+
return self;
|
713
|
+
},
|
714
|
+
|
715
|
+
/**
|
716
|
+
* Encodes the specified string with HTML entities. It will also
|
717
|
+
* translate the string to different languages.
|
718
|
+
*
|
719
|
+
* @method encode
|
720
|
+
* @param {String/Object/Array} text Text to entity encode.
|
721
|
+
* @param {Boolean} [translate=true] False if the contents shouldn't be translated.
|
722
|
+
* @return {String} Encoded and possible traslated string.
|
723
|
+
*/
|
724
|
+
encode: function(text, translate) {
|
725
|
+
if (translate !== false) {
|
726
|
+
text = this.translate(text);
|
727
|
+
}
|
728
|
+
|
729
|
+
return (text || '').replace(/[&<>"]/g, function(match) {
|
730
|
+
return '&#' + match.charCodeAt(0) + ';';
|
731
|
+
});
|
732
|
+
},
|
733
|
+
|
734
|
+
/**
|
735
|
+
* Returns the translated string.
|
736
|
+
*
|
737
|
+
* @method translate
|
738
|
+
* @param {String} text Text to translate.
|
739
|
+
* @return {String} Translated string or the same as the input.
|
740
|
+
*/
|
741
|
+
translate: function(text) {
|
742
|
+
return Control.translate ? Control.translate(text) : text;
|
743
|
+
},
|
744
|
+
|
745
|
+
/**
|
746
|
+
* Adds items before the current control.
|
747
|
+
*
|
748
|
+
* @method before
|
749
|
+
* @param {Array/tinymce.ui.Collection} items Array of items to prepend before this control.
|
750
|
+
* @return {tinymce.ui.Control} Current control instance.
|
751
|
+
*/
|
752
|
+
before: function(items) {
|
753
|
+
var self = this, parent = self.parent();
|
754
|
+
|
755
|
+
if (parent) {
|
756
|
+
parent.insert(items, parent.items().indexOf(self), true);
|
757
|
+
}
|
758
|
+
|
759
|
+
return self;
|
760
|
+
},
|
761
|
+
|
762
|
+
/**
|
763
|
+
* Adds items after the current control.
|
764
|
+
*
|
765
|
+
* @method after
|
766
|
+
* @param {Array/tinymce.ui.Collection} items Array of items to append after this control.
|
767
|
+
* @return {tinymce.ui.Control} Current control instance.
|
768
|
+
*/
|
769
|
+
after: function(items) {
|
770
|
+
var self = this, parent = self.parent();
|
771
|
+
|
772
|
+
if (parent) {
|
773
|
+
parent.insert(items, parent.items().indexOf(self));
|
774
|
+
}
|
775
|
+
|
776
|
+
return self;
|
777
|
+
},
|
778
|
+
|
779
|
+
/**
|
780
|
+
* Removes the current control from DOM and from UI collections.
|
781
|
+
*
|
782
|
+
* @method remove
|
783
|
+
* @return {tinymce.ui.Control} Current control instance.
|
784
|
+
*/
|
785
|
+
remove: function() {
|
786
|
+
var self = this, elm = self.getEl(), parent = self.parent(), newItems, i;
|
787
|
+
|
788
|
+
if (self.items) {
|
789
|
+
var controls = self.items().toArray();
|
790
|
+
i = controls.length;
|
791
|
+
while (i--) {
|
792
|
+
controls[i].remove();
|
793
|
+
}
|
794
|
+
}
|
795
|
+
|
796
|
+
if (parent && parent.items) {
|
797
|
+
newItems = [];
|
798
|
+
|
799
|
+
parent.items().each(function(item) {
|
800
|
+
if (item !== self) {
|
801
|
+
newItems.push(item);
|
802
|
+
}
|
803
|
+
});
|
804
|
+
|
805
|
+
parent.items().set(newItems);
|
806
|
+
parent._lastRect = null;
|
807
|
+
}
|
808
|
+
|
809
|
+
if (self._eventsRoot && self._eventsRoot == self) {
|
810
|
+
$(elm).off();
|
811
|
+
}
|
812
|
+
|
813
|
+
var lookup = self.getRoot().controlIdLookup;
|
814
|
+
if (lookup) {
|
815
|
+
delete lookup[self._id];
|
816
|
+
}
|
817
|
+
|
818
|
+
if (elm && elm.parentNode) {
|
819
|
+
elm.parentNode.removeChild(elm);
|
820
|
+
}
|
821
|
+
|
822
|
+
self.state.set('rendered', false);
|
823
|
+
self.state.destroy();
|
824
|
+
|
825
|
+
self.fire('remove');
|
826
|
+
|
827
|
+
return self;
|
828
|
+
},
|
829
|
+
|
830
|
+
/**
|
831
|
+
* Renders the control before the specified element.
|
832
|
+
*
|
833
|
+
* @method renderBefore
|
834
|
+
* @param {Element} elm Element to render before.
|
835
|
+
* @return {tinymce.ui.Control} Current control instance.
|
836
|
+
*/
|
837
|
+
renderBefore: function(elm) {
|
838
|
+
$(elm).before(this.renderHtml());
|
839
|
+
this.postRender();
|
840
|
+
return this;
|
841
|
+
},
|
842
|
+
|
843
|
+
/**
|
844
|
+
* Renders the control to the specified element.
|
845
|
+
*
|
846
|
+
* @method renderBefore
|
847
|
+
* @param {Element} elm Element to render to.
|
848
|
+
* @return {tinymce.ui.Control} Current control instance.
|
849
|
+
*/
|
850
|
+
renderTo: function(elm) {
|
851
|
+
$(elm || this.getContainerElm()).append(this.renderHtml());
|
852
|
+
this.postRender();
|
853
|
+
return this;
|
854
|
+
},
|
855
|
+
|
856
|
+
preRender: function() {
|
857
|
+
},
|
858
|
+
|
859
|
+
render: function() {
|
860
|
+
},
|
861
|
+
|
862
|
+
renderHtml: function() {
|
863
|
+
return '<div id="' + this._id + '" class="' + this.classes + '"></div>';
|
864
|
+
},
|
865
|
+
|
866
|
+
/**
|
867
|
+
* Post render method. Called after the control has been rendered to the target.
|
868
|
+
*
|
869
|
+
* @method postRender
|
870
|
+
* @return {tinymce.ui.Control} Current control instance.
|
871
|
+
*/
|
872
|
+
postRender: function() {
|
873
|
+
var self = this, settings = self.settings, elm, box, parent, name, parentEventsRoot;
|
874
|
+
|
875
|
+
self.$el = $(self.getEl());
|
876
|
+
self.state.set('rendered', true);
|
877
|
+
|
878
|
+
// Bind on<event> settings
|
879
|
+
for (name in settings) {
|
880
|
+
if (name.indexOf("on") === 0) {
|
881
|
+
self.on(name.substr(2), settings[name]);
|
882
|
+
}
|
883
|
+
}
|
884
|
+
|
885
|
+
if (self._eventsRoot) {
|
886
|
+
for (parent = self.parent(); !parentEventsRoot && parent; parent = parent.parent()) {
|
887
|
+
parentEventsRoot = parent._eventsRoot;
|
888
|
+
}
|
889
|
+
|
890
|
+
if (parentEventsRoot) {
|
891
|
+
for (name in parentEventsRoot._nativeEvents) {
|
892
|
+
self._nativeEvents[name] = true;
|
893
|
+
}
|
894
|
+
}
|
895
|
+
}
|
896
|
+
|
897
|
+
bindPendingEvents(self);
|
898
|
+
|
899
|
+
if (settings.style) {
|
900
|
+
elm = self.getEl();
|
901
|
+
if (elm) {
|
902
|
+
elm.setAttribute('style', settings.style);
|
903
|
+
elm.style.cssText = settings.style;
|
904
|
+
}
|
905
|
+
}
|
906
|
+
|
907
|
+
if (self.settings.border) {
|
908
|
+
box = self.borderBox;
|
909
|
+
self.$el.css({
|
910
|
+
'border-top-width': box.top,
|
911
|
+
'border-right-width': box.right,
|
912
|
+
'border-bottom-width': box.bottom,
|
913
|
+
'border-left-width': box.left
|
914
|
+
});
|
915
|
+
}
|
916
|
+
|
917
|
+
// Add instance to lookup
|
918
|
+
var root = self.getRoot();
|
919
|
+
if (!root.controlIdLookup) {
|
920
|
+
root.controlIdLookup = {};
|
921
|
+
}
|
922
|
+
|
923
|
+
root.controlIdLookup[self._id] = self;
|
924
|
+
|
925
|
+
for (var key in self._aria) {
|
926
|
+
self.aria(key, self._aria[key]);
|
927
|
+
}
|
928
|
+
|
929
|
+
if (self.state.get('visible') === false) {
|
930
|
+
self.getEl().style.display = 'none';
|
931
|
+
}
|
932
|
+
|
933
|
+
self.bindStates();
|
934
|
+
|
935
|
+
self.state.on('change:visible', function(e) {
|
936
|
+
var state = e.value, parentCtrl;
|
937
|
+
|
938
|
+
if (self.state.get('rendered')) {
|
939
|
+
self.getEl().style.display = state === false ? 'none' : '';
|
940
|
+
|
941
|
+
// Need to force a reflow here on IE 8
|
942
|
+
self.getEl().getBoundingClientRect();
|
943
|
+
}
|
944
|
+
|
945
|
+
// Parent container needs to reflow
|
946
|
+
parentCtrl = self.parent();
|
947
|
+
if (parentCtrl) {
|
948
|
+
parentCtrl._lastRect = null;
|
949
|
+
}
|
950
|
+
|
951
|
+
self.fire(state ? 'show' : 'hide');
|
952
|
+
|
953
|
+
ReflowQueue.add(self);
|
954
|
+
});
|
955
|
+
|
956
|
+
self.fire('postrender', {}, false);
|
957
|
+
},
|
958
|
+
|
959
|
+
bindStates: function() {
|
960
|
+
},
|
961
|
+
|
962
|
+
/**
|
963
|
+
* Scrolls the current control into view.
|
964
|
+
*
|
965
|
+
* @method scrollIntoView
|
966
|
+
* @param {String} align Alignment in view top|center|bottom.
|
967
|
+
* @return {tinymce.ui.Control} Current control instance.
|
968
|
+
*/
|
969
|
+
scrollIntoView: function(align) {
|
970
|
+
function getOffset(elm, rootElm) {
|
971
|
+
var x, y, parent = elm;
|
972
|
+
|
973
|
+
x = y = 0;
|
974
|
+
while (parent && parent != rootElm && parent.nodeType) {
|
975
|
+
x += parent.offsetLeft || 0;
|
976
|
+
y += parent.offsetTop || 0;
|
977
|
+
parent = parent.offsetParent;
|
978
|
+
}
|
979
|
+
|
980
|
+
return {x: x, y: y};
|
981
|
+
}
|
982
|
+
|
983
|
+
var elm = this.getEl(), parentElm = elm.parentNode;
|
984
|
+
var x, y, width, height, parentWidth, parentHeight;
|
985
|
+
var pos = getOffset(elm, parentElm);
|
986
|
+
|
987
|
+
x = pos.x;
|
988
|
+
y = pos.y;
|
989
|
+
width = elm.offsetWidth;
|
990
|
+
height = elm.offsetHeight;
|
991
|
+
parentWidth = parentElm.clientWidth;
|
992
|
+
parentHeight = parentElm.clientHeight;
|
993
|
+
|
994
|
+
if (align == "end") {
|
995
|
+
x -= parentWidth - width;
|
996
|
+
y -= parentHeight - height;
|
997
|
+
} else if (align == "center") {
|
998
|
+
x -= (parentWidth / 2) - (width / 2);
|
999
|
+
y -= (parentHeight / 2) - (height / 2);
|
1000
|
+
}
|
1001
|
+
|
1002
|
+
parentElm.scrollLeft = x;
|
1003
|
+
parentElm.scrollTop = y;
|
1004
|
+
|
1005
|
+
return this;
|
1006
|
+
},
|
1007
|
+
|
1008
|
+
getRoot: function() {
|
1009
|
+
var ctrl = this, rootControl, parents = [];
|
1010
|
+
|
1011
|
+
while (ctrl) {
|
1012
|
+
if (ctrl.rootControl) {
|
1013
|
+
rootControl = ctrl.rootControl;
|
1014
|
+
break;
|
1015
|
+
}
|
1016
|
+
|
1017
|
+
parents.push(ctrl);
|
1018
|
+
rootControl = ctrl;
|
1019
|
+
ctrl = ctrl.parent();
|
1020
|
+
}
|
1021
|
+
|
1022
|
+
if (!rootControl) {
|
1023
|
+
rootControl = this;
|
1024
|
+
}
|
1025
|
+
|
1026
|
+
var i = parents.length;
|
1027
|
+
while (i--) {
|
1028
|
+
parents[i].rootControl = rootControl;
|
1029
|
+
}
|
1030
|
+
|
1031
|
+
return rootControl;
|
1032
|
+
},
|
1033
|
+
|
1034
|
+
/**
|
1035
|
+
* Reflows the current control and it's parents.
|
1036
|
+
* This should be used after you for example append children to the current control so
|
1037
|
+
* that the layout managers know that they need to reposition everything.
|
1038
|
+
*
|
1039
|
+
* @example
|
1040
|
+
* container.append({type: 'button', text: 'My button'}).reflow();
|
1041
|
+
*
|
1042
|
+
* @method reflow
|
1043
|
+
* @return {tinymce.ui.Control} Current control instance.
|
1044
|
+
*/
|
1045
|
+
reflow: function() {
|
1046
|
+
ReflowQueue.remove(this);
|
1047
|
+
|
1048
|
+
var parent = this.parent();
|
1049
|
+
if (parent._layout && !parent._layout.isNative()) {
|
1050
|
+
parent.reflow();
|
1051
|
+
}
|
1052
|
+
|
1053
|
+
return this;
|
1054
|
+
}
|
1055
|
+
|
1056
|
+
/**
|
1057
|
+
* Sets/gets the parent container for the control.
|
1058
|
+
*
|
1059
|
+
* @method parent
|
1060
|
+
* @param {tinymce.ui.Container} parent Optional parent to set.
|
1061
|
+
* @return {tinymce.ui.Control} Parent control or the current control on a set action.
|
1062
|
+
*/
|
1063
|
+
// parent: function(parent) {} -- Generated
|
1064
|
+
|
1065
|
+
/**
|
1066
|
+
* Sets/gets the text for the control.
|
1067
|
+
*
|
1068
|
+
* @method text
|
1069
|
+
* @param {String} value Value to set to control.
|
1070
|
+
* @return {String/tinymce.ui.Control} Current control on a set operation or current value on a get.
|
1071
|
+
*/
|
1072
|
+
// text: function(value) {} -- Generated
|
1073
|
+
|
1074
|
+
/**
|
1075
|
+
* Sets/gets the disabled state on the control.
|
1076
|
+
*
|
1077
|
+
* @method disabled
|
1078
|
+
* @param {Boolean} state Value to set to control.
|
1079
|
+
* @return {Boolean/tinymce.ui.Control} Current control on a set operation or current state on a get.
|
1080
|
+
*/
|
1081
|
+
// disabled: function(state) {} -- Generated
|
1082
|
+
|
1083
|
+
/**
|
1084
|
+
* Sets/gets the active for the control.
|
1085
|
+
*
|
1086
|
+
* @method active
|
1087
|
+
* @param {Boolean} state Value to set to control.
|
1088
|
+
* @return {Boolean/tinymce.ui.Control} Current control on a set operation or current state on a get.
|
1089
|
+
*/
|
1090
|
+
// active: function(state) {} -- Generated
|
1091
|
+
|
1092
|
+
/**
|
1093
|
+
* Sets/gets the name for the control.
|
1094
|
+
*
|
1095
|
+
* @method name
|
1096
|
+
* @param {String} value Value to set to control.
|
1097
|
+
* @return {String/tinymce.ui.Control} Current control on a set operation or current value on a get.
|
1098
|
+
*/
|
1099
|
+
// name: function(value) {} -- Generated
|
1100
|
+
|
1101
|
+
/**
|
1102
|
+
* Sets/gets the title for the control.
|
1103
|
+
*
|
1104
|
+
* @method title
|
1105
|
+
* @param {String} value Value to set to control.
|
1106
|
+
* @return {String/tinymce.ui.Control} Current control on a set operation or current value on a get.
|
1107
|
+
*/
|
1108
|
+
// title: function(value) {} -- Generated
|
1109
|
+
|
1110
|
+
/**
|
1111
|
+
* Sets/gets the visible for the control.
|
1112
|
+
*
|
1113
|
+
* @method visible
|
1114
|
+
* @param {Boolean} state Value to set to control.
|
1115
|
+
* @return {Boolean/tinymce.ui.Control} Current control on a set operation or current state on a get.
|
1116
|
+
*/
|
1117
|
+
// visible: function(value) {} -- Generated
|
1118
|
+
};
|
1119
|
+
|
1120
|
+
/**
|
1121
|
+
* Setup state properties.
|
1122
|
+
*/
|
1123
|
+
Tools.each('text title visible disabled active value'.split(' '), function(name) {
|
1124
|
+
proto[name] = function(value) {
|
1125
|
+
if (arguments.length === 0) {
|
1126
|
+
return this.state.get(name);
|
1127
|
+
}
|
1128
|
+
|
1129
|
+
if (typeof value != "undefined") {
|
1130
|
+
this.state.set(name, value);
|
1131
|
+
}
|
1132
|
+
|
1133
|
+
return this;
|
1134
|
+
};
|
1135
|
+
});
|
1136
|
+
|
1137
|
+
Control = Class.extend(proto);
|
1138
|
+
|
1139
|
+
function getEventDispatcher(obj) {
|
1140
|
+
if (!obj._eventDispatcher) {
|
1141
|
+
obj._eventDispatcher = new EventDispatcher({
|
1142
|
+
scope: obj,
|
1143
|
+
toggleEvent: function(name, state) {
|
1144
|
+
if (state && EventDispatcher.isNative(name)) {
|
1145
|
+
if (!obj._nativeEvents) {
|
1146
|
+
obj._nativeEvents = {};
|
1147
|
+
}
|
1148
|
+
|
1149
|
+
obj._nativeEvents[name] = true;
|
1150
|
+
|
1151
|
+
if (obj.state.get('rendered')) {
|
1152
|
+
bindPendingEvents(obj);
|
1153
|
+
}
|
1154
|
+
}
|
1155
|
+
}
|
1156
|
+
});
|
1157
|
+
}
|
1158
|
+
|
1159
|
+
return obj._eventDispatcher;
|
1160
|
+
}
|
1161
|
+
|
1162
|
+
function bindPendingEvents(eventCtrl) {
|
1163
|
+
var i, l, parents, eventRootCtrl, nativeEvents, name;
|
1164
|
+
|
1165
|
+
function delegate(e) {
|
1166
|
+
var control = eventCtrl.getParentCtrl(e.target);
|
1167
|
+
|
1168
|
+
if (control) {
|
1169
|
+
control.fire(e.type, e);
|
1170
|
+
}
|
1171
|
+
}
|
1172
|
+
|
1173
|
+
function mouseLeaveHandler() {
|
1174
|
+
var ctrl = eventRootCtrl._lastHoverCtrl;
|
1175
|
+
|
1176
|
+
if (ctrl) {
|
1177
|
+
ctrl.fire("mouseleave", {target: ctrl.getEl()});
|
1178
|
+
|
1179
|
+
ctrl.parents().each(function(ctrl) {
|
1180
|
+
ctrl.fire("mouseleave", {target: ctrl.getEl()});
|
1181
|
+
});
|
1182
|
+
|
1183
|
+
eventRootCtrl._lastHoverCtrl = null;
|
1184
|
+
}
|
1185
|
+
}
|
1186
|
+
|
1187
|
+
function mouseEnterHandler(e) {
|
1188
|
+
var ctrl = eventCtrl.getParentCtrl(e.target), lastCtrl = eventRootCtrl._lastHoverCtrl, idx = 0, i, parents, lastParents;
|
1189
|
+
|
1190
|
+
// Over on a new control
|
1191
|
+
if (ctrl !== lastCtrl) {
|
1192
|
+
eventRootCtrl._lastHoverCtrl = ctrl;
|
1193
|
+
|
1194
|
+
parents = ctrl.parents().toArray().reverse();
|
1195
|
+
parents.push(ctrl);
|
1196
|
+
|
1197
|
+
if (lastCtrl) {
|
1198
|
+
lastParents = lastCtrl.parents().toArray().reverse();
|
1199
|
+
lastParents.push(lastCtrl);
|
1200
|
+
|
1201
|
+
for (idx = 0; idx < lastParents.length; idx++) {
|
1202
|
+
if (parents[idx] !== lastParents[idx]) {
|
1203
|
+
break;
|
1204
|
+
}
|
1205
|
+
}
|
1206
|
+
|
1207
|
+
for (i = lastParents.length - 1; i >= idx; i--) {
|
1208
|
+
lastCtrl = lastParents[i];
|
1209
|
+
lastCtrl.fire("mouseleave", {
|
1210
|
+
target: lastCtrl.getEl()
|
1211
|
+
});
|
1212
|
+
}
|
1213
|
+
}
|
1214
|
+
|
1215
|
+
for (i = idx; i < parents.length; i++) {
|
1216
|
+
ctrl = parents[i];
|
1217
|
+
ctrl.fire("mouseenter", {
|
1218
|
+
target: ctrl.getEl()
|
1219
|
+
});
|
1220
|
+
}
|
1221
|
+
}
|
1222
|
+
}
|
1223
|
+
|
1224
|
+
function fixWheelEvent(e) {
|
1225
|
+
e.preventDefault();
|
1226
|
+
|
1227
|
+
if (e.type == "mousewheel") {
|
1228
|
+
e.deltaY = -1 / 40 * e.wheelDelta;
|
1229
|
+
|
1230
|
+
if (e.wheelDeltaX) {
|
1231
|
+
e.deltaX = -1 / 40 * e.wheelDeltaX;
|
1232
|
+
}
|
1233
|
+
} else {
|
1234
|
+
e.deltaX = 0;
|
1235
|
+
e.deltaY = e.detail;
|
1236
|
+
}
|
1237
|
+
|
1238
|
+
e = eventCtrl.fire("wheel", e);
|
1239
|
+
}
|
1240
|
+
|
1241
|
+
nativeEvents = eventCtrl._nativeEvents;
|
1242
|
+
if (nativeEvents) {
|
1243
|
+
// Find event root element if it exists
|
1244
|
+
parents = eventCtrl.parents().toArray();
|
1245
|
+
parents.unshift(eventCtrl);
|
1246
|
+
for (i = 0, l = parents.length; !eventRootCtrl && i < l; i++) {
|
1247
|
+
eventRootCtrl = parents[i]._eventsRoot;
|
1248
|
+
}
|
1249
|
+
|
1250
|
+
// Event root wasn't found the use the root control
|
1251
|
+
if (!eventRootCtrl) {
|
1252
|
+
eventRootCtrl = parents[parents.length - 1] || eventCtrl;
|
1253
|
+
}
|
1254
|
+
|
1255
|
+
// Set the eventsRoot property on children that didn't have it
|
1256
|
+
eventCtrl._eventsRoot = eventRootCtrl;
|
1257
|
+
for (l = i, i = 0; i < l; i++) {
|
1258
|
+
parents[i]._eventsRoot = eventRootCtrl;
|
1259
|
+
}
|
1260
|
+
|
1261
|
+
var eventRootDelegates = eventRootCtrl._delegates;
|
1262
|
+
if (!eventRootDelegates) {
|
1263
|
+
eventRootDelegates = eventRootCtrl._delegates = {};
|
1264
|
+
}
|
1265
|
+
|
1266
|
+
// Bind native event delegates
|
1267
|
+
for (name in nativeEvents) {
|
1268
|
+
if (!nativeEvents) {
|
1269
|
+
return false;
|
1270
|
+
}
|
1271
|
+
|
1272
|
+
if (name === "wheel" && !hasWheelEventSupport) {
|
1273
|
+
if (hasMouseWheelEventSupport) {
|
1274
|
+
$(eventCtrl.getEl()).on("mousewheel", fixWheelEvent);
|
1275
|
+
} else {
|
1276
|
+
$(eventCtrl.getEl()).on("DOMMouseScroll", fixWheelEvent);
|
1277
|
+
}
|
1278
|
+
|
1279
|
+
continue;
|
1280
|
+
}
|
1281
|
+
|
1282
|
+
// Special treatment for mousenter/mouseleave since these doesn't bubble
|
1283
|
+
if (name === "mouseenter" || name === "mouseleave") {
|
1284
|
+
// Fake mousenter/mouseleave
|
1285
|
+
if (!eventRootCtrl._hasMouseEnter) {
|
1286
|
+
$(eventRootCtrl.getEl()).on("mouseleave", mouseLeaveHandler).on("mouseover", mouseEnterHandler);
|
1287
|
+
eventRootCtrl._hasMouseEnter = 1;
|
1288
|
+
}
|
1289
|
+
} else if (!eventRootDelegates[name]) {
|
1290
|
+
$(eventRootCtrl.getEl()).on(name, delegate);
|
1291
|
+
eventRootDelegates[name] = true;
|
1292
|
+
}
|
1293
|
+
|
1294
|
+
// Remove the event once it's bound
|
1295
|
+
nativeEvents[name] = false;
|
1296
|
+
}
|
1297
|
+
}
|
1298
|
+
}
|
1299
|
+
|
1300
|
+
return Control;
|
1301
|
+
});
|