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,121 @@
|
|
1
|
+
/**
|
2
|
+
* Plugin.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 the tinymce plugin logic for the paste plugin.
|
13
|
+
*
|
14
|
+
* @class tinymce.pasteplugin.Plugin
|
15
|
+
* @private
|
16
|
+
*/
|
17
|
+
define("tinymce/pasteplugin/Plugin", [
|
18
|
+
"tinymce/PluginManager",
|
19
|
+
"tinymce/pasteplugin/Clipboard",
|
20
|
+
"tinymce/pasteplugin/WordFilter",
|
21
|
+
"tinymce/pasteplugin/Quirks"
|
22
|
+
], function(PluginManager, Clipboard, WordFilter, Quirks) {
|
23
|
+
var userIsInformed;
|
24
|
+
|
25
|
+
PluginManager.add('paste', function(editor) {
|
26
|
+
var self = this, clipboard, settings = editor.settings;
|
27
|
+
|
28
|
+
function isUserInformedAboutPlainText() {
|
29
|
+
return userIsInformed || editor.settings.paste_plaintext_inform === false;
|
30
|
+
}
|
31
|
+
|
32
|
+
function togglePlainTextPaste() {
|
33
|
+
if (clipboard.pasteFormat == "text") {
|
34
|
+
this.active(false);
|
35
|
+
clipboard.pasteFormat = "html";
|
36
|
+
editor.fire('PastePlainTextToggle', {state: false});
|
37
|
+
} else {
|
38
|
+
clipboard.pasteFormat = "text";
|
39
|
+
this.active(true);
|
40
|
+
|
41
|
+
if (!isUserInformedAboutPlainText()) {
|
42
|
+
var message = editor.translate('Paste is now in plain text mode. Contents will now ' +
|
43
|
+
'be pasted as plain text until you toggle this option off.');
|
44
|
+
|
45
|
+
editor.notificationManager.open({
|
46
|
+
text: message,
|
47
|
+
type: 'info'
|
48
|
+
});
|
49
|
+
|
50
|
+
userIsInformed = true;
|
51
|
+
editor.fire('PastePlainTextToggle', {state: true});
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
editor.focus();
|
56
|
+
}
|
57
|
+
|
58
|
+
self.clipboard = clipboard = new Clipboard(editor);
|
59
|
+
self.quirks = new Quirks(editor);
|
60
|
+
self.wordFilter = new WordFilter(editor);
|
61
|
+
|
62
|
+
if (editor.settings.paste_as_text) {
|
63
|
+
self.clipboard.pasteFormat = "text";
|
64
|
+
}
|
65
|
+
|
66
|
+
if (settings.paste_preprocess) {
|
67
|
+
editor.on('PastePreProcess', function(e) {
|
68
|
+
settings.paste_preprocess.call(self, self, e);
|
69
|
+
});
|
70
|
+
}
|
71
|
+
|
72
|
+
if (settings.paste_postprocess) {
|
73
|
+
editor.on('PastePostProcess', function(e) {
|
74
|
+
settings.paste_postprocess.call(self, self, e);
|
75
|
+
});
|
76
|
+
}
|
77
|
+
|
78
|
+
editor.addCommand('mceInsertClipboardContent', function(ui, value) {
|
79
|
+
if (value.content) {
|
80
|
+
self.clipboard.pasteHtml(value.content);
|
81
|
+
}
|
82
|
+
|
83
|
+
if (value.text) {
|
84
|
+
self.clipboard.pasteText(value.text);
|
85
|
+
}
|
86
|
+
});
|
87
|
+
|
88
|
+
// Block all drag/drop events
|
89
|
+
if (editor.paste_block_drop) {
|
90
|
+
editor.on('dragend dragover draggesture dragdrop drop drag', function(e) {
|
91
|
+
e.preventDefault();
|
92
|
+
e.stopPropagation();
|
93
|
+
});
|
94
|
+
}
|
95
|
+
|
96
|
+
// Prevent users from dropping data images on Gecko
|
97
|
+
if (!editor.settings.paste_data_images) {
|
98
|
+
editor.on('drop', function(e) {
|
99
|
+
var dataTransfer = e.dataTransfer;
|
100
|
+
|
101
|
+
if (dataTransfer && dataTransfer.files && dataTransfer.files.length > 0) {
|
102
|
+
e.preventDefault();
|
103
|
+
}
|
104
|
+
});
|
105
|
+
}
|
106
|
+
|
107
|
+
editor.addButton('pastetext', {
|
108
|
+
icon: 'pastetext',
|
109
|
+
tooltip: 'Paste as text',
|
110
|
+
onclick: togglePlainTextPaste,
|
111
|
+
active: self.clipboard.pasteFormat == "text"
|
112
|
+
});
|
113
|
+
|
114
|
+
editor.addMenuItem('pastetext', {
|
115
|
+
text: 'Paste as text',
|
116
|
+
selectable: true,
|
117
|
+
active: clipboard.pasteFormat,
|
118
|
+
onclick: togglePlainTextPaste
|
119
|
+
});
|
120
|
+
});
|
121
|
+
});
|
@@ -0,0 +1,159 @@
|
|
1
|
+
/**
|
2
|
+
* Quirks.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 fixes for browsers. These issues can not be feature
|
13
|
+
* detected since we have no direct control over the clipboard. However we might be able
|
14
|
+
* to remove some of these fixes once the browsers gets updated/fixed.
|
15
|
+
*
|
16
|
+
* @class tinymce.pasteplugin.Quirks
|
17
|
+
* @private
|
18
|
+
*/
|
19
|
+
define("tinymce/pasteplugin/Quirks", [
|
20
|
+
"tinymce/Env",
|
21
|
+
"tinymce/util/Tools",
|
22
|
+
"tinymce/pasteplugin/WordFilter",
|
23
|
+
"tinymce/pasteplugin/Utils"
|
24
|
+
], function(Env, Tools, WordFilter, Utils) {
|
25
|
+
"use strict";
|
26
|
+
|
27
|
+
return function(editor) {
|
28
|
+
function addPreProcessFilter(filterFunc) {
|
29
|
+
editor.on('BeforePastePreProcess', function(e) {
|
30
|
+
e.content = filterFunc(e.content);
|
31
|
+
});
|
32
|
+
}
|
33
|
+
|
34
|
+
/**
|
35
|
+
* Removes BR elements after block elements. IE9 has a nasty bug where it puts a BR element after each
|
36
|
+
* block element when pasting from word. This removes those elements.
|
37
|
+
*
|
38
|
+
* This:
|
39
|
+
* <p>a</p><br><p>b</p>
|
40
|
+
*
|
41
|
+
* Becomes:
|
42
|
+
* <p>a</p><p>b</p>
|
43
|
+
*/
|
44
|
+
function removeExplorerBrElementsAfterBlocks(html) {
|
45
|
+
// Only filter word specific content
|
46
|
+
if (!WordFilter.isWordContent(html)) {
|
47
|
+
return html;
|
48
|
+
}
|
49
|
+
|
50
|
+
// Produce block regexp based on the block elements in schema
|
51
|
+
var blockElements = [];
|
52
|
+
|
53
|
+
Tools.each(editor.schema.getBlockElements(), function(block, blockName) {
|
54
|
+
blockElements.push(blockName);
|
55
|
+
});
|
56
|
+
|
57
|
+
var explorerBlocksRegExp = new RegExp(
|
58
|
+
'(?:<br> [\\s\\r\\n]+|<br>)*(<\\/?(' + blockElements.join('|') + ')[^>]*>)(?:<br> [\\s\\r\\n]+|<br>)*',
|
59
|
+
'g'
|
60
|
+
);
|
61
|
+
|
62
|
+
// Remove BR:s from: <BLOCK>X</BLOCK><BR>
|
63
|
+
html = Utils.filter(html, [
|
64
|
+
[explorerBlocksRegExp, '$1']
|
65
|
+
]);
|
66
|
+
|
67
|
+
// IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break
|
68
|
+
html = Utils.filter(html, [
|
69
|
+
[/<br><br>/g, '<BR><BR>'], // Replace multiple BR elements with uppercase BR to keep them intact
|
70
|
+
[/<br>/g, ' '], // Replace single br elements with space since they are word wrap BR:s
|
71
|
+
[/<BR><BR>/g, '<br>'] // Replace back the double brs but into a single BR
|
72
|
+
]);
|
73
|
+
|
74
|
+
return html;
|
75
|
+
}
|
76
|
+
|
77
|
+
/**
|
78
|
+
* WebKit has a nasty bug where the all computed styles gets added to style attributes when copy/pasting contents.
|
79
|
+
* This fix solves that by simply removing the whole style attribute.
|
80
|
+
*
|
81
|
+
* The paste_webkit_styles option can be set to specify what to keep:
|
82
|
+
* paste_webkit_styles: "none" // Keep no styles
|
83
|
+
* paste_webkit_styles: "all", // Keep all of them
|
84
|
+
* paste_webkit_styles: "font-weight color" // Keep specific ones
|
85
|
+
*
|
86
|
+
* @param {String} content Content that needs to be processed.
|
87
|
+
* @return {String} Processed contents.
|
88
|
+
*/
|
89
|
+
function removeWebKitStyles(content) {
|
90
|
+
// Passthrough all styles from Word and let the WordFilter handle that junk
|
91
|
+
if (WordFilter.isWordContent(content)) {
|
92
|
+
return content;
|
93
|
+
}
|
94
|
+
|
95
|
+
// Filter away styles that isn't matching the target node
|
96
|
+
var webKitStyles = editor.settings.paste_webkit_styles;
|
97
|
+
|
98
|
+
if (editor.settings.paste_remove_styles_if_webkit === false || webKitStyles == "all") {
|
99
|
+
return content;
|
100
|
+
}
|
101
|
+
|
102
|
+
if (webKitStyles) {
|
103
|
+
webKitStyles = webKitStyles.split(/[, ]/);
|
104
|
+
}
|
105
|
+
|
106
|
+
// Keep specific styles that doesn't match the current node computed style
|
107
|
+
if (webKitStyles) {
|
108
|
+
var dom = editor.dom, node = editor.selection.getNode();
|
109
|
+
|
110
|
+
content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, function(all, before, value, after) {
|
111
|
+
var inputStyles = dom.parseStyle(value, 'span'), outputStyles = {};
|
112
|
+
|
113
|
+
if (webKitStyles === "none") {
|
114
|
+
return before + after;
|
115
|
+
}
|
116
|
+
|
117
|
+
for (var i = 0; i < webKitStyles.length; i++) {
|
118
|
+
var inputValue = inputStyles[webKitStyles[i]], currentValue = dom.getStyle(node, webKitStyles[i], true);
|
119
|
+
|
120
|
+
if (/color/.test(webKitStyles[i])) {
|
121
|
+
inputValue = dom.toHex(inputValue);
|
122
|
+
currentValue = dom.toHex(currentValue);
|
123
|
+
}
|
124
|
+
|
125
|
+
if (currentValue != inputValue) {
|
126
|
+
outputStyles[webKitStyles[i]] = inputValue;
|
127
|
+
}
|
128
|
+
}
|
129
|
+
|
130
|
+
outputStyles = dom.serializeStyle(outputStyles, 'span');
|
131
|
+
if (outputStyles) {
|
132
|
+
return before + ' style="' + outputStyles + '"' + after;
|
133
|
+
}
|
134
|
+
|
135
|
+
return before + after;
|
136
|
+
});
|
137
|
+
} else {
|
138
|
+
// Remove all external styles
|
139
|
+
content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, '$1$3');
|
140
|
+
}
|
141
|
+
|
142
|
+
// Keep internal styles
|
143
|
+
content = content.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi, function(all, before, value, after) {
|
144
|
+
return before + ' style="' + value + '"' + after;
|
145
|
+
});
|
146
|
+
|
147
|
+
return content;
|
148
|
+
}
|
149
|
+
|
150
|
+
// Sniff browsers and apply fixes since we can't feature detect
|
151
|
+
if (Env.webkit) {
|
152
|
+
addPreProcessFilter(removeWebKitStyles);
|
153
|
+
}
|
154
|
+
|
155
|
+
if (Env.ie) {
|
156
|
+
addPreProcessFilter(removeExplorerBrElementsAfterBlocks);
|
157
|
+
}
|
158
|
+
};
|
159
|
+
});
|
@@ -0,0 +1,140 @@
|
|
1
|
+
/**
|
2
|
+
* Utils.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 contails various utility functions for the paste plugin.
|
13
|
+
*
|
14
|
+
* @class tinymce.pasteplugin.Utils
|
15
|
+
*/
|
16
|
+
define("tinymce/pasteplugin/Utils", [
|
17
|
+
"tinymce/util/Tools",
|
18
|
+
"tinymce/html/DomParser",
|
19
|
+
"tinymce/html/Schema"
|
20
|
+
], function(Tools, DomParser, Schema) {
|
21
|
+
function filter(content, items) {
|
22
|
+
Tools.each(items, function(v) {
|
23
|
+
if (v.constructor == RegExp) {
|
24
|
+
content = content.replace(v, '');
|
25
|
+
} else {
|
26
|
+
content = content.replace(v[0], v[1]);
|
27
|
+
}
|
28
|
+
});
|
29
|
+
|
30
|
+
return content;
|
31
|
+
}
|
32
|
+
|
33
|
+
/**
|
34
|
+
* Gets the innerText of the specified element. It will handle edge cases
|
35
|
+
* and works better than textContent on Gecko.
|
36
|
+
*
|
37
|
+
* @param {String} html HTML string to get text from.
|
38
|
+
* @return {String} String of text with line feeds.
|
39
|
+
*/
|
40
|
+
function innerText(html) {
|
41
|
+
var schema = new Schema(), domParser = new DomParser({}, schema), text = '';
|
42
|
+
var shortEndedElements = schema.getShortEndedElements();
|
43
|
+
var ignoreElements = Tools.makeMap('script noscript style textarea video audio iframe object', ' ');
|
44
|
+
var blockElements = schema.getBlockElements();
|
45
|
+
|
46
|
+
function walk(node) {
|
47
|
+
var name = node.name, currentNode = node;
|
48
|
+
|
49
|
+
if (name === 'br') {
|
50
|
+
text += '\n';
|
51
|
+
return;
|
52
|
+
}
|
53
|
+
|
54
|
+
// img/input/hr
|
55
|
+
if (shortEndedElements[name]) {
|
56
|
+
text += ' ';
|
57
|
+
}
|
58
|
+
|
59
|
+
// Ingore script, video contents
|
60
|
+
if (ignoreElements[name]) {
|
61
|
+
text += ' ';
|
62
|
+
return;
|
63
|
+
}
|
64
|
+
|
65
|
+
if (node.type == 3) {
|
66
|
+
text += node.value;
|
67
|
+
}
|
68
|
+
|
69
|
+
// Walk all children
|
70
|
+
if (!node.shortEnded) {
|
71
|
+
if ((node = node.firstChild)) {
|
72
|
+
do {
|
73
|
+
walk(node);
|
74
|
+
} while ((node = node.next));
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
// Add \n or \n\n for blocks or P
|
79
|
+
if (blockElements[name] && currentNode.next) {
|
80
|
+
text += '\n';
|
81
|
+
|
82
|
+
if (name == 'p') {
|
83
|
+
text += '\n';
|
84
|
+
}
|
85
|
+
}
|
86
|
+
}
|
87
|
+
|
88
|
+
html = filter(html, [
|
89
|
+
/<!\[[^\]]+\]>/g // Conditional comments
|
90
|
+
]);
|
91
|
+
|
92
|
+
walk(domParser.parse(html));
|
93
|
+
|
94
|
+
return text;
|
95
|
+
}
|
96
|
+
|
97
|
+
/**
|
98
|
+
* Trims the specified HTML by removing all WebKit fragments, all elements wrapping the body trailing BR elements etc.
|
99
|
+
*
|
100
|
+
* @param {String} html Html string to trim contents on.
|
101
|
+
* @return {String} Html contents that got trimmed.
|
102
|
+
*/
|
103
|
+
function trimHtml(html) {
|
104
|
+
function trimSpaces(all, s1, s2) {
|
105
|
+
// WebKit meant to preserve multiple spaces but instead inserted around all inline tags,
|
106
|
+
// including the spans with inline styles created on paste
|
107
|
+
if (!s1 && !s2) {
|
108
|
+
return ' ';
|
109
|
+
}
|
110
|
+
|
111
|
+
return '\u00a0';
|
112
|
+
}
|
113
|
+
|
114
|
+
html = filter(html, [
|
115
|
+
/^[\s\S]*<body[^>]*>\s*|\s*<\/body[^>]*>[\s\S]*$/g, // Remove anything but the contents within the BODY element
|
116
|
+
/<!--StartFragment-->|<!--EndFragment-->/g, // Inner fragments (tables from excel on mac)
|
117
|
+
[/( ?)<span class="Apple-converted-space">\u00a0<\/span>( ?)/g, trimSpaces],
|
118
|
+
/<br class="Apple-interchange-newline">/g,
|
119
|
+
/<br>$/i // Trailing BR elements
|
120
|
+
]);
|
121
|
+
|
122
|
+
return html;
|
123
|
+
}
|
124
|
+
|
125
|
+
// TODO: Should be in some global class
|
126
|
+
function createIdGenerator(prefix) {
|
127
|
+
var count = 0;
|
128
|
+
|
129
|
+
return function() {
|
130
|
+
return prefix + (count++);
|
131
|
+
};
|
132
|
+
}
|
133
|
+
|
134
|
+
return {
|
135
|
+
filter: filter,
|
136
|
+
innerText: innerText,
|
137
|
+
trimHtml: trimHtml,
|
138
|
+
createIdGenerator: createIdGenerator
|
139
|
+
};
|
140
|
+
});
|
@@ -0,0 +1,500 @@
|
|
1
|
+
/**
|
2
|
+
* WordFilter.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 parses word HTML into proper TinyMCE markup.
|
13
|
+
*
|
14
|
+
* @class tinymce.pasteplugin.WordFilter
|
15
|
+
* @private
|
16
|
+
*/
|
17
|
+
define("tinymce/pasteplugin/WordFilter", [
|
18
|
+
"tinymce/util/Tools",
|
19
|
+
"tinymce/html/DomParser",
|
20
|
+
"tinymce/html/Schema",
|
21
|
+
"tinymce/html/Serializer",
|
22
|
+
"tinymce/html/Node",
|
23
|
+
"tinymce/pasteplugin/Utils"
|
24
|
+
], function(Tools, DomParser, Schema, Serializer, Node, Utils) {
|
25
|
+
/**
|
26
|
+
* Checks if the specified content is from any of the following sources: MS Word/Office 365/Google docs.
|
27
|
+
*/
|
28
|
+
function isWordContent(content) {
|
29
|
+
return (
|
30
|
+
(/<font face="Times New Roman"|class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i).test(content) ||
|
31
|
+
(/class="OutlineElement/).test(content) ||
|
32
|
+
(/id="?docs\-internal\-guid\-/.test(content))
|
33
|
+
);
|
34
|
+
}
|
35
|
+
|
36
|
+
/**
|
37
|
+
* Checks if the specified text starts with "1. " or "a. " etc.
|
38
|
+
*/
|
39
|
+
function isNumericList(text) {
|
40
|
+
var found, patterns;
|
41
|
+
|
42
|
+
patterns = [
|
43
|
+
/^[IVXLMCD]{1,2}\.[ \u00a0]/, // Roman upper case
|
44
|
+
/^[ivxlmcd]{1,2}\.[ \u00a0]/, // Roman lower case
|
45
|
+
/^[a-z]{1,2}[\.\)][ \u00a0]/, // Alphabetical a-z
|
46
|
+
/^[A-Z]{1,2}[\.\)][ \u00a0]/, // Alphabetical A-Z
|
47
|
+
/^[0-9]+\.[ \u00a0]/, // Numeric lists
|
48
|
+
/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/, // Japanese
|
49
|
+
/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/ // Chinese
|
50
|
+
];
|
51
|
+
|
52
|
+
text = text.replace(/^[\u00a0 ]+/, '');
|
53
|
+
|
54
|
+
Tools.each(patterns, function(pattern) {
|
55
|
+
if (pattern.test(text)) {
|
56
|
+
found = true;
|
57
|
+
return false;
|
58
|
+
}
|
59
|
+
});
|
60
|
+
|
61
|
+
return found;
|
62
|
+
}
|
63
|
+
|
64
|
+
function isBulletList(text) {
|
65
|
+
return /^[\s\u00a0]*[\u2022\u00b7\u00a7\u25CF]\s*/.test(text);
|
66
|
+
}
|
67
|
+
|
68
|
+
function WordFilter(editor) {
|
69
|
+
var settings = editor.settings;
|
70
|
+
|
71
|
+
editor.on('BeforePastePreProcess', function(e) {
|
72
|
+
var content = e.content, retainStyleProperties, validStyles;
|
73
|
+
|
74
|
+
// Remove google docs internal guid markers
|
75
|
+
content = content.replace(/<b[^>]+id="?docs-internal-[^>]*>/gi, '');
|
76
|
+
content = content.replace(/<br class="?Apple-interchange-newline"?>/gi, '');
|
77
|
+
|
78
|
+
retainStyleProperties = settings.paste_retain_style_properties;
|
79
|
+
if (retainStyleProperties) {
|
80
|
+
validStyles = Tools.makeMap(retainStyleProperties.split(/[, ]/));
|
81
|
+
}
|
82
|
+
|
83
|
+
/**
|
84
|
+
* Converts fake bullet and numbered lists to real semantic OL/UL.
|
85
|
+
*
|
86
|
+
* @param {tinymce.html.Node} node Root node to convert children of.
|
87
|
+
*/
|
88
|
+
function convertFakeListsToProperLists(node) {
|
89
|
+
var currentListNode, prevListNode, lastLevel = 1;
|
90
|
+
|
91
|
+
function getText(node) {
|
92
|
+
var txt = '';
|
93
|
+
|
94
|
+
if (node.type === 3) {
|
95
|
+
return node.value;
|
96
|
+
}
|
97
|
+
|
98
|
+
if ((node = node.firstChild)) {
|
99
|
+
do {
|
100
|
+
txt += getText(node);
|
101
|
+
} while ((node = node.next));
|
102
|
+
}
|
103
|
+
|
104
|
+
return txt;
|
105
|
+
}
|
106
|
+
|
107
|
+
function trimListStart(node, regExp) {
|
108
|
+
if (node.type === 3) {
|
109
|
+
if (regExp.test(node.value)) {
|
110
|
+
node.value = node.value.replace(regExp, '');
|
111
|
+
return false;
|
112
|
+
}
|
113
|
+
}
|
114
|
+
|
115
|
+
if ((node = node.firstChild)) {
|
116
|
+
do {
|
117
|
+
if (!trimListStart(node, regExp)) {
|
118
|
+
return false;
|
119
|
+
}
|
120
|
+
} while ((node = node.next));
|
121
|
+
}
|
122
|
+
|
123
|
+
return true;
|
124
|
+
}
|
125
|
+
|
126
|
+
function removeIgnoredNodes(node) {
|
127
|
+
if (node._listIgnore) {
|
128
|
+
node.remove();
|
129
|
+
return;
|
130
|
+
}
|
131
|
+
|
132
|
+
if ((node = node.firstChild)) {
|
133
|
+
do {
|
134
|
+
removeIgnoredNodes(node);
|
135
|
+
} while ((node = node.next));
|
136
|
+
}
|
137
|
+
}
|
138
|
+
|
139
|
+
function convertParagraphToLi(paragraphNode, listName, start) {
|
140
|
+
var level = paragraphNode._listLevel || lastLevel;
|
141
|
+
|
142
|
+
// Handle list nesting
|
143
|
+
if (level != lastLevel) {
|
144
|
+
if (level < lastLevel) {
|
145
|
+
// Move to parent list
|
146
|
+
if (currentListNode) {
|
147
|
+
currentListNode = currentListNode.parent.parent;
|
148
|
+
}
|
149
|
+
} else {
|
150
|
+
// Create new list
|
151
|
+
prevListNode = currentListNode;
|
152
|
+
currentListNode = null;
|
153
|
+
}
|
154
|
+
}
|
155
|
+
|
156
|
+
if (!currentListNode || currentListNode.name != listName) {
|
157
|
+
prevListNode = prevListNode || currentListNode;
|
158
|
+
currentListNode = new Node(listName, 1);
|
159
|
+
|
160
|
+
if (start > 1) {
|
161
|
+
currentListNode.attr('start', '' + start);
|
162
|
+
}
|
163
|
+
|
164
|
+
paragraphNode.wrap(currentListNode);
|
165
|
+
} else {
|
166
|
+
currentListNode.append(paragraphNode);
|
167
|
+
}
|
168
|
+
|
169
|
+
paragraphNode.name = 'li';
|
170
|
+
|
171
|
+
// Append list to previous list if it exists
|
172
|
+
if (level > lastLevel && prevListNode) {
|
173
|
+
prevListNode.lastChild.append(currentListNode);
|
174
|
+
}
|
175
|
+
|
176
|
+
lastLevel = level;
|
177
|
+
|
178
|
+
// Remove start of list item "1. " or "· " etc
|
179
|
+
removeIgnoredNodes(paragraphNode);
|
180
|
+
trimListStart(paragraphNode, /^\u00a0+/);
|
181
|
+
trimListStart(paragraphNode, /^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/);
|
182
|
+
trimListStart(paragraphNode, /^\u00a0+/);
|
183
|
+
}
|
184
|
+
|
185
|
+
// Build a list of all root level elements before we start
|
186
|
+
// altering them in the loop below.
|
187
|
+
var elements = [], child = node.firstChild;
|
188
|
+
while (typeof child !== 'undefined' && child !== null) {
|
189
|
+
elements.push(child);
|
190
|
+
|
191
|
+
child = child.walk();
|
192
|
+
if (child !== null) {
|
193
|
+
while (typeof child !== 'undefined' && child.parent !== node) {
|
194
|
+
child = child.walk();
|
195
|
+
}
|
196
|
+
}
|
197
|
+
}
|
198
|
+
|
199
|
+
for (var i = 0; i < elements.length; i++) {
|
200
|
+
node = elements[i];
|
201
|
+
|
202
|
+
if (node.name == 'p' && node.firstChild) {
|
203
|
+
// Find first text node in paragraph
|
204
|
+
var nodeText = getText(node);
|
205
|
+
|
206
|
+
// Detect unordered lists look for bullets
|
207
|
+
if (isBulletList(nodeText)) {
|
208
|
+
convertParagraphToLi(node, 'ul');
|
209
|
+
continue;
|
210
|
+
}
|
211
|
+
|
212
|
+
// Detect ordered lists 1., a. or ixv.
|
213
|
+
if (isNumericList(nodeText)) {
|
214
|
+
// Parse OL start number
|
215
|
+
var matches = /([0-9]+)\./.exec(nodeText);
|
216
|
+
var start = 1;
|
217
|
+
if (matches) {
|
218
|
+
start = parseInt(matches[1], 10);
|
219
|
+
}
|
220
|
+
|
221
|
+
convertParagraphToLi(node, 'ol', start);
|
222
|
+
continue;
|
223
|
+
}
|
224
|
+
|
225
|
+
// Convert paragraphs marked as lists but doesn't look like anything
|
226
|
+
if (node._listLevel) {
|
227
|
+
convertParagraphToLi(node, 'ul', 1);
|
228
|
+
continue;
|
229
|
+
}
|
230
|
+
|
231
|
+
currentListNode = null;
|
232
|
+
} else {
|
233
|
+
// If the root level element isn't a p tag which can be
|
234
|
+
// processed by convertParagraphToLi, it interrupts the
|
235
|
+
// lists, causing a new list to start instead of having
|
236
|
+
// elements from the next list inserted above this tag.
|
237
|
+
prevListNode = currentListNode;
|
238
|
+
currentListNode = null;
|
239
|
+
}
|
240
|
+
}
|
241
|
+
}
|
242
|
+
|
243
|
+
function filterStyles(node, styleValue) {
|
244
|
+
var outputStyles = {}, matches, styles = editor.dom.parseStyle(styleValue);
|
245
|
+
|
246
|
+
Tools.each(styles, function(value, name) {
|
247
|
+
// Convert various MS styles to W3C styles
|
248
|
+
switch (name) {
|
249
|
+
case 'mso-list':
|
250
|
+
// Parse out list indent level for lists
|
251
|
+
matches = /\w+ \w+([0-9]+)/i.exec(styleValue);
|
252
|
+
if (matches) {
|
253
|
+
node._listLevel = parseInt(matches[1], 10);
|
254
|
+
}
|
255
|
+
|
256
|
+
// Remove these nodes <span style="mso-list:Ignore">o</span>
|
257
|
+
// Since the span gets removed we mark the text node and the span
|
258
|
+
if (/Ignore/i.test(value) && node.firstChild) {
|
259
|
+
node._listIgnore = true;
|
260
|
+
node.firstChild._listIgnore = true;
|
261
|
+
}
|
262
|
+
|
263
|
+
break;
|
264
|
+
|
265
|
+
case "horiz-align":
|
266
|
+
name = "text-align";
|
267
|
+
break;
|
268
|
+
|
269
|
+
case "vert-align":
|
270
|
+
name = "vertical-align";
|
271
|
+
break;
|
272
|
+
|
273
|
+
case "font-color":
|
274
|
+
case "mso-foreground":
|
275
|
+
name = "color";
|
276
|
+
break;
|
277
|
+
|
278
|
+
case "mso-background":
|
279
|
+
case "mso-highlight":
|
280
|
+
name = "background";
|
281
|
+
break;
|
282
|
+
|
283
|
+
case "font-weight":
|
284
|
+
case "font-style":
|
285
|
+
if (value != "normal") {
|
286
|
+
outputStyles[name] = value;
|
287
|
+
}
|
288
|
+
return;
|
289
|
+
|
290
|
+
case "mso-element":
|
291
|
+
// Remove track changes code
|
292
|
+
if (/^(comment|comment-list)$/i.test(value)) {
|
293
|
+
node.remove();
|
294
|
+
return;
|
295
|
+
}
|
296
|
+
|
297
|
+
break;
|
298
|
+
}
|
299
|
+
|
300
|
+
if (name.indexOf('mso-comment') === 0) {
|
301
|
+
node.remove();
|
302
|
+
return;
|
303
|
+
}
|
304
|
+
|
305
|
+
// Never allow mso- prefixed names
|
306
|
+
if (name.indexOf('mso-') === 0) {
|
307
|
+
return;
|
308
|
+
}
|
309
|
+
|
310
|
+
// Output only valid styles
|
311
|
+
if (retainStyleProperties == "all" || (validStyles && validStyles[name])) {
|
312
|
+
outputStyles[name] = value;
|
313
|
+
}
|
314
|
+
});
|
315
|
+
|
316
|
+
// Convert bold style to "b" element
|
317
|
+
if (/(bold)/i.test(outputStyles["font-weight"])) {
|
318
|
+
delete outputStyles["font-weight"];
|
319
|
+
node.wrap(new Node("b", 1));
|
320
|
+
}
|
321
|
+
|
322
|
+
// Convert italic style to "i" element
|
323
|
+
if (/(italic)/i.test(outputStyles["font-style"])) {
|
324
|
+
delete outputStyles["font-style"];
|
325
|
+
node.wrap(new Node("i", 1));
|
326
|
+
}
|
327
|
+
|
328
|
+
// Serialize the styles and see if there is something left to keep
|
329
|
+
outputStyles = editor.dom.serializeStyle(outputStyles, node.name);
|
330
|
+
if (outputStyles) {
|
331
|
+
return outputStyles;
|
332
|
+
}
|
333
|
+
|
334
|
+
return null;
|
335
|
+
}
|
336
|
+
|
337
|
+
if (settings.paste_enable_default_filters === false) {
|
338
|
+
return;
|
339
|
+
}
|
340
|
+
|
341
|
+
// Detect is the contents is Word junk HTML
|
342
|
+
if (isWordContent(e.content)) {
|
343
|
+
e.wordContent = true; // Mark it for other processors
|
344
|
+
|
345
|
+
// Remove basic Word junk
|
346
|
+
content = Utils.filter(content, [
|
347
|
+
// Word comments like conditional comments etc
|
348
|
+
/<!--[\s\S]+?-->/gi,
|
349
|
+
|
350
|
+
// Remove comments, scripts (e.g., msoShowComment), XML tag, VML content,
|
351
|
+
// MS Office namespaced tags, and a few other tags
|
352
|
+
/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,
|
353
|
+
|
354
|
+
// Convert <s> into <strike> for line-though
|
355
|
+
[/<(\/?)s>/gi, "<$1strike>"],
|
356
|
+
|
357
|
+
// Replace nsbp entites to char since it's easier to handle
|
358
|
+
[/ /gi, "\u00a0"],
|
359
|
+
|
360
|
+
// Convert <span style="mso-spacerun:yes">___</span> to string of alternating
|
361
|
+
// breaking/non-breaking spaces of same length
|
362
|
+
[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,
|
363
|
+
function(str, spaces) {
|
364
|
+
return (spaces.length > 0) ?
|
365
|
+
spaces.replace(/./, " ").slice(Math.floor(spaces.length / 2)).split("").join("\u00a0") : "";
|
366
|
+
}
|
367
|
+
]
|
368
|
+
]);
|
369
|
+
|
370
|
+
var validElements = settings.paste_word_valid_elements;
|
371
|
+
if (!validElements) {
|
372
|
+
validElements = (
|
373
|
+
'-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,' +
|
374
|
+
'-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,' +
|
375
|
+
'td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody'
|
376
|
+
);
|
377
|
+
}
|
378
|
+
|
379
|
+
// Setup strict schema
|
380
|
+
var schema = new Schema({
|
381
|
+
valid_elements: validElements,
|
382
|
+
valid_children: '-li[p]'
|
383
|
+
});
|
384
|
+
|
385
|
+
// Add style/class attribute to all element rules since the user might have removed them from
|
386
|
+
// paste_word_valid_elements config option and we need to check them for properties
|
387
|
+
Tools.each(schema.elements, function(rule) {
|
388
|
+
/*eslint dot-notation:0*/
|
389
|
+
if (!rule.attributes["class"]) {
|
390
|
+
rule.attributes["class"] = {};
|
391
|
+
rule.attributesOrder.push("class");
|
392
|
+
}
|
393
|
+
|
394
|
+
if (!rule.attributes.style) {
|
395
|
+
rule.attributes.style = {};
|
396
|
+
rule.attributesOrder.push("style");
|
397
|
+
}
|
398
|
+
});
|
399
|
+
|
400
|
+
// Parse HTML into DOM structure
|
401
|
+
var domParser = new DomParser({}, schema);
|
402
|
+
|
403
|
+
// Filter styles to remove "mso" specific styles and convert some of them
|
404
|
+
domParser.addAttributeFilter('style', function(nodes) {
|
405
|
+
var i = nodes.length, node;
|
406
|
+
|
407
|
+
while (i--) {
|
408
|
+
node = nodes[i];
|
409
|
+
node.attr('style', filterStyles(node, node.attr('style')));
|
410
|
+
|
411
|
+
// Remove pointess spans
|
412
|
+
if (node.name == 'span' && node.parent && !node.attributes.length) {
|
413
|
+
node.unwrap();
|
414
|
+
}
|
415
|
+
}
|
416
|
+
});
|
417
|
+
|
418
|
+
// Check the class attribute for comments or del items and remove those
|
419
|
+
domParser.addAttributeFilter('class', function(nodes) {
|
420
|
+
var i = nodes.length, node, className;
|
421
|
+
|
422
|
+
while (i--) {
|
423
|
+
node = nodes[i];
|
424
|
+
|
425
|
+
className = node.attr('class');
|
426
|
+
if (/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(className)) {
|
427
|
+
node.remove();
|
428
|
+
}
|
429
|
+
|
430
|
+
node.attr('class', null);
|
431
|
+
}
|
432
|
+
});
|
433
|
+
|
434
|
+
// Remove all del elements since we don't want the track changes code in the editor
|
435
|
+
domParser.addNodeFilter('del', function(nodes) {
|
436
|
+
var i = nodes.length;
|
437
|
+
|
438
|
+
while (i--) {
|
439
|
+
nodes[i].remove();
|
440
|
+
}
|
441
|
+
});
|
442
|
+
|
443
|
+
// Keep some of the links and anchors
|
444
|
+
domParser.addNodeFilter('a', function(nodes) {
|
445
|
+
var i = nodes.length, node, href, name;
|
446
|
+
|
447
|
+
while (i--) {
|
448
|
+
node = nodes[i];
|
449
|
+
href = node.attr('href');
|
450
|
+
name = node.attr('name');
|
451
|
+
|
452
|
+
if (href && href.indexOf('#_msocom_') != -1) {
|
453
|
+
node.remove();
|
454
|
+
continue;
|
455
|
+
}
|
456
|
+
|
457
|
+
if (href && href.indexOf('file://') === 0) {
|
458
|
+
href = href.split('#')[1];
|
459
|
+
if (href) {
|
460
|
+
href = '#' + href;
|
461
|
+
}
|
462
|
+
}
|
463
|
+
|
464
|
+
if (!href && !name) {
|
465
|
+
node.unwrap();
|
466
|
+
} else {
|
467
|
+
// Remove all named anchors that aren't specific to TOC, Footnotes or Endnotes
|
468
|
+
if (name && !/^_?(?:toc|edn|ftn)/i.test(name)) {
|
469
|
+
node.unwrap();
|
470
|
+
continue;
|
471
|
+
}
|
472
|
+
|
473
|
+
node.attr({
|
474
|
+
href: href,
|
475
|
+
name: name
|
476
|
+
});
|
477
|
+
}
|
478
|
+
}
|
479
|
+
});
|
480
|
+
|
481
|
+
// Parse into DOM structure
|
482
|
+
var rootNode = domParser.parse(content);
|
483
|
+
|
484
|
+
// Process DOM
|
485
|
+
if (settings.paste_convert_word_fake_lists !== false) {
|
486
|
+
convertFakeListsToProperLists(rootNode);
|
487
|
+
}
|
488
|
+
|
489
|
+
// Serialize DOM back to HTML
|
490
|
+
e.content = new Serializer({
|
491
|
+
validate: settings.validate
|
492
|
+
}, schema).serialize(rootNode);
|
493
|
+
}
|
494
|
+
});
|
495
|
+
}
|
496
|
+
|
497
|
+
WordFilter.isWordContent = isWordContent;
|
498
|
+
|
499
|
+
return WordFilter;
|
500
|
+
});
|