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,822 @@
|
|
1
|
+
/**
|
2
|
+
* DomParser.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 HTML code into a DOM like structure of nodes it will remove redundant whitespace and make
|
13
|
+
* sure that the node tree is valid according to the specified schema.
|
14
|
+
* So for example: <p>a<p>b</p>c</p> will become <p>a</p><p>b</p><p>c</p>
|
15
|
+
*
|
16
|
+
* @example
|
17
|
+
* var parser = new tinymce.html.DomParser({validate: true}, schema);
|
18
|
+
* var rootNode = parser.parse('<h1>content</h1>');
|
19
|
+
*
|
20
|
+
* @class tinymce.html.DomParser
|
21
|
+
* @version 3.4
|
22
|
+
*/
|
23
|
+
define("tinymce/html/DomParser", [
|
24
|
+
"tinymce/html/Node",
|
25
|
+
"tinymce/html/Schema",
|
26
|
+
"tinymce/html/SaxParser",
|
27
|
+
"tinymce/util/Tools"
|
28
|
+
], function(Node, Schema, SaxParser, Tools) {
|
29
|
+
var makeMap = Tools.makeMap, each = Tools.each, explode = Tools.explode, extend = Tools.extend;
|
30
|
+
|
31
|
+
/**
|
32
|
+
* Constructs a new DomParser instance.
|
33
|
+
*
|
34
|
+
* @constructor
|
35
|
+
* @method DomParser
|
36
|
+
* @param {Object} settings Name/value collection of settings. comment, cdata, text, start and end are callbacks.
|
37
|
+
* @param {tinymce.html.Schema} schema HTML Schema class to use when parsing.
|
38
|
+
*/
|
39
|
+
return function(settings, schema) {
|
40
|
+
var self = this, nodeFilters = {}, attributeFilters = [], matchedNodes = {}, matchedAttributes = {};
|
41
|
+
|
42
|
+
settings = settings || {};
|
43
|
+
settings.validate = "validate" in settings ? settings.validate : true;
|
44
|
+
settings.root_name = settings.root_name || 'body';
|
45
|
+
self.schema = schema = schema || new Schema();
|
46
|
+
|
47
|
+
function fixInvalidChildren(nodes) {
|
48
|
+
var ni, node, parent, parents, newParent, currentNode, tempNode, childNode, i;
|
49
|
+
var nonEmptyElements, nonSplitableElements, textBlockElements, specialElements, sibling, nextNode;
|
50
|
+
|
51
|
+
nonSplitableElements = makeMap('tr,td,th,tbody,thead,tfoot,table');
|
52
|
+
nonEmptyElements = schema.getNonEmptyElements();
|
53
|
+
textBlockElements = schema.getTextBlockElements();
|
54
|
+
specialElements = schema.getSpecialElements();
|
55
|
+
|
56
|
+
for (ni = 0; ni < nodes.length; ni++) {
|
57
|
+
node = nodes[ni];
|
58
|
+
|
59
|
+
// Already removed or fixed
|
60
|
+
if (!node.parent || node.fixed) {
|
61
|
+
continue;
|
62
|
+
}
|
63
|
+
|
64
|
+
// If the invalid element is a text block and the text block is within a parent LI element
|
65
|
+
// Then unwrap the first text block and convert other sibling text blocks to LI elements similar to Word/Open Office
|
66
|
+
if (textBlockElements[node.name] && node.parent.name == 'li') {
|
67
|
+
// Move sibling text blocks after LI element
|
68
|
+
sibling = node.next;
|
69
|
+
while (sibling) {
|
70
|
+
if (textBlockElements[sibling.name]) {
|
71
|
+
sibling.name = 'li';
|
72
|
+
sibling.fixed = true;
|
73
|
+
node.parent.insert(sibling, node.parent);
|
74
|
+
} else {
|
75
|
+
break;
|
76
|
+
}
|
77
|
+
|
78
|
+
sibling = sibling.next;
|
79
|
+
}
|
80
|
+
|
81
|
+
// Unwrap current text block
|
82
|
+
node.unwrap(node);
|
83
|
+
continue;
|
84
|
+
}
|
85
|
+
|
86
|
+
// Get list of all parent nodes until we find a valid parent to stick the child into
|
87
|
+
parents = [node];
|
88
|
+
for (parent = node.parent; parent && !schema.isValidChild(parent.name, node.name) &&
|
89
|
+
!nonSplitableElements[parent.name]; parent = parent.parent) {
|
90
|
+
parents.push(parent);
|
91
|
+
}
|
92
|
+
|
93
|
+
// Found a suitable parent
|
94
|
+
if (parent && parents.length > 1) {
|
95
|
+
// Reverse the array since it makes looping easier
|
96
|
+
parents.reverse();
|
97
|
+
|
98
|
+
// Clone the related parent and insert that after the moved node
|
99
|
+
newParent = currentNode = self.filterNode(parents[0].clone());
|
100
|
+
|
101
|
+
// Start cloning and moving children on the left side of the target node
|
102
|
+
for (i = 0; i < parents.length - 1; i++) {
|
103
|
+
if (schema.isValidChild(currentNode.name, parents[i].name)) {
|
104
|
+
tempNode = self.filterNode(parents[i].clone());
|
105
|
+
currentNode.append(tempNode);
|
106
|
+
} else {
|
107
|
+
tempNode = currentNode;
|
108
|
+
}
|
109
|
+
|
110
|
+
for (childNode = parents[i].firstChild; childNode && childNode != parents[i + 1];) {
|
111
|
+
nextNode = childNode.next;
|
112
|
+
tempNode.append(childNode);
|
113
|
+
childNode = nextNode;
|
114
|
+
}
|
115
|
+
|
116
|
+
currentNode = tempNode;
|
117
|
+
}
|
118
|
+
|
119
|
+
if (!newParent.isEmpty(nonEmptyElements)) {
|
120
|
+
parent.insert(newParent, parents[0], true);
|
121
|
+
parent.insert(node, newParent);
|
122
|
+
} else {
|
123
|
+
parent.insert(node, parents[0], true);
|
124
|
+
}
|
125
|
+
|
126
|
+
// Check if the element is empty by looking through it's contents and special treatment for <p><br /></p>
|
127
|
+
parent = parents[0];
|
128
|
+
if (parent.isEmpty(nonEmptyElements) || parent.firstChild === parent.lastChild && parent.firstChild.name === 'br') {
|
129
|
+
parent.empty().remove();
|
130
|
+
}
|
131
|
+
} else if (node.parent) {
|
132
|
+
// If it's an LI try to find a UL/OL for it or wrap it
|
133
|
+
if (node.name === 'li') {
|
134
|
+
sibling = node.prev;
|
135
|
+
if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) {
|
136
|
+
sibling.append(node);
|
137
|
+
continue;
|
138
|
+
}
|
139
|
+
|
140
|
+
sibling = node.next;
|
141
|
+
if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) {
|
142
|
+
sibling.insert(node, sibling.firstChild, true);
|
143
|
+
continue;
|
144
|
+
}
|
145
|
+
|
146
|
+
node.wrap(self.filterNode(new Node('ul', 1)));
|
147
|
+
continue;
|
148
|
+
}
|
149
|
+
|
150
|
+
// Try wrapping the element in a DIV
|
151
|
+
if (schema.isValidChild(node.parent.name, 'div') && schema.isValidChild('div', node.name)) {
|
152
|
+
node.wrap(self.filterNode(new Node('div', 1)));
|
153
|
+
} else {
|
154
|
+
// We failed wrapping it, then remove or unwrap it
|
155
|
+
if (specialElements[node.name]) {
|
156
|
+
node.empty().remove();
|
157
|
+
} else {
|
158
|
+
node.unwrap();
|
159
|
+
}
|
160
|
+
}
|
161
|
+
}
|
162
|
+
}
|
163
|
+
}
|
164
|
+
|
165
|
+
/**
|
166
|
+
* Runs the specified node though the element and attributes filters.
|
167
|
+
*
|
168
|
+
* @method filterNode
|
169
|
+
* @param {tinymce.html.Node} Node the node to run filters on.
|
170
|
+
* @return {tinymce.html.Node} The passed in node.
|
171
|
+
*/
|
172
|
+
self.filterNode = function(node) {
|
173
|
+
var i, name, list;
|
174
|
+
|
175
|
+
// Run element filters
|
176
|
+
if (name in nodeFilters) {
|
177
|
+
list = matchedNodes[name];
|
178
|
+
|
179
|
+
if (list) {
|
180
|
+
list.push(node);
|
181
|
+
} else {
|
182
|
+
matchedNodes[name] = [node];
|
183
|
+
}
|
184
|
+
}
|
185
|
+
|
186
|
+
// Run attribute filters
|
187
|
+
i = attributeFilters.length;
|
188
|
+
while (i--) {
|
189
|
+
name = attributeFilters[i].name;
|
190
|
+
|
191
|
+
if (name in node.attributes.map) {
|
192
|
+
list = matchedAttributes[name];
|
193
|
+
|
194
|
+
if (list) {
|
195
|
+
list.push(node);
|
196
|
+
} else {
|
197
|
+
matchedAttributes[name] = [node];
|
198
|
+
}
|
199
|
+
}
|
200
|
+
}
|
201
|
+
|
202
|
+
return node;
|
203
|
+
};
|
204
|
+
|
205
|
+
/**
|
206
|
+
* Adds a node filter function to the parser, the parser will collect the specified nodes by name
|
207
|
+
* and then execute the callback ones it has finished parsing the document.
|
208
|
+
*
|
209
|
+
* @example
|
210
|
+
* parser.addNodeFilter('p,h1', function(nodes, name) {
|
211
|
+
* for (var i = 0; i < nodes.length; i++) {
|
212
|
+
* console.log(nodes[i].name);
|
213
|
+
* }
|
214
|
+
* });
|
215
|
+
* @method addNodeFilter
|
216
|
+
* @method {String} name Comma separated list of nodes to collect.
|
217
|
+
* @param {function} callback Callback function to execute once it has collected nodes.
|
218
|
+
*/
|
219
|
+
self.addNodeFilter = function(name, callback) {
|
220
|
+
each(explode(name), function(name) {
|
221
|
+
var list = nodeFilters[name];
|
222
|
+
|
223
|
+
if (!list) {
|
224
|
+
nodeFilters[name] = list = [];
|
225
|
+
}
|
226
|
+
|
227
|
+
list.push(callback);
|
228
|
+
});
|
229
|
+
};
|
230
|
+
|
231
|
+
/**
|
232
|
+
* Adds a attribute filter function to the parser, the parser will collect nodes that has the specified attributes
|
233
|
+
* and then execute the callback ones it has finished parsing the document.
|
234
|
+
*
|
235
|
+
* @example
|
236
|
+
* parser.addAttributeFilter('src,href', function(nodes, name) {
|
237
|
+
* for (var i = 0; i < nodes.length; i++) {
|
238
|
+
* console.log(nodes[i].name);
|
239
|
+
* }
|
240
|
+
* });
|
241
|
+
* @method addAttributeFilter
|
242
|
+
* @method {String} name Comma separated list of nodes to collect.
|
243
|
+
* @param {function} callback Callback function to execute once it has collected nodes.
|
244
|
+
*/
|
245
|
+
self.addAttributeFilter = function(name, callback) {
|
246
|
+
each(explode(name), function(name) {
|
247
|
+
var i;
|
248
|
+
|
249
|
+
for (i = 0; i < attributeFilters.length; i++) {
|
250
|
+
if (attributeFilters[i].name === name) {
|
251
|
+
attributeFilters[i].callbacks.push(callback);
|
252
|
+
return;
|
253
|
+
}
|
254
|
+
}
|
255
|
+
|
256
|
+
attributeFilters.push({name: name, callbacks: [callback]});
|
257
|
+
});
|
258
|
+
};
|
259
|
+
|
260
|
+
/**
|
261
|
+
* Parses the specified HTML string into a DOM like node tree and returns the result.
|
262
|
+
*
|
263
|
+
* @example
|
264
|
+
* var rootNode = new DomParser({...}).parse('<b>text</b>');
|
265
|
+
* @method parse
|
266
|
+
* @param {String} html Html string to sax parse.
|
267
|
+
* @param {Object} args Optional args object that gets passed to all filter functions.
|
268
|
+
* @return {tinymce.html.Node} Root node containing the tree.
|
269
|
+
*/
|
270
|
+
self.parse = function(html, args) {
|
271
|
+
var parser, rootNode, node, nodes, i, l, fi, fl, list, name, validate;
|
272
|
+
var blockElements, startWhiteSpaceRegExp, invalidChildren = [], isInWhiteSpacePreservedElement;
|
273
|
+
var endWhiteSpaceRegExp, allWhiteSpaceRegExp, isAllWhiteSpaceRegExp, whiteSpaceElements;
|
274
|
+
var children, nonEmptyElements, rootBlockName;
|
275
|
+
|
276
|
+
args = args || {};
|
277
|
+
matchedNodes = {};
|
278
|
+
matchedAttributes = {};
|
279
|
+
blockElements = extend(makeMap('script,style,head,html,body,title,meta,param'), schema.getBlockElements());
|
280
|
+
nonEmptyElements = schema.getNonEmptyElements();
|
281
|
+
children = schema.children;
|
282
|
+
validate = settings.validate;
|
283
|
+
rootBlockName = "forced_root_block" in args ? args.forced_root_block : settings.forced_root_block;
|
284
|
+
|
285
|
+
whiteSpaceElements = schema.getWhiteSpaceElements();
|
286
|
+
startWhiteSpaceRegExp = /^[ \t\r\n]+/;
|
287
|
+
endWhiteSpaceRegExp = /[ \t\r\n]+$/;
|
288
|
+
allWhiteSpaceRegExp = /[ \t\r\n]+/g;
|
289
|
+
isAllWhiteSpaceRegExp = /^[ \t\r\n]+$/;
|
290
|
+
|
291
|
+
function addRootBlocks() {
|
292
|
+
var node = rootNode.firstChild, next, rootBlockNode;
|
293
|
+
|
294
|
+
// Removes whitespace at beginning and end of block so:
|
295
|
+
// <p> x </p> -> <p>x</p>
|
296
|
+
function trim(rootBlockNode) {
|
297
|
+
if (rootBlockNode) {
|
298
|
+
node = rootBlockNode.firstChild;
|
299
|
+
if (node && node.type == 3) {
|
300
|
+
node.value = node.value.replace(startWhiteSpaceRegExp, '');
|
301
|
+
}
|
302
|
+
|
303
|
+
node = rootBlockNode.lastChild;
|
304
|
+
if (node && node.type == 3) {
|
305
|
+
node.value = node.value.replace(endWhiteSpaceRegExp, '');
|
306
|
+
}
|
307
|
+
}
|
308
|
+
}
|
309
|
+
|
310
|
+
// Check if rootBlock is valid within rootNode for example if P is valid in H1 if H1 is the contentEditabe root
|
311
|
+
if (!schema.isValidChild(rootNode.name, rootBlockName.toLowerCase())) {
|
312
|
+
return;
|
313
|
+
}
|
314
|
+
|
315
|
+
while (node) {
|
316
|
+
next = node.next;
|
317
|
+
|
318
|
+
if (node.type == 3 || (node.type == 1 && node.name !== 'p' &&
|
319
|
+
!blockElements[node.name] && !node.attr('data-mce-type'))) {
|
320
|
+
if (!rootBlockNode) {
|
321
|
+
// Create a new root block element
|
322
|
+
rootBlockNode = createNode(rootBlockName, 1);
|
323
|
+
rootBlockNode.attr(settings.forced_root_block_attrs);
|
324
|
+
rootNode.insert(rootBlockNode, node);
|
325
|
+
rootBlockNode.append(node);
|
326
|
+
} else {
|
327
|
+
rootBlockNode.append(node);
|
328
|
+
}
|
329
|
+
} else {
|
330
|
+
trim(rootBlockNode);
|
331
|
+
rootBlockNode = null;
|
332
|
+
}
|
333
|
+
|
334
|
+
node = next;
|
335
|
+
}
|
336
|
+
|
337
|
+
trim(rootBlockNode);
|
338
|
+
}
|
339
|
+
|
340
|
+
function createNode(name, type) {
|
341
|
+
var node = new Node(name, type), list;
|
342
|
+
|
343
|
+
if (name in nodeFilters) {
|
344
|
+
list = matchedNodes[name];
|
345
|
+
|
346
|
+
if (list) {
|
347
|
+
list.push(node);
|
348
|
+
} else {
|
349
|
+
matchedNodes[name] = [node];
|
350
|
+
}
|
351
|
+
}
|
352
|
+
|
353
|
+
return node;
|
354
|
+
}
|
355
|
+
|
356
|
+
function removeWhitespaceBefore(node) {
|
357
|
+
var textNode, textNodeNext, textVal, sibling, blockElements = schema.getBlockElements();
|
358
|
+
|
359
|
+
for (textNode = node.prev; textNode && textNode.type === 3;) {
|
360
|
+
textVal = textNode.value.replace(endWhiteSpaceRegExp, '');
|
361
|
+
|
362
|
+
// Found a text node with non whitespace then trim that and break
|
363
|
+
if (textVal.length > 0) {
|
364
|
+
textNode.value = textVal;
|
365
|
+
return;
|
366
|
+
}
|
367
|
+
|
368
|
+
textNodeNext = textNode.next;
|
369
|
+
|
370
|
+
// Fix for bug #7543 where bogus nodes would produce empty
|
371
|
+
// text nodes and these would be removed if a nested list was before it
|
372
|
+
if (textNodeNext) {
|
373
|
+
if (textNodeNext.type == 3 && textNodeNext.value.length) {
|
374
|
+
textNode = textNode.prev;
|
375
|
+
continue;
|
376
|
+
}
|
377
|
+
|
378
|
+
if (!blockElements[textNodeNext.name] && textNodeNext.name != 'script' && textNodeNext.name != 'style') {
|
379
|
+
textNode = textNode.prev;
|
380
|
+
continue;
|
381
|
+
}
|
382
|
+
}
|
383
|
+
|
384
|
+
sibling = textNode.prev;
|
385
|
+
textNode.remove();
|
386
|
+
textNode = sibling;
|
387
|
+
}
|
388
|
+
}
|
389
|
+
|
390
|
+
function cloneAndExcludeBlocks(input) {
|
391
|
+
var name, output = {};
|
392
|
+
|
393
|
+
for (name in input) {
|
394
|
+
if (name !== 'li' && name != 'p') {
|
395
|
+
output[name] = input[name];
|
396
|
+
}
|
397
|
+
}
|
398
|
+
|
399
|
+
return output;
|
400
|
+
}
|
401
|
+
|
402
|
+
parser = new SaxParser({
|
403
|
+
validate: validate,
|
404
|
+
allow_script_urls: settings.allow_script_urls,
|
405
|
+
allow_conditional_comments: settings.allow_conditional_comments,
|
406
|
+
|
407
|
+
// Exclude P and LI from DOM parsing since it's treated better by the DOM parser
|
408
|
+
self_closing_elements: cloneAndExcludeBlocks(schema.getSelfClosingElements()),
|
409
|
+
|
410
|
+
cdata: function(text) {
|
411
|
+
node.append(createNode('#cdata', 4)).value = text;
|
412
|
+
},
|
413
|
+
|
414
|
+
text: function(text, raw) {
|
415
|
+
var textNode;
|
416
|
+
|
417
|
+
// Trim all redundant whitespace on non white space elements
|
418
|
+
if (!isInWhiteSpacePreservedElement) {
|
419
|
+
text = text.replace(allWhiteSpaceRegExp, ' ');
|
420
|
+
|
421
|
+
if (node.lastChild && blockElements[node.lastChild.name]) {
|
422
|
+
text = text.replace(startWhiteSpaceRegExp, '');
|
423
|
+
}
|
424
|
+
}
|
425
|
+
|
426
|
+
// Do we need to create the node
|
427
|
+
if (text.length !== 0) {
|
428
|
+
textNode = createNode('#text', 3);
|
429
|
+
textNode.raw = !!raw;
|
430
|
+
node.append(textNode).value = text;
|
431
|
+
}
|
432
|
+
},
|
433
|
+
|
434
|
+
comment: function(text) {
|
435
|
+
node.append(createNode('#comment', 8)).value = text;
|
436
|
+
},
|
437
|
+
|
438
|
+
pi: function(name, text) {
|
439
|
+
node.append(createNode(name, 7)).value = text;
|
440
|
+
removeWhitespaceBefore(node);
|
441
|
+
},
|
442
|
+
|
443
|
+
doctype: function(text) {
|
444
|
+
var newNode;
|
445
|
+
|
446
|
+
newNode = node.append(createNode('#doctype', 10));
|
447
|
+
newNode.value = text;
|
448
|
+
removeWhitespaceBefore(node);
|
449
|
+
},
|
450
|
+
|
451
|
+
start: function(name, attrs, empty) {
|
452
|
+
var newNode, attrFiltersLen, elementRule, attrName, parent;
|
453
|
+
|
454
|
+
elementRule = validate ? schema.getElementRule(name) : {};
|
455
|
+
if (elementRule) {
|
456
|
+
newNode = createNode(elementRule.outputName || name, 1);
|
457
|
+
newNode.attributes = attrs;
|
458
|
+
newNode.shortEnded = empty;
|
459
|
+
|
460
|
+
node.append(newNode);
|
461
|
+
|
462
|
+
// Check if node is valid child of the parent node is the child is
|
463
|
+
// unknown we don't collect it since it's probably a custom element
|
464
|
+
parent = children[node.name];
|
465
|
+
if (parent && children[newNode.name] && !parent[newNode.name]) {
|
466
|
+
invalidChildren.push(newNode);
|
467
|
+
}
|
468
|
+
|
469
|
+
attrFiltersLen = attributeFilters.length;
|
470
|
+
while (attrFiltersLen--) {
|
471
|
+
attrName = attributeFilters[attrFiltersLen].name;
|
472
|
+
|
473
|
+
if (attrName in attrs.map) {
|
474
|
+
list = matchedAttributes[attrName];
|
475
|
+
|
476
|
+
if (list) {
|
477
|
+
list.push(newNode);
|
478
|
+
} else {
|
479
|
+
matchedAttributes[attrName] = [newNode];
|
480
|
+
}
|
481
|
+
}
|
482
|
+
}
|
483
|
+
|
484
|
+
// Trim whitespace before block
|
485
|
+
if (blockElements[name]) {
|
486
|
+
removeWhitespaceBefore(newNode);
|
487
|
+
}
|
488
|
+
|
489
|
+
// Change current node if the element wasn't empty i.e not <br /> or <img />
|
490
|
+
if (!empty) {
|
491
|
+
node = newNode;
|
492
|
+
}
|
493
|
+
|
494
|
+
// Check if we are inside a whitespace preserved element
|
495
|
+
if (!isInWhiteSpacePreservedElement && whiteSpaceElements[name]) {
|
496
|
+
isInWhiteSpacePreservedElement = true;
|
497
|
+
}
|
498
|
+
}
|
499
|
+
},
|
500
|
+
|
501
|
+
end: function(name) {
|
502
|
+
var textNode, elementRule, text, sibling, tempNode;
|
503
|
+
|
504
|
+
elementRule = validate ? schema.getElementRule(name) : {};
|
505
|
+
if (elementRule) {
|
506
|
+
if (blockElements[name]) {
|
507
|
+
if (!isInWhiteSpacePreservedElement) {
|
508
|
+
// Trim whitespace of the first node in a block
|
509
|
+
textNode = node.firstChild;
|
510
|
+
if (textNode && textNode.type === 3) {
|
511
|
+
text = textNode.value.replace(startWhiteSpaceRegExp, '');
|
512
|
+
|
513
|
+
// Any characters left after trim or should we remove it
|
514
|
+
if (text.length > 0) {
|
515
|
+
textNode.value = text;
|
516
|
+
textNode = textNode.next;
|
517
|
+
} else {
|
518
|
+
sibling = textNode.next;
|
519
|
+
textNode.remove();
|
520
|
+
textNode = sibling;
|
521
|
+
|
522
|
+
// Remove any pure whitespace siblings
|
523
|
+
while (textNode && textNode.type === 3) {
|
524
|
+
text = textNode.value;
|
525
|
+
sibling = textNode.next;
|
526
|
+
|
527
|
+
if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) {
|
528
|
+
textNode.remove();
|
529
|
+
textNode = sibling;
|
530
|
+
}
|
531
|
+
|
532
|
+
textNode = sibling;
|
533
|
+
}
|
534
|
+
}
|
535
|
+
}
|
536
|
+
|
537
|
+
// Trim whitespace of the last node in a block
|
538
|
+
textNode = node.lastChild;
|
539
|
+
if (textNode && textNode.type === 3) {
|
540
|
+
text = textNode.value.replace(endWhiteSpaceRegExp, '');
|
541
|
+
|
542
|
+
// Any characters left after trim or should we remove it
|
543
|
+
if (text.length > 0) {
|
544
|
+
textNode.value = text;
|
545
|
+
textNode = textNode.prev;
|
546
|
+
} else {
|
547
|
+
sibling = textNode.prev;
|
548
|
+
textNode.remove();
|
549
|
+
textNode = sibling;
|
550
|
+
|
551
|
+
// Remove any pure whitespace siblings
|
552
|
+
while (textNode && textNode.type === 3) {
|
553
|
+
text = textNode.value;
|
554
|
+
sibling = textNode.prev;
|
555
|
+
|
556
|
+
if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) {
|
557
|
+
textNode.remove();
|
558
|
+
textNode = sibling;
|
559
|
+
}
|
560
|
+
|
561
|
+
textNode = sibling;
|
562
|
+
}
|
563
|
+
}
|
564
|
+
}
|
565
|
+
}
|
566
|
+
|
567
|
+
// Trim start white space
|
568
|
+
// Removed due to: #5424
|
569
|
+
/*textNode = node.prev;
|
570
|
+
if (textNode && textNode.type === 3) {
|
571
|
+
text = textNode.value.replace(startWhiteSpaceRegExp, '');
|
572
|
+
|
573
|
+
if (text.length > 0)
|
574
|
+
textNode.value = text;
|
575
|
+
else
|
576
|
+
textNode.remove();
|
577
|
+
}*/
|
578
|
+
}
|
579
|
+
|
580
|
+
// Check if we exited a whitespace preserved element
|
581
|
+
if (isInWhiteSpacePreservedElement && whiteSpaceElements[name]) {
|
582
|
+
isInWhiteSpacePreservedElement = false;
|
583
|
+
}
|
584
|
+
|
585
|
+
// Handle empty nodes
|
586
|
+
if (elementRule.removeEmpty || elementRule.paddEmpty) {
|
587
|
+
if (node.isEmpty(nonEmptyElements)) {
|
588
|
+
if (elementRule.paddEmpty) {
|
589
|
+
node.empty().append(new Node('#text', '3')).value = '\u00a0';
|
590
|
+
} else {
|
591
|
+
// Leave nodes that have a name like <a name="name">
|
592
|
+
if (!node.attributes.map.name && !node.attributes.map.id) {
|
593
|
+
tempNode = node.parent;
|
594
|
+
|
595
|
+
if (blockElements[node.name]) {
|
596
|
+
node.empty().remove();
|
597
|
+
} else {
|
598
|
+
node.unwrap();
|
599
|
+
}
|
600
|
+
|
601
|
+
node = tempNode;
|
602
|
+
return;
|
603
|
+
}
|
604
|
+
}
|
605
|
+
}
|
606
|
+
}
|
607
|
+
|
608
|
+
node = node.parent;
|
609
|
+
}
|
610
|
+
}
|
611
|
+
}, schema);
|
612
|
+
|
613
|
+
rootNode = node = new Node(args.context || settings.root_name, 11);
|
614
|
+
|
615
|
+
parser.parse(html);
|
616
|
+
|
617
|
+
// Fix invalid children or report invalid children in a contextual parsing
|
618
|
+
if (validate && invalidChildren.length) {
|
619
|
+
if (!args.context) {
|
620
|
+
fixInvalidChildren(invalidChildren);
|
621
|
+
} else {
|
622
|
+
args.invalid = true;
|
623
|
+
}
|
624
|
+
}
|
625
|
+
|
626
|
+
// Wrap nodes in the root into block elements if the root is body
|
627
|
+
if (rootBlockName && (rootNode.name == 'body' || args.isRootContent)) {
|
628
|
+
addRootBlocks();
|
629
|
+
}
|
630
|
+
|
631
|
+
// Run filters only when the contents is valid
|
632
|
+
if (!args.invalid) {
|
633
|
+
// Run node filters
|
634
|
+
for (name in matchedNodes) {
|
635
|
+
list = nodeFilters[name];
|
636
|
+
nodes = matchedNodes[name];
|
637
|
+
|
638
|
+
// Remove already removed children
|
639
|
+
fi = nodes.length;
|
640
|
+
while (fi--) {
|
641
|
+
if (!nodes[fi].parent) {
|
642
|
+
nodes.splice(fi, 1);
|
643
|
+
}
|
644
|
+
}
|
645
|
+
|
646
|
+
for (i = 0, l = list.length; i < l; i++) {
|
647
|
+
list[i](nodes, name, args);
|
648
|
+
}
|
649
|
+
}
|
650
|
+
|
651
|
+
// Run attribute filters
|
652
|
+
for (i = 0, l = attributeFilters.length; i < l; i++) {
|
653
|
+
list = attributeFilters[i];
|
654
|
+
|
655
|
+
if (list.name in matchedAttributes) {
|
656
|
+
nodes = matchedAttributes[list.name];
|
657
|
+
|
658
|
+
// Remove already removed children
|
659
|
+
fi = nodes.length;
|
660
|
+
while (fi--) {
|
661
|
+
if (!nodes[fi].parent) {
|
662
|
+
nodes.splice(fi, 1);
|
663
|
+
}
|
664
|
+
}
|
665
|
+
|
666
|
+
for (fi = 0, fl = list.callbacks.length; fi < fl; fi++) {
|
667
|
+
list.callbacks[fi](nodes, list.name, args);
|
668
|
+
}
|
669
|
+
}
|
670
|
+
}
|
671
|
+
}
|
672
|
+
|
673
|
+
return rootNode;
|
674
|
+
};
|
675
|
+
|
676
|
+
// Remove <br> at end of block elements Gecko and WebKit injects BR elements to
|
677
|
+
// make it possible to place the caret inside empty blocks. This logic tries to remove
|
678
|
+
// these elements and keep br elements that where intended to be there intact
|
679
|
+
if (settings.remove_trailing_brs) {
|
680
|
+
self.addNodeFilter('br', function(nodes) {
|
681
|
+
var i, l = nodes.length, node, blockElements = extend({}, schema.getBlockElements());
|
682
|
+
var nonEmptyElements = schema.getNonEmptyElements(), parent, lastParent, prev, prevName;
|
683
|
+
var elementRule, textNode;
|
684
|
+
|
685
|
+
// Remove brs from body element as well
|
686
|
+
blockElements.body = 1;
|
687
|
+
|
688
|
+
// Must loop forwards since it will otherwise remove all brs in <p>a<br><br><br></p>
|
689
|
+
for (i = 0; i < l; i++) {
|
690
|
+
node = nodes[i];
|
691
|
+
parent = node.parent;
|
692
|
+
|
693
|
+
if (blockElements[node.parent.name] && node === parent.lastChild) {
|
694
|
+
// Loop all nodes to the left of the current node and check for other BR elements
|
695
|
+
// excluding bookmarks since they are invisible
|
696
|
+
prev = node.prev;
|
697
|
+
while (prev) {
|
698
|
+
prevName = prev.name;
|
699
|
+
|
700
|
+
// Ignore bookmarks
|
701
|
+
if (prevName !== "span" || prev.attr('data-mce-type') !== 'bookmark') {
|
702
|
+
// Found a non BR element
|
703
|
+
if (prevName !== "br") {
|
704
|
+
break;
|
705
|
+
}
|
706
|
+
|
707
|
+
// Found another br it's a <br><br> structure then don't remove anything
|
708
|
+
if (prevName === 'br') {
|
709
|
+
node = null;
|
710
|
+
break;
|
711
|
+
}
|
712
|
+
}
|
713
|
+
|
714
|
+
prev = prev.prev;
|
715
|
+
}
|
716
|
+
|
717
|
+
if (node) {
|
718
|
+
node.remove();
|
719
|
+
|
720
|
+
// Is the parent to be considered empty after we removed the BR
|
721
|
+
if (parent.isEmpty(nonEmptyElements)) {
|
722
|
+
elementRule = schema.getElementRule(parent.name);
|
723
|
+
|
724
|
+
// Remove or padd the element depending on schema rule
|
725
|
+
if (elementRule) {
|
726
|
+
if (elementRule.removeEmpty) {
|
727
|
+
parent.remove();
|
728
|
+
} else if (elementRule.paddEmpty) {
|
729
|
+
parent.empty().append(new Node('#text', 3)).value = '\u00a0';
|
730
|
+
}
|
731
|
+
}
|
732
|
+
}
|
733
|
+
}
|
734
|
+
} else {
|
735
|
+
// Replaces BR elements inside inline elements like <p><b><i><br></i></b></p>
|
736
|
+
// so they become <p><b><i> </i></b></p>
|
737
|
+
lastParent = node;
|
738
|
+
while (parent && parent.firstChild === lastParent && parent.lastChild === lastParent) {
|
739
|
+
lastParent = parent;
|
740
|
+
|
741
|
+
if (blockElements[parent.name]) {
|
742
|
+
break;
|
743
|
+
}
|
744
|
+
|
745
|
+
parent = parent.parent;
|
746
|
+
}
|
747
|
+
|
748
|
+
if (lastParent === parent) {
|
749
|
+
textNode = new Node('#text', 3);
|
750
|
+
textNode.value = '\u00a0';
|
751
|
+
node.replace(textNode);
|
752
|
+
}
|
753
|
+
}
|
754
|
+
}
|
755
|
+
});
|
756
|
+
}
|
757
|
+
|
758
|
+
// Force anchor names closed, unless the setting "allow_html_in_named_anchor" is explicitly included.
|
759
|
+
if (!settings.allow_html_in_named_anchor) {
|
760
|
+
self.addAttributeFilter('id,name', function(nodes) {
|
761
|
+
var i = nodes.length, sibling, prevSibling, parent, node;
|
762
|
+
|
763
|
+
while (i--) {
|
764
|
+
node = nodes[i];
|
765
|
+
if (node.name === 'a' && node.firstChild && !node.attr('href')) {
|
766
|
+
parent = node.parent;
|
767
|
+
|
768
|
+
// Move children after current node
|
769
|
+
sibling = node.lastChild;
|
770
|
+
do {
|
771
|
+
prevSibling = sibling.prev;
|
772
|
+
parent.insert(sibling, node);
|
773
|
+
sibling = prevSibling;
|
774
|
+
} while (sibling);
|
775
|
+
}
|
776
|
+
}
|
777
|
+
});
|
778
|
+
}
|
779
|
+
|
780
|
+
if (settings.validate && schema.getValidClasses()) {
|
781
|
+
self.addAttributeFilter('class', function(nodes) {
|
782
|
+
var i = nodes.length, node, classList, ci, className, classValue;
|
783
|
+
var validClasses = schema.getValidClasses(), validClassesMap, valid;
|
784
|
+
|
785
|
+
while (i--) {
|
786
|
+
node = nodes[i];
|
787
|
+
classList = node.attr('class').split(' ');
|
788
|
+
classValue = '';
|
789
|
+
|
790
|
+
for (ci = 0; ci < classList.length; ci++) {
|
791
|
+
className = classList[ci];
|
792
|
+
valid = false;
|
793
|
+
|
794
|
+
validClassesMap = validClasses['*'];
|
795
|
+
if (validClassesMap && validClassesMap[className]) {
|
796
|
+
valid = true;
|
797
|
+
}
|
798
|
+
|
799
|
+
validClassesMap = validClasses[node.name];
|
800
|
+
if (!valid && validClassesMap && validClassesMap[className]) {
|
801
|
+
valid = true;
|
802
|
+
}
|
803
|
+
|
804
|
+
if (valid) {
|
805
|
+
if (classValue) {
|
806
|
+
classValue += ' ';
|
807
|
+
}
|
808
|
+
|
809
|
+
classValue += className;
|
810
|
+
}
|
811
|
+
}
|
812
|
+
|
813
|
+
if (!classValue.length) {
|
814
|
+
classValue = null;
|
815
|
+
}
|
816
|
+
|
817
|
+
node.attr('class', classValue);
|
818
|
+
}
|
819
|
+
});
|
820
|
+
}
|
821
|
+
};
|
822
|
+
});
|