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,1004 @@
|
|
1
|
+
/**
|
2
|
+
* Schema.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
|
+
* Schema validator class.
|
13
|
+
*
|
14
|
+
* @class tinymce.html.Schema
|
15
|
+
* @example
|
16
|
+
* if (tinymce.activeEditor.schema.isValidChild('p', 'span'))
|
17
|
+
* alert('span is valid child of p.');
|
18
|
+
*
|
19
|
+
* if (tinymce.activeEditor.schema.getElementRule('p'))
|
20
|
+
* alert('P is a valid element.');
|
21
|
+
*
|
22
|
+
* @class tinymce.html.Schema
|
23
|
+
* @version 3.4
|
24
|
+
*/
|
25
|
+
define("tinymce/html/Schema", [
|
26
|
+
"tinymce/util/Tools"
|
27
|
+
], function(Tools) {
|
28
|
+
var mapCache = {}, dummyObj = {};
|
29
|
+
var makeMap = Tools.makeMap, each = Tools.each, extend = Tools.extend, explode = Tools.explode, inArray = Tools.inArray;
|
30
|
+
|
31
|
+
function split(items, delim) {
|
32
|
+
return items ? items.split(delim || ' ') : [];
|
33
|
+
}
|
34
|
+
|
35
|
+
/**
|
36
|
+
* Builds a schema lookup table
|
37
|
+
*
|
38
|
+
* @private
|
39
|
+
* @param {String} type html4, html5 or html5-strict schema type.
|
40
|
+
* @return {Object} Schema lookup table.
|
41
|
+
*/
|
42
|
+
function compileSchema(type) {
|
43
|
+
var schema = {}, globalAttributes, blockContent;
|
44
|
+
var phrasingContent, flowContent, html4BlockContent, html4PhrasingContent;
|
45
|
+
|
46
|
+
function add(name, attributes, children) {
|
47
|
+
var ni, i, attributesOrder, args = arguments;
|
48
|
+
|
49
|
+
function arrayToMap(array, obj) {
|
50
|
+
var map = {}, i, l;
|
51
|
+
|
52
|
+
for (i = 0, l = array.length; i < l; i++) {
|
53
|
+
map[array[i]] = obj || {};
|
54
|
+
}
|
55
|
+
|
56
|
+
return map;
|
57
|
+
}
|
58
|
+
|
59
|
+
children = children || [];
|
60
|
+
attributes = attributes || "";
|
61
|
+
|
62
|
+
if (typeof children === "string") {
|
63
|
+
children = split(children);
|
64
|
+
}
|
65
|
+
|
66
|
+
// Split string children
|
67
|
+
for (i = 3; i < args.length; i++) {
|
68
|
+
if (typeof args[i] === "string") {
|
69
|
+
args[i] = split(args[i]);
|
70
|
+
}
|
71
|
+
|
72
|
+
children.push.apply(children, args[i]);
|
73
|
+
}
|
74
|
+
|
75
|
+
name = split(name);
|
76
|
+
ni = name.length;
|
77
|
+
while (ni--) {
|
78
|
+
attributesOrder = [].concat(globalAttributes, split(attributes));
|
79
|
+
schema[name[ni]] = {
|
80
|
+
attributes: arrayToMap(attributesOrder),
|
81
|
+
attributesOrder: attributesOrder,
|
82
|
+
children: arrayToMap(children, dummyObj)
|
83
|
+
};
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
87
|
+
function addAttrs(name, attributes) {
|
88
|
+
var ni, schemaItem, i, l;
|
89
|
+
|
90
|
+
name = split(name);
|
91
|
+
ni = name.length;
|
92
|
+
attributes = split(attributes);
|
93
|
+
while (ni--) {
|
94
|
+
schemaItem = schema[name[ni]];
|
95
|
+
for (i = 0, l = attributes.length; i < l; i++) {
|
96
|
+
schemaItem.attributes[attributes[i]] = {};
|
97
|
+
schemaItem.attributesOrder.push(attributes[i]);
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
// Use cached schema
|
103
|
+
if (mapCache[type]) {
|
104
|
+
return mapCache[type];
|
105
|
+
}
|
106
|
+
|
107
|
+
// Attributes present on all elements
|
108
|
+
globalAttributes = split("id accesskey class dir lang style tabindex title");
|
109
|
+
|
110
|
+
// Event attributes can be opt-in/opt-out
|
111
|
+
/*eventAttributes = split("onabort onblur oncancel oncanplay oncanplaythrough onchange onclick onclose oncontextmenu oncuechange " +
|
112
|
+
"ondblclick ondrag ondragend ondragenter ondragleave ondragover ondragstart ondrop ondurationchange onemptied onended " +
|
113
|
+
"onerror onfocus oninput oninvalid onkeydown onkeypress onkeyup onload onloadeddata onloadedmetadata onloadstart " +
|
114
|
+
"onmousedown onmousemove onmouseout onmouseover onmouseup onmousewheel onpause onplay onplaying onprogress onratechange " +
|
115
|
+
"onreset onscroll onseeked onseeking onseeking onselect onshow onstalled onsubmit onsuspend ontimeupdate onvolumechange " +
|
116
|
+
"onwaiting"
|
117
|
+
);*/
|
118
|
+
|
119
|
+
// Block content elements
|
120
|
+
blockContent = split(
|
121
|
+
"address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"
|
122
|
+
);
|
123
|
+
|
124
|
+
// Phrasing content elements from the HTML5 spec (inline)
|
125
|
+
phrasingContent = split(
|
126
|
+
"a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd " +
|
127
|
+
"label map noscript object q s samp script select small span strong sub sup " +
|
128
|
+
"textarea u var #text #comment"
|
129
|
+
);
|
130
|
+
|
131
|
+
// Add HTML5 items to globalAttributes, blockContent, phrasingContent
|
132
|
+
if (type != "html4") {
|
133
|
+
globalAttributes.push.apply(globalAttributes, split("contenteditable contextmenu draggable dropzone " +
|
134
|
+
"hidden spellcheck translate"));
|
135
|
+
blockContent.push.apply(blockContent, split("article aside details dialog figure header footer hgroup section nav"));
|
136
|
+
phrasingContent.push.apply(phrasingContent, split("audio canvas command datalist mark meter output picture " +
|
137
|
+
"progress time wbr video ruby bdi keygen"));
|
138
|
+
}
|
139
|
+
|
140
|
+
// Add HTML4 elements unless it's html5-strict
|
141
|
+
if (type != "html5-strict") {
|
142
|
+
globalAttributes.push("xml:lang");
|
143
|
+
|
144
|
+
html4PhrasingContent = split("acronym applet basefont big font strike tt");
|
145
|
+
phrasingContent.push.apply(phrasingContent, html4PhrasingContent);
|
146
|
+
|
147
|
+
each(html4PhrasingContent, function(name) {
|
148
|
+
add(name, "", phrasingContent);
|
149
|
+
});
|
150
|
+
|
151
|
+
html4BlockContent = split("center dir isindex noframes");
|
152
|
+
blockContent.push.apply(blockContent, html4BlockContent);
|
153
|
+
|
154
|
+
// Flow content elements from the HTML5 spec (block+inline)
|
155
|
+
flowContent = [].concat(blockContent, phrasingContent);
|
156
|
+
|
157
|
+
each(html4BlockContent, function(name) {
|
158
|
+
add(name, "", flowContent);
|
159
|
+
});
|
160
|
+
}
|
161
|
+
|
162
|
+
// Flow content elements from the HTML5 spec (block+inline)
|
163
|
+
flowContent = flowContent || [].concat(blockContent, phrasingContent);
|
164
|
+
|
165
|
+
// HTML4 base schema TODO: Move HTML5 specific attributes to HTML5 specific if statement
|
166
|
+
// Schema items <element name>, <specific attributes>, <children ..>
|
167
|
+
add("html", "manifest", "head body");
|
168
|
+
add("head", "", "base command link meta noscript script style title");
|
169
|
+
add("title hr noscript br");
|
170
|
+
add("base", "href target");
|
171
|
+
add("link", "href rel media hreflang type sizes hreflang");
|
172
|
+
add("meta", "name http-equiv content charset");
|
173
|
+
add("style", "media type scoped");
|
174
|
+
add("script", "src async defer type charset");
|
175
|
+
add("body", "onafterprint onbeforeprint onbeforeunload onblur onerror onfocus " +
|
176
|
+
"onhashchange onload onmessage onoffline ononline onpagehide onpageshow " +
|
177
|
+
"onpopstate onresize onscroll onstorage onunload", flowContent);
|
178
|
+
add("address dt dd div caption", "", flowContent);
|
179
|
+
add("h1 h2 h3 h4 h5 h6 pre p abbr code var samp kbd sub sup i b u bdo span legend em strong small s cite dfn", "", phrasingContent);
|
180
|
+
add("blockquote", "cite", flowContent);
|
181
|
+
add("ol", "reversed start type", "li");
|
182
|
+
add("ul", "", "li");
|
183
|
+
add("li", "value", flowContent);
|
184
|
+
add("dl", "", "dt dd");
|
185
|
+
add("a", "href target rel media hreflang type", phrasingContent);
|
186
|
+
add("q", "cite", phrasingContent);
|
187
|
+
add("ins del", "cite datetime", flowContent);
|
188
|
+
add("img", "src sizes srcset alt usemap ismap width height");
|
189
|
+
add("iframe", "src name width height", flowContent);
|
190
|
+
add("embed", "src type width height");
|
191
|
+
add("object", "data type typemustmatch name usemap form width height", flowContent, "param");
|
192
|
+
add("param", "name value");
|
193
|
+
add("map", "name", flowContent, "area");
|
194
|
+
add("area", "alt coords shape href target rel media hreflang type");
|
195
|
+
add("table", "border", "caption colgroup thead tfoot tbody tr" + (type == "html4" ? " col" : ""));
|
196
|
+
add("colgroup", "span", "col");
|
197
|
+
add("col", "span");
|
198
|
+
add("tbody thead tfoot", "", "tr");
|
199
|
+
add("tr", "", "td th");
|
200
|
+
add("td", "colspan rowspan headers", flowContent);
|
201
|
+
add("th", "colspan rowspan headers scope abbr", flowContent);
|
202
|
+
add("form", "accept-charset action autocomplete enctype method name novalidate target", flowContent);
|
203
|
+
add("fieldset", "disabled form name", flowContent, "legend");
|
204
|
+
add("label", "form for", phrasingContent);
|
205
|
+
add("input", "accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate " +
|
206
|
+
"formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"
|
207
|
+
);
|
208
|
+
add("button", "disabled form formaction formenctype formmethod formnovalidate formtarget name type value",
|
209
|
+
type == "html4" ? flowContent : phrasingContent);
|
210
|
+
add("select", "disabled form multiple name required size", "option optgroup");
|
211
|
+
add("optgroup", "disabled label", "option");
|
212
|
+
add("option", "disabled label selected value");
|
213
|
+
add("textarea", "cols dirname disabled form maxlength name readonly required rows wrap");
|
214
|
+
add("menu", "type label", flowContent, "li");
|
215
|
+
add("noscript", "", flowContent);
|
216
|
+
|
217
|
+
// Extend with HTML5 elements
|
218
|
+
if (type != "html4") {
|
219
|
+
add("wbr");
|
220
|
+
add("ruby", "", phrasingContent, "rt rp");
|
221
|
+
add("figcaption", "", flowContent);
|
222
|
+
add("mark rt rp summary bdi", "", phrasingContent);
|
223
|
+
add("canvas", "width height", flowContent);
|
224
|
+
add("video", "src crossorigin poster preload autoplay mediagroup loop " +
|
225
|
+
"muted controls width height buffered", flowContent, "track source");
|
226
|
+
add("audio", "src crossorigin preload autoplay mediagroup loop muted controls buffered volume", flowContent, "track source");
|
227
|
+
add("picture", "", "img source");
|
228
|
+
add("source", "src srcset type media sizes");
|
229
|
+
add("track", "kind src srclang label default");
|
230
|
+
add("datalist", "", phrasingContent, "option");
|
231
|
+
add("article section nav aside header footer", "", flowContent);
|
232
|
+
add("hgroup", "", "h1 h2 h3 h4 h5 h6");
|
233
|
+
add("figure", "", flowContent, "figcaption");
|
234
|
+
add("time", "datetime", phrasingContent);
|
235
|
+
add("dialog", "open", flowContent);
|
236
|
+
add("command", "type label icon disabled checked radiogroup command");
|
237
|
+
add("output", "for form name", phrasingContent);
|
238
|
+
add("progress", "value max", phrasingContent);
|
239
|
+
add("meter", "value min max low high optimum", phrasingContent);
|
240
|
+
add("details", "open", flowContent, "summary");
|
241
|
+
add("keygen", "autofocus challenge disabled form keytype name");
|
242
|
+
}
|
243
|
+
|
244
|
+
// Extend with HTML4 attributes unless it's html5-strict
|
245
|
+
if (type != "html5-strict") {
|
246
|
+
addAttrs("script", "language xml:space");
|
247
|
+
addAttrs("style", "xml:space");
|
248
|
+
addAttrs("object", "declare classid code codebase codetype archive standby align border hspace vspace");
|
249
|
+
addAttrs("embed", "align name hspace vspace");
|
250
|
+
addAttrs("param", "valuetype type");
|
251
|
+
addAttrs("a", "charset name rev shape coords");
|
252
|
+
addAttrs("br", "clear");
|
253
|
+
addAttrs("applet", "codebase archive code object alt name width height align hspace vspace");
|
254
|
+
addAttrs("img", "name longdesc align border hspace vspace");
|
255
|
+
addAttrs("iframe", "longdesc frameborder marginwidth marginheight scrolling align");
|
256
|
+
addAttrs("font basefont", "size color face");
|
257
|
+
addAttrs("input", "usemap align");
|
258
|
+
addAttrs("select", "onchange");
|
259
|
+
addAttrs("textarea");
|
260
|
+
addAttrs("h1 h2 h3 h4 h5 h6 div p legend caption", "align");
|
261
|
+
addAttrs("ul", "type compact");
|
262
|
+
addAttrs("li", "type");
|
263
|
+
addAttrs("ol dl menu dir", "compact");
|
264
|
+
addAttrs("pre", "width xml:space");
|
265
|
+
addAttrs("hr", "align noshade size width");
|
266
|
+
addAttrs("isindex", "prompt");
|
267
|
+
addAttrs("table", "summary width frame rules cellspacing cellpadding align bgcolor");
|
268
|
+
addAttrs("col", "width align char charoff valign");
|
269
|
+
addAttrs("colgroup", "width align char charoff valign");
|
270
|
+
addAttrs("thead", "align char charoff valign");
|
271
|
+
addAttrs("tr", "align char charoff valign bgcolor");
|
272
|
+
addAttrs("th", "axis align char charoff valign nowrap bgcolor width height");
|
273
|
+
addAttrs("form", "accept");
|
274
|
+
addAttrs("td", "abbr axis scope align char charoff valign nowrap bgcolor width height");
|
275
|
+
addAttrs("tfoot", "align char charoff valign");
|
276
|
+
addAttrs("tbody", "align char charoff valign");
|
277
|
+
addAttrs("area", "nohref");
|
278
|
+
addAttrs("body", "background bgcolor text link vlink alink");
|
279
|
+
}
|
280
|
+
|
281
|
+
// Extend with HTML5 attributes unless it's html4
|
282
|
+
if (type != "html4") {
|
283
|
+
addAttrs("input button select textarea", "autofocus");
|
284
|
+
addAttrs("input textarea", "placeholder");
|
285
|
+
addAttrs("a", "download");
|
286
|
+
addAttrs("link script img", "crossorigin");
|
287
|
+
addAttrs("iframe", "sandbox seamless allowfullscreen"); // Excluded: srcdoc
|
288
|
+
}
|
289
|
+
|
290
|
+
// Special: iframe, ruby, video, audio, label
|
291
|
+
|
292
|
+
// Delete children of the same name from it's parent
|
293
|
+
// For example: form can't have a child of the name form
|
294
|
+
each(split('a form meter progress dfn'), function(name) {
|
295
|
+
if (schema[name]) {
|
296
|
+
delete schema[name].children[name];
|
297
|
+
}
|
298
|
+
});
|
299
|
+
|
300
|
+
// Delete header, footer, sectioning and heading content descendants
|
301
|
+
/*each('dt th address', function(name) {
|
302
|
+
delete schema[name].children[name];
|
303
|
+
});*/
|
304
|
+
|
305
|
+
// Caption can't have tables
|
306
|
+
delete schema.caption.children.table;
|
307
|
+
|
308
|
+
// Delete scripts by default due to possible XSS
|
309
|
+
delete schema.script;
|
310
|
+
|
311
|
+
// TODO: LI:s can only have value if parent is OL
|
312
|
+
|
313
|
+
// TODO: Handle transparent elements
|
314
|
+
// a ins del canvas map
|
315
|
+
|
316
|
+
mapCache[type] = schema;
|
317
|
+
|
318
|
+
return schema;
|
319
|
+
}
|
320
|
+
|
321
|
+
function compileElementMap(value, mode) {
|
322
|
+
var styles;
|
323
|
+
|
324
|
+
if (value) {
|
325
|
+
styles = {};
|
326
|
+
|
327
|
+
if (typeof value == 'string') {
|
328
|
+
value = {
|
329
|
+
'*': value
|
330
|
+
};
|
331
|
+
}
|
332
|
+
|
333
|
+
// Convert styles into a rule list
|
334
|
+
each(value, function(value, key) {
|
335
|
+
styles[key] = styles[key.toUpperCase()] = mode == 'map' ? makeMap(value, /[, ]/) : explode(value, /[, ]/);
|
336
|
+
});
|
337
|
+
}
|
338
|
+
|
339
|
+
return styles;
|
340
|
+
}
|
341
|
+
|
342
|
+
/**
|
343
|
+
* Constructs a new Schema instance.
|
344
|
+
*
|
345
|
+
* @constructor
|
346
|
+
* @method Schema
|
347
|
+
* @param {Object} settings Name/value settings object.
|
348
|
+
*/
|
349
|
+
return function(settings) {
|
350
|
+
var self = this, elements = {}, children = {}, patternElements = [], validStyles, invalidStyles, schemaItems;
|
351
|
+
var whiteSpaceElementsMap, selfClosingElementsMap, shortEndedElementsMap, boolAttrMap, validClasses;
|
352
|
+
var blockElementsMap, nonEmptyElementsMap, moveCaretBeforeOnEnterElementsMap, textBlockElementsMap, textInlineElementsMap;
|
353
|
+
var customElementsMap = {}, specialElements = {};
|
354
|
+
|
355
|
+
// Creates an lookup table map object for the specified option or the default value
|
356
|
+
function createLookupTable(option, default_value, extendWith) {
|
357
|
+
var value = settings[option];
|
358
|
+
|
359
|
+
if (!value) {
|
360
|
+
// Get cached default map or make it if needed
|
361
|
+
value = mapCache[option];
|
362
|
+
|
363
|
+
if (!value) {
|
364
|
+
value = makeMap(default_value, ' ', makeMap(default_value.toUpperCase(), ' '));
|
365
|
+
value = extend(value, extendWith);
|
366
|
+
|
367
|
+
mapCache[option] = value;
|
368
|
+
}
|
369
|
+
} else {
|
370
|
+
// Create custom map
|
371
|
+
value = makeMap(value, /[, ]/, makeMap(value.toUpperCase(), /[, ]/));
|
372
|
+
}
|
373
|
+
|
374
|
+
return value;
|
375
|
+
}
|
376
|
+
|
377
|
+
settings = settings || {};
|
378
|
+
schemaItems = compileSchema(settings.schema);
|
379
|
+
|
380
|
+
// Allow all elements and attributes if verify_html is set to false
|
381
|
+
if (settings.verify_html === false) {
|
382
|
+
settings.valid_elements = '*[*]';
|
383
|
+
}
|
384
|
+
|
385
|
+
validStyles = compileElementMap(settings.valid_styles);
|
386
|
+
invalidStyles = compileElementMap(settings.invalid_styles, 'map');
|
387
|
+
validClasses = compileElementMap(settings.valid_classes, 'map');
|
388
|
+
|
389
|
+
// Setup map objects
|
390
|
+
whiteSpaceElementsMap = createLookupTable('whitespace_elements', 'pre script noscript style textarea video audio iframe object');
|
391
|
+
selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li option p td tfoot th thead tr');
|
392
|
+
shortEndedElementsMap = createLookupTable('short_ended_elements', 'area base basefont br col frame hr img input isindex link ' +
|
393
|
+
'meta param embed source wbr track');
|
394
|
+
boolAttrMap = createLookupTable('boolean_attributes', 'checked compact declare defer disabled ismap multiple nohref noresize ' +
|
395
|
+
'noshade nowrap readonly selected autoplay loop controls');
|
396
|
+
nonEmptyElementsMap = createLookupTable('non_empty_elements', 'td th iframe video audio object script', shortEndedElementsMap);
|
397
|
+
moveCaretBeforeOnEnterElementsMap = createLookupTable('move_caret_before_on_enter_elements', 'table', nonEmptyElementsMap);
|
398
|
+
textBlockElementsMap = createLookupTable('text_block_elements', 'h1 h2 h3 h4 h5 h6 p div address pre form ' +
|
399
|
+
'blockquote center dir fieldset header footer article section hgroup aside nav figure');
|
400
|
+
blockElementsMap = createLookupTable('block_elements', 'hr table tbody thead tfoot ' +
|
401
|
+
'th tr td li ol ul caption dl dt dd noscript menu isindex option ' +
|
402
|
+
'datalist select optgroup figcaption', textBlockElementsMap);
|
403
|
+
textInlineElementsMap = createLookupTable('text_inline_elements', 'span strong b em i font strike u var cite ' +
|
404
|
+
'dfn code mark q sup sub samp');
|
405
|
+
|
406
|
+
each((settings.special || 'script noscript style textarea').split(' '), function(name) {
|
407
|
+
specialElements[name] = new RegExp('<\/' + name + '[^>]*>', 'gi');
|
408
|
+
});
|
409
|
+
|
410
|
+
// Converts a wildcard expression string to a regexp for example *a will become /.*a/.
|
411
|
+
function patternToRegExp(str) {
|
412
|
+
return new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$');
|
413
|
+
}
|
414
|
+
|
415
|
+
// Parses the specified valid_elements string and adds to the current rules
|
416
|
+
// This function is a bit hard to read since it's heavily optimized for speed
|
417
|
+
function addValidElements(validElements) {
|
418
|
+
var ei, el, ai, al, matches, element, attr, attrData, elementName, attrName, attrType, attributes, attributesOrder,
|
419
|
+
prefix, outputName, globalAttributes, globalAttributesOrder, key, value,
|
420
|
+
elementRuleRegExp = /^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,
|
421
|
+
attrRuleRegExp = /^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,
|
422
|
+
hasPatternsRegExp = /[*?+]/;
|
423
|
+
|
424
|
+
if (validElements) {
|
425
|
+
// Split valid elements into an array with rules
|
426
|
+
validElements = split(validElements, ',');
|
427
|
+
|
428
|
+
if (elements['@']) {
|
429
|
+
globalAttributes = elements['@'].attributes;
|
430
|
+
globalAttributesOrder = elements['@'].attributesOrder;
|
431
|
+
}
|
432
|
+
|
433
|
+
// Loop all rules
|
434
|
+
for (ei = 0, el = validElements.length; ei < el; ei++) {
|
435
|
+
// Parse element rule
|
436
|
+
matches = elementRuleRegExp.exec(validElements[ei]);
|
437
|
+
if (matches) {
|
438
|
+
// Setup local names for matches
|
439
|
+
prefix = matches[1];
|
440
|
+
elementName = matches[2];
|
441
|
+
outputName = matches[3];
|
442
|
+
attrData = matches[5];
|
443
|
+
|
444
|
+
// Create new attributes and attributesOrder
|
445
|
+
attributes = {};
|
446
|
+
attributesOrder = [];
|
447
|
+
|
448
|
+
// Create the new element
|
449
|
+
element = {
|
450
|
+
attributes: attributes,
|
451
|
+
attributesOrder: attributesOrder
|
452
|
+
};
|
453
|
+
|
454
|
+
// Padd empty elements prefix
|
455
|
+
if (prefix === '#') {
|
456
|
+
element.paddEmpty = true;
|
457
|
+
}
|
458
|
+
|
459
|
+
// Remove empty elements prefix
|
460
|
+
if (prefix === '-') {
|
461
|
+
element.removeEmpty = true;
|
462
|
+
}
|
463
|
+
|
464
|
+
if (matches[4] === '!') {
|
465
|
+
element.removeEmptyAttrs = true;
|
466
|
+
}
|
467
|
+
|
468
|
+
// Copy attributes from global rule into current rule
|
469
|
+
if (globalAttributes) {
|
470
|
+
for (key in globalAttributes) {
|
471
|
+
attributes[key] = globalAttributes[key];
|
472
|
+
}
|
473
|
+
|
474
|
+
attributesOrder.push.apply(attributesOrder, globalAttributesOrder);
|
475
|
+
}
|
476
|
+
|
477
|
+
// Attributes defined
|
478
|
+
if (attrData) {
|
479
|
+
attrData = split(attrData, '|');
|
480
|
+
for (ai = 0, al = attrData.length; ai < al; ai++) {
|
481
|
+
matches = attrRuleRegExp.exec(attrData[ai]);
|
482
|
+
if (matches) {
|
483
|
+
attr = {};
|
484
|
+
attrType = matches[1];
|
485
|
+
attrName = matches[2].replace(/::/g, ':');
|
486
|
+
prefix = matches[3];
|
487
|
+
value = matches[4];
|
488
|
+
|
489
|
+
// Required
|
490
|
+
if (attrType === '!') {
|
491
|
+
element.attributesRequired = element.attributesRequired || [];
|
492
|
+
element.attributesRequired.push(attrName);
|
493
|
+
attr.required = true;
|
494
|
+
}
|
495
|
+
|
496
|
+
// Denied from global
|
497
|
+
if (attrType === '-') {
|
498
|
+
delete attributes[attrName];
|
499
|
+
attributesOrder.splice(inArray(attributesOrder, attrName), 1);
|
500
|
+
continue;
|
501
|
+
}
|
502
|
+
|
503
|
+
// Default value
|
504
|
+
if (prefix) {
|
505
|
+
// Default value
|
506
|
+
if (prefix === '=') {
|
507
|
+
element.attributesDefault = element.attributesDefault || [];
|
508
|
+
element.attributesDefault.push({name: attrName, value: value});
|
509
|
+
attr.defaultValue = value;
|
510
|
+
}
|
511
|
+
|
512
|
+
// Forced value
|
513
|
+
if (prefix === ':') {
|
514
|
+
element.attributesForced = element.attributesForced || [];
|
515
|
+
element.attributesForced.push({name: attrName, value: value});
|
516
|
+
attr.forcedValue = value;
|
517
|
+
}
|
518
|
+
|
519
|
+
// Required values
|
520
|
+
if (prefix === '<') {
|
521
|
+
attr.validValues = makeMap(value, '?');
|
522
|
+
}
|
523
|
+
}
|
524
|
+
|
525
|
+
// Check for attribute patterns
|
526
|
+
if (hasPatternsRegExp.test(attrName)) {
|
527
|
+
element.attributePatterns = element.attributePatterns || [];
|
528
|
+
attr.pattern = patternToRegExp(attrName);
|
529
|
+
element.attributePatterns.push(attr);
|
530
|
+
} else {
|
531
|
+
// Add attribute to order list if it doesn't already exist
|
532
|
+
if (!attributes[attrName]) {
|
533
|
+
attributesOrder.push(attrName);
|
534
|
+
}
|
535
|
+
|
536
|
+
attributes[attrName] = attr;
|
537
|
+
}
|
538
|
+
}
|
539
|
+
}
|
540
|
+
}
|
541
|
+
|
542
|
+
// Global rule, store away these for later usage
|
543
|
+
if (!globalAttributes && elementName == '@') {
|
544
|
+
globalAttributes = attributes;
|
545
|
+
globalAttributesOrder = attributesOrder;
|
546
|
+
}
|
547
|
+
|
548
|
+
// Handle substitute elements such as b/strong
|
549
|
+
if (outputName) {
|
550
|
+
element.outputName = elementName;
|
551
|
+
elements[outputName] = element;
|
552
|
+
}
|
553
|
+
|
554
|
+
// Add pattern or exact element
|
555
|
+
if (hasPatternsRegExp.test(elementName)) {
|
556
|
+
element.pattern = patternToRegExp(elementName);
|
557
|
+
patternElements.push(element);
|
558
|
+
} else {
|
559
|
+
elements[elementName] = element;
|
560
|
+
}
|
561
|
+
}
|
562
|
+
}
|
563
|
+
}
|
564
|
+
}
|
565
|
+
|
566
|
+
function setValidElements(validElements) {
|
567
|
+
elements = {};
|
568
|
+
patternElements = [];
|
569
|
+
|
570
|
+
addValidElements(validElements);
|
571
|
+
|
572
|
+
each(schemaItems, function(element, name) {
|
573
|
+
children[name] = element.children;
|
574
|
+
});
|
575
|
+
}
|
576
|
+
|
577
|
+
// Adds custom non HTML elements to the schema
|
578
|
+
function addCustomElements(customElements) {
|
579
|
+
var customElementRegExp = /^(~)?(.+)$/;
|
580
|
+
|
581
|
+
if (customElements) {
|
582
|
+
// Flush cached items since we are altering the default maps
|
583
|
+
mapCache.text_block_elements = mapCache.block_elements = null;
|
584
|
+
|
585
|
+
each(split(customElements, ','), function(rule) {
|
586
|
+
var matches = customElementRegExp.exec(rule),
|
587
|
+
inline = matches[1] === '~',
|
588
|
+
cloneName = inline ? 'span' : 'div',
|
589
|
+
name = matches[2];
|
590
|
+
|
591
|
+
children[name] = children[cloneName];
|
592
|
+
customElementsMap[name] = cloneName;
|
593
|
+
|
594
|
+
// If it's not marked as inline then add it to valid block elements
|
595
|
+
if (!inline) {
|
596
|
+
blockElementsMap[name.toUpperCase()] = {};
|
597
|
+
blockElementsMap[name] = {};
|
598
|
+
}
|
599
|
+
|
600
|
+
// Add elements clone if needed
|
601
|
+
if (!elements[name]) {
|
602
|
+
var customRule = elements[cloneName];
|
603
|
+
|
604
|
+
customRule = extend({}, customRule);
|
605
|
+
delete customRule.removeEmptyAttrs;
|
606
|
+
delete customRule.removeEmpty;
|
607
|
+
|
608
|
+
elements[name] = customRule;
|
609
|
+
}
|
610
|
+
|
611
|
+
// Add custom elements at span/div positions
|
612
|
+
each(children, function(element, elmName) {
|
613
|
+
if (element[cloneName]) {
|
614
|
+
children[elmName] = element = extend({}, children[elmName]);
|
615
|
+
element[name] = element[cloneName];
|
616
|
+
}
|
617
|
+
});
|
618
|
+
});
|
619
|
+
}
|
620
|
+
}
|
621
|
+
|
622
|
+
// Adds valid children to the schema object
|
623
|
+
function addValidChildren(validChildren) {
|
624
|
+
var childRuleRegExp = /^([+\-]?)(\w+)\[([^\]]+)\]$/;
|
625
|
+
|
626
|
+
// Invalidate the schema cache if the schema is mutated
|
627
|
+
mapCache[settings.schema] = null;
|
628
|
+
|
629
|
+
if (validChildren) {
|
630
|
+
each(split(validChildren, ','), function(rule) {
|
631
|
+
var matches = childRuleRegExp.exec(rule), parent, prefix;
|
632
|
+
|
633
|
+
if (matches) {
|
634
|
+
prefix = matches[1];
|
635
|
+
|
636
|
+
// Add/remove items from default
|
637
|
+
if (prefix) {
|
638
|
+
parent = children[matches[2]];
|
639
|
+
} else {
|
640
|
+
parent = children[matches[2]] = {'#comment': {}};
|
641
|
+
}
|
642
|
+
|
643
|
+
parent = children[matches[2]];
|
644
|
+
|
645
|
+
each(split(matches[3], '|'), function(child) {
|
646
|
+
if (prefix === '-') {
|
647
|
+
delete parent[child];
|
648
|
+
} else {
|
649
|
+
parent[child] = {};
|
650
|
+
}
|
651
|
+
});
|
652
|
+
}
|
653
|
+
});
|
654
|
+
}
|
655
|
+
}
|
656
|
+
|
657
|
+
function getElementRule(name) {
|
658
|
+
var element = elements[name], i;
|
659
|
+
|
660
|
+
// Exact match found
|
661
|
+
if (element) {
|
662
|
+
return element;
|
663
|
+
}
|
664
|
+
|
665
|
+
// No exact match then try the patterns
|
666
|
+
i = patternElements.length;
|
667
|
+
while (i--) {
|
668
|
+
element = patternElements[i];
|
669
|
+
|
670
|
+
if (element.pattern.test(name)) {
|
671
|
+
return element;
|
672
|
+
}
|
673
|
+
}
|
674
|
+
}
|
675
|
+
|
676
|
+
if (!settings.valid_elements) {
|
677
|
+
// No valid elements defined then clone the elements from the schema spec
|
678
|
+
each(schemaItems, function(element, name) {
|
679
|
+
elements[name] = {
|
680
|
+
attributes: element.attributes,
|
681
|
+
attributesOrder: element.attributesOrder
|
682
|
+
};
|
683
|
+
|
684
|
+
children[name] = element.children;
|
685
|
+
});
|
686
|
+
|
687
|
+
// Switch these on HTML4
|
688
|
+
if (settings.schema != "html5") {
|
689
|
+
each(split('strong/b em/i'), function(item) {
|
690
|
+
item = split(item, '/');
|
691
|
+
elements[item[1]].outputName = item[0];
|
692
|
+
});
|
693
|
+
}
|
694
|
+
|
695
|
+
// Add default alt attribute for images
|
696
|
+
elements.img.attributesDefault = [{name: 'alt', value: ''}];
|
697
|
+
|
698
|
+
// Remove these if they are empty by default
|
699
|
+
each(split('ol ul sub sup blockquote span font a table tbody tr strong em b i'), function(name) {
|
700
|
+
if (elements[name]) {
|
701
|
+
elements[name].removeEmpty = true;
|
702
|
+
}
|
703
|
+
});
|
704
|
+
|
705
|
+
// Padd these by default
|
706
|
+
each(split('p h1 h2 h3 h4 h5 h6 th td pre div address caption'), function(name) {
|
707
|
+
elements[name].paddEmpty = true;
|
708
|
+
});
|
709
|
+
|
710
|
+
// Remove these if they have no attributes
|
711
|
+
each(split('span'), function(name) {
|
712
|
+
elements[name].removeEmptyAttrs = true;
|
713
|
+
});
|
714
|
+
|
715
|
+
// Remove these by default
|
716
|
+
// TODO: Reenable in 4.1
|
717
|
+
/*each(split('script style'), function(name) {
|
718
|
+
delete elements[name];
|
719
|
+
});*/
|
720
|
+
} else {
|
721
|
+
setValidElements(settings.valid_elements);
|
722
|
+
}
|
723
|
+
|
724
|
+
addCustomElements(settings.custom_elements);
|
725
|
+
addValidChildren(settings.valid_children);
|
726
|
+
addValidElements(settings.extended_valid_elements);
|
727
|
+
|
728
|
+
// Todo: Remove this when we fix list handling to be valid
|
729
|
+
addValidChildren('+ol[ul|ol],+ul[ul|ol]');
|
730
|
+
|
731
|
+
// Delete invalid elements
|
732
|
+
if (settings.invalid_elements) {
|
733
|
+
each(explode(settings.invalid_elements), function(item) {
|
734
|
+
if (elements[item]) {
|
735
|
+
delete elements[item];
|
736
|
+
}
|
737
|
+
});
|
738
|
+
}
|
739
|
+
|
740
|
+
// If the user didn't allow span only allow internal spans
|
741
|
+
if (!getElementRule('span')) {
|
742
|
+
addValidElements('span[!data-mce-type|*]');
|
743
|
+
}
|
744
|
+
|
745
|
+
/**
|
746
|
+
* Name/value map object with valid parents and children to those parents.
|
747
|
+
*
|
748
|
+
* @example
|
749
|
+
* children = {
|
750
|
+
* div:{p:{}, h1:{}}
|
751
|
+
* };
|
752
|
+
* @field children
|
753
|
+
* @type Object
|
754
|
+
*/
|
755
|
+
self.children = children;
|
756
|
+
|
757
|
+
/**
|
758
|
+
* Name/value map object with valid styles for each element.
|
759
|
+
*
|
760
|
+
* @method getValidStyles
|
761
|
+
* @type Object
|
762
|
+
*/
|
763
|
+
self.getValidStyles = function() {
|
764
|
+
return validStyles;
|
765
|
+
};
|
766
|
+
|
767
|
+
/**
|
768
|
+
* Name/value map object with valid styles for each element.
|
769
|
+
*
|
770
|
+
* @method getInvalidStyles
|
771
|
+
* @type Object
|
772
|
+
*/
|
773
|
+
self.getInvalidStyles = function() {
|
774
|
+
return invalidStyles;
|
775
|
+
};
|
776
|
+
|
777
|
+
/**
|
778
|
+
* Name/value map object with valid classes for each element.
|
779
|
+
*
|
780
|
+
* @method getValidClasses
|
781
|
+
* @type Object
|
782
|
+
*/
|
783
|
+
self.getValidClasses = function() {
|
784
|
+
return validClasses;
|
785
|
+
};
|
786
|
+
|
787
|
+
/**
|
788
|
+
* Returns a map with boolean attributes.
|
789
|
+
*
|
790
|
+
* @method getBoolAttrs
|
791
|
+
* @return {Object} Name/value lookup map for boolean attributes.
|
792
|
+
*/
|
793
|
+
self.getBoolAttrs = function() {
|
794
|
+
return boolAttrMap;
|
795
|
+
};
|
796
|
+
|
797
|
+
/**
|
798
|
+
* Returns a map with block elements.
|
799
|
+
*
|
800
|
+
* @method getBlockElements
|
801
|
+
* @return {Object} Name/value lookup map for block elements.
|
802
|
+
*/
|
803
|
+
self.getBlockElements = function() {
|
804
|
+
return blockElementsMap;
|
805
|
+
};
|
806
|
+
|
807
|
+
/**
|
808
|
+
* Returns a map with text block elements. Such as: p,h1-h6,div,address
|
809
|
+
*
|
810
|
+
* @method getTextBlockElements
|
811
|
+
* @return {Object} Name/value lookup map for block elements.
|
812
|
+
*/
|
813
|
+
self.getTextBlockElements = function() {
|
814
|
+
return textBlockElementsMap;
|
815
|
+
};
|
816
|
+
|
817
|
+
/**
|
818
|
+
* Returns a map of inline text format nodes for example strong/span or ins.
|
819
|
+
*
|
820
|
+
* @method getTextInlineElements
|
821
|
+
* @return {Object} Name/value lookup map for text format elements.
|
822
|
+
*/
|
823
|
+
self.getTextInlineElements = function() {
|
824
|
+
return textInlineElementsMap;
|
825
|
+
};
|
826
|
+
|
827
|
+
/**
|
828
|
+
* Returns a map with short ended elements such as BR or IMG.
|
829
|
+
*
|
830
|
+
* @method getShortEndedElements
|
831
|
+
* @return {Object} Name/value lookup map for short ended elements.
|
832
|
+
*/
|
833
|
+
self.getShortEndedElements = function() {
|
834
|
+
return shortEndedElementsMap;
|
835
|
+
};
|
836
|
+
|
837
|
+
/**
|
838
|
+
* Returns a map with self closing tags such as <li>.
|
839
|
+
*
|
840
|
+
* @method getSelfClosingElements
|
841
|
+
* @return {Object} Name/value lookup map for self closing tags elements.
|
842
|
+
*/
|
843
|
+
self.getSelfClosingElements = function() {
|
844
|
+
return selfClosingElementsMap;
|
845
|
+
};
|
846
|
+
|
847
|
+
/**
|
848
|
+
* Returns a map with elements that should be treated as contents regardless if it has text
|
849
|
+
* content in them or not such as TD, VIDEO or IMG.
|
850
|
+
*
|
851
|
+
* @method getNonEmptyElements
|
852
|
+
* @return {Object} Name/value lookup map for non empty elements.
|
853
|
+
*/
|
854
|
+
self.getNonEmptyElements = function() {
|
855
|
+
return nonEmptyElementsMap;
|
856
|
+
};
|
857
|
+
|
858
|
+
/**
|
859
|
+
* Returns a map with elements that the caret should be moved in front of after enter is
|
860
|
+
* pressed
|
861
|
+
*
|
862
|
+
* @method getMoveCaretBeforeOnEnterElements
|
863
|
+
* @return {Object} Name/value lookup map for elements to place the caret in front of.
|
864
|
+
*/
|
865
|
+
self.getMoveCaretBeforeOnEnterElements = function() {
|
866
|
+
return moveCaretBeforeOnEnterElementsMap;
|
867
|
+
};
|
868
|
+
|
869
|
+
/**
|
870
|
+
* Returns a map with elements where white space is to be preserved like PRE or SCRIPT.
|
871
|
+
*
|
872
|
+
* @method getWhiteSpaceElements
|
873
|
+
* @return {Object} Name/value lookup map for white space elements.
|
874
|
+
*/
|
875
|
+
self.getWhiteSpaceElements = function() {
|
876
|
+
return whiteSpaceElementsMap;
|
877
|
+
};
|
878
|
+
|
879
|
+
/**
|
880
|
+
* Returns a map with special elements. These are elements that needs to be parsed
|
881
|
+
* in a special way such as script, style, textarea etc. The map object values
|
882
|
+
* are regexps used to find the end of the element.
|
883
|
+
*
|
884
|
+
* @method getSpecialElements
|
885
|
+
* @return {Object} Name/value lookup map for special elements.
|
886
|
+
*/
|
887
|
+
self.getSpecialElements = function() {
|
888
|
+
return specialElements;
|
889
|
+
};
|
890
|
+
|
891
|
+
/**
|
892
|
+
* Returns true/false if the specified element and it's child is valid or not
|
893
|
+
* according to the schema.
|
894
|
+
*
|
895
|
+
* @method isValidChild
|
896
|
+
* @param {String} name Element name to check for.
|
897
|
+
* @param {String} child Element child to verify.
|
898
|
+
* @return {Boolean} True/false if the element is a valid child of the specified parent.
|
899
|
+
*/
|
900
|
+
self.isValidChild = function(name, child) {
|
901
|
+
var parent = children[name];
|
902
|
+
|
903
|
+
return !!(parent && parent[child]);
|
904
|
+
};
|
905
|
+
|
906
|
+
/**
|
907
|
+
* Returns true/false if the specified element name and optional attribute is
|
908
|
+
* valid according to the schema.
|
909
|
+
*
|
910
|
+
* @method isValid
|
911
|
+
* @param {String} name Name of element to check.
|
912
|
+
* @param {String} attr Optional attribute name to check for.
|
913
|
+
* @return {Boolean} True/false if the element and attribute is valid.
|
914
|
+
*/
|
915
|
+
self.isValid = function(name, attr) {
|
916
|
+
var attrPatterns, i, rule = getElementRule(name);
|
917
|
+
|
918
|
+
// Check if it's a valid element
|
919
|
+
if (rule) {
|
920
|
+
if (attr) {
|
921
|
+
// Check if attribute name exists
|
922
|
+
if (rule.attributes[attr]) {
|
923
|
+
return true;
|
924
|
+
}
|
925
|
+
|
926
|
+
// Check if attribute matches a regexp pattern
|
927
|
+
attrPatterns = rule.attributePatterns;
|
928
|
+
if (attrPatterns) {
|
929
|
+
i = attrPatterns.length;
|
930
|
+
while (i--) {
|
931
|
+
if (attrPatterns[i].pattern.test(name)) {
|
932
|
+
return true;
|
933
|
+
}
|
934
|
+
}
|
935
|
+
}
|
936
|
+
} else {
|
937
|
+
return true;
|
938
|
+
}
|
939
|
+
}
|
940
|
+
|
941
|
+
// No match
|
942
|
+
return false;
|
943
|
+
};
|
944
|
+
|
945
|
+
/**
|
946
|
+
* Returns true/false if the specified element is valid or not
|
947
|
+
* according to the schema.
|
948
|
+
*
|
949
|
+
* @method getElementRule
|
950
|
+
* @param {String} name Element name to check for.
|
951
|
+
* @return {Object} Element object or undefined if the element isn't valid.
|
952
|
+
*/
|
953
|
+
self.getElementRule = getElementRule;
|
954
|
+
|
955
|
+
/**
|
956
|
+
* Returns an map object of all custom elements.
|
957
|
+
*
|
958
|
+
* @method getCustomElements
|
959
|
+
* @return {Object} Name/value map object of all custom elements.
|
960
|
+
*/
|
961
|
+
self.getCustomElements = function() {
|
962
|
+
return customElementsMap;
|
963
|
+
};
|
964
|
+
|
965
|
+
/**
|
966
|
+
* Parses a valid elements string and adds it to the schema. The valid elements
|
967
|
+
* format is for example "element[attr=default|otherattr]".
|
968
|
+
* Existing rules will be replaced with the ones specified, so this extends the schema.
|
969
|
+
*
|
970
|
+
* @method addValidElements
|
971
|
+
* @param {String} valid_elements String in the valid elements format to be parsed.
|
972
|
+
*/
|
973
|
+
self.addValidElements = addValidElements;
|
974
|
+
|
975
|
+
/**
|
976
|
+
* Parses a valid elements string and sets it to the schema. The valid elements
|
977
|
+
* format is for example "element[attr=default|otherattr]".
|
978
|
+
* Existing rules will be replaced with the ones specified, so this extends the schema.
|
979
|
+
*
|
980
|
+
* @method setValidElements
|
981
|
+
* @param {String} valid_elements String in the valid elements format to be parsed.
|
982
|
+
*/
|
983
|
+
self.setValidElements = setValidElements;
|
984
|
+
|
985
|
+
/**
|
986
|
+
* Adds custom non HTML elements to the schema.
|
987
|
+
*
|
988
|
+
* @method addCustomElements
|
989
|
+
* @param {String} custom_elements Comma separated list of custom elements to add.
|
990
|
+
*/
|
991
|
+
self.addCustomElements = addCustomElements;
|
992
|
+
|
993
|
+
/**
|
994
|
+
* Parses a valid children string and adds them to the schema structure. The valid children
|
995
|
+
* format is for example: "element[child1|child2]".
|
996
|
+
*
|
997
|
+
* @method addValidChildren
|
998
|
+
* @param {String} valid_children Valid children elements string to parse
|
999
|
+
*/
|
1000
|
+
self.addValidChildren = addValidChildren;
|
1001
|
+
|
1002
|
+
self.elements = elements;
|
1003
|
+
};
|
1004
|
+
});
|