spiderfw 0.6.38 → 0.6.39
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/CHANGELOG +23 -0
- data/VERSION +1 -1
- data/apps/core/admin/views/admin.layout.shtml +6 -0
- data/apps/core/auth/controllers/login_controller.rb +1 -1
- data/apps/core/components/assets.rb +55 -6
- data/apps/core/components/public/bootstrap/scss/_variables.scss +5 -2
- data/apps/core/components/public/bootstrap/scss/bootstrap.css +942 -236
- data/apps/core/components/public/bootstrap/scss/responsive.css +187 -30
- data/apps/core/components/public/css/tinymce/skins/lightgray/AbsoluteLayout.less +17 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Animations.less +10 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Button.less +172 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ButtonGroup.less +71 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Checkbox.less +49 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ColorBox.less +6 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ColorButton.less +72 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ColorPicker.less +80 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ComboBox.less +39 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Container.less +9 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Content.Inline.less +4 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Content.Objects.less +166 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Content.less +27 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/CropRect.less +54 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/FieldSet.less +15 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/FitLayout.less +9 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/FloatPanel.less +69 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/FlowLayout.less +36 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Icons.Ie7.less +136 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Icons.less +180 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Iframe.less +6 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ImagePanel.less +20 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/InfoBox.less +71 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Label.less +38 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ListBox.less +26 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Menu.less +34 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/MenuBar.less +32 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/MenuButton.less +34 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/MenuItem.less +142 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Mixins.less +54 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Notification.less +144 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Panel.less +7 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Path.less +45 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Progress.less +34 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Radio.less +1 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Reset.less +32 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ResizeHandle.less +18 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Scrollable.less +44 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/SelectBox.less +6 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Slider.less +29 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Spacer.less +5 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/SplitButton.less +49 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/StackLayout.less +5 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/TabPanel.less +44 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/TextBox.less +41 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Throbber.less +19 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/TinyMCE.less +159 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/ToolTip.less +129 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Variables.less +214 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/Window.less +127 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/content.inline.min.css +1 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/content.min.css +1 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/readme.md +1 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce-small.eot +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce-small.json +1277 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce-small.svg +63 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce-small.ttf +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce-small.woff +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce.json +3381 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce.svg +129 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/img/anchor.gif +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/img/loader.gif +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/img/object.gif +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/img/trans.gif +0 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/skin.dev.less +46 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/skin.ie7.dev.less +46 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/skin.ie7.less +2542 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/skin.ie7.min.css +1 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/skin.less +2586 -0
- data/apps/core/components/public/css/tinymce/skins/lightgray/skin.min.css +1 -0
- data/apps/core/components/public/js/bootbox_2/bootbox.js +551 -0
- data/apps/core/components/public/js/jquery/jquery-ui-1.9.2/ui/i18n/jquery.ui.datepicker-it-min.js +4 -0
- data/apps/core/components/public/js/spider.js +7 -3
- data/apps/core/components/public/js/tinymce/classes/AddOnManager.js +265 -0
- data/apps/core/components/public/js/tinymce/classes/Compat.js +90 -0
- data/apps/core/components/public/js/tinymce/classes/DragDropOverrides.js +224 -0
- data/apps/core/components/public/js/tinymce/classes/Editor.js +2221 -0
- data/apps/core/components/public/js/tinymce/classes/EditorCommands.js +1028 -0
- data/apps/core/components/public/js/tinymce/classes/EditorManager.js +715 -0
- data/apps/core/components/public/js/tinymce/classes/EditorObservable.js +204 -0
- data/apps/core/components/public/js/tinymce/classes/EditorUpload.js +191 -0
- data/apps/core/components/public/js/tinymce/classes/EnterKey.js +676 -0
- data/apps/core/components/public/js/tinymce/classes/Env.js +177 -0
- data/apps/core/components/public/js/tinymce/classes/FocusManager.js +266 -0
- data/apps/core/components/public/js/tinymce/classes/ForceBlocks.js +138 -0
- data/apps/core/components/public/js/tinymce/classes/Formatter.js +2378 -0
- data/apps/core/components/public/js/tinymce/classes/LegacyInput.js +82 -0
- data/apps/core/components/public/js/tinymce/classes/Mode.js +54 -0
- data/apps/core/components/public/js/tinymce/classes/NodeChange.js +154 -0
- data/apps/core/components/public/js/tinymce/classes/NotificationManager.js +156 -0
- data/apps/core/components/public/js/tinymce/classes/Register.js +34 -0
- data/apps/core/components/public/js/tinymce/classes/SelectionOverrides.js +810 -0
- data/apps/core/components/public/js/tinymce/classes/Shortcuts.js +172 -0
- data/apps/core/components/public/js/tinymce/classes/UndoManager.js +346 -0
- data/apps/core/components/public/js/tinymce/classes/WindowManager.js +278 -0
- data/apps/core/components/public/js/tinymce/classes/caret/CaretBookmark.js +263 -0
- data/apps/core/components/public/js/tinymce/classes/caret/CaretCandidate.js +86 -0
- data/apps/core/components/public/js/tinymce/classes/caret/CaretContainer.js +151 -0
- data/apps/core/components/public/js/tinymce/classes/caret/CaretPosition.js +371 -0
- data/apps/core/components/public/js/tinymce/classes/caret/CaretUtils.js +302 -0
- data/apps/core/components/public/js/tinymce/classes/caret/CaretWalker.js +215 -0
- data/apps/core/components/public/js/tinymce/classes/caret/FakeCaret.js +192 -0
- data/apps/core/components/public/js/tinymce/classes/caret/LineUtils.js +135 -0
- data/apps/core/components/public/js/tinymce/classes/caret/LineWalker.js +166 -0
- data/apps/core/components/public/js/tinymce/classes/data/Binding.js +79 -0
- data/apps/core/components/public/js/tinymce/classes/data/ObservableArray.js +196 -0
- data/apps/core/components/public/js/tinymce/classes/data/ObservableObject.js +194 -0
- data/apps/core/components/public/js/tinymce/classes/dom/BookmarkManager.js +456 -0
- data/apps/core/components/public/js/tinymce/classes/dom/ControlSelection.js +634 -0
- data/apps/core/components/public/js/tinymce/classes/dom/DOMUtils.js +1853 -0
- data/apps/core/components/public/js/tinymce/classes/dom/Dimensions.js +64 -0
- data/apps/core/components/public/js/tinymce/classes/dom/DomQuery.js +1578 -0
- data/apps/core/components/public/js/tinymce/classes/dom/ElementUtils.js +118 -0
- data/apps/core/components/public/js/tinymce/classes/dom/EventUtils.js +583 -0
- data/apps/core/components/public/js/tinymce/classes/dom/NodePath.js +50 -0
- data/apps/core/components/public/js/tinymce/classes/dom/NodeType.js +110 -0
- data/apps/core/components/public/js/tinymce/classes/dom/Range.js +785 -0
- data/apps/core/components/public/js/tinymce/classes/dom/RangeUtils.js +628 -0
- data/apps/core/components/public/js/tinymce/classes/dom/ScriptLoader.js +254 -0
- data/apps/core/components/public/js/tinymce/classes/dom/Selection.js +1008 -0
- data/apps/core/components/public/js/tinymce/classes/dom/Serializer.js +506 -0
- data/apps/core/components/public/js/tinymce/classes/dom/Sizzle.jQuery.js +23 -0
- data/apps/core/components/public/js/tinymce/classes/dom/Sizzle.js +2039 -0
- data/apps/core/components/public/js/tinymce/classes/dom/StyleSheetLoader.js +190 -0
- data/apps/core/components/public/js/tinymce/classes/dom/TreeWalker.js +127 -0
- data/apps/core/components/public/js/tinymce/classes/dom/TridentSelection.js +508 -0
- data/apps/core/components/public/js/tinymce/classes/file/BlobCache.js +72 -0
- data/apps/core/components/public/js/tinymce/classes/file/Conversions.js +106 -0
- data/apps/core/components/public/js/tinymce/classes/file/ImageScanner.js +145 -0
- data/apps/core/components/public/js/tinymce/classes/file/Uploader.js +193 -0
- data/apps/core/components/public/js/tinymce/classes/fmt/Hooks.js +66 -0
- data/apps/core/components/public/js/tinymce/classes/fmt/Preview.js +151 -0
- data/apps/core/components/public/js/tinymce/classes/geom/ClientRect.js +136 -0
- data/apps/core/components/public/js/tinymce/classes/geom/Rect.js +214 -0
- data/apps/core/components/public/js/tinymce/classes/html/DomParser.js +822 -0
- data/apps/core/components/public/js/tinymce/classes/html/Entities.js +268 -0
- data/apps/core/components/public/js/tinymce/classes/html/Node.js +496 -0
- data/apps/core/components/public/js/tinymce/classes/html/SaxParser.js +474 -0
- data/apps/core/components/public/js/tinymce/classes/html/Schema.js +1004 -0
- data/apps/core/components/public/js/tinymce/classes/html/Serializer.js +158 -0
- data/apps/core/components/public/js/tinymce/classes/html/Styles.js +363 -0
- data/apps/core/components/public/js/tinymce/classes/html/Writer.js +199 -0
- data/apps/core/components/public/js/tinymce/classes/jquery.tinymce.js +377 -0
- data/apps/core/components/public/js/tinymce/classes/text/ExtendingChar.js +53 -0
- data/apps/core/components/public/js/tinymce/classes/text/Zwsp.js +36 -0
- data/apps/core/components/public/js/tinymce/classes/ui/AbsoluteLayout.js +63 -0
- data/apps/core/components/public/js/tinymce/classes/ui/BoxUtils.js +98 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Button.js +199 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ButtonGroup.js +62 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Checkbox.js +162 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ClassList.js +149 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Collection.js +438 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ColorBox.js +72 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ColorButton.js +124 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ColorPicker.js +206 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ComboBox.js +306 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Container.js +506 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Control.js +1301 -0
- data/apps/core/components/public/js/tinymce/classes/ui/DomUtils.js +107 -0
- data/apps/core/components/public/js/tinymce/classes/ui/DragHelper.js +144 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ElementPath.js +79 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Factory.js +105 -0
- data/apps/core/components/public/js/tinymce/classes/ui/FieldSet.js +59 -0
- data/apps/core/components/public/js/tinymce/classes/ui/FilePicker.js +85 -0
- data/apps/core/components/public/js/tinymce/classes/ui/FitLayout.js +48 -0
- data/apps/core/components/public/js/tinymce/classes/ui/FlexLayout.js +246 -0
- data/apps/core/components/public/js/tinymce/classes/ui/FloatPanel.js +409 -0
- data/apps/core/components/public/js/tinymce/classes/ui/FlowLayout.js +46 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Form.js +157 -0
- data/apps/core/components/public/js/tinymce/classes/ui/FormItem.js +56 -0
- data/apps/core/components/public/js/tinymce/classes/ui/FormatControls.js +535 -0
- data/apps/core/components/public/js/tinymce/classes/ui/GridLayout.js +233 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Iframe.js +85 -0
- data/apps/core/components/public/js/tinymce/classes/ui/InfoBox.js +93 -0
- data/apps/core/components/public/js/tinymce/classes/ui/KeyboardNavigation.js +406 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Label.js +144 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Layout.js +120 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ListBox.js +152 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Menu.js +195 -0
- data/apps/core/components/public/js/tinymce/classes/ui/MenuBar.js +33 -0
- data/apps/core/components/public/js/tinymce/classes/ui/MenuButton.js +268 -0
- data/apps/core/components/public/js/tinymce/classes/ui/MenuItem.js +336 -0
- data/apps/core/components/public/js/tinymce/classes/ui/MessageBox.js +202 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Movable.js +200 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Notification.js +154 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Panel.js +67 -0
- data/apps/core/components/public/js/tinymce/classes/ui/PanelButton.js +114 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Path.js +127 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Progress.js +81 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Radio.js +29 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ReflowQueue.js +79 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Resizable.js +68 -0
- data/apps/core/components/public/js/tinymce/classes/ui/ResizeHandle.js +86 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Scrollable.js +141 -0
- data/apps/core/components/public/js/tinymce/classes/ui/SelectBox.js +106 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Selector.js +369 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Slider.js +161 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Spacer.js +39 -0
- data/apps/core/components/public/js/tinymce/classes/ui/SplitButton.js +146 -0
- data/apps/core/components/public/js/tinymce/classes/ui/StackLayout.js +34 -0
- data/apps/core/components/public/js/tinymce/classes/ui/TabPanel.js +178 -0
- data/apps/core/components/public/js/tinymce/classes/ui/TextBox.js +208 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Throbber.js +88 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Toolbar.js +56 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Tooltip.js +73 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Widget.js +151 -0
- data/apps/core/components/public/js/tinymce/classes/ui/Window.js +474 -0
- data/apps/core/components/public/js/tinymce/classes/util/Arr.js +153 -0
- data/apps/core/components/public/js/tinymce/classes/util/Class.js +167 -0
- data/apps/core/components/public/js/tinymce/classes/util/Color.js +235 -0
- data/apps/core/components/public/js/tinymce/classes/util/Delay.js +191 -0
- data/apps/core/components/public/js/tinymce/classes/util/EventDispatcher.js +294 -0
- data/apps/core/components/public/js/tinymce/classes/util/Fun.js +87 -0
- data/apps/core/components/public/js/tinymce/classes/util/I18n.js +116 -0
- data/apps/core/components/public/js/tinymce/classes/util/JSON.js +109 -0
- data/apps/core/components/public/js/tinymce/classes/util/JSONP.js +38 -0
- data/apps/core/components/public/js/tinymce/classes/util/JSONRequest.js +110 -0
- data/apps/core/components/public/js/tinymce/classes/util/LocalStorage.js +213 -0
- data/apps/core/components/public/js/tinymce/classes/util/Observable.js +129 -0
- data/apps/core/components/public/js/tinymce/classes/util/Promise.js +200 -0
- data/apps/core/components/public/js/tinymce/classes/util/Quirks.js +1701 -0
- data/apps/core/components/public/js/tinymce/classes/util/Tools.js +442 -0
- data/apps/core/components/public/js/tinymce/classes/util/URI.js +411 -0
- data/apps/core/components/public/js/tinymce/classes/util/VK.js +37 -0
- data/apps/core/components/public/js/tinymce/classes/util/XHR.js +110 -0
- data/apps/core/components/public/js/tinymce/jquery.tinymce.min.js +1 -0
- data/apps/core/components/public/js/tinymce/langs/it.js +219 -0
- data/apps/core/components/public/js/tinymce/langs/readme.md +3 -0
- data/apps/core/components/public/js/tinymce/license.txt +504 -0
- data/apps/core/components/public/js/tinymce/plugins/advlist/plugin.js +97 -0
- data/apps/core/components/public/js/tinymce/plugins/advlist/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/anchor/plugin.js +55 -0
- data/apps/core/components/public/js/tinymce/plugins/anchor/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/autolink/plugin.js +204 -0
- data/apps/core/components/public/js/tinymce/plugins/autolink/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/autoresize/plugin.js +162 -0
- data/apps/core/components/public/js/tinymce/plugins/autoresize/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/autosave/plugin.js +165 -0
- data/apps/core/components/public/js/tinymce/plugins/autosave/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/bbcode/plugin.js +123 -0
- data/apps/core/components/public/js/tinymce/plugins/bbcode/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/charmap/plugin.js +450 -0
- data/apps/core/components/public/js/tinymce/plugins/charmap/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/code/plugin.js +60 -0
- data/apps/core/components/public/js/tinymce/plugins/code/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/codesample/classes/Dialog.js +121 -0
- data/apps/core/components/public/js/tinymce/plugins/codesample/classes/Plugin.js +95 -0
- data/apps/core/components/public/js/tinymce/plugins/codesample/classes/Prism.js +937 -0
- data/apps/core/components/public/js/tinymce/plugins/codesample/classes/Utils.js +33 -0
- data/apps/core/components/public/js/tinymce/plugins/codesample/css/prism.css +138 -0
- data/apps/core/components/public/js/tinymce/plugins/codesample/plugin.dev.js +141 -0
- data/apps/core/components/public/js/tinymce/plugins/codesample/plugin.js +1299 -0
- data/apps/core/components/public/js/tinymce/plugins/codesample/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/colorpicker/plugin.js +112 -0
- data/apps/core/components/public/js/tinymce/plugins/colorpicker/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/css/dialog.css +118 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/img/buttons.png +0 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/img/icons.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/img/items.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/img/menu_arrow.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/img/menu_check.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/img/progress.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/img/tabs.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/plugin.js +297 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/tiny_mce_popup.js +542 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/utils/editable_selects.js +70 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/utils/form_utils.js +210 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/utils/mctabs.js +164 -0
- data/apps/core/components/public/js/tinymce/plugins/compat3x/utils/validate.js +252 -0
- data/apps/core/components/public/js/tinymce/plugins/contextmenu/plugin.js +88 -0
- data/apps/core/components/public/js/tinymce/plugins/contextmenu/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/directionality/plugin.js +64 -0
- data/apps/core/components/public/js/tinymce/plugins/directionality/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-cool.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-cry.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-embarassed.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-foot-in-mouth.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-frown.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-innocent.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-kiss.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-laughing.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-money-mouth.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-sealed.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-smile.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-surprised.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-tongue-out.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-undecided.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-wink.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/img/smiley-yell.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/plugin.js +65 -0
- data/apps/core/components/public/js/tinymce/plugins/emoticons/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/example/dialog.html +8 -0
- data/apps/core/components/public/js/tinymce/plugins/example/plugin.js +68 -0
- data/apps/core/components/public/js/tinymce/plugins/example/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/example_dependency/plugin.js +22 -0
- data/apps/core/components/public/js/tinymce/plugins/example_dependency/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/fullpage/plugin.js +490 -0
- data/apps/core/components/public/js/tinymce/plugins/fullpage/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/fullscreen/plugin.js +154 -0
- data/apps/core/components/public/js/tinymce/plugins/fullscreen/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/hr/plugin.js +30 -0
- data/apps/core/components/public/js/tinymce/plugins/hr/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/image/plugin.js +630 -0
- data/apps/core/components/public/js/tinymce/plugins/image/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/config/bolt/atomic.js +6 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/config/bolt/browser.js +6 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/config/bolt/demo.js +8 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/config/bolt/prod.js +6 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/plugin.js +2668 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/src/demo/html/demo.html +16 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/src/demo/js/Demo.js +92 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/src/main/js/CropRect.js +214 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/src/main/js/Dialog.js +485 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/src/main/js/ImagePanel.js +218 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/src/main/js/Plugin.js +411 -0
- data/apps/core/components/public/js/tinymce/plugins/imagetools/src/main/js/UndoStack.js +57 -0
- data/apps/core/components/public/js/tinymce/plugins/importcss/plugin.js +227 -0
- data/apps/core/components/public/js/tinymce/plugins/importcss/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/insertdatetime/plugin.js +121 -0
- data/apps/core/components/public/js/tinymce/plugins/insertdatetime/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/layer/plugin.js +225 -0
- data/apps/core/components/public/js/tinymce/plugins/layer/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/legacyoutput/plugin.js +211 -0
- data/apps/core/components/public/js/tinymce/plugins/legacyoutput/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/link/plugin.js +403 -0
- data/apps/core/components/public/js/tinymce/plugins/link/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/lists/plugin.js +885 -0
- data/apps/core/components/public/js/tinymce/plugins/lists/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/media/moxieplayer.swf +0 -0
- data/apps/core/components/public/js/tinymce/plugins/media/plugin.js +878 -0
- data/apps/core/components/public/js/tinymce/plugins/media/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/nonbreaking/plugin.js +53 -0
- data/apps/core/components/public/js/tinymce/plugins/nonbreaking/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/noneditable/plugin.js +101 -0
- data/apps/core/components/public/js/tinymce/plugins/noneditable/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/pagebreak/plugin.js +88 -0
- data/apps/core/components/public/js/tinymce/plugins/pagebreak/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/paste/classes/Clipboard.js +672 -0
- data/apps/core/components/public/js/tinymce/plugins/paste/classes/Plugin.js +121 -0
- data/apps/core/components/public/js/tinymce/plugins/paste/classes/Quirks.js +159 -0
- data/apps/core/components/public/js/tinymce/plugins/paste/classes/Utils.js +140 -0
- data/apps/core/components/public/js/tinymce/plugins/paste/classes/WordFilter.js +500 -0
- data/apps/core/components/public/js/tinymce/plugins/paste/plugin.dev.js +142 -0
- data/apps/core/components/public/js/tinymce/plugins/paste/plugin.js +1708 -0
- data/apps/core/components/public/js/tinymce/plugins/paste/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/preview/plugin.js +88 -0
- data/apps/core/components/public/js/tinymce/plugins/preview/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/print/plugin.js +32 -0
- data/apps/core/components/public/js/tinymce/plugins/print/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/save/plugin.js +98 -0
- data/apps/core/components/public/js/tinymce/plugins/save/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/searchreplace/plugin.js +609 -0
- data/apps/core/components/public/js/tinymce/plugins/searchreplace/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/spellchecker/classes/DomTextMatcher.js +480 -0
- data/apps/core/components/public/js/tinymce/plugins/spellchecker/classes/Plugin.js +439 -0
- data/apps/core/components/public/js/tinymce/plugins/spellchecker/plugin.dev.js +139 -0
- data/apps/core/components/public/js/tinymce/plugins/spellchecker/plugin.js +1026 -0
- data/apps/core/components/public/js/tinymce/plugins/spellchecker/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/tabfocus/plugin.js +120 -0
- data/apps/core/components/public/js/tinymce/plugins/tabfocus/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/table/classes/CellSelection.js +202 -0
- data/apps/core/components/public/js/tinymce/plugins/table/classes/Dialogs.js +824 -0
- data/apps/core/components/public/js/tinymce/plugins/table/classes/Plugin.js +599 -0
- data/apps/core/components/public/js/tinymce/plugins/table/classes/Quirks.js +400 -0
- data/apps/core/components/public/js/tinymce/plugins/table/classes/ResizeBars.js +984 -0
- data/apps/core/components/public/js/tinymce/plugins/table/classes/TableGrid.js +941 -0
- data/apps/core/components/public/js/tinymce/plugins/table/classes/Utils.js +36 -0
- data/apps/core/components/public/js/tinymce/plugins/table/plugin.dev.js +142 -0
- data/apps/core/components/public/js/tinymce/plugins/table/plugin.js +4106 -0
- data/apps/core/components/public/js/tinymce/plugins/table/plugin.min.js +2 -0
- data/apps/core/components/public/js/tinymce/plugins/template/plugin.js +270 -0
- data/apps/core/components/public/js/tinymce/plugins/template/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/textcolor/plugin.js +282 -0
- data/apps/core/components/public/js/tinymce/plugins/textcolor/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/textpattern/plugin.js +268 -0
- data/apps/core/components/public/js/tinymce/plugins/textpattern/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/css/visualblocks.css +135 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/address.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/article.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/aside.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/blockquote.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/div.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/dl.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/figure.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/h1.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/h2.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/h3.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/h4.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/h5.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/h6.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/hgroup.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/ol.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/p.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/pre.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/section.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/img/ul.gif +0 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/plugin.js +86 -0
- data/apps/core/components/public/js/tinymce/plugins/visualblocks/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/visualchars/plugin.js +123 -0
- data/apps/core/components/public/js/tinymce/plugins/visualchars/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/plugins/wordcount/plugin.js +69 -0
- data/apps/core/components/public/js/tinymce/plugins/wordcount/plugin.min.js +1 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/AbsoluteLayout.less +17 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Animations.less +10 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Button.less +172 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ButtonGroup.less +71 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Checkbox.less +49 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ColorBox.less +6 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ColorButton.less +72 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ColorPicker.less +80 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ComboBox.less +39 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Container.less +9 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Content.Inline.less +4 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Content.Objects.less +166 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Content.less +27 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/CropRect.less +54 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/FieldSet.less +15 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/FitLayout.less +9 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/FloatPanel.less +69 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/FlowLayout.less +36 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Icons.Ie7.less +136 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Icons.less +180 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Iframe.less +6 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ImagePanel.less +20 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/InfoBox.less +71 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Label.less +38 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ListBox.less +26 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Menu.less +34 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/MenuBar.less +32 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/MenuButton.less +34 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/MenuItem.less +142 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Mixins.less +54 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Notification.less +144 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Panel.less +7 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Path.less +45 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Progress.less +34 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Radio.less +1 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Reset.less +32 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ResizeHandle.less +18 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Scrollable.less +44 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/SelectBox.less +6 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Slider.less +29 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Spacer.less +5 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/SplitButton.less +49 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/StackLayout.less +5 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/TabPanel.less +44 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/TextBox.less +41 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Throbber.less +19 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/TinyMCE.less +159 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/ToolTip.less +129 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Variables.less +214 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/Window.less +127 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/content.inline.min.css +1 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/content.min.css +1 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/readme.md +1 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce-small.eot +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce-small.json +1277 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce-small.svg +63 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce-small.ttf +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce-small.woff +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce.eot +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce.json +3381 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce.svg +129 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce.ttf +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/fonts/tinymce.woff +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/img/anchor.gif +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/img/loader.gif +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/img/object.gif +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/img/trans.gif +0 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/skin.dev.less +46 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/skin.ie7.dev.less +46 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/skin.ie7.less +2542 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/skin.ie7.min.css +1 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/skin.less +2586 -0
- data/apps/core/components/public/js/tinymce/skins/lightgray/skin.min.css +1 -0
- data/apps/core/components/public/js/tinymce/themes/modern/theme.js +878 -0
- data/apps/core/components/public/js/tinymce/themes/modern/theme.min.js +1 -0
- data/apps/core/components/public/js/tinymce/tinymce.dev.js +286 -0
- data/apps/core/components/public/js/tinymce/tinymce.js +45811 -0
- data/apps/core/components/public/js/tinymce/tinymce.min.js +13 -0
- data/apps/core/forms/widgets/form/form.rb +3 -1
- data/apps/core/forms/widgets/form/form.shtml +1 -0
- data/apps/core/forms/widgets/inputs/search_select/search_select.rb +1 -1
- data/apps/core/forms/widgets/inputs/select/select.rb +1 -1
- data/apps/core/forms/widgets/inputs/select/select.shtml +0 -1
- data/apps/messenger/backends/sms/skebby.rb +1 -1
- data/apps/messenger/controllers/mixins/messenger_helper.rb +23 -5
- data/lib/spiderfw/config/options/spider.rb +1 -1
- data/lib/spiderfw/controller/mixins/visual.rb +2 -0
- data/lib/spiderfw/http/adapters/rack.rb +10 -5
- data/lib/spiderfw/http/http.rb +4 -2
- data/lib/spiderfw/model/base_model.rb +4 -4
- data/lib/spiderfw/model/mappers/db_mapper.rb +4 -2
- data/lib/spiderfw/model/storage/db/adapters/mysql.rb +2 -1
- data/lib/spiderfw/model/storage/db/db_storage.rb +4 -0
- data/lib/spiderfw/spider.rb +6 -0
- data/lib/spiderfw/templates/layout.rb +1 -1
- data/lib/spiderfw/utils/monkey/object.rb +3 -0
- data/spider.gemspec +6 -2
- metadata +539 -42
- data/blueprints/.DS_Store +0 -0
@@ -0,0 +1,442 @@
|
|
1
|
+
/**
|
2
|
+
* Tools.js
|
3
|
+
*
|
4
|
+
* Released under LGPL License.
|
5
|
+
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved
|
6
|
+
*
|
7
|
+
* License: http://www.tinymce.com/license
|
8
|
+
* Contributing: http://www.tinymce.com/contributing
|
9
|
+
*/
|
10
|
+
|
11
|
+
/**
|
12
|
+
* This class contains various utlity functions. These are also exposed
|
13
|
+
* directly on the tinymce namespace.
|
14
|
+
*
|
15
|
+
* @class tinymce.util.Tools
|
16
|
+
*/
|
17
|
+
define("tinymce/util/Tools", [
|
18
|
+
"tinymce/Env",
|
19
|
+
"tinymce/util/Arr"
|
20
|
+
], function(Env, Arr) {
|
21
|
+
/**
|
22
|
+
* Removes whitespace from the beginning and end of a string.
|
23
|
+
*
|
24
|
+
* @method trim
|
25
|
+
* @param {String} s String to remove whitespace from.
|
26
|
+
* @return {String} New string with removed whitespace.
|
27
|
+
*/
|
28
|
+
var whiteSpaceRegExp = /^\s*|\s*$/g;
|
29
|
+
|
30
|
+
function trim(str) {
|
31
|
+
return (str === null || str === undefined) ? '' : ("" + str).replace(whiteSpaceRegExp, '');
|
32
|
+
}
|
33
|
+
|
34
|
+
/**
|
35
|
+
* Checks if a object is of a specific type for example an array.
|
36
|
+
*
|
37
|
+
* @method is
|
38
|
+
* @param {Object} obj Object to check type of.
|
39
|
+
* @param {string} type Optional type to check for.
|
40
|
+
* @return {Boolean} true/false if the object is of the specified type.
|
41
|
+
*/
|
42
|
+
function is(obj, type) {
|
43
|
+
if (!type) {
|
44
|
+
return obj !== undefined;
|
45
|
+
}
|
46
|
+
|
47
|
+
if (type == 'array' && Arr.isArray(obj)) {
|
48
|
+
return true;
|
49
|
+
}
|
50
|
+
|
51
|
+
return typeof obj == type;
|
52
|
+
}
|
53
|
+
|
54
|
+
/**
|
55
|
+
* Makes a name/object map out of an array with names.
|
56
|
+
*
|
57
|
+
* @method makeMap
|
58
|
+
* @param {Array/String} items Items to make map out of.
|
59
|
+
* @param {String} delim Optional delimiter to split string by.
|
60
|
+
* @param {Object} map Optional map to add items to.
|
61
|
+
* @return {Object} Name/value map of items.
|
62
|
+
*/
|
63
|
+
function makeMap(items, delim, map) {
|
64
|
+
var i;
|
65
|
+
|
66
|
+
items = items || [];
|
67
|
+
delim = delim || ',';
|
68
|
+
|
69
|
+
if (typeof items == "string") {
|
70
|
+
items = items.split(delim);
|
71
|
+
}
|
72
|
+
|
73
|
+
map = map || {};
|
74
|
+
|
75
|
+
i = items.length;
|
76
|
+
while (i--) {
|
77
|
+
map[items[i]] = {};
|
78
|
+
}
|
79
|
+
|
80
|
+
return map;
|
81
|
+
}
|
82
|
+
|
83
|
+
/**
|
84
|
+
* Creates a class, subclass or static singleton.
|
85
|
+
* More details on this method can be found in the Wiki.
|
86
|
+
*
|
87
|
+
* @method create
|
88
|
+
* @param {String} s Class name, inheritance and prefix.
|
89
|
+
* @param {Object} p Collection of methods to add to the class.
|
90
|
+
* @param {Object} root Optional root object defaults to the global window object.
|
91
|
+
* @example
|
92
|
+
* // Creates a basic class
|
93
|
+
* tinymce.create('tinymce.somepackage.SomeClass', {
|
94
|
+
* SomeClass: function() {
|
95
|
+
* // Class constructor
|
96
|
+
* },
|
97
|
+
*
|
98
|
+
* method: function() {
|
99
|
+
* // Some method
|
100
|
+
* }
|
101
|
+
* });
|
102
|
+
*
|
103
|
+
* // Creates a basic subclass class
|
104
|
+
* tinymce.create('tinymce.somepackage.SomeSubClass:tinymce.somepackage.SomeClass', {
|
105
|
+
* SomeSubClass: function() {
|
106
|
+
* // Class constructor
|
107
|
+
* this.parent(); // Call parent constructor
|
108
|
+
* },
|
109
|
+
*
|
110
|
+
* method: function() {
|
111
|
+
* // Some method
|
112
|
+
* this.parent(); // Call parent method
|
113
|
+
* },
|
114
|
+
*
|
115
|
+
* 'static': {
|
116
|
+
* staticMethod: function() {
|
117
|
+
* // Static method
|
118
|
+
* }
|
119
|
+
* }
|
120
|
+
* });
|
121
|
+
*
|
122
|
+
* // Creates a singleton/static class
|
123
|
+
* tinymce.create('static tinymce.somepackage.SomeSingletonClass', {
|
124
|
+
* method: function() {
|
125
|
+
* // Some method
|
126
|
+
* }
|
127
|
+
* });
|
128
|
+
*/
|
129
|
+
function create(s, p, root) {
|
130
|
+
var self = this, sp, ns, cn, scn, c, de = 0;
|
131
|
+
|
132
|
+
// Parse : <prefix> <class>:<super class>
|
133
|
+
s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s);
|
134
|
+
cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name
|
135
|
+
|
136
|
+
// Create namespace for new class
|
137
|
+
ns = self.createNS(s[3].replace(/\.\w+$/, ''), root);
|
138
|
+
|
139
|
+
// Class already exists
|
140
|
+
if (ns[cn]) {
|
141
|
+
return;
|
142
|
+
}
|
143
|
+
|
144
|
+
// Make pure static class
|
145
|
+
if (s[2] == 'static') {
|
146
|
+
ns[cn] = p;
|
147
|
+
|
148
|
+
if (this.onCreate) {
|
149
|
+
this.onCreate(s[2], s[3], ns[cn]);
|
150
|
+
}
|
151
|
+
|
152
|
+
return;
|
153
|
+
}
|
154
|
+
|
155
|
+
// Create default constructor
|
156
|
+
if (!p[cn]) {
|
157
|
+
p[cn] = function() {};
|
158
|
+
de = 1;
|
159
|
+
}
|
160
|
+
|
161
|
+
// Add constructor and methods
|
162
|
+
ns[cn] = p[cn];
|
163
|
+
self.extend(ns[cn].prototype, p);
|
164
|
+
|
165
|
+
// Extend
|
166
|
+
if (s[5]) {
|
167
|
+
sp = self.resolve(s[5]).prototype;
|
168
|
+
scn = s[5].match(/\.(\w+)$/i)[1]; // Class name
|
169
|
+
|
170
|
+
// Extend constructor
|
171
|
+
c = ns[cn];
|
172
|
+
if (de) {
|
173
|
+
// Add passthrough constructor
|
174
|
+
ns[cn] = function() {
|
175
|
+
return sp[scn].apply(this, arguments);
|
176
|
+
};
|
177
|
+
} else {
|
178
|
+
// Add inherit constructor
|
179
|
+
ns[cn] = function() {
|
180
|
+
this.parent = sp[scn];
|
181
|
+
return c.apply(this, arguments);
|
182
|
+
};
|
183
|
+
}
|
184
|
+
ns[cn].prototype[cn] = ns[cn];
|
185
|
+
|
186
|
+
// Add super methods
|
187
|
+
self.each(sp, function(f, n) {
|
188
|
+
ns[cn].prototype[n] = sp[n];
|
189
|
+
});
|
190
|
+
|
191
|
+
// Add overridden methods
|
192
|
+
self.each(p, function(f, n) {
|
193
|
+
// Extend methods if needed
|
194
|
+
if (sp[n]) {
|
195
|
+
ns[cn].prototype[n] = function() {
|
196
|
+
this.parent = sp[n];
|
197
|
+
return f.apply(this, arguments);
|
198
|
+
};
|
199
|
+
} else {
|
200
|
+
if (n != cn) {
|
201
|
+
ns[cn].prototype[n] = f;
|
202
|
+
}
|
203
|
+
}
|
204
|
+
});
|
205
|
+
}
|
206
|
+
|
207
|
+
// Add static methods
|
208
|
+
/*jshint sub:true*/
|
209
|
+
/*eslint dot-notation:0*/
|
210
|
+
self.each(p['static'], function(f, n) {
|
211
|
+
ns[cn][n] = f;
|
212
|
+
});
|
213
|
+
}
|
214
|
+
|
215
|
+
function extend(obj, ext) {
|
216
|
+
var i, l, name, args = arguments, value;
|
217
|
+
|
218
|
+
for (i = 1, l = args.length; i < l; i++) {
|
219
|
+
ext = args[i];
|
220
|
+
for (name in ext) {
|
221
|
+
if (ext.hasOwnProperty(name)) {
|
222
|
+
value = ext[name];
|
223
|
+
|
224
|
+
if (value !== undefined) {
|
225
|
+
obj[name] = value;
|
226
|
+
}
|
227
|
+
}
|
228
|
+
}
|
229
|
+
}
|
230
|
+
|
231
|
+
return obj;
|
232
|
+
}
|
233
|
+
|
234
|
+
/**
|
235
|
+
* Executed the specified function for each item in a object tree.
|
236
|
+
*
|
237
|
+
* @method walk
|
238
|
+
* @param {Object} o Object tree to walk though.
|
239
|
+
* @param {function} f Function to call for each item.
|
240
|
+
* @param {String} n Optional name of collection inside the objects to walk for example childNodes.
|
241
|
+
* @param {String} s Optional scope to execute the function in.
|
242
|
+
*/
|
243
|
+
function walk(o, f, n, s) {
|
244
|
+
s = s || this;
|
245
|
+
|
246
|
+
if (o) {
|
247
|
+
if (n) {
|
248
|
+
o = o[n];
|
249
|
+
}
|
250
|
+
|
251
|
+
Arr.each(o, function(o, i) {
|
252
|
+
if (f.call(s, o, i, n) === false) {
|
253
|
+
return false;
|
254
|
+
}
|
255
|
+
|
256
|
+
walk(o, f, n, s);
|
257
|
+
});
|
258
|
+
}
|
259
|
+
}
|
260
|
+
|
261
|
+
/**
|
262
|
+
* Creates a namespace on a specific object.
|
263
|
+
*
|
264
|
+
* @method createNS
|
265
|
+
* @param {String} n Namespace to create for example a.b.c.d.
|
266
|
+
* @param {Object} o Optional object to add namespace to, defaults to window.
|
267
|
+
* @return {Object} New namespace object the last item in path.
|
268
|
+
* @example
|
269
|
+
* // Create some namespace
|
270
|
+
* tinymce.createNS('tinymce.somepackage.subpackage');
|
271
|
+
*
|
272
|
+
* // Add a singleton
|
273
|
+
* var tinymce.somepackage.subpackage.SomeSingleton = {
|
274
|
+
* method: function() {
|
275
|
+
* // Some method
|
276
|
+
* }
|
277
|
+
* };
|
278
|
+
*/
|
279
|
+
function createNS(n, o) {
|
280
|
+
var i, v;
|
281
|
+
|
282
|
+
o = o || window;
|
283
|
+
|
284
|
+
n = n.split('.');
|
285
|
+
for (i = 0; i < n.length; i++) {
|
286
|
+
v = n[i];
|
287
|
+
|
288
|
+
if (!o[v]) {
|
289
|
+
o[v] = {};
|
290
|
+
}
|
291
|
+
|
292
|
+
o = o[v];
|
293
|
+
}
|
294
|
+
|
295
|
+
return o;
|
296
|
+
}
|
297
|
+
|
298
|
+
/**
|
299
|
+
* Resolves a string and returns the object from a specific structure.
|
300
|
+
*
|
301
|
+
* @method resolve
|
302
|
+
* @param {String} n Path to resolve for example a.b.c.d.
|
303
|
+
* @param {Object} o Optional object to search though, defaults to window.
|
304
|
+
* @return {Object} Last object in path or null if it couldn't be resolved.
|
305
|
+
* @example
|
306
|
+
* // Resolve a path into an object reference
|
307
|
+
* var obj = tinymce.resolve('a.b.c.d');
|
308
|
+
*/
|
309
|
+
function resolve(n, o) {
|
310
|
+
var i, l;
|
311
|
+
|
312
|
+
o = o || window;
|
313
|
+
|
314
|
+
n = n.split('.');
|
315
|
+
for (i = 0, l = n.length; i < l; i++) {
|
316
|
+
o = o[n[i]];
|
317
|
+
|
318
|
+
if (!o) {
|
319
|
+
break;
|
320
|
+
}
|
321
|
+
}
|
322
|
+
|
323
|
+
return o;
|
324
|
+
}
|
325
|
+
|
326
|
+
/**
|
327
|
+
* Splits a string but removes the whitespace before and after each value.
|
328
|
+
*
|
329
|
+
* @method explode
|
330
|
+
* @param {string} s String to split.
|
331
|
+
* @param {string} d Delimiter to split by.
|
332
|
+
* @example
|
333
|
+
* // Split a string into an array with a,b,c
|
334
|
+
* var arr = tinymce.explode('a, b, c');
|
335
|
+
*/
|
336
|
+
function explode(s, d) {
|
337
|
+
if (!s || is(s, 'array')) {
|
338
|
+
return s;
|
339
|
+
}
|
340
|
+
|
341
|
+
return Arr.map(s.split(d || ','), trim);
|
342
|
+
}
|
343
|
+
|
344
|
+
function _addCacheSuffix(url) {
|
345
|
+
var cacheSuffix = Env.cacheSuffix;
|
346
|
+
|
347
|
+
if (cacheSuffix) {
|
348
|
+
url += (url.indexOf('?') === -1 ? '?' : '&') + cacheSuffix;
|
349
|
+
}
|
350
|
+
|
351
|
+
return url;
|
352
|
+
}
|
353
|
+
|
354
|
+
return {
|
355
|
+
trim: trim,
|
356
|
+
|
357
|
+
/**
|
358
|
+
* Returns true/false if the object is an array or not.
|
359
|
+
*
|
360
|
+
* @method isArray
|
361
|
+
* @param {Object} obj Object to check.
|
362
|
+
* @return {boolean} true/false state if the object is an array or not.
|
363
|
+
*/
|
364
|
+
isArray: Arr.isArray,
|
365
|
+
|
366
|
+
is: is,
|
367
|
+
|
368
|
+
/**
|
369
|
+
* Converts the specified object into a real JavaScript array.
|
370
|
+
*
|
371
|
+
* @method toArray
|
372
|
+
* @param {Object} obj Object to convert into array.
|
373
|
+
* @return {Array} Array object based in input.
|
374
|
+
*/
|
375
|
+
toArray: Arr.toArray,
|
376
|
+
makeMap: makeMap,
|
377
|
+
|
378
|
+
/**
|
379
|
+
* Performs an iteration of all items in a collection such as an object or array. This method will execure the
|
380
|
+
* callback function for each item in the collection, if the callback returns false the iteration will terminate.
|
381
|
+
* The callback has the following format: cb(value, key_or_index).
|
382
|
+
*
|
383
|
+
* @method each
|
384
|
+
* @param {Object} o Collection to iterate.
|
385
|
+
* @param {function} cb Callback function to execute for each item.
|
386
|
+
* @param {Object} s Optional scope to execute the callback in.
|
387
|
+
* @example
|
388
|
+
* // Iterate an array
|
389
|
+
* tinymce.each([1,2,3], function(v, i) {
|
390
|
+
* console.debug("Value: " + v + ", Index: " + i);
|
391
|
+
* });
|
392
|
+
*
|
393
|
+
* // Iterate an object
|
394
|
+
* tinymce.each({a: 1, b: 2, c: 3], function(v, k) {
|
395
|
+
* console.debug("Value: " + v + ", Key: " + k);
|
396
|
+
* });
|
397
|
+
*/
|
398
|
+
each: Arr.each,
|
399
|
+
|
400
|
+
/**
|
401
|
+
* Creates a new array by the return value of each iteration function call. This enables you to convert
|
402
|
+
* one array list into another.
|
403
|
+
*
|
404
|
+
* @method map
|
405
|
+
* @param {Array} array Array of items to iterate.
|
406
|
+
* @param {function} callback Function to call for each item. It's return value will be the new value.
|
407
|
+
* @return {Array} Array with new values based on function return values.
|
408
|
+
*/
|
409
|
+
map: Arr.map,
|
410
|
+
|
411
|
+
/**
|
412
|
+
* Filters out items from the input array by calling the specified function for each item.
|
413
|
+
* If the function returns false the item will be excluded if it returns true it will be included.
|
414
|
+
*
|
415
|
+
* @method grep
|
416
|
+
* @param {Array} a Array of items to loop though.
|
417
|
+
* @param {function} f Function to call for each item. Include/exclude depends on it's return value.
|
418
|
+
* @return {Array} New array with values imported and filtered based in input.
|
419
|
+
* @example
|
420
|
+
* // Filter out some items, this will return an array with 4 and 5
|
421
|
+
* var items = tinymce.grep([1,2,3,4,5], function(v) {return v > 3;});
|
422
|
+
*/
|
423
|
+
grep: Arr.filter,
|
424
|
+
|
425
|
+
/**
|
426
|
+
* Returns true/false if the object is an array or not.
|
427
|
+
*
|
428
|
+
* @method isArray
|
429
|
+
* @param {Object} obj Object to check.
|
430
|
+
* @return {boolean} true/false state if the object is an array or not.
|
431
|
+
*/
|
432
|
+
inArray: Arr.indexOf,
|
433
|
+
|
434
|
+
extend: extend,
|
435
|
+
create: create,
|
436
|
+
walk: walk,
|
437
|
+
createNS: createNS,
|
438
|
+
resolve: resolve,
|
439
|
+
explode: explode,
|
440
|
+
_addCacheSuffix: _addCacheSuffix
|
441
|
+
};
|
442
|
+
});
|
@@ -0,0 +1,411 @@
|
|
1
|
+
/**
|
2
|
+
* URI.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 handles parsing, modification and serialization of URI/URL strings.
|
13
|
+
* @class tinymce.util.URI
|
14
|
+
*/
|
15
|
+
define("tinymce/util/URI", [
|
16
|
+
"tinymce/util/Tools"
|
17
|
+
], function(Tools) {
|
18
|
+
var each = Tools.each, trim = Tools.trim;
|
19
|
+
var queryParts = "source protocol authority userInfo user password host port relative path directory file query anchor".split(' ');
|
20
|
+
var DEFAULT_PORTS = {
|
21
|
+
'ftp': 21,
|
22
|
+
'http': 80,
|
23
|
+
'https': 443,
|
24
|
+
'mailto': 25
|
25
|
+
};
|
26
|
+
|
27
|
+
/**
|
28
|
+
* Constructs a new URI instance.
|
29
|
+
*
|
30
|
+
* @constructor
|
31
|
+
* @method URI
|
32
|
+
* @param {String} url URI string to parse.
|
33
|
+
* @param {Object} settings Optional settings object.
|
34
|
+
*/
|
35
|
+
function URI(url, settings) {
|
36
|
+
var self = this, baseUri, base_url;
|
37
|
+
|
38
|
+
url = trim(url);
|
39
|
+
settings = self.settings = settings || {};
|
40
|
+
baseUri = settings.base_uri;
|
41
|
+
|
42
|
+
// Strange app protocol that isn't http/https or local anchor
|
43
|
+
// For example: mailto,skype,tel etc.
|
44
|
+
if (/^([\w\-]+):([^\/]{2})/i.test(url) || /^\s*#/.test(url)) {
|
45
|
+
self.source = url;
|
46
|
+
return;
|
47
|
+
}
|
48
|
+
|
49
|
+
var isProtocolRelative = url.indexOf('//') === 0;
|
50
|
+
|
51
|
+
// Absolute path with no host, fake host and protocol
|
52
|
+
if (url.indexOf('/') === 0 && !isProtocolRelative) {
|
53
|
+
url = (baseUri ? baseUri.protocol || 'http' : 'http') + '://mce_host' + url;
|
54
|
+
}
|
55
|
+
|
56
|
+
// Relative path http:// or protocol relative //path
|
57
|
+
if (!/^[\w\-]*:?\/\//.test(url)) {
|
58
|
+
base_url = settings.base_uri ? settings.base_uri.path : new URI(location.href).directory;
|
59
|
+
if (settings.base_uri.protocol === "") {
|
60
|
+
url = '//mce_host' + self.toAbsPath(base_url, url);
|
61
|
+
} else {
|
62
|
+
url = /([^#?]*)([#?]?.*)/.exec(url);
|
63
|
+
url = ((baseUri && baseUri.protocol) || 'http') + '://mce_host' + self.toAbsPath(base_url, url[1]) + url[2];
|
64
|
+
}
|
65
|
+
}
|
66
|
+
|
67
|
+
// Parse URL (Credits goes to Steave, http://blog.stevenlevithan.com/archives/parseuri)
|
68
|
+
url = url.replace(/@@/g, '(mce_at)'); // Zope 3 workaround, they use @@something
|
69
|
+
|
70
|
+
/*jshint maxlen: 255 */
|
71
|
+
/*eslint max-len: 0 */
|
72
|
+
url = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(url);
|
73
|
+
|
74
|
+
each(queryParts, function(v, i) {
|
75
|
+
var part = url[i];
|
76
|
+
|
77
|
+
// Zope 3 workaround, they use @@something
|
78
|
+
if (part) {
|
79
|
+
part = part.replace(/\(mce_at\)/g, '@@');
|
80
|
+
}
|
81
|
+
|
82
|
+
self[v] = part;
|
83
|
+
});
|
84
|
+
|
85
|
+
if (baseUri) {
|
86
|
+
if (!self.protocol) {
|
87
|
+
self.protocol = baseUri.protocol;
|
88
|
+
}
|
89
|
+
|
90
|
+
if (!self.userInfo) {
|
91
|
+
self.userInfo = baseUri.userInfo;
|
92
|
+
}
|
93
|
+
|
94
|
+
if (!self.port && self.host === 'mce_host') {
|
95
|
+
self.port = baseUri.port;
|
96
|
+
}
|
97
|
+
|
98
|
+
if (!self.host || self.host === 'mce_host') {
|
99
|
+
self.host = baseUri.host;
|
100
|
+
}
|
101
|
+
|
102
|
+
self.source = '';
|
103
|
+
}
|
104
|
+
|
105
|
+
if (isProtocolRelative) {
|
106
|
+
self.protocol = '';
|
107
|
+
}
|
108
|
+
|
109
|
+
//t.path = t.path || '/';
|
110
|
+
}
|
111
|
+
|
112
|
+
URI.prototype = {
|
113
|
+
/**
|
114
|
+
* Sets the internal path part of the URI.
|
115
|
+
*
|
116
|
+
* @method setPath
|
117
|
+
* @param {string} path Path string to set.
|
118
|
+
*/
|
119
|
+
setPath: function(path) {
|
120
|
+
var self = this;
|
121
|
+
|
122
|
+
path = /^(.*?)\/?(\w+)?$/.exec(path);
|
123
|
+
|
124
|
+
// Update path parts
|
125
|
+
self.path = path[0];
|
126
|
+
self.directory = path[1];
|
127
|
+
self.file = path[2];
|
128
|
+
|
129
|
+
// Rebuild source
|
130
|
+
self.source = '';
|
131
|
+
self.getURI();
|
132
|
+
},
|
133
|
+
|
134
|
+
/**
|
135
|
+
* Converts the specified URI into a relative URI based on the current URI instance location.
|
136
|
+
*
|
137
|
+
* @method toRelative
|
138
|
+
* @param {String} uri URI to convert into a relative path/URI.
|
139
|
+
* @return {String} Relative URI from the point specified in the current URI instance.
|
140
|
+
* @example
|
141
|
+
* // Converts an absolute URL to an relative URL url will be somedir/somefile.htm
|
142
|
+
* var url = new tinymce.util.URI('http://www.site.com/dir/').toRelative('http://www.site.com/dir/somedir/somefile.htm');
|
143
|
+
*/
|
144
|
+
toRelative: function(uri) {
|
145
|
+
var self = this, output;
|
146
|
+
|
147
|
+
if (uri === "./") {
|
148
|
+
return uri;
|
149
|
+
}
|
150
|
+
|
151
|
+
uri = new URI(uri, {base_uri: self});
|
152
|
+
|
153
|
+
// Not on same domain/port or protocol
|
154
|
+
if ((uri.host != 'mce_host' && self.host != uri.host && uri.host) || self.port != uri.port ||
|
155
|
+
(self.protocol != uri.protocol && uri.protocol !== "")) {
|
156
|
+
return uri.getURI();
|
157
|
+
}
|
158
|
+
|
159
|
+
var tu = self.getURI(), uu = uri.getURI();
|
160
|
+
|
161
|
+
// Allow usage of the base_uri when relative_urls = true
|
162
|
+
if (tu == uu || (tu.charAt(tu.length - 1) == "/" && tu.substr(0, tu.length - 1) == uu)) {
|
163
|
+
return tu;
|
164
|
+
}
|
165
|
+
|
166
|
+
output = self.toRelPath(self.path, uri.path);
|
167
|
+
|
168
|
+
// Add query
|
169
|
+
if (uri.query) {
|
170
|
+
output += '?' + uri.query;
|
171
|
+
}
|
172
|
+
|
173
|
+
// Add anchor
|
174
|
+
if (uri.anchor) {
|
175
|
+
output += '#' + uri.anchor;
|
176
|
+
}
|
177
|
+
|
178
|
+
return output;
|
179
|
+
},
|
180
|
+
|
181
|
+
/**
|
182
|
+
* Converts the specified URI into a absolute URI based on the current URI instance location.
|
183
|
+
*
|
184
|
+
* @method toAbsolute
|
185
|
+
* @param {String} uri URI to convert into a relative path/URI.
|
186
|
+
* @param {Boolean} noHost No host and protocol prefix.
|
187
|
+
* @return {String} Absolute URI from the point specified in the current URI instance.
|
188
|
+
* @example
|
189
|
+
* // Converts an relative URL to an absolute URL url will be http://www.site.com/dir/somedir/somefile.htm
|
190
|
+
* var url = new tinymce.util.URI('http://www.site.com/dir/').toAbsolute('somedir/somefile.htm');
|
191
|
+
*/
|
192
|
+
toAbsolute: function(uri, noHost) {
|
193
|
+
uri = new URI(uri, {base_uri: this});
|
194
|
+
|
195
|
+
return uri.getURI(noHost && this.isSameOrigin(uri));
|
196
|
+
},
|
197
|
+
|
198
|
+
/**
|
199
|
+
* Determine whether the given URI has the same origin as this URI. Based on RFC-6454.
|
200
|
+
* Supports default ports for protocols listed in DEFAULT_PORTS. Unsupported protocols will fail safe: they
|
201
|
+
* won't match, if the port specifications differ.
|
202
|
+
*
|
203
|
+
* @method isSameOrigin
|
204
|
+
* @param {tinymce.util.URI} uri Uri instance to compare.
|
205
|
+
* @returns {Boolean} True if the origins are the same.
|
206
|
+
*/
|
207
|
+
isSameOrigin: function(uri) {
|
208
|
+
if (this.host == uri.host && this.protocol == uri.protocol) {
|
209
|
+
if (this.port == uri.port) {
|
210
|
+
return true;
|
211
|
+
}
|
212
|
+
|
213
|
+
var defaultPort = DEFAULT_PORTS[this.protocol];
|
214
|
+
if (defaultPort && ((this.port || defaultPort) == (uri.port || defaultPort))) {
|
215
|
+
return true;
|
216
|
+
}
|
217
|
+
}
|
218
|
+
|
219
|
+
return false;
|
220
|
+
},
|
221
|
+
|
222
|
+
/**
|
223
|
+
* Converts a absolute path into a relative path.
|
224
|
+
*
|
225
|
+
* @method toRelPath
|
226
|
+
* @param {String} base Base point to convert the path from.
|
227
|
+
* @param {String} path Absolute path to convert into a relative path.
|
228
|
+
*/
|
229
|
+
toRelPath: function(base, path) {
|
230
|
+
var items, breakPoint = 0, out = '', i, l;
|
231
|
+
|
232
|
+
// Split the paths
|
233
|
+
base = base.substring(0, base.lastIndexOf('/'));
|
234
|
+
base = base.split('/');
|
235
|
+
items = path.split('/');
|
236
|
+
|
237
|
+
if (base.length >= items.length) {
|
238
|
+
for (i = 0, l = base.length; i < l; i++) {
|
239
|
+
if (i >= items.length || base[i] != items[i]) {
|
240
|
+
breakPoint = i + 1;
|
241
|
+
break;
|
242
|
+
}
|
243
|
+
}
|
244
|
+
}
|
245
|
+
|
246
|
+
if (base.length < items.length) {
|
247
|
+
for (i = 0, l = items.length; i < l; i++) {
|
248
|
+
if (i >= base.length || base[i] != items[i]) {
|
249
|
+
breakPoint = i + 1;
|
250
|
+
break;
|
251
|
+
}
|
252
|
+
}
|
253
|
+
}
|
254
|
+
|
255
|
+
if (breakPoint === 1) {
|
256
|
+
return path;
|
257
|
+
}
|
258
|
+
|
259
|
+
for (i = 0, l = base.length - (breakPoint - 1); i < l; i++) {
|
260
|
+
out += "../";
|
261
|
+
}
|
262
|
+
|
263
|
+
for (i = breakPoint - 1, l = items.length; i < l; i++) {
|
264
|
+
if (i != breakPoint - 1) {
|
265
|
+
out += "/" + items[i];
|
266
|
+
} else {
|
267
|
+
out += items[i];
|
268
|
+
}
|
269
|
+
}
|
270
|
+
|
271
|
+
return out;
|
272
|
+
},
|
273
|
+
|
274
|
+
/**
|
275
|
+
* Converts a relative path into a absolute path.
|
276
|
+
*
|
277
|
+
* @method toAbsPath
|
278
|
+
* @param {String} base Base point to convert the path from.
|
279
|
+
* @param {String} path Relative path to convert into an absolute path.
|
280
|
+
*/
|
281
|
+
toAbsPath: function(base, path) {
|
282
|
+
var i, nb = 0, o = [], tr, outPath;
|
283
|
+
|
284
|
+
// Split paths
|
285
|
+
tr = /\/$/.test(path) ? '/' : '';
|
286
|
+
base = base.split('/');
|
287
|
+
path = path.split('/');
|
288
|
+
|
289
|
+
// Remove empty chunks
|
290
|
+
each(base, function(k) {
|
291
|
+
if (k) {
|
292
|
+
o.push(k);
|
293
|
+
}
|
294
|
+
});
|
295
|
+
|
296
|
+
base = o;
|
297
|
+
|
298
|
+
// Merge relURLParts chunks
|
299
|
+
for (i = path.length - 1, o = []; i >= 0; i--) {
|
300
|
+
// Ignore empty or .
|
301
|
+
if (path[i].length === 0 || path[i] === ".") {
|
302
|
+
continue;
|
303
|
+
}
|
304
|
+
|
305
|
+
// Is parent
|
306
|
+
if (path[i] === '..') {
|
307
|
+
nb++;
|
308
|
+
continue;
|
309
|
+
}
|
310
|
+
|
311
|
+
// Move up
|
312
|
+
if (nb > 0) {
|
313
|
+
nb--;
|
314
|
+
continue;
|
315
|
+
}
|
316
|
+
|
317
|
+
o.push(path[i]);
|
318
|
+
}
|
319
|
+
|
320
|
+
i = base.length - nb;
|
321
|
+
|
322
|
+
// If /a/b/c or /
|
323
|
+
if (i <= 0) {
|
324
|
+
outPath = o.reverse().join('/');
|
325
|
+
} else {
|
326
|
+
outPath = base.slice(0, i).join('/') + '/' + o.reverse().join('/');
|
327
|
+
}
|
328
|
+
|
329
|
+
// Add front / if it's needed
|
330
|
+
if (outPath.indexOf('/') !== 0) {
|
331
|
+
outPath = '/' + outPath;
|
332
|
+
}
|
333
|
+
|
334
|
+
// Add traling / if it's needed
|
335
|
+
if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) {
|
336
|
+
outPath += tr;
|
337
|
+
}
|
338
|
+
|
339
|
+
return outPath;
|
340
|
+
},
|
341
|
+
|
342
|
+
/**
|
343
|
+
* Returns the full URI of the internal structure.
|
344
|
+
*
|
345
|
+
* @method getURI
|
346
|
+
* @param {Boolean} noProtoHost Optional no host and protocol part. Defaults to false.
|
347
|
+
*/
|
348
|
+
getURI: function(noProtoHost) {
|
349
|
+
var s, self = this;
|
350
|
+
|
351
|
+
// Rebuild source
|
352
|
+
if (!self.source || noProtoHost) {
|
353
|
+
s = '';
|
354
|
+
|
355
|
+
if (!noProtoHost) {
|
356
|
+
if (self.protocol) {
|
357
|
+
s += self.protocol + '://';
|
358
|
+
} else {
|
359
|
+
s += '//';
|
360
|
+
}
|
361
|
+
|
362
|
+
if (self.userInfo) {
|
363
|
+
s += self.userInfo + '@';
|
364
|
+
}
|
365
|
+
|
366
|
+
if (self.host) {
|
367
|
+
s += self.host;
|
368
|
+
}
|
369
|
+
|
370
|
+
if (self.port) {
|
371
|
+
s += ':' + self.port;
|
372
|
+
}
|
373
|
+
}
|
374
|
+
|
375
|
+
if (self.path) {
|
376
|
+
s += self.path;
|
377
|
+
}
|
378
|
+
|
379
|
+
if (self.query) {
|
380
|
+
s += '?' + self.query;
|
381
|
+
}
|
382
|
+
|
383
|
+
if (self.anchor) {
|
384
|
+
s += '#' + self.anchor;
|
385
|
+
}
|
386
|
+
|
387
|
+
self.source = s;
|
388
|
+
}
|
389
|
+
|
390
|
+
return self.source;
|
391
|
+
}
|
392
|
+
};
|
393
|
+
|
394
|
+
URI.parseDataUri = function(uri) {
|
395
|
+
var type, matches;
|
396
|
+
|
397
|
+
uri = decodeURIComponent(uri).split(',');
|
398
|
+
|
399
|
+
matches = /data:([^;]+)/.exec(uri[0]);
|
400
|
+
if (matches) {
|
401
|
+
type = matches[1];
|
402
|
+
}
|
403
|
+
|
404
|
+
return {
|
405
|
+
type: type,
|
406
|
+
data: uri[1]
|
407
|
+
};
|
408
|
+
};
|
409
|
+
|
410
|
+
return URI;
|
411
|
+
});
|