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,1026 @@
|
|
1
|
+
/**
|
2
|
+
* Compiled inline version. (Library mode)
|
3
|
+
*/
|
4
|
+
|
5
|
+
/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */
|
6
|
+
/*globals $code */
|
7
|
+
|
8
|
+
(function(exports, undefined) {
|
9
|
+
"use strict";
|
10
|
+
|
11
|
+
var modules = {};
|
12
|
+
|
13
|
+
function require(ids, callback) {
|
14
|
+
var module, defs = [];
|
15
|
+
|
16
|
+
for (var i = 0; i < ids.length; ++i) {
|
17
|
+
module = modules[ids[i]] || resolve(ids[i]);
|
18
|
+
if (!module) {
|
19
|
+
throw 'module definition dependecy not found: ' + ids[i];
|
20
|
+
}
|
21
|
+
|
22
|
+
defs.push(module);
|
23
|
+
}
|
24
|
+
|
25
|
+
callback.apply(null, defs);
|
26
|
+
}
|
27
|
+
|
28
|
+
function define(id, dependencies, definition) {
|
29
|
+
if (typeof id !== 'string') {
|
30
|
+
throw 'invalid module definition, module id must be defined and be a string';
|
31
|
+
}
|
32
|
+
|
33
|
+
if (dependencies === undefined) {
|
34
|
+
throw 'invalid module definition, dependencies must be specified';
|
35
|
+
}
|
36
|
+
|
37
|
+
if (definition === undefined) {
|
38
|
+
throw 'invalid module definition, definition function must be specified';
|
39
|
+
}
|
40
|
+
|
41
|
+
require(dependencies, function() {
|
42
|
+
modules[id] = definition.apply(null, arguments);
|
43
|
+
});
|
44
|
+
}
|
45
|
+
|
46
|
+
function defined(id) {
|
47
|
+
return !!modules[id];
|
48
|
+
}
|
49
|
+
|
50
|
+
function resolve(id) {
|
51
|
+
var target = exports;
|
52
|
+
var fragments = id.split(/[.\/]/);
|
53
|
+
|
54
|
+
for (var fi = 0; fi < fragments.length; ++fi) {
|
55
|
+
if (!target[fragments[fi]]) {
|
56
|
+
return;
|
57
|
+
}
|
58
|
+
|
59
|
+
target = target[fragments[fi]];
|
60
|
+
}
|
61
|
+
|
62
|
+
return target;
|
63
|
+
}
|
64
|
+
|
65
|
+
function expose(ids) {
|
66
|
+
var i, target, id, fragments, privateModules;
|
67
|
+
|
68
|
+
for (i = 0; i < ids.length; i++) {
|
69
|
+
target = exports;
|
70
|
+
id = ids[i];
|
71
|
+
fragments = id.split(/[.\/]/);
|
72
|
+
|
73
|
+
for (var fi = 0; fi < fragments.length - 1; ++fi) {
|
74
|
+
if (target[fragments[fi]] === undefined) {
|
75
|
+
target[fragments[fi]] = {};
|
76
|
+
}
|
77
|
+
|
78
|
+
target = target[fragments[fi]];
|
79
|
+
}
|
80
|
+
|
81
|
+
target[fragments[fragments.length - 1]] = modules[id];
|
82
|
+
}
|
83
|
+
|
84
|
+
// Expose private modules for unit tests
|
85
|
+
if (exports.AMDLC_TESTS) {
|
86
|
+
privateModules = exports.privateModules || {};
|
87
|
+
|
88
|
+
for (id in modules) {
|
89
|
+
privateModules[id] = modules[id];
|
90
|
+
}
|
91
|
+
|
92
|
+
for (i = 0; i < ids.length; i++) {
|
93
|
+
delete privateModules[ids[i]];
|
94
|
+
}
|
95
|
+
|
96
|
+
exports.privateModules = privateModules;
|
97
|
+
}
|
98
|
+
}
|
99
|
+
|
100
|
+
// Included from: js/tinymce/plugins/spellchecker/classes/DomTextMatcher.js
|
101
|
+
|
102
|
+
/**
|
103
|
+
* DomTextMatcher.js
|
104
|
+
*
|
105
|
+
* Released under LGPL License.
|
106
|
+
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved
|
107
|
+
*
|
108
|
+
* License: http://www.tinymce.com/license
|
109
|
+
* Contributing: http://www.tinymce.com/contributing
|
110
|
+
*/
|
111
|
+
|
112
|
+
/*eslint no-labels:0, no-constant-condition: 0 */
|
113
|
+
|
114
|
+
/**
|
115
|
+
* This class logic for filtering text and matching words.
|
116
|
+
*
|
117
|
+
* @class tinymce.spellcheckerplugin.TextFilter
|
118
|
+
* @private
|
119
|
+
*/
|
120
|
+
define("tinymce/spellcheckerplugin/DomTextMatcher", [], function() {
|
121
|
+
function isContentEditableFalse(node) {
|
122
|
+
return node && node.nodeType == 1 && node.contentEditable === "false";
|
123
|
+
}
|
124
|
+
|
125
|
+
// Based on work developed by: James Padolsey http://james.padolsey.com
|
126
|
+
// released under UNLICENSE that is compatible with LGPL
|
127
|
+
// TODO: Handle contentEditable edgecase:
|
128
|
+
// <p>text<span contentEditable="false">text<span contentEditable="true">text</span>text</span>text</p>
|
129
|
+
return function(node, editor) {
|
130
|
+
var m, matches = [], text, dom = editor.dom;
|
131
|
+
var blockElementsMap, hiddenTextElementsMap, shortEndedElementsMap;
|
132
|
+
|
133
|
+
blockElementsMap = editor.schema.getBlockElements(); // H1-H6, P, TD etc
|
134
|
+
hiddenTextElementsMap = editor.schema.getWhiteSpaceElements(); // TEXTAREA, PRE, STYLE, SCRIPT
|
135
|
+
shortEndedElementsMap = editor.schema.getShortEndedElements(); // BR, IMG, INPUT
|
136
|
+
|
137
|
+
function createMatch(m, data) {
|
138
|
+
if (!m[0]) {
|
139
|
+
throw 'findAndReplaceDOMText cannot handle zero-length matches';
|
140
|
+
}
|
141
|
+
|
142
|
+
return {
|
143
|
+
start: m.index,
|
144
|
+
end: m.index + m[0].length,
|
145
|
+
text: m[0],
|
146
|
+
data: data
|
147
|
+
};
|
148
|
+
}
|
149
|
+
|
150
|
+
function getText(node) {
|
151
|
+
var txt;
|
152
|
+
|
153
|
+
if (node.nodeType === 3) {
|
154
|
+
return node.data;
|
155
|
+
}
|
156
|
+
|
157
|
+
if (hiddenTextElementsMap[node.nodeName] && !blockElementsMap[node.nodeName]) {
|
158
|
+
return '';
|
159
|
+
}
|
160
|
+
|
161
|
+
if (isContentEditableFalse(node)) {
|
162
|
+
return '\n';
|
163
|
+
}
|
164
|
+
|
165
|
+
txt = '';
|
166
|
+
|
167
|
+
if (blockElementsMap[node.nodeName] || shortEndedElementsMap[node.nodeName]) {
|
168
|
+
txt += '\n';
|
169
|
+
}
|
170
|
+
|
171
|
+
if ((node = node.firstChild)) {
|
172
|
+
do {
|
173
|
+
txt += getText(node);
|
174
|
+
} while ((node = node.nextSibling));
|
175
|
+
}
|
176
|
+
|
177
|
+
return txt;
|
178
|
+
}
|
179
|
+
|
180
|
+
function stepThroughMatches(node, matches, replaceFn) {
|
181
|
+
var startNode, endNode, startNodeIndex,
|
182
|
+
endNodeIndex, innerNodes = [], atIndex = 0, curNode = node,
|
183
|
+
matchLocation, matchIndex = 0;
|
184
|
+
|
185
|
+
matches = matches.slice(0);
|
186
|
+
matches.sort(function(a, b) {
|
187
|
+
return a.start - b.start;
|
188
|
+
});
|
189
|
+
|
190
|
+
matchLocation = matches.shift();
|
191
|
+
|
192
|
+
out: while (true) {
|
193
|
+
if (blockElementsMap[curNode.nodeName] || shortEndedElementsMap[curNode.nodeName] || isContentEditableFalse(curNode)) {
|
194
|
+
atIndex++;
|
195
|
+
}
|
196
|
+
|
197
|
+
if (curNode.nodeType === 3) {
|
198
|
+
if (!endNode && curNode.length + atIndex >= matchLocation.end) {
|
199
|
+
// We've found the ending
|
200
|
+
endNode = curNode;
|
201
|
+
endNodeIndex = matchLocation.end - atIndex;
|
202
|
+
} else if (startNode) {
|
203
|
+
// Intersecting node
|
204
|
+
innerNodes.push(curNode);
|
205
|
+
}
|
206
|
+
|
207
|
+
if (!startNode && curNode.length + atIndex > matchLocation.start) {
|
208
|
+
// We've found the match start
|
209
|
+
startNode = curNode;
|
210
|
+
startNodeIndex = matchLocation.start - atIndex;
|
211
|
+
}
|
212
|
+
|
213
|
+
atIndex += curNode.length;
|
214
|
+
}
|
215
|
+
|
216
|
+
if (startNode && endNode) {
|
217
|
+
curNode = replaceFn({
|
218
|
+
startNode: startNode,
|
219
|
+
startNodeIndex: startNodeIndex,
|
220
|
+
endNode: endNode,
|
221
|
+
endNodeIndex: endNodeIndex,
|
222
|
+
innerNodes: innerNodes,
|
223
|
+
match: matchLocation.text,
|
224
|
+
matchIndex: matchIndex
|
225
|
+
});
|
226
|
+
|
227
|
+
// replaceFn has to return the node that replaced the endNode
|
228
|
+
// and then we step back so we can continue from the end of the
|
229
|
+
// match:
|
230
|
+
atIndex -= (endNode.length - endNodeIndex);
|
231
|
+
startNode = null;
|
232
|
+
endNode = null;
|
233
|
+
innerNodes = [];
|
234
|
+
matchLocation = matches.shift();
|
235
|
+
matchIndex++;
|
236
|
+
|
237
|
+
if (!matchLocation) {
|
238
|
+
break; // no more matches
|
239
|
+
}
|
240
|
+
} else if ((!hiddenTextElementsMap[curNode.nodeName] || blockElementsMap[curNode.nodeName]) && curNode.firstChild) {
|
241
|
+
if (!isContentEditableFalse(curNode)) {
|
242
|
+
// Move down
|
243
|
+
curNode = curNode.firstChild;
|
244
|
+
continue;
|
245
|
+
}
|
246
|
+
} else if (curNode.nextSibling) {
|
247
|
+
// Move forward:
|
248
|
+
curNode = curNode.nextSibling;
|
249
|
+
continue;
|
250
|
+
}
|
251
|
+
|
252
|
+
// Move forward or up:
|
253
|
+
while (true) {
|
254
|
+
if (curNode.nextSibling) {
|
255
|
+
curNode = curNode.nextSibling;
|
256
|
+
break;
|
257
|
+
} else if (curNode.parentNode !== node) {
|
258
|
+
curNode = curNode.parentNode;
|
259
|
+
} else {
|
260
|
+
break out;
|
261
|
+
}
|
262
|
+
}
|
263
|
+
}
|
264
|
+
}
|
265
|
+
|
266
|
+
/**
|
267
|
+
* Generates the actual replaceFn which splits up text nodes
|
268
|
+
* and inserts the replacement element.
|
269
|
+
*/
|
270
|
+
function genReplacer(callback) {
|
271
|
+
function makeReplacementNode(fill, matchIndex) {
|
272
|
+
var match = matches[matchIndex];
|
273
|
+
|
274
|
+
if (!match.stencil) {
|
275
|
+
match.stencil = callback(match);
|
276
|
+
}
|
277
|
+
|
278
|
+
var clone = match.stencil.cloneNode(false);
|
279
|
+
clone.setAttribute('data-mce-index', matchIndex);
|
280
|
+
|
281
|
+
if (fill) {
|
282
|
+
clone.appendChild(dom.doc.createTextNode(fill));
|
283
|
+
}
|
284
|
+
|
285
|
+
return clone;
|
286
|
+
}
|
287
|
+
|
288
|
+
return function(range) {
|
289
|
+
var before, after, parentNode, startNode = range.startNode,
|
290
|
+
endNode = range.endNode, matchIndex = range.matchIndex,
|
291
|
+
doc = dom.doc;
|
292
|
+
|
293
|
+
if (startNode === endNode) {
|
294
|
+
var node = startNode;
|
295
|
+
|
296
|
+
parentNode = node.parentNode;
|
297
|
+
if (range.startNodeIndex > 0) {
|
298
|
+
// Add "before" text node (before the match)
|
299
|
+
before = doc.createTextNode(node.data.substring(0, range.startNodeIndex));
|
300
|
+
parentNode.insertBefore(before, node);
|
301
|
+
}
|
302
|
+
|
303
|
+
// Create the replacement node:
|
304
|
+
var el = makeReplacementNode(range.match, matchIndex);
|
305
|
+
parentNode.insertBefore(el, node);
|
306
|
+
if (range.endNodeIndex < node.length) {
|
307
|
+
// Add "after" text node (after the match)
|
308
|
+
after = doc.createTextNode(node.data.substring(range.endNodeIndex));
|
309
|
+
parentNode.insertBefore(after, node);
|
310
|
+
}
|
311
|
+
|
312
|
+
node.parentNode.removeChild(node);
|
313
|
+
|
314
|
+
return el;
|
315
|
+
}
|
316
|
+
|
317
|
+
// Replace startNode -> [innerNodes...] -> endNode (in that order)
|
318
|
+
before = doc.createTextNode(startNode.data.substring(0, range.startNodeIndex));
|
319
|
+
after = doc.createTextNode(endNode.data.substring(range.endNodeIndex));
|
320
|
+
var elA = makeReplacementNode(startNode.data.substring(range.startNodeIndex), matchIndex);
|
321
|
+
var innerEls = [];
|
322
|
+
|
323
|
+
for (var i = 0, l = range.innerNodes.length; i < l; ++i) {
|
324
|
+
var innerNode = range.innerNodes[i];
|
325
|
+
var innerEl = makeReplacementNode(innerNode.data, matchIndex);
|
326
|
+
innerNode.parentNode.replaceChild(innerEl, innerNode);
|
327
|
+
innerEls.push(innerEl);
|
328
|
+
}
|
329
|
+
|
330
|
+
var elB = makeReplacementNode(endNode.data.substring(0, range.endNodeIndex), matchIndex);
|
331
|
+
|
332
|
+
parentNode = startNode.parentNode;
|
333
|
+
parentNode.insertBefore(before, startNode);
|
334
|
+
parentNode.insertBefore(elA, startNode);
|
335
|
+
parentNode.removeChild(startNode);
|
336
|
+
|
337
|
+
parentNode = endNode.parentNode;
|
338
|
+
parentNode.insertBefore(elB, endNode);
|
339
|
+
parentNode.insertBefore(after, endNode);
|
340
|
+
parentNode.removeChild(endNode);
|
341
|
+
|
342
|
+
return elB;
|
343
|
+
};
|
344
|
+
}
|
345
|
+
|
346
|
+
function unwrapElement(element) {
|
347
|
+
var parentNode = element.parentNode;
|
348
|
+
parentNode.insertBefore(element.firstChild, element);
|
349
|
+
element.parentNode.removeChild(element);
|
350
|
+
}
|
351
|
+
|
352
|
+
function getWrappersByIndex(index) {
|
353
|
+
var elements = node.getElementsByTagName('*'), wrappers = [];
|
354
|
+
|
355
|
+
index = typeof index == "number" ? "" + index : null;
|
356
|
+
|
357
|
+
for (var i = 0; i < elements.length; i++) {
|
358
|
+
var element = elements[i], dataIndex = element.getAttribute('data-mce-index');
|
359
|
+
|
360
|
+
if (dataIndex !== null && dataIndex.length) {
|
361
|
+
if (dataIndex === index || index === null) {
|
362
|
+
wrappers.push(element);
|
363
|
+
}
|
364
|
+
}
|
365
|
+
}
|
366
|
+
|
367
|
+
return wrappers;
|
368
|
+
}
|
369
|
+
|
370
|
+
/**
|
371
|
+
* Returns the index of a specific match object or -1 if it isn't found.
|
372
|
+
*
|
373
|
+
* @param {Match} match Text match object.
|
374
|
+
* @return {Number} Index of match or -1 if it isn't found.
|
375
|
+
*/
|
376
|
+
function indexOf(match) {
|
377
|
+
var i = matches.length;
|
378
|
+
while (i--) {
|
379
|
+
if (matches[i] === match) {
|
380
|
+
return i;
|
381
|
+
}
|
382
|
+
}
|
383
|
+
|
384
|
+
return -1;
|
385
|
+
}
|
386
|
+
|
387
|
+
/**
|
388
|
+
* Filters the matches. If the callback returns true it stays if not it gets removed.
|
389
|
+
*
|
390
|
+
* @param {Function} callback Callback to execute for each match.
|
391
|
+
* @return {DomTextMatcher} Current DomTextMatcher instance.
|
392
|
+
*/
|
393
|
+
function filter(callback) {
|
394
|
+
var filteredMatches = [];
|
395
|
+
|
396
|
+
each(function(match, i) {
|
397
|
+
if (callback(match, i)) {
|
398
|
+
filteredMatches.push(match);
|
399
|
+
}
|
400
|
+
});
|
401
|
+
|
402
|
+
matches = filteredMatches;
|
403
|
+
|
404
|
+
/*jshint validthis:true*/
|
405
|
+
return this;
|
406
|
+
}
|
407
|
+
|
408
|
+
/**
|
409
|
+
* Executes the specified callback for each match.
|
410
|
+
*
|
411
|
+
* @param {Function} callback Callback to execute for each match.
|
412
|
+
* @return {DomTextMatcher} Current DomTextMatcher instance.
|
413
|
+
*/
|
414
|
+
function each(callback) {
|
415
|
+
for (var i = 0, l = matches.length; i < l; i++) {
|
416
|
+
if (callback(matches[i], i) === false) {
|
417
|
+
break;
|
418
|
+
}
|
419
|
+
}
|
420
|
+
|
421
|
+
/*jshint validthis:true*/
|
422
|
+
return this;
|
423
|
+
}
|
424
|
+
|
425
|
+
/**
|
426
|
+
* Wraps the current matches with nodes created by the specified callback.
|
427
|
+
* Multiple clones of these matches might occur on matches that are on multiple nodex.
|
428
|
+
*
|
429
|
+
* @param {Function} callback Callback to execute in order to create elements for matches.
|
430
|
+
* @return {DomTextMatcher} Current DomTextMatcher instance.
|
431
|
+
*/
|
432
|
+
function wrap(callback) {
|
433
|
+
if (matches.length) {
|
434
|
+
stepThroughMatches(node, matches, genReplacer(callback));
|
435
|
+
}
|
436
|
+
|
437
|
+
/*jshint validthis:true*/
|
438
|
+
return this;
|
439
|
+
}
|
440
|
+
|
441
|
+
/**
|
442
|
+
* Finds the specified regexp and adds them to the matches collection.
|
443
|
+
*
|
444
|
+
* @param {RegExp} regex Global regexp to search the current node by.
|
445
|
+
* @param {Object} [data] Optional custom data element for the match.
|
446
|
+
* @return {DomTextMatcher} Current DomTextMatcher instance.
|
447
|
+
*/
|
448
|
+
function find(regex, data) {
|
449
|
+
if (text && regex.global) {
|
450
|
+
while ((m = regex.exec(text))) {
|
451
|
+
matches.push(createMatch(m, data));
|
452
|
+
}
|
453
|
+
}
|
454
|
+
|
455
|
+
return this;
|
456
|
+
}
|
457
|
+
|
458
|
+
/**
|
459
|
+
* Unwraps the specified match object or all matches if unspecified.
|
460
|
+
*
|
461
|
+
* @param {Object} [match] Optional match object.
|
462
|
+
* @return {DomTextMatcher} Current DomTextMatcher instance.
|
463
|
+
*/
|
464
|
+
function unwrap(match) {
|
465
|
+
var i, elements = getWrappersByIndex(match ? indexOf(match) : null);
|
466
|
+
|
467
|
+
i = elements.length;
|
468
|
+
while (i--) {
|
469
|
+
unwrapElement(elements[i]);
|
470
|
+
}
|
471
|
+
|
472
|
+
return this;
|
473
|
+
}
|
474
|
+
|
475
|
+
/**
|
476
|
+
* Returns a match object by the specified DOM element.
|
477
|
+
*
|
478
|
+
* @param {DOMElement} element Element to return match object for.
|
479
|
+
* @return {Object} Match object for the specified element.
|
480
|
+
*/
|
481
|
+
function matchFromElement(element) {
|
482
|
+
return matches[element.getAttribute('data-mce-index')];
|
483
|
+
}
|
484
|
+
|
485
|
+
/**
|
486
|
+
* Returns a DOM element from the specified match element. This will be the first element if it's split
|
487
|
+
* on multiple nodes.
|
488
|
+
*
|
489
|
+
* @param {Object} match Match element to get first element of.
|
490
|
+
* @return {DOMElement} DOM element for the specified match object.
|
491
|
+
*/
|
492
|
+
function elementFromMatch(match) {
|
493
|
+
return getWrappersByIndex(indexOf(match))[0];
|
494
|
+
}
|
495
|
+
|
496
|
+
/**
|
497
|
+
* Adds match the specified range for example a grammar line.
|
498
|
+
*
|
499
|
+
* @param {Number} start Start offset.
|
500
|
+
* @param {Number} length Length of the text.
|
501
|
+
* @param {Object} data Custom data object for match.
|
502
|
+
* @return {DomTextMatcher} Current DomTextMatcher instance.
|
503
|
+
*/
|
504
|
+
function add(start, length, data) {
|
505
|
+
matches.push({
|
506
|
+
start: start,
|
507
|
+
end: start + length,
|
508
|
+
text: text.substr(start, length),
|
509
|
+
data: data
|
510
|
+
});
|
511
|
+
|
512
|
+
return this;
|
513
|
+
}
|
514
|
+
|
515
|
+
/**
|
516
|
+
* Returns a DOM range for the specified match.
|
517
|
+
*
|
518
|
+
* @param {Object} match Match object to get range for.
|
519
|
+
* @return {DOMRange} DOM Range for the specified match.
|
520
|
+
*/
|
521
|
+
function rangeFromMatch(match) {
|
522
|
+
var wrappers = getWrappersByIndex(indexOf(match));
|
523
|
+
|
524
|
+
var rng = editor.dom.createRng();
|
525
|
+
rng.setStartBefore(wrappers[0]);
|
526
|
+
rng.setEndAfter(wrappers[wrappers.length - 1]);
|
527
|
+
|
528
|
+
return rng;
|
529
|
+
}
|
530
|
+
|
531
|
+
/**
|
532
|
+
* Replaces the specified match with the specified text.
|
533
|
+
*
|
534
|
+
* @param {Object} match Match object to replace.
|
535
|
+
* @param {String} text Text to replace the match with.
|
536
|
+
* @return {DOMRange} DOM range produced after the replace.
|
537
|
+
*/
|
538
|
+
function replace(match, text) {
|
539
|
+
var rng = rangeFromMatch(match);
|
540
|
+
|
541
|
+
rng.deleteContents();
|
542
|
+
|
543
|
+
if (text.length > 0) {
|
544
|
+
rng.insertNode(editor.dom.doc.createTextNode(text));
|
545
|
+
}
|
546
|
+
|
547
|
+
return rng;
|
548
|
+
}
|
549
|
+
|
550
|
+
/**
|
551
|
+
* Resets the DomTextMatcher instance. This will remove any wrapped nodes and remove any matches.
|
552
|
+
*
|
553
|
+
* @return {[type]} [description]
|
554
|
+
*/
|
555
|
+
function reset() {
|
556
|
+
matches.splice(0, matches.length);
|
557
|
+
unwrap();
|
558
|
+
|
559
|
+
return this;
|
560
|
+
}
|
561
|
+
|
562
|
+
text = getText(node);
|
563
|
+
|
564
|
+
return {
|
565
|
+
text: text,
|
566
|
+
matches: matches,
|
567
|
+
each: each,
|
568
|
+
filter: filter,
|
569
|
+
reset: reset,
|
570
|
+
matchFromElement: matchFromElement,
|
571
|
+
elementFromMatch: elementFromMatch,
|
572
|
+
find: find,
|
573
|
+
add: add,
|
574
|
+
wrap: wrap,
|
575
|
+
unwrap: unwrap,
|
576
|
+
replace: replace,
|
577
|
+
rangeFromMatch: rangeFromMatch,
|
578
|
+
indexOf: indexOf
|
579
|
+
};
|
580
|
+
};
|
581
|
+
});
|
582
|
+
|
583
|
+
// Included from: js/tinymce/plugins/spellchecker/classes/Plugin.js
|
584
|
+
|
585
|
+
/**
|
586
|
+
* Plugin.js
|
587
|
+
*
|
588
|
+
* Released under LGPL License.
|
589
|
+
* Copyright (c) 1999-2015 Ephox Corp. All rights reserved
|
590
|
+
*
|
591
|
+
* License: http://www.tinymce.com/license
|
592
|
+
* Contributing: http://www.tinymce.com/contributing
|
593
|
+
*/
|
594
|
+
|
595
|
+
/*jshint camelcase:false */
|
596
|
+
|
597
|
+
/**
|
598
|
+
* This class contains all core logic for the spellchecker plugin.
|
599
|
+
*
|
600
|
+
* @class tinymce.spellcheckerplugin.Plugin
|
601
|
+
* @private
|
602
|
+
*/
|
603
|
+
define("tinymce/spellcheckerplugin/Plugin", [
|
604
|
+
"tinymce/spellcheckerplugin/DomTextMatcher",
|
605
|
+
"tinymce/PluginManager",
|
606
|
+
"tinymce/util/Tools",
|
607
|
+
"tinymce/ui/Menu",
|
608
|
+
"tinymce/dom/DOMUtils",
|
609
|
+
"tinymce/util/XHR",
|
610
|
+
"tinymce/util/URI",
|
611
|
+
"tinymce/util/JSON"
|
612
|
+
], function(DomTextMatcher, PluginManager, Tools, Menu, DOMUtils, XHR, URI, JSON) {
|
613
|
+
PluginManager.add('spellchecker', function(editor, url) {
|
614
|
+
var languageMenuItems, self = this, lastSuggestions, started, suggestionsMenu, settings = editor.settings;
|
615
|
+
var hasDictionarySupport;
|
616
|
+
|
617
|
+
function getTextMatcher() {
|
618
|
+
if (!self.textMatcher) {
|
619
|
+
self.textMatcher = new DomTextMatcher(editor.getBody(), editor);
|
620
|
+
}
|
621
|
+
|
622
|
+
return self.textMatcher;
|
623
|
+
}
|
624
|
+
|
625
|
+
function buildMenuItems(listName, languageValues) {
|
626
|
+
var items = [];
|
627
|
+
|
628
|
+
Tools.each(languageValues, function(languageValue) {
|
629
|
+
items.push({
|
630
|
+
selectable: true,
|
631
|
+
text: languageValue.name,
|
632
|
+
data: languageValue.value
|
633
|
+
});
|
634
|
+
});
|
635
|
+
|
636
|
+
return items;
|
637
|
+
}
|
638
|
+
|
639
|
+
var languagesString = settings.spellchecker_languages ||
|
640
|
+
'English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,' +
|
641
|
+
'German=de,Italian=it,Polish=pl,Portuguese=pt_BR,' +
|
642
|
+
'Spanish=es,Swedish=sv';
|
643
|
+
|
644
|
+
languageMenuItems = buildMenuItems('Language',
|
645
|
+
Tools.map(languagesString.split(','), function(langPair) {
|
646
|
+
langPair = langPair.split('=');
|
647
|
+
|
648
|
+
return {
|
649
|
+
name: langPair[0],
|
650
|
+
value: langPair[1]
|
651
|
+
};
|
652
|
+
})
|
653
|
+
);
|
654
|
+
|
655
|
+
function isEmpty(obj) {
|
656
|
+
/*jshint unused:false*/
|
657
|
+
/*eslint no-unused-vars:0 */
|
658
|
+
for (var name in obj) {
|
659
|
+
return false;
|
660
|
+
}
|
661
|
+
|
662
|
+
return true;
|
663
|
+
}
|
664
|
+
|
665
|
+
function showSuggestions(word, spans) {
|
666
|
+
var items = [], suggestions = lastSuggestions[word];
|
667
|
+
|
668
|
+
Tools.each(suggestions, function(suggestion) {
|
669
|
+
items.push({
|
670
|
+
text: suggestion,
|
671
|
+
onclick: function() {
|
672
|
+
editor.insertContent(editor.dom.encode(suggestion));
|
673
|
+
editor.dom.remove(spans);
|
674
|
+
checkIfFinished();
|
675
|
+
}
|
676
|
+
});
|
677
|
+
});
|
678
|
+
|
679
|
+
items.push({text: '-'});
|
680
|
+
|
681
|
+
if (hasDictionarySupport) {
|
682
|
+
items.push({text: 'Add to Dictionary', onclick: function() {
|
683
|
+
addToDictionary(word, spans);
|
684
|
+
}});
|
685
|
+
}
|
686
|
+
|
687
|
+
items.push.apply(items, [
|
688
|
+
{text: 'Ignore', onclick: function() {
|
689
|
+
ignoreWord(word, spans);
|
690
|
+
}},
|
691
|
+
|
692
|
+
{text: 'Ignore all', onclick: function() {
|
693
|
+
ignoreWord(word, spans, true);
|
694
|
+
}}
|
695
|
+
]);
|
696
|
+
|
697
|
+
// Render menu
|
698
|
+
suggestionsMenu = new Menu({
|
699
|
+
items: items,
|
700
|
+
context: 'contextmenu',
|
701
|
+
onautohide: function(e) {
|
702
|
+
if (e.target.className.indexOf('spellchecker') != -1) {
|
703
|
+
e.preventDefault();
|
704
|
+
}
|
705
|
+
},
|
706
|
+
onhide: function() {
|
707
|
+
suggestionsMenu.remove();
|
708
|
+
suggestionsMenu = null;
|
709
|
+
}
|
710
|
+
});
|
711
|
+
|
712
|
+
suggestionsMenu.renderTo(document.body);
|
713
|
+
|
714
|
+
// Position menu
|
715
|
+
var pos = DOMUtils.DOM.getPos(editor.getContentAreaContainer());
|
716
|
+
var targetPos = editor.dom.getPos(spans[0]);
|
717
|
+
var root = editor.dom.getRoot();
|
718
|
+
|
719
|
+
// Adjust targetPos for scrolling in the editor
|
720
|
+
if (root.nodeName == 'BODY') {
|
721
|
+
targetPos.x -= root.ownerDocument.documentElement.scrollLeft || root.scrollLeft;
|
722
|
+
targetPos.y -= root.ownerDocument.documentElement.scrollTop || root.scrollTop;
|
723
|
+
} else {
|
724
|
+
targetPos.x -= root.scrollLeft;
|
725
|
+
targetPos.y -= root.scrollTop;
|
726
|
+
}
|
727
|
+
|
728
|
+
pos.x += targetPos.x;
|
729
|
+
pos.y += targetPos.y;
|
730
|
+
|
731
|
+
suggestionsMenu.moveTo(pos.x, pos.y + spans[0].offsetHeight);
|
732
|
+
}
|
733
|
+
|
734
|
+
function getWordCharPattern() {
|
735
|
+
// Regexp for finding word specific characters this will split words by
|
736
|
+
// spaces, quotes, copy right characters etc. It's escaped with unicode characters
|
737
|
+
// to make it easier to output scripts on servers using different encodings
|
738
|
+
// so if you add any characters outside the 128 byte range make sure to escape it
|
739
|
+
return editor.getParam('spellchecker_wordchar_pattern') || new RegExp("[^" +
|
740
|
+
"\\s!\"#$%&()*+,-./:;<=>?@[\\]^_{|}`" +
|
741
|
+
"\u00a7\u00a9\u00ab\u00ae\u00b1\u00b6\u00b7\u00b8\u00bb" +
|
742
|
+
"\u00bc\u00bd\u00be\u00bf\u00d7\u00f7\u00a4\u201d\u201c\u201e\u00a0\u2002\u2003\u2009" +
|
743
|
+
"]+", "g");
|
744
|
+
}
|
745
|
+
|
746
|
+
function defaultSpellcheckCallback(method, text, doneCallback, errorCallback) {
|
747
|
+
var data = {method: method}, postData = '';
|
748
|
+
|
749
|
+
if (method == "spellcheck") {
|
750
|
+
data.text = text;
|
751
|
+
data.lang = settings.spellchecker_language;
|
752
|
+
}
|
753
|
+
|
754
|
+
if (method == "addToDictionary") {
|
755
|
+
data.word = text;
|
756
|
+
}
|
757
|
+
|
758
|
+
Tools.each(data, function(value, key) {
|
759
|
+
if (postData) {
|
760
|
+
postData += '&';
|
761
|
+
}
|
762
|
+
|
763
|
+
postData += key + '=' + encodeURIComponent(value);
|
764
|
+
});
|
765
|
+
|
766
|
+
XHR.send({
|
767
|
+
url: new URI(url).toAbsolute(settings.spellchecker_rpc_url),
|
768
|
+
type: "post",
|
769
|
+
content_type: 'application/x-www-form-urlencoded',
|
770
|
+
data: postData,
|
771
|
+
success: function(result) {
|
772
|
+
result = JSON.parse(result);
|
773
|
+
|
774
|
+
if (!result) {
|
775
|
+
var message = editor.translate("Server response wasn't proper JSON.");
|
776
|
+
errorCallback(message);
|
777
|
+
} else if (result.error) {
|
778
|
+
errorCallback(result.error);
|
779
|
+
} else {
|
780
|
+
doneCallback(result);
|
781
|
+
}
|
782
|
+
},
|
783
|
+
error: function() {
|
784
|
+
var message = editor.translate("The spelling service was not found: (") +
|
785
|
+
settings.spellchecker_rpc_url +
|
786
|
+
editor.translate(")");
|
787
|
+
errorCallback(message);
|
788
|
+
}
|
789
|
+
});
|
790
|
+
}
|
791
|
+
|
792
|
+
function sendRpcCall(name, data, successCallback, errorCallback) {
|
793
|
+
var spellCheckCallback = settings.spellchecker_callback || defaultSpellcheckCallback;
|
794
|
+
spellCheckCallback.call(self, name, data, successCallback, errorCallback);
|
795
|
+
}
|
796
|
+
|
797
|
+
function spellcheck() {
|
798
|
+
if (finish()) {
|
799
|
+
return;
|
800
|
+
}
|
801
|
+
|
802
|
+
function errorCallback(message) {
|
803
|
+
editor.notificationManager.open({text: message, type: 'error'});
|
804
|
+
editor.setProgressState(false);
|
805
|
+
finish();
|
806
|
+
}
|
807
|
+
|
808
|
+
editor.setProgressState(true);
|
809
|
+
sendRpcCall("spellcheck", getTextMatcher().text, markErrors, errorCallback);
|
810
|
+
editor.focus();
|
811
|
+
}
|
812
|
+
|
813
|
+
function checkIfFinished() {
|
814
|
+
if (!editor.dom.select('span.mce-spellchecker-word').length) {
|
815
|
+
finish();
|
816
|
+
}
|
817
|
+
}
|
818
|
+
|
819
|
+
function addToDictionary(word, spans) {
|
820
|
+
editor.setProgressState(true);
|
821
|
+
|
822
|
+
sendRpcCall("addToDictionary", word, function() {
|
823
|
+
editor.setProgressState(false);
|
824
|
+
editor.dom.remove(spans, true);
|
825
|
+
checkIfFinished();
|
826
|
+
}, function(message) {
|
827
|
+
editor.notificationManager.open({text: message, type: 'error'});
|
828
|
+
editor.setProgressState(false);
|
829
|
+
});
|
830
|
+
}
|
831
|
+
|
832
|
+
function ignoreWord(word, spans, all) {
|
833
|
+
editor.selection.collapse();
|
834
|
+
|
835
|
+
if (all) {
|
836
|
+
Tools.each(editor.dom.select('span.mce-spellchecker-word'), function(span) {
|
837
|
+
if (span.getAttribute('data-mce-word') == word) {
|
838
|
+
editor.dom.remove(span, true);
|
839
|
+
}
|
840
|
+
});
|
841
|
+
} else {
|
842
|
+
editor.dom.remove(spans, true);
|
843
|
+
}
|
844
|
+
|
845
|
+
checkIfFinished();
|
846
|
+
}
|
847
|
+
|
848
|
+
function finish() {
|
849
|
+
getTextMatcher().reset();
|
850
|
+
self.textMatcher = null;
|
851
|
+
|
852
|
+
if (started) {
|
853
|
+
started = false;
|
854
|
+
editor.fire('SpellcheckEnd');
|
855
|
+
return true;
|
856
|
+
}
|
857
|
+
}
|
858
|
+
|
859
|
+
function getElmIndex(elm) {
|
860
|
+
var value = elm.getAttribute('data-mce-index');
|
861
|
+
|
862
|
+
if (typeof value == "number") {
|
863
|
+
return "" + value;
|
864
|
+
}
|
865
|
+
|
866
|
+
return value;
|
867
|
+
}
|
868
|
+
|
869
|
+
function findSpansByIndex(index) {
|
870
|
+
var nodes, spans = [];
|
871
|
+
|
872
|
+
nodes = Tools.toArray(editor.getBody().getElementsByTagName('span'));
|
873
|
+
if (nodes.length) {
|
874
|
+
for (var i = 0; i < nodes.length; i++) {
|
875
|
+
var nodeIndex = getElmIndex(nodes[i]);
|
876
|
+
|
877
|
+
if (nodeIndex === null || !nodeIndex.length) {
|
878
|
+
continue;
|
879
|
+
}
|
880
|
+
|
881
|
+
if (nodeIndex === index.toString()) {
|
882
|
+
spans.push(nodes[i]);
|
883
|
+
}
|
884
|
+
}
|
885
|
+
}
|
886
|
+
|
887
|
+
return spans;
|
888
|
+
}
|
889
|
+
|
890
|
+
editor.on('click', function(e) {
|
891
|
+
var target = e.target;
|
892
|
+
|
893
|
+
if (target.className == "mce-spellchecker-word") {
|
894
|
+
e.preventDefault();
|
895
|
+
|
896
|
+
var spans = findSpansByIndex(getElmIndex(target));
|
897
|
+
|
898
|
+
if (spans.length > 0) {
|
899
|
+
var rng = editor.dom.createRng();
|
900
|
+
rng.setStartBefore(spans[0]);
|
901
|
+
rng.setEndAfter(spans[spans.length - 1]);
|
902
|
+
editor.selection.setRng(rng);
|
903
|
+
showSuggestions(target.getAttribute('data-mce-word'), spans);
|
904
|
+
}
|
905
|
+
}
|
906
|
+
});
|
907
|
+
|
908
|
+
editor.addMenuItem('spellchecker', {
|
909
|
+
text: 'Spellcheck',
|
910
|
+
context: 'tools',
|
911
|
+
onclick: spellcheck,
|
912
|
+
selectable: true,
|
913
|
+
onPostRender: function() {
|
914
|
+
var self = this;
|
915
|
+
|
916
|
+
self.active(started);
|
917
|
+
|
918
|
+
editor.on('SpellcheckStart SpellcheckEnd', function() {
|
919
|
+
self.active(started);
|
920
|
+
});
|
921
|
+
}
|
922
|
+
});
|
923
|
+
|
924
|
+
function updateSelection(e) {
|
925
|
+
var selectedLanguage = settings.spellchecker_language;
|
926
|
+
|
927
|
+
e.control.items().each(function(ctrl) {
|
928
|
+
ctrl.active(ctrl.settings.data === selectedLanguage);
|
929
|
+
});
|
930
|
+
}
|
931
|
+
|
932
|
+
/**
|
933
|
+
* Find the specified words and marks them. It will also show suggestions for those words.
|
934
|
+
*
|
935
|
+
* @example
|
936
|
+
* editor.plugins.spellchecker.markErrors({
|
937
|
+
* dictionary: true,
|
938
|
+
* words: {
|
939
|
+
* "word1": ["suggestion 1", "Suggestion 2"]
|
940
|
+
* }
|
941
|
+
* });
|
942
|
+
* @param {Object} data Data object containing the words with suggestions.
|
943
|
+
*/
|
944
|
+
function markErrors(data) {
|
945
|
+
var suggestions;
|
946
|
+
|
947
|
+
if (data.words) {
|
948
|
+
hasDictionarySupport = !!data.dictionary;
|
949
|
+
suggestions = data.words;
|
950
|
+
} else {
|
951
|
+
// Fallback to old format
|
952
|
+
suggestions = data;
|
953
|
+
}
|
954
|
+
|
955
|
+
editor.setProgressState(false);
|
956
|
+
|
957
|
+
if (isEmpty(suggestions)) {
|
958
|
+
var message = editor.translate('No misspellings found.');
|
959
|
+
editor.notificationManager.open({text: message, type: 'info'});
|
960
|
+
started = false;
|
961
|
+
return;
|
962
|
+
}
|
963
|
+
|
964
|
+
lastSuggestions = suggestions;
|
965
|
+
|
966
|
+
getTextMatcher().find(getWordCharPattern()).filter(function(match) {
|
967
|
+
return !!suggestions[match.text];
|
968
|
+
}).wrap(function(match) {
|
969
|
+
return editor.dom.create('span', {
|
970
|
+
"class": 'mce-spellchecker-word',
|
971
|
+
"data-mce-bogus": 1,
|
972
|
+
"data-mce-word": match.text
|
973
|
+
});
|
974
|
+
});
|
975
|
+
|
976
|
+
started = true;
|
977
|
+
editor.fire('SpellcheckStart');
|
978
|
+
}
|
979
|
+
|
980
|
+
var buttonArgs = {
|
981
|
+
tooltip: 'Spellcheck',
|
982
|
+
onclick: spellcheck,
|
983
|
+
onPostRender: function() {
|
984
|
+
var self = this;
|
985
|
+
|
986
|
+
editor.on('SpellcheckStart SpellcheckEnd', function() {
|
987
|
+
self.active(started);
|
988
|
+
});
|
989
|
+
}
|
990
|
+
};
|
991
|
+
|
992
|
+
if (languageMenuItems.length > 1) {
|
993
|
+
buttonArgs.type = 'splitbutton';
|
994
|
+
buttonArgs.menu = languageMenuItems;
|
995
|
+
buttonArgs.onshow = updateSelection;
|
996
|
+
buttonArgs.onselect = function(e) {
|
997
|
+
settings.spellchecker_language = e.control.settings.data;
|
998
|
+
};
|
999
|
+
}
|
1000
|
+
|
1001
|
+
editor.addButton('spellchecker', buttonArgs);
|
1002
|
+
editor.addCommand('mceSpellCheck', spellcheck);
|
1003
|
+
|
1004
|
+
editor.on('remove', function() {
|
1005
|
+
if (suggestionsMenu) {
|
1006
|
+
suggestionsMenu.remove();
|
1007
|
+
suggestionsMenu = null;
|
1008
|
+
}
|
1009
|
+
});
|
1010
|
+
|
1011
|
+
editor.on('change', checkIfFinished);
|
1012
|
+
|
1013
|
+
this.getTextMatcher = getTextMatcher;
|
1014
|
+
this.getWordCharPattern = getWordCharPattern;
|
1015
|
+
this.markErrors = markErrors;
|
1016
|
+
this.getLanguage = function() {
|
1017
|
+
return settings.spellchecker_language;
|
1018
|
+
};
|
1019
|
+
|
1020
|
+
// Set default spellchecker language if it's not specified
|
1021
|
+
settings.spellchecker_language = settings.spellchecker_language || settings.language || 'en';
|
1022
|
+
});
|
1023
|
+
});
|
1024
|
+
|
1025
|
+
expose(["tinymce/spellcheckerplugin/DomTextMatcher"]);
|
1026
|
+
})(this);
|