From 4e6ec24d603803f5243a33fffba1642e5f58c6e8 Mon Sep 17 00:00:00 2001 From: DubeySandeep Date: Fri, 29 Apr 2022 19:33:16 +0530 Subject: [PATCH 01/14] feat: upgrades tinyMCE4 to tinyMCE5 Co-authored-by: Arunmozhi --- cms/envs/common.py | 4 +- .../static/js/vendor/tinymce/BUILD_README.txt | 43 +- .../js/tinymce/classes/AddOnManager.js | 256 - .../tinymce/js/tinymce/classes/Compat.js | 84 - .../tinymce/js/tinymce/classes/Editor.js | 2168 - .../js/tinymce/classes/EditorCommands.js | 721 - .../js/tinymce/classes/EditorManager.js | 574 - .../tinymce/js/tinymce/classes/EnterKey.js | 670 - .../vendor/tinymce/js/tinymce/classes/Env.js | 135 - .../js/tinymce/classes/FocusManager.js | 230 - .../tinymce/js/tinymce/classes/ForceBlocks.js | 132 - .../tinymce/js/tinymce/classes/Formatter.js | 2426 - .../tinymce/js/tinymce/classes/LegacyInput.js | 73 - .../tinymce/js/tinymce/classes/Shortcuts.js | 111 - .../tinymce/js/tinymce/classes/UndoManager.js | 337 - .../js/tinymce/classes/WindowManager.js | 221 - .../tinymce/classes/dom/ControlSelection.js | 519 - .../js/tinymce/classes/dom/DOMUtils.js | 2078 - .../js/tinymce/classes/dom/DomQuery.js | 730 - .../js/tinymce/classes/dom/EventUtils.js | 557 - .../tinymce/js/tinymce/classes/dom/Range.js | 777 - .../js/tinymce/classes/dom/RangeUtils.js | 476 - .../js/tinymce/classes/dom/ScriptLoader.js | 255 - .../js/tinymce/classes/dom/Selection.js | 1259 - .../js/tinymce/classes/dom/Serializer.js | 387 - .../js/tinymce/classes/dom/Sizzle.jQuery.js | 23 - .../tinymce/js/tinymce/classes/dom/Sizzle.js | 1928 - .../tinymce/classes/dom/StyleSheetLoader.js | 185 - .../js/tinymce/classes/dom/TreeWalker.js | 79 - .../tinymce/classes/dom/TridentSelection.js | 502 - .../js/tinymce/classes/html/DomParser.js | 756 - .../js/tinymce/classes/html/Entities.js | 263 - .../tinymce/js/tinymce/classes/html/Node.js | 496 - .../js/tinymce/classes/html/SaxParser.js | 423 - .../tinymce/js/tinymce/classes/html/Schema.js | 938 - .../js/tinymce/classes/html/Serializer.js | 156 - .../tinymce/js/tinymce/classes/html/Styles.js | 324 - .../tinymce/js/tinymce/classes/html/Writer.js | 199 - .../js/tinymce/classes/jquery.tinymce.js | 364 - .../js/tinymce/classes/ui/AbsoluteLayout.js | 63 - .../tinymce/js/tinymce/classes/ui/Button.js | 141 - .../js/tinymce/classes/ui/ButtonGroup.js | 62 - .../tinymce/js/tinymce/classes/ui/Checkbox.js | 119 - .../js/tinymce/classes/ui/Collection.js | 430 - .../js/tinymce/classes/ui/ColorButton.js | 107 - .../tinymce/js/tinymce/classes/ui/ComboBox.js | 332 - .../js/tinymce/classes/ui/Container.js | 495 - .../tinymce/js/tinymce/classes/ui/Control.js | 1559 - .../tinymce/js/tinymce/classes/ui/DomUtils.js | 95 - .../js/tinymce/classes/ui/DragHelper.js | 136 - .../js/tinymce/classes/ui/ElementPath.js | 83 - .../tinymce/js/tinymce/classes/ui/Factory.js | 105 - .../tinymce/js/tinymce/classes/ui/FieldSet.js | 59 - .../js/tinymce/classes/ui/FilePicker.js | 53 - .../js/tinymce/classes/ui/FitLayout.js | 48 - .../js/tinymce/classes/ui/FlexLayout.js | 246 - .../js/tinymce/classes/ui/FloatPanel.js | 366 - .../js/tinymce/classes/ui/FlowLayout.js | 42 - .../tinymce/js/tinymce/classes/ui/Form.js | 154 - .../tinymce/js/tinymce/classes/ui/FormItem.js | 56 - .../js/tinymce/classes/ui/FormatControls.js | 652 - .../js/tinymce/classes/ui/GridLayout.js | 226 - .../tinymce/js/tinymce/classes/ui/Iframe.js | 83 - .../tinymce/classes/ui/KeyboardNavigation.js | 390 - .../tinymce/js/tinymce/classes/ui/Label.js | 125 - .../tinymce/js/tinymce/classes/ui/Layout.js | 114 - .../tinymce/js/tinymce/classes/ui/ListBox.js | 125 - .../tinymce/js/tinymce/classes/ui/Menu.js | 140 - .../tinymce/js/tinymce/classes/ui/MenuBar.js | 33 - .../js/tinymce/classes/ui/MenuButton.js | 244 - .../tinymce/js/tinymce/classes/ui/MenuItem.js | 292 - .../js/tinymce/classes/ui/MessageBox.js | 205 - .../tinymce/js/tinymce/classes/ui/Movable.js | 200 - .../tinymce/js/tinymce/classes/ui/Panel.js | 67 - .../js/tinymce/classes/ui/PanelButton.js | 105 - .../tinymce/js/tinymce/classes/ui/Path.js | 140 - .../tinymce/js/tinymce/classes/ui/Radio.js | 29 - .../js/tinymce/classes/ui/Resizable.js | 68 - .../js/tinymce/classes/ui/ResizeHandle.js | 86 - .../js/tinymce/classes/ui/Scrollable.js | 149 - .../tinymce/js/tinymce/classes/ui/Selector.js | 369 - .../tinymce/js/tinymce/classes/ui/Spacer.js | 39 - .../js/tinymce/classes/ui/SplitButton.js | 119 - .../js/tinymce/classes/ui/StackLayout.js | 30 - .../tinymce/js/tinymce/classes/ui/TabPanel.js | 180 - .../tinymce/js/tinymce/classes/ui/TextBox.js | 214 - .../tinymce/js/tinymce/classes/ui/Throbber.js | 70 - .../tinymce/js/tinymce/classes/ui/Toolbar.js | 54 - .../tinymce/js/tinymce/classes/ui/Tooltip.js | 86 - .../tinymce/js/tinymce/classes/ui/Widget.js | 156 - .../tinymce/js/tinymce/classes/ui/Window.js | 373 - .../tinymce/js/tinymce/classes/util/Class.js | 163 - .../tinymce/js/tinymce/classes/util/I18n.js | 80 - .../tinymce/js/tinymce/classes/util/JSON.js | 109 - .../tinymce/js/tinymce/classes/util/JSONP.js | 38 - .../js/tinymce/classes/util/JSONRequest.js | 110 - .../js/tinymce/classes/util/LocalStorage.js | 213 - .../js/tinymce/classes/util/Observable.js | 250 - .../tinymce/js/tinymce/classes/util/Quirks.js | 1139 - .../tinymce/js/tinymce/classes/util/Tools.js | 503 - .../tinymce/js/tinymce/classes/util/URI.js | 366 - .../tinymce/js/tinymce/classes/util/VK.js | 37 - .../tinymce/js/tinymce/classes/util/XHR.js | 84 - .../tinymce/js/tinymce/icons/default/icons.js | 172 + .../js/tinymce/icons/default/icons.min.js | 1 + .../tinymce/js/tinymce/jquery.tinymce.min.js | 93 +- .../vendor/tinymce/js/tinymce/langs/readme.md | 0 .../js/vendor/tinymce/js/tinymce/license.txt | 12 +- .../js/tinymce/plugins/advlist/plugin.js | 341 +- .../js/tinymce/plugins/advlist/plugin.min.js | 10 +- .../js/tinymce/plugins/anchor/plugin.js | 249 +- .../js/tinymce/plugins/anchor/plugin.min.js | 10 +- .../js/tinymce/plugins/autolink/plugin.js | 351 +- .../js/tinymce/plugins/autolink/plugin.min.js | 10 +- .../js/tinymce/plugins/autoresize/plugin.js | 171 + .../tinymce/plugins/autoresize/plugin.min.js | 9 + .../js/tinymce/plugins/autosave/plugin.js | 214 + .../js/tinymce/plugins/autosave/plugin.min.js | 9 + .../js/tinymce/plugins/bbcode/plugin.js | 99 + .../js/tinymce/plugins/bbcode/plugin.min.js | 9 + .../js/tinymce/plugins/charmap/plugin.js | 2031 +- .../js/tinymce/plugins/charmap/plugin.min.js | 10 +- .../tinymce/js/tinymce/plugins/code/plugin.js | 141 +- .../js/tinymce/plugins/code/plugin.min.js | 10 +- .../js/tinymce/plugins/codemirror/LICENSE.txt | 193 - .../js/tinymce/plugins/codemirror/README.txt | 26 - .../tinymce/plugins/codemirror/langs/cs_CZ.js | 8 + .../js/tinymce/plugins/codemirror/langs/de.js | 8 + .../tinymce/plugins/codemirror/langs/es_ES.js | 8 + .../tinymce/plugins/codemirror/langs/fr_FR.js | 8 + .../tinymce/plugins/codemirror/langs/pt_BR.js | 8 + .../tinymce/plugins/codemirror/langs/pt_PT.js | 8 + .../js/tinymce/plugins/codemirror/langs/ru.js | 8 + .../js/tinymce/plugins/codemirror/langs/uk.js | 8 + .../tinymce/plugins/codemirror/langs/zh_TW.js | 8 + .../js/tinymce/plugins/codemirror/plugin.js | 225 +- .../tinymce/plugins/codemirror/plugin.min.js | 2 +- .../js/tinymce/plugins/codemirror/source.html | 496 +- .../js/tinymce/plugins/codesample/plugin.js | 1717 + .../tinymce/plugins/codesample/plugin.min.js | 9 + .../js/tinymce/plugins/colorpicker/plugin.js | 22 + .../tinymce/plugins/colorpicker/plugin.min.js | 9 + .../js/tinymce/plugins/contextmenu/plugin.js | 85 +- .../tinymce/plugins/contextmenu/plugin.min.js | 10 +- .../tinymce/plugins/directionality/plugin.js | 314 + .../plugins/directionality/plugin.min.js | 9 + .../js/tinymce/plugins/emoticons/js/emojis.js | 9015 +++ .../plugins/emoticons/js/emojis.min.js | 2 + .../js/tinymce/plugins/emoticons/plugin.js | 564 + .../tinymce/plugins/emoticons/plugin.min.js | 9 + .../js/tinymce/plugins/fullpage/plugin.js | 544 + .../js/tinymce/plugins/fullpage/plugin.min.js | 9 + .../js/tinymce/plugins/fullscreen/plugin.js | 969 + .../tinymce/plugins/fullscreen/plugin.min.js | 9 + .../tinymce/js/tinymce/plugins/help/plugin.js | 846 + .../js/tinymce/plugins/help/plugin.min.js | 9 + .../tinymce/js/tinymce/plugins/hr/plugin.js | 46 + .../js/tinymce/plugins/hr/plugin.min.js | 9 + .../js/tinymce/plugins/image/plugin.js | 1651 + .../js/tinymce/plugins/image/plugin.min.js | 10 +- .../js/tinymce/plugins/imagetools/plugin.js | 1341 + .../tinymce/plugins/imagetools/plugin.min.js | 9 + .../js/tinymce/plugins/importcss/plugin.js | 343 + .../tinymce/plugins/importcss/plugin.min.js | 9 + .../tinymce/plugins/insertdatetime/plugin.js | 292 +- .../plugins/insertdatetime/plugin.min.js | 10 +- .../js/tinymce/plugins/legacyoutput/plugin.js | 199 + .../plugins/legacyoutput/plugin.min.js | 9 + .../tinymce/js/tinymce/plugins/link/plugin.js | 1476 +- .../js/tinymce/plugins/link/plugin.min.js | 10 +- .../js/tinymce/plugins/lists/plugin.js | 2874 +- .../js/tinymce/plugins/lists/plugin.min.js | 10 +- .../js/tinymce/plugins/media/plugin.js | 1315 + .../js/tinymce/plugins/media/plugin.min.js | 10 +- .../js/tinymce/plugins/nonbreaking/plugin.js | 101 + .../tinymce/plugins/nonbreaking/plugin.min.js | 9 + .../js/tinymce/plugins/noneditable/plugin.js | 117 + .../tinymce/plugins/noneditable/plugin.min.js | 9 + .../js/tinymce/plugins/pagebreak/plugin.js | 107 + .../tinymce/plugins/pagebreak/plugin.min.js | 9 + .../plugins/paste/classes/Clipboard.js | 489 - .../tinymce/plugins/paste/classes/Plugin.js | 110 - .../tinymce/plugins/paste/classes/Quirks.js | 123 - .../js/tinymce/plugins/paste/classes/Utils.js | 98 - .../plugins/paste/classes/WordFilter.js | 287 - .../js/tinymce/plugins/paste/plugin.dev.js | 120 - .../js/tinymce/plugins/paste/plugin.js | 2907 +- .../js/tinymce/plugins/paste/plugin.min.js | 10 +- .../js/tinymce/plugins/preview/plugin.js | 127 + .../js/tinymce/plugins/preview/plugin.min.js | 9 + .../js/tinymce/plugins/print/plugin.js | 69 +- .../js/tinymce/plugins/print/plugin.min.js | 10 +- .../js/tinymce/plugins/quickbars/plugin.js | 485 + .../tinymce/plugins/quickbars/plugin.min.js | 9 + .../tinymce/js/tinymce/plugins/save/plugin.js | 207 +- .../js/tinymce/plugins/save/plugin.min.js | 10 +- .../tinymce/plugins/searchreplace/plugin.js | 1752 +- .../plugins/searchreplace/plugin.min.js | 10 +- .../spellchecker/classes/DomTextMatcher.js | 470 - .../plugins/spellchecker/classes/Plugin.js | 343 - .../plugins/spellchecker/plugin.dev.js | 117 - .../js/tinymce/plugins/spellchecker/plugin.js | 1634 +- .../plugins/spellchecker/plugin.min.js | 10 +- .../js/tinymce/plugins/tabfocus/plugin.js | 129 + .../js/tinymce/plugins/tabfocus/plugin.min.js | 9 + .../plugins/table/classes/CellSelection.js | 167 - .../tinymce/plugins/table/classes/Plugin.js | 794 - .../tinymce/plugins/table/classes/Quirks.js | 370 - .../plugins/table/classes/TableGrid.js | 833 - .../js/tinymce/plugins/table/plugin.dev.js | 119 - .../js/tinymce/plugins/table/plugin.js | 12514 ++- .../js/tinymce/plugins/table/plugin.min.js | 10 +- .../js/tinymce/plugins/template/plugin.js | 577 + .../js/tinymce/plugins/template/plugin.min.js | 9 + .../js/tinymce/plugins/textcolor/plugin.js | 172 +- .../tinymce/plugins/textcolor/plugin.min.js | 10 +- .../js/tinymce/plugins/textpattern/plugin.js | 1387 + .../tinymce/plugins/textpattern/plugin.min.js | 9 + .../tinymce/js/tinymce/plugins/toc/plugin.js | 236 + .../js/tinymce/plugins/toc/plugin.min.js | 9 + .../plugins/visualblocks/css/visualblocks.css | 128 - .../plugins/visualblocks/img/address.gif | Bin 104 -> 0 bytes .../plugins/visualblocks/img/article.gif | Bin 99 -> 0 bytes .../plugins/visualblocks/img/aside.gif | Bin 86 -> 0 bytes .../plugins/visualblocks/img/blockquote.gif | Bin 120 -> 0 bytes .../tinymce/plugins/visualblocks/img/div.gif | Bin 72 -> 0 bytes .../plugins/visualblocks/img/figure.gif | Bin 93 -> 0 bytes .../tinymce/plugins/visualblocks/img/h1.gif | Bin 64 -> 0 bytes .../tinymce/plugins/visualblocks/img/h2.gif | Bin 67 -> 0 bytes .../tinymce/plugins/visualblocks/img/h3.gif | Bin 66 -> 0 bytes .../tinymce/plugins/visualblocks/img/h4.gif | Bin 67 -> 0 bytes .../tinymce/plugins/visualblocks/img/h5.gif | Bin 67 -> 0 bytes .../tinymce/plugins/visualblocks/img/h6.gif | Bin 67 -> 0 bytes .../plugins/visualblocks/img/hgroup.gif | Bin 96 -> 0 bytes .../tinymce/plugins/visualblocks/img/ol.gif | Bin 64 -> 0 bytes .../js/tinymce/plugins/visualblocks/img/p.gif | Bin 63 -> 0 bytes .../tinymce/plugins/visualblocks/img/pre.gif | Bin 76 -> 0 bytes .../plugins/visualblocks/img/section.gif | Bin 98 -> 0 bytes .../tinymce/plugins/visualblocks/img/ul.gif | Bin 64 -> 0 bytes .../js/tinymce/plugins/visualblocks/plugin.js | 184 +- .../plugins/visualblocks/plugin.min.js | 10 +- .../js/tinymce/plugins/visualchars/plugin.js | 540 + .../tinymce/plugins/visualchars/plugin.min.js | 9 + .../js/tinymce/plugins/wordcount/plugin.js | 416 + .../tinymce/plugins/wordcount/plugin.min.js | 9 + .../js/vendor/tinymce/js/tinymce/readme.md | 77 + .../js/tinymce/skins/content/dark/content.css | 72 + .../skins/content/dark/content.min.css | 8 + .../skins/content/dark/content.min.css.map | 1 + .../tinymce/skins/content/default/content.css | 67 + .../skins/content/default/content.min.css | 8 + .../skins/content/default/content.min.css.map | 1 + .../skins/content/document/content.css | 72 + .../skins/content/document/content.min.css | 8 + .../content/document/content.min.css.map | 1 + .../tinymce/skins/content/writer/content.css | 68 + .../skins/content/writer/content.min.css | 8 + .../skins/content/writer/content.min.css.map | 1 + .../tinymce/skins/ui/oxide-dark/content.css | 710 + .../skins/ui/oxide-dark/content.inline.css | 722 + .../ui/oxide-dark/content.inline.min.css | 8 + .../ui/oxide-dark/content.inline.min.css.map | 1 + .../skins/ui/oxide-dark/content.min.css | 8 + .../skins/ui/oxide-dark/content.min.css.map | 1 + .../skins/ui/oxide-dark/content.mobile.css | 29 + .../ui/oxide-dark/content.mobile.min.css | 8 + .../ui/oxide-dark/content.mobile.min.css.map | 1 + .../ui/oxide-dark/fonts/tinymce-mobile.woff | Bin 0 -> 4624 bytes .../js/tinymce/skins/ui/oxide-dark/skin.css | 2972 + .../tinymce/skins/ui/oxide-dark/skin.min.css | 8 + .../skins/ui/oxide-dark/skin.min.css.map | 1 + .../skins/ui/oxide-dark/skin.mobile.css | 673 + .../skins/ui/oxide-dark/skin.mobile.min.css | 8 + .../ui/oxide-dark/skin.mobile.min.css.map | 1 + .../js/tinymce/skins/ui/oxide/content.css | 728 + .../tinymce/skins/ui/oxide/content.inline.css | 722 + .../skins/ui/oxide/content.inline.min.css | 8 + .../skins/ui/oxide/content.inline.min.css.map | 1 + .../js/tinymce/skins/ui/oxide/content.min.css | 8 + .../skins/ui/oxide/content.min.css.map | 1 + .../tinymce/skins/ui/oxide/content.mobile.css | 29 + .../skins/ui/oxide/content.mobile.min.css | 8 + .../skins/ui/oxide/content.mobile.min.css.map | 1 + .../skins/ui/oxide/fonts/tinymce-mobile.woff | Bin 0 -> 4624 bytes .../js/tinymce/skins/ui/oxide/skin.css | 2972 + .../js/tinymce/skins/ui/oxide/skin.min.css | 8 + .../tinymce/skins/ui/oxide/skin.min.css.map | 1 + .../js/tinymce/skins/ui/oxide/skin.mobile.css | 673 + .../skins/ui/oxide/skin.mobile.min.css | 8 + .../skins/ui/oxide/skin.mobile.min.css.map | 1 + .../studio-tmce4/content.inline.min.css | 0 .../{ => ui}/studio-tmce4/content.min.css | 0 .../studio-tmce4/fonts/icomoon-small.eot | Bin .../studio-tmce4/fonts/icomoon-small.svg | 0 .../studio-tmce4/fonts/icomoon-small.ttf | Bin .../studio-tmce4/fonts/icomoon-small.woff | Bin .../{ => ui}/studio-tmce4/fonts/icomoon.eot | Bin .../{ => ui}/studio-tmce4/fonts/icomoon.svg | 0 .../{ => ui}/studio-tmce4/fonts/icomoon.ttf | Bin .../{ => ui}/studio-tmce4/fonts/icomoon.woff | Bin .../{ => ui}/studio-tmce4/fonts/readme.md | 0 .../{ => ui}/studio-tmce4/img/anchor.gif | Bin .../{ => ui}/studio-tmce4/img/loader.gif | Bin .../{ => ui}/studio-tmce4/img/object.gif | Bin .../skins/{ => ui}/studio-tmce4/img/trans.gif | Bin .../skins/{ => ui}/studio-tmce4/img/wline.gif | Bin .../{ => ui}/studio-tmce4/skin.ie7.min.css | 0 .../skins/{ => ui}/studio-tmce4/skin.json | 0 .../skins/{ => ui}/studio-tmce4/skin.min.css | 0 .../tinymce/js/tinymce/themes/mobile/theme.js | 13577 ++++ .../js/tinymce/themes/mobile/theme.min.js | 9 + .../tinymce/js/tinymce/themes/modern/theme.js | 599 - .../js/tinymce/themes/modern/theme.min.js | 1 - .../tinymce/js/tinymce/themes/silver/theme.js | 32154 ++++++++ .../js/tinymce/themes/silver/theme.min.js | 9 + .../js/vendor/tinymce/js/tinymce/tinymce.d.ts | 2820 + .../vendor/tinymce/js/tinymce/tinymce.dev.js | 214 - .../tinymce/js/tinymce/tinymce.full.min.js | 445 +- .../tinymce/js/tinymce/tinymce.jquery.dev.js | 213 - .../tinymce/js/tinymce/tinymce.jquery.js | 32176 -------- .../tinymce/js/tinymce/tinymce.jquery.min.js | 10 - .../js/vendor/tinymce/js/tinymce/tinymce.js | 64256 +++++++--------- .../vendor/tinymce/js/tinymce/tinymce.min.js | 19 +- lms/envs/common.py | 4 +- xmodule/js/spec/html/edit_spec.js | 42 +- xmodule/js/src/html/edit.js | 30 +- 326 files changed, 134117 insertions(+), 115186 deletions(-) delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/AddOnManager.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/Compat.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/Editor.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/EditorCommands.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/EditorManager.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/EnterKey.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/Env.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/FocusManager.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ForceBlocks.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/Formatter.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/LegacyInput.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/Shortcuts.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/UndoManager.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/WindowManager.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/dom/ControlSelection.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/dom/DOMUtils.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/dom/DomQuery.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/dom/EventUtils.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/dom/Range.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/dom/RangeUtils.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/dom/ScriptLoader.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/dom/Selection.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/dom/Serializer.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/dom/Sizzle.jQuery.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/dom/Sizzle.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/dom/StyleSheetLoader.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/dom/TreeWalker.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/dom/TridentSelection.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/html/DomParser.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/html/Entities.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/html/Node.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/html/SaxParser.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/html/Schema.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/html/Serializer.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/html/Styles.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/html/Writer.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/jquery.tinymce.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/AbsoluteLayout.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/Button.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/ButtonGroup.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/Checkbox.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/Collection.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/ColorButton.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/ComboBox.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/Container.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/Control.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/DomUtils.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/DragHelper.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/ElementPath.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/Factory.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/FieldSet.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/FilePicker.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/FitLayout.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/FlexLayout.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/FloatPanel.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/FlowLayout.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/Form.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/FormItem.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/FormatControls.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/GridLayout.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/Iframe.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/KeyboardNavigation.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/Label.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/Layout.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/ListBox.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/Menu.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/MenuBar.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/MenuButton.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/MenuItem.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/MessageBox.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/Movable.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/Panel.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/PanelButton.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/Path.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/Radio.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/Resizable.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/ResizeHandle.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/Scrollable.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/Selector.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/Spacer.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/SplitButton.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/StackLayout.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/TabPanel.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/TextBox.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/Throbber.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/Toolbar.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/Tooltip.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/Widget.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/ui/Window.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/util/Class.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/util/I18n.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/util/JSON.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/util/JSONP.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/util/JSONRequest.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/util/LocalStorage.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/util/Observable.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/util/Quirks.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/util/Tools.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/util/URI.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/util/VK.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/classes/util/XHR.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/icons/default/icons.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/icons/default/icons.min.js mode change 100755 => 100644 common/static/js/vendor/tinymce/js/tinymce/jquery.tinymce.min.js mode change 100755 => 100644 common/static/js/vendor/tinymce/js/tinymce/langs/readme.md mode change 100755 => 100644 common/static/js/vendor/tinymce/js/tinymce/license.txt create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/autoresize/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/autoresize/plugin.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/autosave/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/autosave/plugin.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/bbcode/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/bbcode/plugin.min.js delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/LICENSE.txt delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/README.txt create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/cs_CZ.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/de.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/es_ES.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/fr_FR.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/pt_BR.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/pt_PT.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/ru.js create mode 100755 common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/uk.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/zh_TW.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/codesample/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/codesample/plugin.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/colorpicker/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/colorpicker/plugin.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/directionality/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/directionality/plugin.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/emoticons/js/emojis.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/emoticons/js/emojis.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/emoticons/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/emoticons/plugin.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/fullpage/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/fullpage/plugin.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/fullscreen/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/fullscreen/plugin.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/help/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/help/plugin.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/hr/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/hr/plugin.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/image/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/imagetools/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/imagetools/plugin.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/importcss/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/importcss/plugin.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/legacyoutput/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/legacyoutput/plugin.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/media/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/nonbreaking/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/nonbreaking/plugin.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/noneditable/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/noneditable/plugin.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/pagebreak/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/pagebreak/plugin.min.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/plugins/paste/classes/Clipboard.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/plugins/paste/classes/Plugin.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/plugins/paste/classes/Quirks.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/plugins/paste/classes/Utils.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/plugins/paste/classes/WordFilter.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/plugins/paste/plugin.dev.js mode change 100755 => 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/paste/plugin.js mode change 100755 => 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/paste/plugin.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/preview/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/preview/plugin.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/quickbars/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/quickbars/plugin.min.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/plugins/spellchecker/classes/DomTextMatcher.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/plugins/spellchecker/classes/Plugin.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/plugins/spellchecker/plugin.dev.js mode change 100755 => 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/spellchecker/plugin.js mode change 100755 => 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/spellchecker/plugin.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/tabfocus/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/tabfocus/plugin.min.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/plugins/table/classes/CellSelection.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/plugins/table/classes/Plugin.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/plugins/table/classes/Quirks.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/plugins/table/classes/TableGrid.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/plugins/table/plugin.dev.js mode change 100755 => 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/table/plugin.js mode change 100755 => 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/table/plugin.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/template/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/template/plugin.min.js mode change 100755 => 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/textcolor/plugin.js mode change 100755 => 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/textcolor/plugin.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/textpattern/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/textpattern/plugin.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/toc/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/toc/plugin.min.js delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/visualblocks/css/visualblocks.css delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/visualblocks/img/address.gif delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/visualblocks/img/article.gif delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/visualblocks/img/aside.gif delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/visualblocks/img/blockquote.gif delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/visualblocks/img/div.gif delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/visualblocks/img/figure.gif delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/visualblocks/img/h1.gif delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/visualblocks/img/h2.gif delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/visualblocks/img/h3.gif delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/visualblocks/img/h4.gif delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/visualblocks/img/h5.gif delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/visualblocks/img/h6.gif delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/visualblocks/img/hgroup.gif delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/visualblocks/img/ol.gif delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/visualblocks/img/p.gif delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/visualblocks/img/pre.gif delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/visualblocks/img/section.gif delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/visualblocks/img/ul.gif create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/visualchars/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/visualchars/plugin.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/wordcount/plugin.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/plugins/wordcount/plugin.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/readme.md create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/dark/content.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/dark/content.min.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/dark/content.min.css.map create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/default/content.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/default/content.min.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/default/content.min.css.map create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/document/content.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/document/content.min.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/document/content.min.css.map create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/writer/content.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/writer/content.min.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/writer/content.min.css.map create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.min.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.min.css.map create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.min.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.min.css.map create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.mobile.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.mobile.min.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.mobile.min.css.map create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.min.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.min.css.map create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.mobile.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.mobile.min.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.mobile.min.css.map create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.inline.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.inline.min.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.inline.min.css.map create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.min.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.min.css.map create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.mobile.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.mobile.min.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.mobile.min.css.map create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.min.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.min.css.map create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.mobile.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.mobile.min.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.mobile.min.css.map rename common/static/js/vendor/tinymce/js/tinymce/skins/{ => ui}/studio-tmce4/content.inline.min.css (100%) rename common/static/js/vendor/tinymce/js/tinymce/skins/{ => ui}/studio-tmce4/content.min.css (100%) rename common/static/js/vendor/tinymce/js/tinymce/skins/{ => ui}/studio-tmce4/fonts/icomoon-small.eot (100%) rename common/static/js/vendor/tinymce/js/tinymce/skins/{ => ui}/studio-tmce4/fonts/icomoon-small.svg (100%) rename common/static/js/vendor/tinymce/js/tinymce/skins/{ => ui}/studio-tmce4/fonts/icomoon-small.ttf (100%) rename common/static/js/vendor/tinymce/js/tinymce/skins/{ => ui}/studio-tmce4/fonts/icomoon-small.woff (100%) rename common/static/js/vendor/tinymce/js/tinymce/skins/{ => ui}/studio-tmce4/fonts/icomoon.eot (100%) rename common/static/js/vendor/tinymce/js/tinymce/skins/{ => ui}/studio-tmce4/fonts/icomoon.svg (100%) rename common/static/js/vendor/tinymce/js/tinymce/skins/{ => ui}/studio-tmce4/fonts/icomoon.ttf (100%) rename common/static/js/vendor/tinymce/js/tinymce/skins/{ => ui}/studio-tmce4/fonts/icomoon.woff (100%) rename common/static/js/vendor/tinymce/js/tinymce/skins/{ => ui}/studio-tmce4/fonts/readme.md (100%) rename common/static/js/vendor/tinymce/js/tinymce/skins/{ => ui}/studio-tmce4/img/anchor.gif (100%) rename common/static/js/vendor/tinymce/js/tinymce/skins/{ => ui}/studio-tmce4/img/loader.gif (100%) rename common/static/js/vendor/tinymce/js/tinymce/skins/{ => ui}/studio-tmce4/img/object.gif (100%) rename common/static/js/vendor/tinymce/js/tinymce/skins/{ => ui}/studio-tmce4/img/trans.gif (100%) rename common/static/js/vendor/tinymce/js/tinymce/skins/{ => ui}/studio-tmce4/img/wline.gif (100%) rename common/static/js/vendor/tinymce/js/tinymce/skins/{ => ui}/studio-tmce4/skin.ie7.min.css (100%) rename common/static/js/vendor/tinymce/js/tinymce/skins/{ => ui}/studio-tmce4/skin.json (100%) rename common/static/js/vendor/tinymce/js/tinymce/skins/{ => ui}/studio-tmce4/skin.min.css (100%) create mode 100644 common/static/js/vendor/tinymce/js/tinymce/themes/mobile/theme.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/themes/mobile/theme.min.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/themes/modern/theme.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/themes/modern/theme.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/themes/silver/theme.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/themes/silver/theme.min.js create mode 100644 common/static/js/vendor/tinymce/js/tinymce/tinymce.d.ts delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/tinymce.dev.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/tinymce.jquery.dev.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/tinymce.jquery.js delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/tinymce.jquery.min.js mode change 100755 => 100644 common/static/js/vendor/tinymce/js/tinymce/tinymce.js diff --git a/cms/envs/common.py b/cms/envs/common.py index 010e045034ff..21d655500a2c 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -1295,14 +1295,14 @@ 'style-vendor-tinymce-content': { 'source_filenames': [ 'css/tinymce-studio-content-fonts.css', - 'js/vendor/tinymce/js/tinymce/skins/studio-tmce4/content.min.css', + 'js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/content.min.css', 'css/tinymce-studio-content.css' ], 'output_filename': 'css/cms-style-vendor-tinymce-content.css', }, 'style-vendor-tinymce-skin': { 'source_filenames': [ - 'js/vendor/tinymce/js/tinymce/skins/studio-tmce4/skin.min.css' + 'js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/skin.min.css' ], 'output_filename': 'css/cms-style-vendor-tinymce-skin.css', }, diff --git a/common/static/js/vendor/tinymce/BUILD_README.txt b/common/static/js/vendor/tinymce/BUILD_README.txt index e5ae62162cc2..7f067dabd056 100644 --- a/common/static/js/vendor/tinymce/BUILD_README.txt +++ b/common/static/js/vendor/tinymce/BUILD_README.txt @@ -1,20 +1,29 @@ -Instructions for creating js/tinymce.full.min.js +# Instructions for updating tinymce to a newer version: -1. Ensure that the dependencies (NodeJS, Jake, and other dependencies) are installed. If necessary, - install them per the directions on https://github.com/tinymce/tinymce/tree/4.0.20. -2. Unzip edx-platform/vendor_extra/tinymce/JakePackage.zip into this directory (so that Jakefile.js resides in this directory). -3. Clean install the dependencies that were unzipped - npm ci -4. Run the following command in the tinymce directory: - npx jake clean-js -5. Run the following command in the tinymce directory: - npx jake minify bundle[themes:*,plugins:*] -6. Cleanup by deleting the Unversioned files that were created from unzipping jake_package.zip. +1. Download the desired version from https://github.com/tinymce/tinymce/tags +2. If it’s a major update, follow the official migration doc and update the codebase as needed. +3. Setup the codemirror-plugin as per the instruction below. +4. Find all the EDX specific changes in the currently used version of tinymce by searching for the string "EDX" in the vendor/js/tinymce dir. +5. Merge the EDX specific changes with the newly downloaded version. +6. Follow the instructions given below to create the new version of js/tinymce.full.min.js -Instructions for updating tinymce to a newer version: +# Instruction for setting codemirror-plugin -1. Download the desired version from https://github.com/tinymce/tinymce/releases -2. Find all the EDX specific changes that were made to the currently used version of tinymce by searching for - the string "EDX" in this directory. -3. Merge the EDX specific changes with the new version. -4. Follow the instructions above for creating the new version of js/tinymce.full.min.js +1. Download the tinymce-codemirror-plugin from https://gitlab.com/tinymce-plugins/tinymce-codemirror +2. Open terminal in the downloaded plugin directory and run the following commands: + ``` + npm install + npm run prepublish (This command will generate the minified file in the plugin directory) + ``` +3. Remove the tinymce-codemirror/plugins/codemirror/codemirror-4.8 directory +4. Move the tinymce-codemirror/plugins directory to common/static/js/vendor/tinymce/js/plugins/ directory. + +# Instructions for creating js/tinymce.full.min.js + +1. Follow the README file of the downloaded tinymce’s codebase and install all the requirements. +2. Open terminal and change directory to the newly downloaded tinymce. +3. Run the build command: “yarn build”, this will create multiple zip files in the build directory. +4. Unzip the tinymce_.zip file in common/static/vendor/js/ +5. Unzip vendor_extra/tinymce/JakePackage.zip in common/static/vendor/js/tinymce/. +6. Run the following command in the tinymce directory: npx jake minify bundle[themes:silver,plugins:*] +7. Cleanup by deleting the unversioned files that were created from unzipping jake_package.zip. diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/AddOnManager.js b/common/static/js/vendor/tinymce/js/tinymce/classes/AddOnManager.js deleted file mode 100755 index 02ae2d9bdd2f..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/AddOnManager.js +++ /dev/null @@ -1,256 +0,0 @@ -/** - * AddOnManager.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class handles the loading of themes/plugins or other add-ons and their language packs. - * - * @class tinymce.AddOnManager - */ -define("tinymce/AddOnManager", [ - "tinymce/dom/ScriptLoader", - "tinymce/util/Tools" -], function(ScriptLoader, Tools) { - var each = Tools.each; - - function AddOnManager() { - var self = this; - - self.items = []; - self.urls = {}; - self.lookup = {}; - } - - AddOnManager.prototype = { - /** - * Returns the specified add on by the short name. - * - * @method get - * @param {String} name Add-on to look for. - * @return {tinymce.Theme/tinymce.Plugin} Theme or plugin add-on instance or undefined. - */ - get: function(name) { - if (this.lookup[name]) { - return this.lookup[name].instance; - } else { - return undefined; - } - }, - - dependencies: function(name) { - var result; - - if (this.lookup[name]) { - result = this.lookup[name].dependencies; - } - - return result || []; - }, - - /** - * Loads a language pack for the specified add-on. - * - * @method requireLangPack - * @param {String} name Short name of the add-on. - * @param {String} languages Optional comma or space separated list of languages to check if it matches the name. - */ - requireLangPack: function(name, languages) { - if (AddOnManager.language && AddOnManager.languageLoad !== false) { - if (languages && new RegExp('([, ]|\\b)' + AddOnManager.language + '([, ]|\\b)').test(languages) === false) { - return; - } - - ScriptLoader.ScriptLoader.add(this.urls[name] + '/langs/' + AddOnManager.language + '.js'); - } - }, - - /** - * Adds a instance of the add-on by it's short name. - * - * @method add - * @param {String} id Short name/id for the add-on. - * @param {tinymce.Theme/tinymce.Plugin} addOn Theme or plugin to add. - * @return {tinymce.Theme/tinymce.Plugin} The same theme or plugin instance that got passed in. - * @example - * // Create a simple plugin - * tinymce.create('tinymce.plugins.TestPlugin', { - * TestPlugin: function(ed, url) { - * ed.on('click', function(e) { - * ed.windowManager.alert('Hello World!'); - * }); - * } - * }); - * - * // Register plugin using the add method - * tinymce.PluginManager.add('test', tinymce.plugins.TestPlugin); - * - * // Initialize TinyMCE - * tinymce.init({ - * ... - * plugins: '-test' // Init the plugin but don't try to load it - * }); - */ - add: function(id, addOn, dependencies) { - this.items.push(addOn); - this.lookup[id] = {instance: addOn, dependencies: dependencies}; - - return addOn; - }, - - createUrl: function(baseUrl, dep) { - if (typeof dep === "object") { - return dep; - } else { - return {prefix: baseUrl.prefix, resource: dep, suffix: baseUrl.suffix}; - } - }, - - /** - * Add a set of components that will make up the add-on. Using the url of the add-on name as the base url. - * This should be used in development mode. A new compressor/javascript munger process will ensure that the - * components are put together into the plugin.js file and compressed correctly. - * - * @method addComponents - * @param {String} pluginName name of the plugin to load scripts from (will be used to get the base url for the plugins). - * @param {Array} scripts Array containing the names of the scripts to load. - */ - addComponents: function(pluginName, scripts) { - var pluginUrl = this.urls[pluginName]; - - each(scripts, function(script) { - ScriptLoader.ScriptLoader.add(pluginUrl + "/" + script); - }); - }, - - /** - * Loads an add-on from a specific url. - * - * @method load - * @param {String} name Short name of the add-on that gets loaded. - * @param {String} addOnUrl URL to the add-on that will get loaded. - * @param {function} callback Optional callback to execute ones the add-on is loaded. - * @param {Object} scope Optional scope to execute the callback in. - * @example - * // Loads a plugin from an external URL - * tinymce.PluginManager.load('myplugin', '/some/dir/someplugin/plugin.js'); - * - * // Initialize TinyMCE - * tinymce.init({ - * ... - * plugins: '-myplugin' // Don't try to load it again - * }); - */ - load: function(name, addOnUrl, callback, scope) { - var self = this, url = addOnUrl; - - function loadDependencies() { - var dependencies = self.dependencies(name); - - each(dependencies, function(dep) { - var newUrl = self.createUrl(addOnUrl, dep); - - self.load(newUrl.resource, newUrl, undefined, undefined); - }); - - if (callback) { - if (scope) { - callback.call(scope); - } else { - callback.call(ScriptLoader); - } - } - } - - if (self.urls[name]) { - return; - } - - if (typeof addOnUrl === "object") { - url = addOnUrl.prefix + addOnUrl.resource + addOnUrl.suffix; - } - - if (url.indexOf('/') !== 0 && url.indexOf('://') == -1) { - url = AddOnManager.baseURL + '/' + url; - } - - self.urls[name] = url.substring(0, url.lastIndexOf('/')); - - if (self.lookup[name]) { - loadDependencies(); - } else { - ScriptLoader.ScriptLoader.add(url, loadDependencies, scope); - } - } - }; - - AddOnManager.PluginManager = new AddOnManager(); - AddOnManager.ThemeManager = new AddOnManager(); - - return AddOnManager; -}); - -/** - * TinyMCE theme class. - * - * @class tinymce.Theme - */ - -/** - * This method is responsible for rendering/generating the overall user interface with toolbars, buttons, iframe containers etc. - * - * @method renderUI - * @param {Object} obj Object parameter containing the targetNode DOM node that will be replaced visually with an editor instance. - * @return {Object} an object with items like iframeContainer, editorContainer, sizeContainer, deltaWidth, deltaHeight. - */ - -/** - * Plugin base class, this is a pseudo class that describes how a plugin is to be created for TinyMCE. The methods below are all optional. - * - * @class tinymce.Plugin - * @example - * tinymce.PluginManager.add('example', function(editor, url) { - * // Add a button that opens a window - * editor.addButton('example', { - * text: 'My button', - * icon: false, - * onclick: function() { - * // Open window - * editor.windowManager.open({ - * title: 'Example plugin', - * body: [ - * {type: 'textbox', name: 'title', label: 'Title'} - * ], - * onsubmit: function(e) { - * // Insert content when the window form is submitted - * editor.insertContent('Title: ' + e.data.title); - * } - * }); - * } - * }); - * - * // Adds a menu item to the tools menu - * editor.addMenuItem('example', { - * text: 'Example plugin', - * context: 'tools', - * onclick: function() { - * // Open window with a specific url - * editor.windowManager.open({ - * title: 'TinyMCE site', - * url: 'http://www.tinymce.com', - * width: 800, - * height: 600, - * buttons: [{ - * text: 'Close', - * onclick: 'close' - * }] - * }); - * } - * }); - * }); - */ diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/Compat.js b/common/static/js/vendor/tinymce/js/tinymce/classes/Compat.js deleted file mode 100755 index eacc64c9cf94..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/Compat.js +++ /dev/null @@ -1,84 +0,0 @@ -/** - * Compat.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * TinyMCE core class. - * - * @static - * @class tinymce - * @borrow-members tinymce.EditorManager - * @borrow-members tinymce.util.Tools - */ -define("tinymce/Compat", [ - "tinymce/dom/DOMUtils", - "tinymce/dom/EventUtils", - "tinymce/dom/ScriptLoader", - "tinymce/AddOnManager", - "tinymce/util/Tools", - "tinymce/Env" -], function(DOMUtils, EventUtils, ScriptLoader, AddOnManager, Tools, Env) { - var tinymce = window.tinymce; - - /** - * @property {tinymce.dom.DOMUtils} DOM Global DOM instance. - * @property {tinymce.dom.ScriptLoader} ScriptLoader Global ScriptLoader instance. - * @property {tinymce.AddOnManager} PluginManager Global PluginManager instance. - * @property {tinymce.AddOnManager} ThemeManager Global ThemeManager instance. - */ - tinymce.DOM = DOMUtils.DOM; - tinymce.ScriptLoader = ScriptLoader.ScriptLoader; - tinymce.PluginManager = AddOnManager.PluginManager; - tinymce.ThemeManager = AddOnManager.ThemeManager; - - tinymce.dom = tinymce.dom || {}; - tinymce.dom.Event = EventUtils.Event; - - Tools.each(Tools, function(func, key) { - tinymce[key] = func; - }); - - Tools.each('isOpera isWebKit isIE isGecko isMac'.split(' '), function(name) { - tinymce[name] = Env[name.substr(2).toLowerCase()]; - }); - - return {}; -}); - -// Describe the different namespaces - -/** - * Root level namespace this contains classes directly releated to the TinyMCE editor. - * - * @namespace tinymce - */ - -/** - * Contains classes for handling the browsers DOM. - * - * @namespace tinymce.dom - */ - -/** - * Contains html parser and serializer logic. - * - * @namespace tinymce.html - */ - -/** - * Contains the different UI types such as buttons, listboxes etc. - * - * @namespace tinymce.ui - */ - -/** - * Contains various utility classes such as json parser, cookies etc. - * - * @namespace tinymce.util - */ diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/Editor.js b/common/static/js/vendor/tinymce/js/tinymce/classes/Editor.js deleted file mode 100755 index 571c4fa32d29..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/Editor.js +++ /dev/null @@ -1,2168 +0,0 @@ -/** - * Editor.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*jshint scripturl:true */ - -/** - * Include the base event class documentation. - * - * @include ../../../tools/docs/tinymce.Event.js - */ - -/** - * This class contains the core logic for a TinyMCE editor. - * - * @class tinymce.Editor - * @mixes tinymce.util.Observable - * @example - * // Add a class to all paragraphs in the editor. - * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'someclass'); - * - * // Gets the current editors selection as text - * tinymce.activeEditor.selection.getContent({format: 'text'}); - * - * // Creates a new editor instance - * var ed = new tinymce.Editor('textareaid', { - * some_setting: 1 - * }, tinymce.EditorManager); - * - * // Select each item the user clicks on - * ed.on('click', function(e) { - * ed.selection.select(e.target); - * }); - * - * ed.render(); - */ -define("tinymce/Editor", [ - "tinymce/dom/DOMUtils", - "tinymce/AddOnManager", - "tinymce/html/Node", - "tinymce/dom/Serializer", - "tinymce/html/Serializer", - "tinymce/dom/Selection", - "tinymce/Formatter", - "tinymce/UndoManager", - "tinymce/EnterKey", - "tinymce/ForceBlocks", - "tinymce/EditorCommands", - "tinymce/util/URI", - "tinymce/dom/ScriptLoader", - "tinymce/dom/EventUtils", - "tinymce/WindowManager", - "tinymce/html/Schema", - "tinymce/html/DomParser", - "tinymce/util/Quirks", - "tinymce/Env", - "tinymce/util/Tools", - "tinymce/util/Observable", - "tinymce/Shortcuts" -], function( - DOMUtils, AddOnManager, Node, DomSerializer, Serializer, - Selection, Formatter, UndoManager, EnterKey, ForceBlocks, EditorCommands, - URI, ScriptLoader, EventUtils, WindowManager, - Schema, DomParser, Quirks, Env, Tools, Observable, Shortcuts -) { - // Shorten these names - var DOM = DOMUtils.DOM, ThemeManager = AddOnManager.ThemeManager, PluginManager = AddOnManager.PluginManager; - var extend = Tools.extend, each = Tools.each, explode = Tools.explode; - var inArray = Tools.inArray, trim = Tools.trim, resolve = Tools.resolve; - var Event = EventUtils.Event; - var isGecko = Env.gecko, ie = Env.ie; - - function getEventTarget(editor, eventName) { - if (eventName == 'selectionchange') { - return editor.getDoc(); - } - - // Need to bind mousedown/mouseup etc to document not body in iframe mode - // Since the user might click on the HTML element not the BODY - if (!editor.inline && /^mouse|click|contextmenu|drop/.test(eventName)) { - return editor.getDoc(); - } - - return editor.getBody(); - } - - /** - * Include documentation for all the events. - * - * @include ../../../tools/docs/tinymce.Editor.js - */ - - /** - * Constructs a editor instance by id. - * - * @constructor - * @method Editor - * @param {String} id Unique id for the editor. - * @param {Object} settings Settings for the editor. - * @param {tinymce.EditorManager} editorManager EditorManager instance. - * @author Moxiecode - */ - function Editor(id, settings, editorManager) { - var self = this, documentBaseUrl, baseUri; - - documentBaseUrl = self.documentBaseUrl = editorManager.documentBaseURL; - baseUri = editorManager.baseURI; - - /** - * Name/value collection with editor settings. - * - * @property settings - * @type Object - * @example - * // Get the value of the theme setting - * tinymce.activeEditor.windowManager.alert("You are using the " + tinymce.activeEditor.settings.theme + " theme"); - */ - self.settings = settings = extend({ - id: id, - theme: 'modern', - delta_width: 0, - delta_height: 0, - popup_css: '', - plugins: '', - document_base_url: documentBaseUrl, - add_form_submit_trigger: true, - submit_patch: true, - add_unload_trigger: true, - convert_urls: true, - relative_urls: true, - remove_script_host: true, - object_resizing: true, - doctype: '', - visual: true, - font_size_style_values: 'xx-small,x-small,small,medium,large,x-large,xx-large', - - // See: http://www.w3.org/TR/CSS2/fonts.html#propdef-font-size - font_size_legacy_values: 'xx-small,small,medium,large,x-large,xx-large,300%', - forced_root_block: 'p', - hidden_input: true, - padd_empty_editor: true, - render_ui: true, - indentation: '30px', - inline_styles: true, - convert_fonts_to_spans: true, - indent: 'simple', - indent_before: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,' + - 'tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist', - indent_after: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,' + - 'tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist', - validate: true, - entity_encoding: 'named', - url_converter: self.convertURL, - url_converter_scope: self, - ie7_compat: true - }, settings); - - AddOnManager.language = settings.language || 'en'; - AddOnManager.languageLoad = settings.language_load; - - AddOnManager.baseURL = editorManager.baseURL; - - /** - * Editor instance id, normally the same as the div/textarea that was replaced. - * - * @property id - * @type String - */ - self.id = settings.id = id; - - /** - * State to force the editor to return false on a isDirty call. - * - * @property isNotDirty - * @type Boolean - * @example - * function ajaxSave() { - * var ed = tinymce.get('elm1'); - * - * // Save contents using some XHR call - * alert(ed.getContent()); - * - * ed.isNotDirty = true; // Force not dirty state - * } - */ - self.isNotDirty = true; - - /** - * Name/Value object containting plugin instances. - * - * @property plugins - * @type Object - * @example - * // Execute a method inside a plugin directly - * tinymce.activeEditor.plugins.someplugin.someMethod(); - */ - self.plugins = {}; - - /** - * URI object to document configured for the TinyMCE instance. - * - * @property documentBaseURI - * @type tinymce.util.URI - * @example - * // Get relative URL from the location of document_base_url - * tinymce.activeEditor.documentBaseURI.toRelative('/somedir/somefile.htm'); - * - * // Get absolute URL from the location of document_base_url - * tinymce.activeEditor.documentBaseURI.toAbsolute('somefile.htm'); - */ - self.documentBaseURI = new URI(settings.document_base_url || documentBaseUrl, { - base_uri: baseUri - }); - - /** - * URI object to current document that holds the TinyMCE editor instance. - * - * @property baseURI - * @type tinymce.util.URI - * @example - * // Get relative URL from the location of the API - * tinymce.activeEditor.baseURI.toRelative('/somedir/somefile.htm'); - * - * // Get absolute URL from the location of the API - * tinymce.activeEditor.baseURI.toAbsolute('somefile.htm'); - */ - self.baseURI = baseUri; - - /** - * Array with CSS files to load into the iframe. - * - * @property contentCSS - * @type Array - */ - self.contentCSS = []; - - /** - * Array of CSS styles to add to head of document when the editor loads. - * - * @property contentStyles - * @type Array - */ - self.contentStyles = []; - - // Creates all events like onClick, onSetContent etc see Editor.Events.js for the actual logic - self.shortcuts = new Shortcuts(self); - - // Internal command handler objects - self.execCommands = {}; - self.queryStateCommands = {}; - self.queryValueCommands = {}; - self.loadedCSS = {}; - - self.suffix = editorManager.suffix; - self.editorManager = editorManager; - self.inline = settings.inline; - - // Call setup - editorManager.fire('SetupEditor', self); - self.execCallback('setup', self); - } - - Editor.prototype = { - /** - * Renderes the editor/adds it to the page. - * - * @method render - */ - render: function() { - var self = this, settings = self.settings, id = self.id, suffix = self.suffix; - - function readyHandler() { - DOM.unbind(window, 'ready', readyHandler); - self.render(); - } - - // Page is not loaded yet, wait for it - if (!Event.domLoaded) { - DOM.bind(window, 'ready', readyHandler); - return; - } - - // Element not found, then skip initialization - if (!self.getElement()) { - return; - } - - // No editable support old iOS versions etc - if (!Env.contentEditable) { - return; - } - - // Hide target element early to prevent content flashing - if (!settings.inline) { - self.orgVisibility = self.getElement().style.visibility; - self.getElement().style.visibility = 'hidden'; - } else { - self.inline = true; - } - - var form = self.getElement().form || DOM.getParent(id, 'form'); - if (form) { - self.formElement = form; - - // Add hidden input for non input elements inside form elements - if (settings.hidden_input && !/TEXTAREA|INPUT/i.test(self.getElement().nodeName)) { - DOM.insertAfter(DOM.create('input', {type: 'hidden', name: id}), id); - self.hasHiddenInput = true; - } - - // Pass submit/reset from form to editor instance - self.formEventDelegate = function(e) { - self.fire(e.type, e); - }; - - DOM.bind(form, 'submit reset', self.formEventDelegate); - - // Reset contents in editor when the form is reset - self.on('reset', function() { - self.setContent(self.startContent, {format: 'raw'}); - }); - - // Check page uses id="submit" or name="submit" for it's submit button - if (settings.submit_patch && !form.submit.nodeType && !form.submit.length && !form._mceOldSubmit) { - form._mceOldSubmit = form.submit; - form.submit = function() { - self.editorManager.triggerSave(); - self.isNotDirty = true; - - return form._mceOldSubmit(form); - }; - } - } - - /** - * Window manager reference, use this to open new windows and dialogs. - * - * @property windowManager - * @type tinymce.WindowManager - * @example - * // Shows an alert message - * tinymce.activeEditor.windowManager.alert('Hello world!'); - * - * // Opens a new dialog with the file.htm file and the size 320x240 - * // It also adds a custom parameter this can be retrieved by using tinyMCEPopup.getWindowArg inside the dialog. - * tinymce.activeEditor.windowManager.open({ - * url: 'file.htm', - * width: 320, - * height: 240 - * }, { - * custom_param: 1 - * }); - */ - self.windowManager = new WindowManager(self); - - if (settings.encoding == 'xml') { - self.on('GetContent', function(e) { - if (e.save) { - e.content = DOM.encode(e.content); - } - }); - } - - if (settings.add_form_submit_trigger) { - self.on('submit', function() { - if (self.initialized) { - self.save(); - } - }); - } - - if (settings.add_unload_trigger) { - self._beforeUnload = function() { - if (self.initialized && !self.destroyed && !self.isHidden()) { - self.save({format: 'raw', no_events: true, set_dirty: false}); - } - }; - - self.editorManager.on('BeforeUnload', self._beforeUnload); - } - - // Load scripts - function loadScripts() { - var scriptLoader = ScriptLoader.ScriptLoader; - - if (settings.language && settings.language != 'en' && !settings.language_url) { - settings.language_url = self.editorManager.baseURL + '/langs/' + settings.language + '.js'; - } - - if (settings.language_url) { - scriptLoader.add(settings.language_url); - } - - if (settings.theme && typeof settings.theme != "function" && - settings.theme.charAt(0) != '-' && !ThemeManager.urls[settings.theme]) { - var themeUrl = settings.theme_url; - - if (themeUrl) { - themeUrl = self.documentBaseURI.toAbsolute(themeUrl); - } else { - themeUrl = 'themes/' + settings.theme + '/theme' + suffix + '.js'; - } - - ThemeManager.load(settings.theme, themeUrl); - } - - if (Tools.isArray(settings.plugins)) { - settings.plugins = settings.plugins.join(' '); - } - - each(settings.external_plugins, function(url, name) { - PluginManager.load(name, url); - settings.plugins += ' ' + name; - }); - - each(settings.plugins.split(/[ ,]/), function(plugin) { - plugin = trim(plugin); - - if (plugin && !PluginManager.urls[plugin]) { - if (plugin.charAt(0) == '-') { - plugin = plugin.substr(1, plugin.length); - - var dependencies = PluginManager.dependencies(plugin); - - each(dependencies, function(dep) { - var defaultSettings = { - prefix:'plugins/', - resource: dep, - suffix:'/plugin' + suffix + '.js' - }; - - dep = PluginManager.createUrl(defaultSettings, dep); - PluginManager.load(dep.resource, dep); - }); - } else { - PluginManager.load(plugin, { - prefix: 'plugins/', - resource: plugin, - suffix: '/plugin' + suffix + '.js' - }); - } - } - }); - - scriptLoader.loadQueue(function() { - if (!self.removed) { - self.init(); - } - }); - } - - loadScripts(); - }, - - /** - * Initializes the editor this will be called automatically when - * all plugins/themes and language packs are loaded by the rendered method. - * This method will setup the iframe and create the theme and plugin instances. - * - * @method init - */ - init: function() { - var self = this, settings = self.settings, elm = self.getElement(); - var w, h, minHeight, n, o, Theme, url, bodyId, bodyClass, re, i, initializedPlugins = []; - - self.rtl = this.editorManager.i18n.rtl; - self.editorManager.add(self); - - settings.aria_label = settings.aria_label || DOM.getAttrib(elm, 'aria-label', self.getLang('aria.rich_text_area')); - - /** - * Reference to the theme instance that was used to generate the UI. - * - * @property theme - * @type tinymce.Theme - * @example - * // Executes a method on the theme directly - * tinymce.activeEditor.theme.someMethod(); - */ - if (settings.theme) { - if (typeof settings.theme != "function") { - settings.theme = settings.theme.replace(/-/, ''); - Theme = ThemeManager.get(settings.theme); - self.theme = new Theme(self, ThemeManager.urls[settings.theme]); - - if (self.theme.init) { - self.theme.init(self, ThemeManager.urls[settings.theme] || self.documentBaseUrl.replace(/\/$/, '')); - } - } else { - self.theme = settings.theme; - } - } - - function initPlugin(plugin) { - var Plugin = PluginManager.get(plugin), pluginUrl, pluginInstance; - - pluginUrl = PluginManager.urls[plugin] || self.documentBaseUrl.replace(/\/$/, ''); - plugin = trim(plugin); - if (Plugin && inArray(initializedPlugins, plugin) === -1) { - each(PluginManager.dependencies(plugin), function(dep){ - initPlugin(dep); - }); - - pluginInstance = new Plugin(self, pluginUrl); - - self.plugins[plugin] = pluginInstance; - - if (pluginInstance.init) { - pluginInstance.init(self, pluginUrl); - initializedPlugins.push(plugin); - } - } - } - - // Create all plugins - each(settings.plugins.replace(/\-/g, '').split(/[ ,]/), initPlugin); - - // Measure box - if (settings.render_ui && self.theme) { - self.orgDisplay = elm.style.display; - - if (typeof settings.theme != "function") { - w = settings.width || elm.style.width || elm.offsetWidth; - h = settings.height || elm.style.height || elm.offsetHeight; - minHeight = settings.min_height || 100; - re = /^[0-9\.]+(|px)$/i; - - if (re.test('' + w)) { - w = Math.max(parseInt(w, 10), 100); - } - - if (re.test('' + h)) { - h = Math.max(parseInt(h, 10), minHeight); - } - - // Render UI - o = self.theme.renderUI({ - targetNode: elm, - width: w, - height: h, - deltaWidth: settings.delta_width, - deltaHeight: settings.delta_height - }); - - // Resize editor - if (!settings.content_editable) { - DOM.setStyles(o.sizeContainer || o.editorContainer, { - wi2dth: w, - // TODO: Fix this - h2eight: h - }); - - h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : ''); - if (h < minHeight) { - h = minHeight; - } - } - } else { - o = settings.theme(self, elm); - - // Convert element type to id:s - if (o.editorContainer.nodeType) { - o.editorContainer = o.editorContainer.id = o.editorContainer.id || self.id + "_parent"; - } - - // Convert element type to id:s - if (o.iframeContainer.nodeType) { - o.iframeContainer = o.iframeContainer.id = o.iframeContainer.id || self.id + "_iframecontainer"; - } - - // Use specified iframe height or the targets offsetHeight - h = o.iframeHeight || elm.offsetHeight; - } - - self.editorContainer = o.editorContainer; - } - - // Load specified content CSS last - if (settings.content_css) { - each(explode(settings.content_css), function(u) { - self.contentCSS.push(self.documentBaseURI.toAbsolute(u)); - }); - } - - // Load specified content CSS last - if (settings.content_style) { - self.contentStyles.push(settings.content_style); - } - - // Content editable mode ends here - if (settings.content_editable) { - elm = n = o = null; // Fix IE leak - return self.initContentBody(); - } - - self.iframeHTML = settings.doctype + ''; - - // We only need to override paths if we have to - // IE has a bug where it remove site absolute urls to relative ones if this is specified - if (settings.document_base_url != self.documentBaseUrl) { - self.iframeHTML += ''; - } - - // IE8 doesn't support carets behind images setting ie7_compat would force IE8+ to run in IE7 compat mode. - if (!Env.caretAfter && settings.ie7_compat) { - self.iframeHTML += ''; - } - - self.iframeHTML += ''; - - // Load the CSS by injecting them into the HTML this will reduce "flicker" - for (i = 0; i < self.contentCSS.length; i++) { - var cssUrl = self.contentCSS[i]; - self.iframeHTML += ''; - self.loadedCSS[cssUrl] = true; - } - - bodyId = settings.body_id || 'tinymce'; - if (bodyId.indexOf('=') != -1) { - bodyId = self.getParam('body_id', '', 'hash'); - bodyId = bodyId[self.id] || bodyId; - } - - bodyClass = settings.body_class || ''; - if (bodyClass.indexOf('=') != -1) { - bodyClass = self.getParam('body_class', '', 'hash'); - bodyClass = bodyClass[self.id] || ''; - } - - self.iframeHTML += '
'; - - /*eslint no-script-url:0 */ - var domainRelaxUrl = 'javascript:(function(){' + - 'document.open();document.domain="' + document.domain + '";' + - 'var ed = window.parent.tinymce.get("' + self.id + '");document.write(ed.iframeHTML);' + - 'document.close();ed.initContentBody(true);})()'; - - // Domain relaxing is required since the user has messed around with document.domain - if (document.domain != location.hostname) { - url = domainRelaxUrl; - } - - // Create iframe - // TODO: ACC add the appropriate description on this. - n = DOM.add(o.iframeContainer, 'iframe', { - id: self.id + "_ifr", - src: url || 'javascript:""', // Workaround for HTTPS warning in IE6/7 - frameBorder: '0', - allowTransparency: "true", - title: self.editorManager.translate( - "Rich Text Area. Press ALT-F9 for menu. " + - "Press ALT-F10 for toolbar. Press ALT-0 for help" - ), - style: { - width: '100%', - height: h, - display: 'block' // Important for Gecko to render the iframe correctly - } - }); - - // Try accessing the document this will fail on IE when document.domain is set to the same as location.hostname - // Then we have to force domain relaxing using the domainRelaxUrl approach very ugly!! - if (ie) { - try { - self.getDoc(); - } catch (e) { - n.src = url = domainRelaxUrl; - } - } - - self.contentAreaContainer = o.iframeContainer; - - if (o.editorContainer) { - DOM.get(o.editorContainer).style.display = self.orgDisplay; - } - - DOM.get(self.id).style.display = 'none'; - DOM.setAttrib(self.id, 'aria-hidden', true); - - if (!url) { - self.initContentBody(); - } - - elm = n = o = null; // Cleanup - }, - - /** - * This method get called by the init method ones the iframe is loaded. - * It will fill the iframe with contents, setups DOM and selection objects for the iframe. - * - * @method initContentBody - * @private - */ - initContentBody: function(skipWrite) { - var self = this, settings = self.settings, targetElm = DOM.get(self.id), doc = self.getDoc(), body, contentCssText; - - // Restore visibility on target element - if (!settings.inline) { - self.getElement().style.visibility = self.orgVisibility; - } - - // Setup iframe body - if (!skipWrite && !settings.content_editable) { - doc.open(); - doc.write(self.iframeHTML); - doc.close(); - } - - if (settings.content_editable) { - self.on('remove', function() { - var bodyEl = this.getBody(); - - DOM.removeClass(bodyEl, 'mce-content-body'); - DOM.removeClass(bodyEl, 'mce-edit-focus'); - DOM.setAttrib(bodyEl, 'tabIndex', null); - DOM.setAttrib(bodyEl, 'contentEditable', null); - }); - - DOM.addClass(targetElm, 'mce-content-body'); - targetElm.tabIndex = -1; - self.contentDocument = doc = settings.content_document || document; - self.contentWindow = settings.content_window || window; - self.bodyElement = targetElm; - - // Prevent leak in IE - settings.content_document = settings.content_window = null; - - // TODO: Fix this - settings.root_name = targetElm.nodeName.toLowerCase(); - } - - // It will not steal focus while setting contentEditable - body = self.getBody(); - body.disabled = true; - - if (!settings.readonly) { - if (self.inline && DOM.getStyle(body, 'position', true) == 'static') { - body.style.position = 'relative'; - } - - body.contentEditable = self.getParam('content_editable_state', true); - } - - body.disabled = false; - - /** - * Schema instance, enables you to validate elements and it's children. - * - * @property schema - * @type tinymce.html.Schema - */ - self.schema = new Schema(settings); - - /** - * DOM instance for the editor. - * - * @property dom - * @type tinymce.dom.DOMUtils - * @example - * // Adds a class to all paragraphs within the editor - * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'someclass'); - */ - self.dom = new DOMUtils(doc, { - keep_values: true, - url_converter: self.convertURL, - url_converter_scope: self, - hex_colors: settings.force_hex_style_colors, - class_filter: settings.class_filter, - update_styles: true, - root_element: settings.content_editable ? self.id : null, - collect: settings.content_editable, - schema: self.schema, - onSetAttrib: function(e) { - self.fire('SetAttrib', e); - } - }); - - /** - * HTML parser will be used when contents is inserted into the editor. - * - * @property parser - * @type tinymce.html.DomParser - */ - self.parser = new DomParser(settings, self.schema); - - // Convert src and href into data-mce-src, data-mce-href and data-mce-style - self.parser.addAttributeFilter('src,href,style', function(nodes, name) { - var i = nodes.length, node, dom = self.dom, value, internalName; - - while (i--) { - node = nodes[i]; - value = node.attr(name); - internalName = 'data-mce-' + name; - - // Add internal attribute if we need to we don't on a refresh of the document - if (!node.attributes.map[internalName]) { - if (name === "style") { - node.attr(internalName, dom.serializeStyle(dom.parseStyle(value), node.name)); - } else { - node.attr(internalName, self.convertURL(value, name, node.name)); - } - } - } - }); - - // Keep scripts from executing - self.parser.addNodeFilter('script', function(nodes) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - node.attr('type', 'mce-' + (node.attr('type') || 'text/javascript')); - } - }); - - self.parser.addNodeFilter('#cdata', function(nodes) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - node.type = 8; - node.name = '#comment'; - node.value = '[CDATA[' + node.value + ']]'; - } - }); - - self.parser.addNodeFilter('p,h1,h2,h3,h4,h5,h6,div', function(nodes) { - var i = nodes.length, node, nonEmptyElements = self.schema.getNonEmptyElements(); - - while (i--) { - node = nodes[i]; - - if (node.isEmpty(nonEmptyElements)) { - node.empty().append(new Node('br', 1)).shortEnded = true; - } - } - }); - - /** - * DOM serializer for the editor. Will be used when contents is extracted from the editor. - * - * @property serializer - * @type tinymce.dom.Serializer - * @example - * // Serializes the first paragraph in the editor into a string - * tinymce.activeEditor.serializer.serialize(tinymce.activeEditor.dom.select('p')[0]); - */ - self.serializer = new DomSerializer(settings, self); - - /** - * Selection instance for the editor. - * - * @property selection - * @type tinymce.dom.Selection - * @example - * // Sets some contents to the current selection in the editor - * tinymce.activeEditor.selection.setContent('Some contents'); - * - * // Gets the current selection - * alert(tinymce.activeEditor.selection.getContent()); - * - * // Selects the first paragraph found - * tinymce.activeEditor.selection.select(tinymce.activeEditor.dom.select('p')[0]); - */ - self.selection = new Selection(self.dom, self.getWin(), self.serializer, self); - - /** - * Formatter instance. - * - * @property formatter - * @type tinymce.Formatter - */ - self.formatter = new Formatter(self); - - /** - * Undo manager instance, responsible for handling undo levels. - * - * @property undoManager - * @type tinymce.UndoManager - * @example - * // Undoes the last modification to the editor - * tinymce.activeEditor.undoManager.undo(); - */ - self.undoManager = new UndoManager(self); - - self.forceBlocks = new ForceBlocks(self); - self.enterKey = new EnterKey(self); - self.editorCommands = new EditorCommands(self); - - self.fire('PreInit'); - - if (!settings.browser_spellcheck && !settings.gecko_spellcheck) { - doc.body.spellcheck = false; // Gecko - DOM.setAttrib(body, "spellcheck", "false"); - } - - self.fire('PostRender'); - - self.quirks = Quirks(self); - - if (settings.directionality) { - body.dir = settings.directionality; - } - - if (settings.nowrap) { - body.style.whiteSpace = "nowrap"; - } - - if (settings.protect) { - self.on('BeforeSetContent', function(e) { - each(settings.protect, function(pattern) { - e.content = e.content.replace(pattern, function(str) { - return ''; - }); - }); - }); - } - - self.on('SetContent', function() { - self.addVisual(self.getBody()); - }); - - // Remove empty contents - if (settings.padd_empty_editor) { - self.on('PostProcess', function(e) { - e.content = e.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
[\r\n]*)$/, ''); - }); - } - - self.load({initial: true, format: 'html'}); - self.startContent = self.getContent({format: 'raw'}); - - /** - * Is set to true after the editor instance has been initialized - * - * @property initialized - * @type Boolean - * @example - * function isEditorInitialized(editor) { - * return editor && editor.initialized; - * } - */ - self.initialized = true; - - each(self._pendingNativeEvents, function(name) { - self.dom.bind(getEventTarget(self, name), name, function(e) { - self.fire(e.type, e); - }); - }); - - self.fire('init'); - self.focus(true); - self.nodeChanged({initial: true}); - self.execCallback('init_instance_callback', self); - - // Add editor specific CSS styles - if (self.contentStyles.length > 0) { - contentCssText = ''; - - each(self.contentStyles, function(style) { - contentCssText += style + "\r\n"; - }); - - self.dom.addStyle(contentCssText); - } - - // Load specified content CSS last - each(self.contentCSS, function(cssUrl) { - if (!self.loadedCSS[cssUrl]) { - self.dom.loadCSS(cssUrl); - self.loadedCSS[cssUrl] = true; - } - }); - - // Handle auto focus - if (settings.auto_focus) { - setTimeout(function () { - var ed = self.editorManager.get(settings.auto_focus); - - ed.selection.select(ed.getBody(), 1); - ed.selection.collapse(1); - ed.getBody().focus(); - ed.getWin().focus(); - }, 100); - } - - // Clean up references for IE - targetElm = doc = body = null; - }, - - /** - * Focuses/activates the editor. This will set this editor as the activeEditor in the tinymce collection - * it will also place DOM focus inside the editor. - * - * @method focus - * @param {Boolean} skip_focus Skip DOM focus. Just set is as the active editor. - */ - focus: function(skip_focus) { - var oed, self = this, selection = self.selection, contentEditable = self.settings.content_editable, rng; - var controlElm, doc = self.getDoc(), body; - - if (!skip_focus) { - // Get selected control element - rng = selection.getRng(); - if (rng.item) { - controlElm = rng.item(0); - } - - self._refreshContentEditable(); - - // Focus the window iframe - if (!contentEditable) { - // WebKit needs this call to fire focusin event properly see #5948 - // But Opera pre Blink engine will produce an empty selection so skip Opera - if (!Env.opera) { - self.getBody().focus(); - } - - self.getWin().focus(); - } - - // Focus the body as well since it's contentEditable - if (isGecko || contentEditable) { - body = self.getBody(); - - // Check for setActive since it doesn't scroll to the element - if (body.setActive && Env.ie < 11) { - body.setActive(); - } else { - body.focus(); - } - - if (contentEditable) { - selection.normalize(); - } - } - - // Restore selected control element - // This is needed when for example an image is selected within a - // layer a call to focus will then remove the control selection - if (controlElm && controlElm.ownerDocument == doc) { - rng = doc.body.createControlRange(); - rng.addElement(controlElm); - rng.select(); - } - } - - if (self.editorManager.activeEditor != self) { - if ((oed = self.editorManager.activeEditor)) { - oed.fire('deactivate', {relatedTarget: self}); - } - - self.fire('activate', {relatedTarget: oed}); - } - - self.editorManager.activeEditor = self; - }, - - /** - * Executes a legacy callback. This method is useful to call old 2.x option callbacks. - * There new event model is a better way to add callback so this method might be removed in the future. - * - * @method execCallback - * @param {String} name Name of the callback to execute. - * @return {Object} Return value passed from callback function. - */ - execCallback: function(name) { - var self = this, callback = self.settings[name], scope; - - if (!callback) { - return; - } - - // Look through lookup - if (self.callbackLookup && (scope = self.callbackLookup[name])) { - callback = scope.func; - scope = scope.scope; - } - - if (typeof(callback) === 'string') { - scope = callback.replace(/\.\w+$/, ''); - scope = scope ? resolve(scope) : 0; - callback = resolve(callback); - self.callbackLookup = self.callbackLookup || {}; - self.callbackLookup[name] = {func: callback, scope: scope}; - } - - return callback.apply(scope || self, Array.prototype.slice.call(arguments, 1)); - }, - - /** - * Translates the specified string by replacing variables with language pack items it will also check if there is - * a key mathcin the input. - * - * @method translate - * @param {String} text String to translate by the language pack data. - * @return {String} Translated string. - */ - translate: function(text) { - var lang = this.settings.language || 'en', i18n = this.editorManager.i18n; - - if (!text) { - return ''; - } - - return i18n.data[lang + '.' + text] || text.replace(/\{\#([^\}]+)\}/g, function(a, b) { - return i18n.data[lang + '.' + b] || '{#' + b + '}'; - }); - }, - - /** - * Returns a language pack item by name/key. - * - * @method getLang - * @param {String} name Name/key to get from the language pack. - * @param {String} defaultVal Optional default value to retrive. - */ - getLang: function(name, defaultVal) { - return ( - this.editorManager.i18n.data[(this.settings.language || 'en') + '.' + name] || - (defaultVal !== undefined ? defaultVal : '{#' + name + '}') - ); - }, - - /** - * Returns a configuration parameter by name. - * - * @method getParam - * @param {String} name Configruation parameter to retrive. - * @param {String} defaultVal Optional default value to return. - * @param {String} type Optional type parameter. - * @return {String} Configuration parameter value or default value. - * @example - * // Returns a specific config value from the currently active editor - * var someval = tinymce.activeEditor.getParam('myvalue'); - * - * // Returns a specific config value from a specific editor instance by id - * var someval2 = tinymce.get('my_editor').getParam('myvalue'); - */ - getParam: function(name, defaultVal, type) { - var value = name in this.settings ? this.settings[name] : defaultVal, output; - - if (type === 'hash') { - output = {}; - - if (typeof(value) === 'string') { - each(value.indexOf('=') > 0 ? value.split(/[;,](?![^=;,]*(?:[;,]|$))/) : value.split(','), function(value) { - value = value.split('='); - - if (value.length > 1) { - output[trim(value[0])] = trim(value[1]); - } else { - output[trim(value[0])] = trim(value); - } - }); - } else { - output = value; - } - - return output; - } - - return value; - }, - - /** - * Distpaches out a onNodeChange event to all observers. This method should be called when you - * need to update the UI states or element path etc. - * - * @method nodeChanged - */ - nodeChanged: function() { - var self = this, selection = self.selection, node, parents, root; - - // Fix for bug #1896577 it seems that this can not be fired while the editor is loading - if (self.initialized && !self.settings.disable_nodechange && !self.settings.readonly) { - // Get start node - root = self.getBody(); - node = selection.getStart() || root; - node = ie && node.ownerDocument != self.getDoc() ? self.getBody() : node; // Fix for IE initial state - - // Edge case for

|

- if (node.nodeName == 'IMG' && selection.isCollapsed()) { - node = node.parentNode; - } - - // Get parents and add them to object - parents = []; - self.dom.getParent(node, function(node) { - if (node === root) { - return true; - } - - parents.push(node); - }); - - self.fire('NodeChange', {element: node, parents: parents}); - } - }, - - /** - * Adds a button that later gets created by the theme in the editors toolbars. - * - * @method addButton - * @param {String} name Button name to add. - * @param {Object} settings Settings object with title, cmd etc. - * @example - * // Adds a custom button to the editor that inserts contents when clicked - * tinymce.init({ - * ... - * - * toolbar: 'example' - * - * setup: function(ed) { - * ed.addButton('example', { - * title: 'My title', - * image: '../js/tinymce/plugins/example/img/example.gif', - * onclick: function() { - * ed.insertContent('Hello world!!'); - * } - * }); - * } - * }); - */ - addButton: function(name, settings) { - var self = this; - - if (settings.cmd) { - settings.onclick = function() { - self.execCommand(settings.cmd); - }; - } - - if (!settings.text && !settings.icon) { - settings.icon = name; - } - - self.buttons = self.buttons || {}; - settings.tooltip = settings.tooltip || settings.title; - self.buttons[name] = settings; - }, - - /** - * Adds a menu item to be used in the menus of the theme. There might be multiple instances - * of this menu item for example it might be used in the main menus of the theme but also in - * the context menu so make sure that it's self contained and supports multiple instances. - * - * @method addMenuItem - * @param {String} name Menu item name to add. - * @param {Object} settings Settings object with title, cmd etc. - * @example - * // Adds a custom menu item to the editor that inserts contents when clicked - * // The context option allows you to add the menu item to an existing default menu - * tinymce.init({ - * ... - * - * setup: function(ed) { - * ed.addMenuItem('example', { - * text: 'My menu item', - * context: 'tools', - * onclick: function() { - * ed.insertContent('Hello world!!'); - * } - * }); - * } - * }); - */ - addMenuItem: function(name, settings) { - var self = this; - - if (settings.cmd) { - settings.onclick = function() { - self.execCommand(settings.cmd); - }; - } - - self.menuItems = self.menuItems || {}; - self.menuItems[name] = settings; - }, - - /** - * Adds a custom command to the editor, you can also override existing commands with this method. - * The command that you add can be executed with execCommand. - * - * @method addCommand - * @param {String} name Command name to add/override. - * @param {addCommandCallback} callback Function to execute when the command occurs. - * @param {Object} scope Optional scope to execute the function in. - * @example - * // Adds a custom command that later can be executed using execCommand - * tinymce.init({ - * ... - * - * setup: function(ed) { - * // Register example command - * ed.addCommand('mycommand', function(ui, v) { - * ed.windowManager.alert('Hello world!! Selection: ' + ed.selection.getContent({format: 'text'})); - * }); - * } - * }); - */ - addCommand: function(name, callback, scope) { - /** - * Callback function that gets called when a command is executed. - * - * @callback addCommandCallback - * @param {Boolean} ui Display UI state true/false. - * @param {Object} value Optional value for command. - * @return {Boolean} True/false state if the command was handled or not. - */ - this.execCommands[name] = {func: callback, scope: scope || this}; - }, - - /** - * Adds a custom query state command to the editor, you can also override existing commands with this method. - * The command that you add can be executed with queryCommandState function. - * - * @method addQueryStateHandler - * @param {String} name Command name to add/override. - * @param {addQueryStateHandlerCallback} callback Function to execute when the command state retrival occurs. - * @param {Object} scope Optional scope to execute the function in. - */ - addQueryStateHandler: function(name, callback, scope) { - /** - * Callback function that gets called when a queryCommandState is executed. - * - * @callback addQueryStateHandlerCallback - * @return {Boolean} True/false state if the command is enabled or not like is it bold. - */ - this.queryStateCommands[name] = {func: callback, scope: scope || this}; - }, - - /** - * Adds a custom query value command to the editor, you can also override existing commands with this method. - * The command that you add can be executed with queryCommandValue function. - * - * @method addQueryValueHandler - * @param {String} name Command name to add/override. - * @param {addQueryValueHandlerCallback} callback Function to execute when the command value retrival occurs. - * @param {Object} scope Optional scope to execute the function in. - */ - addQueryValueHandler: function(name, callback, scope) { - /** - * Callback function that gets called when a queryCommandValue is executed. - * - * @callback addQueryValueHandlerCallback - * @return {Object} Value of the command or undefined. - */ - this.queryValueCommands[name] = {func: callback, scope: scope || this}; - }, - - /** - * Adds a keyboard shortcut for some command or function. - * - * @method addShortcut - * @param {String} pattern Shortcut pattern. Like for example: ctrl+alt+o. - * @param {String} desc Text description for the command. - * @param {String/Function} cmdFunc Command name string or function to execute when the key is pressed. - * @param {Object} sc Optional scope to execute the function in. - * @return {Boolean} true/false state if the shortcut was added or not. - */ - addShortcut: function(pattern, desc, cmdFunc, scope) { - this.shortcuts.add(pattern, desc, cmdFunc, scope); - }, - - /** - * Executes a command on the current instance. These commands can be TinyMCE internal commands prefixed with "mce" or - * they can be build in browser commands such as "Bold". A compleate list of browser commands is available on MSDN or Mozilla.org. - * This function will dispatch the execCommand function on each plugin, theme or the execcommand_callback option if none of these - * return true it will handle the command as a internal browser command. - * - * @method execCommand - * @param {String} cmd Command name to execute, for example mceLink or Bold. - * @param {Boolean} ui True/false state if a UI (dialog) should be presented or not. - * @param {mixed} value Optional command value, this can be anything. - * @param {Object} a Optional arguments object. - */ - execCommand: function(cmd, ui, value, args) { - var self = this, state = 0, cmdItem; - - if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(cmd) && (!args || !args.skip_focus)) { - self.focus(); - } - - args = extend({}, args); - args = self.fire('BeforeExecCommand', {command: cmd, ui: ui, value: value}); - if (args.isDefaultPrevented()) { - return false; - } - - // Registred commands - if ((cmdItem = self.execCommands[cmd])) { - // Fall through on true - if (cmdItem.func.call(cmdItem.scope, ui, value) !== true) { - self.fire('ExecCommand', {command: cmd, ui: ui, value: value}); - return true; - } - } - - // Plugin commands - each(self.plugins, function(p) { - if (p.execCommand && p.execCommand(cmd, ui, value)) { - self.fire('ExecCommand', {command: cmd, ui: ui, value: value}); - state = true; - return false; - } - }); - - if (state) { - return state; - } - - // Theme commands - if (self.theme && self.theme.execCommand && self.theme.execCommand(cmd, ui, value)) { - self.fire('ExecCommand', {command: cmd, ui: ui, value: value}); - return true; - } - - // Editor commands - if (self.editorCommands.execCommand(cmd, ui, value)) { - self.fire('ExecCommand', {command: cmd, ui: ui, value: value}); - return true; - } - - // Browser commands - self.getDoc().execCommand(cmd, ui, value); - self.fire('ExecCommand', {command: cmd, ui: ui, value: value}); - }, - - /** - * Returns a command specific state, for example if bold is enabled or not. - * - * @method queryCommandState - * @param {string} cmd Command to query state from. - * @return {Boolean} Command specific state, for example if bold is enabled or not. - */ - queryCommandState: function(cmd) { - var self = this, queryItem, returnVal; - - // Is hidden then return undefined - if (self._isHidden()) { - return; - } - - // Registred commands - if ((queryItem = self.queryStateCommands[cmd])) { - returnVal = queryItem.func.call(queryItem.scope); - - // Fall though on true - if (returnVal !== true) { - return returnVal; - } - } - - // Editor commands - returnVal = self.editorCommands.queryCommandState(cmd); - if (returnVal !== -1) { - return returnVal; - } - - // Browser commands - try { - return self.getDoc().queryCommandState(cmd); - } catch (ex) { - // Fails sometimes see bug: 1896577 - } - }, - - /** - * Returns a command specific value, for example the current font size. - * - * @method queryCommandValue - * @param {string} cmd Command to query value from. - * @return {Object} Command specific value, for example the current font size. - */ - queryCommandValue: function(cmd) { - var self = this, queryItem, returnVal; - - // Is hidden then return undefined - if (self._isHidden()) { - return; - } - - // Registred commands - if ((queryItem = self.queryValueCommands[cmd])) { - returnVal = queryItem.func.call(queryItem.scope); - - // Fall though on true - if (returnVal !== true) { - return returnVal; - } - } - - // Editor commands - returnVal = self.editorCommands.queryCommandValue(cmd); - if (returnVal !== undefined) { - return returnVal; - } - - // Browser commands - try { - return self.getDoc().queryCommandValue(cmd); - } catch (ex) { - // Fails sometimes see bug: 1896577 - } - }, - - /** - * Shows the editor and hides any textarea/div that the editor is supposed to replace. - * - * @method show - */ - show: function() { - var self = this; - - DOM.show(self.getContainer()); - DOM.hide(self.id); - self.load(); - self.fire('show'); - }, - - /** - * Hides the editor and shows any textarea/div that the editor is supposed to replace. - * - * @method hide - */ - hide: function() { - var self = this, doc = self.getDoc(); - - // Fixed bug where IE has a blinking cursor left from the editor - if (ie && doc && !self.inline) { - doc.execCommand('SelectAll'); - } - - // We must save before we hide so Safari doesn't crash - self.save(); - - // defer the call to hide to prevent an IE9 crash #4921 - DOM.hide(self.getContainer()); - DOM.setStyle(self.id, 'display', self.orgDisplay); - self.fire('hide'); - }, - - /** - * Returns true/false if the editor is hidden or not. - * - * @method isHidden - * @return {Boolean} True/false if the editor is hidden or not. - */ - isHidden: function() { - return !DOM.isHidden(this.id); - }, - - /** - * Sets the progress state, this will display a throbber/progess for the editor. - * This is ideal for asycronous operations like an AJAX save call. - * - * @method setProgressState - * @param {Boolean} state Boolean state if the progress should be shown or hidden. - * @param {Number} time Optional time to wait before the progress gets shown. - * @return {Boolean} Same as the input state. - * @example - * // Show progress for the active editor - * tinymce.activeEditor.setProgressState(true); - * - * // Hide progress for the active editor - * tinymce.activeEditor.setProgressState(false); - * - * // Show progress after 3 seconds - * tinymce.activeEditor.setProgressState(true, 3000); - */ - setProgressState: function(state, time) { - this.fire('ProgressState', {state: state, time: time}); - }, - - /** - * Loads contents from the textarea or div element that got converted into an editor instance. - * This method will move the contents from that textarea or div into the editor by using setContent - * so all events etc that method has will get dispatched as well. - * - * @method load - * @param {Object} args Optional content object, this gets passed around through the whole load process. - * @return {String} HTML string that got set into the editor. - */ - load: function(args) { - var self = this, elm = self.getElement(), html; - - if (elm) { - args = args || {}; - args.load = true; - - html = self.setContent(elm.value !== undefined ? elm.value : elm.innerHTML, args); - args.element = elm; - - if (!args.no_events) { - self.fire('LoadContent', args); - } - - args.element = elm = null; - - return html; - } - }, - - /** - * Saves the contents from a editor out to the textarea or div element that got converted into an editor instance. - * This method will move the HTML contents from the editor into that textarea or div by getContent - * so all events etc that method has will get dispatched as well. - * - * @method save - * @param {Object} args Optional content object, this gets passed around through the whole save process. - * @return {String} HTML string that got set into the textarea/div. - */ - save: function(args) { - var self = this, elm = self.getElement(), html, form; - - if (!elm || !self.initialized) { - return; - } - - args = args || {}; - args.save = true; - - args.element = elm; - html = args.content = self.getContent(args); - - if (!args.no_events) { - self.fire('SaveContent', args); - } - - html = args.content; - - if (!/TEXTAREA|INPUT/i.test(elm.nodeName)) { - // Update DIV element when not in inline mode - if (!self.inline) { - elm.innerHTML = html; - } - - // Update hidden form element - if ((form = DOM.getParent(self.id, 'form'))) { - each(form.elements, function(elm) { - if (elm.name == self.id) { - elm.value = html; - return false; - } - }); - } - } else { - elm.value = html; - } - - args.element = elm = null; - - if (args.set_dirty !== false) { - self.isNotDirty = true; - } - - return html; - }, - - /** - * Sets the specified content to the editor instance, this will cleanup the content before it gets set using - * the different cleanup rules options. - * - * @method setContent - * @param {String} content Content to set to editor, normally HTML contents but can be other formats as well. - * @param {Object} args Optional content object, this gets passed around through the whole set process. - * @return {String} HTML string that got set into the editor. - * @example - * // Sets the HTML contents of the activeEditor editor - * tinymce.activeEditor.setContent('some html'); - * - * // Sets the raw contents of the activeEditor editor - * tinymce.activeEditor.setContent('some html', {format: 'raw'}); - * - * // Sets the content of a specific editor (my_editor in this example) - * tinymce.get('my_editor').setContent(data); - * - * // Sets the bbcode contents of the activeEditor editor if the bbcode plugin was added - * tinymce.activeEditor.setContent('[b]some[/b] html', {format: 'bbcode'}); - */ - setContent: function(content, args) { - var self = this, body = self.getBody(), forcedRootBlockName; - - // Setup args object - args = args || {}; - args.format = args.format || 'html'; - args.set = true; - args.content = content; - - // Do preprocessing - if (!args.no_events) { - self.fire('BeforeSetContent', args); - } - - content = args.content; - - // Padd empty content in Gecko and Safari. Commands will otherwise fail on the content - // It will also be impossible to place the caret in the editor unless there is a BR element present - if (content.length === 0 || /^\s+$/.test(content)) { - forcedRootBlockName = self.settings.forced_root_block; - - // Check if forcedRootBlock is configured and that the block is a valid child of the body - if (forcedRootBlockName && self.schema.isValidChild(body.nodeName.toLowerCase(), forcedRootBlockName.toLowerCase())) { - // Padd with bogus BR elements on modern browsers and IE 7 and 8 since they don't render empty P tags properly - content = ie && ie < 11 ? '' : '
'; - content = self.dom.createHTML(forcedRootBlockName, self.settings.forced_root_block_attrs, content); - } else if (!ie) { - // We need to add a BR when forced_root_block is disabled on non IE browsers to place the caret - content = '
'; - } - - body.innerHTML = content; - - self.fire('SetContent', args); - } else { - // Parse and serialize the html - if (args.format !== 'raw') { - content = new Serializer({}, self.schema).serialize( - self.parser.parse(content, {isRootContent: true}) - ); - } - - // Set the new cleaned contents to the editor - args.content = trim(content); - self.dom.setHTML(body, args.content); - - // Do post processing - if (!args.no_events) { - self.fire('SetContent', args); - } - - // Don't normalize selection if the focused element isn't the body in - // content editable mode since it will steal focus otherwise - /*if (!self.settings.content_editable || document.activeElement === self.getBody()) { - self.selection.normalize(); - }*/ - } - - return args.content; - }, - - /** - * Gets the content from the editor instance, this will cleanup the content before it gets returned using - * the different cleanup rules options. - * - * @method getContent - * @param {Object} args Optional content object, this gets passed around through the whole get process. - * @return {String} Cleaned content string, normally HTML contents. - * @example - * // Get the HTML contents of the currently active editor - * console.debug(tinymce.activeEditor.getContent()); - * - * // Get the raw contents of the currently active editor - * tinymce.activeEditor.getContent({format: 'raw'}); - * - * // Get content of a specific editor: - * tinymce.get('content id').getContent() - */ - getContent: function(args) { - var self = this, content, body = self.getBody(); - - // Setup args object - args = args || {}; - args.format = args.format || 'html'; - args.get = true; - args.getInner = true; - - // Do preprocessing - if (!args.no_events) { - self.fire('BeforeGetContent', args); - } - - // Get raw contents or by default the cleaned contents - if (args.format == 'raw') { - content = body.innerHTML; - } else if (args.format == 'text') { - content = body.innerText || body.textContent; - } else { - content = self.serializer.serialize(body, args); - } - - // Trim whitespace in beginning/end of HTML - if (args.format != 'text') { - args.content = trim(content); - } else { - args.content = content; - } - - // Do post processing - if (!args.no_events) { - self.fire('GetContent', args); - } - - return args.content; - }, - - /** - * Inserts content at caret position. - * - * @method insertContent - * @param {String} content Content to insert. - */ - insertContent: function(content) { - this.execCommand('mceInsertContent', false, content); - }, - - /** - * Returns true/false if the editor is dirty or not. It will get dirty if the user has made modifications to the contents. - * - * @method isDirty - * @return {Boolean} True/false if the editor is dirty or not. It will get dirty if the user has made modifications to the contents. - * @example - * if (tinymce.activeEditor.isDirty()) - * alert("You must save your contents."); - */ - isDirty: function() { - return !this.isNotDirty; - }, - - /** - * Returns the editors container element. The container element wrappes in - * all the elements added to the page for the editor. Such as UI, iframe etc. - * - * @method getContainer - * @return {Element} HTML DOM element for the editor container. - */ - getContainer: function() { - var self = this; - - if (!self.container) { - self.container = DOM.get(self.editorContainer || self.id + '_parent'); - } - - return self.container; - }, - - /** - * Returns the editors content area container element. The this element is the one who - * holds the iframe or the editable element. - * - * @method getContentAreaContainer - * @return {Element} HTML DOM element for the editor area container. - */ - getContentAreaContainer: function() { - return this.contentAreaContainer; - }, - - /** - * Returns the target element/textarea that got replaced with a TinyMCE editor instance. - * - * @method getElement - * @return {Element} HTML DOM element for the replaced element. - */ - getElement: function() { - return DOM.get(this.settings.content_element || this.id); - }, - - /** - * Returns the iframes window object. - * - * @method getWin - * @return {Window} Iframe DOM window object. - */ - getWin: function() { - var self = this, elm; - - if (!self.contentWindow) { - elm = DOM.get(self.id + "_ifr"); - - if (elm) { - self.contentWindow = elm.contentWindow; - } - } - - return self.contentWindow; - }, - - /** - * Returns the iframes document object. - * - * @method getDoc - * @return {Document} Iframe DOM document object. - */ - getDoc: function() { - var self = this, win; - - if (!self.contentDocument) { - win = self.getWin(); - - if (win) { - self.contentDocument = win.document; - } - } - - return self.contentDocument; - }, - - /** - * Returns the iframes body element. - * - * @method getBody - * @return {Element} Iframe body element. - */ - getBody: function() { - return this.bodyElement || this.getDoc().body; - }, - - /** - * URL converter function this gets executed each time a user adds an img, a or - * any other element that has a URL in it. This will be called both by the DOM and HTML - * manipulation functions. - * - * @method convertURL - * @param {string} url URL to convert. - * @param {string} name Attribute name src, href etc. - * @param {string/HTMLElement} elm Tag name or HTML DOM element depending on HTML or DOM insert. - * @return {string} Converted URL string. - */ - convertURL: function(url, name, elm) { - var self = this, settings = self.settings; - - // Use callback instead - if (settings.urlconverter_callback) { - return self.execCallback('urlconverter_callback', url, elm, true, name); - } - - // Don't convert link href since thats the CSS files that gets loaded into the editor also skip local file URLs - if (!settings.convert_urls || (elm && elm.nodeName == 'LINK') || url.indexOf('file:') === 0 || url.length === 0) { - return url; - } - - // Convert to relative - if (settings.relative_urls) { - return self.documentBaseURI.toRelative(url); - } - - // Convert to absolute - url = self.documentBaseURI.toAbsolute(url, settings.remove_script_host); - - return url; - }, - - /** - * Adds visual aid for tables, anchors etc so they can be more easily edited inside the editor. - * - * @method addVisual - * @param {Element} elm Optional root element to loop though to find tables etc that needs the visual aid. - */ - addVisual: function(elm) { - var self = this, settings = self.settings, dom = self.dom, cls; - - elm = elm || self.getBody(); - - if (self.hasVisual === undefined) { - self.hasVisual = settings.visual; - } - - each(dom.select('table,a', elm), function(elm) { - var value; - - switch (elm.nodeName) { - case 'TABLE': - cls = settings.visual_table_class || 'mce-item-table'; - value = dom.getAttrib(elm, 'border'); - - if (!value || value == '0') { - if (self.hasVisual) { - dom.addClass(elm, cls); - } else { - dom.removeClass(elm, cls); - } - } - - return; - - case 'A': - if (!dom.getAttrib(elm, 'href', false)) { - value = dom.getAttrib(elm, 'name') || elm.id; - cls = settings.visual_anchor_class || 'mce-item-anchor'; - - if (value) { - if (self.hasVisual) { - dom.addClass(elm, cls); - } else { - dom.removeClass(elm, cls); - } - } - } - - return; - } - }); - - self.fire('VisualAid', {element: elm, hasVisual: self.hasVisual}); - }, - - /** - * Removes the editor from the dom and tinymce collection. - * - * @method remove - */ - remove: function() { - var self = this; - - if (!self.removed) { - self.save(); - self.fire('remove'); - self.off(); - self.removed = 1; // Cancels post remove event execution - - // Remove any hidden input - if (self.hasHiddenInput) { - DOM.remove(self.getElement().nextSibling); - } - - DOM.setStyle(self.id, 'display', self.orgDisplay); - - // Don't clear the window or document if content editable - // is enabled since other instances might still be present - if (!self.settings.content_editable) { - Event.unbind(self.getWin()); - Event.unbind(self.getDoc()); - } - - var elm = self.getContainer(); - Event.unbind(self.getBody()); - Event.unbind(elm); - - self.editorManager.remove(self); - DOM.remove(elm); - self.destroy(); - } - }, - - bindNative: function(name) { - var self = this; - - if (self.settings.readonly) { - return; - } - - if (self.initialized) { - self.dom.bind(getEventTarget(self, name), name, function(e) { - self.fire(name, e); - }); - } else { - if (!self._pendingNativeEvents) { - self._pendingNativeEvents = [name]; - } else { - self._pendingNativeEvents.push(name); - } - } - }, - - unbindNative: function(name) { - var self = this; - - if (self.initialized) { - self.dom.unbind(name); - } - }, - - /** - * Destroys the editor instance by removing all events, element references or other resources - * that could leak memory. This method will be called automatically when the page is unloaded - * but you can also call it directly if you know what you are doing. - * - * @method destroy - * @param {Boolean} automatic Optional state if the destroy is an automatic destroy or user called one. - */ - destroy: function(automatic) { - var self = this, form; - - // One time is enough - if (self.destroyed) { - return; - } - - // If user manually calls destroy and not remove - // Users seems to have logic that calls destroy instead of remove - if (!automatic && !self.removed) { - self.remove(); - return; - } - - // We must unbind on Gecko since it would otherwise produce the pesky "attempt - // to run compile-and-go script on a cleared scope" message - if (automatic && isGecko) { - Event.unbind(self.getDoc()); - Event.unbind(self.getWin()); - Event.unbind(self.getBody()); - } - - if (!automatic) { - self.editorManager.off('beforeunload', self._beforeUnload); - - // Manual destroy - if (self.theme && self.theme.destroy) { - self.theme.destroy(); - } - - // Destroy controls, selection and dom - self.selection.destroy(); - self.dom.destroy(); - } - - form = self.formElement; - if (form) { - if (form._mceOldSubmit) { - form.submit = form._mceOldSubmit; - form._mceOldSubmit = null; - } - - DOM.unbind(form, 'submit reset', self.formEventDelegate); - } - - self.contentAreaContainer = self.formElement = self.container = self.editorContainer = null; - self.settings.content_element = self.bodyElement = self.contentDocument = self.contentWindow = null; - - if (self.selection) { - self.selection = self.selection.win = self.selection.dom = self.selection.dom.doc = null; - } - - self.destroyed = 1; - }, - - // Internal functions - - _refreshContentEditable: function() { - var self = this, body, parent; - - // Check if the editor was hidden and the re-initalize contentEditable mode by removing and adding the body again - if (self._isHidden()) { - body = self.getBody(); - parent = body.parentNode; - - parent.removeChild(body); - parent.appendChild(body); - - body.focus(); - } - }, - - _isHidden: function() { - var sel; - - if (!isGecko) { - return 0; - } - - // Weird, wheres that cursor selection? - sel = this.selection.getSel(); - return (!sel || !sel.rangeCount || sel.rangeCount === 0); - } - }; - - extend(Editor.prototype, Observable); - - return Editor; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/EditorCommands.js b/common/static/js/vendor/tinymce/js/tinymce/classes/EditorCommands.js deleted file mode 100755 index 0192017d4609..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/EditorCommands.js +++ /dev/null @@ -1,721 +0,0 @@ -/** - * EditorCommands.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class enables you to add custom editor commands and it contains - * overrides for native browser commands to address various bugs and issues. - * - * @class tinymce.EditorCommands - */ -define("tinymce/EditorCommands", [ - "tinymce/html/Serializer", - "tinymce/Env", - "tinymce/util/Tools" -], function(Serializer, Env, Tools) { - // Added for compression purposes - var each = Tools.each, extend = Tools.extend; - var map = Tools.map, inArray = Tools.inArray, explode = Tools.explode; - var isGecko = Env.gecko, isIE = Env.ie; - var TRUE = true, FALSE = false; - - return function(editor) { - var dom = editor.dom, - selection = editor.selection, - commands = {state: {}, exec: {}, value: {}}, - settings = editor.settings, - formatter = editor.formatter, - bookmark; - - /** - * Executes the specified command. - * - * @method execCommand - * @param {String} command Command to execute. - * @param {Boolean} ui Optional user interface state. - * @param {Object} value Optional value for command. - * @return {Boolean} true/false if the command was found or not. - */ - function execCommand(command, ui, value) { - var func; - - command = command.toLowerCase(); - if ((func = commands.exec[command])) { - func(command, ui, value); - return TRUE; - } - - return FALSE; - } - - /** - * Queries the current state for a command for example if the current selection is "bold". - * - * @method queryCommandState - * @param {String} command Command to check the state of. - * @return {Boolean/Number} true/false if the selected contents is bold or not, -1 if it's not found. - */ - function queryCommandState(command) { - var func; - - command = command.toLowerCase(); - if ((func = commands.state[command])) { - return func(command); - } - - return -1; - } - - /** - * Queries the command value for example the current fontsize. - * - * @method queryCommandValue - * @param {String} command Command to check the value of. - * @return {Object} Command value of false if it's not found. - */ - function queryCommandValue(command) { - var func; - - command = command.toLowerCase(); - if ((func = commands.value[command])) { - return func(command); - } - - return FALSE; - } - - /** - * Adds commands to the command collection. - * - * @method addCommands - * @param {Object} command_list Name/value collection with commands to add, the names can also be comma separated. - * @param {String} type Optional type to add, defaults to exec. Can be value or state as well. - */ - function addCommands(command_list, type) { - type = type || 'exec'; - - each(command_list, function(callback, command) { - each(command.toLowerCase().split(','), function(command) { - commands[type][command] = callback; - }); - }); - } - - // Expose public methods - extend(this, { - execCommand: execCommand, - queryCommandState: queryCommandState, - queryCommandValue: queryCommandValue, - addCommands: addCommands - }); - - // Private methods - - function execNativeCommand(command, ui, value) { - if (ui === undefined) { - ui = FALSE; - } - - if (value === undefined) { - value = null; - } - - return editor.getDoc().execCommand(command, ui, value); - } - - function isFormatMatch(name) { - return formatter.match(name); - } - - function toggleFormat(name, value) { - formatter.toggle(name, value ? {value: value} : undefined); - editor.nodeChanged(); - } - - function storeSelection(type) { - bookmark = selection.getBookmark(type); - } - - function restoreSelection() { - selection.moveToBookmark(bookmark); - } - - // Add execCommand overrides - addCommands({ - // Ignore these, added for compatibility - 'mceResetDesignMode,mceBeginUndoLevel': function() {}, - - // Add undo manager logic - 'mceEndUndoLevel,mceAddUndoLevel': function() { - editor.undoManager.add(); - }, - - 'Cut,Copy,Paste': function(command) { - var doc = editor.getDoc(), failed; - - // Try executing the native command - try { - execNativeCommand(command); - } catch (ex) { - // Command failed - failed = TRUE; - } - - // Present alert message about clipboard access not being available - if (failed || !doc.queryCommandSupported(command)) { - var msg = editor.translate( - "Your browser doesn't support direct access to the clipboard. " + - "Please use the Ctrl+X/C/V keyboard shortcuts instead." - ); - - if (Env.mac) { - msg = msg.replace(/Ctrl\+/g, '\u2318+'); - } - - editor.windowManager.alert(msg); - } - }, - - // Override unlink command - unlink: function() { - if (selection.isCollapsed()) { - var elm = selection.getNode(); - if (elm.tagName == 'A') { - editor.dom.remove(elm, true); - } - - return; - } - - formatter.remove("link"); - }, - - // Override justify commands to use the text formatter engine - 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull': function(command) { - var align = command.substring(7); - - if (align == 'full') { - align = 'justify'; - } - - // Remove all other alignments first - each('left,center,right,justify'.split(','), function(name) { - if (align != name) { - formatter.remove('align' + name); - } - }); - - toggleFormat('align' + align); - execCommand('mceRepaint'); - }, - - // Override list commands to fix WebKit bug - 'InsertUnorderedList,InsertOrderedList': function(command) { - var listElm, listParent; - - execNativeCommand(command); - - // WebKit produces lists within block elements so we need to split them - // we will replace the native list creation logic to custom logic later on - // TODO: Remove this when the list creation logic is removed - listElm = dom.getParent(selection.getNode(), 'ol,ul'); - if (listElm) { - listParent = listElm.parentNode; - - // If list is within a text block then split that block - if (/^(H[1-6]|P|ADDRESS|PRE)$/.test(listParent.nodeName)) { - storeSelection(); - dom.split(listParent, listElm); - restoreSelection(); - } - } - }, - - // Override commands to use the text formatter engine - 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function(command) { - toggleFormat(command); - }, - - // Override commands to use the text formatter engine - 'ForeColor,HiliteColor,FontName': function(command, ui, value) { - toggleFormat(command, value); - }, - - FontSize: function(command, ui, value) { - var fontClasses, fontSizes; - - // Convert font size 1-7 to styles - if (value >= 1 && value <= 7) { - fontSizes = explode(settings.font_size_style_values); - fontClasses = explode(settings.font_size_classes); - - if (fontClasses) { - value = fontClasses[value - 1] || value; - } else { - value = fontSizes[value - 1] || value; - } - } - - toggleFormat(command, value); - }, - - RemoveFormat: function(command) { - formatter.remove(command); - }, - - mceBlockQuote: function() { - toggleFormat('blockquote'); - }, - - FormatBlock: function(command, ui, value) { - return toggleFormat(value || 'p'); - }, - - mceCleanup: function() { - var bookmark = selection.getBookmark(); - - editor.setContent(editor.getContent({cleanup: TRUE}), {cleanup: TRUE}); - - selection.moveToBookmark(bookmark); - }, - - mceRemoveNode: function(command, ui, value) { - var node = value || selection.getNode(); - - // Make sure that the body node isn't removed - if (node != editor.getBody()) { - storeSelection(); - editor.dom.remove(node, TRUE); - restoreSelection(); - } - }, - - mceSelectNodeDepth: function(command, ui, value) { - var counter = 0; - - dom.getParent(selection.getNode(), function(node) { - if (node.nodeType == 1 && counter++ == value) { - selection.select(node); - return FALSE; - } - }, editor.getBody()); - }, - - mceSelectNode: function(command, ui, value) { - selection.select(value); - }, - - mceInsertContent: function(command, ui, value) { - var parser, serializer, parentNode, rootNode, fragment, args; - var marker, rng, node, node2, bookmarkHtml; - - function trimOrPaddLeftRight(html) { - var rng, container, offset; - - rng = selection.getRng(true); - container = rng.startContainer; - offset = rng.startOffset; - - function hasSiblingText(siblingName) { - return container[siblingName] && container[siblingName].nodeType == 3; - } - - if (container.nodeType == 3) { - if (offset > 0) { - html = html.replace(/^ /, ' '); - } else if (!hasSiblingText('previousSibling')) { - html = html.replace(/^ /, ' '); - } - - if (offset < container.length) { - html = html.replace(/ (
|)$/, ' '); - } else if (!hasSiblingText('nextSibling')) { - html = html.replace(/( | )(
|)$/, ' '); - } - } - - return html; - } - - // Check for whitespace before/after value - if (/^ | $/.test(value)) { - value = trimOrPaddLeftRight(value); - } - - // Setup parser and serializer - parser = editor.parser; - serializer = new Serializer({}, editor.schema); - bookmarkHtml = 'ÈB;'; - - // Run beforeSetContent handlers on the HTML to be inserted - args = {content: value, format: 'html', selection: true}; - editor.fire('BeforeSetContent', args); - value = args.content; - - // Add caret at end of contents if it's missing - if (value.indexOf('{$caret}') == -1) { - value += '{$caret}'; - } - - // Replace the caret marker with a span bookmark element - value = value.replace(/\{\$caret\}/, bookmarkHtml); - - // If selection is at |

then move it into

|

- rng = selection.getRng(); - var caretElement = rng.startContainer || (rng.parentElement ? rng.parentElement() : null); - var body = editor.getBody(); - if (caretElement === body && selection.isCollapsed()) { - if (dom.isBlock(body.firstChild) && dom.isEmpty(body.firstChild)) { - rng = dom.createRng(); - rng.setStart(body.firstChild, 0); - rng.setEnd(body.firstChild, 0); - selection.setRng(rng); - } - } - - // Insert node maker where we will insert the new HTML and get it's parent - if (!selection.isCollapsed()) { - editor.getDoc().execCommand('Delete', false, null); - } - - parentNode = selection.getNode(); - - // Parse the fragment within the context of the parent node - var parserArgs = {context: parentNode.nodeName.toLowerCase()}; - fragment = parser.parse(value, parserArgs); - - // Move the caret to a more suitable location - node = fragment.lastChild; - if (node.attr('id') == 'mce_marker') { - marker = node; - - for (node = node.prev; node; node = node.walk(true)) { - if (node.type == 3 || !dom.isBlock(node.name)) { - node.parent.insert(marker, node, node.name === 'br'); - break; - } - } - } - - // If parser says valid we can insert the contents into that parent - if (!parserArgs.invalid) { - value = serializer.serialize(fragment); - - // Check if parent is empty or only has one BR element then set the innerHTML of that parent - node = parentNode.firstChild; - node2 = parentNode.lastChild; - if (!node || (node === node2 && node.nodeName === 'BR')) { - dom.setHTML(parentNode, value); - } else { - selection.setContent(value); - } - } else { - // If the fragment was invalid within that context then we need - // to parse and process the parent it's inserted into - - // Insert bookmark node and get the parent - selection.setContent(bookmarkHtml); - parentNode = selection.getNode(); - rootNode = editor.getBody(); - - // Opera will return the document node when selection is in root - if (parentNode.nodeType == 9) { - parentNode = node = rootNode; - } else { - node = parentNode; - } - - // Find the ancestor just before the root element - while (node !== rootNode) { - parentNode = node; - node = node.parentNode; - } - - // Get the outer/inner HTML depending on if we are in the root and parser and serialize that - value = parentNode == rootNode ? rootNode.innerHTML : dom.getOuterHTML(parentNode); - value = serializer.serialize( - parser.parse( - // Need to replace by using a function since $ in the contents would otherwise be a problem - value.replace(//i, function() { - return serializer.serialize(fragment); - }) - ) - ); - - // Set the inner/outer HTML depending on if we are in the root or not - if (parentNode == rootNode) { - dom.setHTML(rootNode, value); - } else { - dom.setOuterHTML(parentNode, value); - } - } - - marker = dom.get('mce_marker'); - selection.scrollIntoView(marker); - - // Move selection before marker and remove it - rng = dom.createRng(); - - // If previous sibling is a text node set the selection to the end of that node - node = marker.previousSibling; - if (node && node.nodeType == 3) { - rng.setStart(node, node.nodeValue.length); - - // TODO: Why can't we normalize on IE - if (!isIE) { - node2 = marker.nextSibling; - if (node2 && node2.nodeType == 3) { - node.appendData(node2.data); - node2.parentNode.removeChild(node2); - } - } - } else { - // If the previous sibling isn't a text node or doesn't exist set the selection before the marker node - rng.setStartBefore(marker); - rng.setEndBefore(marker); - } - - // Remove the marker node and set the new range - dom.remove(marker); - selection.setRng(rng); - - // Dispatch after event and add any visual elements needed - editor.fire('SetContent', args); - editor.addVisual(); - }, - - mceInsertRawHTML: function(command, ui, value) { - selection.setContent('tiny_mce_marker'); - editor.setContent( - editor.getContent().replace(/tiny_mce_marker/g, function() { - return value; - }) - ); - }, - - mceToggleFormat: function(command, ui, value) { - toggleFormat(value); - }, - - mceSetContent: function(command, ui, value) { - editor.setContent(value); - }, - - 'Indent,Outdent': function(command) { - var intentValue, indentUnit, value; - - // Setup indent level - intentValue = settings.indentation; - indentUnit = /[a-z%]+$/i.exec(intentValue); - intentValue = parseInt(intentValue, 10); - - if (!queryCommandState('InsertUnorderedList') && !queryCommandState('InsertOrderedList')) { - // If forced_root_blocks is set to false we don't have a block to indent so lets create a div - if (!settings.forced_root_block && !dom.getParent(selection.getNode(), dom.isBlock)) { - formatter.apply('div'); - } - - each(selection.getSelectedBlocks(), function(element) { - if (element.nodeName != "LI") { - var indentStyleName = editor.getParam('indent_use_margin', false) ? 'margin' : 'padding'; - - indentStyleName += dom.getStyle(element, 'direction', true) == 'rtl' ? 'Right' : 'Left'; - - if (command == 'outdent') { - value = Math.max(0, parseInt(element.style[indentStyleName] || 0, 10) - intentValue); - dom.setStyle(element, indentStyleName, value ? value + indentUnit : ''); - } else { - value = (parseInt(element.style[indentStyleName] || 0, 10) + intentValue) + indentUnit; - dom.setStyle(element, indentStyleName, value); - } - } - }); - } else { - execNativeCommand(command); - } - }, - - mceRepaint: function() { - if (isGecko) { - try { - storeSelection(TRUE); - - if (selection.getSel()) { - selection.getSel().selectAllChildren(editor.getBody()); - } - - selection.collapse(TRUE); - restoreSelection(); - } catch (ex) { - // Ignore - } - } - }, - - InsertHorizontalRule: function() { - editor.execCommand('mceInsertContent', false, '
'); - }, - - mceToggleVisualAid: function() { - editor.hasVisual = !editor.hasVisual; - editor.addVisual(); - }, - - mceReplaceContent: function(command, ui, value) { - editor.execCommand('mceInsertContent', false, value.replace(/\{\$selection\}/g, selection.getContent({format: 'text'}))); - }, - - mceInsertLink: function(command, ui, value) { - var anchor; - - if (typeof(value) == 'string') { - value = {href: value}; - } - - anchor = dom.getParent(selection.getNode(), 'a'); - - // Spaces are never valid in URLs and it's a very common mistake for people to make so we fix it here. - value.href = value.href.replace(' ', '%20'); - - // Remove existing links if there could be child links or that the href isn't specified - if (!anchor || !value.href) { - formatter.remove('link'); - } - - // Apply new link to selection - if (value.href) { - formatter.apply('link', value, anchor); - } - }, - - selectAll: function() { - var root = dom.getRoot(), rng; - - if (selection.getRng().setStart) { - rng = dom.createRng(); - rng.setStart(root, 0); - rng.setEnd(root, root.childNodes.length); - selection.setRng(rng); - } else { - // IE will render it's own root level block elements and sometimes - // even put font elements in them when the user starts typing. So we need to - // move the selection to a more suitable element from this: - // |

to this:

|

- rng = selection.getRng(); - if (!rng.item) { - rng.moveToElementText(root); - rng.select(); - } - } - }, - - "delete": function() { - execNativeCommand("Delete"); - - // Check if body is empty after the delete call if so then set the contents - // to an empty string and move the caret to any block produced by that operation - // this fixes the issue with root blocks not being properly produced after a delete call on IE - var body = editor.getBody(); - - if (dom.isEmpty(body)) { - editor.setContent(''); - - if (body.firstChild && dom.isBlock(body.firstChild)) { - editor.selection.setCursorLocation(body.firstChild, 0); - } else { - editor.selection.setCursorLocation(body, 0); - } - } - }, - - mceNewDocument: function() { - editor.setContent(''); - } - }); - - // Add queryCommandState overrides - addCommands({ - // Override justify commands - 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull': function(command) { - var name = 'align' + command.substring(7); - var nodes = selection.isCollapsed() ? [dom.getParent(selection.getNode(), dom.isBlock)] : selection.getSelectedBlocks(); - var matches = map(nodes, function(node) { - return !!formatter.matchNode(node, name); - }); - return inArray(matches, TRUE) !== -1; - }, - - 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function(command) { - return isFormatMatch(command); - }, - - mceBlockQuote: function() { - return isFormatMatch('blockquote'); - }, - - Outdent: function() { - var node; - - if (settings.inline_styles) { - if ((node = dom.getParent(selection.getStart(), dom.isBlock)) && parseInt(node.style.paddingLeft, 10) > 0) { - return TRUE; - } - - if ((node = dom.getParent(selection.getEnd(), dom.isBlock)) && parseInt(node.style.paddingLeft, 10) > 0) { - return TRUE; - } - } - - return ( - queryCommandState('InsertUnorderedList') || - queryCommandState('InsertOrderedList') || - (!settings.inline_styles && !!dom.getParent(selection.getNode(), 'BLOCKQUOTE')) - ); - }, - - 'InsertUnorderedList,InsertOrderedList': function(command) { - var list = dom.getParent(selection.getNode(), 'ul,ol'); - - return list && - ( - command === 'insertunorderedlist' && list.tagName === 'UL' || - command === 'insertorderedlist' && list.tagName === 'OL' - ); - } - }, 'state'); - - // Add queryCommandValue overrides - addCommands({ - 'FontSize,FontName': function(command) { - var value = 0, parent; - - if ((parent = dom.getParent(selection.getNode(), 'span'))) { - if (command == 'fontsize') { - value = parent.style.fontSize; - } else { - value = parent.style.fontFamily.replace(/, /g, ',').replace(/[\'\"]/g, '').toLowerCase(); - } - } - - return value; - } - }, 'value'); - - // Add undo manager logic - addCommands({ - Undo: function() { - editor.undoManager.undo(); - }, - - Redo: function() { - editor.undoManager.redo(); - } - }); - }; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/EditorManager.js b/common/static/js/vendor/tinymce/js/tinymce/classes/EditorManager.js deleted file mode 100755 index bc3294c9764e..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/EditorManager.js +++ /dev/null @@ -1,574 +0,0 @@ -/** - * EditorManager.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class used as a factory for manager for tinymce.Editor instances. - * - * @example - * tinymce.EditorManager.init({}); - * - * @class tinymce.EditorManager - * @mixes tinymce.util.Observable - * @static - */ -define("tinymce/EditorManager", [ - "tinymce/Editor", - "tinymce/dom/DOMUtils", - "tinymce/util/URI", - "tinymce/Env", - "tinymce/util/Tools", - "tinymce/util/Observable", - "tinymce/util/I18n", - "tinymce/FocusManager" -], function(Editor, DOMUtils, URI, Env, Tools, Observable, I18n, FocusManager) { - var DOM = DOMUtils.DOM; - var explode = Tools.explode, each = Tools.each, extend = Tools.extend; - var instanceCounter = 0, beforeUnloadDelegate; - - var EditorManager = { - /** - * Major version of TinyMCE build. - * - * @property majorVersion - * @type String - */ - majorVersion : '@@majorVersion@@', - - /** - * Minor version of TinyMCE build. - * - * @property minorVersion - * @type String - */ - minorVersion : '@@minorVersion@@', - - /** - * Release date of TinyMCE build. - * - * @property releaseDate - * @type String - */ - releaseDate: '@@releaseDate@@', - - /** - * Collection of editor instances. - * - * @property editors - * @type Object - * @example - * for (edId in tinymce.editors) - * tinymce.editors[edId].save(); - */ - editors: [], - - /** - * Collection of language pack data. - * - * @property i18n - * @type Object - */ - i18n: I18n, - - /** - * Currently active editor instance. - * - * @property activeEditor - * @type tinymce.Editor - * @example - * tinyMCE.activeEditor.selection.getContent(); - * tinymce.EditorManager.activeEditor.selection.getContent(); - */ - activeEditor: null, - - setup: function() { - var self = this, baseURL, documentBaseURL, suffix = "", preInit; - - // Get base URL for the current document - documentBaseURL = document.location.href.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, ''); - if (!/[\/\\]$/.test(documentBaseURL)) { - documentBaseURL += '/'; - } - - // If tinymce is defined and has a base use that or use the old tinyMCEPreInit - preInit = window.tinymce || window.tinyMCEPreInit; - if (preInit) { - baseURL = preInit.base || preInit.baseURL; - suffix = preInit.suffix; - } else { - // Get base where the tinymce script is located - var scripts = document.getElementsByTagName('script'); - for (var i = 0; i < scripts.length; i++) { - var src = scripts[i].src; - - // Script types supported: - // tinymce.js tinymce.min.js tinymce.dev.js - // tinymce.jquery.js tinymce.jquery.min.js tinymce.jquery.dev.js - // tinymce.full.js tinymce.full.min.js tinymce.full.dev.js - if (/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(src)) { - if (src.indexOf('.min') != -1) { - suffix = '.min'; - } - - baseURL = src.substring(0, src.lastIndexOf('/')); - break; - } - } - } - - /** - * Base URL where the root directory if TinyMCE is located. - * - * @property baseURL - * @type String - */ - self.baseURL = new URI(documentBaseURL).toAbsolute(baseURL); - - /** - * Document base URL where the current document is located. - * - * @property documentBaseURL - * @type String - */ - self.documentBaseURL = documentBaseURL; - - /** - * Absolute baseURI for the installation path of TinyMCE. - * - * @property baseURI - * @type tinymce.util.URI - */ - self.baseURI = new URI(self.baseURL); - - /** - * Current suffix to add to each plugin/theme that gets loaded for example ".min". - * - * @property suffix - * @type String - */ - self.suffix = suffix; - - self.focusManager = new FocusManager(self); - }, - - /** - * Initializes a set of editors. This method will create editors based on various settings. - * - * @method init - * @param {Object} settings Settings object to be passed to each editor instance. - * @example - * // Initializes a editor using the longer method - * tinymce.EditorManager.init({ - * some_settings : 'some value' - * }); - * - * // Initializes a editor instance using the shorter version - * tinyMCE.init({ - * some_settings : 'some value' - * }); - */ - init: function(settings) { - var self = this, editors = [], editor; - - function createId(elm) { - var id = elm.id; - - // Use element id, or unique name or generate a unique id - if (!id) { - id = elm.name; - - if (id && !DOM.get(id)) { - id = elm.name; - } else { - // Generate unique name - id = DOM.uniqueId(); - } - - elm.setAttribute('id', id); - } - - return id; - } - - function execCallback(se, n, s) { - var f = se[n]; - - if (!f) { - return; - } - - return f.apply(s || this, Array.prototype.slice.call(arguments, 2)); - } - - function hasClass(n, c) { - return c.constructor === RegExp ? c.test(n.className) : DOM.hasClass(n, c); - } - - function readyHandler() { - var l, co; - - DOM.unbind(window, 'ready', readyHandler); - - execCallback(settings, 'onpageload'); - - if (settings.types) { - // Process type specific selector - each(settings.types, function(type) { - each(DOM.select(type.selector), function(elm) { - var editor = new Editor(createId(elm), extend({}, settings, type), self); - editors.push(editor); - editor.render(1); - }); - }); - - return; - } else if (settings.selector) { - // Process global selector - each(DOM.select(settings.selector), function(elm) { - var editor = new Editor(createId(elm), settings, self); - editors.push(editor); - editor.render(1); - }); - - return; - } - - // Fallback to old setting - switch (settings.mode) { - case "exact": - l = settings.elements || ''; - - if(l.length > 0) { - each(explode(l), function(v) { - if (DOM.get(v)) { - editor = new Editor(v, settings, self); - editors.push(editor); - editor.render(true); - } else { - each(document.forms, function(f) { - each(f.elements, function(e) { - if (e.name === v) { - v = 'mce_editor_' + instanceCounter++; - DOM.setAttrib(e, 'id', v); - - editor = new Editor(v, settings, self); - editors.push(editor); - editor.render(1); - } - }); - }); - } - }); - } - break; - - case "textareas": - case "specific_textareas": - each(DOM.select('textarea'), function(elm) { - if (settings.editor_deselector && hasClass(elm, settings.editor_deselector)) { - return; - } - - if (!settings.editor_selector || hasClass(elm, settings.editor_selector)) { - editor = new Editor(createId(elm), settings, self); - editors.push(editor); - editor.render(true); - } - }); - break; - } - - // Call onInit when all editors are initialized - if (settings.oninit) { - l = co = 0; - - each(editors, function(ed) { - co++; - - if (!ed.initialized) { - // Wait for it - ed.on('init', function() { - l++; - - // All done - if (l == co) { - execCallback(settings, 'oninit'); - } - }); - } else { - l++; - } - - // All done - if (l == co) { - execCallback(settings, 'oninit'); - } - }); - } - } - - self.settings = settings; - - DOM.bind(window, 'ready', readyHandler); - }, - - /** - * Returns a editor instance by id. - * - * @method get - * @param {String/Number} id Editor instance id or index to return. - * @return {tinymce.Editor} Editor instance to return. - * @example - * // Adds an onclick event to an editor by id (shorter version) - * tinymce.get('mytextbox').on('click', function(e) { - * ed.windowManager.alert('Hello world!'); - * }); - * - * // Adds an onclick event to an editor by id (longer version) - * tinymce.EditorManager.get('mytextbox').on('click', function(e) { - * ed.windowManager.alert('Hello world!'); - * }); - */ - get: function(id) { - if (id === undefined) { - return this.editors; - } - - return this.editors[id]; - }, - - /** - * Adds an editor instance to the editor collection. This will also set it as the active editor. - * - * @method add - * @param {tinymce.Editor} editor Editor instance to add to the collection. - * @return {tinymce.Editor} The same instance that got passed in. - */ - add: function(editor) { - var self = this, editors = self.editors; - - // Add named and index editor instance - editors[editor.id] = editor; - editors.push(editor); - - self.activeEditor = editor; - - /** - * Fires when an editor is added to the EditorManager collection. - * - * @event AddEditor - * @param {Object} e Event arguments. - */ - self.fire('AddEditor', {editor: editor}); - - if (!beforeUnloadDelegate) { - beforeUnloadDelegate = function() { - self.fire('BeforeUnload'); - }; - - DOM.bind(window, 'beforeunload', beforeUnloadDelegate); - } - - return editor; - }, - - /** - * Creates an editor instance and adds it to the EditorManager collection. - * - * @method createEditor - * @param {String} id Instance id to use for editor. - * @param {Object} settings Editor instance settings. - * @return {tinymce.Editor} Editor instance that got created. - */ - createEditor: function(id, settings) { - return this.add(new Editor(id, settings, this)); - }, - - /** - * Removes a editor or editors form page. - * - * @example - * // Remove all editors bound to divs - * tinymce.remove('div'); - * - * // Remove all editors bound to textareas - * tinymce.remove('textarea'); - * - * // Remove all editors - * tinymce.remove(); - * - * // Remove specific instance by id - * tinymce.remove('#id'); - * - * @method remove - * @param {tinymce.Editor/String/Object} [selector] CSS selector or editor instance to remove. - * @return {tinymce.Editor} The editor that got passed in will be return if it was found otherwise null. - */ - remove: function(selector) { - var self = this, i, editors = self.editors, editor, removedFromList; - - // Remove all editors - if (!selector) { - for (i = editors.length - 1; i >= 0; i--) { - self.remove(editors[i]); - } - - return; - } - - // Remove editors by selector - if (typeof(selector) == "string") { - selector = selector.selector || selector; - - each(DOM.select(selector), function(elm) { - self.remove(editors[elm.id]); - }); - - return; - } - - // Remove specific editor - editor = selector; - - // Not in the collection - if (!editors[editor.id]) { - return null; - } - - delete editors[editor.id]; - - for (i = 0; i < editors.length; i++) { - if (editors[i] == editor) { - editors.splice(i, 1); - removedFromList = true; - break; - } - } - - // Select another editor since the active one was removed - if (self.activeEditor == editor) { - self.activeEditor = editors[0]; - } - - /** - * Fires when an editor is removed from EditorManager collection. - * - * @event RemoveEditor - * @param {Object} e Event arguments. - */ - if (removedFromList) { - self.fire('RemoveEditor', {editor: editor}); - } - - if (!editors.length) { - DOM.unbind(window, 'beforeunload', beforeUnloadDelegate); - } - - editor.remove(); - - return editor; - }, - - /** - * Executes a specific command on the currently active editor. - * - * @method execCommand - * @param {String} c Command to perform for example Bold. - * @param {Boolean} u Optional boolean state if a UI should be presented for the command or not. - * @param {String} v Optional value parameter like for example an URL to a link. - * @return {Boolean} true/false if the command was executed or not. - */ - execCommand: function(cmd, ui, value) { - var self = this, editor = self.get(value); - - // Manager commands - switch (cmd) { - case "mceAddEditor": - if (!self.get(value)) { - new Editor(value, self.settings, self).render(); - } - - return true; - - case "mceRemoveEditor": - if (editor) { - editor.remove(); - } - - return true; - - case 'mceToggleEditor': - if (!editor) { - self.execCommand('mceAddEditor', 0, value); - return true; - } - - if (editor.isHidden()) { - editor.show(); - } else { - editor.hide(); - } - - return true; - } - - // Run command on active editor - if (self.activeEditor) { - return self.activeEditor.execCommand(cmd, ui, value); - } - - return false; - }, - - /** - * Calls the save method on all editor instances in the collection. This can be useful when a form is to be submitted. - * - * @method triggerSave - * @example - * // Saves all contents - * tinyMCE.triggerSave(); - */ - triggerSave: function() { - each(this.editors, function(editor) { - editor.save(); - }); - }, - - /** - * Adds a language pack, this gets called by the loaded language files like en.js. - * - * @method addI18n - * @param {String} code Optional language code. - * @param {Object} items Name/value object with translations. - */ - addI18n: function(code, items) { - I18n.add(code, items); - }, - - /** - * Translates the specified string using the language pack items. - * - * @method translate - * @param {String/Array/Object} text String to translate - * @return {String} Translated string. - */ - translate: function(text) { - return I18n.translate(text); - } - }; - - extend(EditorManager, Observable); - - EditorManager.setup(); - - // Export EditorManager as tinymce/tinymce in global namespace - window.tinymce = window.tinyMCE = EditorManager; - - return EditorManager; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/EnterKey.js b/common/static/js/vendor/tinymce/js/tinymce/classes/EnterKey.js deleted file mode 100755 index 325ab28c00df..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/EnterKey.js +++ /dev/null @@ -1,670 +0,0 @@ -/** - * EnterKey.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Contains logic for handling the enter key to split/generate block elements. - */ -define("tinymce/EnterKey", [ - "tinymce/dom/TreeWalker", - "tinymce/dom/RangeUtils", - "tinymce/Env" -], function(TreeWalker, RangeUtils, Env) { - var isIE = Env.ie && Env.ie < 11; - - return function(editor) { - var dom = editor.dom, selection = editor.selection, settings = editor.settings; - var undoManager = editor.undoManager, schema = editor.schema, nonEmptyElementsMap = schema.getNonEmptyElements(); - - function handleEnterKey(evt) { - var rng, tmpRng, editableRoot, container, offset, parentBlock, documentMode, shiftKey, - newBlock, fragment, containerBlock, parentBlockName, containerBlockName, newBlockName, isAfterLastNodeInContainer; - - // Returns true if the block can be split into two blocks or not - function canSplitBlock(node) { - return node && - dom.isBlock(node) && - !/^(TD|TH|CAPTION|FORM)$/.test(node.nodeName) && - !/^(fixed|absolute)/i.test(node.style.position) && - dom.getContentEditable(node) !== "true"; - } - - // Renders empty block on IE - function renderBlockOnIE(block) { - var oldRng; - - if (dom.isBlock(block)) { - oldRng = selection.getRng(); - block.appendChild(dom.create('span', null, '\u00a0')); - selection.select(block); - block.lastChild.outerHTML = ''; - selection.setRng(oldRng); - } - } - - // Remove the first empty inline element of the block so this:

x

becomes this:

x

- function trimInlineElementsOnLeftSideOfBlock(block) { - var node = block, firstChilds = [], i; - - // Find inner most first child ex:

*

- while ((node = node.firstChild)) { - if (dom.isBlock(node)) { - return; - } - - if (node.nodeType == 1 && !nonEmptyElementsMap[node.nodeName.toLowerCase()]) { - firstChilds.push(node); - } - } - - i = firstChilds.length; - while (i--) { - node = firstChilds[i]; - if (!node.hasChildNodes() || (node.firstChild == node.lastChild && node.firstChild.nodeValue === '')) { - dom.remove(node); - } else { - // Remove see #5381 - if (node.nodeName == "A" && (node.innerText || node.textContent) === ' ') { - dom.remove(node); - } - } - } - } - - // Moves the caret to a suitable position within the root for example in the first non - // pure whitespace text node or before an image - function moveToCaretPosition(root) { - var walker, node, rng, lastNode = root, tempElm; - - function firstNonWhiteSpaceNodeSibling(node) { - while (node) { - if (node.nodeType == 1 || (node.nodeType == 3 && node.data && /[\r\n\s]/.test(node.data))) { - return node; - } - - node = node.nextSibling; - } - } - - // Old IE versions doesn't properly render blocks with br elements in them - // For example


wont be rendered correctly in a contentEditable area - // until you remove the br producing

- if (Env.ie && Env.ie < 9 && parentBlock && parentBlock.firstChild) { - if (parentBlock.firstChild == parentBlock.lastChild && parentBlock.firstChild.tagName == 'BR') { - dom.remove(parentBlock.firstChild); - } - } - - if (root.nodeName == 'LI') { - var firstChild = firstNonWhiteSpaceNodeSibling(root.firstChild); - - if (firstChild && /^(UL|OL)$/.test(firstChild.nodeName)) { - root.insertBefore(dom.doc.createTextNode('\u00a0'), root.firstChild); - } - } - - rng = dom.createRng(); - - if (root.hasChildNodes()) { - walker = new TreeWalker(root, root); - - while ((node = walker.current())) { - if (node.nodeType == 3) { - rng.setStart(node, 0); - rng.setEnd(node, 0); - break; - } - - if (nonEmptyElementsMap[node.nodeName.toLowerCase()]) { - rng.setStartBefore(node); - rng.setEndBefore(node); - break; - } - - lastNode = node; - node = walker.next(); - } - - if (!node) { - rng.setStart(lastNode, 0); - rng.setEnd(lastNode, 0); - } - } else { - if (root.nodeName == 'BR') { - if (root.nextSibling && dom.isBlock(root.nextSibling)) { - // Trick on older IE versions to render the caret before the BR between two lists - if (!documentMode || documentMode < 9) { - tempElm = dom.create('br'); - root.parentNode.insertBefore(tempElm, root); - } - - rng.setStartBefore(root); - rng.setEndBefore(root); - } else { - rng.setStartAfter(root); - rng.setEndAfter(root); - } - } else { - rng.setStart(root, 0); - rng.setEnd(root, 0); - } - } - - selection.setRng(rng); - - // Remove tempElm created for old IE:s - dom.remove(tempElm); - selection.scrollIntoView(root); - } - - function setForcedBlockAttrs(node) { - var forcedRootBlockName = settings.forced_root_block; - - if (forcedRootBlockName && forcedRootBlockName.toLowerCase() === node.tagName.toLowerCase()) { - dom.setAttribs(node, settings.forced_root_block_attrs); - } - } - - // Creates a new block element by cloning the current one or creating a new one if the name is specified - // This function will also copy any text formatting from the parent block and add it to the new one - function createNewBlock(name) { - var node = container, block, clonedNode, caretNode; - - if (name || parentBlockName == "TABLE") { - block = dom.create(name || newBlockName); - setForcedBlockAttrs(block); - } else { - block = parentBlock.cloneNode(false); - } - - caretNode = block; - - // Clone any parent styles - if (settings.keep_styles !== false) { - do { - if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U|VAR|CITE|DFN|CODE|MARK|Q|SUP|SUB|SAMP)$/.test(node.nodeName)) { - // Never clone a caret containers - if (node.id == '_mce_caret') { - continue; - } - - clonedNode = node.cloneNode(false); - dom.setAttrib(clonedNode, 'id', ''); // Remove ID since it needs to be document unique - - if (block.hasChildNodes()) { - clonedNode.appendChild(block.firstChild); - block.appendChild(clonedNode); - } else { - caretNode = clonedNode; - block.appendChild(clonedNode); - } - } - } while ((node = node.parentNode)); - } - - // BR is needed in empty blocks on non IE browsers - if (!isIE) { - caretNode.innerHTML = '
'; - } - - return block; - } - - // Returns true/false if the caret is at the start/end of the parent block element - function isCaretAtStartOrEndOfBlock(start) { - var walker, node, name; - - // Caret is in the middle of a text node like "a|b" - if (container.nodeType == 3 && (start ? offset > 0 : offset < container.nodeValue.length)) { - return false; - } - - // If after the last element in block node edge case for #5091 - if (container.parentNode == parentBlock && isAfterLastNodeInContainer && !start) { - return true; - } - - // If the caret if before the first element in parentBlock - if (start && container.nodeType == 1 && container == parentBlock.firstChild) { - return true; - } - - // Caret can be before/after a table - if (container.nodeName === "TABLE" || (container.previousSibling && container.previousSibling.nodeName == "TABLE")) { - return (isAfterLastNodeInContainer && !start) || (!isAfterLastNodeInContainer && start); - } - - // Walk the DOM and look for text nodes or non empty elements - walker = new TreeWalker(container, parentBlock); - - // If caret is in beginning or end of a text block then jump to the next/previous node - if (container.nodeType == 3) { - if (start && offset === 0) { - walker.prev(); - } else if (!start && offset == container.nodeValue.length) { - walker.next(); - } - } - - while ((node = walker.current())) { - if (node.nodeType === 1) { - // Ignore bogus elements - if (!node.getAttribute('data-mce-bogus')) { - // Keep empty elements like but not trailing br:s like

text|

- name = node.nodeName.toLowerCase(); - if (nonEmptyElementsMap[name] && name !== 'br') { - return false; - } - } - } else if (node.nodeType === 3 && !/^[ \t\r\n]*$/.test(node.nodeValue)) { - return false; - } - - if (start) { - walker.prev(); - } else { - walker.next(); - } - } - - return true; - } - - // Wraps any text nodes or inline elements in the specified forced root block name - function wrapSelfAndSiblingsInDefaultBlock(container, offset) { - var newBlock, parentBlock, startNode, node, next, rootBlockName, blockName = newBlockName || 'P'; - - // Not in a block element or in a table cell or caption - parentBlock = dom.getParent(container, dom.isBlock); - rootBlockName = editor.getBody().nodeName.toLowerCase(); - if (!parentBlock || !canSplitBlock(parentBlock)) { - parentBlock = parentBlock || editableRoot; - - if (!parentBlock.hasChildNodes()) { - newBlock = dom.create(blockName); - setForcedBlockAttrs(newBlock); - parentBlock.appendChild(newBlock); - rng.setStart(newBlock, 0); - rng.setEnd(newBlock, 0); - return newBlock; - } - - // Find parent that is the first child of parentBlock - node = container; - while (node.parentNode != parentBlock) { - node = node.parentNode; - } - - // Loop left to find start node start wrapping at - while (node && !dom.isBlock(node)) { - startNode = node; - node = node.previousSibling; - } - - if (startNode && schema.isValidChild(rootBlockName, blockName.toLowerCase())) { - newBlock = dom.create(blockName); - setForcedBlockAttrs(newBlock); - startNode.parentNode.insertBefore(newBlock, startNode); - - // Start wrapping until we hit a block - node = startNode; - while (node && !dom.isBlock(node)) { - next = node.nextSibling; - newBlock.appendChild(node); - node = next; - } - - // Restore range to it's past location - rng.setStart(container, offset); - rng.setEnd(container, offset); - } - } - - return container; - } - - // Inserts a block or br before/after or in the middle of a split list of the LI is empty - function handleEmptyListItem() { - function isFirstOrLastLi(first) { - var node = containerBlock[first ? 'firstChild' : 'lastChild']; - - // Find first/last element since there might be whitespace there - while (node) { - if (node.nodeType == 1) { - break; - } - - node = node[first ? 'nextSibling' : 'previousSibling']; - } - - return node === parentBlock; - } - - function getContainerBlock() { - var containerBlockParent = containerBlock.parentNode; - - if (containerBlockParent.nodeName == 'LI') { - return containerBlockParent; - } - - return containerBlock; - } - - // Check if we are in an nested list - var containerBlockParentName = containerBlock.parentNode.nodeName; - if (/^(OL|UL|LI)$/.test(containerBlockParentName)) { - newBlockName = 'LI'; - } - - newBlock = newBlockName ? createNewBlock(newBlockName) : dom.create('BR'); - - if (isFirstOrLastLi(true) && isFirstOrLastLi()) { - if (containerBlockParentName == 'LI') { - // Nested list is inside a LI - dom.insertAfter(newBlock, getContainerBlock()); - } else { - // Is first and last list item then replace the OL/UL with a text block - dom.replace(newBlock, containerBlock); - } - } else if (isFirstOrLastLi(true)) { - if (containerBlockParentName == 'LI') { - // List nested in an LI then move the list to a new sibling LI - dom.insertAfter(newBlock, getContainerBlock()); - newBlock.appendChild(dom.doc.createTextNode(' ')); // Needed for IE so the caret can be placed - newBlock.appendChild(containerBlock); - } else { - // First LI in list then remove LI and add text block before list - containerBlock.parentNode.insertBefore(newBlock, containerBlock); - } - } else if (isFirstOrLastLi()) { - // Last LI in list then remove LI and add text block after list - dom.insertAfter(newBlock, getContainerBlock()); - renderBlockOnIE(newBlock); - } else { - // Middle LI in list the split the list and insert a text block in the middle - // Extract after fragment and insert it after the current block - containerBlock = getContainerBlock(); - tmpRng = rng.cloneRange(); - tmpRng.setStartAfter(parentBlock); - tmpRng.setEndAfter(containerBlock); - fragment = tmpRng.extractContents(); - - if (newBlockName == 'LI' && fragment.firstChild.nodeName == 'LI') { - newBlock = fragment.firstChild; - dom.insertAfter(fragment, containerBlock); - } else { - dom.insertAfter(fragment, containerBlock); - dom.insertAfter(newBlock, containerBlock); - } - } - - dom.remove(parentBlock); - moveToCaretPosition(newBlock); - undoManager.add(); - } - - // Walks the parent block to the right and look for BR elements - function hasRightSideContent() { - var walker = new TreeWalker(container, parentBlock), node; - - while ((node = walker.next())) { - if (nonEmptyElementsMap[node.nodeName.toLowerCase()] || node.length > 0) { - return true; - } - } - } - - // Inserts a BR element if the forced_root_block option is set to false or empty string - function insertBr() { - var brElm, extraBr, marker; - - if (container && container.nodeType == 3 && offset >= container.nodeValue.length) { - // Insert extra BR element at the end block elements - if (!isIE && !hasRightSideContent()) { - brElm = dom.create('br'); - rng.insertNode(brElm); - rng.setStartAfter(brElm); - rng.setEndAfter(brElm); - extraBr = true; - } - } - - brElm = dom.create('br'); - rng.insertNode(brElm); - - // Rendering modes below IE8 doesn't display BR elements in PRE unless we have a \n before it - if (isIE && parentBlockName == 'PRE' && (!documentMode || documentMode < 8)) { - brElm.parentNode.insertBefore(dom.doc.createTextNode('\r'), brElm); - } - - // Insert temp marker and scroll to that - marker = dom.create('span', {}, ' '); - brElm.parentNode.insertBefore(marker, brElm); - selection.scrollIntoView(marker); - dom.remove(marker); - - if (!extraBr) { - rng.setStartAfter(brElm); - rng.setEndAfter(brElm); - } else { - rng.setStartBefore(brElm); - rng.setEndBefore(brElm); - } - - selection.setRng(rng); - undoManager.add(); - } - - // Trims any linebreaks at the beginning of node user for example when pressing enter in a PRE element - function trimLeadingLineBreaks(node) { - do { - if (node.nodeType === 3) { - node.nodeValue = node.nodeValue.replace(/^[\r\n]+/, ''); - } - - node = node.firstChild; - } while (node); - } - - function getEditableRoot(node) { - var root = dom.getRoot(), parent, editableRoot; - - // Get all parents until we hit a non editable parent or the root - parent = node; - while (parent !== root && dom.getContentEditable(parent) !== "false") { - if (dom.getContentEditable(parent) === "true") { - editableRoot = parent; - } - - parent = parent.parentNode; - } - - return parent !== root ? editableRoot : root; - } - - // Adds a BR at the end of blocks that only contains an IMG or INPUT since - // these might be floated and then they won't expand the block - function addBrToBlockIfNeeded(block) { - var lastChild; - - // IE will render the blocks correctly other browsers needs a BR - if (!isIE) { - block.normalize(); // Remove empty text nodes that got left behind by the extract - - // Check if the block is empty or contains a floated last child - lastChild = block.lastChild; - if (!lastChild || (/^(left|right)$/gi.test(dom.getStyle(lastChild, 'float', true)))) { - dom.add(block, 'br'); - } - } - } - - rng = selection.getRng(true); - - // Event is blocked by some other handler for example the lists plugin - if (evt.isDefaultPrevented()) { - return; - } - - // Delete any selected contents - if (!rng.collapsed) { - editor.execCommand('Delete'); - return; - } - - // Setup range items and newBlockName - new RangeUtils(dom).normalize(rng); - container = rng.startContainer; - offset = rng.startOffset; - newBlockName = (settings.force_p_newlines ? 'p' : '') || settings.forced_root_block; - newBlockName = newBlockName ? newBlockName.toUpperCase() : ''; - documentMode = dom.doc.documentMode; - shiftKey = evt.shiftKey; - - // Resolve node index - if (container.nodeType == 1 && container.hasChildNodes()) { - isAfterLastNodeInContainer = offset > container.childNodes.length - 1; - - container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container; - if (isAfterLastNodeInContainer && container.nodeType == 3) { - offset = container.nodeValue.length; - } else { - offset = 0; - } - } - - // Get editable root node normaly the body element but sometimes a div or span - editableRoot = getEditableRoot(container); - - // If there is no editable root then enter is done inside a contentEditable false element - if (!editableRoot) { - return; - } - - undoManager.beforeChange(); - - // If editable root isn't block nor the root of the editor - if (!dom.isBlock(editableRoot) && editableRoot != dom.getRoot()) { - if (!newBlockName || shiftKey) { - insertBr(); - } - - return; - } - - // Wrap the current node and it's sibling in a default block if it's needed. - // for example this text|text2 will become this

text|text2

- // This won't happen if root blocks are disabled or the shiftKey is pressed - if ((newBlockName && !shiftKey) || (!newBlockName && shiftKey)) { - container = wrapSelfAndSiblingsInDefaultBlock(container, offset); - } - - // Find parent block and setup empty block paddings - parentBlock = dom.getParent(container, dom.isBlock); - containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null; - - // Setup block names - parentBlockName = parentBlock ? parentBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5 - containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5 - - // Enter inside block contained within a LI then split or insert before/after LI - if (containerBlockName == 'LI' && !evt.ctrlKey) { - parentBlock = containerBlock; - parentBlockName = containerBlockName; - } - - // Handle enter in LI - if (parentBlockName == 'LI') { - if (!newBlockName && shiftKey) { - insertBr(); - return; - } - - // Handle enter inside an empty list item - if (dom.isEmpty(parentBlock)) { - handleEmptyListItem(); - return; - } - } - - // Don't split PRE tags but insert a BR instead easier when writing code samples etc - if (parentBlockName == 'PRE' && settings.br_in_pre !== false) { - if (!shiftKey) { - insertBr(); - return; - } - } else { - // If no root block is configured then insert a BR by default or if the shiftKey is pressed - if ((!newBlockName && !shiftKey && parentBlockName != 'LI') || (newBlockName && shiftKey)) { - insertBr(); - return; - } - } - - // If parent block is root then never insert new blocks - if (newBlockName && parentBlock === editor.getBody()) { - return; - } - - // Default block name if it's not configured - newBlockName = newBlockName || 'P'; - - // Insert new block before/after the parent block depending on caret location - if (isCaretAtStartOrEndOfBlock()) { - // If the caret is at the end of a header we produce a P tag after it similar to Word unless we are in a hgroup - if (/^(H[1-6]|PRE|FIGURE)$/.test(parentBlockName) && containerBlockName != 'HGROUP') { - newBlock = createNewBlock(newBlockName); - } else { - newBlock = createNewBlock(); - } - - // Split the current container block element if enter is pressed inside an empty inner block element - if (settings.end_container_on_empty_block && canSplitBlock(containerBlock) && dom.isEmpty(parentBlock)) { - // Split container block for example a BLOCKQUOTE at the current blockParent location for example a P - newBlock = dom.split(containerBlock, parentBlock); - } else { - dom.insertAfter(newBlock, parentBlock); - } - - moveToCaretPosition(newBlock); - } else if (isCaretAtStartOrEndOfBlock(true)) { - // Insert new block before - newBlock = parentBlock.parentNode.insertBefore(createNewBlock(), parentBlock); - renderBlockOnIE(newBlock); - moveToCaretPosition(parentBlock); - } else { - // Extract after fragment and insert it after the current block - tmpRng = rng.cloneRange(); - tmpRng.setEndAfter(parentBlock); - fragment = tmpRng.extractContents(); - trimLeadingLineBreaks(fragment); - newBlock = fragment.firstChild; - dom.insertAfter(fragment, parentBlock); - trimInlineElementsOnLeftSideOfBlock(newBlock); - addBrToBlockIfNeeded(parentBlock); - moveToCaretPosition(newBlock); - } - - dom.setAttrib(newBlock, 'id', ''); // Remove ID since it needs to be document unique - - // Allow custom handling of new blocks - editor.fire('NewBlock', { newBlock: newBlock }); - - undoManager.add(); - } - - editor.on('keydown', function(evt) { - if (evt.keyCode == 13) { - if (handleEnterKey(evt) !== false) { - evt.preventDefault(); - } - } - }); - }; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/Env.js b/common/static/js/vendor/tinymce/js/tinymce/classes/Env.js deleted file mode 100755 index 8bf2c6ef8451..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/Env.js +++ /dev/null @@ -1,135 +0,0 @@ -/** - * Env.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class contains various environment constants like browser versions etc. - * Normally you don't want to sniff specific browser versions but sometimes you have - * to when it's impossible to feature detect. So use this with care. - * - * @class tinymce.Env - * @static - */ -define("tinymce/Env", [], function() { - var nav = navigator, userAgent = nav.userAgent; - var opera, webkit, ie, ie11, gecko, mac, iDevice; - - opera = window.opera && window.opera.buildNumber; - webkit = /WebKit/.test(userAgent); - ie = !webkit && !opera && (/MSIE/gi).test(userAgent) && (/Explorer/gi).test(nav.appName); - ie = ie && /MSIE (\w+)\./.exec(userAgent)[1]; - ie11 = userAgent.indexOf('Trident/') != -1 && (userAgent.indexOf('rv:') != -1 || nav.appName.indexOf('Netscape') != -1) ? 11 : false; - ie = ie || ie11; - gecko = !webkit && !ie11 && /Gecko/.test(userAgent); - mac = userAgent.indexOf('Mac') != -1; - iDevice = /(iPad|iPhone)/.test(userAgent); - - // Is a iPad/iPhone and not on iOS5 sniff the WebKit version since older iOS WebKit versions - // says it has contentEditable support but there is no visible caret. - var contentEditable = !iDevice || userAgent.match(/AppleWebKit\/(\d*)/)[1] >= 534; - - return { - /** - * Constant that is true if the browser is Opera. - * - * @property opera - * @type Boolean - * @final - */ - opera: opera, - - /** - * Constant that is true if the browser is WebKit (Safari/Chrome). - * - * @property webKit - * @type Boolean - * @final - */ - webkit: webkit, - - /** - * Constant that is more than zero if the browser is IE. - * - * @property ie - * @type Boolean - * @final - */ - ie: ie, - - /** - * Constant that is true if the browser is Gecko. - * - * @property gecko - * @type Boolean - * @final - */ - gecko: gecko, - - /** - * Constant that is true if the os is Mac OS. - * - * @property mac - * @type Boolean - * @final - */ - mac: mac, - - /** - * Constant that is true if the os is iOS. - * - * @property iOS - * @type Boolean - * @final - */ - iOS: iDevice, - - /** - * Constant that is true if the browser supports editing. - * - * @property contentEditable - * @type Boolean - * @final - */ - contentEditable: contentEditable, - - /** - * Transparent image data url. - * - * @property transparentSrc - * @type Boolean - * @final - */ - transparentSrc: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", - - /** - * Returns true/false if the browser can or can't place the caret after a inline block like an image. - * - * @property noCaretAfter - * @type Boolean - * @final - */ - caretAfter: ie != 8, - - /** - * Constant that is true if the browser supports native DOM Ranges. IE 9+. - * - * @property range - * @type Boolean - */ - range: window.getSelection && "Range" in window, - - /** - * Returns the IE document mode for non IE browsers this will fake IE 10. - * - * @property documentMode - * @type Number - */ - documentMode: ie ? (document.documentMode || 7) : 10 - }; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/FocusManager.js b/common/static/js/vendor/tinymce/js/tinymce/classes/FocusManager.js deleted file mode 100755 index dca96befc622..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/FocusManager.js +++ /dev/null @@ -1,230 +0,0 @@ -/** - * FocusManager.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class manages the focus/blur state of the editor. This class is needed since some - * browsers fire false focus/blur states when the selection is moved to a UI dialog or similar. - * - * This class will fire two events focus and blur on the editor instances that got affected. - * It will also handle the restore of selection when the focus is lost and returned. - * - * @class tinymce.FocusManager - */ -define("tinymce/FocusManager", [ - "tinymce/dom/DOMUtils", - "tinymce/Env" -], function(DOMUtils, Env) { - var selectionChangeHandler, documentFocusInHandler, DOM = DOMUtils.DOM; - - /** - * Constructs a new focus manager instance. - * - * @constructor FocusManager - * @param {tinymce.EditorManager} editorManager Editor manager instance to handle focus for. - */ - function FocusManager(editorManager) { - function getActiveElement() { - try { - return document.activeElement; - } catch (ex) { - // IE sometimes fails to get the activeElement when resizing table - // TODO: Investigate this - return document.body; - } - } - - // We can't store a real range on IE 11 since it gets mutated so we need to use a bookmark object - // TODO: Move this to a separate range utils class since it's it's logic is present in Selection as well. - function createBookmark(rng) { - if (rng && rng.startContainer) { - return { - startContainer: rng.startContainer, - startOffset: rng.startOffset, - endContainer: rng.endContainer, - endOffset: rng.endOffset - }; - } - - return rng; - } - - function bookmarkToRng(editor, bookmark) { - var rng; - - if (bookmark.startContainer) { - rng = editor.getDoc().createRange(); - rng.setStart(bookmark.startContainer, bookmark.startOffset); - rng.setEnd(bookmark.endContainer, bookmark.endOffset); - } else { - rng = bookmark; - } - - return rng; - } - - function isUIElement(elm) { - return !!DOM.getParent(elm, FocusManager.isEditorUIElement); - } - - function isNodeInBodyOfEditor(node, editor) { - var body = editor.getBody(); - - while (node) { - if (node == body) { - return true; - } - - node = node.parentNode; - } - } - - function registerEvents(e) { - var editor = e.editor; - - editor.on('init', function() { - // Gecko/WebKit has ghost selections in iframes and IE only has one selection per browser tab - if (editor.inline || Env.ie) { - // On other browsers take snapshot on nodechange in inline mode since they have Ghost selections for iframes - editor.on('nodechange keyup', function() { - var node = document.activeElement; - - // IE 11 reports active element as iframe not body of iframe - if (node && node.id == editor.id + '_ifr') { - node = editor.getBody(); - } - - if (isNodeInBodyOfEditor(node, editor)) { - editor.lastRng = editor.selection.getRng(); - } - }); - - // Handles the issue with WebKit not retaining selection within inline document - // If the user releases the mouse out side the body since a mouse up event wont occur on the body - if (Env.webkit && !selectionChangeHandler) { - selectionChangeHandler = function() { - var activeEditor = editorManager.activeEditor; - - if (activeEditor && activeEditor.selection) { - var rng = activeEditor.selection.getRng(); - - // Store when it's non collapsed - if (rng && !rng.collapsed) { - editor.lastRng = rng; - } - } - }; - - DOM.bind(document, 'selectionchange', selectionChangeHandler); - } - } - }); - - editor.on('setcontent', function() { - editor.lastRng = null; - }); - - // Remove last selection bookmark on mousedown see #6305 - editor.on('mousedown', function() { - editor.selection.lastFocusBookmark = null; - }); - - editor.on('focusin', function() { - var focusedEditor = editorManager.focusedEditor; - - if (editor.selection.lastFocusBookmark) { - editor.selection.setRng(bookmarkToRng(editor, editor.selection.lastFocusBookmark)); - editor.selection.lastFocusBookmark = null; - } - - if (focusedEditor != editor) { - if (focusedEditor) { - focusedEditor.fire('blur', {focusedEditor: editor}); - } - - editorManager.activeEditor = editor; - editorManager.focusedEditor = editor; - editor.fire('focus', {blurredEditor: focusedEditor}); - editor.focus(true); - } - - editor.lastRng = null; - }); - - editor.on('focusout', function() { - window.setTimeout(function() { - var focusedEditor = editorManager.focusedEditor; - - // Still the same editor the the blur was outside any editor UI - if (!isUIElement(getActiveElement()) && focusedEditor == editor) { - editor.fire('blur', {focusedEditor: null}); - editorManager.focusedEditor = null; - - // Make sure selection is valid could be invalid if the editor is blured and removed before the timeout occurs - if (editor.selection) { - editor.selection.lastFocusBookmark = null; - } - } - }, 0); - }); - - if (!documentFocusInHandler) { - documentFocusInHandler = function(e) { - var activeEditor = editorManager.activeEditor; - - if (activeEditor && e.target.ownerDocument == document) { - // Check to make sure we have a valid selection - if (activeEditor.selection) { - activeEditor.selection.lastFocusBookmark = createBookmark(activeEditor.lastRng); - } - - // Fire a blur event if the element isn't a UI element - if (!isUIElement(e.target) && editorManager.focusedEditor == activeEditor) { - activeEditor.fire('blur', {focusedEditor: null}); - editorManager.focusedEditor = null; - } - } - }; - - // Check if focus is moved to an element outside the active editor by checking if the target node - // isn't within the body of the activeEditor nor a UI element such as a dialog child control - DOM.bind(document, 'focusin', documentFocusInHandler); - } - } - - function unregisterDocumentEvents(e) { - if (editorManager.focusedEditor == e.editor) { - editorManager.focusedEditor = null; - } - - if (!editorManager.activeEditor) { - DOM.unbind(document, 'selectionchange', selectionChangeHandler); - DOM.unbind(document, 'focusin', documentFocusInHandler); - selectionChangeHandler = documentFocusInHandler = null; - } - } - - editorManager.on('AddEditor', registerEvents); - editorManager.on('RemoveEditor', unregisterDocumentEvents); - } - - /** - * Returns true if the specified element is part of the UI for example an button or text input. - * - * @method isEditorUIElement - * @param {Element} elm Element to check if it's part of the UI or not. - * @return {Boolean} True/false state if the element is part of the UI or not. - */ - FocusManager.isEditorUIElement = function(elm) { - // Needs to be converted to string since svg can have focus: #6776 - return elm.className.toString().indexOf('mce-') !== -1; - }; - - return FocusManager; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ForceBlocks.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ForceBlocks.js deleted file mode 100755 index 3a56b4411179..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ForceBlocks.js +++ /dev/null @@ -1,132 +0,0 @@ -/** - * ForceBlocks.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("tinymce/ForceBlocks", [], function() { - return function(editor) { - var settings = editor.settings, dom = editor.dom, selection = editor.selection; - var schema = editor.schema, blockElements = schema.getBlockElements(); - - function addRootBlocks() { - var node = selection.getStart(), rootNode = editor.getBody(), rng; - var startContainer, startOffset, endContainer, endOffset, rootBlockNode; - var tempNode, offset = -0xFFFFFF, wrapped, restoreSelection; - var tmpRng, rootNodeName, forcedRootBlock; - - forcedRootBlock = settings.forced_root_block; - - if (!node || node.nodeType !== 1 || !forcedRootBlock) { - return; - } - - // Check if node is wrapped in block - while (node && node != rootNode) { - if (blockElements[node.nodeName]) { - return; - } - - node = node.parentNode; - } - - // Get current selection - rng = selection.getRng(); - if (rng.setStart) { - startContainer = rng.startContainer; - startOffset = rng.startOffset; - endContainer = rng.endContainer; - endOffset = rng.endOffset; - - try { - restoreSelection = editor.getDoc().activeElement === rootNode; - } catch (ex) { - // IE throws unspecified error here sometimes - } - } else { - // Force control range into text range - if (rng.item) { - node = rng.item(0); - rng = editor.getDoc().body.createTextRange(); - rng.moveToElementText(node); - } - - restoreSelection = rng.parentElement().ownerDocument === editor.getDoc(); - tmpRng = rng.duplicate(); - tmpRng.collapse(true); - startOffset = tmpRng.move('character', offset) * -1; - - if (!tmpRng.collapsed) { - tmpRng = rng.duplicate(); - tmpRng.collapse(false); - endOffset = (tmpRng.move('character', offset) * -1) - startOffset; - } - } - - // Wrap non block elements and text nodes - node = rootNode.firstChild; - rootNodeName = rootNode.nodeName.toLowerCase(); - while (node) { - // TODO: Break this up, too complex - if (((node.nodeType === 3 || (node.nodeType == 1 && !blockElements[node.nodeName]))) && - schema.isValidChild(rootNodeName, forcedRootBlock.toLowerCase())) { - // Remove empty text nodes - if (node.nodeType === 3 && node.nodeValue.length === 0) { - tempNode = node; - node = node.nextSibling; - dom.remove(tempNode); - continue; - } - - if (!rootBlockNode) { - rootBlockNode = dom.create(forcedRootBlock, editor.settings.forced_root_block_attrs); - node.parentNode.insertBefore(rootBlockNode, node); - wrapped = true; - } - - tempNode = node; - node = node.nextSibling; - rootBlockNode.appendChild(tempNode); - } else { - rootBlockNode = null; - node = node.nextSibling; - } - } - - if (wrapped && restoreSelection) { - if (rng.setStart) { - rng.setStart(startContainer, startOffset); - rng.setEnd(endContainer, endOffset); - selection.setRng(rng); - } else { - // Only select if the previous selection was inside the document to prevent auto focus in quirks mode - try { - rng = editor.getDoc().body.createTextRange(); - rng.moveToElementText(rootNode); - rng.collapse(true); - rng.moveStart('character', startOffset); - - if (endOffset > 0) { - rng.moveEnd('character', endOffset); - } - - rng.select(); - } catch (ex) { - // Ignore - } - } - - editor.nodeChanged(); - } - } - - // Force root blocks - if (settings.forced_root_block) { - editor.on('NodeChange', addRootBlocks); - } - }; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/Formatter.js b/common/static/js/vendor/tinymce/js/tinymce/classes/Formatter.js deleted file mode 100755 index baa0b8a4175c..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/Formatter.js +++ /dev/null @@ -1,2426 +0,0 @@ -/** - * Formatter.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Text formatter engine class. This class is used to apply formats like bold, italic, font size - * etc to the current selection or specific nodes. This engine was build to replace the browsers - * default formatting logic for execCommand due to it's inconsistent and buggy behavior. - * - * @class tinymce.Formatter - * @example - * tinymce.activeEditor.formatter.register('mycustomformat', { - * inline: 'span', - * styles: {color: '#ff0000'} - * }); - * - * tinymce.activeEditor.formatter.apply('mycustomformat'); - */ -define("tinymce/Formatter", [ - "tinymce/dom/TreeWalker", - "tinymce/dom/RangeUtils", - "tinymce/util/Tools" -], function(TreeWalker, RangeUtils, Tools) { - /** - * Constructs a new formatter instance. - * - * @constructor Formatter - * @param {tinymce.Editor} ed Editor instance to construct the formatter engine to. - */ - return function(ed) { - var formats = {}, - dom = ed.dom, - selection = ed.selection, - rangeUtils = new RangeUtils(dom), - isValid = ed.schema.isValidChild, - isBlock = dom.isBlock, - forcedRootBlock = ed.settings.forced_root_block, - nodeIndex = dom.nodeIndex, - INVISIBLE_CHAR = '\uFEFF', - MCE_ATTR_RE = /^(src|href|style)$/, - FALSE = false, - TRUE = true, - formatChangeData, - undef, - getContentEditable = dom.getContentEditable, - disableCaretContainer, - markCaretContainersBogus; - - var each = Tools.each, - grep = Tools.grep, - walk = Tools.walk, - extend = Tools.extend; - - function isTextBlock(name) { - if (name.nodeType) { - name = name.nodeName; - } - - return !!ed.schema.getTextBlockElements()[name.toLowerCase()]; - } - - function getParents(node, selector) { - return dom.getParents(node, selector, dom.getRoot()); - } - - function isCaretNode(node) { - return node.nodeType === 1 && node.id === '_mce_caret'; - } - - function defaultFormats() { - register({ - alignleft: [ - {selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li', styles: {textAlign: 'left'}, defaultBlock: 'div'}, - {selector: 'img,table', collapsed: false, styles: {'float': 'left'}} - ], - - aligncenter: [ - {selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li', styles: {textAlign: 'center'}, defaultBlock: 'div'}, - {selector: 'img', collapsed: false, styles: {display: 'block', marginLeft: 'auto', marginRight: 'auto'}}, - {selector: 'table', collapsed: false, styles: {marginLeft: 'auto', marginRight: 'auto'}} - ], - - alignright: [ - {selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li', styles: {textAlign: 'right'}, defaultBlock: 'div'}, - {selector: 'img,table', collapsed: false, styles: {'float': 'right'}} - ], - - alignjustify: [ - {selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li', styles: {textAlign: 'justify'}, defaultBlock: 'div'} - ], - - bold: [ - {inline: 'strong', remove: 'all'}, - {inline: 'span', styles: {fontWeight: 'bold'}}, - {inline: 'b', remove: 'all'} - ], - - italic: [ - {inline: 'em', remove: 'all'}, - {inline: 'span', styles: {fontStyle: 'italic'}}, - {inline: 'i', remove: 'all'} - ], - - underline: [ - {inline: 'span', styles: {textDecoration: 'underline'}, exact: true}, - {inline: 'u', remove: 'all'} - ], - - strikethrough: [ - {inline: 'span', styles: {textDecoration: 'line-through'}, exact: true}, - {inline: 'strike', remove: 'all'} - ], - - forecolor: {inline: 'span', styles: {color: '%value'}, wrap_links: false}, - hilitecolor: {inline: 'span', styles: {backgroundColor: '%value'}, wrap_links: false}, - fontname: {inline: 'span', styles: {fontFamily: '%value'}}, - fontsize: {inline: 'span', styles: {fontSize: '%value'}}, - fontsize_class: {inline: 'span', attributes: {'class': '%value'}}, - blockquote: {block: 'blockquote', wrapper: 1, remove: 'all'}, - subscript: {inline: 'sub'}, - superscript: {inline: 'sup'}, - code: {inline: 'code'}, - - link: {inline: 'a', selector: 'a', remove: 'all', split: true, deep: true, - onmatch: function() { - return true; - }, - - onformat: function(elm, fmt, vars) { - each(vars, function(value, key) { - dom.setAttrib(elm, key, value); - }); - } - }, - - removeformat: [ - { - selector: 'b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q', - remove: 'all', - split: true, - expand: false, - block_expand: true, - deep: true - }, - {selector: 'span', attributes: ['style', 'class'], remove: 'empty', split: true, expand: false, deep: true}, - {selector: '*', attributes: ['style', 'class'], split: false, expand: false, deep: true} - ] - }); - - // Register default block formats - each('p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp'.split(/\s/), function(name) { - register(name, {block: name, remove: 'all'}); - }); - - // Register user defined formats - register(ed.settings.formats); - } - - function addKeyboardShortcuts() { - // Add some inline shortcuts - ed.addShortcut('ctrl+b', 'bold_desc', 'Bold'); - ed.addShortcut('ctrl+i', 'italic_desc', 'Italic'); - ed.addShortcut('ctrl+u', 'underline_desc', 'Underline'); - - // BlockFormat shortcuts keys - for (var i = 1; i <= 6; i++) { - ed.addShortcut('ctrl+' + i, '', ['FormatBlock', false, 'h' + i]); - } - - ed.addShortcut('ctrl+7', '', ['FormatBlock', false, 'p']); - ed.addShortcut('ctrl+8', '', ['FormatBlock', false, 'div']); - ed.addShortcut('ctrl+9', '', ['FormatBlock', false, 'address']); - } - - // Public functions - - /** - * Returns the format by name or all formats if no name is specified. - * - * @method get - * @param {String} name Optional name to retrive by. - * @return {Array/Object} Array/Object with all registred formats or a specific format. - */ - function get(name) { - return name ? formats[name] : formats; - } - - /** - * Registers a specific format by name. - * - * @method register - * @param {Object/String} name Name of the format for example "bold". - * @param {Object/Array} format Optional format object or array of format variants - * can only be omitted if the first arg is an object. - */ - function register(name, format) { - if (name) { - if (typeof(name) !== 'string') { - each(name, function(format, name) { - register(name, format); - }); - } else { - // Force format into array and add it to internal collection - format = format.length ? format : [format]; - - each(format, function(format) { - // Set deep to false by default on selector formats this to avoid removing - // alignment on images inside paragraphs when alignment is changed on paragraphs - if (format.deep === undef) { - format.deep = !format.selector; - } - - // Default to true - if (format.split === undef) { - format.split = !format.selector || format.inline; - } - - // Default to true - if (format.remove === undef && format.selector && !format.inline) { - format.remove = 'none'; - } - - // Mark format as a mixed format inline + block level - if (format.selector && format.inline) { - format.mixed = true; - format.block_expand = true; - } - - // Split classes if needed - if (typeof(format.classes) === 'string') { - format.classes = format.classes.split(/\s+/); - } - }); - - formats[name] = format; - } - } - } - - function getTextDecoration(node) { - var decoration; - - ed.dom.getParent(node, function(n) { - decoration = ed.dom.getStyle(n, 'text-decoration'); - return decoration && decoration !== 'none'; - }); - - return decoration; - } - - function processUnderlineAndColor(node) { - var textDecoration; - if (node.nodeType === 1 && node.parentNode && node.parentNode.nodeType === 1) { - textDecoration = getTextDecoration(node.parentNode); - if (ed.dom.getStyle(node, 'color') && textDecoration) { - ed.dom.setStyle(node, 'text-decoration', textDecoration); - } else if (ed.dom.getStyle(node, 'textdecoration') === textDecoration) { - ed.dom.setStyle(node, 'text-decoration', null); - } - } - } - - /** - * Applies the specified format to the current selection or specified node. - * - * @method apply - * @param {String} name Name of format to apply. - * @param {Object} vars Optional list of variables to replace within format before applying it. - * @param {Node} node Optional node to apply the format to defaults to current selection. - */ - function apply(name, vars, node) { - var formatList = get(name), format = formatList[0], bookmark, rng, isCollapsed = !node && selection.isCollapsed(); - - function setElementFormat(elm, fmt) { - fmt = fmt || format; - - if (elm) { - if (fmt.onformat) { - fmt.onformat(elm, fmt, vars, node); - } - - each(fmt.styles, function(value, name) { - dom.setStyle(elm, name, replaceVars(value, vars)); - }); - - each(fmt.attributes, function(value, name) { - dom.setAttrib(elm, name, replaceVars(value, vars)); - }); - - each(fmt.classes, function(value) { - value = replaceVars(value, vars); - - if (!dom.hasClass(elm, value)) { - dom.addClass(elm, value); - } - }); - } - } - - function adjustSelectionToVisibleSelection() { - function findSelectionEnd(start, end) { - var walker = new TreeWalker(end); - for (node = walker.current(); node; node = walker.prev()) { - if (node.childNodes.length > 1 || node == start || node.tagName == 'BR') { - return node; - } - } - } - - // Adjust selection so that a end container with a end offset of zero is not included in the selection - // as this isn't visible to the user. - var rng = ed.selection.getRng(); - var start = rng.startContainer; - var end = rng.endContainer; - - if (start != end && rng.endOffset === 0) { - var newEnd = findSelectionEnd(start, end); - var endOffset = newEnd.nodeType == 3 ? newEnd.length : newEnd.childNodes.length; - - rng.setEnd(newEnd, endOffset); - } - - return rng; - } - - function applyStyleToList(node, bookmark, wrapElm, newWrappers, process){ - var nodes = [], listIndex = -1, list, startIndex = -1, endIndex = -1, currentWrapElm; - - // find the index of the first child list. - each(node.childNodes, function(n, index) { - if (n.nodeName === "UL" || n.nodeName === "OL") { - listIndex = index; - list = n; - return false; - } - }); - - // get the index of the bookmarks - each(node.childNodes, function(n, index) { - if (n.nodeName === "SPAN" && dom.getAttrib(n, "data-mce-type") == "bookmark") { - if (n.id == bookmark.id + "_start") { - startIndex = index; - } else if (n.id == bookmark.id + "_end") { - endIndex = index; - } - } - }); - - // if the selection spans across an embedded list, or there isn't an embedded list - handle processing normally - if (listIndex <= 0 || (startIndex < listIndex && endIndex > listIndex)) { - each(grep(node.childNodes), process); - return 0; - } else { - currentWrapElm = dom.clone(wrapElm, FALSE); - - // create a list of the nodes on the same side of the list as the selection - each(grep(node.childNodes), function(n, index) { - if ((startIndex < listIndex && index < listIndex) || (startIndex > listIndex && index > listIndex)) { - nodes.push(n); - n.parentNode.removeChild(n); - } - }); - - // insert the wrapping element either before or after the list. - if (startIndex < listIndex) { - node.insertBefore(currentWrapElm, list); - } else if (startIndex > listIndex) { - node.insertBefore(currentWrapElm, list.nextSibling); - } - - // add the new nodes to the list. - newWrappers.push(currentWrapElm); - - each(nodes, function(node) { - currentWrapElm.appendChild(node); - }); - - return currentWrapElm; - } - } - - function applyRngStyle(rng, bookmark, node_specific) { - var newWrappers = [], wrapName, wrapElm, contentEditable = true; - - // Setup wrapper element - wrapName = format.inline || format.block; - wrapElm = dom.create(wrapName); - setElementFormat(wrapElm); - - rangeUtils.walk(rng, function(nodes) { - var currentWrapElm; - - /** - * Process a list of nodes wrap them. - */ - function process(node) { - var nodeName, parentName, found, hasContentEditableState, lastContentEditable; - - lastContentEditable = contentEditable; - nodeName = node.nodeName.toLowerCase(); - parentName = node.parentNode.nodeName.toLowerCase(); - - // Node has a contentEditable value - if (node.nodeType === 1 && getContentEditable(node)) { - lastContentEditable = contentEditable; - contentEditable = getContentEditable(node) === "true"; - hasContentEditableState = true; // We don't want to wrap the container only it's children - } - - // Stop wrapping on br elements - if (isEq(nodeName, 'br')) { - currentWrapElm = 0; - - // Remove any br elements when we wrap things - if (format.block) { - dom.remove(node); - } - - return; - } - - // If node is wrapper type - if (format.wrapper && matchNode(node, name, vars)) { - currentWrapElm = 0; - return; - } - - // Can we rename the block - // TODO: Break this if up, too complex - if (contentEditable && !hasContentEditableState && format.block && - !format.wrapper && isTextBlock(nodeName) && isValid(parentName, wrapName)) { - node = dom.rename(node, wrapName); - setElementFormat(node); - newWrappers.push(node); - currentWrapElm = 0; - return; - } - - // Handle selector patterns - if (format.selector) { - // Look for matching formats - each(formatList, function(format) { - // Check collapsed state if it exists - if ('collapsed' in format && format.collapsed !== isCollapsed) { - return; - } - - if (dom.is(node, format.selector) && !isCaretNode(node)) { - setElementFormat(node, format); - found = true; - } - }); - - // Continue processing if a selector match wasn't found and a inline element is defined - if (!format.inline || found) { - currentWrapElm = 0; - return; - } - } - - // Is it valid to wrap this item - // TODO: Break this if up, too complex - if (contentEditable && !hasContentEditableState && isValid(wrapName, nodeName) && isValid(parentName, wrapName) && - !(!node_specific && node.nodeType === 3 && - node.nodeValue.length === 1 && - node.nodeValue.charCodeAt(0) === 65279) && - !isCaretNode(node) && - (!format.inline || !isBlock(node))) { - // Start wrapping - if (!currentWrapElm) { - // Wrap the node - currentWrapElm = dom.clone(wrapElm, FALSE); - node.parentNode.insertBefore(currentWrapElm, node); - newWrappers.push(currentWrapElm); - } - - currentWrapElm.appendChild(node); - } else if (nodeName == 'li' && bookmark) { - // Start wrapping - if we are in a list node and have a bookmark, then - // we will always begin by wrapping in a new element. - currentWrapElm = applyStyleToList(node, bookmark, wrapElm, newWrappers, process); - } else { - // Start a new wrapper for possible children - currentWrapElm = 0; - - each(grep(node.childNodes), process); - - if (hasContentEditableState) { - contentEditable = lastContentEditable; // Restore last contentEditable state from stack - } - - // End the last wrapper - currentWrapElm = 0; - } - } - - // Process siblings from range - each(nodes, process); - }); - - // Wrap links inside as well, for example color inside a link when the wrapper is around the link - if (format.wrap_links === false) { - each(newWrappers, function(node) { - function process(node) { - var i, currentWrapElm, children; - - if (node.nodeName === 'A') { - currentWrapElm = dom.clone(wrapElm, FALSE); - newWrappers.push(currentWrapElm); - - children = grep(node.childNodes); - for (i = 0; i < children.length; i++) { - currentWrapElm.appendChild(children[i]); - } - - node.appendChild(currentWrapElm); - } - - each(grep(node.childNodes), process); - } - - process(node); - }); - } - - // Cleanup - each(newWrappers, function(node) { - var childCount; - - function getChildCount(node) { - var count = 0; - - each(node.childNodes, function(node) { - if (!isWhiteSpaceNode(node) && !isBookmarkNode(node)) { - count++; - } - }); - - return count; - } - - function mergeStyles(node) { - var child, clone; - - each(node.childNodes, function(node) { - if (node.nodeType == 1 && !isBookmarkNode(node) && !isCaretNode(node)) { - child = node; - return FALSE; // break loop - } - }); - - // If child was found and of the same type as the current node - if (child && !isBookmarkNode(child) && matchName(child, format)) { - clone = dom.clone(child, FALSE); - setElementFormat(clone); - - dom.replace(clone, node, TRUE); - dom.remove(child, 1); - } - - return clone || node; - } - - childCount = getChildCount(node); - - // Remove empty nodes but only if there is multiple wrappers and they are not block - // elements so never remove single

since that would remove the - // currrent empty block element where the caret is at - if ((newWrappers.length > 1 || !isBlock(node)) && childCount === 0) { - dom.remove(node, 1); - return; - } - - if (format.inline || format.wrapper) { - // Merges the current node with it's children of similar type to reduce the number of elements - if (!format.exact && childCount === 1) { - node = mergeStyles(node); - } - - // Remove/merge children - each(formatList, function(format) { - // Merge all children of similar type will move styles from child to parent - // this: text - // will become: text - each(dom.select(format.inline, node), function(child) { - var parent; - - if (isBookmarkNode(child)) { - return; - } - - // When wrap_links is set to false we don't want - // to remove the format on children within links - if (format.wrap_links === false) { - parent = child.parentNode; - - do { - if (parent.nodeName === 'A') { - return; - } - } while ((parent = parent.parentNode)); - } - - removeFormat(format, vars, child, format.exact ? child : null); - }); - }); - - // Remove child if direct parent is of same type - if (matchNode(node.parentNode, name, vars)) { - dom.remove(node, 1); - node = 0; - return TRUE; - } - - // Look for parent with similar style format - if (format.merge_with_parents) { - dom.getParent(node.parentNode, function(parent) { - if (matchNode(parent, name, vars)) { - dom.remove(node, 1); - node = 0; - return TRUE; - } - }); - } - - // Merge next and previous siblings if they are similar texttext becomes texttext - if (node && format.merge_siblings !== false) { - node = mergeSiblings(getNonWhiteSpaceSibling(node), node); - node = mergeSiblings(node, getNonWhiteSpaceSibling(node, TRUE)); - } - } - }); - } - - if (format) { - if (node) { - if (node.nodeType) { - rng = dom.createRng(); - rng.setStartBefore(node); - rng.setEndAfter(node); - applyRngStyle(expandRng(rng, formatList), null, true); - } else { - applyRngStyle(node, null, true); - } - } else { - if (!isCollapsed || !format.inline || dom.select('td.mce-item-selected,th.mce-item-selected').length) { - // Obtain selection node before selection is unselected by applyRngStyle() - var curSelNode = ed.selection.getNode(); - - // If the formats have a default block and we can't find a parent block then - // start wrapping it with a DIV this is for forced_root_blocks: false - // It's kind of a hack but people should be using the default block type P since all desktop editors work that way - if (!forcedRootBlock && formatList[0].defaultBlock && !dom.getParent(curSelNode, dom.isBlock)) { - apply(formatList[0].defaultBlock); - } - - // Apply formatting to selection - ed.selection.setRng(adjustSelectionToVisibleSelection()); - bookmark = selection.getBookmark(); - applyRngStyle(expandRng(selection.getRng(TRUE), formatList), bookmark); - - // Colored nodes should be underlined so that the color of the underline matches the text color. - if (format.styles && (format.styles.color || format.styles.textDecoration)) { - walk(curSelNode, processUnderlineAndColor, 'childNodes'); - processUnderlineAndColor(curSelNode); - } - - selection.moveToBookmark(bookmark); - moveStart(selection.getRng(TRUE)); - ed.nodeChanged(); - } else { - performCaretAction('apply', name, vars); - } - } - } - } - - /** - * Removes the specified format from the current selection or specified node. - * - * @method remove - * @param {String} name Name of format to remove. - * @param {Object} vars Optional list of variables to replace within format before removing it. - * @param {Node/Range} node Optional node or DOM range to remove the format from defaults to current selection. - */ - function remove(name, vars, node) { - var formatList = get(name), format = formatList[0], bookmark, rng, contentEditable = true; - - // Merges the styles for each node - function process(node) { - var children, i, l, lastContentEditable, hasContentEditableState; - - // Node has a contentEditable value - if (node.nodeType === 1 && getContentEditable(node)) { - lastContentEditable = contentEditable; - contentEditable = getContentEditable(node) === "true"; - hasContentEditableState = true; // We don't want to wrap the container only it's children - } - - // Grab the children first since the nodelist might be changed - children = grep(node.childNodes); - - // Process current node - if (contentEditable && !hasContentEditableState) { - for (i = 0, l = formatList.length; i < l; i++) { - if (removeFormat(formatList[i], vars, node, node)) { - break; - } - } - } - - // Process the children - if (format.deep) { - if (children.length) { - for (i = 0, l = children.length; i < l; i++) { - process(children[i]); - } - - if (hasContentEditableState) { - contentEditable = lastContentEditable; // Restore last contentEditable state from stack - } - } - } - } - - function findFormatRoot(container) { - var formatRoot; - - // Find format root - each(getParents(container.parentNode).reverse(), function(parent) { - var format; - - // Find format root element - if (!formatRoot && parent.id != '_start' && parent.id != '_end') { - // Is the node matching the format we are looking for - format = matchNode(parent, name, vars); - if (format && format.split !== false) { - formatRoot = parent; - } - } - }); - - return formatRoot; - } - - function wrapAndSplit(format_root, container, target, split) { - var parent, clone, lastClone, firstClone, i, formatRootParent; - - // Format root found then clone formats and split it - if (format_root) { - formatRootParent = format_root.parentNode; - - for (parent = container.parentNode; parent && parent != formatRootParent; parent = parent.parentNode) { - clone = dom.clone(parent, FALSE); - - for (i = 0; i < formatList.length; i++) { - if (removeFormat(formatList[i], vars, clone, clone)) { - clone = 0; - break; - } - } - - // Build wrapper node - if (clone) { - if (lastClone) { - clone.appendChild(lastClone); - } - - if (!firstClone) { - firstClone = clone; - } - - lastClone = clone; - } - } - - // Never split block elements if the format is mixed - if (split && (!format.mixed || !isBlock(format_root))) { - container = dom.split(format_root, container); - } - - // Wrap container in cloned formats - if (lastClone) { - target.parentNode.insertBefore(lastClone, target); - firstClone.appendChild(target); - } - } - - return container; - } - - function splitToFormatRoot(container) { - return wrapAndSplit(findFormatRoot(container), container, container, true); - } - - function unwrap(start) { - var node = dom.get(start ? '_start' : '_end'), - out = node[start ? 'firstChild' : 'lastChild']; - - // If the end is placed within the start the result will be removed - // So this checks if the out node is a bookmark node if it is it - // checks for another more suitable node - if (isBookmarkNode(out)) { - out = out[start ? 'firstChild' : 'lastChild']; - } - - dom.remove(node, true); - - return out; - } - - function removeRngStyle(rng) { - var startContainer, endContainer; - var commonAncestorContainer = rng.commonAncestorContainer; - - rng = expandRng(rng, formatList, TRUE); - - if (format.split) { - startContainer = getContainer(rng, TRUE); - endContainer = getContainer(rng); - - if (startContainer != endContainer) { - // WebKit will render the table incorrectly if we wrap a TH or TD in a SPAN - // so let's see if we can use the first child instead - // This will happen if you triple click a table cell and use remove formatting - if (/^(TR|TH|TD)$/.test(startContainer.nodeName) && startContainer.firstChild) { - if (startContainer.nodeName == "TR") { - startContainer = startContainer.firstChild.firstChild || startContainer; - } else { - startContainer = startContainer.firstChild || startContainer; - } - } - - // Try to adjust endContainer as well if cells on the same row were selected - bug #6410 - if (commonAncestorContainer && - /^T(HEAD|BODY|FOOT|R)$/.test(commonAncestorContainer.nodeName) && - /^(TH|TD)$/.test(endContainer.nodeName) && endContainer.firstChild) { - endContainer = endContainer.firstChild || endContainer; - } - - // Wrap start/end nodes in span element since these might be cloned/moved - startContainer = wrap(startContainer, 'span', {id: '_start', 'data-mce-type': 'bookmark'}); - endContainer = wrap(endContainer, 'span', {id: '_end', 'data-mce-type': 'bookmark'}); - - // Split start/end - splitToFormatRoot(startContainer); - splitToFormatRoot(endContainer); - - // Unwrap start/end to get real elements again - startContainer = unwrap(TRUE); - endContainer = unwrap(); - } else { - startContainer = endContainer = splitToFormatRoot(startContainer); - } - - // Update range positions since they might have changed after the split operations - rng.startContainer = startContainer.parentNode; - rng.startOffset = nodeIndex(startContainer); - rng.endContainer = endContainer.parentNode; - rng.endOffset = nodeIndex(endContainer) + 1; - } - - // Remove items between start/end - rangeUtils.walk(rng, function(nodes) { - each(nodes, function(node) { - process(node); - - // Remove parent span if it only contains text-decoration: underline, yet a parent node is also underlined. - if (node.nodeType === 1 && ed.dom.getStyle(node, 'text-decoration') === 'underline' && - node.parentNode && getTextDecoration(node.parentNode) === 'underline') { - removeFormat({ - 'deep': false, - 'exact': true, - 'inline': 'span', - 'styles': { - 'textDecoration': 'underline' - } - }, null, node); - } - }); - }); - } - - // Handle node - if (node) { - if (node.nodeType) { - rng = dom.createRng(); - rng.setStartBefore(node); - rng.setEndAfter(node); - removeRngStyle(rng); - } else { - removeRngStyle(node); - } - - return; - } - - if (!selection.isCollapsed() || !format.inline || dom.select('td.mce-item-selected,th.mce-item-selected').length) { - bookmark = selection.getBookmark(); - removeRngStyle(selection.getRng(TRUE)); - selection.moveToBookmark(bookmark); - - // Check if start element still has formatting then we are at: "text|text" - // and need to move the start into the next text node - if (format.inline && match(name, vars, selection.getStart())) { - moveStart(selection.getRng(true)); - } - - ed.nodeChanged(); - } else { - performCaretAction('remove', name, vars); - } - } - - /** - * Toggles the specified format on/off. - * - * @method toggle - * @param {String} name Name of format to apply/remove. - * @param {Object} vars Optional list of variables to replace within format before applying/removing it. - * @param {Node} node Optional node to apply the format to or remove from. Defaults to current selection. - */ - function toggle(name, vars, node) { - var fmt = get(name); - - if (match(name, vars, node) && (!('toggle' in fmt[0]) || fmt[0].toggle)) { - remove(name, vars, node); - } else { - apply(name, vars, node); - } - } - - /** - * Return true/false if the specified node has the specified format. - * - * @method matchNode - * @param {Node} node Node to check the format on. - * @param {String} name Format name to check. - * @param {Object} vars Optional list of variables to replace before checking it. - * @param {Boolean} similar Match format that has similar properties. - * @return {Object} Returns the format object it matches or undefined if it doesn't match. - */ - function matchNode(node, name, vars, similar) { - var formatList = get(name), format, i, classes; - - function matchItems(node, format, item_name) { - var key, value, items = format[item_name], i; - - // Custom match - if (format.onmatch) { - return format.onmatch(node, format, item_name); - } - - // Check all items - if (items) { - // Non indexed object - if (items.length === undef) { - for (key in items) { - if (items.hasOwnProperty(key)) { - if (item_name === 'attributes') { - value = dom.getAttrib(node, key); - } else { - value = getStyle(node, key); - } - - if (similar && !value && !format.exact) { - return; - } - - if ((!similar || format.exact) && !isEq(value, normalizeStyleValue(replaceVars(items[key], vars), key))) { - return; - } - } - } - } else { - // Only one match needed for indexed arrays - for (i = 0; i < items.length; i++) { - if (item_name === 'attributes' ? dom.getAttrib(node, items[i]) : getStyle(node, items[i])) { - return format; - } - } - } - } - - return format; - } - - if (formatList && node) { - // Check each format in list - for (i = 0; i < formatList.length; i++) { - format = formatList[i]; - - // Name name, attributes, styles and classes - if (matchName(node, format) && matchItems(node, format, 'attributes') && matchItems(node, format, 'styles')) { - // Match classes - if ((classes = format.classes)) { - for (i = 0; i < classes.length; i++) { - if (!dom.hasClass(node, classes[i])) { - return; - } - } - } - - return format; - } - } - } - } - - /** - * Matches the current selection or specified node against the specified format name. - * - * @method match - * @param {String} name Name of format to match. - * @param {Object} vars Optional list of variables to replace before checking it. - * @param {Node} node Optional node to check. - * @return {boolean} true/false if the specified selection/node matches the format. - */ - function match(name, vars, node) { - var startNode; - - function matchParents(node) { - var root = dom.getRoot(); - - if (node === root) { - return false; - } - - // Find first node with similar format settings - node = dom.getParent(node, function(node) { - return node.parentNode === root || !!matchNode(node, name, vars, true); - }); - - // Do an exact check on the similar format element - return matchNode(node, name, vars); - } - - // Check specified node - if (node) { - return matchParents(node); - } - - // Check selected node - node = selection.getNode(); - if (matchParents(node)) { - return TRUE; - } - - // Check start node if it's different - startNode = selection.getStart(); - if (startNode != node) { - if (matchParents(startNode)) { - return TRUE; - } - } - - return FALSE; - } - - /** - * Matches the current selection against the array of formats and returns a new array with matching formats. - * - * @method matchAll - * @param {Array} names Name of format to match. - * @param {Object} vars Optional list of variables to replace before checking it. - * @return {Array} Array with matched formats. - */ - function matchAll(names, vars) { - var startElement, matchedFormatNames = [], checkedMap = {}; - - // Check start of selection for formats - startElement = selection.getStart(); - dom.getParent(startElement, function(node) { - var i, name; - - for (i = 0; i < names.length; i++) { - name = names[i]; - - if (!checkedMap[name] && matchNode(node, name, vars)) { - checkedMap[name] = true; - matchedFormatNames.push(name); - } - } - }, dom.getRoot()); - - return matchedFormatNames; - } - - /** - * Returns true/false if the specified format can be applied to the current selection or not. It - * will currently only check the state for selector formats, it returns true on all other format types. - * - * @method canApply - * @param {String} name Name of format to check. - * @return {boolean} true/false if the specified format can be applied to the current selection/node. - */ - function canApply(name) { - var formatList = get(name), startNode, parents, i, x, selector; - - if (formatList) { - startNode = selection.getStart(); - parents = getParents(startNode); - - for (x = formatList.length - 1; x >= 0; x--) { - selector = formatList[x].selector; - - // Format is not selector based then always return TRUE - // Is it has a defaultBlock then it's likely it can be applied for example align on a non block element line - if (!selector || formatList[x].defaultBlock) { - return TRUE; - } - - for (i = parents.length - 1; i >= 0; i--) { - if (dom.is(parents[i], selector)) { - return TRUE; - } - } - } - } - - return FALSE; - } - - /** - * Executes the specified callback when the current selection matches the formats or not. - * - * @method formatChanged - * @param {String} formats Comma separated list of formats to check for. - * @param {function} callback Callback with state and args when the format is changed/toggled on/off. - * @param {Boolean} similar True/false state if the match should handle similar or exact formats. - */ - function formatChanged(formats, callback, similar) { - var currentFormats; - - // Setup format node change logic - if (!formatChangeData) { - formatChangeData = {}; - currentFormats = {}; - - ed.on('NodeChange', function(e) { - var parents = getParents(e.element), matchedFormats = {}; - - // Check for new formats - each(formatChangeData, function(callbacks, format) { - each(parents, function(node) { - if (matchNode(node, format, {}, callbacks.similar)) { - if (!currentFormats[format]) { - // Execute callbacks - each(callbacks, function(callback) { - callback(true, {node: node, format: format, parents: parents}); - }); - - currentFormats[format] = callbacks; - } - - matchedFormats[format] = callbacks; - return false; - } - }); - }); - - // Check if current formats still match - each(currentFormats, function(callbacks, format) { - if (!matchedFormats[format]) { - delete currentFormats[format]; - - each(callbacks, function(callback) { - callback(false, {node: e.element, format: format, parents: parents}); - }); - } - }); - }); - } - - // Add format listeners - each(formats.split(','), function(format) { - if (!formatChangeData[format]) { - formatChangeData[format] = []; - formatChangeData[format].similar = similar; - } - - formatChangeData[format].push(callback); - }); - - return this; - } - - // Expose to public - extend(this, { - get: get, - register: register, - apply: apply, - remove: remove, - toggle: toggle, - match: match, - matchAll: matchAll, - matchNode: matchNode, - canApply: canApply, - formatChanged: formatChanged - }); - - // Initialize - defaultFormats(); - addKeyboardShortcuts(); - ed.on('BeforeGetContent', function() { - if (markCaretContainersBogus) { - markCaretContainersBogus(); - } - }); - ed.on('mouseup keydown', function(e) { - if (disableCaretContainer) { - disableCaretContainer(e); - } - }); - - // Private functions - - /** - * Checks if the specified nodes name matches the format inline/block or selector. - * - * @private - * @param {Node} node Node to match against the specified format. - * @param {Object} format Format object o match with. - * @return {boolean} true/false if the format matches. - */ - function matchName(node, format) { - // Check for inline match - if (isEq(node, format.inline)) { - return TRUE; - } - - // Check for block match - if (isEq(node, format.block)) { - return TRUE; - } - - // Check for selector match - if (format.selector) { - return node.nodeType == 1 && dom.is(node, format.selector); - } - } - - /** - * Compares two string/nodes regardless of their case. - * - * @private - * @param {String/Node} Node or string to compare. - * @param {String/Node} Node or string to compare. - * @return {boolean} True/false if they match. - */ - function isEq(str1, str2) { - str1 = str1 || ''; - str2 = str2 || ''; - - str1 = '' + (str1.nodeName || str1); - str2 = '' + (str2.nodeName || str2); - - return str1.toLowerCase() == str2.toLowerCase(); - } - - /** - * Returns the style by name on the specified node. This method modifies the style - * contents to make it more easy to match. This will resolve a few browser issues. - * - * @private - * @param {Node} node to get style from. - * @param {String} name Style name to get. - * @return {String} Style item value. - */ - function getStyle(node, name) { - return normalizeStyleValue(dom.getStyle(node, name), name); - } - - /** - * Normalize style value by name. This method modifies the style contents - * to make it more easy to match. This will resolve a few browser issues. - * - * @private - * @param {Node} node to get style from. - * @param {String} name Style name to get. - * @return {String} Style item value. - */ - function normalizeStyleValue(value, name) { - // Force the format to hex - if (name == 'color' || name == 'backgroundColor') { - value = dom.toHex(value); - } - - // Opera will return bold as 700 - if (name == 'fontWeight' && value == 700) { - value = 'bold'; - } - - // Normalize fontFamily so "'Font name', Font" becomes: "Font name,Font" - if (name == 'fontFamily') { - value = value.replace(/[\'\"]/g, '').replace(/,\s+/g, ','); - } - - return '' + value; - } - - /** - * Replaces variables in the value. The variable format is %var. - * - * @private - * @param {String} value Value to replace variables in. - * @param {Object} vars Name/value array with variables to replace. - * @return {String} New value with replaced variables. - */ - function replaceVars(value, vars) { - if (typeof(value) != "string") { - value = value(vars); - } else if (vars) { - value = value.replace(/%(\w+)/g, function(str, name) { - return vars[name] || str; - }); - } - - return value; - } - - function isWhiteSpaceNode(node) { - return node && node.nodeType === 3 && /^([\t \r\n]+|)$/.test(node.nodeValue); - } - - function wrap(node, name, attrs) { - var wrapper = dom.create(name, attrs); - - node.parentNode.insertBefore(wrapper, node); - wrapper.appendChild(node); - - return wrapper; - } - - /** - * Expands the specified range like object to depending on format. - * - * For example on block formats it will move the start/end position - * to the beginning of the current block. - * - * @private - * @param {Object} rng Range like object. - * @param {Array} formats Array with formats to expand by. - * @return {Object} Expanded range like object. - */ - function expandRng(rng, format, remove) { - var lastIdx, leaf, endPoint, - startContainer = rng.startContainer, - startOffset = rng.startOffset, - endContainer = rng.endContainer, - endOffset = rng.endOffset; - - // This function walks up the tree if there is no siblings before/after the node - function findParentContainer(start) { - var container, parent, sibling, siblingName, root; - - container = parent = start ? startContainer : endContainer; - siblingName = start ? 'previousSibling' : 'nextSibling'; - root = dom.getRoot(); - - function isBogusBr(node) { - return node.nodeName == "BR" && node.getAttribute('data-mce-bogus') && !node.nextSibling; - } - - // If it's a text node and the offset is inside the text - if (container.nodeType == 3 && !isWhiteSpaceNode(container)) { - if (start ? startOffset > 0 : endOffset < container.nodeValue.length) { - return container; - } - } - - /*eslint no-constant-condition:0 */ - while (true) { - // Stop expanding on block elements - if (!format[0].block_expand && isBlock(parent)) { - return parent; - } - - // Walk left/right - for (sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) { - if (!isBookmarkNode(sibling) && !isWhiteSpaceNode(sibling) && !isBogusBr(sibling)) { - return parent; - } - } - - // Check if we can move up are we at root level or body level - if (parent.parentNode == root) { - container = parent; - break; - } - - parent = parent.parentNode; - } - - return container; - } - - // This function walks down the tree to find the leaf at the selection. - // The offset is also returned as if node initially a leaf, the offset may be in the middle of the text node. - function findLeaf(node, offset) { - if (offset === undef) { - offset = node.nodeType === 3 ? node.length : node.childNodes.length; - } - - while (node && node.hasChildNodes()) { - node = node.childNodes[offset]; - if (node) { - offset = node.nodeType === 3 ? node.length : node.childNodes.length; - } - } - return { node: node, offset: offset }; - } - - // If index based start position then resolve it - if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) { - lastIdx = startContainer.childNodes.length - 1; - startContainer = startContainer.childNodes[startOffset > lastIdx ? lastIdx : startOffset]; - - if (startContainer.nodeType == 3) { - startOffset = 0; - } - } - - // If index based end position then resolve it - if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) { - lastIdx = endContainer.childNodes.length - 1; - endContainer = endContainer.childNodes[endOffset > lastIdx ? lastIdx : endOffset - 1]; - - if (endContainer.nodeType == 3) { - endOffset = endContainer.nodeValue.length; - } - } - - // Expands the node to the closes contentEditable false element if it exists - function findParentContentEditable(node) { - var parent = node; - - while (parent) { - if (parent.nodeType === 1 && getContentEditable(parent)) { - return getContentEditable(parent) === "false" ? parent : node; - } - - parent = parent.parentNode; - } - - return node; - } - - function findWordEndPoint(container, offset, start) { - var walker, node, pos, lastTextNode; - - function findSpace(node, offset) { - var pos, pos2, str = node.nodeValue; - - if (typeof(offset) == "undefined") { - offset = start ? str.length : 0; - } - - if (start) { - pos = str.lastIndexOf(' ', offset); - pos2 = str.lastIndexOf('\u00a0', offset); - pos = pos > pos2 ? pos : pos2; - - // Include the space on remove to avoid tag soup - if (pos !== -1 && !remove) { - pos++; - } - } else { - pos = str.indexOf(' ', offset); - pos2 = str.indexOf('\u00a0', offset); - pos = pos !== -1 && (pos2 === -1 || pos < pos2) ? pos : pos2; - } - - return pos; - } - - if (container.nodeType === 3) { - pos = findSpace(container, offset); - - if (pos !== -1) { - return {container: container, offset: pos}; - } - - lastTextNode = container; - } - - // Walk the nodes inside the block - walker = new TreeWalker(container, dom.getParent(container, isBlock) || ed.getBody()); - while ((node = walker[start ? 'prev' : 'next']())) { - if (node.nodeType === 3) { - lastTextNode = node; - pos = findSpace(node); - - if (pos !== -1) { - return {container: node, offset: pos}; - } - } else if (isBlock(node)) { - break; - } - } - - if (lastTextNode) { - if (start) { - offset = 0; - } else { - offset = lastTextNode.length; - } - - return {container: lastTextNode, offset: offset}; - } - } - - function findSelectorEndPoint(container, sibling_name) { - var parents, i, y, curFormat; - - if (container.nodeType == 3 && container.nodeValue.length === 0 && container[sibling_name]) { - container = container[sibling_name]; - } - - parents = getParents(container); - for (i = 0; i < parents.length; i++) { - for (y = 0; y < format.length; y++) { - curFormat = format[y]; - - // If collapsed state is set then skip formats that doesn't match that - if ("collapsed" in curFormat && curFormat.collapsed !== rng.collapsed) { - continue; - } - - if (dom.is(parents[i], curFormat.selector)) { - return parents[i]; - } - } - } - - return container; - } - - function findBlockEndPoint(container, sibling_name) { - var node, root = dom.getRoot(); - - // Expand to block of similar type - if (!format[0].wrapper) { - node = dom.getParent(container, format[0].block, root); - } - - // Expand to first wrappable block element or any block element - if (!node) { - node = dom.getParent(container.nodeType == 3 ? container.parentNode : container, function(node) { - // Fixes #6183 where it would expand to editable parent element in inline mode - return node != root && isTextBlock(node); - }); - } - - // Exclude inner lists from wrapping - if (node && format[0].wrapper) { - node = getParents(node, 'ul,ol').reverse()[0] || node; - } - - // Didn't find a block element look for first/last wrappable element - if (!node) { - node = container; - - while (node[sibling_name] && !isBlock(node[sibling_name])) { - node = node[sibling_name]; - - // Break on BR but include it will be removed later on - // we can't remove it now since we need to check if it can be wrapped - if (isEq(node, 'br')) { - break; - } - } - } - - return node || container; - } - - // Expand to closest contentEditable element - startContainer = findParentContentEditable(startContainer); - endContainer = findParentContentEditable(endContainer); - - // Exclude bookmark nodes if possible - if (isBookmarkNode(startContainer.parentNode) || isBookmarkNode(startContainer)) { - startContainer = isBookmarkNode(startContainer) ? startContainer : startContainer.parentNode; - startContainer = startContainer.nextSibling || startContainer; - - if (startContainer.nodeType == 3) { - startOffset = 0; - } - } - - if (isBookmarkNode(endContainer.parentNode) || isBookmarkNode(endContainer)) { - endContainer = isBookmarkNode(endContainer) ? endContainer : endContainer.parentNode; - endContainer = endContainer.previousSibling || endContainer; - - if (endContainer.nodeType == 3) { - endOffset = endContainer.length; - } - } - - if (format[0].inline) { - if (rng.collapsed) { - // Expand left to closest word boundary - endPoint = findWordEndPoint(startContainer, startOffset, true); - if (endPoint) { - startContainer = endPoint.container; - startOffset = endPoint.offset; - } - - // Expand right to closest word boundary - endPoint = findWordEndPoint(endContainer, endOffset); - if (endPoint) { - endContainer = endPoint.container; - endOffset = endPoint.offset; - } - } - - // Avoid applying formatting to a trailing space. - leaf = findLeaf(endContainer, endOffset); - if (leaf.node) { - while (leaf.node && leaf.offset === 0 && leaf.node.previousSibling) { - leaf = findLeaf(leaf.node.previousSibling); - } - - if (leaf.node && leaf.offset > 0 && leaf.node.nodeType === 3 && - leaf.node.nodeValue.charAt(leaf.offset - 1) === ' ') { - - if (leaf.offset > 1) { - endContainer = leaf.node; - endContainer.splitText(leaf.offset - 1); - } - } - } - } - - // Move start/end point up the tree if the leaves are sharp and if we are in different containers - // Example * becomes !: !

*texttext*

! - // This will reduce the number of wrapper elements that needs to be created - // Move start point up the tree - if (format[0].inline || format[0].block_expand) { - if (!format[0].inline || (startContainer.nodeType != 3 || startOffset === 0)) { - startContainer = findParentContainer(true); - } - - if (!format[0].inline || (endContainer.nodeType != 3 || endOffset === endContainer.nodeValue.length)) { - endContainer = findParentContainer(); - } - } - - // Expand start/end container to matching selector - if (format[0].selector && format[0].expand !== FALSE && !format[0].inline) { - // Find new startContainer/endContainer if there is better one - startContainer = findSelectorEndPoint(startContainer, 'previousSibling'); - endContainer = findSelectorEndPoint(endContainer, 'nextSibling'); - } - - // Expand start/end container to matching block element or text node - if (format[0].block || format[0].selector) { - // Find new startContainer/endContainer if there is better one - startContainer = findBlockEndPoint(startContainer, 'previousSibling'); - endContainer = findBlockEndPoint(endContainer, 'nextSibling'); - - // Non block element then try to expand up the leaf - if (format[0].block) { - if (!isBlock(startContainer)) { - startContainer = findParentContainer(true); - } - - if (!isBlock(endContainer)) { - endContainer = findParentContainer(); - } - } - } - - // Setup index for startContainer - if (startContainer.nodeType == 1) { - startOffset = nodeIndex(startContainer); - startContainer = startContainer.parentNode; - } - - // Setup index for endContainer - if (endContainer.nodeType == 1) { - endOffset = nodeIndex(endContainer) + 1; - endContainer = endContainer.parentNode; - } - - // Return new range like object - return { - startContainer: startContainer, - startOffset: startOffset, - endContainer: endContainer, - endOffset: endOffset - }; - } - - /** - * Removes the specified format for the specified node. It will also remove the node if it doesn't have - * any attributes if the format specifies it to do so. - * - * @private - * @param {Object} format Format object with items to remove from node. - * @param {Object} vars Name/value object with variables to apply to format. - * @param {Node} node Node to remove the format styles on. - * @param {Node} compare_node Optional compare node, if specified the styles will be compared to that node. - * @return {Boolean} True/false if the node was removed or not. - */ - function removeFormat(format, vars, node, compare_node) { - var i, attrs, stylesModified; - - // Check if node matches format - if (!matchName(node, format)) { - return FALSE; - } - - // Should we compare with format attribs and styles - if (format.remove != 'all') { - // Remove styles - each(format.styles, function(value, name) { - value = normalizeStyleValue(replaceVars(value, vars), name); - - // Indexed array - if (typeof(name) === 'number') { - name = value; - compare_node = 0; - } - - if (!compare_node || isEq(getStyle(compare_node, name), value)) { - dom.setStyle(node, name, ''); - } - - stylesModified = 1; - }); - - // Remove style attribute if it's empty - if (stylesModified && dom.getAttrib(node, 'style') === '') { - node.removeAttribute('style'); - node.removeAttribute('data-mce-style'); - } - - // Remove attributes - each(format.attributes, function(value, name) { - var valueOut; - - value = replaceVars(value, vars); - - // Indexed array - if (typeof(name) === 'number') { - name = value; - compare_node = 0; - } - - if (!compare_node || isEq(dom.getAttrib(compare_node, name), value)) { - // Keep internal classes - if (name == 'class') { - value = dom.getAttrib(node, name); - if (value) { - // Build new class value where everything is removed except the internal prefixed classes - valueOut = ''; - each(value.split(/\s+/), function(cls) { - if (/mce\w+/.test(cls)) { - valueOut += (valueOut ? ' ' : '') + cls; - } - }); - - // We got some internal classes left - if (valueOut) { - dom.setAttrib(node, name, valueOut); - return; - } - } - } - - // IE6 has a bug where the attribute doesn't get removed correctly - if (name == "class") { - node.removeAttribute('className'); - } - - // Remove mce prefixed attributes - if (MCE_ATTR_RE.test(name)) { - node.removeAttribute('data-mce-' + name); - } - - node.removeAttribute(name); - } - }); - - // Remove classes - each(format.classes, function(value) { - value = replaceVars(value, vars); - - if (!compare_node || dom.hasClass(compare_node, value)) { - dom.removeClass(node, value); - } - }); - - // Check for non internal attributes - attrs = dom.getAttribs(node); - for (i = 0; i < attrs.length; i++) { - if (attrs[i].nodeName.indexOf('_') !== 0) { - return FALSE; - } - } - } - - // Remove the inline child if it's empty for example or - if (format.remove != 'none') { - removeNode(node, format); - return TRUE; - } - } - - /** - * Removes the node and wrap it's children in paragraphs before doing so or - * appends BR elements to the beginning/end of the block element if forcedRootBlocks is disabled. - * - * If the div in the node below gets removed: - * text
text
text - * - * Output becomes: - * text

text
text - * - * So when the div is removed the result is: - * text
text
text - * - * @private - * @param {Node} node Node to remove + apply BR/P elements to. - * @param {Object} format Format rule. - * @return {Node} Input node. - */ - function removeNode(node, format) { - var parentNode = node.parentNode, rootBlockElm; - - function find(node, next, inc) { - node = getNonWhiteSpaceSibling(node, next, inc); - - return !node || (node.nodeName == 'BR' || isBlock(node)); - } - - if (format.block) { - if (!forcedRootBlock) { - // Append BR elements if needed before we remove the block - if (isBlock(node) && !isBlock(parentNode)) { - if (!find(node, FALSE) && !find(node.firstChild, TRUE, 1)) { - node.insertBefore(dom.create('br'), node.firstChild); - } - - if (!find(node, TRUE) && !find(node.lastChild, FALSE, 1)) { - node.appendChild(dom.create('br')); - } - } - } else { - // Wrap the block in a forcedRootBlock if we are at the root of document - if (parentNode == dom.getRoot()) { - if (!format.list_block || !isEq(node, format.list_block)) { - each(grep(node.childNodes), function(node) { - if (isValid(forcedRootBlock, node.nodeName.toLowerCase())) { - if (!rootBlockElm) { - rootBlockElm = wrap(node, forcedRootBlock); - dom.setAttribs(rootBlockElm, ed.settings.forced_root_block_attrs); - } else { - rootBlockElm.appendChild(node); - } - } else { - rootBlockElm = 0; - } - }); - } - } - } - } - - // Never remove nodes that isn't the specified inline element if a selector is specified too - if (format.selector && format.inline && !isEq(format.inline, node)) { - return; - } - - dom.remove(node, 1); - } - - /** - * Returns the next/previous non whitespace node. - * - * @private - * @param {Node} node Node to start at. - * @param {boolean} next (Optional) Include next or previous node defaults to previous. - * @param {boolean} inc (Optional) Include the current node in checking. Defaults to false. - * @return {Node} Next or previous node or undefined if it wasn't found. - */ - function getNonWhiteSpaceSibling(node, next, inc) { - if (node) { - next = next ? 'nextSibling' : 'previousSibling'; - - for (node = inc ? node : node[next]; node; node = node[next]) { - if (node.nodeType == 1 || !isWhiteSpaceNode(node)) { - return node; - } - } - } - } - - /** - * Checks if the specified node is a bookmark node or not. - * - * @private - * @param {Node} node Node to check if it's a bookmark node or not. - * @return {Boolean} true/false if the node is a bookmark node. - */ - function isBookmarkNode(node) { - return node && node.nodeType == 1 && node.getAttribute('data-mce-type') == 'bookmark'; - } - - /** - * Merges the next/previous sibling element if they match. - * - * @private - * @param {Node} prev Previous node to compare/merge. - * @param {Node} next Next node to compare/merge. - * @return {Node} Next node if we didn't merge and prev node if we did. - */ - function mergeSiblings(prev, next) { - var sibling, tmpSibling; - - /** - * Compares two nodes and checks if it's attributes and styles matches. - * This doesn't compare classes as items since their order is significant. - * - * @private - * @param {Node} node1 First node to compare with. - * @param {Node} node2 Second node to compare with. - * @return {boolean} True/false if the nodes are the same or not. - */ - function compareElements(node1, node2) { - // Not the same name - if (node1.nodeName != node2.nodeName) { - return FALSE; - } - - /** - * Returns all the nodes attributes excluding internal ones, styles and classes. - * - * @private - * @param {Node} node Node to get attributes from. - * @return {Object} Name/value object with attributes and attribute values. - */ - function getAttribs(node) { - var attribs = {}; - - each(dom.getAttribs(node), function(attr) { - var name = attr.nodeName.toLowerCase(); - - // Don't compare internal attributes or style - if (name.indexOf('_') !== 0 && name !== 'style' && name !== 'data-mce-style') { - attribs[name] = dom.getAttrib(node, name); - } - }); - - return attribs; - } - - /** - * Compares two objects checks if it's key + value exists in the other one. - * - * @private - * @param {Object} obj1 First object to compare. - * @param {Object} obj2 Second object to compare. - * @return {boolean} True/false if the objects matches or not. - */ - function compareObjects(obj1, obj2) { - var value, name; - - for (name in obj1) { - // Obj1 has item obj2 doesn't have - if (obj1.hasOwnProperty(name)) { - value = obj2[name]; - - // Obj2 doesn't have obj1 item - if (value === undef) { - return FALSE; - } - - // Obj2 item has a different value - if (obj1[name] != value) { - return FALSE; - } - - // Delete similar value - delete obj2[name]; - } - } - - // Check if obj 2 has something obj 1 doesn't have - for (name in obj2) { - // Obj2 has item obj1 doesn't have - if (obj2.hasOwnProperty(name)) { - return FALSE; - } - } - - return TRUE; - } - - // Attribs are not the same - if (!compareObjects(getAttribs(node1), getAttribs(node2))) { - return FALSE; - } - - // Styles are not the same - if (!compareObjects(dom.parseStyle(dom.getAttrib(node1, 'style')), dom.parseStyle(dom.getAttrib(node2, 'style')))) { - return FALSE; - } - - return !isBookmarkNode(node1) && !isBookmarkNode(node2); - } - - function findElementSibling(node, sibling_name) { - for (sibling = node; sibling; sibling = sibling[sibling_name]) { - if (sibling.nodeType == 3 && sibling.nodeValue.length !== 0) { - return node; - } - - if (sibling.nodeType == 1 && !isBookmarkNode(sibling)) { - return sibling; - } - } - - return node; - } - - // Check if next/prev exists and that they are elements - if (prev && next) { - // If previous sibling is empty then jump over it - prev = findElementSibling(prev, 'previousSibling'); - next = findElementSibling(next, 'nextSibling'); - - // Compare next and previous nodes - if (compareElements(prev, next)) { - // Append nodes between - for (sibling = prev.nextSibling; sibling && sibling != next;) { - tmpSibling = sibling; - sibling = sibling.nextSibling; - prev.appendChild(tmpSibling); - } - - // Remove next node - dom.remove(next); - - // Move children into prev node - each(grep(next.childNodes), function(node) { - prev.appendChild(node); - }); - - return prev; - } - } - - return next; - } - - function getContainer(rng, start) { - var container, offset, lastIdx; - - container = rng[start ? 'startContainer' : 'endContainer']; - offset = rng[start ? 'startOffset' : 'endOffset']; - - if (container.nodeType == 1) { - lastIdx = container.childNodes.length - 1; - - if (!start && offset) { - offset--; - } - - container = container.childNodes[offset > lastIdx ? lastIdx : offset]; - } - - // If start text node is excluded then walk to the next node - if (container.nodeType === 3 && start && offset >= container.nodeValue.length) { - container = new TreeWalker(container, ed.getBody()).next() || container; - } - - // If end text node is excluded then walk to the previous node - if (container.nodeType === 3 && !start && offset === 0) { - container = new TreeWalker(container, ed.getBody()).prev() || container; - } - - return container; - } - - function performCaretAction(type, name, vars) { - var caretContainerId = '_mce_caret', debug = ed.settings.caret_debug; - - // Creates a caret container bogus element - function createCaretContainer(fill) { - var caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style: debug ? 'color:red' : ''}); - - if (fill) { - caretContainer.appendChild(ed.getDoc().createTextNode(INVISIBLE_CHAR)); - } - - return caretContainer; - } - - function isCaretContainerEmpty(node, nodes) { - while (node) { - if ((node.nodeType === 3 && node.nodeValue !== INVISIBLE_CHAR) || node.childNodes.length > 1) { - return false; - } - - // Collect nodes - if (nodes && node.nodeType === 1) { - nodes.push(node); - } - - node = node.firstChild; - } - - return true; - } - - // Returns any parent caret container element - function getParentCaretContainer(node) { - while (node) { - if (node.id === caretContainerId) { - return node; - } - - node = node.parentNode; - } - } - - // Finds the first text node in the specified node - function findFirstTextNode(node) { - var walker; - - if (node) { - walker = new TreeWalker(node, node); - - for (node = walker.current(); node; node = walker.next()) { - if (node.nodeType === 3) { - return node; - } - } - } - } - - // Removes the caret container for the specified node or all on the current document - function removeCaretContainer(node, move_caret) { - var child, rng; - - if (!node) { - node = getParentCaretContainer(selection.getStart()); - - if (!node) { - while ((node = dom.get(caretContainerId))) { - removeCaretContainer(node, false); - } - } - } else { - rng = selection.getRng(true); - - if (isCaretContainerEmpty(node)) { - if (move_caret !== false) { - rng.setStartBefore(node); - rng.setEndBefore(node); - } - - dom.remove(node); - } else { - child = findFirstTextNode(node); - - if (child.nodeValue.charAt(0) === INVISIBLE_CHAR) { - child = child.deleteData(0, 1); - } - - dom.remove(node, 1); - } - - selection.setRng(rng); - } - } - - // Applies formatting to the caret postion - function applyCaretFormat() { - var rng, caretContainer, textNode, offset, bookmark, container, text; - - rng = selection.getRng(true); - offset = rng.startOffset; - container = rng.startContainer; - text = container.nodeValue; - - caretContainer = getParentCaretContainer(selection.getStart()); - if (caretContainer) { - textNode = findFirstTextNode(caretContainer); - } - - // Expand to word is caret is in the middle of a text node and the char before/after is a alpha numeric character - if (text && offset > 0 && offset < text.length && /\w/.test(text.charAt(offset)) && /\w/.test(text.charAt(offset - 1))) { - // Get bookmark of caret position - bookmark = selection.getBookmark(); - - // Collapse bookmark range (WebKit) - rng.collapse(true); - - // Expand the range to the closest word and split it at those points - rng = expandRng(rng, get(name)); - rng = rangeUtils.split(rng); - - // Apply the format to the range - apply(name, vars, rng); - - // Move selection back to caret position - selection.moveToBookmark(bookmark); - } else { - if (!caretContainer || textNode.nodeValue !== INVISIBLE_CHAR) { - caretContainer = createCaretContainer(true); - textNode = caretContainer.firstChild; - - rng.insertNode(caretContainer); - offset = 1; - - apply(name, vars, caretContainer); - } else { - apply(name, vars, caretContainer); - } - - // Move selection to text node - selection.setCursorLocation(textNode, offset); - } - } - - function removeCaretFormat() { - var rng = selection.getRng(true), container, offset, bookmark, - hasContentAfter, node, formatNode, parents = [], i, caretContainer; - - container = rng.startContainer; - offset = rng.startOffset; - node = container; - - if (container.nodeType == 3) { - if (offset != container.nodeValue.length || container.nodeValue === INVISIBLE_CHAR) { - hasContentAfter = true; - } - - node = node.parentNode; - } - - while (node) { - if (matchNode(node, name, vars)) { - formatNode = node; - break; - } - - if (node.nextSibling) { - hasContentAfter = true; - } - - parents.push(node); - node = node.parentNode; - } - - // Node doesn't have the specified format - if (!formatNode) { - return; - } - - // Is there contents after the caret then remove the format on the element - if (hasContentAfter) { - // Get bookmark of caret position - bookmark = selection.getBookmark(); - - // Collapse bookmark range (WebKit) - rng.collapse(true); - - // Expand the range to the closest word and split it at those points - rng = expandRng(rng, get(name), true); - rng = rangeUtils.split(rng); - - // Remove the format from the range - remove(name, vars, rng); - - // Move selection back to caret position - selection.moveToBookmark(bookmark); - } else { - caretContainer = createCaretContainer(); - - node = caretContainer; - for (i = parents.length - 1; i >= 0; i--) { - node.appendChild(dom.clone(parents[i], false)); - node = node.firstChild; - } - - // Insert invisible character into inner most format element - node.appendChild(dom.doc.createTextNode(INVISIBLE_CHAR)); - node = node.firstChild; - - var block = dom.getParent(formatNode, isTextBlock); - - if (block && dom.isEmpty(block)) { - // Replace formatNode with caretContainer when removing format from empty block like

|

- formatNode.parentNode.replaceChild(caretContainer, formatNode); - } else { - // Insert caret container after the formated node - dom.insertAfter(caretContainer, formatNode); - } - - // Move selection to text node - selection.setCursorLocation(node, 1); - - // If the formatNode is empty, we can remove it safely. - if (dom.isEmpty(formatNode)) { - dom.remove(formatNode); - } - } - } - - // Checks if the parent caret container node isn't empty if that is the case it - // will remove the bogus state on all children that isn't empty - function unmarkBogusCaretParents() { - var caretContainer; - - caretContainer = getParentCaretContainer(selection.getStart()); - if (caretContainer && !dom.isEmpty(caretContainer)) { - walk(caretContainer, function(node) { - if (node.nodeType == 1 && node.id !== caretContainerId && !dom.isEmpty(node)) { - dom.setAttrib(node, 'data-mce-bogus', null); - } - }, 'childNodes'); - } - } - - // Only bind the caret events once - if (!ed._hasCaretEvents) { - // Mark current caret container elements as bogus when getting the contents so we don't end up with empty elements - markCaretContainersBogus = function() { - var nodes = [], i; - - if (isCaretContainerEmpty(getParentCaretContainer(selection.getStart()), nodes)) { - // Mark children - i = nodes.length; - while (i--) { - dom.setAttrib(nodes[i], 'data-mce-bogus', '1'); - } - } - }; - - disableCaretContainer = function(e) { - var keyCode = e.keyCode; - - removeCaretContainer(); - - // Remove caret container on keydown and it's a backspace, enter or left/right arrow keys - if (keyCode == 8 || keyCode == 37 || keyCode == 39) { - removeCaretContainer(getParentCaretContainer(selection.getStart())); - } - - unmarkBogusCaretParents(); - }; - - // Remove bogus state if they got filled by contents using editor.selection.setContent - ed.on('SetContent', function(e) { - if (e.selection) { - unmarkBogusCaretParents(); - } - }); - ed._hasCaretEvents = true; - } - - // Do apply or remove caret format - if (type == "apply") { - applyCaretFormat(); - } else { - removeCaretFormat(); - } - } - - /** - * Moves the start to the first suitable text node. - */ - function moveStart(rng) { - var container = rng.startContainer, - offset = rng.startOffset, isAtEndOfText, - walker, node, nodes, tmpNode; - - // Convert text node into index if possible - if (container.nodeType == 3 && offset >= container.nodeValue.length) { - // Get the parent container location and walk from there - offset = nodeIndex(container); - container = container.parentNode; - isAtEndOfText = true; - } - - // Move startContainer/startOffset in to a suitable node - if (container.nodeType == 1) { - nodes = container.childNodes; - container = nodes[Math.min(offset, nodes.length - 1)]; - walker = new TreeWalker(container, dom.getParent(container, dom.isBlock)); - - // If offset is at end of the parent node walk to the next one - if (offset > nodes.length - 1 || isAtEndOfText) { - walker.next(); - } - - for (node = walker.current(); node; node = walker.next()) { - if (node.nodeType == 3 && !isWhiteSpaceNode(node)) { - // IE has a "neat" feature where it moves the start node into the closest element - // we can avoid this by inserting an element before it and then remove it after we set the selection - tmpNode = dom.create('a', null, INVISIBLE_CHAR); - node.parentNode.insertBefore(tmpNode, node); - - // Set selection and remove tmpNode - rng.setStart(node, 0); - selection.setRng(rng); - dom.remove(tmpNode); - - return; - } - } - } - } - }; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/LegacyInput.js b/common/static/js/vendor/tinymce/js/tinymce/classes/LegacyInput.js deleted file mode 100755 index 2f3f55985c66..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/LegacyInput.js +++ /dev/null @@ -1,73 +0,0 @@ -/** - * LegacyInput.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("tinymce/LegacyInput", [ - "tinymce/EditorManager", - "tinymce/util/Tools" -], function(EditorManager, Tools) { - var each = Tools.each, explode = Tools.explode; - - EditorManager.on('AddEditor', function(e) { - var editor = e.editor; - - editor.on('preInit', function() { - var filters, fontSizes, dom, settings = editor.settings; - - function replaceWithSpan(node, styles) { - each(styles, function(value, name) { - if (value) { - dom.setStyle(node, name, value); - } - }); - - dom.rename(node, 'span'); - } - - function convert(e) { - dom = editor.dom; - - if (settings.convert_fonts_to_spans) { - each(dom.select('font,u,strike', e.node), function(node) { - filters[node.nodeName.toLowerCase()](dom, node); - }); - } - } - - if (settings.inline_styles) { - fontSizes = explode(settings.font_size_legacy_values); - - filters = { - font: function(dom, node) { - replaceWithSpan(node, { - backgroundColor: node.style.backgroundColor, - color: node.color, - fontFamily: node.face, - fontSize: fontSizes[parseInt(node.size, 10) - 1] - }); - }, - - u: function(dom, node) { - replaceWithSpan(node, { - textDecoration: 'underline' - }); - }, - - strike: function(dom, node) { - replaceWithSpan(node, { - textDecoration: 'line-through' - }); - } - }; - - editor.on('PreProcess SetContent', convert); - } - }); - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/Shortcuts.js b/common/static/js/vendor/tinymce/js/tinymce/classes/Shortcuts.js deleted file mode 100755 index 03051d8e5ef5..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/Shortcuts.js +++ /dev/null @@ -1,111 +0,0 @@ -/** - * Shortcuts.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Contains all logic for handling of keyboard shortcuts. - */ -define("tinymce/Shortcuts", [ - "tinymce/util/Tools", - "tinymce/Env" -], function(Tools, Env) { - var each = Tools.each, explode = Tools.explode; - - var keyCodeLookup = { - "f9": 120, - "f10": 121, - "f11": 122 - }; - - return function(editor) { - var self = this, shortcuts = {}; - - editor.on('keyup keypress keydown', function(e) { - if (e.altKey || e.ctrlKey || e.metaKey) { - each(shortcuts, function(shortcut) { - var ctrlKey = Env.mac ? e.metaKey : e.ctrlKey; - - if (shortcut.ctrl != ctrlKey || shortcut.alt != e.altKey || shortcut.shift != e.shiftKey) { - return; - } - - if (e.keyCode == shortcut.keyCode || (e.charCode && e.charCode == shortcut.charCode)) { - e.preventDefault(); - - if (e.type == "keydown") { - shortcut.func.call(shortcut.scope); - } - - return true; - } - }); - } - }); - - /** - * Adds a keyboard shortcut for some command or function. - * - * @method addShortcut - * @param {String} pattern Shortcut pattern. Like for example: ctrl+alt+o. - * @param {String} desc Text description for the command. - * @param {String/Function} cmdFunc Command name string or function to execute when the key is pressed. - * @param {Object} sc Optional scope to execute the function in. - * @return {Boolean} true/false state if the shortcut was added or not. - */ - self.add = function(pattern, desc, cmdFunc, scope) { - var cmd; - - cmd = cmdFunc; - - if (typeof(cmdFunc) === 'string') { - cmdFunc = function() { - editor.execCommand(cmd, false, null); - }; - } else if (Tools.isArray(cmd)) { - cmdFunc = function() { - editor.execCommand(cmd[0], cmd[1], cmd[2]); - }; - } - - each(explode(pattern.toLowerCase()), function(pattern) { - var shortcut = { - func: cmdFunc, - scope: scope || editor, - desc: editor.translate(desc), - alt: false, - ctrl: false, - shift: false - }; - - each(explode(pattern, '+'), function(value) { - switch (value) { - case 'alt': - case 'ctrl': - case 'shift': - shortcut[value] = true; - break; - - default: - shortcut.charCode = value.charCodeAt(0); - shortcut.keyCode = keyCodeLookup[value] || value.toUpperCase().charCodeAt(0); - } - }); - - shortcuts[ - (shortcut.ctrl ? 'ctrl' : '') + ',' + - (shortcut.alt ? 'alt' : '') + ',' + - (shortcut.shift ? 'shift' : '') + ',' + - shortcut.keyCode - ] = shortcut; - }); - - return true; - }; - }; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/UndoManager.js b/common/static/js/vendor/tinymce/js/tinymce/classes/UndoManager.js deleted file mode 100755 index ebe43b4b83c8..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/UndoManager.js +++ /dev/null @@ -1,337 +0,0 @@ -/** - * UndoManager.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class handles the undo/redo history levels for the editor. Since the build in undo/redo has major drawbacks a custom one was needed. - * - * @class tinymce.UndoManager - */ -define("tinymce/UndoManager", [ - "tinymce/Env", - "tinymce/util/Tools" -], function(Env, Tools) { - var trim = Tools.trim, trimContentRegExp; - - trimContentRegExp = new RegExp([ - ']+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\\/span>', // Trim bogus spans like caret containers - ']+data-mce-bogus[^>]+><\\/div>', // Trim bogus divs like resize handles - '\\s?data-mce-selected="[^"]+"' // Trim temporaty data-mce prefixed attributes like data-mce-selected - ].join('|'), 'gi'); - - return function(editor) { - var self = this, index = 0, data = [], beforeBookmark, isFirstTypedCharacter, lock; - - // Returns a trimmed version of the current editor contents - function getContent() { - return trim(editor.getContent({format: 'raw', no_events: 1}).replace(trimContentRegExp, '')); - } - - function addNonTypingUndoLevel(e) { - self.typing = false; - self.add({}, e); - } - - // Add initial undo level when the editor is initialized - editor.on('init', function() { - self.add(); - }); - - // Get position before an execCommand is processed - editor.on('BeforeExecCommand', function(e) { - var cmd = e.command; - - if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint') { - self.beforeChange(); - } - }); - - // Add undo level after an execCommand call was made - editor.on('ExecCommand', function(e) { - var cmd = e.command; - - if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint') { - addNonTypingUndoLevel(e); - } - }); - - editor.on('ObjectResizeStart', function() { - self.beforeChange(); - }); - - editor.on('SaveContent ObjectResized blur', addNonTypingUndoLevel); - editor.dom.bind(editor.dom.getRoot(), 'dragend', addNonTypingUndoLevel); - - editor.on('KeyUp', function(e) { - var keyCode = e.keyCode; - - if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 45 || keyCode == 13 || e.ctrlKey) { - addNonTypingUndoLevel(); - editor.nodeChanged(); - } - - if (keyCode == 46 || keyCode == 8 || (Env.mac && (keyCode == 91 || keyCode == 93))) { - editor.nodeChanged(); - } - - // Fire a TypingUndo event on the first character entered - if (isFirstTypedCharacter && self.typing) { - // Make the it dirty if the content was changed after typing the first character - if (!editor.isDirty()) { - editor.isNotDirty = !data[0] || getContent() == data[0].content; - - // Fire initial change event - if (!editor.isNotDirty) { - editor.fire('change', {level: data[0], lastLevel: null}); - } - } - - editor.fire('TypingUndo'); - isFirstTypedCharacter = false; - editor.nodeChanged(); - } - }); - - editor.on('KeyDown', function(e) { - var keyCode = e.keyCode; - - // Is caracter positon keys left,right,up,down,home,end,pgdown,pgup,enter - if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 45) { - if (self.typing) { - addNonTypingUndoLevel(e); - } - - return; - } - - // If key isn't shift,ctrl,alt,capslock,metakey - if ((keyCode < 16 || keyCode > 20) && keyCode != 224 && keyCode != 91 && !self.typing) { - self.beforeChange(); - self.typing = true; - self.add({}, e); - isFirstTypedCharacter = true; - } - }); - - editor.on('MouseDown', function(e) { - if (self.typing) { - addNonTypingUndoLevel(e); - } - }); - - // Add keyboard shortcuts for undo/redo keys - editor.addShortcut('ctrl+z', '', 'Undo'); - editor.addShortcut('ctrl+y,ctrl+shift+z', '', 'Redo'); - - editor.on('AddUndo Undo Redo ClearUndos MouseUp', function(e) { - if (!e.isDefaultPrevented()) { - editor.nodeChanged(); - } - }); - - self = { - // Explose for debugging reasons - data: data, - - /** - * State if the user is currently typing or not. This will add a typing operation into one undo - * level instead of one new level for each keystroke. - * - * @field {Boolean} typing - */ - typing: false, - - /** - * Stores away a bookmark to be used when performing an undo action so that the selection is before - * the change has been made. - * - * @method beforeChange - */ - beforeChange: function() { - if (!lock) { - beforeBookmark = editor.selection.getBookmark(2, true); - } - }, - - /** - * Adds a new undo level/snapshot to the undo list. - * - * @method add - * @param {Object} level Optional undo level object to add. - * @param {DOMEvent} Event Optional event responsible for the creation of the undo level. - * @return {Object} Undo level that got added or null it a level wasn't needed. - */ - add: function(level, event) { - var i, settings = editor.settings, lastLevel; - - level = level || {}; - level.content = getContent(); - - if (lock || editor.removed) { - return null; - } - - if (editor.fire('BeforeAddUndo', {level: level, originalEvent: event}).isDefaultPrevented()) { - return null; - } - - // Add undo level if needed - lastLevel = data[index]; - if (lastLevel && lastLevel.content == level.content) { - return null; - } - - // Set before bookmark on previous level - if (data[index]) { - data[index].beforeBookmark = beforeBookmark; - } - - // Time to compress - if (settings.custom_undo_redo_levels) { - if (data.length > settings.custom_undo_redo_levels) { - for (i = 0; i < data.length - 1; i++) { - data[i] = data[i + 1]; - } - - data.length--; - index = data.length; - } - } - - // Get a non intrusive normalized bookmark - level.bookmark = editor.selection.getBookmark(2, true); - - // Crop array if needed - if (index < data.length - 1) { - data.length = index + 1; - } - - data.push(level); - index = data.length - 1; - - var args = {level: level, lastLevel: lastLevel, originalEvent: event}; - - editor.fire('AddUndo', args); - - if (index > 0) { - editor.isNotDirty = false; - editor.fire('change', args); - } - - return level; - }, - - /** - * Undoes the last action. - * - * @method undo - * @return {Object} Undo level or null if no undo was performed. - */ - undo: function() { - var level; - - if (self.typing) { - self.add(); - self.typing = false; - } - - if (index > 0) { - level = data[--index]; - - // Undo to first index then set dirty state to false - if (index === 0) { - editor.isNotDirty = true; - } - - editor.setContent(level.content, {format: 'raw'}); - editor.selection.moveToBookmark(level.beforeBookmark); - - editor.fire('undo', {level: level}); - } - - return level; - }, - - /** - * Redoes the last action. - * - * @method redo - * @return {Object} Redo level or null if no redo was performed. - */ - redo: function() { - var level; - - if (index < data.length - 1) { - level = data[++index]; - - editor.setContent(level.content, {format: 'raw'}); - editor.selection.moveToBookmark(level.bookmark); - - editor.fire('redo', {level: level}); - } - - return level; - }, - - /** - * Removes all undo levels. - * - * @method clear - */ - clear: function() { - data = []; - index = 0; - self.typing = false; - editor.fire('ClearUndos'); - }, - - /** - * Returns true/false if the undo manager has any undo levels. - * - * @method hasUndo - * @return {Boolean} true/false if the undo manager has any undo levels. - */ - hasUndo: function() { - // Has undo levels or typing and content isn't the same as the initial level - return index > 0 || (self.typing && data[0] && getContent() != data[0].content); - }, - - /** - * Returns true/false if the undo manager has any redo levels. - * - * @method hasRedo - * @return {Boolean} true/false if the undo manager has any redo levels. - */ - hasRedo: function() { - return index < data.length - 1 && !this.typing; - }, - - /** - * Executes the specified function in an undo transation. The selection - * before the modification will be stored to the undo stack and if the DOM changes - * it will add a new undo level. Any methods within the transation that adds undo levels will - * be ignored. So a transation can include calls to execCommand or editor.insertContent. - * - * @method transact - * @param {function} callback Function to execute dom manipulation logic in. - */ - transact: function(callback) { - self.beforeChange(); - - lock = true; - callback(); - lock = false; - - self.add(); - } - }; - - return self; - }; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/WindowManager.js b/common/static/js/vendor/tinymce/js/tinymce/classes/WindowManager.js deleted file mode 100755 index d864f15cd2b8..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/WindowManager.js +++ /dev/null @@ -1,221 +0,0 @@ -/** - * WindowManager.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class handles the creation of native windows and dialogs. This class can be extended to provide for example inline dialogs. - * - * @class tinymce.WindowManager - * @example - * // Opens a new dialog with the file.htm file and the size 320x240 - * // It also adds a custom parameter this can be retrieved by using tinyMCEPopup.getWindowArg inside the dialog. - * tinymce.activeEditor.windowManager.open({ - * url: 'file.htm', - * width: 320, - * height: 240 - * }, { - * custom_param: 1 - * }); - * - * // Displays an alert box using the active editors window manager instance - * tinymce.activeEditor.windowManager.alert('Hello world!'); - * - * // Displays an confirm box and an alert message will be displayed depending on what you choose in the confirm - * tinymce.activeEditor.windowManager.confirm("Do you want to do something", function(s) { - * if (s) - * tinymce.activeEditor.windowManager.alert("Ok"); - * else - * tinymce.activeEditor.windowManager.alert("Cancel"); - * }); - */ -define("tinymce/WindowManager", [ - "tinymce/ui/Window", - "tinymce/ui/MessageBox" -], function(Window, MessageBox) { - return function(editor) { - var self = this, windows = []; - - function getTopMostWindow() { - if (windows.length) { - return windows[windows.length - 1]; - } - } - - self.windows = windows; - - /** - * Opens a new window. - * - * @method open - * @param {Object} args Optional name/value settings collection contains things like width/height/url etc. - * @option {String} title Window title. - * @option {String} file URL of the file to open in the window. - * @option {Number} width Width in pixels. - * @option {Number} height Height in pixels. - * @option {Boolean} resizable Specifies whether the popup window is resizable or not. - * @option {Boolean} maximizable Specifies whether the popup window has a "maximize" button and can get maximized or not. - * @option {String/Boolean} scrollbars Specifies whether the popup window can have scrollbars if required (i.e. content - * larger than the popup size specified). - */ - self.open = function(args, params) { - var win; - - editor.editorManager.activeEditor = editor; - - args.title = args.title || ' '; - - // Handle URL - args.url = args.url || args.file; // Legacy - if (args.url) { - args.width = parseInt(args.width || 320, 10); - args.height = parseInt(args.height || 240, 10); - } - - // Handle body - if (args.body) { - args.items = { - defaults: args.defaults, - type: args.bodyType || 'form', - items: args.body - }; - } - - if (!args.url && !args.buttons) { - args.buttons = [ - {text: 'Ok', subtype: 'primary', onclick: function() { - win.find('form')[0].submit(); - }}, - - {text: 'Cancel', onclick: function() { - win.close(); - }} - ]; - } - - win = new Window(args); - windows.push(win); - - win.on('close', function() { - var i = windows.length; - - while (i--) { - if (windows[i] === win) { - windows.splice(i, 1); - } - } - - editor.focus(); - }); - - // Handle data - if (args.data) { - win.on('postRender', function() { - this.find('*').each(function(ctrl) { - var name = ctrl.name(); - - if (name in args.data) { - ctrl.value(args.data[name]); - } - }); - }); - } - - // store args and parameters - win.features = args || {}; - win.params = params || {}; - - // Takes a snapshot in the FocusManager of the selection before focus is lost to dialog - editor.nodeChanged(); - - return win.renderTo(document.body).reflow(); - }; - - /** - * Creates a alert dialog. Please don't use the blocking behavior of this - * native version use the callback method instead then it can be extended. - * - * @method alert - * @param {String} message Text to display in the new alert dialog. - * @param {function} callback Callback function to be executed after the user has selected ok. - * @param {Object} scope Optional scope to execute the callback in. - * @example - * // Displays an alert box using the active editors window manager instance - * tinymce.activeEditor.windowManager.alert('Hello world!'); - */ - self.alert = function(message, callback, scope) { - MessageBox.alert(message, function() { - if (callback) { - callback.call(scope || this); - } else { - editor.focus(); - } - }); - }; - - /** - * Creates a confirm dialog. Please don't use the blocking behavior of this - * native version use the callback method instead then it can be extended. - * - * @method confirm - * @param {String} messageText to display in the new confirm dialog. - * @param {function} callback Callback function to be executed after the user has selected ok or cancel. - * @param {Object} scope Optional scope to execute the callback in. - * @example - * // Displays an confirm box and an alert message will be displayed depending on what you choose in the confirm - * tinymce.activeEditor.windowManager.confirm("Do you want to do something", function(s) { - * if (s) - * tinymce.activeEditor.windowManager.alert("Ok"); - * else - * tinymce.activeEditor.windowManager.alert("Cancel"); - * }); - */ - self.confirm = function(message, callback, scope) { - MessageBox.confirm(message, function(state) { - callback.call(scope || this, state); - }); - }; - - /** - * Closes the top most window. - * - * @method close - */ - self.close = function() { - if (getTopMostWindow()) { - getTopMostWindow().close(); - } - }; - - /** - * Returns the params of the last window open call. This can be used in iframe based - * dialog to get params passed from the tinymce plugin. - * - * @example - * var dialogArguments = top.tinymce.activeEditor.windowManager.getParams(); - * - * @method getParams - * @return {Object} Name/value object with parameters passed from windowManager.open call. - */ - self.getParams = function() { - return getTopMostWindow() ? getTopMostWindow().params : null; - }; - - /** - * Sets the params of the last opened window. - * - * @method setParams - * @param {Object} params Params object to set for the last opened window. - */ - self.setParams = function(params) { - if (getTopMostWindow()) { - getTopMostWindow().params = params; - } - }; - }; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/ControlSelection.js b/common/static/js/vendor/tinymce/js/tinymce/classes/dom/ControlSelection.js deleted file mode 100755 index 3e1d6e306b7a..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/ControlSelection.js +++ /dev/null @@ -1,519 +0,0 @@ -/** - * ControlSelection.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class handles control selection of elements. Controls are elements - * that can be resized and needs to be selected as a whole. It adds custom resize handles - * to all browser engines that support properly disabling the built in resize logic. - * - * @class tinymce.dom.ControlSelection - */ -define("tinymce/dom/ControlSelection", [ - "tinymce/util/VK", - "tinymce/util/Tools", - "tinymce/Env" -], function(VK, Tools, Env) { - return function(selection, editor) { - var dom = editor.dom, each = Tools.each; - var selectedElm, selectedElmGhost, resizeHandles, selectedHandle, lastMouseDownEvent; - var startX, startY, selectedElmX, selectedElmY, startW, startH, ratio, resizeStarted; - var width, height, editableDoc = editor.getDoc(), rootDocument = document, isIE = Env.ie && Env.ie < 11; - - // Details about each resize handle how to scale etc - resizeHandles = { - // Name: x multiplier, y multiplier, delta size x, delta size y - n: [0.5, 0, 0, -1], - e: [1, 0.5, 1, 0], - s: [0.5, 1, 0, 1], - w: [0, 0.5, -1, 0], - nw: [0, 0, -1, -1], - ne: [1, 0, 1, -1], - se: [1, 1, 1, 1], - sw: [0, 1, -1, 1] - }; - - // Add CSS for resize handles, cloned element and selected - var rootClass = '.mce-content-body'; - editor.contentStyles.push( - rootClass + ' div.mce-resizehandle {' + - 'position: absolute;' + - 'border: 1px solid black;' + - 'background: #FFF;' + - 'width: 5px;' + - 'height: 5px;' + - 'z-index: 10000' + - '}' + - rootClass + ' .mce-resizehandle:hover {' + - 'background: #000' + - '}' + - rootClass + ' img[data-mce-selected], hr[data-mce-selected] {' + - 'outline: 1px solid black;' + - 'resize: none' + // Have been talks about implementing this in browsers - '}' + - rootClass + ' .mce-clonedresizable {' + - 'position: absolute;' + - (Env.gecko ? '' : 'outline: 1px dashed black;') + // Gecko produces trails while resizing - 'opacity: .5;' + - 'filter: alpha(opacity=50);' + - 'z-index: 10000' + - '}' - ); - - function isResizable(elm) { - var selector = editor.settings.object_resizing; - - if (selector === false || Env.iOS) { - return false; - } - - if (typeof selector != 'string') { - selector = 'table,img,div'; - } - - if (elm.getAttribute('data-mce-resize') === 'false') { - return false; - } - - return editor.dom.is(elm, selector); - } - - function resizeGhostElement(e) { - var deltaX, deltaY; - - // Calc new width/height - deltaX = e.screenX - startX; - deltaY = e.screenY - startY; - - // Calc new size - width = deltaX * selectedHandle[2] + startW; - height = deltaY * selectedHandle[3] + startH; - - // Never scale down lower than 5 pixels - width = width < 5 ? 5 : width; - height = height < 5 ? 5 : height; - - // Constrain proportions when modifier key is pressed or if the nw, ne, sw, se corners are moved on an image - if (VK.modifierPressed(e) || (selectedElm.nodeName == "IMG" && selectedHandle[2] * selectedHandle[3] !== 0)) { - width = Math.round(height / ratio); - height = Math.round(width * ratio); - } - - // Update ghost size - dom.setStyles(selectedElmGhost, { - width: width, - height: height - }); - - // Update ghost X position if needed - if (selectedHandle[2] < 0 && selectedElmGhost.clientWidth <= width) { - dom.setStyle(selectedElmGhost, 'left', selectedElmX + (startW - width)); - } - - // Update ghost Y position if needed - if (selectedHandle[3] < 0 && selectedElmGhost.clientHeight <= height) { - dom.setStyle(selectedElmGhost, 'top', selectedElmY + (startH - height)); - } - - if (!resizeStarted) { - editor.fire('ObjectResizeStart', {target: selectedElm, width: startW, height: startH}); - resizeStarted = true; - } - } - - function endGhostResize() { - resizeStarted = false; - - function setSizeProp(name, value) { - if (value) { - // Resize by using style or attribute - if (selectedElm.style[name] || !editor.schema.isValid(selectedElm.nodeName.toLowerCase(), name)) { - dom.setStyle(selectedElm, name, value); - } else { - dom.setAttrib(selectedElm, name, value); - } - } - } - - // Set width/height properties - setSizeProp('width', width); - setSizeProp('height', height); - - dom.unbind(editableDoc, 'mousemove', resizeGhostElement); - dom.unbind(editableDoc, 'mouseup', endGhostResize); - - if (rootDocument != editableDoc) { - dom.unbind(rootDocument, 'mousemove', resizeGhostElement); - dom.unbind(rootDocument, 'mouseup', endGhostResize); - } - - // Remove ghost and update resize handle positions - dom.remove(selectedElmGhost); - - if (!isIE || selectedElm.nodeName == "TABLE") { - showResizeRect(selectedElm); - } - - editor.fire('ObjectResized', {target: selectedElm, width: width, height: height}); - editor.nodeChanged(); - } - - function showResizeRect(targetElm, mouseDownHandleName, mouseDownEvent) { - var position, targetWidth, targetHeight, e, rect, offsetParent = editor.getBody(); - - unbindResizeHandleEvents(); - - // Get position and size of target - position = dom.getPos(targetElm, offsetParent); - selectedElmX = position.x; - selectedElmY = position.y; - rect = targetElm.getBoundingClientRect(); // Fix for Gecko offsetHeight for table with caption - targetWidth = rect.width || (rect.right - rect.left); - targetHeight = rect.height || (rect.bottom - rect.top); - - // Reset width/height if user selects a new image/table - if (selectedElm != targetElm) { - detachResizeStartListener(); - selectedElm = targetElm; - width = height = 0; - } - - // Makes it possible to disable resizing - e = editor.fire('ObjectSelected', {target: targetElm}); - - if (isResizable(targetElm) && !e.isDefaultPrevented()) { - each(resizeHandles, function(handle, name) { - var handleElm, handlerContainerElm; - - function startDrag(e) { - startX = e.screenX; - startY = e.screenY; - startW = selectedElm.clientWidth; - startH = selectedElm.clientHeight; - ratio = startH / startW; - selectedHandle = handle; - - selectedElmGhost = selectedElm.cloneNode(true); - dom.addClass(selectedElmGhost, 'mce-clonedresizable'); - selectedElmGhost.contentEditable = false; // Hides IE move layer cursor - selectedElmGhost.unSelectabe = true; - dom.setStyles(selectedElmGhost, { - left: selectedElmX, - top: selectedElmY, - margin: 0 - }); - - selectedElmGhost.removeAttribute('data-mce-selected'); - editor.getBody().appendChild(selectedElmGhost); - - dom.bind(editableDoc, 'mousemove', resizeGhostElement); - dom.bind(editableDoc, 'mouseup', endGhostResize); - - if (rootDocument != editableDoc) { - dom.bind(rootDocument, 'mousemove', resizeGhostElement); - dom.bind(rootDocument, 'mouseup', endGhostResize); - } - } - - if (mouseDownHandleName) { - // Drag started by IE native resizestart - if (name == mouseDownHandleName) { - startDrag(mouseDownEvent); - } - - return; - } - - // Get existing or render resize handle - handleElm = dom.get('mceResizeHandle' + name); - if (!handleElm) { - handlerContainerElm = editor.getBody(); - - handleElm = dom.add(handlerContainerElm, 'div', { - id: 'mceResizeHandle' + name, - 'data-mce-bogus': true, - 'class': 'mce-resizehandle', - unselectable: true, - style: 'cursor:' + name + '-resize; margin:0; padding:0' - }); - - // Hides IE move layer cursor - // If we set it on Chrome we get this wounderful bug: #6725 - if (Env.ie) { - handleElm.contentEditable = false; - } - } else { - dom.show(handleElm); - } - - if (!handle.elm) { - dom.bind(handleElm, 'mousedown', function(e) { - e.stopImmediatePropagation(); - e.preventDefault(); - startDrag(e); - }); - - handle.elm = handleElm; - } - - /* - var halfHandleW = handleElm.offsetWidth / 2; - var halfHandleH = handleElm.offsetHeight / 2; - - // Position element - dom.setStyles(handleElm, { - left: Math.floor((targetWidth * handle[0] + selectedElmX) - halfHandleW + (handle[2] * halfHandleW)), - top: Math.floor((targetHeight * handle[1] + selectedElmY) - halfHandleH + (handle[3] * halfHandleH)) - }); - */ - - // Position element - dom.setStyles(handleElm, { - left: (targetWidth * handle[0] + selectedElmX) - (handleElm.offsetWidth / 2), - top: (targetHeight * handle[1] + selectedElmY) - (handleElm.offsetHeight / 2) - }); - }); - } else { - hideResizeRect(); - } - - selectedElm.setAttribute('data-mce-selected', '1'); - } - - function hideResizeRect() { - var name, handleElm; - - unbindResizeHandleEvents(); - - if (selectedElm) { - selectedElm.removeAttribute('data-mce-selected'); - } - - for (name in resizeHandles) { - handleElm = dom.get('mceResizeHandle' + name); - if (handleElm) { - dom.unbind(handleElm); - dom.remove(handleElm); - } - } - } - - function updateResizeRect(e) { - var controlElm; - - function isChildOrEqual(node, parent) { - if (node) { - do { - if (node === parent) { - return true; - } - } while ((node = node.parentNode)); - } - } - - // Remove data-mce-selected from all elements since they might have been copied using Ctrl+c/v - each(dom.select('img[data-mce-selected],hr[data-mce-selected]'), function(img) { - img.removeAttribute('data-mce-selected'); - }); - - controlElm = e.type == 'mousedown' ? e.target : selection.getNode(); - controlElm = dom.getParent(controlElm, isIE ? 'table' : 'table,img,hr'); - - if (isChildOrEqual(controlElm, editor.getBody())) { - disableGeckoResize(); - - if (isChildOrEqual(selection.getStart(), controlElm) && isChildOrEqual(selection.getEnd(), controlElm)) { - if (!isIE || (controlElm != selection.getStart() && selection.getStart().nodeName !== 'IMG')) { - showResizeRect(controlElm); - return; - } - } - } - - hideResizeRect(); - } - - function attachEvent(elm, name, func) { - if (elm && elm.attachEvent) { - elm.attachEvent('on' + name, func); - } - } - - function detachEvent(elm, name, func) { - if (elm && elm.detachEvent) { - elm.detachEvent('on' + name, func); - } - } - - function resizeNativeStart(e) { - var target = e.srcElement, pos, name, corner, cornerX, cornerY, relativeX, relativeY; - - pos = target.getBoundingClientRect(); - relativeX = lastMouseDownEvent.clientX - pos.left; - relativeY = lastMouseDownEvent.clientY - pos.top; - - // Figure out what corner we are draging on - for (name in resizeHandles) { - corner = resizeHandles[name]; - - cornerX = target.offsetWidth * corner[0]; - cornerY = target.offsetHeight * corner[1]; - - if (Math.abs(cornerX - relativeX) < 8 && Math.abs(cornerY - relativeY) < 8) { - selectedHandle = corner; - break; - } - } - - // Remove native selection and let the magic begin - resizeStarted = true; - editor.getDoc().selection.empty(); - showResizeRect(target, name, lastMouseDownEvent); - } - - function nativeControlSelect(e) { - var target = e.srcElement; - - if (target != selectedElm) { - detachResizeStartListener(); - - if (target.id.indexOf('mceResizeHandle') === 0) { - e.returnValue = false; - return; - } - - if (target.nodeName == 'IMG' || target.nodeName == 'TABLE') { - hideResizeRect(); - selectedElm = target; - attachEvent(target, 'resizestart', resizeNativeStart); - } - } - } - - function detachResizeStartListener() { - detachEvent(selectedElm, 'resizestart', resizeNativeStart); - } - - function unbindResizeHandleEvents() { - for (var name in resizeHandles) { - var handle = resizeHandles[name]; - - if (handle.elm) { - dom.unbind(handle.elm); - delete handle.elm; - } - } - } - - function disableGeckoResize() { - try { - // Disable object resizing on Gecko - editor.getDoc().execCommand('enableObjectResizing', false, false); - } catch (ex) { - // Ignore - } - } - - function controlSelect(elm) { - var ctrlRng; - - if (!isIE) { - return; - } - - ctrlRng = editableDoc.body.createControlRange(); - - try { - ctrlRng.addElement(elm); - ctrlRng.select(); - return true; - } catch (ex) { - // Ignore since the element can't be control selected for example a P tag - } - } - - editor.on('init', function() { - if (isIE) { - // Hide the resize rect on resize and reselect the image - editor.on('ObjectResized', function(e) { - if (e.target.nodeName != 'TABLE') { - hideResizeRect(); - controlSelect(e.target); - } - }); - - attachEvent(editor.getBody(), 'controlselect', nativeControlSelect); - - editor.on('mousedown', function(e) { - lastMouseDownEvent = e; - }); - } else { - disableGeckoResize(); - - if (Env.ie >= 11) { - // TODO: Drag/drop doesn't work - editor.on('mouseup', function(e) { - var nodeName = e.target.nodeName; - - if (/^(TABLE|IMG|HR)$/.test(nodeName)) { - editor.selection.select(e.target, nodeName == 'TABLE'); - editor.nodeChanged(); - } - }); - - editor.dom.bind(editor.getBody(), 'mscontrolselect', function(e) { - if (/^(TABLE|IMG|HR)$/.test(e.target.nodeName)) { - e.preventDefault(); - - // This moves the selection from being a control selection to a text like selection like in WebKit #6753 - // TODO: Fix this the day IE works like other browsers without this nasty native ugly control selections. - if (e.target.tagName == 'IMG') { - window.setTimeout(function() { - editor.selection.select(e.target); - }, 0); - } - } - }); - } - } - - editor.on('nodechange mousedown mouseup ResizeEditor', updateResizeRect); - - // Update resize rect while typing in a table - editor.on('keydown keyup', function(e) { - if (selectedElm && selectedElm.nodeName == "TABLE") { - updateResizeRect(e); - } - }); - - // Hide rect on focusout since it would float on top of windows otherwise - //editor.on('focusout', hideResizeRect); - }); - - editor.on('remove', unbindResizeHandleEvents); - - function destroy() { - selectedElm = selectedElmGhost = null; - - if (isIE) { - detachResizeStartListener(); - detachEvent(editor.getBody(), 'controlselect', nativeControlSelect); - } - } - - return { - isResizable: isResizable, - showResizeRect: showResizeRect, - hideResizeRect: hideResizeRect, - updateResizeRect: updateResizeRect, - controlSelect: controlSelect, - destroy: destroy - }; - }; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/DOMUtils.js b/common/static/js/vendor/tinymce/js/tinymce/classes/dom/DOMUtils.js deleted file mode 100755 index 904d3720fecf..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/DOMUtils.js +++ /dev/null @@ -1,2078 +0,0 @@ -/** - * DOMUtils.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Utility class for various DOM manipulation and retrieval functions. - * - * @class tinymce.dom.DOMUtils - * @example - * // Add a class to an element by id in the page - * tinymce.DOM.addClass('someid', 'someclass'); - * - * // Add a class to an element by id inside the editor - * tinymce.activeEditor.dom.addClass('someid', 'someclass'); - */ -define("tinymce/dom/DOMUtils", [ - "tinymce/dom/Sizzle", - "tinymce/html/Styles", - "tinymce/dom/EventUtils", - "tinymce/dom/TreeWalker", - "tinymce/dom/Range", - "tinymce/html/Entities", - "tinymce/Env", - "tinymce/util/Tools", - "tinymce/dom/StyleSheetLoader" -], function(Sizzle, Styles, EventUtils, TreeWalker, Range, Entities, Env, Tools, StyleSheetLoader) { - // Shorten names - var each = Tools.each, is = Tools.is, grep = Tools.grep, trim = Tools.trim, extend = Tools.extend; - var isWebKit = Env.webkit, isIE = Env.ie; - var simpleSelectorRe = /^([a-z0-9],?)+$/i; - var whiteSpaceRegExp = /^[ \t\r\n]*$/; - var numericCssMap = Tools.makeMap('fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom', ' '); - - /** - * Constructs a new DOMUtils instance. Consult the Wiki for more details on settings etc for this class. - * - * @constructor - * @method DOMUtils - * @param {Document} d Document reference to bind the utility class to. - * @param {settings} s Optional settings collection. - */ - function DOMUtils(doc, settings) { - var self = this, blockElementsMap; - - self.doc = doc; - self.win = window; - self.files = {}; - self.counter = 0; - self.stdMode = !isIE || doc.documentMode >= 8; - self.boxModel = !isIE || doc.compatMode == "CSS1Compat" || self.stdMode; - self.hasOuterHTML = "outerHTML" in doc.createElement("a"); - self.styleSheetLoader = new StyleSheetLoader(doc); - this.boundEvents = []; - - self.settings = settings = extend({ - keep_values: false, - hex_colors: 1 - }, settings); - - self.schema = settings.schema; - self.styles = new Styles({ - url_converter: settings.url_converter, - url_converter_scope: settings.url_converter_scope - }, settings.schema); - - self.fixDoc(doc); - self.events = settings.ownEvents ? new EventUtils(settings.proxy) : EventUtils.Event; - blockElementsMap = settings.schema ? settings.schema.getBlockElements() : {}; - - /** - * Returns true/false if the specified element is a block element or not. - * - * @method isBlock - * @param {Node/String} node Element/Node to check. - * @return {Boolean} True/False state if the node is a block element or not. - */ - self.isBlock = function(node) { - // Fix for #5446 - if (!node) { - return false; - } - - // This function is called in module pattern style since it might be executed with the wrong this scope - var type = node.nodeType; - - // If it's a node then check the type and use the nodeName - if (type) { - return !!(type === 1 && blockElementsMap[node.nodeName]); - } - - return !!blockElementsMap[node]; - }; - } - - DOMUtils.prototype = { - root: null, - props: { - "for": "htmlFor", - "class": "className", - className: "className", - checked: "checked", - disabled: "disabled", - maxlength: "maxLength", - readonly: "readOnly", - selected: "selected", - value: "value", - id: "id", - name: "name", - type: "type" - }, - - fixDoc: function(doc) { - var settings = this.settings, name; - - if (isIE && settings.schema) { - // Add missing HTML 4/5 elements to IE - ('abbr article aside audio canvas ' + - 'details figcaption figure footer ' + - 'header hgroup mark menu meter nav ' + - 'output progress section summary ' + - 'time video').replace(/\w+/g, function(name) { - doc.createElement(name); - }); - - // Create all custom elements - for (name in settings.schema.getCustomElements()) { - doc.createElement(name); - } - } - }, - - clone: function(node, deep) { - var self = this, clone, doc; - - // TODO: Add feature detection here in the future - if (!isIE || node.nodeType !== 1 || deep) { - return node.cloneNode(deep); - } - - doc = self.doc; - - // Make a HTML5 safe shallow copy - if (!deep) { - clone = doc.createElement(node.nodeName); - - // Copy attribs - each(self.getAttribs(node), function(attr) { - self.setAttrib(clone, attr.nodeName, self.getAttrib(node, attr.nodeName)); - }); - - return clone; - } -/* - // Setup HTML5 patched document fragment - if (!self.frag) { - self.frag = doc.createDocumentFragment(); - self.fixDoc(self.frag); - } - - // Make a deep copy by adding it to the document fragment then removing it this removed the :section - clone = doc.createElement('div'); - self.frag.appendChild(clone); - clone.innerHTML = node.outerHTML; - self.frag.removeChild(clone); -*/ - return clone.firstChild; - }, - - /** - * Returns the root node of the document. This is normally the body but might be a DIV. Parents like getParent will not - * go above the point of this root node. - * - * @method getRoot - * @return {Element} Root element for the utility class. - */ - getRoot: function() { - var self = this; - - return self.get(self.settings.root_element) || self.doc.body; - }, - - /** - * Returns the viewport of the window. - * - * @method getViewPort - * @param {Window} win Optional window to get viewport of. - * @return {Object} Viewport object with fields x, y, w and h. - */ - getViewPort: function(win) { - var doc, rootElm; - - win = !win ? this.win : win; - doc = win.document; - rootElm = this.boxModel ? doc.documentElement : doc.body; - - // Returns viewport size excluding scrollbars - return { - x: win.pageXOffset || rootElm.scrollLeft, - y: win.pageYOffset || rootElm.scrollTop, - w: win.innerWidth || rootElm.clientWidth, - h: win.innerHeight || rootElm.clientHeight - }; - }, - - /** - * Returns the rectangle for a specific element. - * - * @method getRect - * @param {Element/String} elm Element object or element ID to get rectangle from. - * @return {object} Rectangle for specified element object with x, y, w, h fields. - */ - getRect: function(elm) { - var self = this, pos, size; - - elm = self.get(elm); - pos = self.getPos(elm); - size = self.getSize(elm); - - return { - x: pos.x, y: pos.y, - w: size.w, h: size.h - }; - }, - - /** - * Returns the size dimensions of the specified element. - * - * @method getSize - * @param {Element/String} elm Element object or element ID to get rectangle from. - * @return {object} Rectangle for specified element object with w, h fields. - */ - getSize: function(elm) { - var self = this, w, h; - - elm = self.get(elm); - w = self.getStyle(elm, 'width'); - h = self.getStyle(elm, 'height'); - - // Non pixel value, then force offset/clientWidth - if (w.indexOf('px') === -1) { - w = 0; - } - - // Non pixel value, then force offset/clientWidth - if (h.indexOf('px') === -1) { - h = 0; - } - - return { - w: parseInt(w, 10) || elm.offsetWidth || elm.clientWidth, - h: parseInt(h, 10) || elm.offsetHeight || elm.clientHeight - }; - }, - - /** - * Returns a node by the specified selector function. This function will - * loop through all parent nodes and call the specified function for each node. - * If the function then returns true indicating that it has found what it was looking for, the loop execution will then end - * and the node it found will be returned. - * - * @method getParent - * @param {Node/String} node DOM node to search parents on or ID string. - * @param {function} selector Selection function or CSS selector to execute on each node. - * @param {Node} root Optional root element, never go below this point. - * @return {Node} DOM Node or null if it wasn't found. - */ - getParent: function(node, selector, root) { - return this.getParents(node, selector, root, false); - }, - - /** - * Returns a node list of all parents matching the specified selector function or pattern. - * If the function then returns true indicating that it has found what it was looking for and that node will be collected. - * - * @method getParents - * @param {Node/String} node DOM node to search parents on or ID string. - * @param {function} selector Selection function to execute on each node or CSS pattern. - * @param {Node} root Optional root element, never go below this point. - * @return {Array} Array of nodes or null if it wasn't found. - */ - getParents: function(node, selector, root, collect) { - var self = this, selectorVal, result = []; - - node = self.get(node); - collect = collect === undefined; - - // Default root on inline mode - root = root || (self.getRoot().nodeName != 'BODY' ? self.getRoot().parentNode : null); - - // Wrap node name as func - if (is(selector, 'string')) { - selectorVal = selector; - - if (selector === '*') { - selector = function(node) {return node.nodeType == 1;}; - } else { - selector = function(node) { - return self.is(node, selectorVal); - }; - } - } - - while (node) { - if (node == root || !node.nodeType || node.nodeType === 9) { - break; - } - - if (!selector || selector(node)) { - if (collect) { - result.push(node); - } else { - return node; - } - } - - node = node.parentNode; - } - - return collect ? result : null; - }, - - /** - * Returns the specified element by ID or the input element if it isn't a string. - * - * @method get - * @param {String/Element} n Element id to look for or element to just pass though. - * @return {Element} Element matching the specified id or null if it wasn't found. - */ - get: function(elm) { - var name; - - if (elm && this.doc && typeof(elm) == 'string') { - name = elm; - elm = this.doc.getElementById(elm); - - // IE and Opera returns meta elements when they match the specified input ID, but getElementsByName seems to do the trick - if (elm && elm.id !== name) { - return this.doc.getElementsByName(name)[1]; - } - } - - return elm; - }, - - /** - * Returns the next node that matches selector or function - * - * @method getNext - * @param {Node} node Node to find siblings from. - * @param {String/function} selector Selector CSS expression or function. - * @return {Node} Next node item matching the selector or null if it wasn't found. - */ - getNext: function(node, selector) { - return this._findSib(node, selector, 'nextSibling'); - }, - - /** - * Returns the previous node that matches selector or function - * - * @method getPrev - * @param {Node} node Node to find siblings from. - * @param {String/function} selector Selector CSS expression or function. - * @return {Node} Previous node item matching the selector or null if it wasn't found. - */ - getPrev: function(node, selector) { - return this._findSib(node, selector, 'previousSibling'); - }, - - // #ifndef jquery - - /** - * Selects specific elements by a CSS level 3 pattern. For example "div#a1 p.test". - * This function is optimized for the most common patterns needed in TinyMCE but it also performs well enough - * on more complex patterns. - * - * @method select - * @param {String} selector CSS level 3 pattern to select/find elements by. - * @param {Object} scope Optional root element/scope element to search in. - * @return {Array} Array with all matched elements. - * @example - * // Adds a class to all paragraphs in the currently active editor - * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'someclass'); - * - * // Adds a class to all spans that have the test class in the currently active editor - * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('span.test'), 'someclass') - */ - select: function(selector, scope) { - var self = this; - - //Sizzle.selectors.cacheLength = 0; - return Sizzle(selector, self.get(scope) || self.get(self.settings.root_element) || self.doc, []); - }, - - /** - * Returns true/false if the specified element matches the specified css pattern. - * - * @method is - * @param {Node/NodeList} elm DOM node to match or an array of nodes to match. - * @param {String} selector CSS pattern to match the element against. - */ - is: function(elm, selector) { - var i; - - // If it isn't an array then try to do some simple selectors instead of Sizzle for to boost performance - if (elm.length === undefined) { - // Simple all selector - if (selector === '*') { - return elm.nodeType == 1; - } - - // Simple selector just elements - if (simpleSelectorRe.test(selector)) { - selector = selector.toLowerCase().split(/,/); - elm = elm.nodeName.toLowerCase(); - - for (i = selector.length - 1; i >= 0; i--) { - if (selector[i] == elm) { - return true; - } - } - - return false; - } - } - - // Is non element - if (elm.nodeType && elm.nodeType != 1) { - return false; - } - - var elms = elm.nodeType ? [elm] : elm; - return Sizzle(selector, elms[0].ownerDocument || elms[0], null, elms).length > 0; - }, - - // #endif - - /** - * Adds the specified element to another element or elements. - * - * @method add - * @param {String/Element/Array} parentElm Element id string, DOM node element or array of ids or elements to add to. - * @param {String/Element} name Name of new element to add or existing element to add. - * @param {Object} attrs Optional object collection with arguments to add to the new element(s). - * @param {String} html Optional inner HTML contents to add for each element. - * @return {Element/Array} Element that got created, or an array of created elements if multiple input elements - * were passed in. - * @example - * // Adds a new paragraph to the end of the active editor - * tinymce.activeEditor.dom.add(tinymce.activeEditor.getBody(), 'p', {title: 'my title'}, 'Some content'); - */ - add: function(parentElm, name, attrs, html, create) { - var self = this; - - return this.run(parentElm, function(parentElm) { - var newElm; - - newElm = is(name, 'string') ? self.doc.createElement(name) : name; - self.setAttribs(newElm, attrs); - - if (html) { - if (html.nodeType) { - newElm.appendChild(html); - } else { - self.setHTML(newElm, html); - } - } - - return !create ? parentElm.appendChild(newElm) : newElm; - }); - }, - - /** - * Creates a new element. - * - * @method create - * @param {String} name Name of new element. - * @param {Object} attrs Optional object name/value collection with element attributes. - * @param {String} html Optional HTML string to set as inner HTML of the element. - * @return {Element} HTML DOM node element that got created. - * @example - * // Adds an element where the caret/selection is in the active editor - * var el = tinymce.activeEditor.dom.create('div', {id: 'test', 'class': 'myclass'}, 'some content'); - * tinymce.activeEditor.selection.setNode(el); - */ - create: function(name, attrs, html) { - return this.add(this.doc.createElement(name), name, attrs, html, 1); - }, - - /** - * Creates HTML string for element. The element will be closed unless an empty inner HTML string is passed in. - * - * @method createHTML - * @param {String} name Name of new element. - * @param {Object} attrs Optional object name/value collection with element attributes. - * @param {String} html Optional HTML string to set as inner HTML of the element. - * @return {String} String with new HTML element, for example: test. - * @example - * // Creates a html chunk and inserts it at the current selection/caret location - * tinymce.activeEditor.selection.setContent(tinymce.activeEditor.dom.createHTML('a', {href: 'test.html'}, 'some line')); - */ - createHTML: function(name, attrs, html) { - var outHtml = '', key; - - outHtml += '<' + name; - - for (key in attrs) { - if (attrs.hasOwnProperty(key) && attrs[key] !== null) { - outHtml += ' ' + key + '="' + this.encode(attrs[key]) + '"'; - } - } - - // A call to tinymce.is doesn't work for some odd reason on IE9 possible bug inside their JS runtime - if (typeof(html) != "undefined") { - return outHtml + '>' + html + ''; - } - - return outHtml + ' />'; - }, - - /** - * Creates a document fragment out of the specified HTML string. - * - * @method createFragment - * @param {String} html Html string to create fragment from. - * @return {DocumentFragment} Document fragment node. - */ - createFragment: function(html) { - var frag, node, doc = this.doc, container; - - container = doc.createElement("div"); - frag = doc.createDocumentFragment(); - - if (html) { - container.innerHTML = html; - } - - while ((node = container.firstChild)) { - frag.appendChild(node); - } - - return frag; - }, - - /** - * Removes/deletes the specified element(s) from the DOM. - * - * @method remove - * @param {String/Element/Array} node ID of element or DOM element object or array containing multiple elements/ids. - * @param {Boolean} keep_children Optional state to keep children or not. If set to true all children will be - * placed at the location of the removed element. - * @return {Element/Array} HTML DOM element that got removed, or an array of removed elements if multiple input elements - * were passed in. - * @example - * // Removes all paragraphs in the active editor - * tinymce.activeEditor.dom.remove(tinymce.activeEditor.dom.select('p')); - * - * // Removes an element by id in the document - * tinymce.DOM.remove('mydiv'); - */ - remove: function(node, keep_children) { - return this.run(node, function(node) { - var child, parent = node.parentNode; - - if (!parent) { - return null; - } - - if (keep_children) { - while ((child = node.firstChild)) { - // IE 8 will crash if you don't remove completely empty text nodes - if (!isIE || child.nodeType !== 3 || child.nodeValue) { - parent.insertBefore(child, node); - } else { - node.removeChild(child); - } - } - } - - return parent.removeChild(node); - }); - }, - - /** - * Sets the CSS style value on a HTML element. The name can be a camelcase string - * or the CSS style name like background-color. - * - * @method setStyle - * @param {String/Element/Array} n HTML element/Element ID or Array of elements/ids to set CSS style value on. - * @param {String} na Name of the style value to set. - * @param {String} v Value to set on the style. - * @example - * // Sets a style value on all paragraphs in the currently active editor - * tinymce.activeEditor.dom.setStyle(tinymce.activeEditor.dom.select('p'), 'background-color', 'red'); - * - * // Sets a style value to an element by id in the current document - * tinymce.DOM.setStyle('mydiv', 'background-color', 'red'); - */ - setStyle: function(elm, name, value) { - return this.run(elm, function(elm) { - var self = this, style, key; - - if (name) { - if (typeof(name) === 'string') { - style = elm.style; - - // Camelcase it, if needed - name = name.replace(/-(\D)/g, function(a, b) { - return b.toUpperCase(); - }); - - // Default px suffix on these - if (typeof(value) === 'number' && !numericCssMap[name]) { - value += 'px'; - } - - // IE specific opacity - if (name === "opacity" && elm.runtimeStyle && typeof(elm.runtimeStyle.opacity) === "undefined") { - style.filter = value === '' ? '' : "alpha(opacity=" + (value * 100) + ")"; - } - - if (name == "float") { - // Old IE vs modern browsers - name = "cssFloat" in elm.style ? "cssFloat" : "styleFloat"; - } - - try { - style[name] = value; - } catch (ex) { - // Ignore IE errors - } - - // Force update of the style data - if (self.settings.update_styles) { - elm.removeAttribute('data-mce-style'); - } - } else { - for (key in name) { - self.setStyle(elm, key, name[key]); - } - } - } - }); - }, - - /** - * Returns the current style or runtime/computed value of an element. - * - * @method getStyle - * @param {String/Element} elm HTML element or element id string to get style from. - * @param {String} name Style name to return. - * @param {Boolean} computed Computed style. - * @return {String} Current style or computed style value of an element. - */ - getStyle: function(elm, name, computed) { - elm = this.get(elm); - - if (!elm) { - return; - } - - // W3C - if (this.doc.defaultView && computed) { - // Remove camelcase - name = name.replace(/[A-Z]/g, function(a){ - return '-' + a; - }); - - try { - return this.doc.defaultView.getComputedStyle(elm, null).getPropertyValue(name); - } catch (ex) { - // Old safari might fail - return null; - } - } - - // Camelcase it, if needed - name = name.replace(/-(\D)/g, function(a, b) { - return b.toUpperCase(); - }); - - if (name == 'float') { - name = isIE ? 'styleFloat' : 'cssFloat'; - } - - // IE & Opera - if (elm.currentStyle && computed) { - return elm.currentStyle[name]; - } - - return elm.style ? elm.style[name] : undefined; - }, - - /** - * Sets multiple styles on the specified element(s). - * - * @method setStyles - * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to set styles on. - * @param {Object} o Name/Value collection of style items to add to the element(s). - * @example - * // Sets styles on all paragraphs in the currently active editor - * tinymce.activeEditor.dom.setStyles(tinymce.activeEditor.dom.select('p'), {'background-color': 'red', 'color': 'green'}); - * - * // Sets styles to an element by id in the current document - * tinymce.DOM.setStyles('mydiv', {'background-color': 'red', 'color': 'green'}); - */ - setStyles: function(elm, styles) { - this.setStyle(elm, styles); - }, - - css: function(elm, name, value) { - this.setStyle(elm, name, value); - }, - - /** - * Removes all attributes from an element or elements. - * - * @method removeAllAttribs - * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to remove attributes from. - */ - removeAllAttribs: function(e) { - return this.run(e, function(e) { - var i, attrs = e.attributes; - for (i = attrs.length - 1; i >= 0; i--) { - e.removeAttributeNode(attrs.item(i)); - } - }); - }, - - /** - * Sets the specified attribute of an element or elements. - * - * @method setAttrib - * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to set attribute on. - * @param {String} n Name of attribute to set. - * @param {String} v Value to set on the attribute - if this value is falsy like null, 0 or '' it will remove the attribute instead. - * @example - * // Sets class attribute on all paragraphs in the active editor - * tinymce.activeEditor.dom.setAttrib(tinymce.activeEditor.dom.select('p'), 'class', 'myclass'); - * - * // Sets class attribute on a specific element in the current page - * tinymce.dom.setAttrib('mydiv', 'class', 'myclass'); - */ - setAttrib: function(e, n, v) { - var self = this; - - // What's the point - if (!e || !n) { - return; - } - - return this.run(e, function(e) { - var s = self.settings; - var originalValue = e.getAttribute(n); - if (v !== null) { - switch (n) { - case "style": - if (!is(v, 'string')) { - each(v, function(v, n) { - self.setStyle(e, n, v); - }); - - return; - } - - // No mce_style for elements with these since they might get resized by the user - if (s.keep_values) { - if (v) { - e.setAttribute('data-mce-style', v, 2); - } else { - e.removeAttribute('data-mce-style', 2); - } - } - - e.style.cssText = v; - break; - - case "class": - e.className = v || ''; // Fix IE null bug - break; - - case "src": - case "href": - if (s.keep_values) { - if (s.url_converter) { - v = s.url_converter.call(s.url_converter_scope || self, v, n, e); - } - - self.setAttrib(e, 'data-mce-' + n, v, 2); - } - - break; - - case "shape": - e.setAttribute('data-mce-style', v); - break; - } - } - if (is(v) && v !== null && v.length !== 0) { - e.setAttribute(n, '' + v, 2); - } else { - e.removeAttribute(n, 2); - } - - // fire onChangeAttrib event for attributes that have changed - if (originalValue != v && s.onSetAttrib) { - s.onSetAttrib({attrElm: e, attrName: n, attrValue: v}); - } - }); - }, - - /** - * Sets two or more specified attributes of an element or elements. - * - * @method setAttribs - * @param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set attributes on. - * @param {Object} attrs Name/Value collection of attribute items to add to the element(s). - * @example - * // Sets class and title attributes on all paragraphs in the active editor - * tinymce.activeEditor.dom.setAttribs(tinymce.activeEditor.dom.select('p'), {'class': 'myclass', title: 'some title'}); - * - * // Sets class and title attributes on a specific element in the current page - * tinymce.DOM.setAttribs('mydiv', {'class': 'myclass', title: 'some title'}); - */ - setAttribs: function(elm, attrs) { - var self = this; - - return this.run(elm, function(elm) { - each(attrs, function(value, name) { - self.setAttrib(elm, name, value); - }); - }); - }, - - /** - * Returns the specified attribute by name. - * - * @method getAttrib - * @param {String/Element} elm Element string id or DOM element to get attribute from. - * @param {String} name Name of attribute to get. - * @param {String} defaultVal Optional default value to return if the attribute didn't exist. - * @return {String} Attribute value string, default value or null if the attribute wasn't found. - */ - getAttrib: function(elm, name, defaultVal) { - var value, self = this, undef; - - elm = self.get(elm); - - if (!elm || elm.nodeType !== 1) { - return defaultVal === undef ? false : defaultVal; - } - - if (!is(defaultVal)) { - defaultVal = ''; - } - - // Try the mce variant for these - if (/^(src|href|style|coords|shape)$/.test(name)) { - value = elm.getAttribute("data-mce-" + name); - - if (value) { - return value; - } - } - - if (isIE && self.props[name]) { - value = elm[self.props[name]]; - value = value && value.nodeValue ? value.nodeValue : value; - } - - if (!value) { - value = elm.getAttribute(name, 2); - } - - // Check boolean attribs - if (/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(name)) { - if (elm[self.props[name]] === true && value === '') { - return name; - } - - return value ? name : ''; - } - - // Inner input elements will override attributes on form elements - if (elm.nodeName === "FORM" && elm.getAttributeNode(name)) { - return elm.getAttributeNode(name).nodeValue; - } - - if (name === 'style') { - value = value || elm.style.cssText; - - if (value) { - value = self.serializeStyle(self.parseStyle(value), elm.nodeName); - - if (self.settings.keep_values) { - elm.setAttribute('data-mce-style', value); - } - } - } - - // Remove Apple and WebKit stuff - if (isWebKit && name === "class" && value) { - value = value.replace(/(apple|webkit)\-[a-z\-]+/gi, ''); - } - - // Handle IE issues - if (isIE) { - switch (name) { - case 'rowspan': - case 'colspan': - // IE returns 1 as default value - if (value === 1) { - value = ''; - } - - break; - - case 'size': - // IE returns +0 as default value for size - if (value === '+0' || value === 20 || value === 0) { - value = ''; - } - - break; - - case 'width': - case 'height': - case 'vspace': - case 'checked': - case 'disabled': - case 'readonly': - if (value === 0) { - value = ''; - } - - break; - - case 'hspace': - // IE returns -1 as default value - if (value === -1) { - value = ''; - } - - break; - - case 'maxlength': - case 'tabindex': - // IE returns default value - if (value === 32768 || value === 2147483647 || value === '32768') { - value = ''; - } - - break; - - case 'multiple': - case 'compact': - case 'noshade': - case 'nowrap': - if (value === 65535) { - return name; - } - - return defaultVal; - - case 'shape': - value = value.toLowerCase(); - break; - - default: - // IE has odd anonymous function for event attributes - if (name.indexOf('on') === 0 && value) { - value = ('' + value).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/, '$1'); - } - } - } - - return (value !== undef && value !== null && value !== '') ? '' + value : defaultVal; - }, - - /** - * Returns the absolute x, y position of a node. The position will be returned in an object with x, y fields. - * - * @method getPos - * @param {Element/String} elm HTML element or element id to get x, y position from. - * @param {Element} rootElm Optional root element to stop calculations at. - * @return {object} Absolute position of the specified element object with x, y fields. - */ - getPos: function(elm, rootElm) { - var self = this, x = 0, y = 0, offsetParent, doc = self.doc, pos; - - elm = self.get(elm); - rootElm = rootElm || doc.body; - - if (elm) { - // Use getBoundingClientRect if it exists since it's faster than looping offset nodes - if (rootElm === doc.body && elm.getBoundingClientRect) { - pos = elm.getBoundingClientRect(); - rootElm = self.boxModel ? doc.documentElement : doc.body; - - // Add scroll offsets from documentElement or body since IE with the wrong box model will use d.body and so do WebKit - // Also remove the body/documentelement clientTop/clientLeft on IE 6, 7 since they offset the position - x = pos.left + (doc.documentElement.scrollLeft || doc.body.scrollLeft) - rootElm.clientLeft; - y = pos.top + (doc.documentElement.scrollTop || doc.body.scrollTop) - rootElm.clientTop; - - return {x: x, y: y}; - } - - offsetParent = elm; - while (offsetParent && offsetParent != rootElm && offsetParent.nodeType) { - x += offsetParent.offsetLeft || 0; - y += offsetParent.offsetTop || 0; - offsetParent = offsetParent.offsetParent; - } - - offsetParent = elm.parentNode; - while (offsetParent && offsetParent != rootElm && offsetParent.nodeType) { - x -= offsetParent.scrollLeft || 0; - y -= offsetParent.scrollTop || 0; - offsetParent = offsetParent.parentNode; - } - } - - return {x: x, y: y}; - }, - - /** - * Parses the specified style value into an object collection. This parser will also - * merge and remove any redundant items that browsers might have added. It will also convert non-hex - * colors to hex values. Urls inside the styles will also be converted to absolute/relative based on settings. - * - * @method parseStyle - * @param {String} cssText Style value to parse, for example: border:1px solid red;. - * @return {Object} Object representation of that style, for example: {border: '1px solid red'} - */ - parseStyle: function(cssText) { - return this.styles.parse(cssText); - }, - - /** - * Serializes the specified style object into a string. - * - * @method serializeStyle - * @param {Object} styles Object to serialize as string, for example: {border: '1px solid red'} - * @param {String} name Optional element name. - * @return {String} String representation of the style object, for example: border: 1px solid red. - */ - serializeStyle: function(styles, name) { - return this.styles.serialize(styles, name); - }, - - /** - * Adds a style element at the top of the document with the specified cssText content. - * - * @method addStyle - * @param {String} cssText CSS Text style to add to top of head of document. - */ - addStyle: function(cssText) { - var self = this, doc = self.doc, head, styleElm; - - // Prevent inline from loading the same styles twice - if (self !== DOMUtils.DOM && doc === document) { - var addedStyles = DOMUtils.DOM.addedStyles; - - addedStyles = addedStyles || []; - if (addedStyles[cssText]) { - return; - } - - addedStyles[cssText] = true; - DOMUtils.DOM.addedStyles = addedStyles; - } - - // Create style element if needed - styleElm = doc.getElementById('mceDefaultStyles'); - if (!styleElm) { - styleElm = doc.createElement('style'); - styleElm.id = 'mceDefaultStyles'; - styleElm.type = 'text/css'; - - head = doc.getElementsByTagName('head')[0]; - if (head.firstChild) { - head.insertBefore(styleElm, head.firstChild); - } else { - head.appendChild(styleElm); - } - } - - // Append style data to old or new style element - if (styleElm.styleSheet) { - styleElm.styleSheet.cssText += cssText; - } else { - styleElm.appendChild(doc.createTextNode(cssText)); - } - }, - - /** - * Imports/loads the specified CSS file into the document bound to the class. - * - * @method loadCSS - * @param {String} u URL to CSS file to load. - * @example - * // Loads a CSS file dynamically into the current document - * tinymce.DOM.loadCSS('somepath/some.css'); - * - * // Loads a CSS file into the currently active editor instance - * tinymce.activeEditor.dom.loadCSS('somepath/some.css'); - * - * // Loads a CSS file into an editor instance by id - * tinymce.get('someid').dom.loadCSS('somepath/some.css'); - * - * // Loads multiple CSS files into the current document - * tinymce.DOM.loadCSS('somepath/some.css,somepath/someother.css'); - */ - loadCSS: function(url) { - var self = this, doc = self.doc, head; - - // Prevent inline from loading the same CSS file twice - if (self !== DOMUtils.DOM && doc === document) { - DOMUtils.DOM.loadCSS(url); - return; - } - - if (!url) { - url = ''; - } - - head = doc.getElementsByTagName('head')[0]; - - each(url.split(','), function(url) { - var link; - - if (self.files[url]) { - return; - } - - self.files[url] = true; - link = self.create('link', {rel: 'stylesheet', href: url}); - - // IE 8 has a bug where dynamically loading stylesheets would produce a 1 item remaining bug - // This fix seems to resolve that issue by recalcing the document once a stylesheet finishes loading - // It's ugly but it seems to work fine. - if (isIE && doc.documentMode && doc.recalc) { - link.onload = function() { - if (doc.recalc) { - doc.recalc(); - } - - link.onload = null; - }; - } - - head.appendChild(link); - }); - }, - - /** - * Adds a class to the specified element or elements. - * - * @method addClass - * @param {String/Element/Array} elm Element ID string or DOM element or array with elements or IDs. - * @param {String} cls Class name to add to each element. - * @return {String/Array} String with new class value or array with new class values for all elements. - * @example - * // Adds a class to all paragraphs in the active editor - * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'myclass'); - * - * // Adds a class to a specific element in the current page - * tinymce.DOM.addClass('mydiv', 'myclass'); - */ - addClass: function(elm, cls) { - return this.run(elm, function(elm) { - var clsVal; - - if (!cls) { - return 0; - } - - if (this.hasClass(elm, cls)) { - return elm.className; - } - - clsVal = this.removeClass(elm, cls); - elm.className = clsVal = (clsVal !== '' ? (clsVal + ' ') : '') + cls; - - return clsVal; - }); - }, - - /** - * Removes a class from the specified element or elements. - * - * @method removeClass - * @param {String/Element/Array} elm Element ID string or DOM element or array with elements or IDs. - * @param {String} cls Class name to remove from each element. - * @return {String/Array} String of remaining class name(s), or an array of strings if multiple input elements - * were passed in. - * @example - * // Removes a class from all paragraphs in the active editor - * tinymce.activeEditor.dom.removeClass(tinymce.activeEditor.dom.select('p'), 'myclass'); - * - * // Removes a class from a specific element in the current page - * tinymce.DOM.removeClass('mydiv', 'myclass'); - */ - removeClass: function(elm, cls) { - var self = this, re; - - return self.run(elm, function(elm) { - var val; - - if (self.hasClass(elm, cls)) { - if (!re) { - re = new RegExp("(^|\\s+)" + cls + "(\\s+|$)", "g"); - } - - val = elm.className.replace(re, ' '); - val = trim(val != ' ' ? val : ''); - - elm.className = val; - - // Empty class attr - if (!val) { - elm.removeAttribute('class'); - elm.removeAttribute('className'); - } - - return val; - } - - return elm.className; - }); - }, - - /** - * Returns true if the specified element has the specified class. - * - * @method hasClass - * @param {String/Element} n HTML element or element id string to check CSS class on. - * @param {String} c CSS class to check for. - * @return {Boolean} true/false if the specified element has the specified class. - */ - hasClass: function(elm, cls) { - elm = this.get(elm); - - if (!elm || !cls) { - return false; - } - - return (' ' + elm.className + ' ').indexOf(' ' + cls + ' ') !== -1; - }, - - /** - * Toggles the specified class on/off. - * - * @method toggleClass - * @param {Element} elm Element to toggle class on. - * @param {[type]} cls Class to toggle on/off. - * @param {[type]} state Optional state to set. - */ - toggleClass: function(elm, cls, state) { - state = state === undefined ? !this.hasClass(elm, cls) : state; - - if (this.hasClass(elm, cls) !== state) { - if (state) { - this.addClass(elm, cls); - } else { - this.removeClass(elm, cls); - } - } - }, - - /** - * Shows the specified element(s) by ID by setting the "display" style. - * - * @method show - * @param {String/Element/Array} elm ID of DOM element or DOM element or array with elements or IDs to show. - */ - show: function(elm) { - return this.setStyle(elm, 'display', 'block'); - }, - - /** - * Hides the specified element(s) by ID by setting the "display" style. - * - * @method hide - * @param {String/Element/Array} e ID of DOM element or DOM element or array with elements or IDs to hide. - * @example - * // Hides an element by id in the document - * tinymce.DOM.hide('myid'); - */ - hide: function(elm) { - return this.setStyle(elm, 'display', 'none'); - }, - - /** - * Returns true/false if the element is hidden or not by checking the "display" style. - * - * @method isHidden - * @param {String/Element} e Id or element to check display state on. - * @return {Boolean} true/false if the element is hidden or not. - */ - isHidden: function(elm) { - elm = this.get(elm); - - return !elm || elm.style.display == 'none' || this.getStyle(elm, 'display') == 'none'; - }, - - /** - * Returns a unique id. This can be useful when generating elements on the fly. - * This method will not check if the element already exists. - * - * @method uniqueId - * @param {String} prefix Optional prefix to add in front of all ids - defaults to "mce_". - * @return {String} Unique id. - */ - uniqueId: function(prefix) { - return (!prefix ? 'mce_' : prefix) + (this.counter++); - }, - - /** - * Sets the specified HTML content inside the element or elements. The HTML will first be processed. This means - * URLs will get converted, hex color values fixed etc. Check processHTML for details. - * - * @method setHTML - * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to set HTML inside of. - * @param {String} h HTML content to set as inner HTML of the element. - * @example - * // Sets the inner HTML of all paragraphs in the active editor - * tinymce.activeEditor.dom.setHTML(tinymce.activeEditor.dom.select('p'), 'some inner html'); - * - * // Sets the inner HTML of an element by id in the document - * tinymce.DOM.setHTML('mydiv', 'some inner html'); - */ - setHTML: function(element, html) { - var self = this; - - return self.run(element, function(element) { - if (isIE) { - // Remove all child nodes, IE keeps empty text nodes in DOM - while (element.firstChild) { - element.removeChild(element.firstChild); - } - - try { - // IE will remove comments from the beginning - // unless you padd the contents with something - element.innerHTML = '
' + html; - element.removeChild(element.firstChild); - } catch (ex) { - // IE sometimes produces an unknown runtime error on innerHTML if it's a block element - // within a block element for example a div inside a p - // This seems to fix this problem - - // Create new div with HTML contents and a BR in front to keep comments - var newElement = self.create('div'); - newElement.innerHTML = '
' + html; - - // Add all children from div to target - each(grep(newElement.childNodes), function(node, i) { - // Skip br element - if (i && element.canHaveHTML) { - element.appendChild(node); - } - }); - } - } else { - element.innerHTML = html; - } - - return html; - }); - }, - - /** - * Returns the outer HTML of an element. - * - * @method getOuterHTML - * @param {String/Element} elm Element ID or element object to get outer HTML from. - * @return {String} Outer HTML string. - * @example - * tinymce.DOM.getOuterHTML(editorElement); - * tinymce.activeEditor.getOuterHTML(tinymce.activeEditor.getBody()); - */ - getOuterHTML: function(elm) { - var doc, self = this; - - elm = self.get(elm); - - if (!elm) { - return null; - } - - if (elm.nodeType === 1 && self.hasOuterHTML) { - return elm.outerHTML; - } - - doc = (elm.ownerDocument || self.doc).createElement("body"); - doc.appendChild(elm.cloneNode(true)); - - return doc.innerHTML; - }, - - /** - * Sets the specified outer HTML on an element or elements. - * - * @method setOuterHTML - * @param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set outer HTML on. - * @param {Object} html HTML code to set as outer value for the element. - * @param {Document} doc Optional document scope to use in this process - defaults to the document of the DOM class. - * @example - * // Sets the outer HTML of all paragraphs in the active editor - * tinymce.activeEditor.dom.setOuterHTML(tinymce.activeEditor.dom.select('p'), '
some html
'); - * - * // Sets the outer HTML of an element by id in the document - * tinymce.DOM.setOuterHTML('mydiv', '
some html
'); - */ - setOuterHTML: function(elm, html, doc) { - var self = this; - - return self.run(elm, function(elm) { - function set() { - var node, tempElm; - - tempElm = doc.createElement("body"); - tempElm.innerHTML = html; - - node = tempElm.lastChild; - while (node) { - self.insertAfter(node.cloneNode(true), elm); - node = node.previousSibling; - } - - self.remove(elm); - } - - // Only set HTML on elements - if (elm.nodeType == 1) { - doc = doc || elm.ownerDocument || self.doc; - - if (isIE) { - try { - // Try outerHTML for IE it sometimes produces an unknown runtime error - if (elm.nodeType == 1 && self.hasOuterHTML) { - elm.outerHTML = html; - } else { - set(); - } - } catch (ex) { - // Fix for unknown runtime error - set(); - } - } else { - set(); - } - } - }); - }, - - /** - * Entity decodes a string. This method decodes any HTML entities, such as å. - * - * @method decode - * @param {String} s String to decode entities on. - * @return {String} Entity decoded string. - */ - decode: Entities.decode, - - /** - * Entity encodes a string. This method encodes the most common entities, such as <>"&. - * - * @method encode - * @param {String} text String to encode with entities. - * @return {String} Entity encoded string. - */ - encode: Entities.encodeAllRaw, - - /** - * Inserts an element after the reference element. - * - * @method insertAfter - * @param {Element} node Element to insert after the reference. - * @param {Element/String/Array} reference_node Reference element, element id or array of elements to insert after. - * @return {Element/Array} Element that got added or an array with elements. - */ - insertAfter: function(node, reference_node) { - reference_node = this.get(reference_node); - - return this.run(node, function(node) { - var parent, nextSibling; - - parent = reference_node.parentNode; - nextSibling = reference_node.nextSibling; - - if (nextSibling) { - parent.insertBefore(node, nextSibling); - } else { - parent.appendChild(node); - } - - return node; - }); - }, - - /** - * Replaces the specified element or elements with the new element specified. The new element will - * be cloned if multiple input elements are passed in. - * - * @method replace - * @param {Element} newElm New element to replace old ones with. - * @param {Element/String/Array} oldELm Element DOM node, element id or array of elements or ids to replace. - * @param {Boolean} k Optional keep children state, if set to true child nodes from the old object will be added to new ones. - */ - replace: function(newElm, oldElm, keepChildren) { - var self = this; - - return self.run(oldElm, function(oldElm) { - if (is(oldElm, 'array')) { - newElm = newElm.cloneNode(true); - } - - if (keepChildren) { - each(grep(oldElm.childNodes), function(node) { - newElm.appendChild(node); - }); - } - - return oldElm.parentNode.replaceChild(newElm, oldElm); - }); - }, - - /** - * Renames the specified element and keeps its attributes and children. - * - * @method rename - * @param {Element} elm Element to rename. - * @param {String} name Name of the new element. - * @return {Element} New element or the old element if it needed renaming. - */ - rename: function(elm, name) { - var self = this, newElm; - - if (elm.nodeName != name.toUpperCase()) { - // Rename block element - newElm = self.create(name); - - // Copy attribs to new block - each(self.getAttribs(elm), function(attr_node) { - self.setAttrib(newElm, attr_node.nodeName, self.getAttrib(elm, attr_node.nodeName)); - }); - - // Replace block - self.replace(newElm, elm, 1); - } - - return newElm || elm; - }, - - /** - * Find the common ancestor of two elements. This is a shorter method than using the DOM Range logic. - * - * @method findCommonAncestor - * @param {Element} a Element to find common ancestor of. - * @param {Element} b Element to find common ancestor of. - * @return {Element} Common ancestor element of the two input elements. - */ - findCommonAncestor: function(a, b) { - var ps = a, pe; - - while (ps) { - pe = b; - - while (pe && ps != pe) { - pe = pe.parentNode; - } - - if (ps == pe) { - break; - } - - ps = ps.parentNode; - } - - if (!ps && a.ownerDocument) { - return a.ownerDocument.documentElement; - } - - return ps; - }, - - /** - * Parses the specified RGB color value and returns a hex version of that color. - * - * @method toHex - * @param {String} rgbVal RGB string value like rgb(1,2,3) - * @return {String} Hex version of that RGB value like #FF00FF. - */ - toHex: function(rgbVal) { - return this.styles.toHex(Tools.trim(rgbVal)); - }, - - /** - * Executes the specified function on the element by id or dom element node or array of elements/id. - * - * @method run - * @param {String/Element/Array} Element ID or DOM element object or array with ids or elements. - * @param {function} f Function to execute for each item. - * @param {Object} s Optional scope to execute the function in. - * @return {Object/Array} Single object, or an array of objects if multiple input elements were passed in. - */ - run: function(elm, func, scope) { - var self = this, result; - - if (typeof(elm) === 'string') { - elm = self.get(elm); - } - - if (!elm) { - return false; - } - - scope = scope || this; - if (!elm.nodeType && (elm.length || elm.length === 0)) { - result = []; - - each(elm, function(elm, i) { - if (elm) { - if (typeof(elm) == 'string') { - elm = self.get(elm); - } - - result.push(func.call(scope, elm, i)); - } - }); - - return result; - } - - return func.call(scope, elm); - }, - - /** - * Returns a NodeList with attributes for the element. - * - * @method getAttribs - * @param {HTMLElement/string} elm Element node or string id to get attributes from. - * @return {NodeList} NodeList with attributes. - */ - getAttribs: function(elm) { - var attrs; - - elm = this.get(elm); - - if (!elm) { - return []; - } - - if (isIE) { - attrs = []; - - // Object will throw exception in IE - if (elm.nodeName == 'OBJECT') { - return elm.attributes; - } - - // IE doesn't keep the selected attribute if you clone option elements - if (elm.nodeName === 'OPTION' && this.getAttrib(elm, 'selected')) { - attrs.push({specified: 1, nodeName: 'selected'}); - } - - // It's crazy that this is faster in IE but it's because it returns all attributes all the time - var attrRegExp = /<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi; - elm.cloneNode(false).outerHTML.replace(attrRegExp, '').replace(/[\w:\-]+/gi, function(a) { - attrs.push({specified: 1, nodeName: a}); - }); - - return attrs; - } - - return elm.attributes; - }, - - /** - * Returns true/false if the specified node is to be considered empty or not. - * - * @example - * tinymce.DOM.isEmpty(node, {img: true}); - * @method isEmpty - * @param {Object} elements Optional name/value object with elements that are automatically treated as non-empty elements. - * @return {Boolean} true/false if the node is empty or not. - */ - isEmpty: function(node, elements) { - var self = this, i, attributes, type, walker, name, brCount = 0; - - node = node.firstChild; - if (node) { - walker = new TreeWalker(node, node.parentNode); - elements = elements || self.schema ? self.schema.getNonEmptyElements() : null; - - do { - type = node.nodeType; - - if (type === 1) { - // Ignore bogus elements - if (node.getAttribute('data-mce-bogus')) { - continue; - } - - // Keep empty elements like - name = node.nodeName.toLowerCase(); - if (elements && elements[name]) { - // Ignore single BR elements in blocks like


or


- if (name === 'br') { - brCount++; - continue; - } - - return false; - } - - // Keep elements with data-bookmark attributes or name attribute like - attributes = self.getAttribs(node); - i = node.attributes.length; - while (i--) { - name = node.attributes[i].nodeName; - if (name === "name" || name === 'data-mce-bookmark') { - return false; - } - } - } - - // Keep comment nodes - if (type == 8) { - return false; - } - - // Keep non whitespace text nodes - if ((type === 3 && !whiteSpaceRegExp.test(node.nodeValue))) { - return false; - } - } while ((node = walker.next())); - } - - return brCount <= 1; - }, - - /** - * Creates a new DOM Range object. This will use the native DOM Range API if it's - * available. If it's not, it will fall back to the custom TinyMCE implementation. - * - * @method createRng - * @return {DOMRange} DOM Range object. - * @example - * var rng = tinymce.DOM.createRng(); - * alert(rng.startContainer + "," + rng.startOffset); - */ - createRng: function() { - var doc = this.doc; - - return doc.createRange ? doc.createRange() : new Range(this); - }, - - /** - * Returns the index of the specified node within its parent. - * - * @method nodeIndex - * @param {Node} node Node to look for. - * @param {boolean} normalized Optional true/false state if the index is what it would be after a normalization. - * @return {Number} Index of the specified node. - */ - nodeIndex: function(node, normalized) { - var idx = 0, lastNodeType, nodeType; - - if (node) { - for (lastNodeType = node.nodeType, node = node.previousSibling; node; node = node.previousSibling) { - nodeType = node.nodeType; - - // Normalize text nodes - if (normalized && nodeType == 3) { - if (nodeType == lastNodeType || !node.nodeValue.length) { - continue; - } - } - idx++; - lastNodeType = nodeType; - } - } - - return idx; - }, - - /** - * Splits an element into two new elements and places the specified split - * element or elements between the new ones. For example splitting the paragraph at the bold element in - * this example

abcabc123

would produce

abc

abc

123

. - * - * @method split - * @param {Element} parentElm Parent element to split. - * @param {Element} splitElm Element to split at. - * @param {Element} replacementElm Optional replacement element to replace the split element with. - * @return {Element} Returns the split element or the replacement element if that is specified. - */ - split: function(parentElm, splitElm, replacementElm) { - var self = this, r = self.createRng(), bef, aft, pa; - - // W3C valid browsers tend to leave empty nodes to the left/right side of the contents - this makes sense - // but we don't want that in our code since it serves no purpose for the end user - // For example splitting this html at the bold element: - //

text 1CHOPtext 2

- // would produce: - //

text 1

CHOP

text 2

- // this function will then trim off empty edges and produce: - //

text 1

CHOP

text 2

- function trimNode(node) { - var i, children = node.childNodes, type = node.nodeType; - - function surroundedBySpans(node) { - var previousIsSpan = node.previousSibling && node.previousSibling.nodeName == 'SPAN'; - var nextIsSpan = node.nextSibling && node.nextSibling.nodeName == 'SPAN'; - return previousIsSpan && nextIsSpan; - } - - if (type == 1 && node.getAttribute('data-mce-type') == 'bookmark') { - return; - } - - for (i = children.length - 1; i >= 0; i--) { - trimNode(children[i]); - } - - if (type != 9) { - // Keep non whitespace text nodes - if (type == 3 && node.nodeValue.length > 0) { - // If parent element isn't a block or there isn't any useful contents for example "

" - // Also keep text nodes with only spaces if surrounded by spans. - // eg. "

a b

" should keep space between a and b - var trimmedLength = trim(node.nodeValue).length; - if (!self.isBlock(node.parentNode) || trimmedLength > 0 || trimmedLength === 0 && surroundedBySpans(node)) { - return; - } - } else if (type == 1) { - // If the only child is a bookmark then move it up - children = node.childNodes; - - // TODO fix this complex if - if (children.length == 1 && children[0] && children[0].nodeType == 1 && - children[0].getAttribute('data-mce-type') == 'bookmark') { - node.parentNode.insertBefore(children[0], node); - } - - // Keep non empty elements or img, hr etc - if (children.length || /^(br|hr|input|img)$/i.test(node.nodeName)) { - return; - } - } - - self.remove(node); - } - - return node; - } - - if (parentElm && splitElm) { - // Get before chunk - r.setStart(parentElm.parentNode, self.nodeIndex(parentElm)); - r.setEnd(splitElm.parentNode, self.nodeIndex(splitElm)); - bef = r.extractContents(); - - // Get after chunk - r = self.createRng(); - r.setStart(splitElm.parentNode, self.nodeIndex(splitElm) + 1); - r.setEnd(parentElm.parentNode, self.nodeIndex(parentElm) + 1); - aft = r.extractContents(); - - // Insert before chunk - pa = parentElm.parentNode; - pa.insertBefore(trimNode(bef), parentElm); - - // Insert middle chunk - if (replacementElm) { - pa.replaceChild(replacementElm, splitElm); - } else { - pa.insertBefore(splitElm, parentElm); - } - - // Insert after chunk - pa.insertBefore(trimNode(aft), parentElm); - self.remove(parentElm); - - return replacementElm || splitElm; - } - }, - - /** - * Adds an event handler to the specified object. - * - * @method bind - * @param {Element/Document/Window/Array} target Target element to bind events to. - * handler to or an array of elements/ids/documents. - * @param {String} name Name of event handler to add, for example: click. - * @param {function} func Function to execute when the event occurs. - * @param {Object} scope Optional scope to execute the function in. - * @return {function} Function callback handler the same as the one passed in. - */ - bind: function(target, name, func, scope) { - var self = this; - - if (Tools.isArray(target)) { - var i = target.length; - - while (i--) { - target[i] = self.bind(target[i], name, func, scope); - } - - return target; - } - - // Collect all window/document events bound by editor instance - if (self.settings.collect && (target === self.doc || target === self.win)) { - self.boundEvents.push([target, name, func, scope]); - } - - return self.events.bind(target, name, func, scope || self); - }, - - /** - * Removes the specified event handler by name and function from an element or collection of elements. - * - * @method unbind - * @param {Element/Document/Window/Array} target Target element to unbind events on. - * @param {String} name Event handler name, for example: "click" - * @param {function} func Function to remove. - * @return {bool/Array} Bool state of true if the handler was removed, or an array of states if multiple input elements - * were passed in. - */ - unbind: function(target, name, func) { - var self = this, i; - - if (Tools.isArray(target)) { - i = target.length; - - while (i--) { - target[i] = self.unbind(target[i], name, func); - } - - return target; - } - - // Remove any bound events matching the input - if (self.boundEvents && (target === self.doc || target === self.win)) { - i = self.boundEvents.length; - - while (i--) { - var item = self.boundEvents[i]; - - if (target == item[0] && (!name || name == item[1]) && (!func || func == item[2])) { - this.events.unbind(item[0], item[1], item[2]); - } - } - } - - return this.events.unbind(target, name, func); - }, - - /** - * Fires the specified event name with object on target. - * - * @method fire - * @param {Node/Document/Window} target Target element or object to fire event on. - * @param {String} name Name of the event to fire. - * @param {Object} evt Event object to send. - * @return {Event} Event object. - */ - fire: function(target, name, evt) { - return this.events.fire(target, name, evt); - }, - - // Returns the content editable state of a node - getContentEditable: function(node) { - var contentEditable; - - // Check type - if (node.nodeType != 1) { - return null; - } - - // Check for fake content editable - contentEditable = node.getAttribute("data-mce-contenteditable"); - if (contentEditable && contentEditable !== "inherit") { - return contentEditable; - } - - // Check for real content editable - return node.contentEditable !== "inherit" ? node.contentEditable : null; - }, - - /** - * Destroys all internal references to the DOM to solve IE leak issues. - * - * @method destroy - */ - destroy: function() { - var self = this; - - // Unbind all events bound to window/document by editor instance - if (self.boundEvents) { - var i = self.boundEvents.length; - - while (i--) { - var item = self.boundEvents[i]; - this.events.unbind(item[0], item[1], item[2]); - } - - self.boundEvents = null; - } - - // Restore sizzle document to window.document - // Since the current document might be removed producing "Permission denied" on IE see #6325 - if (Sizzle.setDocument) { - Sizzle.setDocument(); - } - - self.win = self.doc = self.root = self.events = self.frag = null; - }, - - // #ifdef debug - - dumpRng: function(r) { - return ( - 'startContainer: ' + r.startContainer.nodeName + - ', startOffset: ' + r.startOffset + - ', endContainer: ' + r.endContainer.nodeName + - ', endOffset: ' + r.endOffset - ); - }, - - // #endif - - _findSib: function(node, selector, name) { - var self = this, func = selector; - - if (node) { - // If expression make a function of it using is - if (typeof(func) == 'string') { - func = function(node) { - return self.is(node, selector); - }; - } - - // Loop all siblings - for (node = node[name]; node; node = node[name]) { - if (func(node)) { - return node; - } - } - } - - return null; - } - }; - - /** - * Instance of DOMUtils for the current document. - * - * @static - * @property DOM - * @type tinymce.dom.DOMUtils - * @example - * // Example of how to add a class to some element by id - * tinymce.DOM.addClass('someid', 'someclass'); - */ - DOMUtils.DOM = new DOMUtils(document); - - return DOMUtils; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/DomQuery.js b/common/static/js/vendor/tinymce/js/tinymce/classes/dom/DomQuery.js deleted file mode 100755 index 838c98256fa2..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/DomQuery.js +++ /dev/null @@ -1,730 +0,0 @@ -/** - * DomQuery.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - * - * Some of this logic is based on jQuery code that is released under - * MIT license that grants us to sublicense it under LGPL. - * - * @ignore-file - */ - -/** - * @class tinymce.dom.DomQuery - */ -define("tinymce/dom/DomQuery", [ - "tinymce/dom/EventUtils", - "tinymce/dom/Sizzle" -], function(EventUtils, Sizzle) { - var doc = document, push = Array.prototype.push, slice = Array.prototype.slice; - var rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/; - var Event = EventUtils.Event; - - function isDefined(obj) { - return typeof obj !== "undefined"; - } - - function isString(obj) { - return typeof obj === "string"; - } - - function createFragment(html) { - var frag, node, container; - - container = doc.createElement("div"); - frag = doc.createDocumentFragment(); - container.innerHTML = html; - - while ((node = container.firstChild)) { - frag.appendChild(node); - } - - return frag; - } - - function domManipulate(targetNodes, sourceItem, callback) { - var i; - - if (typeof sourceItem === "string") { - sourceItem = createFragment(sourceItem); - } else if (sourceItem.length) { - for (i = 0; i < sourceItem.length; i++) { - domManipulate(targetNodes, sourceItem[i], callback); - } - - return targetNodes; - } - - i = targetNodes.length; - while (i--) { - callback.call(targetNodes[i], sourceItem.parentNode ? sourceItem : sourceItem); - } - - return targetNodes; - } - - function hasClass(node, className) { - return node && className && (' ' + node.className + ' ').indexOf(' ' + className + ' ') !== -1; - } - - /** - * Makes a map object out of a string that gets separated by a delimiter. - * - * @method makeMap - * @param {String} items Item string to split. - * @param {Object} map Optional object to add items to. - * @return {Object} name/value object with items as keys. - */ - function makeMap(items, map) { - var i; - - items = items || []; - - if (typeof(items) == "string") { - items = items.split(' '); - } - - map = map || {}; - - i = items.length; - while (i--) { - map[items[i]] = {}; - } - - return map; - } - - var numericCssMap = makeMap('fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom'); - - function DomQuery(selector, context) { - /*eslint new-cap:0 */ - return new DomQuery.fn.init(selector, context); - } - - /** - * Extends the specified object with another object. - * - * @method extend - * @param {Object} target Object to extend. - * @param {Object..} obj Multiple objects to extend with. - * @return {Object} Same as target, the extended object. - */ - function extend(target) { - var args = arguments, arg, i, key; - - for (i = 1; i < args.length; i++) { - arg = args[i]; - - for (key in arg) { - target[key] = arg[key]; - } - } - - return target; - } - - /** - * Converts the specified object into a real JavaScript array. - * - * @method toArray - * @param {Object} obj Object to convert into array. - * @return {Array} Array object based in input. - */ - function toArray(obj) { - var array = [], i, l; - - for (i = 0, l = obj.length; i < l; i++) { - array[i] = obj[i]; - } - - return array; - } - - /** - * Returns the index of the specified item inside the array. - * - * @method inArray - * @param {Object} item Item to look for. - * @param {Array} array Array to look for item in. - * @return {Number} Index of the item or -1. - */ - function inArray(item, array) { - var i; - - if (array.indexOf) { - return array.indexOf(item); - } - - i = array.length; - while (i--) { - if (array[i] === item) { - return i; - } - } - - return -1; - } - - /** - * Returns true/false if the specified object is an array. - * - * @method isArray - * @param {Object} obj Object to check if it's an array. - * @return {Boolean} true/false if the input object is array or not. - */ - var isArray = Array.isArray || function(obj) { - return Object.prototype.toString.call(obj) === "[object Array]"; - }; - - var whiteSpaceRegExp = /^\s*|\s*$/g; - - function trim(str) { - return (str === null || str === undefined) ? '' : ("" + str).replace(whiteSpaceRegExp, ''); - } - - /** - * Executes the callback function for each item in array/object. If you return false in the - * callback it will break the loop. - * - * @method each - * @param {Object} obj Object to iterate. - * @param {function} callback Callback function to execute for each item. - */ - function each(obj, callback) { - var length, key, i, undef, value; - - if (obj) { - length = obj.length; - - if (length === undef) { - // Loop object items - for (key in obj) { - if (obj.hasOwnProperty(key)) { - value = obj[key]; - if (callback.call(value, value, key) === false) { - break; - } - } - } - } else { - // Loop array items - for (i = 0; i < length; i++) { - value = obj[i]; - if (callback.call(value, value, key) === false) { - break; - } - } - } - } - - return obj; - } - - DomQuery.fn = DomQuery.prototype = { - constructor: DomQuery, - selector: "", - length: 0, - - init: function(selector, context) { - var self = this, match, node; - - if (!selector) { - return self; - } - - if (selector.nodeType) { - self.context = self[0] = selector; - self.length = 1; - - return self; - } - - if (isString(selector)) { - if (selector.charAt(0) === "<" && selector.charAt(selector.length - 1) === ">" && selector.length >= 3) { - match = [null, selector, null]; - } else { - match = rquickExpr.exec(selector); - } - - if (match) { - if (match[1]) { - node = createFragment(selector).firstChild; - while (node) { - this.add(node); - node = node.nextSibling; - } - } else { - node = doc.getElementById(match[2]); - - if (node.id !== match[2]) { - return self.find(selector); - } - - self.length = 1; - self[0] = node; - } - } else { - return DomQuery(context || document).find(selector); - } - } else { - this.add(selector); - } - - return self; - }, - - toArray: function() { - return toArray(this); - }, - - add: function(items) { - var self = this; - - // Force single item into array - if (!isArray(items)) { - if (items instanceof DomQuery) { - self.add(items.toArray()); - } else { - push.call(self, items); - } - } else { - push.apply(self, items); - } - - return self; - }, - - attr: function(name, value) { - var self = this; - - if (typeof name === "object") { - each(name, function(value, name) { - self.attr(name, value); - }); - } else if (isDefined(value)) { - this.each(function() { - if (this.nodeType === 1) { - this.setAttribute(name, value); - } - }); - } else { - return self[0] && self[0].nodeType === 1 ? self[0].getAttribute(name) : undefined; - } - - return self; - }, - - css: function(name, value) { - var self = this; - - if (typeof name === "object") { - each(name, function(value, name) { - self.css(name, value); - }); - } else { - // Camelcase it, if needed - name = name.replace(/-(\D)/g, function(a, b) { - return b.toUpperCase(); - }); - - if (isDefined(value)) { - // Default px suffix on these - if (typeof(value) === 'number' && !numericCssMap[name]) { - value += 'px'; - } - - self.each(function() { - var style = this.style; - - // IE specific opacity - if (name === "opacity" && this.runtimeStyle && typeof(this.runtimeStyle.opacity) === "undefined") { - style.filter = value === '' ? '' : "alpha(opacity=" + (value * 100) + ")"; - } - - try { - style[name] = value; - } catch (ex) { - // Ignore - } - }); - } else { - return self[0] ? self[0].style[name] : undefined; - } - } - - return self; - }, - - remove: function() { - var self = this, node, i = this.length; - - while (i--) { - node = self[i]; - Event.clean(node); - - if (node.parentNode) { - node.parentNode.removeChild(node); - } - } - - return this; - }, - - empty: function() { - var self = this, node, i = this.length; - - while (i--) { - node = self[i]; - while (node.firstChild) { - node.removeChild(node.firstChild); - } - } - - return this; - }, - - html: function(value) { - var self = this, i; - - if (isDefined(value)) { - i = self.length; - while (i--) { - self[i].innerHTML = value; - } - - return self; - } - - return self[0] ? self[0].innerHTML : ''; - }, - - text: function(value) { - var self = this, i; - - if (isDefined(value)) { - i = self.length; - while (i--) { - self[i].innerText = self[0].textContent = value; - } - - return self; - } - - return self[0] ? self[0].innerText || self[0].textContent : ''; - }, - - append: function() { - return domManipulate(this, arguments, function(node) { - if (this.nodeType === 1) { - this.appendChild(node); - } - }); - }, - - prepend: function() { - return domManipulate(this, arguments, function(node) { - if (this.nodeType === 1) { - this.insertBefore(node, this.firstChild); - } - }); - }, - - before: function() { - var self = this; - - if (self[0] && self[0].parentNode) { - return domManipulate(self, arguments, function(node) { - this.parentNode.insertBefore(node, this.nextSibling); - }); - } - - return self; - }, - - after: function() { - var self = this; - - if (self[0] && self[0].parentNode) { - return domManipulate(self, arguments, function(node) { - this.parentNode.insertBefore(node, this); - }); - } - - return self; - }, - - appendTo: function(val) { - DomQuery(val).append(this); - - return this; - }, - - addClass: function(className) { - return this.toggleClass(className, true); - }, - - removeClass: function(className) { - return this.toggleClass(className, false); - }, - - toggleClass: function(className, state) { - var self = this; - - if (className.indexOf(' ') !== -1) { - each(className.split(' '), function() { - self.toggleClass(this, state); - }); - } else { - self.each(function(node) { - var existingClassName; - - if (hasClass(node, className) !== state) { - existingClassName = node.className; - - if (state) { - node.className += existingClassName ? ' ' + className : className; - } else { - node.className = trim((" " + existingClassName + " ").replace(' ' + className + ' ', ' ')); - } - } - }); - } - - return self; - }, - - hasClass: function(className) { - return hasClass(this[0], className); - }, - - each: function(callback) { - return each(this, callback); - }, - - on: function(name, callback) { - return this.each(function() { - Event.bind(this, name, callback); - }); - }, - - off: function(name, callback) { - return this.each(function() { - Event.unbind(this, name, callback); - }); - }, - - show: function() { - return this.css('display', ''); - }, - - hide: function() { - return this.css('display', 'none'); - }, - - slice: function() { - return new DomQuery(slice.apply(this, arguments)); - }, - - eq: function(index) { - return index === -1 ? this.slice(index) : this.slice(index, +index + 1); - }, - - first: function() { - return this.eq(0); - }, - - last: function() { - return this.eq(-1); - }, - - replaceWith: function(content) { - var self = this; - - if (self[0]) { - self[0].parentNode.replaceChild(DomQuery(content)[0], self[0]); - } - - return self; - }, - - wrap: function(wrapper) { - wrapper = DomQuery(wrapper)[0]; - - return this.each(function() { - var self = this, newWrapper = wrapper.cloneNode(false); - self.parentNode.insertBefore(newWrapper, self); - newWrapper.appendChild(self); - }); - }, - - unwrap: function() { - return this.each(function() { - var self = this, node = self.firstChild, currentNode; - - while (node) { - currentNode = node; - node = node.nextSibling; - self.parentNode.insertBefore(currentNode, self); - } - }); - }, - - clone: function() { - var result = []; - - this.each(function() { - result.push(this.cloneNode(true)); - }); - - return DomQuery(result); - }, - - find: function(selector) { - var i, l, ret = []; - - for (i = 0, l = this.length; i < l; i++) { - DomQuery.find(selector, this[i], ret); - } - - return DomQuery(ret); - }, - - push: push, - sort: [].sort, - splice: [].splice - }; - - // Static members - extend(DomQuery, { - extend: extend, - toArray: toArray, - inArray: inArray, - isArray: isArray, - each: each, - trim: trim, - makeMap: makeMap, - - // Sizzle - find: Sizzle, - expr: Sizzle.selectors, - unique: Sizzle.uniqueSort, - text: Sizzle.getText, - isXMLDoc: Sizzle.isXML, - contains: Sizzle.contains, - filter: function(expr, elems, not) { - if (not) { - expr = ":not(" + expr + ")"; - } - - if (elems.length === 1) { - elems = DomQuery.find.matchesSelector(elems[0], expr) ? [elems[0]] : []; - } else { - elems = DomQuery.find.matches(expr, elems); - } - - return elems; - } - }); - - function dir(el, prop, until) { - var matched = [], cur = el[prop]; - - while (cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !DomQuery(cur).is(until))) { - if (cur.nodeType === 1) { - matched.push(cur); - } - - cur = cur[prop]; - } - - return matched; - } - - function sibling(n, el, siblingName, nodeType) { - var r = []; - - for(; n; n = n[siblingName]) { - if ((!nodeType || n.nodeType === nodeType) && n !== el) { - r.push(n); - } - } - - return r; - } - - each({ - parent: function(node) { - var parent = node.parentNode; - - return parent && parent.nodeType !== 11 ? parent : null; - }, - - parents: function(node) { - return dir(node, "parentNode"); - }, - - parentsUntil: function(node, until) { - return dir(node, "parentNode", until); - }, - - next: function(node) { - return sibling(node, 'nextSibling', 1); - }, - - prev: function(node) { - return sibling(node, 'previousSibling', 1); - }, - - nextNodes: function(node) { - return sibling(node, 'nextSibling'); - }, - - prevNodes: function(node) { - return sibling(node, 'previousSibling'); - }, - - children: function(node) { - return sibling(node.firstChild, 'nextSibling', 1); - }, - - contents: function(node) { - return toArray((node.nodeName === "iframe" ? node.contentDocument || node.contentWindow.document : node).childNodes); - } - }, function(name, fn){ - DomQuery.fn[name] = function(selector) { - var self = this, result; - - if (self.length > 1) { - throw new Error("DomQuery only supports traverse functions on a single node."); - } - - if (self[0]) { - result = fn(self[0], selector); - } - - result = DomQuery(result); - - if (selector && name !== "parentsUntil") { - return result.filter(selector); - } - - return result; - }; - }); - - DomQuery.fn.filter = function(selector) { - return DomQuery.filter(selector); - }; - - DomQuery.fn.is = function(selector) { - return !!selector && this.filter(selector).length > 0; - }; - - DomQuery.fn.init.prototype = DomQuery.fn; - - return DomQuery; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/EventUtils.js b/common/static/js/vendor/tinymce/js/tinymce/classes/dom/EventUtils.js deleted file mode 100755 index e3a21cdd88ee..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/EventUtils.js +++ /dev/null @@ -1,557 +0,0 @@ -/** - * EventUtils.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*jshint loopfunc:true*/ -/*eslint no-loop-func:0 */ - -define("tinymce/dom/EventUtils", [], function() { - "use strict"; - - var eventExpandoPrefix = "mce-data-"; - var mouseEventRe = /^(?:mouse|contextmenu)|click/; - var deprecated = {keyLocation: 1, layerX: 1, layerY: 1, returnValue: 1}; - - /** - * Binds a native event to a callback on the speified target. - */ - function addEvent(target, name, callback, capture) { - if (target.addEventListener) { - target.addEventListener(name, callback, capture || false); - } else if (target.attachEvent) { - target.attachEvent('on' + name, callback); - } - } - - /** - * Unbinds a native event callback on the specified target. - */ - function removeEvent(target, name, callback, capture) { - if (target.removeEventListener) { - target.removeEventListener(name, callback, capture || false); - } else if (target.detachEvent) { - target.detachEvent('on' + name, callback); - } - } - - /** - * Normalizes a native event object or just adds the event specific methods on a custom event. - */ - function fix(originalEvent, data) { - var name, event = data || {}, undef; - - // Dummy function that gets replaced on the delegation state functions - function returnFalse() { - return false; - } - - // Dummy function that gets replaced on the delegation state functions - function returnTrue() { - return true; - } - - // Copy all properties from the original event - for (name in originalEvent) { - // layerX/layerY is deprecated in Chrome and produces a warning - if (!deprecated[name]) { - event[name] = originalEvent[name]; - } - } - - // Normalize target IE uses srcElement - if (!event.target) { - event.target = event.srcElement || document; - } - - // Calculate pageX/Y if missing and clientX/Y available - if (originalEvent && mouseEventRe.test(originalEvent.type) && originalEvent.pageX === undef && originalEvent.clientX !== undef) { - var eventDoc = event.target.ownerDocument || document; - var doc = eventDoc.documentElement; - var body = eventDoc.body; - - event.pageX = originalEvent.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - - ( doc && doc.clientLeft || body && body.clientLeft || 0); - - event.pageY = originalEvent.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0 ) - - ( doc && doc.clientTop || body && body.clientTop || 0); - } - - // Add preventDefault method - event.preventDefault = function() { - event.isDefaultPrevented = returnTrue; - - // Execute preventDefault on the original event object - if (originalEvent) { - if (originalEvent.preventDefault) { - originalEvent.preventDefault(); - } else { - originalEvent.returnValue = false; // IE - } - } - }; - - // Add stopPropagation - event.stopPropagation = function() { - event.isPropagationStopped = returnTrue; - - // Execute stopPropagation on the original event object - if (originalEvent) { - if (originalEvent.stopPropagation) { - originalEvent.stopPropagation(); - } else { - originalEvent.cancelBubble = true; // IE - } - } - }; - - // Add stopImmediatePropagation - event.stopImmediatePropagation = function() { - event.isImmediatePropagationStopped = returnTrue; - event.stopPropagation(); - }; - - // Add event delegation states - if (!event.isDefaultPrevented) { - event.isDefaultPrevented = returnFalse; - event.isPropagationStopped = returnFalse; - event.isImmediatePropagationStopped = returnFalse; - } - - return event; - } - - /** - * Bind a DOMContentLoaded event across browsers and executes the callback once the page DOM is initialized. - * It will also set/check the domLoaded state of the event_utils instance so ready isn't called multiple times. - */ - function bindOnReady(win, callback, eventUtils) { - var doc = win.document, event = {type: 'ready'}; - - if (eventUtils.domLoaded) { - callback(event); - return; - } - - // Gets called when the DOM is ready - function readyHandler() { - if (!eventUtils.domLoaded) { - eventUtils.domLoaded = true; - callback(event); - } - } - - function waitForDomLoaded() { - // Check complete or interactive state if there is a body - // element on some iframes IE 8 will produce a null body - if (doc.readyState === "complete" || (doc.readyState === "interactive" && doc.body)) { - removeEvent(doc, "readystatechange", waitForDomLoaded); - readyHandler(); - } - } - - function tryScroll() { - try { - // If IE is used, use the trick by Diego Perini licensed under MIT by request to the author. - // http://javascript.nwbox.com/IEContentLoaded/ - doc.documentElement.doScroll("left"); - } catch (ex) { - setTimeout(tryScroll, 0); - return; - } - - readyHandler(); - } - - // Use W3C method - if (doc.addEventListener) { - if (doc.readyState === "complete") { - readyHandler(); - } else { - addEvent(win, 'DOMContentLoaded', readyHandler); - } - } else { - // Use IE method - addEvent(doc, "readystatechange", waitForDomLoaded); - - // Wait until we can scroll, when we can the DOM is initialized - if (doc.documentElement.doScroll && win.self === win.top) { - tryScroll(); - } - } - - // Fallback if any of the above methods should fail for some odd reason - addEvent(win, 'load', readyHandler); - } - - /** - * This class enables you to bind/unbind native events to elements and normalize it's behavior across browsers. - */ - function EventUtils() { - var self = this, events = {}, count, expando, hasFocusIn, hasMouseEnterLeave, mouseEnterLeave; - - expando = eventExpandoPrefix + (+new Date()).toString(32); - hasMouseEnterLeave = "onmouseenter" in document.documentElement; - hasFocusIn = "onfocusin" in document.documentElement; - mouseEnterLeave = {mouseenter: 'mouseover', mouseleave: 'mouseout'}; - count = 1; - - // State if the DOMContentLoaded was executed or not - self.domLoaded = false; - self.events = events; - - /** - * Executes all event handler callbacks for a specific event. - * - * @private - * @param {Event} evt Event object. - * @param {String} id Expando id value to look for. - */ - function executeHandlers(evt, id) { - var callbackList, i, l, callback, container = events[id]; - - callbackList = container && container[evt.type]; - if (callbackList) { - for (i = 0, l = callbackList.length; i < l; i++) { - callback = callbackList[i]; - - // Check if callback exists might be removed if a unbind is called inside the callback - if (callback && callback.func.call(callback.scope, evt) === false) { - evt.preventDefault(); - } - - // Should we stop propagation to immediate listeners - if (evt.isImmediatePropagationStopped()) { - return; - } - } - } - } - - /** - * Binds a callback to an event on the specified target. - * - * @method bind - * @param {Object} target Target node/window or custom object. - * @param {String} names Name of the event to bind. - * @param {function} callback Callback function to execute when the event occurs. - * @param {Object} scope Scope to call the callback function on, defaults to target. - * @return {function} Callback function that got bound. - */ - self.bind = function(target, names, callback, scope) { - var id, callbackList, i, name, fakeName, nativeHandler, capture, win = window; - - // Native event handler function patches the event and executes the callbacks for the expando - function defaultNativeHandler(evt) { - executeHandlers(fix(evt || win.event), id); - } - - // Don't bind to text nodes or comments - if (!target || target.nodeType === 3 || target.nodeType === 8) { - return; - } - - // Create or get events id for the target - if (!target[expando]) { - id = count++; - target[expando] = id; - events[id] = {}; - } else { - id = target[expando]; - } - - // Setup the specified scope or use the target as a default - scope = scope || target; - - // Split names and bind each event, enables you to bind multiple events with one call - names = names.split(' '); - i = names.length; - while (i--) { - name = names[i]; - nativeHandler = defaultNativeHandler; - fakeName = capture = false; - - // Use ready instead of DOMContentLoaded - if (name === "DOMContentLoaded") { - name = "ready"; - } - - // DOM is already ready - if (self.domLoaded && name === "ready" && target.readyState == 'complete') { - callback.call(scope, fix({type: name})); - continue; - } - - // Handle mouseenter/mouseleaver - if (!hasMouseEnterLeave) { - fakeName = mouseEnterLeave[name]; - - if (fakeName) { - nativeHandler = function(evt) { - var current, related; - - current = evt.currentTarget; - related = evt.relatedTarget; - - // Check if related is inside the current target if it's not then the event should - // be ignored since it's a mouseover/mouseout inside the element - if (related && current.contains) { - // Use contains for performance - related = current.contains(related); - } else { - while (related && related !== current) { - related = related.parentNode; - } - } - - // Fire fake event - if (!related) { - evt = fix(evt || win.event); - evt.type = evt.type === 'mouseout' ? 'mouseleave' : 'mouseenter'; - evt.target = current; - executeHandlers(evt, id); - } - }; - } - } - - // Fake bubbeling of focusin/focusout - if (!hasFocusIn && (name === "focusin" || name === "focusout")) { - capture = true; - fakeName = name === "focusin" ? "focus" : "blur"; - nativeHandler = function(evt) { - evt = fix(evt || win.event); - evt.type = evt.type === 'focus' ? 'focusin' : 'focusout'; - executeHandlers(evt, id); - }; - } - - // Setup callback list and bind native event - callbackList = events[id][name]; - if (!callbackList) { - events[id][name] = callbackList = [{func: callback, scope: scope}]; - callbackList.fakeName = fakeName; - callbackList.capture = capture; - - // Add the nativeHandler to the callback list so that we can later unbind it - callbackList.nativeHandler = nativeHandler; - - // Check if the target has native events support - - if (name === "ready") { - bindOnReady(target, nativeHandler, self); - } else { - addEvent(target, fakeName || name, nativeHandler, capture); - } - } else { - if (name === "ready" && self.domLoaded) { - callback({type: name}); - } else { - // If it already has an native handler then just push the callback - callbackList.push({func: callback, scope: scope}); - } - } - } - - target = callbackList = 0; // Clean memory for IE - - return callback; - }; - - /** - * Unbinds the specified event by name, name and callback or all events on the target. - * - * @method unbind - * @param {Object} target Target node/window or custom object. - * @param {String} names Optional event name to unbind. - * @param {function} callback Optional callback function to unbind. - * @return {EventUtils} Event utils instance. - */ - self.unbind = function(target, names, callback) { - var id, callbackList, i, ci, name, eventMap; - - // Don't bind to text nodes or comments - if (!target || target.nodeType === 3 || target.nodeType === 8) { - return self; - } - - // Unbind event or events if the target has the expando - id = target[expando]; - if (id) { - eventMap = events[id]; - - // Specific callback - if (names) { - names = names.split(' '); - i = names.length; - while (i--) { - name = names[i]; - callbackList = eventMap[name]; - - // Unbind the event if it exists in the map - if (callbackList) { - // Remove specified callback - if (callback) { - ci = callbackList.length; - while (ci--) { - if (callbackList[ci].func === callback) { - var nativeHandler = callbackList.nativeHandler; - var fakeName = callbackList.fakeName, capture = callbackList.capture; - - // Clone callbackList since unbind inside a callback would otherwise break the handlers loop - callbackList = callbackList.slice(0, ci).concat(callbackList.slice(ci + 1)); - callbackList.nativeHandler = nativeHandler; - callbackList.fakeName = fakeName; - callbackList.capture = capture; - - eventMap[name] = callbackList; - } - } - } - - // Remove all callbacks if there isn't a specified callback or there is no callbacks left - if (!callback || callbackList.length === 0) { - delete eventMap[name]; - removeEvent(target, callbackList.fakeName || name, callbackList.nativeHandler, callbackList.capture); - } - } - } - } else { - // All events for a specific element - for (name in eventMap) { - callbackList = eventMap[name]; - removeEvent(target, callbackList.fakeName || name, callbackList.nativeHandler, callbackList.capture); - } - - eventMap = {}; - } - - // Check if object is empty, if it isn't then we won't remove the expando map - for (name in eventMap) { - return self; - } - - // Delete event object - delete events[id]; - - // Remove expando from target - try { - // IE will fail here since it can't delete properties from window - delete target[expando]; - } catch (ex) { - // IE will set it to null - target[expando] = null; - } - } - - return self; - }; - - /** - * Fires the specified event on the specified target. - * - * @method fire - * @param {Object} target Target node/window or custom object. - * @param {String} name Event name to fire. - * @param {Object} args Optional arguments to send to the observers. - * @return {EventUtils} Event utils instance. - */ - self.fire = function(target, name, args) { - var id; - - // Don't bind to text nodes or comments - if (!target || target.nodeType === 3 || target.nodeType === 8) { - return self; - } - - // Build event object by patching the args - args = fix(null, args); - args.type = name; - args.target = target; - - do { - // Found an expando that means there is listeners to execute - id = target[expando]; - if (id) { - executeHandlers(args, id); - } - - // Walk up the DOM - target = target.parentNode || target.ownerDocument || target.defaultView || target.parentWindow; - } while (target && !args.isPropagationStopped()); - - return self; - }; - - /** - * Removes all bound event listeners for the specified target. This will also remove any bound - * listeners to child nodes within that target. - * - * @method clean - * @param {Object} target Target node/window object. - * @return {EventUtils} Event utils instance. - */ - self.clean = function(target) { - var i, children, unbind = self.unbind; - - // Don't bind to text nodes or comments - if (!target || target.nodeType === 3 || target.nodeType === 8) { - return self; - } - - // Unbind any element on the specificed target - if (target[expando]) { - unbind(target); - } - - // Target doesn't have getElementsByTagName it's probably a window object then use it's document to find the children - if (!target.getElementsByTagName) { - target = target.document; - } - - // Remove events from each child element - if (target && target.getElementsByTagName) { - unbind(target); - - children = target.getElementsByTagName('*'); - i = children.length; - while (i--) { - target = children[i]; - - if (target[expando]) { - unbind(target); - } - } - } - - return self; - }; - - /** - * Destroys the event object. Call this on IE to remove memory leaks. - */ - self.destroy = function() { - events = {}; - }; - - // Legacy function for canceling events - self.cancel = function(e) { - if (e) { - e.preventDefault(); - e.stopImmediatePropagation(); - } - - return false; - }; - } - - EventUtils.Event = new EventUtils(); - EventUtils.Event.bind(window, 'ready', function() {}); - - return EventUtils; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/Range.js b/common/static/js/vendor/tinymce/js/tinymce/classes/dom/Range.js deleted file mode 100755 index d9aab1674f1e..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/Range.js +++ /dev/null @@ -1,777 +0,0 @@ -/** - * Range.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("tinymce/dom/Range", [ - "tinymce/util/Tools" -], function(Tools) { - // Range constructor - function Range(dom) { - var self = this, - doc = dom.doc, - EXTRACT = 0, - CLONE = 1, - DELETE = 2, - TRUE = true, - FALSE = false, - START_OFFSET = 'startOffset', - START_CONTAINER = 'startContainer', - END_CONTAINER = 'endContainer', - END_OFFSET = 'endOffset', - extend = Tools.extend, - nodeIndex = dom.nodeIndex; - - function createDocumentFragment() { - return doc.createDocumentFragment(); - } - - function setStart(n, o) { - _setEndPoint(TRUE, n, o); - } - - function setEnd(n, o) { - _setEndPoint(FALSE, n, o); - } - - function setStartBefore(n) { - setStart(n.parentNode, nodeIndex(n)); - } - - function setStartAfter(n) { - setStart(n.parentNode, nodeIndex(n) + 1); - } - - function setEndBefore(n) { - setEnd(n.parentNode, nodeIndex(n)); - } - - function setEndAfter(n) { - setEnd(n.parentNode, nodeIndex(n) + 1); - } - - function collapse(ts) { - if (ts) { - self[END_CONTAINER] = self[START_CONTAINER]; - self[END_OFFSET] = self[START_OFFSET]; - } else { - self[START_CONTAINER] = self[END_CONTAINER]; - self[START_OFFSET] = self[END_OFFSET]; - } - - self.collapsed = TRUE; - } - - function selectNode(n) { - setStartBefore(n); - setEndAfter(n); - } - - function selectNodeContents(n) { - setStart(n, 0); - setEnd(n, n.nodeType === 1 ? n.childNodes.length : n.nodeValue.length); - } - - function compareBoundaryPoints(h, r) { - var sc = self[START_CONTAINER], so = self[START_OFFSET], ec = self[END_CONTAINER], eo = self[END_OFFSET], - rsc = r.startContainer, rso = r.startOffset, rec = r.endContainer, reo = r.endOffset; - - // Check START_TO_START - if (h === 0) { - return _compareBoundaryPoints(sc, so, rsc, rso); - } - - // Check START_TO_END - if (h === 1) { - return _compareBoundaryPoints(ec, eo, rsc, rso); - } - - // Check END_TO_END - if (h === 2) { - return _compareBoundaryPoints(ec, eo, rec, reo); - } - - // Check END_TO_START - if (h === 3) { - return _compareBoundaryPoints(sc, so, rec, reo); - } - } - - function deleteContents() { - _traverse(DELETE); - } - - function extractContents() { - return _traverse(EXTRACT); - } - - function cloneContents() { - return _traverse(CLONE); - } - - function insertNode(n) { - var startContainer = this[START_CONTAINER], - startOffset = this[START_OFFSET], nn, o; - - // Node is TEXT_NODE or CDATA - if ((startContainer.nodeType === 3 || startContainer.nodeType === 4) && startContainer.nodeValue) { - if (!startOffset) { - // At the start of text - startContainer.parentNode.insertBefore(n, startContainer); - } else if (startOffset >= startContainer.nodeValue.length) { - // At the end of text - dom.insertAfter(n, startContainer); - } else { - // Middle, need to split - nn = startContainer.splitText(startOffset); - startContainer.parentNode.insertBefore(n, nn); - } - } else { - // Insert element node - if (startContainer.childNodes.length > 0) { - o = startContainer.childNodes[startOffset]; - } - - if (o) { - startContainer.insertBefore(n, o); - } else { - if (startContainer.nodeType == 3) { - dom.insertAfter(n, startContainer); - } else { - startContainer.appendChild(n); - } - } - } - } - - function surroundContents(n) { - var f = self.extractContents(); - - self.insertNode(n); - n.appendChild(f); - self.selectNode(n); - } - - function cloneRange() { - return extend(new Range(dom), { - startContainer: self[START_CONTAINER], - startOffset: self[START_OFFSET], - endContainer: self[END_CONTAINER], - endOffset: self[END_OFFSET], - collapsed: self.collapsed, - commonAncestorContainer: self.commonAncestorContainer - }); - } - - // Private methods - - function _getSelectedNode(container, offset) { - var child; - - if (container.nodeType == 3 /* TEXT_NODE */) { - return container; - } - - if (offset < 0) { - return container; - } - - child = container.firstChild; - while (child && offset > 0) { - --offset; - child = child.nextSibling; - } - - if (child) { - return child; - } - - return container; - } - - function _isCollapsed() { - return (self[START_CONTAINER] == self[END_CONTAINER] && self[START_OFFSET] == self[END_OFFSET]); - } - - function _compareBoundaryPoints(containerA, offsetA, containerB, offsetB) { - var c, offsetC, n, cmnRoot, childA, childB; - - // In the first case the boundary-points have the same container. A is before B - // if its offset is less than the offset of B, A is equal to B if its offset is - // equal to the offset of B, and A is after B if its offset is greater than the - // offset of B. - if (containerA == containerB) { - if (offsetA == offsetB) { - return 0; // equal - } - - if (offsetA < offsetB) { - return -1; // before - } - - return 1; // after - } - - // In the second case a child node C of the container of A is an ancestor - // container of B. In this case, A is before B if the offset of A is less than or - // equal to the index of the child node C and A is after B otherwise. - c = containerB; - while (c && c.parentNode != containerA) { - c = c.parentNode; - } - - if (c) { - offsetC = 0; - n = containerA.firstChild; - - while (n != c && offsetC < offsetA) { - offsetC++; - n = n.nextSibling; - } - - if (offsetA <= offsetC) { - return -1; // before - } - - return 1; // after - } - - // In the third case a child node C of the container of B is an ancestor container - // of A. In this case, A is before B if the index of the child node C is less than - // the offset of B and A is after B otherwise. - c = containerA; - while (c && c.parentNode != containerB) { - c = c.parentNode; - } - - if (c) { - offsetC = 0; - n = containerB.firstChild; - - while (n != c && offsetC < offsetB) { - offsetC++; - n = n.nextSibling; - } - - if (offsetC < offsetB) { - return -1; // before - } - - return 1; // after - } - - // In the fourth case, none of three other cases hold: the containers of A and B - // are siblings or descendants of sibling nodes. In this case, A is before B if - // the container of A is before the container of B in a pre-order traversal of the - // Ranges' context tree and A is after B otherwise. - cmnRoot = dom.findCommonAncestor(containerA, containerB); - childA = containerA; - - while (childA && childA.parentNode != cmnRoot) { - childA = childA.parentNode; - } - - if (!childA) { - childA = cmnRoot; - } - - childB = containerB; - while (childB && childB.parentNode != cmnRoot) { - childB = childB.parentNode; - } - - if (!childB) { - childB = cmnRoot; - } - - if (childA == childB) { - return 0; // equal - } - - n = cmnRoot.firstChild; - while (n) { - if (n == childA) { - return -1; // before - } - - if (n == childB) { - return 1; // after - } - - n = n.nextSibling; - } - } - - function _setEndPoint(st, n, o) { - var ec, sc; - - if (st) { - self[START_CONTAINER] = n; - self[START_OFFSET] = o; - } else { - self[END_CONTAINER] = n; - self[END_OFFSET] = o; - } - - // If one boundary-point of a Range is set to have a root container - // other than the current one for the Range, the Range is collapsed to - // the new position. This enforces the restriction that both boundary- - // points of a Range must have the same root container. - ec = self[END_CONTAINER]; - while (ec.parentNode) { - ec = ec.parentNode; - } - - sc = self[START_CONTAINER]; - while (sc.parentNode) { - sc = sc.parentNode; - } - - if (sc == ec) { - // The start position of a Range is guaranteed to never be after the - // end position. To enforce this restriction, if the start is set to - // be at a position after the end, the Range is collapsed to that - // position. - if (_compareBoundaryPoints(self[START_CONTAINER], self[START_OFFSET], self[END_CONTAINER], self[END_OFFSET]) > 0) { - self.collapse(st); - } - } else { - self.collapse(st); - } - - self.collapsed = _isCollapsed(); - self.commonAncestorContainer = dom.findCommonAncestor(self[START_CONTAINER], self[END_CONTAINER]); - } - - function _traverse(how) { - var c, endContainerDepth = 0, startContainerDepth = 0, p, depthDiff, startNode, endNode, sp, ep; - - if (self[START_CONTAINER] == self[END_CONTAINER]) { - return _traverseSameContainer(how); - } - - for (c = self[END_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) { - if (p == self[START_CONTAINER]) { - return _traverseCommonStartContainer(c, how); - } - - ++endContainerDepth; - } - - for (c = self[START_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) { - if (p == self[END_CONTAINER]) { - return _traverseCommonEndContainer(c, how); - } - - ++startContainerDepth; - } - - depthDiff = startContainerDepth - endContainerDepth; - - startNode = self[START_CONTAINER]; - while (depthDiff > 0) { - startNode = startNode.parentNode; - depthDiff--; - } - - endNode = self[END_CONTAINER]; - while (depthDiff < 0) { - endNode = endNode.parentNode; - depthDiff++; - } - - // ascend the ancestor hierarchy until we have a common parent. - for (sp = startNode.parentNode, ep = endNode.parentNode; sp != ep; sp = sp.parentNode, ep = ep.parentNode) { - startNode = sp; - endNode = ep; - } - - return _traverseCommonAncestors(startNode, endNode, how); - } - - function _traverseSameContainer(how) { - var frag, s, sub, n, cnt, sibling, xferNode, start, len; - - if (how != DELETE) { - frag = createDocumentFragment(); - } - - // If selection is empty, just return the fragment - if (self[START_OFFSET] == self[END_OFFSET]) { - return frag; - } - - // Text node needs special case handling - if (self[START_CONTAINER].nodeType == 3 /* TEXT_NODE */) { - // get the substring - s = self[START_CONTAINER].nodeValue; - sub = s.substring(self[START_OFFSET], self[END_OFFSET]); - - // set the original text node to its new value - if (how != CLONE) { - n = self[START_CONTAINER]; - start = self[START_OFFSET]; - len = self[END_OFFSET] - self[START_OFFSET]; - - if (start === 0 && len >= n.nodeValue.length - 1) { - n.parentNode.removeChild(n); - } else { - n.deleteData(start, len); - } - - // Nothing is partially selected, so collapse to start point - self.collapse(TRUE); - } - - if (how == DELETE) { - return; - } - - if (sub.length > 0) { - frag.appendChild(doc.createTextNode(sub)); - } - - return frag; - } - - // Copy nodes between the start/end offsets. - n = _getSelectedNode(self[START_CONTAINER], self[START_OFFSET]); - cnt = self[END_OFFSET] - self[START_OFFSET]; - - while (n && cnt > 0) { - sibling = n.nextSibling; - xferNode = _traverseFullySelected(n, how); - - if (frag) { - frag.appendChild(xferNode); - } - - --cnt; - n = sibling; - } - - // Nothing is partially selected, so collapse to start point - if (how != CLONE) { - self.collapse(TRUE); - } - - return frag; - } - - function _traverseCommonStartContainer(endAncestor, how) { - var frag, n, endIdx, cnt, sibling, xferNode; - - if (how != DELETE) { - frag = createDocumentFragment(); - } - - n = _traverseRightBoundary(endAncestor, how); - - if (frag) { - frag.appendChild(n); - } - - endIdx = nodeIndex(endAncestor); - cnt = endIdx - self[START_OFFSET]; - - if (cnt <= 0) { - // Collapse to just before the endAncestor, which - // is partially selected. - if (how != CLONE) { - self.setEndBefore(endAncestor); - self.collapse(FALSE); - } - - return frag; - } - - n = endAncestor.previousSibling; - while (cnt > 0) { - sibling = n.previousSibling; - xferNode = _traverseFullySelected(n, how); - - if (frag) { - frag.insertBefore(xferNode, frag.firstChild); - } - - --cnt; - n = sibling; - } - - // Collapse to just before the endAncestor, which - // is partially selected. - if (how != CLONE) { - self.setEndBefore(endAncestor); - self.collapse(FALSE); - } - - return frag; - } - - function _traverseCommonEndContainer(startAncestor, how) { - var frag, startIdx, n, cnt, sibling, xferNode; - - if (how != DELETE) { - frag = createDocumentFragment(); - } - - n = _traverseLeftBoundary(startAncestor, how); - if (frag) { - frag.appendChild(n); - } - - startIdx = nodeIndex(startAncestor); - ++startIdx; // Because we already traversed it - - cnt = self[END_OFFSET] - startIdx; - n = startAncestor.nextSibling; - while (n && cnt > 0) { - sibling = n.nextSibling; - xferNode = _traverseFullySelected(n, how); - - if (frag) { - frag.appendChild(xferNode); - } - - --cnt; - n = sibling; - } - - if (how != CLONE) { - self.setStartAfter(startAncestor); - self.collapse(TRUE); - } - - return frag; - } - - function _traverseCommonAncestors(startAncestor, endAncestor, how) { - var n, frag, startOffset, endOffset, cnt, sibling, nextSibling; - - if (how != DELETE) { - frag = createDocumentFragment(); - } - - n = _traverseLeftBoundary(startAncestor, how); - if (frag) { - frag.appendChild(n); - } - - startOffset = nodeIndex(startAncestor); - endOffset = nodeIndex(endAncestor); - ++startOffset; - - cnt = endOffset - startOffset; - sibling = startAncestor.nextSibling; - - while (cnt > 0) { - nextSibling = sibling.nextSibling; - n = _traverseFullySelected(sibling, how); - - if (frag) { - frag.appendChild(n); - } - - sibling = nextSibling; - --cnt; - } - - n = _traverseRightBoundary(endAncestor, how); - - if (frag) { - frag.appendChild(n); - } - - if (how != CLONE) { - self.setStartAfter(startAncestor); - self.collapse(TRUE); - } - - return frag; - } - - function _traverseRightBoundary(root, how) { - var next = _getSelectedNode(self[END_CONTAINER], self[END_OFFSET] - 1), parent, clonedParent; - var prevSibling, clonedChild, clonedGrandParent, isFullySelected = next != self[END_CONTAINER]; - - if (next == root) { - return _traverseNode(next, isFullySelected, FALSE, how); - } - - parent = next.parentNode; - clonedParent = _traverseNode(parent, FALSE, FALSE, how); - - while (parent) { - while (next) { - prevSibling = next.previousSibling; - clonedChild = _traverseNode(next, isFullySelected, FALSE, how); - - if (how != DELETE) { - clonedParent.insertBefore(clonedChild, clonedParent.firstChild); - } - - isFullySelected = TRUE; - next = prevSibling; - } - - if (parent == root) { - return clonedParent; - } - - next = parent.previousSibling; - parent = parent.parentNode; - - clonedGrandParent = _traverseNode(parent, FALSE, FALSE, how); - - if (how != DELETE) { - clonedGrandParent.appendChild(clonedParent); - } - - clonedParent = clonedGrandParent; - } - } - - function _traverseLeftBoundary(root, how) { - var next = _getSelectedNode(self[START_CONTAINER], self[START_OFFSET]), isFullySelected = next != self[START_CONTAINER]; - var parent, clonedParent, nextSibling, clonedChild, clonedGrandParent; - - if (next == root) { - return _traverseNode(next, isFullySelected, TRUE, how); - } - - parent = next.parentNode; - clonedParent = _traverseNode(parent, FALSE, TRUE, how); - - while (parent) { - while (next) { - nextSibling = next.nextSibling; - clonedChild = _traverseNode(next, isFullySelected, TRUE, how); - - if (how != DELETE) { - clonedParent.appendChild(clonedChild); - } - - isFullySelected = TRUE; - next = nextSibling; - } - - if (parent == root) { - return clonedParent; - } - - next = parent.nextSibling; - parent = parent.parentNode; - - clonedGrandParent = _traverseNode(parent, FALSE, TRUE, how); - - if (how != DELETE) { - clonedGrandParent.appendChild(clonedParent); - } - - clonedParent = clonedGrandParent; - } - } - - function _traverseNode(n, isFullySelected, isLeft, how) { - var txtValue, newNodeValue, oldNodeValue, offset, newNode; - - if (isFullySelected) { - return _traverseFullySelected(n, how); - } - - if (n.nodeType == 3 /* TEXT_NODE */) { - txtValue = n.nodeValue; - - if (isLeft) { - offset = self[START_OFFSET]; - newNodeValue = txtValue.substring(offset); - oldNodeValue = txtValue.substring(0, offset); - } else { - offset = self[END_OFFSET]; - newNodeValue = txtValue.substring(0, offset); - oldNodeValue = txtValue.substring(offset); - } - - if (how != CLONE) { - n.nodeValue = oldNodeValue; - } - - if (how == DELETE) { - return; - } - - newNode = dom.clone(n, FALSE); - newNode.nodeValue = newNodeValue; - - return newNode; - } - - if (how == DELETE) { - return; - } - - return dom.clone(n, FALSE); - } - - function _traverseFullySelected(n, how) { - if (how != DELETE) { - return how == CLONE ? dom.clone(n, TRUE) : n; - } - - n.parentNode.removeChild(n); - } - - function toStringIE() { - return dom.create('body', null, cloneContents()).outerText; - } - - extend(self, { - // Inital states - startContainer: doc, - startOffset: 0, - endContainer: doc, - endOffset: 0, - collapsed: TRUE, - commonAncestorContainer: doc, - - // Range constants - START_TO_START: 0, - START_TO_END: 1, - END_TO_END: 2, - END_TO_START: 3, - - // Public methods - setStart: setStart, - setEnd: setEnd, - setStartBefore: setStartBefore, - setStartAfter: setStartAfter, - setEndBefore: setEndBefore, - setEndAfter: setEndAfter, - collapse: collapse, - selectNode: selectNode, - selectNodeContents: selectNodeContents, - compareBoundaryPoints: compareBoundaryPoints, - deleteContents: deleteContents, - extractContents: extractContents, - cloneContents: cloneContents, - insertNode: insertNode, - surroundContents: surroundContents, - cloneRange: cloneRange, - toStringIE: toStringIE - }); - - return self; - } - - // Older IE versions doesn't let you override toString by it's constructor so we have to stick it in the prototype - Range.prototype.toString = function() { - return this.toStringIE(); - }; - - return Range; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/RangeUtils.js b/common/static/js/vendor/tinymce/js/tinymce/classes/dom/RangeUtils.js deleted file mode 100755 index 42d39f91f8bf..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/RangeUtils.js +++ /dev/null @@ -1,476 +0,0 @@ -/** - * Range.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * RangeUtils - * - * @class tinymce.dom.RangeUtils - * @private - */ -define("tinymce/dom/RangeUtils", [ - "tinymce/util/Tools", - "tinymce/dom/TreeWalker" -], function(Tools, TreeWalker) { - var each = Tools.each; - - function RangeUtils(dom) { - /** - * Walks the specified range like object and executes the callback for each sibling collection it finds. - * - * @method walk - * @param {Object} rng Range like object. - * @param {function} callback Callback function to execute for each sibling collection. - */ - this.walk = function(rng, callback) { - var startContainer = rng.startContainer, - startOffset = rng.startOffset, - endContainer = rng.endContainer, - endOffset = rng.endOffset, - ancestor, startPoint, - endPoint, node, parent, siblings, nodes; - - // Handle table cell selection the table plugin enables - // you to fake select table cells and perform formatting actions on them - nodes = dom.select('td.mce-item-selected,th.mce-item-selected'); - if (nodes.length > 0) { - each(nodes, function(node) { - callback([node]); - }); - - return; - } - - /** - * Excludes start/end text node if they are out side the range - * - * @private - * @param {Array} nodes Nodes to exclude items from. - * @return {Array} Array with nodes excluding the start/end container if needed. - */ - function exclude(nodes) { - var node; - - // First node is excluded - node = nodes[0]; - if (node.nodeType === 3 && node === startContainer && startOffset >= node.nodeValue.length) { - nodes.splice(0, 1); - } - - // Last node is excluded - node = nodes[nodes.length - 1]; - if (endOffset === 0 && nodes.length > 0 && node === endContainer && node.nodeType === 3) { - nodes.splice(nodes.length - 1, 1); - } - - return nodes; - } - - /** - * Collects siblings - * - * @private - * @param {Node} node Node to collect siblings from. - * @param {String} name Name of the sibling to check for. - * @return {Array} Array of collected siblings. - */ - function collectSiblings(node, name, end_node) { - var siblings = []; - - for (; node && node != end_node; node = node[name]) { - siblings.push(node); - } - - return siblings; - } - - /** - * Find an end point this is the node just before the common ancestor root. - * - * @private - * @param {Node} node Node to start at. - * @param {Node} root Root/ancestor element to stop just before. - * @return {Node} Node just before the root element. - */ - function findEndPoint(node, root) { - do { - if (node.parentNode == root) { - return node; - } - - node = node.parentNode; - } while(node); - } - - function walkBoundary(start_node, end_node, next) { - var siblingName = next ? 'nextSibling' : 'previousSibling'; - - for (node = start_node, parent = node.parentNode; node && node != end_node; node = parent) { - parent = node.parentNode; - siblings = collectSiblings(node == start_node ? node : node[siblingName], siblingName); - - if (siblings.length) { - if (!next) { - siblings.reverse(); - } - - callback(exclude(siblings)); - } - } - } - - // If index based start position then resolve it - if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) { - startContainer = startContainer.childNodes[startOffset]; - } - - // If index based end position then resolve it - if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) { - endContainer = endContainer.childNodes[Math.min(endOffset - 1, endContainer.childNodes.length - 1)]; - } - - // Same container - if (startContainer == endContainer) { - return callback(exclude([startContainer])); - } - - // Find common ancestor and end points - ancestor = dom.findCommonAncestor(startContainer, endContainer); - - // Process left side - for (node = startContainer; node; node = node.parentNode) { - if (node === endContainer) { - return walkBoundary(startContainer, ancestor, true); - } - - if (node === ancestor) { - break; - } - } - - // Process right side - for (node = endContainer; node; node = node.parentNode) { - if (node === startContainer) { - return walkBoundary(endContainer, ancestor); - } - - if (node === ancestor) { - break; - } - } - - // Find start/end point - startPoint = findEndPoint(startContainer, ancestor) || startContainer; - endPoint = findEndPoint(endContainer, ancestor) || endContainer; - - // Walk left leaf - walkBoundary(startContainer, startPoint, true); - - // Walk the middle from start to end point - siblings = collectSiblings( - startPoint == startContainer ? startPoint : startPoint.nextSibling, - 'nextSibling', - endPoint == endContainer ? endPoint.nextSibling : endPoint - ); - - if (siblings.length) { - callback(exclude(siblings)); - } - - // Walk right leaf - walkBoundary(endContainer, endPoint); - }; - - /** - * Splits the specified range at it's start/end points. - * - * @private - * @param {Range/RangeObject} rng Range to split. - * @return {Object} Range position object. - */ - this.split = function(rng) { - var startContainer = rng.startContainer, - startOffset = rng.startOffset, - endContainer = rng.endContainer, - endOffset = rng.endOffset; - - function splitText(node, offset) { - return node.splitText(offset); - } - - // Handle single text node - if (startContainer == endContainer && startContainer.nodeType == 3) { - if (startOffset > 0 && startOffset < startContainer.nodeValue.length) { - endContainer = splitText(startContainer, startOffset); - startContainer = endContainer.previousSibling; - - if (endOffset > startOffset) { - endOffset = endOffset - startOffset; - startContainer = endContainer = splitText(endContainer, endOffset).previousSibling; - endOffset = endContainer.nodeValue.length; - startOffset = 0; - } else { - endOffset = 0; - } - } - } else { - // Split startContainer text node if needed - if (startContainer.nodeType == 3 && startOffset > 0 && startOffset < startContainer.nodeValue.length) { - startContainer = splitText(startContainer, startOffset); - startOffset = 0; - } - - // Split endContainer text node if needed - if (endContainer.nodeType == 3 && endOffset > 0 && endOffset < endContainer.nodeValue.length) { - endContainer = splitText(endContainer, endOffset).previousSibling; - endOffset = endContainer.nodeValue.length; - } - } - - return { - startContainer: startContainer, - startOffset: startOffset, - endContainer: endContainer, - endOffset: endOffset - }; - }; - - /** - * Normalizes the specified range by finding the closest best suitable caret location. - * - * @private - * @param {Range} rng Range to normalize. - * @return {Boolean} True/false if the specified range was normalized or not. - */ - this.normalize = function(rng) { - var normalized, collapsed; - - function normalizeEndPoint(start) { - var container, offset, walker, body = dom.getRoot(), node, nonEmptyElementsMap, nodeName; - var directionLeft, isAfterNode; - - function hasBrBeforeAfter(node, left) { - var walker = new TreeWalker(node, dom.getParent(node.parentNode, dom.isBlock) || body); - - while ((node = walker[left ? 'prev' : 'next']())) { - if (node.nodeName === "BR") { - return true; - } - } - } - - function isPrevNode(node, name) { - return node.previousSibling && node.previousSibling.nodeName == name; - } - - // Walks the dom left/right to find a suitable text node to move the endpoint into - // It will only walk within the current parent block or body and will stop if it hits a block or a BR/IMG - function findTextNodeRelative(left, startNode) { - var walker, lastInlineElement, parentBlockContainer; - - startNode = startNode || container; - parentBlockContainer = dom.getParent(startNode.parentNode, dom.isBlock) || body; - - // Lean left before the BR element if it's the only BR within a block element. Gecko bug: #6680 - // This:


|

becomes

|

- if (left && startNode.nodeName == 'BR' && isAfterNode && dom.isEmpty(parentBlockContainer)) { - container = startNode.parentNode; - offset = dom.nodeIndex(startNode); - normalized = true; - return; - } - - // Walk left until we hit a text node we can move to or a block/br/img - walker = new TreeWalker(startNode, parentBlockContainer); - while ((node = walker[left ? 'prev' : 'next']())) { - // Found text node that has a length - if (node.nodeType === 3 && node.nodeValue.length > 0) { - container = node; - offset = left ? node.nodeValue.length : 0; - normalized = true; - return; - } - - // Break if we find a block or a BR/IMG/INPUT etc - if (dom.isBlock(node) || nonEmptyElementsMap[node.nodeName.toLowerCase()]) { - return; - } - - lastInlineElement = node; - } - - // Only fetch the last inline element when in caret mode for now - if (collapsed && lastInlineElement) { - container = lastInlineElement; - normalized = true; - offset = 0; - } - } - - container = rng[(start ? 'start' : 'end') + 'Container']; - offset = rng[(start ? 'start' : 'end') + 'Offset']; - isAfterNode = container.nodeType == 1 && offset === container.childNodes.length; - nonEmptyElementsMap = dom.schema.getNonEmptyElements(); - directionLeft = start; - - if (container.nodeType == 1 && offset > container.childNodes.length - 1) { - directionLeft = false; - } - - // If the container is a document move it to the body element - if (container.nodeType === 9) { - container = dom.getRoot(); - offset = 0; - } - - // If the container is body try move it into the closest text node or position - if (container === body) { - // If start is before/after a image, table etc - if (directionLeft) { - node = container.childNodes[offset > 0 ? offset - 1 : 0]; - if (node) { - nodeName = node.nodeName.toLowerCase(); - if (nonEmptyElementsMap[node.nodeName] || node.nodeName == "TABLE") { - return; - } - } - } - - // Resolve the index - if (container.hasChildNodes()) { - offset = Math.min(!directionLeft && offset > 0 ? offset - 1 : offset, container.childNodes.length - 1); - container = container.childNodes[offset]; - offset = 0; - - // Don't walk into elements that doesn't have any child nodes like a IMG - if (container.hasChildNodes() && !/TABLE/.test(container.nodeName)) { - // Walk the DOM to find a text node to place the caret at or a BR - node = container; - walker = new TreeWalker(container, body); - - do { - // Found a text node use that position - if (node.nodeType === 3 && node.nodeValue.length > 0) { - offset = directionLeft ? 0 : node.nodeValue.length; - container = node; - normalized = true; - break; - } - - // Found a BR/IMG element that we can place the caret before - if (nonEmptyElementsMap[node.nodeName.toLowerCase()]) { - offset = dom.nodeIndex(node); - container = node.parentNode; - - // Put caret after image when moving the end point - if (node.nodeName == "IMG" && !directionLeft) { - offset++; - } - - normalized = true; - break; - } - } while ((node = (directionLeft ? walker.next() : walker.prev()))); - } - } - } - - // Lean the caret to the left if possible - if (collapsed) { - // So this: x|x - // Becomes: x|x - // Seems that only gecko has issues with this - if (container.nodeType === 3 && offset === 0) { - findTextNodeRelative(true); - } - - // Lean left into empty inline elements when the caret is before a BR - // So this: |
- // Becomes: |
- // Seems that only gecko has issues with this. - // Special edge case for

x|

since we don't want

x|

- if (container.nodeType === 1) { - node = container.childNodes[offset]; - - // Offset is after the containers last child - // then use the previous child for normalization - if (!node) { - node = container.childNodes[offset - 1]; - } - - if (node && node.nodeName === 'BR' && !isPrevNode(node, 'A') && - !hasBrBeforeAfter(node) && !hasBrBeforeAfter(node, true)) { - findTextNodeRelative(true, node); - } - } - } - - // Lean the start of the selection right if possible - // So this: x[x] - // Becomes: x[x] - if (directionLeft && !collapsed && container.nodeType === 3 && offset === container.nodeValue.length) { - findTextNodeRelative(false); - } - - // Set endpoint if it was normalized - if (normalized) { - rng['set' + (start ? 'Start' : 'End')](container, offset); - } - } - - collapsed = rng.collapsed; - - normalizeEndPoint(true); - - if (!collapsed) { - normalizeEndPoint(); - } - - // If it was collapsed then make sure it still is - if (normalized && collapsed) { - rng.collapse(true); - } - - return normalized; - }; - } - - /** - * Compares two ranges and checks if they are equal. - * - * @static - * @method compareRanges - * @param {DOMRange} rng1 First range to compare. - * @param {DOMRange} rng2 First range to compare. - * @return {Boolean} true/false if the ranges are equal. - */ - RangeUtils.compareRanges = function(rng1, rng2) { - if (rng1 && rng2) { - // Compare native IE ranges - if (rng1.item || rng1.duplicate) { - // Both are control ranges and the selected element matches - if (rng1.item && rng2.item && rng1.item(0) === rng2.item(0)) { - return true; - } - - // Both are text ranges and the range matches - if (rng1.isEqual && rng2.isEqual && rng2.isEqual(rng1)) { - return true; - } - } else { - // Compare w3c ranges - return rng1.startContainer == rng2.startContainer && rng1.startOffset == rng2.startOffset; - } - } - - return false; - }; - - return RangeUtils; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/ScriptLoader.js b/common/static/js/vendor/tinymce/js/tinymce/classes/dom/ScriptLoader.js deleted file mode 100755 index 89c04669719e..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/ScriptLoader.js +++ /dev/null @@ -1,255 +0,0 @@ -/** - * ScriptLoader.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*globals console*/ - -/** - * This class handles asynchronous/synchronous loading of JavaScript files it will execute callbacks - * when various items gets loaded. This class is useful to load external JavaScript files. - * - * @class tinymce.dom.ScriptLoader - * @example - * // Load a script from a specific URL using the global script loader - * tinymce.ScriptLoader.load('somescript.js'); - * - * // Load a script using a unique instance of the script loader - * var scriptLoader = new tinymce.dom.ScriptLoader(); - * - * scriptLoader.load('somescript.js'); - * - * // Load multiple scripts - * var scriptLoader = new tinymce.dom.ScriptLoader(); - * - * scriptLoader.add('somescript1.js'); - * scriptLoader.add('somescript2.js'); - * scriptLoader.add('somescript3.js'); - * - * scriptLoader.loadQueue(function() { - * alert('All scripts are now loaded.'); - * }); - */ -define("tinymce/dom/ScriptLoader", [ - "tinymce/dom/DOMUtils", - "tinymce/util/Tools" -], function(DOMUtils, Tools) { - var DOM = DOMUtils.DOM; - var each = Tools.each, grep = Tools.grep; - - function ScriptLoader() { - var QUEUED = 0, - LOADING = 1, - LOADED = 2, - states = {}, - queue = [], - scriptLoadedCallbacks = {}, - queueLoadedCallbacks = [], - loading = 0, - undef; - - /** - * Loads a specific script directly without adding it to the load queue. - * - * @method load - * @param {String} url Absolute URL to script to add. - * @param {function} callback Optional callback function to execute ones this script gets loaded. - * @param {Object} scope Optional scope to execute callback in. - */ - function loadScript(url, callback) { - var dom = DOM, elm, id; - - // Execute callback when script is loaded - function done() { - dom.remove(id); - - if (elm) { - elm.onreadystatechange = elm.onload = elm = null; - } - - callback(); - } - - function error() { - /*eslint no-console:0 */ - - // Report the error so it's easier for people to spot loading errors - if (typeof(console) !== "undefined" && console.log) { - console.log("Failed to load: " + url); - } - - // We can't mark it as done if there is a load error since - // A) We don't want to produce 404 errors on the server and - // B) the onerror event won't fire on all browsers. - // done(); - } - - id = dom.uniqueId(); - - // Create new script element - elm = document.createElement('script'); - elm.id = id; - elm.type = 'text/javascript'; - elm.src = url; - - // Seems that onreadystatechange works better on IE 10 onload seems to fire incorrectly - if ("onreadystatechange" in elm) { - elm.onreadystatechange = function() { - if (/loaded|complete/.test(elm.readyState)) { - done(); - } - }; - } else { - elm.onload = done; - } - - // Add onerror event will get fired on some browsers but not all of them - elm.onerror = error; - - // Add script to document - (document.getElementsByTagName('head')[0] || document.body).appendChild(elm); - } - - /** - * Returns true/false if a script has been loaded or not. - * - * @method isDone - * @param {String} url URL to check for. - * @return {Boolean} true/false if the URL is loaded. - */ - this.isDone = function(url) { - return states[url] == LOADED; - }; - - /** - * Marks a specific script to be loaded. This can be useful if a script got loaded outside - * the script loader or to skip it from loading some script. - * - * @method markDone - * @param {string} u Absolute URL to the script to mark as loaded. - */ - this.markDone = function(url) { - states[url] = LOADED; - }; - - /** - * Adds a specific script to the load queue of the script loader. - * - * @method add - * @param {String} url Absolute URL to script to add. - * @param {function} callback Optional callback function to execute ones this script gets loaded. - * @param {Object} scope Optional scope to execute callback in. - */ - this.add = this.load = function(url, callback, scope) { - var state = states[url]; - - // Add url to load queue - if (state == undef) { - queue.push(url); - states[url] = QUEUED; - } - - if (callback) { - // Store away callback for later execution - if (!scriptLoadedCallbacks[url]) { - scriptLoadedCallbacks[url] = []; - } - - scriptLoadedCallbacks[url].push({ - func: callback, - scope: scope || this - }); - } - }; - - /** - * Starts the loading of the queue. - * - * @method loadQueue - * @param {function} callback Optional callback to execute when all queued items are loaded. - * @param {Object} scope Optional scope to execute the callback in. - */ - this.loadQueue = function(callback, scope) { - this.loadScripts(queue, callback, scope); - }; - - /** - * Loads the specified queue of files and executes the callback ones they are loaded. - * This method is generally not used outside this class but it might be useful in some scenarios. - * - * @method loadScripts - * @param {Array} scripts Array of queue items to load. - * @param {function} callback Optional callback to execute ones all items are loaded. - * @param {Object} scope Optional scope to execute callback in. - */ - this.loadScripts = function(scripts, callback, scope) { - var loadScripts; - - function execScriptLoadedCallbacks(url) { - // Execute URL callback functions - each(scriptLoadedCallbacks[url], function(callback) { - callback.func.call(callback.scope); - }); - - scriptLoadedCallbacks[url] = undef; - } - - queueLoadedCallbacks.push({ - func: callback, - scope: scope || this - }); - - loadScripts = function() { - var loadingScripts = grep(scripts); - - // Current scripts has been handled - scripts.length = 0; - - // Load scripts that needs to be loaded - each(loadingScripts, function(url) { - // Script is already loaded then execute script callbacks directly - if (states[url] == LOADED) { - execScriptLoadedCallbacks(url); - return; - } - - // Is script not loading then start loading it - if (states[url] != LOADING) { - states[url] = LOADING; - loading++; - - loadScript(url, function() { - states[url] = LOADED; - loading--; - - execScriptLoadedCallbacks(url); - - // Load more scripts if they where added by the recently loaded script - loadScripts(); - }); - } - }); - - // No scripts are currently loading then execute all pending queue loaded callbacks - if (!loading) { - each(queueLoadedCallbacks, function(callback) { - callback.func.call(callback.scope); - }); - - queueLoadedCallbacks.length = 0; - } - }; - - loadScripts(); - }; - } - - ScriptLoader.ScriptLoader = new ScriptLoader(); - - return ScriptLoader; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/Selection.js b/common/static/js/vendor/tinymce/js/tinymce/classes/dom/Selection.js deleted file mode 100755 index aa132875d547..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/Selection.js +++ /dev/null @@ -1,1259 +0,0 @@ -/** - * Selection.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class handles text and control selection it's an crossbrowser utility class. - * Consult the TinyMCE Wiki API for more details and examples on how to use this class. - * - * @class tinymce.dom.Selection - * @example - * // Getting the currently selected node for the active editor - * alert(tinymce.activeEditor.selection.getNode().nodeName); - */ -define("tinymce/dom/Selection", [ - "tinymce/dom/TreeWalker", - "tinymce/dom/TridentSelection", - "tinymce/dom/ControlSelection", - "tinymce/dom/RangeUtils", - "tinymce/Env", - "tinymce/util/Tools" -], function(TreeWalker, TridentSelection, ControlSelection, RangeUtils, Env, Tools) { - var each = Tools.each, grep = Tools.grep, trim = Tools.trim; - var isIE = Env.ie, isOpera = Env.opera; - - /** - * Constructs a new selection instance. - * - * @constructor - * @method Selection - * @param {tinymce.dom.DOMUtils} dom DOMUtils object reference. - * @param {Window} win Window to bind the selection object to. - * @param {tinymce.dom.Serializer} serializer DOM serialization class to use for getContent. - */ - function Selection(dom, win, serializer, editor) { - var self = this; - - self.dom = dom; - self.win = win; - self.serializer = serializer; - self.editor = editor; - - self.controlSelection = new ControlSelection(self, editor); - - // No W3C Range support - if (!self.win.getSelection) { - self.tridentSel = new TridentSelection(self); - } - } - - Selection.prototype = { - /** - * Move the selection cursor range to the specified node and offset. - * If there is no node specified it will move it to the first suitable location within the body. - * - * @method setCursorLocation - * @param {Node} node Optional node to put the cursor in. - * @param {Number} offset Optional offset from the start of the node to put the cursor at. - */ - setCursorLocation: function(node, offset) { - var self = this, rng = self.dom.createRng(); - - if (!node) { - self._moveEndPoint(rng, self.editor.getBody(), true); - self.setRng(rng); - } else { - rng.setStart(node, offset); - rng.setEnd(node, offset); - self.setRng(rng); - self.collapse(false); - } - }, - - /** - * Returns the selected contents using the DOM serializer passed in to this class. - * - * @method getContent - * @param {Object} s Optional settings class with for example output format text or html. - * @return {String} Selected contents in for example HTML format. - * @example - * // Alerts the currently selected contents - * alert(tinymce.activeEditor.selection.getContent()); - * - * // Alerts the currently selected contents as plain text - * alert(tinymce.activeEditor.selection.getContent({format: 'text'})); - */ - getContent: function(args) { - var self = this, rng = self.getRng(), tmpElm = self.dom.create("body"); - var se = self.getSel(), whiteSpaceBefore, whiteSpaceAfter, fragment; - - args = args || {}; - whiteSpaceBefore = whiteSpaceAfter = ''; - args.get = true; - args.format = args.format || 'html'; - args.selection = true; - self.editor.fire('BeforeGetContent', args); - - if (args.format == 'text') { - return self.isCollapsed() ? '' : (rng.text || (se.toString ? se.toString() : '')); - } - - if (rng.cloneContents) { - fragment = rng.cloneContents(); - - if (fragment) { - tmpElm.appendChild(fragment); - } - } else if (rng.item !== undefined || rng.htmlText !== undefined) { - // IE will produce invalid markup if elements are present that - // it doesn't understand like custom elements or HTML5 elements. - // Adding a BR in front of the contents and then remoiving it seems to fix it though. - tmpElm.innerHTML = '
' + (rng.item ? rng.item(0).outerHTML : rng.htmlText); - tmpElm.removeChild(tmpElm.firstChild); - } else { - tmpElm.innerHTML = rng.toString(); - } - - // Keep whitespace before and after - if (/^\s/.test(tmpElm.innerHTML)) { - whiteSpaceBefore = ' '; - } - - if (/\s+$/.test(tmpElm.innerHTML)) { - whiteSpaceAfter = ' '; - } - - args.getInner = true; - - args.content = self.isCollapsed() ? '' : whiteSpaceBefore + self.serializer.serialize(tmpElm, args) + whiteSpaceAfter; - self.editor.fire('GetContent', args); - - return args.content; - }, - - /** - * Sets the current selection to the specified content. If any contents is selected it will be replaced - * with the contents passed in to this function. If there is no selection the contents will be inserted - * where the caret is placed in the editor/page. - * - * @method setContent - * @param {String} content HTML contents to set could also be other formats depending on settings. - * @param {Object} args Optional settings object with for example data format. - * @example - * // Inserts some HTML contents at the current selection - * tinymce.activeEditor.selection.setContent('Some contents'); - */ - setContent: function(content, args) { - var self = this, rng = self.getRng(), caretNode, doc = self.win.document, frag, temp; - - args = args || {format: 'html'}; - args.set = true; - args.selection = true; - content = args.content = content; - - // Dispatch before set content event - if (!args.no_events) { - self.editor.fire('BeforeSetContent', args); - } - - content = args.content; - - if (rng.insertNode) { - // Make caret marker since insertNode places the caret in the beginning of text after insert - content += '_'; - - // Delete and insert new node - if (rng.startContainer == doc && rng.endContainer == doc) { - // WebKit will fail if the body is empty since the range is then invalid and it can't insert contents - doc.body.innerHTML = content; - } else { - rng.deleteContents(); - - if (doc.body.childNodes.length === 0) { - doc.body.innerHTML = content; - } else { - // createContextualFragment doesn't exists in IE 9 DOMRanges - if (rng.createContextualFragment) { - rng.insertNode(rng.createContextualFragment(content)); - } else { - // Fake createContextualFragment call in IE 9 - frag = doc.createDocumentFragment(); - temp = doc.createElement('div'); - - frag.appendChild(temp); - temp.outerHTML = content; - - rng.insertNode(frag); - } - } - } - - // Move to caret marker - caretNode = self.dom.get('__caret'); - - // Make sure we wrap it compleatly, Opera fails with a simple select call - rng = doc.createRange(); - rng.setStartBefore(caretNode); - rng.setEndBefore(caretNode); - self.setRng(rng); - - // Remove the caret position - self.dom.remove('__caret'); - - try { - self.setRng(rng); - } catch (ex) { - // Might fail on Opera for some odd reason - } - } else { - if (rng.item) { - // Delete content and get caret text selection - doc.execCommand('Delete', false, null); - rng = self.getRng(); - } - - // Explorer removes spaces from the beginning of pasted contents - if (/^\s+/.test(content)) { - rng.pasteHTML('_' + content); - self.dom.remove('__mce_tmp'); - } else { - rng.pasteHTML(content); - } - } - - // Dispatch set content event - if (!args.no_events) { - self.editor.fire('SetContent', args); - } - }, - - /** - * Returns the start element of a selection range. If the start is in a text - * node the parent element will be returned. - * - * @method getStart - * @return {Element} Start element of selection range. - */ - getStart: function() { - var self = this, rng = self.getRng(), startElement, parentElement, checkRng, node; - - if (rng.duplicate || rng.item) { - // Control selection, return first item - if (rng.item) { - return rng.item(0); - } - - // Get start element - checkRng = rng.duplicate(); - checkRng.collapse(1); - startElement = checkRng.parentElement(); - if (startElement.ownerDocument !== self.dom.doc) { - startElement = self.dom.getRoot(); - } - - // Check if range parent is inside the start element, then return the inner parent element - // This will fix issues when a single element is selected, IE would otherwise return the wrong start element - parentElement = node = rng.parentElement(); - while ((node = node.parentNode)) { - if (node == startElement) { - startElement = parentElement; - break; - } - } - - return startElement; - } else { - startElement = rng.startContainer; - - if (startElement.nodeType == 1 && startElement.hasChildNodes()) { - startElement = startElement.childNodes[Math.min(startElement.childNodes.length - 1, rng.startOffset)]; - } - - if (startElement && startElement.nodeType == 3) { - return startElement.parentNode; - } - - return startElement; - } - }, - - /** - * Returns the end element of a selection range. If the end is in a text - * node the parent element will be returned. - * - * @method getEnd - * @return {Element} End element of selection range. - */ - getEnd: function() { - var self = this, rng = self.getRng(), endElement, endOffset; - - if (rng.duplicate || rng.item) { - if (rng.item) { - return rng.item(0); - } - - rng = rng.duplicate(); - rng.collapse(0); - endElement = rng.parentElement(); - if (endElement.ownerDocument !== self.dom.doc) { - endElement = self.dom.getRoot(); - } - - if (endElement && endElement.nodeName == 'BODY') { - return endElement.lastChild || endElement; - } - - return endElement; - } else { - endElement = rng.endContainer; - endOffset = rng.endOffset; - - if (endElement.nodeType == 1 && endElement.hasChildNodes()) { - endElement = endElement.childNodes[endOffset > 0 ? endOffset - 1 : endOffset]; - } - - if (endElement && endElement.nodeType == 3) { - return endElement.parentNode; - } - - return endElement; - } - }, - - /** - * Returns a bookmark location for the current selection. This bookmark object - * can then be used to restore the selection after some content modification to the document. - * - * @method getBookmark - * @param {Number} type Optional state if the bookmark should be simple or not. Default is complex. - * @param {Boolean} normalized Optional state that enables you to get a position that it would be after normalization. - * @return {Object} Bookmark object, use moveToBookmark with this object to restore the selection. - * @example - * // Stores a bookmark of the current selection - * var bm = tinymce.activeEditor.selection.getBookmark(); - * - * tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'Some new content'); - * - * // Restore the selection bookmark - * tinymce.activeEditor.selection.moveToBookmark(bm); - */ - getBookmark: function(type, normalized) { - var self = this, dom = self.dom, rng, rng2, id, collapsed, name, element, chr = '', styles; - - function findIndex(name, element) { - var index = 0; - - each(dom.select(name), function(node, i) { - if (node == element) { - index = i; - } - }); - - return index; - } - - function normalizeTableCellSelection(rng) { - function moveEndPoint(start) { - var container, offset, childNodes, prefix = start ? 'start' : 'end'; - - container = rng[prefix + 'Container']; - offset = rng[prefix + 'Offset']; - - if (container.nodeType == 1 && container.nodeName == "TR") { - childNodes = container.childNodes; - container = childNodes[Math.min(start ? offset : offset - 1, childNodes.length - 1)]; - if (container) { - offset = start ? 0 : container.childNodes.length; - rng['set' + (start ? 'Start' : 'End')](container, offset); - } - } - } - - moveEndPoint(true); - moveEndPoint(); - - return rng; - } - - function getLocation() { - var rng = self.getRng(true), root = dom.getRoot(), bookmark = {}; - - function getPoint(rng, start) { - var container = rng[start ? 'startContainer' : 'endContainer'], - offset = rng[start ? 'startOffset' : 'endOffset'], point = [], node, childNodes, after = 0; - - if (container.nodeType == 3) { - if (normalized) { - for (node = container.previousSibling; node && node.nodeType == 3; node = node.previousSibling) { - offset += node.nodeValue.length; - } - } - - point.push(offset); - } else { - childNodes = container.childNodes; - - if (offset >= childNodes.length && childNodes.length) { - after = 1; - offset = Math.max(0, childNodes.length - 1); - } - - point.push(self.dom.nodeIndex(childNodes[offset], normalized) + after); - } - - for (; container && container != root; container = container.parentNode) { - point.push(self.dom.nodeIndex(container, normalized)); - } - - return point; - } - - bookmark.start = getPoint(rng, true); - - if (!self.isCollapsed()) { - bookmark.end = getPoint(rng); - } - - return bookmark; - } - - if (type == 2) { - element = self.getNode(); - name = element ? element.nodeName : null; - - if (name == 'IMG') { - return {name: name, index: findIndex(name, element)}; - } - - if (self.tridentSel) { - return self.tridentSel.getBookmark(type); - } - - return getLocation(); - } - - // Handle simple range - if (type) { - return {rng: self.getRng()}; - } - - rng = self.getRng(); - id = dom.uniqueId(); - collapsed = self.isCollapsed(); - styles = 'overflow:hidden;line-height:0px'; - - // Explorer method - if (rng.duplicate || rng.item) { - // Text selection - if (!rng.item) { - rng2 = rng.duplicate(); - - try { - // Insert start marker - rng.collapse(); - rng.pasteHTML('' + chr + ''); - - // Insert end marker - if (!collapsed) { - rng2.collapse(false); - - // Detect the empty space after block elements in IE and move the - // end back one character

] becomes

]

- rng.moveToElementText(rng2.parentElement()); - if (rng.compareEndPoints('StartToEnd', rng2) === 0) { - rng2.move('character', -1); - } - - rng2.pasteHTML('' + chr + ''); - } - } catch (ex) { - // IE might throw unspecified error so lets ignore it - return null; - } - } else { - // Control selection - element = rng.item(0); - name = element.nodeName; - - return {name: name, index: findIndex(name, element)}; - } - } else { - element = self.getNode(); - name = element.nodeName; - if (name == 'IMG') { - return {name: name, index: findIndex(name, element)}; - } - - // W3C method - rng2 = normalizeTableCellSelection(rng.cloneRange()); - - // Insert end marker - if (!collapsed) { - rng2.collapse(false); - rng2.insertNode(dom.create('span', {'data-mce-type': "bookmark", id: id + '_end', style: styles}, chr)); - } - - rng = normalizeTableCellSelection(rng); - rng.collapse(true); - rng.insertNode(dom.create('span', {'data-mce-type': "bookmark", id: id + '_start', style: styles}, chr)); - } - - self.moveToBookmark({id: id, keep: 1}); - - return {id: id}; - }, - - /** - * Restores the selection to the specified bookmark. - * - * @method moveToBookmark - * @param {Object} bookmark Bookmark to restore selection from. - * @return {Boolean} true/false if it was successful or not. - * @example - * // Stores a bookmark of the current selection - * var bm = tinymce.activeEditor.selection.getBookmark(); - * - * tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'Some new content'); - * - * // Restore the selection bookmark - * tinymce.activeEditor.selection.moveToBookmark(bm); - */ - moveToBookmark: function(bookmark) { - var self = this, dom = self.dom, rng, root, startContainer, endContainer, startOffset, endOffset; - - function setEndPoint(start) { - var point = bookmark[start ? 'start' : 'end'], i, node, offset, children; - - if (point) { - offset = point[0]; - - // Find container node - for (node = root, i = point.length - 1; i >= 1; i--) { - children = node.childNodes; - - if (point[i] > children.length - 1) { - return; - } - - node = children[point[i]]; - } - - // Move text offset to best suitable location - if (node.nodeType === 3) { - offset = Math.min(point[0], node.nodeValue.length); - } - - // Move element offset to best suitable location - if (node.nodeType === 1) { - offset = Math.min(point[0], node.childNodes.length); - } - - // Set offset within container node - if (start) { - rng.setStart(node, offset); - } else { - rng.setEnd(node, offset); - } - } - - return true; - } - - function restoreEndPoint(suffix) { - var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev, keep = bookmark.keep; - - if (marker) { - node = marker.parentNode; - - if (suffix == 'start') { - if (!keep) { - idx = dom.nodeIndex(marker); - } else { - node = marker.firstChild; - idx = 1; - } - - startContainer = endContainer = node; - startOffset = endOffset = idx; - } else { - if (!keep) { - idx = dom.nodeIndex(marker); - } else { - node = marker.firstChild; - idx = 1; - } - - endContainer = node; - endOffset = idx; - } - - if (!keep) { - prev = marker.previousSibling; - next = marker.nextSibling; - - // Remove all marker text nodes - each(grep(marker.childNodes), function(node) { - if (node.nodeType == 3) { - node.nodeValue = node.nodeValue.replace(/\uFEFF/g, ''); - } - }); - - // Remove marker but keep children if for example contents where inserted into the marker - // Also remove duplicated instances of the marker for example by a - // split operation or by WebKit auto split on paste feature - while ((marker = dom.get(bookmark.id + '_' + suffix))) { - dom.remove(marker, 1); - } - - // If siblings are text nodes then merge them unless it's Opera since it some how removes the node - // and we are sniffing since adding a lot of detection code for a browser with 3% of the market - // isn't worth the effort. Sorry, Opera but it's just a fact - if (prev && next && prev.nodeType == next.nodeType && prev.nodeType == 3 && !isOpera) { - idx = prev.nodeValue.length; - prev.appendData(next.nodeValue); - dom.remove(next); - - if (suffix == 'start') { - startContainer = endContainer = prev; - startOffset = endOffset = idx; - } else { - endContainer = prev; - endOffset = idx; - } - } - } - } - } - - function addBogus(node) { - // Adds a bogus BR element for empty block elements - if (dom.isBlock(node) && !node.innerHTML && !isIE) { - node.innerHTML = '
'; - } - - return node; - } - - if (bookmark) { - if (bookmark.start) { - rng = dom.createRng(); - root = dom.getRoot(); - - if (self.tridentSel) { - return self.tridentSel.moveToBookmark(bookmark); - } - - if (setEndPoint(true) && setEndPoint()) { - self.setRng(rng); - } - } else if (bookmark.id) { - // Restore start/end points - restoreEndPoint('start'); - restoreEndPoint('end'); - - if (startContainer) { - rng = dom.createRng(); - rng.setStart(addBogus(startContainer), startOffset); - rng.setEnd(addBogus(endContainer), endOffset); - self.setRng(rng); - } - } else if (bookmark.name) { - self.select(dom.select(bookmark.name)[bookmark.index]); - } else if (bookmark.rng) { - self.setRng(bookmark.rng); - } - } - }, - - /** - * Selects the specified element. This will place the start and end of the selection range around the element. - * - * @method select - * @param {Element} node HMTL DOM element to select. - * @param {Boolean} content Optional bool state if the contents should be selected or not on non IE browser. - * @return {Element} Selected element the same element as the one that got passed in. - * @example - * // Select the first paragraph in the active editor - * tinymce.activeEditor.selection.select(tinymce.activeEditor.dom.select('p')[0]); - */ - select: function(node, content) { - var self = this, dom = self.dom, rng = dom.createRng(), idx; - - // Clear stored range set by FocusManager - self.lastFocusBookmark = null; - - if (node) { - if (!content && self.controlSelection.controlSelect(node)) { - return; - } - - idx = dom.nodeIndex(node); - rng.setStart(node.parentNode, idx); - rng.setEnd(node.parentNode, idx + 1); - - // Find first/last text node or BR element - if (content) { - self._moveEndPoint(rng, node, true); - self._moveEndPoint(rng, node); - } - - self.setRng(rng); - } - - return node; - }, - - /** - * Returns true/false if the selection range is collapsed or not. Collapsed means if it's a caret or a larger selection. - * - * @method isCollapsed - * @return {Boolean} true/false state if the selection range is collapsed or not. - * Collapsed means if it's a caret or a larger selection. - */ - isCollapsed: function() { - var self = this, rng = self.getRng(), sel = self.getSel(); - - if (!rng || rng.item) { - return false; - } - - if (rng.compareEndPoints) { - return rng.compareEndPoints('StartToEnd', rng) === 0; - } - - return !sel || rng.collapsed; - }, - - /** - * Collapse the selection to start or end of range. - * - * @method collapse - * @param {Boolean} to_start Optional boolean state if to collapse to end or not. Defaults to start. - */ - collapse: function(to_start) { - var self = this, rng = self.getRng(), node; - - // Control range on IE - if (rng.item) { - node = rng.item(0); - rng = self.win.document.body.createTextRange(); - rng.moveToElementText(node); - } - - rng.collapse(!!to_start); - self.setRng(rng); - }, - - /** - * Returns the browsers internal selection object. - * - * @method getSel - * @return {Selection} Internal browser selection object. - */ - getSel: function() { - var win = this.win; - - return win.getSelection ? win.getSelection() : win.document.selection; - }, - - /** - * Returns the browsers internal range object. - * - * @method getRng - * @param {Boolean} w3c Forces a compatible W3C range on IE. - * @return {Range} Internal browser range object. - * @see http://www.quirksmode.org/dom/range_intro.html - * @see http://www.dotvoid.com/2001/03/using-the-range-object-in-mozilla/ - */ - getRng: function(w3c) { - var self = this, selection, rng, elm, doc = self.win.document, ieRng; - - function tryCompareBounderyPoints(how, sourceRange, destinationRange) { - try { - return sourceRange.compareBoundaryPoints(how, destinationRange); - } catch (ex) { - // Gecko throws wrong document exception if the range points - // to nodes that where removed from the dom #6690 - // Browsers should mutate existing DOMRange instances so that they always point - // to something in the document this is not the case in Gecko works fine in IE/WebKit/Blink - // For performance reasons just return -1 - return -1; - } - } - - // Use last rng passed from FocusManager if it's available this enables - // calls to editor.selection.getStart() to work when caret focus is lost on IE - if (!w3c && self.lastFocusBookmark) { - var bookmark = self.lastFocusBookmark; - - // Convert bookmark to range IE 11 fix - if (bookmark.startContainer) { - rng = doc.createRange(); - rng.setStart(bookmark.startContainer, bookmark.startOffset); - rng.setEnd(bookmark.endContainer, bookmark.endOffset); - } else { - rng = bookmark; - } - - return rng; - } - - // Found tridentSel object then we need to use that one - if (w3c && self.tridentSel) { - return self.tridentSel.getRangeAt(0); - } - - try { - if ((selection = self.getSel())) { - if (selection.rangeCount > 0) { - rng = selection.getRangeAt(0); - } else { - rng = selection.createRange ? selection.createRange() : doc.createRange(); - } - } - } catch (ex) { - // IE throws unspecified error here if TinyMCE is placed in a frame/iframe - } - - // We have W3C ranges and it's IE then fake control selection since IE9 doesn't handle that correctly yet - // IE 11 doesn't support the selection object so we check for that as well - if (isIE && rng && rng.setStart && doc.selection) { - try { - // IE will sometimes throw an exception here - ieRng = doc.selection.createRange(); - } catch (ex) { - - } - - if (ieRng && ieRng.item) { - elm = ieRng.item(0); - rng = doc.createRange(); - rng.setStartBefore(elm); - rng.setEndAfter(elm); - } - } - - // No range found then create an empty one - // This can occur when the editor is placed in a hidden container element on Gecko - // Or on IE when there was an exception - if (!rng) { - rng = doc.createRange ? doc.createRange() : doc.body.createTextRange(); - } - - // If range is at start of document then move it to start of body - if (rng.setStart && rng.startContainer.nodeType === 9 && rng.collapsed) { - elm = self.dom.getRoot(); - rng.setStart(elm, 0); - rng.setEnd(elm, 0); - } - - if (self.selectedRange && self.explicitRange) { - if (tryCompareBounderyPoints(rng.START_TO_START, rng, self.selectedRange) === 0 && - tryCompareBounderyPoints(rng.END_TO_END, rng, self.selectedRange) === 0) { - // Safari, Opera and Chrome only ever select text which causes the range to change. - // This lets us use the originally set range if the selection hasn't been changed by the user. - rng = self.explicitRange; - } else { - self.selectedRange = null; - self.explicitRange = null; - } - } - - return rng; - }, - - /** - * Changes the selection to the specified DOM range. - * - * @method setRng - * @param {Range} rng Range to select. - */ - setRng: function(rng, forward) { - var self = this, sel; - - // Is IE specific range - if (rng.select) { - try { - rng.select(); - } catch (ex) { - // Needed for some odd IE bug #1843306 - } - - return; - } - - if (!self.tridentSel) { - sel = self.getSel(); - - if (sel) { - self.explicitRange = rng; - - try { - sel.removeAllRanges(); - sel.addRange(rng); - } catch (ex) { - // IE might throw errors here if the editor is within a hidden container and selection is changed - } - - // Forward is set to false and we have an extend function - if (forward === false && sel.extend) { - sel.collapse(rng.endContainer, rng.endOffset); - sel.extend(rng.startContainer, rng.startOffset); - } - - // adding range isn't always successful so we need to check range count otherwise an exception can occur - self.selectedRange = sel.rangeCount > 0 ? sel.getRangeAt(0) : null; - } - } else { - // Is W3C Range fake range on IE - if (rng.cloneRange) { - try { - self.tridentSel.addRange(rng); - return; - } catch (ex) { - //IE9 throws an error here if called before selection is placed in the editor - } - } - } - }, - - /** - * Sets the current selection to the specified DOM element. - * - * @method setNode - * @param {Element} elm Element to set as the contents of the selection. - * @return {Element} Returns the element that got passed in. - * @example - * // Inserts a DOM node at current selection/caret location - * tinymce.activeEditor.selection.setNode(tinymce.activeEditor.dom.create('img', {src: 'some.gif', title: 'some title'})); - */ - setNode: function(elm) { - var self = this; - - self.setContent(self.dom.getOuterHTML(elm)); - - return elm; - }, - - /** - * Returns the currently selected element or the common ancestor element for both start and end of the selection. - * - * @method getNode - * @return {Element} Currently selected element or common ancestor element. - * @example - * // Alerts the currently selected elements node name - * alert(tinymce.activeEditor.selection.getNode().nodeName); - */ - getNode: function() { - var self = this, rng = self.getRng(), elm; - var startContainer = rng.startContainer, endContainer = rng.endContainer; - var startOffset = rng.startOffset, endOffset = rng.endOffset, root = self.dom.getRoot(); - - function skipEmptyTextNodes(node, forwards) { - var orig = node; - - while (node && node.nodeType === 3 && node.length === 0) { - node = forwards ? node.nextSibling : node.previousSibling; - } - - return node || orig; - } - - // Range maybe lost after the editor is made visible again - if (!rng) { - return root; - } - - if (rng.setStart) { - elm = rng.commonAncestorContainer; - - // Handle selection a image or other control like element such as anchors - if (!rng.collapsed) { - if (startContainer == endContainer) { - if (endOffset - startOffset < 2) { - if (startContainer.hasChildNodes()) { - elm = startContainer.childNodes[startOffset]; - } - } - } - - // If the anchor node is a element instead of a text node then return this element - //if (tinymce.isWebKit && sel.anchorNode && sel.anchorNode.nodeType == 1) - // return sel.anchorNode.childNodes[sel.anchorOffset]; - - // Handle cases where the selection is immediately wrapped around a node and return that node instead of it's parent. - // This happens when you double click an underlined word in FireFox. - if (startContainer.nodeType === 3 && endContainer.nodeType === 3) { - if (startContainer.length === startOffset) { - startContainer = skipEmptyTextNodes(startContainer.nextSibling, true); - } else { - startContainer = startContainer.parentNode; - } - - if (endOffset === 0) { - endContainer = skipEmptyTextNodes(endContainer.previousSibling, false); - } else { - endContainer = endContainer.parentNode; - } - - if (startContainer && startContainer === endContainer) { - return startContainer; - } - } - } - - if (elm && elm.nodeType == 3) { - return elm.parentNode; - } - - return elm; - } - - elm = rng.item ? rng.item(0) : rng.parentElement(); - - // IE 7 might return elements outside the iframe - if (elm.ownerDocument !== self.win.document) { - elm = root; - } - - return elm; - }, - - getSelectedBlocks: function(startElm, endElm) { - var self = this, dom = self.dom, node, root, selectedBlocks = []; - - root = dom.getRoot(); - startElm = dom.getParent(startElm || self.getStart(), dom.isBlock); - endElm = dom.getParent(endElm || self.getEnd(), dom.isBlock); - - if (startElm && startElm != root) { - selectedBlocks.push(startElm); - } - - if (startElm && endElm && startElm != endElm) { - node = startElm; - - var walker = new TreeWalker(startElm, root); - while ((node = walker.next()) && node != endElm) { - if (dom.isBlock(node)) { - selectedBlocks.push(node); - } - } - } - - if (endElm && startElm != endElm && endElm != root) { - selectedBlocks.push(endElm); - } - - return selectedBlocks; - }, - - isForward: function() { - var dom = this.dom, sel = this.getSel(), anchorRange, focusRange; - - // No support for selection direction then always return true - if (!sel || !sel.anchorNode || !sel.focusNode) { - return true; - } - - anchorRange = dom.createRng(); - anchorRange.setStart(sel.anchorNode, sel.anchorOffset); - anchorRange.collapse(true); - - focusRange = dom.createRng(); - focusRange.setStart(sel.focusNode, sel.focusOffset); - focusRange.collapse(true); - - return anchorRange.compareBoundaryPoints(anchorRange.START_TO_START, focusRange) <= 0; - }, - - normalize: function() { - var self = this, rng = self.getRng(); - - if (!isIE && new RangeUtils(self.dom).normalize(rng)) { - self.setRng(rng, self.isForward()); - } - - return rng; - }, - - /** - * Executes callback of the current selection matches the specified selector or not and passes the state and args to the callback. - * - * @method selectorChanged - * @param {String} selector CSS selector to check for. - * @param {function} callback Callback with state and args when the selector is matches or not. - */ - selectorChanged: function(selector, callback) { - var self = this, currentSelectors; - - if (!self.selectorChangedData) { - self.selectorChangedData = {}; - currentSelectors = {}; - - self.editor.on('NodeChange', function(e) { - var node = e.element, dom = self.dom, parents = dom.getParents(node, null, dom.getRoot()), matchedSelectors = {}; - - // Check for new matching selectors - each(self.selectorChangedData, function(callbacks, selector) { - each(parents, function(node) { - if (dom.is(node, selector)) { - if (!currentSelectors[selector]) { - // Execute callbacks - each(callbacks, function(callback) { - callback(true, {node: node, selector: selector, parents: parents}); - }); - - currentSelectors[selector] = callbacks; - } - - matchedSelectors[selector] = callbacks; - return false; - } - }); - }); - - // Check if current selectors still match - each(currentSelectors, function(callbacks, selector) { - if (!matchedSelectors[selector]) { - delete currentSelectors[selector]; - - each(callbacks, function(callback) { - callback(false, {node: node, selector: selector, parents: parents}); - }); - } - }); - }); - } - - // Add selector listeners - if (!self.selectorChangedData[selector]) { - self.selectorChangedData[selector] = []; - } - - self.selectorChangedData[selector].push(callback); - - return self; - }, - - getScrollContainer: function() { - var scrollContainer, node = this.dom.getRoot(); - - while (node && node.nodeName != 'BODY') { - if (node.scrollHeight > node.clientHeight) { - scrollContainer = node; - break; - } - - node = node.parentNode; - } - - return scrollContainer; - }, - - scrollIntoView: function(elm) { - var y, viewPort, self = this, dom = self.dom, root = dom.getRoot(), viewPortY, viewPortH; - - function getPos(elm) { - var x = 0, y = 0; - - var offsetParent = elm; - while (offsetParent && offsetParent.nodeType) { - x += offsetParent.offsetLeft || 0; - y += offsetParent.offsetTop || 0; - offsetParent = offsetParent.offsetParent; - } - - return {x: x, y: y}; - } - - if (root.nodeName != 'BODY') { - var scrollContainer = self.getScrollContainer(); - if (scrollContainer) { - y = getPos(elm).y - getPos(scrollContainer).y; - viewPortH = scrollContainer.clientHeight; - viewPortY = scrollContainer.scrollTop; - if (y < viewPortY || y + 25 > viewPortY + viewPortH) { - scrollContainer.scrollTop = y < viewPortY ? y : y - viewPortH + 25; - } - - return; - } - } - - viewPort = dom.getViewPort(self.editor.getWin()); - y = dom.getPos(elm).y; - viewPortY = viewPort.y; - viewPortH = viewPort.h; - if (y < viewPort.y || y + 25 > viewPortY + viewPortH) { - self.editor.getWin().scrollTo(0, y < viewPortY ? y : y - viewPortH + 25); - } - }, - - _moveEndPoint: function(rng, node, start) { - var root = node, walker = new TreeWalker(node, root); - var nonEmptyElementsMap = this.dom.schema.getNonEmptyElements(); - - do { - // Text node - if (node.nodeType == 3 && trim(node.nodeValue).length !== 0) { - if (start) { - rng.setStart(node, 0); - } else { - rng.setEnd(node, node.nodeValue.length); - } - - return; - } - - // BR/IMG/INPUT elements - if (nonEmptyElementsMap[node.nodeName]) { - if (start) { - rng.setStartBefore(node); - } else { - if (node.nodeName == 'BR') { - rng.setEndBefore(node); - } else { - rng.setEndAfter(node); - } - } - - return; - } - - // Found empty text block old IE can place the selection inside those - if (Env.ie && Env.ie < 11 && this.dom.isBlock(node) && this.dom.isEmpty(node)) { - if (start) { - rng.setStart(node, 0); - } else { - rng.setEnd(node, 0); - } - - return; - } - } while ((node = (start ? walker.next() : walker.prev()))); - - // Failed to find any text node or other suitable location then move to the root of body - if (root.nodeName == 'BODY') { - if (start) { - rng.setStart(root, 0); - } else { - rng.setEnd(root, root.childNodes.length); - } - } - }, - - destroy: function() { - this.win = null; - this.controlSelection.destroy(); - } - }; - - return Selection; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/Serializer.js b/common/static/js/vendor/tinymce/js/tinymce/classes/dom/Serializer.js deleted file mode 100755 index 6607497bd364..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/Serializer.js +++ /dev/null @@ -1,387 +0,0 @@ -/** - * Serializer.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class is used to serialize DOM trees into a string. Consult the TinyMCE Wiki API for - * more details and examples on how to use this class. - * - * @class tinymce.dom.Serializer - */ -define("tinymce/dom/Serializer", [ - "tinymce/dom/DOMUtils", - "tinymce/html/DomParser", - "tinymce/html/Entities", - "tinymce/html/Serializer", - "tinymce/html/Node", - "tinymce/html/Schema", - "tinymce/Env", - "tinymce/util/Tools" -], function(DOMUtils, DomParser, Entities, Serializer, Node, Schema, Env, Tools) { - var each = Tools.each, trim = Tools.trim; - var DOM = DOMUtils.DOM; - - /** - * Constructs a new DOM serializer class. - * - * @constructor - * @method Serializer - * @param {Object} settings Serializer settings object. - * @param {tinymce.Editor} editor Optional editor to bind events to and get schema/dom from. - */ - return function(settings, editor) { - var dom, schema, htmlParser; - - if (editor) { - dom = editor.dom; - schema = editor.schema; - } - - // Default DOM and Schema if they are undefined - dom = dom || DOM; - schema = schema || new Schema(settings); - settings.entity_encoding = settings.entity_encoding || 'named'; - settings.remove_trailing_brs = "remove_trailing_brs" in settings ? settings.remove_trailing_brs : true; - - htmlParser = new DomParser(settings, schema); - - // Convert move data-mce-src, data-mce-href and data-mce-style into nodes or process them if needed - htmlParser.addAttributeFilter('src,href,style', function(nodes, name) { - var i = nodes.length, node, value, internalName = 'data-mce-' + name; - var urlConverter = settings.url_converter, urlConverterScope = settings.url_converter_scope, undef; - - while (i--) { - node = nodes[i]; - - value = node.attributes.map[internalName]; - if (value !== undef) { - // Set external name to internal value and remove internal - node.attr(name, value.length > 0 ? value : null); - node.attr(internalName, null); - } else { - // No internal attribute found then convert the value we have in the DOM - value = node.attributes.map[name]; - - if (name === "style") { - value = dom.serializeStyle(dom.parseStyle(value), node.name); - } else if (urlConverter) { - value = urlConverter.call(urlConverterScope, value, name, node.name); - } - - node.attr(name, value.length > 0 ? value : null); - } - } - }); - - // Remove internal classes mceItem<..> or mceSelected - htmlParser.addAttributeFilter('class', function(nodes) { - var i = nodes.length, node, value; - - while (i--) { - node = nodes[i]; - value = node.attr('class').replace(/(?:^|\s)mce-item-\w+(?!\S)/g, ''); - node.attr('class', value.length > 0 ? value : null); - } - }); - - // Remove bookmark elements - htmlParser.addAttributeFilter('data-mce-type', function(nodes, name, args) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - - if (node.attributes.map['data-mce-type'] === 'bookmark' && !args.cleanup) { - node.remove(); - } - } - }); - - // Remove expando attributes - htmlParser.addAttributeFilter('data-mce-expando', function(nodes, name) { - var i = nodes.length; - - while (i--) { - nodes[i].attr(name, null); - } - }); - - htmlParser.addNodeFilter('noscript', function(nodes) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i].firstChild; - - if (node) { - node.value = Entities.decode(node.value); - } - } - }); - - // Force script into CDATA sections and remove the mce- prefix also add comments around styles - htmlParser.addNodeFilter('script,style', function(nodes, name) { - var i = nodes.length, node, value; - - function trim(value) { - /*jshint maxlen:255 */ - /*eslint max-len:0 */ - return value.replace(/()/g, '\n') - .replace(/^[\r\n]*|[\r\n]*$/g, '') - .replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g, ''); - } - - while (i--) { - node = nodes[i]; - value = node.firstChild ? node.firstChild.value : ''; - - if (name === "script") { - // Remove mce- prefix from script elements and remove default text/javascript mime type (HTML5) - var type = (node.attr('type') || 'text/javascript').replace(/^mce\-/, ''); - node.attr('type', type === 'text/javascript' ? null : type); - - if (value.length > 0) { - node.firstChild.value = '// '; - } - } else { - if (value.length > 0) { - node.firstChild.value = ''; - } - } - } - }); - - // Convert comments to cdata and handle protected comments - htmlParser.addNodeFilter('#comment', function(nodes) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - - if (node.value.indexOf('[CDATA[') === 0) { - node.name = '#cdata'; - node.type = 4; - node.value = node.value.replace(/^\[CDATA\[|\]\]$/g, ''); - } else if (node.value.indexOf('mce:protected ') === 0) { - node.name = "#text"; - node.type = 3; - node.raw = true; - node.value = unescape(node.value).substr(14); - } - } - }); - - htmlParser.addNodeFilter('xml:namespace,input', function(nodes, name) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - if (node.type === 7) { - node.remove(); - } else if (node.type === 1) { - if (name === "input" && !("type" in node.attributes.map)) { - node.attr('type', 'text'); - } - } - } - }); - - // Fix list elements, TODO: Replace this later - if (settings.fix_list_elements) { - htmlParser.addNodeFilter('ul,ol', function(nodes) { - var i = nodes.length, node, parentNode; - - while (i--) { - node = nodes[i]; - parentNode = node.parent; - - if (parentNode.name === 'ul' || parentNode.name === 'ol') { - if (node.prev && node.prev.name === 'li') { - node.prev.append(node); - } - } - } - }); - } - - // Remove internal data attributes - htmlParser.addAttributeFilter('data-mce-src,data-mce-href,data-mce-style,data-mce-selected', function(nodes, name) { - var i = nodes.length; - - while (i--) { - nodes[i].attr(name, null); - } - }); - - // Return public methods - return { - /** - * Schema instance that was used to when the Serializer was constructed. - * - * @field {tinymce.html.Schema} schema - */ - schema: schema, - - /** - * Adds a node filter function to the parser used by the serializer, the parser will collect the specified nodes by name - * and then execute the callback ones it has finished parsing the document. - * - * @example - * parser.addNodeFilter('p,h1', function(nodes, name) { - * for (var i = 0; i < nodes.length; i++) { - * console.log(nodes[i].name); - * } - * }); - * @method addNodeFilter - * @method {String} name Comma separated list of nodes to collect. - * @param {function} callback Callback function to execute once it has collected nodes. - */ - addNodeFilter: htmlParser.addNodeFilter, - - /** - * Adds a attribute filter function to the parser used by the serializer, the parser will - * collect nodes that has the specified attributes - * and then execute the callback ones it has finished parsing the document. - * - * @example - * parser.addAttributeFilter('src,href', function(nodes, name) { - * for (var i = 0; i < nodes.length; i++) { - * console.log(nodes[i].name); - * } - * }); - * @method addAttributeFilter - * @method {String} name Comma separated list of nodes to collect. - * @param {function} callback Callback function to execute once it has collected nodes. - */ - addAttributeFilter: htmlParser.addAttributeFilter, - - /** - * Serializes the specified browser DOM node into a HTML string. - * - * @method serialize - * @param {DOMNode} node DOM node to serialize. - * @param {Object} args Arguments option that gets passed to event handlers. - */ - serialize: function(node, args) { - var self = this, impl, doc, oldDoc, htmlSerializer, content; - - // Explorer won't clone contents of script and style and the - // selected index of select elements are cleared on a clone operation. - if (Env.ie && dom.select('script,style,select,map').length > 0) { - content = node.innerHTML; - node = node.cloneNode(false); - dom.setHTML(node, content); - } else { - node = node.cloneNode(true); - } - - // Nodes needs to be attached to something in WebKit/Opera - // This fix will make DOM ranges and make Sizzle happy! - impl = node.ownerDocument.implementation; - if (impl.createHTMLDocument) { - // Create an empty HTML document - doc = impl.createHTMLDocument(""); - - // Add the element or it's children if it's a body element to the new document - each(node.nodeName == 'BODY' ? node.childNodes : [node], function(node) { - doc.body.appendChild(doc.importNode(node, true)); - }); - - // Grab first child or body element for serialization - if (node.nodeName != 'BODY') { - node = doc.body.firstChild; - } else { - node = doc.body; - } - - // set the new document in DOMUtils so createElement etc works - oldDoc = dom.doc; - dom.doc = doc; - } - - args = args || {}; - args.format = args.format || 'html'; - - // Don't wrap content if we want selected html - if (args.selection) { - args.forced_root_block = ''; - } - - // Pre process - if (!args.no_events) { - args.node = node; - self.onPreProcess(args); - } - - // Setup serializer - htmlSerializer = new Serializer(settings, schema); - - // Parse and serialize HTML - args.content = htmlSerializer.serialize( - htmlParser.parse(trim(args.getInner ? node.innerHTML : dom.getOuterHTML(node)), args) - ); - - // Replace all BOM characters for now until we can find a better solution - if (!args.cleanup) { - args.content = args.content.replace(/\uFEFF/g, ''); - } - - // Post process - if (!args.no_events) { - self.onPostProcess(args); - } - - // Restore the old document if it was changed - if (oldDoc) { - dom.doc = oldDoc; - } - - args.node = null; - - return args.content; - }, - - /** - * Adds valid elements rules to the serializers schema instance this enables you to specify things - * like what elements should be outputted and what attributes specific elements might have. - * Consult the Wiki for more details on this format. - * - * @method addRules - * @param {String} rules Valid elements rules string to add to schema. - */ - addRules: function(rules) { - schema.addValidElements(rules); - }, - - /** - * Sets the valid elements rules to the serializers schema instance this enables you to specify things - * like what elements should be outputted and what attributes specific elements might have. - * Consult the Wiki for more details on this format. - * - * @method setRules - * @param {String} rules Valid elements rules string. - */ - setRules: function(rules) { - schema.setValidElements(rules); - }, - - onPreProcess: function(args) { - if (editor) { - editor.fire('PreProcess', args); - } - }, - - onPostProcess: function(args) { - if (editor) { - editor.fire('PostProcess', args); - } - } - }; - }; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/Sizzle.jQuery.js b/common/static/js/vendor/tinymce/js/tinymce/classes/dom/Sizzle.jQuery.js deleted file mode 100755 index 8b9e2a16a652..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/Sizzle.jQuery.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * Sizzle.jQuery.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*global jQuery:true */ - -/* - * Fake Sizzle using jQuery. - */ -define("tinymce/dom/Sizzle", [], function() { - // Detect if jQuery is loaded - if (!window.jQuery) { - throw new Error("Load jQuery first"); - } - - return jQuery.find; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/Sizzle.js b/common/static/js/vendor/tinymce/js/tinymce/classes/dom/Sizzle.js deleted file mode 100755 index 4eaa7bae5256..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/Sizzle.js +++ /dev/null @@ -1,1928 +0,0 @@ -/** - * Sizzle.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - * - * @ignore-file - */ - -/*jshint bitwise:false, expr:true, noempty:false, sub:true, eqnull:true, latedef:false, maxlen:255 */ -/*eslint dot-notation:0, no-empty:0, no-cond-assign:0, no-unused-expressions:0, new-cap:0, no-nested-ternary:0, func-style:0, no-bitwise: 0 */ - -/* - * Sizzle CSS Selector Engine - * Copyright, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -define("tinymce/dom/Sizzle", [], function() { -var i, - cachedruns, - Expr, - getText, - isXML, - compile, - outermostContext, - recompare, - sortInput, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + -(new Date()), - preferredDoc = window.document, - support = {}, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - hasDuplicate = false, - sortOrder = function() { return 0; }, - - // General-purpose constants - strundefined = typeof undefined, - MAX_NEGATIVE = 1 << 31, - - // Array methods - arr = [], - pop = arr.pop, - push_native = arr.push, - push = arr.push, - slice = arr.slice, - // Use a stripped-down indexOf if we can't use a native one - indexOf = arr.indexOf || function( elem ) { - var i = 0, - len = this.length; - for ( ; i < len; i++ ) { - if ( this[i] === elem ) { - return i; - } - } - return -1; - }, - - - // Regular expressions - - // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - // http://www.w3.org/TR/css3-syntax/#characters - characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", - - // Loosely modeled on CSS identifier characters - // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors - // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = characterEncoding.replace( "w", "w#" ), - - // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors - operators = "([*^$|!~]?=)", - attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + - "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", - - // Prefer arguments quoted, - // then not containing pseudos/brackets, - // then attribute selectors/non-parenthetical expressions, - // then anything else - // These preferences are here to reduce the number of selectors - // needing tokenize in the PSEUDO preFilter - pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ), - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + characterEncoding + ")" ), - "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), - "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ), - "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + - "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + - "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + - whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rsibling = /[\x20\t\r\n\f]*[+~]/, - - rnative = /^[^{]+\{\s*\[native code/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/, - - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rescape = /'|\\/g, - rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, - - // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g, - funescape = function( _, escaped ) { - var high = "0x" + escaped - 0x10000; - // NaN means non-codepoint - return high !== high ? - escaped : - // BMP codepoint - high < 0 ? - String.fromCharCode( high + 0x10000 ) : - // Supplemental Plane codepoint (surrogate pair) - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }; - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - (arr = slice.call( preferredDoc.childNodes )), - preferredDoc.childNodes - ); - // Support: Android<4.0 - // Detect silently failing push.apply - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - push_native.apply( target, slice.call(els) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - // Can't trust NodeList.length - while ( (target[j++] = els[i++]) ) {} - target.length = j - 1; - } - }; -} - -/** - * For feature detection - * @param {Function} fn The function to test for native support - */ -function isNative( fn ) { - return rnative.test( fn + "" ); -} - -/** - * Create key-value caches of limited size - * @returns {Function(string, Object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var cache, - keys = []; - - cache = function( key, value ) { - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key += " " ) > Expr.cacheLength ) { - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - cache[ key ] = value; - return value; - }; - - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created div and expects a boolean result - */ -function assert( fn ) { - var div = document.createElement("div"); - - try { - return !!fn( div ); - } catch (e) { - return false; - } finally { - // release memory in IE - div = null; - } -} - -function Sizzle( selector, context, results, seed ) { - var match, elem, m, nodeType, - // QSA vars - i, groups, old, nid, newContext, newSelector; - - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } - - context = context || document; - results = results || []; - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { - return []; - } - - if ( documentIsHTML && !seed ) { - - // Shortcuts - if ( (match = rquickExpr.exec( selector )) ) { - // Speed-up: Sizzle("#ID") - if ( (m = match[1]) ) { - if ( nodeType === 9 ) { - elem = context.getElementById( m ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE, Opera, and Webkit return items - // by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - } else { - // Context is not a document - if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && - contains( context, elem ) && elem.id === m ) { - results.push( elem ); - return results; - } - } - - // Speed-up: Sizzle("TAG") - } else if ( match[2] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Speed-up: Sizzle(".CLASS") - } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // QSA path - if ( support.qsa && !rbuggyQSA.test(selector) ) { - old = true; - nid = expando; - newContext = context; - newSelector = nodeType === 9 && selector; - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - groups = tokenize( selector ); - - if ( (old = context.getAttribute("id")) ) { - nid = old.replace( rescape, "\\$&" ); - } else { - context.setAttribute( "id", nid ); - } - nid = "[id='" + nid + "'] "; - - i = groups.length; - while ( i-- ) { - groups[i] = nid + toSelector( groups[i] ); - } - newContext = rsibling.test( selector ) && context.parentNode || context; - newSelector = groups.join(","); - } - - if ( newSelector ) { - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch(qsaError) { - } finally { - if ( !old ) { - context.removeAttribute("id"); - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Detect xml - * @param {Element|Object} elem An element or a document - */ -isXML = Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = elem && (elem.ownerDocument || elem).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var doc = node ? node.ownerDocument || node : preferredDoc; - - // If no document and documentElement is available, return - if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Set our document - document = doc; - docElem = doc.documentElement; - - // Support tests - documentIsHTML = !isXML( doc ); - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert(function( div ) { - div.appendChild( doc.createComment("") ); - return !div.getElementsByTagName("*").length; - }); - - // Check if attributes should be retrieved by attribute nodes - support.attributes = assert(function( div ) { - div.innerHTML = ""; - var type = typeof div.lastChild.getAttribute("multiple"); - // IE8 returns a string for some attributes even when not present - return type !== "boolean" && type !== "string"; - }); - - // Check if getElementsByClassName can be trusted - support.getElementsByClassName = assert(function( div ) { - // Opera can't find a second classname (in 9.6) - div.innerHTML = ""; - if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) { - return false; - } - - // Safari 3.2 caches class attributes and doesn't catch changes - div.lastChild.className = "e"; - return div.getElementsByClassName("e").length === 2; - }); - - // Check if getElementsByName privileges form controls or returns elements by ID - // If so, assume (for broader support) that getElementById returns elements by name - support.getByName = assert(function( div ) { - // Inject content - div.id = expando + 0; - // Support: Windows 8 Native Apps - // Assigning innerHTML with "name" attributes throws uncatchable exceptions - // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx - div.appendChild( document.createElement("a") ).setAttribute( "name", expando ); - div.appendChild( document.createElement("i") ).setAttribute( "name", expando ); - docElem.appendChild( div ); - - // Test - var pass = doc.getElementsByName && - // buggy browsers will return fewer than the correct 2 - doc.getElementsByName( expando ).length === 2 + - // buggy browsers will return more than the correct 0 - doc.getElementsByName( expando + 0 ).length; - - // Cleanup - docElem.removeChild( div ); - - return pass; - }); - - // Support: Webkit<537.32 - // Detached nodes confoundingly follow *each other* - support.sortDetached = assert(function( div1 ) { - return div1.compareDocumentPosition && - // Should return 1, but Webkit returns 4 (following) - (div1.compareDocumentPosition( document.createElement("div") ) & 1); - }); - - // IE6/7 return modified attributes - Expr.attrHandle = assert(function( div ) { - div.innerHTML = ""; - return div.firstChild && typeof div.firstChild.getAttribute !== strundefined && - div.firstChild.getAttribute("href") === "#"; - }) ? - {} : - { - "href": function( elem ) { - return elem.getAttribute( "href", 2 ); - }, - "type": function( elem ) { - return elem.getAttribute("type"); - } - }; - - // ID find and filter - if ( support.getByName ) { - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== strundefined && documentIsHTML ) { - var m = context.getElementById( id ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [m] : []; - } - }; - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute("id") === attrId; - }; - }; - } else { - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== strundefined && documentIsHTML ) { - var m = context.getElementById( id ); - - return m ? - m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ? - [m] : - undefined : - []; - } - }; - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); - return node && node.value === attrId; - }; - }; - } - - // Tag - Expr.find["TAG"] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== strundefined ) { - return context.getElementsByTagName( tag ); - } - } : - function( tag, context ) { - var elem, - tmp = [], - i = 0, - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( (elem = results[i++]) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Name - Expr.find["NAME"] = support.getByName && function( tag, context ) { - if ( typeof context.getElementsByName !== strundefined ) { - return context.getElementsByName( name ); - } - }; - - // Class - Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21), - // no need to also add to buggyMatches since matches checks buggyQSA - // A support test would require too much code (would include document ready) - rbuggyQSA = [ ":focus" ]; - - if ( (support.qsa = isNative(doc.querySelectorAll)) ) { - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert(function( div ) { - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // http://bugs.jquery.com/ticket/12359 - div.innerHTML = ""; - - // IE8 - Some boolean attributes are not treated correctly - if ( !div.querySelectorAll("[selected]").length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" ); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":checked").length ) { - rbuggyQSA.push(":checked"); - } - }); - - assert(function( div ) { - - // Opera 10-12/IE8 - ^= $= *= and empty values - // Should not select anything - div.innerHTML = ""; - if ( div.querySelectorAll("[i^='']").length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":enabled").length ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Opera 10-11 does not throw on post-comma invalid pseudos - div.querySelectorAll("*,:x"); - rbuggyQSA.push(",.*:"); - }); - } - - if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector || - docElem.mozMatchesSelector || - docElem.webkitMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector) )) ) { - - assert(function( div ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( div, "div" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( div, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - }); - } - - rbuggyQSA = new RegExp( rbuggyQSA.join("|") ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); - - // Element contains another - // Purposefully does not implement inclusive descendant - // As in, an element does not contain itself - contains = isNative(docElem.contains) || docElem.compareDocumentPosition ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - )); - } : - function( a, b ) { - if ( b ) { - while ( (b = b.parentNode) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - // Document order sorting - sortOrder = docElem.compareDocumentPosition ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b ); - - if ( compare ) { - // Disconnected nodes - if ( compare & 1 || - (recompare && b.compareDocumentPosition( a ) === compare) ) { - - // Choose the first element that is related to our preferred document - if ( a === doc || contains(preferredDoc, a) ) { - return -1; - } - if ( b === doc || contains(preferredDoc, b) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } - - // Not directly comparable, sort on existence of method - return a.compareDocumentPosition ? -1 : 1; - } : - function( a, b ) { - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - - // Parentless nodes are either documents or disconnected - } else if ( !aup || !bup ) { - return a === doc ? -1 : - b === doc ? 1 : - aup ? -1 : - bup ? 1 : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( (cur = cur.parentNode) ) { - ap.unshift( cur ); - } - cur = b; - while ( (cur = cur.parentNode) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[i] === bp[i] ) { - i++; - } - - return i ? - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[i], bp[i] ) : - - // Otherwise nodes in our document sort first - ap[i] === preferredDoc ? -1 : - bp[i] === preferredDoc ? 1 : - 0; - }; - - return document; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - // Make sure that attribute selectors are quoted - expr = expr.replace( rattributeQuotes, "='$1']" ); - - // rbuggyQSA always contains :focus, so no need for an existence check - if ( support.matchesSelector && documentIsHTML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) { - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch(e) {} - } - - return Sizzle( expr, document, null, [elem] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - // Set document vars if needed - if ( ( context.ownerDocument || context ) !== document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - var val; - - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - if ( documentIsHTML ) { - name = name.toLowerCase(); - } - if ( (val = Expr.attrHandle[ name ]) ) { - return val( elem ); - } - if ( !documentIsHTML || support.attributes ) { - return elem.getAttribute( name ); - } - return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ? - name : - val && val.specified ? val.value : null; -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -// Document sorting and removing duplicates -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - // Compensate for sort limitations - recompare = !support.sortDetached; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( (elem = results[i++]) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - return results; -}; - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns Returns -1 if a precedes b, 1 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( (cur = cur.nextSibling) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -// Returns a function to use in pseudos for input types -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -// Returns a function to use in pseudos for buttons -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; - }; -} - -// Returns a function to use in pseudos for positionals -function createPositionalPseudo( fn ) { - return markFunction(function( argument ) { - argument = +argument; - return markFunction(function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ (j = matchIndexes[i]) ] ) { - seed[j] = !(matches[j] = seed[j]); - } - } - }); - }); -} - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - // If no nodeType, this is expected to be an array - for ( ; (node = elem[i]); i++ ) { - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent for elements - // innerText usage removed for consistency of new lines (see #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[1] = match[1].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); - - if ( match[2] === "~=" ) { - match[3] = " " + match[3] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[1] = match[1].toLowerCase(); - - if ( match[1].slice( 0, 3 ) === "nth" ) { - // nth-* requires argument - if ( !match[3] ) { - Sizzle.error( match[0] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); - match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); - - // other types prohibit arguments - } else if ( match[3] ) { - Sizzle.error( match[0] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[5] && match[2]; - - if ( matchExpr["CHILD"].test( match[0] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[4] ) { - match[2] = match[4]; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - // Get excess from tokenize (recursively) - (excess = tokenize( unquoted, true )) && - // advance to the next closing parenthesis - (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { - - // excess is a negative index - match[0] = match[0].slice( 0, excess ); - match[2] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeName ) { - if ( nodeName === "*" ) { - return function() { return true; }; - } - - nodeName = nodeName.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && - classCache( className, function( elem ) { - return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" ); - }); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - }; - }, - - "CHILD": function( type, what, argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, context, xml ) { - var cache, outerCache, node, diff, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( (node = node[ dir ]) ) { - if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { - return false; - } - } - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - // Seek `elem` from a previously-cached index - outerCache = parent[ expando ] || (parent[ expando ] = {}); - cache = outerCache[ type ] || []; - nodeIndex = cache[0] === dirruns && cache[1]; - diff = cache[0] === dirruns && cache[2]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( (node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - (diff = nodeIndex = 0) || start.pop()) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - outerCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - // Use previously-cached element index if available - } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { - diff = cache[1]; - - // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) - } else { - // Use the same loop as above to seek `elem` from the start - while ( (node = ++nodeIndex && node && node[ dir ] || - (diff = nodeIndex = 0) || start.pop()) ) { - - if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { - // Cache the index of each encountered element - if ( useCache ) { - (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction(function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf.call( seed, matched[i] ); - seed[ idx ] = !( matches[ idx ] = matched[i] ); - } - }) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - // Potentially complex pseudos - "not": markFunction(function( selector ) { - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction(function( seed, matches, context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( (elem = unmatched[i]) ) { - seed[i] = !(matches[i] = elem); - } - } - }) : - function( elem, context, xml ) { - input[0] = elem; - matcher( input, null, xml, results ); - return !results.pop(); - }; - }), - - "has": markFunction(function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - }), - - "contains": markFunction(function( text ) { - return function( elem ) { - return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; - }; - }), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - // lang value must be a valid identifier - if ( !ridentifier.test(lang || "") ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( (elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); - return false; - }; - }), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); - }, - - // Boolean properties - "enabled": function( elem ) { - return elem.disabled === false; - }, - - "disabled": function( elem ) { - return elem.disabled === true; - }, - - "checked": function( elem ) { - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); - }, - - "selected": function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), - // not comment, processing instructions, or others - // Thanks to Diego Perini for the nodeName shortcut - // Greater than "@" means alpha characters (specifically not starting with "#" or "?") - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos["empty"]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) - // use getAttribute instead to test this case - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); - }, - - // Position-in-collection - "first": createPositionalPseudo(function() { - return [ 0 ]; - }), - - "last": createPositionalPseudo(function( matchIndexes, length ) { - return [ length - 1 ]; - }), - - "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - }), - - "even": createPositionalPseudo(function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "odd": createPositionalPseudo(function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }) - } -}; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -function tokenize( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || (match = rcomma.exec( soFar )) ) { - if ( match ) { - // Don't consume trailing commas as valid - soFar = soFar.slice( match[0].length ) || soFar; - } - groups.push( tokens = [] ); - } - - matched = false; - - // Combinators - if ( (match = rcombinators.exec( soFar )) ) { - matched = match.shift(); - tokens.push( { - value: matched, - // Cast descendant combinators to space - type: match[0].replace( rtrim, " " ) - } ); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || - (match = preFilters[ type ]( match ))) ) { - matched = match.shift(); - tokens.push( { - value: matched, - type: type, - matches: match - } ); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -} - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[i].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - checkNonElements = base && dir === "parentNode", - doneName = done++; - - return combinator.first ? - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var data, cache, outerCache, - dirkey = dirruns + " " + doneName; - - // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching - if ( xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || (elem[ expando ] = {}); - if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { - if ( (data = cache[1]) === true || data === cachedruns ) { - return data === true; - } - } else { - cache = outerCache[ dir ] = [ dirkey ]; - cache[1] = matcher( elem, context, xml ) || cachedruns; - if ( cache[1] === true ) { - return true; - } - } - } - } - } - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[i]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[0]; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( (elem = unmatched[i]) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction(function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( (elem = temp[i]) ) { - matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) ) { - // Restore matcherIn since elem is not yet a final match - temp.push( (matcherIn[i] = elem) ); - } - } - postFinder( null, (matcherOut = []), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) && - (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { - - seed[temp] = !(results[temp] = elem); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - }); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[0].type ], - implicitRelative = leadingRelative || Expr.relative[" "], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf.call( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - (checkContext = context).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - } ]; - - for ( ; i < len; i++ ) { - if ( (matcher = Expr.relative[ tokens[i].type ]) ) { - matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; - } else { - matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[j].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - // A counter to specify which element is currently being matched - var matcherCachedRuns = 0, - bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, expandContext ) { - var elem, j, matcher, - setMatched = [], - matchedCount = 0, - i = "0", - unmatched = seed && [], - outermost = expandContext != null, - contextBackup = outermostContext, - // We must always have either seed elements or context - elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); - - if ( outermost ) { - outermostContext = context !== document && context; - cachedruns = matcherCachedRuns; - } - - // Add elements passing elementMatchers directly to results - // Keep `i` a string if there are no elements so `matchedCount` will be "00" below - for ( ; (elem = elems[i]) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - while ( (matcher = elementMatchers[j++]) ) { - if ( matcher( elem, context, xml ) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - cachedruns = ++matcherCachedRuns; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - // They will have gone through all possible matchers - if ( (elem = !matcher && elem) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // Apply set filters to unmatched elements - matchedCount += i; - if ( bySet && i !== matchedCount ) { - j = 0; - while ( (matcher = setMatchers[j++]) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !(unmatched[i] || setMatched[i]) ) { - setMatched[i] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - // Generate a function of recursive functions that can be used to check each element - if ( !group ) { - group = tokenize( selector ); - } - i = group.length; - while ( i-- ) { - cached = matcherFromTokens( group[i] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); - } - return cached; -}; - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[i], results ); - } - return results; -} - -function select( selector, context, results, seed ) { - var i, tokens, token, type, find, - match = tokenize( selector ); - - if ( !seed ) { - // Try to minimize operations if there is only one group - if ( match.length === 1 ) { - - // Take a shortcut and set the context if the root selector is an ID - tokens = match[0] = match[0].slice( 0 ); - if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && - context.nodeType === 9 && documentIsHTML && - Expr.relative[ tokens[1].type ] ) { - - context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; - if ( !context ) { - return results; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[i]; - - // Abort if we hit a combinator - if ( Expr.relative[ (type = token.type) ] ) { - break; - } - if ( (find = Expr.find[ type ]) ) { - // Search, expanding context for leading sibling combinators - if ( (seed = find( - token.matches[0].replace( runescape, funescape ), - rsibling.test( tokens[0].type ) && context.parentNode || context - )) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - } - - // Compile and execute a filtering function - // Provide `match` to avoid retokenization if we modified the selector above - compile( selector, match )( - seed, - context, - !documentIsHTML, - results, - rsibling.test( selector ) - ); - return results; -} - -// Deprecated -Expr.pseudos["nth"] = Expr.pseudos["eq"]; - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -// Check sort stability -support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; - -// Initialize with the default document -setDocument(); - -// Always assume the presence of duplicates if sort doesn't -// pass them to our comparison function (as in Google Chrome). -[0, 0].sort( sortOrder ); -support.detectDuplicates = hasDuplicate; - -/* -// EXPOSE -if ( typeof define === "function" && define.amd ) { - define(function() { return Sizzle; }); -} else { - window.Sizzle = Sizzle; -} -*/ - -// EXPOSE -return Sizzle; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/StyleSheetLoader.js b/common/static/js/vendor/tinymce/js/tinymce/classes/dom/StyleSheetLoader.js deleted file mode 100755 index cf385acb3427..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/StyleSheetLoader.js +++ /dev/null @@ -1,185 +0,0 @@ -/** - * StyleSheetLoader.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class handles loading of external stylesheets and fires events when these are loaded. - * - * @class tinymce.dom.StyleSheetLoader - * @private - */ -define("tinymce/dom/StyleSheetLoader", [], function() { - "use strict"; - - return function(document, settings) { - var idCount = 0, loadedStates = {}, maxLoadTime; - - settings = settings || {}; - maxLoadTime = settings.maxLoadTime || 5000; - - function appendToHead(node) { - document.getElementsByTagName('head')[0].appendChild(node); - } - - /** - * Loads the specified css style sheet file and call the loadedCallback once it's finished loading. - * - * @method load - * @param {String} url Url to be loaded. - * @param {Function} loadedCallback Callback to be executed when loaded. - * @param {Function} errorCallback Callback to be executed when failed loading. - */ - function load(url, loadedCallback, errorCallback) { - var link, style, startTime, state; - - function passed() { - var callbacks = state.passed, i = callbacks.length; - - while (i--) { - callbacks[i](); - } - - state.status = 2; - state.passed = []; - state.failed = []; - } - - function failed() { - var callbacks = state.failed, i = callbacks.length; - - while (i--) { - callbacks[i](); - } - - state.status = 3; - state.passed = []; - state.failed = []; - } - - // Sniffs for older WebKit versions that have the link.onload but a broken one - function isOldWebKit() { - var webKitChunks = navigator.userAgent.match(/WebKit\/(\d*)/); - return !!(webKitChunks && webKitChunks[1] < 536); - } - - // Calls the waitCallback until the test returns true or the timeout occurs - function wait(testCallback, waitCallback) { - if (!testCallback()) { - // Wait for timeout - if ((new Date().getTime()) - startTime < maxLoadTime) { - window.setTimeout(waitCallback, 0); - } else { - failed(); - } - } - } - - // Workaround for WebKit that doesn't properly support the onload event for link elements - // Or WebKit that fires the onload event before the StyleSheet is added to the document - function waitForWebKitLinkLoaded() { - wait(function() { - var styleSheets = document.styleSheets, styleSheet, i = styleSheets.length, owner; - - while (i--) { - styleSheet = styleSheets[i]; - owner = styleSheet.ownerNode ? styleSheet.ownerNode : styleSheet.owningElement; - if (owner && owner.id === link.id) { - passed(); - return true; - } - } - }, waitForWebKitLinkLoaded); - } - - // Workaround for older Geckos that doesn't have any onload event for StyleSheets - function waitForGeckoLinkLoaded() { - wait(function() { - try { - // Accessing the cssRules will throw an exception until the CSS file is loaded - var cssRules = style.sheet.cssRules; - passed(); - return !!cssRules; - } catch (ex) { - // Ignore - } - }, waitForGeckoLinkLoaded); - } - - if (!loadedStates[url]) { - state = { - passed: [], - failed: [] - }; - - loadedStates[url] = state; - } else { - state = loadedStates[url]; - } - - if (loadedCallback) { - state.passed.push(loadedCallback); - } - - if (errorCallback) { - state.failed.push(errorCallback); - } - - // Is loading wait for it to pass - if (state.status == 1) { - return; - } - - // Has finished loading and was success - if (state.status == 2) { - passed(); - return; - } - - // Has finished loading and was a failure - if (state.status == 3) { - failed(); - return; - } - - // Start loading - state.status = 1; - link = document.createElement('link'); - link.rel = 'stylesheet'; - link.type = 'text/css'; - link.id = 'u' + (idCount++); - link.async = false; - link.defer = false; - startTime = new Date().getTime(); - - // Feature detect onload on link element and sniff older webkits since it has an broken onload event - if ("onload" in link && !isOldWebKit()) { - link.onload = waitForWebKitLinkLoaded; - link.onerror = failed; - } else { - // Sniff for old Firefox that doesn't support the onload event on link elements - // TODO: Remove this in the future when everyone uses modern browsers - if (navigator.userAgent.indexOf("Firefox") > 0) { - style = document.createElement('style'); - style.textContent = '@import "' + url + '"'; - waitForGeckoLinkLoaded(); - appendToHead(style); - return; - } else { - // Use the id owner on older webkits - waitForWebKitLinkLoaded(); - } - } - - appendToHead(link); - link.href = url; - } - - this.load = load; - }; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/TreeWalker.js b/common/static/js/vendor/tinymce/js/tinymce/classes/dom/TreeWalker.js deleted file mode 100755 index ffe8f0439d42..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/TreeWalker.js +++ /dev/null @@ -1,79 +0,0 @@ -/** - * TreeWalker.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * TreeWalker class enables you to walk the DOM in a linear manner. - * - * @class tinymce.dom.TreeWalker - */ -define("tinymce/dom/TreeWalker", [], function() { - return function(start_node, root_node) { - var node = start_node; - - function findSibling(node, start_name, sibling_name, shallow) { - var sibling, parent; - - if (node) { - // Walk into nodes if it has a start - if (!shallow && node[start_name]) { - return node[start_name]; - } - - // Return the sibling if it has one - if (node != root_node) { - sibling = node[sibling_name]; - if (sibling) { - return sibling; - } - - // Walk up the parents to look for siblings - for (parent = node.parentNode; parent && parent != root_node; parent = parent.parentNode) { - sibling = parent[sibling_name]; - if (sibling) { - return sibling; - } - } - } - } - } - - /** - * Returns the current node. - * - * @method current - * @return {Node} Current node where the walker is. - */ - this.current = function() { - return node; - }; - - /** - * Walks to the next node in tree. - * - * @method next - * @return {Node} Current node where the walker is after moving to the next node. - */ - this.next = function(shallow) { - node = findSibling(node, 'firstChild', 'nextSibling', shallow); - return node; - }; - - /** - * Walks to the previous node in tree. - * - * @method prev - * @return {Node} Current node where the walker is after moving to the previous node. - */ - this.prev = function(shallow) { - node = findSibling(node, 'lastChild', 'previousSibling', shallow); - return node; - }; - }; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/TridentSelection.js b/common/static/js/vendor/tinymce/js/tinymce/classes/dom/TridentSelection.js deleted file mode 100755 index 1edb9208c23c..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/dom/TridentSelection.js +++ /dev/null @@ -1,502 +0,0 @@ -/** - * TridentSelection.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Selection class for old explorer versions. This one fakes the - * native selection object available on modern browsers. - * - * @class tinymce.dom.TridentSelection - */ -define("tinymce/dom/TridentSelection", [], function() { - function Selection(selection) { - var self = this, dom = selection.dom, FALSE = false; - - function getPosition(rng, start) { - var checkRng, startIndex = 0, endIndex, inside, - children, child, offset, index, position = -1, parent; - - // Setup test range, collapse it and get the parent - checkRng = rng.duplicate(); - checkRng.collapse(start); - parent = checkRng.parentElement(); - - // Check if the selection is within the right document - if (parent.ownerDocument !== selection.dom.doc) { - return; - } - - // IE will report non editable elements as it's parent so look for an editable one - while (parent.contentEditable === "false") { - parent = parent.parentNode; - } - - // If parent doesn't have any children then return that we are inside the element - if (!parent.hasChildNodes()) { - return {node: parent, inside: 1}; - } - - // Setup node list and endIndex - children = parent.children; - endIndex = children.length - 1; - - // Perform a binary search for the position - while (startIndex <= endIndex) { - index = Math.floor((startIndex + endIndex) / 2); - - // Move selection to node and compare the ranges - child = children[index]; - checkRng.moveToElementText(child); - position = checkRng.compareEndPoints(start ? 'StartToStart' : 'EndToEnd', rng); - - // Before/after or an exact match - if (position > 0) { - endIndex = index - 1; - } else if (position < 0) { - startIndex = index + 1; - } else { - return {node: child}; - } - } - - // Check if child position is before or we didn't find a position - if (position < 0) { - // No element child was found use the parent element and the offset inside that - if (!child) { - checkRng.moveToElementText(parent); - checkRng.collapse(true); - child = parent; - inside = true; - } else { - checkRng.collapse(false); - } - - // Walk character by character in text node until we hit the selected range endpoint, - // hit the end of document or parent isn't the right one - // We need to walk char by char since rng.text or rng.htmlText will trim line endings - offset = 0; - while (checkRng.compareEndPoints(start ? 'StartToStart' : 'StartToEnd', rng) !== 0) { - if (checkRng.move('character', 1) === 0 || parent != checkRng.parentElement()) { - break; - } - - offset++; - } - } else { - // Child position is after the selection endpoint - checkRng.collapse(true); - - // Walk character by character in text node until we hit the selected range endpoint, hit - // the end of document or parent isn't the right one - offset = 0; - while (checkRng.compareEndPoints(start ? 'StartToStart' : 'StartToEnd', rng) !== 0) { - if (checkRng.move('character', -1) === 0 || parent != checkRng.parentElement()) { - break; - } - - offset++; - } - } - - return {node: child, position: position, offset: offset, inside: inside}; - } - - // Returns a W3C DOM compatible range object by using the IE Range API - function getRange() { - var ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed, tmpRange, element2, bookmark; - - // If selection is outside the current document just return an empty range - element = ieRange.item ? ieRange.item(0) : ieRange.parentElement(); - if (element.ownerDocument != dom.doc) { - return domRange; - } - - collapsed = selection.isCollapsed(); - - // Handle control selection - if (ieRange.item) { - domRange.setStart(element.parentNode, dom.nodeIndex(element)); - domRange.setEnd(domRange.startContainer, domRange.startOffset + 1); - - return domRange; - } - - function findEndPoint(start) { - var endPoint = getPosition(ieRange, start), container, offset, textNodeOffset = 0, sibling, undef, nodeValue; - - container = endPoint.node; - offset = endPoint.offset; - - if (endPoint.inside && !container.hasChildNodes()) { - domRange[start ? 'setStart' : 'setEnd'](container, 0); - return; - } - - if (offset === undef) { - domRange[start ? 'setStartBefore' : 'setEndAfter'](container); - return; - } - - if (endPoint.position < 0) { - sibling = endPoint.inside ? container.firstChild : container.nextSibling; - - if (!sibling) { - domRange[start ? 'setStartAfter' : 'setEndAfter'](container); - return; - } - - if (!offset) { - if (sibling.nodeType == 3) { - domRange[start ? 'setStart' : 'setEnd'](sibling, 0); - } else { - domRange[start ? 'setStartBefore' : 'setEndBefore'](sibling); - } - - return; - } - - // Find the text node and offset - while (sibling) { - nodeValue = sibling.nodeValue; - textNodeOffset += nodeValue.length; - - // We are at or passed the position we where looking for - if (textNodeOffset >= offset) { - container = sibling; - textNodeOffset -= offset; - textNodeOffset = nodeValue.length - textNodeOffset; - break; - } - - sibling = sibling.nextSibling; - } - } else { - // Find the text node and offset - sibling = container.previousSibling; - - if (!sibling) { - return domRange[start ? 'setStartBefore' : 'setEndBefore'](container); - } - - // If there isn't any text to loop then use the first position - if (!offset) { - if (container.nodeType == 3) { - domRange[start ? 'setStart' : 'setEnd'](sibling, container.nodeValue.length); - } else { - domRange[start ? 'setStartAfter' : 'setEndAfter'](sibling); - } - - return; - } - - while (sibling) { - textNodeOffset += sibling.nodeValue.length; - - // We are at or passed the position we where looking for - if (textNodeOffset >= offset) { - container = sibling; - textNodeOffset -= offset; - break; - } - - sibling = sibling.previousSibling; - } - } - - domRange[start ? 'setStart' : 'setEnd'](container, textNodeOffset); - } - - try { - // Find start point - findEndPoint(true); - - // Find end point if needed - if (!collapsed) { - findEndPoint(); - } - } catch (ex) { - // IE has a nasty bug where text nodes might throw "invalid argument" when you - // access the nodeValue or other properties of text nodes. This seems to happend when - // text nodes are split into two nodes by a delete/backspace call. So lets detect it and try to fix it. - if (ex.number == -2147024809) { - // Get the current selection - bookmark = self.getBookmark(2); - - // Get start element - tmpRange = ieRange.duplicate(); - tmpRange.collapse(true); - element = tmpRange.parentElement(); - - // Get end element - if (!collapsed) { - tmpRange = ieRange.duplicate(); - tmpRange.collapse(false); - element2 = tmpRange.parentElement(); - element2.innerHTML = element2.innerHTML; - } - - // Remove the broken elements - element.innerHTML = element.innerHTML; - - // Restore the selection - self.moveToBookmark(bookmark); - - // Since the range has moved we need to re-get it - ieRange = selection.getRng(); - - // Find start point - findEndPoint(true); - - // Find end point if needed - if (!collapsed) { - findEndPoint(); - } - } else { - throw ex; // Throw other errors - } - } - - return domRange; - } - - this.getBookmark = function(type) { - var rng = selection.getRng(), bookmark = {}; - - function getIndexes(node) { - var parent, root, children, i, indexes = []; - - parent = node.parentNode; - root = dom.getRoot().parentNode; - - while (parent != root && parent.nodeType !== 9) { - children = parent.children; - - i = children.length; - while (i--) { - if (node === children[i]) { - indexes.push(i); - break; - } - } - - node = parent; - parent = parent.parentNode; - } - - return indexes; - } - - function getBookmarkEndPoint(start) { - var position; - - position = getPosition(rng, start); - if (position) { - return { - position: position.position, - offset: position.offset, - indexes: getIndexes(position.node), - inside: position.inside - }; - } - } - - // Non ubstructive bookmark - if (type === 2) { - // Handle text selection - if (!rng.item) { - bookmark.start = getBookmarkEndPoint(true); - - if (!selection.isCollapsed()) { - bookmark.end = getBookmarkEndPoint(); - } - } else { - bookmark.start = {ctrl: true, indexes: getIndexes(rng.item(0))}; - } - } - - return bookmark; - }; - - this.moveToBookmark = function(bookmark) { - var rng, body = dom.doc.body; - - function resolveIndexes(indexes) { - var node, i, idx, children; - - node = dom.getRoot(); - for (i = indexes.length - 1; i >= 0; i--) { - children = node.children; - idx = indexes[i]; - - if (idx <= children.length - 1) { - node = children[idx]; - } - } - - return node; - } - - function setBookmarkEndPoint(start) { - var endPoint = bookmark[start ? 'start' : 'end'], moveLeft, moveRng, undef, offset; - - if (endPoint) { - moveLeft = endPoint.position > 0; - - moveRng = body.createTextRange(); - moveRng.moveToElementText(resolveIndexes(endPoint.indexes)); - - offset = endPoint.offset; - if (offset !== undef) { - moveRng.collapse(endPoint.inside || moveLeft); - moveRng.moveStart('character', moveLeft ? -offset : offset); - } else { - moveRng.collapse(start); - } - - rng.setEndPoint(start ? 'StartToStart' : 'EndToStart', moveRng); - - if (start) { - rng.collapse(true); - } - } - } - - if (bookmark.start) { - if (bookmark.start.ctrl) { - rng = body.createControlRange(); - rng.addElement(resolveIndexes(bookmark.start.indexes)); - rng.select(); - } else { - rng = body.createTextRange(); - setBookmarkEndPoint(true); - setBookmarkEndPoint(); - rng.select(); - } - } - }; - - this.addRange = function(rng) { - var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, sibling, - doc = selection.dom.doc, body = doc.body, nativeRng, ctrlElm; - - function setEndPoint(start) { - var container, offset, marker, tmpRng, nodes; - - marker = dom.create('a'); - container = start ? startContainer : endContainer; - offset = start ? startOffset : endOffset; - tmpRng = ieRng.duplicate(); - - if (container == doc || container == doc.documentElement) { - container = body; - offset = 0; - } - - if (container.nodeType == 3) { - container.parentNode.insertBefore(marker, container); - tmpRng.moveToElementText(marker); - tmpRng.moveStart('character', offset); - dom.remove(marker); - ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng); - } else { - nodes = container.childNodes; - - if (nodes.length) { - if (offset >= nodes.length) { - dom.insertAfter(marker, nodes[nodes.length - 1]); - } else { - container.insertBefore(marker, nodes[offset]); - } - - tmpRng.moveToElementText(marker); - } else if (container.canHaveHTML) { - // Empty node selection for example
|
- // Setting innerHTML with a span marker then remove that marker seems to keep empty block elements open - container.innerHTML = ''; - marker = container.firstChild; - tmpRng.moveToElementText(marker); - tmpRng.collapse(FALSE); // Collapse false works better than true for some odd reason - } - - ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng); - dom.remove(marker); - } - } - - // Setup some shorter versions - startContainer = rng.startContainer; - startOffset = rng.startOffset; - endContainer = rng.endContainer; - endOffset = rng.endOffset; - ieRng = body.createTextRange(); - - // If single element selection then try making a control selection out of it - if (startContainer == endContainer && startContainer.nodeType == 1) { - // Trick to place the caret inside an empty block element like

- if (startOffset == endOffset && !startContainer.hasChildNodes()) { - if (startContainer.canHaveHTML) { - // Check if previous sibling is an empty block if it is then we need to render it - // IE would otherwise move the caret into the sibling instead of the empty startContainer see: #5236 - // Example this:

|

would become this:

|

- sibling = startContainer.previousSibling; - if (sibling && !sibling.hasChildNodes() && dom.isBlock(sibling)) { - sibling.innerHTML = ''; - } else { - sibling = null; - } - - startContainer.innerHTML = ''; - ieRng.moveToElementText(startContainer.lastChild); - ieRng.select(); - dom.doc.selection.clear(); - startContainer.innerHTML = ''; - - if (sibling) { - sibling.innerHTML = ''; - } - return; - } else { - startOffset = dom.nodeIndex(startContainer); - startContainer = startContainer.parentNode; - } - } - - if (startOffset == endOffset - 1) { - try { - ctrlElm = startContainer.childNodes[startOffset]; - ctrlRng = body.createControlRange(); - ctrlRng.addElement(ctrlElm); - ctrlRng.select(); - - // Check if the range produced is on the correct element and is a control range - // On IE 8 it will select the parent contentEditable container if you select an inner element see: #5398 - nativeRng = selection.getRng(); - if (nativeRng.item && ctrlElm === nativeRng.item(0)) { - return; - } - } catch (ex) { - // Ignore - } - } - } - - // Set start/end point of selection - setEndPoint(true); - setEndPoint(); - - // Select the new range and scroll it into view - ieRng.select(); - }; - - // Expose range method - this.getRangeAt = getRange; - } - - return Selection; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/html/DomParser.js b/common/static/js/vendor/tinymce/js/tinymce/classes/html/DomParser.js deleted file mode 100755 index bc494adde32b..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/html/DomParser.js +++ /dev/null @@ -1,756 +0,0 @@ -/** - * DomParser.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class parses HTML code into a DOM like structure of nodes it will remove redundant whitespace and make - * sure that the node tree is valid according to the specified schema. - * So for example:

a

b

c

will become

a

b

c

- * - * @example - * var parser = new tinymce.html.DomParser({validate: true}, schema); - * var rootNode = parser.parse('

content

'); - * - * @class tinymce.html.DomParser - * @version 3.4 - */ -define("tinymce/html/DomParser", [ - "tinymce/html/Node", - "tinymce/html/Schema", - "tinymce/html/SaxParser", - "tinymce/util/Tools" -], function(Node, Schema, SaxParser, Tools) { - var makeMap = Tools.makeMap, each = Tools.each, explode = Tools.explode, extend = Tools.extend; - - /** - * Constructs a new DomParser instance. - * - * @constructor - * @method DomParser - * @param {Object} settings Name/value collection of settings. comment, cdata, text, start and end are callbacks. - * @param {tinymce.html.Schema} schema HTML Schema class to use when parsing. - */ - return function(settings, schema) { - var self = this, nodeFilters = {}, attributeFilters = [], matchedNodes = {}, matchedAttributes = {}; - - settings = settings || {}; - settings.validate = "validate" in settings ? settings.validate : true; - settings.root_name = settings.root_name || 'body'; - self.schema = schema = schema || new Schema(); - - function fixInvalidChildren(nodes) { - var ni, node, parent, parents, newParent, currentNode, tempNode, childNode, i; - var nonEmptyElements, nonSplitableElements, textBlockElements, sibling, nextNode; - - nonSplitableElements = makeMap('tr,td,th,tbody,thead,tfoot,table'); - nonEmptyElements = schema.getNonEmptyElements(); - textBlockElements = schema.getTextBlockElements(); - - for (ni = 0; ni < nodes.length; ni++) { - node = nodes[ni]; - - // Already removed or fixed - if (!node.parent || node.fixed) { - continue; - } - - // If the invalid element is a text block and the text block is within a parent LI element - // Then unwrap the first text block and convert other sibling text blocks to LI elements similar to Word/Open Office - if (textBlockElements[node.name] && node.parent.name == 'li') { - // Move sibling text blocks after LI element - sibling = node.next; - while (sibling) { - if (textBlockElements[sibling.name]) { - sibling.name = 'li'; - sibling.fixed = true; - node.parent.insert(sibling, node.parent); - } else { - break; - } - - sibling = sibling.next; - } - - // Unwrap current text block - node.unwrap(node); - continue; - } - - // Get list of all parent nodes until we find a valid parent to stick the child into - parents = [node]; - for (parent = node.parent; parent && !schema.isValidChild(parent.name, node.name) && - !nonSplitableElements[parent.name]; parent = parent.parent) { - parents.push(parent); - } - - // Found a suitable parent - if (parent && parents.length > 1) { - // Reverse the array since it makes looping easier - parents.reverse(); - - // Clone the related parent and insert that after the moved node - newParent = currentNode = self.filterNode(parents[0].clone()); - - // Start cloning and moving children on the left side of the target node - for (i = 0; i < parents.length - 1; i++) { - if (schema.isValidChild(currentNode.name, parents[i].name)) { - tempNode = self.filterNode(parents[i].clone()); - currentNode.append(tempNode); - } else { - tempNode = currentNode; - } - - for (childNode = parents[i].firstChild; childNode && childNode != parents[i + 1]; ) { - nextNode = childNode.next; - tempNode.append(childNode); - childNode = nextNode; - } - - currentNode = tempNode; - } - - if (!newParent.isEmpty(nonEmptyElements)) { - parent.insert(newParent, parents[0], true); - parent.insert(node, newParent); - } else { - parent.insert(node, parents[0], true); - } - - // Check if the element is empty by looking through it's contents and special treatment for


- parent = parents[0]; - if (parent.isEmpty(nonEmptyElements) || parent.firstChild === parent.lastChild && parent.firstChild.name === 'br') { - parent.empty().remove(); - } - } else if (node.parent) { - // If it's an LI try to find a UL/OL for it or wrap it - if (node.name === 'li') { - sibling = node.prev; - if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) { - sibling.append(node); - continue; - } - - sibling = node.next; - if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) { - sibling.insert(node, sibling.firstChild, true); - continue; - } - - node.wrap(self.filterNode(new Node('ul', 1))); - continue; - } - - // Try wrapping the element in a DIV - if (schema.isValidChild(node.parent.name, 'div') && schema.isValidChild('div', node.name)) { - node.wrap(self.filterNode(new Node('div', 1))); - } else { - // We failed wrapping it, then remove or unwrap it - if (node.name === 'style' || node.name === 'script') { - node.empty().remove(); - } else { - node.unwrap(); - } - } - } - } - } - - /** - * Runs the specified node though the element and attributes filters. - * - * @method filterNode - * @param {tinymce.html.Node} Node the node to run filters on. - * @return {tinymce.html.Node} The passed in node. - */ - self.filterNode = function(node) { - var i, name, list; - - // Run element filters - if (name in nodeFilters) { - list = matchedNodes[name]; - - if (list) { - list.push(node); - } else { - matchedNodes[name] = [node]; - } - } - - // Run attribute filters - i = attributeFilters.length; - while (i--) { - name = attributeFilters[i].name; - - if (name in node.attributes.map) { - list = matchedAttributes[name]; - - if (list) { - list.push(node); - } else { - matchedAttributes[name] = [node]; - } - } - } - - return node; - }; - - /** - * Adds a node filter function to the parser, the parser will collect the specified nodes by name - * and then execute the callback ones it has finished parsing the document. - * - * @example - * parser.addNodeFilter('p,h1', function(nodes, name) { - * for (var i = 0; i < nodes.length; i++) { - * console.log(nodes[i].name); - * } - * }); - * @method addNodeFilter - * @method {String} name Comma separated list of nodes to collect. - * @param {function} callback Callback function to execute once it has collected nodes. - */ - self.addNodeFilter = function(name, callback) { - each(explode(name), function(name) { - var list = nodeFilters[name]; - - if (!list) { - nodeFilters[name] = list = []; - } - - list.push(callback); - }); - }; - - /** - * Adds a attribute filter function to the parser, the parser will collect nodes that has the specified attributes - * and then execute the callback ones it has finished parsing the document. - * - * @example - * parser.addAttributeFilter('src,href', function(nodes, name) { - * for (var i = 0; i < nodes.length; i++) { - * console.log(nodes[i].name); - * } - * }); - * @method addAttributeFilter - * @method {String} name Comma separated list of nodes to collect. - * @param {function} callback Callback function to execute once it has collected nodes. - */ - self.addAttributeFilter = function(name, callback) { - each(explode(name), function(name) { - var i; - - for (i = 0; i < attributeFilters.length; i++) { - if (attributeFilters[i].name === name) { - attributeFilters[i].callbacks.push(callback); - return; - } - } - - attributeFilters.push({name: name, callbacks: [callback]}); - }); - }; - - /** - * Parses the specified HTML string into a DOM like node tree and returns the result. - * - * @example - * var rootNode = new DomParser({...}).parse('text'); - * @method parse - * @param {String} html Html string to sax parse. - * @param {Object} args Optional args object that gets passed to all filter functions. - * @return {tinymce.html.Node} Root node containing the tree. - */ - self.parse = function(html, args) { - var parser, rootNode, node, nodes, i, l, fi, fl, list, name, validate; - var blockElements, startWhiteSpaceRegExp, invalidChildren = [], isInWhiteSpacePreservedElement; - var endWhiteSpaceRegExp, allWhiteSpaceRegExp, isAllWhiteSpaceRegExp, whiteSpaceElements; - var children, nonEmptyElements, rootBlockName; - - args = args || {}; - matchedNodes = {}; - matchedAttributes = {}; - blockElements = extend(makeMap('script,style,head,html,body,title,meta,param'), schema.getBlockElements()); - nonEmptyElements = schema.getNonEmptyElements(); - children = schema.children; - validate = settings.validate; - rootBlockName = "forced_root_block" in args ? args.forced_root_block : settings.forced_root_block; - - whiteSpaceElements = schema.getWhiteSpaceElements(); - startWhiteSpaceRegExp = /^[ \t\r\n]+/; - endWhiteSpaceRegExp = /[ \t\r\n]+$/; - allWhiteSpaceRegExp = /[ \t\r\n]+/g; - isAllWhiteSpaceRegExp = /^[ \t\r\n]+$/; - - function addRootBlocks() { - var node = rootNode.firstChild, next, rootBlockNode; - - // Removes whitespace at beginning and end of block so: - //

x

->

x

- function trim(rootBlockNode) { - if (rootBlockNode) { - node = rootBlockNode.firstChild; - if (node && node.type == 3) { - node.value = node.value.replace(startWhiteSpaceRegExp, ''); - } - - node = rootBlockNode.lastChild; - if (node && node.type == 3) { - node.value = node.value.replace(endWhiteSpaceRegExp, ''); - } - } - } - - // Check if rootBlock is valid within rootNode for example if P is valid in H1 if H1 is the contentEditabe root - if (!schema.isValidChild(rootNode.name, rootBlockName.toLowerCase())) { - return; - } - - while (node) { - next = node.next; - - if (node.type == 3 || (node.type == 1 && node.name !== 'p' && - !blockElements[node.name] && !node.attr('data-mce-type'))) { - if (!rootBlockNode) { - // Create a new root block element - rootBlockNode = createNode(rootBlockName, 1); - rootBlockNode.attr(settings.forced_root_block_attrs); - rootNode.insert(rootBlockNode, node); - rootBlockNode.append(node); - } else { - rootBlockNode.append(node); - } - } else { - trim(rootBlockNode); - rootBlockNode = null; - } - - node = next; - } - - trim(rootBlockNode); - } - - function createNode(name, type) { - var node = new Node(name, type), list; - - if (name in nodeFilters) { - list = matchedNodes[name]; - - if (list) { - list.push(node); - } else { - matchedNodes[name] = [node]; - } - } - - return node; - } - - function removeWhitespaceBefore(node) { - var textNode, textVal, sibling; - - for (textNode = node.prev; textNode && textNode.type === 3; ) { - textVal = textNode.value.replace(endWhiteSpaceRegExp, ''); - - if (textVal.length > 0) { - textNode.value = textVal; - textNode = textNode.prev; - } else { - sibling = textNode.prev; - textNode.remove(); - textNode = sibling; - } - } - } - - function cloneAndExcludeBlocks(input) { - var name, output = {}; - - for (name in input) { - if (name !== 'li' && name != 'p') { - output[name] = input[name]; - } - } - - return output; - } - - parser = new SaxParser({ - validate: validate, - allow_script_urls: settings.allow_script_urls, - allow_conditional_comments: settings.allow_conditional_comments, - - // Exclude P and LI from DOM parsing since it's treated better by the DOM parser - self_closing_elements: cloneAndExcludeBlocks(schema.getSelfClosingElements()), - - cdata: function(text) { - node.append(createNode('#cdata', 4)).value = text; - }, - - text: function(text, raw) { - var textNode; - - // Trim all redundant whitespace on non white space elements - if (!isInWhiteSpacePreservedElement) { - text = text.replace(allWhiteSpaceRegExp, ' '); - - if (node.lastChild && blockElements[node.lastChild.name]) { - text = text.replace(startWhiteSpaceRegExp, ''); - } - } - - // Do we need to create the node - if (text.length !== 0) { - textNode = createNode('#text', 3); - textNode.raw = !!raw; - node.append(textNode).value = text; - } - }, - - comment: function(text) { - node.append(createNode('#comment', 8)).value = text; - }, - - pi: function(name, text) { - node.append(createNode(name, 7)).value = text; - removeWhitespaceBefore(node); - }, - - doctype: function(text) { - var newNode; - - newNode = node.append(createNode('#doctype', 10)); - newNode.value = text; - removeWhitespaceBefore(node); - }, - - start: function(name, attrs, empty) { - var newNode, attrFiltersLen, elementRule, attrName, parent; - - elementRule = validate ? schema.getElementRule(name) : {}; - if (elementRule) { - newNode = createNode(elementRule.outputName || name, 1); - newNode.attributes = attrs; - newNode.shortEnded = empty; - - node.append(newNode); - - // Check if node is valid child of the parent node is the child is - // unknown we don't collect it since it's probably a custom element - parent = children[node.name]; - if (parent && children[newNode.name] && !parent[newNode.name]) { - invalidChildren.push(newNode); - } - - attrFiltersLen = attributeFilters.length; - while (attrFiltersLen--) { - attrName = attributeFilters[attrFiltersLen].name; - - if (attrName in attrs.map) { - list = matchedAttributes[attrName]; - - if (list) { - list.push(newNode); - } else { - matchedAttributes[attrName] = [newNode]; - } - } - } - - // Trim whitespace before block - if (blockElements[name]) { - removeWhitespaceBefore(newNode); - } - - // Change current node if the element wasn't empty i.e not
or - if (!empty) { - node = newNode; - } - - // Check if we are inside a whitespace preserved element - if (!isInWhiteSpacePreservedElement && whiteSpaceElements[name]) { - isInWhiteSpacePreservedElement = true; - } - } - }, - - end: function(name) { - var textNode, elementRule, text, sibling, tempNode; - - elementRule = validate ? schema.getElementRule(name) : {}; - if (elementRule) { - if (blockElements[name]) { - if (!isInWhiteSpacePreservedElement) { - // Trim whitespace of the first node in a block - textNode = node.firstChild; - if (textNode && textNode.type === 3) { - text = textNode.value.replace(startWhiteSpaceRegExp, ''); - - // Any characters left after trim or should we remove it - if (text.length > 0) { - textNode.value = text; - textNode = textNode.next; - } else { - sibling = textNode.next; - textNode.remove(); - textNode = sibling; - - // Remove any pure whitespace siblings - while (textNode && textNode.type === 3) { - text = textNode.value; - sibling = textNode.next; - - if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) { - textNode.remove(); - textNode = sibling; - } - - textNode = sibling; - } - } - } - - // Trim whitespace of the last node in a block - textNode = node.lastChild; - if (textNode && textNode.type === 3) { - text = textNode.value.replace(endWhiteSpaceRegExp, ''); - - // Any characters left after trim or should we remove it - if (text.length > 0) { - textNode.value = text; - textNode = textNode.prev; - } else { - sibling = textNode.prev; - textNode.remove(); - textNode = sibling; - - // Remove any pure whitespace siblings - while (textNode && textNode.type === 3) { - text = textNode.value; - sibling = textNode.prev; - - if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) { - textNode.remove(); - textNode = sibling; - } - - textNode = sibling; - } - } - } - } - - // Trim start white space - // Removed due to: #5424 - /*textNode = node.prev; - if (textNode && textNode.type === 3) { - text = textNode.value.replace(startWhiteSpaceRegExp, ''); - - if (text.length > 0) - textNode.value = text; - else - textNode.remove(); - }*/ - } - - // Check if we exited a whitespace preserved element - if (isInWhiteSpacePreservedElement && whiteSpaceElements[name]) { - isInWhiteSpacePreservedElement = false; - } - - // Handle empty nodes - if (elementRule.removeEmpty || elementRule.paddEmpty) { - if (node.isEmpty(nonEmptyElements)) { - if (elementRule.paddEmpty) { - node.empty().append(new Node('#text', '3')).value = '\u00a0'; - } else { - // Leave nodes that have a name like - if (!node.attributes.map.name && !node.attributes.map.id) { - tempNode = node.parent; - node.empty().remove(); - node = tempNode; - return; - } - } - } - } - - node = node.parent; - } - } - }, schema); - - rootNode = node = new Node(args.context || settings.root_name, 11); - - parser.parse(html); - - // Fix invalid children or report invalid children in a contextual parsing - if (validate && invalidChildren.length) { - if (!args.context) { - fixInvalidChildren(invalidChildren); - } else { - args.invalid = true; - } - } - - // Wrap nodes in the root into block elements if the root is body - if (rootBlockName && (rootNode.name == 'body' || args.isRootContent)) { - addRootBlocks(); - } - - // Run filters only when the contents is valid - if (!args.invalid) { - // Run node filters - for (name in matchedNodes) { - list = nodeFilters[name]; - nodes = matchedNodes[name]; - - // Remove already removed children - fi = nodes.length; - while (fi--) { - if (!nodes[fi].parent) { - nodes.splice(fi, 1); - } - } - - for (i = 0, l = list.length; i < l; i++) { - list[i](nodes, name, args); - } - } - - // Run attribute filters - for (i = 0, l = attributeFilters.length; i < l; i++) { - list = attributeFilters[i]; - - if (list.name in matchedAttributes) { - nodes = matchedAttributes[list.name]; - - // Remove already removed children - fi = nodes.length; - while (fi--) { - if (!nodes[fi].parent) { - nodes.splice(fi, 1); - } - } - - for (fi = 0, fl = list.callbacks.length; fi < fl; fi++) { - list.callbacks[fi](nodes, list.name, args); - } - } - } - } - - return rootNode; - }; - - // Remove
at end of block elements Gecko and WebKit injects BR elements to - // make it possible to place the caret inside empty blocks. This logic tries to remove - // these elements and keep br elements that where intended to be there intact - if (settings.remove_trailing_brs) { - self.addNodeFilter('br', function(nodes) { - var i, l = nodes.length, node, blockElements = extend({}, schema.getBlockElements()); - var nonEmptyElements = schema.getNonEmptyElements(), parent, lastParent, prev, prevName; - var elementRule, textNode; - - // Remove brs from body element as well - blockElements.body = 1; - - // Must loop forwards since it will otherwise remove all brs in

a


- for (i = 0; i < l; i++) { - node = nodes[i]; - parent = node.parent; - - if (blockElements[node.parent.name] && node === parent.lastChild) { - // Loop all nodes to the left of the current node and check for other BR elements - // excluding bookmarks since they are invisible - prev = node.prev; - while (prev) { - prevName = prev.name; - - // Ignore bookmarks - if (prevName !== "span" || prev.attr('data-mce-type') !== 'bookmark') { - // Found a non BR element - if (prevName !== "br") { - break; - } - - // Found another br it's a

structure then don't remove anything - if (prevName === 'br') { - node = null; - break; - } - } - - prev = prev.prev; - } - - if (node) { - node.remove(); - - // Is the parent to be considered empty after we removed the BR - if (parent.isEmpty(nonEmptyElements)) { - elementRule = schema.getElementRule(parent.name); - - // Remove or padd the element depending on schema rule - if (elementRule) { - if (elementRule.removeEmpty) { - parent.remove(); - } else if (elementRule.paddEmpty) { - parent.empty().append(new Node('#text', 3)).value = '\u00a0'; - } - } - } - } - } else { - // Replaces BR elements inside inline elements like


- // so they become

 

- lastParent = node; - while (parent && parent.firstChild === lastParent && parent.lastChild === lastParent) { - lastParent = parent; - - if (blockElements[parent.name]) { - break; - } - - parent = parent.parent; - } - - if (lastParent === parent) { - textNode = new Node('#text', 3); - textNode.value = '\u00a0'; - node.replace(textNode); - } - } - } - }); - } - - // Force anchor names closed, unless the setting "allow_html_in_named_anchor" is explicitly included. - if (!settings.allow_html_in_named_anchor) { - self.addAttributeFilter('id,name', function(nodes) { - var i = nodes.length, sibling, prevSibling, parent, node; - - while (i--) { - node = nodes[i]; - if (node.name === 'a' && node.firstChild && !node.attr('href')) { - parent = node.parent; - - // Move children after current node - sibling = node.lastChild; - do { - prevSibling = sibling.prev; - parent.insert(sibling, node); - sibling = prevSibling; - } while (sibling); - } - } - }); - } - }; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/html/Entities.js b/common/static/js/vendor/tinymce/js/tinymce/classes/html/Entities.js deleted file mode 100755 index 71430a9dfcb1..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/html/Entities.js +++ /dev/null @@ -1,263 +0,0 @@ -/** - * Entities.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*jshint bitwise:false */ -/*eslint no-bitwise:0 */ - -/** - * Entity encoder class. - * - * @class tinymce.html.Entities - * @static - * @version 3.4 - */ -define("tinymce/html/Entities", [ - "tinymce/util/Tools" -], function(Tools) { - var makeMap = Tools.makeMap; - - var namedEntities, baseEntities, reverseEntities, - attrsCharsRegExp = /[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g, - textCharsRegExp = /[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g, - rawCharsRegExp = /[<>&\"\']/g, - entityRegExp = /&(#x|#)?([\w]+);/g, - asciiMap = { - 128: "\u20AC", 130: "\u201A", 131: "\u0192", 132: "\u201E", 133: "\u2026", 134: "\u2020", - 135: "\u2021", 136: "\u02C6", 137: "\u2030", 138: "\u0160", 139: "\u2039", 140: "\u0152", - 142: "\u017D", 145: "\u2018", 146: "\u2019", 147: "\u201C", 148: "\u201D", 149: "\u2022", - 150: "\u2013", 151: "\u2014", 152: "\u02DC", 153: "\u2122", 154: "\u0161", 155: "\u203A", - 156: "\u0153", 158: "\u017E", 159: "\u0178" - }; - - // Raw entities - baseEntities = { - '\"': '"', // Needs to be escaped since the YUI compressor would otherwise break the code - "'": ''', - '<': '<', - '>': '>', - '&': '&' - }; - - // Reverse lookup table for raw entities - reverseEntities = { - '<': '<', - '>': '>', - '&': '&', - '"': '"', - ''': "'" - }; - - // Decodes text by using the browser - function nativeDecode(text) { - var elm; - - elm = document.createElement("div"); - elm.innerHTML = text; - - return elm.textContent || elm.innerText || text; - } - - // Build a two way lookup table for the entities - function buildEntitiesLookup(items, radix) { - var i, chr, entity, lookup = {}; - - if (items) { - items = items.split(','); - radix = radix || 10; - - // Build entities lookup table - for (i = 0; i < items.length; i += 2) { - chr = String.fromCharCode(parseInt(items[i], radix)); - - // Only add non base entities - if (!baseEntities[chr]) { - entity = '&' + items[i + 1] + ';'; - lookup[chr] = entity; - lookup[entity] = chr; - } - } - - return lookup; - } - } - - // Unpack entities lookup where the numbers are in radix 32 to reduce the size - namedEntities = buildEntitiesLookup( - '50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,' + - '5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,' + - '5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,' + - '5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,' + - '68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,' + - '6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,' + - '6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,' + - '75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,' + - '7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,' + - '7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,' + - 'sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,' + - 'st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,' + - 't9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,' + - 'tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,' + - 'u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,' + - '81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,' + - '8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,' + - '8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,' + - '8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,' + - '8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,' + - 'nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,' + - 'rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,' + - 'Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,' + - '80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,' + - '811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro', 32); - - var Entities = { - /** - * Encodes the specified string using raw entities. This means only the required XML base entities will be endoded. - * - * @method encodeRaw - * @param {String} text Text to encode. - * @param {Boolean} attr Optional flag to specify if the text is attribute contents. - * @return {String} Entity encoded text. - */ - encodeRaw: function(text, attr) { - return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { - return baseEntities[chr] || chr; - }); - }, - - /** - * Encoded the specified text with both the attributes and text entities. This function will produce larger text contents - * since it doesn't know if the context is within a attribute or text node. This was added for compatibility - * and is exposed as the DOMUtils.encode function. - * - * @method encodeAllRaw - * @param {String} text Text to encode. - * @return {String} Entity encoded text. - */ - encodeAllRaw: function(text) { - return ('' + text).replace(rawCharsRegExp, function(chr) { - return baseEntities[chr] || chr; - }); - }, - - /** - * Encodes the specified string using numeric entities. The core entities will be - * encoded as named ones but all non lower ascii characters will be encoded into numeric entities. - * - * @method encodeNumeric - * @param {String} text Text to encode. - * @param {Boolean} attr Optional flag to specify if the text is attribute contents. - * @return {String} Entity encoded text. - */ - encodeNumeric: function(text, attr) { - return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { - // Multi byte sequence convert it to a single entity - if (chr.length > 1) { - return '&#' + (((chr.charCodeAt(0) - 0xD800) * 0x400) + (chr.charCodeAt(1) - 0xDC00) + 0x10000) + ';'; - } - - return baseEntities[chr] || '&#' + chr.charCodeAt(0) + ';'; - }); - }, - - /** - * Encodes the specified string using named entities. The core entities will be encoded - * as named ones but all non lower ascii characters will be encoded into named entities. - * - * @method encodeNamed - * @param {String} text Text to encode. - * @param {Boolean} attr Optional flag to specify if the text is attribute contents. - * @param {Object} entities Optional parameter with entities to use. - * @return {String} Entity encoded text. - */ - encodeNamed: function(text, attr, entities) { - entities = entities || namedEntities; - - return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { - return baseEntities[chr] || entities[chr] || chr; - }); - }, - - /** - * Returns an encode function based on the name(s) and it's optional entities. - * - * @method getEncodeFunc - * @param {String} name Comma separated list of encoders for example named,numeric. - * @param {String} entities Optional parameter with entities to use instead of the built in set. - * @return {function} Encode function to be used. - */ - getEncodeFunc: function(name, entities) { - entities = buildEntitiesLookup(entities) || namedEntities; - - function encodeNamedAndNumeric(text, attr) { - return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { - return baseEntities[chr] || entities[chr] || '&#' + chr.charCodeAt(0) + ';' || chr; - }); - } - - function encodeCustomNamed(text, attr) { - return Entities.encodeNamed(text, attr, entities); - } - - // Replace + with , to be compatible with previous TinyMCE versions - name = makeMap(name.replace(/\+/g, ',')); - - // Named and numeric encoder - if (name.named && name.numeric) { - return encodeNamedAndNumeric; - } - - // Named encoder - if (name.named) { - // Custom names - if (entities) { - return encodeCustomNamed; - } - - return Entities.encodeNamed; - } - - // Numeric - if (name.numeric) { - return Entities.encodeNumeric; - } - - // Raw encoder - return Entities.encodeRaw; - }, - - /** - * Decodes the specified string, this will replace entities with raw UTF characters. - * - * @method decode - * @param {String} text Text to entity decode. - * @return {String} Entity decoded string. - */ - decode: function(text) { - return text.replace(entityRegExp, function(all, numeric, value) { - if (numeric) { - value = parseInt(value, numeric.length === 2 ? 16 : 10); - - // Support upper UTF - if (value > 0xFFFF) { - value -= 0x10000; - - return String.fromCharCode(0xD800 + (value >> 10), 0xDC00 + (value & 0x3FF)); - } else { - return asciiMap[value] || String.fromCharCode(value); - } - } - - return reverseEntities[all] || namedEntities[all] || nativeDecode(all); - }); - } - }; - - return Entities; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/html/Node.js b/common/static/js/vendor/tinymce/js/tinymce/classes/html/Node.js deleted file mode 100755 index acfc57a9fb37..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/html/Node.js +++ /dev/null @@ -1,496 +0,0 @@ -/** - * Node.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class is a minimalistic implementation of a DOM like node used by the DomParser class. - * - * @example - * var node = new tinymce.html.Node('strong', 1); - * someRoot.append(node); - * - * @class tinymce.html.Node - * @version 3.4 - */ -define("tinymce/html/Node", [], function() { - var whiteSpaceRegExp = /^[ \t\r\n]*$/, typeLookup = { - '#text': 3, - '#comment': 8, - '#cdata': 4, - '#pi': 7, - '#doctype': 10, - '#document-fragment': 11 - }; - - // Walks the tree left/right - function walk(node, root_node, prev) { - var sibling, parent, startName = prev ? 'lastChild' : 'firstChild', siblingName = prev ? 'prev' : 'next'; - - // Walk into nodes if it has a start - if (node[startName]) { - return node[startName]; - } - - // Return the sibling if it has one - if (node !== root_node) { - sibling = node[siblingName]; - - if (sibling) { - return sibling; - } - - // Walk up the parents to look for siblings - for (parent = node.parent; parent && parent !== root_node; parent = parent.parent) { - sibling = parent[siblingName]; - - if (sibling) { - return sibling; - } - } - } - } - - /** - * Constructs a new Node instance. - * - * @constructor - * @method Node - * @param {String} name Name of the node type. - * @param {Number} type Numeric type representing the node. - */ - function Node(name, type) { - this.name = name; - this.type = type; - - if (type === 1) { - this.attributes = []; - this.attributes.map = {}; - } - } - - Node.prototype = { - /** - * Replaces the current node with the specified one. - * - * @example - * someNode.replace(someNewNode); - * - * @method replace - * @param {tinymce.html.Node} node Node to replace the current node with. - * @return {tinymce.html.Node} The old node that got replaced. - */ - replace: function(node) { - var self = this; - - if (node.parent) { - node.remove(); - } - - self.insert(node, self); - self.remove(); - - return self; - }, - - /** - * Gets/sets or removes an attribute by name. - * - * @example - * someNode.attr("name", "value"); // Sets an attribute - * console.log(someNode.attr("name")); // Gets an attribute - * someNode.attr("name", null); // Removes an attribute - * - * @method attr - * @param {String} name Attribute name to set or get. - * @param {String} value Optional value to set. - * @return {String/tinymce.html.Node} String or undefined on a get operation or the current node on a set operation. - */ - attr: function(name, value) { - var self = this, attrs, i, undef; - - if (typeof name !== "string") { - for (i in name) { - self.attr(i, name[i]); - } - - return self; - } - - if ((attrs = self.attributes)) { - if (value !== undef) { - // Remove attribute - if (value === null) { - if (name in attrs.map) { - delete attrs.map[name]; - - i = attrs.length; - while (i--) { - if (attrs[i].name === name) { - attrs = attrs.splice(i, 1); - return self; - } - } - } - - return self; - } - - // Set attribute - if (name in attrs.map) { - // Set attribute - i = attrs.length; - while (i--) { - if (attrs[i].name === name) { - attrs[i].value = value; - break; - } - } - } else { - attrs.push({name: name, value: value}); - } - - attrs.map[name] = value; - - return self; - } else { - return attrs.map[name]; - } - } - }, - - /** - * Does a shallow clones the node into a new node. It will also exclude id attributes since - * there should only be one id per document. - * - * @example - * var clonedNode = node.clone(); - * - * @method clone - * @return {tinymce.html.Node} New copy of the original node. - */ - clone: function() { - var self = this, clone = new Node(self.name, self.type), i, l, selfAttrs, selfAttr, cloneAttrs; - - // Clone element attributes - if ((selfAttrs = self.attributes)) { - cloneAttrs = []; - cloneAttrs.map = {}; - - for (i = 0, l = selfAttrs.length; i < l; i++) { - selfAttr = selfAttrs[i]; - - // Clone everything except id - if (selfAttr.name !== 'id') { - cloneAttrs[cloneAttrs.length] = {name: selfAttr.name, value: selfAttr.value}; - cloneAttrs.map[selfAttr.name] = selfAttr.value; - } - } - - clone.attributes = cloneAttrs; - } - - clone.value = self.value; - clone.shortEnded = self.shortEnded; - - return clone; - }, - - /** - * Wraps the node in in another node. - * - * @example - * node.wrap(wrapperNode); - * - * @method wrap - */ - wrap: function(wrapper) { - var self = this; - - self.parent.insert(wrapper, self); - wrapper.append(self); - - return self; - }, - - /** - * Unwraps the node in other words it removes the node but keeps the children. - * - * @example - * node.unwrap(); - * - * @method unwrap - */ - unwrap: function() { - var self = this, node, next; - - for (node = self.firstChild; node; ) { - next = node.next; - self.insert(node, self, true); - node = next; - } - - self.remove(); - }, - - /** - * Removes the node from it's parent. - * - * @example - * node.remove(); - * - * @method remove - * @return {tinymce.html.Node} Current node that got removed. - */ - remove: function() { - var self = this, parent = self.parent, next = self.next, prev = self.prev; - - if (parent) { - if (parent.firstChild === self) { - parent.firstChild = next; - - if (next) { - next.prev = null; - } - } else { - prev.next = next; - } - - if (parent.lastChild === self) { - parent.lastChild = prev; - - if (prev) { - prev.next = null; - } - } else { - next.prev = prev; - } - - self.parent = self.next = self.prev = null; - } - - return self; - }, - - /** - * Appends a new node as a child of the current node. - * - * @example - * node.append(someNode); - * - * @method append - * @param {tinymce.html.Node} node Node to append as a child of the current one. - * @return {tinymce.html.Node} The node that got appended. - */ - append: function(node) { - var self = this, last; - - if (node.parent) { - node.remove(); - } - - last = self.lastChild; - if (last) { - last.next = node; - node.prev = last; - self.lastChild = node; - } else { - self.lastChild = self.firstChild = node; - } - - node.parent = self; - - return node; - }, - - /** - * Inserts a node at a specific position as a child of the current node. - * - * @example - * parentNode.insert(newChildNode, oldChildNode); - * - * @method insert - * @param {tinymce.html.Node} node Node to insert as a child of the current node. - * @param {tinymce.html.Node} ref_node Reference node to set node before/after. - * @param {Boolean} before Optional state to insert the node before the reference node. - * @return {tinymce.html.Node} The node that got inserted. - */ - insert: function(node, ref_node, before) { - var parent; - - if (node.parent) { - node.remove(); - } - - parent = ref_node.parent || this; - - if (before) { - if (ref_node === parent.firstChild) { - parent.firstChild = node; - } else { - ref_node.prev.next = node; - } - - node.prev = ref_node.prev; - node.next = ref_node; - ref_node.prev = node; - } else { - if (ref_node === parent.lastChild) { - parent.lastChild = node; - } else { - ref_node.next.prev = node; - } - - node.next = ref_node.next; - node.prev = ref_node; - ref_node.next = node; - } - - node.parent = parent; - - return node; - }, - - /** - * Get all children by name. - * - * @method getAll - * @param {String} name Name of the child nodes to collect. - * @return {Array} Array with child nodes matchin the specified name. - */ - getAll: function(name) { - var self = this, node, collection = []; - - for (node = self.firstChild; node; node = walk(node, self)) { - if (node.name === name) { - collection.push(node); - } - } - - return collection; - }, - - /** - * Removes all children of the current node. - * - * @method empty - * @return {tinymce.html.Node} The current node that got cleared. - */ - empty: function() { - var self = this, nodes, i, node; - - // Remove all children - if (self.firstChild) { - nodes = []; - - // Collect the children - for (node = self.firstChild; node; node = walk(node, self)) { - nodes.push(node); - } - - // Remove the children - i = nodes.length; - while (i--) { - node = nodes[i]; - node.parent = node.firstChild = node.lastChild = node.next = node.prev = null; - } - } - - self.firstChild = self.lastChild = null; - - return self; - }, - - /** - * Returns true/false if the node is to be considered empty or not. - * - * @example - * node.isEmpty({img: true}); - * @method isEmpty - * @param {Object} elements Name/value object with elements that are automatically treated as non empty elements. - * @return {Boolean} true/false if the node is empty or not. - */ - isEmpty: function(elements) { - var self = this, node = self.firstChild, i, name; - - if (node) { - do { - if (node.type === 1) { - // Ignore bogus elements - if (node.attributes.map['data-mce-bogus']) { - continue; - } - - // Keep empty elements like - if (elements[node.name]) { - return false; - } - - // Keep elements with data attributes or name attribute like
- i = node.attributes.length; - while (i--) { - name = node.attributes[i].name; - if (name === "name" || name.indexOf('data-mce-') === 0) { - return false; - } - } - } - - // Keep comments - if (node.type === 8) { - return false; - } - - // Keep non whitespace text nodes - if ((node.type === 3 && !whiteSpaceRegExp.test(node.value))) { - return false; - } - } while ((node = walk(node, self))); - } - - return true; - }, - - /** - * Walks to the next or previous node and returns that node or null if it wasn't found. - * - * @method walk - * @param {Boolean} prev Optional previous node state defaults to false. - * @return {tinymce.html.Node} Node that is next to or previous of the current node. - */ - walk: function(prev) { - return walk(this, null, prev); - } - }; - - /** - * Creates a node of a specific type. - * - * @static - * @method create - * @param {String} name Name of the node type to create for example "b" or "#text". - * @param {Object} attrs Name/value collection of attributes that will be applied to elements. - */ - Node.create = function(name, attrs) { - var node, attrName; - - // Create node - node = new Node(name, typeLookup[name] || 1); - - // Add attributes if needed - if (attrs) { - for (attrName in attrs) { - node.attr(attrName, attrs[attrName]); - } - } - - return node; - }; - - return Node; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/html/SaxParser.js b/common/static/js/vendor/tinymce/js/tinymce/classes/html/SaxParser.js deleted file mode 100755 index 80258fde185d..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/html/SaxParser.js +++ /dev/null @@ -1,423 +0,0 @@ -/** - * SaxParser.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*eslint max-depth:[2, 9] */ - -/** - * This class parses HTML code using pure JavaScript and executes various events for each item it finds. It will - * always execute the events in the right order for tag soup code like

. It will also remove elements - * and attributes that doesn't fit the schema if the validate setting is enabled. - * - * @example - * var parser = new tinymce.html.SaxParser({ - * validate: true, - * - * comment: function(text) { - * console.log('Comment:', text); - * }, - * - * cdata: function(text) { - * console.log('CDATA:', text); - * }, - * - * text: function(text, raw) { - * console.log('Text:', text, 'Raw:', raw); - * }, - * - * start: function(name, attrs, empty) { - * console.log('Start:', name, attrs, empty); - * }, - * - * end: function(name) { - * console.log('End:', name); - * }, - * - * pi: function(name, text) { - * console.log('PI:', name, text); - * }, - * - * doctype: function(text) { - * console.log('DocType:', text); - * } - * }, schema); - * @class tinymce.html.SaxParser - * @version 3.4 - */ -define("tinymce/html/SaxParser", [ - "tinymce/html/Schema", - "tinymce/html/Entities", - "tinymce/util/Tools" -], function(Schema, Entities, Tools) { - var each = Tools.each; - - /** - * Constructs a new SaxParser instance. - * - * @constructor - * @method SaxParser - * @param {Object} settings Name/value collection of settings. comment, cdata, text, start and end are callbacks. - * @param {tinymce.html.Schema} schema HTML Schema class to use when parsing. - */ - return function(settings, schema) { - var self = this; - - function noop() {} - - settings = settings || {}; - self.schema = schema = schema || new Schema(); - - if (settings.fix_self_closing !== false) { - settings.fix_self_closing = true; - } - - // Add handler functions from settings and setup default handlers - each('comment cdata text start end pi doctype'.split(' '), function(name) { - if (name) { - self[name] = settings[name] || noop; - } - }); - - /** - * Parses the specified HTML string and executes the callbacks for each item it finds. - * - * @example - * new SaxParser({...}).parse('text'); - * @method parse - * @param {String} html Html string to sax parse. - */ - self.parse = function(html) { - var self = this, matches, index = 0, value, endRegExp, stack = [], attrList, i, text, name; - var isInternalElement, removeInternalElements, shortEndedElements, fillAttrsMap, isShortEnded; - var validate, elementRule, isValidElement, attr, attribsValue, validAttributesMap, validAttributePatterns; - var attributesRequired, attributesDefault, attributesForced; - var anyAttributesRequired, selfClosing, tokenRegExp, attrRegExp, specialElements, attrValue, idCount = 0; - var decode = Entities.decode, fixSelfClosing, filteredUrlAttrs = Tools.makeMap('src,href'); - var scriptUriRegExp = /(java|vb)script:/i; - - function processEndTag(name) { - var pos, i; - - // Find position of parent of the same type - pos = stack.length; - while (pos--) { - if (stack[pos].name === name) { - break; - } - } - - // Found parent - if (pos >= 0) { - // Close all the open elements - for (i = stack.length - 1; i >= pos; i--) { - name = stack[i]; - - if (name.valid) { - self.end(name.name); - } - } - - // Remove the open elements from the stack - stack.length = pos; - } - } - - function parseAttribute(match, name, value, val2, val3) { - var attrRule, i, trimRegExp = /[\s\u0000-\u001F]+/g; - - name = name.toLowerCase(); - value = name in fillAttrsMap ? name : decode(value || val2 || val3 || ''); // Handle boolean attribute than value attribute - - // Validate name and value pass through all data- attributes - if (validate && !isInternalElement && name.indexOf('data-') !== 0) { - attrRule = validAttributesMap[name]; - - // Find rule by pattern matching - if (!attrRule && validAttributePatterns) { - i = validAttributePatterns.length; - while (i--) { - attrRule = validAttributePatterns[i]; - if (attrRule.pattern.test(name)) { - break; - } - } - - // No rule matched - if (i === -1) { - attrRule = null; - } - } - - // No attribute rule found - if (!attrRule) { - return; - } - - // Validate value - if (attrRule.validValues && !(value in attrRule.validValues)) { - return; - } - } - - // Block any javascript: urls - if (filteredUrlAttrs[name] && !settings.allow_script_urls) { - var uri = value.replace(trimRegExp, ''); - - try { - // Might throw malformed URI sequence - uri = decodeURIComponent(uri); - if (scriptUriRegExp.test(uri)) { - return; - } - } catch (ex) { - // Fallback to non UTF-8 decoder - uri = unescape(uri); - if (scriptUriRegExp.test(uri)) { - return; - } - } - } - - // Add attribute to list and map - attrList.map[name] = value; - attrList.push({ - name: name, - value: value - }); - } - - // Precompile RegExps and map objects - tokenRegExp = new RegExp('<(?:' + - '(?:!--([\\w\\W]*?)-->)|' + // Comment - '(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|' + // CDATA - '(?:!DOCTYPE([\\w\\W]*?)>)|' + // DOCTYPE - '(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + // PI - '(?:\\/([^>]+)>)|' + // End element - '(?:([A-Za-z0-9\\-\\:\\.]+)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/|\\s+)>)' + // Start element - ')', 'g'); - - attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g; - - // Setup lookup tables for empty elements and boolean attributes - shortEndedElements = schema.getShortEndedElements(); - selfClosing = settings.self_closing_elements || schema.getSelfClosingElements(); - fillAttrsMap = schema.getBoolAttrs(); - validate = settings.validate; - removeInternalElements = settings.remove_internals; - fixSelfClosing = settings.fix_self_closing; - specialElements = schema.getSpecialElements(); - - while ((matches = tokenRegExp.exec(html))) { - // Text - if (index < matches.index) { - self.text(decode(html.substr(index, matches.index - index))); - } - - if ((value = matches[6])) { // End element - value = value.toLowerCase(); - - // IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements - if (value.charAt(0) === ':') { - value = value.substr(1); - } - - processEndTag(value); - } else if ((value = matches[7])) { // Start element - value = value.toLowerCase(); - - // IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements - if (value.charAt(0) === ':') { - value = value.substr(1); - } - - isShortEnded = value in shortEndedElements; - - // Is self closing tag for example an
  • after an open
  • - if (fixSelfClosing && selfClosing[value] && stack.length > 0 && stack[stack.length - 1].name === value) { - processEndTag(value); - } - - // Validate element - if (!validate || (elementRule = schema.getElementRule(value))) { - isValidElement = true; - - // Grab attributes map and patters when validation is enabled - if (validate) { - validAttributesMap = elementRule.attributes; - validAttributePatterns = elementRule.attributePatterns; - } - - // Parse attributes - if ((attribsValue = matches[8])) { - isInternalElement = attribsValue.indexOf('data-mce-type') !== -1; // Check if the element is an internal element - - // If the element has internal attributes then remove it if we are told to do so - if (isInternalElement && removeInternalElements) { - isValidElement = false; - } - - attrList = []; - attrList.map = {}; - - attribsValue.replace(attrRegExp, parseAttribute); - } else { - attrList = []; - attrList.map = {}; - } - - // Process attributes if validation is enabled - if (validate && !isInternalElement) { - attributesRequired = elementRule.attributesRequired; - attributesDefault = elementRule.attributesDefault; - attributesForced = elementRule.attributesForced; - anyAttributesRequired = elementRule.removeEmptyAttrs; - - // Check if any attribute exists - if (anyAttributesRequired && !attrList.length) { - isValidElement = false; - } - - // Handle forced attributes - if (attributesForced) { - i = attributesForced.length; - while (i--) { - attr = attributesForced[i]; - name = attr.name; - attrValue = attr.value; - - if (attrValue === '{$uid}') { - attrValue = 'mce_' + idCount++; - } - - attrList.map[name] = attrValue; - attrList.push({name: name, value: attrValue}); - } - } - - // Handle default attributes - if (attributesDefault) { - i = attributesDefault.length; - while (i--) { - attr = attributesDefault[i]; - name = attr.name; - - if (!(name in attrList.map)) { - attrValue = attr.value; - - if (attrValue === '{$uid}') { - attrValue = 'mce_' + idCount++; - } - - attrList.map[name] = attrValue; - attrList.push({name: name, value: attrValue}); - } - } - } - - // Handle required attributes - if (attributesRequired) { - i = attributesRequired.length; - while (i--) { - if (attributesRequired[i] in attrList.map) { - break; - } - } - - // None of the required attributes where found - if (i === -1) { - isValidElement = false; - } - } - - // Invalidate element if it's marked as bogus - if (attrList.map['data-mce-bogus']) { - isValidElement = false; - } - } - - if (isValidElement) { - self.start(value, attrList, isShortEnded); - } - } else { - isValidElement = false; - } - - // Treat script, noscript and style a bit different since they may include code that looks like elements - if ((endRegExp = specialElements[value])) { - endRegExp.lastIndex = index = matches.index + matches[0].length; - - if ((matches = endRegExp.exec(html))) { - if (isValidElement) { - text = html.substr(index, matches.index - index); - } - - index = matches.index + matches[0].length; - } else { - text = html.substr(index); - index = html.length; - } - - if (isValidElement) { - if (text.length > 0) { - self.text(text, true); - } - - self.end(value); - } - - tokenRegExp.lastIndex = index; - continue; - } - - // Push value on to stack - if (!isShortEnded) { - if (!attribsValue || attribsValue.indexOf('/') != attribsValue.length - 1) { - stack.push({name: value, valid: isValidElement}); - } else if (isValidElement) { - self.end(value); - } - } - } else if ((value = matches[1])) { // Comment - // Padd comment value to avoid browsers from parsing invalid comments as HTML - if (value.charAt(0) === '>') { - value = ' ' + value; - } - - if (!settings.allow_conditional_comments && value.substr(0, 3) === '[if') { - value = ' ' + value; - } - - self.comment(value); - } else if ((value = matches[2])) { // CDATA - self.cdata(value); - } else if ((value = matches[3])) { // DOCTYPE - self.doctype(value); - } else if ((value = matches[4])) { // PI - self.pi(value, matches[5]); - } - - index = matches.index + matches[0].length; - } - - // Text - if (index < html.length) { - self.text(decode(html.substr(index))); - } - - // Close any open elements - for (i = stack.length - 1; i >= 0; i--) { - value = stack[i]; - - if (value.valid) { - self.end(value.name); - } - } - }; - }; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/html/Schema.js b/common/static/js/vendor/tinymce/js/tinymce/classes/html/Schema.js deleted file mode 100755 index 40b44e56d270..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/html/Schema.js +++ /dev/null @@ -1,938 +0,0 @@ -/** - * Schema.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Schema validator class. - * - * @class tinymce.html.Schema - * @example - * if (tinymce.activeEditor.schema.isValidChild('p', 'span')) - * alert('span is valid child of p.'); - * - * if (tinymce.activeEditor.schema.getElementRule('p')) - * alert('P is a valid element.'); - * - * @class tinymce.html.Schema - * @version 3.4 - */ -define("tinymce/html/Schema", [ - "tinymce/util/Tools" -], function(Tools) { - var mapCache = {}; - var makeMap = Tools.makeMap, each = Tools.each, extend = Tools.extend, explode = Tools.explode, inArray = Tools.inArray; - - function split(items, delim) { - return items ? items.split(delim || ' ') : []; - } - - /** - * Builds a schema lookup table - * - * @private - * @param {String} type html4, html5 or html5-strict schema type. - * @return {Object} Schema lookup table. - */ - function compileSchema(type) { - var schema = {}, globalAttributes, blockContent; - var phrasingContent, flowContent, html4BlockContent, html4PhrasingContent; - - function add(name, attributes, children) { - var ni, i, attributesOrder, args = arguments; - - function arrayToMap(array) { - var map = {}, i, l; - - for (i = 0, l = array.length; i < l; i++) { - map[array[i]] = {}; - } - - return map; - } - - children = children || []; - attributes = attributes || ""; - - if (typeof(children) === "string") { - children = split(children); - } - - // Split string children - for (i = 3; i < args.length; i++) { - if (typeof(args[i]) === "string") { - args[i] = split(args[i]); - } - - children.push.apply(children, args[i]); - } - - name = split(name); - ni = name.length; - while (ni--) { - attributesOrder = [].concat(globalAttributes, split(attributes)); - schema[name[ni]] = { - attributes: arrayToMap(attributesOrder), - attributesOrder: attributesOrder, - children: arrayToMap(children) - }; - } - } - - function addAttrs(name, attributes) { - var ni, schemaItem, i, l; - - name = split(name); - ni = name.length; - attributes = split(attributes); - while (ni--) { - schemaItem = schema[name[ni]]; - for (i = 0, l = attributes.length; i < l; i++) { - schemaItem.attributes[attributes[i]] = {}; - schemaItem.attributesOrder.push(attributes[i]); - } - } - } - - // Use cached schema - if (mapCache[type]) { - return mapCache[type]; - } - - // Attributes present on all elements - globalAttributes = split("id accesskey class dir lang style tabindex title"); - - // Event attributes can be opt-in/opt-out - /*eventAttributes = split("onabort onblur oncancel oncanplay oncanplaythrough onchange onclick onclose oncontextmenu oncuechange " + - "ondblclick ondrag ondragend ondragenter ondragleave ondragover ondragstart ondrop ondurationchange onemptied onended " + - "onerror onfocus oninput oninvalid onkeydown onkeypress onkeyup onload onloadeddata onloadedmetadata onloadstart " + - "onmousedown onmousemove onmouseout onmouseover onmouseup onmousewheel onpause onplay onplaying onprogress onratechange " + - "onreset onscroll onseeked onseeking onseeking onselect onshow onstalled onsubmit onsuspend ontimeupdate onvolumechange " + - "onwaiting" - );*/ - - // Block content elements - blockContent = split( - "address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul" - ); - - // Phrasing content elements from the HTML5 spec (inline) - phrasingContent = split( - "a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd " + - "label map noscript object q s samp script select small span strong sub sup " + - "textarea u var #text #comment" - ); - - // Add HTML5 items to globalAttributes, blockContent, phrasingContent - if (type != "html4") { - globalAttributes.push.apply(globalAttributes, split("contenteditable contextmenu draggable dropzone " + - "hidden spellcheck translate")); - blockContent.push.apply(blockContent, split("article aside details dialog figure header footer hgroup section nav")); - phrasingContent.push.apply(phrasingContent, split("audio canvas command datalist mark meter output progress time wbr " + - "video ruby bdi keygen")); - } - - // Add HTML4 elements unless it's html5-strict - if (type != "html5-strict") { - globalAttributes.push("xml:lang"); - - html4PhrasingContent = split("acronym applet basefont big font strike tt"); - phrasingContent.push.apply(phrasingContent, html4PhrasingContent); - - each(html4PhrasingContent, function(name) { - add(name, "", phrasingContent); - }); - - html4BlockContent = split("center dir isindex noframes"); - blockContent.push.apply(blockContent, html4BlockContent); - - // Flow content elements from the HTML5 spec (block+inline) - flowContent = [].concat(blockContent, phrasingContent); - - each(html4BlockContent, function(name) { - add(name, "", flowContent); - }); - } - - // Flow content elements from the HTML5 spec (block+inline) - flowContent = flowContent || [].concat(blockContent, phrasingContent); - - // HTML4 base schema TODO: Move HTML5 specific attributes to HTML5 specific if statement - // Schema items , , - add("html", "manifest", "head body"); - add("head", "", "base command link meta noscript script style title"); - add("title hr noscript br"); - add("base", "href target"); - add("link", "href rel media hreflang type sizes hreflang"); - add("meta", "name http-equiv content charset"); - add("style", "media type scoped"); - add("script", "src async defer type charset"); - add("body", "onafterprint onbeforeprint onbeforeunload onblur onerror onfocus " + - "onhashchange onload onmessage onoffline ononline onpagehide onpageshow " + - "onpopstate onresize onscroll onstorage onunload", flowContent); - add("address dt dd div caption", "", flowContent); - 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); - add("blockquote", "cite", flowContent); - add("ol", "reversed start type", "li"); - add("ul", "", "li"); - add("li", "value", flowContent); - add("dl", "", "dt dd"); - add("a", "href target rel media hreflang type", phrasingContent); - add("q", "cite", phrasingContent); - add("ins del", "cite datetime", flowContent); - add("img", "src alt usemap ismap width height"); - add("iframe", "src name width height", flowContent); - add("embed", "src type width height"); - add("object", "data type typemustmatch name usemap form width height", flowContent, "param"); - add("param", "name value"); - add("map", "name", flowContent, "area"); - add("area", "alt coords shape href target rel media hreflang type"); - add("table", "border", "caption colgroup thead tfoot tbody tr" + (type == "html4" ? " col" : "")); - add("colgroup", "span", "col"); - add("col", "span"); - add("tbody thead tfoot", "", "tr"); - add("tr", "", "td th"); - add("td", "colspan rowspan headers", flowContent); - add("th", "colspan rowspan headers scope abbr", flowContent); - add("form", "accept-charset action autocomplete enctype method name novalidate target", flowContent); - add("fieldset", "disabled form name", flowContent, "legend"); - add("label", "form for", phrasingContent); - add("input", "accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate " + - "formtarget height list max maxlength min multiple name pattern readonly required size src step type value width" - ); - add("button", "disabled form formaction formenctype formmethod formnovalidate formtarget name type value", - type == "html4" ? flowContent : phrasingContent); - add("select", "disabled form multiple name required size", "option optgroup"); - add("optgroup", "disabled label", "option"); - add("option", "disabled label selected value"); - add("textarea", "cols dirname disabled form maxlength name readonly required rows wrap"); - add("menu", "type label", flowContent, "li"); - add("noscript", "", flowContent); - - // Extend with HTML5 elements - if (type != "html4") { - add("wbr"); - add("ruby", "", phrasingContent, "rt rp"); - add("figcaption", "", flowContent); - add("mark rt rp summary bdi", "", phrasingContent); - add("canvas", "width height", flowContent); - add("video", "src crossorigin poster preload autoplay mediagroup loop " + - "muted controls width height", flowContent, "track source"); - add("audio", "src crossorigin preload autoplay mediagroup loop muted controls", flowContent, "track source"); - add("source", "src type media"); - add("track", "kind src srclang label default"); - add("datalist", "", phrasingContent, "option"); - add("article section nav aside header footer", "", flowContent); - add("hgroup", "", "h1 h2 h3 h4 h5 h6"); - add("figure", "", flowContent, "figcaption"); - add("time", "datetime", phrasingContent); - add("dialog", "open", flowContent); - add("command", "type label icon disabled checked radiogroup command"); - add("output", "for form name", phrasingContent); - add("progress", "value max", phrasingContent); - add("meter", "value min max low high optimum", phrasingContent); - add("details", "open", flowContent, "summary"); - add("keygen", "autofocus challenge disabled form keytype name"); - } - - // Extend with HTML4 attributes unless it's html5-strict - if (type != "html5-strict") { - addAttrs("script", "language xml:space"); - addAttrs("style", "xml:space"); - addAttrs("object", "declare classid codebase codetype archive standby align border hspace vspace"); - addAttrs("param", "valuetype type"); - addAttrs("a", "charset name rev shape coords"); - addAttrs("br", "clear"); - addAttrs("applet", "codebase archive code object alt name width height align hspace vspace"); - addAttrs("img", "name longdesc align border hspace vspace"); - addAttrs("iframe", "longdesc frameborder marginwidth marginheight scrolling align"); - addAttrs("font basefont", "size color face"); - addAttrs("input", "usemap align"); - addAttrs("select", "onchange"); - addAttrs("textarea"); - addAttrs("h1 h2 h3 h4 h5 h6 div p legend caption", "align"); - addAttrs("ul", "type compact"); - addAttrs("li", "type"); - addAttrs("ol dl menu dir", "compact"); - addAttrs("pre", "width xml:space"); - addAttrs("hr", "align noshade size width"); - addAttrs("isindex", "prompt"); - addAttrs("table", "summary width frame rules cellspacing cellpadding align bgcolor"); - addAttrs("col", "width align char charoff valign"); - addAttrs("colgroup", "width align char charoff valign"); - addAttrs("thead", "align char charoff valign"); - addAttrs("tr", "align char charoff valign bgcolor"); - addAttrs("th", "axis align char charoff valign nowrap bgcolor width height"); - addAttrs("form", "accept"); - addAttrs("td", "abbr axis scope align char charoff valign nowrap bgcolor width height"); - addAttrs("tfoot", "align char charoff valign"); - addAttrs("tbody", "align char charoff valign"); - addAttrs("area", "nohref"); - addAttrs("body", "background bgcolor text link vlink alink"); - } - - // Extend with HTML5 attributes unless it's html4 - if (type != "html4") { - addAttrs("input button select textarea", "autofocus"); - addAttrs("input textarea", "placeholder"); - addAttrs("a", "download"); - addAttrs("link script img", "crossorigin"); - addAttrs("iframe", "srcdoc sandbox seamless allowfullscreen"); - } - - // Special: iframe, ruby, video, audio, label - - // Delete children of the same name from it's parent - // For example: form can't have a child of the name form - each(split('a form meter progress dfn'), function(name) { - if (schema[name]) { - delete schema[name].children[name]; - } - }); - - // Delete header, footer, sectioning and heading content descendants - /*each('dt th address', function(name) { - delete schema[name].children[name]; - });*/ - - // Caption can't have tables - delete schema.caption.children.table; - - // TODO: LI:s can only have value if parent is OL - - // TODO: Handle transparent elements - // a ins del canvas map - - mapCache[type] = schema; - - return schema; - } - - /** - * Constructs a new Schema instance. - * - * @constructor - * @method Schema - * @param {Object} settings Name/value settings object. - */ - return function(settings) { - var self = this, elements = {}, children = {}, patternElements = [], validStyles, schemaItems; - var whiteSpaceElementsMap, selfClosingElementsMap, shortEndedElementsMap, boolAttrMap; - var blockElementsMap, nonEmptyElementsMap, textBlockElementsMap, customElementsMap = {}, specialElements = {}; - - // Creates an lookup table map object for the specified option or the default value - function createLookupTable(option, default_value, extendWith) { - var value = settings[option]; - - if (!value) { - // Get cached default map or make it if needed - value = mapCache[option]; - - if (!value) { - value = makeMap(default_value, ' ', makeMap(default_value.toUpperCase(), ' ')); - value = extend(value, extendWith); - - mapCache[option] = value; - } - } else { - // Create custom map - value = makeMap(value, ',', makeMap(value.toUpperCase(), ' ')); - } - - return value; - } - - settings = settings || {}; - schemaItems = compileSchema(settings.schema); - - // Allow all elements and attributes if verify_html is set to false - if (settings.verify_html === false) { - settings.valid_elements = '*[*]'; - } - - // Build styles list - if (settings.valid_styles) { - validStyles = {}; - - // Convert styles into a rule list - each(settings.valid_styles, function(value, key) { - validStyles[key] = explode(value); - }); - } - - // Setup map objects - whiteSpaceElementsMap = createLookupTable('whitespace_elements', 'pre script noscript style textarea video audio iframe object'); - selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li option p td tfoot th thead tr'); - shortEndedElementsMap = createLookupTable('short_ended_elements', 'area base basefont br col frame hr img input isindex link ' + - 'meta param embed source wbr track'); - boolAttrMap = createLookupTable('boolean_attributes', 'checked compact declare defer disabled ismap multiple nohref noresize ' + - 'noshade nowrap readonly selected autoplay loop controls'); - nonEmptyElementsMap = createLookupTable('non_empty_elements', 'td th iframe video audio object script', shortEndedElementsMap); - textBlockElementsMap = createLookupTable('text_block_elements', 'h1 h2 h3 h4 h5 h6 p div address pre form ' + - 'blockquote center dir fieldset header footer article section hgroup aside nav figure'); - blockElementsMap = createLookupTable('block_elements', 'hr table tbody thead tfoot ' + - 'th tr td li ol ul caption dl dt dd noscript menu isindex option ' + - 'datalist select optgroup', textBlockElementsMap); - - each((settings.special || 'script noscript style textarea').split(' '), function(name) { - specialElements[name] = new RegExp('<\/' + name + '[^>]*>','gi'); - }); - - // Converts a wildcard expression string to a regexp for example *a will become /.*a/. - function patternToRegExp(str) { - return new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$'); - } - - // Parses the specified valid_elements string and adds to the current rules - // This function is a bit hard to read since it's heavily optimized for speed - function addValidElements(valid_elements) { - var ei, el, ai, al, matches, element, attr, attrData, elementName, attrName, attrType, attributes, attributesOrder, - prefix, outputName, globalAttributes, globalAttributesOrder, key, value, - elementRuleRegExp = /^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/, - attrRuleRegExp = /^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/, - hasPatternsRegExp = /[*?+]/; - - if (valid_elements) { - // Split valid elements into an array with rules - valid_elements = split(valid_elements, ','); - - if (elements['@']) { - globalAttributes = elements['@'].attributes; - globalAttributesOrder = elements['@'].attributesOrder; - } - - // Loop all rules - for (ei = 0, el = valid_elements.length; ei < el; ei++) { - // Parse element rule - matches = elementRuleRegExp.exec(valid_elements[ei]); - if (matches) { - // Setup local names for matches - prefix = matches[1]; - elementName = matches[2]; - outputName = matches[3]; - attrData = matches[5]; - - // Create new attributes and attributesOrder - attributes = {}; - attributesOrder = []; - - // Create the new element - element = { - attributes: attributes, - attributesOrder: attributesOrder - }; - - // Padd empty elements prefix - if (prefix === '#') { - element.paddEmpty = true; - } - - // Remove empty elements prefix - if (prefix === '-') { - element.removeEmpty = true; - } - - if (matches[4] === '!') { - element.removeEmptyAttrs = true; - } - - // Copy attributes from global rule into current rule - if (globalAttributes) { - for (key in globalAttributes) { - attributes[key] = globalAttributes[key]; - } - - attributesOrder.push.apply(attributesOrder, globalAttributesOrder); - } - - // Attributes defined - if (attrData) { - attrData = split(attrData, '|'); - for (ai = 0, al = attrData.length; ai < al; ai++) { - matches = attrRuleRegExp.exec(attrData[ai]); - if (matches) { - attr = {}; - attrType = matches[1]; - attrName = matches[2].replace(/::/g, ':'); - prefix = matches[3]; - value = matches[4]; - - // Required - if (attrType === '!') { - element.attributesRequired = element.attributesRequired || []; - element.attributesRequired.push(attrName); - attr.required = true; - } - - // Denied from global - if (attrType === '-') { - delete attributes[attrName]; - attributesOrder.splice(inArray(attributesOrder, attrName), 1); - continue; - } - - // Default value - if (prefix) { - // Default value - if (prefix === '=') { - element.attributesDefault = element.attributesDefault || []; - element.attributesDefault.push({name: attrName, value: value}); - attr.defaultValue = value; - } - - // Forced value - if (prefix === ':') { - element.attributesForced = element.attributesForced || []; - element.attributesForced.push({name: attrName, value: value}); - attr.forcedValue = value; - } - - // Required values - if (prefix === '<') { - attr.validValues = makeMap(value, '?'); - } - } - - // Check for attribute patterns - if (hasPatternsRegExp.test(attrName)) { - element.attributePatterns = element.attributePatterns || []; - attr.pattern = patternToRegExp(attrName); - element.attributePatterns.push(attr); - } else { - // Add attribute to order list if it doesn't already exist - if (!attributes[attrName]) { - attributesOrder.push(attrName); - } - - attributes[attrName] = attr; - } - } - } - } - - // Global rule, store away these for later usage - if (!globalAttributes && elementName == '@') { - globalAttributes = attributes; - globalAttributesOrder = attributesOrder; - } - - // Handle substitute elements such as b/strong - if (outputName) { - element.outputName = elementName; - elements[outputName] = element; - } - - // Add pattern or exact element - if (hasPatternsRegExp.test(elementName)) { - element.pattern = patternToRegExp(elementName); - patternElements.push(element); - } else { - elements[elementName] = element; - } - } - } - } - } - - function setValidElements(valid_elements) { - elements = {}; - patternElements = []; - - addValidElements(valid_elements); - - each(schemaItems, function(element, name) { - children[name] = element.children; - }); - } - - // Adds custom non HTML elements to the schema - function addCustomElements(custom_elements) { - var customElementRegExp = /^(~)?(.+)$/; - - if (custom_elements) { - // Flush cached items since we are altering the default maps - mapCache.text_block_elements = mapCache.block_elements = null; - - each(split(custom_elements, ','), function(rule) { - var matches = customElementRegExp.exec(rule), - inline = matches[1] === '~', - cloneName = inline ? 'span' : 'div', - name = matches[2]; - - children[name] = children[cloneName]; - customElementsMap[name] = cloneName; - - // If it's not marked as inline then add it to valid block elements - if (!inline) { - blockElementsMap[name.toUpperCase()] = {}; - blockElementsMap[name] = {}; - } - - // Add elements clone if needed - if (!elements[name]) { - var customRule = elements[cloneName]; - - customRule = extend({}, customRule); - delete customRule.removeEmptyAttrs; - delete customRule.removeEmpty; - - elements[name] = customRule; - } - - // Add custom elements at span/div positions - each(children, function(element, elmName) { - if (element[cloneName]) { - children[elmName] = element = extend({}, children[elmName]); - element[name] = element[cloneName]; - } - }); - }); - } - } - - // Adds valid children to the schema object - function addValidChildren(valid_children) { - var childRuleRegExp = /^([+\-]?)(\w+)\[([^\]]+)\]$/; - - if (valid_children) { - each(split(valid_children, ','), function(rule) { - var matches = childRuleRegExp.exec(rule), parent, prefix; - - if (matches) { - prefix = matches[1]; - - // Add/remove items from default - if (prefix) { - parent = children[matches[2]]; - } else { - parent = children[matches[2]] = {'#comment': {}}; - } - - parent = children[matches[2]]; - - each(split(matches[3], '|'), function(child) { - if (prefix === '-') { - // Clone the element before we delete - // things in it to not mess up default schemas - children[matches[2]] = parent = extend({}, children[matches[2]]); - - delete parent[child]; - } else { - parent[child] = {}; - } - }); - } - }); - } - } - - function getElementRule(name) { - var element = elements[name], i; - - // Exact match found - if (element) { - return element; - } - - // No exact match then try the patterns - i = patternElements.length; - while (i--) { - element = patternElements[i]; - - if (element.pattern.test(name)) { - return element; - } - } - } - - if (!settings.valid_elements) { - // No valid elements defined then clone the elements from the schema spec - each(schemaItems, function(element, name) { - elements[name] = { - attributes: element.attributes, - attributesOrder: element.attributesOrder - }; - - children[name] = element.children; - }); - - // Switch these on HTML4 - if (settings.schema != "html5") { - each(split('strong/b em/i'), function(item) { - item = split(item, '/'); - elements[item[1]].outputName = item[0]; - }); - } - - // Add default alt attribute for images - elements.img.attributesDefault = [{name: 'alt', value: ''}]; - - // Remove these if they are empty by default - each(split('ol ul sub sup blockquote span font a table tbody tr strong em b i'), function(name) { - if (elements[name]) { - elements[name].removeEmpty = true; - } - }); - - // Padd these by default - each(split('p h1 h2 h3 h4 h5 h6 th td pre div address caption'), function(name) { - elements[name].paddEmpty = true; - }); - - // Remove these if they have no attributes - each(split('span'), function(name) { - elements[name].removeEmptyAttrs = true; - }); - - // Remove these by default - // TODO: Reenable in 4.1 - /*each(split('script style'), function(name) { - delete elements[name]; - });*/ - } else { - setValidElements(settings.valid_elements); - } - - addCustomElements(settings.custom_elements); - addValidChildren(settings.valid_children); - addValidElements(settings.extended_valid_elements); - - // Todo: Remove this when we fix list handling to be valid - addValidChildren('+ol[ul|ol],+ul[ul|ol]'); - - // Delete invalid elements - if (settings.invalid_elements) { - each(explode(settings.invalid_elements), function(item) { - if (elements[item]) { - delete elements[item]; - } - }); - } - - // If the user didn't allow span only allow internal spans - if (!getElementRule('span')) { - addValidElements('span[!data-mce-type|*]'); - } - - /** - * Name/value map object with valid parents and children to those parents. - * - * @example - * children = { - * div:{p:{}, h1:{}} - * }; - * @field children - * @type Object - */ - self.children = children; - - /** - * Name/value map object with valid styles for each element. - * - * @field styles - * @type Object - */ - self.styles = validStyles; - - /** - * Returns a map with boolean attributes. - * - * @method getBoolAttrs - * @return {Object} Name/value lookup map for boolean attributes. - */ - self.getBoolAttrs = function() { - return boolAttrMap; - }; - - /** - * Returns a map with block elements. - * - * @method getBlockElements - * @return {Object} Name/value lookup map for block elements. - */ - self.getBlockElements = function() { - return blockElementsMap; - }; - - /** - * Returns a map with text block elements. Such as: p,h1-h6,div,address - * - * @method getTextBlockElements - * @return {Object} Name/value lookup map for block elements. - */ - self.getTextBlockElements = function() { - return textBlockElementsMap; - }; - - /** - * Returns a map with short ended elements such as BR or IMG. - * - * @method getShortEndedElements - * @return {Object} Name/value lookup map for short ended elements. - */ - self.getShortEndedElements = function() { - return shortEndedElementsMap; - }; - - /** - * Returns a map with self closing tags such as
  • . - * - * @method getSelfClosingElements - * @return {Object} Name/value lookup map for self closing tags elements. - */ - self.getSelfClosingElements = function() { - return selfClosingElementsMap; - }; - - /** - * Returns a map with elements that should be treated as contents regardless if it has text - * content in them or not such as TD, VIDEO or IMG. - * - * @method getNonEmptyElements - * @return {Object} Name/value lookup map for non empty elements. - */ - self.getNonEmptyElements = function() { - return nonEmptyElementsMap; - }; - - /** - * Returns a map with elements where white space is to be preserved like PRE or SCRIPT. - * - * @method getWhiteSpaceElements - * @return {Object} Name/value lookup map for white space elements. - */ - self.getWhiteSpaceElements = function() { - return whiteSpaceElementsMap; - }; - - /** - * Returns a map with special elements. These are elements that needs to be parsed - * in a special way such as script, style, textarea etc. The map object values - * are regexps used to find the end of the element. - * - * @method getSpecialElements - * @return {Object} Name/value lookup map for special elements. - */ - self.getSpecialElements = function() { - return specialElements; - }; - - /** - * Returns true/false if the specified element and it's child is valid or not - * according to the schema. - * - * @method isValidChild - * @param {String} name Element name to check for. - * @param {String} child Element child to verify. - * @return {Boolean} True/false if the element is a valid child of the specified parent. - */ - self.isValidChild = function(name, child) { - var parent = children[name]; - - return !!(parent && parent[child]); - }; - - /** - * Returns true/false if the specified element name and optional attribute is - * valid according to the schema. - * - * @method isValid - * @param {String} name Name of element to check. - * @param {String} attr Optional attribute name to check for. - * @return {Boolean} True/false if the element and attribute is valid. - */ - self.isValid = function(name, attr) { - var attrPatterns, i, rule = getElementRule(name); - - // Check if it's a valid element - if (rule) { - if (attr) { - // Check if attribute name exists - if (rule.attributes[attr]) { - return true; - } - - // Check if attribute matches a regexp pattern - attrPatterns = rule.attributePatterns; - if (attrPatterns) { - i = attrPatterns.length; - while (i--) { - if (attrPatterns[i].pattern.test(name)) { - return true; - } - } - } - } else { - return true; - } - } - - // No match - return false; - }; - - /** - * Returns true/false if the specified element is valid or not - * according to the schema. - * - * @method getElementRule - * @param {String} name Element name to check for. - * @return {Object} Element object or undefined if the element isn't valid. - */ - self.getElementRule = getElementRule; - - /** - * Returns an map object of all custom elements. - * - * @method getCustomElements - * @return {Object} Name/value map object of all custom elements. - */ - self.getCustomElements = function() { - return customElementsMap; - }; - - /** - * Parses a valid elements string and adds it to the schema. The valid elements - * format is for example "element[attr=default|otherattr]". - * Existing rules will be replaced with the ones specified, so this extends the schema. - * - * @method addValidElements - * @param {String} valid_elements String in the valid elements format to be parsed. - */ - self.addValidElements = addValidElements; - - /** - * Parses a valid elements string and sets it to the schema. The valid elements - * format is for example "element[attr=default|otherattr]". - * Existing rules will be replaced with the ones specified, so this extends the schema. - * - * @method setValidElements - * @param {String} valid_elements String in the valid elements format to be parsed. - */ - self.setValidElements = setValidElements; - - /** - * Adds custom non HTML elements to the schema. - * - * @method addCustomElements - * @param {String} custom_elements Comma separated list of custom elements to add. - */ - self.addCustomElements = addCustomElements; - - /** - * Parses a valid children string and adds them to the schema structure. The valid children - * format is for example: "element[child1|child2]". - * - * @method addValidChildren - * @param {String} valid_children Valid children elements string to parse - */ - self.addValidChildren = addValidChildren; - - self.elements = elements; - }; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/html/Serializer.js b/common/static/js/vendor/tinymce/js/tinymce/classes/html/Serializer.js deleted file mode 100755 index 041272af7605..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/html/Serializer.js +++ /dev/null @@ -1,156 +0,0 @@ -/** - * Serializer.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class is used to serialize down the DOM tree into a string using a Writer instance. - * - * - * @example - * new tinymce.html.Serializer().serialize(new tinymce.html.DomParser().parse('

    text

    ')); - * @class tinymce.html.Serializer - * @version 3.4 - */ -define("tinymce/html/Serializer", [ - "tinymce/html/Writer", - "tinymce/html/Schema" -], function(Writer, Schema) { - /** - * Constructs a new Serializer instance. - * - * @constructor - * @method Serializer - * @param {Object} settings Name/value settings object. - * @param {tinymce.html.Schema} schema Schema instance to use. - */ - return function(settings, schema) { - var self = this, writer = new Writer(settings); - - settings = settings || {}; - settings.validate = "validate" in settings ? settings.validate : true; - - self.schema = schema = schema || new Schema(); - self.writer = writer; - - /** - * Serializes the specified node into a string. - * - * @example - * new tinymce.html.Serializer().serialize(new tinymce.html.DomParser().parse('

    text

    ')); - * @method serialize - * @param {tinymce.html.Node} node Node instance to serialize. - * @return {String} String with HTML based on DOM tree. - */ - self.serialize = function(node) { - var handlers, validate; - - validate = settings.validate; - - handlers = { - // #text - 3: function(node) { - writer.text(node.value, node.raw); - }, - - // #comment - 8: function(node) { - writer.comment(node.value); - }, - - // Processing instruction - 7: function(node) { - writer.pi(node.name, node.value); - }, - - // Doctype - 10: function(node) { - writer.doctype(node.value); - }, - - // CDATA - 4: function(node) { - writer.cdata(node.value); - }, - - // Document fragment - 11: function(node) { - if ((node = node.firstChild)) { - do { - walk(node); - } while ((node = node.next)); - } - } - }; - - writer.reset(); - - function walk(node) { - var handler = handlers[node.type], name, isEmpty, attrs, attrName, attrValue, sortedAttrs, i, l, elementRule; - - if (!handler) { - name = node.name; - isEmpty = node.shortEnded; - attrs = node.attributes; - - // Sort attributes - if (validate && attrs && attrs.length > 1) { - sortedAttrs = []; - sortedAttrs.map = {}; - - elementRule = schema.getElementRule(node.name); - for (i = 0, l = elementRule.attributesOrder.length; i < l; i++) { - attrName = elementRule.attributesOrder[i]; - - if (attrName in attrs.map) { - attrValue = attrs.map[attrName]; - sortedAttrs.map[attrName] = attrValue; - sortedAttrs.push({name: attrName, value: attrValue}); - } - } - - for (i = 0, l = attrs.length; i < l; i++) { - attrName = attrs[i].name; - - if (!(attrName in sortedAttrs.map)) { - attrValue = attrs.map[attrName]; - sortedAttrs.map[attrName] = attrValue; - sortedAttrs.push({name: attrName, value: attrValue}); - } - } - - attrs = sortedAttrs; - } - - writer.start(node.name, attrs, isEmpty); - - if (!isEmpty) { - if ((node = node.firstChild)) { - do { - walk(node); - } while ((node = node.next)); - } - - writer.end(name); - } - } else { - handler(node); - } - } - - // Serialize element and treat all non elements as fragments - if (node.type == 1 && !settings.inner) { - walk(node); - } else { - handlers[11](node); - } - - return writer.getContent(); - }; - }; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/html/Styles.js b/common/static/js/vendor/tinymce/js/tinymce/classes/html/Styles.js deleted file mode 100755 index 51b6f4621c35..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/html/Styles.js +++ /dev/null @@ -1,324 +0,0 @@ -/** - * Styles.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class is used to parse CSS styles it also compresses styles to reduce the output size. - * - * @example - * var Styles = new tinymce.html.Styles({ - * url_converter: function(url) { - * return url; - * } - * }); - * - * styles = Styles.parse('border: 1px solid red'); - * styles.color = 'red'; - * - * console.log(new tinymce.html.StyleSerializer().serialize(styles)); - * - * @class tinymce.html.Styles - * @version 3.4 - */ -define("tinymce/html/Styles", [], function() { - return function(settings, schema) { - /*jshint maxlen:255 */ - /*eslint max-len:0 */ - var rgbRegExp = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi, - urlOrStrRegExp = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi, - styleRegExp = /\s*([^:]+):\s*([^;]+);?/g, - trimRightRegExp = /\s+$/, - undef, i, encodingLookup = {}, encodingItems, invisibleChar = '\uFEFF'; - - settings = settings || {}; - - encodingItems = ('\\" \\\' \\; \\: ; : ' + invisibleChar).split(' '); - for (i = 0; i < encodingItems.length; i++) { - encodingLookup[encodingItems[i]] = invisibleChar + i; - encodingLookup[invisibleChar + i] = encodingItems[i]; - } - - function toHex(match, r, g, b) { - function hex(val) { - val = parseInt(val, 10).toString(16); - - return val.length > 1 ? val : '0' + val; // 0 -> 00 - } - - return '#' + hex(r) + hex(g) + hex(b); - } - - return { - /** - * Parses the specified RGB color value and returns a hex version of that color. - * - * @method toHex - * @param {String} color RGB string value like rgb(1,2,3) - * @return {String} Hex version of that RGB value like #FF00FF. - */ - toHex: function(color) { - return color.replace(rgbRegExp, toHex); - }, - - /** - * Parses the specified style value into an object collection. This parser will also - * merge and remove any redundant items that browsers might have added. It will also convert non hex - * colors to hex values. Urls inside the styles will also be converted to absolute/relative based on settings. - * - * @method parse - * @param {String} css Style value to parse for example: border:1px solid red;. - * @return {Object} Object representation of that style like {border: '1px solid red'} - */ - parse: function(css) { - var styles = {}, matches, name, value, isEncoded, urlConverter = settings.url_converter; - var urlConverterScope = settings.url_converter_scope || this; - - function compress(prefix, suffix, noJoin) { - var top, right, bottom, left; - - top = styles[prefix + '-top' + suffix]; - if (!top) { - return; - } - - right = styles[prefix + '-right' + suffix]; - if (!right) { - return; - } - - bottom = styles[prefix + '-bottom' + suffix]; - if (!bottom) { - return; - } - - left = styles[prefix + '-left' + suffix]; - if (!left) { - return; - } - - var box = [top, right, bottom, left]; - i = box.length - 1; - while (i--) { - if (box[i] !== box[i + 1]) { - break; - } - } - - if (i > -1 && noJoin) { - return; - } - - styles[prefix + suffix] = i == -1 ? box[0] : box.join(' '); - delete styles[prefix + '-top' + suffix]; - delete styles[prefix + '-right' + suffix]; - delete styles[prefix + '-bottom' + suffix]; - delete styles[prefix + '-left' + suffix]; - } - - /** - * Checks if the specific style can be compressed in other words if all border-width are equal. - */ - function canCompress(key) { - var value = styles[key], i; - - if (!value) { - return; - } - - value = value.split(' '); - i = value.length; - while (i--) { - if (value[i] !== value[0]) { - return false; - } - } - - styles[key] = value[0]; - - return true; - } - - /** - * Compresses multiple styles into one style. - */ - function compress2(target, a, b, c) { - if (!canCompress(a)) { - return; - } - - if (!canCompress(b)) { - return; - } - - if (!canCompress(c)) { - return; - } - - // Compress - styles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c]; - delete styles[a]; - delete styles[b]; - delete styles[c]; - } - - // Encodes the specified string by replacing all \" \' ; : with _ - function encode(str) { - isEncoded = true; - - return encodingLookup[str]; - } - - // Decodes the specified string by replacing all _ with it's original value \" \' etc - // It will also decode the \" \' if keep_slashes is set to fale or omitted - function decode(str, keep_slashes) { - if (isEncoded) { - str = str.replace(/\uFEFF[0-9]/g, function(str) { - return encodingLookup[str]; - }); - } - - if (!keep_slashes) { - str = str.replace(/\\([\'\";:])/g, "$1"); - } - - return str; - } - - function processUrl(match, url, url2, url3, str, str2) { - str = str || str2; - - if (str) { - str = decode(str); - - // Force strings into single quote format - return "'" + str.replace(/\'/g, "\\'") + "'"; - } - - url = decode(url || url2 || url3); - - if (!settings.allow_script_urls && /(java|vb)script:/i.test(url.replace(/[\s\r\n]+/, ''))) { - return ""; - } - - // Convert the URL to relative/absolute depending on config - if (urlConverter) { - url = urlConverter.call(urlConverterScope, url, 'style'); - } - - // Output new URL format - return "url('" + url.replace(/\'/g, "\\'") + "')"; - } - - if (css) { - css = css.replace(/[\u0000-\u001F]/g, ''); - - // Encode \" \' % and ; and : inside strings so they don't interfere with the style parsing - css = css.replace(/\\[\"\';:\uFEFF]/g, encode).replace(/\"[^\"]+\"|\'[^\']+\'/g, function(str) { - return str.replace(/[;:]/g, encode); - }); - - // Parse styles - while ((matches = styleRegExp.exec(css))) { - name = matches[1].replace(trimRightRegExp, '').toLowerCase(); - value = matches[2].replace(trimRightRegExp, ''); - - if (name && value.length > 0) { - if (!settings.allow_script_urls && (name == "behavior" || /expression\s*\(/.test(value))) { - continue; - } - - // Opera will produce 700 instead of bold in their style values - if (name === 'font-weight' && value === '700') { - value = 'bold'; - } else if (name === 'color' || name === 'background-color') { // Lowercase colors like RED - value = value.toLowerCase(); - } - - // Convert RGB colors to HEX - value = value.replace(rgbRegExp, toHex); - - // Convert URLs and force them into url('value') format - value = value.replace(urlOrStrRegExp, processUrl); - styles[name] = isEncoded ? decode(value, true) : value; - } - - styleRegExp.lastIndex = matches.index + matches[0].length; - } - // Compress the styles to reduce it's size for example IE will expand styles - compress("border", "", true); - compress("border", "-width"); - compress("border", "-color"); - compress("border", "-style"); - compress("padding", ""); - compress("margin", ""); - compress2('border', 'border-width', 'border-style', 'border-color'); - - // Remove pointless border, IE produces these - if (styles.border === 'medium none') { - delete styles.border; - } - - // IE 11 will produce a border-image: none when getting the style attribute from

    - // So lets asume it shouldn't be there - if (styles['border-image'] === 'none') { - delete styles['border-image']; - } - } - - return styles; - }, - - /** - * Serializes the specified style object into a string. - * - * @method serialize - * @param {Object} styles Object to serialize as string for example: {border: '1px solid red'} - * @param {String} element_name Optional element name, if specified only the styles that matches the schema will be serialized. - * @return {String} String representation of the style object for example: border: 1px solid red. - */ - serialize: function(styles, element_name) { - var css = '', name, value; - - function serializeStyles(name) { - var styleList, i, l, value; - - styleList = schema.styles[name]; - if (styleList) { - for (i = 0, l = styleList.length; i < l; i++) { - name = styleList[i]; - value = styles[name]; - - if (value !== undef && value.length > 0) { - css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';'; - } - } - } - } - - // Serialize styles according to schema - if (element_name && schema && schema.styles) { - // Serialize global styles and element specific styles - serializeStyles('*'); - serializeStyles(element_name); - } else { - // Output the styles in the order they are inside the object - for (name in styles) { - value = styles[name]; - - if (value !== undef && value.length > 0) { - css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';'; - } - } - } - - return css; - } - }; - }; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/html/Writer.js b/common/static/js/vendor/tinymce/js/tinymce/classes/html/Writer.js deleted file mode 100755 index 0f9eaaef4bd9..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/html/Writer.js +++ /dev/null @@ -1,199 +0,0 @@ -/** - * Writer.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class is used to write HTML tags out it can be used with the Serializer or the SaxParser. - * - * @class tinymce.html.Writer - * @example - * var writer = new tinymce.html.Writer({indent: true}); - * var parser = new tinymce.html.SaxParser(writer).parse('


    '); - * console.log(writer.getContent()); - * - * @class tinymce.html.Writer - * @version 3.4 - */ -define("tinymce/html/Writer", [ - "tinymce/html/Entities", - "tinymce/util/Tools" -], function(Entities, Tools) { - var makeMap = Tools.makeMap; - - /** - * Constructs a new Writer instance. - * - * @constructor - * @method Writer - * @param {Object} settings Name/value settings object. - */ - return function(settings) { - var html = [], indent, indentBefore, indentAfter, encode, htmlOutput; - - settings = settings || {}; - indent = settings.indent; - indentBefore = makeMap(settings.indent_before || ''); - indentAfter = makeMap(settings.indent_after || ''); - encode = Entities.getEncodeFunc(settings.entity_encoding || 'raw', settings.entities); - htmlOutput = settings.element_format == "html"; - - return { - /** - * Writes the a start element such as

    . - * - * @method start - * @param {String} name Name of the element. - * @param {Array} attrs Optional attribute array or undefined if it hasn't any. - * @param {Boolean} empty Optional empty state if the tag should end like
    . - */ - start: function(name, attrs, empty) { - var i, l, attr, value; - - if (indent && indentBefore[name] && html.length > 0) { - value = html[html.length - 1]; - - if (value.length > 0 && value !== '\n') { - html.push('\n'); - } - } - - html.push('<', name); - - if (attrs) { - for (i = 0, l = attrs.length; i < l; i++) { - attr = attrs[i]; - html.push(' ', attr.name, '="', encode(attr.value, true), '"'); - } - } - - if (!empty || htmlOutput) { - html[html.length] = '>'; - } else { - html[html.length] = ' />'; - } - - if (empty && indent && indentAfter[name] && html.length > 0) { - value = html[html.length - 1]; - - if (value.length > 0 && value !== '\n') { - html.push('\n'); - } - } - }, - - /** - * Writes the a end element such as

    . - * - * @method end - * @param {String} name Name of the element. - */ - end: function(name) { - var value; - - /*if (indent && indentBefore[name] && html.length > 0) { - value = html[html.length - 1]; - - if (value.length > 0 && value !== '\n') - html.push('\n'); - }*/ - - html.push(''); - - if (indent && indentAfter[name] && html.length > 0) { - value = html[html.length - 1]; - - if (value.length > 0 && value !== '\n') { - html.push('\n'); - } - } - }, - - /** - * Writes a text node. - * - * @method text - * @param {String} text String to write out. - * @param {Boolean} raw Optional raw state if true the contents wont get encoded. - */ - text: function(text, raw) { - if (text.length > 0) { - html[html.length] = raw ? text : encode(text); - } - }, - - /** - * Writes a cdata node such as . - * - * @method cdata - * @param {String} text String to write out inside the cdata. - */ - cdata: function(text) { - html.push(''); - }, - - /** - * Writes a comment node such as . - * - * @method cdata - * @param {String} text String to write out inside the comment. - */ - comment: function(text) { - html.push(''); - }, - - /** - * Writes a PI node such as . - * - * @method pi - * @param {String} name Name of the pi. - * @param {String} text String to write out inside the pi. - */ - pi: function(name, text) { - if (text) { - html.push(''); - } else { - html.push(''); - } - - if (indent) { - html.push('\n'); - } - }, - - /** - * Writes a doctype node such as . - * - * @method doctype - * @param {String} text String to write out inside the doctype. - */ - doctype: function(text) { - html.push('', indent ? '\n' : ''); - }, - - /** - * Resets the internal buffer if one wants to reuse the writer. - * - * @method reset - */ - reset: function() { - html.length = 0; - }, - - /** - * Returns the contents that got serialized. - * - * @method getContent - * @return {String} HTML contents that got written down. - */ - getContent: function() { - return html.join('').replace(/\n$/, ''); - } - }; - }; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/jquery.tinymce.js b/common/static/js/vendor/tinymce/js/tinymce/classes/jquery.tinymce.js deleted file mode 100755 index 495e88a8265b..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/jquery.tinymce.js +++ /dev/null @@ -1,364 +0,0 @@ -/** - * jquery.tinymce.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*global tinymce:true, jQuery */ - -(function($) { - var undef, - lazyLoading, - delayedInits = [], - win = window; - - $.fn.tinymce = function(settings) { - var self = this, url, base, lang, suffix = "", patchApplied; - - // No match then just ignore the call - if (!self.length) { - return self; - } - - // Get editor instance - if (!settings) { - return window.tinymce ? tinymce.get(self[0].id) : null; - } - - self.css('visibility', 'hidden'); // Hide textarea to avoid flicker - - function init() { - var editors = [], initCount = 0; - - // Apply patches to the jQuery object, only once - if (!patchApplied) { - applyPatch(); - patchApplied = true; - } - - // Create an editor instance for each matched node - self.each(function(i, node) { - var ed, id = node.id, oninit = settings.oninit; - - // Generate unique id for target element if needed - if (!id) { - node.id = id = tinymce.DOM.uniqueId(); - } - - // Only init the editor once - if (tinymce.get(id)) { - return; - } - - // Create editor instance and render it - ed = new tinymce.Editor(id, settings, tinymce.EditorManager); - editors.push(ed); - - ed.on('init', function() { - var scope, func = oninit; - - self.css('visibility', ''); - - // Run this if the oninit setting is defined - // this logic will fire the oninit callback ones each - // matched editor instance is initialized - if (oninit) { - // Fire the oninit event ones each editor instance is initialized - if (++initCount == editors.length) { - if (typeof(func) === "string") { - scope = (func.indexOf(".") === -1) ? null : tinymce.resolve(func.replace(/\.\w+$/, "")); - func = tinymce.resolve(func); - } - - // Call the oninit function with the object - func.apply(scope || tinymce, editors); - } - } - }); - }); - - // Render the editor instances in a separate loop since we - // need to have the full editors array used in the onInit calls - $.each(editors, function(i, ed) { - ed.render(); - }); - } - - // Load TinyMCE on demand, if we need to - if (!win.tinymce && !lazyLoading && (url = settings.script_url)) { - lazyLoading = 1; - base = url.substring(0, url.lastIndexOf("/")); - - // Check if it's a dev/src version they want to load then - // make sure that all plugins, themes etc are loaded in source mode as well - if (url.indexOf('.min') != -1) { - suffix = ".min"; - } - - // Setup tinyMCEPreInit object this will later be used by the TinyMCE - // core script to locate other resources like CSS files, dialogs etc - // You can also predefined a tinyMCEPreInit object and then it will use that instead - win.tinymce = win.tinyMCEPreInit || { - base: base, - suffix: suffix - }; - - // url contains gzip then we assume it's a compressor - if (url.indexOf('gzip') != -1) { - lang = settings.language || "en"; - url = url + (/\?/.test(url) ? '&' : '?') + "js=true&core=true&suffix=" + escape(suffix) + - "&themes=" + escape(settings.theme || 'modern') + "&plugins=" + - escape(settings.plugins || '') + "&languages=" + (lang || ''); - - // Check if compressor script is already loaded otherwise setup a basic one - if (!win.tinyMCE_GZ) { - win.tinyMCE_GZ = { - start: function() { - function load(url) { - tinymce.ScriptLoader.markDone(tinymce.baseURI.toAbsolute(url)); - } - - // Add core languages - load("langs/" + lang + ".js"); - - // Add themes with languages - load("themes/" + settings.theme + "/theme" + suffix + ".js"); - load("themes/" + settings.theme + "/langs/" + lang + ".js"); - - // Add plugins with languages - $.each(settings.plugins.split(","), function(i, name) { - if (name) { - load("plugins/" + name + "/plugin" + suffix + ".js"); - load("plugins/" + name + "/langs/" + lang + ".js"); - } - }); - }, - - end: function() { - } - }; - } - } - - var script = document.createElement('script'); - script.type = 'text/javascript'; - script.onload = script.onreadystatechange = function(e) { - e = e || window.event; - - if (lazyLoading !== 2 && (e.type == 'load' || /complete|loaded/.test(script.readyState))) { - tinymce.dom.Event.domLoaded = 1; - lazyLoading = 2; - - // Execute callback after mainscript has been loaded and before the initialization occurs - if (settings.script_loaded) { - settings.script_loaded(); - } - - init(); - - $.each(delayedInits, function(i, init) { - init(); - }); - } - }; - script.src = url; - document.body.appendChild(script); - } else { - // Delay the init call until tinymce is loaded - if (lazyLoading === 1) { - delayedInits.push(init); - } else { - init(); - } - } - - return self; - }; - - // Add :tinymce psuedo selector this will select elements that has been converted into editor instances - // it's now possible to use things like $('*:tinymce') to get all TinyMCE bound elements. - $.extend($.expr[":"], { - tinymce: function(e) { - return !!(e.id && "tinymce" in window && tinymce.get(e.id)); - } - }); - - // This function patches internal jQuery functions so that if - // you for example remove an div element containing an editor it's - // automatically destroyed by the TinyMCE API - function applyPatch() { - // Removes any child editor instances by looking for editor wrapper elements - function removeEditors(name) { - // If the function is remove - if (name === "remove") { - this.each(function(i, node) { - var ed = tinyMCEInstance(node); - - if (ed) { - ed.remove(); - } - }); - } - - this.find("span.mceEditor,div.mceEditor").each(function(i, node) { - var ed = tinymce.get(node.id.replace(/_parent$/, "")); - - if (ed) { - ed.remove(); - } - }); - } - - // Loads or saves contents from/to textarea if the value - // argument is defined it will set the TinyMCE internal contents - function loadOrSave(value) { - var self = this, ed; - - // Handle set value - /*jshint eqnull:true */ - if (value != null) { - removeEditors.call(self); - - // Saves the contents before get/set value of textarea/div - self.each(function(i, node) { - var ed; - - if ((ed = tinymce.get(node.id))) { - ed.setContent(value); - } - }); - } else if (self.length > 0) { - // Handle get value - if ((ed = tinymce.get(self[0].id))) { - return ed.getContent(); - } - } - } - - // Returns tinymce instance for the specified element or null if it wasn't found - function tinyMCEInstance(element) { - var ed = null; - - if (element && element.id && win.tinymce) { - ed = tinymce.get(element.id); - } - - return ed; - } - - // Checks if the specified set contains tinymce instances - function containsTinyMCE(matchedSet) { - return !!((matchedSet) && (matchedSet.length) && (win.tinymce) && (matchedSet.is(":tinymce"))); - } - - // Patch various jQuery functions - var jQueryFn = {}; - - // Patch some setter/getter functions these will - // now be able to set/get the contents of editor instances for - // example $('#editorid').html('Content'); will update the TinyMCE iframe instance - $.each(["text", "html", "val"], function(i, name) { - var origFn = jQueryFn[name] = $.fn[name], - textProc = (name === "text"); - - $.fn[name] = function(value) { - var self = this; - - if (!containsTinyMCE(self)) { - return origFn.apply(self, arguments); - } - - if (value !== undef) { - loadOrSave.call(self.filter(":tinymce"), value); - origFn.apply(self.not(":tinymce"), arguments); - - return self; // return original set for chaining - } else { - var ret = ""; - var args = arguments; - - (textProc ? self : self.eq(0)).each(function(i, node) { - var ed = tinyMCEInstance(node); - - if (ed) { - ret += textProc ? ed.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g, "") : ed.getContent({save: true}); - } else { - ret += origFn.apply($(node), args); - } - }); - - return ret; - } - }; - }); - - // Makes it possible to use $('#id').append("content"); to append contents to the TinyMCE editor iframe - $.each(["append", "prepend"], function(i, name) { - var origFn = jQueryFn[name] = $.fn[name], - prepend = (name === "prepend"); - - $.fn[name] = function(value) { - var self = this; - - if (!containsTinyMCE(self)) { - return origFn.apply(self, arguments); - } - - if (value !== undef) { - self.filter(":tinymce").each(function(i, node) { - var ed = tinyMCEInstance(node); - - if (ed) { - ed.setContent(prepend ? value + ed.getContent() : ed.getContent() + value); - } - }); - - origFn.apply(self.not(":tinymce"), arguments); - - return self; // return original set for chaining - } - }; - }); - - // Makes sure that the editor instance gets properly destroyed when the parent element is removed - $.each(["remove", "replaceWith", "replaceAll", "empty"], function(i, name) { - var origFn = jQueryFn[name] = $.fn[name]; - - $.fn[name] = function() { - removeEditors.call(this, name); - - return origFn.apply(this, arguments); - }; - }); - - jQueryFn.attr = $.fn.attr; - - // Makes sure that $('#tinymce_id').attr('value') gets the editors current HTML contents - $.fn.attr = function(name, value) { - var self = this, args = arguments; - - if ((!name) || (name !== "value") || (!containsTinyMCE(self))) { - if (value !== undef) { - return jQueryFn.attr.apply(self, args); - } else { - return jQueryFn.attr.apply(self, args); - } - } - - if (value !== undef) { - loadOrSave.call(self.filter(":tinymce"), value); - jQueryFn.attr.apply(self.not(":tinymce"), args); - - return self; // return original set for chaining - } else { - var node = self[0], ed = tinyMCEInstance(node); - - return ed ? ed.getContent({save: true}) : jQueryFn.attr.apply($(node), args); - } - }; - } -})(jQuery); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/AbsoluteLayout.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/AbsoluteLayout.js deleted file mode 100755 index 8d286a13e39d..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/AbsoluteLayout.js +++ /dev/null @@ -1,63 +0,0 @@ -/** - * AbsoluteLayout.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * LayoutManager for absolute positioning. This layout manager is more of - * a base class for other layouts but can be created and used directly. - * - * @-x-less AbsoluteLayout.less - * @class tinymce.ui.AbsoluteLayout - * @extends tinymce.ui.Layout - */ -define("tinymce/ui/AbsoluteLayout", [ - "tinymce/ui/Layout" -], function(Layout) { - "use strict"; - - return Layout.extend({ - Defaults: { - containerClass: 'abs-layout', - controlClass: 'abs-layout-item' - }, - - /** - * Recalculates the positions of the controls in the specified container. - * - * @method recalc - * @param {tinymce.ui.Container} container Container instance to recalc. - */ - recalc: function(container) { - container.items().filter(':visible').each(function(ctrl) { - var settings = ctrl.settings; - - ctrl.layoutRect({ - x: settings.x, - y: settings.y, - w: settings.w, - h: settings.h - }); - - if (ctrl.recalc) { - ctrl.recalc(); - } - }); - }, - - /** - * Renders the specified container and any layout specific HTML. - * - * @method renderHtml - * @param {tinymce.ui.Container} container Container to render HTML for. - */ - renderHtml: function(container) { - return '
    ' + this._super(container); - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Button.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Button.js deleted file mode 100755 index c2ecf347b818..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Button.js +++ /dev/null @@ -1,141 +0,0 @@ -/** - * Button.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class is used to create buttons. You can create them directly or through the Factory. - * - * @example - * // Create and render a button to the body element - * tinymce.ui.Factory.create({ - * type: 'button', - * text: 'My button' - * }).renderTo(document.body); - * - * @-x-less Button.less - * @class tinymce.ui.Button - * @extends tinymce.ui.Widget - */ -define("tinymce/ui/Button", [ - "tinymce/ui/Widget" -], function(Widget) { - "use strict"; - - return Widget.extend({ - Defaults: { - classes: "widget btn", - role: "button" - }, - - /** - * Constructs a new button instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - * @setting {String} size Size of the button small|medium|large. - * @setting {String} image Image to use for icon. - * @setting {String} icon Icon to use for button. - */ - init: function(settings) { - var self = this, size; - - self.on('click mousedown', function(e) { - e.preventDefault(); - }); - - self._super(settings); - size = settings.size; - - if (settings.subtype) { - self.addClass(settings.subtype); - } - - if (size) { - self.addClass('btn-' + size); - } - }, - - /** - * Sets/gets the current button icon. - * - * @method icon - * @param {String} [icon] New icon identifier. - * @return {String|tinymce.ui.MenuButton} Current icon or current MenuButton instance. - */ - icon: function(icon) { - var self = this, prefix = self.classPrefix; - - if (typeof(icon) == 'undefined') { - return self.settings.icon; - } - - self.settings.icon = icon; - icon = icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : ''; - - if (self._rendered) { - var btnElm = self.getEl().firstChild, iconElm = btnElm.getElementsByTagName('i')[0]; - - if (icon) { - if (!iconElm || iconElm != btnElm.firstChild) { - iconElm = document.createElement('i'); - btnElm.insertBefore(iconElm, btnElm.firstChild); - } - - iconElm.className = icon; - } else if (iconElm) { - btnElm.removeChild(iconElm); - } - - self.text(self._text); // Set text again to fix whitespace between icon + text - } - - return self; - }, - - /** - * Repaints the button for example after it's been resizes by a layout engine. - * - * @method repaint - */ - repaint: function() { - var btnStyle = this.getEl().firstChild.style; - - btnStyle.width = btnStyle.height = "100%"; - - this._super(); - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, id = self._id, prefix = self.classPrefix; - var icon = self.settings.icon, image = ''; - - if (self.settings.image) { - icon = 'none'; - image = ' style="background-image: url(\'' + self.settings.image + '\')"'; - } - - icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : ''; - - return ( - '
    ' + - '' + - '
    ' - ); - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/ButtonGroup.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/ButtonGroup.js deleted file mode 100755 index f58fe6ce56e6..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/ButtonGroup.js +++ /dev/null @@ -1,62 +0,0 @@ -/** - * ButtonGroup.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This control enables you to put multiple buttons into a group. This is - * useful when you want to combine similar toolbar buttons into a group. - * - * @example - * // Create and render a buttongroup with two buttons to the body element - * tinymce.ui.Factory.create({ - * type: 'buttongroup', - * items: [ - * {text: 'Button A'}, - * {text: 'Button B'} - * ] - * }).renderTo(document.body); - * - * @-x-less ButtonGroup.less - * @class tinymce.ui.ButtonGroup - * @extends tinymce.ui.Container - */ -define("tinymce/ui/ButtonGroup", [ - "tinymce/ui/Container" -], function(Container) { - "use strict"; - - return Container.extend({ - Defaults: { - defaultType: 'button', - role: 'group' - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, layout = self._layout; - - self.addClass('btn-group'); - self.preRender(); - layout.preRender(self); - - return ( - '
    ' + - '
    ' + - (self.settings.html || '') + layout.renderHtml(self) + - '
    ' + - '
    ' - ); - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Checkbox.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Checkbox.js deleted file mode 100755 index 1bbdf1f1b645..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Checkbox.js +++ /dev/null @@ -1,119 +0,0 @@ -/** - * Checkbox.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This control creates a custom checkbox. - * - * @example - * // Create and render a checkbox to the body element - * tinymce.ui.Factory.create({ - * type: 'checkbox', - * checked: true, - * text: 'My checkbox' - * }).renderTo(document.body); - * - * @-x-less Checkbox.less - * @class tinymce.ui.Checkbox - * @extends tinymce.ui.Widget - */ -define("tinymce/ui/Checkbox", [ - "tinymce/ui/Widget" -], function(Widget) { - "use strict"; - - return Widget.extend({ - Defaults: { - classes: "checkbox", - role: "checkbox", - checked: false - }, - - /** - * Constructs a new Checkbox instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - * @setting {Boolean} checked True if the checkbox should be checked by default. - */ - init: function(settings) { - var self = this; - - self._super(settings); - - self.on('click mousedown', function(e) { - e.preventDefault(); - }); - - self.on('click', function(e) { - e.preventDefault(); - - if (!self.disabled()) { - self.checked(!self.checked()); - } - }); - - self.checked(self.settings.checked); - }, - - /** - * Getter/setter function for the checked state. - * - * @method checked - * @param {Boolean} [state] State to be set. - * @return {Boolean|tinymce.ui.Checkbox} True/false or checkbox if it's a set operation. - */ - checked: function(state) { - var self = this; - - if (typeof state != "undefined") { - if (state) { - self.addClass('checked'); - } else { - self.removeClass('checked'); - } - - self._checked = state; - self.aria('checked', state); - - return self; - } - - return self._checked; - }, - - /** - * Getter/setter function for the value state. - * - * @method value - * @param {Boolean} [state] State to be set. - * @return {Boolean|tinymce.ui.Checkbox} True/false or checkbox if it's a set operation. - */ - value: function(state) { - return this.checked(state); - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, id = self._id, prefix = self.classPrefix; - - return ( - '
    ' + - '' + - '' + self.encode(self._text) + '' + - '
    ' - ); - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Collection.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Collection.js deleted file mode 100755 index 285d0c83689b..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Collection.js +++ /dev/null @@ -1,430 +0,0 @@ -/** - * Collection.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Control collection, this class contains control instances and it enables you to - * perform actions on all the contained items. This is very similar to how jQuery works. - * - * @example - * someCollection.show().disabled(true); - * - * @class tinymce.ui.Collection - */ -define("tinymce/ui/Collection", [ - "tinymce/util/Tools", - "tinymce/ui/Selector", - "tinymce/util/Class" -], function(Tools, Selector, Class) { - "use strict"; - - var Collection, proto, push = Array.prototype.push, slice = Array.prototype.slice; - - proto = { - /** - * Current number of contained control instances. - * - * @field length - * @type Number - */ - length: 0, - - /** - * Constructor for the collection. - * - * @constructor - * @method init - * @param {Array} items Optional array with items to add. - */ - init: function(items) { - if (items) { - this.add(items); - } - }, - - /** - * Adds new items to the control collection. - * - * @method add - * @param {Array} items Array if items to add to collection. - * @return {tinymce.ui.Collection} Current collection instance. - */ - add: function(items) { - var self = this; - - // Force single item into array - if (!Tools.isArray(items)) { - if (items instanceof Collection) { - self.add(items.toArray()); - } else { - push.call(self, items); - } - } else { - push.apply(self, items); - } - - return self; - }, - - /** - * Sets the contents of the collection. This will remove any existing items - * and replace them with the ones specified in the input array. - * - * @method set - * @param {Array} items Array with items to set into the Collection. - * @return {tinymce.ui.Collection} Collection instance. - */ - set: function(items) { - var self = this, len = self.length, i; - - self.length = 0; - self.add(items); - - // Remove old entries - for (i = self.length; i < len; i++) { - delete self[i]; - } - - return self; - }, - - /** - * Filters the collection item based on the specified selector expression or selector function. - * - * @method filter - * @param {String} selector Selector expression to filter items by. - * @return {tinymce.ui.Collection} Collection containing the filtered items. - */ - filter: function(selector) { - var self = this, i, l, matches = [], item, match; - - // Compile string into selector expression - if (typeof(selector) === "string") { - selector = new Selector(selector); - - match = function(item) { - return selector.match(item); - }; - } else { - // Use selector as matching function - match = selector; - } - - for (i = 0, l = self.length; i < l; i++) { - item = self[i]; - - if (match(item)) { - matches.push(item); - } - } - - return new Collection(matches); - }, - - /** - * Slices the items within the collection. - * - * @method slice - * @param {Number} index Index to slice at. - * @param {Number} len Optional length to slice. - * @return {tinymce.ui.Collection} Current collection. - */ - slice: function() { - return new Collection(slice.apply(this, arguments)); - }, - - /** - * Makes the current collection equal to the specified index. - * - * @method eq - * @param {Number} index Index of the item to set the collection to. - * @return {tinymce.ui.Collection} Current collection. - */ - eq: function(index) { - return index === -1 ? this.slice(index) : this.slice(index, +index + 1); - }, - - /** - * Executes the specified callback on each item in collection. - * - * @method each - * @param {function} callback Callback to execute for each item in collection. - * @return {tinymce.ui.Collection} Current collection instance. - */ - each: function(callback) { - Tools.each(this, callback); - - return this; - }, - - /** - * Returns an JavaScript array object of the contents inside the collection. - * - * @method toArray - * @return {Array} Array with all items from collection. - */ - toArray: function() { - return Tools.toArray(this); - }, - - /** - * Finds the index of the specified control or return -1 if it isn't in the collection. - * - * @method indexOf - * @param {Control} ctrl Control instance to look for. - * @return {Number} Index of the specified control or -1. - */ - indexOf: function(ctrl) { - var self = this, i = self.length; - - while (i--) { - if (self[i] === ctrl) { - break; - } - } - - return i; - }, - - /** - * Returns a new collection of the contents in reverse order. - * - * @method reverse - * @return {tinymce.ui.Collection} Collection instance with reversed items. - */ - reverse: function() { - return new Collection(Tools.toArray(this).reverse()); - }, - - /** - * Returns true/false if the class exists or not. - * - * @method hasClass - * @param {String} cls Class to check for. - * @return {Boolean} true/false state if the class exists or not. - */ - hasClass: function(cls) { - return this[0] ? this[0].hasClass(cls) : false; - }, - - /** - * Sets/gets the specific property on the items in the collection. The same as executing control.(); - * - * @method prop - * @param {String} name Property name to get/set. - * @param {Object} value Optional object value to set. - * @return {tinymce.ui.Collection} Current collection instance or value of the first item on a get operation. - */ - prop: function(name, value) { - var self = this, undef, item; - - if (value !== undef) { - self.each(function(item) { - if (item[name]) { - item[name](value); - } - }); - - return self; - } - - item = self[0]; - - if (item && item[name]) { - return item[name](); - } - }, - - /** - * Executes the specific function name with optional arguments an all items in collection if it exists. - * - * @example collection.exec("myMethod", arg1, arg2, arg3); - * @method exec - * @param {String} name Name of the function to execute. - * @param {Object} ... Multiple arguments to pass to each function. - * @return {tinymce.ui.Collection} Current collection. - */ - exec: function(name) { - var self = this, args = Tools.toArray(arguments).slice(1); - - self.each(function(item) { - if (item[name]) { - item[name].apply(item, args); - } - }); - - return self; - }, - - /** - * Remove all items from collection and DOM. - * - * @method remove - * @return {tinymce.ui.Collection} Current collection. - */ - remove: function() { - var i = this.length; - - while (i--) { - this[i].remove(); - } - - return this; - } - - /** - * Fires the specified event by name and arguments on the control. This will execute all - * bound event handlers. - * - * @method fire - * @param {String} name Name of the event to fire. - * @param {Object} args Optional arguments to pass to the event. - * @return {tinymce.ui.Collection} Current collection instance. - */ - // fire: function(event, args) {}, -- Generated by code below - - /** - * Binds a callback to the specified event. This event can both be - * native browser events like "click" or custom ones like PostRender. - * - * The callback function will have two parameters the first one being the control that received the event - * the second one will be the event object either the browsers native event object or a custom JS object. - * - * @method on - * @param {String} name Name of the event to bind. For example "click". - * @param {String/function} callback Callback function to execute ones the event occurs. - * @return {tinymce.ui.Collection} Current collection instance. - */ - // on: function(name, callback) {}, -- Generated by code below - - /** - * Unbinds the specified event and optionally a specific callback. If you omit the name - * parameter all event handlers will be removed. If you omit the callback all event handles - * by the specified name will be removed. - * - * @method off - * @param {String} name Optional name for the event to unbind. - * @param {function} callback Optional callback function to unbind. - * @return {tinymce.ui.Collection} Current collection instance. - */ - // off: function(name, callback) {}, -- Generated by code below - - /** - * Shows the items in the current collection. - * - * @method show - * @return {tinymce.ui.Collection} Current collection instance. - */ - // show: function() {}, -- Generated by code below - - /** - * Hides the items in the current collection. - * - * @method hide - * @return {tinymce.ui.Collection} Current collection instance. - */ - // hide: function() {}, -- Generated by code below - - /** - * Sets/gets the text contents of the items in the current collection. - * - * @method text - * @return {tinymce.ui.Collection} Current collection instance or text value of the first item on a get operation. - */ - // text: function(value) {}, -- Generated by code below - - /** - * Sets/gets the name contents of the items in the current collection. - * - * @method name - * @return {tinymce.ui.Collection} Current collection instance or name value of the first item on a get operation. - */ - // name: function(value) {}, -- Generated by code below - - /** - * Sets/gets the disabled state on the items in the current collection. - * - * @method disabled - * @return {tinymce.ui.Collection} Current collection instance or disabled state of the first item on a get operation. - */ - // disabled: function(state) {}, -- Generated by code below - - /** - * Sets/gets the active state on the items in the current collection. - * - * @method active - * @return {tinymce.ui.Collection} Current collection instance or active state of the first item on a get operation. - */ - // active: function(state) {}, -- Generated by code below - - /** - * Sets/gets the selected state on the items in the current collection. - * - * @method selected - * @return {tinymce.ui.Collection} Current collection instance or selected state of the first item on a get operation. - */ - // selected: function(state) {}, -- Generated by code below - - /** - * Sets/gets the selected state on the items in the current collection. - * - * @method visible - * @return {tinymce.ui.Collection} Current collection instance or visible state of the first item on a get operation. - */ - // visible: function(state) {}, -- Generated by code below - - /** - * Adds a class to all items in the collection. - * - * @method addClass - * @param {String} cls Class to add to each item. - * @return {tinymce.ui.Collection} Current collection instance. - */ - // addClass: function(cls) {}, -- Generated by code below - - /** - * Removes the specified class from all items in collection. - * - * @method removeClass - * @param {String} cls Class to remove from each item. - * @return {tinymce.ui.Collection} Current collection instance. - */ - // removeClass: function(cls) {}, -- Generated by code below - }; - - // Extend tinymce.ui.Collection prototype with some generated control specific methods - Tools.each('fire on off show hide addClass removeClass append prepend before after reflow'.split(' '), function(name) { - proto[name] = function() { - var args = Tools.toArray(arguments); - - this.each(function(ctrl) { - if (name in ctrl) { - ctrl[name].apply(ctrl, args); - } - }); - - return this; - }; - }); - - // Extend tinymce.ui.Collection prototype with some property methods - Tools.each('text name disabled active selected checked visible parent value data'.split(' '), function(name) { - proto[name] = function(value) { - return this.prop(name, value); - }; - }); - - // Create class based on the new prototype - Collection = Class.extend(proto); - - // Stick Collection into Selector to prevent circual references - Selector.Collection = Collection; - - return Collection; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/ColorButton.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/ColorButton.js deleted file mode 100755 index f4b36c3f2d2b..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/ColorButton.js +++ /dev/null @@ -1,107 +0,0 @@ -/** - * ColorButton.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class creates a color button control. This is a split button in which the main - * button has a visual representation of the currently selected color. When clicked - * the caret button displays a color picker, allowing the user to select a new color. - * - * @-x-less ColorButton.less - * @class tinymce.ui.ColorButton - * @extends tinymce.ui.PanelButton - */ -define("tinymce/ui/ColorButton", [ - "tinymce/ui/PanelButton", - "tinymce/dom/DOMUtils" -], function(PanelButton, DomUtils) { - "use strict"; - - var DOM = DomUtils.DOM; - - return PanelButton.extend({ - /** - * Constructs a new ColorButton instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - */ - init: function(settings) { - this._super(settings); - this.addClass('colorbutton'); - }, - - /** - * Getter/setter for the current color. - * - * @method color - * @param {String} [color] Color to set. - * @return {String|tinymce.ui.ColorButton} Current color or current instance. - */ - color: function(color) { - if (color) { - this._color = color; - this.getEl('preview').style.backgroundColor = color; - return this; - } - - return this._color; - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, id = self._id, prefix = self.classPrefix; - var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : ''; - var image = self.settings.image ? ' style="background-image: url(\'' + self.settings.image + '\')"' : ''; - - return ( - '
    ' + - '' + - '' + - '
    ' - ); - }, - - /** - * Called after the control has been rendered. - * - * @method postRender - */ - postRender: function() { - var self = this, onClickHandler = self.settings.onclick; - - self.on('click', function(e) { - if (e.aria && e.aria.key == 'down') { - return; - } - - if (e.control == self && !DOM.getParent(e.target, '.' + self.classPrefix + 'open')) { - e.stopImmediatePropagation(); - onClickHandler.call(self, e); - } - }); - - delete self.settings.onclick; - - return self._super(); - } - - }); -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/ComboBox.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/ComboBox.js deleted file mode 100755 index c174bf67c6d8..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/ComboBox.js +++ /dev/null @@ -1,332 +0,0 @@ -/** - * ComboBox.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class creates a combobox control. Select box that you select a value from or - * type a value into. - * - * @-x-less ComboBox.less - * @class tinymce.ui.ComboBox - * @extends tinymce.ui.Widget - */ -define("tinymce/ui/ComboBox", [ - "tinymce/ui/Widget", - "tinymce/ui/Factory", - "tinymce/ui/DomUtils" -], function(Widget, Factory, DomUtils) { - "use strict"; - - return Widget.extend({ - /** - * Constructs a new control instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - * @setting {String} placeholder Placeholder text to display. - */ - init: function(settings) { - var self = this; - - self._super(settings); - self.addClass('combobox'); - self.subinput = true; - self.ariaTarget = 'inp'; // TODO: Figure out a better way - - settings = self.settings; - settings.menu = settings.menu || settings.values; - - if (settings.menu) { - settings.icon = 'caret'; - } - - self.on('click', function(e) { - var elm = e.target, root = self.getEl(); - - while (elm && elm != root) { - if (elm.id && elm.id.indexOf('-open') != -1) { - self.fire('action'); - - if (settings.menu) { - self.showMenu(); - - if (e.aria) { - self.menu.items()[0].focus(); - } - } - } - - elm = elm.parentNode; - } - }); - - // TODO: Rework this - self.on('keydown', function(e) { - if (e.target.nodeName == "INPUT" && e.keyCode == 13) { - self.parents().reverse().each(function(ctrl) { - e.preventDefault(); - self.fire('change'); - - if (ctrl.hasEventListeners('submit') && ctrl.toJSON) { - ctrl.fire('submit', {data: ctrl.toJSON()}); - return false; - } - }); - } - }); - - if (settings.placeholder) { - self.addClass('placeholder'); - - self.on('focusin', function() { - if (!self._hasOnChange) { - DomUtils.on(self.getEl('inp'), 'change', function() { - self.fire('change'); - }); - - self._hasOnChange = true; - } - - if (self.hasClass('placeholder')) { - self.getEl('inp').value = ''; - self.removeClass('placeholder'); - } - }); - - self.on('focusout', function() { - if (self.value().length === 0) { - self.getEl('inp').value = settings.placeholder; - self.addClass('placeholder'); - } - }); - } - }, - - showMenu: function() { - var self = this, settings = self.settings, menu; - - if (!self.menu) { - menu = settings.menu || []; - - // Is menu array then auto constuct menu control - if (menu.length) { - menu = { - type: 'menu', - items: menu - }; - } else { - menu.type = menu.type || 'menu'; - } - - self.menu = Factory.create(menu).parent(self).renderTo(self.getContainerElm()); - self.fire('createmenu'); - self.menu.reflow(); - self.menu.on('cancel', function(e) { - if (e.control === self.menu) { - self.focus(); - } - }); - - self.menu.on('show hide', function(e) { - e.control.items().each(function(ctrl) { - ctrl.active(ctrl.value() == self.value()); - }); - }).fire('show'); - - self.menu.on('select', function(e) { - self.value(e.control.value()); - }); - - self.on('focusin', function(e) { - if (e.target.tagName == 'INPUT') { - self.menu.hide(); - } - }); - - self.aria('expanded', true); - } - - self.menu.show(); - self.menu.layoutRect({w: self.layoutRect().w}); - self.menu.moveRel(self.getEl(), self.isRtl() ? ['br-tr', 'tr-br'] : ['bl-tl', 'tl-bl']); - }, - - /** - * Getter/setter function for the control value. - * - * @method value - * @param {String} [value] Value to be set. - * @return {String|tinymce.ui.ComboBox} Value or self if it's a set operation. - */ - value: function(value) { - var self = this; - - if (typeof(value) != "undefined") { - self._value = value; - self.removeClass('placeholder'); - - if (self._rendered) { - self.getEl('inp').value = value; - } - - return self; - } - - if (self._rendered) { - value = self.getEl('inp').value; - - if (value != self.settings.placeholder) { - return value; - } - - return ''; - } - - return self._value; - }, - - /** - * Getter/setter function for the disabled state. - * - * @method value - * @param {Boolean} [state] State to be set. - * @return {Boolean|tinymce.ui.ComboBox} True/false or self if it's a set operation. - */ - disabled: function(state) { - var self = this; - - if (self._rendered && typeof(state) != 'undefined') { - self.getEl('inp').disabled = state; - } - - return self._super(state); - }, - - /** - * Focuses the input area of the control. - * - * @method focus - */ - focus: function() { - this.getEl('inp').focus(); - }, - - /** - * Repaints the control after a layout operation. - * - * @method repaint - */ - repaint: function() { - var self = this, elm = self.getEl(), openElm = self.getEl('open'), rect = self.layoutRect(); - var width, lineHeight; - - if (openElm) { - width = rect.w - DomUtils.getSize(openElm).width - 10; - } else { - width = rect.w - 10; - } - - // Detect old IE 7+8 add lineHeight to align caret vertically in the middle - var doc = document; - if (doc.all && (!doc.documentMode || doc.documentMode <= 8)) { - lineHeight = (self.layoutRect().h - 2) + 'px'; - } - - DomUtils.css(elm.firstChild, { - width: width, - lineHeight: lineHeight - }); - - self._super(); - - return self; - }, - - /** - * Post render method. Called after the control has been rendered to the target. - * - * @method postRender - * @return {tinymce.ui.ComboBox} Current combobox instance. - */ - postRender: function() { - var self = this; - - DomUtils.on(this.getEl('inp'), 'change', function() { - self.fire('change'); - }); - - return self._super(); - }, - - remove: function() { - DomUtils.off(this.getEl('inp')); - this._super(); - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, id = self._id, settings = self.settings, prefix = self.classPrefix; - var value = settings.value || settings.placeholder || ''; - var icon, text, openBtnHtml = '', extraAttrs = ''; - - if ("spellcheck" in settings) { - extraAttrs += ' spellcheck="' + settings.spellcheck + '"'; - } - - if (settings.maxLength) { - extraAttrs += ' maxlength="' + settings.maxLength + '"'; - } - - if (settings.size) { - extraAttrs += ' size="' + settings.size + '"'; - } - - if (settings.subtype) { - extraAttrs += ' type="' + settings.subtype + '"'; - } - - if (self.disabled()) { - extraAttrs += ' disabled="disabled"'; - } - - icon = settings.icon; - if (icon && icon != 'caret') { - icon = prefix + 'ico ' + prefix + 'i-' + settings.icon; - } - - text = self._text; - - if (icon || text) { - openBtnHtml = ( - '
    ' + - '' + - '
    ' - ); - - self.addClass('has-open'); - } - - return ( - '
    ' + - '' + - openBtnHtml + - '
    ' - ); - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Container.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Container.js deleted file mode 100755 index f47ae9fc66e1..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Container.js +++ /dev/null @@ -1,495 +0,0 @@ -/** - * Container.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Container control. This is extended by all controls that can have - * children such as panels etc. You can also use this class directly as an - * generic container instance. The container doesn't have any specific role or style. - * - * @-x-less Container.less - * @class tinymce.ui.Container - * @extends tinymce.ui.Control - */ -define("tinymce/ui/Container", [ - "tinymce/ui/Control", - "tinymce/ui/Collection", - "tinymce/ui/Selector", - "tinymce/ui/Factory", - "tinymce/ui/KeyboardNavigation", - "tinymce/util/Tools", - "tinymce/ui/DomUtils" -], function(Control, Collection, Selector, Factory, KeyboardNavigation, Tools, DomUtils) { - "use strict"; - - var selectorCache = {}; - - return Control.extend({ - layout: '', - innerClass: 'container-inner', - - /** - * Constructs a new control instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - * @setting {Array} items Items to add to container in JSON format or control instances. - * @setting {String} layout Layout manager by name to use. - * @setting {Object} defaults Default settings to apply to all items. - */ - init: function(settings) { - var self = this; - - self._super(settings); - settings = self.settings; - self._fixed = settings.fixed; - self._items = new Collection(); - - if (self.isRtl()) { - self.addClass('rtl'); - } - - self.addClass('container'); - self.addClass('container-body', 'body'); - - if (settings.containerCls) { - self.addClass(settings.containerCls); - } - - self._layout = Factory.create((settings.layout || self.layout) + 'layout'); - - if (self.settings.items) { - self.add(self.settings.items); - } - - // TODO: Fix this! - self._hasBody = true; - }, - - /** - * Returns a collection of child items that the container currently have. - * - * @method items - * @return {tinymce.ui.Collection} Control collection direct child controls. - */ - items: function() { - return this._items; - }, - - /** - * Find child controls by selector. - * - * @method find - * @param {String} selector Selector CSS pattern to find children by. - * @return {tinymce.ui.Collection} Control collection with child controls. - */ - find: function(selector) { - selector = selectorCache[selector] = selectorCache[selector] || new Selector(selector); - - return selector.find(this); - }, - - /** - * Adds one or many items to the current container. This will create instances of - * the object representations if needed. - * - * @method add - * @param {Array/Object/tinymce.ui.Control} items Array or item that will be added to the container. - * @return {tinymce.ui.Collection} Current collection control. - */ - add: function(items) { - var self = this; - - self.items().add(self.create(items)).parent(self); - - return self; - }, - - /** - * Focuses the current container instance. This will look - * for the first control in the container and focus that. - * - * @method focus - * @param {Boolean} keyboard Optional true/false if the focus was a keyboard focus or not. - * @return {tinymce.ui.Collection} Current instance. - */ - focus: function(keyboard) { - var self = this, focusCtrl, keyboardNav, items; - - if (keyboard) { - keyboardNav = self.keyboardNav || self.parents().eq(-1)[0].keyboardNav; - - if (keyboardNav) { - keyboardNav.focusFirst(self); - return; - } - } - - items = self.find('*'); - - // TODO: Figure out a better way to auto focus alert dialog buttons - if (self.statusbar) { - items.add(self.statusbar.items()); - } - - items.each(function(ctrl) { - if (ctrl.settings.autofocus) { - focusCtrl = null; - return false; - } - - if (ctrl.canFocus) { - focusCtrl = focusCtrl || ctrl; - } - }); - - if (focusCtrl) { - focusCtrl.focus(); - } - - return self; - }, - - /** - * Replaces the specified child control with a new control. - * - * @method replace - * @param {tinymce.ui.Control} oldItem Old item to be replaced. - * @param {tinymce.ui.Control} newItem New item to be inserted. - */ - replace: function(oldItem, newItem) { - var ctrlElm, items = this.items(), i = items.length; - - // Replace the item in collection - while (i--) { - if (items[i] === oldItem) { - items[i] = newItem; - break; - } - } - - if (i >= 0) { - // Remove new item from DOM - ctrlElm = newItem.getEl(); - if (ctrlElm) { - ctrlElm.parentNode.removeChild(ctrlElm); - } - - // Remove old item from DOM - ctrlElm = oldItem.getEl(); - if (ctrlElm) { - ctrlElm.parentNode.removeChild(ctrlElm); - } - } - - // Adopt the item - newItem.parent(this); - }, - - /** - * Creates the specified items. If any of the items is plain JSON style objects - * it will convert these into real tinymce.ui.Control instances. - * - * @method create - * @param {Array} items Array of items to convert into control instances. - * @return {Array} Array with control instances. - */ - create: function(items) { - var self = this, settings, ctrlItems = []; - - // Non array structure, then force it into an array - if (!Tools.isArray(items)) { - items = [items]; - } - - // Add default type to each child control - Tools.each(items, function(item) { - if (item) { - // Construct item if needed - if (!(item instanceof Control)) { - // Name only then convert it to an object - if (typeof(item) == "string") { - item = {type: item}; - } - - // Create control instance based on input settings and default settings - settings = Tools.extend({}, self.settings.defaults, item); - item.type = settings.type = settings.type || item.type || self.settings.defaultType || - (settings.defaults ? settings.defaults.type : null); - item = Factory.create(settings); - } - - ctrlItems.push(item); - } - }); - - return ctrlItems; - }, - - /** - * Renders new control instances. - * - * @private - */ - renderNew: function() { - var self = this; - - // Render any new items - self.items().each(function(ctrl, index) { - var containerElm, fragment; - - ctrl.parent(self); - - if (!ctrl._rendered) { - containerElm = self.getEl('body'); - fragment = DomUtils.createFragment(ctrl.renderHtml()); - - // Insert or append the item - if (containerElm.hasChildNodes() && index <= containerElm.childNodes.length - 1) { - containerElm.insertBefore(fragment, containerElm.childNodes[index]); - } else { - containerElm.appendChild(fragment); - } - - ctrl.postRender(); - } - }); - - self._layout.applyClasses(self); - self._lastRect = null; - - return self; - }, - - /** - * Appends new instances to the current container. - * - * @method append - * @param {Array/tinymce.ui.Collection} items Array if controls to append. - * @return {tinymce.ui.Container} Current container instance. - */ - append: function(items) { - return this.add(items).renderNew(); - }, - - /** - * Prepends new instances to the current container. - * - * @method prepend - * @param {Array/tinymce.ui.Collection} items Array if controls to prepend. - * @return {tinymce.ui.Container} Current container instance. - */ - prepend: function(items) { - var self = this; - - self.items().set(self.create(items).concat(self.items().toArray())); - - return self.renderNew(); - }, - - /** - * Inserts an control at a specific index. - * - * @method insert - * @param {Array/tinymce.ui.Collection} items Array if controls to insert. - * @param {Number} index Index to insert controls at. - * @param {Boolean} [before=false] Inserts controls before the index. - */ - insert: function(items, index, before) { - var self = this, curItems, beforeItems, afterItems; - - items = self.create(items); - curItems = self.items(); - - if (!before && index < curItems.length - 1) { - index += 1; - } - - if (index >= 0 && index < curItems.length) { - beforeItems = curItems.slice(0, index).toArray(); - afterItems = curItems.slice(index).toArray(); - curItems.set(beforeItems.concat(items, afterItems)); - } - - return self.renderNew(); - }, - - /** - * Populates the form fields from the specified JSON data object. - * - * Control items in the form that matches the data will have it's value set. - * - * @method fromJSON - * @param {Object} data JSON data object to set control values by. - * @return {tinymce.ui.Container} Current form instance. - */ - fromJSON: function(data) { - var self = this; - - for (var name in data) { - self.find('#' + name).value(data[name]); - } - - return self; - }, - - /** - * Serializes the form into a JSON object by getting all items - * that has a name and a value. - * - * @method toJSON - * @return {Object} JSON object with form data. - */ - toJSON: function() { - var self = this, data = {}; - - self.find('*').each(function(ctrl) { - var name = ctrl.name(), value = ctrl.value(); - - if (name && typeof(value) != "undefined") { - data[name] = value; - } - }); - - return data; - }, - - preRender: function() { - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, layout = self._layout, role = this.settings.role; - - self.preRender(); - layout.preRender(self); - - return ( - '
    ' + - '
    ' + - (self.settings.html || '') + layout.renderHtml(self) + - '
    ' + - '
    ' - ); - }, - - /** - * Post render method. Called after the control has been rendered to the target. - * - * @method postRender - * @return {tinymce.ui.Container} Current combobox instance. - */ - postRender: function() { - var self = this, box; - - self.items().exec('postRender'); - self._super(); - - self._layout.postRender(self); - self._rendered = true; - - if (self.settings.style) { - DomUtils.css(self.getEl(), self.settings.style); - } - - if (self.settings.border) { - box = self.borderBox(); - DomUtils.css(self.getEl(), { - 'border-top-width': box.top, - 'border-right-width': box.right, - 'border-bottom-width': box.bottom, - 'border-left-width': box.left - }); - } - - if (!self.parent()) { - self.keyboardNav = new KeyboardNavigation({ - root: self - }); - } - - return self; - }, - - /** - * Initializes the current controls layout rect. - * This will be executed by the layout managers to determine the - * default minWidth/minHeight etc. - * - * @method initLayoutRect - * @return {Object} Layout rect instance. - */ - initLayoutRect: function() { - var self = this, layoutRect = self._super(); - - // Recalc container size by asking layout manager - self._layout.recalc(self); - - return layoutRect; - }, - - /** - * Recalculates the positions of the controls in the current container. - * This is invoked by the reflow method and shouldn't be called directly. - * - * @method recalc - */ - recalc: function() { - var self = this, rect = self._layoutRect, lastRect = self._lastRect; - - if (!lastRect || lastRect.w != rect.w || lastRect.h != rect.h) { - self._layout.recalc(self); - rect = self.layoutRect(); - self._lastRect = {x: rect.x, y: rect.y, w: rect.w, h: rect.h}; - return true; - } - }, - - /** - * Reflows the current container and it's children and possible parents. - * This should be used after you for example append children to the current control so - * that the layout managers know that they need to reposition everything. - * - * @example - * container.append({type: 'button', text: 'My button'}).reflow(); - * - * @method reflow - * @return {tinymce.ui.Container} Current container instance. - */ - reflow: function() { - var i; - - if (this.visible()) { - Control.repaintControls = []; - Control.repaintControls.map = {}; - - this.recalc(); - i = Control.repaintControls.length; - - while (i--) { - Control.repaintControls[i].repaint(); - } - - // TODO: Fix me! - if (this.settings.layout !== "flow" && this.settings.layout !== "stack") { - this.repaint(); - } - - Control.repaintControls = []; - } - - return this; - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Control.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Control.js deleted file mode 100755 index 599916f22974..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Control.js +++ /dev/null @@ -1,1559 +0,0 @@ -/** - * Control.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*eslint consistent-this:0 */ - -/** - * This is the base class for all controls and containers. All UI control instances inherit - * from this one as it has the base logic needed by all of them. - * - * @class tinymce.ui.Control - */ -define("tinymce/ui/Control", [ - "tinymce/util/Class", - "tinymce/util/Tools", - "tinymce/ui/Collection", - "tinymce/ui/DomUtils" -], function(Class, Tools, Collection, DomUtils) { - "use strict"; - - var nativeEvents = Tools.makeMap("focusin focusout scroll click dblclick mousedown mouseup mousemove mouseover" + - " mouseout mouseenter mouseleave wheel keydown keypress keyup contextmenu", " "); - - var elementIdCache = {}; - var hasMouseWheelEventSupport = "onmousewheel" in document; - var hasWheelEventSupport = false; - - var Control = Class.extend({ - Statics: { - elementIdCache: elementIdCache - }, - - isRtl: function() { - return Control.rtl; - }, - - /** - * Class/id prefix to use for all controls. - * - * @final - * @field {String} classPrefix - */ - classPrefix: "mce-", - - /** - * Constructs a new control instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - * @setting {String} style Style CSS properties to add. - * @setting {String} border Border box values example: 1 1 1 1 - * @setting {String} padding Padding box values example: 1 1 1 1 - * @setting {String} margin Margin box values example: 1 1 1 1 - * @setting {Number} minWidth Minimal width for the control. - * @setting {Number} minHeight Minimal height for the control. - * @setting {String} classes Space separated list of classes to add. - * @setting {String} role WAI-ARIA role to use for control. - * @setting {Boolean} hidden Is the control hidden by default. - * @setting {Boolean} disabled Is the control disabled by default. - * @setting {String} name Name of the control instance. - */ - init: function(settings) { - var self = this, classes, i; - - self.settings = settings = Tools.extend({}, self.Defaults, settings); - - // Initial states - self._id = settings.id || DomUtils.id(); - self._text = self._name = ''; - self._width = self._height = 0; - self._aria = {role: settings.role}; - - // Setup classes - classes = settings.classes; - if (classes) { - classes = classes.split(' '); - classes.map = {}; - i = classes.length; - while (i--) { - classes.map[classes[i]] = true; - } - } - - self._classes = classes || []; - self.visible(true); - - // Set some properties - Tools.each('title text width height name classes visible disabled active value'.split(' '), function(name) { - var value = settings[name], undef; - - if (value !== undef) { - self[name](value); - } else if (self['_' + name] === undef) { - self['_' + name] = false; - } - }); - - self.on('click', function() { - if (self.disabled()) { - return false; - } - }); - - // TODO: Is this needed duplicate code see above? - if (settings.classes) { - Tools.each(settings.classes.split(' '), function(cls) { - self.addClass(cls); - }); - } - - /** - * Name/value object with settings for the current control. - * - * @field {Object} settings - */ - self.settings = settings; - - self._borderBox = self.parseBox(settings.border); - self._paddingBox = self.parseBox(settings.padding); - self._marginBox = self.parseBox(settings.margin); - - if (settings.hidden) { - self.hide(); - } - }, - - // Will generate getter/setter methods for these properties - Properties: 'parent,title,text,width,height,disabled,active,name,value', - - // Will generate empty dummy functions for these - Methods: 'renderHtml', - - /** - * Returns the root element to render controls into. - * - * @method getContainerElm - * @return {Element} HTML DOM element to render into. - */ - getContainerElm: function() { - return document.body; - }, - - /** - * Returns a control instance for the current DOM element. - * - * @method getParentCtrl - * @param {Element} elm HTML dom element to get parent control from. - * @return {tinymce.ui.Control} Control instance or undefined. - */ - getParentCtrl: function(elm) { - var ctrl, lookup = this.getRoot().controlIdLookup; - - while (elm && lookup) { - ctrl = lookup[elm.id]; - if (ctrl) { - break; - } - - elm = elm.parentNode; - } - - return ctrl; - }, - - /** - * Parses the specified box value. A box value contains 1-4 properties in clockwise order. - * - * @method parseBox - * @param {String/Number} value Box value "0 1 2 3" or "0" etc. - * @return {Object} Object with top/right/bottom/left properties. - * @private - */ - parseBox: function(value) { - var len, radix = 10; - - if (!value) { - return; - } - - if (typeof(value) === "number") { - value = value || 0; - - return { - top: value, - left: value, - bottom: value, - right: value - }; - } - - value = value.split(' '); - len = value.length; - - if (len === 1) { - value[1] = value[2] = value[3] = value[0]; - } else if (len === 2) { - value[2] = value[0]; - value[3] = value[1]; - } else if (len === 3) { - value[3] = value[1]; - } - - return { - top: parseInt(value[0], radix) || 0, - right: parseInt(value[1], radix) || 0, - bottom: parseInt(value[2], radix) || 0, - left: parseInt(value[3], radix) || 0 - }; - }, - - borderBox: function() { - return this._borderBox; - }, - - paddingBox: function() { - return this._paddingBox; - }, - - marginBox: function() { - return this._marginBox; - }, - - measureBox: function(elm, prefix) { - function getStyle(name) { - var defaultView = document.defaultView; - - if (defaultView) { - // Remove camelcase - name = name.replace(/[A-Z]/g, function(a) { - return '-' + a; - }); - - return defaultView.getComputedStyle(elm, null).getPropertyValue(name); - } - - return elm.currentStyle[name]; - } - - function getSide(name) { - var val = parseFloat(getStyle(name), 10); - - return isNaN(val) ? 0 : val; - } - - return { - top: getSide(prefix + "TopWidth"), - right: getSide(prefix + "RightWidth"), - bottom: getSide(prefix + "BottomWidth"), - left: getSide(prefix + "LeftWidth") - }; - }, - - /** - * Initializes the current controls layout rect. - * This will be executed by the layout managers to determine the - * default minWidth/minHeight etc. - * - * @method initLayoutRect - * @return {Object} Layout rect instance. - */ - initLayoutRect: function() { - var self = this, settings = self.settings, borderBox, layoutRect; - var elm = self.getEl(), width, height, minWidth, minHeight, autoResize; - var startMinWidth, startMinHeight, initialSize; - - // Measure the current element - borderBox = self._borderBox = self._borderBox || self.measureBox(elm, 'border'); - self._paddingBox = self._paddingBox || self.measureBox(elm, 'padding'); - self._marginBox = self._marginBox || self.measureBox(elm, 'margin'); - initialSize = DomUtils.getSize(elm); - - // Setup minWidth/minHeight and width/height - startMinWidth = settings.minWidth; - startMinHeight = settings.minHeight; - minWidth = startMinWidth || initialSize.width; - minHeight = startMinHeight || initialSize.height; - width = settings.width; - height = settings.height; - autoResize = settings.autoResize; - autoResize = typeof(autoResize) != "undefined" ? autoResize : !width && !height; - - width = width || minWidth; - height = height || minHeight; - - var deltaW = borderBox.left + borderBox.right; - var deltaH = borderBox.top + borderBox.bottom; - - var maxW = settings.maxWidth || 0xFFFF; - var maxH = settings.maxHeight || 0xFFFF; - - // Setup initial layout rect - self._layoutRect = layoutRect = { - x: settings.x || 0, - y: settings.y || 0, - w: width, - h: height, - deltaW: deltaW, - deltaH: deltaH, - contentW: width - deltaW, - contentH: height - deltaH, - innerW: width - deltaW, - innerH: height - deltaH, - startMinWidth: startMinWidth || 0, - startMinHeight: startMinHeight || 0, - minW: Math.min(minWidth, maxW), - minH: Math.min(minHeight, maxH), - maxW: maxW, - maxH: maxH, - autoResize: autoResize, - scrollW: 0 - }; - - self._lastLayoutRect = {}; - - return layoutRect; - }, - - /** - * Getter/setter for the current layout rect. - * - * @method layoutRect - * @param {Object} [newRect] Optional new layout rect. - * @return {tinymce.ui.Control/Object} Current control or rect object. - */ - layoutRect: function(newRect) { - var self = this, curRect = self._layoutRect, lastLayoutRect, size, deltaWidth, deltaHeight, undef, repaintControls; - - // Initialize default layout rect - if (!curRect) { - curRect = self.initLayoutRect(); - } - - // Set new rect values - if (newRect) { - // Calc deltas between inner and outer sizes - deltaWidth = curRect.deltaW; - deltaHeight = curRect.deltaH; - - // Set x position - if (newRect.x !== undef) { - curRect.x = newRect.x; - } - - // Set y position - if (newRect.y !== undef) { - curRect.y = newRect.y; - } - - // Set minW - if (newRect.minW !== undef) { - curRect.minW = newRect.minW; - } - - // Set minH - if (newRect.minH !== undef) { - curRect.minH = newRect.minH; - } - - // Set new width and calculate inner width - size = newRect.w; - if (size !== undef) { - size = size < curRect.minW ? curRect.minW : size; - size = size > curRect.maxW ? curRect.maxW : size; - curRect.w = size; - curRect.innerW = size - deltaWidth; - } - - // Set new height and calculate inner height - size = newRect.h; - if (size !== undef) { - size = size < curRect.minH ? curRect.minH : size; - size = size > curRect.maxH ? curRect.maxH : size; - curRect.h = size; - curRect.innerH = size - deltaHeight; - } - - // Set new inner width and calculate width - size = newRect.innerW; - if (size !== undef) { - size = size < curRect.minW - deltaWidth ? curRect.minW - deltaWidth : size; - size = size > curRect.maxW - deltaWidth ? curRect.maxW - deltaWidth : size; - curRect.innerW = size; - curRect.w = size + deltaWidth; - } - - // Set new height and calculate inner height - size = newRect.innerH; - if (size !== undef) { - size = size < curRect.minH - deltaHeight ? curRect.minH - deltaHeight : size; - size = size > curRect.maxH - deltaHeight ? curRect.maxH - deltaHeight : size; - curRect.innerH = size; - curRect.h = size + deltaHeight; - } - - // Set new contentW - if (newRect.contentW !== undef) { - curRect.contentW = newRect.contentW; - } - - // Set new contentH - if (newRect.contentH !== undef) { - curRect.contentH = newRect.contentH; - } - - // Compare last layout rect with the current one to see if we need to repaint or not - lastLayoutRect = self._lastLayoutRect; - if (lastLayoutRect.x !== curRect.x || lastLayoutRect.y !== curRect.y || - lastLayoutRect.w !== curRect.w || lastLayoutRect.h !== curRect.h) { - repaintControls = Control.repaintControls; - - if (repaintControls) { - if (repaintControls.map && !repaintControls.map[self._id]) { - repaintControls.push(self); - repaintControls.map[self._id] = true; - } - } - - lastLayoutRect.x = curRect.x; - lastLayoutRect.y = curRect.y; - lastLayoutRect.w = curRect.w; - lastLayoutRect.h = curRect.h; - } - - return self; - } - - return curRect; - }, - - /** - * Repaints the control after a layout operation. - * - * @method repaint - */ - repaint: function() { - var self = this, style, bodyStyle, rect, borderBox, borderW = 0, borderH = 0, lastRepaintRect, round; - - // Use Math.round on all values on IE < 9 - round = !document.createRange ? Math.round : function(value) { - return value; - }; - - style = self.getEl().style; - rect = self._layoutRect; - lastRepaintRect = self._lastRepaintRect || {}; - - borderBox = self._borderBox; - borderW = borderBox.left + borderBox.right; - borderH = borderBox.top + borderBox.bottom; - - if (rect.x !== lastRepaintRect.x) { - style.left = round(rect.x) + 'px'; - lastRepaintRect.x = rect.x; - } - - if (rect.y !== lastRepaintRect.y) { - style.top = round(rect.y) + 'px'; - lastRepaintRect.y = rect.y; - } - - if (rect.w !== lastRepaintRect.w) { - style.width = round(rect.w - borderW) + 'px'; - lastRepaintRect.w = rect.w; - } - - if (rect.h !== lastRepaintRect.h) { - style.height = round(rect.h - borderH) + 'px'; - lastRepaintRect.h = rect.h; - } - - // Update body if needed - if (self._hasBody && rect.innerW !== lastRepaintRect.innerW) { - bodyStyle = self.getEl('body').style; - bodyStyle.width = round(rect.innerW) + 'px'; - lastRepaintRect.innerW = rect.innerW; - } - - if (self._hasBody && rect.innerH !== lastRepaintRect.innerH) { - bodyStyle = bodyStyle || self.getEl('body').style; - bodyStyle.height = round(rect.innerH) + 'px'; - lastRepaintRect.innerH = rect.innerH; - } - - self._lastRepaintRect = lastRepaintRect; - self.fire('repaint', {}, false); - }, - - /** - * Binds a callback to the specified event. This event can both be - * native browser events like "click" or custom ones like PostRender. - * - * The callback function will be passed a DOM event like object that enables yout do stop propagation. - * - * @method on - * @param {String} name Name of the event to bind. For example "click". - * @param {String/function} callback Callback function to execute ones the event occurs. - * @return {tinymce.ui.Control} Current control object. - */ - on: function(name, callback) { - var self = this, bindings, handlers, names, i; - - function resolveCallbackName(name) { - var callback, scope; - - return function(e) { - if (!callback) { - self.parents().each(function(ctrl) { - var callbacks = ctrl.settings.callbacks; - - if (callbacks && (callback = callbacks[name])) { - scope = ctrl; - return false; - } - }); - } - - return callback.call(scope, e); - }; - } - - if (callback) { - if (typeof(callback) == 'string') { - callback = resolveCallbackName(callback); - } - - names = name.toLowerCase().split(' '); - i = names.length; - while (i--) { - name = names[i]; - - bindings = self._bindings; - if (!bindings) { - bindings = self._bindings = {}; - } - - handlers = bindings[name]; - if (!handlers) { - handlers = bindings[name] = []; - } - - handlers.push(callback); - - if (nativeEvents[name]) { - if (!self._nativeEvents) { - self._nativeEvents = {name: true}; - } else { - self._nativeEvents[name] = true; - } - - if (self._rendered) { - self.bindPendingEvents(); - } - } - } - } - - return self; - }, - - /** - * Unbinds the specified event and optionally a specific callback. If you omit the name - * parameter all event handlers will be removed. If you omit the callback all event handles - * by the specified name will be removed. - * - * @method off - * @param {String} [name] Name for the event to unbind. - * @param {function} [callback] Callback function to unbind. - * @return {mxex.ui.Control} Current control object. - */ - off: function(name, callback) { - var self = this, i, bindings = self._bindings, handlers, bindingName, names, hi; - - if (bindings) { - if (name) { - names = name.toLowerCase().split(' '); - i = names.length; - while (i--) { - name = names[i]; - handlers = bindings[name]; - - // Unbind all handlers - if (!name) { - for (bindingName in bindings) { - bindings[bindingName].length = 0; - } - - return self; - } - - if (handlers) { - // Unbind all by name - if (!callback) { - handlers.length = 0; - } else { - // Unbind specific ones - hi = handlers.length; - while (hi--) { - if (handlers[hi] === callback) { - handlers.splice(hi, 1); - } - } - } - } - } - } else { - self._bindings = []; - } - } - - return self; - }, - - /** - * Fires the specified event by name and arguments on the control. This will execute all - * bound event handlers. - * - * @method fire - * @param {String} name Name of the event to fire. - * @param {Object} [args] Arguments to pass to the event. - * @param {Boolean} [bubble] Value to control bubbeling. Defaults to true. - * @return {Object} Current arguments object. - */ - fire: function(name, args, bubble) { - var self = this, i, l, handlers, parentCtrl; - - name = name.toLowerCase(); - - // Dummy function that gets replaced on the delegation state functions - function returnFalse() { - return false; - } - - // Dummy function that gets replaced on the delegation state functions - function returnTrue() { - return true; - } - - // Setup empty object if args is omited - args = args || {}; - - // Stick type into event object - if (!args.type) { - args.type = name; - } - - // Stick control into event - if (!args.control) { - args.control = self; - } - - // Add event delegation methods if they are missing - if (!args.preventDefault) { - // Add preventDefault method - args.preventDefault = function() { - args.isDefaultPrevented = returnTrue; - }; - - // Add stopPropagation - args.stopPropagation = function() { - args.isPropagationStopped = returnTrue; - }; - - // Add stopImmediatePropagation - args.stopImmediatePropagation = function() { - args.isImmediatePropagationStopped = returnTrue; - }; - - // Add event delegation states - args.isDefaultPrevented = returnFalse; - args.isPropagationStopped = returnFalse; - args.isImmediatePropagationStopped = returnFalse; - } - - if (self._bindings) { - handlers = self._bindings[name]; - - if (handlers) { - for (i = 0, l = handlers.length; i < l; i++) { - // Execute callback and break if the callback returns a false - if (!args.isImmediatePropagationStopped() && handlers[i].call(self, args) === false) { - break; - } - } - } - } - - // Bubble event up to parent controls - if (bubble !== false) { - parentCtrl = self.parent(); - while (parentCtrl && !args.isPropagationStopped()) { - parentCtrl.fire(name, args, false); - parentCtrl = parentCtrl.parent(); - } - } - - return args; - }, - - /** - * Returns true/false if the specified event has any listeners. - * - * @method hasEventListeners - * @param {String} name Name of the event to check for. - * @return {Boolean} True/false state if the event has listeners. - */ - hasEventListeners: function(name) { - return name in this._bindings; - }, - - /** - * Returns a control collection with all parent controls. - * - * @method parents - * @param {String} selector Optional selector expression to find parents. - * @return {tinymce.ui.Collection} Collection with all parent controls. - */ - parents: function(selector) { - var self = this, ctrl, parents = new Collection(); - - // Add each parent to collection - for (ctrl = self.parent(); ctrl; ctrl = ctrl.parent()) { - parents.add(ctrl); - } - - // Filter away everything that doesn't match the selector - if (selector) { - parents = parents.filter(selector); - } - - return parents; - }, - - /** - * Returns the control next to the current control. - * - * @method next - * @return {tinymce.ui.Control} Next control instance. - */ - next: function() { - var parentControls = this.parent().items(); - - return parentControls[parentControls.indexOf(this) + 1]; - }, - - /** - * Returns the control previous to the current control. - * - * @method prev - * @return {tinymce.ui.Control} Previous control instance. - */ - prev: function() { - var parentControls = this.parent().items(); - - return parentControls[parentControls.indexOf(this) - 1]; - }, - - /** - * Find the common ancestor for two control instances. - * - * @method findCommonAncestor - * @param {tinymce.ui.Control} ctrl1 First control. - * @param {tinymce.ui.Control} ctrl2 Second control. - * @return {tinymce.ui.Control} Ancestor control instance. - */ - findCommonAncestor: function(ctrl1, ctrl2) { - var parentCtrl; - - while (ctrl1) { - parentCtrl = ctrl2; - - while (parentCtrl && ctrl1 != parentCtrl) { - parentCtrl = parentCtrl.parent(); - } - - if (ctrl1 == parentCtrl) { - break; - } - - ctrl1 = ctrl1.parent(); - } - - return ctrl1; - }, - - /** - * Returns true/false if the specific control has the specific class. - * - * @method hasClass - * @param {String} cls Class to check for. - * @param {String} [group] Sub element group name. - * @return {Boolean} True/false if the control has the specified class. - */ - hasClass: function(cls, group) { - var classes = this._classes[group || 'control']; - - cls = this.classPrefix + cls; - - return classes && !!classes.map[cls]; - }, - - /** - * Adds the specified class to the control - * - * @method addClass - * @param {String} cls Class to check for. - * @param {String} [group] Sub element group name. - * @return {tinymce.ui.Control} Current control object. - */ - addClass: function(cls, group) { - var self = this, classes, elm; - - cls = this.classPrefix + cls; - classes = self._classes[group || 'control']; - - if (!classes) { - classes = []; - classes.map = {}; - self._classes[group || 'control'] = classes; - } - - if (!classes.map[cls]) { - classes.map[cls] = cls; - classes.push(cls); - - if (self._rendered) { - elm = self.getEl(group); - - if (elm) { - elm.className = classes.join(' '); - } - } - } - - return self; - }, - - /** - * Removes the specified class from the control. - * - * @method removeClass - * @param {String} cls Class to remove. - * @param {String} [group] Sub element group name. - * @return {tinymce.ui.Control} Current control object. - */ - removeClass: function(cls, group) { - var self = this, classes, i, elm; - - cls = this.classPrefix + cls; - classes = self._classes[group || 'control']; - if (classes && classes.map[cls]) { - delete classes.map[cls]; - - i = classes.length; - while (i--) { - if (classes[i] === cls) { - classes.splice(i, 1); - } - } - } - - if (self._rendered) { - elm = self.getEl(group); - - if (elm) { - elm.className = classes.join(' '); - } - } - - return self; - }, - - /** - * Toggles the specified class on the control. - * - * @method toggleClass - * @param {String} cls Class to remove. - * @param {Boolean} state True/false state to add/remove class. - * @param {String} [group] Sub element group name. - * @return {tinymce.ui.Control} Current control object. - */ - toggleClass: function(cls, state, group) { - var self = this; - - if (state) { - self.addClass(cls, group); - } else { - self.removeClass(cls, group); - } - - return self; - }, - - /** - * Returns the class string for the specified group name. - * - * @method classes - * @param {String} [group] Group to get clases by. - * @return {String} Classes for the specified group. - */ - classes: function(group) { - var classes = this._classes[group || 'control']; - - return classes ? classes.join(' ') : ''; - }, - - /** - * Sets the inner HTML of the control element. - * - * @method innerHtml - * @param {String} html Html string to set as inner html. - * @return {tinymce.ui.Control} Current control object. - */ - innerHtml: function(html) { - DomUtils.innerHtml(this.getEl(), html); - return this; - }, - - /** - * Returns the control DOM element or sub element. - * - * @method getEl - * @param {String} [suffix] Suffix to get element by. - * @param {Boolean} [dropCache] True if the cache for the element should be dropped. - * @return {Element} HTML DOM element for the current control or it's children. - */ - getEl: function(suffix, dropCache) { - var elm, id = suffix ? this._id + '-' + suffix : this._id; - - elm = elementIdCache[id] = (dropCache === true ? null : elementIdCache[id]) || DomUtils.get(id); - - return elm; - }, - - /** - * Sets/gets the visible for the control. - * - * @method visible - * @param {Boolean} state Value to set to control. - * @return {Boolean/tinymce.ui.Control} Current control on a set operation or current state on a get. - */ - visible: function(state) { - var self = this, parentCtrl; - - if (typeof(state) !== "undefined") { - if (self._visible !== state) { - if (self._rendered) { - self.getEl().style.display = state ? '' : 'none'; - } - - self._visible = state; - - // Parent container needs to reflow - parentCtrl = self.parent(); - if (parentCtrl) { - parentCtrl._lastRect = null; - } - - self.fire(state ? 'show' : 'hide'); - } - - return self; - } - - return self._visible; - }, - - /** - * Sets the visible state to true. - * - * @method show - * @return {tinymce.ui.Control} Current control instance. - */ - show: function() { - return this.visible(true); - }, - - /** - * Sets the visible state to false. - * - * @method hide - * @return {tinymce.ui.Control} Current control instance. - */ - hide: function() { - return this.visible(false); - }, - - /** - * Focuses the current control. - * - * @method focus - * @return {tinymce.ui.Control} Current control instance. - */ - focus: function() { - try { - this.getEl().focus(); - } catch (ex) { - // Ignore IE error - } - - return this; - }, - - /** - * Blurs the current control. - * - * @method blur - * @return {tinymce.ui.Control} Current control instance. - */ - blur: function() { - this.getEl().blur(); - - return this; - }, - - /** - * Sets the specified aria property. - * - * @method aria - * @param {String} name Name of the aria property to set. - * @param {String} value Value of the aria property. - * @return {tinymce.ui.Control} Current control instance. - */ - aria: function(name, value) { - var self = this, elm = self.getEl(self.ariaTarget); - - if (typeof(value) === "undefined") { - return self._aria[name]; - } else { - self._aria[name] = value; - } - - if (self._rendered) { - elm.setAttribute(name == 'role' ? name : 'aria-' + name, value); - } - - return self; - }, - - /** - * Encodes the specified string with HTML entities. It will also - * translate the string to different languages. - * - * @method encode - * @param {String/Object/Array} text Text to entity encode. - * @param {Boolean} [translate=true] False if the contents shouldn't be translated. - * @return {String} Encoded and possible traslated string. - */ - encode: function(text, translate) { - if (translate !== false && Control.translate) { - text = Control.translate(text); - } - - return (text || '').replace(/[&<>"]/g, function(match) { - return '&#' + match.charCodeAt(0) + ';'; - }); - }, - - /** - * Adds items before the current control. - * - * @method before - * @param {Array/tinymce.ui.Collection} items Array of items to prepend before this control. - * @return {tinymce.ui.Control} Current control instance. - */ - before: function(items) { - var self = this, parent = self.parent(); - - if (parent) { - parent.insert(items, parent.items().indexOf(self), true); - } - - return self; - }, - - /** - * Adds items after the current control. - * - * @method after - * @param {Array/tinymce.ui.Collection} items Array of items to append after this control. - * @return {tinymce.ui.Control} Current control instance. - */ - after: function(items) { - var self = this, parent = self.parent(); - - if (parent) { - parent.insert(items, parent.items().indexOf(self)); - } - - return self; - }, - - /** - * Removes the current control from DOM and from UI collections. - * - * @method remove - * @return {tinymce.ui.Control} Current control instance. - */ - remove: function() { - var self = this, elm = self.getEl(), parent = self.parent(), newItems, i; - - if (self.items) { - var controls = self.items().toArray(); - i = controls.length; - while (i--) { - controls[i].remove(); - } - } - - if (parent && parent.items) { - newItems = []; - - parent.items().each(function(item) { - if (item !== self) { - newItems.push(item); - } - }); - - parent.items().set(newItems); - parent._lastRect = null; - } - - if (self._eventsRoot && self._eventsRoot == self) { - DomUtils.off(elm); - } - - var lookup = self.getRoot().controlIdLookup; - if (lookup) { - delete lookup[self._id]; - } - - delete elementIdCache[self._id]; - - if (elm && elm.parentNode) { - var nodes = elm.getElementsByTagName('*'); - - i = nodes.length; - while (i--) { - delete elementIdCache[nodes[i].id]; - } - - elm.parentNode.removeChild(elm); - } - - self._rendered = false; - - return self; - }, - - /** - * Renders the control before the specified element. - * - * @method renderBefore - * @param {Element} elm Element to render before. - * @return {tinymce.ui.Control} Current control instance. - */ - renderBefore: function(elm) { - var self = this; - - elm.parentNode.insertBefore(DomUtils.createFragment(self.renderHtml()), elm); - self.postRender(); - - return self; - }, - - /** - * Renders the control to the specified element. - * - * @method renderBefore - * @param {Element} elm Element to render to. - * @return {tinymce.ui.Control} Current control instance. - */ - renderTo: function(elm) { - var self = this; - - elm = elm || self.getContainerElm(); - elm.appendChild(DomUtils.createFragment(self.renderHtml())); - self.postRender(); - - return self; - }, - - /** - * Post render method. Called after the control has been rendered to the target. - * - * @method postRender - * @return {tinymce.ui.Control} Current control instance. - */ - postRender: function() { - var self = this, settings = self.settings, elm, box, parent, name, parentEventsRoot; - - // Bind on settings - for (name in settings) { - if (name.indexOf("on") === 0) { - self.on(name.substr(2), settings[name]); - } - } - - if (self._eventsRoot) { - for (parent = self.parent(); !parentEventsRoot && parent; parent = parent.parent()) { - parentEventsRoot = parent._eventsRoot; - } - - if (parentEventsRoot) { - for (name in parentEventsRoot._nativeEvents) { - self._nativeEvents[name] = true; - } - } - } - - self.bindPendingEvents(); - - if (settings.style) { - elm = self.getEl(); - if (elm) { - elm.setAttribute('style', settings.style); - elm.style.cssText = settings.style; - } - } - - if (!self._visible) { - DomUtils.css(self.getEl(), 'display', 'none'); - } - - if (self.settings.border) { - box = self.borderBox(); - DomUtils.css(self.getEl(), { - 'border-top-width': box.top, - 'border-right-width': box.right, - 'border-bottom-width': box.bottom, - 'border-left-width': box.left - }); - } - - // Add instance to lookup - var root = self.getRoot(); - if (!root.controlIdLookup) { - root.controlIdLookup = {}; - } - - root.controlIdLookup[self._id] = self; - - for (var key in self._aria) { - self.aria(key, self._aria[key]); - } - - self.fire('postrender', {}, false); - }, - - /** - * Scrolls the current control into view. - * - * @method scrollIntoView - * @param {String} align Alignment in view top|center|bottom. - * @return {tinymce.ui.Control} Current control instance. - */ - scrollIntoView: function(align) { - function getOffset(elm, rootElm) { - var x, y, parent = elm; - - x = y = 0; - while (parent && parent != rootElm && parent.nodeType) { - x += parent.offsetLeft || 0; - y += parent.offsetTop || 0; - parent = parent.offsetParent; - } - - return {x: x, y: y}; - } - - var elm = this.getEl(), parentElm = elm.parentNode; - var x, y, width, height, parentWidth, parentHeight; - var pos = getOffset(elm, parentElm); - - x = pos.x; - y = pos.y; - width = elm.offsetWidth; - height = elm.offsetHeight; - parentWidth = parentElm.clientWidth; - parentHeight = parentElm.clientHeight; - - if (align == "end") { - x -= parentWidth - width; - y -= parentHeight - height; - } else if (align == "center") { - x -= (parentWidth / 2) - (width / 2); - y -= (parentHeight / 2) - (height / 2); - } - - parentElm.scrollLeft = x; - parentElm.scrollTop = y; - - return this; - }, - - /** - * Binds pending DOM events. - * - * @private - */ - bindPendingEvents: function() { - var self = this, i, l, parents, eventRootCtrl, nativeEvents, name; - - function delegate(e) { - var control = self.getParentCtrl(e.target); - - if (control) { - control.fire(e.type, e); - } - } - - function mouseLeaveHandler() { - var ctrl = eventRootCtrl._lastHoverCtrl; - - if (ctrl) { - ctrl.fire("mouseleave", {target: ctrl.getEl()}); - - ctrl.parents().each(function(ctrl) { - ctrl.fire("mouseleave", {target: ctrl.getEl()}); - }); - - eventRootCtrl._lastHoverCtrl = null; - } - } - - function mouseEnterHandler(e) { - var ctrl = self.getParentCtrl(e.target), lastCtrl = eventRootCtrl._lastHoverCtrl, idx = 0, i, parents, lastParents; - - // Over on a new control - if (ctrl !== lastCtrl) { - eventRootCtrl._lastHoverCtrl = ctrl; - - parents = ctrl.parents().toArray().reverse(); - parents.push(ctrl); - - if (lastCtrl) { - lastParents = lastCtrl.parents().toArray().reverse(); - lastParents.push(lastCtrl); - - for (idx = 0; idx < lastParents.length; idx++) { - if (parents[idx] !== lastParents[idx]) { - break; - } - } - - for (i = lastParents.length - 1; i >= idx; i--) { - lastCtrl = lastParents[i]; - lastCtrl.fire("mouseleave", { - target : lastCtrl.getEl() - }); - } - } - - for (i = idx; i < parents.length; i++) { - ctrl = parents[i]; - ctrl.fire("mouseenter", { - target : ctrl.getEl() - }); - } - } - } - - function fixWheelEvent(e) { - e.preventDefault(); - - if (e.type == "mousewheel") { - e.deltaY = -1 / 40 * e.wheelDelta; - - if (e.wheelDeltaX) { - e.deltaX = -1 / 40 * e.wheelDeltaX; - } - } else { - e.deltaX = 0; - e.deltaY = e.detail; - } - - e = self.fire("wheel", e); - } - - self._rendered = true; - - nativeEvents = self._nativeEvents; - if (nativeEvents) { - // Find event root element if it exists - parents = self.parents().toArray(); - parents.unshift(self); - for (i = 0, l = parents.length; !eventRootCtrl && i < l; i++) { - eventRootCtrl = parents[i]._eventsRoot; - } - - // Event root wasn't found the use the root control - if (!eventRootCtrl) { - eventRootCtrl = parents[parents.length - 1] || self; - } - - // Set the eventsRoot property on children that didn't have it - self._eventsRoot = eventRootCtrl; - for (l = i, i = 0; i < l; i++) { - parents[i]._eventsRoot = eventRootCtrl; - } - - // Bind native event delegates - for (name in nativeEvents) { - if (!nativeEvents) { - return false; - } - - if (name === "wheel" && !hasWheelEventSupport) { - if (hasMouseWheelEventSupport) { - DomUtils.on(self.getEl(), "mousewheel", fixWheelEvent); - } else { - DomUtils.on(self.getEl(), "DOMMouseScroll", fixWheelEvent); - } - - continue; - } - - // Special treatment for mousenter/mouseleave since these doesn't bubble - if (name === "mouseenter" || name === "mouseleave") { - // Fake mousenter/mouseleave - if (!eventRootCtrl._hasMouseEnter) { - DomUtils.on(eventRootCtrl.getEl(), "mouseleave", mouseLeaveHandler); - DomUtils.on(eventRootCtrl.getEl(), "mouseover", mouseEnterHandler); - eventRootCtrl._hasMouseEnter = 1; - } - } else if (!eventRootCtrl[name]) { - DomUtils.on(eventRootCtrl.getEl(), name, delegate); - eventRootCtrl[name] = true; - } - - // Remove the event once it's bound - nativeEvents[name] = false; - } - } - }, - - getRoot: function() { - var ctrl = this, rootControl, parents = []; - - while (ctrl) { - if (ctrl.rootControl) { - rootControl = ctrl.rootControl; - break; - } - - parents.push(ctrl); - rootControl = ctrl; - ctrl = ctrl.parent(); - } - - if (!rootControl) { - rootControl = this; - } - - var i = parents.length; - while (i--) { - parents[i].rootControl = rootControl; - } - - return rootControl; - }, - - /** - * Reflows the current control and it's parents. - * This should be used after you for example append children to the current control so - * that the layout managers know that they need to reposition everything. - * - * @example - * container.append({type: 'button', text: 'My button'}).reflow(); - * - * @method reflow - * @return {tinymce.ui.Control} Current control instance. - */ - reflow: function() { - this.repaint(); - - return this; - } - - /** - * Sets/gets the parent container for the control. - * - * @method parent - * @param {tinymce.ui.Container} parent Optional parent to set. - * @return {tinymce.ui.Control} Parent control or the current control on a set action. - */ - // parent: function(parent) {} -- Generated - - /** - * Sets/gets the text for the control. - * - * @method text - * @param {String} value Value to set to control. - * @return {String/tinymce.ui.Control} Current control on a set operation or current value on a get. - */ - // text: function(value) {} -- Generated - - /** - * Sets/gets the width for the control. - * - * @method width - * @param {Number} value Value to set to control. - * @return {Number/tinymce.ui.Control} Current control on a set operation or current value on a get. - */ - // width: function(value) {} -- Generated - - /** - * Sets/gets the height for the control. - * - * @method height - * @param {Number} value Value to set to control. - * @return {Number/tinymce.ui.Control} Current control on a set operation or current value on a get. - */ - // height: function(value) {} -- Generated - - /** - * Sets/gets the disabled state on the control. - * - * @method disabled - * @param {Boolean} state Value to set to control. - * @return {Boolean/tinymce.ui.Control} Current control on a set operation or current state on a get. - */ - // disabled: function(state) {} -- Generated - - /** - * Sets/gets the active for the control. - * - * @method active - * @param {Boolean} state Value to set to control. - * @return {Boolean/tinymce.ui.Control} Current control on a set operation or current state on a get. - */ - // active: function(state) {} -- Generated - - /** - * Sets/gets the name for the control. - * - * @method name - * @param {String} value Value to set to control. - * @return {String/tinymce.ui.Control} Current control on a set operation or current value on a get. - */ - // name: function(value) {} -- Generated - - /** - * Sets/gets the title for the control. - * - * @method title - * @param {String} value Value to set to control. - * @return {String/tinymce.ui.Control} Current control on a set operation or current value on a get. - */ - // title: function(value) {} -- Generated - }); - - return Control; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/DomUtils.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/DomUtils.js deleted file mode 100755 index cbe3d40de9ea..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/DomUtils.js +++ /dev/null @@ -1,95 +0,0 @@ -/** - * DOMUtils.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("tinymce/ui/DomUtils", [ - "tinymce/util/Tools", - "tinymce/dom/DOMUtils" -], function(Tools, DOMUtils) { - "use strict"; - - return { - id: function() { - return DOMUtils.DOM.uniqueId(); - }, - - createFragment: function(html) { - return DOMUtils.DOM.createFragment(html); - }, - - getWindowSize: function() { - return DOMUtils.DOM.getViewPort(); - }, - - getSize: function(elm) { - var width, height; - - if (elm.getBoundingClientRect) { - var rect = elm.getBoundingClientRect(); - - width = Math.max(rect.width || (rect.right - rect.left), elm.offsetWidth); - height = Math.max(rect.height || (rect.bottom - rect.bottom), elm.offsetHeight); - } else { - width = elm.offsetWidth; - height = elm.offsetHeight; - } - - return {width: width, height: height}; - }, - - getPos: function(elm, root) { - return DOMUtils.DOM.getPos(elm, root); - }, - - getViewPort: function(win) { - return DOMUtils.DOM.getViewPort(win); - }, - - get: function(id) { - return document.getElementById(id); - }, - - addClass : function(elm, cls) { - return DOMUtils.DOM.addClass(elm, cls); - }, - - removeClass : function(elm, cls) { - return DOMUtils.DOM.removeClass(elm, cls); - }, - - hasClass : function(elm, cls) { - return DOMUtils.DOM.hasClass(elm, cls); - }, - - toggleClass: function(elm, cls, state) { - return DOMUtils.DOM.toggleClass(elm, cls, state); - }, - - css: function(elm, name, value) { - return DOMUtils.DOM.setStyle(elm, name, value); - }, - - on: function(target, name, callback, scope) { - return DOMUtils.DOM.bind(target, name, callback, scope); - }, - - off: function(target, name, callback) { - return DOMUtils.DOM.unbind(target, name, callback); - }, - - fire: function(target, name, args) { - return DOMUtils.DOM.fire(target, name, args); - }, - - innerHtml: function(elm, html) { - // Workaround for
    in

    bug on IE 8 #6178 - DOMUtils.DOM.setHTML(elm, html); - } - }; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/DragHelper.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/DragHelper.js deleted file mode 100755 index c7c2850b2684..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/DragHelper.js +++ /dev/null @@ -1,136 +0,0 @@ -/** - * DragHelper.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Drag/drop helper class. - * - * @example - * var dragHelper = new tinymce.ui.DragHelper('mydiv', { - * start: function(evt) { - * }, - * - * drag: function(evt) { - * }, - * - * end: function(evt) { - * } - * }); - * - * @class tinymce.ui.DragHelper - */ -define("tinymce/ui/DragHelper", [ - "tinymce/ui/DomUtils" -], function(DomUtils) { - "use strict"; - - function getDocumentSize() { - var doc = document, documentElement, body, scrollWidth, clientWidth; - var offsetWidth, scrollHeight, clientHeight, offsetHeight, max = Math.max; - - documentElement = doc.documentElement; - body = doc.body; - - scrollWidth = max(documentElement.scrollWidth, body.scrollWidth); - clientWidth = max(documentElement.clientWidth, body.clientWidth); - offsetWidth = max(documentElement.offsetWidth, body.offsetWidth); - - scrollHeight = max(documentElement.scrollHeight, body.scrollHeight); - clientHeight = max(documentElement.clientHeight, body.clientHeight); - offsetHeight = max(documentElement.offsetHeight, body.offsetHeight); - - return { - width: scrollWidth < offsetWidth ? clientWidth : scrollWidth, - height: scrollHeight < offsetHeight ? clientHeight : scrollHeight - }; - } - - return function(id, settings) { - var eventOverlayElm, doc = document, downButton, start, stop, drag, startX, startY; - - settings = settings || {}; - - function getHandleElm() { - return doc.getElementById(settings.handle || id); - } - - start = function(e) { - var docSize = getDocumentSize(), handleElm, cursor; - - e.preventDefault(); - downButton = e.button; - handleElm = getHandleElm(); - startX = e.screenX; - startY = e.screenY; - - // Grab cursor from handle - if (window.getComputedStyle) { - cursor = window.getComputedStyle(handleElm, null).getPropertyValue("cursor"); - } else { - cursor = handleElm.runtimeStyle.cursor; - } - - // Create event overlay and add it to document - eventOverlayElm = doc.createElement('div'); - DomUtils.css(eventOverlayElm, { - position: "absolute", - top: 0, left: 0, - width: docSize.width, - height: docSize.height, - zIndex: 0x7FFFFFFF, - opacity: 0.0001, - background: 'red', - cursor: cursor - }); - - doc.body.appendChild(eventOverlayElm); - - // Bind mouse events - DomUtils.on(doc, 'mousemove', drag); - DomUtils.on(doc, 'mouseup', stop); - - // Begin drag - settings.start(e); - }; - - drag = function(e) { - if (e.button !== downButton) { - return stop(e); - } - - e.deltaX = e.screenX - startX; - e.deltaY = e.screenY - startY; - - e.preventDefault(); - settings.drag(e); - }; - - stop = function(e) { - DomUtils.off(doc, 'mousemove', drag); - DomUtils.off(doc, 'mouseup', stop); - - eventOverlayElm.parentNode.removeChild(eventOverlayElm); - - if (settings.stop) { - settings.stop(e); - } - }; - - /** - * Destroys the drag/drop helper instance. - * - * @method destroy - */ - this.destroy = function() { - DomUtils.off(getHandleElm()); - }; - - DomUtils.on(getHandleElm(), 'mousedown', start); - }; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/ElementPath.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/ElementPath.js deleted file mode 100755 index 5b9d7fbcecd3..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/ElementPath.js +++ /dev/null @@ -1,83 +0,0 @@ -/** - * ElementPath.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This control creates an path for the current selections parent elements in TinyMCE. - * - * @class tinymce.ui.ElementPath - * @extends tinymce.ui.Path - */ -define("tinymce/ui/ElementPath", [ - "tinymce/ui/Path", - "tinymce/EditorManager" -], function(Path, EditorManager) { - return Path.extend({ - /** - * Post render method. Called after the control has been rendered to the target. - * - * @method postRender - * @return {tinymce.ui.ElementPath} Current combobox instance. - */ - postRender: function() { - var self = this, editor = EditorManager.activeEditor; - - function isHidden(elm) { - if (elm.nodeType === 1) { - if (elm.nodeName == "BR" || !!elm.getAttribute('data-mce-bogus')) { - return true; - } - - if (elm.getAttribute('data-mce-type') === 'bookmark') { - return true; - } - } - - return false; - } - - self.on('select', function(e) { - var parents = [], node, body = editor.getBody(); - - editor.focus(); - - node = editor.selection.getStart(); - while (node && node != body) { - if (!isHidden(node)) { - parents.push(node); - } - - node = node.parentNode; - } - - editor.selection.select(parents[parents.length - 1 - e.index]); - editor.nodeChanged(); - }); - - editor.on('nodeChange', function(e) { - var parents = [], selectionParents = e.parents, i = selectionParents.length; - - while (i--) { - if (selectionParents[i].nodeType == 1 && !isHidden(selectionParents[i])) { - var args = editor.fire('ResolveName', { - name: selectionParents[i].nodeName.toLowerCase(), - target: selectionParents[i] - }); - - parents.push({name: args.name}); - } - } - - self.data(parents); - }); - - return self._super(); - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Factory.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Factory.js deleted file mode 100755 index 6e4fc1c51396..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Factory.js +++ /dev/null @@ -1,105 +0,0 @@ -/** - * Factory.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*global tinymce:true */ - -/** - * This class is a factory for control instances. This enables you - * to create instances of controls without having to require the UI controls directly. - * - * It also allow you to override or add new control types. - * - * @class tinymce.ui.Factory - */ -define("tinymce/ui/Factory", [], function() { - "use strict"; - - var types = {}, namespaceInit; - - return { - /** - * Adds a new control instance type to the factory. - * - * @method add - * @param {String} type Type name for example "button". - * @param {function} typeClass Class type function. - */ - add: function(type, typeClass) { - types[type.toLowerCase()] = typeClass; - }, - - /** - * Returns true/false if the specified type exists or not. - * - * @method has - * @param {String} type Type to look for. - * @return {Boolean} true/false if the control by name exists. - */ - has: function(type) { - return !!types[type.toLowerCase()]; - }, - - /** - * Creates a new control instance based on the settings provided. The instance created will be - * based on the specified type property it can also create whole structures of components out of - * the specified JSON object. - * - * @example - * tinymce.ui.Factory.create({ - * type: 'button', - * text: 'Hello world!' - * }); - * - * @method create - * @param {Object/String} settings Name/Value object with items used to create the type. - * @return {tinymce.ui.Control} Control instance based on the specified type. - */ - create: function(type, settings) { - var ControlType, name, namespace; - - // Build type lookup - if (!namespaceInit) { - namespace = tinymce.ui; - - for (name in namespace) { - types[name.toLowerCase()] = namespace[name]; - } - - namespaceInit = true; - } - - // If string is specified then use it as the type - if (typeof(type) == 'string') { - settings = settings || {}; - settings.type = type; - } else { - settings = type; - type = settings.type; - } - - // Find control type - type = type.toLowerCase(); - ControlType = types[type]; - - // #if debug - - if (!ControlType) { - throw new Error("Could not find control by type: " + type); - } - - // #endif - - ControlType = new ControlType(settings); - ControlType.type = type; // Set the type on the instance, this will be used by the Selector engine - - return ControlType; - } - }; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/FieldSet.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/FieldSet.js deleted file mode 100755 index 4142890cb05d..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/FieldSet.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * FieldSet.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class creates fieldset containers. - * - * @-x-less FieldSet.less - * @class tinymce.ui.FieldSet - * @extends tinymce.ui.Form - */ -define("tinymce/ui/FieldSet", [ - "tinymce/ui/Form" -], function(Form) { - "use strict"; - - return Form.extend({ - Defaults: { - containerCls: 'fieldset', - layout: 'flex', - direction: 'column', - align: 'stretch', - flex: 1, - padding: "25 15 5 15", - labelGap: 30, - spacing: 10, - border: 1 - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, layout = self._layout, prefix = self.classPrefix; - - self.preRender(); - layout.preRender(self); - - return ( - '

    ' + - (self.settings.title ? ('' + - self.settings.title + '') : '') + - '
    ' + - (self.settings.html || '') + layout.renderHtml(self) + - '
    ' + - '
    ' - ); - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/FilePicker.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/FilePicker.js deleted file mode 100755 index b95bf603debf..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/FilePicker.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * FilePicker.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*global tinymce:true */ - -/** - * This class creates a file picker control. - * - * @class tinymce.ui.FilePicker - * @extends tinymce.ui.ComboBox - */ -define("tinymce/ui/FilePicker", [ - "tinymce/ui/ComboBox" -], function(ComboBox) { - "use strict"; - - return ComboBox.extend({ - /** - * Constructs a new control instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - */ - init: function(settings) { - var self = this, editor = tinymce.activeEditor, fileBrowserCallback; - - settings.spellcheck = false; - - fileBrowserCallback = editor.settings.file_browser_callback; - if (fileBrowserCallback) { - settings.icon = 'browse'; - - settings.onaction = function() { - fileBrowserCallback( - self.getEl('inp').id, - self.getEl('inp').value, - settings.filetype, - window - ); - }; - } - - self._super(settings); - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/FitLayout.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/FitLayout.js deleted file mode 100755 index 6809204441ab..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/FitLayout.js +++ /dev/null @@ -1,48 +0,0 @@ -/** - * FitLayout.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This layout manager will resize the control to be the size of it's parent container. - * In other words width: 100% and height: 100%. - * - * @-x-less FitLayout.less - * @class tinymce.ui.FitLayout - * @extends tinymce.ui.AbsoluteLayout - */ -define("tinymce/ui/FitLayout", [ - "tinymce/ui/AbsoluteLayout" -], function(AbsoluteLayout) { - "use strict"; - - return AbsoluteLayout.extend({ - /** - * Recalculates the positions of the controls in the specified container. - * - * @method recalc - * @param {tinymce.ui.Container} container Container instance to recalc. - */ - recalc: function(container) { - var contLayoutRect = container.layoutRect(), paddingBox = container.paddingBox(); - - container.items().filter(':visible').each(function(ctrl) { - ctrl.layoutRect({ - x: paddingBox.left, - y: paddingBox.top, - w: contLayoutRect.innerW - paddingBox.right - paddingBox.left, - h: contLayoutRect.innerH - paddingBox.top - paddingBox.bottom - }); - - if (ctrl.recalc) { - ctrl.recalc(); - } - }); - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/FlexLayout.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/FlexLayout.js deleted file mode 100755 index 99761c8068a7..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/FlexLayout.js +++ /dev/null @@ -1,246 +0,0 @@ -/** - * FlexLayout.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This layout manager works similar to the CSS flex box. - * - * @setting {String} direction row|row-reverse|column|column-reverse - * @setting {Number} flex A positive-number to flex by. - * @setting {String} align start|end|center|stretch - * @setting {String} pack start|end|justify - * - * @class tinymce.ui.FlexLayout - * @extends tinymce.ui.AbsoluteLayout - */ -define("tinymce/ui/FlexLayout", [ - "tinymce/ui/AbsoluteLayout" -], function(AbsoluteLayout) { - "use strict"; - - return AbsoluteLayout.extend({ - /** - * Recalculates the positions of the controls in the specified container. - * - * @method recalc - * @param {tinymce.ui.Container} container Container instance to recalc. - */ - recalc: function(container) { - // A ton of variables, needs to be in the same scope for performance - var i, l, items, contLayoutRect, contPaddingBox, contSettings, align, pack, spacing, totalFlex, availableSpace, direction; - var ctrl, ctrlLayoutRect, ctrlSettings, flex, maxSizeItems = [], size, maxSize, ratio, rect, pos, maxAlignEndPos; - var sizeName, minSizeName, posName, maxSizeName, beforeName, innerSizeName, deltaSizeName, contentSizeName; - var alignAxisName, alignInnerSizeName, alignSizeName, alignMinSizeName, alignBeforeName, alignAfterName; - var alignDeltaSizeName, alignContentSizeName; - var max = Math.max, min = Math.min; - - // Get container items, properties and settings - items = container.items().filter(':visible'); - contLayoutRect = container.layoutRect(); - contPaddingBox = container._paddingBox; - contSettings = container.settings; - direction = container.isRtl() ? (contSettings.direction || 'row-reversed') : contSettings.direction; - align = contSettings.align; - pack = container.isRtl() ? (contSettings.pack || 'end') : contSettings.pack; - spacing = contSettings.spacing || 0; - - if (direction == "row-reversed" || direction == "column-reverse") { - items = items.set(items.toArray().reverse()); - direction = direction.split('-')[0]; - } - - // Setup axis variable name for row/column direction since the calculations is the same - if (direction == "column") { - posName = "y"; - sizeName = "h"; - minSizeName = "minH"; - maxSizeName = "maxH"; - innerSizeName = "innerH"; - beforeName = 'top'; - deltaSizeName = "deltaH"; - contentSizeName = "contentH"; - - alignBeforeName = "left"; - alignSizeName = "w"; - alignAxisName = "x"; - alignInnerSizeName = "innerW"; - alignMinSizeName = "minW"; - alignAfterName = "right"; - alignDeltaSizeName = "deltaW"; - alignContentSizeName = "contentW"; - } else { - posName = "x"; - sizeName = "w"; - minSizeName = "minW"; - maxSizeName = "maxW"; - innerSizeName = "innerW"; - beforeName = 'left'; - deltaSizeName = "deltaW"; - contentSizeName = "contentW"; - - alignBeforeName = "top"; - alignSizeName = "h"; - alignAxisName = "y"; - alignInnerSizeName = "innerH"; - alignMinSizeName = "minH"; - alignAfterName = "bottom"; - alignDeltaSizeName = "deltaH"; - alignContentSizeName = "contentH"; - } - - // Figure out total flex, availableSpace and collect any max size elements - availableSpace = contLayoutRect[innerSizeName] - contPaddingBox[beforeName] - contPaddingBox[beforeName]; - maxAlignEndPos = totalFlex = 0; - for (i = 0, l = items.length; i < l; i++) { - ctrl = items[i]; - ctrlLayoutRect = ctrl.layoutRect(); - ctrlSettings = ctrl.settings; - flex = ctrlSettings.flex; - availableSpace -= (i < l - 1 ? spacing : 0); - - if (flex > 0) { - totalFlex += flex; - - // Flexed item has a max size then we need to check if we will hit that size - if (ctrlLayoutRect[maxSizeName]) { - maxSizeItems.push(ctrl); - } - - ctrlLayoutRect.flex = flex; - } - - availableSpace -= ctrlLayoutRect[minSizeName]; - - // Calculate the align end position to be used to check for overflow/underflow - size = contPaddingBox[alignBeforeName] + ctrlLayoutRect[alignMinSizeName] + contPaddingBox[alignAfterName]; - if (size > maxAlignEndPos) { - maxAlignEndPos = size; - } - } - - // Calculate minW/minH - rect = {}; - if (availableSpace < 0) { - rect[minSizeName] = contLayoutRect[minSizeName] - availableSpace + contLayoutRect[deltaSizeName]; - } else { - rect[minSizeName] = contLayoutRect[innerSizeName] - availableSpace + contLayoutRect[deltaSizeName]; - } - - rect[alignMinSizeName] = maxAlignEndPos + contLayoutRect[alignDeltaSizeName]; - - rect[contentSizeName] = contLayoutRect[innerSizeName] - availableSpace; - rect[alignContentSizeName] = maxAlignEndPos; - rect.minW = min(rect.minW, contLayoutRect.maxW); - rect.minH = min(rect.minH, contLayoutRect.maxH); - rect.minW = max(rect.minW, contLayoutRect.startMinWidth); - rect.minH = max(rect.minH, contLayoutRect.startMinHeight); - - // Resize container container if minSize was changed - if (contLayoutRect.autoResize && (rect.minW != contLayoutRect.minW || rect.minH != contLayoutRect.minH)) { - rect.w = rect.minW; - rect.h = rect.minH; - - container.layoutRect(rect); - this.recalc(container); - - // Forced recalc for example if items are hidden/shown - if (container._lastRect === null) { - var parentCtrl = container.parent(); - if (parentCtrl) { - parentCtrl._lastRect = null; - parentCtrl.recalc(); - } - } - - return; - } - - // Handle max size elements, check if they will become to wide with current options - ratio = availableSpace / totalFlex; - for (i = 0, l = maxSizeItems.length; i < l; i++) { - ctrl = maxSizeItems[i]; - ctrlLayoutRect = ctrl.layoutRect(); - maxSize = ctrlLayoutRect[maxSizeName]; - size = ctrlLayoutRect[minSizeName] + ctrlLayoutRect.flex * ratio; - - if (size > maxSize) { - availableSpace -= (ctrlLayoutRect[maxSizeName] - ctrlLayoutRect[minSizeName]); - totalFlex -= ctrlLayoutRect.flex; - ctrlLayoutRect.flex = 0; - ctrlLayoutRect.maxFlexSize = maxSize; - } else { - ctrlLayoutRect.maxFlexSize = 0; - } - } - - // Setup new ratio, target layout rect, start position - ratio = availableSpace / totalFlex; - pos = contPaddingBox[beforeName]; - rect = {}; - - // Handle pack setting moves the start position to end, center - if (totalFlex === 0) { - if (pack == "end") { - pos = availableSpace + contPaddingBox[beforeName]; - } else if (pack == "center") { - pos = Math.round( - (contLayoutRect[innerSizeName] / 2) - ((contLayoutRect[innerSizeName] - availableSpace) / 2) - ) + contPaddingBox[beforeName]; - - if (pos < 0) { - pos = contPaddingBox[beforeName]; - } - } else if (pack == "justify") { - pos = contPaddingBox[beforeName]; - spacing = Math.floor(availableSpace / (items.length - 1)); - } - } - - // Default aligning (start) the other ones needs to be calculated while doing the layout - rect[alignAxisName] = contPaddingBox[alignBeforeName]; - - // Start laying out controls - for (i = 0, l = items.length; i < l; i++) { - ctrl = items[i]; - ctrlLayoutRect = ctrl.layoutRect(); - size = ctrlLayoutRect.maxFlexSize || ctrlLayoutRect[minSizeName]; - - // Align the control on the other axis - if (align === "center") { - rect[alignAxisName] = Math.round((contLayoutRect[alignInnerSizeName] / 2) - (ctrlLayoutRect[alignSizeName] / 2)); - } else if (align === "stretch") { - rect[alignSizeName] = max( - ctrlLayoutRect[alignMinSizeName] || 0, - contLayoutRect[alignInnerSizeName] - contPaddingBox[alignBeforeName] - contPaddingBox[alignAfterName] - ); - rect[alignAxisName] = contPaddingBox[alignBeforeName]; - } else if (align === "end") { - rect[alignAxisName] = contLayoutRect[alignInnerSizeName] - ctrlLayoutRect[alignSizeName] - contPaddingBox.top; - } - - // Calculate new size based on flex - if (ctrlLayoutRect.flex > 0) { - size += ctrlLayoutRect.flex * ratio; - } - - rect[sizeName] = size; - rect[posName] = pos; - ctrl.layoutRect(rect); - - // Recalculate containers - if (ctrl.recalc) { - ctrl.recalc(); - } - - // Move x/y position - pos += size + spacing; - } - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/FloatPanel.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/FloatPanel.js deleted file mode 100755 index 27457eee0e89..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/FloatPanel.js +++ /dev/null @@ -1,366 +0,0 @@ -/** - * FloatPanel.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class creates a floating panel. - * - * @-x-less FloatPanel.less - * @class tinymce.ui.FloatPanel - * @extends tinymce.ui.Panel - * @mixes tinymce.ui.Movable - * @mixes tinymce.ui.Resizable - */ -define("tinymce/ui/FloatPanel", [ - "tinymce/ui/Panel", - "tinymce/ui/Movable", - "tinymce/ui/Resizable", - "tinymce/ui/DomUtils" -], function(Panel, Movable, Resizable, DomUtils) { - "use strict"; - - var documentClickHandler, documentScrollHandler, visiblePanels = []; - var zOrder = [], hasModal; - - var FloatPanel = Panel.extend({ - Mixins: [Movable, Resizable], - - /** - * Constructs a new control instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - * @setting {Boolean} autohide Automatically hide the panel. - */ - init: function(settings) { - var self = this; - - function reorder() { - var i, zIndex = FloatPanel.zIndex || 0xFFFF, topModal; - - if (zOrder.length) { - for (i = 0; i < zOrder.length; i++) { - if (zOrder[i].modal) { - zIndex++; - topModal = zOrder[i]; - } - - zOrder[i].getEl().style.zIndex = zIndex; - zOrder[i].zIndex = zIndex; - zIndex++; - } - } - - var modalBlockEl = document.getElementById(self.classPrefix + 'modal-block'); - - if (topModal) { - DomUtils.css(modalBlockEl, 'z-index', topModal.zIndex - 1); - } else if (modalBlockEl) { - modalBlockEl.parentNode.removeChild(modalBlockEl); - hasModal = false; - } - - FloatPanel.currentZIndex = zIndex; - } - - function isChildOf(ctrl, parent) { - while (ctrl) { - if (ctrl == parent) { - return true; - } - - ctrl = ctrl.parent(); - } - } - - /** - * Repositions the panel to the top of page if the panel is outside of the visual viewport. It will - * also reposition all child panels of the current panel. - */ - function repositionPanel(panel) { - var scrollY = DomUtils.getViewPort().y; - - function toggleFixedChildPanels(fixed, deltaY) { - var parent; - - for (var i = 0; i < visiblePanels.length; i++) { - if (visiblePanels[i] != panel) { - parent = visiblePanels[i].parent(); - - while (parent && (parent = parent.parent())) { - if (parent == panel) { - visiblePanels[i].fixed(fixed).moveBy(0, deltaY).repaint(); - } - } - } - } - } - - if (panel.settings.autofix) { - if (!panel._fixed) { - panel._autoFixY = panel.layoutRect().y; - - if (panel._autoFixY < scrollY) { - panel.fixed(true).layoutRect({y: 0}).repaint(); - toggleFixedChildPanels(true, scrollY - panel._autoFixY); - } - } else { - if (panel._autoFixY > scrollY) { - panel.fixed(false).layoutRect({y: panel._autoFixY}).repaint(); - toggleFixedChildPanels(false, panel._autoFixY - scrollY); - } - } - } - } - - self._super(settings); - self._eventsRoot = self; - - self.addClass('floatpanel'); - - // Hide floatpanes on click out side the root button - if (settings.autohide) { - if (!documentClickHandler) { - documentClickHandler = function(e) { - // Hide any float panel when a click is out side that float panel and the - // float panels direct parent for example a click on a menu button - var i = visiblePanels.length; - while (i--) { - var panel = visiblePanels[i], clickCtrl = panel.getParentCtrl(e.target); - - if (panel.settings.autohide) { - if (clickCtrl) { - if (isChildOf(clickCtrl, panel) || panel.parent() === clickCtrl) { - continue; - } - } - - e = panel.fire('autohide', {target: e.target}); - if (!e.isDefaultPrevented()) { - panel.hide(); - } - } - } - }; - - DomUtils.on(document, 'click', documentClickHandler); - } - - visiblePanels.push(self); - } - - if (settings.autofix) { - if (!documentScrollHandler) { - documentScrollHandler = function() { - var i; - - i = visiblePanels.length; - while (i--) { - repositionPanel(visiblePanels[i]); - } - }; - - DomUtils.on(window, 'scroll', documentScrollHandler); - } - - self.on('move', function() { - repositionPanel(this); - }); - } - - self.on('postrender show', function(e) { - if (e.control == self) { - var modalBlockEl, prefix = self.classPrefix; - - if (self.modal && !hasModal) { - modalBlockEl = DomUtils.createFragment('
    '); - modalBlockEl = modalBlockEl.firstChild; - - self.getContainerElm().appendChild(modalBlockEl); - - setTimeout(function() { - DomUtils.addClass(modalBlockEl, prefix + 'in'); - DomUtils.addClass(self.getEl(), prefix + 'in'); - }, 0); - - hasModal = true; - } - - zOrder.push(self); - reorder(); - } - }); - - self.on('close hide', function(e) { - if (e.control == self) { - var i = zOrder.length; - - while (i--) { - if (zOrder[i] === self) { - zOrder.splice(i, 1); - } - } - - reorder(); - } - }); - - self.on('show', function() { - self.parents().each(function(ctrl) { - if (ctrl._fixed) { - self.fixed(true); - return false; - } - }); - }); - - if (settings.popover) { - self._preBodyHtml = '
    '; - self.addClass('popover').addClass('bottom').addClass(self.isRtl() ? 'end' : 'start'); - } - }, - - fixed: function(state) { - var self = this; - - if (self._fixed != state) { - if (self._rendered) { - var viewport = DomUtils.getViewPort(); - - if (state) { - self.layoutRect().y -= viewport.y; - } else { - self.layoutRect().y += viewport.y; - } - } - - self.toggleClass('fixed', state); - self._fixed = state; - } - - return self; - }, - - /** - * Shows the current float panel. - * - * @method show - * @return {tinymce.ui.FloatPanel} Current floatpanel instance. - */ - show: function() { - var self = this, i, state = self._super(); - - i = visiblePanels.length; - while (i--) { - if (visiblePanels[i] === self) { - break; - } - } - - if (i === -1) { - visiblePanels.push(self); - } - - return state; - }, - - /** - * Hides the current float panel. - * - * @method hide - * @return {tinymce.ui.FloatPanel} Current floatpanel instance. - */ - hide: function() { - removeVisiblePanel(this); - return this._super(); - }, - - /** - * Hides all visible the float panels. - * - * @method hideAll - */ - hideAll: function() { - FloatPanel.hideAll(); - }, - - /** - * Closes the float panel. This will remove the float panel from page and fire the close event. - * - * @method close - */ - close: function() { - var self = this; - - self.fire('close'); - - return self.remove(); - }, - - /** - * Removes the float panel from page. - * - * @method remove - */ - remove: function() { - removeVisiblePanel(this); - this._super(); - }, - - postRender: function() { - var self = this; - - if (self.settings.bodyRole) { - this.getEl('body').setAttribute('role', self.settings.bodyRole); - } - - return self._super(); - } - }); - - /** - * Hides all visible the float panels. - * - * @static - * @method hideAll - */ - FloatPanel.hideAll = function() { - var i = visiblePanels.length; - - while (i--) { - var panel = visiblePanels[i]; - - if (panel && panel.settings.autohide) { - panel.hide(); - visiblePanels.splice(i, 1); - } - } - }; - - function removeVisiblePanel(panel) { - var i; - - i = visiblePanels.length; - while (i--) { - if (visiblePanels[i] === panel) { - visiblePanels.splice(i, 1); - } - } - - i = zOrder.length; - while (i--) { - if (zOrder[i] === panel) { - zOrder.splice(i, 1); - } - } - } - - return FloatPanel; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/FlowLayout.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/FlowLayout.js deleted file mode 100755 index cc40c22b749c..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/FlowLayout.js +++ /dev/null @@ -1,42 +0,0 @@ -/** - * FlowLayout.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This layout manager will place the controls by using the browsers native layout. - * - * @-x-less FlowLayout.less - * @class tinymce.ui.FlowLayout - * @extends tinymce.ui.Layout - */ -define("tinymce/ui/FlowLayout", [ - "tinymce/ui/Layout" -], function(Layout) { - return Layout.extend({ - Defaults: { - containerClass: 'flow-layout', - controlClass: 'flow-layout-item', - endClass : 'break' - }, - - /** - * Recalculates the positions of the controls in the specified container. - * - * @method recalc - * @param {tinymce.ui.Container} container Container instance to recalc. - */ - recalc: function(container) { - container.items().filter(':visible').each(function(ctrl) { - if (ctrl.recalc) { - ctrl.recalc(); - } - }); - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Form.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Form.js deleted file mode 100755 index 074ebc2832c9..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Form.js +++ /dev/null @@ -1,154 +0,0 @@ -/** - * Form.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class creates a form container. A form container has the ability - * to automatically wrap items in tinymce.ui.FormItem instances. - * - * Each FormItem instance is a container for the label and the item. - * - * @example - * tinymce.ui.Factory.create({ - * type: 'form', - * items: [ - * {type: 'textbox', label: 'My text box'} - * ] - * }).renderTo(document.body); - * - * @class tinymce.ui.Form - * @extends tinymce.ui.Container - */ -define("tinymce/ui/Form", [ - "tinymce/ui/Container", - "tinymce/ui/FormItem" -], function(Container, FormItem) { - "use strict"; - - return Container.extend({ - Defaults: { - containerCls: 'form', - layout: 'flex', - direction: 'column', - align: 'stretch', - flex: 1, - padding: 20, - labelGap: 30, - spacing: 10, - callbacks: { - submit: function() { - this.submit(); - } - } - }, - - /** - * This method gets invoked before the control is rendered. - * - * @method preRender - */ - preRender: function() { - var self = this, items = self.items(); - - // Wrap any labeled items in FormItems - items.each(function(ctrl) { - var formItem, label = ctrl.settings.label; - - if (label) { - formItem = new FormItem({ - layout: 'flex', - autoResize: "overflow", - defaults: {flex: 1}, - items: [ - {type: 'label', id: ctrl._id + '-l', text: label, flex: 0, forId: ctrl._id, disabled: ctrl.disabled()} - ] - }); - - formItem.type = 'formitem'; - ctrl.aria('labelledby', ctrl._id + '-l'); - - if (typeof(ctrl.settings.flex) == "undefined") { - ctrl.settings.flex = 1; - } - - self.replace(ctrl, formItem); - formItem.add(ctrl); - } - }); - }, - - /** - * Recalcs label widths. - * - * @private - */ - recalcLabels: function() { - var self = this, maxLabelWidth = 0, labels = [], i, labelGap; - - if (self.settings.labelGapCalc === false) { - return; - } - - self.items().filter('formitem').each(function(item) { - var labelCtrl = item.items()[0], labelWidth = labelCtrl.getEl().clientWidth; - - maxLabelWidth = labelWidth > maxLabelWidth ? labelWidth : maxLabelWidth; - labels.push(labelCtrl); - }); - - labelGap = self.settings.labelGap || 0; - - i = labels.length; - while (i--) { - labels[i].settings.minWidth = maxLabelWidth + labelGap; - } - }, - - /** - * Getter/setter for the visibility state. - * - * @method visible - * @param {Boolean} [state] True/false state to show/hide. - * @return {tinymce.ui.Form|Boolean} True/false state or current control. - */ - visible: function(state) { - var val = this._super(state); - - if (state === true && this._rendered) { - this.recalcLabels(); - } - - return val; - }, - - /** - * Fires a submit event with the serialized form. - * - * @method submit - * @return {Object} Event arguments object. - */ - submit: function() { - return this.fire('submit', {data: this.toJSON()}); - }, - - /** - * Post render method. Called after the control has been rendered to the target. - * - * @method postRender - * @return {tinymce.ui.ComboBox} Current combobox instance. - */ - postRender: function() { - var self = this; - - self._super(); - self.recalcLabels(); - self.fromJSON(self.settings.data); - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/FormItem.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/FormItem.js deleted file mode 100755 index 56408db8acd2..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/FormItem.js +++ /dev/null @@ -1,56 +0,0 @@ -/** - * FormItem.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class is a container created by the form element with - * a label and control item. - * - * @class tinymce.ui.FormItem - * @extends tinymce.ui.Container - * @setting {String} label Label to display for the form item. - */ -define("tinymce/ui/FormItem", [ - "tinymce/ui/Container" -], function(Container) { - "use strict"; - - return Container.extend({ - Defaults: { - layout: 'flex', - align: 'center', - defaults: { - flex: 1 - } - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, layout = self._layout, prefix = self.classPrefix; - - self.addClass('formitem'); - layout.preRender(self); - - return ( - '
    ' + - (self.settings.title ? ('
    ' + - self.settings.title + '
    ') : '') + - '
    ' + - (self.settings.html || '') + layout.renderHtml(self) + - '
    ' + - '
    ' - ); - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/FormatControls.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/FormatControls.js deleted file mode 100755 index cce53fbf152e..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/FormatControls.js +++ /dev/null @@ -1,652 +0,0 @@ -/** - * FormatControls.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Internal class containing all TinyMCE specific control types such as - * format listboxes, fontlist boxes, toolbar buttons etc. - * - * @class tinymce.ui.FormatControls - */ -define("tinymce/ui/FormatControls", [ - "tinymce/ui/Control", - "tinymce/ui/Widget", - "tinymce/ui/FloatPanel", - "tinymce/util/Tools", - "tinymce/EditorManager", - "tinymce/Env" -], function(Control, Widget, FloatPanel, Tools, EditorManager, Env) { - var each = Tools.each; - - EditorManager.on('AddEditor', function(e) { - if (e.editor.rtl) { - Control.rtl = true; - } - - registerControls(e.editor); - }); - - Control.translate = function(text) { - return EditorManager.translate(text); - }; - - Widget.tooltips = !Env.iOS; - - function registerControls(editor) { - var formatMenu; - - // Generates a preview for a format - function getPreviewCss(format) { - var name, previewElm, dom = editor.dom; - var previewCss = '', parentFontSize, previewStyles; - - previewStyles = editor.settings.preview_styles; - - // No preview forced - if (previewStyles === false) { - return ''; - } - - // Default preview - if (!previewStyles) { - previewStyles = 'font-family font-size font-weight font-style text-decoration ' + - 'text-transform color background-color border border-radius outline text-shadow'; - } - - // Removes any variables since these can't be previewed - function removeVars(val) { - return val.replace(/%(\w+)/g, ''); - } - - // Create block/inline element to use for preview - format = editor.formatter.get(format); - if (!format) { - return; - } - - format = format[0]; - name = format.block || format.inline || 'span'; - previewElm = dom.create(name); - - // Add format styles to preview element - each(format.styles, function(value, name) { - value = removeVars(value); - - if (value) { - dom.setStyle(previewElm, name, value); - } - }); - - // Add attributes to preview element - each(format.attributes, function(value, name) { - value = removeVars(value); - - if (value) { - dom.setAttrib(previewElm, name, value); - } - }); - - // Add classes to preview element - each(format.classes, function(value) { - value = removeVars(value); - - if (!dom.hasClass(previewElm, value)) { - dom.addClass(previewElm, value); - } - }); - - editor.fire('PreviewFormats'); - - // Add the previewElm outside the visual area - dom.setStyles(previewElm, {position: 'absolute', left: -0xFFFF}); - editor.getBody().appendChild(previewElm); - - // Get parent container font size so we can compute px values out of em/% for older IE:s - parentFontSize = dom.getStyle(editor.getBody(), 'fontSize', true); - parentFontSize = /px$/.test(parentFontSize) ? parseInt(parentFontSize, 10) : 0; - - each(previewStyles.split(' '), function(name) { - var value = dom.getStyle(previewElm, name, true); - - // If background is transparent then check if the body has a background color we can use - if (name == 'background-color' && /transparent|rgba\s*\([^)]+,\s*0\)/.test(value)) { - value = dom.getStyle(editor.getBody(), name, true); - - // Ignore white since it's the default color, not the nicest fix - // TODO: Fix this by detecting runtime style - if (dom.toHex(value).toLowerCase() == '#ffffff') { - return; - } - } - - if (name == 'color') { - // Ignore black since it's the default color, not the nicest fix - // TODO: Fix this by detecting runtime style - if (dom.toHex(value).toLowerCase() == '#000000') { - return; - } - } - - // Old IE won't calculate the font size so we need to do that manually - if (name == 'font-size') { - if (/em|%$/.test(value)) { - if (parentFontSize === 0) { - return; - } - - // Convert font size from em/% to px - value = parseFloat(value, 10) / (/%$/.test(value) ? 100 : 1); - value = (value * parentFontSize) + 'px'; - } - } - - if (name == "border" && value) { - previewCss += 'padding:0 2px;'; - } - - previewCss += name + ':' + value + ';'; - }); - - editor.fire('AfterPreviewFormats'); - - //previewCss += 'line-height:normal'; - - dom.remove(previewElm); - - return previewCss; - } - - function createListBoxChangeHandler(items, formatName) { - return function() { - var self = this; - - editor.on('nodeChange', function(e) { - var formatter = editor.formatter; - var value = null; - - each(e.parents, function(node) { - each(items, function(item) { - if (formatName) { - if (formatter.matchNode(node, formatName, {value: item.value})) { - value = item.value; - } - } else { - if (formatter.matchNode(node, item.value)) { - value = item.value; - } - } - - if (value) { - return false; - } - }); - - if (value) { - return false; - } - }); - - self.value(value); - }); - }; - } - - function createFormats(formats) { - formats = formats.split(';'); - - var i = formats.length; - while (i--) { - formats[i] = formats[i].split('='); - } - - return formats; - } - - function createFormatMenu() { - var count = 0, newFormats = []; - - var defaultStyleFormats = [ - {title: 'Headers', items: [ - {title: 'Header 1', format: 'h1'}, - {title: 'Header 2', format: 'h2'}, - {title: 'Header 3', format: 'h3'}, - {title: 'Header 4', format: 'h4'}, - {title: 'Header 5', format: 'h5'}, - {title: 'Header 6', format: 'h6'} - ]}, - - {title: 'Inline', items: [ - {title: 'Bold', icon: 'bold', format: 'bold'}, - {title: 'Italic', icon: 'italic', format: 'italic'}, - {title: 'Underline', icon: 'underline', format: 'underline'}, - {title: 'Strikethrough', icon: 'strikethrough', format: 'strikethrough'}, - {title: 'Superscript', icon: 'superscript', format: 'superscript'}, - {title: 'Subscript', icon: 'subscript', format: 'subscript'}, - {title: 'Code', icon: 'code', format: 'code'} - ]}, - - {title: 'Blocks', items: [ - {title: 'Paragraph', format: 'p'}, - {title: 'Blockquote', format: 'blockquote'}, - {title: 'Div', format: 'div'}, - {title: 'Pre', format: 'pre'} - ]}, - - {title: 'Alignment', items: [ - {title: 'Left', icon: 'alignleft', format: 'alignleft'}, - {title: 'Center', icon: 'aligncenter', format: 'aligncenter'}, - {title: 'Right', icon: 'alignright', format: 'alignright'}, - {title: 'Justify', icon: 'alignjustify', format: 'alignjustify'} - ]} - ]; - - function createMenu(formats) { - var menu = []; - - if (!formats) { - return; - } - - each(formats, function(format) { - var menuItem = { - text: format.title, - icon: format.icon - }; - - if (format.items) { - menuItem.menu = createMenu(format.items); - } else { - var formatName = format.format || "custom" + count++; - - if (!format.format) { - format.name = formatName; - newFormats.push(format); - } - - menuItem.format = formatName; - } - - menu.push(menuItem); - }); - - return menu; - } - - function createStylesMenu() { - var menu; - - if (editor.settings.style_formats_merge) { - if (editor.settings.style_formats) { - menu = createMenu(defaultStyleFormats.concat(editor.settings.style_formats)); - } else { - menu = createMenu(defaultStyleFormats); - } - } else { - menu = createMenu(editor.settings.style_formats || defaultStyleFormats); - } - - return menu; - } - - editor.on('init', function() { - each(newFormats, function(format) { - editor.formatter.register(format.name, format); - }); - }); - - return { - type: 'menu', - items: createStylesMenu(), - onPostRender: function(e) { - editor.fire('renderFormatsMenu', {control: e.control}); - }, - itemDefaults: { - preview: true, - - textStyle: function() { - if (this.settings.format) { - return getPreviewCss(this.settings.format); - } - }, - - onPostRender: function() { - var self = this, formatName = this.settings.format; - - if (formatName) { - self.parent().on('show', function() { - self.disabled(!editor.formatter.canApply(formatName)); - self.active(editor.formatter.match(formatName)); - }); - } - }, - - onclick: function() { - if (this.settings.format) { - toggleFormat(this.settings.format); - } - } - } - }; - } - - formatMenu = createFormatMenu(); - - // Simple format controls : - each({ - bold: 'Bold', - italic: 'Italic', - underline: 'Underline', - strikethrough: 'Strikethrough', - subscript: 'Subscript', - superscript: 'Superscript' - }, function(text, name) { - editor.addButton(name, { - tooltip: text, - onPostRender: function() { - var self = this; - - // TODO: Fix this - if (editor.formatter) { - editor.formatter.formatChanged(name, function(state) { - self.active(state); - }); - } else { - editor.on('init', function() { - editor.formatter.formatChanged(name, function(state) { - self.active(state); - }); - }); - } - }, - onclick: function() { - toggleFormat(name); - } - }); - }); - - // Simple command controls :[,] - each({ - outdent: ['Decrease indent', 'Outdent'], - indent: ['Increase indent', 'Indent'], - cut: ['Cut', 'Cut'], - copy: ['Copy', 'Copy'], - paste: ['Paste', 'Paste'], - help: ['Help', 'mceHelp'], - selectall: ['Select all', 'SelectAll'], - hr: ['Insert horizontal rule', 'InsertHorizontalRule'], - removeformat: ['Clear formatting', 'RemoveFormat'], - visualaid: ['Visual aids', 'mceToggleVisualAid'], - newdocument: ['New document', 'mceNewDocument'] - }, function(item, name) { - editor.addButton(name, { - tooltip: item[0], - cmd: item[1] - }); - }); - - // Simple command controls with format state - each({ - blockquote: ['Blockquote', 'mceBlockQuote'], - numlist: ['Numbered list', 'InsertOrderedList'], - bullist: ['Bullet list', 'InsertUnorderedList'], - subscript: ['Subscript', 'Subscript'], - superscript: ['Superscript', 'Superscript'], - alignleft: ['Align left', 'JustifyLeft'], - aligncenter: ['Align center', 'JustifyCenter'], - alignright: ['Align right', 'JustifyRight'], - alignjustify: ['Justify', 'JustifyFull'] - }, function(item, name) { - editor.addButton(name, { - tooltip: item[0], - cmd: item[1], - onPostRender: function() { - var self = this; - - // TODO: Fix this - if (editor.formatter) { - editor.formatter.formatChanged(name, function(state) { - self.active(state); - }); - } else { - editor.on('init', function() { - editor.formatter.formatChanged(name, function(state) { - self.active(state); - }); - }); - } - } - }); - }); - - function hasUndo() { - return editor.undoManager ? editor.undoManager.hasUndo() : false; - } - - function hasRedo() { - return editor.undoManager ? editor.undoManager.hasRedo() : false; - } - - function toggleUndoState() { - var self = this; - - self.disabled(!hasUndo()); - editor.on('Undo Redo AddUndo TypingUndo', function() { - self.disabled(!hasUndo()); - }); - } - - function toggleRedoState() { - var self = this; - - self.disabled(!hasRedo()); - editor.on('Undo Redo AddUndo TypingUndo', function() { - self.disabled(!hasRedo()); - }); - } - - function toggleVisualAidState() { - var self = this; - - editor.on('VisualAid', function(e) { - self.active(e.hasVisual); - }); - - self.active(editor.hasVisual); - } - - editor.addButton('undo', { - tooltip: 'Undo', - onPostRender: toggleUndoState, - cmd: 'undo' - }); - - editor.addButton('redo', { - tooltip: 'Redo', - onPostRender: toggleRedoState, - cmd: 'redo' - }); - - editor.addMenuItem('newdocument', { - text: 'New document', - shortcut: 'Ctrl+N', - icon: 'newdocument', - cmd: 'mceNewDocument' - }); - - editor.addMenuItem('undo', { - text: 'Undo', - icon: 'undo', - shortcut: 'Ctrl+Z', - onPostRender: toggleUndoState, - cmd: 'undo' - }); - - editor.addMenuItem('redo', { - text: 'Redo', - icon: 'redo', - shortcut: 'Ctrl+Y', - onPostRender: toggleRedoState, - cmd: 'redo' - }); - - editor.addMenuItem('visualaid', { - text: 'Visual aids', - selectable: true, - onPostRender: toggleVisualAidState, - cmd: 'mceToggleVisualAid' - }); - - each({ - cut: ['Cut', 'Cut', 'Ctrl+X'], - copy: ['Copy', 'Copy', 'Ctrl+C'], - paste: ['Paste', 'Paste', 'Ctrl+V'], - selectall: ['Select all', 'SelectAll', 'Ctrl+A'], - bold: ['Bold', 'Bold', 'Ctrl+B'], - italic: ['Italic', 'Italic', 'Ctrl+I'], - underline: ['Underline', 'Underline'], - strikethrough: ['Strikethrough', 'Strikethrough'], - subscript: ['Subscript', 'Subscript'], - superscript: ['Superscript', 'Superscript'], - removeformat: ['Clear formatting', 'RemoveFormat'] - }, function(item, name) { - editor.addMenuItem(name, { - text: item[0], - icon: name, - shortcut: item[2], - cmd: item[1] - }); - }); - - editor.on('mousedown', function() { - FloatPanel.hideAll(); - }); - - function toggleFormat(fmt) { - if (fmt.control) { - fmt = fmt.control.value(); - } - - if (fmt) { - editor.execCommand('mceToggleFormat', false, fmt); - } - } - - editor.addButton('styleselect', { - type: 'menubutton', - text: 'Formats', - menu: formatMenu - }); - - editor.addButton('formatselect', function() { - var items = [], blocks = createFormats(editor.settings.block_formats || - 'Paragraph=p;' + - 'Address=address;' + - 'Pre=pre;' + - 'Header 1=h1;' + - 'Header 2=h2;' + - 'Header 3=h3;' + - 'Header 4=h4;' + - 'Header 5=h5;' + - 'Header 6=h6' - ); - - each(blocks, function(block) { - items.push({ - text: block[0], - value: block[1], - textStyle: function() { - return getPreviewCss(block[1]); - } - }); - }); - - return { - type: 'listbox', - text: blocks[0][0], - values: items, - fixedWidth: true, - onselect: toggleFormat, - onPostRender: createListBoxChangeHandler(items) - }; - }); - - editor.addButton('fontselect', function() { - var defaultFontsFormats = - 'Andale Mono=andale mono,times;' + - 'Arial=arial,helvetica,sans-serif;' + - 'Arial Black=arial black,avant garde;' + - 'Book Antiqua=book antiqua,palatino;' + - 'Comic Sans MS=comic sans ms,sans-serif;' + - 'Courier New=courier new,courier;' + - 'Georgia=georgia,palatino;' + - 'Helvetica=helvetica;' + - 'Impact=impact,chicago;' + - 'Symbol=symbol;' + - 'Tahoma=tahoma,arial,helvetica,sans-serif;' + - 'Terminal=terminal,monaco;' + - 'Times New Roman=times new roman,times;' + - 'Trebuchet MS=trebuchet ms,geneva;' + - 'Verdana=verdana,geneva;' + - 'Webdings=webdings;' + - 'Wingdings=wingdings,zapf dingbats'; - - var items = [], fonts = createFormats(editor.settings.font_formats || defaultFontsFormats); - - each(fonts, function(font) { - items.push({ - text: {raw: font[0]}, - value: font[1], - textStyle: font[1].indexOf('dings') == -1 ? 'font-family:' + font[1] : '' - }); - }); - - return { - type: 'listbox', - text: 'Font Family', - tooltip: 'Font Family', - values: items, - fixedWidth: true, - onPostRender: createListBoxChangeHandler(items, 'fontname'), - onselect: function(e) { - if (e.control.settings.value) { - editor.execCommand('FontName', false, e.control.settings.value); - } - } - }; - }); - - editor.addButton('fontsizeselect', function() { - var items = [], defaultFontsizeFormats = '8pt 10pt 12pt 14pt 18pt 24pt 36pt'; - var fontsize_formats = editor.settings.fontsize_formats || defaultFontsizeFormats; - - each(fontsize_formats.split(' '), function(item) { - items.push({text: item, value: item}); - }); - - return { - type: 'listbox', - text: 'Font Sizes', - tooltip: 'Font Sizes', - values: items, - fixedWidth: true, - onPostRender: createListBoxChangeHandler(items, 'fontsize'), - onclick: function(e) { - if (e.control.settings.value) { - editor.execCommand('FontSize', false, e.control.settings.value); - } - } - }; - }); - - editor.addMenuItem('formats', { - text: 'Formats', - menu: formatMenu - }); - } -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/GridLayout.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/GridLayout.js deleted file mode 100755 index b4289712276c..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/GridLayout.js +++ /dev/null @@ -1,226 +0,0 @@ -/** - * GridLayout.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This layout manager places controls in a grid. - * - * @setting {Number} spacing Spacing between controls. - * @setting {Number} spacingH Horizontal spacing between controls. - * @setting {Number} spacingV Vertical spacing between controls. - * @setting {Number} columns Number of columns to use. - * @setting {String/Array} alignH start|end|center|stretch or array of values for each column. - * @setting {String/Array} alignV start|end|center|stretch or array of values for each column. - * @setting {String} pack start|end - * - * @class tinymce.ui.GridLayout - * @extends tinymce.ui.AbsoluteLayout - */ -define("tinymce/ui/GridLayout", [ - "tinymce/ui/AbsoluteLayout" -], function(AbsoluteLayout) { - "use strict"; - - return AbsoluteLayout.extend({ - /** - * Recalculates the positions of the controls in the specified container. - * - * @method recalc - * @param {tinymce.ui.Container} container Container instance to recalc. - */ - recalc: function(container) { - var settings = container.settings, rows, cols, items, contLayoutRect, width, height, rect, - ctrlLayoutRect, ctrl, x, y, posX, posY, ctrlSettings, contPaddingBox, align, spacingH, spacingV, alignH, alignV, maxX, maxY, - colWidths = [], rowHeights = [], ctrlMinWidth, ctrlMinHeight, availableWidth, availableHeight; - - // Get layout settings - settings = container.settings; - items = container.items().filter(':visible'); - contLayoutRect = container.layoutRect(); - cols = settings.columns || Math.ceil(Math.sqrt(items.length)); - rows = Math.ceil(items.length / cols); - spacingH = settings.spacingH || settings.spacing || 0; - spacingV = settings.spacingV || settings.spacing || 0; - alignH = settings.alignH || settings.align; - alignV = settings.alignV || settings.align; - contPaddingBox = container._paddingBox; - - if (alignH && typeof(alignH) == "string") { - alignH = [alignH]; - } - - if (alignV && typeof(alignV) == "string") { - alignV = [alignV]; - } - - // Zero padd columnWidths - for (x = 0; x < cols; x++) { - colWidths.push(0); - } - - // Zero padd rowHeights - for (y = 0; y < rows; y++) { - rowHeights.push(0); - } - - // Calculate columnWidths and rowHeights - for (y = 0; y < rows; y++) { - for (x = 0; x < cols; x++) { - ctrl = items[y * cols + x]; - - // Out of bounds - if (!ctrl) { - break; - } - - ctrlLayoutRect = ctrl.layoutRect(); - ctrlMinWidth = ctrlLayoutRect.minW; - ctrlMinHeight = ctrlLayoutRect.minH; - - colWidths[x] = ctrlMinWidth > colWidths[x] ? ctrlMinWidth : colWidths[x]; - rowHeights[y] = ctrlMinHeight > rowHeights[y] ? ctrlMinHeight : rowHeights[y]; - } - } - - // Calculate maxX - availableWidth = contLayoutRect.innerW - contPaddingBox.left - contPaddingBox.right; - for (maxX = 0, x = 0; x < cols; x++) { - maxX += colWidths[x] + (x > 0 ? spacingH : 0); - availableWidth -= (x > 0 ? spacingH : 0) + colWidths[x]; - } - - // Calculate maxY - availableHeight = contLayoutRect.innerH - contPaddingBox.top - contPaddingBox.bottom; - for (maxY = 0, y = 0; y < rows; y++) { - maxY += rowHeights[y] + (y > 0 ? spacingV : 0); - availableHeight -= (y > 0 ? spacingV : 0) + rowHeights[y]; - } - - maxX += contPaddingBox.left + contPaddingBox.right; - maxY += contPaddingBox.top + contPaddingBox.bottom; - - // Calculate minW/minH - rect = {}; - rect.minW = maxX + (contLayoutRect.w - contLayoutRect.innerW); - rect.minH = maxY + (contLayoutRect.h - contLayoutRect.innerH); - - rect.contentW = rect.minW - contLayoutRect.deltaW; - rect.contentH = rect.minH - contLayoutRect.deltaH; - rect.minW = Math.min(rect.minW, contLayoutRect.maxW); - rect.minH = Math.min(rect.minH, contLayoutRect.maxH); - rect.minW = Math.max(rect.minW, contLayoutRect.startMinWidth); - rect.minH = Math.max(rect.minH, contLayoutRect.startMinHeight); - - // Resize container container if minSize was changed - if (contLayoutRect.autoResize && (rect.minW != contLayoutRect.minW || rect.minH != contLayoutRect.minH)) { - rect.w = rect.minW; - rect.h = rect.minH; - - container.layoutRect(rect); - this.recalc(container); - - // Forced recalc for example if items are hidden/shown - if (container._lastRect === null) { - var parentCtrl = container.parent(); - if (parentCtrl) { - parentCtrl._lastRect = null; - parentCtrl.recalc(); - } - } - - return; - } - - // Update contentW/contentH so absEnd moves correctly - if (contLayoutRect.autoResize) { - rect = container.layoutRect(rect); - rect.contentW = rect.minW - contLayoutRect.deltaW; - rect.contentH = rect.minH - contLayoutRect.deltaH; - } - - var flexV; - - if (settings.packV == 'start') { - flexV = 0; - } else { - flexV = availableHeight > 0 ? Math.floor(availableHeight / rows) : 0; - } - - // Calculate totalFlex - var totalFlex = 0; - var flexWidths = settings.flexWidths; - if (flexWidths) { - for (x = 0; x < flexWidths.length; x++) { - totalFlex += flexWidths[x]; - } - } else { - totalFlex = cols; - } - - // Calculate new column widths based on flex values - var ratio = availableWidth / totalFlex; - for (x = 0; x < cols; x++) { - colWidths[x] += flexWidths ? flexWidths[x] * ratio : ratio; - } - - // Move/resize controls - posY = contPaddingBox.top; - for (y = 0; y < rows; y++) { - posX = contPaddingBox.left; - height = rowHeights[y] + flexV; - - for (x = 0; x < cols; x++) { - ctrl = items[y * cols + x]; - - // No more controls to render then break - if (!ctrl) { - break; - } - - // Get control settings and calculate x, y - ctrlSettings = ctrl.settings; - ctrlLayoutRect = ctrl.layoutRect(); - width = Math.max(colWidths[x], ctrlLayoutRect.startMinWidth); - ctrlLayoutRect.x = posX; - ctrlLayoutRect.y = posY; - - // Align control horizontal - align = ctrlSettings.alignH || (alignH ? (alignH[x] || alignH[0]) : null); - if (align == "center") { - ctrlLayoutRect.x = posX + (width / 2) - (ctrlLayoutRect.w / 2); - } else if (align == "right") { - ctrlLayoutRect.x = posX + width - ctrlLayoutRect.w; - } else if (align == "stretch") { - ctrlLayoutRect.w = width; - } - - // Align control vertical - align = ctrlSettings.alignV || (alignV ? (alignV[x] || alignV[0]) : null); - if (align == "center") { - ctrlLayoutRect.y = posY + (height / 2) - (ctrlLayoutRect.h / 2); - } else if (align == "bottom") { - ctrlLayoutRect.y = posY + height - ctrlLayoutRect.h; - } else if (align == "stretch") { - ctrlLayoutRect.h = height; - } - - ctrl.layoutRect(ctrlLayoutRect); - - posX += width + spacingH; - - if (ctrl.recalc) { - ctrl.recalc(); - } - } - - posY += height + spacingV; - } - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Iframe.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Iframe.js deleted file mode 100755 index 93ad3a29a087..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Iframe.js +++ /dev/null @@ -1,83 +0,0 @@ -/** - * Iframe.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*jshint scripturl:true */ - -/** - * This class creates an iframe. - * - * @setting {String} url Url to open in the iframe. - * - * @-x-less Iframe.less - * @class tinymce.ui.Iframe - * @extends tinymce.ui.Widget - */ -define("tinymce/ui/Iframe", [ - "tinymce/ui/Widget" -], function(Widget) { - "use strict"; - - return Widget.extend({ - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this; - - self.addClass('iframe'); - self.canFocus = false; - - return ( - '' - ); - }, - - /** - * Setter for the iframe source. - * - * @method src - * @param {String} src Source URL for iframe. - */ - src: function(src) { - this.getEl().src = src; - }, - - /** - * Inner HTML for the iframe. - * - * @method html - * @param {String} html HTML string to set as HTML inside the iframe. - * @param {function} callback Optional callback to execute when the iframe body is filled with contents. - * @return {tinymce.ui.Iframe} Current iframe control. - */ - html: function(html, callback) { - var self = this, body = this.getEl().contentWindow.document.body; - - // Wait for iframe to initialize IE 10 takes time - if (!body) { - setTimeout(function() { - self.html(html); - }, 0); - } else { - body.innerHTML = html; - - if (callback) { - callback(); - } - } - - return this; - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/KeyboardNavigation.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/KeyboardNavigation.js deleted file mode 100755 index 61acb384e1bc..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/KeyboardNavigation.js +++ /dev/null @@ -1,390 +0,0 @@ -/** - * KeyboardNavigation.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class handles keyboard navigation of controls and elements. - * - * @class tinymce.ui.KeyboardNavigation - */ -define("tinymce/ui/KeyboardNavigation", [ -], function() { - "use strict"; - - /** - * This class handles all keyboard navigation for WAI-ARIA support. Each root container - * gets an instance of this class. - * - * @constructor - */ - return function(settings) { - var root = settings.root, focusedElement, focusedControl; - - focusedElement = document.activeElement; - focusedControl = root.getParentCtrl(focusedElement); - - /** - * Returns the currently focused elements wai aria role of the currently - * focused element or specified element. - * - * @private - * @param {Element} elm Optional element to get role from. - * @return {String} Role of specified element. - */ - function getRole(elm) { - elm = elm || focusedElement; - - return elm && elm.getAttribute('role'); - } - - /** - * Returns the wai role of the parent element of the currently - * focused element or specified element. - * - * @private - * @param {Element} elm Optional element to get parent role from. - * @return {String} Role of the first parent that has a role. - */ - function getParentRole(elm) { - var role, parent = elm || focusedElement; - - while ((parent = parent.parentNode)) { - if ((role = getRole(parent))) { - return role; - } - } - } - - /** - * Returns a wai aria property by name for example aria-selected. - * - * @private - * @param {String} name Name of the aria property to get for example "disabled". - * @return {String} Aria property value. - */ - function getAriaProp(name) { - var elm = focusedElement; - - if (elm) { - return elm.getAttribute('aria-' + name); - } - } - - /** - * Is the element a text input element or not. - * - * @private - * @param {Element} elm Element to check if it's an text input element or not. - * @return {Boolean} True/false if the element is a text element or not. - */ - function isTextInputElement(elm) { - // Notice: since type can be "email" etc we don't check the type - // So all input elements gets treated as text input elements - return elm.tagName == "INPUT" || elm.tagName == "TEXTAREA"; - } - - /** - * Returns true/false if the specified element can be focused or not. - * - * @private - * @param {Element} elm DOM element to check if it can be focused or not. - * @return {Boolean} True/false if the element can have focus. - */ - function canFocus(elm) { - if (isTextInputElement(elm) && !elm.hidden) { - return true; - } - - if (/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell)$/.test(getRole(elm))) { - return true; - } - - return false; - } - - /** - * Returns an array of focusable visible elements within the specified container element. - * - * @private - * @param {Element} elm DOM element to find focusable elements within. - * @return {Array} Array of focusable elements. - */ - function getFocusElements(elm) { - var elements = []; - - function collect(elm) { - if (elm.nodeType != 1 || elm.style.display == 'none') { - return; - } - - if (canFocus(elm)) { - elements.push(elm); - } - - for (var i = 0; i < elm.childNodes.length; i++) { - collect(elm.childNodes[i]); - } - } - - collect(elm || root.getEl()); - - return elements; - } - - /** - * Returns the navigation root control for the specified control. The navigation root - * is the control that the keyboard navigation gets scoped to for example a menubar or toolbar group. - * It will look for parents of the specified target control or the currenty focused control if this option is omitted. - * - * @private - * @param {tinymce.ui.Control} targetControl Optional target control to find root of. - * @return {tinymce.ui.Control} Navigation root control. - */ - function getNavigationRoot(targetControl) { - var navigationRoot, controls; - - targetControl = targetControl || focusedControl; - controls = targetControl.parents().toArray(); - controls.unshift(targetControl); - - for (var i = 0; i < controls.length; i++) { - navigationRoot = controls[i]; - - if (navigationRoot.settings.ariaRoot) { - break; - } - } - - return navigationRoot; - } - - /** - * Focuses the first item in the specified targetControl element or the last aria index if the - * navigation root has the ariaRemember option enabled. - * - * @private - * @param {tinymce.ui.Control} targetControl Target control to focus the first item in. - */ - function focusFirst(targetControl) { - var navigationRoot = getNavigationRoot(targetControl); - var focusElements = getFocusElements(navigationRoot.getEl()); - - if (navigationRoot.settings.ariaRemember && "lastAriaIndex" in navigationRoot) { - moveFocusToIndex(navigationRoot.lastAriaIndex, focusElements); - } else { - moveFocusToIndex(0, focusElements); - } - } - - /** - * Moves the focus to the specified index within the elements list. - * This will scope the index to the size of the element list if it changed. - * - * @private - * @param {Number} idx Specified index to move to. - * @param {Array} elements Array with dom elements to move focus within. - * @return {Number} Input index or a changed index if it was out of range. - */ - function moveFocusToIndex(idx, elements) { - if (idx < 0) { - idx = elements.length - 1; - } else if (idx >= elements.length) { - idx = 0; - } - - if (elements[idx]) { - elements[idx].focus(); - } - - return idx; - } - - /** - * Moves the focus forwards or backwards. - * - * @private - * @param {Number} dir Direction to move in positive means forward, negative means backwards. - * @param {Array} elements Optional array of elements to move within defaults to the current navigation roots elements. - */ - function moveFocus(dir, elements) { - var idx = -1, navigationRoot = getNavigationRoot(); - - elements = elements || getFocusElements(navigationRoot.getEl()); - - for (var i = 0; i < elements.length; i++) { - if (elements[i] === focusedElement) { - idx = i; - } - } - - idx += dir; - navigationRoot.lastAriaIndex = moveFocusToIndex(idx, elements); - } - - /** - * Moves the focus to the left this is called by the left key. - * - * @private - */ - function left() { - var parentRole = getParentRole(); - - if (parentRole == "tablist") { - moveFocus(-1, getFocusElements(focusedElement.parentNode)); - } else if (focusedControl.parent().submenu) { - cancel(); - } else { - moveFocus(-1); - } - } - - /** - * Moves the focus to the right this is called by the right key. - * - * @private - */ - function right() { - var role = getRole(), parentRole = getParentRole(); - - if (parentRole == "tablist") { - moveFocus(1, getFocusElements(focusedElement.parentNode)); - } else if (role == "menuitem" && parentRole == "menu" && getAriaProp('haspopup')) { - enter(); - } else { - moveFocus(1); - } - } - - /** - * Moves the focus to the up this is called by the up key. - * - * @private - */ - function up() { - moveFocus(-1); - } - - /** - * Moves the focus to the up this is called by the down key. - * - * @private - */ - function down() { - var role = getRole(), parentRole = getParentRole(); - - if (role == "menuitem" && parentRole == "menubar") { - enter(); - } else if (role == "button" && getAriaProp('haspopup')) { - enter({key: 'down'}); - } else { - moveFocus(1); - } - } - - /** - * Moves the focus to the next item or previous item depending on shift key. - * - * @private - * @param {DOMEvent} e DOM event object. - */ - function tab(e) { - var parentRole = getParentRole(); - - if (parentRole == "tablist") { - var elm = getFocusElements(focusedControl.getEl('body'))[0]; - - if (elm) { - elm.focus(); - } - } else { - moveFocus(e.shiftKey ? -1 : 1); - } - } - - /** - * Calls the cancel event on the currently focused control. This is normally done using the Esc key. - * - * @private - */ - function cancel() { - focusedControl.fire('cancel'); - } - - /** - * Calls the click event on the currently focused control. This is normally done using the Enter/Space keys. - * - * @private - * @param {Object} aria Optional aria data to pass along with the enter event. - */ - function enter(aria) { - aria = aria || {}; - focusedControl.fire('click', {target: focusedElement, aria: aria}); - } - - root.on('keydown', function(e) { - function handleNonTabEvent(e, handler) { - // Ignore non tab keys for text elements - if (isTextInputElement(focusedElement)) { - return; - } - - if (handler(e) !== false) { - e.preventDefault(); - } - } - - if (e.isDefaultPrevented()) { - return; - } - - switch (e.keyCode) { - case 37: // DOM_VK_LEFT - handleNonTabEvent(e, left); - break; - - case 39: // DOM_VK_RIGHT - handleNonTabEvent(e, right); - break; - - case 38: // DOM_VK_UP - handleNonTabEvent(e, up); - break; - - case 40: // DOM_VK_DOWN - handleNonTabEvent(e, down); - break; - - case 27: // DOM_VK_ESCAPE - handleNonTabEvent(e, cancel); - break; - - case 14: // DOM_VK_ENTER - case 13: // DOM_VK_RETURN - case 32: // DOM_VK_SPACE - handleNonTabEvent(e, enter); - break; - - case 9: // DOM_VK_TAB - if (tab(e) !== false) { - e.preventDefault(); - } - break; - } - }); - - root.on('focusin', function(e) { - focusedElement = e.target; - focusedControl = e.control; - }); - - return { - focusFirst: focusFirst - }; - }; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Label.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Label.js deleted file mode 100755 index 1ecb81081b33..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Label.js +++ /dev/null @@ -1,125 +0,0 @@ -/** - * Label.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class creates a label element. A label is a simple text control - * that can be bound to other controls. - * - * @-x-less Label.less - * @class tinymce.ui.Label - * @extends tinymce.ui.Widget - */ -define("tinymce/ui/Label", [ - "tinymce/ui/Widget", - "tinymce/ui/DomUtils" -], function(Widget, DomUtils) { - "use strict"; - - return Widget.extend({ - /** - * Constructs a instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - * @param {Boolean} multiline Multiline label. - */ - init: function(settings) { - var self = this; - - self._super(settings); - self.addClass('widget'); - self.addClass('label'); - self.canFocus = false; - - if (settings.multiline) { - self.addClass('autoscroll'); - } - - if (settings.strong) { - self.addClass('strong'); - } - }, - - /** - * Initializes the current controls layout rect. - * This will be executed by the layout managers to determine the - * default minWidth/minHeight etc. - * - * @method initLayoutRect - * @return {Object} Layout rect instance. - */ - initLayoutRect: function() { - var self = this, layoutRect = self._super(); - - if (self.settings.multiline) { - var size = DomUtils.getSize(self.getEl()); - - // Check if the text fits within maxW if not then try word wrapping it - if (size.width > layoutRect.maxW) { - layoutRect.minW = layoutRect.maxW; - self.addClass('multiline'); - } - - self.getEl().style.width = layoutRect.minW + 'px'; - layoutRect.startMinH = layoutRect.h = layoutRect.minH = Math.min(layoutRect.maxH, DomUtils.getSize(self.getEl()).height); - } - - return layoutRect; - }, - - /** - * Repaints the control after a layout operation. - * - * @method repaint - */ - repaint: function() { - var self = this; - - if (!self.settings.multiline) { - self.getEl().style.lineHeight = self.layoutRect().h + 'px'; - } - - return self._super(); - }, - - /** - * Sets/gets the current label text. - * - * @method text - * @param {String} [text] New label text. - * @return {String|tinymce.ui.Label} Current text or current label instance. - */ - text: function(text) { - var self = this; - - if (self._rendered && text) { - this.innerHtml(self.encode(text)); - } - - return self._super(text); - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, forId = self.settings.forId; - - return ( - '' - ); - } - }); -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Layout.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Layout.js deleted file mode 100755 index 7fd3f1d93b30..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Layout.js +++ /dev/null @@ -1,114 +0,0 @@ -/** - * Layout.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Base layout manager class. - * - * @class tinymce.ui.Layout - */ -define("tinymce/ui/Layout", [ - "tinymce/util/Class", - "tinymce/util/Tools" -], function(Class, Tools) { - "use strict"; - - return Class.extend({ - Defaults: { - firstControlClass: 'first', - lastControlClass: 'last' - }, - - /** - * Constructs a layout instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - */ - init: function(settings) { - this.settings = Tools.extend({}, this.Defaults, settings); - }, - - /** - * This method gets invoked before the layout renders the controls. - * - * @method preRender - * @param {tinymce.ui.Container} container Container instance to preRender. - */ - preRender: function(container) { - container.addClass(this.settings.containerClass, 'body'); - }, - - /** - * Applies layout classes to the container. - * - * @private - */ - applyClasses: function(container) { - var self = this, settings = self.settings, items, firstClass, lastClass; - - items = container.items().filter(':visible'); - firstClass = settings.firstControlClass; - lastClass = settings.lastControlClass; - - items.each(function(item) { - item.removeClass(firstClass).removeClass(lastClass); - - if (settings.controlClass) { - item.addClass(settings.controlClass); - } - }); - - items.eq(0).addClass(firstClass); - items.eq(-1).addClass(lastClass); - }, - - /** - * Renders the specified container and any layout specific HTML. - * - * @method renderHtml - * @param {tinymce.ui.Container} container Container to render HTML for. - */ - renderHtml: function(container) { - var self = this, settings = self.settings, items, html = ''; - - items = container.items(); - items.eq(0).addClass(settings.firstControlClass); - items.eq(-1).addClass(settings.lastControlClass); - - items.each(function(item) { - if (settings.controlClass) { - item.addClass(settings.controlClass); - } - - html += item.renderHtml(); - }); - - return html; - }, - - /** - * Recalculates the positions of the controls in the specified container. - * - * @method recalc - * @param {tinymce.ui.Container} container Container instance to recalc. - */ - recalc: function() { - }, - - /** - * This method gets invoked after the layout renders the controls. - * - * @method postRender - * @param {tinymce.ui.Container} container Container instance to postRender. - */ - postRender: function() { - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/ListBox.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/ListBox.js deleted file mode 100755 index d42fc9da3bd3..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/ListBox.js +++ /dev/null @@ -1,125 +0,0 @@ -/** - * ListBox.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a new list box control. - * - * @-x-less ListBox.less - * @class tinymce.ui.ListBox - * @extends tinymce.ui.MenuButton - */ -define("tinymce/ui/ListBox", [ - "tinymce/ui/MenuButton" -], function(MenuButton) { - "use strict"; - - return MenuButton.extend({ - /** - * Constructs a instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - * @setting {Array} values Array with values to add to list box. - */ - init: function(settings) { - var self = this, values, i, selected, selectedText, lastItemCtrl; - - self._values = values = settings.values; - if (values) { - for (i = 0; i < values.length; i++) { - selected = values[i].selected || settings.value === values[i].value; - - if (selected) { - selectedText = selectedText || values[i].text; - self._value = values[i].value; - break; - } - } - - // Default with first item - if (!selected && values.length > 0) { - selectedText = values[0].text; - self._value = values[0].value; - } - - settings.menu = values; - } - - settings.text = settings.text || selectedText || values[0].text; - - self._super(settings); - self.addClass('listbox'); - - self.on('select', function(e) { - var ctrl = e.control; - - if (lastItemCtrl) { - e.lastControl = lastItemCtrl; - } - - if (settings.multiple) { - ctrl.active(!ctrl.active()); - } else { - self.value(e.control.settings.value); - } - - lastItemCtrl = ctrl; - }); - }, - - /** - * Getter/setter function for the control value. - * - * @method value - * @param {String} [value] Value to be set. - * @return {Boolean/tinymce.ui.ListBox} Value or self if it's a set operation. - */ - value: function(value) { - var self = this, active, selectedText, menu, i; - - function activateByValue(menu, value) { - menu.items().each(function(ctrl) { - active = ctrl.value() === value; - - if (active) { - selectedText = selectedText || ctrl.text(); - } - - ctrl.active(active); - - if (ctrl.menu) { - activateByValue(ctrl.menu, value); - } - }); - } - - if (typeof(value) != "undefined") { - if (self.menu) { - activateByValue(self.menu, value); - } else { - menu = self.settings.menu; - for (i = 0; i < menu.length; i++) { - active = menu[i].value == value; - - if (active) { - selectedText = selectedText || menu[i].text; - } - - menu[i].active = active; - } - } - - self.text(selectedText || this.settings.text); - } - - return self._super(value); - } - }); -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Menu.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Menu.js deleted file mode 100755 index 5efdd3f7aea7..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Menu.js +++ /dev/null @@ -1,140 +0,0 @@ -/** - * Menu.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a new menu. - * - * @-x-less Menu.less - * @class tinymce.ui.Menu - * @extends tinymce.ui.FloatPanel - */ -define("tinymce/ui/Menu", [ - "tinymce/ui/FloatPanel", - "tinymce/ui/MenuItem", - "tinymce/util/Tools" -], function(FloatPanel, MenuItem, Tools) { - "use strict"; - - var Menu = FloatPanel.extend({ - Defaults: { - defaultType: 'menuitem', - border: 1, - layout: 'stack', - role: 'application', - bodyRole: 'menu', - ariaRoot: true - }, - - /** - * Constructs a instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - */ - init: function(settings) { - var self = this; - - settings.autohide = true; - settings.constrainToViewport = true; - - if (settings.itemDefaults) { - var items = settings.items, i = items.length; - - while (i--) { - items[i] = Tools.extend({}, settings.itemDefaults, items[i]); - } - } - - self._super(settings); - self.addClass('menu'); - }, - - /** - * Repaints the control after a layout operation. - * - * @method repaint - */ - repaint: function() { - this.toggleClass('menu-align', true); - - this._super(); - - this.getEl().style.height = ''; - this.getEl('body').style.height = ''; - - return this; - }, - - /** - * Hides/closes the menu. - * - * @method cancel - */ - cancel: function() { - var self = this; - - self.hideAll(); - self.fire('select'); - }, - - /** - * Hide menu and all sub menus. - * - * @method hideAll - */ - hideAll: function() { - var self = this; - - this.find('menuitem').exec('hideMenu'); - - return self._super(); - }, -/* - getContainerElm: function() { - var doc = document, id = this.classPrefix + 'menucontainer'; - - var elm = doc.getElementById(id); - if (!elm) { - elm = doc.createElement('div'); - elm.id = id; - elm.setAttribute('role', 'application'); - elm.className = this.classPrefix + '-reset'; - elm.style.position = 'absolute'; - elm.style.top = elm.style.left = '0'; - elm.style.overflow = 'visible'; - doc.body.appendChild(elm); - } - - return elm; - }, -*/ - /** - * Invoked before the menu is rendered. - * - * @method preRender - */ - preRender: function() { - var self = this; - - self.items().each(function(ctrl) { - var settings = ctrl.settings; - - if (settings.icon || settings.selectable) { - self._hasIcons = true; - return false; - } - }); - - return self._super(); - } - }); - - return Menu; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/MenuBar.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/MenuBar.js deleted file mode 100755 index 385f30984c04..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/MenuBar.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * MenuBar.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a new menubar. - * - * @-x-less MenuBar.less - * @class tinymce.ui.MenuBar - * @extends tinymce.ui.Container - */ -define("tinymce/ui/MenuBar", [ - "tinymce/ui/Toolbar" -], function(Toolbar) { - "use strict"; - - return Toolbar.extend({ - Defaults: { - role: 'menubar', - containerCls: 'menubar', - ariaRoot: true, - defaults: { - type: 'menubutton' - } - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/MenuButton.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/MenuButton.js deleted file mode 100755 index 385916e277f5..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/MenuButton.js +++ /dev/null @@ -1,244 +0,0 @@ -/** - * MenuButton.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a new menu button. - * - * @-x-less MenuButton.less - * @class tinymce.ui.MenuButton - * @extends tinymce.ui.Button - */ -define("tinymce/ui/MenuButton", [ - "tinymce/ui/Button", - "tinymce/ui/Factory", - "tinymce/ui/MenuBar" -], function(Button, Factory, MenuBar) { - "use strict"; - - // TODO: Maybe add as some global function - function isChildOf(node, parent) { - while (node) { - if (parent === node) { - return true; - } - - node = node.parentNode; - } - - return false; - } - - var MenuButton = Button.extend({ - /** - * Constructs a instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - */ - init: function(settings) { - var self = this; - - self._renderOpen = true; - self._super(settings); - - self.addClass('menubtn'); - - if (settings.fixedWidth) { - self.addClass('fixed-width'); - } - - self.aria('haspopup', true); - self.hasPopup = true; - }, - - /** - * Shows the menu for the button. - * - * @method showMenu - */ - showMenu: function() { - var self = this, settings = self.settings, menu; - - if (self.menu && self.menu.visible()) { - return self.hideMenu(); - } - - if (!self.menu) { - menu = settings.menu || []; - - // Is menu array then auto constuct menu control - if (menu.length) { - menu = { - type: 'menu', - items: menu - }; - } else { - menu.type = menu.type || 'menu'; - } - - self.menu = Factory.create(menu).parent(self).renderTo(); - self.fire('createmenu'); - self.menu.reflow(); - self.menu.on('cancel', function(e) { - if (e.control.parent() === self.menu) { - e.stopPropagation(); - self.focus(); - self.hideMenu(); - } - }); - - // Move focus to button when a menu item is selected/clicked - self.menu.on('select', function() { - self.focus(); - }); - - self.menu.on('show hide', function(e) { - if (e.control == self.menu) { - self.activeMenu(e.type == 'show'); - } - - self.aria('expanded', e.type == 'show'); - }).fire('show'); - } - - self.menu.show(); - self.menu.layoutRect({w: self.layoutRect().w}); - self.menu.moveRel(self.getEl(), self.isRtl() ? ['br-tr', 'tr-br'] : ['bl-tl', 'tl-bl']); - }, - - /** - * Hides the menu for the button. - * - * @method hideMenu - */ - hideMenu: function() { - var self = this; - - if (self.menu) { - self.menu.items().each(function(item) { - if (item.hideMenu) { - item.hideMenu(); - } - }); - - self.menu.hide(); - } - }, - - /** - * Sets the active menu state. - * - * @private - */ - activeMenu: function(state) { - this.toggleClass('active', state); - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, id = self._id, prefix = self.classPrefix; - var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : ''; - - self.aria('role', self.parent() instanceof MenuBar ? 'menuitem' : 'button'); - - return ( - '
    ' + - '' + - '
    ' - ); - }, - - /** - * Gets invoked after the control has been rendered. - * - * @method postRender - */ - postRender: function() { - var self = this; - - self.on('click', function(e) { - if (e.control === self && isChildOf(e.target, self.getEl())) { - self.showMenu(); - - if (e.aria) { - self.menu.items()[0].focus(); - } - } - }); - - self.on('mouseenter', function(e) { - var overCtrl = e.control, parent = self.parent(), hasVisibleSiblingMenu; - - if (overCtrl && parent && overCtrl instanceof MenuButton && overCtrl.parent() == parent) { - parent.items().filter('MenuButton').each(function(ctrl) { - if (ctrl.hideMenu && ctrl != overCtrl) { - if (ctrl.menu && ctrl.menu.visible()) { - hasVisibleSiblingMenu = true; - } - - ctrl.hideMenu(); - } - }); - - if (hasVisibleSiblingMenu) { - overCtrl.focus(); // Fix for: #5887 - overCtrl.showMenu(); - } - } - }); - - return self._super(); - }, - - /** - * Sets/gets the current button text. - * - * @method text - * @param {String} [text] New button text. - * @return {String|tinymce.ui.MenuButton} Current text or current MenuButton instance. - */ - text: function(text) { - var self = this, i, children; - - if (self._rendered) { - children = self.getEl('open').getElementsByTagName('span'); - for (i = 0; i < children.length; i++) { - children[i].innerHTML = (self.settings.icon && text ? '\u00a0' : '') + self.encode(text); - } - } - - return this._super(text); - }, - - /** - * Removes the control and it's menus. - * - * @method remove - */ - remove: function() { - this._super(); - - if (this.menu) { - this.menu.remove(); - } - } - }); - - return MenuButton; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/MenuItem.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/MenuItem.js deleted file mode 100755 index dac8af1a7e5a..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/MenuItem.js +++ /dev/null @@ -1,292 +0,0 @@ -/** - * MenuItem.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a new menu item. - * - * @-x-less MenuItem.less - * @class tinymce.ui.MenuItem - * @extends tinymce.ui.Control - */ -define("tinymce/ui/MenuItem", [ - "tinymce/ui/Widget", - "tinymce/ui/Factory", - "tinymce/Env" -], function(Widget, Factory, Env) { - "use strict"; - - return Widget.extend({ - Defaults: { - border: 0, - role: 'menuitem' - }, - - /** - * Constructs a instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - * @setting {Boolean} selectable Selectable menu. - * @setting {Array} menu Submenu array with items. - * @setting {String} shortcut Shortcut to display for menu item. Example: Ctrl+X - */ - init: function(settings) { - var self = this; - - self.hasPopup = true; - - self._super(settings); - - settings = self.settings; - - self.addClass('menu-item'); - - if (settings.menu) { - self.addClass('menu-item-expand'); - } - - if (settings.preview) { - self.addClass('menu-item-preview'); - } - - if (self._text === '-' || self._text === '|') { - self.addClass('menu-item-sep'); - self.aria('role', 'separator'); - self._text = '-'; - } - - if (settings.selectable) { - self.aria('role', 'menuitemcheckbox'); - self.addClass('menu-item-checkbox'); - settings.icon = 'selected'; - } - - if (!settings.preview && !settings.selectable) { - self.addClass('menu-item-normal'); - } - - self.on('mousedown', function(e) { - e.preventDefault(); - }); - - if (settings.menu) { - self.aria('haspopup', true); - } - }, - - /** - * Returns true/false if the menuitem has sub menu. - * - * @method hasMenus - * @return {Boolean} True/false state if it has submenu. - */ - hasMenus: function() { - return !!this.settings.menu; - }, - - /** - * Shows the menu for the menu item. - * - * @method showMenu - */ - showMenu: function() { - var self = this, settings = self.settings, menu, parent = self.parent(); - - parent.items().each(function(ctrl) { - if (ctrl !== self) { - ctrl.hideMenu(); - } - }); - - if (settings.menu) { - menu = self.menu; - - if (!menu) { - menu = settings.menu; - - // Is menu array then auto constuct menu control - if (menu.length) { - menu = { - type: 'menu', - items: menu - }; - } else { - menu.type = menu.type || 'menu'; - } - - if (parent.settings.itemDefaults) { - menu.itemDefaults = parent.settings.itemDefaults; - } - - menu = self.menu = Factory.create(menu).parent(self).renderTo(); - menu.reflow(); - menu.fire('show'); - menu.on('cancel', function(e) { - e.stopPropagation(); - self.focus(); - menu.hide(); - }); - - menu.on('hide', function(e) { - if (e.control === menu) { - self.removeClass('selected'); - } - }); - - menu.submenu = true; - } else { - menu.show(); - } - - menu._parentMenu = parent; - - menu.addClass('menu-sub'); - - var rel = menu.testMoveRel( - self.getEl(), - self.isRtl() ? ['tl-tr', 'bl-br', 'tr-tl', 'br-bl'] : ['tr-tl', 'br-bl', 'tl-tr', 'bl-br'] - ); - - menu.moveRel(self.getEl(), rel); - menu.rel = rel; - - rel = 'menu-sub-' + rel; - menu.removeClass(menu._lastRel); - menu.addClass(rel); - menu._lastRel = rel; - - self.addClass('selected'); - self.aria('expanded', true); - } - }, - - /** - * Hides the menu for the menu item. - * - * @method hideMenu - */ - hideMenu: function() { - var self = this; - - if (self.menu) { - self.menu.items().each(function(item) { - if (item.hideMenu) { - item.hideMenu(); - } - }); - - self.menu.hide(); - self.aria('expanded', false); - } - - return self; - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, id = self._id, settings = self.settings, prefix = self.classPrefix, text = self.encode(self._text); - var icon = self.settings.icon, image = '', shortcut = settings.shortcut; - - if (icon) { - self.parent().addClass('menu-has-icons'); - } - - if (settings.image) { - icon = 'none'; - image = ' style="background-image: url(\'' + settings.image + '\')"'; - } - - if (shortcut && Env.mac) { - // format shortcut for Mac - shortcut = shortcut.replace(/ctrl\+alt\+/i, '⌥⌘'); // ctrl+cmd - shortcut = shortcut.replace(/ctrl\+/i, '⌘'); // ctrl symbol - shortcut = shortcut.replace(/alt\+/i, '⌥'); // cmd symbol - shortcut = shortcut.replace(/shift\+/i, '⇧'); // shift symbol - } - - icon = prefix + 'ico ' + prefix + 'i-' + (self.settings.icon || 'none'); - - return ( - '
    ' + - (text !== '-' ? ' ' : '') + - (text !== '-' ? '' + text + '' : '') + - (shortcut ? '
    ' + shortcut + '
    ' : '') + - (settings.menu ? '
    ' : '') + - '
    ' - ); - }, - - /** - * Gets invoked after the control has been rendered. - * - * @method postRender - */ - postRender: function() { - var self = this, settings = self.settings; - - var textStyle = settings.textStyle; - if (typeof(textStyle) == "function") { - textStyle = textStyle.call(this); - } - - if (textStyle) { - var textElm = self.getEl('text'); - if (textElm) { - textElm.setAttribute('style', textStyle); - } - } - - self.on('mouseenter click', function(e) { - if (e.control === self) { - if (!settings.menu && e.type === 'click') { - self.fire('select'); - self.parent().hideAll(); - } else { - self.showMenu(); - - if (e.aria) { - self.menu.focus(true); - } - } - } - }); - - self._super(); - - return self; - }, - - active: function(state) { - if (typeof(state) != "undefined") { - this.aria('checked', state); - } - - return this._super(state); - }, - - /** - * Removes the control and it's menus. - * - * @method remove - */ - remove: function() { - this._super(); - - if (this.menu) { - this.menu.remove(); - } - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/MessageBox.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/MessageBox.js deleted file mode 100755 index 5da41817a02f..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/MessageBox.js +++ /dev/null @@ -1,205 +0,0 @@ -/** - * MessageBox.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class is used to create MessageBoxes like alerts/confirms etc. - * - * @class tinymce.ui.Window - * @extends tinymce.ui.FloatPanel - */ -define("tinymce/ui/MessageBox", [ - "tinymce/ui/Window" -], function(Window) { - "use strict"; - - var MessageBox = Window.extend({ - /** - * Constructs a instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - */ - init: function(settings) { - settings = { - border: 1, - padding: 20, - layout: 'flex', - pack: "center", - align: "center", - containerCls: 'panel', - autoScroll: true, - buttons: {type: "button", text: "Ok", action: "ok"}, - items: { - type: "label", - multiline: true, - maxWidth: 500, - maxHeight: 200 - } - }; - - this._super(settings); - }, - - Statics: { - /** - * Ok buttons constant. - * - * @static - * @final - * @field {Number} OK - */ - OK: 1, - - /** - * Ok/cancel buttons constant. - * - * @static - * @final - * @field {Number} OK_CANCEL - */ - OK_CANCEL: 2, - - /** - * yes/no buttons constant. - * - * @static - * @final - * @field {Number} YES_NO - */ - YES_NO: 3, - - /** - * yes/no/cancel buttons constant. - * - * @static - * @final - * @field {Number} YES_NO_CANCEL - */ - YES_NO_CANCEL: 4, - - /** - * Constructs a new message box and renders it to the body element. - * - * @static - * @method msgBox - * @param {Object} settings Name/value object with settings. - */ - msgBox: function(settings) { - var buttons, callback = settings.callback || function() {}; - - switch (settings.buttons) { - case MessageBox.OK_CANCEL: - buttons = [ - {type: "button", text: "Ok", subtype: "primary", onClick: function(e) { - e.control.parents()[1].close(); - callback(true); - }}, - - {type: "button", text: "Cancel", onClick: function(e) { - e.control.parents()[1].close(); - callback(false); - }} - ]; - break; - - case MessageBox.YES_NO: - buttons = [ - {type: "button", text: "Ok", subtype: "primary", onClick: function(e) { - e.control.parents()[1].close(); - callback(true); - }} - ]; - break; - - case MessageBox.YES_NO_CANCEL: - buttons = [ - {type: "button", text: "Ok", subtype: "primary", onClick: function(e) { - e.control.parents()[1].close(); - }} - ]; - break; - - default: - buttons = [ - {type: "button", text: "Ok", subtype: "primary", onClick: function(e) { - e.control.parents()[1].close(); - callback(true); - }} - ]; - break; - } - - return new Window({ - padding: 20, - x: settings.x, - y: settings.y, - minWidth: 300, - minHeight: 100, - layout: "flex", - pack: "center", - align: "center", - buttons: buttons, - title: settings.title, - role: 'alertdialog', - items: { - type: "label", - multiline: true, - maxWidth: 500, - maxHeight: 200, - text: settings.text - }, - onPostRender: function() { - this.aria('describedby', this.items()[0]._id); - }, - onClose: settings.onClose, - onCancel: function() { - callback(false); - } - }).renderTo(document.body).reflow(); - }, - - /** - * Creates a new alert dialog. - * - * @method alert - * @param {Object} settings Settings for the alert dialog. - * @param {function} [callback] Callback to execute when the user makes a choice. - */ - alert: function(settings, callback) { - if (typeof(settings) == "string") { - settings = {text: settings}; - } - - settings.callback = callback; - return MessageBox.msgBox(settings); - }, - - /** - * Creates a new confirm dialog. - * - * @method confirm - * @param {Object} settings Settings for the confirm dialog. - * @param {function} [callback] Callback to execute when the user makes a choice. - */ - confirm: function(settings, callback) { - if (typeof(settings) == "string") { - settings = {text: settings}; - } - - settings.callback = callback; - settings.buttons = MessageBox.OK_CANCEL; - - return MessageBox.msgBox(settings); - } - } - }); - - return MessageBox; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Movable.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Movable.js deleted file mode 100755 index 8370354e2c12..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Movable.js +++ /dev/null @@ -1,200 +0,0 @@ -/** - * Movable.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Movable mixin. Makes controls movable absolute and relative to other elements. - * - * @mixin tinymce.ui.Movable - */ -define("tinymce/ui/Movable", [ - "tinymce/ui/DomUtils" -], function(DomUtils) { - "use strict"; - - function calculateRelativePosition(ctrl, targetElm, rel) { - var ctrlElm, pos, x, y, selfW, selfH, targetW, targetH, viewport, size; - - viewport = DomUtils.getViewPort(); - - // Get pos of target - pos = DomUtils.getPos(targetElm); - x = pos.x; - y = pos.y; - - if (ctrl._fixed) { - x -= viewport.x; - y -= viewport.y; - } - - // Get size of self - ctrlElm = ctrl.getEl(); - size = DomUtils.getSize(ctrlElm); - selfW = size.width; - selfH = size.height; - - // Get size of target - size = DomUtils.getSize(targetElm); - targetW = size.width; - targetH = size.height; - - // Parse align string - rel = (rel || '').split(''); - - // Target corners - if (rel[0] === 'b') { - y += targetH; - } - - if (rel[1] === 'r') { - x += targetW; - } - - if (rel[0] === 'c') { - y += Math.round(targetH / 2); - } - - if (rel[1] === 'c') { - x += Math.round(targetW / 2); - } - - // Self corners - if (rel[3] === 'b') { - y -= selfH; - } - - if (rel[4] === 'r') { - x -= selfW; - } - - if (rel[3] === 'c') { - y -= Math.round(selfH / 2); - } - - if (rel[4] === 'c') { - x -= Math.round(selfW / 2); - } - - return { - x: x, - y: y, - w: selfW, - h: selfH - }; - } - - return { - /** - * Tests various positions to get the most suitable one. - * - * @method testMoveRel - * @param {DOMElement} elm Element to position against. - * @param {Array} rels Array with relative positions. - * @return {String} Best suitable relative position. - */ - testMoveRel: function(elm, rels) { - var viewPortRect = DomUtils.getViewPort(); - - for (var i = 0; i < rels.length; i++) { - var pos = calculateRelativePosition(this, elm, rels[i]); - - if (this._fixed) { - if (pos.x > 0 && pos.x + pos.w < viewPortRect.w && pos.y > 0 && pos.y + pos.h < viewPortRect.h) { - return rels[i]; - } - } else { - if (pos.x > viewPortRect.x && pos.x + pos.w < viewPortRect.w + viewPortRect.x && - pos.y > viewPortRect.y && pos.y + pos.h < viewPortRect.h + viewPortRect.y) { - return rels[i]; - } - } - } - - return rels[0]; - }, - - /** - * Move relative to the specified element. - * - * @method moveRel - * @param {Element} elm Element to move relative to. - * @param {String} rel Relative mode. For example: br-tl. - * @return {tinymce.ui.Control} Current control instance. - */ - moveRel: function(elm, rel) { - if (typeof(rel) != 'string') { - rel = this.testMoveRel(elm, rel); - } - - var pos = calculateRelativePosition(this, elm, rel); - return this.moveTo(pos.x, pos.y); - }, - - /** - * Move by a relative x, y values. - * - * @method moveBy - * @param {Number} dx Relative x position. - * @param {Number} dy Relative y position. - * @return {tinymce.ui.Control} Current control instance. - */ - moveBy: function(dx, dy) { - var self = this, rect = self.layoutRect(); - - self.moveTo(rect.x + dx, rect.y + dy); - - return self; - }, - - /** - * Move to absolute position. - * - * @method moveTo - * @param {Number} x Absolute x position. - * @param {Number} y Absolute y position. - * @return {tinymce.ui.Control} Current control instance. - */ - moveTo: function(x, y) { - var self = this; - - // TODO: Move this to some global class - function contrain(value, max, size) { - if (value < 0) { - return 0; - } - - if (value + size > max) { - value = max - size; - return value < 0 ? 0 : value; - } - - return value; - } - - if (self.settings.constrainToViewport) { - var viewPortRect = DomUtils.getViewPort(window); - var layoutRect = self.layoutRect(); - - x = contrain(x, viewPortRect.w + viewPortRect.x, layoutRect.w); - y = contrain(y, viewPortRect.h + viewPortRect.y, layoutRect.h); - } - - if (self._rendered) { - self.layoutRect({x: x, y: y}).repaint(); - } else { - self.settings.x = x; - self.settings.y = y; - } - - self.fire('move', {x: x, y: y}); - - return self; - } - }; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Panel.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Panel.js deleted file mode 100755 index 1420ecd0cc97..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Panel.js +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Panel.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a new panel. - * - * @-x-less Panel.less - * @class tinymce.ui.Panel - * @extends tinymce.ui.Container - * @mixes tinymce.ui.Scrollable - */ -define("tinymce/ui/Panel", [ - "tinymce/ui/Container", - "tinymce/ui/Scrollable" -], function(Container, Scrollable) { - "use strict"; - - return Container.extend({ - Defaults: { - layout: 'fit', - containerCls: 'panel' - }, - - Mixins: [Scrollable], - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, layout = self._layout, innerHtml = self.settings.html; - - self.preRender(); - layout.preRender(self); - - if (typeof(innerHtml) == "undefined") { - innerHtml = ( - '
    ' + - layout.renderHtml(self) + - '
    ' - ); - } else { - if (typeof(innerHtml) == 'function') { - innerHtml = innerHtml.call(self); - } - - self._hasBody = false; - } - - return ( - '
    ' + - (self._preBodyHtml || '') + - innerHtml + - '
    ' - ); - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/PanelButton.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/PanelButton.js deleted file mode 100755 index 9505d3398f46..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/PanelButton.js +++ /dev/null @@ -1,105 +0,0 @@ -/** - * PanelButton.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a new panel button. - * - * @class tinymce.ui.PanelButton - * @extends tinymce.ui.Button - */ -define("tinymce/ui/PanelButton", [ - "tinymce/ui/Button", - "tinymce/ui/FloatPanel" -], function(Button, FloatPanel) { - "use strict"; - - return Button.extend({ - /** - * Shows the panel for the button. - * - * @method showPanel - */ - showPanel: function() { - var self = this, settings = self.settings; - - self.active(true); - - if (!self.panel) { - var panelSettings = settings.panel; - - // Wrap panel in grid layout if type if specified - // This makes it possible to add forms or other containers directly in the panel option - if (panelSettings.type) { - panelSettings = { - layout: 'grid', - items: panelSettings - }; - } - - panelSettings.role = panelSettings.role || 'dialog'; - panelSettings.popover = true; - panelSettings.autohide = true; - panelSettings.ariaRoot = true; - - self.panel = new FloatPanel(panelSettings).on('hide', function() { - self.active(false); - }).on('cancel', function(e) { - e.stopPropagation(); - self.focus(); - self.hidePanel(); - }).parent(self).renderTo(self.getContainerElm()); - - self.panel.fire('show'); - self.panel.reflow(); - } else { - self.panel.show(); - } - - self.panel.moveRel(self.getEl(), settings.popoverAlign || (self.isRtl() ? ['bc-tr', 'bc-tc'] : ['bc-tl', 'bc-tc'])); - }, - - /** - * Hides the panel for the button. - * - * @method hidePanel - */ - hidePanel: function() { - var self = this; - - if (self.panel) { - self.panel.hide(); - } - }, - - /** - * Called after the control has been rendered. - * - * @method postRender - */ - postRender: function() { - var self = this; - - self.aria('haspopup', true); - - self.on('click', function(e) { - if (e.control === self) { - if (self.panel && self.panel.visible()) { - self.hidePanel(); - } else { - self.showPanel(); - self.panel.focus(!!e.aria); - } - } - }); - - return self._super(); - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Path.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Path.js deleted file mode 100755 index edf516304d27..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Path.js +++ /dev/null @@ -1,140 +0,0 @@ -/** - * Path.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a new path control. - * - * @-x-less Path.less - * @class tinymce.ui.Path - * @extends tinymce.ui.Widget - */ -define("tinymce/ui/Path", [ - "tinymce/ui/Widget" -], function(Widget) { - "use strict"; - - return Widget.extend({ - /** - * Constructs a instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - * @setting {String} delimiter Delimiter to display between items in path. - */ - init: function(settings) { - var self = this; - - if (!settings.delimiter) { - settings.delimiter = '\u00BB'; - } - - self._super(settings); - self.addClass('path'); - self.canFocus = true; - - self.on('click', function(e) { - var index, target = e.target; - - if ((index = target.getAttribute('data-index'))) { - self.fire('select', {value: self.data()[index], index: index}); - } - }); - }, - - /** - * Focuses the current control. - * - * @method focus - * @return {tinymce.ui.Control} Current control instance. - */ - focus: function() { - var self = this; - - self.getEl().firstChild.focus(); - - return self; - }, - - /** - * Sets/gets the data to be used for the path. - * - * @method data - * @param {Array} data Array with items name is rendered to path. - */ - data: function(data) { - var self = this; - - if (typeof(data) !== "undefined") { - self._data = data; - self.update(); - - return self; - } - - return self._data; - }, - - /** - * Updated the path. - * - * @private - */ - update: function() { - this.innerHtml(this._getPathHtml()); - }, - - /** - * Called after the control has been rendered. - * - * @method postRender - */ - postRender: function() { - var self = this; - - self._super(); - - self.data(self.settings.data); - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this; - - return ( - '
    ' + - self._getPathHtml() + - '
    ' - ); - }, - - _getPathHtml: function() { - var self = this, parts = self._data || [], i, l, html = '', prefix = self.classPrefix; - - for (i = 0, l = parts.length; i < l; i++) { - html += ( - (i > 0 ? '' : '') + - '
    ' + parts[i].name + '
    ' - ); - } - - if (!html) { - html = '
     
    '; - } - - return html; - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Radio.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Radio.js deleted file mode 100755 index 056968c99dae..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Radio.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Radio.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a new radio button. - * - * @-x-less Radio.less - * @class tinymce.ui.Radio - * @extends tinymce.ui.Checkbox - */ -define("tinymce/ui/Radio", [ - "tinymce/ui/Checkbox" -], function(Checkbox) { - "use strict"; - - return Checkbox.extend({ - Defaults: { - classes: "radio", - role: "radio" - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Resizable.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Resizable.js deleted file mode 100755 index 5933efbddcc7..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Resizable.js +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Resizable.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Resizable mixin. Enables controls to be resized. - * - * @mixin tinymce.ui.Resizable - */ -define("tinymce/ui/Resizable", [ - "tinymce/ui/DomUtils" -], function(DomUtils) { - "use strict"; - - return { - /** - * Resizes the control to contents. - * - * @method resizeToContent - */ - resizeToContent: function() { - this._layoutRect.autoResize = true; - this._lastRect = null; - this.reflow(); - }, - - /** - * Resizes the control to a specific width/height. - * - * @method resizeTo - * @param {Number} w Control width. - * @param {Number} h Control height. - * @return {tinymce.ui.Control} Current control instance. - */ - resizeTo: function(w, h) { - // TODO: Fix hack - if (w <= 1 || h <= 1) { - var rect = DomUtils.getWindowSize(); - - w = w <= 1 ? w * rect.w : w; - h = h <= 1 ? h * rect.h : h; - } - - this._layoutRect.autoResize = false; - return this.layoutRect({minW: w, minH: h, w: w, h: h}).reflow(); - }, - - /** - * Resizes the control to a specific relative width/height. - * - * @method resizeBy - * @param {Number} dw Relative control width. - * @param {Number} dh Relative control height. - * @return {tinymce.ui.Control} Current control instance. - */ - resizeBy: function(dw, dh) { - var self = this, rect = self.layoutRect(); - - return self.resizeTo(rect.w + dw, rect.h + dh); - } - }; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/ResizeHandle.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/ResizeHandle.js deleted file mode 100755 index b09c699c69e8..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/ResizeHandle.js +++ /dev/null @@ -1,86 +0,0 @@ -/** - * ResizeHandle.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Renders a resize handle that fires ResizeStart, Resize and ResizeEnd events. - * - * @-x-less ResizeHandle.less - * @class tinymce.ui.ResizeHandle - * @extends tinymce.ui.Widget - */ -define("tinymce/ui/ResizeHandle", [ - "tinymce/ui/Widget", - "tinymce/ui/DragHelper" -], function(Widget, DragHelper) { - "use strict"; - - return Widget.extend({ - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, prefix = self.classPrefix; - - self.addClass('resizehandle'); - - if (self.settings.direction == "both") { - self.addClass('resizehandle-both'); - } - - self.canFocus = false; - - return ( - '
    ' + - '' + - '
    ' - ); - }, - - /** - * Called after the control has been rendered. - * - * @method postRender - */ - postRender: function() { - var self = this; - - self._super(); - - self.resizeDragHelper = new DragHelper(this._id, { - start: function() { - self.fire('ResizeStart'); - }, - - drag: function(e) { - if (self.settings.direction != "both") { - e.deltaX = 0; - } - - self.fire('Resize', e); - }, - - stop: function() { - self.fire('ResizeEnd'); - } - }); - }, - - remove: function() { - if (this.resizeDragHelper) { - this.resizeDragHelper.destroy(); - } - - return this._super(); - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Scrollable.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Scrollable.js deleted file mode 100755 index b3d375ff6db0..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Scrollable.js +++ /dev/null @@ -1,149 +0,0 @@ -/** - * Scrollable.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This mixin makes controls scrollable using custom scrollbars. - * - * @-x-less Scrollable.less - * @mixin tinymce.ui.Scrollable - */ -define("tinymce/ui/Scrollable", [ - "tinymce/ui/DomUtils", - "tinymce/ui/DragHelper" -], function(DomUtils, DragHelper) { - "use strict"; - - return { - init: function() { - var self = this; - self.on('repaint', self.renderScroll); - }, - - renderScroll: function() { - var self = this, margin = 2; - - function repaintScroll() { - var hasScrollH, hasScrollV, bodyElm; - - function repaintAxis(axisName, posName, sizeName, contentSizeName, hasScroll, ax) { - var containerElm, scrollBarElm, scrollThumbElm; - var containerSize, scrollSize, ratio, rect; - var posNameLower, sizeNameLower; - - scrollBarElm = self.getEl('scroll' + axisName); - if (scrollBarElm) { - posNameLower = posName.toLowerCase(); - sizeNameLower = sizeName.toLowerCase(); - - if (self.getEl('absend')) { - DomUtils.css(self.getEl('absend'), posNameLower, self.layoutRect()[contentSizeName] - 1); - } - - if (!hasScroll) { - DomUtils.css(scrollBarElm, 'display', 'none'); - return; - } - - DomUtils.css(scrollBarElm, 'display', 'block'); - containerElm = self.getEl('body'); - scrollThumbElm = self.getEl('scroll' + axisName + "t"); - containerSize = containerElm["client" + sizeName] - (margin * 2); - containerSize -= hasScrollH && hasScrollV ? scrollBarElm["client" + ax] : 0; - scrollSize = containerElm["scroll" + sizeName]; - ratio = containerSize / scrollSize; - - rect = {}; - rect[posNameLower] = containerElm["offset" + posName] + margin; - rect[sizeNameLower] = containerSize; - DomUtils.css(scrollBarElm, rect); - - rect = {}; - rect[posNameLower] = containerElm["scroll" + posName] * ratio; - rect[sizeNameLower] = containerSize * ratio; - DomUtils.css(scrollThumbElm, rect); - } - } - - bodyElm = self.getEl('body'); - hasScrollH = bodyElm.scrollWidth > bodyElm.clientWidth; - hasScrollV = bodyElm.scrollHeight > bodyElm.clientHeight; - - repaintAxis("h", "Left", "Width", "contentW", hasScrollH, "Height"); - repaintAxis("v", "Top", "Height", "contentH", hasScrollV, "Width"); - } - - function addScroll() { - function addScrollAxis(axisName, posName, sizeName, deltaPosName, ax) { - var scrollStart, axisId = self._id + '-scroll' + axisName, prefix = self.classPrefix; - - self.getEl().appendChild(DomUtils.createFragment( - '
    ' + - '
    ' + - '
    ' - )); - - self.draghelper = new DragHelper(axisId + 't', { - start: function() { - scrollStart = self.getEl('body')["scroll" + posName]; - DomUtils.addClass(DomUtils.get(axisId), prefix + 'active'); - }, - - drag: function(e) { - var ratio, hasScrollH, hasScrollV, containerSize, layoutRect = self.layoutRect(); - - hasScrollH = layoutRect.contentW > layoutRect.innerW; - hasScrollV = layoutRect.contentH > layoutRect.innerH; - containerSize = self.getEl('body')["client" + sizeName] - (margin * 2); - containerSize -= hasScrollH && hasScrollV ? self.getEl('scroll' + axisName)["client" + ax] : 0; - - ratio = containerSize / self.getEl('body')["scroll" + sizeName]; - self.getEl('body')["scroll" + posName] = scrollStart + (e["delta" + deltaPosName] / ratio); - }, - - stop: function() { - DomUtils.removeClass(DomUtils.get(axisId), prefix + 'active'); - } - }); -/* - self.on('click', function(e) { - if (e.target.id == self._id + '-scrollv') { - - } - });*/ - } - - self.addClass('scroll'); - - addScrollAxis("v", "Top", "Height", "Y", "Width"); - addScrollAxis("h", "Left", "Width", "X", "Height"); - } - - if (self.settings.autoScroll) { - if (!self._hasScroll) { - self._hasScroll = true; - addScroll(); - - self.on('wheel', function(e) { - var bodyEl = self.getEl('body'); - - bodyEl.scrollLeft += (e.deltaX || 0) * 10; - bodyEl.scrollTop += e.deltaY * 10; - - repaintScroll(); - }); - - DomUtils.on(self.getEl('body'), "scroll", repaintScroll); - } - - repaintScroll(); - } - } - }; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Selector.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Selector.js deleted file mode 100755 index 63bde042eecf..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Selector.js +++ /dev/null @@ -1,369 +0,0 @@ -/** - * Selector.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*eslint no-nested-ternary:0 */ - -/** - * Selector engine, enables you to select controls by using CSS like expressions. - * We currently only support basic CSS expressions to reduce the size of the core - * and the ones we support should be enough for most cases. - * - * @example - * Supported expressions: - * element - * element#name - * element.class - * element[attr] - * element[attr*=value] - * element[attr~=value] - * element[attr!=value] - * element[attr^=value] - * element[attr$=value] - * element: - * element:not() - * element:first - * element:last - * element:odd - * element:even - * element element - * element > element - * - * @class tinymce.ui.Selector - */ -define("tinymce/ui/Selector", [ - "tinymce/util/Class" -], function(Class) { - "use strict"; - - /** - * Produces an array with a unique set of objects. It will not compare the values - * but the references of the objects. - * - * @private - * @method unqiue - * @param {Array} array Array to make into an array with unique items. - * @return {Array} Array with unique items. - */ - function unique(array) { - var uniqueItems = [], i = array.length, item; - - while (i--) { - item = array[i]; - - if (!item.__checked) { - uniqueItems.push(item); - item.__checked = 1; - } - } - - i = uniqueItems.length; - while (i--) { - delete uniqueItems[i].__checked; - } - - return uniqueItems; - } - - var expression = /^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i; - - /*jshint maxlen:255 */ - /*eslint max-len:0 */ - var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, - whiteSpace = /^\s*|\s*$/g, - Collection; - - var Selector = Class.extend({ - /** - * Constructs a new Selector instance. - * - * @constructor - * @method init - * @param {String} selector CSS like selector expression. - */ - init: function(selector) { - var match = this.match; - - function compileNameFilter(name) { - if (name) { - name = name.toLowerCase(); - - return function(item) { - return name === '*' || item.type === name; - }; - } - } - - function compileIdFilter(id) { - if (id) { - return function(item) { - return item._name === id; - }; - } - } - - function compileClassesFilter(classes) { - if (classes) { - classes = classes.split('.'); - - return function(item) { - var i = classes.length; - - while (i--) { - if (!item.hasClass(classes[i])) { - return false; - } - } - - return true; - }; - } - } - - function compileAttrFilter(name, cmp, check) { - if (name) { - return function(item) { - var value = item[name] ? item[name]() : ''; - - return !cmp ? !!check : - cmp === "=" ? value === check : - cmp === "*=" ? value.indexOf(check) >= 0 : - cmp === "~=" ? (" " + value + " ").indexOf(" " + check + " ") >= 0 : - cmp === "!=" ? value != check : - cmp === "^=" ? value.indexOf(check) === 0 : - cmp === "$=" ? value.substr(value.length - check.length) === check : - false; - }; - } - } - - function compilePsuedoFilter(name) { - var notSelectors; - - if (name) { - name = /(?:not\((.+)\))|(.+)/i.exec(name); - - if (!name[1]) { - name = name[2]; - - return function(item, index, length) { - return name === 'first' ? index === 0 : - name === 'last' ? index === length - 1 : - name === 'even' ? index % 2 === 0 : - name === 'odd' ? index % 2 === 1 : - item[name] ? item[name]() : - false; - }; - } else { - // Compile not expression - notSelectors = parseChunks(name[1], []); - - return function(item) { - return !match(item, notSelectors); - }; - } - } - } - - function compile(selector, filters, direct) { - var parts; - - function add(filter) { - if (filter) { - filters.push(filter); - } - } - - // Parse expression into parts - parts = expression.exec(selector.replace(whiteSpace, '')); - - add(compileNameFilter(parts[1])); - add(compileIdFilter(parts[2])); - add(compileClassesFilter(parts[3])); - add(compileAttrFilter(parts[4], parts[5], parts[6])); - add(compilePsuedoFilter(parts[7])); - - // Mark the filter with psuedo for performance - filters.psuedo = !!parts[7]; - filters.direct = direct; - - return filters; - } - - // Parser logic based on Sizzle by John Resig - function parseChunks(selector, selectors) { - var parts = [], extra, matches, i; - - do { - chunker.exec(""); - matches = chunker.exec(selector); - - if (matches) { - selector = matches[3]; - parts.push(matches[1]); - - if (matches[2]) { - extra = matches[3]; - break; - } - } - } while (matches); - - if (extra) { - parseChunks(extra, selectors); - } - - selector = []; - for (i = 0; i < parts.length; i++) { - if (parts[i] != '>') { - selector.push(compile(parts[i], [], parts[i - 1] === '>')); - } - } - - selectors.push(selector); - - return selectors; - } - - this._selectors = parseChunks(selector, []); - }, - - /** - * Returns true/false if the selector matches the specified control. - * - * @method match - * @param {tinymce.ui.Control} control Control to match agains the selector. - * @param {Array} selectors Optional array of selectors, mostly used internally. - * @return {Boolean} true/false state if the control matches or not. - */ - match: function(control, selectors) { - var i, l, si, sl, selector, fi, fl, filters, index, length, siblings, count, item; - - selectors = selectors || this._selectors; - for (i = 0, l = selectors.length; i < l; i++) { - selector = selectors[i]; - sl = selector.length; - item = control; - count = 0; - - for (si = sl - 1; si >= 0; si--) { - filters = selector[si]; - - while (item) { - // Find the index and length since a psuedo filter like :first needs it - if (filters.psuedo) { - siblings = item.parent().items(); - index = length = siblings.length; - while (index--) { - if (siblings[index] === item) { - break; - } - } - } - - for (fi = 0, fl = filters.length; fi < fl; fi++) { - if (!filters[fi](item, index, length)) { - fi = fl + 1; - break; - } - } - - if (fi === fl) { - count++; - break; - } else { - // If it didn't match the right most expression then - // break since it's no point looking at the parents - if (si === sl - 1) { - break; - } - } - - item = item.parent(); - } - } - - // If we found all selectors then return true otherwise continue looking - if (count === sl) { - return true; - } - } - - return false; - }, - - /** - * Returns a tinymce.ui.Collection with matches of the specified selector inside the specified container. - * - * @method find - * @param {tinymce.ui.Control} container Container to look for items in. - * @return {tinymce.ui.Collection} Collection with matched elements. - */ - find: function(container) { - var matches = [], i, l, selectors = this._selectors; - - function collect(items, selector, index) { - var i, l, fi, fl, item, filters = selector[index]; - - for (i = 0, l = items.length; i < l; i++) { - item = items[i]; - - // Run each filter agains the item - for (fi = 0, fl = filters.length; fi < fl; fi++) { - if (!filters[fi](item, i, l)) { - fi = fl + 1; - break; - } - } - - // All filters matched the item - if (fi === fl) { - // Matched item is on the last expression like: panel toolbar [button] - if (index == selector.length - 1) { - matches.push(item); - } else { - // Collect next expression type - if (item.items) { - collect(item.items(), selector, index + 1); - } - } - } else if (filters.direct) { - return; - } - - // Collect child items - if (item.items) { - collect(item.items(), selector, index); - } - } - } - - if (container.items) { - for (i = 0, l = selectors.length; i < l; i++) { - collect(container.items(), selectors[i], 0); - } - - // Unique the matches if needed - if (l > 1) { - matches = unique(matches); - } - } - - // Fix for circular reference - if (!Collection) { - // TODO: Fix me! - Collection = Selector.Collection; - } - - return new Collection(matches); - } - }); - - return Selector; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Spacer.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Spacer.js deleted file mode 100755 index 7536994f8338..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Spacer.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Spacer.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a spacer. This control is used in flex layouts for example. - * - * @-x-less Spacer.less - * @class tinymce.ui.Spacer - * @extends tinymce.ui.Widget - */ -define("tinymce/ui/Spacer", [ - "tinymce/ui/Widget" -], function(Widget) { - "use strict"; - - return Widget.extend({ - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this; - - self.addClass('spacer'); - self.canFocus = false; - - return '
    '; - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/SplitButton.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/SplitButton.js deleted file mode 100755 index 9263063d1b2d..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/SplitButton.js +++ /dev/null @@ -1,119 +0,0 @@ -/** - * SplitButton.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a split button. - * - * @-x-less SplitButton.less - * @class tinymce.ui.SplitButton - * @extends tinymce.ui.Button - */ -define("tinymce/ui/SplitButton", [ - "tinymce/ui/MenuButton", - "tinymce/ui/DomUtils" -], function(MenuButton, DomUtils) { - return MenuButton.extend({ - Defaults: { - classes: "widget btn splitbtn", - role: "button" - }, - - /** - * Repaints the control after a layout operation. - * - * @method repaint - */ - repaint: function() { - var self = this, elm = self.getEl(), rect = self.layoutRect(), mainButtonElm, menuButtonElm; - - self._super(); - - mainButtonElm = elm.firstChild; - menuButtonElm = elm.lastChild; - - DomUtils.css(mainButtonElm, { - width: rect.w - DomUtils.getSize(menuButtonElm).width, - height: rect.h - 2 - }); - - DomUtils.css(menuButtonElm, { - height: rect.h - 2 - }); - - return self; - }, - - /** - * Sets the active menu state. - * - * @private - */ - activeMenu: function(state) { - var self = this; - - DomUtils.toggleClass(self.getEl().lastChild, self.classPrefix + 'active', state); - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, id = self._id, prefix = self.classPrefix; - var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : ''; - - return ( - '
    ' + - '' + - '' + - '
    ' - ); - }, - - /** - * Called after the control has been rendered. - * - * @method postRender - */ - postRender: function() { - var self = this, onClickHandler = self.settings.onclick; - - self.on('click', function(e) { - var node = e.target; - - if (e.control == this) { - // Find clicks that is on the main button - while (node) { - if ((e.aria && e.aria.key != 'down') || (node.nodeName == 'BUTTON' && node.className.indexOf('open') == -1)) { - e.stopImmediatePropagation(); - onClickHandler.call(this, e); - return; - } - - node = node.parentNode; - } - } - }); - - delete self.settings.onclick; - - return self._super(); - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/StackLayout.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/StackLayout.js deleted file mode 100755 index 32fcbf481c5f..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/StackLayout.js +++ /dev/null @@ -1,30 +0,0 @@ -/** - * StackLayout.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This layout uses the browsers layout when the items are blocks. - * - * @-x-less StackLayout.less - * @class tinymce.ui.StackLayout - * @extends tinymce.ui.FlowLayout - */ -define("tinymce/ui/StackLayout", [ - "tinymce/ui/FlowLayout" -], function(FlowLayout) { - "use strict"; - - return FlowLayout.extend({ - Defaults: { - containerClass: 'stack-layout', - controlClass: 'stack-layout-item', - endClass : 'break' - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/TabPanel.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/TabPanel.js deleted file mode 100755 index 1f379be9695f..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/TabPanel.js +++ /dev/null @@ -1,180 +0,0 @@ -/** - * TabPanel.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a tab panel control. - * - * @-x-less TabPanel.less - * @class tinymce.ui.TabPanel - * @extends tinymce.ui.Panel - * - * @setting {Number} activeTab Active tab index. - */ -define("tinymce/ui/TabPanel", [ - "tinymce/ui/Panel", - "tinymce/ui/DomUtils" -], function(Panel, DomUtils) { - "use strict"; - - return Panel.extend({ - lastIdx: 0, - - Defaults: { - layout: 'absolute', - defaults: { - type: 'panel' - } - }, - - /** - * Activates the specified tab by index. - * - * @method activateTab - * @param {Number} idx Index of the tab to activate. - */ - activateTab: function(idx) { - var activeTabElm; - - if (this.activeTabId) { - activeTabElm = this.getEl(this.activeTabId); - DomUtils.removeClass(activeTabElm, this.classPrefix + 'active'); - activeTabElm.setAttribute('aria-selected', "false"); - } - - this.activeTabId = 't' + idx; - - activeTabElm = this.getEl('t' + idx); - activeTabElm.setAttribute('aria-selected', "true"); - DomUtils.addClass(activeTabElm, this.classPrefix + 'active'); - - if (idx != this.lastIdx) { - this.items()[this.lastIdx].hide(); - this.lastIdx = idx; - } - - this.items()[idx].show().fire('showtab'); - this.reflow(); - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, layout = self._layout, tabsHtml = '', prefix = self.classPrefix; - - self.preRender(); - layout.preRender(self); - - self.items().each(function(ctrl, i) { - var id = self._id + '-t' + i; - - ctrl.aria('role', 'tabpanel'); - ctrl.aria('labelledby', id); - - tabsHtml += ( - '' - ); - }); - - return ( - '
    ' + - '
    ' + - tabsHtml + - '
    ' + - '
    ' + - layout.renderHtml(self) + - '
    ' + - '
    ' - ); - }, - - /** - * Called after the control has been rendered. - * - * @method postRender - */ - postRender: function() { - var self = this; - - self._super(); - - self.settings.activeTab = self.settings.activeTab || 0; - self.activateTab(self.settings.activeTab); - - this.on('click', function(e) { - var targetParent = e.target.parentNode; - - if (e.target.parentNode.id == self._id + '-head') { - var i = targetParent.childNodes.length; - - while (i--) { - if (targetParent.childNodes[i] == e.target) { - self.activateTab(i); - } - } - } - }); - }, - - /** - * Initializes the current controls layout rect. - * This will be executed by the layout managers to determine the - * default minWidth/minHeight etc. - * - * @method initLayoutRect - * @return {Object} Layout rect instance. - */ - initLayoutRect: function() { - var self = this, rect, minW, minH; - - minW = DomUtils.getSize(self.getEl('head')).width; - minW = minW < 0 ? 0 : minW; - minH = 0; - self.items().each(function(item, i) { - minW = Math.max(minW, item.layoutRect().minW); - minH = Math.max(minH, item.layoutRect().minH); - if (self.settings.activeTab != i) { - item.hide(); - } - }); - - self.items().each(function(ctrl) { - ctrl.settings.x = 0; - ctrl.settings.y = 0; - ctrl.settings.w = minW; - ctrl.settings.h = minH; - - ctrl.layoutRect({ - x: 0, - y: 0, - w: minW, - h: minH - }); - }); - - var headH = DomUtils.getSize(self.getEl('head')).height; - - self.settings.minWidth = minW; - self.settings.minHeight = minH + headH; - - rect = self._super(); - rect.deltaH += headH; - rect.innerH = rect.h - rect.deltaH; - - return rect; - } - }); -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/TextBox.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/TextBox.js deleted file mode 100755 index a11f72de53f0..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/TextBox.js +++ /dev/null @@ -1,214 +0,0 @@ -/** - * TextBox.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a new textbox. - * - * @-x-less TextBox.less - * @class tinymce.ui.TextBox - * @extends tinymce.ui.Widget - */ -define("tinymce/ui/TextBox", [ - "tinymce/ui/Widget", - "tinymce/ui/DomUtils" -], function(Widget, DomUtils) { - "use strict"; - - return Widget.extend({ - /** - * Constructs a instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - * @setting {Boolean} multiline True if the textbox is a multiline control. - * @setting {Number} maxLength Max length for the textbox. - * @setting {Number} size Size of the textbox in characters. - */ - init: function(settings) { - var self = this; - - self._super(settings); - - self._value = settings.value || ''; - self.addClass('textbox'); - - if (settings.multiline) { - self.addClass('multiline'); - } else { - // TODO: Rework this - self.on('keydown', function(e) { - if (e.keyCode == 13) { - self.parents().reverse().each(function(ctrl) { - e.preventDefault(); - - if (ctrl.hasEventListeners('submit') && ctrl.toJSON) { - ctrl.fire('submit', {data: ctrl.toJSON()}); - return false; - } - }); - } - }); - } - }, - - /** - * Getter/setter function for the disabled state. - * - * @method value - * @param {Boolean} [state] State to be set. - * @return {Boolean|tinymce.ui.ComboBox} True/false or self if it's a set operation. - */ - disabled: function(state) { - var self = this; - - if (self._rendered && typeof(state) != 'undefined') { - self.getEl().disabled = state; - } - - return self._super(state); - }, - - /** - * Getter/setter function for the control value. - * - * @method value - * @param {String} [value] Value to be set. - * @return {String|tinymce.ui.ComboBox} Value or self if it's a set operation. - */ - value: function(value) { - var self = this; - - if (typeof(value) != "undefined") { - self._value = value; - - if (self._rendered) { - self.getEl().value = value; - } - - return self; - } - - if (self._rendered) { - return self.getEl().value; - } - - return self._value; - }, - - /** - * Repaints the control after a layout operation. - * - * @method repaint - */ - repaint: function() { - var self = this, style, rect, borderBox, borderW = 0, borderH = 0, lastRepaintRect; - - style = self.getEl().style; - rect = self._layoutRect; - lastRepaintRect = self._lastRepaintRect || {}; - - // Detect old IE 7+8 add lineHeight to align caret vertically in the middle - var doc = document; - if (!self.settings.multiline && doc.all && (!doc.documentMode || doc.documentMode <= 8)) { - style.lineHeight = (rect.h - borderH) + 'px'; - } - - borderBox = self._borderBox; - borderW = borderBox.left + borderBox.right + 8; - borderH = borderBox.top + borderBox.bottom + (self.settings.multiline ? 8 : 0); - - if (rect.x !== lastRepaintRect.x) { - style.left = rect.x + 'px'; - lastRepaintRect.x = rect.x; - } - - if (rect.y !== lastRepaintRect.y) { - style.top = rect.y + 'px'; - lastRepaintRect.y = rect.y; - } - - if (rect.w !== lastRepaintRect.w) { - style.width = (rect.w - borderW) + 'px'; - lastRepaintRect.w = rect.w; - } - - if (rect.h !== lastRepaintRect.h) { - style.height = (rect.h - borderH) + 'px'; - lastRepaintRect.h = rect.h; - } - - self._lastRepaintRect = lastRepaintRect; - self.fire('repaint', {}, false); - - return self; - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, id = self._id, settings = self.settings, value = self.encode(self._value, false), extraAttrs = ''; - - if ("spellcheck" in settings) { - extraAttrs += ' spellcheck="' + settings.spellcheck + '"'; - } - - if (settings.maxLength) { - extraAttrs += ' maxlength="' + settings.maxLength + '"'; - } - - if (settings.size) { - extraAttrs += ' size="' + settings.size + '"'; - } - - if (settings.subtype) { - extraAttrs += ' type="' + settings.subtype + '"'; - } - - if (self.disabled()) { - extraAttrs += ' disabled="disabled"'; - } - - if (settings.multiline) { - return ( - '' - ); - } - - return ''; - }, - - /** - * Called after the control has been rendered. - * - * @method postRender - */ - postRender: function() { - var self = this; - - DomUtils.on(self.getEl(), 'change', function(e) { - self.fire('change', e); - }); - - return self._super(); - }, - - remove: function() { - DomUtils.off(this.getEl()); - this._super(); - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Throbber.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Throbber.js deleted file mode 100755 index b56e2cc7ca3f..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Throbber.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * Throbber.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class enables you to display a Throbber for any element. - * - * @-x-less Throbber.less - * @class tinymce.ui.Throbber - */ -define("tinymce/ui/Throbber", [ - "tinymce/ui/DomUtils" -], function(DomUtils) { - "use strict"; - - /** - * Constructs a new throbber. - * - * @constructor - * @param {Element} elm DOM Html element to display throbber in. - */ - return function(elm) { - var self = this, state; - - /** - * Shows the throbber. - * - * @method show - * @param {Number} [time] Time to wait before showing. - * @return {tinymce.ui.Throbber} Current throbber instance. - */ - self.show = function(time) { - self.hide(); - - state = true; - - window.setTimeout(function() { - if (state) { - elm.appendChild(DomUtils.createFragment('
    ')); - } - }, time || 0); - - return self; - }; - - /** - * Hides the throbber. - * - * @method hide - * @return {tinymce.ui.Throbber} Current throbber instance. - */ - self.hide = function() { - var child = elm.lastChild; - - if (child && child.className.indexOf('throbber') != -1) { - child.parentNode.removeChild(child); - } - - state = false; - - return self; - }; - }; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Toolbar.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Toolbar.js deleted file mode 100755 index 55b6210e03e6..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Toolbar.js +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Toolbar.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a new toolbar. - * - * @class tinymce.ui.Toolbar - * @extends tinymce.ui.Container - */ -define("tinymce/ui/Toolbar", [ - "tinymce/ui/Container" -], function(Container) { - "use strict"; - - return Container.extend({ - Defaults: { - role: 'toolbar', - layout: 'flow' - }, - - /** - * Constructs a instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - */ - init: function(settings) { - var self = this; - - self._super(settings); - self.addClass('toolbar'); - }, - - /** - * Called after the control has been rendered. - * - * @method postRender - */ - postRender: function() { - var self = this; - - self.items().addClass('toolbar-item'); - - return self._super(); - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Tooltip.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Tooltip.js deleted file mode 100755 index 2d01d491201d..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Tooltip.js +++ /dev/null @@ -1,86 +0,0 @@ -/** - * Tooltip.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a tooltip instance. - * - * @-x-less ToolTip.less - * @class tinymce.ui.ToolTip - * @extends tinymce.ui.Control - * @mixes tinymce.ui.Movable - */ -define("tinymce/ui/Tooltip", [ - "tinymce/ui/Control", - "tinymce/ui/Movable" -], function(Control, Movable) { - return Control.extend({ - Mixins: [Movable], - - Defaults: { - classes: 'widget tooltip tooltip-n' - }, - - /** - * Sets/gets the current label text. - * - * @method text - * @param {String} [text] New label text. - * @return {String|tinymce.ui.Tooltip} Current text or current label instance. - */ - text: function(value) { - var self = this; - - if (typeof(value) != "undefined") { - self._value = value; - - if (self._rendered) { - self.getEl().lastChild.innerHTML = self.encode(value); - } - - return self; - } - - return self._value; - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, prefix = self.classPrefix; - - return ( - '' - ); - }, - - /** - * Repaints the control after a layout operation. - * - * @method repaint - */ - repaint: function() { - var self = this, style, rect; - - style = self.getEl().style; - rect = self._layoutRect; - - style.left = rect.x + 'px'; - style.top = rect.y + 'px'; - style.zIndex = 0xFFFF + 0xFFFF; - } - }); -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Widget.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Widget.js deleted file mode 100755 index 274b937e1c55..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Widget.js +++ /dev/null @@ -1,156 +0,0 @@ -/** - * Widget.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Widget base class a widget is a control that has a tooltip and some basic states. - * - * @class tinymce.ui.Widget - * @extends tinymce.ui.Control - */ -define("tinymce/ui/Widget", [ - "tinymce/ui/Control", - "tinymce/ui/Tooltip" -], function(Control, Tooltip) { - "use strict"; - - var tooltip; - - var Widget = Control.extend({ - /** - * Constructs a instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - * @setting {String} tooltip Tooltip text to display when hovering. - * @setting {Boolean} autofocus True if the control should be focused when rendered. - * @setting {String} text Text to display inside widget. - */ - init: function(settings) { - var self = this; - - self._super(settings); - self.canFocus = true; - - if (settings.tooltip && Widget.tooltips !== false) { - self.on('mouseenter', function(e) { - var tooltip = self.tooltip().moveTo(-0xFFFF); - - if (e.control == self) { - var rel = tooltip.text(settings.tooltip).show().testMoveRel(self.getEl(), ['bc-tc', 'bc-tl', 'bc-tr']); - - tooltip.toggleClass('tooltip-n', rel == 'bc-tc'); - tooltip.toggleClass('tooltip-nw', rel == 'bc-tl'); - tooltip.toggleClass('tooltip-ne', rel == 'bc-tr'); - - tooltip.moveRel(self.getEl(), rel); - } else { - tooltip.hide(); - } - }); - - self.on('mouseleave mousedown click', function() { - self.tooltip().hide(); - }); - } - - self.aria('label', settings.ariaLabel || settings.tooltip); - }, - - /** - * Returns the current tooltip instance. - * - * @method tooltip - * @return {tinymce.ui.Tooltip} Tooltip instance. - */ - tooltip: function() { - if (!tooltip) { - tooltip = new Tooltip({type: 'tooltip'}); - tooltip.renderTo(); - } - - return tooltip; - }, - - /** - * Sets/gets the active state of the widget. - * - * @method active - * @param {Boolean} [state] State if the control is active. - * @return {Boolean|tinymce.ui.Widget} True/false or current widget instance. - */ - active: function(state) { - var self = this, undef; - - if (state !== undef) { - self.aria('pressed', state); - self.toggleClass('active', state); - } - - return self._super(state); - }, - - /** - * Sets/gets the disabled state of the widget. - * - * @method disabled - * @param {Boolean} [state] State if the control is disabled. - * @return {Boolean|tinymce.ui.Widget} True/false or current widget instance. - */ - disabled: function(state) { - var self = this, undef; - - if (state !== undef) { - self.aria('disabled', state); - self.toggleClass('disabled', state); - } - - return self._super(state); - }, - - /** - * Called after the control has been rendered. - * - * @method postRender - */ - postRender: function() { - var self = this, settings = self.settings; - - self._rendered = true; - - self._super(); - - if (!self.parent() && (settings.width || settings.height)) { - self.initLayoutRect(); - self.repaint(); - } - - if (settings.autofocus) { - self.focus(); - } - }, - - /** - * Removes the current control from DOM and from UI collections. - * - * @method remove - * @return {tinymce.ui.Control} Current control instance. - */ - remove: function() { - this._super(); - - if (tooltip) { - tooltip.remove(); - tooltip = null; - } - } - }); - - return Widget; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Window.js b/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Window.js deleted file mode 100755 index 00d841b09cfb..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/ui/Window.js +++ /dev/null @@ -1,373 +0,0 @@ -/** - * Window.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a new window. - * - * @-x-less Window.less - * @class tinymce.ui.Window - * @extends tinymce.ui.FloatPanel - */ -define("tinymce/ui/Window", [ - "tinymce/ui/FloatPanel", - "tinymce/ui/Panel", - "tinymce/ui/DomUtils", - "tinymce/ui/DragHelper" -], function(FloatPanel, Panel, DomUtils, DragHelper) { - "use strict"; - - var Window = FloatPanel.extend({ - modal: true, - - Defaults: { - border: 1, - layout: 'flex', - containerCls: 'panel', - role: 'dialog', - callbacks: { - submit: function() { - this.fire('submit', {data: this.toJSON()}); - }, - - close: function() { - this.close(); - } - } - }, - - /** - * Constructs a instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - */ - init: function(settings) { - var self = this; - - self._super(settings); - - if (self.isRtl()) { - self.addClass('rtl'); - } - - self.addClass('window'); - self._fixed = true; - - // Create statusbar - if (settings.buttons) { - self.statusbar = new Panel({ - layout: 'flex', - border: '1 0 0 0', - spacing: 3, - padding: 10, - align: 'center', - pack: self.isRtl() ? 'start' : 'end', - defaults: { - type: 'button' - }, - items: settings.buttons - }); - - self.statusbar.addClass('foot'); - self.statusbar.parent(self); - } - - self.on('click', function(e) { - if (e.target.className.indexOf(self.classPrefix + 'close') != -1) { - self.close(); - } - }); - - self.on('cancel', function() { - self.close(); - }); - - self.aria('describedby', self.describedBy || self._id + '-none'); - self.aria('label', settings.title); - self._fullscreen = false; - }, - - /** - * Recalculates the positions of the controls in the current container. - * This is invoked by the reflow method and shouldn't be called directly. - * - * @method recalc - */ - recalc: function() { - var self = this, statusbar = self.statusbar, layoutRect, width, x, needsRecalc; - - if (self._fullscreen) { - self.layoutRect(DomUtils.getWindowSize()); - self.layoutRect().contentH = self.layoutRect().innerH; - } - - self._super(); - - layoutRect = self.layoutRect(); - - // Resize window based on title width - if (self.settings.title && !self._fullscreen) { - width = layoutRect.headerW; - if (width > layoutRect.w) { - x = layoutRect.x - Math.max(0, width / 2); - self.layoutRect({w: width, x: x}); - needsRecalc = true; - } - } - - // Resize window based on statusbar width - if (statusbar) { - statusbar.layoutRect({w: self.layoutRect().innerW}).recalc(); - - width = statusbar.layoutRect().minW + layoutRect.deltaW; - if (width > layoutRect.w) { - x = layoutRect.x - Math.max(0, width - layoutRect.w); - self.layoutRect({w: width, x: x}); - needsRecalc = true; - } - } - - // Recalc body and disable auto resize - if (needsRecalc) { - self.recalc(); - } - }, - - /** - * Initializes the current controls layout rect. - * This will be executed by the layout managers to determine the - * default minWidth/minHeight etc. - * - * @method initLayoutRect - * @return {Object} Layout rect instance. - */ - initLayoutRect: function() { - var self = this, layoutRect = self._super(), deltaH = 0, headEl; - - // Reserve vertical space for title - if (self.settings.title && !self._fullscreen) { - headEl = self.getEl('head'); - - var size = DomUtils.getSize(headEl); - - layoutRect.headerW = size.width; - layoutRect.headerH = size.height; - - deltaH += layoutRect.headerH; - } - - // Reserve vertical space for statusbar - if (self.statusbar) { - deltaH += self.statusbar.layoutRect().h; - } - - layoutRect.deltaH += deltaH; - layoutRect.minH += deltaH; - //layoutRect.innerH -= deltaH; - layoutRect.h += deltaH; - - var rect = DomUtils.getWindowSize(); - - layoutRect.x = Math.max(0, rect.w / 2 - layoutRect.w / 2); - layoutRect.y = Math.max(0, rect.h / 2 - layoutRect.h / 2); - - return layoutRect; - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, layout = self._layout, id = self._id, prefix = self.classPrefix; - var settings = self.settings, headerHtml = '', footerHtml = '', html = settings.html; - - self.preRender(); - layout.preRender(self); - - if (settings.title) { - headerHtml = ( - '
    ' + - '
    ' + self.encode(settings.title) + '
    ' + - '' + - '
    ' + - '
    ' - ); - } - - if (settings.url) { - html = ''; - } - - if (typeof(html) == "undefined") { - html = layout.renderHtml(self); - } - - if (self.statusbar) { - footerHtml = self.statusbar.renderHtml(); - } - - return ( - '
    ' + - '
    ' + - headerHtml + - '
    ' + - html + - '
    ' + - footerHtml + - '
    ' + - '
    ' - ); - }, - - /** - * Switches the window fullscreen mode. - * - * @method fullscreen - * @param {Boolean} state True/false state. - * @return {tinymce.ui.Window} Current window instance. - */ - fullscreen: function(state) { - var self = this, documentElement = document.documentElement, slowRendering, prefix = self.classPrefix, layoutRect; - - if (state != self._fullscreen) { - DomUtils.on(window, 'resize', function() { - var time; - - if (self._fullscreen) { - // Time the layout time if it's to slow use a timeout to not hog the CPU - if (!slowRendering) { - time = new Date().getTime(); - - var rect = DomUtils.getWindowSize(); - self.moveTo(0, 0).resizeTo(rect.w, rect.h); - - if ((new Date().getTime()) - time > 50) { - slowRendering = true; - } - } else { - if (!self._timer) { - self._timer = setTimeout(function() { - var rect = DomUtils.getWindowSize(); - self.moveTo(0, 0).resizeTo(rect.w, rect.h); - - self._timer = 0; - }, 50); - } - } - } - }); - - layoutRect = self.layoutRect(); - self._fullscreen = state; - - if (!state) { - self._borderBox = self.parseBox(self.settings.border); - self.getEl('head').style.display = ''; - layoutRect.deltaH += layoutRect.headerH; - DomUtils.removeClass(documentElement, prefix + 'fullscreen'); - DomUtils.removeClass(document.body, prefix + 'fullscreen'); - self.removeClass('fullscreen'); - self.moveTo(self._initial.x, self._initial.y).resizeTo(self._initial.w, self._initial.h); - } else { - self._initial = {x: layoutRect.x, y: layoutRect.y, w: layoutRect.w, h: layoutRect.h}; - - self._borderBox = self.parseBox('0'); - self.getEl('head').style.display = 'none'; - layoutRect.deltaH -= layoutRect.headerH + 2; - DomUtils.addClass(documentElement, prefix + 'fullscreen'); - DomUtils.addClass(document.body, prefix + 'fullscreen'); - self.addClass('fullscreen'); - - var rect = DomUtils.getWindowSize(); - self.moveTo(0, 0).resizeTo(rect.w, rect.h); - } - } - - return self.reflow(); - }, - - /** - * Called after the control has been rendered. - * - * @method postRender - */ - postRender: function() { - var self = this, startPos; - - setTimeout(function() { - self.addClass('in'); - }, 0); - - self._super(); - - if (self.statusbar) { - self.statusbar.postRender(); - } - - self.focus(); - - this.dragHelper = new DragHelper(self._id + '-dragh', { - start: function() { - startPos = { - x: self.layoutRect().x, - y: self.layoutRect().y - }; - }, - - drag: function(e) { - self.moveTo(startPos.x + e.deltaX, startPos.y + e.deltaY); - } - }); - - self.on('submit', function(e) { - if (!e.isDefaultPrevented()) { - self.close(); - } - }); - }, - - /** - * Fires a submit event with the serialized form. - * - * @method submit - * @return {Object} Event arguments object. - */ - submit: function() { - return this.fire('submit', {data: this.toJSON()}); - }, - - /** - * Removes the current control from DOM and from UI collections. - * - * @method remove - * @return {tinymce.ui.Control} Current control instance. - */ - remove: function() { - var self = this, prefix = self.classPrefix; - - self.dragHelper.destroy(); - self._super(); - - if (self.statusbar) { - this.statusbar.remove(); - } - - if (self._fullscreen) { - DomUtils.removeClass(document.documentElement, prefix + 'fullscreen'); - DomUtils.removeClass(document.body, prefix + 'fullscreen'); - } - } - }); - - return Window; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/util/Class.js b/common/static/js/vendor/tinymce/js/tinymce/classes/util/Class.js deleted file mode 100755 index 787c69c77cba..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/util/Class.js +++ /dev/null @@ -1,163 +0,0 @@ -/** - * Class.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * This utilitiy class is used for easier inheritage. - * - * Features: - * * Exposed super functions: this._super(); - * * Mixins - * * Dummy functions - * * Property functions: var value = object.value(); and object.value(newValue); - * * Static functions - * * Defaults settings - */ -define("tinymce/util/Class", [ - "tinymce/util/Tools" -], function(Tools) { - var each = Tools.each, extend = Tools.extend; - - var extendClass, initializing; - - function Class() { - } - - // Provides classical inheritance, based on code made by John Resig - Class.extend = extendClass = function(prop) { - var self = this, _super = self.prototype, prototype, name, member; - - // The dummy class constructor - function Class() { - var i, mixins, mixin, self = this; - - // All construction is actually done in the init method - if (!initializing) { - // Run class constuctor - if (self.init) { - self.init.apply(self, arguments); - } - - // Run mixin constructors - mixins = self.Mixins; - if (mixins) { - i = mixins.length; - while (i--) { - mixin = mixins[i]; - if (mixin.init) { - mixin.init.apply(self, arguments); - } - } - } - } - } - - // Dummy function, needs to be extended in order to provide functionality - function dummy() { - return this; - } - - // Creates a overloaded method for the class - // this enables you to use this._super(); to call the super function - function createMethod(name, fn) { - return function(){ - var self = this, tmp = self._super, ret; - - self._super = _super[name]; - ret = fn.apply(self, arguments); - self._super = tmp; - - return ret; - }; - } - - // Instantiate a base class (but only create the instance, - // don't run the init constructor) - initializing = true; - prototype = new self(); - initializing = false; - - // Add mixins - if (prop.Mixins) { - each(prop.Mixins, function(mixin) { - mixin = mixin; - - for (var name in mixin) { - if (name !== "init") { - prop[name] = mixin[name]; - } - } - }); - - if (_super.Mixins) { - prop.Mixins = _super.Mixins.concat(prop.Mixins); - } - } - - // Generate dummy methods - if (prop.Methods) { - each(prop.Methods.split(','), function(name) { - prop[name] = dummy; - }); - } - - // Generate property methods - if (prop.Properties) { - each(prop.Properties.split(','), function(name) { - var fieldName = '_' + name; - - prop[name] = function(value) { - var self = this, undef; - - // Set value - if (value !== undef) { - self[fieldName] = value; - - return self; - } - - // Get value - return self[fieldName]; - }; - }); - } - - // Static functions - if (prop.Statics) { - each(prop.Statics, function(func, name) { - Class[name] = func; - }); - } - - // Default settings - if (prop.Defaults && _super.Defaults) { - prop.Defaults = extend({}, _super.Defaults, prop.Defaults); - } - - // Copy the properties over onto the new prototype - for (name in prop) { - member = prop[name]; - - if (typeof member == "function" && _super[name]) { - prototype[name] = createMethod(name, member); - } else { - prototype[name] = member; - } - } - - // Populate our constructed prototype object - Class.prototype = prototype; - - // Enforce the constructor to be what we expect - Class.constructor = Class; - - // And make this class extendible - Class.extend = extendClass; - - return Class; - }; - - return Class; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/util/I18n.js b/common/static/js/vendor/tinymce/js/tinymce/classes/util/I18n.js deleted file mode 100755 index 27a8dad64a89..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/util/I18n.js +++ /dev/null @@ -1,80 +0,0 @@ -/** - * I18n.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * I18n class that handles translation of TinyMCE UI. - * Uses po style with csharp style parameters. - * - * @class tinymce.util.I18n - */ -define("tinymce/util/I18n", [], function() { - "use strict"; - - var data = {}; - - return { - /** - * Property gets set to true if a RTL language pack was loaded. - * - * @property rtl - * @type Boolean - */ - rtl: false, - - /** - * Adds translations for a specific language code. - * - * @method add - * @param {String} code Language code like sv_SE. - * @param {Array} items Name/value array with English en_US to sv_SE. - */ - add: function(code, items) { - for (var name in items) { - data[name] = items[name]; - } - - this.rtl = this.rtl || data._dir === 'rtl'; - }, - - /** - * Translates the specified text. - * - * It has a few formats: - * I18n.translate("Text"); - * I18n.translate(["Text {0}/{1}", 0, 1]); - * I18n.translate({raw: "Raw string"}); - * - * @method translate - * @param {String/Object/Array} text Text to translate. - * @return {String} String that got translated. - */ - translate: function(text) { - if (typeof(text) == "undefined") { - return text; - } - - if (typeof(text) != "string" && text.raw) { - return text.raw; - } - - if (text.push) { - var values = text.slice(1); - - text = (data[text[0]] || text[0]).replace(/\{([^\}]+)\}/g, function(match1, match2) { - return values[match2]; - }); - } - - return data[text] || text; - }, - - data: data - }; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/util/JSON.js b/common/static/js/vendor/tinymce/js/tinymce/classes/util/JSON.js deleted file mode 100755 index 623b5df35e70..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/util/JSON.js +++ /dev/null @@ -1,109 +0,0 @@ -/** - * JSON.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * JSON parser and serializer class. - * - * @class tinymce.util.JSON - * @static - * @example - * // JSON parse a string into an object - * var obj = tinymce.util.JSON.parse(somestring); - * - * // JSON serialize a object into an string - * var str = tinymce.util.JSON.serialize(obj); - */ -define("tinymce/util/JSON", [], function() { - function serialize(o, quote) { - var i, v, t, name; - - quote = quote || '"'; - - if (o === null) { - return 'null'; - } - - t = typeof o; - - if (t == 'string') { - v = '\bb\tt\nn\ff\rr\""\'\'\\\\'; - - return quote + o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g, function(a, b) { - // Make sure single quotes never get encoded inside double quotes for JSON compatibility - if (quote === '"' && a === "'") { - return a; - } - - i = v.indexOf(b); - - if (i + 1) { - return '\\' + v.charAt(i + 1); - } - - a = b.charCodeAt().toString(16); - - return '\\u' + '0000'.substring(a.length) + a; - }) + quote; - } - - if (t == 'object') { - if (o.hasOwnProperty && Object.prototype.toString.call(o) === '[object Array]') { - for (i = 0, v = '['; i < o.length; i++) { - v += (i > 0 ? ',' : '') + serialize(o[i], quote); - } - - return v + ']'; - } - - v = '{'; - - for (name in o) { - if (o.hasOwnProperty(name)) { - v += typeof o[name] != 'function' ? (v.length > 1 ? ',' + quote : quote) + name + - quote + ':' + serialize(o[name], quote) : ''; - } - } - - return v + '}'; - } - - return '' + o; - } - - return { - /** - * Serializes the specified object as a JSON string. - * - * @method serialize - * @param {Object} obj Object to serialize as a JSON string. - * @param {String} quote Optional quote string defaults to ". - * @return {string} JSON string serialized from input. - */ - serialize: serialize, - - /** - * Unserializes/parses the specified JSON string into a object. - * - * @method parse - * @param {string} s JSON String to parse into a JavaScript object. - * @return {Object} Object from input JSON string or undefined if it failed. - */ - parse: function(text) { - try { - // Trick uglify JS - return window[String.fromCharCode(101) + 'val']('(' + text + ')'); - } catch (ex) { - // Ignore - } - } - - /**#@-*/ - }; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/util/JSONP.js b/common/static/js/vendor/tinymce/js/tinymce/classes/util/JSONP.js deleted file mode 100755 index 3c0bf67dd66c..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/util/JSONP.js +++ /dev/null @@ -1,38 +0,0 @@ -/** - * JSONP.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("tinymce/util/JSONP", [ - "tinymce/dom/DOMUtils" -], function(DOMUtils) { - return { - callbacks: {}, - count: 0, - - send: function(settings) { - var self = this, dom = DOMUtils.DOM, count = settings.count !== undefined ? settings.count : self.count; - var id = 'tinymce_jsonp_' + count; - - self.callbacks[count] = function(json) { - dom.remove(id); - delete self.callbacks[count]; - - settings.callback(json); - }; - - dom.add(dom.doc.body, 'script', { - id: id, - src: settings.url, - type: 'text/javascript' - }); - - self.count++; - } - }; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/util/JSONRequest.js b/common/static/js/vendor/tinymce/js/tinymce/classes/util/JSONRequest.js deleted file mode 100755 index 0277a66cb88f..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/util/JSONRequest.js +++ /dev/null @@ -1,110 +0,0 @@ -/** - * JSONRequest.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class enables you to use JSON-RPC to call backend methods. - * - * @class tinymce.util.JSONRequest - * @example - * var json = new tinymce.util.JSONRequest({ - * url: 'somebackend.php' - * }); - * - * // Send RPC call 1 - * json.send({ - * method: 'someMethod1', - * params: ['a', 'b'], - * success: function(result) { - * console.dir(result); - * } - * }); - * - * // Send RPC call 2 - * json.send({ - * method: 'someMethod2', - * params: ['a', 'b'], - * success: function(result) { - * console.dir(result); - * } - * }); - */ -define("tinymce/util/JSONRequest", [ - "tinymce/util/JSON", - "tinymce/util/XHR", - "tinymce/util/Tools" -], function(JSON, XHR, Tools) { - var extend = Tools.extend; - - function JSONRequest(settings) { - this.settings = extend({}, settings); - this.count = 0; - } - - /** - * Simple helper function to send a JSON-RPC request without the need to initialize an object. - * Consult the Wiki API documentation for more details on what you can pass to this function. - * - * @method sendRPC - * @static - * @param {Object} o Call object where there are three field id, method and params this object should also contain callbacks etc. - */ - JSONRequest.sendRPC = function(o) { - return new JSONRequest().send(o); - }; - - JSONRequest.prototype = { - /** - * Sends a JSON-RPC call. Consult the Wiki API documentation for more details on what you can pass to this function. - * - * @method send - * @param {Object} args Call object where there are three field id, method and params this object should also contain callbacks etc. - */ - send: function(args) { - var ecb = args.error, scb = args.success; - - args = extend(this.settings, args); - - args.success = function(c, x) { - c = JSON.parse(c); - - if (typeof(c) == 'undefined') { - c = { - error : 'JSON Parse error.' - }; - } - - if (c.error) { - ecb.call(args.error_scope || args.scope, c.error, x); - } else { - scb.call(args.success_scope || args.scope, c.result); - } - }; - - args.error = function(ty, x) { - if (ecb) { - ecb.call(args.error_scope || args.scope, ty, x); - } - }; - - args.data = JSON.serialize({ - id: args.id || 'c' + (this.count++), - method: args.method, - params: args.params - }); - - // JSON content type for Ruby on rails. Bug: #1883287 - args.content_type = 'application/json'; - - XHR.send(args); - } - }; - - return JSONRequest; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/util/LocalStorage.js b/common/static/js/vendor/tinymce/js/tinymce/classes/util/LocalStorage.js deleted file mode 100755 index 6a6d890c7e71..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/util/LocalStorage.js +++ /dev/null @@ -1,213 +0,0 @@ -/** - * LocalStorage.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class will simulate LocalStorage on IE 7 and return the native version on modern browsers. - * Storage is done using userData on IE 7 and a special serialization format. The format is designed - * to be as small as possible by making sure that the keys and values doesn't need to be encoded. This - * makes it possible to store for example HTML data. - * - * Storage format for userData: - * ,,,,... - * - * For example this data key1=value1,key2=value2 would be: - * 4,key1,6,value1,4,key2,6,value2 - * - * @class tinymce.util.LocalStorage - * @static - * @version 4.0 - * @example - * tinymce.util.LocalStorage.setItem('key', 'value'); - * var value = tinymce.util.LocalStorage.getItem('key'); - */ -define("tinymce/util/LocalStorage", [], function() { - var LocalStorage, storageElm, items, keys, userDataKey, hasOldIEDataSupport; - - // Check for native support - try { - if (window.localStorage) { - return localStorage; - } - } catch (ex) { - // Ignore - } - - userDataKey = "tinymce"; - storageElm = document.documentElement; - hasOldIEDataSupport = !!storageElm.addBehavior; - - if (hasOldIEDataSupport) { - storageElm.addBehavior('#default#userData'); - } - - /** - * Gets the keys names and updates LocalStorage.length property. Since IE7 doesn't have any getters/setters. - */ - function updateKeys() { - keys = []; - - for (var key in items) { - keys.push(key); - } - - LocalStorage.length = keys.length; - } - - /** - * Loads the userData string and parses it into the items structure. - */ - function load() { - var key, data, value, pos = 0; - - items = {}; - - // localStorage can be disabled on WebKit/Gecko so make a dummy storage - if (!hasOldIEDataSupport) { - return; - } - - function next(end) { - var value, nextPos; - - nextPos = end !== undefined ? pos + end : data.indexOf(',', pos); - if (nextPos === -1 || nextPos > data.length) { - return null; - } - - value = data.substring(pos, nextPos); - pos = nextPos + 1; - - return value; - } - - storageElm.load(userDataKey); - data = storageElm.getAttribute(userDataKey) || ''; - - do { - var offset = next(); - if (offset === null) { - break; - } - - key = next(parseInt(offset, 32) || 0); - if (key !== null) { - offset = next(); - if (offset === null) { - break; - } - - value = next(parseInt(offset, 32) || 0); - - if (key) { - items[key] = value; - } - } - } while (key !== null); - - updateKeys(); - } - - /** - * Saves the items structure into a the userData format. - */ - function save() { - var value, data = ''; - - // localStorage can be disabled on WebKit/Gecko so make a dummy storage - if (!hasOldIEDataSupport) { - return; - } - - for (var key in items) { - value = items[key]; - data += (data ? ',' : '') + key.length.toString(32) + ',' + key + ',' + value.length.toString(32) + ',' + value; - } - - storageElm.setAttribute(userDataKey, data); - - try { - storageElm.save(userDataKey); - } catch (ex) { - // Ignore disk full - } - - updateKeys(); - } - - LocalStorage = { - /** - * Length of the number of items in storage. - * - * @property length - * @type Number - * @return {Number} Number of items in storage. - */ - //length:0, - - /** - * Returns the key name by index. - * - * @method key - * @param {Number} index Index of key to return. - * @return {String} Key value or null if it wasn't found. - */ - key: function(index) { - return keys[index]; - }, - - /** - * Returns the value if the specified key or null if it wasn't found. - * - * @method getItem - * @param {String} key Key of item to retrive. - * @return {String} Value of the specified item or null if it wasn't found. - */ - getItem: function(key) { - return key in items ? items[key] : null; - }, - - /** - * Sets the value of the specified item by it's key. - * - * @method setItem - * @param {String} key Key of the item to set. - * @param {String} value Value of the item to set. - */ - setItem: function(key, value) { - items[key] = "" + value; - save(); - }, - - /** - * Removes the specified item by key. - * - * @method removeItem - * @param {String} key Key of item to remove. - */ - removeItem: function(key) { - delete items[key]; - save(); - }, - - /** - * Removes all items. - * - * @method clear - */ - clear: function() { - items = {}; - save(); - } - }; - - load(); - - return LocalStorage; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/util/Observable.js b/common/static/js/vendor/tinymce/js/tinymce/classes/util/Observable.js deleted file mode 100755 index ca17e677c52e..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/util/Observable.js +++ /dev/null @@ -1,250 +0,0 @@ -/** - * Observable.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This mixin will add event binding logic to classes. - * - * @mixin tinymce.util.Observable - */ -define("tinymce/util/Observable", [ - "tinymce/util/Tools" -], function(Tools) { - var bindingsName = "__bindings"; - var nativeEvents = Tools.makeMap( - "focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange" + - " mouseout mouseenter mouseleave keydown keypress keyup contextmenu dragstart dragend dragover draggesture dragdrop drop drag", ' ' - ); - - function returnFalse() { - return false; - } - - function returnTrue() { - return true; - } - - return { - /** - * Fires the specified event by name. - * - * @method fire - * @param {String} name Name of the event to fire. - * @param {tinymce.Event/Object?} args Event arguments. - * @param {Boolean?} bubble True/false if the event is to be bubbled. - * @return {tinymce.Event} Event instance passed in converted into tinymce.Event instance. - * @example - * instance.fire('event', {...}); - */ - fire: function(name, args, bubble) { - var self = this, handlers, i, l, callback, parent; - - if (self.removed) { - return; - } - - name = name.toLowerCase(); - args = args || {}; - args.type = name; - - // Setup target is there isn't one - if (!args.target) { - args.target = self; - } - - // Add event delegation methods if they are missing - if (!args.preventDefault) { - // Add preventDefault method - args.preventDefault = function() { - args.isDefaultPrevented = returnTrue; - }; - - // Add stopPropagation - args.stopPropagation = function() { - args.isPropagationStopped = returnTrue; - }; - - // Add stopImmediatePropagation - args.stopImmediatePropagation = function() { - args.isImmediatePropagationStopped = returnTrue; - }; - - // Add event delegation states - args.isDefaultPrevented = returnFalse; - args.isPropagationStopped = returnFalse; - args.isImmediatePropagationStopped = returnFalse; - } - - //console.log(name, args); - - if (self[bindingsName]) { - handlers = self[bindingsName][name]; - - if (handlers) { - for (i = 0, l = handlers.length; i < l; i++) { - handlers[i] = callback = handlers[i]; - - // Stop immediate propagation if needed - if (args.isImmediatePropagationStopped()) { - break; - } - - // If callback returns false then prevent default and stop all propagation - if (callback.call(self, args) === false) { - args.preventDefault(); - return args; - } - } - } - } - - // Bubble event up to parents - if (bubble !== false && self.parent) { - parent = self.parent(); - while (parent && !args.isPropagationStopped()) { - parent.fire(name, args, false); - parent = parent.parent(); - } - } - - return args; - }, - - /** - * Binds an event listener to a specific event by name. - * - * @method on - * @param {String} name Event name or space separated list of events to bind. - * @param {callback} callback Callback to be executed when the event occurs. - * @param {Boolean} first Optional flag if the event should be prepended. Use this with care. - * @return {Object} Current class instance. - * @example - * instance.on('event', function(e) { - * // Callback logic - * }); - */ - on: function(name, callback, prepend) { - var self = this, bindings, handlers, names, i; - - if (callback === false) { - callback = function() { - return false; - }; - } - - if (callback) { - names = name.toLowerCase().split(' '); - i = names.length; - while (i--) { - name = names[i]; - - bindings = self[bindingsName]; - if (!bindings) { - bindings = self[bindingsName] = {}; - } - - handlers = bindings[name]; - if (!handlers) { - handlers = bindings[name] = []; - if (self.bindNative && nativeEvents[name]) { - self.bindNative(name); - } - } - - if (prepend) { - handlers.unshift(callback); - } else { - handlers.push(callback); - } - } - } - - return self; - }, - - /** - * Unbinds an event listener to a specific event by name. - * - * @method off - * @param {String?} name Name of the event to unbind. - * @param {callback?} callback Callback to unbind. - * @return {Object} Current class instance. - * @example - * // Unbind specific callback - * instance.off('event', handler); - * - * // Unbind all listeners by name - * instance.off('event'); - * - * // Unbind all events - * instance.off(); - */ - off: function(name, callback) { - var self = this, i, bindings = self[bindingsName], handlers, bindingName, names, hi; - - if (bindings) { - if (name) { - names = name.toLowerCase().split(' '); - i = names.length; - while (i--) { - name = names[i]; - handlers = bindings[name]; - - // Unbind all handlers - if (!name) { - for (bindingName in bindings) { - bindings[name].length = 0; - } - - return self; - } - - if (handlers) { - // Unbind all by name - if (!callback) { - handlers.length = 0; - } else { - // Unbind specific ones - hi = handlers.length; - while (hi--) { - if (handlers[hi] === callback) { - handlers.splice(hi, 1); - } - } - } - - if (!handlers.length && self.unbindNative && nativeEvents[name]) { - self.unbindNative(name); - delete bindings[name]; - } - } - } - } else { - if (self.unbindNative) { - for (name in bindings) { - self.unbindNative(name); - } - } - - self[bindingsName] = []; - } - } - - return self; - }, - - hasEventListeners: function(name) { - var bindings = this[bindingsName]; - - name = name.toLowerCase(); - - return !(!bindings || !bindings[name] || bindings[name].length === 0); - } - }; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/util/Quirks.js b/common/static/js/vendor/tinymce/js/tinymce/classes/util/Quirks.js deleted file mode 100755 index 27b610c55193..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/util/Quirks.js +++ /dev/null @@ -1,1139 +0,0 @@ -/** - * Quirks.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - * - * @ignore-file - */ - -/** - * This file includes fixes for various browser quirks it's made to make it easy to add/remove browser specific fixes. - * - * @class tinymce.util.Quirks - */ -define("tinymce/util/Quirks", [ - "tinymce/util/VK", - "tinymce/dom/RangeUtils", - "tinymce/html/Node", - "tinymce/html/Entities", - "tinymce/Env", - "tinymce/util/Tools" -], function(VK, RangeUtils, Node, Entities, Env, Tools) { - return function(editor) { - var each = Tools.each; - var BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE, dom = editor.dom, selection = editor.selection, - settings = editor.settings, parser = editor.parser, serializer = editor.serializer; - var isGecko = Env.gecko, isIE = Env.ie, isWebKit = Env.webkit; - - /** - * Executes a command with a specific state this can be to enable/disable browser editing features. - */ - function setEditorCommandState(cmd, state) { - try { - editor.getDoc().execCommand(cmd, false, state); - } catch (ex) { - // Ignore - } - } - - /** - * Returns current IE document mode. - */ - function getDocumentMode() { - var documentMode = editor.getDoc().documentMode; - - return documentMode ? documentMode : 6; - } - - /** - * Returns true/false if the event is prevented or not. - * - * @private - * @param {Event} e Event object. - * @return {Boolean} true/false if the event is prevented or not. - */ - function isDefaultPrevented(e) { - return e.isDefaultPrevented(); - } - - /** - * Fixes a WebKit bug when deleting contents using backspace or delete key. - * WebKit will produce a span element if you delete across two block elements. - * - * Example: - *

    a

    |b

    - * - * Will produce this on backspace: - *

    ab

    - * - * This fixes the backspace to produce: - *

    a|b

    - * - * See bug: https://bugs.webkit.org/show_bug.cgi?id=45784 - * - * This fixes the following delete scenarios: - * 1. Delete by pressing backspace key. - * 2. Delete by pressing delete key. - * 3. Delete by pressing backspace key with ctrl/cmd (Word delete). - * 4. Delete by pressing delete key with ctrl/cmd (Word delete). - * 5. Delete by drag/dropping contents inside the editor. - * 6. Delete by using Cut Ctrl+X/Cmd+X. - * 7. Delete by selecting contents and writing a character.' - * - * This code is a ugly hack since writing full custom delete logic for just this bug - * fix seemed like a huge task. I hope we can remove this before the year 2030. - */ - function cleanupStylesWhenDeleting() { - var doc = editor.getDoc(), urlPrefix = 'data:text/mce-internal,'; - var MutationObserver = window.MutationObserver, olderWebKit; - - // Add mini polyfill for older WebKits - // TODO: Remove this when old Safari versions gets updated - if (!MutationObserver) { - olderWebKit = true; - - MutationObserver = function() { - var records = [], target; - - function nodeInsert(e) { - var target = e.relatedNode || e.target; - records.push({target: target, addedNodes: [target]}); - } - - function attrModified(e) { - var target = e.relatedNode || e.target; - records.push({target: target, attributeName: e.attrName}); - } - - this.observe = function(node) { - target = node; - target.addEventListener('DOMSubtreeModified', nodeInsert, false); - target.addEventListener('DOMNodeInsertedIntoDocument', nodeInsert, false); - target.addEventListener('DOMNodeInserted', nodeInsert, false); - target.addEventListener('DOMAttrModified', attrModified, false); - }; - - this.disconnect = function() { - target.removeEventListener('DOMNodeInserted', nodeInsert); - target.removeEventListener('DOMAttrModified', attrModified); - target.removeEventListener('DOMSubtreeModified', nodeInsert, false); - }; - - this.takeRecords = function() { - return records; - }; - }; - } - - function customDelete(isForward) { - var mutationObserver = new MutationObserver(function() {}); - - Tools.each(editor.getBody().getElementsByTagName('*'), function(elm) { - // Mark existing spans - if (elm.tagName == 'SPAN') { - elm.setAttribute('mce-data-marked', 1); - } - - // Make sure all elements has a data-mce-style attribute - if (!elm.hasAttribute('data-mce-style') && elm.hasAttribute('style')) { - editor.dom.setAttrib(elm, 'style', elm.getAttribute('style')); - } - }); - - // Observe added nodes and style attribute changes - mutationObserver.observe(editor.getDoc(), { - childList: true, - attributes: true, - subtree: true, - attributeFilter: ['style'] - }); - - editor.getDoc().execCommand(isForward ? 'ForwardDelete' : 'Delete', false, null); - - var rng = editor.selection.getRng(); - var caretElement = rng.startContainer.parentNode; - - Tools.each(mutationObserver.takeRecords(), function(record) { - // Restore style attribute to previous value - if (record.attributeName == "style") { - var oldValue = record.target.getAttribute('data-mce-style'); - - if (oldValue) { - record.target.setAttribute("style", oldValue); - } else { - record.target.removeAttribute("style"); - } - } - - // Remove all spans that isn't maked and retain selection - Tools.each(record.addedNodes, function(node) { - if (node.nodeName == "SPAN" && !node.getAttribute('mce-data-marked')) { - var offset, container; - - if (node == caretElement) { - offset = rng.startOffset; - container = node.firstChild; - } - - dom.remove(node, true); - - if (container) { - rng.setStart(container, offset); - rng.setEnd(container, offset); - editor.selection.setRng(rng); - } - } - }); - }); - - mutationObserver.disconnect(); - - // Remove any left over marks - Tools.each(editor.dom.select('span[mce-data-marked]'), function(span) { - span.removeAttribute('mce-data-marked'); - }); - } - - editor.on('keydown', function(e) { - var isForward = e.keyCode == DELETE, isMeta = VK.metaKeyPressed(e); - - if (!isDefaultPrevented(e) && (isForward || e.keyCode == BACKSPACE)) { - var rng = editor.selection.getRng(), container = rng.startContainer, offset = rng.startOffset; - - // Ignore non meta delete in the where there is text before/after the caret - if (!isMeta && rng.collapsed && container.nodeType == 3) { - if (isForward ? offset < container.data.length : offset > 0) { - return; - } - } - - e.preventDefault(); - - if (isMeta) { - editor.selection.getSel().modify("extend", isForward ? "forward" : "backward", "word"); - } - - customDelete(isForward); - } - }); - - editor.on('keypress', function(e) { - if (!isDefaultPrevented(e) && !selection.isCollapsed() && e.charCode && !VK.metaKeyPressed(e)) { - e.preventDefault(); - customDelete(true); - editor.selection.setContent(String.fromCharCode(e.charCode)); - } - }); - - editor.addCommand('Delete', function() { - customDelete(); - }); - - editor.addCommand('ForwardDelete', function() { - customDelete(true); - }); - - // Older WebKits doesn't properly handle the clipboard so we can't add the rest - if (olderWebKit) { - return; - } - - editor.on('dragstart', function(e) { - // Safari doesn't support custom dataTransfer items so we can only use URL and Text - e.dataTransfer.setData('URL', 'data:text/mce-internal,' + escape(editor.selection.getContent())); - }); - - editor.on('drop', function(e) { - if (!isDefaultPrevented(e)) { - var internalContent = e.dataTransfer.getData('URL'); - - if (!internalContent || internalContent.indexOf(urlPrefix) == -1 || !doc.caretRangeFromPoint) { - return; - } - - internalContent = unescape(internalContent.substr(urlPrefix.length)); - if (doc.caretRangeFromPoint) { - e.preventDefault(); - customDelete(); - editor.selection.setRng(doc.caretRangeFromPoint(e.x, e.y)); - editor.insertContent(internalContent); - } - } - }); - - editor.on('cut', function(e) { - if (!isDefaultPrevented(e) && e.clipboardData) { - e.preventDefault(); - e.clipboardData.clearData(); - e.clipboardData.setData('text/html', editor.selection.getContent()); - e.clipboardData.setData('text/plain', editor.selection.getContent({format: 'text'})); - customDelete(true); - } - }); - } - - /** - * Makes sure that the editor body becomes empty when backspace or delete is pressed in empty editors. - * - * For example: - *

    |

    - * - * Or: - *

    |

    - * - * Or: - * [

    ] - */ - function emptyEditorWhenDeleting() { - function serializeRng(rng) { - var body = dom.create("body"); - var contents = rng.cloneContents(); - body.appendChild(contents); - return selection.serializer.serialize(body, {format: 'html'}); - } - - function allContentsSelected(rng) { - if (!rng.setStart) { - if (rng.item) { - return false; - } - - var bodyRng = rng.duplicate(); - bodyRng.moveToElementText(editor.getBody()); - return RangeUtils.compareRanges(rng, bodyRng); - } - - var selection = serializeRng(rng); - - var allRng = dom.createRng(); - allRng.selectNode(editor.getBody()); - - var allSelection = serializeRng(allRng); - return selection === allSelection; - } - - editor.on('keydown', function(e) { - var keyCode = e.keyCode, isCollapsed, body; - - // Empty the editor if it's needed for example backspace at

    |

    - if (!isDefaultPrevented(e) && (keyCode == DELETE || keyCode == BACKSPACE)) { - isCollapsed = editor.selection.isCollapsed(); - body = editor.getBody(); - - // Selection is collapsed but the editor isn't empty - if (isCollapsed && !dom.isEmpty(body)) { - return; - } - - // Selection isn't collapsed but not all the contents is selected - if (!isCollapsed && !allContentsSelected(editor.selection.getRng())) { - return; - } - - // Manually empty the editor - e.preventDefault(); - editor.setContent(''); - - if (body.firstChild && dom.isBlock(body.firstChild)) { - editor.selection.setCursorLocation(body.firstChild, 0); - } else { - editor.selection.setCursorLocation(body, 0); - } - - editor.nodeChanged(); - } - }); - } - - /** - * WebKit doesn't select all the nodes in the body when you press Ctrl+A. - * IE selects more than the contents [

    a

    ] instead of

    [a] see bug #6438 - * This selects the whole body so that backspace/delete logic will delete everything - */ - function selectAll() { - editor.on('keydown', function(e) { - if (!isDefaultPrevented(e) && e.keyCode == 65 && VK.metaKeyPressed(e)) { - e.preventDefault(); - editor.execCommand('SelectAll'); - } - }); - } - - /** - * WebKit has a weird issue where it some times fails to properly convert keypresses to input method keystrokes. - * The IME on Mac doesn't initialize when it doesn't fire a proper focus event. - * - * This seems to happen when the user manages to click the documentElement element then the window doesn't get proper focus until - * you enter a character into the editor. - * - * It also happens when the first focus in made to the body. - * - * See: https://bugs.webkit.org/show_bug.cgi?id=83566 - */ - function inputMethodFocus() { - if (!editor.settings.content_editable) { - // Case 1 IME doesn't initialize if you focus the document - dom.bind(editor.getDoc(), 'focusin', function() { - selection.setRng(selection.getRng()); - }); - - // Case 2 IME doesn't initialize if you click the documentElement it also doesn't properly fire the focusin event - dom.bind(editor.getDoc(), 'mousedown', function(e) { - if (e.target == editor.getDoc().documentElement) { - editor.getBody().focus(); - selection.setRng(selection.getRng()); - } - }); - } - } - - /** - * Backspacing in FireFox/IE from a paragraph into a horizontal rule results in a floating text node because the - * browser just deletes the paragraph - the browser fails to merge the text node with a horizontal rule so it is - * left there. TinyMCE sees a floating text node and wraps it in a paragraph on the key up event (ForceBlocks.js - * addRootBlocks), meaning the action does nothing. With this code, FireFox/IE matche the behaviour of other - * browsers. - * - * It also fixes a bug on Firefox where it's impossible to delete HR elements. - */ - function removeHrOnBackspace() { - editor.on('keydown', function(e) { - if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) { - if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) { - var node = selection.getNode(); - var previousSibling = node.previousSibling; - - if (node.nodeName == 'HR') { - dom.remove(node); - e.preventDefault(); - return; - } - - if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "hr") { - dom.remove(previousSibling); - e.preventDefault(); - } - } - } - }); - } - - /** - * Firefox 3.x has an issue where the body element won't get proper focus if you click out - * side it's rectangle. - */ - function focusBody() { - // Fix for a focus bug in FF 3.x where the body element - // wouldn't get proper focus if the user clicked on the HTML element - if (!window.Range.prototype.getClientRects) { // Detect getClientRects got introduced in FF 4 - editor.on('mousedown', function(e) { - if (!isDefaultPrevented(e) && e.target.nodeName === "HTML") { - var body = editor.getBody(); - - // Blur the body it's focused but not correctly focused - body.blur(); - - // Refocus the body after a little while - setTimeout(function() { - body.focus(); - }, 0); - } - }); - } - } - - /** - * WebKit has a bug where it isn't possible to select image, hr or anchor elements - * by clicking on them so we need to fake that. - */ - function selectControlElements() { - editor.on('click', function(e) { - e = e.target; - - // Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250 - // WebKit can't even do simple things like selecting an image - // Needs tobe the setBaseAndExtend or it will fail to select floated images - if (/^(IMG|HR)$/.test(e.nodeName)) { - selection.getSel().setBaseAndExtent(e, 0, e, 1); - } - - if (e.nodeName == 'A' && dom.hasClass(e, 'mce-item-anchor')) { - selection.select(e); - } - - editor.nodeChanged(); - }); - } - - /** - * Fixes a Gecko bug where the style attribute gets added to the wrong element when deleting between two block elements. - * - * Fixes do backspace/delete on this: - *

    bla[ck

    r]ed

    - * - * Would become: - *

    bla|ed

    - * - * Instead of: - *

    bla|ed

    - */ - function removeStylesWhenDeletingAcrossBlockElements() { - function getAttributeApplyFunction() { - var template = dom.getAttribs(selection.getStart().cloneNode(false)); - - return function() { - var target = selection.getStart(); - - if (target !== editor.getBody()) { - dom.setAttrib(target, "style", null); - - each(template, function(attr) { - target.setAttributeNode(attr.cloneNode(true)); - }); - } - }; - } - - function isSelectionAcrossElements() { - return !selection.isCollapsed() && - dom.getParent(selection.getStart(), dom.isBlock) != dom.getParent(selection.getEnd(), dom.isBlock); - } - - editor.on('keypress', function(e) { - var applyAttributes; - - if (!isDefaultPrevented(e) && (e.keyCode == 8 || e.keyCode == 46) && isSelectionAcrossElements()) { - applyAttributes = getAttributeApplyFunction(); - editor.getDoc().execCommand('delete', false, null); - applyAttributes(); - e.preventDefault(); - return false; - } - }); - - dom.bind(editor.getDoc(), 'cut', function(e) { - var applyAttributes; - - if (!isDefaultPrevented(e) && isSelectionAcrossElements()) { - applyAttributes = getAttributeApplyFunction(); - - setTimeout(function() { - applyAttributes(); - }, 0); - } - }); - } - - /** - * Fire a nodeChanged when the selection is changed on WebKit this fixes selection issues on iOS5. It only fires the nodeChange - * event every 50ms since it would other wise update the UI when you type and it hogs the CPU. - */ - function selectionChangeNodeChanged() { - var lastRng, selectionTimer; - - editor.on('selectionchange', function() { - if (selectionTimer) { - clearTimeout(selectionTimer); - selectionTimer = 0; - } - - selectionTimer = window.setTimeout(function() { - if (editor.removed) { - return; - } - - var rng = selection.getRng(); - - // Compare the ranges to see if it was a real change or not - if (!lastRng || !RangeUtils.compareRanges(rng, lastRng)) { - editor.nodeChanged(); - lastRng = rng; - } - }, 50); - }); - } - - /** - * Screen readers on IE needs to have the role application set on the body. - */ - function ensureBodyHasRoleApplication() { - document.body.setAttribute("role", "application"); - } - - /** - * Backspacing into a table behaves differently depending upon browser type. - * Therefore, disable Backspace when cursor immediately follows a table. - */ - function disableBackspaceIntoATable() { - editor.on('keydown', function(e) { - if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) { - if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) { - var previousSibling = selection.getNode().previousSibling; - if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "table") { - e.preventDefault(); - return false; - } - } - } - }); - } - - /** - * Old IE versions can't properly render BR elements in PRE tags white in contentEditable mode. So this - * logic adds a \n before the BR so that it will get rendered. - */ - function addNewLinesBeforeBrInPre() { - // IE8+ rendering mode does the right thing with BR in PRE - if (getDocumentMode() > 7) { - return; - } - - // Enable display: none in area and add a specific class that hides all BR elements in PRE to - // avoid the caret from getting stuck at the BR elements while pressing the right arrow key - setEditorCommandState('RespectVisibilityInDesign', true); - editor.contentStyles.push('.mceHideBrInPre pre br {display: none}'); - dom.addClass(editor.getBody(), 'mceHideBrInPre'); - - // Adds a \n before all BR elements in PRE to get them visual - parser.addNodeFilter('pre', function(nodes) { - var i = nodes.length, brNodes, j, brElm, sibling; - - while (i--) { - brNodes = nodes[i].getAll('br'); - j = brNodes.length; - while (j--) { - brElm = brNodes[j]; - - // Add \n before BR in PRE elements on older IE:s so the new lines get rendered - sibling = brElm.prev; - if (sibling && sibling.type === 3 && sibling.value.charAt(sibling.value - 1) != '\n') { - sibling.value += '\n'; - } else { - brElm.parent.insert(new Node('#text', 3), brElm, true).value = '\n'; - } - } - } - }); - - // Removes any \n before BR elements in PRE since other browsers and in contentEditable=false mode they will be visible - serializer.addNodeFilter('pre', function(nodes) { - var i = nodes.length, brNodes, j, brElm, sibling; - - while (i--) { - brNodes = nodes[i].getAll('br'); - j = brNodes.length; - while (j--) { - brElm = brNodes[j]; - sibling = brElm.prev; - if (sibling && sibling.type == 3) { - sibling.value = sibling.value.replace(/\r?\n$/, ''); - } - } - } - }); - } - - /** - * Moves style width/height to attribute width/height when the user resizes an image on IE. - */ - function removePreSerializedStylesWhenSelectingControls() { - dom.bind(editor.getBody(), 'mouseup', function() { - var value, node = selection.getNode(); - - // Moved styles to attributes on IMG eements - if (node.nodeName == 'IMG') { - // Convert style width to width attribute - if ((value = dom.getStyle(node, 'width'))) { - dom.setAttrib(node, 'width', value.replace(/[^0-9%]+/g, '')); - dom.setStyle(node, 'width', ''); - } - - // Convert style height to height attribute - if ((value = dom.getStyle(node, 'height'))) { - dom.setAttrib(node, 'height', value.replace(/[^0-9%]+/g, '')); - dom.setStyle(node, 'height', ''); - } - } - }); - } - - /** - * Removes a blockquote when backspace is pressed at the beginning of it. - * - * For example: - *

    |x

    - * - * Becomes: - *

    |x

    - */ - function removeBlockQuoteOnBackSpace() { - // Add block quote deletion handler - editor.on('keydown', function(e) { - var rng, container, offset, root, parent; - - if (isDefaultPrevented(e) || e.keyCode != VK.BACKSPACE) { - return; - } - - rng = selection.getRng(); - container = rng.startContainer; - offset = rng.startOffset; - root = dom.getRoot(); - parent = container; - - if (!rng.collapsed || offset !== 0) { - return; - } - - while (parent && parent.parentNode && parent.parentNode.firstChild == parent && parent.parentNode != root) { - parent = parent.parentNode; - } - - // Is the cursor at the beginning of a blockquote? - if (parent.tagName === 'BLOCKQUOTE') { - // Remove the blockquote - editor.formatter.toggle('blockquote', null, parent); - - // Move the caret to the beginning of container - rng = dom.createRng(); - rng.setStart(container, 0); - rng.setEnd(container, 0); - selection.setRng(rng); - } - }); - } - - /** - * Sets various Gecko editing options on mouse down and before a execCommand to disable inline table editing that is broken etc. - */ - function setGeckoEditingOptions() { - function setOpts() { - editor._refreshContentEditable(); - - setEditorCommandState("StyleWithCSS", false); - setEditorCommandState("enableInlineTableEditing", false); - - if (!settings.object_resizing) { - setEditorCommandState("enableObjectResizing", false); - } - } - - if (!settings.readonly) { - editor.on('BeforeExecCommand MouseDown', setOpts); - } - } - - /** - * Fixes a gecko link bug, when a link is placed at the end of block elements there is - * no way to move the caret behind the link. This fix adds a bogus br element after the link. - * - * For example this: - *

    x

    - * - * Becomes this: - *

    x

    - */ - function addBrAfterLastLinks() { - function fixLinks() { - each(dom.select('a'), function(node) { - var parentNode = node.parentNode, root = dom.getRoot(); - - if (parentNode.lastChild === node) { - while (parentNode && !dom.isBlock(parentNode)) { - if (parentNode.parentNode.lastChild !== parentNode || parentNode === root) { - return; - } - - parentNode = parentNode.parentNode; - } - - dom.add(parentNode, 'br', {'data-mce-bogus': 1}); - } - }); - } - - editor.on('SetContent ExecCommand', function(e) { - if (e.type == "setcontent" || e.command === 'mceInsertLink') { - fixLinks(); - } - }); - } - - /** - * WebKit will produce DIV elements here and there by default. But since TinyMCE uses paragraphs by - * default we want to change that behavior. - */ - function setDefaultBlockType() { - if (settings.forced_root_block) { - editor.on('init', function() { - setEditorCommandState('DefaultParagraphSeparator', settings.forced_root_block); - }); - } - } - - /** - * Removes ghost selections from images/tables on Gecko. - */ - function removeGhostSelection() { - editor.on('Undo Redo SetContent', function(e) { - if (!e.initial) { - editor.execCommand('mceRepaint'); - } - }); - } - - /** - * Deletes the selected image on IE instead of navigating to previous page. - */ - function deleteControlItemOnBackSpace() { - editor.on('keydown', function(e) { - var rng; - - if (!isDefaultPrevented(e) && e.keyCode == BACKSPACE) { - rng = editor.getDoc().selection.createRange(); - if (rng && rng.item) { - e.preventDefault(); - editor.undoManager.beforeChange(); - dom.remove(rng.item(0)); - editor.undoManager.add(); - } - } - }); - } - - /** - * IE10 doesn't properly render block elements with the right height until you add contents to them. - * This fixes that by adding a padding-right to all empty text block elements. - * See: https://connect.microsoft.com/IE/feedback/details/743881 - */ - function renderEmptyBlocksFix() { - var emptyBlocksCSS; - - // IE10+ - if (getDocumentMode() >= 10) { - emptyBlocksCSS = ''; - each('p div h1 h2 h3 h4 h5 h6'.split(' '), function(name, i) { - emptyBlocksCSS += (i > 0 ? ',' : '') + name + ':empty'; - }); - - editor.contentStyles.push(emptyBlocksCSS + '{padding-right: 1px !important}'); - } - } - - /** - * Old IE versions can't retain contents within noscript elements so this logic will store the contents - * as a attribute and the insert that value as it's raw text when the DOM is serialized. - */ - function keepNoScriptContents() { - if (getDocumentMode() < 9) { - parser.addNodeFilter('noscript', function(nodes) { - var i = nodes.length, node, textNode; - - while (i--) { - node = nodes[i]; - textNode = node.firstChild; - - if (textNode) { - node.attr('data-mce-innertext', textNode.value); - } - } - }); - - serializer.addNodeFilter('noscript', function(nodes) { - var i = nodes.length, node, textNode, value; - - while (i--) { - node = nodes[i]; - textNode = nodes[i].firstChild; - - if (textNode) { - textNode.value = Entities.decode(textNode.value); - } else { - // Old IE can't retain noscript value so an attribute is used to store it - value = node.attributes.map['data-mce-innertext']; - if (value) { - node.attr('data-mce-innertext', null); - textNode = new Node('#text', 3); - textNode.value = value; - textNode.raw = true; - node.append(textNode); - } - } - } - }); - } - } - - /** - * IE has an issue where you can't select/move the caret by clicking outside the body if the document is in standards mode. - */ - function fixCaretSelectionOfDocumentElementOnIe() { - var doc = dom.doc, body = doc.body, started, startRng, htmlElm; - - // Return range from point or null if it failed - function rngFromPoint(x, y) { - var rng = body.createTextRange(); - - try { - rng.moveToPoint(x, y); - } catch (ex) { - // IE sometimes throws and exception, so lets just ignore it - rng = null; - } - - return rng; - } - - // Fires while the selection is changing - function selectionChange(e) { - var pointRng; - - // Check if the button is down or not - if (e.button) { - // Create range from mouse position - pointRng = rngFromPoint(e.x, e.y); - - if (pointRng) { - // Check if pointRange is before/after selection then change the endPoint - if (pointRng.compareEndPoints('StartToStart', startRng) > 0) { - pointRng.setEndPoint('StartToStart', startRng); - } else { - pointRng.setEndPoint('EndToEnd', startRng); - } - - pointRng.select(); - } - } else { - endSelection(); - } - } - - // Removes listeners - function endSelection() { - var rng = doc.selection.createRange(); - - // If the range is collapsed then use the last start range - if (startRng && !rng.item && rng.compareEndPoints('StartToEnd', rng) === 0) { - startRng.select(); - } - - dom.unbind(doc, 'mouseup', endSelection); - dom.unbind(doc, 'mousemove', selectionChange); - startRng = started = 0; - } - - // Make HTML element unselectable since we are going to handle selection by hand - doc.documentElement.unselectable = true; - - // Detect when user selects outside BODY - dom.bind(doc, 'mousedown contextmenu', function(e) { - if (e.target.nodeName === 'HTML') { - if (started) { - endSelection(); - } - - // Detect vertical scrollbar, since IE will fire a mousedown on the scrollbar and have target set as HTML - htmlElm = doc.documentElement; - if (htmlElm.scrollHeight > htmlElm.clientHeight) { - return; - } - - started = 1; - // Setup start position - startRng = rngFromPoint(e.x, e.y); - if (startRng) { - // Listen for selection change events - dom.bind(doc, 'mouseup', endSelection); - dom.bind(doc, 'mousemove', selectionChange); - - dom.getRoot().focus(); - startRng.select(); - } - } - }); - } - - /** - * Fixes selection issues where the caret can be placed between two inline elements like a|b - * this fix will lean the caret right into the closest inline element. - */ - function normalizeSelection() { - // Normalize selection for example a|a becomes a|a except for Ctrl+A since it selects everything - editor.on('keyup focusin mouseup', function(e) { - if (e.keyCode != 65 || !VK.metaKeyPressed(e)) { - selection.normalize(); - } - }, true); - } - - /** - * Forces Gecko to render a broken image icon if it fails to load an image. - */ - function showBrokenImageIcon() { - editor.contentStyles.push( - 'img:-moz-broken {' + - '-moz-force-broken-image-icon:1;' + - 'min-width:24px;' + - 'min-height:24px' + - '}' - ); - } - - /** - * iOS has a bug where it's impossible to type if the document has a touchstart event - * bound and the user touches the document while having the on screen keyboard visible. - * - * The touch event moves the focus to the parent document while having the caret inside the iframe - * this fix moves the focus back into the iframe document. - */ - function restoreFocusOnKeyDown() { - if (!editor.inline) { - editor.on('keydown', function() { - if (document.activeElement == document.body) { - editor.getWin().focus(); - } - }); - } - } - - /** - * IE 11 has an annoying issue where you can't move focus into the editor - * by clicking on the white area HTML element. We used to be able to to fix this with - * the fixCaretSelectionOfDocumentElementOnIe fix. But since M$ removed the selection - * object it's not possible anymore. So we need to hack in a ungly CSS to force the - * body to be at least 150px. If the user clicks the HTML element out side this 150px region - * we simply move the focus into the first paragraph. Not ideal since you loose the - * positioning of the caret but goot enough for most cases. - */ - function bodyHeight() { - if (!editor.inline) { - editor.contentStyles.push('body {min-height: 150px}'); - editor.on('click', function(e) { - if (e.target.nodeName == 'HTML') { - editor.getBody().focus(); - editor.selection.normalize(); - editor.nodeChanged(); - } - }); - } - } - - /** - * Firefox on Mac OS will move the browser back to the previous page if you press CMD+Left arrow. - * You might then loose all your work so we need to block that behavior and replace it with our own. - */ - function blockCmdArrowNavigation() { - if (Env.mac) { - editor.on('keydown', function(e) { - if (VK.metaKeyPressed(e) && (e.keyCode == 37 || e.keyCode == 39)) { - e.preventDefault(); - editor.selection.getSel().modify('move', e.keyCode == 37 ? 'backward' : 'forward', 'word'); - } - }); - } - } - - /** - * Disables the autolinking in IE 9+ this is then re-enabled by the autolink plugin. - */ - function disableAutoUrlDetect() { - setEditorCommandState("AutoUrlDetect", false); - } - - /** - * IE 11 has a fantastic bug where it will produce two trailing BR elements to iframe bodies when - * the iframe is hidden by display: none on a parent container. The DOM is actually out of sync - * with innerHTML in this case. It's like IE adds shadow DOM BR elements that appears on innerHTML - * but not as the lastChild of the body. However is we add a BR element to the body then remove it - * it doesn't seem to add these BR elements makes sence right?! - * - * Example of what happens: text becomes text

    - */ - function doubleTrailingBrElements() { - if (!editor.inline) { - editor.on('focus blur', function() { - var br = editor.dom.create('br'); - editor.getBody().appendChild(br); - br.parentNode.removeChild(br); - }, true); - } - } - - /** - * iOS 7.1 introduced two new bugs: - * 1) It's possible to open links within a contentEditable area by clicking on them. - * 2) If you hold down the finger it will display the link/image touch callout menu. - */ - function tapLinksAndImages() { - editor.on('click', function(e) { - if (e.target.tagName === 'A') { - e.preventDefault(); - } - }); - - editor.contentStyles.push('.mce-content-body {-webkit-touch-callout: none}'); - } - - // All browsers - disableBackspaceIntoATable(); - removeBlockQuoteOnBackSpace(); - emptyEditorWhenDeleting(); - normalizeSelection(); - - // WebKit - if (isWebKit) { - cleanupStylesWhenDeleting(); - inputMethodFocus(); - selectControlElements(); - setDefaultBlockType(); - - // iOS - if (Env.iOS) { - selectionChangeNodeChanged(); - restoreFocusOnKeyDown(); - bodyHeight(); - tapLinksAndImages(); - } else { - selectAll(); - } - } - - // IE - if (isIE && Env.ie < 11) { - removeHrOnBackspace(); - ensureBodyHasRoleApplication(); - addNewLinesBeforeBrInPre(); - removePreSerializedStylesWhenSelectingControls(); - deleteControlItemOnBackSpace(); - renderEmptyBlocksFix(); - keepNoScriptContents(); - fixCaretSelectionOfDocumentElementOnIe(); - } - - if (Env.ie >= 11) { - bodyHeight(); - doubleTrailingBrElements(); - } - - if (Env.ie) { - selectAll(); - disableAutoUrlDetect(); - } - - // Gecko - if (isGecko) { - removeHrOnBackspace(); - focusBody(); - removeStylesWhenDeletingAcrossBlockElements(); - setGeckoEditingOptions(); - addBrAfterLastLinks(); - removeGhostSelection(); - showBrokenImageIcon(); - blockCmdArrowNavigation(); - } - }; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/util/Tools.js b/common/static/js/vendor/tinymce/js/tinymce/classes/util/Tools.js deleted file mode 100755 index c30101b5e38e..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/util/Tools.js +++ /dev/null @@ -1,503 +0,0 @@ -/** - * Tools.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class contains various utlity functions. These are also exposed - * directly on the tinymce namespace. - * - * @class tinymce.util.Tools - */ -define("tinymce/util/Tools", [], function() { - /** - * Removes whitespace from the beginning and end of a string. - * - * @method trim - * @param {String} s String to remove whitespace from. - * @return {String} New string with removed whitespace. - */ - var whiteSpaceRegExp = /^\s*|\s*$/g; - - function trim(str) { - return (str === null || str === undefined) ? '' : ("" + str).replace(whiteSpaceRegExp, ''); - } - - /** - * Returns true/false if the object is an array or not. - * - * @method isArray - * @param {Object} obj Object to check. - * @return {boolean} true/false state if the object is an array or not. - */ - var isArray = Array.isArray || function(obj) { - return Object.prototype.toString.call(obj) === "[object Array]"; - }; - - /** - * Checks if a object is of a specific type for example an array. - * - * @method is - * @param {Object} o Object to check type of. - * @param {string} t Optional type to check for. - * @return {Boolean} true/false if the object is of the specified type. - */ - function is(o, t) { - if (!t) { - return o !== undefined; - } - - if (t == 'array' && isArray(o)) { - return true; - } - - return typeof(o) == t; - } - - /** - * Converts the specified object into a real JavaScript array. - * - * @method toArray - * @param {Object} obj Object to convert into array. - * @return {Array} Array object based in input. - */ - function toArray(obj) { - var array = [], i, l; - - for (i = 0, l = obj.length; i < l; i++) { - array[i] = obj[i]; - } - - return array; - } - - /** - * Makes a name/object map out of an array with names. - * - * @method makeMap - * @param {Array/String} items Items to make map out of. - * @param {String} delim Optional delimiter to split string by. - * @param {Object} map Optional map to add items to. - * @return {Object} Name/value map of items. - */ - function makeMap(items, delim, map) { - var i; - - items = items || []; - delim = delim || ','; - - if (typeof(items) == "string") { - items = items.split(delim); - } - - map = map || {}; - - i = items.length; - while (i--) { - map[items[i]] = {}; - } - - return map; - } - - /** - * Performs an iteration of all items in a collection such as an object or array. This method will execure the - * callback function for each item in the collection, if the callback returns false the iteration will terminate. - * The callback has the following format: cb(value, key_or_index). - * - * @method each - * @param {Object} o Collection to iterate. - * @param {function} cb Callback function to execute for each item. - * @param {Object} s Optional scope to execute the callback in. - * @example - * // Iterate an array - * tinymce.each([1,2,3], function(v, i) { - * console.debug("Value: " + v + ", Index: " + i); - * }); - * - * // Iterate an object - * tinymce.each({a: 1, b: 2, c: 3], function(v, k) { - * console.debug("Value: " + v + ", Key: " + k); - * }); - */ - function each(o, cb, s) { - var n, l; - - if (!o) { - return 0; - } - - s = s || o; - - if (o.length !== undefined) { - // Indexed arrays, needed for Safari - for (n = 0, l = o.length; n < l; n++) { - if (cb.call(s, o[n], n, o) === false) { - return 0; - } - } - } else { - // Hashtables - for (n in o) { - if (o.hasOwnProperty(n)) { - if (cb.call(s, o[n], n, o) === false) { - return 0; - } - } - } - } - - return 1; - } - - /** - * Creates a new array by the return value of each iteration function call. This enables you to convert - * one array list into another. - * - * @method map - * @param {Array} a Array of items to iterate. - * @param {function} f Function to call for each item. It's return value will be the new value. - * @return {Array} Array with new values based on function return values. - */ - function map(a, f) { - var o = []; - - each(a, function(v) { - o.push(f(v)); - }); - - return o; - } - - /** - * Filters out items from the input array by calling the specified function for each item. - * If the function returns false the item will be excluded if it returns true it will be included. - * - * @method grep - * @param {Array} a Array of items to loop though. - * @param {function} f Function to call for each item. Include/exclude depends on it's return value. - * @return {Array} New array with values imported and filtered based in input. - * @example - * // Filter out some items, this will return an array with 4 and 5 - * var items = tinymce.grep([1,2,3,4,5], function(v) {return v > 3;}); - */ - function grep(a, f) { - var o = []; - - each(a, function(v) { - if (!f || f(v)) { - o.push(v); - } - }); - - return o; - } - - /** - * Creates a class, subclass or static singleton. - * More details on this method can be found in the Wiki. - * - * @method create - * @param {String} s Class name, inheritage and prefix. - * @param {Object} p Collection of methods to add to the class. - * @param {Object} root Optional root object defaults to the global window object. - * @example - * // Creates a basic class - * tinymce.create('tinymce.somepackage.SomeClass', { - * SomeClass: function() { - * // Class constructor - * }, - * - * method: function() { - * // Some method - * } - * }); - * - * // Creates a basic subclass class - * tinymce.create('tinymce.somepackage.SomeSubClass:tinymce.somepackage.SomeClass', { - * SomeSubClass: function() { - * // Class constructor - * this.parent(); // Call parent constructor - * }, - * - * method: function() { - * // Some method - * this.parent(); // Call parent method - * }, - * - * 'static': { - * staticMethod: function() { - * // Static method - * } - * } - * }); - * - * // Creates a singleton/static class - * tinymce.create('static tinymce.somepackage.SomeSingletonClass', { - * method: function() { - * // Some method - * } - * }); - */ - function create(s, p, root) { - var self = this, sp, ns, cn, scn, c, de = 0; - - // Parse : : - s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s); - cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name - - // Create namespace for new class - ns = self.createNS(s[3].replace(/\.\w+$/, ''), root); - - // Class already exists - if (ns[cn]) { - return; - } - - // Make pure static class - if (s[2] == 'static') { - ns[cn] = p; - - if (this.onCreate) { - this.onCreate(s[2], s[3], ns[cn]); - } - - return; - } - - // Create default constructor - if (!p[cn]) { - p[cn] = function() {}; - de = 1; - } - - // Add constructor and methods - ns[cn] = p[cn]; - self.extend(ns[cn].prototype, p); - - // Extend - if (s[5]) { - sp = self.resolve(s[5]).prototype; - scn = s[5].match(/\.(\w+)$/i)[1]; // Class name - - // Extend constructor - c = ns[cn]; - if (de) { - // Add passthrough constructor - ns[cn] = function() { - return sp[scn].apply(this, arguments); - }; - } else { - // Add inherit constructor - ns[cn] = function() { - this.parent = sp[scn]; - return c.apply(this, arguments); - }; - } - ns[cn].prototype[cn] = ns[cn]; - - // Add super methods - self.each(sp, function(f, n) { - ns[cn].prototype[n] = sp[n]; - }); - - // Add overridden methods - self.each(p, function(f, n) { - // Extend methods if needed - if (sp[n]) { - ns[cn].prototype[n] = function() { - this.parent = sp[n]; - return f.apply(this, arguments); - }; - } else { - if (n != cn) { - ns[cn].prototype[n] = f; - } - } - }); - } - - // Add static methods - /*jshint sub:true*/ - self.each(p['static'], function(f, n) { - ns[cn][n] = f; - }); - } - - /** - * Returns the index of a value in an array, this method will return -1 if the item wasn't found. - * - * @method inArray - * @param {Array} a Array/Object to search for value in. - * @param {Object} v Value to check for inside the array. - * @return {Number/String} Index of item inside the array inside an object. Or -1 if it wasn't found. - * @example - * // Get index of value in array this will alert 1 since 2 is at that index - * alert(tinymce.inArray([1,2,3], 2)); - */ - function inArray(a, v) { - var i, l; - - if (a) { - for (i = 0, l = a.length; i < l; i++) { - if (a[i] === v) { - return i; - } - } - } - - return -1; - } - - function extend(obj, ext) { - var i, l, name, args = arguments, value; - - for (i = 1, l = args.length; i < l; i++) { - ext = args[i]; - for (name in ext) { - if (ext.hasOwnProperty(name)) { - value = ext[name]; - - if (value !== undefined) { - obj[name] = value; - } - } - } - } - - return obj; - } - - /** - * Executed the specified function for each item in a object tree. - * - * @method walk - * @param {Object} o Object tree to walk though. - * @param {function} f Function to call for each item. - * @param {String} n Optional name of collection inside the objects to walk for example childNodes. - * @param {String} s Optional scope to execute the function in. - */ - function walk(o, f, n, s) { - s = s || this; - - if (o) { - if (n) { - o = o[n]; - } - - each(o, function(o, i) { - if (f.call(s, o, i, n) === false) { - return false; - } - - walk(o, f, n, s); - }); - } - } - - /** - * Creates a namespace on a specific object. - * - * @method createNS - * @param {String} n Namespace to create for example a.b.c.d. - * @param {Object} o Optional object to add namespace to, defaults to window. - * @return {Object} New namespace object the last item in path. - * @example - * // Create some namespace - * tinymce.createNS('tinymce.somepackage.subpackage'); - * - * // Add a singleton - * var tinymce.somepackage.subpackage.SomeSingleton = { - * method: function() { - * // Some method - * } - * }; - */ - function createNS(n, o) { - var i, v; - - o = o || window; - - n = n.split('.'); - for (i = 0; i < n.length; i++) { - v = n[i]; - - if (!o[v]) { - o[v] = {}; - } - - o = o[v]; - } - - return o; - } - - /** - * Resolves a string and returns the object from a specific structure. - * - * @method resolve - * @param {String} n Path to resolve for example a.b.c.d. - * @param {Object} o Optional object to search though, defaults to window. - * @return {Object} Last object in path or null if it couldn't be resolved. - * @example - * // Resolve a path into an object reference - * var obj = tinymce.resolve('a.b.c.d'); - */ - function resolve(n, o) { - var i, l; - - o = o || window; - - n = n.split('.'); - for (i = 0, l = n.length; i < l; i++) { - o = o[n[i]]; - - if (!o) { - break; - } - } - - return o; - } - - /** - * Splits a string but removes the whitespace before and after each value. - * - * @method explode - * @param {string} s String to split. - * @param {string} d Delimiter to split by. - * @example - * // Split a string into an array with a,b,c - * var arr = tinymce.explode('a, b, c'); - */ - function explode(s, d) { - if (!s || is(s, 'array')) { - return s; - } - - return map(s.split(d || ','), trim); - } - - return { - trim: trim, - isArray: isArray, - is: is, - toArray: toArray, - makeMap: makeMap, - each: each, - map: map, - grep: grep, - inArray: inArray, - extend: extend, - create: create, - walk: walk, - createNS: createNS, - resolve: resolve, - explode: explode - }; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/util/URI.js b/common/static/js/vendor/tinymce/js/tinymce/classes/util/URI.js deleted file mode 100755 index 5529ad02074a..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/util/URI.js +++ /dev/null @@ -1,366 +0,0 @@ -/** - * URI.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class handles parsing, modification and serialization of URI/URL strings. - * @class tinymce.util.URI - */ -define("tinymce/util/URI", [ - "tinymce/util/Tools" -], function(Tools) { - var each = Tools.each, trim = Tools.trim; - - /** - * Constructs a new URI instance. - * - * @constructor - * @method URI - * @param {String} url URI string to parse. - * @param {Object} settings Optional settings object. - */ - function URI(url, settings) { - var self = this, baseUri, base_url; - - // Trim whitespace - url = trim(url); - - // Default settings - settings = self.settings = settings || {}; - - // Strange app protocol that isn't http/https or local anchor - // For example: mailto,skype,tel etc. - if (/^([\w\-]+):([^\/]{2})/i.test(url) || /^\s*#/.test(url)) { - self.source = url; - return; - } - - var isProtocolRelative = url.indexOf('//') === 0; - - // Absolute path with no host, fake host and protocol - if (url.indexOf('/') === 0 && !isProtocolRelative) { - url = (settings.base_uri ? settings.base_uri.protocol || 'http' : 'http') + '://mce_host' + url; - } - - // Relative path http:// or protocol relative //path - if (!/^[\w\-]*:?\/\//.test(url)) { - base_url = settings.base_uri ? settings.base_uri.path : new URI(location.href).directory; - if (settings.base_uri.protocol === "") { - url = '//mce_host' + self.toAbsPath(base_url, url); - } else { - url = ((settings.base_uri && settings.base_uri.protocol) || 'http') + '://mce_host' + self.toAbsPath(base_url, url); - } - } - - // Parse URL (Credits goes to Steave, http://blog.stevenlevithan.com/archives/parseuri) - url = url.replace(/@@/g, '(mce_at)'); // Zope 3 workaround, they use @@something - - /*jshint maxlen: 255 */ - /*eslint max-len: 0 */ - url = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(url); - - each(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], function(v, i) { - var part = url[i]; - - // Zope 3 workaround, they use @@something - if (part) { - part = part.replace(/\(mce_at\)/g, '@@'); - } - - self[v] = part; - }); - - baseUri = settings.base_uri; - if (baseUri) { - if (!self.protocol) { - self.protocol = baseUri.protocol; - } - - if (!self.userInfo) { - self.userInfo = baseUri.userInfo; - } - - if (!self.port && self.host === 'mce_host') { - self.port = baseUri.port; - } - - if (!self.host || self.host === 'mce_host') { - self.host = baseUri.host; - } - - self.source = ''; - } - - if (isProtocolRelative) { - self.protocol = ''; - } - - //t.path = t.path || '/'; - } - - URI.prototype = { - /** - * Sets the internal path part of the URI. - * - * @method setPath - * @param {string} path Path string to set. - */ - setPath: function(path) { - var self = this; - - path = /^(.*?)\/?(\w+)?$/.exec(path); - - // Update path parts - self.path = path[0]; - self.directory = path[1]; - self.file = path[2]; - - // Rebuild source - self.source = ''; - self.getURI(); - }, - - /** - * Converts the specified URI into a relative URI based on the current URI instance location. - * - * @method toRelative - * @param {String} uri URI to convert into a relative path/URI. - * @return {String} Relative URI from the point specified in the current URI instance. - * @example - * // Converts an absolute URL to an relative URL url will be somedir/somefile.htm - * var url = new tinymce.util.URI('http://www.site.com/dir/').toRelative('http://www.site.com/dir/somedir/somefile.htm'); - */ - toRelative: function(uri) { - var self = this, output; - - if (uri === "./") { - return uri; - } - - uri = new URI(uri, {base_uri: self}); - - // Not on same domain/port or protocol - if ((uri.host != 'mce_host' && self.host != uri.host && uri.host) || self.port != uri.port || - (self.protocol != uri.protocol && uri.protocol !== "")) { - return uri.getURI(); - } - - var tu = self.getURI(), uu = uri.getURI(); - - // Allow usage of the base_uri when relative_urls = true - if (tu == uu || (tu.charAt(tu.length - 1) == "/" && tu.substr(0, tu.length - 1) == uu)) { - return tu; - } - - output = self.toRelPath(self.path, uri.path); - - // Add query - if (uri.query) { - output += '?' + uri.query; - } - - // Add anchor - if (uri.anchor) { - output += '#' + uri.anchor; - } - - return output; - }, - - /** - * Converts the specified URI into a absolute URI based on the current URI instance location. - * - * @method toAbsolute - * @param {String} uri URI to convert into a relative path/URI. - * @param {Boolean} noHost No host and protocol prefix. - * @return {String} Absolute URI from the point specified in the current URI instance. - * @example - * // Converts an relative URL to an absolute URL url will be http://www.site.com/dir/somedir/somefile.htm - * var url = new tinymce.util.URI('http://www.site.com/dir/').toAbsolute('somedir/somefile.htm'); - */ - toAbsolute: function(uri, noHost) { - uri = new URI(uri, {base_uri: this}); - - return uri.getURI(this.host == uri.host && this.protocol == uri.protocol ? noHost : 0); - }, - - /** - * Converts a absolute path into a relative path. - * - * @method toRelPath - * @param {String} base Base point to convert the path from. - * @param {String} path Absolute path to convert into a relative path. - */ - toRelPath: function(base, path) { - var items, breakPoint = 0, out = '', i, l; - - // Split the paths - base = base.substring(0, base.lastIndexOf('/')); - base = base.split('/'); - items = path.split('/'); - - if (base.length >= items.length) { - for (i = 0, l = base.length; i < l; i++) { - if (i >= items.length || base[i] != items[i]) { - breakPoint = i + 1; - break; - } - } - } - - if (base.length < items.length) { - for (i = 0, l = items.length; i < l; i++) { - if (i >= base.length || base[i] != items[i]) { - breakPoint = i + 1; - break; - } - } - } - - if (breakPoint === 1) { - return path; - } - - for (i = 0, l = base.length - (breakPoint - 1); i < l; i++) { - out += "../"; - } - - for (i = breakPoint - 1, l = items.length; i < l; i++) { - if (i != breakPoint - 1) { - out += "/" + items[i]; - } else { - out += items[i]; - } - } - - return out; - }, - - /** - * Converts a relative path into a absolute path. - * - * @method toAbsPath - * @param {String} base Base point to convert the path from. - * @param {String} path Relative path to convert into an absolute path. - */ - toAbsPath: function(base, path) { - var i, nb = 0, o = [], tr, outPath; - - // Split paths - tr = /\/$/.test(path) ? '/' : ''; - base = base.split('/'); - path = path.split('/'); - - // Remove empty chunks - each(base, function(k) { - if (k) { - o.push(k); - } - }); - - base = o; - - // Merge relURLParts chunks - for (i = path.length - 1, o = []; i >= 0; i--) { - // Ignore empty or . - if (path[i].length === 0 || path[i] === ".") { - continue; - } - - // Is parent - if (path[i] === '..') { - nb++; - continue; - } - - // Move up - if (nb > 0) { - nb--; - continue; - } - - o.push(path[i]); - } - - i = base.length - nb; - - // If /a/b/c or / - if (i <= 0) { - outPath = o.reverse().join('/'); - } else { - outPath = base.slice(0, i).join('/') + '/' + o.reverse().join('/'); - } - - // Add front / if it's needed - if (outPath.indexOf('/') !== 0) { - outPath = '/' + outPath; - } - - // Add traling / if it's needed - if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) { - outPath += tr; - } - - return outPath; - }, - - /** - * Returns the full URI of the internal structure. - * - * @method getURI - * @param {Boolean} noProtoHost Optional no host and protocol part. Defaults to false. - */ - getURI: function(noProtoHost) { - var s, self = this; - - // Rebuild source - if (!self.source || noProtoHost) { - s = ''; - - if (!noProtoHost) { - if (self.protocol) { - s += self.protocol + '://'; - } else { - s += '//'; - } - - if (self.userInfo) { - s += self.userInfo + '@'; - } - - if (self.host) { - s += self.host; - } - - if (self.port) { - s += ':' + self.port; - } - } - - if (self.path) { - s += self.path; - } - - if (self.query) { - s += '?' + self.query; - } - - if (self.anchor) { - s += '#' + self.anchor; - } - - self.source = s; - } - - return self.source; - } - }; - - return URI; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/util/VK.js b/common/static/js/vendor/tinymce/js/tinymce/classes/util/VK.js deleted file mode 100755 index 9640bc6dc805..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/util/VK.js +++ /dev/null @@ -1,37 +0,0 @@ -/** - * VK.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This file exposes a set of the common KeyCodes for use. Please grow it as needed. - */ -define("tinymce/util/VK", [ - "tinymce/Env" -], function(Env) { - return { - BACKSPACE: 8, - DELETE: 46, - DOWN: 40, - ENTER: 13, - LEFT: 37, - RIGHT: 39, - SPACEBAR: 32, - TAB: 9, - UP: 38, - - modifierPressed: function(e) { - return e.shiftKey || e.ctrlKey || e.altKey; - }, - - metaKeyPressed: function(e) { - // Check if ctrl or meta key is pressed also check if alt is false for Polish users - return (Env.mac ? e.metaKey : e.ctrlKey) && !e.altKey; - } - }; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/classes/util/XHR.js b/common/static/js/vendor/tinymce/js/tinymce/classes/util/XHR.js deleted file mode 100755 index 7b87fbc463af..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/classes/util/XHR.js +++ /dev/null @@ -1,84 +0,0 @@ -/** - * XHR.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class enables you to send XMLHTTPRequests cross browser. - * @class tinymce.util.XHR - * @static - * @example - * // Sends a low level Ajax request - * tinymce.util.XHR.send({ - * url: 'someurl', - * success: function(text) { - * console.debug(text); - * } - * }); - */ -define("tinymce/util/XHR", [], function() { - return { - /** - * Sends a XMLHTTPRequest. - * Consult the Wiki for details on what settings this method takes. - * - * @method send - * @param {Object} settings Object will target URL, callbacks and other info needed to make the request. - */ - send: function(settings) { - var xhr, count = 0; - - function ready() { - if (!settings.async || xhr.readyState == 4 || count++ > 10000) { - if (settings.success && count < 10000 && xhr.status == 200) { - settings.success.call(settings.success_scope, '' + xhr.responseText, xhr, settings); - } else if (settings.error) { - settings.error.call(settings.error_scope, count > 10000 ? 'TIMED_OUT' : 'GENERAL', xhr, settings); - } - - xhr = null; - } else { - setTimeout(ready, 10); - } - } - - // Default settings - settings.scope = settings.scope || this; - settings.success_scope = settings.success_scope || settings.scope; - settings.error_scope = settings.error_scope || settings.scope; - settings.async = settings.async === false ? false : true; - settings.data = settings.data || ''; - - xhr = new XMLHttpRequest(); - - if (xhr) { - if (xhr.overrideMimeType) { - xhr.overrideMimeType(settings.content_type); - } - - xhr.open(settings.type || (settings.data ? 'POST' : 'GET'), settings.url, settings.async); - - if (settings.content_type) { - xhr.setRequestHeader('Content-Type', settings.content_type); - } - - xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); - - xhr.send(settings.data); - - // Syncronous request - if (!settings.async) { - return ready(); - } - - // Wait for response, onReadyStateChange can not be used since it leaks memory in IE - setTimeout(ready, 10); - } - } - }; -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/icons/default/icons.js b/common/static/js/vendor/tinymce/js/tinymce/icons/default/icons.js new file mode 100644 index 000000000000..d31c90729dd5 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/icons/default/icons.js @@ -0,0 +1,172 @@ +tinymce.IconManager.add('default', { + icons: { + 'accessibility-check': '', + 'action-next': '', + 'action-prev': '', + 'align-center': '', + 'align-justify': '', + 'align-left': '', + 'align-none': '', + 'align-right': '', + 'arrow-left': '', + 'arrow-right': '', + 'bold': '', + 'bookmark': '', + 'border-width': '', + 'brightness': '', + 'browse': '', + 'cancel': '', + 'change-case': '', + 'character-count': '', + 'checklist-rtl': '', + 'checklist': '', + 'checkmark': '', + 'chevron-down': '', + 'chevron-left': '', + 'chevron-right': '', + 'chevron-up': '', + 'close': '', + 'code-sample': '', + 'color-levels': '', + 'color-picker': '', + 'color-swatch-remove-color': '', + 'color-swatch': '', + 'comment-add': '', + 'comment': '', + 'contrast': '', + 'copy': '', + 'crop': '', + 'cut-column': '', + 'cut-row': '', + 'cut': '', + 'document-properties': '', + 'drag': '', + 'duplicate-column': '', + 'duplicate-row': '', + 'duplicate': '', + 'edit-block': '', + 'edit-image': '', + 'embed-page': '', + 'embed': '', + 'emoji': '', + 'export': '', + 'fill': '', + 'flip-horizontally': '', + 'flip-vertically': '', + 'format-painter': '', + 'format': '', + 'fullscreen': '', + 'gallery': '', + 'gamma': '', + 'help': '', + 'highlight-bg-color': '', + 'home': '', + 'horizontal-rule': '', + 'image-options': '', + 'image': '', + 'indent': '', + 'info': '', + 'insert-character': '', + 'insert-time': '', + 'invert': '', + 'italic': '', + 'line-height': '', + 'line': '', + 'link': '', + 'list-bull-circle': '', + 'list-bull-default': '', + 'list-bull-square': '', + 'list-num-default-rtl': '', + 'list-num-default': '', + 'list-num-lower-alpha-rtl': '', + 'list-num-lower-alpha': '', + 'list-num-lower-greek-rtl': '', + 'list-num-lower-greek': '', + 'list-num-lower-roman-rtl': '', + 'list-num-lower-roman': '', + 'list-num-upper-alpha-rtl': '', + 'list-num-upper-alpha': '', + 'list-num-upper-roman-rtl': '', + 'list-num-upper-roman': '', + 'lock': '', + 'ltr': '', + 'more-drawer': '', + 'new-document': '', + 'new-tab': '', + 'non-breaking': '', + 'notice': '', + 'ordered-list-rtl': '', + 'ordered-list': '', + 'orientation': '', + 'outdent': '', + 'page-break': '', + 'paragraph': '', + 'paste-column-after': '', + 'paste-column-before': '', + 'paste-row-after': '', + 'paste-row-before': '', + 'paste-text': '', + 'paste': '', + 'permanent-pen': '', + 'plus': '', + 'preferences': '', + 'preview': '', + 'print': '', + 'quote': '', + 'redo': '', + 'reload': '', + 'remove-formatting': '', + 'remove': '', + 'resize-handle': '', + 'resize': '', + 'restore-draft': '', + 'rotate-left': '', + 'rotate-right': '', + 'rtl': '', + 'save': '', + 'search': '', + 'select-all': '', + 'selected': '', + 'settings': '', + 'sharpen': '', + 'sourcecode': '', + 'spell-check': '', + 'strike-through': '', + 'subscript': '', + 'superscript': '', + 'table-cell-properties': '', + 'table-cell-select-all': '', + 'table-cell-select-inner': '', + 'table-delete-column': '', + 'table-delete-row': '', + 'table-delete-table': '', + 'table-insert-column-after': '', + 'table-insert-column-before': '', + 'table-insert-row-above': '', + 'table-insert-row-after': '', + 'table-left-header': '', + 'table-merge-cells': '', + 'table-row-properties': '', + 'table-split-cells': '', + 'table-top-header': '', + 'table': '', + 'template': '', + 'temporary-placeholder': '', + 'text-color': '', + 'toc': '', + 'translate': '', + 'underline': '', + 'undo': '', + 'unlink': '', + 'unlock': '', + 'unordered-list': '', + 'unselected': '', + 'upload': '', + 'user': '', + 'visualblocks': '', + 'visualchars': '', + 'warning': '', + 'zoom-in': '', + 'zoom-out': '', + } +}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/icons/default/icons.min.js b/common/static/js/vendor/tinymce/js/tinymce/icons/default/icons.min.js new file mode 100644 index 000000000000..086f297d3278 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/icons/default/icons.min.js @@ -0,0 +1 @@ +tinymce.IconManager.add("default",{icons:{"accessibility-check":'',"action-next":'',"action-prev":'',"align-center":'',"align-justify":'',"align-left":'',"align-none":'',"align-right":'',"arrow-left":'',"arrow-right":'',bold:'',bookmark:'',"border-width":'',brightness:'',browse:'',cancel:'',"change-case":'',"character-count":'',"checklist-rtl":'',checklist:'',checkmark:'',"chevron-down":'',"chevron-left":'',"chevron-right":'',"chevron-up":'',close:'',"code-sample":'',"color-levels":'',"color-picker":'',"color-swatch-remove-color":'',"color-swatch":'',"comment-add":'',comment:'',contrast:'',copy:'',crop:'',"cut-column":'',"cut-row":'',cut:'',"document-properties":'',drag:'',"duplicate-column":'',"duplicate-row":'',duplicate:'',"edit-block":'',"edit-image":'',"embed-page":'',embed:'',emoji:'',"export":'',fill:'',"flip-horizontally":'',"flip-vertically":'',"format-painter":'',format:'',fullscreen:'',gallery:'',gamma:'',help:'',"highlight-bg-color":'',home:'',"horizontal-rule":'',"image-options":'',image:'',indent:'',info:'',"insert-character":'',"insert-time":'',invert:'',italic:'',"line-height":'',line:'',link:'',"list-bull-circle":'',"list-bull-default":'',"list-bull-square":'',"list-num-default-rtl":'',"list-num-default":'',"list-num-lower-alpha-rtl":'',"list-num-lower-alpha":'',"list-num-lower-greek-rtl":'',"list-num-lower-greek":'',"list-num-lower-roman-rtl":'',"list-num-lower-roman":'',"list-num-upper-alpha-rtl":'',"list-num-upper-alpha":'',"list-num-upper-roman-rtl":'',"list-num-upper-roman":'',lock:'',ltr:'',"more-drawer":'',"new-document":'',"new-tab":'',"non-breaking":'',notice:'',"ordered-list-rtl":'',"ordered-list":'',orientation:'',outdent:'',"page-break":'',paragraph:'',"paste-column-after":'',"paste-column-before":'',"paste-row-after":'',"paste-row-before":'',"paste-text":'',paste:'',"permanent-pen":'',plus:'',preferences:'',preview:'',print:'',quote:'',redo:'',reload:'',"remove-formatting":'',remove:'',"resize-handle":'',resize:'',"restore-draft":'',"rotate-left":'',"rotate-right":'',rtl:'',save:'',search:'',"select-all":'',selected:'',settings:'',sharpen:'',sourcecode:'',"spell-check":'',"strike-through":'',subscript:'',superscript:'',"table-cell-properties":'',"table-cell-select-all":'',"table-cell-select-inner":'',"table-delete-column":'',"table-delete-row":'',"table-delete-table":'',"table-insert-column-after":'',"table-insert-column-before":'',"table-insert-row-above":'',"table-insert-row-after":'',"table-left-header":'',"table-merge-cells":'',"table-row-properties":'',"table-split-cells":'',"table-top-header":'',table:'',template:'',"temporary-placeholder":'',"text-color":'',toc:'',translate:'',underline:'',undo:'',unlink:'',unlock:'',"unordered-list":'',unselected:'',upload:'',user:'',visualblocks:'',visualchars:'',warning:'',"zoom-in":'',"zoom-out":''}}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/jquery.tinymce.min.js b/common/static/js/vendor/tinymce/js/tinymce/jquery.tinymce.min.js old mode 100755 new mode 100644 index 17c44e6ae769..f26b879802e1 --- a/common/static/js/vendor/tinymce/js/tinymce/jquery.tinymce.min.js +++ b/common/static/js/vendor/tinymce/js/tinymce/jquery.tinymce.min.js @@ -1 +1,92 @@ -!function(e){function t(){function t(e){"remove"===e&&this.each(function(e,t){var n=r(t);n&&n.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(e,t){var n=tinymce.get(t.id.replace(/_parent$/,""));n&&n.remove()})}function i(e){var n,i=this;if(null!=e)t.call(i),i.each(function(t,n){var i;(i=tinymce.get(n.id))&&i.setContent(e)});else if(i.length>0&&(n=tinymce.get(i[0].id)))return n.getContent()}function r(e){var t=null;return e&&e.id&&a.tinymce&&(t=tinymce.get(e.id)),t}function c(e){return!!(e&&e.length&&a.tinymce&&e.is(":tinymce"))}var o={};e.each(["text","html","val"],function(t,a){var u=o[a]=e.fn[a],s="text"===a;e.fn[a]=function(t){var a=this;if(!c(a))return u.apply(a,arguments);if(t!==n)return i.call(a.filter(":tinymce"),t),u.apply(a.not(":tinymce"),arguments),a;var o="",l=arguments;return(s?a:a.eq(0)).each(function(t,n){var i=r(n);o+=i?s?i.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):i.getContent({save:!0}):u.apply(e(n),l)}),o}}),e.each(["append","prepend"],function(t,i){var a=o[i]=e.fn[i],u="prepend"===i;e.fn[i]=function(e){var t=this;return c(t)?e!==n?(t.filter(":tinymce").each(function(t,n){var i=r(n);i&&i.setContent(u?e+i.getContent():i.getContent()+e)}),a.apply(t.not(":tinymce"),arguments),t):void 0:a.apply(t,arguments)}}),e.each(["remove","replaceWith","replaceAll","empty"],function(n,i){var r=o[i]=e.fn[i];e.fn[i]=function(){return t.call(this,i),r.apply(this,arguments)}}),o.attr=e.fn.attr,e.fn.attr=function(t,a){var u=this,s=arguments;if(!t||"value"!==t||!c(u))return a!==n?o.attr.apply(u,s):o.attr.apply(u,s);if(a!==n)return i.call(u.filter(":tinymce"),a),o.attr.apply(u.not(":tinymce"),s),u;var l=u[0],m=r(l);return m?m.getContent({save:!0}):o.attr.apply(e(l),s)}}var n,i,r=[],a=window;e.fn.tinymce=function(n){function c(){var i=[],r=0;l||(t(),l=!0),m.each(function(e,t){var a,c=t.id,o=n.oninit;c||(t.id=c=tinymce.DOM.uniqueId()),tinymce.get(c)||(a=new tinymce.Editor(c,n,tinymce.EditorManager),i.push(a),a.on("init",function(){var e,t=o;m.css("visibility",""),o&&++r==i.length&&("string"==typeof t&&(e=-1===t.indexOf(".")?null:tinymce.resolve(t.replace(/\.\w+$/,"")),t=tinymce.resolve(t)),t.apply(e||tinymce,i))}))}),e.each(i,function(e,t){t.render()})}var o,u,s,l,m=this,p="";if(!m.length)return m;if(!n)return window.tinymce?tinymce.get(m[0].id):null;if(m.css("visibility","hidden"),a.tinymce||i||!(o=n.script_url))1===i?r.push(c):c();else{i=1,u=o.substring(0,o.lastIndexOf("/")),-1!=o.indexOf(".min")&&(p=".min"),a.tinymce=a.tinyMCEPreInit||{base:u,suffix:p},-1!=o.indexOf("gzip")&&(s=n.language||"en",o=o+(/\?/.test(o)?"&":"?")+"js=true&core=true&suffix="+escape(p)+"&themes="+escape(n.theme||"modern")+"&plugins="+escape(n.plugins||"")+"&languages="+(s||""),a.tinyMCE_GZ||(a.tinyMCE_GZ={start:function(){function t(e){tinymce.ScriptLoader.markDone(tinymce.baseURI.toAbsolute(e))}t("langs/"+s+".js"),t("themes/"+n.theme+"/theme"+p+".js"),t("themes/"+n.theme+"/langs/"+s+".js"),e.each(n.plugins.split(","),function(e,n){n&&(t("plugins/"+n+"/plugin"+p+".js"),t("plugins/"+n+"/langs/"+s+".js"))})},end:function(){}}));var f=document.createElement("script");f.type="text/javascript",f.onload=f.onreadystatechange=function(t){t=t||window.event,2===i||"load"!=t.type&&!/complete|loaded/.test(f.readyState)||(tinymce.dom.Event.domLoaded=1,i=2,n.script_loaded&&n.script_loaded(),c(),e.each(r,function(e,t){t()}))},f.src=o,document.body.appendChild(f)}return m},e.extend(e.expr[":"],{tinymce:function(e){return!!(e.id&&"tinymce"in window&&tinymce.get(e.id))}})}(jQuery); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + */ +/** + * Jquery integration plugin. + * + * @class tinymce.core.JqueryIntegration + * @private + */ +!function(){var f,c,u,s=[],p="undefined"!=typeof global?global:window,d=p.jQuery,v=function(){ +// Reference to tinymce needs to be lazily evaluated since tinymce +// might be loaded through the compressor or other means +return p.tinymce};d.fn.tinymce=function(o){var e,t,i,l=this,r=""; +// No match then just ignore the call +if(!l.length)return l; +// Get editor instance +if(!o)return v()?v().get(l[0].id):null;l.css("visibility","hidden");// Hide textarea to avoid flicker +var n,a=function(){var a=[],c=0; +// Apply patches to the jQuery object, only once +u||(m(),u=!0), +// Create an editor instance for each matched node +l.each(function(e,t){var n,i=t.id,r=o.oninit; +// Generate unique id for target element if needed +i||(t.id=i=v().DOM.uniqueId()), +// Only init the editor once +v().get(i)||( +// Create editor instance and render it +n=v().createEditor(i,o),a.push(n),n.on("init",function(){var e,t=r;l.css("visibility",""), +// Run this if the oninit setting is defined +// this logic will fire the oninit callback ones each +// matched editor instance is initialized +r&&++c==a.length&&("string"==typeof t&&(e=-1===t.indexOf(".")?null:v().resolve(t.replace(/\.\w+$/,"")),t=v().resolve(t)), +// Call the oninit function with the object +t.apply(e||v(),a))}))}), +// Render the editor instances in a separate loop since we +// need to have the full editors array used in the onInit calls +d.each(a,function(e,t){t.render()})}; +// Load TinyMCE on demand, if we need to +return p.tinymce||c||!(e=o.script_url)? +// Delay the init call until tinymce is loaded +1===c?s.push(a):a():(c=1,t=e.substring(0,e.lastIndexOf("/")), +// Check if it's a dev/src version they want to load then +// make sure that all plugins, themes etc are loaded in source mode as well +-1!=e.indexOf(".min")&&(r=".min"), +// Setup tinyMCEPreInit object this will later be used by the TinyMCE +// core script to locate other resources like CSS files, dialogs etc +// You can also predefined a tinyMCEPreInit object and then it will use that instead +p.tinymce=p.tinyMCEPreInit||{base:t,suffix:r}, +// url contains gzip then we assume it's a compressor +-1!=e.indexOf("gzip")&&(i=o.language||"en",e=e+(/\?/.test(e)?"&":"?")+"js=true&core=true&suffix="+escape(r)+"&themes="+escape(o.theme||"modern")+"&plugins="+escape(o.plugins||"")+"&languages="+(i||""), +// Check if compressor script is already loaded otherwise setup a basic one +p.tinyMCE_GZ||(p.tinyMCE_GZ={start:function(){var n=function(e){v().ScriptLoader.markDone(v().baseURI.toAbsolute(e))}; +// Add core languages +n("langs/"+i+".js"), +// Add themes with languages +n("themes/"+o.theme+"/theme"+r+".js"),n("themes/"+o.theme+"/langs/"+i+".js"), +// Add plugins with languages +d.each(o.plugins.split(","),function(e,t){t&&(n("plugins/"+t+"/plugin"+r+".js"),n("plugins/"+t+"/langs/"+i+".js"))})},end:function(){}})),(n=document.createElement("script")).type="text/javascript",n.onload=n.onreadystatechange=function(e){e=e||window.event,2===c||"load"!=e.type&&!/complete|loaded/.test(n.readyState)||(v().dom.Event.domLoaded=1,c=2, +// Execute callback after mainscript has been loaded and before the initialization occurs +o.script_loaded&&o.script_loaded(),a(),d.each(s,function(e,t){t()}))},n.src=e,document.body.appendChild(n)),l}, +// Add :tinymce pseudo selector this will select elements that has been converted into editor instances +// it's now possible to use things like $('*:tinymce') to get all TinyMCE bound elements. +d.extend(d.expr[":"],{tinymce:function(e){var t;return!!(e.id&&"tinymce"in p&&(t=v().get(e.id))&&t.editorManager===v())}}); +// This function patches internal jQuery functions so that if +// you for example remove an div element containing an editor it's +// automatically destroyed by the TinyMCE API +var m=function(){ +// Removes any child editor instances by looking for editor wrapper elements +var r=function(e){ +// If the function is remove +"remove"===e&&this.each(function(e,t){var n=l(t);n&&n.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(e,t){var n=v().get(t.id.replace(/_parent$/,""));n&&n.remove()})},o=function(i){var e,t=this; +// Handle set value +/*jshint eqnull:true */if(null!=i)r.call(t), +// Saves the contents before get/set value of textarea/div +t.each(function(e,t){var n;(n=v().get(t.id))&&n.setContent(i)});else if(0])*>/g,""):n.getContent({save:!0}):a.apply(d(t),r)}),i}}), +// Makes it possible to use $('#id').append("content"); to append contents to the TinyMCE editor iframe +d.each(["append","prepend"],function(e,t){var n=s[t]=d.fn[t],r="prepend"===t;d.fn[t]=function(i){var e=this;return u(e)?i!==f?("string"==typeof i&&e.filter(":tinymce").each(function(e,t){var n=l(t);n&&n.setContent(r?i+n.getContent():n.getContent()+i)}),n.apply(e.not(":tinymce"),arguments),e):void 0:n.apply(e,arguments)}}), +// Makes sure that the editor instance gets properly destroyed when the parent element is removed +d.each(["remove","replaceWith","replaceAll","empty"],function(e,t){var n=s[t]=d.fn[t];d.fn[t]=function(){return r.call(this,t),n.apply(this,arguments)}}),s.attr=d.fn.attr, +// Makes sure that $('#tinymce_id').attr('value') gets the editors current HTML contents +d.fn.attr=function(e,t){var n=this,i=arguments;if(!e||"value"!==e||!u(n))return s.attr.apply(n,i);if(t!==f)return o.call(n.filter(":tinymce"),t),s.attr.apply(n.not(":tinymce"),i),n;// return original set for chaining +var r=n[0],a=l(r);return a?a.getContent({save:!0}):s.attr.apply(d(r),i)}}}(); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/langs/readme.md b/common/static/js/vendor/tinymce/js/tinymce/langs/readme.md old mode 100755 new mode 100644 diff --git a/common/static/js/vendor/tinymce/js/tinymce/license.txt b/common/static/js/vendor/tinymce/js/tinymce/license.txt old mode 100755 new mode 100644 index 1837b0acbe16..b17fc90494cf --- a/common/static/js/vendor/tinymce/js/tinymce/license.txt +++ b/common/static/js/vendor/tinymce/js/tinymce/license.txt @@ -1,5 +1,5 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA @@ -10,7 +10,7 @@ as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] - Preamble + Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public @@ -112,7 +112,7 @@ modification follow. Pay close attention to the difference between a former contains code derived from the library, whereas the latter must be combined with the library in order to run. - GNU LESSER GENERAL PUBLIC LICENSE + GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other @@ -432,7 +432,7 @@ decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. @@ -455,7 +455,7 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS + END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/advlist/plugin.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/advlist/plugin.js index 665f9aa6f508..4aeb1f5501c7 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/advlist/plugin.js +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/advlist/plugin.js @@ -1,93 +1,278 @@ /** - * plugin.js + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing + * Version: 5.5.1 (2020-10-01) */ +(function () { + 'use strict'; -/*global tinymce:true */ - -tinymce.PluginManager.add('advlist', function(editor) { - var olMenuItems, ulMenuItems, lastStyles = {}; - - function buildMenuItems(listName, styleValues) { - var items = []; - - tinymce.each(styleValues.split(/[ ,]/), function(styleValue) { - items.push({ - text: styleValue.replace(/\-/g, ' ').replace(/\b\w/g, function(chr) {return chr.toUpperCase();}), - data: styleValue == 'default' ? '' : styleValue - }); - }); - - return items; - } - - olMenuItems = buildMenuItems('OL', editor.getParam( - "advlist_number_styles", - "default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman" - )); + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); - ulMenuItems = buildMenuItems('UL', editor.getParam("advlist_bullet_styles", "default,circle,disc,square")); + var applyListFormat = function (editor, listName, styleValue) { + var cmd = listName === 'UL' ? 'InsertUnorderedList' : 'InsertOrderedList'; + editor.execCommand(cmd, false, styleValue === false ? null : { 'list-style-type': styleValue }); + }; - function applyListFormat(listName, styleValue) { - var list, dom = editor.dom, sel = editor.selection; + var register = function (editor) { + editor.addCommand('ApplyUnorderedListStyle', function (ui, value) { + applyListFormat(editor, 'UL', value['list-style-type']); + }); + editor.addCommand('ApplyOrderedListStyle', function (ui, value) { + applyListFormat(editor, 'OL', value['list-style-type']); + }); + }; - // Check for existing list element - list = dom.getParent(sel.getNode(), 'ol,ul'); + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); - // Switch/add list type if needed - if (!list || list.nodeName != listName || styleValue === false) { - editor.execCommand(listName == 'UL' ? 'InsertUnorderedList' : 'InsertOrderedList'); - } + var getNumberStyles = function (editor) { + var styles = editor.getParam('advlist_number_styles', 'default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman'); + return styles ? styles.split(/[ ,]/) : []; + }; + var getBulletStyles = function (editor) { + var styles = editor.getParam('advlist_bullet_styles', 'default,circle,square'); + return styles ? styles.split(/[ ,]/) : []; + }; - // Set style - styleValue = styleValue === false ? lastStyles[listName] : styleValue; - lastStyles[listName] = styleValue; + var noop = function () { + }; + var constant = function (value) { + return function () { + return value; + }; + }; + var never = constant(false); + var always = constant(true); - list = dom.getParent(sel.getNode(), 'ol,ul'); - if (list) { - dom.setStyle(list, 'listStyleType', styleValue); - list.removeAttribute('data-mce-style'); - } + var none = function () { + return NONE; + }; + var NONE = function () { + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; + }(); + var some = function (a) { + var constant_a = constant(a); + var self = function () { + return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; + }; + var from = function (value) { + return value === null || value === undefined ? NONE : some(value); + }; + var Optional = { + some: some, + none: none, + from: from + }; - editor.focus(); - } + var isChildOfBody = function (editor, elm) { + return editor.$.contains(editor.getBody(), elm); + }; + var isTableCellNode = function (node) { + return node && /^(TH|TD)$/.test(node.nodeName); + }; + var isListNode = function (editor) { + return function (node) { + return node && /^(OL|UL|DL)$/.test(node.nodeName) && isChildOfBody(editor, node); + }; + }; + var getSelectedStyleType = function (editor) { + var listElm = editor.dom.getParent(editor.selection.getNode(), 'ol,ul'); + var style = editor.dom.getStyle(listElm, 'listStyleType'); + return Optional.from(style); + }; - function updateSelection(e) { - var listStyleType = editor.dom.getStyle(editor.dom.getParent(editor.selection.getNode(), 'ol,ul'), 'listStyleType') || ''; + var findIndex = function (list, predicate) { + for (var index = 0; index < list.length; index++) { + var element = list[index]; + if (predicate(element)) { + return index; + } + } + return -1; + }; + var styleValueToText = function (styleValue) { + return styleValue.replace(/\-/g, ' ').replace(/\b\w/g, function (chr) { + return chr.toUpperCase(); + }); + }; + var isWithinList = function (editor, e, nodeName) { + var tableCellIndex = findIndex(e.parents, isTableCellNode); + var parents = tableCellIndex !== -1 ? e.parents.slice(0, tableCellIndex) : e.parents; + var lists = global$1.grep(parents, isListNode(editor)); + return lists.length > 0 && lists[0].nodeName === nodeName; + }; + var addSplitButton = function (editor, id, tooltip, cmd, nodeName, styles) { + editor.ui.registry.addSplitButton(id, { + tooltip: tooltip, + icon: nodeName === 'OL' ? 'ordered-list' : 'unordered-list', + presets: 'listpreview', + columns: 3, + fetch: function (callback) { + var items = global$1.map(styles, function (styleValue) { + var iconStyle = nodeName === 'OL' ? 'num' : 'bull'; + var iconName = styleValue === 'disc' || styleValue === 'decimal' ? 'default' : styleValue; + var itemValue = styleValue === 'default' ? '' : styleValue; + var displayText = styleValueToText(styleValue); + return { + type: 'choiceitem', + value: itemValue, + icon: 'list-' + iconStyle + '-' + iconName, + text: displayText + }; + }); + callback(items); + }, + onAction: function () { + return editor.execCommand(cmd); + }, + onItemAction: function (_splitButtonApi, value) { + applyListFormat(editor, nodeName, value); + }, + select: function (value) { + var listStyleType = getSelectedStyleType(editor); + return listStyleType.map(function (listStyle) { + return value === listStyle; + }).getOr(false); + }, + onSetup: function (api) { + var nodeChangeHandler = function (e) { + api.setActive(isWithinList(editor, e, nodeName)); + }; + editor.on('NodeChange', nodeChangeHandler); + return function () { + return editor.off('NodeChange', nodeChangeHandler); + }; + } + }); + }; + var addButton = function (editor, id, tooltip, cmd, nodeName, _styles) { + editor.ui.registry.addToggleButton(id, { + active: false, + tooltip: tooltip, + icon: nodeName === 'OL' ? 'ordered-list' : 'unordered-list', + onSetup: function (api) { + var nodeChangeHandler = function (e) { + api.setActive(isWithinList(editor, e, nodeName)); + }; + editor.on('NodeChange', nodeChangeHandler); + return function () { + return editor.off('NodeChange', nodeChangeHandler); + }; + }, + onAction: function () { + return editor.execCommand(cmd); + } + }); + }; + var addControl = function (editor, id, tooltip, cmd, nodeName, styles) { + if (styles.length > 1) { + addSplitButton(editor, id, tooltip, cmd, nodeName, styles); + } else { + addButton(editor, id, tooltip, cmd, nodeName); + } + }; + var register$1 = function (editor) { + addControl(editor, 'numlist', 'Numbered list', 'InsertOrderedList', 'OL', getNumberStyles(editor)); + addControl(editor, 'bullist', 'Bullet list', 'InsertUnorderedList', 'UL', getBulletStyles(editor)); + }; - e.control.items().each(function(ctrl) { - ctrl.active(ctrl.settings.data === listStyleType); - }); - } + function Plugin () { + global.add('advlist', function (editor) { + if (editor.hasPlugin('lists')) { + register$1(editor); + register(editor); + } + }); + } - editor.addButton('numlist', { - type: 'splitbutton', - tooltip: 'Numbered list', - menu: olMenuItems, - onshow: updateSelection, - onselect: function(e) { - applyListFormat('OL', e.control.settings.data); - }, - onclick: function() { - applyListFormat('OL', false); - } - }); + Plugin(); - editor.addButton('bullist', { - type: 'splitbutton', - tooltip: 'Bullet list', - menu: ulMenuItems, - onshow: updateSelection, - onselect: function(e) { - applyListFormat('UL', e.control.settings.data); - }, - onclick: function() { - applyListFormat('UL', false); - } - }); -}); \ No newline at end of file +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/advlist/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/advlist/plugin.min.js index a4db7ccae7b8..754fdc266e18 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/advlist/plugin.min.js +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/advlist/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("advlist",function(t){function e(t,e){var n=[];return tinymce.each(e.split(/[ ,]/),function(t){n.push({text:t.replace(/\-/g," ").replace(/\b\w/g,function(t){return t.toUpperCase()}),data:"default"==t?"":t})}),n}function n(e,n){var o,l=t.dom,a=t.selection;o=l.getParent(a.getNode(),"ol,ul"),o&&o.nodeName==e&&n!==!1||t.execCommand("UL"==e?"InsertUnorderedList":"InsertOrderedList"),n=n===!1?i[e]:n,i[e]=n,o=l.getParent(a.getNode(),"ol,ul"),o&&(l.setStyle(o,"listStyleType",n),o.removeAttribute("data-mce-style")),t.focus()}function o(e){var n=t.dom.getStyle(t.dom.getParent(t.selection.getNode(),"ol,ul"),"listStyleType")||"";e.control.items().each(function(t){t.active(t.settings.data===n)})}var l,a,i={};l=e("OL",t.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman")),a=e("UL",t.getParam("advlist_bullet_styles","default,circle,disc,square")),t.addButton("numlist",{type:"splitbutton",tooltip:"Numbered list",menu:l,onshow:o,onselect:function(t){n("OL",t.control.settings.data)},onclick:function(){n("OL",!1)}}),t.addButton("bullist",{type:"splitbutton",tooltip:"Bullet list",menu:a,onshow:o,onselect:function(t){n("UL",t.control.settings.data)},onclick:function(){n("UL",!1)}})}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var n,e,t,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(n,e,t){var r="UL"===e?"InsertUnorderedList":"InsertOrderedList";n.execCommand(r,!1,!1===t?null:{"list-style-type":t})},l=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(n){return function(){return n}},c=i(!1),s=i(!0),o=function(){return a},a=(n=function(n){return n.isNone()},{fold:function(n,e){return n()},is:c,isSome:c,isNone:s,getOr:t=function(n){return n},getOrThunk:e=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:t,orThunk:e,map:o,each:function(){},bind:o,exists:c,forall:s,filter:o,equals:n,equals_:n,toArray:function(){return[]},toString:i("none()")}),f=function(t){var n=i(t),e=function(){return o},r=function(n){return n(t)},o={fold:function(n,e){return e(t)},is:function(n){return t===n},isSome:s,isNone:c,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:e,orThunk:e,map:function(n){return f(n(t))},each:function(n){n(t)},bind:r,exists:r,forall:r,filter:function(n){return n(t)?o:a},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(c,function(n){return e(t,n)})}};return o},d=function(n){return null===n||n===undefined?a:f(n)},g=function(n){return n&&/^(TH|TD)$/.test(n.nodeName)},m=function(r){return function(n){return n&&/^(OL|UL|DL)$/.test(n.nodeName)&&(t=n,(e=r).$.contains(e.getBody(),t));var e,t}},p=function(n,e,t){var r=function(n,e){for(var t=0;t= 2 ? end - 2 : 0); - rng.setEnd(endContainer, end >= 1 ? end - 1 : 0); - end -= 1; - - // Loop until one of the following is found: a blank space,  , delimiter, (end-2) >= 0 - } while (rng.toString() != ' ' && rng.toString() !== '' && - rng.toString().charCodeAt(0) != 160 && (end - 2) >= 0 && rng.toString() != delimiter); - - if (rng.toString() == delimiter || rng.toString().charCodeAt(0) == 160) { - rng.setStart(endContainer, end); - rng.setEnd(endContainer, start); - end += 1; - } else if (rng.startOffset === 0) { - rng.setStart(endContainer, 0); - rng.setEnd(endContainer, start); - } else { - rng.setStart(endContainer, end); - rng.setEnd(endContainer, start); - } - - // Exclude last . from word like "www.site.com." - text = rng.toString(); - if (text.charAt(text.length - 1) == '.') { - rng.setEnd(endContainer, start - 1); - } - - text = rng.toString(); - matches = text.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i); - - if (matches) { - if (matches[1] == 'www.') { - matches[1] = 'http://www.'; - } else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) { - matches[1] = 'mailto:' + matches[1]; - } - - bookmark = editor.selection.getBookmark(); - - editor.selection.setRng(rng); - editor.execCommand('createlink', false, matches[1] + matches[2]); - editor.selection.moveToBookmark(bookmark); - editor.nodeChanged(); - - // TODO: Determine if this is still needed. - if (tinymce.Env.webkit) { - // move the caret to its original position - editor.selection.collapse(false); - var max = Math.min(endContainer.length, start + 1); - rng.setStart(endContainer, max); - rng.setEnd(endContainer, max); - editor.selection.setRng(rng); - } - } - } -}); +(function () { + 'use strict'; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var global$1 = tinymce.util.Tools.resolve('tinymce.Env'); + + var getAutoLinkPattern = function (editor) { + return editor.getParam('autolink_pattern', /^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@(?!.*@))(.+)$/i); + }; + var getDefaultLinkTarget = function (editor) { + return editor.getParam('default_link_target', false); + }; + var getDefaultLinkProtocol = function (editor) { + return editor.getParam('link_default_protocol', 'http', 'string'); + }; + + var rangeEqualsDelimiterOrSpace = function (rangeString, delimiter) { + return rangeString === delimiter || rangeString === ' ' || rangeString.charCodeAt(0) === 160; + }; + var handleEclipse = function (editor) { + parseCurrentLine(editor, -1, '('); + }; + var handleSpacebar = function (editor) { + parseCurrentLine(editor, 0, ''); + }; + var handleEnter = function (editor) { + parseCurrentLine(editor, -1, ''); + }; + var scopeIndex = function (container, index) { + if (index < 0) { + index = 0; + } + if (container.nodeType === 3) { + var len = container.data.length; + if (index > len) { + index = len; + } + } + return index; + }; + var setStart = function (rng, container, offset) { + if (container.nodeType !== 1 || container.hasChildNodes()) { + rng.setStart(container, scopeIndex(container, offset)); + } else { + rng.setStartBefore(container); + } + }; + var setEnd = function (rng, container, offset) { + if (container.nodeType !== 1 || container.hasChildNodes()) { + rng.setEnd(container, scopeIndex(container, offset)); + } else { + rng.setEndAfter(container); + } + }; + var parseCurrentLine = function (editor, endOffset, delimiter) { + var end, endContainer, bookmark, text, prev, len, rngText; + var autoLinkPattern = getAutoLinkPattern(editor); + var defaultLinkTarget = getDefaultLinkTarget(editor); + if (editor.selection.getNode().tagName === 'A') { + return; + } + var rng = editor.selection.getRng().cloneRange(); + if (rng.startOffset < 5) { + prev = rng.endContainer.previousSibling; + if (!prev) { + if (!rng.endContainer.firstChild || !rng.endContainer.firstChild.nextSibling) { + return; + } + prev = rng.endContainer.firstChild.nextSibling; + } + len = prev.length; + setStart(rng, prev, len); + setEnd(rng, prev, len); + if (rng.endOffset < 5) { + return; + } + end = rng.endOffset; + endContainer = prev; + } else { + endContainer = rng.endContainer; + if (endContainer.nodeType !== 3 && endContainer.firstChild) { + while (endContainer.nodeType !== 3 && endContainer.firstChild) { + endContainer = endContainer.firstChild; + } + if (endContainer.nodeType === 3) { + setStart(rng, endContainer, 0); + setEnd(rng, endContainer, endContainer.nodeValue.length); + } + } + if (rng.endOffset === 1) { + end = 2; + } else { + end = rng.endOffset - 1 - endOffset; + } + } + var start = end; + do { + setStart(rng, endContainer, end >= 2 ? end - 2 : 0); + setEnd(rng, endContainer, end >= 1 ? end - 1 : 0); + end -= 1; + rngText = rng.toString(); + } while (rngText !== ' ' && rngText !== '' && rngText.charCodeAt(0) !== 160 && end - 2 >= 0 && rngText !== delimiter); + if (rangeEqualsDelimiterOrSpace(rng.toString(), delimiter)) { + setStart(rng, endContainer, end); + setEnd(rng, endContainer, start); + end += 1; + } else if (rng.startOffset === 0) { + setStart(rng, endContainer, 0); + setEnd(rng, endContainer, start); + } else { + setStart(rng, endContainer, end); + setEnd(rng, endContainer, start); + } + text = rng.toString(); + if (text.charAt(text.length - 1) === '.') { + setEnd(rng, endContainer, start - 1); + } + text = rng.toString().trim(); + var matches = text.match(autoLinkPattern); + var protocol = getDefaultLinkProtocol(editor); + if (matches) { + if (matches[1] === 'www.') { + matches[1] = protocol + '://www.'; + } else if (/@$/.test(matches[1]) && !/^mailto:/.test(matches[1])) { + matches[1] = 'mailto:' + matches[1]; + } + bookmark = editor.selection.getBookmark(); + editor.selection.setRng(rng); + editor.execCommand('createlink', false, matches[1] + matches[2]); + if (defaultLinkTarget !== false) { + editor.dom.setAttrib(editor.selection.getNode(), 'target', defaultLinkTarget); + } + editor.selection.moveToBookmark(bookmark); + editor.nodeChanged(); + } + }; + var setup = function (editor) { + var autoUrlDetectState; + editor.on('keydown', function (e) { + if (e.keyCode === 13) { + return handleEnter(editor); + } + }); + if (global$1.browser.isIE()) { + editor.on('focus', function () { + if (!autoUrlDetectState) { + autoUrlDetectState = true; + try { + editor.execCommand('AutoUrlDetect', false, true); + } catch (ex) { + } + } + }); + return; + } + editor.on('keypress', function (e) { + if (e.keyCode === 41) { + return handleEclipse(editor); + } + }); + editor.on('keyup', function (e) { + if (e.keyCode === 32) { + return handleSpacebar(editor); + } + }); + }; + + function Plugin () { + global.add('autolink', function (editor) { + setup(editor); + }); + } + + Plugin(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/autolink/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/autolink/plugin.min.js index 3fab6fa01b9c..b5cd5b074aea 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/autolink/plugin.min.js +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/autolink/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("autolink",function(t){function e(t){o(t,-1,"(",!0)}function n(t){o(t,0,"",!0)}function i(t){o(t,-1,"",!1)}function o(t,e,n){var i,o,r,s,d,f,a,l,c;if(i=t.selection.getRng(!0).cloneRange(),i.startOffset<5){if(l=i.endContainer.previousSibling,!l){if(!i.endContainer.firstChild||!i.endContainer.firstChild.nextSibling)return;l=i.endContainer.firstChild.nextSibling}if(c=l.length,i.setStart(l,c),i.setEnd(l,c),i.endOffset<5)return;o=i.endOffset,s=l}else{if(s=i.endContainer,3!=s.nodeType&&s.firstChild){for(;3!=s.nodeType&&s.firstChild;)s=s.firstChild;3==s.nodeType&&(i.setStart(s,0),i.setEnd(s,s.nodeValue.length))}o=1==i.endOffset?2:i.endOffset-1-e}r=o;do i.setStart(s,o>=2?o-2:0),i.setEnd(s,o>=1?o-1:0),o-=1;while(" "!=i.toString()&&""!==i.toString()&&160!=i.toString().charCodeAt(0)&&o-2>=0&&i.toString()!=n);if(i.toString()==n||160==i.toString().charCodeAt(0)?(i.setStart(s,o),i.setEnd(s,r),o+=1):0===i.startOffset?(i.setStart(s,0),i.setEnd(s,r)):(i.setStart(s,o),i.setEnd(s,r)),f=i.toString(),"."==f.charAt(f.length-1)&&i.setEnd(s,r-1),f=i.toString(),a=f.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i),a&&("www."==a[1]?a[1]="http://www.":/@$/.test(a[1])&&!/^mailto:/.test(a[1])&&(a[1]="mailto:"+a[1]),d=t.selection.getBookmark(),t.selection.setRng(i),t.execCommand("createlink",!1,a[1]+a[2]),t.selection.moveToBookmark(d),t.nodeChanged(),tinymce.Env.webkit)){t.selection.collapse(!1);var g=Math.min(s.length,r+1);i.setStart(s,g),i.setEnd(s,g),t.selection.setRng(i)}}var r;return t.on("keydown",function(e){if(13==e.keyCode)return i(t)}),tinymce.Env.ie?void t.on("focus",function(){if(!r){r=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(t){}}}):(t.on("keypress",function(n){if(41==n.which)return e(t)}),void t.on("keyup",function(e){if(32==e.keyCode)return n(t)}))}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.Env"),i=function(e,t){var n;return t<0&&(t=0),3!==e.nodeType||(n=e.data.length) getAutoResizeMinHeight(editor)) { + resizeHeight = contentHeight + chromeHeight; + } + var maxHeight = getAutoResizeMaxHeight(editor); + if (maxHeight && resizeHeight > maxHeight) { + resizeHeight = maxHeight; + toggleScrolling(editor, true); + } else { + toggleScrolling(editor, false); + } + if (resizeHeight !== oldSize.get()) { + var deltaSize = resizeHeight - oldSize.get(); + dom.setStyle(editor.getContainer(), 'height', resizeHeight + 'px'); + oldSize.set(resizeHeight); + fireResizeEditor(editor); + if (global$1.browser.isSafari() && global$1.mac) { + var win = editor.getWin(); + win.scrollTo(win.pageXOffset, win.pageYOffset); + } + if (editor.hasFocus()) { + editor.selection.scrollIntoView(editor.selection.getNode()); + } + if (global$1.webkit && deltaSize < 0) { + resize(editor, oldSize); + } + } + }; + var setup = function (editor, oldSize) { + editor.on('init', function () { + var overflowPadding = getAutoResizeOverflowPadding(editor); + var dom = editor.dom; + dom.setStyles(editor.getDoc().documentElement, { height: 'auto' }); + dom.setStyles(editor.getBody(), { + 'paddingLeft': overflowPadding, + 'paddingRight': overflowPadding, + 'min-height': 0 + }); + }); + editor.on('NodeChange SetContent keyup FullscreenStateChanged ResizeContent', function () { + resize(editor, oldSize); + }); + if (shouldAutoResizeOnInit(editor)) { + editor.on('init', function () { + wait(editor, oldSize, 20, 100, function () { + wait(editor, oldSize, 5, 1000); + }); + }); + } + }; + + var register = function (editor, oldSize) { + editor.addCommand('mceAutoResize', function () { + resize(editor, oldSize); + }); + }; + + function Plugin () { + global.add('autoresize', function (editor) { + if (!editor.settings.hasOwnProperty('resize')) { + editor.settings.resize = false; + } + if (!editor.inline) { + var oldSize = Cell(0); + register(editor, oldSize); + setup(editor, oldSize); + } + }); + } + + Plugin(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/autoresize/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/autoresize/plugin.min.js new file mode 100644 index 000000000000..82dc0d825be5 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/autoresize/plugin.min.js @@ -0,0 +1,9 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),h=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),y=function(e){return e.getParam("min_height",e.getElement().offsetHeight,"number")},a=function(e,t,n,i,o){r.setEditorTimeout(e,function(){b(e,t),n--?a(e,t,n,i,o):o&&o()},i)},p=function(e,t){var n=e.getBody();n&&(n.style.overflowY=t?"":"hidden",t||(n.scrollTop=0))},v=function(e,t,n,i){var o=parseInt(e.getStyle(t,n,i),10);return isNaN(o)?0:o},b=function(e,t){var n,i,o,r,s,a,g,u,l,c,m,f=e.dom,d=e.getDoc();d&&((n=e).plugins.fullscreen&&n.plugins.fullscreen.isFullscreen()?p(e,!0):(i=d.documentElement,o=e.getParam("autoresize_bottom_margin",50,"number"),r=y(e),s=v(f,i,"margin-top",!0),a=v(f,i,"margin-bottom",!0),(g=i.offsetHeight+s+a+o)<0&&(g=0),g+(u=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight)>y(e)&&(r=g+u),(l=e.getParam("max_height",0,"number"))&&l getAutoSaveRetention(editor)) { + removeDraft(editor, false); + return false; + } + return true; + }; + var removeDraft = function (editor, fire) { + var prefix = getAutoSavePrefix(editor); + global$2.removeItem(prefix + 'draft'); + global$2.removeItem(prefix + 'time'); + if (fire !== false) { + fireRemoveDraft(editor); + } + }; + var storeDraft = function (editor) { + var prefix = getAutoSavePrefix(editor); + if (!isEmpty(editor) && editor.isDirty()) { + global$2.setItem(prefix + 'draft', editor.getContent({ + format: 'raw', + no_events: true + })); + global$2.setItem(prefix + 'time', new Date().getTime().toString()); + fireStoreDraft(editor); + } + }; + var restoreDraft = function (editor) { + var prefix = getAutoSavePrefix(editor); + if (hasDraft(editor)) { + editor.setContent(global$2.getItem(prefix + 'draft'), { format: 'raw' }); + fireRestoreDraft(editor); + } + }; + var startStoreDraft = function (editor) { + var interval = getAutoSaveInterval(editor); + global$1.setInterval(function () { + if (!editor.removed) { + storeDraft(editor); + } + }, interval); + }; + var restoreLastDraft = function (editor) { + editor.undoManager.transact(function () { + restoreDraft(editor); + removeDraft(editor); + }); + editor.focus(); + }; + + var get = function (editor) { + return { + hasDraft: function () { + return hasDraft(editor); + }, + storeDraft: function () { + return storeDraft(editor); + }, + restoreDraft: function () { + return restoreDraft(editor); + }, + removeDraft: function (fire) { + return removeDraft(editor, fire); + }, + isEmpty: function (html) { + return isEmpty(editor, html); + } + }; + }; + + var global$4 = tinymce.util.Tools.resolve('tinymce.EditorManager'); + + var setup = function (editor) { + editor.editorManager.on('BeforeUnload', function (e) { + var msg; + global$3.each(global$4.get(), function (editor) { + if (editor.plugins.autosave) { + editor.plugins.autosave.storeDraft(); + } + if (!msg && editor.isDirty() && shouldAskBeforeUnload(editor)) { + msg = editor.translate('You have unsaved changes are you sure you want to navigate away?'); + } + }); + if (msg) { + e.preventDefault(); + e.returnValue = msg; + } + }); + }; + + var makeSetupHandler = function (editor) { + return function (api) { + api.setDisabled(!hasDraft(editor)); + var editorEventCallback = function () { + return api.setDisabled(!hasDraft(editor)); + }; + editor.on('StoreDraft RestoreDraft RemoveDraft', editorEventCallback); + return function () { + return editor.off('StoreDraft RestoreDraft RemoveDraft', editorEventCallback); + }; + }; + }; + var register = function (editor) { + startStoreDraft(editor); + editor.ui.registry.addButton('restoredraft', { + tooltip: 'Restore last draft', + icon: 'restore-draft', + onAction: function () { + restoreLastDraft(editor); + }, + onSetup: makeSetupHandler(editor) + }); + editor.ui.registry.addMenuItem('restoredraft', { + text: 'Restore last draft', + icon: 'restore-draft', + onAction: function () { + restoreLastDraft(editor); + }, + onSetup: makeSetupHandler(editor) + }); + }; + + function Plugin () { + global.add('autosave', function (editor) { + setup(editor); + register(editor); + editor.on('init', function () { + if (shouldRestoreWhenEmpty(editor) && editor.dom.isEmpty(editor.getBody())) { + restoreDraft(editor); + } + }); + return get(editor); + }); + } + + Plugin(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/autosave/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/autosave/plugin.min.js new file mode 100644 index 000000000000..98868226fc1c --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/autosave/plugin.min.js @@ -0,0 +1,9 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var e,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=(e=undefined,function(t){return e===t}),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),n=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),o=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(t,e){var r=t||e,n=/^(\d+)([ms]?)$/.exec(""+r);return(n[2]?{s:1e3,m:6e4}[n[2]]:1)*parseInt(r,10)},u=function(t){var e=document.location;return t.getParam("autosave_prefix","tinymce-autosave-{path}{query}{hash}-{id}-").replace(/{path}/g,e.pathname).replace(/{query}/g,e.search).replace(/{hash}/g,e.hash).replace(/{id}/g,t.id)},s=function(t,e){if(a(e))return t.dom.isEmpty(t.getBody());var r=o.trim(e);if(""===r)return!0;var n=(new DOMParser).parseFromString(r,"text/html");return t.dom.isEmpty(n)},f=function(t){var e=parseInt(n.getItem(u(t)+"time"),10)||0;return!((new Date).getTime()-e>i(t.getParam("autosave_retention"),"20m"))||(c(t,!1),!1)},c=function(t,e){var r=u(t);n.removeItem(r+"draft"),n.removeItem(r+"time"),!1!==e&&t.fire("RemoveDraft")},m=function(t){var e=u(t);!s(t)&&t.isDirty()&&(n.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),n.setItem(e+"time",(new Date).getTime().toString()),t.fire("StoreDraft"))},l=function(t){var e=u(t);f(t)&&(t.setContent(n.getItem(e+"draft"),{format:"raw"}),t.fire("RestoreDraft"))},v=function(t){var e=i(t.getParam("autosave_interval"),"30s");r.setInterval(function(){t.removed||m(t)},e)},d=function(t){t.undoManager.transact(function(){l(t),c(t)}),t.focus()},g=tinymce.util.Tools.resolve("tinymce.EditorManager"),y=function(r){return function(t){t.setDisabled(!f(r));var e=function(){return t.setDisabled(!f(r))};return r.on("StoreDraft RestoreDraft RemoveDraft",e),function(){return r.off("StoreDraft RestoreDraft RemoveDraft",e)}}};t.add("autosave",function(t){var e,r;return t.editorManager.on("BeforeUnload",function(t){var e;o.each(g.get(),function(t){t.plugins.autosave&&t.plugins.autosave.storeDraft(),!e&&t.isDirty()&&t.getParam("autosave_ask_before_unload",!0)&&(e=t.translate("You have unsaved changes are you sure you want to navigate away?"))}),e&&(t.preventDefault(),t.returnValue=e)}),v(e=t),e.ui.registry.addButton("restoredraft",{tooltip:"Restore last draft",icon:"restore-draft",onAction:function(){d(e)},onSetup:y(e)}),e.ui.registry.addMenuItem("restoredraft",{text:"Restore last draft",icon:"restore-draft",onAction:function(){d(e)},onSetup:y(e)}),t.on("init",function(){t.getParam("autosave_restore_when_empty",!1)&&t.dom.isEmpty(t.getBody())&&l(t)}),r=t,{hasDraft:function(){return f(r)},storeDraft:function(){return m(r)},restoreDraft:function(){return l(r)},removeDraft:function(t){return c(r,t)},isEmpty:function(t){return s(r,t)}}})}(); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/bbcode/plugin.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/bbcode/plugin.js new file mode 100644 index 000000000000..aee92b1e260e --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/bbcode/plugin.js @@ -0,0 +1,99 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +(function () { + 'use strict'; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var html2bbcode = function (s) { + s = global$1.trim(s); + var rep = function (re, str) { + s = s.replace(re, str); + }; + rep(/(.*?)<\/a>/gi, '[url=$1]$2[/url]'); + rep(/(.*?)<\/font>/gi, '[code][color=$1]$2[/color][/code]'); + rep(/(.*?)<\/font>/gi, '[quote][color=$1]$2[/color][/quote]'); + rep(/(.*?)<\/font>/gi, '[code][color=$1]$2[/color][/code]'); + rep(/(.*?)<\/font>/gi, '[quote][color=$1]$2[/color][/quote]'); + rep(/(.*?)<\/span>/gi, '[color=$1]$2[/color]'); + rep(/(.*?)<\/font>/gi, '[color=$1]$2[/color]'); + rep(/(.*?)<\/span>/gi, '[size=$1]$2[/size]'); + rep(/(.*?)<\/font>/gi, '$1'); + rep(//gi, '[img]$1[/img]'); + rep(/(.*?)<\/span>/gi, '[code]$1[/code]'); + rep(/(.*?)<\/span>/gi, '[quote]$1[/quote]'); + rep(/(.*?)<\/strong>/gi, '[code][b]$1[/b][/code]'); + rep(/(.*?)<\/strong>/gi, '[quote][b]$1[/b][/quote]'); + rep(/(.*?)<\/em>/gi, '[code][i]$1[/i][/code]'); + rep(/(.*?)<\/em>/gi, '[quote][i]$1[/i][/quote]'); + rep(/(.*?)<\/u>/gi, '[code][u]$1[/u][/code]'); + rep(/(.*?)<\/u>/gi, '[quote][u]$1[/u][/quote]'); + rep(/<\/(strong|b)>/gi, '[/b]'); + rep(/<(strong|b)>/gi, '[b]'); + rep(/<\/(em|i)>/gi, '[/i]'); + rep(/<(em|i)>/gi, '[i]'); + rep(/<\/u>/gi, '[/u]'); + rep(/(.*?)<\/span>/gi, '[u]$1[/u]'); + rep(//gi, '[u]'); + rep(/]*>/gi, '[quote]'); + rep(/<\/blockquote>/gi, '[/quote]'); + rep(/
    /gi, '\n'); + rep(//gi, '\n'); + rep(/
    /gi, '\n'); + rep(/

    /gi, ''); + rep(/<\/p>/gi, '\n'); + rep(/ |\u00a0/gi, ' '); + rep(/"/gi, '"'); + rep(/</gi, '<'); + rep(/>/gi, '>'); + rep(/&/gi, '&'); + return s; + }; + var bbcode2html = function (s) { + s = global$1.trim(s); + var rep = function (re, str) { + s = s.replace(re, str); + }; + rep(/\n/gi, '
    '); + rep(/\[b\]/gi, ''); + rep(/\[\/b\]/gi, ''); + rep(/\[i\]/gi, ''); + rep(/\[\/i\]/gi, ''); + rep(/\[u\]/gi, ''); + rep(/\[\/u\]/gi, ''); + rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi, '$2'); + rep(/\[url\](.*?)\[\/url\]/gi, '$1'); + rep(/\[img\](.*?)\[\/img\]/gi, ''); + rep(/\[color=(.*?)\](.*?)\[\/color\]/gi, '$2'); + rep(/\[code\](.*?)\[\/code\]/gi, '$1 '); + rep(/\[quote.*?\](.*?)\[\/quote\]/gi, '$1 '); + return s; + }; + + function Plugin () { + global.add('bbcode', function (editor) { + editor.on('BeforeSetContent', function (e) { + e.content = bbcode2html(e.content); + }); + editor.on('PostProcess', function (e) { + if (e.set) { + e.content = bbcode2html(e.content); + } + if (e.get) { + e.content = html2bbcode(e.content); + } + }); + }); + } + + Plugin(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/bbcode/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/bbcode/plugin.min.js new file mode 100644 index 000000000000..4c26eab1f85b --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/bbcode/plugin.min.js @@ -0,0 +1,9 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var o=tinymce.util.Tools.resolve("tinymce.PluginManager"),e=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=function(t){t=e.trim(t);var o=function(o,e){t=t.replace(o,e)};return o(/\n/gi,"
    "),o(/\[b\]/gi,""),o(/\[\/b\]/gi,""),o(/\[i\]/gi,""),o(/\[\/i\]/gi,""),o(/\[u\]/gi,""),o(/\[\/u\]/gi,""),o(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'$2'),o(/\[url\](.*?)\[\/url\]/gi,'$1'),o(/\[img\](.*?)\[\/img\]/gi,''),o(/\[color=(.*?)\](.*?)\[\/color\]/gi,'$2'),o(/\[code\](.*?)\[\/code\]/gi,'$1 '),o(/\[quote.*?\](.*?)\[\/quote\]/gi,'$1 '),t};o.add("bbcode",function(o){o.on("BeforeSetContent",function(o){o.content=t(o.content)}),o.on("PostProcess",function(o){o.set&&(o.content=t(o.content)),o.get&&(o.content=function(t){t=e.trim(t);var o=function(o,e){t=t.replace(o,e)};return o(/(.*?)<\/a>/gi,"[url=$1]$2[/url]"),o(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),o(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),o(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),o(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),o(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"),o(/(.*?)<\/font>/gi,"[color=$1]$2[/color]"),o(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"),o(/(.*?)<\/font>/gi,"$1"),o(//gi,"[img]$1[/img]"),o(/(.*?)<\/span>/gi,"[code]$1[/code]"),o(/(.*?)<\/span>/gi,"[quote]$1[/quote]"),o(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),o(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),o(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),o(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),o(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),o(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),o(/<\/(strong|b)>/gi,"[/b]"),o(/<(strong|b)>/gi,"[b]"),o(/<\/(em|i)>/gi,"[/i]"),o(/<(em|i)>/gi,"[i]"),o(/<\/u>/gi,"[/u]"),o(/(.*?)<\/span>/gi,"[u]$1[/u]"),o(//gi,"[u]"),o(/]*>/gi,"[quote]"),o(/<\/blockquote>/gi,"[/quote]"),o(/
    /gi,"\n"),o(//gi,"\n"),o(/
    /gi,"\n"),o(/

    /gi,""),o(/<\/p>/gi,"\n"),o(/ |\u00a0/gi," "),o(/"/gi,'"'),o(/</gi,"<"),o(/>/gi,">"),o(/&/gi,"&"),t}(o.content))})})}(); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/charmap/plugin.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/charmap/plugin.js index 203a38067ab3..9d4d8f06b17b 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/charmap/plugin.js +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/charmap/plugin.js @@ -1,365 +1,1706 @@ /** - * plugin.js + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing + * Version: 5.5.1 (2020-10-01) */ +(function () { + 'use strict'; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var fireInsertCustomChar = function (editor, chr) { + return editor.fire('insertCustomChar', { chr: chr }); + }; + + var insertChar = function (editor, chr) { + var evtChr = fireInsertCustomChar(editor, chr).chr; + editor.execCommand('mceInsertContent', false, evtChr); + }; + + var noop = function () { + }; + var constant = function (value) { + return function () { + return value; + }; + }; + var never = constant(false); + var always = constant(true); + + var none = function () { + return NONE; + }; + var NONE = function () { + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; + }(); + var some = function (a) { + var constant_a = constant(a); + var self = function () { + return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; + }; + var from = function (value) { + return value === null || value === undefined ? NONE : some(value); + }; + var Optional = { + some: some, + none: none, + from: from + }; + + var typeOf = function (x) { + var t = typeof x; + if (x === null) { + return 'null'; + } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } else { + return t; + } + }; + var isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isArray = isType('array'); -/*global tinymce:true */ + var nativePush = Array.prototype.push; + var map = function (xs, f) { + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; + }; + var each = function (xs, f) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } + }; + var findUntil = function (xs, pred, until) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Optional.some(x); + } else if (until(x, i)) { + break; + } + } + return Optional.none(); + }; + var find = function (xs, pred) { + return findUntil(xs, pred, never); + }; + var flatten = function (xs) { + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); + } + nativePush.apply(r, xs[i]); + } + return r; + }; + var bind = function (xs, f) { + return flatten(map(xs, f)); + }; -tinymce.PluginManager.add('charmap', function(editor) { - var charmap = [ - ['160', 'no-break space'], - ['38', 'ampersand'], - ['34', 'quotation mark'], - // finance - ['162', 'cent sign'], - ['8364', 'euro sign'], - ['163', 'pound sign'], - ['165', 'yen sign'], - // signs - ['169', 'copyright sign'], - ['174', 'registered sign'], - ['8482', 'trade mark sign'], - ['8240', 'per mille sign'], - ['181', 'micro sign'], - ['183', 'middle dot'], - ['8226', 'bullet'], - ['8230', 'three dot leader'], - ['8242', 'minutes / feet'], - ['8243', 'seconds / inches'], - ['167', 'section sign'], - ['182', 'paragraph sign'], - ['223', 'sharp s / ess-zed'], - // quotations - ['8249', 'single left-pointing angle quotation mark'], - ['8250', 'single right-pointing angle quotation mark'], - ['171', 'left pointing guillemet'], - ['187', 'right pointing guillemet'], - ['8216', 'left single quotation mark'], - ['8217', 'right single quotation mark'], - ['8220', 'left double quotation mark'], - ['8221', 'right double quotation mark'], - ['8218', 'single low-9 quotation mark'], - ['8222', 'double low-9 quotation mark'], - ['60', 'less-than sign'], - ['62', 'greater-than sign'], - ['8804', 'less-than or equal to'], - ['8805', 'greater-than or equal to'], - ['8211', 'en dash'], - ['8212', 'em dash'], - ['175', 'macron'], - ['8254', 'overline'], - ['164', 'currency sign'], - ['166', 'broken bar'], - ['168', 'diaeresis'], - ['161', 'inverted exclamation mark'], - ['191', 'turned question mark'], - ['710', 'circumflex accent'], - ['732', 'small tilde'], - ['176', 'degree sign'], - ['8722', 'minus sign'], - ['177', 'plus-minus sign'], - ['247', 'division sign'], - ['8260', 'fraction slash'], - ['215', 'multiplication sign'], - ['185', 'superscript one'], - ['178', 'superscript two'], - ['179', 'superscript three'], - ['188', 'fraction one quarter'], - ['189', 'fraction one half'], - ['190', 'fraction three quarters'], - // math / logical - ['402', 'function / florin'], - ['8747', 'integral'], - ['8721', 'n-ary sumation'], - ['8734', 'infinity'], - ['8730', 'square root'], - ['8764', 'similar to'], - ['8773', 'approximately equal to'], - ['8776', 'almost equal to'], - ['8800', 'not equal to'], - ['8801', 'identical to'], - ['8712', 'element of'], - ['8713', 'not an element of'], - ['8715', 'contains as member'], - ['8719', 'n-ary product'], - ['8743', 'logical and'], - ['8744', 'logical or'], - ['172', 'not sign'], - ['8745', 'intersection'], - ['8746', 'union'], - ['8706', 'partial differential'], - ['8704', 'for all'], - ['8707', 'there exists'], - ['8709', 'diameter'], - ['8711', 'backward difference'], - ['8727', 'asterisk operator'], - ['8733', 'proportional to'], - ['8736', 'angle'], - // undefined - ['180', 'acute accent'], - ['184', 'cedilla'], - ['170', 'feminine ordinal indicator'], - ['186', 'masculine ordinal indicator'], - ['8224', 'dagger'], - ['8225', 'double dagger'], - // alphabetical special chars - ['192', 'A - grave'], - ['193', 'A - acute'], - ['194', 'A - circumflex'], - ['195', 'A - tilde'], - ['196', 'A - diaeresis'], - ['197', 'A - ring above'], - ['198', 'ligature AE'], - ['199', 'C - cedilla'], - ['200', 'E - grave'], - ['201', 'E - acute'], - ['202', 'E - circumflex'], - ['203', 'E - diaeresis'], - ['204', 'I - grave'], - ['205', 'I - acute'], - ['206', 'I - circumflex'], - ['207', 'I - diaeresis'], - ['208', 'ETH'], - ['209', 'N - tilde'], - ['210', 'O - grave'], - ['211', 'O - acute'], - ['212', 'O - circumflex'], - ['213', 'O - tilde'], - ['214', 'O - diaeresis'], - ['216', 'O - slash'], - ['338', 'ligature OE'], - ['352', 'S - caron'], - ['217', 'U - grave'], - ['218', 'U - acute'], - ['219', 'U - circumflex'], - ['220', 'U - diaeresis'], - ['221', 'Y - acute'], - ['376', 'Y - diaeresis'], - ['222', 'THORN'], - ['224', 'a - grave'], - ['225', 'a - acute'], - ['226', 'a - circumflex'], - ['227', 'a - tilde'], - ['228', 'a - diaeresis'], - ['229', 'a - ring above'], - ['230', 'ligature ae'], - ['231', 'c - cedilla'], - ['232', 'e - grave'], - ['233', 'e - acute'], - ['234', 'e - circumflex'], - ['235', 'e - diaeresis'], - ['236', 'i - grave'], - ['237', 'i - acute'], - ['238', 'i - circumflex'], - ['239', 'i - diaeresis'], - ['240', 'eth'], - ['241', 'n - tilde'], - ['242', 'o - grave'], - ['243', 'o - acute'], - ['244', 'o - circumflex'], - ['245', 'o - tilde'], - ['246', 'o - diaeresis'], - ['248', 'o slash'], - ['339', 'ligature oe'], - ['353', 's - caron'], - ['249', 'u - grave'], - ['250', 'u - acute'], - ['251', 'u - circumflex'], - ['252', 'u - diaeresis'], - ['253', 'y - acute'], - ['254', 'thorn'], - ['255', 'y - diaeresis'], - ['913', 'Alpha'], - ['914', 'Beta'], - ['915', 'Gamma'], - ['916', 'Delta'], - ['917', 'Epsilon'], - ['918', 'Zeta'], - ['919', 'Eta'], - ['920', 'Theta'], - ['921', 'Iota'], - ['922', 'Kappa'], - ['923', 'Lambda'], - ['924', 'Mu'], - ['925', 'Nu'], - ['926', 'Xi'], - ['927', 'Omicron'], - ['928', 'Pi'], - ['929', 'Rho'], - ['931', 'Sigma'], - ['932', 'Tau'], - ['933', 'Upsilon'], - ['934', 'Phi'], - ['935', 'Chi'], - ['936', 'Psi'], - ['937', 'Omega'], - ['945', 'alpha'], - ['946', 'beta'], - ['947', 'gamma'], - ['948', 'delta'], - ['949', 'epsilon'], - ['950', 'zeta'], - ['951', 'eta'], - ['952', 'theta'], - ['953', 'iota'], - ['954', 'kappa'], - ['955', 'lambda'], - ['956', 'mu'], - ['957', 'nu'], - ['958', 'xi'], - ['959', 'omicron'], - ['960', 'pi'], - ['961', 'rho'], - ['962', 'final sigma'], - ['963', 'sigma'], - ['964', 'tau'], - ['965', 'upsilon'], - ['966', 'phi'], - ['967', 'chi'], - ['968', 'psi'], - ['969', 'omega'], - // symbols - ['8501', 'alef symbol'], - ['982', 'pi symbol'], - ['8476', 'real part symbol'], - ['978', 'upsilon - hook symbol'], - ['8472', 'Weierstrass p'], - ['8465', 'imaginary part'], - // arrows - ['8592', 'leftwards arrow'], - ['8593', 'upwards arrow'], - ['8594', 'rightwards arrow'], - ['8595', 'downwards arrow'], - ['8596', 'left right arrow'], - ['8629', 'carriage return'], - ['8656', 'leftwards double arrow'], - ['8657', 'upwards double arrow'], - ['8658', 'rightwards double arrow'], - ['8659', 'downwards double arrow'], - ['8660', 'left right double arrow'], - ['8756', 'therefore'], - ['8834', 'subset of'], - ['8835', 'superset of'], - ['8836', 'not a subset of'], - ['8838', 'subset of or equal to'], - ['8839', 'superset of or equal to'], - ['8853', 'circled plus'], - ['8855', 'circled times'], - ['8869', 'perpendicular'], - ['8901', 'dot operator'], - ['8968', 'left ceiling'], - ['8969', 'right ceiling'], - ['8970', 'left floor'], - ['8971', 'right floor'], - ['9001', 'left-pointing angle bracket'], - ['9002', 'right-pointing angle bracket'], - ['9674', 'lozenge'], - ['9824', 'black spade suit'], - ['9827', 'black club suit'], - ['9829', 'black heart suit'], - ['9830', 'black diamond suit'], - ['8194', 'en space'], - ['8195', 'em space'], - ['8201', 'thin space'], - ['8204', 'zero width non-joiner'], - ['8205', 'zero width joiner'], - ['8206', 'left-to-right mark'], - ['8207', 'right-to-left mark'], - ['173', 'soft hyphen'] - ]; + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); - function showDialog() { - var gridHtml, x, y, win; + var getCharMap = function (editor) { + return editor.getParam('charmap'); + }; + var getCharMapAppend = function (editor) { + return editor.getParam('charmap_append'); + }; - function getParentTd(elm) { - while (elm) { - if (elm.nodeName == 'TD') { - return elm; - } + var isArray$1 = global$1.isArray; + var UserDefined = 'User Defined'; + var getDefaultCharMap = function () { + return [ + { + name: 'Currency', + characters: [ + [ + 36, + 'dollar sign' + ], + [ + 162, + 'cent sign' + ], + [ + 8364, + 'euro sign' + ], + [ + 163, + 'pound sign' + ], + [ + 165, + 'yen sign' + ], + [ + 164, + 'currency sign' + ], + [ + 8352, + 'euro-currency sign' + ], + [ + 8353, + 'colon sign' + ], + [ + 8354, + 'cruzeiro sign' + ], + [ + 8355, + 'french franc sign' + ], + [ + 8356, + 'lira sign' + ], + [ + 8357, + 'mill sign' + ], + [ + 8358, + 'naira sign' + ], + [ + 8359, + 'peseta sign' + ], + [ + 8360, + 'rupee sign' + ], + [ + 8361, + 'won sign' + ], + [ + 8362, + 'new sheqel sign' + ], + [ + 8363, + 'dong sign' + ], + [ + 8365, + 'kip sign' + ], + [ + 8366, + 'tugrik sign' + ], + [ + 8367, + 'drachma sign' + ], + [ + 8368, + 'german penny symbol' + ], + [ + 8369, + 'peso sign' + ], + [ + 8370, + 'guarani sign' + ], + [ + 8371, + 'austral sign' + ], + [ + 8372, + 'hryvnia sign' + ], + [ + 8373, + 'cedi sign' + ], + [ + 8374, + 'livre tournois sign' + ], + [ + 8375, + 'spesmilo sign' + ], + [ + 8376, + 'tenge sign' + ], + [ + 8377, + 'indian rupee sign' + ], + [ + 8378, + 'turkish lira sign' + ], + [ + 8379, + 'nordic mark sign' + ], + [ + 8380, + 'manat sign' + ], + [ + 8381, + 'ruble sign' + ], + [ + 20870, + 'yen character' + ], + [ + 20803, + 'yuan character' + ], + [ + 22291, + 'yuan character, in hong kong and taiwan' + ], + [ + 22278, + 'yen/yuan character variant one' + ] + ] + }, + { + name: 'Text', + characters: [ + [ + 169, + 'copyright sign' + ], + [ + 174, + 'registered sign' + ], + [ + 8482, + 'trade mark sign' + ], + [ + 8240, + 'per mille sign' + ], + [ + 181, + 'micro sign' + ], + [ + 183, + 'middle dot' + ], + [ + 8226, + 'bullet' + ], + [ + 8230, + 'three dot leader' + ], + [ + 8242, + 'minutes / feet' + ], + [ + 8243, + 'seconds / inches' + ], + [ + 167, + 'section sign' + ], + [ + 182, + 'paragraph sign' + ], + [ + 223, + 'sharp s / ess-zed' + ] + ] + }, + { + name: 'Quotations', + characters: [ + [ + 8249, + 'single left-pointing angle quotation mark' + ], + [ + 8250, + 'single right-pointing angle quotation mark' + ], + [ + 171, + 'left pointing guillemet' + ], + [ + 187, + 'right pointing guillemet' + ], + [ + 8216, + 'left single quotation mark' + ], + [ + 8217, + 'right single quotation mark' + ], + [ + 8220, + 'left double quotation mark' + ], + [ + 8221, + 'right double quotation mark' + ], + [ + 8218, + 'single low-9 quotation mark' + ], + [ + 8222, + 'double low-9 quotation mark' + ], + [ + 60, + 'less-than sign' + ], + [ + 62, + 'greater-than sign' + ], + [ + 8804, + 'less-than or equal to' + ], + [ + 8805, + 'greater-than or equal to' + ], + [ + 8211, + 'en dash' + ], + [ + 8212, + 'em dash' + ], + [ + 175, + 'macron' + ], + [ + 8254, + 'overline' + ], + [ + 164, + 'currency sign' + ], + [ + 166, + 'broken bar' + ], + [ + 168, + 'diaeresis' + ], + [ + 161, + 'inverted exclamation mark' + ], + [ + 191, + 'turned question mark' + ], + [ + 710, + 'circumflex accent' + ], + [ + 732, + 'small tilde' + ], + [ + 176, + 'degree sign' + ], + [ + 8722, + 'minus sign' + ], + [ + 177, + 'plus-minus sign' + ], + [ + 247, + 'division sign' + ], + [ + 8260, + 'fraction slash' + ], + [ + 215, + 'multiplication sign' + ], + [ + 185, + 'superscript one' + ], + [ + 178, + 'superscript two' + ], + [ + 179, + 'superscript three' + ], + [ + 188, + 'fraction one quarter' + ], + [ + 189, + 'fraction one half' + ], + [ + 190, + 'fraction three quarters' + ] + ] + }, + { + name: 'Mathematical', + characters: [ + [ + 402, + 'function / florin' + ], + [ + 8747, + 'integral' + ], + [ + 8721, + 'n-ary sumation' + ], + [ + 8734, + 'infinity' + ], + [ + 8730, + 'square root' + ], + [ + 8764, + 'similar to' + ], + [ + 8773, + 'approximately equal to' + ], + [ + 8776, + 'almost equal to' + ], + [ + 8800, + 'not equal to' + ], + [ + 8801, + 'identical to' + ], + [ + 8712, + 'element of' + ], + [ + 8713, + 'not an element of' + ], + [ + 8715, + 'contains as member' + ], + [ + 8719, + 'n-ary product' + ], + [ + 8743, + 'logical and' + ], + [ + 8744, + 'logical or' + ], + [ + 172, + 'not sign' + ], + [ + 8745, + 'intersection' + ], + [ + 8746, + 'union' + ], + [ + 8706, + 'partial differential' + ], + [ + 8704, + 'for all' + ], + [ + 8707, + 'there exists' + ], + [ + 8709, + 'diameter' + ], + [ + 8711, + 'backward difference' + ], + [ + 8727, + 'asterisk operator' + ], + [ + 8733, + 'proportional to' + ], + [ + 8736, + 'angle' + ] + ] + }, + { + name: 'Extended Latin', + characters: [ + [ + 192, + 'A - grave' + ], + [ + 193, + 'A - acute' + ], + [ + 194, + 'A - circumflex' + ], + [ + 195, + 'A - tilde' + ], + [ + 196, + 'A - diaeresis' + ], + [ + 197, + 'A - ring above' + ], + [ + 256, + 'A - macron' + ], + [ + 198, + 'ligature AE' + ], + [ + 199, + 'C - cedilla' + ], + [ + 200, + 'E - grave' + ], + [ + 201, + 'E - acute' + ], + [ + 202, + 'E - circumflex' + ], + [ + 203, + 'E - diaeresis' + ], + [ + 274, + 'E - macron' + ], + [ + 204, + 'I - grave' + ], + [ + 205, + 'I - acute' + ], + [ + 206, + 'I - circumflex' + ], + [ + 207, + 'I - diaeresis' + ], + [ + 298, + 'I - macron' + ], + [ + 208, + 'ETH' + ], + [ + 209, + 'N - tilde' + ], + [ + 210, + 'O - grave' + ], + [ + 211, + 'O - acute' + ], + [ + 212, + 'O - circumflex' + ], + [ + 213, + 'O - tilde' + ], + [ + 214, + 'O - diaeresis' + ], + [ + 216, + 'O - slash' + ], + [ + 332, + 'O - macron' + ], + [ + 338, + 'ligature OE' + ], + [ + 352, + 'S - caron' + ], + [ + 217, + 'U - grave' + ], + [ + 218, + 'U - acute' + ], + [ + 219, + 'U - circumflex' + ], + [ + 220, + 'U - diaeresis' + ], + [ + 362, + 'U - macron' + ], + [ + 221, + 'Y - acute' + ], + [ + 376, + 'Y - diaeresis' + ], + [ + 562, + 'Y - macron' + ], + [ + 222, + 'THORN' + ], + [ + 224, + 'a - grave' + ], + [ + 225, + 'a - acute' + ], + [ + 226, + 'a - circumflex' + ], + [ + 227, + 'a - tilde' + ], + [ + 228, + 'a - diaeresis' + ], + [ + 229, + 'a - ring above' + ], + [ + 257, + 'a - macron' + ], + [ + 230, + 'ligature ae' + ], + [ + 231, + 'c - cedilla' + ], + [ + 232, + 'e - grave' + ], + [ + 233, + 'e - acute' + ], + [ + 234, + 'e - circumflex' + ], + [ + 235, + 'e - diaeresis' + ], + [ + 275, + 'e - macron' + ], + [ + 236, + 'i - grave' + ], + [ + 237, + 'i - acute' + ], + [ + 238, + 'i - circumflex' + ], + [ + 239, + 'i - diaeresis' + ], + [ + 299, + 'i - macron' + ], + [ + 240, + 'eth' + ], + [ + 241, + 'n - tilde' + ], + [ + 242, + 'o - grave' + ], + [ + 243, + 'o - acute' + ], + [ + 244, + 'o - circumflex' + ], + [ + 245, + 'o - tilde' + ], + [ + 246, + 'o - diaeresis' + ], + [ + 248, + 'o slash' + ], + [ + 333, + 'o macron' + ], + [ + 339, + 'ligature oe' + ], + [ + 353, + 's - caron' + ], + [ + 249, + 'u - grave' + ], + [ + 250, + 'u - acute' + ], + [ + 251, + 'u - circumflex' + ], + [ + 252, + 'u - diaeresis' + ], + [ + 363, + 'u - macron' + ], + [ + 253, + 'y - acute' + ], + [ + 254, + 'thorn' + ], + [ + 255, + 'y - diaeresis' + ], + [ + 563, + 'y - macron' + ], + [ + 913, + 'Alpha' + ], + [ + 914, + 'Beta' + ], + [ + 915, + 'Gamma' + ], + [ + 916, + 'Delta' + ], + [ + 917, + 'Epsilon' + ], + [ + 918, + 'Zeta' + ], + [ + 919, + 'Eta' + ], + [ + 920, + 'Theta' + ], + [ + 921, + 'Iota' + ], + [ + 922, + 'Kappa' + ], + [ + 923, + 'Lambda' + ], + [ + 924, + 'Mu' + ], + [ + 925, + 'Nu' + ], + [ + 926, + 'Xi' + ], + [ + 927, + 'Omicron' + ], + [ + 928, + 'Pi' + ], + [ + 929, + 'Rho' + ], + [ + 931, + 'Sigma' + ], + [ + 932, + 'Tau' + ], + [ + 933, + 'Upsilon' + ], + [ + 934, + 'Phi' + ], + [ + 935, + 'Chi' + ], + [ + 936, + 'Psi' + ], + [ + 937, + 'Omega' + ], + [ + 945, + 'alpha' + ], + [ + 946, + 'beta' + ], + [ + 947, + 'gamma' + ], + [ + 948, + 'delta' + ], + [ + 949, + 'epsilon' + ], + [ + 950, + 'zeta' + ], + [ + 951, + 'eta' + ], + [ + 952, + 'theta' + ], + [ + 953, + 'iota' + ], + [ + 954, + 'kappa' + ], + [ + 955, + 'lambda' + ], + [ + 956, + 'mu' + ], + [ + 957, + 'nu' + ], + [ + 958, + 'xi' + ], + [ + 959, + 'omicron' + ], + [ + 960, + 'pi' + ], + [ + 961, + 'rho' + ], + [ + 962, + 'final sigma' + ], + [ + 963, + 'sigma' + ], + [ + 964, + 'tau' + ], + [ + 965, + 'upsilon' + ], + [ + 966, + 'phi' + ], + [ + 967, + 'chi' + ], + [ + 968, + 'psi' + ], + [ + 969, + 'omega' + ] + ] + }, + { + name: 'Symbols', + characters: [ + [ + 8501, + 'alef symbol' + ], + [ + 982, + 'pi symbol' + ], + [ + 8476, + 'real part symbol' + ], + [ + 978, + 'upsilon - hook symbol' + ], + [ + 8472, + 'Weierstrass p' + ], + [ + 8465, + 'imaginary part' + ] + ] + }, + { + name: 'Arrows', + characters: [ + [ + 8592, + 'leftwards arrow' + ], + [ + 8593, + 'upwards arrow' + ], + [ + 8594, + 'rightwards arrow' + ], + [ + 8595, + 'downwards arrow' + ], + [ + 8596, + 'left right arrow' + ], + [ + 8629, + 'carriage return' + ], + [ + 8656, + 'leftwards double arrow' + ], + [ + 8657, + 'upwards double arrow' + ], + [ + 8658, + 'rightwards double arrow' + ], + [ + 8659, + 'downwards double arrow' + ], + [ + 8660, + 'left right double arrow' + ], + [ + 8756, + 'therefore' + ], + [ + 8834, + 'subset of' + ], + [ + 8835, + 'superset of' + ], + [ + 8836, + 'not a subset of' + ], + [ + 8838, + 'subset of or equal to' + ], + [ + 8839, + 'superset of or equal to' + ], + [ + 8853, + 'circled plus' + ], + [ + 8855, + 'circled times' + ], + [ + 8869, + 'perpendicular' + ], + [ + 8901, + 'dot operator' + ], + [ + 8968, + 'left ceiling' + ], + [ + 8969, + 'right ceiling' + ], + [ + 8970, + 'left floor' + ], + [ + 8971, + 'right floor' + ], + [ + 9001, + 'left-pointing angle bracket' + ], + [ + 9002, + 'right-pointing angle bracket' + ], + [ + 9674, + 'lozenge' + ], + [ + 9824, + 'black spade suit' + ], + [ + 9827, + 'black club suit' + ], + [ + 9829, + 'black heart suit' + ], + [ + 9830, + 'black diamond suit' + ], + [ + 8194, + 'en space' + ], + [ + 8195, + 'em space' + ], + [ + 8201, + 'thin space' + ], + [ + 8204, + 'zero width non-joiner' + ], + [ + 8205, + 'zero width joiner' + ], + [ + 8206, + 'left-to-right mark' + ], + [ + 8207, + 'right-to-left mark' + ] + ] + } + ]; + }; + var charmapFilter = function (charmap) { + return global$1.grep(charmap, function (item) { + return isArray$1(item) && item.length === 2; + }); + }; + var getCharsFromSetting = function (settingValue) { + if (isArray$1(settingValue)) { + return [].concat(charmapFilter(settingValue)); + } + if (typeof settingValue === 'function') { + return settingValue(); + } + return []; + }; + var extendCharMap = function (editor, charmap) { + var userCharMap = getCharMap(editor); + if (userCharMap) { + charmap = [{ + name: UserDefined, + characters: getCharsFromSetting(userCharMap) + }]; + } + var userCharMapAppend = getCharMapAppend(editor); + if (userCharMapAppend) { + var userDefinedGroup = global$1.grep(charmap, function (cg) { + return cg.name === UserDefined; + }); + if (userDefinedGroup.length) { + userDefinedGroup[0].characters = [].concat(userDefinedGroup[0].characters).concat(getCharsFromSetting(userCharMapAppend)); + return charmap; + } + return [].concat(charmap).concat({ + name: UserDefined, + characters: getCharsFromSetting(userCharMapAppend) + }); + } + return charmap; + }; + var getCharMap$1 = function (editor) { + var groups = extendCharMap(editor, getDefaultCharMap()); + return groups.length > 1 ? [{ + name: 'All', + characters: bind(groups, function (g) { + return g.characters; + }) + }].concat(groups) : groups; + }; - elm = elm.parentNode; - } - } + var get = function (editor) { + var getCharMap = function () { + return getCharMap$1(editor); + }; + var insertChar$1 = function (chr) { + insertChar(editor, chr); + }; + return { + getCharMap: getCharMap, + insertChar: insertChar$1 + }; + }; - gridHtml = ''; + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; + }; - var width = 25; - for (y = 0; y < 10; y++) { - gridHtml += ''; + var last = function (fn, rate) { + var timer = null; + var cancel = function () { + if (timer !== null) { + clearTimeout(timer); + timer = null; + } + }; + var throttle = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (timer !== null) { + clearTimeout(timer); + } + timer = setTimeout(function () { + fn.apply(null, args); + timer = null; + }, rate); + }; + return { + cancel: cancel, + throttle: throttle + }; + }; - for (x = 0; x < width; x++) { - var chr = charmap[y * width + x]; + var nativeFromCodePoint = String.fromCodePoint; + var contains = function (str, substr) { + return str.indexOf(substr) !== -1; + }; + var fromCodePoint = function () { + var codePoints = []; + for (var _i = 0; _i < arguments.length; _i++) { + codePoints[_i] = arguments[_i]; + } + if (nativeFromCodePoint) { + return nativeFromCodePoint.apply(void 0, codePoints); + } else { + var codeUnits = []; + var codeLen = 0; + var result = ''; + for (var index = 0, len = codePoints.length; index !== len; ++index) { + var codePoint = +codePoints[index]; + if (!(codePoint < 1114111 && codePoint >>> 0 === codePoint)) { + throw RangeError('Invalid code point: ' + codePoint); + } + if (codePoint <= 65535) { + codeLen = codeUnits.push(codePoint); + } else { + codePoint -= 65536; + codeLen = codeUnits.push((codePoint >> 10) + 55296, codePoint % 1024 + 56320); + } + if (codeLen >= 16383) { + result += String.fromCharCode.apply(null, codeUnits); + codeUnits.length = 0; + } + } + return result + String.fromCharCode.apply(null, codeUnits); + } + }; - gridHtml += ''; - } + var charMatches = function (charCode, name, lowerCasePattern) { + if (contains(fromCodePoint(charCode).toLowerCase(), lowerCasePattern)) { + return true; + } else { + return contains(name.toLowerCase(), lowerCasePattern) || contains(name.toLowerCase().replace(/\s+/g, ''), lowerCasePattern); + } + }; + var scan = function (group, pattern) { + var matches = []; + var lowerCasePattern = pattern.toLowerCase(); + each(group.characters, function (g) { + if (charMatches(g[0], g[1], lowerCasePattern)) { + matches.push(g); + } + }); + return map(matches, function (m) { + return { + text: m[1], + value: fromCodePoint(m[0]), + icon: fromCodePoint(m[0]) + }; + }); + }; - gridHtml += ''; - } + var patternName = 'pattern'; + var open = function (editor, charMap) { + var makeGroupItems = function () { + return [ + { + label: 'Search', + type: 'input', + name: patternName + }, + { + type: 'collection', + name: 'results' + } + ]; + }; + var makeTabs = function () { + return map(charMap, function (charGroup) { + return { + title: charGroup.name, + name: charGroup.name, + items: makeGroupItems() + }; + }); + }; + var makePanel = function () { + return { + type: 'panel', + items: makeGroupItems() + }; + }; + var makeTabPanel = function () { + return { + type: 'tabpanel', + tabs: makeTabs() + }; + }; + var currentTab = charMap.length === 1 ? Cell(UserDefined) : Cell('All'); + var scanAndSet = function (dialogApi, pattern) { + find(charMap, function (group) { + return group.name === currentTab.get(); + }).each(function (f) { + var items = scan(f, pattern); + dialogApi.setData({ results: items }); + }); + }; + var SEARCH_DELAY = 40; + var updateFilter = last(function (dialogApi) { + var pattern = dialogApi.getData().pattern; + scanAndSet(dialogApi, pattern); + }, SEARCH_DELAY); + var body = charMap.length === 1 ? makePanel() : makeTabPanel(); + var initialData = { + pattern: '', + results: scan(charMap[0], '') + }; + var bridgeSpec = { + title: 'Special Character', + size: 'normal', + body: body, + buttons: [{ + type: 'cancel', + name: 'close', + text: 'Close', + primary: true + }], + initialData: initialData, + onAction: function (api, details) { + if (details.name === 'results') { + insertChar(editor, details.value); + api.close(); + } + }, + onTabChange: function (dialogApi, details) { + currentTab.set(details.newTabName); + updateFilter.throttle(dialogApi); + }, + onChange: function (dialogApi, changeData) { + if (changeData.name === patternName) { + updateFilter.throttle(dialogApi); + } + } + }; + var dialogApi = editor.windowManager.open(bridgeSpec); + dialogApi.focus(patternName); + }; - gridHtml += ''; + var register = function (editor, charMap) { + editor.addCommand('mceShowCharmap', function () { + open(editor, charMap); + }); + }; - var charMapPanel = { - type: 'container', - html: gridHtml, - onclick: function(e) { - var target = e.target; - if (/^(TD|DIV)$/.test(target.nodeName)) { - editor.execCommand('mceInsertContent', false, tinymce.trim(target.innerText || target.textContent)); + var global$2 = tinymce.util.Tools.resolve('tinymce.util.Promise'); - if (!e.ctrlKey) { - win.close(); - } - } - }, - onmouseover: function(e) { - var td = getParentTd(e.target); + var init = function (editor, all) { + editor.ui.registry.addAutocompleter('charmap', { + ch: ':', + columns: 'auto', + minChars: 2, + fetch: function (pattern, _maxResults) { + return new global$2(function (resolve, _reject) { + resolve(scan(all, pattern)); + }); + }, + onAction: function (autocompleteApi, rng, value) { + editor.selection.setRng(rng); + editor.insertContent(value); + autocompleteApi.hide(); + } + }); + }; - if (td) { - win.find('#preview').text(td.firstChild.firstChild.data); - } - } - }; + var register$1 = function (editor) { + editor.ui.registry.addButton('charmap', { + icon: 'insert-character', + tooltip: 'Special character', + onAction: function () { + return editor.execCommand('mceShowCharmap'); + } + }); + editor.ui.registry.addMenuItem('charmap', { + icon: 'insert-character', + text: 'Special character...', + onAction: function () { + return editor.execCommand('mceShowCharmap'); + } + }); + }; - win = editor.windowManager.open({ - title: "Special character", - spacing: 10, - padding: 10, - items: [ - charMapPanel, - { - type: 'label', - name: 'preview', - text: ' ', - style: 'font-size: 40px; text-align: center', - border: 1, - minWidth: 100, - minHeight: 80 - } - ], - buttons: [ - {text: "Close", onclick: function() { - win.close(); - }} - ] - }); - } + function Plugin () { + global.add('charmap', function (editor) { + var charMap = getCharMap$1(editor); + register(editor, charMap); + register$1(editor); + init(editor, charMap[0]); + return get(editor); + }); + } - editor.addButton('charmap', { - icon: 'charmap', - tooltip: 'Special character', - onclick: showDialog - }); + Plugin(); - editor.addMenuItem('charmap', { - icon: 'charmap', - text: 'Special character', - onclick: showDialog, - context: 'insert' - }); -}); \ No newline at end of file +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/charmap/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/charmap/plugin.min.js index 69d189143ada..05c0f3d79f38 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/charmap/plugin.min.js +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/charmap/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("charmap",function(e){function a(){function a(e){for(;e;){if("TD"==e.nodeName)return e;e=e.parentNode}}var i,r,o,n;i='';var l=25;for(o=0;o<10;o++){for(i+="",r=0;r
    '+(s?String.fromCharCode(parseInt(s[0],10)):" ")+"
    "}i+="
    "}i+="";var c={type:"container",html:i,onclick:function(a){var t=a.target;/^(TD|DIV)$/.test(t.nodeName)&&(e.execCommand("mceInsertContent",!1,tinymce.trim(t.innerText||t.textContent)),a.ctrlKey||n.close())},onmouseover:function(e){var t=a(e.target);t&&n.find("#preview").text(t.firstChild.firstChild.data)}};n=e.windowManager.open({title:"Special character",spacing:10,padding:10,items:[c,{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:100,minHeight:80}],buttons:[{text:"Close",onclick:function(){n.close()}}]})}var t=[["160","no-break space"],["38","ampersand"],["34","quotation mark"],["162","cent sign"],["8364","euro sign"],["163","pound sign"],["165","yen sign"],["169","copyright sign"],["174","registered sign"],["8482","trade mark sign"],["8240","per mille sign"],["181","micro sign"],["183","middle dot"],["8226","bullet"],["8230","three dot leader"],["8242","minutes / feet"],["8243","seconds / inches"],["167","section sign"],["182","paragraph sign"],["223","sharp s / ess-zed"],["8249","single left-pointing angle quotation mark"],["8250","single right-pointing angle quotation mark"],["171","left pointing guillemet"],["187","right pointing guillemet"],["8216","left single quotation mark"],["8217","right single quotation mark"],["8220","left double quotation mark"],["8221","right double quotation mark"],["8218","single low-9 quotation mark"],["8222","double low-9 quotation mark"],["60","less-than sign"],["62","greater-than sign"],["8804","less-than or equal to"],["8805","greater-than or equal to"],["8211","en dash"],["8212","em dash"],["175","macron"],["8254","overline"],["164","currency sign"],["166","broken bar"],["168","diaeresis"],["161","inverted exclamation mark"],["191","turned question mark"],["710","circumflex accent"],["732","small tilde"],["176","degree sign"],["8722","minus sign"],["177","plus-minus sign"],["247","division sign"],["8260","fraction slash"],["215","multiplication sign"],["185","superscript one"],["178","superscript two"],["179","superscript three"],["188","fraction one quarter"],["189","fraction one half"],["190","fraction three quarters"],["402","function / florin"],["8747","integral"],["8721","n-ary sumation"],["8734","infinity"],["8730","square root"],["8764","similar to"],["8773","approximately equal to"],["8776","almost equal to"],["8800","not equal to"],["8801","identical to"],["8712","element of"],["8713","not an element of"],["8715","contains as member"],["8719","n-ary product"],["8743","logical and"],["8744","logical or"],["172","not sign"],["8745","intersection"],["8746","union"],["8706","partial differential"],["8704","for all"],["8707","there exists"],["8709","diameter"],["8711","backward difference"],["8727","asterisk operator"],["8733","proportional to"],["8736","angle"],["180","acute accent"],["184","cedilla"],["170","feminine ordinal indicator"],["186","masculine ordinal indicator"],["8224","dagger"],["8225","double dagger"],["192","A - grave"],["193","A - acute"],["194","A - circumflex"],["195","A - tilde"],["196","A - diaeresis"],["197","A - ring above"],["198","ligature AE"],["199","C - cedilla"],["200","E - grave"],["201","E - acute"],["202","E - circumflex"],["203","E - diaeresis"],["204","I - grave"],["205","I - acute"],["206","I - circumflex"],["207","I - diaeresis"],["208","ETH"],["209","N - tilde"],["210","O - grave"],["211","O - acute"],["212","O - circumflex"],["213","O - tilde"],["214","O - diaeresis"],["216","O - slash"],["338","ligature OE"],["352","S - caron"],["217","U - grave"],["218","U - acute"],["219","U - circumflex"],["220","U - diaeresis"],["221","Y - acute"],["376","Y - diaeresis"],["222","THORN"],["224","a - grave"],["225","a - acute"],["226","a - circumflex"],["227","a - tilde"],["228","a - diaeresis"],["229","a - ring above"],["230","ligature ae"],["231","c - cedilla"],["232","e - grave"],["233","e - acute"],["234","e - circumflex"],["235","e - diaeresis"],["236","i - grave"],["237","i - acute"],["238","i - circumflex"],["239","i - diaeresis"],["240","eth"],["241","n - tilde"],["242","o - grave"],["243","o - acute"],["244","o - circumflex"],["245","o - tilde"],["246","o - diaeresis"],["248","o slash"],["339","ligature oe"],["353","s - caron"],["249","u - grave"],["250","u - acute"],["251","u - circumflex"],["252","u - diaeresis"],["253","y - acute"],["254","thorn"],["255","y - diaeresis"],["913","Alpha"],["914","Beta"],["915","Gamma"],["916","Delta"],["917","Epsilon"],["918","Zeta"],["919","Eta"],["920","Theta"],["921","Iota"],["922","Kappa"],["923","Lambda"],["924","Mu"],["925","Nu"],["926","Xi"],["927","Omicron"],["928","Pi"],["929","Rho"],["931","Sigma"],["932","Tau"],["933","Upsilon"],["934","Phi"],["935","Chi"],["936","Psi"],["937","Omega"],["945","alpha"],["946","beta"],["947","gamma"],["948","delta"],["949","epsilon"],["950","zeta"],["951","eta"],["952","theta"],["953","iota"],["954","kappa"],["955","lambda"],["956","mu"],["957","nu"],["958","xi"],["959","omicron"],["960","pi"],["961","rho"],["962","final sigma"],["963","sigma"],["964","tau"],["965","upsilon"],["966","phi"],["967","chi"],["968","psi"],["969","omega"],["8501","alef symbol"],["982","pi symbol"],["8476","real part symbol"],["978","upsilon - hook symbol"],["8472","Weierstrass p"],["8465","imaginary part"],["8592","leftwards arrow"],["8593","upwards arrow"],["8594","rightwards arrow"],["8595","downwards arrow"],["8596","left right arrow"],["8629","carriage return"],["8656","leftwards double arrow"],["8657","upwards double arrow"],["8658","rightwards double arrow"],["8659","downwards double arrow"],["8660","left right double arrow"],["8756","therefore"],["8834","subset of"],["8835","superset of"],["8836","not a subset of"],["8838","subset of or equal to"],["8839","superset of or equal to"],["8853","circled plus"],["8855","circled times"],["8869","perpendicular"],["8901","dot operator"],["8968","left ceiling"],["8969","right ceiling"],["8970","left floor"],["8971","right floor"],["9001","left-pointing angle bracket"],["9002","right-pointing angle bracket"],["9674","lozenge"],["9824","black spade suit"],["9827","black club suit"],["9829","black heart suit"],["9830","black diamond suit"],["8194","en space"],["8195","em space"],["8201","thin space"],["8204","zero width non-joiner"],["8205","zero width joiner"],["8206","left-to-right mark"],["8207","right-to-left mark"],["173","soft hyphen"]];e.addButton("charmap",{icon:"charmap",tooltip:"Special character",onclick:a}),e.addMenuItem("charmap",{icon:"charmap",text:"Special character",onclick:a,context:"insert"})}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var e,n,r,t,a=tinymce.util.Tools.resolve("tinymce.PluginManager"),s=function(e,n){var r,t=(r=n,e.fire("insertCustomChar",{chr:r}).chr);e.execCommand("mceInsertContent",!1,t)},i=function(e){return function(){return e}},o=i(!1),c=i(!0),u=function(){return l},l=(e=function(e){return e.isNone()},{fold:function(e,n){return e()},is:o,isSome:o,isNone:c,getOr:r=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:r,orThunk:n,map:u,each:function(){},bind:u,exists:o,forall:c,filter:u,equals:e,equals_:e,toArray:function(){return[]},toString:i("none()")}),g=function(r){var e=i(r),n=function(){return a},t=function(e){return e(r)},a={fold:function(e,n){return n(r)},is:function(e){return r===e},isSome:c,isNone:o,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return g(e(r))},each:function(e){e(r)},bind:t,exists:t,forall:t,filter:function(e){return e(r)?a:l},toArray:function(){return[r]},toString:function(){return"some("+r+")"},equals:function(e){return e.is(r)},equals_:function(e,n){return e.fold(o,function(e){return n(r,e)})}};return a},m={some:g,none:u,from:function(e){return null===e||e===undefined?l:g(e)}},f=(t="array",function(e){return r=typeof(n=e),(null===n?"null":"object"==r&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":r)===t;var n,r}),h=Array.prototype.push,p=function(e,n){for(var r=e.length,t=new Array(r),a=0;a>>0===o))throw RangeError("Invalid code point: "+o);16383<=(o<=65535?r.push(o):(o-=65536,r.push(55296+(o>>10),o%1024+56320)))&&(t+=String.fromCharCode.apply(null,r),r.length=0)}return t+String.fromCharCode.apply(null,r)},S=function(e,n){var a=[],i=n.toLowerCase();return function(e,n){for(var r=0,t=e.length;r. - -Version 1.1 - 2013-07-19 -- New options jsFiles and cssFiles. - -Version 1.0 - 2013-06-29 -- Initial release. diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/cs_CZ.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/cs_CZ.js new file mode 100644 index 000000000000..0b7c42576e2b --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/cs_CZ.js @@ -0,0 +1,8 @@ +tinymce.addI18n('cs_CZ',{ + 'HTML source code': 'Zdrojový HTML kód', + 'Start search': 'Hledat', + 'Find next': 'Najít další', + 'Find previous': 'Najít předchozí', + 'Replace': 'Nahradit', + 'Replace all': 'Nahradit vše' +}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/de.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/de.js new file mode 100644 index 000000000000..4763bbcbb56c --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/de.js @@ -0,0 +1,8 @@ +tinymce.addI18n('de',{ + 'HTML source code': 'HTML-Quellcode', + 'Start search': 'Suchen', + 'Find next': 'Suche nächstes', + 'Find previous': 'Suche vorheriges', + 'Replace': 'Ersetzen', + 'Replace all': 'Alles ersetzen' +}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/es_ES.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/es_ES.js new file mode 100644 index 000000000000..1b2740dca953 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/es_ES.js @@ -0,0 +1,8 @@ +tinymce.addI18n('es_ES',{ + 'HTML source code': 'Código fuente HTML', + 'Start search': 'Buscar', + 'Find next': 'Siguiente', + 'Find previous': 'Anterior', + 'Replace': 'Reemplazar', + 'Replace all': 'Reemplazar todo' +}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/fr_FR.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/fr_FR.js new file mode 100644 index 000000000000..f2e464428c79 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/fr_FR.js @@ -0,0 +1,8 @@ +tinymce.addI18n('fr_FR',{ + 'HTML source code': 'Code source HTML', + 'Start search': 'Rechercher', + 'Find next': 'Chercher suiv.', + 'Find previous': 'Chercher préc.', + 'Replace': 'Replace', + 'Replace all': 'Replace all' +}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/pt_BR.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/pt_BR.js new file mode 100644 index 000000000000..613b21ea11e8 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/pt_BR.js @@ -0,0 +1,8 @@ +tinymce.addI18n('pt_BR',{ + 'HTML source code': 'Código Fonte HTML', + 'Start search': 'Iniciar Pesquisa', + 'Find next': 'Encontrar Próximo', + 'Find previous': 'Encontrar Anterior', + 'Replace': 'Substituir', + 'Replace all': 'Substituir all' +}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/pt_PT.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/pt_PT.js new file mode 100644 index 000000000000..6e4b54be08d3 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/pt_PT.js @@ -0,0 +1,8 @@ +tinymce.addI18n('pt_PT',{ + 'HTML source code': 'Código Fonte HTML', + 'Start search': 'Iniciar Pesquisa', + 'Find next': 'Encontrar Próximo', + 'Find previous': 'Encontrar Anterior', + 'Replace': 'Substituir', + 'Replace all': 'Substituir all' +}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/ru.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/ru.js new file mode 100644 index 000000000000..01ee0c4f5896 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/ru.js @@ -0,0 +1,8 @@ +tinymce.addI18n('ru',{ + 'HTML source code': '\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 HTML \u043a\u043e\u0434', + 'Start search': '\u041d\u0430\u0447\u0430\u0442\u044c \u043f\u043e\u0438\u0441\u043a', + 'Find next': '\u041d\u0430\u0439\u0442\u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439', + 'Find previous': '\u041d\u0430\u0439\u0442\u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439', + 'Replace': '\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c', + 'Replace all': '\u0417\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0432\u0441\u0435' +}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/uk.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/uk.js new file mode 100755 index 000000000000..59918fe44845 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/uk.js @@ -0,0 +1,8 @@ +tinymce.addI18n('uk',{ + 'HTML source code': 'Вихідний код HTML', + 'Start search': 'Пошук', + 'Find next': 'Знайти наступне', + 'Find previous': 'Знайти попереднє', + 'Replace': 'Замінити', + 'Replace all': 'Замінити все' +}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/zh_TW.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/zh_TW.js new file mode 100644 index 000000000000..8647164c3e5b --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/langs/zh_TW.js @@ -0,0 +1,8 @@ +tinymce.addI18n('zh_TW',{ + 'HTML source code': 'HTML原始碼', + 'Start search': '開始搜尋', + 'Find next': '搜尋下一個.', + 'Find previous': '搜尋上一個.', + 'Replace': '取代', + 'Replace all': '全部取代' +}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/plugin.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/plugin.js index c6d8fc7ad459..65f9991d2700 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/plugin.js +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/plugin.js @@ -5,142 +5,121 @@ * @author Arjan Haverkamp */ -/*jshint unused:false */ -/*global tinymce:true */ +/* jshint unused:false */ +/* global tinymce:true */ -tinymce.PluginManager.requireLangPack('codemirror'); +tinymce.PluginManager.requireLangPack('codemirror') tinymce.PluginManager.add('codemirror', function(editor, url) { + function showSourceEditor() { + editor.focus() + editor.selection.collapse(true) - function showSourceEditor() { - // Insert caret marker - editor.focus(); - editor.selection.collapse(true); - editor.selection.setContent(''); - - // Determine the origin of the window that will host the code editor. - // If tinyMCE's baseURL is relative, then static files are hosted in the - // same origin as the containing page. If it is not relative, then we know that - // the origin of the iframe hosting the code editor will match the origin - // of tinyMCE's baseURL, as they are both hosted on the CDN. - var codeEditorOrigin; - var index = tinyMCE.baseURL.indexOf("/static/"); - if (index > 0) { - codeEditorOrigin = tinyMCE.baseURL.substring(0, index); - } - else { - codeEditorOrigin = window.location.origin; + // Insert caret marker + if (editor.settings.codemirror.saveCursorPosition) { + editor.selection.setContent('') } - // Send the path location for CodeMirror and the parent origin to use in postMessage. - var sourceHtmlParams = "?CodeMirrorPath=" + editor.settings.codemirror.path + - "&ParentOrigin=" + window.location.origin; - - // Open editor window - var win = editor.windowManager.open({ - title: 'HTML source code', - url: url + '/source.html' + sourceHtmlParams, - width: 800, - height: 550, - resizable: true, - maximizable: true, - buttons: [ - { text: 'OK', subtype: 'primary', onclick: function () { - postToCodeEditor({type: "save"}); - }}, - { text: 'Cancel', onclick: function () { - postToCodeEditor({type: "cancel"}); - }} - ] - - }); - - // The master version of TinyMCE has a win.getContentWindow() method. This is its implementation. - var codeWindow = win.getEl().getElementsByTagName('iframe')[0].contentWindow; - - var postToCodeEditor = function (data) { - codeWindow.postMessage(data, codeEditorOrigin); - }; - - var messageListener = function (event) { - // Check that the message came from the code editor. - if (codeEditorOrigin !== event.origin) { - return; - } + var codemirrorWidth = 800 + if (editor.settings.codemirror.width) { + codemirrorWidth = editor.settings.codemirror.width + } - var source; - if (event.data.type === "init") { - source = {content: editor.getContent({source_view: true})}; - // Post an event to allow rewriting of static links on the content. - editor.fire("ShowCodeEditor", source); + var codemirrorHeight = 550 + if (editor.settings.codemirror.height) { + codemirrorHeight = editor.settings.codemirror.height + } - postToCodeEditor( - { - type: "init", - content: source.content + var buttonsConfig = (tinymce.majorVersion < 5) + ? [ + { + text: 'Ok', + subtype: 'primary', + onclick: function() { + var doc = document.querySelectorAll('.mce-container-body>iframe')[0] + doc.contentWindow.submit() + win.close() } - ); - editor.dom.remove(editor.dom.select('.CmCaReT')); - } - else if (event.data.type === "setText") { - source = {content: event.data.text}; - var isDirty = event.data.isDirty; - - // Post an event to allow rewriting of static links on the content. - editor.fire('SaveCodeEditor', source); - - editor.setContent(source.content); - - // Set cursor: - var el = editor.dom.select('span#CmCaReT')[0]; - if (el) { - editor.selection.scrollIntoView(el); - editor.selection.setCursorLocation(el,0); - editor.dom.remove(el); + }, + { + text: 'Cancel', + onclick: 'close' } - // EDX: added because CmCaReT span was getting left in when caret was within a style tag. - // Make sure to strip it out (and accept that caret will not be in the correct place). - else { - var content = editor.getContent(); - var strippedContent = content.replace('', ''); - if (content !== strippedContent) { - editor.setContent(strippedContent); - } + ] + : [ + { + type: 'custom', + text: 'Ok', + name: 'codemirrorOk', + primary: true + }, + { + type: 'cancel', + text: 'Cancel', + name: 'codemirrorCancel' } + ] - // EDX: moved block of code from original location since we may change content in bug fix code above. - editor.isNotDirty = !isDirty; - if (isDirty) { - editor.nodeChanged(); + var config = { + title: 'HTML source code', + url: url + '/source.html', + width: codemirrorWidth, + height: codemirrorHeight, + resizable: true, + maximizable: true, + fullScreen: editor.settings.codemirror.fullscreen, + saveCursorPosition: false, + buttons: buttonsConfig + } + + if (tinymce.majorVersion >= 5) { + config.onAction = function (dialogApi, actionData) { + if (actionData.name === 'codemirrorOk') { + var doc = document.querySelectorAll('.tox-dialog__body-iframe iframe')[0] + doc.contentWindow.submit() + editor.undoManager.add() + win.close() } } - else if (event.data.type === "closeWindow") { - win.close(); - } - }; - - win.on("close", function() { - window.removeEventListener("message", messageListener); - }); - - window.addEventListener("message", messageListener, false); - - } + } - // Add a button to the button bar - // EDX changed to show "HTML" on toolbar button - editor.addButton('code', { - title: 'Edit HTML', - text: 'HTML', - icon: false, - onclick: showSourceEditor - }); + var win = (tinymce.majorVersion < 5) + ? editor.windowManager.open(config) + : editor.windowManager.openUrl(config) - // Add a menu item to the tools menu - editor.addMenuItem('code', { - icon: 'code', - text: 'Edit HTML', - context: 'tools', - onclick: showSourceEditor - }); -}); + if (editor.settings.codemirror.fullscreen) { + win.fullscreen(true) + } + } + + if (tinymce.majorVersion < 5) { + // Add a button to the button bar + editor.addButton('code', { + title: 'Source code', + icon: 'code', + onclick: showSourceEditor + }) + + // Add a menu item to the tools menu + editor.addMenuItem('code', { + icon: 'code', + text: 'Source code', + context: 'tools', + onclick: showSourceEditor + }) + } else { + // EDX changed to show "HTML" on toolbar button + editor.ui.registry.addButton('code', { + text: 'HTML', + tooltip: 'Edit HTML', + onAction: showSourceEditor + }) + + editor.ui.registry.addMenuItem('code', { + icon: 'sourcecode', + text: 'Edit HTML', + onAction: showSourceEditor, + context: 'tools' + }) + } +}) diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/plugin.min.js index 05db12ebdc72..94c41ef0f5b7 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/plugin.min.js +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/plugin.min.js @@ -1 +1 @@ -tinymce.PluginManager.requireLangPack("codemirror"),tinymce.PluginManager.add("codemirror",function(e,t){function n(){e.focus(),e.selection.collapse(!0),e.selection.setContent('');var n,o=tinyMCE.baseURL.indexOf("/static/");n=o>0?tinyMCE.baseURL.substring(0,o):window.location.origin;var i="?CodeMirrorPath="+e.settings.codemirror.path+"&ParentOrigin="+window.location.origin,a=e.windowManager.open({title:"HTML source code",url:t+"/source.html"+i,width:800,height:550,resizable:!0,maximizable:!0,buttons:[{text:"OK",subtype:"primary",onclick:function(){s({type:"save"})}},{text:"Cancel",onclick:function(){s({type:"cancel"})}}]}),c=a.getEl().getElementsByTagName("iframe")[0].contentWindow,s=function(e){c.postMessage(e,n)},r=function(t){if(n===t.origin){var o;if("init"===t.data.type)o={content:e.getContent({source_view:!0})},e.fire("ShowCodeEditor",o),s({type:"init",content:o.content}),e.dom.remove(e.dom.select(".CmCaReT"));else if("setText"===t.data.type){o={content:t.data.text};var i=t.data.isDirty;e.fire("SaveCodeEditor",o),e.setContent(o.content);var c=e.dom.select("span#CmCaReT")[0];if(c)e.selection.scrollIntoView(c),e.selection.setCursorLocation(c,0),e.dom.remove(c);else{var r=e.getContent(),d=r.replace('',"");r!==d&&e.setContent(d)}e.isNotDirty=!i,i&&e.nodeChanged()}else"closeWindow"===t.data.type&&a.close()}};a.on("close",function(){window.removeEventListener("message",r)}),window.addEventListener("message",r,!1)}e.addButton("code",{title:"Edit HTML",text:"HTML",icon:!1,onclick:n}),e.addMenuItem("code",{icon:"code",text:"Edit HTML",context:"tools",onclick:n})}); \ No newline at end of file +tinymce.PluginManager.requireLangPack("codemirror");tinymce.PluginManager.add("codemirror",function(e,o){function t(){e.focus();e.selection.collapse(true);if(e.settings.codemirror.saveCursorPosition){e.selection.setContent('')}var t=800;if(e.settings.codemirror.width){t=e.settings.codemirror.width}var r=550;if(e.settings.codemirror.height){r=e.settings.codemirror.height}var i=tinymce.majorVersion<5?[{text:"Ok",subtype:"primary",onclick:function(){var e=document.querySelectorAll(".mce-container-body>iframe")[0];e.contentWindow.submit();c.close()}},{text:"Cancel",onclick:"close"}]:[{type:"custom",text:"Ok",name:"codemirrorOk",primary:true},{type:"cancel",text:"Cancel",name:"codemirrorCancel"}];var n={title:"HTML source code",url:o+"/source.html",width:t,height:r,resizable:true,maximizable:true,fullScreen:e.settings.codemirror.fullscreen,saveCursorPosition:false,buttons:i};if(tinymce.majorVersion>=5){n.onAction=function(o,t){if(t.name==="codemirrorOk"){var r=document.querySelectorAll(".tox-dialog__body-iframe iframe")[0];r.contentWindow.submit();e.undoManager.add();c.close()}}}var c=tinymce.majorVersion<5?e.windowManager.open(n):e.windowManager.openUrl(n);if(e.settings.codemirror.fullscreen){c.fullscreen(true)}}if(tinymce.majorVersion<5){e.addButton("code",{title:"Source code",icon:"code",onclick:t});e.addMenuItem("code",{icon:"code",text:"Source code",context:"tools",onclick:t})}else{e.ui.registry.addButton("code",{text:"HTML",tooltip:"Edit HTML",onAction:t});e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Edit HTML",onAction:t,context:"tools"})}}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/source.html b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/source.html index 11e11be5e0de..4b855988a60f 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/source.html +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/source.html @@ -1,9 +1,8 @@ - - - - - - - + + + diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/codesample/plugin.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/codesample/plugin.js new file mode 100644 index 000000000000..ab50889a0cb9 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/codesample/plugin.js @@ -0,0 +1,1717 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +(function () { + 'use strict'; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var noop = function () { + }; + var constant = function (value) { + return function () { + return value; + }; + }; + var never = constant(false); + var always = constant(true); + + var none = function () { + return NONE; + }; + var NONE = function () { + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; + }(); + var some = function (a) { + var constant_a = constant(a); + var self = function () { + return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; + }; + var from = function (value) { + return value === null || value === undefined ? NONE : some(value); + }; + var Optional = { + some: some, + none: none, + from: from + }; + + var head = function (xs) { + return xs.length === 0 ? Optional.none() : Optional.some(xs[0]); + }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); + + function isCodeSample(elm) { + return elm && elm.nodeName === 'PRE' && elm.className.indexOf('language-') !== -1; + } + function trimArg(predicateFn) { + return function (arg1, arg2) { + return predicateFn(arg2); + }; + } + + var Global = typeof window !== 'undefined' ? window : Function('return this;')(); + + var exports$1 = {}, module = { exports: exports$1 }, global$2 = {}; + (function (define, exports, module, require) { + var oldprism = window.Prism; + window.Prism = { manual: true }; + (function (f) { + if (typeof exports === 'object' && typeof module !== 'undefined') { + module.exports = f(); + } else if (typeof define === 'function' && define.amd) { + define([], f); + } else { + var g; + if (typeof window !== 'undefined') { + g = window; + } else if (typeof global$2 !== 'undefined') { + g = global$2; + } else if (typeof self !== 'undefined') { + g = self; + } else { + g = this; + } + g.EphoxContactWrapper = f(); + } + }(function () { + return function () { + function r(e, n, t) { + function o(i, f) { + if (!n[i]) { + if (!e[i]) { + var c = 'function' == typeof require && require; + if (!f && c) + return c(i, !0); + if (u) + return u(i, !0); + var a = new Error('Cannot find module \'' + i + '\''); + throw a.code = 'MODULE_NOT_FOUND', a; + } + var p = n[i] = { exports: {} }; + e[i][0].call(p.exports, function (r) { + var n = e[i][1][r]; + return o(n || r); + }, p, p.exports, r, e, n, t); + } + return n[i].exports; + } + for (var u = 'function' == typeof require && require, i = 0; i < t.length; i++) + o(t[i]); + return o; + } + return r; + }()({ + 1: [ + function (require, module, exports) { + Prism.languages.c = Prism.languages.extend('clike', { + 'class-name': { + pattern: /(\b(?:enum|struct)\s+)\w+/, + lookbehind: true + }, + 'keyword': /\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/, + 'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/, + 'number': /(?:\b0x(?:[\da-f]+\.?[\da-f]*|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ful]*/i + }); + Prism.languages.insertBefore('c', 'string', { + 'macro': { + pattern: /(^\s*)#\s*[a-z]+(?:[^\r\n\\]|\\(?:\r\n|[\s\S]))*/im, + lookbehind: true, + alias: 'property', + inside: { + 'string': { + pattern: /(#\s*include\s*)(?:<.+?>|("|')(?:\\?.)+?\2)/, + lookbehind: true + }, + 'directive': { + pattern: /(#\s*)\b(?:define|defined|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/, + lookbehind: true, + alias: 'keyword' + } + } + }, + 'constant': /\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/ + }); + delete Prism.languages.c['boolean']; + }, + {} + ], + 2: [ + function (require, module, exports) { + Prism.languages.clike = { + 'comment': [ + { + pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, + lookbehind: true + }, + { + pattern: /(^|[^\\:])\/\/.*/, + lookbehind: true, + greedy: true + } + ], + 'string': { + pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: true + }, + 'class-name': { + pattern: /(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i, + lookbehind: true, + inside: { 'punctuation': /[.\\]/ } + }, + 'keyword': /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/, + 'boolean': /\b(?:true|false)\b/, + 'function': /\w+(?=\()/, + 'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i, + 'operator': /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/, + 'punctuation': /[{}[\];(),.:]/ + }; + }, + {} + ], + 3: [ + function (require, module, exports) { + (function (global) { + var _self = typeof window !== 'undefined' ? window : typeof WorkerGlobalScope !== 'undefined' && self instanceof WorkerGlobalScope ? self : {}; + var Prism = function (_self) { + var lang = /\blang(?:uage)?-([\w-]+)\b/i; + var uniqueId = 0; + var _ = { + manual: _self.Prism && _self.Prism.manual, + disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler, + util: { + encode: function (tokens) { + if (tokens instanceof Token) { + return new Token(tokens.type, _.util.encode(tokens.content), tokens.alias); + } else if (Array.isArray(tokens)) { + return tokens.map(_.util.encode); + } else { + return tokens.replace(/&/g, '&').replace(/ text.length) { + return; + } + if (str instanceof Token) { + continue; + } + if (greedy && i != strarr.length - 1) { + pattern.lastIndex = pos; + var match = pattern.exec(text); + if (!match) { + break; + } + var from = match.index + (lookbehind && match[1] ? match[1].length : 0), to = match.index + match[0].length, k = i, p = pos; + for (var len = strarr.length; k < len && (p < to || !strarr[k].type && !strarr[k - 1].greedy); ++k) { + p += strarr[k].length; + if (from >= p) { + ++i; + pos = p; + } + } + if (strarr[i] instanceof Token) { + continue; + } + delNum = k - i; + str = text.slice(pos, p); + match.index -= pos; + } else { + pattern.lastIndex = 0; + var match = pattern.exec(str), delNum = 1; + } + if (!match) { + if (oneshot) { + break; + } + continue; + } + if (lookbehind) { + lookbehindLength = match[1] ? match[1].length : 0; + } + var from = match.index + lookbehindLength, match = match[0].slice(lookbehindLength), to = from + match.length, before = str.slice(0, from), after = str.slice(to); + var args = [ + i, + delNum + ]; + if (before) { + ++i; + pos += before.length; + args.push(before); + } + var wrapped = new Token(token, inside ? _.tokenize(match, inside) : match, alias, match, greedy); + args.push(wrapped); + if (after) { + args.push(after); + } + Array.prototype.splice.apply(strarr, args); + if (delNum != 1) + _.matchGrammar(text, strarr, grammar, i, pos, true, token + ',' + j); + if (oneshot) + break; + } + } + } + }, + tokenize: function (text, grammar) { + var strarr = [text]; + var rest = grammar.rest; + if (rest) { + for (var token in rest) { + grammar[token] = rest[token]; + } + delete grammar.rest; + } + _.matchGrammar(text, strarr, grammar, 0, 0, false); + return strarr; + }, + hooks: { + all: {}, + add: function (name, callback) { + var hooks = _.hooks.all; + hooks[name] = hooks[name] || []; + hooks[name].push(callback); + }, + run: function (name, env) { + var callbacks = _.hooks.all[name]; + if (!callbacks || !callbacks.length) { + return; + } + for (var i = 0, callback; callback = callbacks[i++];) { + callback(env); + } + } + }, + Token: Token + }; + _self.Prism = _; + function Token(type, content, alias, matchedStr, greedy) { + this.type = type; + this.content = content; + this.alias = alias; + this.length = (matchedStr || '').length | 0; + this.greedy = !!greedy; + } + Token.stringify = function (o, language) { + if (typeof o == 'string') { + return o; + } + if (Array.isArray(o)) { + return o.map(function (element) { + return Token.stringify(element, language); + }).join(''); + } + var env = { + type: o.type, + content: Token.stringify(o.content, language), + tag: 'span', + classes: [ + 'token', + o.type + ], + attributes: {}, + language: language + }; + if (o.alias) { + var aliases = Array.isArray(o.alias) ? o.alias : [o.alias]; + Array.prototype.push.apply(env.classes, aliases); + } + _.hooks.run('wrap', env); + var attributes = Object.keys(env.attributes).map(function (name) { + return name + '="' + (env.attributes[name] || '').replace(/"/g, '"') + '"'; + }).join(' '); + return '<' + env.tag + ' class="' + env.classes.join(' ') + '"' + (attributes ? ' ' + attributes : '') + '>' + env.content + ''; + }; + if (!_self.document) { + if (!_self.addEventListener) { + return _; + } + if (!_.disableWorkerMessageHandler) { + _self.addEventListener('message', function (evt) { + var message = JSON.parse(evt.data), lang = message.language, code = message.code, immediateClose = message.immediateClose; + _self.postMessage(_.highlight(code, _.languages[lang], lang)); + if (immediateClose) { + _self.close(); + } + }, false); + } + return _; + } + var script = _.util.currentScript(); + if (script) { + _.filename = script.src; + if (script.hasAttribute('data-manual')) { + _.manual = true; + } + } + if (!_.manual) { + var highlightAutomaticallyCallback = function () { + if (!_.manual) { + _.highlightAll(); + } + }; + var readyState = document.readyState; + if (readyState === 'loading' || readyState === 'interactive' && script && script.defer) { + document.addEventListener('DOMContentLoaded', highlightAutomaticallyCallback); + } else { + if (window.requestAnimationFrame) { + window.requestAnimationFrame(highlightAutomaticallyCallback); + } else { + window.setTimeout(highlightAutomaticallyCallback, 16); + } + } + } + return _; + }(_self); + if (typeof module !== 'undefined' && module.exports) { + module.exports = Prism; + } + if (typeof global !== 'undefined') { + global.Prism = Prism; + } + }.call(this, typeof global$2 !== 'undefined' ? global$2 : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : {})); + }, + {} + ], + 4: [ + function (require, module, exports) { + Prism.languages.cpp = Prism.languages.extend('c', { + 'class-name': { + pattern: /(\b(?:class|enum|struct)\s+)\w+/, + lookbehind: true + }, + 'keyword': /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/, + 'number': { + pattern: /(?:\b0b[01']+|\b0x(?:[\da-f']+\.?[\da-f']*|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+\.?[\d']*|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]*/i, + greedy: true + }, + 'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/, + 'boolean': /\b(?:true|false)\b/ + }); + Prism.languages.insertBefore('cpp', 'string', { + 'raw-string': { + pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/, + alias: 'string', + greedy: true + } + }); + }, + {} + ], + 5: [ + function (require, module, exports) { + Prism.languages.csharp = Prism.languages.extend('clike', { + 'keyword': /\b(?:abstract|add|alias|as|ascending|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|descending|do|double|dynamic|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|from|get|global|goto|group|if|implicit|in|int|interface|internal|into|is|join|let|lock|long|namespace|new|null|object|operator|orderby|out|override|params|partial|private|protected|public|readonly|ref|remove|return|sbyte|sealed|select|set|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|value|var|virtual|void|volatile|where|while|yield)\b/, + 'string': [ + { + pattern: /@("|')(?:\1\1|\\[\s\S]|(?!\1)[^\\])*\1/, + greedy: true + }, + { + pattern: /("|')(?:\\.|(?!\1)[^\\\r\n])*?\1/, + greedy: true + } + ], + 'class-name': [ + { + pattern: /\b[A-Z]\w*(?:\.\w+)*\b(?=\s+\w+)/, + inside: { punctuation: /\./ } + }, + { + pattern: /(\[)[A-Z]\w*(?:\.\w+)*\b/, + lookbehind: true, + inside: { punctuation: /\./ } + }, + { + pattern: /(\b(?:class|interface)\s+[A-Z]\w*(?:\.\w+)*\s*:\s*)[A-Z]\w*(?:\.\w+)*\b/, + lookbehind: true, + inside: { punctuation: /\./ } + }, + { + pattern: /((?:\b(?:class|interface|new)\s+)|(?:catch\s+\())[A-Z]\w*(?:\.\w+)*\b/, + lookbehind: true, + inside: { punctuation: /\./ } + } + ], + 'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)f?/i, + 'operator': />>=?|<<=?|[-=]>|([-+&|?])\1|~|[-+*/%&|^!=<>]=?/, + 'punctuation': /\?\.?|::|[{}[\];(),.:]/ + }); + Prism.languages.insertBefore('csharp', 'class-name', { + 'generic-method': { + pattern: /\w+\s*<[^>\r\n]+?>\s*(?=\()/, + inside: { + function: /^\w+/, + 'class-name': { + pattern: /\b[A-Z]\w*(?:\.\w+)*\b/, + inside: { punctuation: /\./ } + }, + keyword: Prism.languages.csharp.keyword, + punctuation: /[<>(),.:]/ + } + }, + 'preprocessor': { + pattern: /(^\s*)#.*/m, + lookbehind: true, + alias: 'property', + inside: { + 'directive': { + pattern: /(\s*#)\b(?:define|elif|else|endif|endregion|error|if|line|pragma|region|undef|warning)\b/, + lookbehind: true, + alias: 'keyword' + } + } + } + }); + Prism.languages.dotnet = Prism.languages.cs = Prism.languages.csharp; + }, + {} + ], + 6: [ + function (require, module, exports) { + (function (Prism) { + var string = /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/; + Prism.languages.css = { + 'comment': /\/\*[\s\S]*?\*\//, + 'atrule': { + pattern: /@[\w-]+[\s\S]*?(?:;|(?=\s*\{))/, + inside: { 'rule': /@[\w-]+/ } + }, + 'url': { + pattern: RegExp('url\\((?:' + string.source + '|[^\n\r()]*)\\)', 'i'), + inside: { + 'function': /^url/i, + 'punctuation': /^\(|\)$/ + } + }, + 'selector': RegExp('[^{}\\s](?:[^{};"\']|' + string.source + ')*?(?=\\s*\\{)'), + 'string': { + pattern: string, + greedy: true + }, + 'property': /[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i, + 'important': /!important\b/i, + 'function': /[-a-z0-9]+(?=\()/i, + 'punctuation': /[(){};:,]/ + }; + Prism.languages.css['atrule'].inside.rest = Prism.languages.css; + var markup = Prism.languages.markup; + if (markup) { + markup.tag.addInlined('style', 'css'); + Prism.languages.insertBefore('inside', 'attr-value', { + 'style-attr': { + pattern: /\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i, + inside: { + 'attr-name': { + pattern: /^\s*style/i, + inside: markup.tag.inside + }, + 'punctuation': /^\s*=\s*['"]|['"]\s*$/, + 'attr-value': { + pattern: /.+/i, + inside: Prism.languages.css + } + }, + alias: 'language-css' + } + }, markup.tag); + } + }(Prism)); + }, + {} + ], + 7: [ + function (require, module, exports) { + (function (Prism) { + var keywords = /\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|null|open|opens|package|private|protected|provides|public|requires|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/; + var className = /\b[A-Z](?:\w*[a-z]\w*)?\b/; + Prism.languages.java = Prism.languages.extend('clike', { + 'class-name': [ + className, + /\b[A-Z]\w*(?=\s+\w+\s*[;,=())])/ + ], + 'keyword': keywords, + 'function': [ + Prism.languages.clike.function, + { + pattern: /(\:\:)[a-z_]\w*/, + lookbehind: true + } + ], + 'number': /\b0b[01][01_]*L?\b|\b0x[\da-f_]*\.?[\da-f_p+-]+\b|(?:\b\d[\d_]*\.?[\d_]*|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i, + 'operator': { + pattern: /(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m, + lookbehind: true + } + }); + Prism.languages.insertBefore('java', 'string', { + 'triple-quoted-string': { + pattern: /"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/, + greedy: true, + alias: 'string' + } + }); + Prism.languages.insertBefore('java', 'class-name', { + 'annotation': { + alias: 'punctuation', + pattern: /(^|[^.])@\w+/, + lookbehind: true + }, + 'namespace': { + pattern: /(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)[a-z]\w*(?:\.[a-z]\w*)+/, + lookbehind: true, + inside: { 'punctuation': /\./ } + }, + 'generics': { + pattern: /<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/, + inside: { + 'class-name': className, + 'keyword': keywords, + 'punctuation': /[<>(),.:]/, + 'operator': /[?&|]/ + } + } + }); + }(Prism)); + }, + {} + ], + 8: [ + function (require, module, exports) { + Prism.languages.javascript = Prism.languages.extend('clike', { + 'class-name': [ + Prism.languages.clike['class-name'], + { + pattern: /(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/, + lookbehind: true + } + ], + 'keyword': [ + { + pattern: /((?:^|})\s*)(?:catch|finally)\b/, + lookbehind: true + }, + { + pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/, + lookbehind: true + } + ], + 'number': /\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/, + 'function': /#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/, + 'operator': /--|\+\+|\*\*=?|=>|&&|\|\||[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?[.?]?|[~:]/ + }); + Prism.languages.javascript['class-name'][0].pattern = /(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/; + Prism.languages.insertBefore('javascript', 'keyword', { + 'regex': { + pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*[\s\S]*?\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/, + lookbehind: true, + greedy: true + }, + 'function-variable': { + pattern: /#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/, + alias: 'function' + }, + 'parameter': [ + { + pattern: /(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/, + lookbehind: true, + inside: Prism.languages.javascript + }, + { + pattern: /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i, + inside: Prism.languages.javascript + }, + { + pattern: /(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/, + lookbehind: true, + inside: Prism.languages.javascript + }, + { + pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/, + lookbehind: true, + inside: Prism.languages.javascript + } + ], + 'constant': /\b[A-Z](?:[A-Z_]|\dx?)*\b/ + }); + Prism.languages.insertBefore('javascript', 'string', { + 'template-string': { + pattern: /`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/, + greedy: true, + inside: { + 'template-punctuation': { + pattern: /^`|`$/, + alias: 'string' + }, + 'interpolation': { + pattern: /((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/, + lookbehind: true, + inside: { + 'interpolation-punctuation': { + pattern: /^\${|}$/, + alias: 'punctuation' + }, + rest: Prism.languages.javascript + } + }, + 'string': /[\s\S]+/ + } + } + }); + if (Prism.languages.markup) { + Prism.languages.markup.tag.addInlined('script', 'javascript'); + } + Prism.languages.js = Prism.languages.javascript; + }, + {} + ], + 9: [ + function (require, module, exports) { + (function (Prism) { + function getPlaceholder(language, index) { + return '___' + language.toUpperCase() + index + '___'; + } + Object.defineProperties(Prism.languages['markup-templating'] = {}, { + buildPlaceholders: { + value: function (env, language, placeholderPattern, replaceFilter) { + if (env.language !== language) { + return; + } + var tokenStack = env.tokenStack = []; + env.code = env.code.replace(placeholderPattern, function (match) { + if (typeof replaceFilter === 'function' && !replaceFilter(match)) { + return match; + } + var i = tokenStack.length; + var placeholder; + while (env.code.indexOf(placeholder = getPlaceholder(language, i)) !== -1) + ++i; + tokenStack[i] = match; + return placeholder; + }); + env.grammar = Prism.languages.markup; + } + }, + tokenizePlaceholders: { + value: function (env, language) { + if (env.language !== language || !env.tokenStack) { + return; + } + env.grammar = Prism.languages[language]; + var j = 0; + var keys = Object.keys(env.tokenStack); + function walkTokens(tokens) { + for (var i = 0; i < tokens.length; i++) { + if (j >= keys.length) { + break; + } + var token = tokens[i]; + if (typeof token === 'string' || token.content && typeof token.content === 'string') { + var k = keys[j]; + var t = env.tokenStack[k]; + var s = typeof token === 'string' ? token : token.content; + var placeholder = getPlaceholder(language, k); + var index = s.indexOf(placeholder); + if (index > -1) { + ++j; + var before = s.substring(0, index); + var middle = new Prism.Token(language, Prism.tokenize(t, env.grammar), 'language-' + language, t); + var after = s.substring(index + placeholder.length); + var replacement = []; + if (before) { + replacement.push.apply(replacement, walkTokens([before])); + } + replacement.push(middle); + if (after) { + replacement.push.apply(replacement, walkTokens([after])); + } + if (typeof token === 'string') { + tokens.splice.apply(tokens, [ + i, + 1 + ].concat(replacement)); + } else { + token.content = replacement; + } + } + } else if (token.content) { + walkTokens(token.content); + } + } + return tokens; + } + walkTokens(env.tokens); + } + } + }); + }(Prism)); + }, + {} + ], + 10: [ + function (require, module, exports) { + Prism.languages.markup = { + 'comment': //, + 'prolog': /<\?[\s\S]+?\?>/, + 'doctype': { + pattern: /"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:(?!)*\]\s*)?>/i, + greedy: true + }, + 'cdata': //i, + 'tag': { + pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/i, + greedy: true, + inside: { + 'tag': { + pattern: /^<\/?[^\s>\/]+/i, + inside: { + 'punctuation': /^<\/?/, + 'namespace': /^[^\s>\/:]+:/ + } + }, + 'attr-value': { + pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/i, + inside: { + 'punctuation': [ + /^=/, + { + pattern: /^(\s*)["']|["']$/, + lookbehind: true + } + ] + } + }, + 'punctuation': /\/?>/, + 'attr-name': { + pattern: /[^\s>\/]+/, + inside: { 'namespace': /^[^\s>\/:]+:/ } + } + } + }, + 'entity': /&#?[\da-z]{1,8};/i + }; + Prism.languages.markup['tag'].inside['attr-value'].inside['entity'] = Prism.languages.markup['entity']; + Prism.hooks.add('wrap', function (env) { + if (env.type === 'entity') { + env.attributes['title'] = env.content.replace(/&/, '&'); + } + }); + Object.defineProperty(Prism.languages.markup.tag, 'addInlined', { + value: function addInlined(tagName, lang) { + var includedCdataInside = {}; + includedCdataInside['language-' + lang] = { + pattern: /(^$)/i, + lookbehind: true, + inside: Prism.languages[lang] + }; + includedCdataInside['cdata'] = /^$/i; + var inside = { + 'included-cdata': { + pattern: //i, + inside: includedCdataInside + } + }; + inside['language-' + lang] = { + pattern: /[\s\S]+/, + inside: Prism.languages[lang] + }; + var def = {}; + def[tagName] = { + pattern: RegExp(/(<__[\s\S]*?>)(?:\s*|[\s\S])*?(?=<\/__>)/.source.replace(/__/g, tagName), 'i'), + lookbehind: true, + greedy: true, + inside: inside + }; + Prism.languages.insertBefore('markup', 'cdata', def); + } + }); + Prism.languages.xml = Prism.languages.extend('markup', {}); + Prism.languages.html = Prism.languages.markup; + Prism.languages.mathml = Prism.languages.markup; + Prism.languages.svg = Prism.languages.markup; + }, + {} + ], + 11: [ + function (require, module, exports) { + (function (Prism) { + Prism.languages.php = Prism.languages.extend('clike', { + 'keyword': /\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|new|or|parent|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i, + 'boolean': { + pattern: /\b(?:false|true)\b/i, + alias: 'constant' + }, + 'constant': [ + /\b[A-Z_][A-Z0-9_]*\b/, + /\b(?:null)\b/i + ], + 'comment': { + pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/, + lookbehind: true + } + }); + Prism.languages.insertBefore('php', 'string', { + 'shell-comment': { + pattern: /(^|[^\\])#.*/, + lookbehind: true, + alias: 'comment' + } + }); + Prism.languages.insertBefore('php', 'comment', { + 'delimiter': { + pattern: /\?>$|^<\?(?:php(?=\s)|=)?/i, + alias: 'important' + } + }); + Prism.languages.insertBefore('php', 'keyword', { + 'variable': /\$+(?:\w+\b|(?={))/i, + 'package': { + pattern: /(\\|namespace\s+|use\s+)[\w\\]+/, + lookbehind: true, + inside: { punctuation: /\\/ } + } + }); + Prism.languages.insertBefore('php', 'operator', { + 'property': { + pattern: /(->)[\w]+/, + lookbehind: true + } + }); + var string_interpolation = { + pattern: /{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[.+?]|->\w+)*)/, + lookbehind: true, + inside: Prism.languages.php + }; + Prism.languages.insertBefore('php', 'string', { + 'nowdoc-string': { + pattern: /<<<'([^']+)'(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\1;/, + greedy: true, + alias: 'string', + inside: { + 'delimiter': { + pattern: /^<<<'[^']+'|[a-z_]\w*;$/i, + alias: 'symbol', + inside: { 'punctuation': /^<<<'?|[';]$/ } + } + } + }, + 'heredoc-string': { + pattern: /<<<(?:"([^"]+)"(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\1;|([a-z_]\w*)(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\2;)/i, + greedy: true, + alias: 'string', + inside: { + 'delimiter': { + pattern: /^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i, + alias: 'symbol', + inside: { 'punctuation': /^<<<"?|[";]$/ } + }, + 'interpolation': string_interpolation + } + }, + 'single-quoted-string': { + pattern: /'(?:\\[\s\S]|[^\\'])*'/, + greedy: true, + alias: 'string' + }, + 'double-quoted-string': { + pattern: /"(?:\\[\s\S]|[^\\"])*"/, + greedy: true, + alias: 'string', + inside: { 'interpolation': string_interpolation } + } + }); + delete Prism.languages.php['string']; + Prism.hooks.add('before-tokenize', function (env) { + if (!/<\?/.test(env.code)) { + return; + } + var phpPattern = /<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#)(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|\/\*[\s\S]*?(?:\*\/|$))*?(?:\?>|$)/ig; + Prism.languages['markup-templating'].buildPlaceholders(env, 'php', phpPattern); + }); + Prism.hooks.add('after-tokenize', function (env) { + Prism.languages['markup-templating'].tokenizePlaceholders(env, 'php'); + }); + }(Prism)); + }, + {} + ], + 12: [ + function (require, module, exports) { + Prism.languages.python = { + 'comment': { + pattern: /(^|[^\\])#.*/, + lookbehind: true + }, + 'string-interpolation': { + pattern: /(?:f|rf|fr)(?:("""|''')[\s\S]+?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i, + greedy: true, + inside: { + 'interpolation': { + pattern: /((?:^|[^{])(?:{{)*){(?!{)(?:[^{}]|{(?!{)(?:[^{}]|{(?!{)(?:[^{}])+})+})+}/, + lookbehind: true, + inside: { + 'format-spec': { + pattern: /(:)[^:(){}]+(?=}$)/, + lookbehind: true + }, + 'conversion-option': { + pattern: /![sra](?=[:}]$)/, + alias: 'punctuation' + }, + rest: null + } + }, + 'string': /[\s\S]+/ + } + }, + 'triple-quoted-string': { + pattern: /(?:[rub]|rb|br)?("""|''')[\s\S]+?\1/i, + greedy: true, + alias: 'string' + }, + 'string': { + pattern: /(?:[rub]|rb|br)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i, + greedy: true + }, + 'function': { + pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g, + lookbehind: true + }, + 'class-name': { + pattern: /(\bclass\s+)\w+/i, + lookbehind: true + }, + 'decorator': { + pattern: /(^\s*)@\w+(?:\.\w+)*/im, + lookbehind: true, + alias: [ + 'annotation', + 'punctuation' + ], + inside: { 'punctuation': /\./ } + }, + 'keyword': /\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/, + 'builtin': /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/, + 'boolean': /\b(?:True|False|None)\b/, + 'number': /(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i, + 'operator': /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/, + 'punctuation': /[{}[\];(),.:]/ + }; + Prism.languages.python['string-interpolation'].inside['interpolation'].inside.rest = Prism.languages.python; + Prism.languages.py = Prism.languages.python; + }, + {} + ], + 13: [ + function (require, module, exports) { + (function (Prism) { + Prism.languages.ruby = Prism.languages.extend('clike', { + 'comment': [ + /#.*/, + { + pattern: /^=begin\s[\s\S]*?^=end/m, + greedy: true + } + ], + 'class-name': { + pattern: /(\b(?:class)\s+|\bcatch\s+\()[\w.\\]+/i, + lookbehind: true, + inside: { 'punctuation': /[.\\]/ } + }, + 'keyword': /\b(?:alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|protected|private|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/ + }); + var interpolation = { + pattern: /#\{[^}]+\}/, + inside: { + 'delimiter': { + pattern: /^#\{|\}$/, + alias: 'tag' + }, + rest: Prism.languages.ruby + } + }; + delete Prism.languages.ruby.function; + Prism.languages.insertBefore('ruby', 'keyword', { + 'regex': [ + { + pattern: /%r([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1[gim]{0,3}/, + greedy: true, + inside: { 'interpolation': interpolation } + }, + { + pattern: /%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/, + greedy: true, + inside: { 'interpolation': interpolation } + }, + { + pattern: /%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/, + greedy: true, + inside: { 'interpolation': interpolation } + }, + { + pattern: /%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/, + greedy: true, + inside: { 'interpolation': interpolation } + }, + { + pattern: /%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/, + greedy: true, + inside: { 'interpolation': interpolation } + }, + { + pattern: /(^|[^/])\/(?!\/)(?:\[.+?]|\\.|[^/\\\r\n])+\/[gim]{0,3}(?=\s*(?:$|[\r\n,.;})]))/, + lookbehind: true, + greedy: true + } + ], + 'variable': /[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/, + 'symbol': { + pattern: /(^|[^:]):[a-zA-Z_]\w*(?:[?!]|\b)/, + lookbehind: true + }, + 'method-definition': { + pattern: /(\bdef\s+)[\w.]+/, + lookbehind: true, + inside: { + 'function': /\w+$/, + rest: Prism.languages.ruby + } + } + }); + Prism.languages.insertBefore('ruby', 'number', { + 'builtin': /\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|Fixnum|Float|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/, + 'constant': /\b[A-Z]\w*(?:[?!]|\b)/ + }); + Prism.languages.ruby.string = [ + { + pattern: /%[qQiIwWxs]?([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/, + greedy: true, + inside: { 'interpolation': interpolation } + }, + { + pattern: /%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/, + greedy: true, + inside: { 'interpolation': interpolation } + }, + { + pattern: /%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/, + greedy: true, + inside: { 'interpolation': interpolation } + }, + { + pattern: /%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/, + greedy: true, + inside: { 'interpolation': interpolation } + }, + { + pattern: /%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/, + greedy: true, + inside: { 'interpolation': interpolation } + }, + { + pattern: /("|')(?:#\{[^}]+\}|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + greedy: true, + inside: { 'interpolation': interpolation } + } + ]; + Prism.languages.rb = Prism.languages.ruby; + }(Prism)); + }, + {} + ], + 14: [ + function (require, module, exports) { + var Prism = require('prismjs/components/prism-core'); + require('prismjs/components/prism-clike'); + require('prismjs/components/prism-markup-templating'); + require('prismjs/components/prism-c'); + require('prismjs/components/prism-cpp'); + require('prismjs/components/prism-csharp'); + require('prismjs/components/prism-css'); + require('prismjs/components/prism-java'); + require('prismjs/components/prism-javascript'); + require('prismjs/components/prism-markup'); + require('prismjs/components/prism-php'); + require('prismjs/components/prism-python'); + require('prismjs/components/prism-ruby'); + module.exports = { boltExport: Prism }; + }, + { + 'prismjs/components/prism-c': 1, + 'prismjs/components/prism-clike': 2, + 'prismjs/components/prism-core': 3, + 'prismjs/components/prism-cpp': 4, + 'prismjs/components/prism-csharp': 5, + 'prismjs/components/prism-css': 6, + 'prismjs/components/prism-java': 7, + 'prismjs/components/prism-javascript': 8, + 'prismjs/components/prism-markup': 10, + 'prismjs/components/prism-markup-templating': 9, + 'prismjs/components/prism-php': 11, + 'prismjs/components/prism-python': 12, + 'prismjs/components/prism-ruby': 13 + } + ] + }, {}, [14])(14); + })); + var prism = window.Prism; + window.Prism = oldprism; + return prism; + }(undefined, exports$1, module, undefined)); + var Prism$1 = module.exports.boltExport; + + var getLanguages = function (editor) { + return editor.getParam('codesample_languages'); + }; + var useGlobalPrismJS = function (editor) { + return editor.getParam('codesample_global_prismjs', false, 'boolean'); + }; + + var get = function (editor) { + return Global.Prism && useGlobalPrismJS(editor) ? Global.Prism : Prism$1; + }; + + var getSelectedCodeSample = function (editor) { + var node = editor.selection ? editor.selection.getNode() : null; + if (isCodeSample(node)) { + return Optional.some(node); + } + return Optional.none(); + }; + var insertCodeSample = function (editor, language, code) { + editor.undoManager.transact(function () { + var node = getSelectedCodeSample(editor); + code = global$1.DOM.encode(code); + return node.fold(function () { + editor.insertContent('

    ' + code + '
    '); + editor.selection.select(editor.$('#__new').removeAttr('id')[0]); + }, function (n) { + editor.dom.setAttrib(n, 'class', 'language-' + language); + n.innerHTML = code; + get(editor).highlightElement(n); + editor.selection.select(n); + }); + }); + }; + var getCurrentCode = function (editor) { + var node = getSelectedCodeSample(editor); + return node.fold(function () { + return ''; + }, function (n) { + return n.textContent; + }); + }; + + var getLanguages$1 = function (editor) { + var defaultLanguages = [ + { + text: 'HTML/XML', + value: 'markup' + }, + { + text: 'JavaScript', + value: 'javascript' + }, + { + text: 'CSS', + value: 'css' + }, + { + text: 'PHP', + value: 'php' + }, + { + text: 'Ruby', + value: 'ruby' + }, + { + text: 'Python', + value: 'python' + }, + { + text: 'Java', + value: 'java' + }, + { + text: 'C', + value: 'c' + }, + { + text: 'C#', + value: 'csharp' + }, + { + text: 'C++', + value: 'cpp' + } + ]; + var customLanguages = getLanguages(editor); + return customLanguages ? customLanguages : defaultLanguages; + }; + var getCurrentLanguage = function (editor, fallback) { + var node = getSelectedCodeSample(editor); + return node.fold(function () { + return fallback; + }, function (n) { + var matches = n.className.match(/language-(\w+)/); + return matches ? matches[1] : fallback; + }); + }; + + var open = function (editor) { + var languages = getLanguages$1(editor); + var defaultLanguage = head(languages).fold(function () { + return ''; + }, function (l) { + return l.value; + }); + var currentLanguage = getCurrentLanguage(editor, defaultLanguage); + var currentCode = getCurrentCode(editor); + editor.windowManager.open({ + title: 'Insert/Edit Code Sample', + size: 'large', + body: { + type: 'panel', + items: [ + { + type: 'selectbox', + name: 'language', + label: 'Language', + items: languages + }, + { + type: 'textarea', + name: 'code', + label: 'Code view' + } + ] + }, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + initialData: { + language: currentLanguage, + code: currentCode + }, + onSubmit: function (api) { + var data = api.getData(); + insertCodeSample(editor, data.language, data.code); + api.close(); + } + }); + }; + + var register = function (editor) { + editor.addCommand('codesample', function () { + var node = editor.selection.getNode(); + if (editor.selection.isCollapsed() || isCodeSample(node)) { + open(editor); + } else { + editor.formatter.toggle('code'); + } + }); + }; + + var setup = function (editor) { + var $ = editor.$; + editor.on('PreProcess', function (e) { + $('pre[contenteditable=false]', e.node).filter(trimArg(isCodeSample)).each(function (idx, elm) { + var $elm = $(elm), code = elm.textContent; + $elm.attr('class', $.trim($elm.attr('class'))); + $elm.removeAttr('contentEditable'); + $elm.empty().append($('').each(function () { + this.textContent = code; + })); + }); + }); + editor.on('SetContent', function () { + var unprocessedCodeSamples = $('pre').filter(trimArg(isCodeSample)).filter(function (idx, elm) { + return elm.contentEditable !== 'false'; + }); + if (unprocessedCodeSamples.length) { + editor.undoManager.transact(function () { + unprocessedCodeSamples.each(function (idx, elm) { + $(elm).find('br').each(function (idx, elm) { + elm.parentNode.replaceChild(editor.getDoc().createTextNode('\n'), elm); + }); + elm.contentEditable = 'false'; + elm.innerHTML = editor.dom.encode(elm.textContent); + get(editor).highlightElement(elm); + elm.className = $.trim(elm.className); + }); + }); + } + }); + }; + + var isCodeSampleSelection = function (editor) { + var node = editor.selection.getStart(); + return editor.dom.is(node, 'pre[class*="language-"]'); + }; + var register$1 = function (editor) { + editor.ui.registry.addToggleButton('codesample', { + icon: 'code-sample', + tooltip: 'Insert/edit code sample', + onAction: function () { + return open(editor); + }, + onSetup: function (api) { + var nodeChangeHandler = function () { + api.setActive(isCodeSampleSelection(editor)); + }; + editor.on('NodeChange', nodeChangeHandler); + return function () { + return editor.off('NodeChange', nodeChangeHandler); + }; + } + }); + editor.ui.registry.addMenuItem('codesample', { + text: 'Code sample...', + icon: 'code-sample', + onAction: function () { + return open(editor); + } + }); + }; + + function Plugin () { + global.add('codesample', function (editor) { + setup(editor); + register$1(editor); + register(editor); + editor.on('dblclick', function (ev) { + if (isCodeSample(ev.target)) { + open(editor); + } + }); + }); + } + + Plugin(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/codesample/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/codesample/plugin.min.js new file mode 100644 index 000000000000..e094d08e6b02 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/codesample/plugin.min.js @@ -0,0 +1,9 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var e,n,t,a=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(e){return function(){return e}},s=i(!1),o=i(!0),r=function(){return l},l=(e=function(e){return e.isNone()},{fold:function(e,n){return e()},is:s,isSome:s,isNone:o,getOr:t=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:t,orThunk:n,map:r,each:function(){},bind:r,exists:s,forall:o,filter:r,equals:e,equals_:e,toArray:function(){return[]},toString:i("none()")}),u=function(t){var e=i(t),n=function(){return r},a=function(e){return e(t)},r={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:o,isNone:s,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return u(e(t))},each:function(e){e(t)},bind:a,exists:a,forall:a,filter:function(e){return e(t)?r:l},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(s,function(e){return n(t,e)})}};return r},c={some:u,none:r,from:function(e){return null===e||e===undefined?l:u(e)}},d=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils");function p(e){return e&&"PRE"===e.nodeName&&-1!==e.className.indexOf("language-")}function g(t){return function(e,n){return t(n)}}var m="undefined"!=typeof window?window:Function("return this;")(),f={},h={exports:f},b={};!function(n,t,a,d){var e=window.Prism;window.Prism={manual:!0},function(e){"object"==typeof t&&void 0!==a?a.exports=e():"function"==typeof n&&n.amd?n([],e):("undefined"!=typeof window?window:void 0!==b?b:"undefined"!=typeof self?self:this).EphoxContactWrapper=e()}(function(){return function c(i,s,o){function l(n,e){if(!s[n]){if(!i[n]){var t="function"==typeof d&&d;if(!e&&t)return t(n,!0);if(u)return u(n,!0);var a=new Error("Cannot find module '"+n+"'");throw a.code="MODULE_NOT_FOUND",a}var r=s[n]={exports:{}};i[n][0].call(r.exports,function(e){return l(i[n][1][e]||e)},r,r.exports,c,i,s,o)}return s[n].exports}for(var u="function"==typeof d&&d,e=0;e>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/,number:/(?:\b0x(?:[\da-f]+\.?[\da-f]*|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ful]*/i}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+(?:[^\r\n\\]|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,alias:"property",inside:{string:{pattern:/(#\s*include\s*)(?:<.+?>|("|')(?:\\?.)+?\2)/,lookbehind:!0},directive:{pattern:/(#\s*)\b(?:define|defined|elif|else|endif|error|ifdef|ifndef|if|import|include|line|pragma|undef|using)\b/,lookbehind:!0,alias:"keyword"}}},constant:/\b(?:__FILE__|__LINE__|__DATE__|__TIME__|__TIMESTAMP__|__func__|EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|stdin|stdout|stderr)\b/}),delete Prism.languages.c["boolean"]},{}],2:[function(e,n,t){Prism.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|interface|extends|implements|trait|instanceof|new)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/,"boolean":/\b(?:true|false)\b/,"function":/\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/}},{}],3:[function(e,t,n){(function(e){var n=function(u){var c=/\blang(?:uage)?-([\w-]+)\b/i,n=0,C={manual:u.Prism&&u.Prism.manual,disableWorkerMessageHandler:u.Prism&&u.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof O?new O(e.type,C.util.encode(e.content),e.alias):Array.isArray(e)?e.map(C.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(!(w instanceof O)){if(m&&b!=n.length-1){if(d.lastIndex=y,!(P=d.exec(e)))break;for(var v=P.index+(g&&P[1]?P[1].length:0),k=P.index+P[0].length,x=b,_=y,F=n.length;x"+a.content+""},!u.document)return u.addEventListener&&(C.disableWorkerMessageHandler||u.addEventListener("message",function(e){var n=JSON.parse(e.data),t=n.language,a=n.code,r=n.immediateClose;u.postMessage(C.highlight(a,C.languages[t],t)),r&&u.close()},!1)),C;var e,t,a=C.util.currentScript();return a&&(C.filename=a.src,a.hasAttribute("data-manual")&&(C.manual=!0)),C.manual||(e=function(){C.manual||C.highlightAll()},"loading"===(t=document.readyState)||"interactive"===t&&a&&a.defer?document.addEventListener("DOMContentLoaded",e):window.requestAnimationFrame?window.requestAnimationFrame(e):window.setTimeout(e,16)),C}("undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{});void 0!==t&&t.exports&&(t.exports=n),void 0!==e&&(e.Prism=n)}).call(this,void 0!==b?b:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],4:[function(e,n,t){Prism.languages.cpp=Prism.languages.extend("c",{"class-name":{pattern:/(\b(?:class|enum|struct)\s+)\w+/,lookbehind:!0},keyword:/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+\.?[\da-f']*|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+\.?[\d']*|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]*/i,greedy:!0},operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,"boolean":/\b(?:true|false)\b/}),Prism.languages.insertBefore("cpp","string",{"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}})},{}],5:[function(e,n,t){Prism.languages.csharp=Prism.languages.extend("clike",{keyword:/\b(?:abstract|add|alias|as|ascending|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|descending|do|double|dynamic|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|from|get|global|goto|group|if|implicit|in|int|interface|internal|into|is|join|let|lock|long|namespace|new|null|object|operator|orderby|out|override|params|partial|private|protected|public|readonly|ref|remove|return|sbyte|sealed|select|set|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|value|var|virtual|void|volatile|where|while|yield)\b/,string:[{pattern:/@("|')(?:\1\1|\\[\s\S]|(?!\1)[^\\])*\1/,greedy:!0},{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*?\1/,greedy:!0}],"class-name":[{pattern:/\b[A-Z]\w*(?:\.\w+)*\b(?=\s+\w+)/,inside:{punctuation:/\./}},{pattern:/(\[)[A-Z]\w*(?:\.\w+)*\b/,lookbehind:!0,inside:{punctuation:/\./}},{pattern:/(\b(?:class|interface)\s+[A-Z]\w*(?:\.\w+)*\s*:\s*)[A-Z]\w*(?:\.\w+)*\b/,lookbehind:!0,inside:{punctuation:/\./}},{pattern:/((?:\b(?:class|interface|new)\s+)|(?:catch\s+\())[A-Z]\w*(?:\.\w+)*\b/,lookbehind:!0,inside:{punctuation:/\./}}],number:/\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)f?/i,operator:/>>=?|<<=?|[-=]>|([-+&|?])\1|~|[-+*/%&|^!=<>]=?/,punctuation:/\?\.?|::|[{}[\];(),.:]/}),Prism.languages.insertBefore("csharp","class-name",{"generic-method":{pattern:/\w+\s*<[^>\r\n]+?>\s*(?=\()/,inside:{"function":/^\w+/,"class-name":{pattern:/\b[A-Z]\w*(?:\.\w+)*\b/,inside:{punctuation:/\./}},keyword:Prism.languages.csharp.keyword,punctuation:/[<>(),.:]/}},preprocessor:{pattern:/(^\s*)#.*/m,lookbehind:!0,alias:"property",inside:{directive:{pattern:/(\s*#)\b(?:define|elif|else|endif|endregion|error|if|line|pragma|region|undef|warning)\b/,lookbehind:!0,alias:"keyword"}}}}),Prism.languages.dotnet=Prism.languages.cs=Prism.languages.csharp},{}],6:[function(e,n,t){!function(e){var n=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-]+[\s\S]*?(?:;|(?=\s*\{))/,inside:{rule:/@[\w-]+/}},url:{pattern:RegExp("url\\((?:"+n.source+"|[^\n\r()]*)\\)","i"),inside:{"function":/^url/i,punctuation:/^\(|\)$/}},selector:RegExp("[^{}\\s](?:[^{};\"']|"+n.source+")*?(?=\\s*\\{)"),string:{pattern:n,greedy:!0},property:/[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i,important:/!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var t=e.languages.markup;t&&(t.tag.addInlined("style","css"),e.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:t.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:e.languages.css}},alias:"language-css"}},t.tag))}(Prism)},{}],7:[function(e,n,t){var a,r,i;a=Prism,r=/\b(?:abstract|assert|boolean|break|byte|case|catch|char|class|const|continue|default|do|double|else|enum|exports|extends|final|finally|float|for|goto|if|implements|import|instanceof|int|interface|long|module|native|new|null|open|opens|package|private|protected|provides|public|requires|return|short|static|strictfp|super|switch|synchronized|this|throw|throws|to|transient|transitive|try|uses|var|void|volatile|while|with|yield)\b/,i=/\b[A-Z](?:\w*[a-z]\w*)?\b/,a.languages.java=a.languages.extend("clike",{"class-name":[i,/\b[A-Z]\w*(?=\s+\w+\s*[;,=())])/],keyword:r,"function":[a.languages.clike["function"],{pattern:/(\:\:)[a-z_]\w*/,lookbehind:!0}],number:/\b0b[01][01_]*L?\b|\b0x[\da-f_]*\.?[\da-f_p+-]+\b|(?:\b\d[\d_]*\.?[\d_]*|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfl]?/i,operator:{pattern:/(^|[^.])(?:<<=?|>>>?=?|->|--|\+\+|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?)/m,lookbehind:!0}}),a.languages.insertBefore("java","string",{"triple-quoted-string":{pattern:/"""[ \t]*[\r\n](?:(?:"|"")?(?:\\.|[^"\\]))*"""/,greedy:!0,alias:"string"}}),a.languages.insertBefore("java","class-name",{annotation:{alias:"punctuation",pattern:/(^|[^.])@\w+/,lookbehind:!0},namespace:{pattern:/(\b(?:exports|import(?:\s+static)?|module|open|opens|package|provides|requires|to|transitive|uses|with)\s+)[a-z]\w*(?:\.[a-z]\w*)+/,lookbehind:!0,inside:{punctuation:/\./}},generics:{pattern:/<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<(?:[\w\s,.&?]|<[\w\s,.&?]*>)*>)*>)*>/,inside:{"class-name":i,keyword:r,punctuation:/[<>(),.:]/,operator:/[?&|]/}}})},{}],8:[function(e,n,t){Prism.languages.javascript=Prism.languages.extend("clike",{"class-name":[Prism.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])[_$A-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\.(?:prototype|constructor))/,lookbehind:!0}],keyword:[{pattern:/((?:^|})\s*)(?:catch|finally)\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],number:/\b(?:(?:0[xX](?:[\dA-Fa-f](?:_[\dA-Fa-f])?)+|0[bB](?:[01](?:_[01])?)+|0[oO](?:[0-7](?:_[0-7])?)+)n?|(?:\d(?:_\d)?)+n|NaN|Infinity)\b|(?:\b(?:\d(?:_\d)?)+\.?(?:\d(?:_\d)?)*|\B\.(?:\d(?:_\d)?)+)(?:[Ee][+-]?(?:\d(?:_\d)?)+)?/,"function":/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,operator:/--|\+\+|\*\*=?|=>|&&|\|\||[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?[.?]?|[~:]/}),Prism.languages.javascript["class-name"][0].pattern=/(\b(?:class|interface|extends|implements|instanceof|new)\s+)[\w.\\]+/,Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*]|\\.|[^/\\\[\r\n])+\/[gimyus]{0,6}(?=(?:\s|\/\*[\s\S]*?\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0},"function-variable":{pattern:/#?[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|[_$a-zA-Z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)?\s*\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\))/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=>)/i,inside:Prism.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*=>)/,lookbehind:!0,inside:Prism.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:[_$A-Za-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*\s*)\(\s*)(?!\s)(?:[^()]|\([^()]*\))+?(?=\s*\)\s*\{)/,lookbehind:!0,inside:Prism.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),Prism.languages.insertBefore("javascript","string",{"template-string":{pattern:/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}|(?!\${)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})+}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\${|}$/,alias:"punctuation"},rest:Prism.languages.javascript}},string:/[\s\S]+/}}}),Prism.languages.markup&&Prism.languages.markup.tag.addInlined("script","javascript"),Prism.languages.js=Prism.languages.javascript},{}],9:[function(e,n,t){function b(e,n){return"___"+e.toUpperCase()+n+"___"}var y;y=Prism,Object.defineProperties(y.languages["markup-templating"]={},{buildPlaceholders:{value:function(a,r,e,i){var s;a.language===r&&(s=a.tokenStack=[],a.code=a.code.replace(e,function(e){if("function"==typeof i&&!i(e))return e;for(var n,t=s.length;-1!==a.code.indexOf(n=b(r,t));)++t;return s[t]=e,n}),a.grammar=y.languages.markup)}},tokenizePlaceholders:{value:function(p,g){var m,f;p.language===g&&p.tokenStack&&(p.grammar=y.languages[g],m=0,f=Object.keys(p.tokenStack),function h(e){for(var n=0;n=f.length);n++){var t,a,r,i,s,o,l,u,c,d=e[n];"string"==typeof d||d.content&&"string"==typeof d.content?(t=f[m],a=p.tokenStack[t],r="string"==typeof d?d:d.content,i=b(g,t),-1<(s=r.indexOf(i))&&(++m,o=r.substring(0,s),l=new y.Token(g,y.tokenize(a,p.grammar),"language-"+g,a),u=r.substring(s+i.length),c=[],o&&c.push.apply(c,h([o])),c.push(l),u&&c.push.apply(c,h([u])),"string"==typeof d?e.splice.apply(e,[n,1].concat(c)):d.content=c)):d.content&&h(d.content)}return e}(p.tokens))}}})},{}],10:[function(e,n,t){Prism.languages.markup={comment://,prolog:/<\?[\s\S]+?\?>/,doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:(?!)*\]\s*)?>/i,greedy:!0},cdata://i,tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/i,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/i,inside:{punctuation:[/^=/,{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},Prism.languages.markup.tag.inside["attr-value"].inside.entity=Prism.languages.markup.entity,Prism.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))}),Object.defineProperty(Prism.languages.markup.tag,"addInlined",{value:function(e,n){var t={};t["language-"+n]={pattern:/(^$)/i,lookbehind:!0,inside:Prism.languages[n]},t.cdata=/^$/i;var a={"included-cdata":{pattern://i,inside:t}};a["language-"+n]={pattern:/[\s\S]+/,inside:Prism.languages[n]};var r={};r[e]={pattern:RegExp(/(<__[\s\S]*?>)(?:\s*|[\s\S])*?(?=<\/__>)/.source.replace(/__/g,e),"i"),lookbehind:!0,greedy:!0,inside:a},Prism.languages.insertBefore("markup","cdata",r)}}),Prism.languages.xml=Prism.languages.extend("markup",{}),Prism.languages.html=Prism.languages.markup,Prism.languages.mathml=Prism.languages.markup,Prism.languages.svg=Prism.languages.markup},{}],11:[function(e,n,t){!function(n){n.languages.php=n.languages.extend("clike",{keyword:/\b(?:__halt_compiler|abstract|and|array|as|break|callable|case|catch|class|clone|const|continue|declare|default|die|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|eval|exit|extends|final|finally|for|foreach|function|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|namespace|new|or|parent|print|private|protected|public|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\b/i,"boolean":{pattern:/\b(?:false|true)\b/i,alias:"constant"},constant:[/\b[A-Z_][A-Z0-9_]*\b/,/\b(?:null)\b/i],comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0}}),n.languages.insertBefore("php","string",{"shell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),n.languages.insertBefore("php","comment",{delimiter:{pattern:/\?>$|^<\?(?:php(?=\s)|=)?/i,alias:"important"}}),n.languages.insertBefore("php","keyword",{variable:/\$+(?:\w+\b|(?={))/i,"package":{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),n.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}});var e={pattern:/{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[.+?]|->\w+)*)/,lookbehind:!0,inside:n.languages.php};n.languages.insertBefore("php","string",{"nowdoc-string":{pattern:/<<<'([^']+)'(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\1;/,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<'[^']+'|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<'?|[';]$/}}}},"heredoc-string":{pattern:/<<<(?:"([^"]+)"(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\1;|([a-z_]\w*)(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\2;)/i,greedy:!0,alias:"string",inside:{delimiter:{pattern:/^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i,alias:"symbol",inside:{punctuation:/^<<<"?|[";]$/}},interpolation:e}},"single-quoted-string":{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0,alias:"string"},"double-quoted-string":{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,alias:"string",inside:{interpolation:e}}}),delete n.languages.php.string,n.hooks.add("before-tokenize",function(e){/<\?/.test(e.code)&&n.languages["markup-templating"].buildPlaceholders(e,"php",/<\?(?:[^"'/#]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|(?:\/\/|#)(?:[^?\n\r]|\?(?!>))*(?=$|\?>|[\r\n])|\/\*[\s\S]*?(?:\*\/|$))*?(?:\?>|$)/gi)}),n.hooks.add("after-tokenize",function(e){n.languages["markup-templating"].tokenizePlaceholders(e,"php")})}(Prism)},{}],12:[function(e,n,t){Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},"string-interpolation":{pattern:/(?:f|rf|fr)(?:("""|''')[\s\S]+?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:{{)*){(?!{)(?:[^{}]|{(?!{)(?:[^{}]|{(?!{)(?:[^{}])+})+})+}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=}$)/,lookbehind:!0},"conversion-option":{pattern:/![sra](?=[:}]$)/,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|rb|br)?("""|''')[\s\S]+?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|rb|br)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},"function":{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^\s*)@\w+(?:\.\w+)*/im,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:and|as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,"boolean":/\b(?:True|False|None)\b/,number:/(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest=Prism.languages.python,Prism.languages.py=Prism.languages.python},{}],13:[function(e,n,t){!function(e){e.languages.ruby=e.languages.extend("clike",{comment:[/#.*/,{pattern:/^=begin\s[\s\S]*?^=end/m,greedy:!0}],"class-name":{pattern:/(\b(?:class)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|protected|private|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/});var n={pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"tag"},rest:e.languages.ruby}};delete e.languages.ruby["function"],e.languages.insertBefore("ruby","keyword",{regex:[{pattern:/%r([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1[gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/,greedy:!0,inside:{interpolation:n}},{pattern:/(^|[^/])\/(?!\/)(?:\[.+?]|\\.|[^/\\\r\n])+\/[gim]{0,3}(?=\s*(?:$|[\r\n,.;})]))/,lookbehind:!0,greedy:!0}],variable:/[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/,symbol:{pattern:/(^|[^:]):[a-zA-Z_]\w*(?:[?!]|\b)/,lookbehind:!0},"method-definition":{pattern:/(\bdef\s+)[\w.]+/,lookbehind:!0,inside:{"function":/\w+$/,rest:e.languages.ruby}}}),e.languages.insertBefore("ruby","number",{builtin:/\b(?:Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|Fixnum|Float|Hash|Integer|IO|MatchData|Method|Module|NilClass|Numeric|Object|Proc|Range|Regexp|String|Struct|TMS|Symbol|ThreadGroup|Thread|Time|TrueClass)\b/,constant:/\b[A-Z]\w*(?:[?!]|\b)/}),e.languages.ruby.string=[{pattern:/%[qQiIwWxs]?([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/,greedy:!0,inside:{interpolation:n}},{pattern:/%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/,greedy:!0,inside:{interpolation:n}},{pattern:/%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/,greedy:!0,inside:{interpolation:n}},{pattern:/%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/,greedy:!0,inside:{interpolation:n}},{pattern:/%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/,greedy:!0,inside:{interpolation:n}},{pattern:/("|')(?:#\{[^}]+\}|\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0,inside:{interpolation:n}}],e.languages.rb=e.languages.ruby}(Prism)},{}],14:[function(e,n,t){var a=e("prismjs/components/prism-core");e("prismjs/components/prism-clike"),e("prismjs/components/prism-markup-templating"),e("prismjs/components/prism-c"),e("prismjs/components/prism-cpp"),e("prismjs/components/prism-csharp"),e("prismjs/components/prism-css"),e("prismjs/components/prism-java"),e("prismjs/components/prism-javascript"),e("prismjs/components/prism-markup"),e("prismjs/components/prism-php"),e("prismjs/components/prism-python"),e("prismjs/components/prism-ruby"),n.exports={boltExport:a}},{"prismjs/components/prism-c":1,"prismjs/components/prism-clike":2,"prismjs/components/prism-core":3,"prismjs/components/prism-cpp":4,"prismjs/components/prism-csharp":5,"prismjs/components/prism-css":6,"prismjs/components/prism-java":7,"prismjs/components/prism-javascript":8,"prismjs/components/prism-markup":10,"prismjs/components/prism-markup-templating":9,"prismjs/components/prism-php":11,"prismjs/components/prism-python":12,"prismjs/components/prism-ruby":13}]},{},[14])(14)});var r=window.Prism;window.Prism=e}(undefined,f,h,undefined);var y=h.exports.boltExport,w=function(e){return m.Prism&&e.getParam("codesample_global_prismjs",!1,"boolean")?m.Prism:y},v=function(e){var n=e.selection?e.selection.getNode():null;return p(n)?c.some(n):c.none()},k=function(i){var e,t,n=i.getParam("codesample_languages")||[{text:"HTML/XML",value:"markup"},{text:"JavaScript",value:"javascript"},{text:"CSS",value:"css"},{text:"PHP",value:"php"},{text:"Ruby",value:"ruby"},{text:"Python",value:"python"},{text:"Java",value:"java"},{text:"C",value:"c"},{text:"C#",value:"csharp"},{text:"C++",value:"cpp"}],a=(0===(e=n).length?c.none():c.some(e[0])).fold(function(){return""},function(e){return e.value}),r=(t=a,v(i).fold(function(){return t},function(e){var n=e.className.match(/language-(\w+)/);return n?n[1]:t})),s=v(i).fold(function(){return""},function(e){return e.textContent});i.windowManager.open({title:"Insert/Edit Code Sample",size:"large",body:{type:"panel",items:[{type:"selectbox",name:"language",label:"Language",items:n},{type:"textarea",name:"code",label:"Code view"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{language:r,code:s},onSubmit:function(e){var n,t,a,r=e.getData();n=i,t=r.language,a=r.code,n.undoManager.transact(function(){var e=v(n);return a=d.DOM.encode(a),e.fold(function(){n.insertContent('
    '+a+"
    "),n.selection.select(n.$("#__new").removeAttr("id")[0])},function(e){n.dom.setAttrib(e,"class","language-"+t),e.innerHTML=a,w(n).highlightElement(e),n.selection.select(e)})}),e.close()}})},x=function(a){a.ui.registry.addToggleButton("codesample",{icon:"code-sample",tooltip:"Insert/edit code sample",onAction:function(){return k(a)},onSetup:function(t){var e=function(){var e,n;t.setActive((n=(e=a).selection.getStart(),e.dom.is(n,'pre[class*="language-"]')))};return a.on("NodeChange",e),function(){return a.off("NodeChange",e)}}}),a.ui.registry.addMenuItem("codesample",{text:"Code sample...",icon:"code-sample",onAction:function(){return k(a)}})};a.add("codesample",function(n){var t,r,a;r=(t=n).$,t.on("PreProcess",function(e){r("pre[contenteditable=false]",e.node).filter(g(p)).each(function(e,n){var t=r(n),a=n.textContent;t.attr("class",r.trim(t.attr("class"))),t.removeAttr("contentEditable"),t.empty().append(r("").each(function(){this.textContent=a}))})}),t.on("SetContent",function(){var e=r("pre").filter(g(p)).filter(function(e,n){return"false"!==n.contentEditable});e.length&&t.undoManager.transact(function(){e.each(function(e,n){r(n).find("br").each(function(e,n){n.parentNode.replaceChild(t.getDoc().createTextNode("\n"),n)}),n.contentEditable="false",n.innerHTML=t.dom.encode(n.textContent),w(t).highlightElement(n),n.className=r.trim(n.className)})})}),x(n),(a=n).addCommand("codesample",function(){var e=a.selection.getNode();a.selection.isCollapsed()||p(e)?k(a):a.formatter.toggle("code")}),n.on("dblclick",function(e){p(e.target)&&k(n)})})}(); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/colorpicker/plugin.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/colorpicker/plugin.js new file mode 100644 index 000000000000..2d0623aacbbe --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/colorpicker/plugin.js @@ -0,0 +1,22 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +(function () { + 'use strict'; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + function Plugin () { + global.add('colorpicker', function () { + console.warn('Color picker plugin is now built in to the core editor, please remove it from your editor configuration'); + }); + } + + Plugin(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/colorpicker/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/colorpicker/plugin.min.js new file mode 100644 index 000000000000..ccdf6629cbf9 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/colorpicker/plugin.min.js @@ -0,0 +1,9 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";tinymce.util.Tools.resolve("tinymce.PluginManager").add("colorpicker",function(){console.warn("Color picker plugin is now built in to the core editor, please remove it from your editor configuration")})}(); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/contextmenu/plugin.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/contextmenu/plugin.js index ada25f77b707..0a7ef19bce43 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/contextmenu/plugin.js +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/contextmenu/plugin.js @@ -1,77 +1,22 @@ /** - * plugin.js + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing + * Version: 5.5.1 (2020-10-01) */ +(function () { + 'use strict'; -/*global tinymce:true */ - -tinymce.PluginManager.add('contextmenu', function(editor) { - var menu, contextmenuNeverUseNative = editor.settings.contextmenu_never_use_native; - - editor.on('contextmenu', function(e) { - var contextmenu; - - // Block TinyMCE menu on ctrlKey - if (e.ctrlKey && !contextmenuNeverUseNative) { - return; - } - - e.preventDefault(); - - contextmenu = editor.settings.contextmenu || 'link image inserttable | cell row column deletetable'; - - // Render menu - if (!menu) { - var items = []; - - tinymce.each(contextmenu.split(/[ ,]/), function(name) { - var item = editor.menuItems[name]; - - if (name == '|') { - item = {text: name}; - } - - if (item) { - item.shortcut = ''; // Hide shortcuts - items.push(item); - } - }); - - for (var i = 0; i < items.length; i++) { - if (items[i].text == '|') { - if (i === 0 || i == items.length - 1) { - items.splice(i, 1); - } - } - } - - menu = new tinymce.ui.Menu({ - items: items, - context: 'contextmenu' - }).addClass('contextmenu').renderTo(); - - editor.on('remove', function() { - menu.remove(); - menu = null; - }); - } else { - menu.show(); - } + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); - // Position menu - var pos = {x: e.pageX, y: e.pageY}; + function Plugin () { + global.add('contextmenu', function () { + console.warn('Context menu plugin is now built in to the core editor, please remove it from your editor configuration'); + }); + } - if (!editor.inline) { - pos = tinymce.DOM.getPos(editor.getContentAreaContainer()); - pos.x += e.clientX; - pos.y += e.clientY; - } + Plugin(); - menu.moveTo(pos.x, pos.y); - }); -}); \ No newline at end of file +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/contextmenu/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/contextmenu/plugin.min.js index 06f0d4bd5d98..9ecd56617a30 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/contextmenu/plugin.min.js +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/contextmenu/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("contextmenu",function(e){var n,t=e.settings.contextmenu_never_use_native;e.on("contextmenu",function(i){var o;if(!i.ctrlKey||t){if(i.preventDefault(),o=e.settings.contextmenu||"link image inserttable | cell row column deletetable",n)n.show();else{var c=[];tinymce.each(o.split(/[ ,]/),function(n){var t=e.menuItems[n];"|"==n&&(t={text:n}),t&&(t.shortcut="",c.push(t))});for(var a=0;a 1) { + console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); + }; + var fromTag = function (tag, scope) { + var doc = scope || document; + var node = doc.createElement(tag); + return fromDom(node); + }; + var fromText = function (text, scope) { + var doc = scope || document; + var node = doc.createTextNode(text); + return fromDom(node); + }; + var fromDom = function (node) { + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: node }; + }; + var fromPoint = function (docElm, x, y) { + return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); + }; + var SugarElement = { + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint + }; + + var Global = typeof window !== 'undefined' ? window : Function('return this;')(); + + var DOCUMENT = 9; + var DOCUMENT_FRAGMENT = 11; + var TEXT = 3; + + var type = function (element) { + return element.dom.nodeType; + }; + var isType = function (t) { + return function (element) { + return type(element) === t; + }; + }; + var isText = isType(TEXT); + var isDocument = isType(DOCUMENT); + var isDocumentFragment = isType(DOCUMENT_FRAGMENT); + + var owner = function (element) { + return SugarElement.fromDom(element.dom.ownerDocument); + }; + var documentOrOwner = function (dos) { + return isDocument(dos) ? dos : owner(dos); + }; + + var isShadowRoot = function (dos) { + return isDocumentFragment(dos); + }; + var supported = isFunction(Element.prototype.attachShadow) && isFunction(Node.prototype.getRootNode); + var getRootNode = supported ? function (e) { + return SugarElement.fromDom(e.dom.getRootNode()); + } : documentOrOwner; + var getShadowRoot = function (e) { + var r = getRootNode(e); + return isShadowRoot(r) ? Optional.some(r) : Optional.none(); + }; + var getShadowHost = function (e) { + return SugarElement.fromDom(e.dom.host); + }; + + var inBody = function (element) { + var dom = isText(element) ? element.dom.parentNode : element.dom; + if (dom === undefined || dom === null || dom.ownerDocument === null) { + return false; + } + var doc = dom.ownerDocument; + return getShadowRoot(SugarElement.fromDom(dom)).fold(function () { + return doc.body.contains(dom); + }, compose1(inBody, getShadowHost)); + }; + + var get = function (element, property) { + var dom = element.dom; + var styles = window.getComputedStyle(dom); + var r = styles.getPropertyValue(property); + return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r; + }; + var getUnsafeProperty = function (dom, property) { + return isSupported(dom) ? dom.style.getPropertyValue(property) : ''; + }; + + var getDirection = function (element) { + return get(element, 'direction') === 'rtl' ? 'rtl' : 'ltr'; + }; + + var getNodeChangeHandler = function (editor, dir) { + return function (api) { + var nodeChangeHandler = function (e) { + var element = SugarElement.fromDom(e.element); + api.setActive(getDirection(element) === dir); + }; + editor.on('NodeChange', nodeChangeHandler); + return function () { + return editor.off('NodeChange', nodeChangeHandler); + }; + }; + }; + var register$1 = function (editor) { + editor.ui.registry.addToggleButton('ltr', { + tooltip: 'Left to right', + icon: 'ltr', + onAction: function () { + return editor.execCommand('mceDirectionLTR'); + }, + onSetup: getNodeChangeHandler(editor, 'ltr') + }); + editor.ui.registry.addToggleButton('rtl', { + tooltip: 'Right to left', + icon: 'rtl', + onAction: function () { + return editor.execCommand('mceDirectionRTL'); + }, + onSetup: getNodeChangeHandler(editor, 'rtl') + }); + }; + + function Plugin () { + global.add('directionality', function (editor) { + register(editor); + register$1(editor); + }); + } + + Plugin(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/directionality/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/directionality/plugin.min.js new file mode 100644 index 000000000000..e556a297559b --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/directionality/plugin.min.js @@ -0,0 +1,9 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var n,t,e,o,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(n,t){var e,o=n.dom,r=n.selection.getSelectedBlocks();r.length&&(e=o.getAttrib(r[0],"dir"),u.each(r,function(n){o.getParent(n.parentNode,'*[dir="'+t+'"]',o.getRoot())||o.setAttrib(n,"dir",e!==t?t:null)}),n.nodeChanged())},c=function(n){return function(){return n}},f=c(!1),d=c(!0),l=function(){return m},m=(n=function(n){return n.isNone()},{fold:function(n,t){return n()},is:f,isSome:f,isNone:d,getOr:e=function(n){return n},getOrThunk:t=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:c(null),getOrUndefined:c(undefined),or:e,orThunk:t,map:l,each:function(){},bind:l,exists:f,forall:d,filter:l,equals:n,equals_:n,toArray:function(){return[]},toString:c("none()")}),a=function(e){var n=c(e),t=function(){return r},o=function(n){return n(e)},r={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:d,isNone:f,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:t,orThunk:t,map:function(n){return a(n(e))},each:function(n){n(e)},bind:o,exists:o,forall:o,filter:function(n){return n(e)?r:m},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(n){return n.is(e)},equals_:function(n,t){return n.fold(f,function(n){return t(e,n)})}};return r},s={some:a,none:l,from:function(n){return null===n||n===undefined?m:a(n)}},g=(o="function",function(n){return typeof n===o}),h=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:n}},y={fromHtml:function(n,t){var e=(t||document).createElement("div");if(e.innerHTML=n,!e.hasChildNodes()||1= max; + }; + }); + for (var i = 0; i < list.length; i++) { + if (pattern.length === 0 || emojiMatches(list[i], lowerCasePattern)) { + matches.push({ + value: list[i].char, + text: list[i].title, + icon: list[i].char + }); + if (reachedLimit(matches.length)) { + break; + } + } + } + return matches; + }; + + var init = function (editor, database) { + editor.ui.registry.addAutocompleter('emoticons', { + ch: ':', + columns: 'auto', + minChars: 2, + fetch: function (pattern, maxResults) { + return database.waitForLoad().then(function () { + var candidates = database.listAll(); + return emojisFrom(candidates, pattern, Optional.some(maxResults)); + }); + }, + onAction: function (autocompleteApi, rng, value) { + editor.selection.setRng(rng); + editor.insertContent(value); + autocompleteApi.hide(); + } + }); + }; + + var last = function (fn, rate) { + var timer = null; + var cancel = function () { + if (timer !== null) { + clearTimeout(timer); + timer = null; + } + }; + var throttle = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (timer !== null) { + clearTimeout(timer); + } + timer = setTimeout(function () { + fn.apply(null, args); + timer = null; + }, rate); + }; + return { + cancel: cancel, + throttle: throttle + }; + }; + + var insertEmoticon = function (editor, ch) { + editor.insertContent(ch); + }; + + var patternName = 'pattern'; + var open = function (editor, database) { + var initialState = { + pattern: '', + results: emojisFrom(database.listAll(), '', Optional.some(300)) + }; + var currentTab = Cell(ALL_CATEGORY); + var scan = function (dialogApi) { + var dialogData = dialogApi.getData(); + var category = currentTab.get(); + var candidates = database.listCategory(category); + var results = emojisFrom(candidates, dialogData[patternName], category === ALL_CATEGORY ? Optional.some(300) : Optional.none()); + dialogApi.setData({ results: results }); + }; + var updateFilter = last(function (dialogApi) { + scan(dialogApi); + }, 200); + var searchField = { + label: 'Search', + type: 'input', + name: patternName + }; + var resultsField = { + type: 'collection', + name: 'results' + }; + var getInitialState = function () { + var body = { + type: 'tabpanel', + tabs: map$1(database.listCategories(), function (cat) { + return { + title: cat, + name: cat, + items: [ + searchField, + resultsField + ] + }; + }) + }; + return { + title: 'Emoticons', + size: 'normal', + body: body, + initialData: initialState, + onTabChange: function (dialogApi, details) { + currentTab.set(details.newTabName); + updateFilter.throttle(dialogApi); + }, + onChange: updateFilter.throttle, + onAction: function (dialogApi, actionData) { + if (actionData.name === 'results') { + insertEmoticon(editor, actionData.value); + dialogApi.close(); + } + }, + buttons: [{ + type: 'cancel', + text: 'Close', + primary: true + }] + }; + }; + var dialogApi = editor.windowManager.open(getInitialState()); + dialogApi.focus(patternName); + if (!database.hasLoaded()) { + dialogApi.block('Loading emoticons...'); + database.waitForLoad().then(function () { + dialogApi.redial(getInitialState()); + updateFilter.throttle(dialogApi); + dialogApi.focus(patternName); + dialogApi.unblock(); + }).catch(function (_err) { + dialogApi.redial({ + title: 'Emoticons', + body: { + type: 'panel', + items: [{ + type: 'alertbanner', + level: 'error', + icon: 'warning', + text: '

    Could not load emoticons

    ' + }] + }, + buttons: [{ + type: 'cancel', + text: 'Close', + primary: true + }], + initialData: { + pattern: '', + results: [] + } + }); + dialogApi.focus(patternName); + dialogApi.unblock(); + }); + } + }; + + var register = function (editor, database) { + var onAction = function () { + return open(editor, database); + }; + editor.ui.registry.addButton('emoticons', { + tooltip: 'Emoticons', + icon: 'emoji', + onAction: onAction + }); + editor.ui.registry.addMenuItem('emoticons', { + text: 'Emoticons...', + icon: 'emoji', + onAction: onAction + }); + }; + + function Plugin () { + global.add('emoticons', function (editor, pluginUrl) { + var databaseUrl = getEmoticonDatabaseUrl(editor, pluginUrl); + var databaseId = getEmoticonDatabaseId(editor); + var database = initDatabase(editor, databaseUrl, databaseId); + register(editor, database); + init(editor, database); + }); + } + + Plugin(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/emoticons/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/emoticons/plugin.min.js new file mode 100644 index 000000000000..a44a370f6bee --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/emoticons/plugin.min.js @@ -0,0 +1,9 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var u,n,t,e,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=function(){return(r=Object.assign||function(n){for(var t,e=1,o=arguments.length;eCould not load emoticons

    "}]},buttons:[{type:"cancel",text:"Close",primary:!0}],initialData:{pattern:"",results:[]}}),f.focus(x),f.unblock()}))};o.add("emoticons",function(n,t){var e,o,r,i,u,a,c,l=(o=t,(e=n).getParam("emoticons_database_url",o+"/js/emojis"+e.suffix+".js")),s=n.getParam("emoticons_database_id","tinymce.plugins.emoticons","string"),f=_(n,l,s);i=f,u=function(){return L(r,i)},(r=n).ui.registry.addButton("emoticons",{tooltip:"Emoticons",icon:"emoji",onAction:u}),r.ui.registry.addMenuItem("emoticons",{text:"Emoticons...",icon:"emoji",onAction:u}),c=f,(a=n).ui.registry.addAutocompleter("emoticons",{ch:":",columns:"auto",minChars:2,fetch:function(t,e){return c.waitForLoad().then(function(){var n=c.listAll();return P(n,t,y.some(e))})},onAction:function(n,t,e){a.selection.setRng(t),a.insertContent(e),n.hide()}})})}(); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/fullpage/plugin.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/fullpage/plugin.js new file mode 100644 index 000000000000..a38816220b9a --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/fullpage/plugin.js @@ -0,0 +1,544 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +(function () { + 'use strict'; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; + }; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var __assign = function () { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.html.DomParser'); + + var global$3 = tinymce.util.Tools.resolve('tinymce.html.Node'); + + var global$4 = tinymce.util.Tools.resolve('tinymce.html.Serializer'); + + var shouldHideInSourceView = function (editor) { + return editor.getParam('fullpage_hide_in_source_view'); + }; + var getDefaultXmlPi = function (editor) { + return editor.getParam('fullpage_default_xml_pi'); + }; + var getDefaultEncoding = function (editor) { + return editor.getParam('fullpage_default_encoding'); + }; + var getDefaultFontFamily = function (editor) { + return editor.getParam('fullpage_default_font_family'); + }; + var getDefaultFontSize = function (editor) { + return editor.getParam('fullpage_default_font_size'); + }; + var getDefaultTextColor = function (editor) { + return editor.getParam('fullpage_default_text_color'); + }; + var getDefaultTitle = function (editor) { + return editor.getParam('fullpage_default_title'); + }; + var getDefaultDocType = function (editor) { + return editor.getParam('fullpage_default_doctype', ''); + }; + var getProtect = function (editor) { + return editor.getParam('protect'); + }; + + var parseHeader = function (head) { + return global$2({ + validate: false, + root_name: '#document' + }).parse(head, { format: 'xhtml' }); + }; + var htmlToData = function (editor, head) { + var headerFragment = parseHeader(head); + var data = {}; + var elm, matches; + function getAttr(elm, name) { + var value = elm.attr(name); + return value || ''; + } + data.fontface = getDefaultFontFamily(editor); + data.fontsize = getDefaultFontSize(editor); + elm = headerFragment.firstChild; + if (elm.type === 7) { + data.xml_pi = true; + matches = /encoding="([^"]+)"/.exec(elm.value); + if (matches) { + data.docencoding = matches[1]; + } + } + elm = headerFragment.getAll('#doctype')[0]; + if (elm) { + data.doctype = ''; + } + elm = headerFragment.getAll('title')[0]; + if (elm && elm.firstChild) { + data.title = elm.firstChild.value; + } + global$1.each(headerFragment.getAll('meta'), function (meta) { + var name = meta.attr('name'); + var httpEquiv = meta.attr('http-equiv'); + var matches; + if (name) { + data[name.toLowerCase()] = meta.attr('content'); + } else if (httpEquiv === 'Content-Type') { + matches = /charset\s*=\s*(.*)\s*/gi.exec(meta.attr('content')); + if (matches) { + data.docencoding = matches[1]; + } + } + }); + elm = headerFragment.getAll('html')[0]; + if (elm) { + data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang'); + } + data.stylesheets = []; + global$1.each(headerFragment.getAll('link'), function (link) { + if (link.attr('rel') === 'stylesheet') { + data.stylesheets.push(link.attr('href')); + } + }); + elm = headerFragment.getAll('body')[0]; + if (elm) { + data.langdir = getAttr(elm, 'dir'); + data.style = getAttr(elm, 'style'); + data.visited_color = getAttr(elm, 'vlink'); + data.link_color = getAttr(elm, 'link'); + data.active_color = getAttr(elm, 'alink'); + } + return data; + }; + var dataToHtml = function (editor, data, head) { + var headElement, elm, value; + var dom = editor.dom; + function setAttr(elm, name, value) { + elm.attr(name, value ? value : undefined); + } + function addHeadNode(node) { + if (headElement.firstChild) { + headElement.insert(node, headElement.firstChild); + } else { + headElement.append(node); + } + } + var headerFragment = parseHeader(head); + headElement = headerFragment.getAll('head')[0]; + if (!headElement) { + elm = headerFragment.getAll('html')[0]; + headElement = new global$3('head', 1); + if (elm.firstChild) { + elm.insert(headElement, elm.firstChild, true); + } else { + elm.append(headElement); + } + } + elm = headerFragment.firstChild; + if (data.xml_pi) { + value = 'version="1.0"'; + if (data.docencoding) { + value += ' encoding="' + data.docencoding + '"'; + } + if (elm.type !== 7) { + elm = new global$3('xml', 7); + headerFragment.insert(elm, headerFragment.firstChild, true); + } + elm.value = value; + } else if (elm && elm.type === 7) { + elm.remove(); + } + elm = headerFragment.getAll('#doctype')[0]; + if (data.doctype) { + if (!elm) { + elm = new global$3('#doctype', 10); + if (data.xml_pi) { + headerFragment.insert(elm, headerFragment.firstChild); + } else { + addHeadNode(elm); + } + } + elm.value = data.doctype.substring(9, data.doctype.length - 1); + } else if (elm) { + elm.remove(); + } + elm = null; + global$1.each(headerFragment.getAll('meta'), function (meta) { + if (meta.attr('http-equiv') === 'Content-Type') { + elm = meta; + } + }); + if (data.docencoding) { + if (!elm) { + elm = new global$3('meta', 1); + elm.attr('http-equiv', 'Content-Type'); + elm.shortEnded = true; + addHeadNode(elm); + } + elm.attr('content', 'text/html; charset=' + data.docencoding); + } else if (elm) { + elm.remove(); + } + elm = headerFragment.getAll('title')[0]; + if (data.title) { + if (!elm) { + elm = new global$3('title', 1); + addHeadNode(elm); + } else { + elm.empty(); + } + elm.append(new global$3('#text', 3)).value = data.title; + } else if (elm) { + elm.remove(); + } + global$1.each('keywords,description,author,copyright,robots'.split(','), function (name) { + var nodes = headerFragment.getAll('meta'); + var i, meta; + var value = data[name]; + for (i = 0; i < nodes.length; i++) { + meta = nodes[i]; + if (meta.attr('name') === name) { + if (value) { + meta.attr('content', value); + } else { + meta.remove(); + } + return; + } + } + if (value) { + elm = new global$3('meta', 1); + elm.attr('name', name); + elm.attr('content', value); + elm.shortEnded = true; + addHeadNode(elm); + } + }); + var currentStyleSheetsMap = {}; + global$1.each(headerFragment.getAll('link'), function (stylesheet) { + if (stylesheet.attr('rel') === 'stylesheet') { + currentStyleSheetsMap[stylesheet.attr('href')] = stylesheet; + } + }); + global$1.each(data.stylesheets, function (stylesheet) { + if (!currentStyleSheetsMap[stylesheet]) { + elm = new global$3('link', 1); + elm.attr({ + rel: 'stylesheet', + text: 'text/css', + href: stylesheet + }); + elm.shortEnded = true; + addHeadNode(elm); + } + delete currentStyleSheetsMap[stylesheet]; + }); + global$1.each(currentStyleSheetsMap, function (stylesheet) { + stylesheet.remove(); + }); + elm = headerFragment.getAll('body')[0]; + if (elm) { + setAttr(elm, 'dir', data.langdir); + setAttr(elm, 'style', data.style); + setAttr(elm, 'vlink', data.visited_color); + setAttr(elm, 'link', data.link_color); + setAttr(elm, 'alink', data.active_color); + dom.setAttribs(editor.getBody(), { + style: data.style, + dir: data.dir, + vLink: data.visited_color, + link: data.link_color, + aLink: data.active_color + }); + } + elm = headerFragment.getAll('html')[0]; + if (elm) { + setAttr(elm, 'lang', data.langcode); + setAttr(elm, 'xml:lang', data.langcode); + } + if (!headElement.firstChild) { + headElement.remove(); + } + var html = global$4({ + validate: false, + indent: true, + indent_before: 'head,html,body,meta,title,script,link,style', + indent_after: 'head,html,body,meta,title,script,link,style' + }).serialize(headerFragment); + return html.substring(0, html.indexOf('')); + }; + + var open = function (editor, headState) { + var data = htmlToData(editor, headState.get()); + var defaultData = { + title: '', + keywords: '', + description: '', + robots: '', + author: '', + docencoding: '' + }; + var initialData = __assign(__assign({}, defaultData), data); + editor.windowManager.open({ + title: 'Metadata and Document Properties', + size: 'normal', + body: { + type: 'panel', + items: [ + { + name: 'title', + type: 'input', + label: 'Title' + }, + { + name: 'keywords', + type: 'input', + label: 'Keywords' + }, + { + name: 'description', + type: 'input', + label: 'Description' + }, + { + name: 'robots', + type: 'input', + label: 'Robots' + }, + { + name: 'author', + type: 'input', + label: 'Author' + }, + { + name: 'docencoding', + type: 'input', + label: 'Encoding' + } + ] + }, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + initialData: initialData, + onSubmit: function (api) { + var nuData = api.getData(); + var headHtml = dataToHtml(editor, global$1.extend(data, nuData), headState.get()); + headState.set(headHtml); + api.close(); + } + }); + }; + + var register = function (editor, headState) { + editor.addCommand('mceFullPageProperties', function () { + open(editor, headState); + }); + }; + + var protectHtml = function (protect, html) { + global$1.each(protect, function (pattern) { + html = html.replace(pattern, function (str) { + return ''; + }); + }); + return html; + }; + var unprotectHtml = function (html) { + return html.replace(//g, function (a, m) { + return unescape(m); + }); + }; + + var each = global$1.each; + var low = function (s) { + return s.replace(/<\/?[A-Z]+/g, function (a) { + return a.toLowerCase(); + }); + }; + var handleSetContent = function (editor, headState, footState, evt) { + var startPos, endPos, content, styles = ''; + var dom = editor.dom; + if (evt.selection) { + return; + } + content = protectHtml(getProtect(editor), evt.content); + if (evt.format === 'raw' && headState.get()) { + return; + } + if (evt.source_view && shouldHideInSourceView(editor)) { + return; + } + if (content.length === 0 && !evt.source_view) { + content = global$1.trim(headState.get()) + '\n' + global$1.trim(content) + '\n' + global$1.trim(footState.get()); + } + content = content.replace(/<(\/?)BODY/gi, '<$1body'); + startPos = content.indexOf('', startPos); + headState.set(low(content.substring(0, startPos + 1))); + endPos = content.indexOf('\n'); + } + var headerFragment = parseHeader(headState.get()); + each(headerFragment.getAll('style'), function (node) { + if (node.firstChild) { + styles += node.firstChild.value; + } + }); + var bodyElm = headerFragment.getAll('body')[0]; + if (bodyElm) { + dom.setAttribs(editor.getBody(), { + style: bodyElm.attr('style') || '', + dir: bodyElm.attr('dir') || '', + vLink: bodyElm.attr('vlink') || '', + link: bodyElm.attr('link') || '', + aLink: bodyElm.attr('alink') || '' + }); + } + dom.remove('fullpage_styles'); + var headElm = editor.getDoc().getElementsByTagName('head')[0]; + if (styles) { + var styleElm = dom.add(headElm, 'style', { id: 'fullpage_styles' }); + styleElm.appendChild(document.createTextNode(styles)); + } + var currentStyleSheetsMap = {}; + global$1.each(headElm.getElementsByTagName('link'), function (stylesheet) { + if (stylesheet.rel === 'stylesheet' && stylesheet.getAttribute('data-mce-fullpage')) { + currentStyleSheetsMap[stylesheet.href] = stylesheet; + } + }); + global$1.each(headerFragment.getAll('link'), function (stylesheet) { + var href = stylesheet.attr('href'); + if (!href) { + return true; + } + if (!currentStyleSheetsMap[href] && stylesheet.attr('rel') === 'stylesheet') { + dom.add(headElm, 'link', { + 'rel': 'stylesheet', + 'text': 'text/css', + href: href, + 'data-mce-fullpage': '1' + }); + } + delete currentStyleSheetsMap[href]; + }); + global$1.each(currentStyleSheetsMap, function (stylesheet) { + stylesheet.parentNode.removeChild(stylesheet); + }); + }; + var getDefaultHeader = function (editor) { + var header = '', value, styles = ''; + if (getDefaultXmlPi(editor)) { + var piEncoding = getDefaultEncoding(editor); + header += '\n'; + } + header += getDefaultDocType(editor); + header += '\n\n\n'; + if (value = getDefaultTitle(editor)) { + header += '' + value + '\n'; + } + if (value = getDefaultEncoding(editor)) { + header += '\n'; + } + if (value = getDefaultFontFamily(editor)) { + styles += 'font-family: ' + value + ';'; + } + if (value = getDefaultFontSize(editor)) { + styles += 'font-size: ' + value + ';'; + } + if (value = getDefaultTextColor(editor)) { + styles += 'color: ' + value + ';'; + } + header += '\n\n'; + return header; + }; + var handleGetContent = function (editor, head, foot, evt) { + if (!evt.selection && (!evt.source_view || !shouldHideInSourceView(editor))) { + evt.content = unprotectHtml(global$1.trim(head) + '\n' + global$1.trim(evt.content) + '\n' + global$1.trim(foot)); + } + }; + var setup = function (editor, headState, footState) { + editor.on('BeforeSetContent', function (evt) { + handleSetContent(editor, headState, footState, evt); + }); + editor.on('GetContent', function (evt) { + handleGetContent(editor, headState.get(), footState.get(), evt); + }); + }; + + var register$1 = function (editor) { + editor.ui.registry.addButton('fullpage', { + tooltip: 'Metadata and document properties', + icon: 'document-properties', + onAction: function () { + editor.execCommand('mceFullPageProperties'); + } + }); + editor.ui.registry.addMenuItem('fullpage', { + text: 'Metadata and document properties', + icon: 'document-properties', + onAction: function () { + editor.execCommand('mceFullPageProperties'); + } + }); + }; + + function Plugin () { + global.add('fullpage', function (editor) { + var headState = Cell(''), footState = Cell(''); + register(editor, headState); + register$1(editor); + setup(editor, headState, footState); + }); + } + + Plugin(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/fullpage/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/fullpage/plugin.min.js new file mode 100644 index 000000000000..ee30e994b2bc --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/fullpage/plugin.min.js @@ -0,0 +1,9 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var s=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(){return(u=Object.assign||function(e){for(var t,n=1,l=arguments.length;n"),(n=r.getAll("title")[0])&&n.firstChild&&(a.title=n.firstChild.value),p.each(r.getAll("meta"),function(e){var t,n=e.attr("name"),l=e.attr("http-equiv");n?a[n.toLowerCase()]=e.attr("content"):"Content-Type"===l&&(t=/charset\s*=\s*(.*)\s*/gi.exec(e.attr("content")))&&(a.docencoding=t[1])}),(n=r.getAll("html")[0])&&(a.langcode=s(n,"lang")||s(n,"xml:lang")),a.stylesheets=[],p.each(r.getAll("link"),function(e){"stylesheet"===e.attr("rel")&&a.stylesheets.push(e.attr("href"))}),(n=r.getAll("body")[0])&&(a.langdir=s(n,"dir"),a.style=s(n,"style"),a.visited_color=s(n,"vlink"),a.link_color=s(n,"link"),a.active_color=s(n,"alink")),a);function s(e,t){return e.attr(t)||""}var d=u(u({},{title:"",keywords:"",description:"",robots:"",author:"",docencoding:""}),c);l.windowManager.open({title:"Metadata and Document Properties",size:"normal",body:{type:"panel",items:[{name:"title",type:"input",label:"Title"},{name:"keywords",type:"input",label:"Keywords"},{name:"description",type:"input",label:"Description"},{name:"robots",type:"input",label:"Robots"},{name:"author",type:"input",label:"Author"},{name:"docencoding",type:"input",label:"Encoding"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:d,onSubmit:function(e){var t=e.getData(),n=function(e,o,t){var r,n,l=e.dom;function i(e,t,n){e.attr(t,n||undefined)}function a(e){c.firstChild?c.insert(e,c.firstChild):c.append(e)}var c,s=v(t);(c=s.getAll("head")[0])||(r=s.getAll("html")[0],c=new m("head",1),r.firstChild?r.insert(c,r.firstChild,!0):r.append(c)),r=s.firstChild,o.xml_pi?(n='version="1.0"',o.docencoding&&(n+=' encoding="'+o.docencoding+'"'),7!==r.type&&(r=new m("xml",7),s.insert(r,s.firstChild,!0)),r.value=n):r&&7===r.type&&r.remove(),r=s.getAll("#doctype")[0],o.doctype?(r||(r=new m("#doctype",10),o.xml_pi?s.insert(r,s.firstChild):a(r)),r.value=o.doctype.substring(9,o.doctype.length-1)):r&&r.remove(),r=null,p.each(s.getAll("meta"),function(e){"Content-Type"===e.attr("http-equiv")&&(r=e)}),o.docencoding?(r||((r=new m("meta",1)).attr("http-equiv","Content-Type"),r.shortEnded=!0,a(r)),r.attr("content","text/html; charset="+o.docencoding)):r&&r.remove(),r=s.getAll("title")[0],o.title?(r?r.empty():a(r=new m("title",1)),r.append(new m("#text",3)).value=o.title):r&&r.remove(),p.each("keywords,description,author,copyright,robots".split(","),function(e){for(var t,n=s.getAll("meta"),l=o[e],i=0;i"))}(l,p.extend(c,t),i.get());i.set(n),e.close()}})},_=p.each,b=function(e){return e.replace(/<\/?[A-Z]+/g,function(e){return e.toLowerCase()})},x=function(e,t,n,l){var i,o,r,a,c,s,d,u,m,f="",g=e.dom;l.selection||(a=e.getParam("protect"),c=l.content,p.each(a,function(e){c=c.replace(e,function(e){return"\x3c!--mce:protected "+escape(e)+"--\x3e"})}),r=c,"raw"===l.format&&t.get()||l.source_view&&y(e)||(0!==r.length||l.source_view||(r=p.trim(t.get())+"\n"+p.trim(r)+"\n"+p.trim(n.get())),-1!==(i=(r=r.replace(/<(\/?)BODY/gi,"<$1body")).indexOf("",i),t.set(b(r.substring(0,i+1))),-1===(o=r.indexOf("\n")),s=v(t.get()),_(s.getAll("style"),function(e){e.firstChild&&(f+=e.firstChild.value)}),(d=s.getAll("body")[0])&&g.setAttribs(e.getBody(),{style:d.attr("style")||"",dir:d.attr("dir")||"",vLink:d.attr("vlink")||"",link:d.attr("link")||"",aLink:d.attr("alink")||""}),g.remove("fullpage_styles"),u=e.getDoc().getElementsByTagName("head")[0],f&&g.add(u,"style",{id:"fullpage_styles"}).appendChild(document.createTextNode(f)),m={},p.each(u.getElementsByTagName("link"),function(e){"stylesheet"===e.rel&&e.getAttribute("data-mce-fullpage")&&(m[e.href]=e)}),p.each(s.getAll("link"),function(e){var t=e.attr("href");if(!t)return!0;m[t]||"stylesheet"!==e.attr("rel")||g.add(u,"link",{rel:"stylesheet",text:"text/css",href:t,"data-mce-fullpage":"1"}),delete m[t]}),p.each(m,function(e){e.parentNode.removeChild(e)})))},k=function(e){var t,n="",l="";return e.getParam("fullpage_default_xml_pi")&&(n+='\n'),n+=e.getParam("fullpage_default_doctype",""),n+="\n\n\n",(t=e.getParam("fullpage_default_title"))&&(n+=""+t+"\n"),(t=i(e))&&(n+='\n'),(t=g(e))&&(l+="font-family: "+t+";"),(t=h(e))&&(l+="font-size: "+t+";"),(t=e.getParam("fullpage_default_text_color"))&&(l+="color: "+t+";"),n+="\n\n"},C=function(e,t,n,l){l.selection||l.source_view&&y(e)||(l.content=(p.trim(t)+"\n"+p.trim(l.content)+"\n"+p.trim(n)).replace(//g,function(e,t){return unescape(t)}))};e.add("fullpage",function(e){var t,n,l,i,o,r,a=s(""),c=s("");n=a,(t=e).addCommand("mceFullPageProperties",function(){d(t,n)}),(l=e).ui.registry.addButton("fullpage",{tooltip:"Metadata and document properties",icon:"document-properties",onAction:function(){l.execCommand("mceFullPageProperties")}}),l.ui.registry.addMenuItem("fullpage",{text:"Metadata and document properties",icon:"document-properties",onAction:function(){l.execCommand("mceFullPageProperties")}}),o=a,r=c,(i=e).on("BeforeSetContent",function(e){x(i,o,r,e)}),i.on("GetContent",function(e){C(i,o.get(),r.get(),e)})})}(); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/fullscreen/plugin.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/fullscreen/plugin.js new file mode 100644 index 000000000000..270aa7a30b18 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/fullscreen/plugin.js @@ -0,0 +1,969 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +(function () { + 'use strict'; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; + }; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var get = function (fullscreenState) { + return { + isFullscreen: function () { + return fullscreenState.get() !== null; + } + }; + }; + + var noop = function () { + }; + var compose = function (fa, fb) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return fa(fb.apply(null, args)); + }; + }; + var compose1 = function (fbc, fab) { + return function (a) { + return fbc(fab(a)); + }; + }; + var constant = function (value) { + return function () { + return value; + }; + }; + function curry(fn) { + var initialArgs = []; + for (var _i = 1; _i < arguments.length; _i++) { + initialArgs[_i - 1] = arguments[_i]; + } + return function () { + var restArgs = []; + for (var _i = 0; _i < arguments.length; _i++) { + restArgs[_i] = arguments[_i]; + } + var all = initialArgs.concat(restArgs); + return fn.apply(null, all); + }; + } + var never = constant(false); + var always = constant(true); + + var none = function () { + return NONE; + }; + var NONE = function () { + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; + }(); + var some = function (a) { + var constant_a = constant(a); + var self = function () { + return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; + }; + var from = function (value) { + return value === null || value === undefined ? NONE : some(value); + }; + var Optional = { + some: some, + none: none, + from: from + }; + + var revocable = function (doRevoke) { + var subject = Cell(Optional.none()); + var revoke = function () { + return subject.get().each(doRevoke); + }; + var clear = function () { + revoke(); + subject.set(Optional.none()); + }; + var isSet = function () { + return subject.get().isSome(); + }; + var set = function (s) { + revoke(); + subject.set(Optional.some(s)); + }; + return { + clear: clear, + isSet: isSet, + set: set + }; + }; + var unbindable = function () { + return revocable(function (s) { + return s.unbind(); + }); + }; + var value = function () { + var subject = Cell(Optional.none()); + var clear = function () { + return subject.set(Optional.none()); + }; + var set = function (s) { + return subject.set(Optional.some(s)); + }; + var isSet = function () { + return subject.get().isSome(); + }; + var on = function (f) { + return subject.get().each(f); + }; + return { + clear: clear, + set: set, + isSet: isSet, + on: on + }; + }; + + var typeOf = function (x) { + var t = typeof x; + if (x === null) { + return 'null'; + } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } else { + return t; + } + }; + var isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isSimpleType = function (type) { + return function (value) { + return typeof value === type; + }; + }; + var isString = isType('string'); + var isArray = isType('array'); + var isBoolean = isSimpleType('boolean'); + var isNullable = function (a) { + return a === null || a === undefined; + }; + var isNonNullable = function (a) { + return !isNullable(a); + }; + var isFunction = isSimpleType('function'); + var isNumber = isSimpleType('number'); + + var nativePush = Array.prototype.push; + var map = function (xs, f) { + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; + }; + var each = function (xs, f) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } + }; + var filter = function (xs, pred) { + var r = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + r.push(x); + } + } + return r; + }; + var flatten = function (xs) { + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); + } + nativePush.apply(r, xs[i]); + } + return r; + }; + var bind = function (xs, f) { + return flatten(map(xs, f)); + }; + var head = function (xs) { + return xs.length === 0 ? Optional.none() : Optional.some(xs[0]); + }; + + var keys = Object.keys; + var each$1 = function (obj, f) { + var props = keys(obj); + for (var k = 0, len = props.length; k < len; k++) { + var i = props[k]; + var x = obj[i]; + f(x, i); + } + }; + + var isSupported = function (dom) { + return dom.style !== undefined && isFunction(dom.style.getPropertyValue); + }; + + var fromHtml = function (html, scope) { + var doc = scope || document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); + }; + var fromTag = function (tag, scope) { + var doc = scope || document; + var node = doc.createElement(tag); + return fromDom(node); + }; + var fromText = function (text, scope) { + var doc = scope || document; + var node = doc.createTextNode(text); + return fromDom(node); + }; + var fromDom = function (node) { + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: node }; + }; + var fromPoint = function (docElm, x, y) { + return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); + }; + var SugarElement = { + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint + }; + + var Global = typeof window !== 'undefined' ? window : Function('return this;')(); + + var DOCUMENT = 9; + var DOCUMENT_FRAGMENT = 11; + var ELEMENT = 1; + var TEXT = 3; + + var type = function (element) { + return element.dom.nodeType; + }; + var isType$1 = function (t) { + return function (element) { + return type(element) === t; + }; + }; + var isElement = isType$1(ELEMENT); + var isText = isType$1(TEXT); + var isDocument = isType$1(DOCUMENT); + var isDocumentFragment = isType$1(DOCUMENT_FRAGMENT); + + var is = function (element, selector) { + var dom = element.dom; + if (dom.nodeType !== ELEMENT) { + return false; + } else { + var elem = dom; + if (elem.matches !== undefined) { + return elem.matches(selector); + } else if (elem.msMatchesSelector !== undefined) { + return elem.msMatchesSelector(selector); + } else if (elem.webkitMatchesSelector !== undefined) { + return elem.webkitMatchesSelector(selector); + } else if (elem.mozMatchesSelector !== undefined) { + return elem.mozMatchesSelector(selector); + } else { + throw new Error('Browser lacks native selectors'); + } + } + }; + var bypassSelector = function (dom) { + return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0; + }; + var all = function (selector, scope) { + var base = scope === undefined ? document : scope.dom; + return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), SugarElement.fromDom); + }; + + var eq = function (e1, e2) { + return e1.dom === e2.dom; + }; + + var owner = function (element) { + return SugarElement.fromDom(element.dom.ownerDocument); + }; + var documentOrOwner = function (dos) { + return isDocument(dos) ? dos : owner(dos); + }; + var parent = function (element) { + return Optional.from(element.dom.parentNode).map(SugarElement.fromDom); + }; + var parents = function (element, isRoot) { + var stop = isFunction(isRoot) ? isRoot : never; + var dom = element.dom; + var ret = []; + while (dom.parentNode !== null && dom.parentNode !== undefined) { + var rawParent = dom.parentNode; + var p = SugarElement.fromDom(rawParent); + ret.push(p); + if (stop(p) === true) { + break; + } else { + dom = rawParent; + } + } + return ret; + }; + var siblings = function (element) { + var filterSelf = function (elements) { + return filter(elements, function (x) { + return !eq(element, x); + }); + }; + return parent(element).map(children).map(filterSelf).getOr([]); + }; + var children = function (element) { + return map(element.dom.childNodes, SugarElement.fromDom); + }; + + var isShadowRoot = function (dos) { + return isDocumentFragment(dos); + }; + var supported = isFunction(Element.prototype.attachShadow) && isFunction(Node.prototype.getRootNode); + var isSupported$1 = constant(supported); + var getRootNode = supported ? function (e) { + return SugarElement.fromDom(e.dom.getRootNode()); + } : documentOrOwner; + var getShadowRoot = function (e) { + var r = getRootNode(e); + return isShadowRoot(r) ? Optional.some(r) : Optional.none(); + }; + var getShadowHost = function (e) { + return SugarElement.fromDom(e.dom.host); + }; + var getOriginalEventTarget = function (event) { + if (isSupported$1() && isNonNullable(event.target)) { + var el = SugarElement.fromDom(event.target); + if (isElement(el) && isOpenShadowHost(el)) { + if (event.composed && event.composedPath) { + var composedPath = event.composedPath(); + if (composedPath) { + return head(composedPath); + } + } + } + } + return Optional.from(event.target); + }; + var isOpenShadowHost = function (element) { + return isNonNullable(element.dom.shadowRoot); + }; + + var inBody = function (element) { + var dom = isText(element) ? element.dom.parentNode : element.dom; + if (dom === undefined || dom === null || dom.ownerDocument === null) { + return false; + } + var doc = dom.ownerDocument; + return getShadowRoot(SugarElement.fromDom(dom)).fold(function () { + return doc.body.contains(dom); + }, compose1(inBody, getShadowHost)); + }; + var getBody = function (doc) { + var b = doc.dom.body; + if (b === null || b === undefined) { + throw new Error('Body is not available yet'); + } + return SugarElement.fromDom(b); + }; + + var rawSet = function (dom, key, value) { + if (isString(value) || isBoolean(value) || isNumber(value)) { + dom.setAttribute(key, value + ''); + } else { + console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom); + throw new Error('Attribute value was not simple'); + } + }; + var set = function (element, key, value) { + rawSet(element.dom, key, value); + }; + var get$1 = function (element, key) { + var v = element.dom.getAttribute(key); + return v === null ? undefined : v; + }; + var remove = function (element, key) { + element.dom.removeAttribute(key); + }; + + var internalSet = function (dom, property, value) { + if (!isString(value)) { + console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom); + throw new Error('CSS value must be a string: ' + value); + } + if (isSupported(dom)) { + dom.style.setProperty(property, value); + } + }; + var setAll = function (element, css) { + var dom = element.dom; + each$1(css, function (v, k) { + internalSet(dom, k, v); + }); + }; + var get$2 = function (element, property) { + var dom = element.dom; + var styles = window.getComputedStyle(dom); + var r = styles.getPropertyValue(property); + return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r; + }; + var getUnsafeProperty = function (dom, property) { + return isSupported(dom) ? dom.style.getPropertyValue(property) : ''; + }; + + var mkEvent = function (target, x, y, stop, prevent, kill, raw) { + return { + target: target, + x: x, + y: y, + stop: stop, + prevent: prevent, + kill: kill, + raw: raw + }; + }; + var fromRawEvent = function (rawEvent) { + var target = SugarElement.fromDom(getOriginalEventTarget(rawEvent).getOr(rawEvent.target)); + var stop = function () { + return rawEvent.stopPropagation(); + }; + var prevent = function () { + return rawEvent.preventDefault(); + }; + var kill = compose(prevent, stop); + return mkEvent(target, rawEvent.clientX, rawEvent.clientY, stop, prevent, kill, rawEvent); + }; + var handle = function (filter, handler) { + return function (rawEvent) { + if (filter(rawEvent)) { + handler(fromRawEvent(rawEvent)); + } + }; + }; + var binder = function (element, event, filter, handler, useCapture) { + var wrapped = handle(filter, handler); + element.dom.addEventListener(event, wrapped, useCapture); + return { unbind: curry(unbind, element, event, wrapped, useCapture) }; + }; + var bind$1 = function (element, event, filter, handler) { + return binder(element, event, filter, handler, false); + }; + var unbind = function (element, event, handler, useCapture) { + element.dom.removeEventListener(event, handler, useCapture); + }; + + var filter$1 = always; + var bind$2 = function (element, event, handler) { + return bind$1(element, event, filter$1, handler); + }; + + var r = function (left, top) { + var translate = function (x, y) { + return r(left + x, top + y); + }; + return { + left: left, + top: top, + translate: translate + }; + }; + var SugarPosition = r; + + var get$3 = function (_DOC) { + var doc = _DOC !== undefined ? _DOC.dom : document; + var x = doc.body.scrollLeft || doc.documentElement.scrollLeft; + var y = doc.body.scrollTop || doc.documentElement.scrollTop; + return SugarPosition(x, y); + }; + + var get$4 = function (_win) { + var win = _win === undefined ? window : _win; + return Optional.from(win['visualViewport']); + }; + var bounds = function (x, y, width, height) { + return { + x: x, + y: y, + width: width, + height: height, + right: x + width, + bottom: y + height + }; + }; + var getBounds = function (_win) { + var win = _win === undefined ? window : _win; + var doc = win.document; + var scroll = get$3(SugarElement.fromDom(doc)); + return get$4(win).fold(function () { + var html = win.document.documentElement; + var width = html.clientWidth; + var height = html.clientHeight; + return bounds(scroll.left, scroll.top, width, height); + }, function (visualViewport) { + return bounds(Math.max(visualViewport.pageLeft, scroll.left), Math.max(visualViewport.pageTop, scroll.top), visualViewport.width, visualViewport.height); + }); + }; + var bind$3 = function (name, callback, _win) { + return get$4(_win).map(function (visualViewport) { + var handler = function (e) { + return callback(fromRawEvent(e)); + }; + visualViewport.addEventListener(name, handler); + return { + unbind: function () { + return visualViewport.removeEventListener(name, handler); + } + }; + }).getOrThunk(function () { + return { unbind: noop }; + }); + }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.Env'); + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.Delay'); + + var fireFullscreenStateChanged = function (editor, state) { + editor.fire('FullscreenStateChanged', { state: state }); + }; + + var getFullscreenNative = function (editor) { + return editor.getParam('fullscreen_native', false, 'boolean'); + }; + + var getFullscreenRoot = function (editor) { + var elem = SugarElement.fromDom(editor.getElement()); + return getShadowRoot(elem).map(getShadowHost).getOrThunk(function () { + return getBody(owner(elem)); + }); + }; + var getFullscreenElement = function (root) { + if (root.fullscreenElement !== undefined) { + return root.fullscreenElement; + } else if (root.msFullscreenElement !== undefined) { + return root.msFullscreenElement; + } else if (root.webkitFullscreenElement !== undefined) { + return root.webkitFullscreenElement; + } else { + return null; + } + }; + var getFullscreenchangeEventName = function () { + if (document.fullscreenElement !== undefined) { + return 'fullscreenchange'; + } else if (document.msFullscreenElement !== undefined) { + return 'MSFullscreenChange'; + } else if (document.webkitFullscreenElement !== undefined) { + return 'webkitfullscreenchange'; + } else { + return 'fullscreenchange'; + } + }; + var requestFullscreen = function (sugarElem) { + var elem = sugarElem.dom; + if (elem.requestFullscreen) { + elem.requestFullscreen(); + } else if (elem.msRequestFullscreen) { + elem.msRequestFullscreen(); + } else if (elem.webkitRequestFullScreen) { + elem.webkitRequestFullScreen(); + } + }; + var exitFullscreen = function (sugarDoc) { + var doc = sugarDoc.dom; + if (doc.exitFullscreen) { + doc.exitFullscreen(); + } else if (doc.msExitFullscreen) { + doc.msExitFullscreen(); + } else if (doc.webkitCancelFullScreen) { + doc.webkitCancelFullScreen(); + } + }; + var isFullscreenElement = function (elem) { + return elem.dom === getFullscreenElement(owner(elem).dom); + }; + + var ancestors = function (scope, predicate, isRoot) { + return filter(parents(scope, isRoot), predicate); + }; + var siblings$1 = function (scope, predicate) { + return filter(siblings(scope), predicate); + }; + + var all$1 = function (selector) { + return all(selector); + }; + var ancestors$1 = function (scope, selector, isRoot) { + return ancestors(scope, function (e) { + return is(e, selector); + }, isRoot); + }; + var siblings$2 = function (scope, selector) { + return siblings$1(scope, function (e) { + return is(e, selector); + }); + }; + + var attr = 'data-ephox-mobile-fullscreen-style'; + var siblingStyles = 'display:none!important;'; + var ancestorPosition = 'position:absolute!important;'; + var ancestorStyles = 'top:0!important;left:0!important;margin:0!important;padding:0!important;width:100%!important;height:100%!important;overflow:visible!important;'; + var bgFallback = 'background-color:rgb(255,255,255)!important;'; + var isAndroid = global$2.os.isAndroid(); + var matchColor = function (editorBody) { + var color = get$2(editorBody, 'background-color'); + return color !== undefined && color !== '' ? 'background-color:' + color + '!important' : bgFallback; + }; + var clobberStyles = function (dom, container, editorBody) { + var gatherSiblings = function (element) { + return siblings$2(element, '*:not(.tox-silver-sink)'); + }; + var clobber = function (clobberStyle) { + return function (element) { + var styles = get$1(element, 'style'); + var backup = styles === undefined ? 'no-styles' : styles.trim(); + if (backup === clobberStyle) { + return; + } else { + set(element, attr, backup); + setAll(element, dom.parseStyle(clobberStyle)); + } + }; + }; + var ancestors = ancestors$1(container, '*'); + var siblings = bind(ancestors, gatherSiblings); + var bgColor = matchColor(editorBody); + each(siblings, clobber(siblingStyles)); + each(ancestors, clobber(ancestorPosition + ancestorStyles + bgColor)); + var containerStyles = isAndroid === true ? '' : ancestorPosition; + clobber(containerStyles + ancestorStyles + bgColor)(container); + }; + var restoreStyles = function (dom) { + var clobberedEls = all$1('[' + attr + ']'); + each(clobberedEls, function (element) { + var restore = get$1(element, attr); + if (restore !== 'no-styles') { + setAll(element, dom.parseStyle(restore)); + } else { + remove(element, 'style'); + } + remove(element, attr); + }); + }; + + var DOM = global$1.DOM; + var getScrollPos = function () { + var vp = getBounds(window); + return { + x: vp.x, + y: vp.y + }; + }; + var setScrollPos = function (pos) { + window.scrollTo(pos.x, pos.y); + }; + var viewportUpdate = get$4().fold(function () { + return { + bind: noop, + unbind: noop + }; + }, function (visualViewport) { + var editorContainer = value(); + var resizeBinder = unbindable(); + var scrollBinder = unbindable(); + var refreshScroll = function () { + document.body.scrollTop = 0; + document.documentElement.scrollTop = 0; + }; + var refreshVisualViewport = function () { + window.requestAnimationFrame(function () { + editorContainer.on(function (container) { + return setAll(container, { + top: visualViewport.offsetTop + 'px', + left: visualViewport.offsetLeft + 'px', + height: visualViewport.height + 'px', + width: visualViewport.width + 'px' + }); + }); + }); + }; + var update = global$3.throttle(function () { + refreshScroll(); + refreshVisualViewport(); + }, 50); + var bind = function (element) { + editorContainer.set(element); + update(); + resizeBinder.set(bind$3('resize', update)); + scrollBinder.set(bind$3('scroll', update)); + }; + var unbind = function () { + editorContainer.on(function () { + resizeBinder.clear(); + scrollBinder.clear(); + }); + editorContainer.clear(); + }; + return { + bind: bind, + unbind: unbind + }; + }); + var toggleFullscreen = function (editor, fullscreenState) { + var body = document.body; + var documentElement = document.documentElement; + var editorContainer = editor.getContainer(); + var editorContainerS = SugarElement.fromDom(editorContainer); + var fullscreenRoot = getFullscreenRoot(editor); + var fullscreenInfo = fullscreenState.get(); + var editorBody = SugarElement.fromDom(editor.getBody()); + var isTouch = global$2.deviceType.isTouch(); + var editorContainerStyle = editorContainer.style; + var iframe = editor.iframeElement; + var iframeStyle = iframe.style; + var cleanup = function () { + if (isTouch) { + restoreStyles(editor.dom); + } + DOM.removeClass(body, 'tox-fullscreen'); + DOM.removeClass(documentElement, 'tox-fullscreen'); + DOM.removeClass(editorContainer, 'tox-fullscreen'); + viewportUpdate.unbind(); + Optional.from(fullscreenState.get()).each(function (info) { + return info.fullscreenChangeHandler.unbind(); + }); + }; + if (!fullscreenInfo) { + var fullscreenChangeHandler = bind$2(owner(fullscreenRoot), getFullscreenchangeEventName(), function (_evt) { + if (getFullscreenNative(editor)) { + if (!isFullscreenElement(fullscreenRoot) && fullscreenState.get() !== null) { + toggleFullscreen(editor, fullscreenState); + } + } + }); + var newFullScreenInfo = { + scrollPos: getScrollPos(), + containerWidth: editorContainerStyle.width, + containerHeight: editorContainerStyle.height, + containerTop: editorContainerStyle.top, + containerLeft: editorContainerStyle.left, + iframeWidth: iframeStyle.width, + iframeHeight: iframeStyle.height, + fullscreenChangeHandler: fullscreenChangeHandler + }; + if (isTouch) { + clobberStyles(editor.dom, editorContainerS, editorBody); + } + iframeStyle.width = iframeStyle.height = '100%'; + editorContainerStyle.width = editorContainerStyle.height = ''; + DOM.addClass(body, 'tox-fullscreen'); + DOM.addClass(documentElement, 'tox-fullscreen'); + DOM.addClass(editorContainer, 'tox-fullscreen'); + viewportUpdate.bind(editorContainerS); + editor.on('remove', cleanup); + fullscreenState.set(newFullScreenInfo); + if (getFullscreenNative(editor)) { + requestFullscreen(fullscreenRoot); + } + fireFullscreenStateChanged(editor, true); + } else { + fullscreenInfo.fullscreenChangeHandler.unbind(); + if (getFullscreenNative(editor) && isFullscreenElement(fullscreenRoot)) { + exitFullscreen(owner(fullscreenRoot)); + } + iframeStyle.width = fullscreenInfo.iframeWidth; + iframeStyle.height = fullscreenInfo.iframeHeight; + editorContainerStyle.width = fullscreenInfo.containerWidth; + editorContainerStyle.height = fullscreenInfo.containerHeight; + editorContainerStyle.top = fullscreenInfo.containerTop; + editorContainerStyle.left = fullscreenInfo.containerLeft; + setScrollPos(fullscreenInfo.scrollPos); + fullscreenState.set(null); + fireFullscreenStateChanged(editor, false); + cleanup(); + editor.off('remove', cleanup); + } + }; + + var register = function (editor, fullscreenState) { + editor.addCommand('mceFullScreen', function () { + toggleFullscreen(editor, fullscreenState); + }); + }; + + var makeSetupHandler = function (editor, fullscreenState) { + return function (api) { + api.setActive(fullscreenState.get() !== null); + var editorEventCallback = function (e) { + return api.setActive(e.state); + }; + editor.on('FullscreenStateChanged', editorEventCallback); + return function () { + return editor.off('FullscreenStateChanged', editorEventCallback); + }; + }; + }; + var register$1 = function (editor, fullscreenState) { + editor.ui.registry.addToggleMenuItem('fullscreen', { + text: 'Fullscreen', + icon: 'fullscreen', + shortcut: 'Meta+Shift+F', + onAction: function () { + return editor.execCommand('mceFullScreen'); + }, + onSetup: makeSetupHandler(editor, fullscreenState) + }); + editor.ui.registry.addToggleButton('fullscreen', { + tooltip: 'Fullscreen', + icon: 'fullscreen', + onAction: function () { + return editor.execCommand('mceFullScreen'); + }, + onSetup: makeSetupHandler(editor, fullscreenState) + }); + }; + + function Plugin () { + global.add('fullscreen', function (editor) { + var fullscreenState = Cell(null); + if (editor.inline) { + return get(fullscreenState); + } + register(editor, fullscreenState); + register$1(editor, fullscreenState); + editor.addShortcut('Meta+Shift+F', '', 'mceFullScreen'); + return get(fullscreenState); + }); + } + + Plugin(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/fullscreen/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/fullscreen/plugin.min.js new file mode 100644 index 000000000000..81fe157ef9d7 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/fullscreen/plugin.min.js @@ -0,0 +1,9 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var l=function(n){var e=n;return{get:function(){return e},set:function(n){e=n}}},n=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(n){return{isFullscreen:function(){return null!==n.get()}}},e=function(){},u=function(n){return function(){return n}};var t,r,o,c=u(!1),f=u(!0),a=function(){return d},d=(t=function(n){return n.isNone()},{fold:function(n,e){return n()},is:c,isSome:c,isNone:f,getOr:o=function(n){return n},getOrThunk:r=function(n){return n()},getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(undefined),or:o,orThunk:r,map:a,each:e,bind:a,exists:c,forall:f,filter:a,equals:t,equals_:t,toArray:function(){return[]},toString:u("none()")}),s=function(t){var n=u(t),e=function(){return o},r=function(n){return n(t)},o={fold:function(n,e){return e(t)},is:function(n){return t===n},isSome:f,isNone:c,getOr:n,getOrThunk:n,getOrDie:n,getOrNull:n,getOrUndefined:n,or:e,orThunk:e,map:function(n){return s(n(t))},each:function(n){n(t)},bind:r,exists:r,forall:r,filter:function(n){return n(t)?o:d},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(n){return n.is(t)},equals_:function(n,e){return n.fold(c,function(n){return e(t,n)})}};return o},b={some:s,none:a,from:function(n){return null===n||n===undefined?d:s(n)}},m=function(){return n=function(n){return n.unbind()},e=l(b.none()),t=function(){return e.get().each(n)},{clear:function(){t(),e.set(b.none())},isSet:function(){return e.get().isSome()},set:function(n){t(),e.set(b.some(n))}};var n,e,t},h=function(r){return function(n){return t=typeof(e=n),(null===e?"null":"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t)===r;var e,t}},g=function(e){return function(n){return typeof n===e}},p=h("string"),v=h("array"),y=g("boolean"),w=function(n){return!(null===(e=n)||e===undefined);var e},S=g("function"),E=g("number"),F=Array.prototype.push,T=function(n,e){for(var t=n.length,r=new Array(t),o=0;o -1; + }; + var map = function (xs, f) { + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; + }; + var filter = function (xs, pred) { + var r = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + r.push(x); + } + } + return r; + }; + var findUntil = function (xs, pred, until) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Optional.some(x); + } else if (until(x, i)) { + break; + } + } + return Optional.none(); + }; + var find = function (xs, pred) { + return findUntil(xs, pred, never); + }; + + var keys = Object.keys; + var hasOwnProperty = Object.hasOwnProperty; + var get$1 = function (obj, key) { + return has(obj, key) ? Optional.from(obj[key]) : Optional.none(); + }; + var has = function (obj, key) { + return hasOwnProperty.call(obj, key); + }; + + var cat = function (arr) { + var r = []; + var push = function (x) { + r.push(x); + }; + for (var i = 0; i < arr.length; i++) { + arr[i].each(push); + } + return r; + }; + + var getHelpTabs = function (editor) { + return Optional.from(editor.getParam('help_tabs')); + }; + var getForcedPlugins = function (editor) { + return editor.getParam('forced_plugins'); + }; + + var description = '

    Editor UI keyboard navigation

    \n\n

    Activating keyboard navigation

    \n\n

    The sections of the outer UI of the editor - the menubar, toolbar, sidebar and footer - are all keyboard navigable. As such, there are multiple ways to activate keyboard navigation:

    \n
      \n
    • Focus the menubar: Alt + F9 (Windows) or ⌥F9 (MacOS)
    • \n
    • Focus the toolbar: Alt + F10 (Windows) or ⌥F10 (MacOS)
    • \n
    • Focus the footer: Alt + F11 (Windows) or ⌥F11 (MacOS)
    • \n
    \n\n

    Focusing the menubar or toolbar will start keyboard navigation at the first item in the menubar or toolbar, which will be highlighted with a gray background. Focusing the footer will start keyboard navigation at the first item in the element path, which will be highlighted with an underline.

    \n\n

    Moving between UI sections

    \n\n

    When keyboard navigation is active, pressing tab will move the focus to the next major section of the UI, where applicable. These sections are:

    \n
      \n
    • the menubar
    • \n
    • each group of the toolbar
    • \n
    • the sidebar
    • \n
    • the element path in the footer
    • \n
    • the wordcount toggle button in the footer
    • \n
    • the branding link in the footer
    • \n
    \n\n

    Pressing shift + tab will move backwards through the same sections, except when moving from the footer to the toolbar. Focusing the element path then pressing shift + tab will move focus to the first toolbar group, not the last.

    \n\n

    Moving within UI sections

    \n\n

    Keyboard navigation within UI sections can usually be achieved using the left and right arrow keys. This includes:

    \n
      \n
    • moving between menus in the menubar
    • \n
    • moving between buttons in a toolbar group
    • \n
    • moving between items in the element path
    • \n
    \n\n

    In all these UI sections, keyboard navigation will cycle within the section. For example, focusing the last button in a toolbar group then pressing right arrow will move focus to the first item in the same toolbar group.

    \n\n

    Executing buttons

    \n\n

    To execute a button, navigate the selection to the desired button and hit space or enter.

    \n\n

    Opening, navigating and closing menus

    \n\n

    When focusing a menubar button or a toolbar button with a menu, pressing space, enter or down arrow will open the menu. When the menu opens the first item will be selected. To move up or down the menu, press the up or down arrow key respectively. This is the same for submenus, which can also be opened and closed using the left and right arrow keys.

    \n\n

    To close any active menu, hit the escape key. When a menu is closed the selection will be restored to its previous selection. This also works for closing submenus.

    \n\n

    Context toolbars and menus

    \n\n

    To focus an open context toolbar such as the table context toolbar, press Ctrl + F9 (Windows) or ⌃F9 (MacOS).

    \n\n

    Context toolbar navigation is the same as toolbar navigation, and context menu navigation is the same as standard menu navigation.

    \n\n

    Dialog navigation

    \n\n

    There are two types of dialog UIs in TinyMCE: tabbed dialogs and non-tabbed dialogs.

    \n\n

    When a non-tabbed dialog is opened, the first interactive component in the dialog will be focused. Users can navigate between interactive components by pressing tab. This includes any footer buttons. Navigation will cycle back to the first dialog component if tab is pressed while focusing the last component in the dialog. Pressing shift + tab will navigate backwards.

    \n\n

    When a tabbed dialog is opened, the first button in the tab menu is focused. Pressing tab will navigate to the first interactive component in that tab, and will cycle through the tab\u2019s components, the footer buttons, then back to the tab button. To switch to another tab, focus the tab button for the current tab, then use the arrow keys to cycle through the tab buttons.

    '; + var tab = function () { + var body = { + type: 'htmlpanel', + presets: 'document', + html: description + }; + return { + name: 'keyboardnav', + title: 'Keyboard Navigation', + items: [body] + }; + }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.Env'); + + var convertText = function (source) { + var mac = { + alt: '⌥', + ctrl: '⌃', + shift: '⇧', + meta: '⌘', + access: '⌃⌥' + }; + var other = { + meta: 'Ctrl ', + access: 'Shift + Alt ' + }; + var replace = global$1.mac ? mac : other; + var shortcut = source.split('+'); + var updated = map(shortcut, function (segment) { + var search = segment.toLowerCase().trim(); + return has(replace, search) ? replace[search] : segment; + }); + return global$1.mac ? updated.join('').replace(/\s/, '') : updated.join('+'); + }; + + var shortcuts = [ + { + shortcuts: ['Meta + B'], + action: 'Bold' + }, + { + shortcuts: ['Meta + I'], + action: 'Italic' + }, + { + shortcuts: ['Meta + U'], + action: 'Underline' + }, + { + shortcuts: ['Meta + A'], + action: 'Select all' + }, + { + shortcuts: [ + 'Meta + Y', + 'Meta + Shift + Z' + ], + action: 'Redo' + }, + { + shortcuts: ['Meta + Z'], + action: 'Undo' + }, + { + shortcuts: ['Access + 1'], + action: 'Heading 1' + }, + { + shortcuts: ['Access + 2'], + action: 'Heading 2' + }, + { + shortcuts: ['Access + 3'], + action: 'Heading 3' + }, + { + shortcuts: ['Access + 4'], + action: 'Heading 4' + }, + { + shortcuts: ['Access + 5'], + action: 'Heading 5' + }, + { + shortcuts: ['Access + 6'], + action: 'Heading 6' + }, + { + shortcuts: ['Access + 7'], + action: 'Paragraph' + }, + { + shortcuts: ['Access + 8'], + action: 'Div' + }, + { + shortcuts: ['Access + 9'], + action: 'Address' + }, + { + shortcuts: ['Alt + 0'], + action: 'Open help dialog' + }, + { + shortcuts: ['Alt + F9'], + action: 'Focus to menubar' + }, + { + shortcuts: ['Alt + F10'], + action: 'Focus to toolbar' + }, + { + shortcuts: ['Alt + F11'], + action: 'Focus to element path' + }, + { + shortcuts: ['Ctrl + F9'], + action: 'Focus to contextual toolbar' + }, + { + shortcuts: ['Shift + Enter'], + action: 'Open popup menu for split buttons' + }, + { + shortcuts: ['Meta + K'], + action: 'Insert link (if link plugin activated)' + }, + { + shortcuts: ['Meta + S'], + action: 'Save (if save plugin activated)' + }, + { + shortcuts: ['Meta + F'], + action: 'Find (if searchreplace plugin activated)' + }, + { + shortcuts: ['Meta + Shift + F'], + action: 'Switch to or from fullscreen mode' + } + ]; + + var tab$1 = function () { + var shortcutList = map(shortcuts, function (shortcut) { + var shortcutText = map(shortcut.shortcuts, convertText).join(' or '); + return [ + shortcut.action, + shortcutText + ]; + }); + var tablePanel = { + type: 'table', + header: [ + 'Action', + 'Shortcut' + ], + cells: shortcutList + }; + return { + name: 'shortcuts', + title: 'Handy Shortcuts', + items: [tablePanel] + }; + }; + + var global$2 = tinymce.util.Tools.resolve('tinymce.util.I18n'); + + var urls = [ + { + key: 'advlist', + name: 'Advanced List' + }, + { + key: 'anchor', + name: 'Anchor' + }, + { + key: 'autolink', + name: 'Autolink' + }, + { + key: 'autoresize', + name: 'Autoresize' + }, + { + key: 'autosave', + name: 'Autosave' + }, + { + key: 'bbcode', + name: 'BBCode' + }, + { + key: 'charmap', + name: 'Character Map' + }, + { + key: 'code', + name: 'Code' + }, + { + key: 'codesample', + name: 'Code Sample' + }, + { + key: 'colorpicker', + name: 'Color Picker' + }, + { + key: 'directionality', + name: 'Directionality' + }, + { + key: 'emoticons', + name: 'Emoticons' + }, + { + key: 'fullpage', + name: 'Full Page' + }, + { + key: 'fullscreen', + name: 'Full Screen' + }, + { + key: 'help', + name: 'Help' + }, + { + key: 'hr', + name: 'Horizontal Rule' + }, + { + key: 'image', + name: 'Image' + }, + { + key: 'imagetools', + name: 'Image Tools' + }, + { + key: 'importcss', + name: 'Import CSS' + }, + { + key: 'insertdatetime', + name: 'Insert Date/Time' + }, + { + key: 'legacyoutput', + name: 'Legacy Output' + }, + { + key: 'link', + name: 'Link' + }, + { + key: 'lists', + name: 'Lists' + }, + { + key: 'media', + name: 'Media' + }, + { + key: 'nonbreaking', + name: 'Nonbreaking' + }, + { + key: 'noneditable', + name: 'Noneditable' + }, + { + key: 'pagebreak', + name: 'Page Break' + }, + { + key: 'paste', + name: 'Paste' + }, + { + key: 'preview', + name: 'Preview' + }, + { + key: 'print', + name: 'Print' + }, + { + key: 'save', + name: 'Save' + }, + { + key: 'searchreplace', + name: 'Search and Replace' + }, + { + key: 'spellchecker', + name: 'Spell Checker' + }, + { + key: 'tabfocus', + name: 'Tab Focus' + }, + { + key: 'table', + name: 'Table' + }, + { + key: 'template', + name: 'Template' + }, + { + key: 'textcolor', + name: 'Text Color' + }, + { + key: 'textpattern', + name: 'Text Pattern' + }, + { + key: 'toc', + name: 'Table of Contents' + }, + { + key: 'visualblocks', + name: 'Visual Blocks' + }, + { + key: 'visualchars', + name: 'Visual Characters' + }, + { + key: 'wordcount', + name: 'Word Count' + }, + { + key: 'advcode', + name: 'Advanced Code Editor*' + }, + { + key: 'formatpainter', + name: 'Format Painter*' + }, + { + key: 'powerpaste', + name: 'PowerPaste*' + }, + { + key: 'tinydrive', + name: 'Tiny Drive*', + slug: 'drive' + }, + { + key: 'tinymcespellchecker', + name: 'Spell Checker Pro*' + }, + { + key: 'a11ychecker', + name: 'Accessibility Checker*' + }, + { + key: 'linkchecker', + name: 'Link Checker*' + }, + { + key: 'mentions', + name: 'Mentions*' + }, + { + key: 'mediaembed', + name: 'Enhanced Media Embed*' + }, + { + key: 'checklist', + name: 'Checklist*' + }, + { + key: 'casechange', + name: 'Case Change*' + }, + { + key: 'permanentpen', + name: 'Permanent Pen*' + }, + { + key: 'pageembed', + name: 'Page Embed*' + }, + { + key: 'tinycomments', + name: 'Tiny Comments*', + slug: 'comments' + }, + { + key: 'advtable', + name: 'Advanced Tables*' + }, + { + key: 'autocorrect', + name: 'Autocorrect*' + } + ]; + + var tab$2 = function (editor) { + var availablePlugins = function () { + var premiumPlugins = [ + 'Accessibility Checker', + 'Advanced Code Editor', + 'Advanced Tables', + 'Case Change', + 'Checklist', + 'Tiny Comments', + 'Tiny Drive', + 'Enhanced Media Embed', + 'Format Painter', + 'Link Checker', + 'Mentions', + 'MoxieManager', + 'Page Embed', + 'Permanent Pen', + 'PowerPaste', + 'Spell Checker Pro' + ]; + var premiumPluginList = map(premiumPlugins, function (plugin) { + return '
  • ' + global$2.translate(plugin) + '
  • '; + }).join(''); + return '
    ' + '

    ' + global$2.translate('Premium plugins:') + '

    ' + '' + '
    '; + }; + var makeLink = function (p) { + return '' + p.name + ''; + }; + var maybeUrlize = function (editor, key) { + return find(urls, function (x) { + return x.key === key; + }).fold(function () { + var getMetadata = editor.plugins[key].getMetadata; + return typeof getMetadata === 'function' ? makeLink(getMetadata()) : key; + }, function (x) { + var urlSlug = x.slug || x.key; + return makeLink({ + name: x.name, + url: 'https://www.tiny.cloud/docs/plugins/' + urlSlug + }); + }); + }; + var getPluginKeys = function (editor) { + var keys$1 = keys(editor.plugins); + var forced_plugins = getForcedPlugins(editor); + return forced_plugins === undefined ? keys$1 : filter(keys$1, function (k) { + return !contains(forced_plugins, k); + }); + }; + var pluginLister = function (editor) { + var pluginKeys = getPluginKeys(editor); + var pluginLis = map(pluginKeys, function (key) { + return '
  • ' + maybeUrlize(editor, key) + '
  • '; + }); + var count = pluginLis.length; + var pluginsString = pluginLis.join(''); + var html = '

    ' + global$2.translate([ + 'Plugins installed ({0}):', + count + ]) + '

    ' + '
      ' + pluginsString + '
    '; + return html; + }; + var installedPlugins = function (editor) { + if (editor == null) { + return ''; + } + return '
    ' + pluginLister(editor) + '
    '; + }; + var htmlPanel = { + type: 'htmlpanel', + presets: 'document', + html: [ + installedPlugins(editor), + availablePlugins() + ].join('') + }; + return { + name: 'plugins', + title: 'Plugins', + items: [htmlPanel] + }; + }; + + var global$3 = tinymce.util.Tools.resolve('tinymce.EditorManager'); + + var tab$3 = function () { + var getVersion = function (major, minor) { + return major.indexOf('@') === 0 ? 'X.X.X' : major + '.' + minor; + }; + var version = getVersion(global$3.majorVersion, global$3.minorVersion); + var changeLogLink = 'TinyMCE ' + version + ''; + var htmlPanel = { + type: 'htmlpanel', + html: '

    ' + global$2.translate([ + 'You are using {0}', + changeLogLink + ]) + '

    ', + presets: 'document' + }; + return { + name: 'versions', + title: 'Version', + items: [htmlPanel] + }; + }; + + var parseHelpTabsSetting = function (tabsFromSettings, tabs) { + var newTabs = {}; + var names = map(tabsFromSettings, function (t) { + if (typeof t === 'string') { + if (has(tabs, t)) { + newTabs[t] = tabs[t]; + } + return t; + } else { + newTabs[t.name] = t; + return t.name; + } + }); + return { + tabs: newTabs, + names: names + }; + }; + var getNamesFromTabs = function (tabs) { + var names = keys(tabs); + var idx = names.indexOf('versions'); + if (idx !== -1) { + names.splice(idx, 1); + names.push('versions'); + } + return { + tabs: tabs, + names: names + }; + }; + var parseCustomTabs = function (editor, customTabs) { + var _a; + var shortcuts = tab$1(); + var nav = tab(); + var plugins = tab$2(editor); + var versions = tab$3(); + var tabs = __assign((_a = {}, _a[shortcuts.name] = shortcuts, _a[nav.name] = nav, _a[plugins.name] = plugins, _a[versions.name] = versions, _a), customTabs.get()); + return getHelpTabs(editor).fold(function () { + return getNamesFromTabs(tabs); + }, function (tabsFromSettings) { + return parseHelpTabsSetting(tabsFromSettings, tabs); + }); + }; + var init = function (editor, customTabs) { + return function () { + var _a = parseCustomTabs(editor, customTabs), tabs = _a.tabs, names = _a.names; + var foundTabs = map(names, function (name) { + return get$1(tabs, name); + }); + var dialogTabs = cat(foundTabs); + var body = { + type: 'tabpanel', + tabs: dialogTabs + }; + editor.windowManager.open({ + title: 'Help', + size: 'medium', + body: body, + buttons: [{ + type: 'cancel', + name: 'close', + text: 'Close', + primary: true + }], + initialData: {} + }); + }; + }; + + function Plugin () { + global.add('help', function (editor) { + var customTabs = Cell({}); + var api = get(customTabs); + var dialogOpener = init(editor, customTabs); + register$1(editor, dialogOpener); + register(editor, dialogOpener); + editor.shortcuts.add('Alt+0', 'Open help dialog', 'mceHelp'); + return api; + }); + } + + Plugin(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/help/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/help/plugin.min.js new file mode 100644 index 000000000000..9a945df2c366 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/help/plugin.min.js @@ -0,0 +1,9 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var e,t,n,a=tinymce.util.Tools.resolve("tinymce.PluginManager"),m=function(){return(m=Object.assign||function(e){for(var t,n=1,a=arguments.length;n'+e.name+""};return{name:"plugins",title:"Plugins",items:[{type:"htmlpanel",presets:"document",html:[null==(n=e)?"":'
    '+function(a){var e,t,n,o=(t=f((e=a).plugins),(n=e.getParam("forced_plugins"))===undefined?t:function(e,t){for(var n=[],a=0,o=e.length;a"+(t=a,n=e,g(C,function(e){return e.key===n}).fold(function(){var e=t.plugins[n].getMetadata;return"function"==typeof e?l(e()):n},function(e){var t=e.slug||e.key;return l({name:e.name,url:"https://www.tiny.cloud/docs/plugins/"+t})}))+"";var t,n}),r=i.length,s=i.join("");return"

    "+A.translate(["Plugins installed ({0}):",r])+"

      "+s+"
    "}(n)+"
    ",(t=p(["Accessibility Checker","Advanced Code Editor","Advanced Tables","Case Change","Checklist","Tiny Comments","Tiny Drive","Enhanced Media Embed","Format Painter","Link Checker","Mentions","MoxieManager","Page Embed","Permanent Pen","PowerPaste","Spell Checker Pro"],function(e){return"
  • "+A.translate(e)+"
  • "}).join(""),'

    '+A.translate("Premium plugins:")+"

    ")].join("")}]}},x=tinymce.util.Tools.resolve("tinymce.EditorManager"),P=function(e,t){var n,a,o,i,r,s={name:"shortcuts",title:"Handy Shortcuts",items:[{type:"table",header:["Action","Shortcut"],cells:p(w,function(e){var t=p(e.shortcuts,v).join(" or ");return[e.action,t]})}]},l={name:"keyboardnav",title:"Keyboard Navigation",items:[{type:"htmlpanel",presets:"document",html:"

    Editor UI keyboard navigation

    \n\n

    Activating keyboard navigation

    \n\n

    The sections of the outer UI of the editor - the menubar, toolbar, sidebar and footer - are all keyboard navigable. As such, there are multiple ways to activate keyboard navigation:

    \n
      \n
    • Focus the menubar: Alt + F9 (Windows) or ⌥F9 (MacOS)
    • \n
    • Focus the toolbar: Alt + F10 (Windows) or ⌥F10 (MacOS)
    • \n
    • Focus the footer: Alt + F11 (Windows) or ⌥F11 (MacOS)
    • \n
    \n\n

    Focusing the menubar or toolbar will start keyboard navigation at the first item in the menubar or toolbar, which will be highlighted with a gray background. Focusing the footer will start keyboard navigation at the first item in the element path, which will be highlighted with an underline.

    \n\n

    Moving between UI sections

    \n\n

    When keyboard navigation is active, pressing tab will move the focus to the next major section of the UI, where applicable. These sections are:

    \n
      \n
    • the menubar
    • \n
    • each group of the toolbar
    • \n
    • the sidebar
    • \n
    • the element path in the footer
    • \n
    • the wordcount toggle button in the footer
    • \n
    • the branding link in the footer
    • \n
    \n\n

    Pressing shift + tab will move backwards through the same sections, except when moving from the footer to the toolbar. Focusing the element path then pressing shift + tab will move focus to the first toolbar group, not the last.

    \n\n

    Moving within UI sections

    \n\n

    Keyboard navigation within UI sections can usually be achieved using the left and right arrow keys. This includes:

    \n
      \n
    • moving between menus in the menubar
    • \n
    • moving between buttons in a toolbar group
    • \n
    • moving between items in the element path
    • \n
    \n\n

    In all these UI sections, keyboard navigation will cycle within the section. For example, focusing the last button in a toolbar group then pressing right arrow will move focus to the first item in the same toolbar group.

    \n\n

    Executing buttons

    \n\n

    To execute a button, navigate the selection to the desired button and hit space or enter.

    \n\n

    Opening, navigating and closing menus

    \n\n

    When focusing a menubar button or a toolbar button with a menu, pressing space, enter or down arrow will open the menu. When the menu opens the first item will be selected. To move up or down the menu, press the up or down arrow key respectively. This is the same for submenus, which can also be opened and closed using the left and right arrow keys.

    \n\n

    To close any active menu, hit the escape key. When a menu is closed the selection will be restored to its previous selection. This also works for closing submenus.

    \n\n

    Context toolbars and menus

    \n\n

    To focus an open context toolbar such as the table context toolbar, press Ctrl + F9 (Windows) or ⌃F9 (MacOS).

    \n\n

    Context toolbar navigation is the same as toolbar navigation, and context menu navigation is the same as standard menu navigation.

    \n\n

    Dialog navigation

    \n\n

    There are two types of dialog UIs in TinyMCE: tabbed dialogs and non-tabbed dialogs.

    \n\n

    When a non-tabbed dialog is opened, the first interactive component in the dialog will be focused. Users can navigate between interactive components by pressing tab. This includes any footer buttons. Navigation will cycle back to the first dialog component if tab is pressed while focusing the last component in the dialog. Pressing shift + tab will navigate backwards.

    \n\n

    When a tabbed dialog is opened, the first button in the tab menu is focused. Pressing tab will navigate to the first interactive component in that tab, and will cycle through the tab\u2019s components, the footer buttons, then back to the tab button. To switch to another tab, focus the tab button for the current tab, then use the arrow keys to cycle through the tab buttons.

    "}]},c=T(e),u=(i='TinyMCE '+(a=x.majorVersion,o=x.minorVersion,0===a.indexOf("@")?"X.X.X":a+"."+o)+"",{name:"versions",title:"Version",items:[{type:"htmlpanel",html:"

    "+A.translate(["You are using {0}",i])+"

    ",presets:"document"}]}),h=m(((n={})[s.name]=s,n[l.name]=l,n[c.name]=c,n[u.name]=u,n),t.get());return r=e,d.from(r.getParam("help_tabs")).fold(function(){return t=f(e=h),-1!==(n=t.indexOf("versions"))&&(t.splice(n,1),t.push("versions")),{tabs:e,names:t};var e,t,n},function(e){return t=h,n={},a=p(e,function(e){return"string"==typeof e?(y(t,e)&&(n[e]=t[e]),e):(n[e.name]=e).name}),{tabs:n,names:a};var t,n,a})},M=function(o,i){return function(){var e=P(o,i),a=e.tabs,t=e.names,n={type:"tabpanel",tabs:function(e){for(var t=[],n=function(e){t.push(e)},a=0;a'); + }); + }; + + var register$1 = function (editor) { + editor.ui.registry.addButton('hr', { + icon: 'horizontal-rule', + tooltip: 'Horizontal line', + onAction: function () { + return editor.execCommand('InsertHorizontalRule'); + } + }); + editor.ui.registry.addMenuItem('hr', { + icon: 'horizontal-rule', + text: 'Horizontal line', + onAction: function () { + return editor.execCommand('InsertHorizontalRule'); + } + }); + }; + + function Plugin () { + global.add('hr', function (editor) { + register(editor); + register$1(editor); + }); + } + + Plugin(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/hr/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/hr/plugin.min.js new file mode 100644 index 000000000000..5901aa48d90d --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/hr/plugin.min.js @@ -0,0 +1,9 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager");n.add("hr",function(n){var o,t;(o=n).addCommand("InsertHorizontalRule",function(){o.execCommand("mceInsertContent",!1,"
    ")}),(t=n).ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:function(){return t.execCommand("InsertHorizontalRule")}}),t.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:function(){return t.execCommand("InsertHorizontalRule")}})})}(); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/image/plugin.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/image/plugin.js new file mode 100644 index 000000000000..83c519ae0729 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/image/plugin.js @@ -0,0 +1,1651 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +(function () { + 'use strict'; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var __assign = function () { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + + var typeOf = function (x) { + var t = typeof x; + if (x === null) { + return 'null'; + } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } else { + return t; + } + }; + var isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isSimpleType = function (type) { + return function (value) { + return typeof value === type; + }; + }; + var eq = function (t) { + return function (a) { + return t === a; + }; + }; + var isString = isType('string'); + var isObject = isType('object'); + var isArray = isType('array'); + var isNull = eq(null); + var isBoolean = isSimpleType('boolean'); + var isNumber = isSimpleType('number'); + + var noop = function () { + }; + var constant = function (value) { + return function () { + return value; + }; + }; + var never = constant(false); + var always = constant(true); + + var none = function () { + return NONE; + }; + var NONE = function () { + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; + }(); + var some = function (a) { + var constant_a = constant(a); + var self = function () { + return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; + }; + var from = function (value) { + return value === null || value === undefined ? NONE : some(value); + }; + var Optional = { + some: some, + none: none, + from: from + }; + + var nativePush = Array.prototype.push; + var flatten = function (xs) { + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); + } + nativePush.apply(r, xs[i]); + } + return r; + }; + var head = function (xs) { + return xs.length === 0 ? Optional.none() : Optional.some(xs[0]); + }; + var findMap = function (arr, f) { + for (var i = 0; i < arr.length; i++) { + var r = f(arr[i], i); + if (r.isSome()) { + return r; + } + } + return Optional.none(); + }; + + var Global = typeof window !== 'undefined' ? window : Function('return this;')(); + + var rawSet = function (dom, key, value) { + if (isString(value) || isBoolean(value) || isNumber(value)) { + dom.setAttribute(key, value + ''); + } else { + console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom); + throw new Error('Attribute value was not simple'); + } + }; + var set = function (element, key, value) { + rawSet(element.dom, key, value); + }; + var remove = function (element, key) { + element.dom.removeAttribute(key); + }; + + var fromHtml = function (html, scope) { + var doc = scope || document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); + }; + var fromTag = function (tag, scope) { + var doc = scope || document; + var node = doc.createElement(tag); + return fromDom(node); + }; + var fromText = function (text, scope) { + var doc = scope || document; + var node = doc.createTextNode(text); + return fromDom(node); + }; + var fromDom = function (node) { + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: node }; + }; + var fromPoint = function (docElm, x, y) { + return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); + }; + var SugarElement = { + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint + }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.util.Promise'); + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.XHR'); + + var hasDimensions = function (editor) { + return editor.getParam('image_dimensions', true, 'boolean'); + }; + var hasAdvTab = function (editor) { + return editor.getParam('image_advtab', false, 'boolean'); + }; + var hasUploadTab = function (editor) { + return editor.getParam('image_uploadtab', true, 'boolean'); + }; + var getPrependUrl = function (editor) { + return editor.getParam('image_prepend_url', '', 'string'); + }; + var getClassList = function (editor) { + return editor.getParam('image_class_list'); + }; + var hasDescription = function (editor) { + return editor.getParam('image_description', true, 'boolean'); + }; + var hasImageTitle = function (editor) { + return editor.getParam('image_title', false, 'boolean'); + }; + var hasImageCaption = function (editor) { + return editor.getParam('image_caption', false, 'boolean'); + }; + var getImageList = function (editor) { + return editor.getParam('image_list', false); + }; + var hasUploadUrl = function (editor) { + return !!getUploadUrl(editor); + }; + var hasUploadHandler = function (editor) { + return !!getUploadHandler(editor); + }; + var getUploadUrl = function (editor) { + return editor.getParam('images_upload_url', '', 'string'); + }; + var getUploadHandler = function (editor) { + return editor.getParam('images_upload_handler', undefined, 'function'); + }; + var getUploadBasePath = function (editor) { + return editor.getParam('images_upload_base_path', undefined, 'string'); + }; + var getUploadCredentials = function (editor) { + return editor.getParam('images_upload_credentials', false, 'boolean'); + }; + var showAccessibilityOptions = function (editor) { + return editor.getParam('a11y_advanced_options', false, 'boolean'); + }; + var isAutomaticUploadsEnabled = function (editor) { + return editor.getParam('automatic_uploads', true, 'boolean'); + }; + + var parseIntAndGetMax = function (val1, val2) { + return Math.max(parseInt(val1, 10), parseInt(val2, 10)); + }; + var getImageSize = function (url) { + return new global$2(function (callback) { + var img = document.createElement('img'); + var done = function (dimensions) { + if (img.parentNode) { + img.parentNode.removeChild(img); + } + callback(dimensions); + }; + img.onload = function () { + var width = parseIntAndGetMax(img.width, img.clientWidth); + var height = parseIntAndGetMax(img.height, img.clientHeight); + var dimensions = { + width: width, + height: height + }; + done(global$2.resolve(dimensions)); + }; + img.onerror = function () { + done(global$2.reject('Failed to get image dimensions for: ' + url)); + }; + var style = img.style; + style.visibility = 'hidden'; + style.position = 'fixed'; + style.bottom = style.left = '0px'; + style.width = style.height = 'auto'; + document.body.appendChild(img); + img.src = url; + }); + }; + var removePixelSuffix = function (value) { + if (value) { + value = value.replace(/px$/, ''); + } + return value; + }; + var addPixelSuffix = function (value) { + if (value.length > 0 && /^[0-9]+$/.test(value)) { + value += 'px'; + } + return value; + }; + var mergeMargins = function (css) { + if (css.margin) { + var splitMargin = String(css.margin).split(' '); + switch (splitMargin.length) { + case 1: + css['margin-top'] = css['margin-top'] || splitMargin[0]; + css['margin-right'] = css['margin-right'] || splitMargin[0]; + css['margin-bottom'] = css['margin-bottom'] || splitMargin[0]; + css['margin-left'] = css['margin-left'] || splitMargin[0]; + break; + case 2: + css['margin-top'] = css['margin-top'] || splitMargin[0]; + css['margin-right'] = css['margin-right'] || splitMargin[1]; + css['margin-bottom'] = css['margin-bottom'] || splitMargin[0]; + css['margin-left'] = css['margin-left'] || splitMargin[1]; + break; + case 3: + css['margin-top'] = css['margin-top'] || splitMargin[0]; + css['margin-right'] = css['margin-right'] || splitMargin[1]; + css['margin-bottom'] = css['margin-bottom'] || splitMargin[2]; + css['margin-left'] = css['margin-left'] || splitMargin[1]; + break; + case 4: + css['margin-top'] = css['margin-top'] || splitMargin[0]; + css['margin-right'] = css['margin-right'] || splitMargin[1]; + css['margin-bottom'] = css['margin-bottom'] || splitMargin[2]; + css['margin-left'] = css['margin-left'] || splitMargin[3]; + } + delete css.margin; + } + return css; + }; + var createImageList = function (editor, callback) { + var imageList = getImageList(editor); + if (typeof imageList === 'string') { + global$3.send({ + url: imageList, + success: function (text) { + callback(JSON.parse(text)); + } + }); + } else if (typeof imageList === 'function') { + imageList(callback); + } else { + callback(imageList); + } + }; + var waitLoadImage = function (editor, data, imgElm) { + var selectImage = function () { + imgElm.onload = imgElm.onerror = null; + if (editor.selection) { + editor.selection.select(imgElm); + editor.nodeChanged(); + } + }; + imgElm.onload = function () { + if (!data.width && !data.height && hasDimensions(editor)) { + editor.dom.setAttribs(imgElm, { + width: String(imgElm.clientWidth), + height: String(imgElm.clientHeight) + }); + } + selectImage(); + }; + imgElm.onerror = selectImage; + }; + var blobToDataUri = function (blob) { + return new global$2(function (resolve, reject) { + var reader = new FileReader(); + reader.onload = function () { + resolve(reader.result); + }; + reader.onerror = function () { + reject(reader.error.message); + }; + reader.readAsDataURL(blob); + }); + }; + var isPlaceholderImage = function (imgElm) { + return imgElm.nodeName === 'IMG' && (imgElm.hasAttribute('data-mce-object') || imgElm.hasAttribute('data-mce-placeholder')); + }; + + var DOM = global$1.DOM; + var getHspace = function (image) { + if (image.style.marginLeft && image.style.marginRight && image.style.marginLeft === image.style.marginRight) { + return removePixelSuffix(image.style.marginLeft); + } else { + return ''; + } + }; + var getVspace = function (image) { + if (image.style.marginTop && image.style.marginBottom && image.style.marginTop === image.style.marginBottom) { + return removePixelSuffix(image.style.marginTop); + } else { + return ''; + } + }; + var getBorder = function (image) { + if (image.style.borderWidth) { + return removePixelSuffix(image.style.borderWidth); + } else { + return ''; + } + }; + var getAttrib = function (image, name) { + if (image.hasAttribute(name)) { + return image.getAttribute(name); + } else { + return ''; + } + }; + var getStyle = function (image, name) { + return image.style[name] ? image.style[name] : ''; + }; + var hasCaption = function (image) { + return image.parentNode !== null && image.parentNode.nodeName === 'FIGURE'; + }; + var updateAttrib = function (image, name, value) { + if (value === '') { + image.removeAttribute(name); + } else { + image.setAttribute(name, value); + } + }; + var wrapInFigure = function (image) { + var figureElm = DOM.create('figure', { class: 'image' }); + DOM.insertAfter(figureElm, image); + figureElm.appendChild(image); + figureElm.appendChild(DOM.create('figcaption', { contentEditable: 'true' }, 'Caption')); + figureElm.contentEditable = 'false'; + }; + var removeFigure = function (image) { + var figureElm = image.parentNode; + DOM.insertAfter(image, figureElm); + DOM.remove(figureElm); + }; + var toggleCaption = function (image) { + if (hasCaption(image)) { + removeFigure(image); + } else { + wrapInFigure(image); + } + }; + var normalizeStyle = function (image, normalizeCss) { + var attrValue = image.getAttribute('style'); + var value = normalizeCss(attrValue !== null ? attrValue : ''); + if (value.length > 0) { + image.setAttribute('style', value); + image.setAttribute('data-mce-style', value); + } else { + image.removeAttribute('style'); + } + }; + var setSize = function (name, normalizeCss) { + return function (image, name, value) { + if (image.style[name]) { + image.style[name] = addPixelSuffix(value); + normalizeStyle(image, normalizeCss); + } else { + updateAttrib(image, name, value); + } + }; + }; + var getSize = function (image, name) { + if (image.style[name]) { + return removePixelSuffix(image.style[name]); + } else { + return getAttrib(image, name); + } + }; + var setHspace = function (image, value) { + var pxValue = addPixelSuffix(value); + image.style.marginLeft = pxValue; + image.style.marginRight = pxValue; + }; + var setVspace = function (image, value) { + var pxValue = addPixelSuffix(value); + image.style.marginTop = pxValue; + image.style.marginBottom = pxValue; + }; + var setBorder = function (image, value) { + var pxValue = addPixelSuffix(value); + image.style.borderWidth = pxValue; + }; + var setBorderStyle = function (image, value) { + image.style.borderStyle = value; + }; + var getBorderStyle = function (image) { + return getStyle(image, 'borderStyle'); + }; + var isFigure = function (elm) { + return elm.nodeName === 'FIGURE'; + }; + var isImage = function (elm) { + return elm.nodeName === 'IMG'; + }; + var getIsDecorative = function (image) { + return DOM.getAttrib(image, 'alt').length === 0 && DOM.getAttrib(image, 'role') === 'presentation'; + }; + var getAlt = function (image) { + if (getIsDecorative(image)) { + return ''; + } else { + return getAttrib(image, 'alt'); + } + }; + var defaultData = function () { + return { + src: '', + alt: '', + title: '', + width: '', + height: '', + class: '', + style: '', + caption: false, + hspace: '', + vspace: '', + border: '', + borderStyle: '', + isDecorative: false + }; + }; + var getStyleValue = function (normalizeCss, data) { + var image = document.createElement('img'); + updateAttrib(image, 'style', data.style); + if (getHspace(image) || data.hspace !== '') { + setHspace(image, data.hspace); + } + if (getVspace(image) || data.vspace !== '') { + setVspace(image, data.vspace); + } + if (getBorder(image) || data.border !== '') { + setBorder(image, data.border); + } + if (getBorderStyle(image) || data.borderStyle !== '') { + setBorderStyle(image, data.borderStyle); + } + return normalizeCss(image.getAttribute('style')); + }; + var create = function (normalizeCss, data) { + var image = document.createElement('img'); + write(normalizeCss, __assign(__assign({}, data), { caption: false }), image); + setAlt(image, data.alt, data.isDecorative); + if (data.caption) { + var figure = DOM.create('figure', { class: 'image' }); + figure.appendChild(image); + figure.appendChild(DOM.create('figcaption', { contentEditable: 'true' }, 'Caption')); + figure.contentEditable = 'false'; + return figure; + } else { + return image; + } + }; + var read = function (normalizeCss, image) { + return { + src: getAttrib(image, 'src'), + alt: getAlt(image), + title: getAttrib(image, 'title'), + width: getSize(image, 'width'), + height: getSize(image, 'height'), + class: getAttrib(image, 'class'), + style: normalizeCss(getAttrib(image, 'style')), + caption: hasCaption(image), + hspace: getHspace(image), + vspace: getVspace(image), + border: getBorder(image), + borderStyle: getStyle(image, 'borderStyle'), + isDecorative: getIsDecorative(image) + }; + }; + var updateProp = function (image, oldData, newData, name, set) { + if (newData[name] !== oldData[name]) { + set(image, name, newData[name]); + } + }; + var setAlt = function (image, alt, isDecorative) { + if (isDecorative) { + DOM.setAttrib(image, 'role', 'presentation'); + var sugarImage = SugarElement.fromDom(image); + set(sugarImage, 'alt', ''); + } else { + if (isNull(alt)) { + var sugarImage = SugarElement.fromDom(image); + remove(sugarImage, 'alt'); + } else { + var sugarImage = SugarElement.fromDom(image); + set(sugarImage, 'alt', alt); + } + if (DOM.getAttrib(image, 'role') === 'presentation') { + DOM.setAttrib(image, 'role', ''); + } + } + }; + var updateAlt = function (image, oldData, newData) { + if (newData.alt !== oldData.alt || newData.isDecorative !== oldData.isDecorative) { + setAlt(image, newData.alt, newData.isDecorative); + } + }; + var normalized = function (set, normalizeCss) { + return function (image, name, value) { + set(image, value); + normalizeStyle(image, normalizeCss); + }; + }; + var write = function (normalizeCss, newData, image) { + var oldData = read(normalizeCss, image); + updateProp(image, oldData, newData, 'caption', function (image, _name, _value) { + return toggleCaption(image); + }); + updateProp(image, oldData, newData, 'src', updateAttrib); + updateProp(image, oldData, newData, 'title', updateAttrib); + updateProp(image, oldData, newData, 'width', setSize('width', normalizeCss)); + updateProp(image, oldData, newData, 'height', setSize('height', normalizeCss)); + updateProp(image, oldData, newData, 'class', updateAttrib); + updateProp(image, oldData, newData, 'style', normalized(function (image, value) { + return updateAttrib(image, 'style', value); + }, normalizeCss)); + updateProp(image, oldData, newData, 'hspace', normalized(setHspace, normalizeCss)); + updateProp(image, oldData, newData, 'vspace', normalized(setVspace, normalizeCss)); + updateProp(image, oldData, newData, 'border', normalized(setBorder, normalizeCss)); + updateProp(image, oldData, newData, 'borderStyle', normalized(setBorderStyle, normalizeCss)); + updateAlt(image, oldData, newData); + }; + + var normalizeCss = function (editor, cssText) { + var css = editor.dom.styles.parse(cssText); + var mergedCss = mergeMargins(css); + var compressed = editor.dom.styles.parse(editor.dom.styles.serialize(mergedCss)); + return editor.dom.styles.serialize(compressed); + }; + var getSelectedImage = function (editor) { + var imgElm = editor.selection.getNode(); + var figureElm = editor.dom.getParent(imgElm, 'figure.image'); + if (figureElm) { + return editor.dom.select('img', figureElm)[0]; + } + if (imgElm && (imgElm.nodeName !== 'IMG' || isPlaceholderImage(imgElm))) { + return null; + } + return imgElm; + }; + var splitTextBlock = function (editor, figure) { + var dom = editor.dom; + var textBlock = dom.getParent(figure.parentNode, function (node) { + return !!editor.schema.getTextBlockElements()[node.nodeName]; + }, editor.getBody()); + if (textBlock) { + return dom.split(textBlock, figure); + } else { + return figure; + } + }; + var readImageDataFromSelection = function (editor) { + var image = getSelectedImage(editor); + return image ? read(function (css) { + return normalizeCss(editor, css); + }, image) : defaultData(); + }; + var insertImageAtCaret = function (editor, data) { + var elm = create(function (css) { + return normalizeCss(editor, css); + }, data); + editor.dom.setAttrib(elm, 'data-mce-id', '__mcenew'); + editor.focus(); + editor.selection.setContent(elm.outerHTML); + var insertedElm = editor.dom.select('*[data-mce-id="__mcenew"]')[0]; + editor.dom.setAttrib(insertedElm, 'data-mce-id', null); + if (isFigure(insertedElm)) { + var figure = splitTextBlock(editor, insertedElm); + editor.selection.select(figure); + } else { + editor.selection.select(insertedElm); + } + }; + var syncSrcAttr = function (editor, image) { + editor.dom.setAttrib(image, 'src', image.getAttribute('src')); + }; + var deleteImage = function (editor, image) { + if (image) { + var elm = editor.dom.is(image.parentNode, 'figure.image') ? image.parentNode : image; + editor.dom.remove(elm); + editor.focus(); + editor.nodeChanged(); + if (editor.dom.isEmpty(editor.getBody())) { + editor.setContent(''); + editor.selection.setCursorLocation(); + } + } + }; + var writeImageDataToSelection = function (editor, data) { + var image = getSelectedImage(editor); + write(function (css) { + return normalizeCss(editor, css); + }, data, image); + syncSrcAttr(editor, image); + if (isFigure(image.parentNode)) { + var figure = image.parentNode; + splitTextBlock(editor, figure); + editor.selection.select(image.parentNode); + } else { + editor.selection.select(image); + waitLoadImage(editor, data, image); + } + }; + var insertOrUpdateImage = function (editor, partialData) { + var image = getSelectedImage(editor); + if (image) { + var selectedImageData = read(function (css) { + return normalizeCss(editor, css); + }, image); + var data = __assign(__assign({}, selectedImageData), partialData); + if (data.src) { + writeImageDataToSelection(editor, data); + } else { + deleteImage(editor, image); + } + } else if (partialData.src) { + insertImageAtCaret(editor, __assign(__assign({}, defaultData()), partialData)); + } + }; + + var hasOwnProperty = Object.prototype.hasOwnProperty; + var deep = function (old, nu) { + var bothObjects = isObject(old) && isObject(nu); + return bothObjects ? deepMerge(old, nu) : nu; + }; + var baseMerge = function (merger) { + return function () { + var objects = new Array(arguments.length); + for (var i = 0; i < objects.length; i++) { + objects[i] = arguments[i]; + } + if (objects.length === 0) { + throw new Error('Can\'t merge zero objects'); + } + var ret = {}; + for (var j = 0; j < objects.length; j++) { + var curObject = objects[j]; + for (var key in curObject) { + if (hasOwnProperty.call(curObject, key)) { + ret[key] = merger(ret[key], curObject[key]); + } + } + } + return ret; + }; + }; + var deepMerge = baseMerge(deep); + + var global$4 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var getValue = function (item) { + return isString(item.value) ? item.value : ''; + }; + var sanitizeList = function (list, extractValue) { + var out = []; + global$4.each(list, function (item) { + var text = isString(item.text) ? item.text : isString(item.title) ? item.title : ''; + if (item.menu !== undefined) { + var items = sanitizeList(item.menu, extractValue); + out.push({ + text: text, + items: items + }); + } else { + var value = extractValue(item); + out.push({ + text: text, + value: value + }); + } + }); + return out; + }; + var sanitizer = function (extracter) { + if (extracter === void 0) { + extracter = getValue; + } + return function (list) { + if (list) { + return Optional.from(list).map(function (list) { + return sanitizeList(list, extracter); + }); + } else { + return Optional.none(); + } + }; + }; + var sanitize = function (list) { + return sanitizer(getValue)(list); + }; + var isGroup = function (item) { + return Object.prototype.hasOwnProperty.call(item, 'items'); + }; + var findEntryDelegate = function (list, value) { + return findMap(list, function (item) { + if (isGroup(item)) { + return findEntryDelegate(item.items, value); + } else if (item.value === value) { + return Optional.some(item); + } else { + return Optional.none(); + } + }); + }; + var findEntry = function (optList, value) { + return optList.bind(function (list) { + return findEntryDelegate(list, value); + }); + }; + var ListUtils = { + sanitizer: sanitizer, + sanitize: sanitize, + findEntry: findEntry + }; + + var pathJoin = function (path1, path2) { + if (path1) { + return path1.replace(/\/$/, '') + '/' + path2.replace(/^\//, ''); + } + return path2; + }; + function Uploader (settings) { + var defaultHandler = function (blobInfo, success, failure, progress) { + var xhr = new XMLHttpRequest(); + xhr.open('POST', settings.url); + xhr.withCredentials = settings.credentials; + xhr.upload.onprogress = function (e) { + progress(e.loaded / e.total * 100); + }; + xhr.onerror = function () { + failure('Image upload failed due to a XHR Transport error. Code: ' + xhr.status); + }; + xhr.onload = function () { + if (xhr.status < 200 || xhr.status >= 300) { + failure('HTTP Error: ' + xhr.status); + return; + } + var json = JSON.parse(xhr.responseText); + if (!json || typeof json.location !== 'string') { + failure('Invalid JSON: ' + xhr.responseText); + return; + } + success(pathJoin(settings.basePath, json.location)); + }; + var formData = new FormData(); + formData.append('file', blobInfo.blob(), blobInfo.filename()); + xhr.send(formData); + }; + var uploadBlob = function (blobInfo, handler) { + return new global$2(function (resolve, reject) { + try { + handler(blobInfo, resolve, reject, noop); + } catch (ex) { + reject(ex.message); + } + }); + }; + var isDefaultHandler = function (handler) { + return handler === defaultHandler; + }; + var upload = function (blobInfo) { + return !settings.url && isDefaultHandler(settings.handler) ? global$2.reject('Upload url missing from the settings.') : uploadBlob(blobInfo, settings.handler); + }; + settings = global$4.extend({ + credentials: false, + handler: defaultHandler + }, settings); + return { upload: upload }; + } + + var makeTab = function (_info) { + return { + title: 'Advanced', + name: 'advanced', + items: [ + { + type: 'input', + label: 'Style', + name: 'style' + }, + { + type: 'grid', + columns: 2, + items: [ + { + type: 'input', + label: 'Vertical space', + name: 'vspace', + inputMode: 'numeric' + }, + { + type: 'input', + label: 'Horizontal space', + name: 'hspace', + inputMode: 'numeric' + }, + { + type: 'input', + label: 'Border width', + name: 'border', + inputMode: 'numeric' + }, + { + type: 'listbox', + name: 'borderstyle', + label: 'Border style', + items: [ + { + text: 'Select...', + value: '' + }, + { + text: 'Solid', + value: 'solid' + }, + { + text: 'Dotted', + value: 'dotted' + }, + { + text: 'Dashed', + value: 'dashed' + }, + { + text: 'Double', + value: 'double' + }, + { + text: 'Groove', + value: 'groove' + }, + { + text: 'Ridge', + value: 'ridge' + }, + { + text: 'Inset', + value: 'inset' + }, + { + text: 'Outset', + value: 'outset' + }, + { + text: 'None', + value: 'none' + }, + { + text: 'Hidden', + value: 'hidden' + } + ] + } + ] + } + ] + }; + }; + var AdvTab = { makeTab: makeTab }; + + var collect = function (editor) { + var urlListSanitizer = ListUtils.sanitizer(function (item) { + return editor.convertURL(item.value || item.url, 'src'); + }); + var futureImageList = new global$2(function (completer) { + createImageList(editor, function (imageList) { + completer(urlListSanitizer(imageList).map(function (items) { + return flatten([ + [{ + text: 'None', + value: '' + }], + items + ]); + })); + }); + }); + var classList = ListUtils.sanitize(getClassList(editor)); + var hasAdvTab$1 = hasAdvTab(editor); + var hasUploadTab$1 = hasUploadTab(editor); + var hasUploadUrl$1 = hasUploadUrl(editor); + var hasUploadHandler$1 = hasUploadHandler(editor); + var image = readImageDataFromSelection(editor); + var hasDescription$1 = hasDescription(editor); + var hasImageTitle$1 = hasImageTitle(editor); + var hasDimensions$1 = hasDimensions(editor); + var hasImageCaption$1 = hasImageCaption(editor); + var hasAccessibilityOptions = showAccessibilityOptions(editor); + var url = getUploadUrl(editor); + var basePath = getUploadBasePath(editor); + var credentials = getUploadCredentials(editor); + var handler = getUploadHandler(editor); + var automaticUploads = isAutomaticUploadsEnabled(editor); + var prependURL = Optional.some(getPrependUrl(editor)).filter(function (preUrl) { + return isString(preUrl) && preUrl.length > 0; + }); + return futureImageList.then(function (imageList) { + return { + image: image, + imageList: imageList, + classList: classList, + hasAdvTab: hasAdvTab$1, + hasUploadTab: hasUploadTab$1, + hasUploadUrl: hasUploadUrl$1, + hasUploadHandler: hasUploadHandler$1, + hasDescription: hasDescription$1, + hasImageTitle: hasImageTitle$1, + hasDimensions: hasDimensions$1, + hasImageCaption: hasImageCaption$1, + url: url, + basePath: basePath, + credentials: credentials, + handler: handler, + prependURL: prependURL, + hasAccessibilityOptions: hasAccessibilityOptions, + automaticUploads: automaticUploads + }; + }); + }; + + var makeItems = function (info) { + var imageUrl = { + name: 'src', + type: 'urlinput', + filetype: 'image', + label: 'Source' + }; + var imageList = info.imageList.map(function (items) { + return { + name: 'images', + type: 'listbox', + label: 'Image list', + items: items + }; + }); + var imageDescription = { + name: 'alt', + type: 'input', + label: 'Alternative description', + disabled: info.hasAccessibilityOptions && info.image.isDecorative + }; + var imageTitle = { + name: 'title', + type: 'input', + label: 'Image title' + }; + var imageDimensions = { + name: 'dimensions', + type: 'sizeinput' + }; + var isDecorative = { + type: 'label', + label: 'Accessibility', + items: [{ + name: 'isDecorative', + type: 'checkbox', + label: 'Image is decorative' + }] + }; + var classList = info.classList.map(function (items) { + return { + name: 'classes', + type: 'listbox', + label: 'Class', + items: items + }; + }); + var caption = { + type: 'label', + label: 'Caption', + items: [{ + type: 'checkbox', + name: 'caption', + label: 'Show caption' + }] + }; + return flatten([ + [imageUrl], + imageList.toArray(), + info.hasAccessibilityOptions && info.hasDescription ? [isDecorative] : [], + info.hasDescription ? [imageDescription] : [], + info.hasImageTitle ? [imageTitle] : [], + info.hasDimensions ? [imageDimensions] : [], + [{ + type: 'grid', + columns: 2, + items: flatten([ + classList.toArray(), + info.hasImageCaption ? [caption] : [] + ]) + }] + ]); + }; + var makeTab$1 = function (info) { + return { + title: 'General', + name: 'general', + items: makeItems(info) + }; + }; + var MainTab = { + makeTab: makeTab$1, + makeItems: makeItems + }; + + var makeTab$2 = function (_info) { + var items = [{ + type: 'dropzone', + name: 'fileinput' + }]; + return { + title: 'Upload', + name: 'upload', + items: items + }; + }; + var UploadTab = { makeTab: makeTab$2 }; + + var createState = function (info) { + return { + prevImage: ListUtils.findEntry(info.imageList, info.image.src), + prevAlt: info.image.alt, + open: true + }; + }; + var fromImageData = function (image) { + return { + src: { + value: image.src, + meta: {} + }, + images: image.src, + alt: image.alt, + title: image.title, + dimensions: { + width: image.width, + height: image.height + }, + classes: image.class, + caption: image.caption, + style: image.style, + vspace: image.vspace, + border: image.border, + hspace: image.hspace, + borderstyle: image.borderStyle, + fileinput: [], + isDecorative: image.isDecorative + }; + }; + var toImageData = function (data, removeEmptyAlt) { + return { + src: data.src.value, + alt: data.alt.length === 0 && removeEmptyAlt ? null : data.alt, + title: data.title, + width: data.dimensions.width, + height: data.dimensions.height, + class: data.classes, + style: data.style, + caption: data.caption, + hspace: data.hspace, + vspace: data.vspace, + border: data.border, + borderStyle: data.borderstyle, + isDecorative: data.isDecorative + }; + }; + var addPrependUrl2 = function (info, srcURL) { + if (!/^(?:[a-zA-Z]+:)?\/\//.test(srcURL)) { + return info.prependURL.bind(function (prependUrl) { + if (srcURL.substring(0, prependUrl.length) !== prependUrl) { + return Optional.some(prependUrl + srcURL); + } + return Optional.none(); + }); + } + return Optional.none(); + }; + var addPrependUrl = function (info, api) { + var data = api.getData(); + addPrependUrl2(info, data.src.value).each(function (srcURL) { + api.setData({ + src: { + value: srcURL, + meta: data.src.meta + } + }); + }); + }; + var formFillFromMeta2 = function (info, data, meta) { + if (info.hasDescription && isString(meta.alt)) { + data.alt = meta.alt; + } + if (info.hasAccessibilityOptions) { + data.isDecorative = meta.isDecorative || data.isDecorative || false; + } + if (info.hasImageTitle && isString(meta.title)) { + data.title = meta.title; + } + if (info.hasDimensions) { + if (isString(meta.width)) { + data.dimensions.width = meta.width; + } + if (isString(meta.height)) { + data.dimensions.height = meta.height; + } + } + if (isString(meta.class)) { + ListUtils.findEntry(info.classList, meta.class).each(function (entry) { + data.classes = entry.value; + }); + } + if (info.hasImageCaption) { + if (isBoolean(meta.caption)) { + data.caption = meta.caption; + } + } + if (info.hasAdvTab) { + if (isString(meta.style)) { + data.style = meta.style; + } + if (isString(meta.vspace)) { + data.vspace = meta.vspace; + } + if (isString(meta.border)) { + data.border = meta.border; + } + if (isString(meta.hspace)) { + data.hspace = meta.hspace; + } + if (isString(meta.borderstyle)) { + data.borderstyle = meta.borderstyle; + } + } + }; + var formFillFromMeta = function (info, api) { + var data = api.getData(); + var meta = data.src.meta; + if (meta !== undefined) { + var newData = deepMerge({}, data); + formFillFromMeta2(info, newData, meta); + api.setData(newData); + } + }; + var calculateImageSize = function (helpers, info, state, api) { + var data = api.getData(); + var url = data.src.value; + var meta = data.src.meta || {}; + if (!meta.width && !meta.height && info.hasDimensions) { + helpers.imageSize(url).then(function (size) { + if (state.open) { + api.setData({ dimensions: size }); + } + }); + } + }; + var updateImagesDropdown = function (info, state, api) { + var data = api.getData(); + var image = ListUtils.findEntry(info.imageList, data.src.value); + state.prevImage = image; + api.setData({ + images: image.map(function (entry) { + return entry.value; + }).getOr('') + }); + }; + var changeSrc = function (helpers, info, state, api) { + addPrependUrl(info, api); + formFillFromMeta(info, api); + calculateImageSize(helpers, info, state, api); + updateImagesDropdown(info, state, api); + }; + var changeImages = function (helpers, info, state, api) { + var data = api.getData(); + var image = ListUtils.findEntry(info.imageList, data.images); + image.each(function (img) { + var updateAlt = data.alt === '' || state.prevImage.map(function (image) { + return image.text === data.alt; + }).getOr(false); + if (updateAlt) { + if (img.value === '') { + api.setData({ + src: img, + alt: state.prevAlt + }); + } else { + api.setData({ + src: img, + alt: img.text + }); + } + } else { + api.setData({ src: img }); + } + }); + state.prevImage = image; + changeSrc(helpers, info, state, api); + }; + var calcVSpace = function (css) { + var matchingTopBottom = css['margin-top'] && css['margin-bottom'] && css['margin-top'] === css['margin-bottom']; + return matchingTopBottom ? removePixelSuffix(String(css['margin-top'])) : ''; + }; + var calcHSpace = function (css) { + var matchingLeftRight = css['margin-right'] && css['margin-left'] && css['margin-right'] === css['margin-left']; + return matchingLeftRight ? removePixelSuffix(String(css['margin-right'])) : ''; + }; + var calcBorderWidth = function (css) { + return css['border-width'] ? removePixelSuffix(String(css['border-width'])) : ''; + }; + var calcBorderStyle = function (css) { + return css['border-style'] ? String(css['border-style']) : ''; + }; + var calcStyle = function (parseStyle, serializeStyle, css) { + return serializeStyle(parseStyle(serializeStyle(css))); + }; + var changeStyle2 = function (parseStyle, serializeStyle, data) { + var css = mergeMargins(parseStyle(data.style)); + var dataCopy = deepMerge({}, data); + dataCopy.vspace = calcVSpace(css); + dataCopy.hspace = calcHSpace(css); + dataCopy.border = calcBorderWidth(css); + dataCopy.borderstyle = calcBorderStyle(css); + dataCopy.style = calcStyle(parseStyle, serializeStyle, css); + return dataCopy; + }; + var changeStyle = function (helpers, api) { + var data = api.getData(); + var newData = changeStyle2(helpers.parseStyle, helpers.serializeStyle, data); + api.setData(newData); + }; + var changeAStyle = function (helpers, info, api) { + var data = deepMerge(fromImageData(info.image), api.getData()); + var style = getStyleValue(helpers.normalizeCss, toImageData(data, false)); + api.setData({ style: style }); + }; + var changeFileInput = function (helpers, info, state, api) { + var data = api.getData(); + api.block('Uploading image'); + head(data.fileinput).fold(function () { + api.unblock(); + }, function (file) { + var blobUri = URL.createObjectURL(file); + var uploader = Uploader({ + url: info.url, + basePath: info.basePath, + credentials: info.credentials, + handler: info.handler + }); + var finalize = function () { + api.unblock(); + URL.revokeObjectURL(blobUri); + }; + var updateSrcAndSwitchTab = function (url) { + api.setData({ + src: { + value: url, + meta: {} + } + }); + api.showTab('general'); + changeSrc(helpers, info, state, api); + }; + blobToDataUri(file).then(function (dataUrl) { + var blobInfo = helpers.createBlobCache(file, blobUri, dataUrl); + if (info.automaticUploads) { + uploader.upload(blobInfo).then(function (url) { + updateSrcAndSwitchTab(url); + finalize(); + }).catch(function (err) { + finalize(); + helpers.alertErr(err); + }); + } else { + helpers.addToBlobCache(blobInfo); + updateSrcAndSwitchTab(blobInfo.blobUri()); + api.unblock(); + } + }); + }); + }; + var changeHandler = function (helpers, info, state) { + return function (api, evt) { + if (evt.name === 'src') { + changeSrc(helpers, info, state, api); + } else if (evt.name === 'images') { + changeImages(helpers, info, state, api); + } else if (evt.name === 'alt') { + state.prevAlt = api.getData().alt; + } else if (evt.name === 'style') { + changeStyle(helpers, api); + } else if (evt.name === 'vspace' || evt.name === 'hspace' || evt.name === 'border' || evt.name === 'borderstyle') { + changeAStyle(helpers, info, api); + } else if (evt.name === 'fileinput') { + changeFileInput(helpers, info, state, api); + } else if (evt.name === 'isDecorative') { + if (api.getData().isDecorative) { + api.disable('alt'); + } else { + api.enable('alt'); + } + } + }; + }; + var closeHandler = function (state) { + return function () { + state.open = false; + }; + }; + var makeDialogBody = function (info) { + if (info.hasAdvTab || info.hasUploadUrl || info.hasUploadHandler) { + var tabPanel = { + type: 'tabpanel', + tabs: flatten([ + [MainTab.makeTab(info)], + info.hasAdvTab ? [AdvTab.makeTab(info)] : [], + info.hasUploadTab && (info.hasUploadUrl || info.hasUploadHandler) ? [UploadTab.makeTab(info)] : [] + ]) + }; + return tabPanel; + } else { + var panel = { + type: 'panel', + items: MainTab.makeItems(info) + }; + return panel; + } + }; + var makeDialog = function (helpers) { + return function (info) { + var state = createState(info); + return { + title: 'Insert/Edit Image', + size: 'normal', + body: makeDialogBody(info), + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + initialData: fromImageData(info.image), + onSubmit: helpers.onSubmit(info), + onChange: changeHandler(helpers, info, state), + onClose: closeHandler(state) + }; + }; + }; + var submitHandler = function (editor) { + return function (info) { + return function (api) { + var data = deepMerge(fromImageData(info.image), api.getData()); + editor.execCommand('mceUpdateImage', false, toImageData(data, info.hasAccessibilityOptions)); + editor.editorUpload.uploadImagesAuto(); + api.close(); + }; + }; + }; + var imageSize = function (editor) { + return function (url) { + return getImageSize(editor.documentBaseURI.toAbsolute(url)).then(function (dimensions) { + return { + width: String(dimensions.width), + height: String(dimensions.height) + }; + }); + }; + }; + var createBlobCache = function (editor) { + return function (file, blobUri, dataUrl) { + return editor.editorUpload.blobCache.create({ + blob: file, + blobUri: blobUri, + name: file.name ? file.name.replace(/\.[^\.]+$/, '') : null, + base64: dataUrl.split(',')[1] + }); + }; + }; + var addToBlobCache = function (editor) { + return function (blobInfo) { + editor.editorUpload.blobCache.add(blobInfo); + }; + }; + var alertErr = function (editor) { + return function (message) { + editor.windowManager.alert(message); + }; + }; + var normalizeCss$1 = function (editor) { + return function (cssText) { + return normalizeCss(editor, cssText); + }; + }; + var parseStyle = function (editor) { + return function (cssText) { + return editor.dom.parseStyle(cssText); + }; + }; + var serializeStyle = function (editor) { + return function (stylesArg, name) { + return editor.dom.serializeStyle(stylesArg, name); + }; + }; + var Dialog = function (editor) { + var helpers = { + onSubmit: submitHandler(editor), + imageSize: imageSize(editor), + addToBlobCache: addToBlobCache(editor), + createBlobCache: createBlobCache(editor), + alertErr: alertErr(editor), + normalizeCss: normalizeCss$1(editor), + parseStyle: parseStyle(editor), + serializeStyle: serializeStyle(editor) + }; + var open = function () { + collect(editor).then(makeDialog(helpers)).then(editor.windowManager.open); + }; + return { open: open }; + }; + + var register = function (editor) { + editor.addCommand('mceImage', Dialog(editor).open); + editor.addCommand('mceUpdateImage', function (_ui, data) { + editor.undoManager.transact(function () { + return insertOrUpdateImage(editor, data); + }); + }); + }; + + var hasImageClass = function (node) { + var className = node.attr('class'); + return className && /\bimage\b/.test(className); + }; + var toggleContentEditableState = function (state) { + return function (nodes) { + var i = nodes.length; + var toggleContentEditable = function (node) { + node.attr('contenteditable', state ? 'true' : null); + }; + while (i--) { + var node = nodes[i]; + if (hasImageClass(node)) { + node.attr('contenteditable', state ? 'false' : null); + global$4.each(node.getAll('figcaption'), toggleContentEditable); + } + } + }; + }; + var setup = function (editor) { + editor.on('PreInit', function () { + editor.parser.addNodeFilter('figure', toggleContentEditableState(true)); + editor.serializer.addNodeFilter('figure', toggleContentEditableState(false)); + }); + }; + + var register$1 = function (editor) { + editor.ui.registry.addToggleButton('image', { + icon: 'image', + tooltip: 'Insert/edit image', + onAction: Dialog(editor).open, + onSetup: function (buttonApi) { + return editor.selection.selectorChangedWithUnbind('img:not([data-mce-object],[data-mce-placeholder]),figure.image', buttonApi.setActive).unbind; + } + }); + editor.ui.registry.addMenuItem('image', { + icon: 'image', + text: 'Image...', + onAction: Dialog(editor).open + }); + editor.ui.registry.addContextMenu('image', { + update: function (element) { + return isFigure(element) || isImage(element) && !isPlaceholderImage(element) ? ['image'] : []; + } + }); + }; + + function Plugin () { + global.add('image', function (editor) { + setup(editor); + register$1(editor); + register(editor); + }); + } + + Plugin(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/image/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/image/plugin.min.js index fb8ee8fd7f43..9e01ef9a50d6 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/image/plugin.min.js +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/image/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("image",function(e){function t(e,t){function n(e,n){i.parentNode&&i.parentNode.removeChild(i),t({width:e,height:n})}var i=document.createElement("img");i.onload=function(){n(i.clientWidth,i.clientHeight)},i.onerror=function(){n()};var a=i.style;a.visibility="hidden",a.position="fixed",a.bottom=a.left=0,a.width=a.height="auto",document.body.appendChild(i),i.src=e}function n(t){return function(){var n=e.settings.image_list;"string"==typeof n?tinymce.util.XHR.send({url:n,success:function(e){t(tinymce.util.JSON.parse(e))}}):t(n)}}function i(n){function i(){var t=[{text:"None",value:""}];return tinymce.each(n,function(n){t.push({text:n.text||n.title,value:e.convertURL(n.value||n.url,"src"),menu:n.menu})}),t}function a(){var e,t,n,i;e=s.find("#width")[0],t=s.find("#height")[0],n=e.value(),i=t.value(),s.find("#constrain")[0].checked()&&d&&u&&n&&i&&(d!=n?(i=Math.round(n/d*i),t.value(i)):(n=Math.round(i/u*n),e.value(n))),d=n,u=i}function o(){function t(t){function i(){t.onload=t.onerror=null,e.selection.select(t),e.nodeChanged()}t.onload=function(){n.width||n.height||m.setAttribs(t,{width:t.clientWidth,height:t.clientHeight}),i()},t.onerror=i}c(),a();var n=s.toJSON();""===n.width&&(n.width=null),""===n.height&&(n.height=null),""===n.style&&(n.style=null),n={src:n.src,alt:n.alt,width:n.width,height:n.height,style:n.style},e.fire('SaveImage', n),e.undoManager.transact(function(){return n.src?(p?m.setAttribs(p,n):(n.id="__mcenew",e.focus(),e.selection.setContent(m.createHTML("img",n)),p=m.get("__mcenew"),m.setAttrib(p,"id",null)),void t(p)):void(p&&(m.remove(p),e.nodeChanged()))})}function l(e){return e&&(e=e.replace(/px$/,"")),e}function r(){h&&h.value(e.convertURL(this.value(),"src")),t(this.value(),function(e){e.width&&e.height&&(d=e.width,u=e.height,s.find("#width").value(d),s.find("#height").value(u))})}function c(){function t(e){return e.length>0&&/^[0-9]+$/.test(e)&&(e+="px"),e}if(e.settings.image_advtab){var n=s.toJSON(),i=m.parseStyle(n.style);delete i.margin,i["margin-top"]=i["margin-bottom"]=t(n.vspace),i["margin-left"]=i["margin-right"]=t(n.hspace),i["border-width"]=t(n.border),s.find("#style").value(m.serializeStyle(m.parseStyle(m.serializeStyle(i))))}}var s,d,u,h,g={},m=e.dom,p=e.selection.getNode();d=m.getAttrib(p,"width"),u=m.getAttrib(p,"height"),"IMG"!=p.nodeName||p.getAttribute("data-mce-object")||p.getAttribute("data-mce-placeholder")?p=null:g={src:m.getAttrib(p,"src"),alt:m.getAttrib(p,"alt"),width:d,height:u},n&&(h={type:"listbox",label:"Image list",values:i(),value:g.src&&e.convertURL(g.src,"src"),onselect:function(e){var t=s.find("#alt");(!t.value()||e.lastControl&&t.value()==e.lastControl.text())&&t.value(e.control.text()),s.find("#src").value(e.control.value())},onPostRender:function(){h=this}});var y=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:r},h,{name:"alt",type:"textbox",label:"Image description"},{type:"container",label:"Dimensions",layout:"flex",direction:"row",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:3,onchange:a},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:3,onchange:a},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}];e.fire('EditImage', g),e.settings.image_advtab?(p&&(g.hspace=l(p.style.marginLeft||p.style.marginRight),g.vspace=l(p.style.marginTop||p.style.marginBottom),g.border=l(p.style.borderWidth),g.style=e.dom.serializeStyle(e.dom.parseStyle(e.dom.getAttrib(p,"style")))),s=e.windowManager.open({title:"Insert/edit image",data:g,bodyType:"tabpanel",body:[{title:"General",type:"form",items:y},{title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox"},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,alignH:["left","right"],defaults:{type:"textbox",maxWidth:50,onchange:c},items:[{label:"Vertical space",name:"vspace"},{label:"Horizontal space",name:"hspace"},{label:"Border",name:"border"}]}]}],onSubmit:o})):s=e.windowManager.open({title:"Insert/edit image",data:g,body:y,onSubmit:o})}e.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:n(i),stateSelector:"img:not([data-mce-object],[data-mce-placeholder])"}),e.addMenuItem("image",{icon:"image",text:"Insert image",onclick:n(i),context:"insert",prependToContext:!0})}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var t,e,n,r,o,a=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(){return(c=Object.assign||function(e){for(var t,n=1,r=arguments.length;n 1) { + console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); + }; + var fromTag = function (tag, scope) { + var doc = scope || document; + var node = doc.createElement(tag); + return fromDom(node); + }; + var fromText = function (text, scope) { + var doc = scope || document; + var node = doc.createTextNode(text); + return fromDom(node); + }; + var fromDom = function (node) { + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: node }; + }; + var fromPoint = function (docElm, x, y) { + return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); + }; + var SugarElement = { + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint + }; + + var is = function (element, selector) { + var dom = element.dom; + if (dom.nodeType !== ELEMENT) { + return false; + } else { + var elem = dom; + if (elem.matches !== undefined) { + return elem.matches(selector); + } else if (elem.msMatchesSelector !== undefined) { + return elem.msMatchesSelector(selector); + } else if (elem.webkitMatchesSelector !== undefined) { + return elem.webkitMatchesSelector(selector); + } else if (elem.mozMatchesSelector !== undefined) { + return elem.mozMatchesSelector(selector); + } else { + throw new Error('Browser lacks native selectors'); + } + } + }; + + var Global = typeof window !== 'undefined' ? window : Function('return this;')(); + + var child = function (scope, predicate) { + var pred = function (node) { + return predicate(SugarElement.fromDom(node)); + }; + var result = find(scope.dom.childNodes, pred); + return result.map(SugarElement.fromDom); + }; + + var child$1 = function (scope, selector) { + return child(scope, function (e) { + return is(e, selector); + }); + }; + + var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay'); + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.Promise'); + + var global$4 = tinymce.util.Tools.resolve('tinymce.util.URI'); + + var getToolbarItems = function (editor) { + return editor.getParam('imagetools_toolbar', 'rotateleft rotateright flipv fliph editimage imageoptions'); + }; + var getProxyUrl = function (editor) { + return editor.getParam('imagetools_proxy'); + }; + var getCorsHosts = function (editor) { + return editor.getParam('imagetools_cors_hosts', [], 'string[]'); + }; + var getCredentialsHosts = function (editor) { + return editor.getParam('imagetools_credentials_hosts', [], 'string[]'); + }; + var getFetchImage = function (editor) { + return Optional.from(editor.getParam('imagetools_fetch_image', null, 'function')); + }; + var getApiKey = function (editor) { + return editor.getParam('api_key', editor.getParam('imagetools_api_key', '', 'string'), 'string'); + }; + var getUploadTimeout = function (editor) { + return editor.getParam('images_upload_timeout', 30000, 'number'); + }; + var shouldReuseFilename = function (editor) { + return editor.getParam('images_reuse_filename', false, 'boolean'); + }; + + function getImageSize(img) { + var width, height; + function isPxValue(value) { + return /^[0-9\.]+px$/.test(value); + } + width = img.style.width; + height = img.style.height; + if (width || height) { + if (isPxValue(width) && isPxValue(height)) { + return { + w: parseInt(width, 10), + h: parseInt(height, 10) + }; + } + return null; + } + width = img.width; + height = img.height; + if (width && height) { + return { + w: parseInt(width, 10), + h: parseInt(height, 10) + }; + } + return null; + } + function setImageSize(img, size) { + var width, height; + if (size) { + width = img.style.width; + height = img.style.height; + if (width || height) { + img.style.width = size.w + 'px'; + img.style.height = size.h + 'px'; + img.removeAttribute('data-mce-style'); + } + width = img.width; + height = img.height; + if (width || height) { + img.setAttribute('width', size.w); + img.setAttribute('height', size.h); + } + } + } + function getNaturalImageSize(img) { + return { + w: img.naturalWidth, + h: img.naturalHeight + }; + } + + var count = 0; + var getFigureImg = function (elem) { + return child$1(SugarElement.fromDom(elem), 'img'); + }; + var isFigure = function (editor, elem) { + return editor.dom.is(elem, 'figure'); + }; + var getEditableImage = function (editor, elem) { + var isImage = function (imgNode) { + return editor.dom.is(imgNode, 'img:not([data-mce-object],[data-mce-placeholder])'); + }; + var isEditable = function (imgNode) { + return isImage(imgNode) && (isLocalImage(editor, imgNode) || isCorsImage(editor, imgNode) || getProxyUrl(editor)); + }; + if (isFigure(editor, elem)) { + var imgOpt = getFigureImg(elem); + return imgOpt.map(function (img) { + return isEditable(img.dom) ? Optional.some(img.dom) : Optional.none(); + }); + } + return isEditable(elem) ? Optional.some(elem) : Optional.none(); + }; + var displayError = function (editor, error) { + editor.notificationManager.open({ + text: error, + type: 'error' + }); + }; + var getSelectedImage = function (editor) { + var elem = editor.selection.getNode(); + if (isFigure(editor, elem)) { + return getFigureImg(elem); + } else { + return Optional.some(SugarElement.fromDom(elem)); + } + }; + var extractFilename = function (editor, url) { + var m = url.match(/\/([^\/\?]+)?\.(?:jpeg|jpg|png|gif)(?:\?|$)/i); + if (m) { + return editor.dom.encode(m[1]); + } + return null; + }; + var createId = function () { + return 'imagetools' + count++; + }; + var isLocalImage = function (editor, img) { + var url = img.src; + return url.indexOf('data:') === 0 || url.indexOf('blob:') === 0 || new global$4(url).host === editor.documentBaseURI.host; + }; + var isCorsImage = function (editor, img) { + return global$1.inArray(getCorsHosts(editor), new global$4(img.src).host) !== -1; + }; + var isCorsWithCredentialsImage = function (editor, img) { + return global$1.inArray(getCredentialsHosts(editor), new global$4(img.src).host) !== -1; + }; + var defaultFetchImage = function (editor, img) { + if (isCorsImage(editor, img)) { + return getUrl(img.src, null, isCorsWithCredentialsImage(editor, img)); + } + if (!isLocalImage(editor, img)) { + var proxyUrl = getProxyUrl(editor); + var src = proxyUrl + (proxyUrl.indexOf('?') === -1 ? '?' : '&') + 'url=' + encodeURIComponent(img.src); + var apiKey = getApiKey(editor); + return getUrl(src, apiKey, false); + } + return imageToBlob$1(img); + }; + var imageToBlob$2 = function (editor, img) { + return getFetchImage(editor).fold(function () { + return defaultFetchImage(editor, img); + }, function (customFetchImage) { + return customFetchImage(img); + }); + }; + var findBlob = function (editor, img) { + var blobInfo = editor.editorUpload.blobCache.getByUri(img.src); + if (blobInfo) { + return global$3.resolve(blobInfo.blob()); + } + return imageToBlob$2(editor, img); + }; + var startTimedUpload = function (editor, imageUploadTimerState) { + var imageUploadTimer = global$2.setEditorTimeout(editor, function () { + editor.editorUpload.uploadImagesAuto(); + }, getUploadTimeout(editor)); + imageUploadTimerState.set(imageUploadTimer); + }; + var cancelTimedUpload = function (imageUploadTimerState) { + global$2.clearTimeout(imageUploadTimerState.get()); + }; + var updateSelectedImage = function (editor, ir, uploadImmediately, imageUploadTimerState, selectedImage, size) { + return ir.toBlob().then(function (blob) { + var uri, name, blobInfo; + var blobCache = editor.editorUpload.blobCache; + uri = selectedImage.src; + if (shouldReuseFilename(editor)) { + blobInfo = blobCache.getByUri(uri); + if (blobInfo) { + uri = blobInfo.uri(); + name = blobInfo.name(); + } else { + name = extractFilename(editor, uri); + } + } + blobInfo = blobCache.create({ + id: createId(), + blob: blob, + base64: ir.toBase64(), + uri: uri, + name: name + }); + blobCache.add(blobInfo); + editor.undoManager.transact(function () { + function imageLoadedHandler() { + editor.$(selectedImage).off('load', imageLoadedHandler); + editor.nodeChanged(); + if (uploadImmediately) { + editor.editorUpload.uploadImagesAuto(); + } else { + cancelTimedUpload(imageUploadTimerState); + startTimedUpload(editor, imageUploadTimerState); + } + } + editor.$(selectedImage).on('load', imageLoadedHandler); + if (size) { + editor.$(selectedImage).attr({ + width: size.w, + height: size.h + }); + } + editor.$(selectedImage).attr({ src: blobInfo.blobUri() }).removeAttr('data-mce-src'); + }); + return blobInfo; + }); + }; + var selectedImageOperation = function (editor, imageUploadTimerState, fn, size) { + return function () { + var imgOpt = getSelectedImage(editor); + return imgOpt.fold(function () { + displayError(editor, 'Could not find selected image'); + }, function (img) { + return editor._scanForImages().then(function () { + return findBlob(editor, img.dom); + }).then(blobToImageResult).then(fn).then(function (imageResult) { + return updateSelectedImage(editor, imageResult, false, imageUploadTimerState, img.dom, size); + }, function (error) { + displayError(editor, error); + }); + }); + }; + }; + var rotate$2 = function (editor, imageUploadTimerState, angle) { + return function () { + var imgOpt = getSelectedImage(editor); + var flippedSize = imgOpt.fold(function () { + return null; + }, function (img) { + var size = getImageSize(img.dom); + return size ? { + w: size.h, + h: size.w + } : null; + }); + return selectedImageOperation(editor, imageUploadTimerState, function (imageResult) { + return rotate$1(imageResult, angle); + }, flippedSize)(); + }; + }; + var flip$2 = function (editor, imageUploadTimerState, axis) { + return function () { + return selectedImageOperation(editor, imageUploadTimerState, function (imageResult) { + return flip$1(imageResult, axis); + })(); + }; + }; + var handleDialogBlob = function (editor, imageUploadTimerState, img, originalSize, blob) { + return blobToImage$1(blob).then(function (newImage) { + var newSize = getNaturalImageSize(newImage); + if (originalSize.w !== newSize.w || originalSize.h !== newSize.h) { + if (getImageSize(img)) { + setImageSize(img, newSize); + } + } + URL.revokeObjectURL(newImage.src); + return blob; + }).then(blobToImageResult).then(function (imageResult) { + return updateSelectedImage(editor, imageResult, true, imageUploadTimerState, img); + }, function () { + }); + }; + + var saveState = 'save-state'; + var disable = 'disable'; + var enable = 'enable'; + + var createState = function (blob) { + return { + blob: blob, + url: URL.createObjectURL(blob) + }; + }; + var makeOpen = function (editor, imageUploadTimerState) { + return function () { + var getLoadedSpec = function (currentState) { + return { + title: 'Edit Image', + size: 'large', + body: { + type: 'panel', + items: [{ + type: 'imagetools', + name: 'imagetools', + label: 'Edit Image', + currentState: currentState + }] + }, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true, + disabled: true + } + ], + onSubmit: function (api) { + var blob = api.getData().imagetools.blob; + originalImgOpt.each(function (originalImg) { + originalSizeOpt.each(function (originalSize) { + handleDialogBlob(editor, imageUploadTimerState, originalImg.dom, originalSize, blob); + }); + }); + api.close(); + }, + onCancel: function () { + }, + onAction: function (api, details) { + switch (details.name) { + case saveState: + if (details.value) { + api.enable('save'); + } else { + api.disable('save'); + } + break; + case disable: + api.disable('save'); + api.disable('cancel'); + break; + case enable: + api.enable('cancel'); + break; + } + } + }; + }; + var originalImgOpt = getSelectedImage(editor); + var originalSizeOpt = originalImgOpt.map(function (origImg) { + return getNaturalImageSize(origImg.dom); + }); + var imgOpt = getSelectedImage(editor); + imgOpt.each(function (img) { + getEditableImage(editor, img.dom).each(function (_) { + findBlob(editor, img.dom).then(function (blob) { + var state = createState(blob); + editor.windowManager.open(getLoadedSpec(state)); + }); + }); + }); + }; + }; + + var register = function (editor, imageUploadTimerState) { + global$1.each({ + mceImageRotateLeft: rotate$2(editor, imageUploadTimerState, -90), + mceImageRotateRight: rotate$2(editor, imageUploadTimerState, 90), + mceImageFlipVertical: flip$2(editor, imageUploadTimerState, 'v'), + mceImageFlipHorizontal: flip$2(editor, imageUploadTimerState, 'h'), + mceEditImage: makeOpen(editor, imageUploadTimerState) + }, function (fn, cmd) { + editor.addCommand(cmd, fn); + }); + }; + + var setup = function (editor, imageUploadTimerState, lastSelectedImageState) { + editor.on('NodeChange', function (e) { + var lastSelectedImage = lastSelectedImageState.get(); + if (lastSelectedImage && lastSelectedImage.src !== e.element.src) { + cancelTimedUpload(imageUploadTimerState); + editor.editorUpload.uploadImagesAuto(); + lastSelectedImageState.set(null); + } + getEditableImage(editor, e.element).each(lastSelectedImageState.set); + }); + }; + + var register$1 = function (editor) { + var cmd = function (command) { + return function () { + return editor.execCommand(command); + }; + }; + editor.ui.registry.addButton('rotateleft', { + tooltip: 'Rotate counterclockwise', + icon: 'rotate-left', + onAction: cmd('mceImageRotateLeft') + }); + editor.ui.registry.addButton('rotateright', { + tooltip: 'Rotate clockwise', + icon: 'rotate-right', + onAction: cmd('mceImageRotateRight') + }); + editor.ui.registry.addButton('flipv', { + tooltip: 'Flip vertically', + icon: 'flip-vertically', + onAction: cmd('mceImageFlipVertical') + }); + editor.ui.registry.addButton('fliph', { + tooltip: 'Flip horizontally', + icon: 'flip-horizontally', + onAction: cmd('mceImageFlipHorizontal') + }); + editor.ui.registry.addButton('editimage', { + tooltip: 'Edit image', + icon: 'edit-image', + onAction: cmd('mceEditImage'), + onSetup: function (buttonApi) { + var setDisabled = function () { + var elementOpt = getSelectedImage(editor); + elementOpt.each(function (element) { + var disabled = getEditableImage(editor, element.dom).isNone(); + buttonApi.setDisabled(disabled); + }); + }; + editor.on('NodeChange', setDisabled); + return function () { + editor.off('NodeChange', setDisabled); + }; + } + }); + editor.ui.registry.addButton('imageoptions', { + tooltip: 'Image options', + icon: 'image', + onAction: cmd('mceImage') + }); + editor.ui.registry.addContextMenu('imagetools', { + update: function (element) { + return getEditableImage(editor, element).fold(function () { + return []; + }, function (_) { + return [{ + text: 'Edit image', + icon: 'edit-image', + onAction: cmd('mceEditImage') + }]; + }); + } + }); + }; + + var register$2 = function (editor) { + editor.ui.registry.addContextToolbar('imagetools', { + items: getToolbarItems(editor), + predicate: function (elem) { + return getEditableImage(editor, elem).isSome(); + }, + position: 'node', + scope: 'node' + }); + }; + + function Plugin () { + global.add('imagetools', function (editor) { + var imageUploadTimerState = Cell(0); + var lastSelectedImageState = Cell(null); + register(editor, imageUploadTimerState); + register$1(editor); + register$2(editor); + setup(editor, imageUploadTimerState, lastSelectedImageState); + }); + } + + Plugin(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/imagetools/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/imagetools/plugin.min.js new file mode 100644 index 000000000000..44b4e8b7ffac --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/imagetools/plugin.min.js @@ -0,0 +1,9 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var t,e,n,r,l=function(t){var e=t;return{get:function(){return e},set:function(t){e=t}}},o=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(){},u=function(t){return function(){return t}},a=u(!1),c=u(!0),s=function(){return f},f=(t=function(t){return t.isNone()},{fold:function(t,e){return t()},is:a,isSome:a,isNone:c,getOr:n=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(undefined),or:n,orThunk:e,map:s,each:i,bind:s,exists:a,forall:c,filter:s,equals:t,equals_:t,toArray:function(){return[]},toString:u("none()")}),m=function(n){var t=u(n),e=function(){return o},r=function(t){return t(n)},o={fold:function(t,e){return e(n)},is:function(t){return n===t},isSome:c,isNone:a,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:e,orThunk:e,map:function(t){return m(t(n))},each:function(t){t(n)},bind:r,exists:r,forall:r,filter:function(t){return t(n)?o:f},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(t){return t.is(n)},equals_:function(t,e){return t.fold(a,function(t){return e(n,t)})}};return o},g={some:m,none:s,from:function(t){return null===t||t===undefined?f:m(t)}},h=function(t){return!(null===(e=t)||e===undefined);var e},p=(r="function",function(t){return typeof t===r});function v(t,e){return b(document.createElement("canvas"),t,e)}function y(t){var e=v(t.width,t.height);return w(e).drawImage(t,0,0),e}function w(t){return t.getContext("2d")}function b(t,e,n){return t.width=e,t.height=n,t}var I,T,_,R,U=window.Promise?window.Promise:(I=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],C(t,A(j,this),A(x,this))},T=window,_=I.immediateFn||"function"==typeof T.setImmediate&&T.setImmediate||function(t){setTimeout(t,1)},R=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},I.prototype["catch"]=function(t){return this.then(null,t)},I.prototype.then=function(n,r){var o=this;return new I(function(t,e){E.call(o,new k(n,r,t,e))})},I.all=function(){for(var t=[],e=0;e 0) { + global$4.each(selectorGroups, function (group) { + var menuItem = processSelector(selector, group); + if (menuItem) { + model.addItemToGroup(group.title, menuItem); + } + }); + } else { + var menuItem = processSelector(selector, null); + if (menuItem) { + model.addItem(menuItem); + } + } + } + } + }); + var items = model.toFormats(); + editor.fire('addStyleModifications', { + items: items, + replace: !shouldAppend(editor) + }); + }); + }; + + var get = function (editor) { + var convertSelectorToFormat = function (selectorText) { + return defaultConvertSelectorToFormat(editor, selectorText); + }; + return { convertSelectorToFormat: convertSelectorToFormat }; + }; + + function Plugin () { + global.add('importcss', function (editor) { + setup(editor); + return get(editor); + }); + } + + Plugin(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/importcss/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/importcss/plugin.min.js new file mode 100644 index 000000000000..d2cb80e898b8 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/importcss/plugin.min.js @@ -0,0 +1,9 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var n,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),v=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),f=tinymce.util.Tools.resolve("tinymce.EditorManager"),m=tinymce.util.Tools.resolve("tinymce.Env"),h=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=function(t){return t.getParam("importcss_selector_converter")},o=(n="array",function(t){return r=typeof(e=t),(null===e?"null":"object"==r&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==r&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":r)===n;var e,r}),i=Array.prototype.push,l=function(t,e){return function(t){for(var e=[],r=0,n=t.length;r' + html + ''; - - var timeElm = editor.dom.getParent(editor.selection.getStart(), 'time'); - if (timeElm) { - editor.dom.setOuterHTML(timeElm, html); - return; - } - } - - editor.insertContent(html); - } - - editor.addCommand('mceInsertDate', function() { - insertDateTime(editor.getParam("insertdatetime_dateformat", editor.translate("%Y-%m-%d"))); - }); - - editor.addCommand('mceInsertTime', function() { - insertDateTime(editor.getParam("insertdatetime_timeformat", editor.translate('%H:%M:%S'))); - }); - - editor.addButton('insertdatetime', { - type: 'splitbutton', - title: 'Insert date/time', - onclick: function() { - insertDateTime(lastFormat || defaultButtonTimeFormat); - }, - menu: menuItems - }); - - tinymce.each(editor.settings.insertdatetime_formats || [ - "%H:%M:%S", - "%Y-%m-%d", - "%I:%M:%S %p", - "%D" - ], function(fmt) { - if (!defaultButtonTimeFormat) { - defaultButtonTimeFormat = fmt; - } - - menuItems.push({ - text: getDateTime(fmt), - onclick: function() { - lastFormat = fmt; - insertDateTime(fmt); - } - }); - }); - - editor.addMenuItem('insertdatetime', { - icon: 'date', - text: 'Insert date/time', - menu: menuItems, - context: 'insert' - }); -}); +(function () { + 'use strict'; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var getDateFormat = function (editor) { + return editor.getParam('insertdatetime_dateformat', editor.translate('%Y-%m-%d')); + }; + var getTimeFormat = function (editor) { + return editor.getParam('insertdatetime_timeformat', editor.translate('%H:%M:%S')); + }; + var getFormats = function (editor) { + return editor.getParam('insertdatetime_formats', [ + '%H:%M:%S', + '%Y-%m-%d', + '%I:%M:%S %p', + '%D' + ]); + }; + var getDefaultDateTime = function (editor) { + var formats = getFormats(editor); + return formats.length > 0 ? formats[0] : getTimeFormat(editor); + }; + var shouldInsertTimeElement = function (editor) { + return editor.getParam('insertdatetime_element', false); + }; + + var daysShort = 'Sun Mon Tue Wed Thu Fri Sat Sun'.split(' '); + var daysLong = 'Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday'.split(' '); + var monthsShort = 'Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec'.split(' '); + var monthsLong = 'January February March April May June July August September October November December'.split(' '); + var addZeros = function (value, len) { + value = '' + value; + if (value.length < len) { + for (var i = 0; i < len - value.length; i++) { + value = '0' + value; + } + } + return value; + }; + var getDateTime = function (editor, fmt, date) { + date = date || new Date(); + fmt = fmt.replace('%D', '%m/%d/%Y'); + fmt = fmt.replace('%r', '%I:%M:%S %p'); + fmt = fmt.replace('%Y', '' + date.getFullYear()); + fmt = fmt.replace('%y', '' + date.getYear()); + fmt = fmt.replace('%m', addZeros(date.getMonth() + 1, 2)); + fmt = fmt.replace('%d', addZeros(date.getDate(), 2)); + fmt = fmt.replace('%H', '' + addZeros(date.getHours(), 2)); + fmt = fmt.replace('%M', '' + addZeros(date.getMinutes(), 2)); + fmt = fmt.replace('%S', '' + addZeros(date.getSeconds(), 2)); + fmt = fmt.replace('%I', '' + ((date.getHours() + 11) % 12 + 1)); + fmt = fmt.replace('%p', '' + (date.getHours() < 12 ? 'AM' : 'PM')); + fmt = fmt.replace('%B', '' + editor.translate(monthsLong[date.getMonth()])); + fmt = fmt.replace('%b', '' + editor.translate(monthsShort[date.getMonth()])); + fmt = fmt.replace('%A', '' + editor.translate(daysLong[date.getDay()])); + fmt = fmt.replace('%a', '' + editor.translate(daysShort[date.getDay()])); + fmt = fmt.replace('%%', '%'); + return fmt; + }; + var updateElement = function (editor, timeElm, computerTime, userTime) { + var newTimeElm = editor.dom.create('time', { datetime: computerTime }, userTime); + timeElm.parentNode.insertBefore(newTimeElm, timeElm); + editor.dom.remove(timeElm); + editor.selection.select(newTimeElm, true); + editor.selection.collapse(false); + }; + var insertDateTime = function (editor, format) { + if (shouldInsertTimeElement(editor)) { + var userTime = getDateTime(editor, format); + var computerTime = void 0; + if (/%[HMSIp]/.test(format)) { + computerTime = getDateTime(editor, '%Y-%m-%dT%H:%M'); + } else { + computerTime = getDateTime(editor, '%Y-%m-%d'); + } + var timeElm = editor.dom.getParent(editor.selection.getStart(), 'time'); + if (timeElm) { + updateElement(editor, timeElm, computerTime, userTime); + } else { + editor.insertContent(''); + } + } else { + editor.insertContent(getDateTime(editor, format)); + } + }; + + var register = function (editor) { + editor.addCommand('mceInsertDate', function () { + insertDateTime(editor, getDateFormat(editor)); + }); + editor.addCommand('mceInsertTime', function () { + insertDateTime(editor, getTimeFormat(editor)); + }); + }; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; + }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var register$1 = function (editor) { + var formats = getFormats(editor); + var defaultFormat = Cell(getDefaultDateTime(editor)); + editor.ui.registry.addSplitButton('insertdatetime', { + icon: 'insert-time', + tooltip: 'Insert date/time', + select: function (value) { + return value === defaultFormat.get(); + }, + fetch: function (done) { + done(global$1.map(formats, function (format) { + return { + type: 'choiceitem', + text: getDateTime(editor, format), + value: format + }; + })); + }, + onAction: function (_api) { + insertDateTime(editor, defaultFormat.get()); + }, + onItemAction: function (_api, value) { + defaultFormat.set(value); + insertDateTime(editor, value); + } + }); + var makeMenuItemHandler = function (format) { + return function () { + defaultFormat.set(format); + insertDateTime(editor, format); + }; + }; + editor.ui.registry.addNestedMenuItem('insertdatetime', { + icon: 'insert-time', + text: 'Date/time', + getSubmenuItems: function () { + return global$1.map(formats, function (format) { + return { + type: 'menuitem', + text: getDateTime(editor, format), + onAction: makeMenuItemHandler(format) + }; + }); + } + }); + }; + + function Plugin () { + global.add('insertdatetime', function (editor) { + register(editor); + register$1(editor); + }); + } + + Plugin(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/insertdatetime/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/insertdatetime/plugin.min.js index 6b170087a90f..f70aadc35d97 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/insertdatetime/plugin.min.js +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/insertdatetime/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("insertdatetime",function(e){function t(t,a){function n(e,t){if(e=""+e,e.length'+n+"";var i=e.dom.getParent(e.selection.getStart(),"time");if(i)return void e.dom.setOuterHTML(i,n)}e.insertContent(n)}var n,r,i="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),d="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),c="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),m="January February March April May June July August September October November December".split(" "),u=[];e.addCommand("mceInsertDate",function(){a(e.getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d")))}),e.addCommand("mceInsertTime",function(){a(e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S")))}),e.addButton("insertdatetime",{type:"splitbutton",title:"Insert date/time",onclick:function(){a(n||r)},menu:u}),tinymce.each(e.settings.insertdatetime_formats||["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"],function(e){r||(r=e),u.push({text:t(e),onclick:function(){n=e,a(e)}})}),e.addMenuItem("insertdatetime",{icon:"date",text:"Insert date/time",menu:u,context:"insert"})}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))},c=function(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])},r="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),a="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),i="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),o="January February March April May June July August September October November December".split(" "),m=function(e,t){if((e=""+e).length'+n+"")):e.insertContent(s(e,t))},t=function(t){t.addCommand("mceInsertDate",function(){var e;l(t,(e=t).getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d")))}),t.addCommand("mceInsertTime",function(){l(t,u(t))})},d=tinymce.util.Tools.resolve("tinymce.util.Tools"),n=function(n){var e,t,r,a,i=c(n),o=(a=c(r=n),e=0 -1; + }; + var map = function (xs, f) { + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; + }; + var each = function (xs, f) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } + }; + var foldl = function (xs, f, acc) { + each(xs, function (x) { + acc = f(acc, x); + }); + return acc; + }; + var flatten = function (xs) { + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); + } + nativePush.apply(r, xs[i]); + } + return r; + }; + var bind = function (xs, f) { + return flatten(map(xs, f)); + }; + var findMap = function (arr, f) { + for (var i = 0; i < arr.length; i++) { + var r = f(arr[i], i); + if (r.isSome()) { + return r; + } + } + return Optional.none(); + }; + + var cat = function (arr) { + var r = []; + var push = function (x) { + r.push(x); + }; + for (var i = 0; i < arr.length; i++) { + arr[i].each(push); + } + return r; + }; + var someIf = function (b, a) { + return b ? Optional.some(a) : Optional.none(); + }; + + var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var getValue = function (item) { + return isString(item.value) ? item.value : ''; + }; + var sanitizeList = function (list, extractValue) { + var out = []; + global$2.each(list, function (item) { + var text = isString(item.text) ? item.text : isString(item.title) ? item.title : ''; + if (item.menu !== undefined) { + var items = sanitizeList(item.menu, extractValue); + out.push({ + text: text, + items: items + }); + } else { + var value = extractValue(item); + out.push({ + text: text, + value: value + }); + } + }); + return out; + }; + var sanitizeWith = function (extracter) { + if (extracter === void 0) { + extracter = getValue; + } + return function (list) { + return Optional.from(list).map(function (list) { + return sanitizeList(list, extracter); + }); + }; + }; + var sanitize = function (list) { + return sanitizeWith(getValue)(list); + }; + var createUi = function (name, label) { + return function (items) { + return { + name: name, + type: 'listbox', + label: label, + items: items + }; + }; + }; + var ListOptions = { + sanitize: sanitize, + sanitizeWith: sanitizeWith, + createUi: createUi, + getValue: getValue + }; + + var __assign = function () { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + + var keys = Object.keys; + var hasOwnProperty = Object.hasOwnProperty; + var each$1 = function (obj, f) { + var props = keys(obj); + for (var k = 0, len = props.length; k < len; k++) { + var i = props[k]; + var x = obj[i]; + f(x, i); + } + }; + var objAcc = function (r) { + return function (x, i) { + r[i] = x; + }; + }; + var internalFilter = function (obj, pred, onTrue, onFalse) { + var r = {}; + each$1(obj, function (x, i) { + (pred(x, i) ? onTrue : onFalse)(x, i); + }); + return r; + }; + var filter = function (obj, pred) { + var t = {}; + internalFilter(obj, pred, objAcc(t), noop); + return t; + }; + var has = function (obj, key) { + return hasOwnProperty.call(obj, key); + }; + var hasNonNullableKey = function (obj, key) { + return has(obj, key) && obj[key] !== undefined && obj[key] !== null; + }; + + var global$3 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker'); + + var isAnchor = function (elm) { + return elm && elm.nodeName.toLowerCase() === 'a'; + }; + var isLink = function (elm) { + return isAnchor(elm) && !!getHref(elm); + }; + var collectNodesInRange = function (rng, predicate) { + if (rng.collapsed) { + return []; + } else { + var contents = rng.cloneContents(); + var walker = new global$3(contents.firstChild, contents); + var elements = []; + var current = contents.firstChild; + do { + if (predicate(current)) { + elements.push(current); + } + } while (current = walker.next()); + return elements; + } + }; + var hasProtocol = function (url) { + return /^\w+:/i.test(url); + }; + var getHref = function (elm) { + var href = elm.getAttribute('data-mce-href'); + return href ? href : elm.getAttribute('href'); + }; + var applyRelTargetRules = function (rel, isUnsafe) { + var rules = ['noopener']; + var rels = rel ? rel.split(/\s+/) : []; + var toString = function (rels) { + return global$2.trim(rels.sort().join(' ')); + }; + var addTargetRules = function (rels) { + rels = removeTargetRules(rels); + return rels.length > 0 ? rels.concat(rules) : rules; + }; + var removeTargetRules = function (rels) { + return rels.filter(function (val) { + return global$2.inArray(rules, val) === -1; + }); + }; + var newRels = isUnsafe ? addTargetRules(rels) : removeTargetRules(rels); + return newRels.length > 0 ? toString(newRels) : ''; + }; + var trimCaretContainers = function (text) { + return text.replace(/\uFEFF/g, ''); + }; + var getAnchorElement = function (editor, selectedElm) { + selectedElm = selectedElm || editor.selection.getNode(); + if (isImageFigure(selectedElm)) { + return editor.dom.select('a[href]', selectedElm)[0]; + } else { + return editor.dom.getParent(selectedElm, 'a[href]'); + } + }; + var getAnchorText = function (selection, anchorElm) { + var text = anchorElm ? anchorElm.innerText || anchorElm.textContent : selection.getContent({ format: 'text' }); + return trimCaretContainers(text); + }; + var hasLinks = function (elements) { + return global$2.grep(elements, isLink).length > 0; + }; + var hasLinksInSelection = function (rng) { + return collectNodesInRange(rng, isLink).length > 0; + }; + var isOnlyTextSelected = function (editor) { + var inlineTextElements = editor.schema.getTextInlineElements(); + var isElement = function (elm) { + return elm.nodeType === 1 && !isAnchor(elm) && !has(inlineTextElements, elm.nodeName.toLowerCase()); + }; + var elements = collectNodesInRange(editor.selection.getRng(), isElement); + return elements.length === 0; + }; + var isImageFigure = function (elm) { + return elm && elm.nodeName === 'FIGURE' && /\bimage\b/i.test(elm.className); + }; + var getLinkAttrs = function (data) { + return foldl([ + 'title', + 'rel', + 'class', + 'target' + ], function (acc, key) { + data[key].each(function (value) { + acc[key] = value.length > 0 ? value : null; + }); + return acc; + }, { href: data.href }); + }; + var handleExternalTargets = function (href, assumeExternalTargets) { + if ((assumeExternalTargets === 'http' || assumeExternalTargets === 'https') && !hasProtocol(href)) { + return assumeExternalTargets + '://' + href; + } + return href; + }; + var applyLinkOverrides = function (editor, linkAttrs) { + var newLinkAttrs = __assign({}, linkAttrs); + if (!(getRelList(editor).length > 0) && allowUnsafeLinkTarget(editor) === false) { + var newRel = applyRelTargetRules(newLinkAttrs.rel, newLinkAttrs.target === '_blank'); + newLinkAttrs.rel = newRel ? newRel : null; + } + if (Optional.from(newLinkAttrs.target).isNone() && getTargetList(editor) === false) { + newLinkAttrs.target = getDefaultLinkTarget(editor); + } + newLinkAttrs.href = handleExternalTargets(newLinkAttrs.href, assumeExternalTargets(editor)); + return newLinkAttrs; + }; + var updateLink = function (editor, anchorElm, text, linkAttrs) { + text.each(function (text) { + if (anchorElm.hasOwnProperty('innerText')) { + anchorElm.innerText = text; + } else { + anchorElm.textContent = text; + } + }); + editor.dom.setAttribs(anchorElm, linkAttrs); + editor.selection.select(anchorElm); + }; + var createLink = function (editor, selectedElm, text, linkAttrs) { + if (isImageFigure(selectedElm)) { + linkImageFigure(editor, selectedElm, linkAttrs); + } else { + text.fold(function () { + editor.execCommand('mceInsertLink', false, linkAttrs); + }, function (text) { + editor.insertContent(editor.dom.createHTML('a', linkAttrs, editor.dom.encode(text))); + }); + } + }; + var linkDomMutation = function (editor, attachState, data) { + var selectedElm = editor.selection.getNode(); + var anchorElm = getAnchorElement(editor, selectedElm); + var linkAttrs = applyLinkOverrides(editor, getLinkAttrs(data)); + editor.undoManager.transact(function () { + if (data.href === attachState.href) { + attachState.attach(); + } + if (anchorElm) { + editor.focus(); + updateLink(editor, anchorElm, data.text, linkAttrs); + } else { + createLink(editor, selectedElm, data.text, linkAttrs); + } + }); + }; + var unlinkSelection = function (editor) { + var dom = editor.dom, selection = editor.selection; + var bookmark = selection.getBookmark(); + var rng = selection.getRng().cloneRange(); + var startAnchorElm = dom.getParent(rng.startContainer, 'a[href]', editor.getBody()); + var endAnchorElm = dom.getParent(rng.endContainer, 'a[href]', editor.getBody()); + if (startAnchorElm) { + rng.setStartBefore(startAnchorElm); + } + if (endAnchorElm) { + rng.setEndAfter(endAnchorElm); + } + selection.setRng(rng); + editor.execCommand('unlink'); + selection.moveToBookmark(bookmark); + }; + var unlinkDomMutation = function (editor) { + editor.undoManager.transact(function () { + var node = editor.selection.getNode(); + if (isImageFigure(node)) { + unlinkImageFigure(editor, node); + } else { + unlinkSelection(editor); + } + editor.focus(); + }); + }; + var unwrapOptions = function (data) { + var cls = data.class, href = data.href, rel = data.rel, target = data.target, text = data.text, title = data.title; + return filter({ + class: cls.getOrNull(), + href: href, + rel: rel.getOrNull(), + target: target.getOrNull(), + text: text.getOrNull(), + title: title.getOrNull() + }, function (v, _k) { + return isNull(v) === false; + }); + }; + var link = function (editor, attachState, data) { + editor.hasPlugin('rtc', true) ? editor.execCommand('createlink', false, unwrapOptions(data)) : linkDomMutation(editor, attachState, data); + }; + var unlink = function (editor) { + editor.hasPlugin('rtc', true) ? editor.execCommand('unlink') : unlinkDomMutation(editor); + }; + var unlinkImageFigure = function (editor, fig) { + var img = editor.dom.select('img', fig)[0]; + if (img) { + var a = editor.dom.getParents(img, 'a[href]', fig)[0]; + if (a) { + a.parentNode.insertBefore(img, a); + editor.dom.remove(a); + } + } + }; + var linkImageFigure = function (editor, fig, attrs) { + var img = editor.dom.select('img', fig)[0]; + if (img) { + var a = editor.dom.create('a', attrs); + img.parentNode.insertBefore(a, img); + a.appendChild(img); + } + }; + + var isListGroup = function (item) { + return hasNonNullableKey(item, 'items'); + }; + var findTextByValue = function (value, catalog) { + return findMap(catalog, function (item) { + if (isListGroup(item)) { + return findTextByValue(value, item.items); + } else { + return someIf(item.value === value, item); + } + }); + }; + var getDelta = function (persistentText, fieldName, catalog, data) { + var value = data[fieldName]; + var hasPersistentText = persistentText.length > 0; + return value !== undefined ? findTextByValue(value, catalog).map(function (i) { + return { + url: { + value: i.value, + meta: { + text: hasPersistentText ? persistentText : i.text, + attach: noop + } + }, + text: hasPersistentText ? persistentText : i.text + }; + }) : Optional.none(); + }; + var findCatalog = function (catalogs, fieldName) { + if (fieldName === 'link') { + return catalogs.link; + } else if (fieldName === 'anchor') { + return catalogs.anchor; + } else { + return Optional.none(); + } + }; + var init = function (initialData, linkCatalog) { + var persistentData = { + text: initialData.text, + title: initialData.title + }; + var getTitleFromUrlChange = function (url) { + return someIf(persistentData.title.length <= 0, Optional.from(url.meta.title).getOr('')); + }; + var getTextFromUrlChange = function (url) { + return someIf(persistentData.text.length <= 0, Optional.from(url.meta.text).getOr(url.value)); + }; + var onUrlChange = function (data) { + var text = getTextFromUrlChange(data.url); + var title = getTitleFromUrlChange(data.url); + if (text.isSome() || title.isSome()) { + return Optional.some(__assign(__assign({}, text.map(function (text) { + return { text: text }; + }).getOr({})), title.map(function (title) { + return { title: title }; + }).getOr({}))); + } else { + return Optional.none(); + } + }; + var onCatalogChange = function (data, change) { + var catalog = findCatalog(linkCatalog, change.name).getOr([]); + return getDelta(persistentData.text, change.name, catalog, data); + }; + var onChange = function (getData, change) { + var name = change.name; + if (name === 'url') { + return onUrlChange(getData()); + } else if (contains([ + 'anchor', + 'link' + ], name)) { + return onCatalogChange(getData(), change); + } else if (name === 'text' || name === 'title') { + persistentData[name] = getData()[name]; + return Optional.none(); + } else { + return Optional.none(); + } + }; + return { onChange: onChange }; + }; + var DialogChanges = { + init: init, + getDelta: getDelta + }; + + var global$4 = tinymce.util.Tools.resolve('tinymce.util.Delay'); + + var global$5 = tinymce.util.Tools.resolve('tinymce.util.Promise'); + + var delayedConfirm = function (editor, message, callback) { + var rng = editor.selection.getRng(); + global$4.setEditorTimeout(editor, function () { + editor.windowManager.confirm(message, function (state) { + editor.selection.setRng(rng); + callback(state); + }); + }); + }; + var tryEmailTransform = function (data) { + var url = data.href; + var suggestMailTo = url.indexOf('@') > 0 && url.indexOf('/') === -1 && url.indexOf('mailto:') === -1; + return suggestMailTo ? Optional.some({ + message: 'The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?', + preprocess: function (oldData) { + return __assign(__assign({}, oldData), { href: 'mailto:' + url }); + } + }) : Optional.none(); + }; + var tryProtocolTransform = function (assumeExternalTargets, defaultLinkProtocol) { + return function (data) { + var url = data.href; + var suggestProtocol = assumeExternalTargets === 1 && !hasProtocol(url) || assumeExternalTargets === 0 && /^\s*www(\.|\d\.)/i.test(url); + return suggestProtocol ? Optional.some({ + message: 'The URL you entered seems to be an external link. Do you want to add the required ' + defaultLinkProtocol + ':// prefix?', + preprocess: function (oldData) { + return __assign(__assign({}, oldData), { href: defaultLinkProtocol + '://' + url }); + } + }) : Optional.none(); + }; + }; + var preprocess = function (editor, data) { + return findMap([ + tryEmailTransform, + tryProtocolTransform(assumeExternalTargets(editor), getDefaultLinkProtocol(editor)) + ], function (f) { + return f(data); + }).fold(function () { + return global$5.resolve(data); + }, function (transform) { + return new global$5(function (callback) { + delayedConfirm(editor, transform.message, function (state) { + callback(state ? transform.preprocess(data) : data); + }); + }); + }); + }; + var DialogConfirms = { preprocess: preprocess }; + + var getAnchors = function (editor) { + var anchorNodes = editor.dom.select('a:not([href])'); + var anchors = bind(anchorNodes, function (anchor) { + var id = anchor.name || anchor.id; + return id ? [{ + text: id, + value: '#' + id + }] : []; + }); + return anchors.length > 0 ? Optional.some([{ + text: 'None', + value: '' + }].concat(anchors)) : Optional.none(); + }; + var AnchorListOptions = { getAnchors: getAnchors }; + + var getClasses = function (editor) { + var list = getLinkClassList(editor); + if (list.length > 0) { + return ListOptions.sanitize(list); + } + return Optional.none(); + }; + var ClassListOptions = { getClasses: getClasses }; + + var global$6 = tinymce.util.Tools.resolve('tinymce.util.XHR'); + + var parseJson = function (text) { + try { + return Optional.some(JSON.parse(text)); + } catch (err) { + return Optional.none(); + } + }; + var getLinks = function (editor) { + var extractor = function (item) { + return editor.convertURL(item.value || item.url, 'href'); + }; + var linkList = getLinkList(editor); + return new global$5(function (callback) { + if (isString(linkList)) { + global$6.send({ + url: linkList, + success: function (text) { + return callback(parseJson(text)); + }, + error: function (_) { + return callback(Optional.none()); + } + }); + } else if (isFunction(linkList)) { + linkList(function (output) { + return callback(Optional.some(output)); + }); + } else { + callback(Optional.from(linkList)); + } + }).then(function (optItems) { + return optItems.bind(ListOptions.sanitizeWith(extractor)).map(function (items) { + if (items.length > 0) { + var noneItem = [{ + text: 'None', + value: '' + }]; + return noneItem.concat(items); + } else { + return items; + } + }); + }); + }; + var LinkListOptions = { getLinks: getLinks }; + + var getRels = function (editor, initialTarget) { + var list = getRelList(editor); + if (list.length > 0) { + var isTargetBlank_1 = initialTarget.is('_blank'); + var enforceSafe = allowUnsafeLinkTarget(editor) === false; + var safeRelExtractor = function (item) { + return applyRelTargetRules(ListOptions.getValue(item), isTargetBlank_1); + }; + var sanitizer = enforceSafe ? ListOptions.sanitizeWith(safeRelExtractor) : ListOptions.sanitize; + return sanitizer(list); + } + return Optional.none(); + }; + var RelOptions = { getRels: getRels }; + + var fallbacks = [ + { + text: 'Current window', + value: '' + }, + { + text: 'New window', + value: '_blank' + } + ]; + var getTargets = function (editor) { + var list = getTargetList(editor); + if (isArray(list)) { + return ListOptions.sanitize(list).orThunk(function () { + return Optional.some(fallbacks); + }); + } else if (list === false) { + return Optional.none(); + } + return Optional.some(fallbacks); + }; + var TargetOptions = { getTargets: getTargets }; + + var nonEmptyAttr = function (dom, elem, name) { + var val = dom.getAttrib(elem, name); + return val !== null && val.length > 0 ? Optional.some(val) : Optional.none(); + }; + var extractFromAnchor = function (editor, anchor) { + var dom = editor.dom; + var onlyText = isOnlyTextSelected(editor); + var text = onlyText ? Optional.some(getAnchorText(editor.selection, anchor)) : Optional.none(); + var url = anchor ? Optional.some(dom.getAttrib(anchor, 'href')) : Optional.none(); + var target = anchor ? Optional.from(dom.getAttrib(anchor, 'target')) : Optional.none(); + var rel = nonEmptyAttr(dom, anchor, 'rel'); + var linkClass = nonEmptyAttr(dom, anchor, 'class'); + var title = nonEmptyAttr(dom, anchor, 'title'); + return { + url: url, + text: text, + title: title, + target: target, + rel: rel, + linkClass: linkClass + }; + }; + var collect = function (editor, linkNode) { + return LinkListOptions.getLinks(editor).then(function (links) { + var anchor = extractFromAnchor(editor, linkNode); + return { + anchor: anchor, + catalogs: { + targets: TargetOptions.getTargets(editor), + rels: RelOptions.getRels(editor, anchor.target), + classes: ClassListOptions.getClasses(editor), + anchor: AnchorListOptions.getAnchors(editor), + link: links + }, + optNode: Optional.from(linkNode), + flags: { titleEnabled: shouldShowLinkTitle(editor) } + }; + }); + }; + var DialogInfo = { collect: collect }; - function n(t) { - function n(e) { - var t = f.find("#text"); - (!t.value() || e.lastControl && t.value() == e.lastControl.text()) && t.value(e.control.text()), f.find("#href").value(e.control.value()) - } - - function l() { - var n = [{ - text: "None", - value: "" - }]; - return tinymce.each(t, function(t) { - n.push({ - text: t.text || t.title, - value: e.convertURL(t.value || t.url, "href"), - menu: t.menu - }) - }), n - } - - function i(t) { - var n = [{ - text: "None", - value: "" - }]; - return tinymce.each(e.settings.rel_list, function(e) { - n.push({ - text: e.text || e.title, - value: e.value, - selected: t === e.value - }) - }), n - } - - function r(t) { - var n = []; - return e.settings.target_list || (n.push({ - text: "None", - value: "" - }), n.push({ - text: "New window", - value: "_blank" - })), tinymce.each(e.settings.target_list, function(e) { - n.push({ - text: e.text || e.title, - value: e.value, - selected: t === e.value - }) - }), n - } - - function a(t) { - var l = []; - return tinymce.each(e.dom.select("a:not([href])"), function(e) { - var n = e.name || e.id; - n && l.push({ - text: n, - value: "#" + n, - selected: -1 != t.indexOf("#" + n) - }) - }), l.length ? (l.unshift({ - text: "None", - value: "" - }), { - name: "anchor", - type: "listbox", - label: "Anchors", - values: l, - onselect: n - }) : void 0 - } - - function o() { - h && h.value(e.convertURL(this.value(), "href")), !c && 0 === x.text.length && k && this.parent().parent().find("#text")[0].value(this.value()) - } - var u, s, c, f, d, h, v, g, x = {}, - m = e.selection, - p = e.dom; - u = m.getNode(), s = p.getParent(u, "a[href]"); - var k = !0; - if (/= 0; y--) - if (3 != b[y].nodeType) { - k = !1; - break - } - } - x.text = c = s ? s.innerText || s.textContent : m.getContent({ - format: "text" - }), x.href = s ? p.getAttrib(s, "href") : "", x.target = s ? p.getAttrib(s, "target") : e.settings.default_link_target || "", x.rel = s ? p.getAttrib(s, "rel") : "", e.fire('EditLink', x), k && (d = { - name: "text", - type: "textbox", - size: 40, - label: "Text to display", - onchange: function() { - x.text = this.value() + var handleSubmit = function (editor, info) { + return function (api) { + var data = api.getData(); + if (!data.url.value) { + unlink(editor); + api.close(); + return; + } + var getChangedValue = function (key) { + return Optional.from(data[key]).filter(function (value) { + return !info.anchor[key].is(value); + }); + }; + var changedData = { + href: data.url.value, + text: getChangedValue('text'), + target: getChangedValue('target'), + rel: getChangedValue('rel'), + class: getChangedValue('linkClass'), + title: getChangedValue('title') + }; + var attachState = { + href: data.url.value, + attach: data.url.meta !== undefined && data.url.meta.attach ? data.url.meta.attach : function () { + } + }; + DialogConfirms.preprocess(editor, changedData).then(function (pData) { + link(editor, attachState, pData); + }); + api.close(); + }; + }; + var collectData = function (editor) { + var anchorNode = getAnchorElement(editor); + return DialogInfo.collect(editor, anchorNode); + }; + var getInitialData = function (info, defaultTarget) { + var anchor = info.anchor; + var url = anchor.url.getOr(''); + return { + url: { + value: url, + meta: { original: { value: url } } + }, + text: anchor.text.getOr(''), + title: anchor.title.getOr(''), + anchor: url, + link: url, + rel: anchor.rel.getOr(''), + target: anchor.target.or(defaultTarget).getOr(''), + linkClass: anchor.linkClass.getOr('') + }; + }; + var makeDialog = function (settings, onSubmit, editor) { + var urlInput = [{ + name: 'url', + type: 'urlinput', + filetype: 'file', + label: 'URL' + }]; + var displayText = settings.anchor.text.map(function () { + return { + name: 'text', + type: 'input', + label: 'Text to display' + }; + }).toArray(); + var titleText = settings.flags.titleEnabled ? [{ + name: 'title', + type: 'input', + label: 'Title' + }] : []; + var defaultTarget = Optional.from(getDefaultLinkTarget(editor)); + var initialData = getInitialData(settings, defaultTarget); + var catalogs = settings.catalogs; + var dialogDelta = DialogChanges.init(initialData, catalogs); + var body = { + type: 'panel', + items: flatten([ + urlInput, + displayText, + titleText, + cat([ + catalogs.anchor.map(ListOptions.createUi('anchor', 'Anchors')), + catalogs.rels.map(ListOptions.createUi('rel', 'Rel')), + catalogs.targets.map(ListOptions.createUi('target', 'Open link in...')), + catalogs.link.map(ListOptions.createUi('link', 'Link list')), + catalogs.classes.map(ListOptions.createUi('linkClass', 'Class')) + ]) + ]) + }; + return { + title: 'Insert/Edit Link', + size: 'normal', + body: body, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + initialData: initialData, + onChange: function (api, _a) { + var name = _a.name; + dialogDelta.onChange(api.getData, { name: name }).each(function (newData) { + api.setData(newData); + }); + }, + onSubmit: onSubmit + }; + }; + var open = function (editor) { + var data = collectData(editor); + data.then(function (info) { + var onSubmit = handleSubmit(editor, info); + return makeDialog(info, onSubmit, editor); + }).then(function (spec) { + editor.windowManager.open(spec); + }); + }; + + var appendClickRemove = function (link, evt) { + document.body.appendChild(link); + link.dispatchEvent(evt); + document.body.removeChild(link); + }; + var open$1 = function (url) { + var link = document.createElement('a'); + link.target = '_blank'; + link.href = url; + link.rel = 'noreferrer noopener'; + var evt = document.createEvent('MouseEvents'); + evt.initMouseEvent('click', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); + appendClickRemove(link, evt); + }; + + var getLink = function (editor, elm) { + return editor.dom.getParent(elm, 'a[href]'); + }; + var getSelectedLink = function (editor) { + return getLink(editor, editor.selection.getStart()); + }; + var hasOnlyAltModifier = function (e) { + return e.altKey === true && e.shiftKey === false && e.ctrlKey === false && e.metaKey === false; + }; + var gotoLink = function (editor, a) { + if (a) { + var href = getHref(a); + if (/^#/.test(href)) { + var targetEl = editor.$(href); + if (targetEl.length) { + editor.selection.scrollIntoView(targetEl[0], true); + } + } else { + open$1(a.href); + } + } + }; + var openDialog = function (editor) { + return function () { + open(editor); + }; + }; + var gotoSelectedLink = function (editor) { + return function () { + gotoLink(editor, getSelectedLink(editor)); + }; + }; + var setupGotoLinks = function (editor) { + editor.on('click', function (e) { + var link = getLink(editor, e.target); + if (link && global$1.metaKeyPressed(e)) { + e.preventDefault(); + gotoLink(editor, link); + } + }); + editor.on('keydown', function (e) { + var link = getSelectedLink(editor); + if (link && e.keyCode === 13 && hasOnlyAltModifier(e)) { + e.preventDefault(); + gotoLink(editor, link); + } + }); + }; + var toggleState = function (editor, toggler) { + editor.on('NodeChange', toggler); + return function () { + return editor.off('NodeChange', toggler); + }; + }; + var toggleActiveState = function (editor) { + return function (api) { + return toggleState(editor, function () { + api.setActive(!editor.mode.isReadOnly() && getAnchorElement(editor, editor.selection.getNode()) !== null); + }); + }; + }; + var toggleEnabledState = function (editor) { + return function (api) { + var updateState = function () { + return api.setDisabled(getAnchorElement(editor, editor.selection.getNode()) === null); + }; + updateState(); + return toggleState(editor, updateState); + }; + }; + var toggleUnlinkState = function (editor) { + return function (api) { + var hasLinks$1 = function (parents) { + return hasLinks(parents) || hasLinksInSelection(editor.selection.getRng()); + }; + var parents = editor.dom.getParents(editor.selection.getStart()); + api.setDisabled(!hasLinks$1(parents)); + return toggleState(editor, function (e) { + return api.setDisabled(!hasLinks$1(e.parents)); + }); + }; + }; + + var register = function (editor) { + editor.addCommand('mceLink', function () { + if (useQuickLink(editor)) { + editor.fire('contexttoolbar-show', { toolbarKey: 'quicklink' }); + } else { + openDialog(editor)(); + } + }); + }; + + var setup = function (editor) { + editor.addShortcut('Meta+K', '', function () { + editor.execCommand('mceLink'); + }); + }; + + var setupButtons = function (editor) { + editor.ui.registry.addToggleButton('link', { + icon: 'link', + tooltip: 'Insert/edit link', + onAction: openDialog(editor), + onSetup: toggleActiveState(editor) + }); + editor.ui.registry.addButton('openlink', { + icon: 'new-tab', + tooltip: 'Open link', + onAction: gotoSelectedLink(editor), + onSetup: toggleEnabledState(editor) + }); + editor.ui.registry.addButton('unlink', { + icon: 'unlink', + tooltip: 'Remove link', + onAction: function () { + return unlink(editor); + }, + onSetup: toggleUnlinkState(editor) + }); + }; + var setupMenuItems = function (editor) { + editor.ui.registry.addMenuItem('openlink', { + text: 'Open link', + icon: 'new-tab', + onAction: gotoSelectedLink(editor), + onSetup: toggleEnabledState(editor) + }); + editor.ui.registry.addMenuItem('link', { + icon: 'link', + text: 'Link...', + shortcut: 'Meta+K', + onAction: openDialog(editor) + }); + editor.ui.registry.addMenuItem('unlink', { + icon: 'unlink', + text: 'Remove link', + onAction: function () { + return unlink(editor); + }, + onSetup: toggleUnlinkState(editor) + }); + }; + var setupContextMenu = function (editor) { + var inLink = 'link unlink openlink'; + var noLink = 'link'; + editor.ui.registry.addContextMenu('link', { + update: function (element) { + return hasLinks(editor.dom.getParents(element, 'a')) ? inLink : noLink; + } + }); + }; + var setupContextToolbars = function (editor) { + var collapseSelectionToEnd = function (editor) { + editor.selection.collapse(false); + }; + var onSetupLink = function (buttonApi) { + var node = editor.selection.getNode(); + buttonApi.setDisabled(!getAnchorElement(editor, node)); + return function () { + }; + }; + editor.ui.registry.addContextForm('quicklink', { + launch: { + type: 'contextformtogglebutton', + icon: 'link', + tooltip: 'Link', + onSetup: toggleActiveState(editor) + }, + label: 'Link', + predicate: function (node) { + return !!getAnchorElement(editor, node) && hasContextToolbar(editor); + }, + initValue: function () { + var elm = getAnchorElement(editor); + return !!elm ? getHref(elm) : ''; + }, + commands: [ + { + type: 'contextformtogglebutton', + icon: 'link', + tooltip: 'Link', + primary: true, + onSetup: function (buttonApi) { + var node = editor.selection.getNode(); + buttonApi.setActive(!!getAnchorElement(editor, node)); + return toggleActiveState(editor)(buttonApi); + }, + onAction: function (formApi) { + var anchor = getAnchorElement(editor); + var value = formApi.getValue(); + if (!anchor) { + var attachState = { + href: value, + attach: function () { + } + }; + var onlyText = isOnlyTextSelected(editor); + var text = onlyText ? Optional.some(getAnchorText(editor.selection, anchor)).filter(function (t) { + return t.length > 0; + }).or(Optional.from(value)) : Optional.none(); + link(editor, attachState, { + href: value, + text: text, + title: Optional.none(), + rel: Optional.none(), + target: Optional.none(), + class: Optional.none() + }); + formApi.hide(); + } else { + editor.undoManager.transact(function () { + editor.dom.setAttrib(anchor, 'href', value); + collapseSelectionToEnd(editor); + formApi.hide(); + }); + } } - }), t && (h = { - type: "listbox", - label: "Link list", - values: l(), - onselect: n, - value: e.convertURL(x.href, "href"), - onPostRender: function() { - h = this + }, + { + type: 'contextformbutton', + icon: 'unlink', + tooltip: 'Remove link', + onSetup: onSetupLink, + onAction: function (formApi) { + unlink(editor); + formApi.hide(); } - }), e.settings.target_list !== !1 && (g = { - name: "target", - type: "listbox", - label: "Target", - values: r(x.target) - }), e.settings.rel_list && (v = { - name: "rel", - type: "listbox", - label: "Rel", - values: i(x.rel) - }), f = e.windowManager.open({ - title: "Insert link", - data: x, - body: [{ - name: "href", - type: "filepicker", - filetype: "file", - size: 40, - autofocus: !0, - label: "Url", - onchange: o, - onkeyup: o - }, - d, a(x.href), h, v, g - ], - onSubmit: function(t) { - function n(t, n) { - var l = e.selection.getRng(); - window.setTimeout(function() { - e.windowManager.confirm(t, function(t) { - e.selection.setRng(l), n(t) - }) - }, 0) - } - - function l() { - s ? (e.focus(), k && i.text != c && (s.innerText = i.text), p.setAttribs(s, { - href: r, - target: i.target ? i.target : null, - rel: i.rel ? i.rel : null - }), m.select(s), e.undoManager.add()) : k ? e.insertContent(p.createHTML("a", { - href: r, - target: i.target ? i.target : null, - rel: i.rel ? i.rel : null - }, p.encode(i.text))) : e.execCommand("mceInsertLink", !1, { - href: r, - target: i.target, - rel: i.rel ? i.rel : null - }) - } - var i = t.data; - e.fire('SaveLink', i); - var r = i.href; - /* EDX - Change the email address detection, which mistakenly detected Split asset keys as email addresses. - Instead, if the link has a "@" sign *and* a colon, do not consider it an email address. */ - return r ? r.indexOf("@") > 0 && -1 == r.indexOf("//") && -1 == r.indexOf(":") ? void n("The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?", function(e) { - e && (r = "mailto:" + r), l() - }) : /^\s*www\./i.test(r) ? void n("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?", function(e) { - e && (r = "http://" + r), l() - }) : void l() : void e.execCommand("unlink") + }, + { + type: 'contextformbutton', + icon: 'new-tab', + tooltip: 'Open link', + onSetup: onSetupLink, + onAction: function (formApi) { + gotoSelectedLink(editor)(); + formApi.hide(); } - }) + } + ] + }); + }; + + function Plugin () { + global.add('link', function (editor) { + setupButtons(editor); + setupMenuItems(editor); + setupContextMenu(editor); + setupContextToolbars(editor); + setupGotoLinks(editor); + register(editor); + setup(editor); + }); } - e.addButton("link", { - icon: "link", - tooltip: "Insert/edit link", - shortcut: "Ctrl+K", - onclick: t(n), - stateSelector: "a[href]" - }), e.addButton("unlink", { - icon: "unlink", - tooltip: "Remove link", - cmd: "unlink", - stateSelector: "a[href]" - }), e.addShortcut("Ctrl+K", "", t(n)), this.showDialog = n, e.addMenuItem("link", { - icon: "link", - text: "Insert link", - shortcut: "Ctrl+K", - onclick: t(n), - stateSelector: "a[href]", - context: "insert", - prependToContext: !0 - }) -}); + + Plugin(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/link/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/link/plugin.min.js index 413eac55ae43..9bca7021675c 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/link/plugin.min.js +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/link/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("link",function(e){function t(t){return function(){var n=e.settings.link_list;"string"==typeof n?tinymce.util.XHR.send({url:n,success:function(e){t(tinymce.util.JSON.parse(e))}}):t(n)}}function n(t){function n(e){var t=f.find("#text");(!t.value()||e.lastControl&&t.value()==e.lastControl.text())&&t.value(e.control.text()),f.find("#href").value(e.control.value())}function l(){var n=[{text:"None",value:""}];return tinymce.each(t,function(t){n.push({text:t.text||t.title,value:e.convertURL(t.value||t.url,"href"),menu:t.menu})}),n}function i(t){var n=[{text:"None",value:""}];return tinymce.each(e.settings.rel_list,function(e){n.push({text:e.text||e.title,value:e.value,selected:t===e.value})}),n}function r(t){var n=[];return e.settings.target_list||(n.push({text:"None",value:""}),n.push({text:"New window",value:"_blank"})),tinymce.each(e.settings.target_list,function(e){n.push({text:e.text||e.title,value:e.value,selected:t===e.value})}),n}function a(t){var l=[];return tinymce.each(e.dom.select("a:not([href])"),function(e){var n=e.name||e.id;n&&l.push({text:n,value:"#"+n,selected:-1!=t.indexOf("#"+n)})}),l.length?(l.unshift({text:"None",value:""}),{name:"anchor",type:"listbox",label:"Anchors",values:l,onselect:n}):void 0}function o(){h&&h.value(e.convertURL(this.value(),"href")),!c&&0===x.text.length&&k&&this.parent().parent().find("#text")[0].value(this.value())}var u,s,c,f,d,h,v,g,x={},m=e.selection,p=e.dom;u=m.getNode(),s=p.getParent(u,"a[href]");var k=!0;if(/=0;y--)if(3!=b[y].nodeType){k=!1;break}}x.text=c=s?s.innerText||s.textContent:m.getContent({format:"text"}),x.href=s?p.getAttrib(s,"href"):"",x.target=s?p.getAttrib(s,"target"):e.settings.default_link_target||"",x.rel=s?p.getAttrib(s,"rel"):"",e.fire("EditLink",x),k&&(d={name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){x.text=this.value()}}),t&&(h={type:"listbox",label:"Link list",values:l(),onselect:n,value:e.convertURL(x.href,"href"),onPostRender:function(){h=this}}),e.settings.target_list!==!1&&(g={name:"target",type:"listbox",label:"Target",values:r(x.target)}),e.settings.rel_list&&(v={name:"rel",type:"listbox",label:"Rel",values:i(x.rel)}),f=e.windowManager.open({title:"Insert link",data:x,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:o,onkeyup:o},d,a(x.href),h,v,g],onSubmit:function(t){function n(t,n){var l=e.selection.getRng();window.setTimeout(function(){e.windowManager.confirm(t,function(t){e.selection.setRng(l),n(t)})},0)}function l(){s?(e.focus(),k&&i.text!=c&&(s.innerText=i.text),p.setAttribs(s,{href:r,target:i.target?i.target:null,rel:i.rel?i.rel:null}),m.select(s),e.undoManager.add()):k?e.insertContent(p.createHTML("a",{href:r,target:i.target?i.target:null,rel:i.rel?i.rel:null},p.encode(i.text))):e.execCommand("mceInsertLink",!1,{href:r,target:i.target,rel:i.rel?i.rel:null})}var i=t.data;e.fire("SaveLink",i);var r=i.href;return r?r.indexOf("@")>0&&-1==r.indexOf("//")&&-1==r.indexOf(":")?void n("The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",function(e){e&&(r="mailto:"+r),l()}):/^\s*www\./i.test(r)?void n("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(e){e&&(r="http://"+r),l()}):void l():void e.execCommand("unlink")}})}e.addButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Ctrl+K",onclick:t(n),stateSelector:"a[href]"}),e.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink",stateSelector:"a[href]"}),e.addShortcut("Ctrl+K","",t(n)),this.showDialog=n,e.addMenuItem("link",{icon:"link",text:"Insert link",shortcut:"Ctrl+K",onclick:t(n),stateSelector:"a[href]",context:"insert",prependToContext:!0})}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var n,t,e,r,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=tinymce.util.Tools.resolve("tinymce.util.VK"),u=function(r){return function(t){return e=typeof(n=t),(null===n?"null":"object"==e&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":e)===r;var n,e}},a=function(n){return function(t){return typeof t===n}},l=u("string"),c=u("array"),f=function(t){return n===t},s=a("boolean"),m=a("function"),g=function(t){var n=t.getParam("link_assume_external_targets",!1);return s(n)&&n?1:!l(n)||"http"!==n&&"https"!==n?0:n},p=function(t){return t.getParam("default_link_target")},d=function(t){return t.getParam("target_list",!0)},h=function(t){return t.getParam("rel_list",[],"array")},v=function(t){return t.getParam("allow_unsafe_link_target",!1,"boolean")},y=function(){},k=function(t){return function(){return t}},x=k(!1),b=k(!(n=null)),O=function(){return w},w=(t=function(t){return t.isNone()},{fold:function(t,n){return t()},is:x,isSome:x,isNone:b,getOr:r=function(t){return t},getOrThunk:e=function(t){return t()},getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:k(null),getOrUndefined:k(undefined),or:r,orThunk:e,map:O,each:y,bind:O,exists:x,forall:b,filter:O,equals:t,equals_:t,toArray:function(){return[]},toString:k("none()")}),C=function(e){var t=k(e),n=function(){return o},r=function(t){return t(e)},o={fold:function(t,n){return n(e)},is:function(t){return e===t},isSome:b,isNone:x,getOr:t,getOrThunk:t,getOrDie:t,getOrNull:t,getOrUndefined:t,or:n,orThunk:n,map:function(t){return C(t(e))},each:function(t){t(e)},bind:r,exists:r,forall:r,filter:function(t){return t(e)?o:w},toArray:function(){return[e]},toString:function(){return"some("+e+")"},equals:function(t){return t.is(e)},equals_:function(t,n){return t.fold(x,function(t){return n(e,t)})}};return o},N={some:C,none:O,from:function(t){return null===t||t===undefined?w:C(t)}},A=Array.prototype.indexOf,P=Array.prototype.push,T=function(t,n){return e=t,r=n,-1||

    - * becomes:

    ||

    - * - * @param {DOMRange} rng DOM Range to get bookmark on. - * @return {Object} Bookmark object. - */ - function createBookmark(rng) { - var bookmark = {}; - - function setupEndPoint(start) { - var offsetNode, container, offset; - - container = rng[start ? 'startContainer' : 'endContainer']; - offset = rng[start ? 'startOffset' : 'endOffset']; - - if (container.nodeType == 1) { - offsetNode = dom.create('span', {'data-mce-type': 'bookmark'}); - - if (container.hasChildNodes()) { - offset = Math.min(offset, container.childNodes.length - 1); - - if (start) { - container.insertBefore(offsetNode, container.childNodes[offset]); - } else { - dom.insertAfter(offsetNode, container.childNodes[offset]); - } - } else { - container.appendChild(offsetNode); - } - - container = offsetNode; - offset = 0; - } - - bookmark[start ? 'startContainer' : 'endContainer'] = container; - bookmark[start ? 'startOffset' : 'endOffset'] = offset; - } - - setupEndPoint(true); - - if (!rng.collapsed) { - setupEndPoint(); - } - - return bookmark; - } - - /** - * Moves the selection to the current bookmark and removes any selection container wrappers. - * - * @param {Object} bookmark Bookmark object to move selection to. - */ - function moveToBookmark(bookmark) { - function restoreEndPoint(start) { - var container, offset, node; - - function nodeIndex(container) { - var node = container.parentNode.firstChild, idx = 0; - - while (node) { - if (node == container) { - return idx; - } - - // Skip data-mce-type=bookmark nodes - if (node.nodeType != 1 || node.getAttribute('data-mce-type') != 'bookmark') { - idx++; - } - - node = node.nextSibling; - } - - return -1; - } - - container = node = bookmark[start ? 'startContainer' : 'endContainer']; - offset = bookmark[start ? 'startOffset' : 'endOffset']; - - if (!container) { - return; - } - - if (container.nodeType == 1) { - offset = nodeIndex(container); - container = container.parentNode; - dom.remove(node); - } - - bookmark[start ? 'startContainer' : 'endContainer'] = container; - bookmark[start ? 'startOffset' : 'endOffset'] = offset; - } - - restoreEndPoint(true); - restoreEndPoint(); - - var rng = dom.createRng(); - - rng.setStart(bookmark.startContainer, bookmark.startOffset); - - if (bookmark.endContainer) { - rng.setEnd(bookmark.endContainer, bookmark.endOffset); - } - - selection.setRng(rng); - } - - function createNewTextBlock(contentNode, blockName) { - var node, textBlock, fragment = dom.createFragment(), hasContentNode; - var blockElements = editor.schema.getBlockElements(); - - if (editor.settings.forced_root_block) { - blockName = blockName || editor.settings.forced_root_block; - } - - if (blockName) { - textBlock = dom.create(blockName); - - if (textBlock.tagName === editor.settings.forced_root_block) { - dom.setAttribs(textBlock, editor.settings.forced_root_block_attrs); - } - - fragment.appendChild(textBlock); - } - - if (contentNode) { - while ((node = contentNode.firstChild)) { - var nodeName = node.nodeName; - - if (!hasContentNode && (nodeName != 'SPAN' || node.getAttribute('data-mce-type') != 'bookmark')) { - hasContentNode = true; - } - - if (blockElements[nodeName]) { - fragment.appendChild(node); - textBlock = null; - } else { - if (blockName) { - if (!textBlock) { - textBlock = dom.create(blockName); - fragment.appendChild(textBlock); - } - - textBlock.appendChild(node); - } else { - fragment.appendChild(node); - } - } - } - } - - if (!editor.settings.forced_root_block) { - fragment.appendChild(dom.create('br')); - } else { - // BR is needed in empty blocks on non IE browsers - if (!hasContentNode && (!tinymce.Env.ie || tinymce.Env.ie > 10)) { - textBlock.appendChild(dom.create('br', {'data-mce-bogus': '1'})); - } - } - - return fragment; - } - - function getSelectedListItems() { - return tinymce.grep(selection.getSelectedBlocks(), function(block) { - return block.nodeName == 'LI'; - }); - } - - function splitList(ul, li, newBlock) { - var tmpRng, fragment; - - var bookmarks = dom.select('span[data-mce-type="bookmark"]', ul); - - newBlock = newBlock || createNewTextBlock(li); - tmpRng = dom.createRng(); - tmpRng.setStartAfter(li); - tmpRng.setEndAfter(ul); - fragment = tmpRng.extractContents(); - - if (!dom.isEmpty(fragment)) { - dom.insertAfter(fragment, ul); - } - - dom.insertAfter(newBlock, ul); - - if (dom.isEmpty(li.parentNode)) { - tinymce.each(bookmarks, function(node) { - li.parentNode.parentNode.insertBefore(node, li.parentNode); - }); - - dom.remove(li.parentNode); - } - - dom.remove(li); - } - - function mergeWithAdjacentLists(listBlock) { - var sibling, node; - - sibling = listBlock.nextSibling; - if (sibling && isListNode(sibling) && sibling.nodeName == listBlock.nodeName) { - while ((node = sibling.firstChild)) { - listBlock.appendChild(node); - } - - dom.remove(sibling); - } - - sibling = listBlock.previousSibling; - if (sibling && isListNode(sibling) && sibling.nodeName == listBlock.nodeName) { - while ((node = sibling.firstChild)) { - listBlock.insertBefore(node, listBlock.firstChild); - } - - dom.remove(sibling); - } - } - - /** - * Normalizes the all lists in the specified element. - */ - function normalizeList(element) { - tinymce.each(tinymce.grep(dom.select('ol,ul', element)), function(ul) { - var sibling, parentNode = ul.parentNode; - - // Move UL/OL to previous LI if it's the only child of a LI - if (parentNode.nodeName == 'LI' && parentNode.firstChild == ul) { - sibling = parentNode.previousSibling; - if (sibling && sibling.nodeName == 'LI') { - sibling.appendChild(ul); - - if (dom.isEmpty(parentNode)) { - dom.remove(parentNode); - } - } - } - - // Append OL/UL to previous LI if it's in a parent OL/UL i.e. old HTML4 - if (isListNode(parentNode)) { - sibling = parentNode.previousSibling; - if (sibling && sibling.nodeName == 'LI') { - sibling.appendChild(ul); - } - } - }); - } - - function outdent(li) { - var ul = li.parentNode, ulParent = ul.parentNode, newBlock; - - function removeEmptyLi(li) { - if (dom.isEmpty(li)) { - dom.remove(li); - } - } - - if (isFirstChild(li) && isLastChild(li)) { - if (ulParent.nodeName == "LI") { - dom.insertAfter(li, ulParent); - removeEmptyLi(ulParent); - dom.remove(ul); - } else if (isListNode(ulParent)) { - dom.remove(ul, true); - } else { - ulParent.insertBefore(createNewTextBlock(li), ul); - dom.remove(ul); - } - - return true; - } else if (isFirstChild(li)) { - if (ulParent.nodeName == "LI") { - dom.insertAfter(li, ulParent); - li.appendChild(ul); - removeEmptyLi(ulParent); - } else if (isListNode(ulParent)) { - ulParent.insertBefore(li, ul); - } else { - ulParent.insertBefore(createNewTextBlock(li), ul); - dom.remove(li); - } - - return true; - } else if (isLastChild(li)) { - if (ulParent.nodeName == "LI") { - dom.insertAfter(li, ulParent); - } else if (isListNode(ulParent)) { - dom.insertAfter(li, ul); - } else { - dom.insertAfter(createNewTextBlock(li), ul); - dom.remove(li); - } - - return true; - } else { - if (ulParent.nodeName == 'LI') { - ul = ulParent; - newBlock = createNewTextBlock(li, 'LI'); - } else if (isListNode(ulParent)) { - newBlock = createNewTextBlock(li, 'LI'); - } else { - newBlock = createNewTextBlock(li); - } - - splitList(ul, li, newBlock); - normalizeList(ul.parentNode); - - return true; - } - - return false; - } - - function indent(li) { - var sibling, newList; - - function mergeLists(from, to) { - var node; - - if (isListNode(from)) { - while ((node = li.lastChild.firstChild)) { - to.appendChild(node); - } - - dom.remove(from); - } - } - - sibling = li.previousSibling; - - if (sibling && isListNode(sibling)) { - sibling.appendChild(li); - return true; - } - - if (sibling && sibling.nodeName == 'LI' && isListNode(sibling.lastChild)) { - sibling.lastChild.appendChild(li); - mergeLists(li.lastChild, sibling.lastChild); - return true; - } - - sibling = li.nextSibling; - - if (sibling && isListNode(sibling)) { - sibling.insertBefore(li, sibling.firstChild); - return true; - } - - if (sibling && sibling.nodeName == 'LI' && isListNode(li.lastChild)) { - return false; - } - - sibling = li.previousSibling; - if (sibling && sibling.nodeName == 'LI') { - newList = dom.create(li.parentNode.nodeName); - sibling.appendChild(newList); - newList.appendChild(li); - mergeLists(li.lastChild, newList); - return true; - } - - return false; - } - - function indentSelection() { - var listElements = getSelectedListItems(); - - if (listElements.length) { - var bookmark = createBookmark(selection.getRng(true)); - - for (var i = 0; i < listElements.length; i++) { - if (!indent(listElements[i]) && i === 0) { - break; - } - } - - moveToBookmark(bookmark); - editor.nodeChanged(); - - return true; - } - } - - function outdentSelection() { - var listElements = getSelectedListItems(); - - if (listElements.length) { - var bookmark = createBookmark(selection.getRng(true)); - var i, y, root = editor.getBody(); - - i = listElements.length; - while (i--) { - var node = listElements[i].parentNode; - - while (node && node != root) { - y = listElements.length; - while (y--) { - if (listElements[y] === node) { - listElements.splice(i, 1); - break; - } - } - - node = node.parentNode; - } - } - - for (i = 0; i < listElements.length; i++) { - if (!outdent(listElements[i]) && i === 0) { - break; - } - } - - moveToBookmark(bookmark); - editor.nodeChanged(); - - return true; - } - } - - function applyList(listName) { - var rng = selection.getRng(true), bookmark = createBookmark(rng); - - function getSelectedTextBlocks() { - var textBlocks = [], root = editor.getBody(); - - function getEndPointNode(start) { - var container, offset; - - container = rng[start ? 'startContainer' : 'endContainer']; - offset = rng[start ? 'startOffset' : 'endOffset']; - - // Resolve node index - if (container.nodeType == 1) { - container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container; - } - - while (container.parentNode != root) { - if (isTextBlock(container)) { - return container; - } - - if (/^(TD|TH)$/.test(container.parentNode.nodeName)) { - return container; - } - - container = container.parentNode; - } - - return container; - } - - var startNode = getEndPointNode(true); - var endNode = getEndPointNode(); - var block, siblings = []; - - for (var node = startNode; node; node = node.nextSibling) { - siblings.push(node); - - if (node == endNode) { - break; - } - } - - tinymce.each(siblings, function(node) { - if (isTextBlock(node)) { - textBlocks.push(node); - block = null; - return; - } - - if (dom.isBlock(node) || node.nodeName == 'BR') { - if (node.nodeName == 'BR') { - dom.remove(node); - } - - block = null; - return; - } - - var nextSibling = node.nextSibling; - if (isBookmarkNode(node)) { - if (isTextBlock(nextSibling) || (!nextSibling && node.parentNode == root)) { - block = null; - return; - } - } - - if (!block) { - block = dom.create('p'); - node.parentNode.insertBefore(block, node); - textBlocks.push(block); - } - - block.appendChild(node); - }); - - return textBlocks; - } - - var textBlocks = getSelectedTextBlocks(); - - tinymce.each(textBlocks, function(block) { - var listBlock, sibling; - - sibling = block.previousSibling; - if (sibling && isListNode(sibling) && sibling.nodeName == listName) { - listBlock = sibling; - block = dom.rename(block, 'LI'); - sibling.appendChild(block); - } else { - listBlock = dom.create(listName); - block.parentNode.insertBefore(listBlock, block); - listBlock.appendChild(block); - block = dom.rename(block, 'LI'); - } - - mergeWithAdjacentLists(listBlock); - }); - - moveToBookmark(bookmark); - } - - function removeList() { - var bookmark = createBookmark(selection.getRng(true)), root = editor.getBody(); - - tinymce.each(getSelectedListItems(), function(li) { - var node, rootList; - - if (dom.isEmpty(li)) { - outdent(li); - return; - } - - for (node = li; node && node != root; node = node.parentNode) { - if (isListNode(node)) { - rootList = node; - } - } - - splitList(rootList, li); - }); - - moveToBookmark(bookmark); - } - - function toggleList(listName) { - var parentList = dom.getParent(selection.getStart(), 'OL,UL'); - - if (parentList) { - if (parentList.nodeName == listName) { - removeList(listName); - } else { - var bookmark = createBookmark(selection.getRng(true)); - mergeWithAdjacentLists(dom.rename(parentList, listName)); - moveToBookmark(bookmark); - } - } else { - applyList(listName); - } - } - - self.backspaceDelete = function(isForward) { - function findNextCaretContainer(rng, isForward) { - var node = rng.startContainer, offset = rng.startOffset; - - if (node.nodeType == 3 && (isForward ? offset < node.data.length : offset > 0)) { - return node; - } - - var walker = new tinymce.dom.TreeWalker(rng.startContainer); - while ((node = walker[isForward ? 'next' : 'prev']())) { - if (node.nodeType == 3 && node.data.length > 0) { - return node; - } - } - } - - function mergeLiElements(fromElm, toElm) { - var node, listNode, ul = fromElm.parentNode; - - if (isListNode(toElm.lastChild)) { - listNode = toElm.lastChild; - } - - node = toElm.lastChild; - if (node && node.nodeName == 'BR' && fromElm.hasChildNodes()) { - dom.remove(node); - } - - while ((node = fromElm.firstChild)) { - toElm.appendChild(node); - } - - if (listNode) { - toElm.appendChild(listNode); - } - - dom.remove(fromElm); - - if (dom.isEmpty(ul)) { - dom.remove(ul); - } - } - - if (selection.isCollapsed()) { - var li = dom.getParent(selection.getStart(), 'LI'); - - if (li) { - var rng = selection.getRng(true); - var otherLi = dom.getParent(findNextCaretContainer(rng, isForward), 'LI'); - - if (otherLi && otherLi != li) { - var bookmark = createBookmark(rng); - - if (isForward) { - mergeLiElements(otherLi, li); - } else { - mergeLiElements(li, otherLi); - } - - moveToBookmark(bookmark); - - return true; - } else if (!otherLi) { - if (!isForward && removeList(li.parentNode.nodeName)) { - return true; - } - } - } - } - }; - - editor.addCommand('Indent', function() { - if (!indentSelection()) { - return true; - } - }); - - editor.addCommand('Outdent', function() { - if (!outdentSelection()) { - return true; - } - }); - - editor.addCommand('InsertUnorderedList', function() { - toggleList('UL'); - }); - - editor.addCommand('InsertOrderedList', function() { - toggleList('OL'); - }); - - editor.on('keydown', function(e) { - if (e.keyCode == 9 && editor.dom.getParent(editor.selection.getStart(), 'LI')) { - e.preventDefault(); - - if (e.shiftKey) { - outdentSelection(); - } else { - indentSelection(); - } - } - }); - }); - - editor.addButton('indent', { - icon: 'indent', - title: 'Increase indent', - cmd: 'Indent', - onPostRender: function() { - var ctrl = this; - - editor.on('nodechange', function() { - var li = editor.dom.getParent(editor.selection.getNode(), 'LI,UL,OL'); - ctrl.disabled(li && (li.nodeName != 'LI' || isFirstChild(li))); - }); - } - }); - - editor.on('keydown', function(e) { - if (e.keyCode == tinymce.util.VK.BACKSPACE) { - if (self.backspaceDelete()) { - e.preventDefault(); - } - } else if (e.keyCode == tinymce.util.VK.DELETE) { - if (self.backspaceDelete(true)) { - e.preventDefault(); - } - } - }); -}); +(function () { + 'use strict'; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var noop = function () { + }; + var constant = function (value) { + return function () { + return value; + }; + }; + var not = function (f) { + return function (t) { + return !f(t); + }; + }; + var never = constant(false); + var always = constant(true); + + var none = function () { + return NONE; + }; + var NONE = function () { + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; + }(); + var some = function (a) { + var constant_a = constant(a); + var self = function () { + return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; + }; + var from = function (value) { + return value === null || value === undefined ? NONE : some(value); + }; + var Optional = { + some: some, + none: none, + from: from + }; + + var typeOf = function (x) { + var t = typeof x; + if (x === null) { + return 'null'; + } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } else { + return t; + } + }; + var isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isSimpleType = function (type) { + return function (value) { + return typeof value === type; + }; + }; + var isString = isType('string'); + var isArray = isType('array'); + var isBoolean = isSimpleType('boolean'); + var isFunction = isSimpleType('function'); + var isNumber = isSimpleType('number'); + + var nativeSlice = Array.prototype.slice; + var nativePush = Array.prototype.push; + var map = function (xs, f) { + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; + }; + var each = function (xs, f) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } + }; + var filter = function (xs, pred) { + var r = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + r.push(x); + } + } + return r; + }; + var groupBy = function (xs, f) { + if (xs.length === 0) { + return []; + } else { + var wasType = f(xs[0]); + var r = []; + var group = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + var type = f(x); + if (type !== wasType) { + r.push(group); + group = []; + } + wasType = type; + group.push(x); + } + if (group.length !== 0) { + r.push(group); + } + return r; + } + }; + var foldl = function (xs, f, acc) { + each(xs, function (x) { + acc = f(acc, x); + }); + return acc; + }; + var findUntil = function (xs, pred, until) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Optional.some(x); + } else if (until(x, i)) { + break; + } + } + return Optional.none(); + }; + var find = function (xs, pred) { + return findUntil(xs, pred, never); + }; + var flatten = function (xs) { + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); + } + nativePush.apply(r, xs[i]); + } + return r; + }; + var bind = function (xs, f) { + return flatten(map(xs, f)); + }; + var reverse = function (xs) { + var r = nativeSlice.call(xs, 0); + r.reverse(); + return r; + }; + var head = function (xs) { + return xs.length === 0 ? Optional.none() : Optional.some(xs[0]); + }; + var last = function (xs) { + return xs.length === 0 ? Optional.none() : Optional.some(xs[xs.length - 1]); + }; + + var __assign = function () { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + + var cached = function (f) { + var called = false; + var r; + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!called) { + called = true; + r = f.apply(null, args); + } + return r; + }; + }; + + var DeviceType = function (os, browser, userAgent, mediaMatch) { + var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true; + var isiPhone = os.isiOS() && !isiPad; + var isMobile = os.isiOS() || os.isAndroid(); + var isTouch = isMobile || mediaMatch('(pointer:coarse)'); + var isTablet = isiPad || !isiPhone && isMobile && mediaMatch('(min-device-width:768px)'); + var isPhone = isiPhone || isMobile && !isTablet; + var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false; + var isDesktop = !isPhone && !isTablet && !iOSwebview; + return { + isiPad: constant(isiPad), + isiPhone: constant(isiPhone), + isTablet: constant(isTablet), + isPhone: constant(isPhone), + isTouch: constant(isTouch), + isAndroid: os.isAndroid, + isiOS: os.isiOS, + isWebView: constant(iOSwebview), + isDesktop: constant(isDesktop) + }; + }; + + var firstMatch = function (regexes, s) { + for (var i = 0; i < regexes.length; i++) { + var x = regexes[i]; + if (x.test(s)) { + return x; + } + } + return undefined; + }; + var find$1 = function (regexes, agent) { + var r = firstMatch(regexes, agent); + if (!r) { + return { + major: 0, + minor: 0 + }; + } + var group = function (i) { + return Number(agent.replace(r, '$' + i)); + }; + return nu(group(1), group(2)); + }; + var detect = function (versionRegexes, agent) { + var cleanedAgent = String(agent).toLowerCase(); + if (versionRegexes.length === 0) { + return unknown(); + } + return find$1(versionRegexes, cleanedAgent); + }; + var unknown = function () { + return nu(0, 0); + }; + var nu = function (major, minor) { + return { + major: major, + minor: minor + }; + }; + var Version = { + nu: nu, + detect: detect, + unknown: unknown + }; + + var detect$1 = function (candidates, userAgent) { + var agent = String(userAgent).toLowerCase(); + return find(candidates, function (candidate) { + return candidate.search(agent); + }); + }; + var detectBrowser = function (browsers, userAgent) { + return detect$1(browsers, userAgent).map(function (browser) { + var version = Version.detect(browser.versionRegexes, userAgent); + return { + current: browser.name, + version: version + }; + }); + }; + var detectOs = function (oses, userAgent) { + return detect$1(oses, userAgent).map(function (os) { + var version = Version.detect(os.versionRegexes, userAgent); + return { + current: os.name, + version: version + }; + }); + }; + var UaString = { + detectBrowser: detectBrowser, + detectOs: detectOs + }; + + var contains = function (str, substr) { + return str.indexOf(substr) !== -1; + }; + + var normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/; + var checkContains = function (target) { + return function (uastring) { + return contains(uastring, target); + }; + }; + var browsers = [ + { + name: 'Edge', + versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/], + search: function (uastring) { + return contains(uastring, 'edge/') && contains(uastring, 'chrome') && contains(uastring, 'safari') && contains(uastring, 'applewebkit'); + } + }, + { + name: 'Chrome', + versionRegexes: [ + /.*?chrome\/([0-9]+)\.([0-9]+).*/, + normalVersionRegex + ], + search: function (uastring) { + return contains(uastring, 'chrome') && !contains(uastring, 'chromeframe'); + } + }, + { + name: 'IE', + versionRegexes: [ + /.*?msie\ ?([0-9]+)\.([0-9]+).*/, + /.*?rv:([0-9]+)\.([0-9]+).*/ + ], + search: function (uastring) { + return contains(uastring, 'msie') || contains(uastring, 'trident'); + } + }, + { + name: 'Opera', + versionRegexes: [ + normalVersionRegex, + /.*?opera\/([0-9]+)\.([0-9]+).*/ + ], + search: checkContains('opera') + }, + { + name: 'Firefox', + versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/], + search: checkContains('firefox') + }, + { + name: 'Safari', + versionRegexes: [ + normalVersionRegex, + /.*?cpu os ([0-9]+)_([0-9]+).*/ + ], + search: function (uastring) { + return (contains(uastring, 'safari') || contains(uastring, 'mobile/')) && contains(uastring, 'applewebkit'); + } + } + ]; + var oses = [ + { + name: 'Windows', + search: checkContains('win'), + versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/] + }, + { + name: 'iOS', + search: function (uastring) { + return contains(uastring, 'iphone') || contains(uastring, 'ipad'); + }, + versionRegexes: [ + /.*?version\/\ ?([0-9]+)\.([0-9]+).*/, + /.*cpu os ([0-9]+)_([0-9]+).*/, + /.*cpu iphone os ([0-9]+)_([0-9]+).*/ + ] + }, + { + name: 'Android', + search: checkContains('android'), + versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/] + }, + { + name: 'OSX', + search: checkContains('mac os x'), + versionRegexes: [/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/] + }, + { + name: 'Linux', + search: checkContains('linux'), + versionRegexes: [] + }, + { + name: 'Solaris', + search: checkContains('sunos'), + versionRegexes: [] + }, + { + name: 'FreeBSD', + search: checkContains('freebsd'), + versionRegexes: [] + }, + { + name: 'ChromeOS', + search: checkContains('cros'), + versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/] + } + ]; + var PlatformInfo = { + browsers: constant(browsers), + oses: constant(oses) + }; + + var edge = 'Edge'; + var chrome = 'Chrome'; + var ie = 'IE'; + var opera = 'Opera'; + var firefox = 'Firefox'; + var safari = 'Safari'; + var unknown$1 = function () { + return nu$1({ + current: undefined, + version: Version.unknown() + }); + }; + var nu$1 = function (info) { + var current = info.current; + var version = info.version; + var isBrowser = function (name) { + return function () { + return current === name; + }; + }; + return { + current: current, + version: version, + isEdge: isBrowser(edge), + isChrome: isBrowser(chrome), + isIE: isBrowser(ie), + isOpera: isBrowser(opera), + isFirefox: isBrowser(firefox), + isSafari: isBrowser(safari) + }; + }; + var Browser = { + unknown: unknown$1, + nu: nu$1, + edge: constant(edge), + chrome: constant(chrome), + ie: constant(ie), + opera: constant(opera), + firefox: constant(firefox), + safari: constant(safari) + }; + + var windows = 'Windows'; + var ios = 'iOS'; + var android = 'Android'; + var linux = 'Linux'; + var osx = 'OSX'; + var solaris = 'Solaris'; + var freebsd = 'FreeBSD'; + var chromeos = 'ChromeOS'; + var unknown$2 = function () { + return nu$2({ + current: undefined, + version: Version.unknown() + }); + }; + var nu$2 = function (info) { + var current = info.current; + var version = info.version; + var isOS = function (name) { + return function () { + return current === name; + }; + }; + return { + current: current, + version: version, + isWindows: isOS(windows), + isiOS: isOS(ios), + isAndroid: isOS(android), + isOSX: isOS(osx), + isLinux: isOS(linux), + isSolaris: isOS(solaris), + isFreeBSD: isOS(freebsd), + isChromeOS: isOS(chromeos) + }; + }; + var OperatingSystem = { + unknown: unknown$2, + nu: nu$2, + windows: constant(windows), + ios: constant(ios), + android: constant(android), + linux: constant(linux), + osx: constant(osx), + solaris: constant(solaris), + freebsd: constant(freebsd), + chromeos: constant(chromeos) + }; + + var detect$2 = function (userAgent, mediaMatch) { + var browsers = PlatformInfo.browsers(); + var oses = PlatformInfo.oses(); + var browser = UaString.detectBrowser(browsers, userAgent).fold(Browser.unknown, Browser.nu); + var os = UaString.detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu); + var deviceType = DeviceType(os, browser, userAgent, mediaMatch); + return { + browser: browser, + os: os, + deviceType: deviceType + }; + }; + var PlatformDetection = { detect: detect$2 }; + + var mediaMatch = function (query) { + return window.matchMedia(query).matches; + }; + var platform = cached(function () { + return PlatformDetection.detect(navigator.userAgent, mediaMatch); + }); + var detect$3 = function () { + return platform(); + }; + + var compareDocumentPosition = function (a, b, match) { + return (a.compareDocumentPosition(b) & match) !== 0; + }; + var documentPositionContainedBy = function (a, b) { + return compareDocumentPosition(a, b, Node.DOCUMENT_POSITION_CONTAINED_BY); + }; + + var ELEMENT = 1; + + var fromHtml = function (html, scope) { + var doc = scope || document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); + }; + var fromTag = function (tag, scope) { + var doc = scope || document; + var node = doc.createElement(tag); + return fromDom(node); + }; + var fromText = function (text, scope) { + var doc = scope || document; + var node = doc.createTextNode(text); + return fromDom(node); + }; + var fromDom = function (node) { + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: node }; + }; + var fromPoint = function (docElm, x, y) { + return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); + }; + var SugarElement = { + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint + }; + + var is = function (element, selector) { + var dom = element.dom; + if (dom.nodeType !== ELEMENT) { + return false; + } else { + var elem = dom; + if (elem.matches !== undefined) { + return elem.matches(selector); + } else if (elem.msMatchesSelector !== undefined) { + return elem.msMatchesSelector(selector); + } else if (elem.webkitMatchesSelector !== undefined) { + return elem.webkitMatchesSelector(selector); + } else if (elem.mozMatchesSelector !== undefined) { + return elem.mozMatchesSelector(selector); + } else { + throw new Error('Browser lacks native selectors'); + } + } + }; + + var eq = function (e1, e2) { + return e1.dom === e2.dom; + }; + var regularContains = function (e1, e2) { + var d1 = e1.dom; + var d2 = e2.dom; + return d1 === d2 ? false : d1.contains(d2); + }; + var ieContains = function (e1, e2) { + return documentPositionContainedBy(e1.dom, e2.dom); + }; + var contains$1 = function (e1, e2) { + return detect$3().browser.isIE() ? ieContains(e1, e2) : regularContains(e1, e2); + }; + var is$1 = is; + + var global$1 = tinymce.util.Tools.resolve('tinymce.dom.RangeUtils'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker'); + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.VK'); + + var keys = Object.keys; + var each$1 = function (obj, f) { + var props = keys(obj); + for (var k = 0, len = props.length; k < len; k++) { + var i = props[k]; + var x = obj[i]; + f(x, i); + } + }; + var objAcc = function (r) { + return function (x, i) { + r[i] = x; + }; + }; + var internalFilter = function (obj, pred, onTrue, onFalse) { + var r = {}; + each$1(obj, function (x, i) { + (pred(x, i) ? onTrue : onFalse)(x, i); + }); + return r; + }; + var filter$1 = function (obj, pred) { + var t = {}; + internalFilter(obj, pred, objAcc(t), noop); + return t; + }; + + var Global = typeof window !== 'undefined' ? window : Function('return this;')(); + + var name = function (element) { + var r = element.dom.nodeName; + return r.toLowerCase(); + }; + var type = function (element) { + return element.dom.nodeType; + }; + var isType$1 = function (t) { + return function (element) { + return type(element) === t; + }; + }; + var isElement = isType$1(ELEMENT); + + var rawSet = function (dom, key, value) { + if (isString(value) || isBoolean(value) || isNumber(value)) { + dom.setAttribute(key, value + ''); + } else { + console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom); + throw new Error('Attribute value was not simple'); + } + }; + var setAll = function (element, attrs) { + var dom = element.dom; + each$1(attrs, function (v, k) { + rawSet(dom, k, v); + }); + }; + var clone = function (element) { + return foldl(element.dom.attributes, function (acc, attr) { + acc[attr.name] = attr.value; + return acc; + }, {}); + }; + + var parent = function (element) { + return Optional.from(element.dom.parentNode).map(SugarElement.fromDom); + }; + var children = function (element) { + return map(element.dom.childNodes, SugarElement.fromDom); + }; + var child = function (element, index) { + var cs = element.dom.childNodes; + return Optional.from(cs[index]).map(SugarElement.fromDom); + }; + var firstChild = function (element) { + return child(element, 0); + }; + var lastChild = function (element) { + return child(element, element.dom.childNodes.length - 1); + }; + + var before = function (marker, element) { + var parent$1 = parent(marker); + parent$1.each(function (v) { + v.dom.insertBefore(element.dom, marker.dom); + }); + }; + var append = function (parent, element) { + parent.dom.appendChild(element.dom); + }; + + var before$1 = function (marker, elements) { + each(elements, function (x) { + before(marker, x); + }); + }; + var append$1 = function (parent, elements) { + each(elements, function (x) { + append(parent, x); + }); + }; + + var remove = function (element) { + var dom = element.dom; + if (dom.parentNode !== null) { + dom.parentNode.removeChild(dom); + } + }; + + var clone$1 = function (original, isDeep) { + return SugarElement.fromDom(original.dom.cloneNode(isDeep)); + }; + var deep = function (original) { + return clone$1(original, true); + }; + var shallowAs = function (original, tag) { + var nu = SugarElement.fromTag(tag); + var attributes = clone(original); + setAll(nu, attributes); + return nu; + }; + var mutate = function (original, tag) { + var nu = shallowAs(original, tag); + before(original, nu); + var children$1 = children(original); + append$1(nu, children$1); + remove(original); + return nu; + }; + + var global$4 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); + + var global$5 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var matchNodeName = function (name) { + return function (node) { + return node && node.nodeName.toLowerCase() === name; + }; + }; + var matchNodeNames = function (regex) { + return function (node) { + return node && regex.test(node.nodeName); + }; + }; + var isTextNode = function (node) { + return node && node.nodeType === 3; + }; + var isListNode = matchNodeNames(/^(OL|UL|DL)$/); + var isOlUlNode = matchNodeNames(/^(OL|UL)$/); + var isOlNode = matchNodeName('ol'); + var isListItemNode = matchNodeNames(/^(LI|DT|DD)$/); + var isDlItemNode = matchNodeNames(/^(DT|DD)$/); + var isTableCellNode = matchNodeNames(/^(TH|TD)$/); + var isBr = matchNodeName('br'); + var isFirstChild = function (node) { + return node.parentNode.firstChild === node; + }; + var isTextBlock = function (editor, node) { + return node && !!editor.schema.getTextBlockElements()[node.nodeName]; + }; + var isBlock = function (node, blockElements) { + return node && node.nodeName in blockElements; + }; + var isBogusBr = function (dom, node) { + if (!isBr(node)) { + return false; + } + return dom.isBlock(node.nextSibling) && !isBr(node.previousSibling); + }; + var isEmpty = function (dom, elm, keepBookmarks) { + var empty = dom.isEmpty(elm); + if (keepBookmarks && dom.select('span[data-mce-type=bookmark]', elm).length > 0) { + return false; + } + return empty; + }; + var isChildOfBody = function (dom, elm) { + return dom.isChildOf(elm, dom.getRoot()); + }; + + var shouldIndentOnTab = function (editor) { + return editor.getParam('lists_indent_on_tab', true); + }; + var getForcedRootBlock = function (editor) { + var block = editor.getParam('forced_root_block', 'p'); + if (block === false) { + return ''; + } else if (block === true) { + return 'p'; + } else { + return block; + } + }; + var getForcedRootBlockAttrs = function (editor) { + return editor.getParam('forced_root_block_attrs', {}); + }; + + var createTextBlock = function (editor, contentNode) { + var dom = editor.dom; + var blockElements = editor.schema.getBlockElements(); + var fragment = dom.createFragment(); + var blockName = getForcedRootBlock(editor); + var node, textBlock, hasContentNode; + if (blockName) { + textBlock = dom.create(blockName); + if (textBlock.tagName === blockName.toUpperCase()) { + dom.setAttribs(textBlock, getForcedRootBlockAttrs(editor)); + } + if (!isBlock(contentNode.firstChild, blockElements)) { + fragment.appendChild(textBlock); + } + } + if (contentNode) { + while (node = contentNode.firstChild) { + var nodeName = node.nodeName; + if (!hasContentNode && (nodeName !== 'SPAN' || node.getAttribute('data-mce-type') !== 'bookmark')) { + hasContentNode = true; + } + if (isBlock(node, blockElements)) { + fragment.appendChild(node); + textBlock = null; + } else { + if (blockName) { + if (!textBlock) { + textBlock = dom.create(blockName); + fragment.appendChild(textBlock); + } + textBlock.appendChild(node); + } else { + fragment.appendChild(node); + } + } + } + } + if (!blockName) { + fragment.appendChild(dom.create('br')); + } else { + if (!hasContentNode) { + textBlock.appendChild(dom.create('br', { 'data-mce-bogus': '1' })); + } + } + return fragment; + }; + + var DOM = global$4.DOM; + var splitList = function (editor, ul, li) { + var removeAndKeepBookmarks = function (targetNode) { + global$5.each(bookmarks, function (node) { + targetNode.parentNode.insertBefore(node, li.parentNode); + }); + DOM.remove(targetNode); + }; + var bookmarks = DOM.select('span[data-mce-type="bookmark"]', ul); + var newBlock = createTextBlock(editor, li); + var tmpRng = DOM.createRng(); + tmpRng.setStartAfter(li); + tmpRng.setEndAfter(ul); + var fragment = tmpRng.extractContents(); + for (var node = fragment.firstChild; node; node = node.firstChild) { + if (node.nodeName === 'LI' && editor.dom.isEmpty(node)) { + DOM.remove(node); + break; + } + } + if (!editor.dom.isEmpty(fragment)) { + DOM.insertAfter(fragment, ul); + } + DOM.insertAfter(newBlock, ul); + if (isEmpty(editor.dom, li.parentNode)) { + removeAndKeepBookmarks(li.parentNode); + } + DOM.remove(li); + if (isEmpty(editor.dom, ul)) { + DOM.remove(ul); + } + }; + + var outdentDlItem = function (editor, item) { + if (is$1(item, 'dd')) { + mutate(item, 'dt'); + } else if (is$1(item, 'dt')) { + parent(item).each(function (dl) { + return splitList(editor, dl.dom, item.dom); + }); + } + }; + var indentDlItem = function (item) { + if (is$1(item, 'dt')) { + mutate(item, 'dd'); + } + }; + var dlIndentation = function (editor, indentation, dlItems) { + if (indentation === 'Indent') { + each(dlItems, indentDlItem); + } else { + each(dlItems, function (item) { + return outdentDlItem(editor, item); + }); + } + }; + + var getNormalizedPoint = function (container, offset) { + if (isTextNode(container)) { + return { + container: container, + offset: offset + }; + } + var node = global$1.getNode(container, offset); + if (isTextNode(node)) { + return { + container: node, + offset: offset >= container.childNodes.length ? node.data.length : 0 + }; + } else if (node.previousSibling && isTextNode(node.previousSibling)) { + return { + container: node.previousSibling, + offset: node.previousSibling.data.length + }; + } else if (node.nextSibling && isTextNode(node.nextSibling)) { + return { + container: node.nextSibling, + offset: 0 + }; + } + return { + container: container, + offset: offset + }; + }; + var normalizeRange = function (rng) { + var outRng = rng.cloneRange(); + var rangeStart = getNormalizedPoint(rng.startContainer, rng.startOffset); + outRng.setStart(rangeStart.container, rangeStart.offset); + var rangeEnd = getNormalizedPoint(rng.endContainer, rng.endOffset); + outRng.setEnd(rangeEnd.container, rangeEnd.offset); + return outRng; + }; + + var global$6 = tinymce.util.Tools.resolve('tinymce.dom.DomQuery'); + + var getParentList = function (editor, node) { + var selectionStart = node || editor.selection.getStart(true); + return editor.dom.getParent(selectionStart, 'OL,UL,DL', getClosestListRootElm(editor, selectionStart)); + }; + var isParentListSelected = function (parentList, selectedBlocks) { + return parentList && selectedBlocks.length === 1 && selectedBlocks[0] === parentList; + }; + var findSubLists = function (parentList) { + return global$5.grep(parentList.querySelectorAll('ol,ul,dl'), function (elm) { + return isListNode(elm); + }); + }; + var getSelectedSubLists = function (editor) { + var parentList = getParentList(editor); + var selectedBlocks = editor.selection.getSelectedBlocks(); + if (isParentListSelected(parentList, selectedBlocks)) { + return findSubLists(parentList); + } else { + return global$5.grep(selectedBlocks, function (elm) { + return isListNode(elm) && parentList !== elm; + }); + } + }; + var findParentListItemsNodes = function (editor, elms) { + var listItemsElms = global$5.map(elms, function (elm) { + var parentLi = editor.dom.getParent(elm, 'li,dd,dt', getClosestListRootElm(editor, elm)); + return parentLi ? parentLi : elm; + }); + return global$6.unique(listItemsElms); + }; + var getSelectedListItems = function (editor) { + var selectedBlocks = editor.selection.getSelectedBlocks(); + return global$5.grep(findParentListItemsNodes(editor, selectedBlocks), function (block) { + return isListItemNode(block); + }); + }; + var getSelectedDlItems = function (editor) { + return filter(getSelectedListItems(editor), isDlItemNode); + }; + var getClosestListRootElm = function (editor, elm) { + var parentTableCell = editor.dom.getParents(elm, 'TD,TH'); + var root = parentTableCell.length > 0 ? parentTableCell[0] : editor.getBody(); + return root; + }; + var findLastParentListNode = function (editor, elm) { + var parentLists = editor.dom.getParents(elm, 'ol,ul', getClosestListRootElm(editor, elm)); + return last(parentLists); + }; + var getSelectedLists = function (editor) { + var firstList = findLastParentListNode(editor, editor.selection.getStart()); + var subsequentLists = filter(editor.selection.getSelectedBlocks(), isOlUlNode); + return firstList.toArray().concat(subsequentLists); + }; + var getSelectedListRoots = function (editor) { + var selectedLists = getSelectedLists(editor); + return getUniqueListRoots(editor, selectedLists); + }; + var getUniqueListRoots = function (editor, lists) { + var listRoots = map(lists, function (list) { + return findLastParentListNode(editor, list).getOr(list); + }); + return global$6.unique(listRoots); + }; + + var lift2 = function (oa, ob, f) { + return oa.isSome() && ob.isSome() ? Optional.some(f(oa.getOrDie(), ob.getOrDie())) : Optional.none(); + }; + + var fromElements = function (elements, scope) { + var doc = scope || document; + var fragment = doc.createDocumentFragment(); + each(elements, function (element) { + fragment.appendChild(element.dom); + }); + return SugarElement.fromDom(fragment); + }; + + var fireListEvent = function (editor, action, element) { + return editor.fire('ListMutation', { + action: action, + element: element + }); + }; + + var isSupported = function (dom) { + return dom.style !== undefined && isFunction(dom.style.getPropertyValue); + }; + + var internalSet = function (dom, property, value) { + if (!isString(value)) { + console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom); + throw new Error('CSS value must be a string: ' + value); + } + if (isSupported(dom)) { + dom.style.setProperty(property, value); + } + }; + var set = function (element, property, value) { + var dom = element.dom; + internalSet(dom, property, value); + }; + + var joinSegment = function (parent, child) { + append(parent.item, child.list); + }; + var joinSegments = function (segments) { + for (var i = 1; i < segments.length; i++) { + joinSegment(segments[i - 1], segments[i]); + } + }; + var appendSegments = function (head$1, tail) { + lift2(last(head$1), head(tail), joinSegment); + }; + var createSegment = function (scope, listType) { + var segment = { + list: SugarElement.fromTag(listType, scope), + item: SugarElement.fromTag('li', scope) + }; + append(segment.list, segment.item); + return segment; + }; + var createSegments = function (scope, entry, size) { + var segments = []; + for (var i = 0; i < size; i++) { + segments.push(createSegment(scope, entry.listType)); + } + return segments; + }; + var populateSegments = function (segments, entry) { + for (var i = 0; i < segments.length - 1; i++) { + set(segments[i].item, 'list-style-type', 'none'); + } + last(segments).each(function (segment) { + setAll(segment.list, entry.listAttributes); + setAll(segment.item, entry.itemAttributes); + append$1(segment.item, entry.content); + }); + }; + var normalizeSegment = function (segment, entry) { + if (name(segment.list) !== entry.listType) { + segment.list = mutate(segment.list, entry.listType); + } + setAll(segment.list, entry.listAttributes); + }; + var createItem = function (scope, attr, content) { + var item = SugarElement.fromTag('li', scope); + setAll(item, attr); + append$1(item, content); + return item; + }; + var appendItem = function (segment, item) { + append(segment.list, item); + segment.item = item; + }; + var writeShallow = function (scope, cast, entry) { + var newCast = cast.slice(0, entry.depth); + last(newCast).each(function (segment) { + var item = createItem(scope, entry.itemAttributes, entry.content); + appendItem(segment, item); + normalizeSegment(segment, entry); + }); + return newCast; + }; + var writeDeep = function (scope, cast, entry) { + var segments = createSegments(scope, entry, entry.depth - cast.length); + joinSegments(segments); + populateSegments(segments, entry); + appendSegments(cast, segments); + return cast.concat(segments); + }; + var composeList = function (scope, entries) { + var cast = foldl(entries, function (cast, entry) { + return entry.depth > cast.length ? writeDeep(scope, cast, entry) : writeShallow(scope, cast, entry); + }, []); + return head(cast).map(function (segment) { + return segment.list; + }); + }; + + var isList = function (el) { + return is$1(el, 'OL,UL'); + }; + var hasFirstChildList = function (el) { + return firstChild(el).map(isList).getOr(false); + }; + var hasLastChildList = function (el) { + return lastChild(el).map(isList).getOr(false); + }; + + var isIndented = function (entry) { + return entry.depth > 0; + }; + var isSelected = function (entry) { + return entry.isSelected; + }; + var cloneItemContent = function (li) { + var children$1 = children(li); + var content = hasLastChildList(li) ? children$1.slice(0, -1) : children$1; + return map(content, deep); + }; + var createEntry = function (li, depth, isSelected) { + return parent(li).filter(isElement).map(function (list) { + return { + depth: depth, + dirty: false, + isSelected: isSelected, + content: cloneItemContent(li), + itemAttributes: clone(li), + listAttributes: clone(list), + listType: name(list) + }; + }); + }; + + var indentEntry = function (indentation, entry) { + switch (indentation) { + case 'Indent': + entry.depth++; + break; + case 'Outdent': + entry.depth--; + break; + case 'Flatten': + entry.depth = 0; + } + entry.dirty = true; + }; + + var cloneListProperties = function (target, source) { + target.listType = source.listType; + target.listAttributes = __assign({}, source.listAttributes); + }; + var cleanListProperties = function (entry) { + entry.listAttributes = filter$1(entry.listAttributes, function (_value, key) { + return key !== 'start'; + }); + }; + var closestSiblingEntry = function (entries, start) { + var depth = entries[start].depth; + var matches = function (entry) { + return entry.depth === depth && !entry.dirty; + }; + var until = function (entry) { + return entry.depth < depth; + }; + return findUntil(reverse(entries.slice(0, start)), matches, until).orThunk(function () { + return findUntil(entries.slice(start + 1), matches, until); + }); + }; + var normalizeEntries = function (entries) { + each(entries, function (entry, i) { + closestSiblingEntry(entries, i).fold(function () { + if (entry.dirty) { + cleanListProperties(entry); + } + }, function (matchingEntry) { + return cloneListProperties(entry, matchingEntry); + }); + }); + return entries; + }; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; + }; + + var parseItem = function (depth, itemSelection, selectionState, item) { + return firstChild(item).filter(isList).fold(function () { + itemSelection.each(function (selection) { + if (eq(selection.start, item)) { + selectionState.set(true); + } + }); + var currentItemEntry = createEntry(item, depth, selectionState.get()); + itemSelection.each(function (selection) { + if (eq(selection.end, item)) { + selectionState.set(false); + } + }); + var childListEntries = lastChild(item).filter(isList).map(function (list) { + return parseList(depth, itemSelection, selectionState, list); + }).getOr([]); + return currentItemEntry.toArray().concat(childListEntries); + }, function (list) { + return parseList(depth, itemSelection, selectionState, list); + }); + }; + var parseList = function (depth, itemSelection, selectionState, list) { + return bind(children(list), function (element) { + var parser = isList(element) ? parseList : parseItem; + var newDepth = depth + 1; + return parser(newDepth, itemSelection, selectionState, element); + }); + }; + var parseLists = function (lists, itemSelection) { + var selectionState = Cell(false); + var initialDepth = 0; + return map(lists, function (list) { + return { + sourceList: list, + entries: parseList(initialDepth, itemSelection, selectionState, list) + }; + }); + }; + + var outdentedComposer = function (editor, entries) { + var normalizedEntries = normalizeEntries(entries); + return map(normalizedEntries, function (entry) { + var content = fromElements(entry.content); + return SugarElement.fromDom(createTextBlock(editor, content.dom)); + }); + }; + var indentedComposer = function (editor, entries) { + var normalizedEntries = normalizeEntries(entries); + return composeList(editor.contentDocument, normalizedEntries).toArray(); + }; + var composeEntries = function (editor, entries) { + return bind(groupBy(entries, isIndented), function (entries) { + var groupIsIndented = head(entries).map(isIndented).getOr(false); + return groupIsIndented ? indentedComposer(editor, entries) : outdentedComposer(editor, entries); + }); + }; + var indentSelectedEntries = function (entries, indentation) { + each(filter(entries, isSelected), function (entry) { + return indentEntry(indentation, entry); + }); + }; + var getItemSelection = function (editor) { + var selectedListItems = map(getSelectedListItems(editor), SugarElement.fromDom); + return lift2(find(selectedListItems, not(hasFirstChildList)), find(reverse(selectedListItems), not(hasFirstChildList)), function (start, end) { + return { + start: start, + end: end + }; + }); + }; + var listIndentation = function (editor, lists, indentation) { + var entrySets = parseLists(lists, getItemSelection(editor)); + each(entrySets, function (entrySet) { + indentSelectedEntries(entrySet.entries, indentation); + var composedLists = composeEntries(editor, entrySet.entries); + each(composedLists, function (composedList) { + fireListEvent(editor, indentation === 'Indent' ? 'IndentList' : 'OutdentList', composedList.dom); + }); + before$1(entrySet.sourceList, composedLists); + remove(entrySet.sourceList); + }); + }; + + var selectionIndentation = function (editor, indentation) { + var lists = map(getSelectedListRoots(editor), SugarElement.fromDom); + var dlItems = map(getSelectedDlItems(editor), SugarElement.fromDom); + var isHandled = false; + if (lists.length || dlItems.length) { + var bookmark = editor.selection.getBookmark(); + listIndentation(editor, lists, indentation); + dlIndentation(editor, indentation, dlItems); + editor.selection.moveToBookmark(bookmark); + editor.selection.setRng(normalizeRange(editor.selection.getRng())); + editor.nodeChanged(); + isHandled = true; + } + return isHandled; + }; + var indentListSelection = function (editor) { + return selectionIndentation(editor, 'Indent'); + }; + var outdentListSelection = function (editor) { + return selectionIndentation(editor, 'Outdent'); + }; + var flattenListSelection = function (editor) { + return selectionIndentation(editor, 'Flatten'); + }; + + var global$7 = tinymce.util.Tools.resolve('tinymce.dom.BookmarkManager'); + + var DOM$1 = global$4.DOM; + var createBookmark = function (rng) { + var bookmark = {}; + var setupEndPoint = function (start) { + var offsetNode, container, offset; + container = rng[start ? 'startContainer' : 'endContainer']; + offset = rng[start ? 'startOffset' : 'endOffset']; + if (container.nodeType === 1) { + offsetNode = DOM$1.create('span', { 'data-mce-type': 'bookmark' }); + if (container.hasChildNodes()) { + offset = Math.min(offset, container.childNodes.length - 1); + if (start) { + container.insertBefore(offsetNode, container.childNodes[offset]); + } else { + DOM$1.insertAfter(offsetNode, container.childNodes[offset]); + } + } else { + container.appendChild(offsetNode); + } + container = offsetNode; + offset = 0; + } + bookmark[start ? 'startContainer' : 'endContainer'] = container; + bookmark[start ? 'startOffset' : 'endOffset'] = offset; + }; + setupEndPoint(true); + if (!rng.collapsed) { + setupEndPoint(); + } + return bookmark; + }; + var resolveBookmark = function (bookmark) { + function restoreEndPoint(start) { + var container, offset, node; + var nodeIndex = function (container) { + var node = container.parentNode.firstChild, idx = 0; + while (node) { + if (node === container) { + return idx; + } + if (node.nodeType !== 1 || node.getAttribute('data-mce-type') !== 'bookmark') { + idx++; + } + node = node.nextSibling; + } + return -1; + }; + container = node = bookmark[start ? 'startContainer' : 'endContainer']; + offset = bookmark[start ? 'startOffset' : 'endOffset']; + if (!container) { + return; + } + if (container.nodeType === 1) { + offset = nodeIndex(container); + container = container.parentNode; + DOM$1.remove(node); + if (!container.hasChildNodes() && DOM$1.isBlock(container)) { + container.appendChild(DOM$1.create('br')); + } + } + bookmark[start ? 'startContainer' : 'endContainer'] = container; + bookmark[start ? 'startOffset' : 'endOffset'] = offset; + } + restoreEndPoint(true); + restoreEndPoint(); + var rng = DOM$1.createRng(); + rng.setStart(bookmark.startContainer, bookmark.startOffset); + if (bookmark.endContainer) { + rng.setEnd(bookmark.endContainer, bookmark.endOffset); + } + return normalizeRange(rng); + }; + + var listToggleActionFromListName = function (listName) { + switch (listName) { + case 'UL': + return 'ToggleUlList'; + case 'OL': + return 'ToggleOlList'; + case 'DL': + return 'ToggleDLList'; + } + }; + + var isCustomList = function (list) { + return /\btox\-/.test(list.className); + }; + var listState = function (editor, listName, activate) { + var nodeChangeHandler = function (e) { + var inList = findUntil(e.parents, isListNode, isTableCellNode).filter(function (list) { + return list.nodeName === listName && !isCustomList(list); + }).isSome(); + activate(inList); + }; + var parents = editor.dom.getParents(editor.selection.getNode()); + nodeChangeHandler({ parents: parents }); + editor.on('NodeChange', nodeChangeHandler); + return function () { + return editor.off('NodeChange', nodeChangeHandler); + }; + }; + + var updateListStyle = function (dom, el, detail) { + var type = detail['list-style-type'] ? detail['list-style-type'] : null; + dom.setStyle(el, 'list-style-type', type); + }; + var setAttribs = function (elm, attrs) { + global$5.each(attrs, function (value, key) { + elm.setAttribute(key, value); + }); + }; + var updateListAttrs = function (dom, el, detail) { + setAttribs(el, detail['list-attributes']); + global$5.each(dom.select('li', el), function (li) { + setAttribs(li, detail['list-item-attributes']); + }); + }; + var updateListWithDetails = function (dom, el, detail) { + updateListStyle(dom, el, detail); + updateListAttrs(dom, el, detail); + }; + var removeStyles = function (dom, element, styles) { + global$5.each(styles, function (style) { + var _a; + return dom.setStyle(element, (_a = {}, _a[style] = '', _a)); + }); + }; + var getEndPointNode = function (editor, rng, start, root) { + var container = rng[start ? 'startContainer' : 'endContainer']; + var offset = rng[start ? 'startOffset' : 'endOffset']; + if (container.nodeType === 1) { + container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container; + } + if (!start && isBr(container.nextSibling)) { + container = container.nextSibling; + } + while (container.parentNode !== root) { + if (isTextBlock(editor, container)) { + return container; + } + if (/^(TD|TH)$/.test(container.parentNode.nodeName)) { + return container; + } + container = container.parentNode; + } + return container; + }; + var getSelectedTextBlocks = function (editor, rng, root) { + var textBlocks = [], dom = editor.dom; + var startNode = getEndPointNode(editor, rng, true, root); + var endNode = getEndPointNode(editor, rng, false, root); + var block; + var siblings = []; + for (var node = startNode; node; node = node.nextSibling) { + siblings.push(node); + if (node === endNode) { + break; + } + } + global$5.each(siblings, function (node) { + if (isTextBlock(editor, node)) { + textBlocks.push(node); + block = null; + return; + } + if (dom.isBlock(node) || isBr(node)) { + if (isBr(node)) { + dom.remove(node); + } + block = null; + return; + } + var nextSibling = node.nextSibling; + if (global$7.isBookmarkNode(node)) { + if (isTextBlock(editor, nextSibling) || !nextSibling && node.parentNode === root) { + block = null; + return; + } + } + if (!block) { + block = dom.create('p'); + node.parentNode.insertBefore(block, node); + textBlocks.push(block); + } + block.appendChild(node); + }); + return textBlocks; + }; + var hasCompatibleStyle = function (dom, sib, detail) { + var sibStyle = dom.getStyle(sib, 'list-style-type'); + var detailStyle = detail ? detail['list-style-type'] : ''; + detailStyle = detailStyle === null ? '' : detailStyle; + return sibStyle === detailStyle; + }; + var applyList = function (editor, listName, detail) { + if (detail === void 0) { + detail = {}; + } + var rng = editor.selection.getRng(); + var listItemName = 'LI'; + var root = getClosestListRootElm(editor, editor.selection.getStart(true)); + var dom = editor.dom; + if (dom.getContentEditable(editor.selection.getNode()) === 'false') { + return; + } + listName = listName.toUpperCase(); + if (listName === 'DL') { + listItemName = 'DT'; + } + var bookmark = createBookmark(rng); + global$5.each(getSelectedTextBlocks(editor, rng, root), function (block) { + var listBlock; + var sibling = block.previousSibling; + if (sibling && isListNode(sibling) && sibling.nodeName === listName && hasCompatibleStyle(dom, sibling, detail)) { + listBlock = sibling; + block = dom.rename(block, listItemName); + sibling.appendChild(block); + } else { + listBlock = dom.create(listName); + block.parentNode.insertBefore(listBlock, block); + listBlock.appendChild(block); + block = dom.rename(block, listItemName); + } + removeStyles(dom, block, [ + 'margin', + 'margin-right', + 'margin-bottom', + 'margin-left', + 'margin-top', + 'padding', + 'padding-right', + 'padding-bottom', + 'padding-left', + 'padding-top' + ]); + updateListWithDetails(dom, listBlock, detail); + mergeWithAdjacentLists(editor.dom, listBlock); + }); + editor.selection.setRng(resolveBookmark(bookmark)); + }; + var isValidLists = function (list1, list2) { + return list1 && list2 && isListNode(list1) && list1.nodeName === list2.nodeName; + }; + var hasSameListStyle = function (dom, list1, list2) { + var targetStyle = dom.getStyle(list1, 'list-style-type', true); + var style = dom.getStyle(list2, 'list-style-type', true); + return targetStyle === style; + }; + var hasSameClasses = function (elm1, elm2) { + return elm1.className === elm2.className; + }; + var shouldMerge = function (dom, list1, list2) { + return isValidLists(list1, list2) && hasSameListStyle(dom, list1, list2) && hasSameClasses(list1, list2); + }; + var mergeWithAdjacentLists = function (dom, listBlock) { + var sibling, node; + sibling = listBlock.nextSibling; + if (shouldMerge(dom, listBlock, sibling)) { + while (node = sibling.firstChild) { + listBlock.appendChild(node); + } + dom.remove(sibling); + } + sibling = listBlock.previousSibling; + if (shouldMerge(dom, listBlock, sibling)) { + while (node = sibling.lastChild) { + listBlock.insertBefore(node, listBlock.firstChild); + } + dom.remove(sibling); + } + }; + var updateList = function (editor, list, listName, detail) { + if (list.nodeName !== listName) { + var newList = editor.dom.rename(list, listName); + updateListWithDetails(editor.dom, newList, detail); + fireListEvent(editor, listToggleActionFromListName(listName), newList); + } else { + updateListWithDetails(editor.dom, list, detail); + fireListEvent(editor, listToggleActionFromListName(listName), list); + } + }; + var toggleMultipleLists = function (editor, parentList, lists, listName, detail) { + if (parentList.nodeName === listName && !hasListStyleDetail(detail)) { + flattenListSelection(editor); + } else { + var bookmark = createBookmark(editor.selection.getRng(true)); + global$5.each([parentList].concat(lists), function (elm) { + updateList(editor, elm, listName, detail); + }); + editor.selection.setRng(resolveBookmark(bookmark)); + } + }; + var hasListStyleDetail = function (detail) { + return 'list-style-type' in detail; + }; + var toggleSingleList = function (editor, parentList, listName, detail) { + if (parentList === editor.getBody()) { + return; + } + if (parentList) { + if (parentList.nodeName === listName && !hasListStyleDetail(detail) && !isCustomList(parentList)) { + flattenListSelection(editor); + } else { + var bookmark = createBookmark(editor.selection.getRng(true)); + updateListWithDetails(editor.dom, parentList, detail); + var newList = editor.dom.rename(parentList, listName); + mergeWithAdjacentLists(editor.dom, newList); + editor.selection.setRng(resolveBookmark(bookmark)); + fireListEvent(editor, listToggleActionFromListName(listName), newList); + } + } else { + applyList(editor, listName, detail); + fireListEvent(editor, listToggleActionFromListName(listName), parentList); + } + }; + var toggleList = function (editor, listName, detail) { + var parentList = getParentList(editor); + var selectedSubLists = getSelectedSubLists(editor); + detail = detail ? detail : {}; + if (parentList && selectedSubLists.length > 0) { + toggleMultipleLists(editor, parentList, selectedSubLists, listName, detail); + } else { + toggleSingleList(editor, parentList, listName, detail); + } + }; + + var DOM$2 = global$4.DOM; + var normalizeList = function (dom, ul) { + var sibling; + var parentNode = ul.parentNode; + if (parentNode.nodeName === 'LI' && parentNode.firstChild === ul) { + sibling = parentNode.previousSibling; + if (sibling && sibling.nodeName === 'LI') { + sibling.appendChild(ul); + if (isEmpty(dom, parentNode)) { + DOM$2.remove(parentNode); + } + } else { + DOM$2.setStyle(parentNode, 'listStyleType', 'none'); + } + } + if (isListNode(parentNode)) { + sibling = parentNode.previousSibling; + if (sibling && sibling.nodeName === 'LI') { + sibling.appendChild(ul); + } + } + }; + var normalizeLists = function (dom, element) { + global$5.each(global$5.grep(dom.select('ol,ul', element)), function (ul) { + normalizeList(dom, ul); + }); + }; + + var findNextCaretContainer = function (editor, rng, isForward, root) { + var node = rng.startContainer; + var offset = rng.startOffset; + if (isTextNode(node) && (isForward ? offset < node.data.length : offset > 0)) { + return node; + } + var nonEmptyBlocks = editor.schema.getNonEmptyElements(); + if (node.nodeType === 1) { + node = global$1.getNode(node, offset); + } + var walker = new global$2(node, root); + if (isForward) { + if (isBogusBr(editor.dom, node)) { + walker.next(); + } + } + while (node = walker[isForward ? 'next' : 'prev2']()) { + if (node.nodeName === 'LI' && !node.hasChildNodes()) { + return node; + } + if (nonEmptyBlocks[node.nodeName]) { + return node; + } + if (isTextNode(node) && node.data.length > 0) { + return node; + } + } + }; + var hasOnlyOneBlockChild = function (dom, elm) { + var childNodes = elm.childNodes; + return childNodes.length === 1 && !isListNode(childNodes[0]) && dom.isBlock(childNodes[0]); + }; + var unwrapSingleBlockChild = function (dom, elm) { + if (hasOnlyOneBlockChild(dom, elm)) { + dom.remove(elm.firstChild, true); + } + }; + var moveChildren = function (dom, fromElm, toElm) { + var node; + var targetElm = hasOnlyOneBlockChild(dom, toElm) ? toElm.firstChild : toElm; + unwrapSingleBlockChild(dom, fromElm); + if (!isEmpty(dom, fromElm, true)) { + while (node = fromElm.firstChild) { + targetElm.appendChild(node); + } + } + }; + var mergeLiElements = function (dom, fromElm, toElm) { + var listNode; + var ul = fromElm.parentNode; + if (!isChildOfBody(dom, fromElm) || !isChildOfBody(dom, toElm)) { + return; + } + if (isListNode(toElm.lastChild)) { + listNode = toElm.lastChild; + } + if (ul === toElm.lastChild) { + if (isBr(ul.previousSibling)) { + dom.remove(ul.previousSibling); + } + } + var node = toElm.lastChild; + if (node && isBr(node) && fromElm.hasChildNodes()) { + dom.remove(node); + } + if (isEmpty(dom, toElm, true)) { + dom.$(toElm).empty(); + } + moveChildren(dom, fromElm, toElm); + if (listNode) { + toElm.appendChild(listNode); + } + var contains = contains$1(SugarElement.fromDom(toElm), SugarElement.fromDom(fromElm)); + var nestedLists = contains ? dom.getParents(fromElm, isListNode, toElm) : []; + dom.remove(fromElm); + each(nestedLists, function (list) { + if (isEmpty(dom, list) && list !== dom.getRoot()) { + dom.remove(list); + } + }); + }; + var mergeIntoEmptyLi = function (editor, fromLi, toLi) { + editor.dom.$(toLi).empty(); + mergeLiElements(editor.dom, fromLi, toLi); + editor.selection.setCursorLocation(toLi); + }; + var mergeForward = function (editor, rng, fromLi, toLi) { + var dom = editor.dom; + if (dom.isEmpty(toLi)) { + mergeIntoEmptyLi(editor, fromLi, toLi); + } else { + var bookmark = createBookmark(rng); + mergeLiElements(dom, fromLi, toLi); + editor.selection.setRng(resolveBookmark(bookmark)); + } + }; + var mergeBackward = function (editor, rng, fromLi, toLi) { + var bookmark = createBookmark(rng); + mergeLiElements(editor.dom, fromLi, toLi); + var resolvedBookmark = resolveBookmark(bookmark); + editor.selection.setRng(resolvedBookmark); + }; + var backspaceDeleteFromListToListCaret = function (editor, isForward) { + var dom = editor.dom, selection = editor.selection; + var selectionStartElm = selection.getStart(); + var root = getClosestListRootElm(editor, selectionStartElm); + var li = dom.getParent(selection.getStart(), 'LI', root); + if (li) { + var ul = li.parentNode; + if (ul === editor.getBody() && isEmpty(dom, ul)) { + return true; + } + var rng_1 = normalizeRange(selection.getRng()); + var otherLi_1 = dom.getParent(findNextCaretContainer(editor, rng_1, isForward, root), 'LI', root); + if (otherLi_1 && otherLi_1 !== li) { + editor.undoManager.transact(function () { + if (isForward) { + mergeForward(editor, rng_1, otherLi_1, li); + } else { + if (isFirstChild(li)) { + outdentListSelection(editor); + } else { + mergeBackward(editor, rng_1, li, otherLi_1); + } + } + }); + return true; + } else if (!otherLi_1) { + if (!isForward && rng_1.startOffset === 0 && rng_1.endOffset === 0) { + editor.undoManager.transact(function () { + flattenListSelection(editor); + }); + return true; + } + } + } + return false; + }; + var removeBlock = function (dom, block, root) { + var parentBlock = dom.getParent(block.parentNode, dom.isBlock, root); + dom.remove(block); + if (parentBlock && dom.isEmpty(parentBlock)) { + dom.remove(parentBlock); + } + }; + var backspaceDeleteIntoListCaret = function (editor, isForward) { + var dom = editor.dom; + var selectionStartElm = editor.selection.getStart(); + var root = getClosestListRootElm(editor, selectionStartElm); + var block = dom.getParent(selectionStartElm, dom.isBlock, root); + if (block && dom.isEmpty(block)) { + var rng = normalizeRange(editor.selection.getRng()); + var otherLi_2 = dom.getParent(findNextCaretContainer(editor, rng, isForward, root), 'LI', root); + if (otherLi_2) { + editor.undoManager.transact(function () { + removeBlock(dom, block, root); + mergeWithAdjacentLists(dom, otherLi_2.parentNode); + editor.selection.select(otherLi_2, true); + editor.selection.collapse(isForward); + }); + return true; + } + } + return false; + }; + var backspaceDeleteCaret = function (editor, isForward) { + return backspaceDeleteFromListToListCaret(editor, isForward) || backspaceDeleteIntoListCaret(editor, isForward); + }; + var backspaceDeleteRange = function (editor) { + var selectionStartElm = editor.selection.getStart(); + var root = getClosestListRootElm(editor, selectionStartElm); + var startListParent = editor.dom.getParent(selectionStartElm, 'LI,DT,DD', root); + if (startListParent || getSelectedListItems(editor).length > 0) { + editor.undoManager.transact(function () { + editor.execCommand('Delete'); + normalizeLists(editor.dom, editor.getBody()); + }); + return true; + } + return false; + }; + var backspaceDelete = function (editor, isForward) { + return editor.selection.isCollapsed() ? backspaceDeleteCaret(editor, isForward) : backspaceDeleteRange(editor); + }; + var setup = function (editor) { + editor.on('keydown', function (e) { + if (e.keyCode === global$3.BACKSPACE) { + if (backspaceDelete(editor, false)) { + e.preventDefault(); + } + } else if (e.keyCode === global$3.DELETE) { + if (backspaceDelete(editor, true)) { + e.preventDefault(); + } + } + }); + }; + + var get = function (editor) { + return { + backspaceDelete: function (isForward) { + backspaceDelete(editor, isForward); + } + }; + }; + + var open = function (editor) { + var dom = editor.dom; + var currentList = getParentList(editor); + if (!isOlNode(currentList)) { + return; + } + editor.windowManager.open({ + title: 'List Properties', + body: { + type: 'panel', + items: [{ + type: 'input', + name: 'start', + label: 'Start list at number', + inputMode: 'numeric' + }] + }, + initialData: { start: dom.getAttrib(currentList, 'start') || '1' }, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + onSubmit: function (api) { + var data = api.getData(); + editor.undoManager.transact(function () { + dom.setAttrib(getParentList(editor), 'start', data.start === '1' ? '' : data.start); + }); + api.close(); + } + }); + }; + + var queryListCommandState = function (editor, listName) { + return function () { + var parentList = editor.dom.getParent(editor.selection.getStart(), 'UL,OL,DL'); + return parentList && parentList.nodeName === listName; + }; + }; + var register = function (editor) { + editor.on('BeforeExecCommand', function (e) { + var cmd = e.command.toLowerCase(); + if (cmd === 'indent') { + indentListSelection(editor); + } else if (cmd === 'outdent') { + outdentListSelection(editor); + } + }); + editor.addCommand('InsertUnorderedList', function (ui, detail) { + toggleList(editor, 'UL', detail); + }); + editor.addCommand('InsertOrderedList', function (ui, detail) { + toggleList(editor, 'OL', detail); + }); + editor.addCommand('InsertDefinitionList', function (ui, detail) { + toggleList(editor, 'DL', detail); + }); + editor.addCommand('RemoveList', function () { + flattenListSelection(editor); + }); + editor.addCommand('mceListProps', function () { + open(editor); + }); + editor.addQueryStateHandler('InsertUnorderedList', queryListCommandState(editor, 'UL')); + editor.addQueryStateHandler('InsertOrderedList', queryListCommandState(editor, 'OL')); + editor.addQueryStateHandler('InsertDefinitionList', queryListCommandState(editor, 'DL')); + }; + + var setupTabKey = function (editor) { + editor.on('keydown', function (e) { + if (e.keyCode !== global$3.TAB || global$3.metaKeyPressed(e)) { + return; + } + editor.undoManager.transact(function () { + if (e.shiftKey ? outdentListSelection(editor) : indentListSelection(editor)) { + e.preventDefault(); + } + }); + }); + }; + var setup$1 = function (editor) { + if (shouldIndentOnTab(editor)) { + setupTabKey(editor); + } + setup(editor); + }; + + var register$1 = function (editor) { + var exec = function (command) { + return function () { + return editor.execCommand(command); + }; + }; + if (!editor.hasPlugin('advlist')) { + editor.ui.registry.addToggleButton('numlist', { + icon: 'ordered-list', + active: false, + tooltip: 'Numbered list', + onAction: exec('InsertOrderedList'), + onSetup: function (api) { + return listState(editor, 'OL', api.setActive); + } + }); + editor.ui.registry.addToggleButton('bullist', { + icon: 'unordered-list', + active: false, + tooltip: 'Bullet list', + onAction: exec('InsertUnorderedList'), + onSetup: function (api) { + return listState(editor, 'UL', api.setActive); + } + }); + } + }; + + var register$2 = function (editor) { + var listProperties = { + text: 'List properties...', + icon: 'ordered-list', + onAction: function () { + return open(editor); + }, + onSetup: function (api) { + return listState(editor, 'OL', function (active) { + return api.setDisabled(!active); + }); + } + }; + editor.ui.registry.addMenuItem('listprops', listProperties); + editor.ui.registry.addContextMenu('lists', { + update: function (node) { + var parentList = getParentList(editor, node); + return isOlNode(parentList) ? ['listprops'] : []; + } + }); + }; + + function Plugin () { + global.add('lists', function (editor) { + if (editor.hasPlugin('rtc', true) === false) { + setup$1(editor); + register(editor); + } + register$1(editor); + register$2(editor); + return get(editor); + }); + } + + Plugin(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/lists/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/lists/plugin.min.js index 439155306102..01a36ea7eafb 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/lists/plugin.min.js +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/lists/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("lists",function(e){function t(e){return e&&/^(OL|UL)$/.test(e.nodeName)}function n(e){return e.parentNode.firstChild==e}function r(e){return e.parentNode.lastChild==e}function o(t){return t&&!!e.schema.getTextBlockElements()[t.nodeName]}function i(e){return e&&"SPAN"===e.nodeName&&"bookmark"===e.getAttribute("data-mce-type")}var a=this;e.on("init",function(){function d(e){function t(t){var r,o,i;o=e[t?"startContainer":"endContainer"],i=e[t?"startOffset":"endOffset"],1==o.nodeType&&(r=b.create("span",{"data-mce-type":"bookmark"}),o.hasChildNodes()?(i=Math.min(i,o.childNodes.length-1),t?o.insertBefore(r,o.childNodes[i]):b.insertAfter(r,o.childNodes[i])):o.appendChild(r),o=r,i=0),n[t?"startContainer":"endContainer"]=o,n[t?"startOffset":"endOffset"]=i}var n={};return t(!0),e.collapsed||t(),n}function s(e){function t(t){function n(e){for(var t=e.parentNode.firstChild,n=0;t;){if(t==e)return n;(1!=t.nodeType||"bookmark"!=t.getAttribute("data-mce-type"))&&n++,t=t.nextSibling}return-1}var r,o,i;r=i=e[t?"startContainer":"endContainer"],o=e[t?"startOffset":"endOffset"],r&&(1==r.nodeType&&(o=n(r),r=r.parentNode,b.remove(i)),e[t?"startContainer":"endContainer"]=r,e[t?"startOffset":"endOffset"]=o)}t(!0),t();var n=b.createRng();n.setStart(e.startContainer,e.startOffset),e.endContainer&&n.setEnd(e.endContainer,e.endOffset),L.setRng(n)}function f(t,n){var r,o,i,a=b.createFragment(),d=e.schema.getBlockElements();if(e.settings.forced_root_block&&(n=n||e.settings.forced_root_block),n&&(o=b.create(n),o.tagName===e.settings.forced_root_block&&b.setAttribs(o,e.settings.forced_root_block_attrs),a.appendChild(o)),t)for(;r=t.firstChild;){var s=r.nodeName;i||"SPAN"==s&&"bookmark"==r.getAttribute("data-mce-type")||(i=!0),d[s]?(a.appendChild(r),o=null):n?(o||(o=b.create(n),a.appendChild(o)),o.appendChild(r)):a.appendChild(r)}return e.settings.forced_root_block?i||tinymce.Env.ie&&!(tinymce.Env.ie>10)||o.appendChild(b.create("br",{"data-mce-bogus":"1"})):a.appendChild(b.create("br")),a}function l(){return tinymce.grep(L.getSelectedBlocks(),function(e){return"LI"==e.nodeName})}function c(e,t,n){var r,o,i=b.select('span[data-mce-type="bookmark"]',e);n=n||f(t),r=b.createRng(),r.setStartAfter(t),r.setEndAfter(e),o=r.extractContents(),b.isEmpty(o)||b.insertAfter(o,e),b.insertAfter(n,e),b.isEmpty(t.parentNode)&&(tinymce.each(i,function(e){t.parentNode.parentNode.insertBefore(e,t.parentNode)}),b.remove(t.parentNode)),b.remove(t)}function p(e){var n,r;if(n=e.nextSibling,n&&t(n)&&n.nodeName==e.nodeName){for(;r=n.firstChild;)e.appendChild(r);b.remove(n)}if(n=e.previousSibling,n&&t(n)&&n.nodeName==e.nodeName){for(;r=n.firstChild;)e.insertBefore(r,e.firstChild);b.remove(n)}}function u(e){tinymce.each(tinymce.grep(b.select("ol,ul",e)),function(e){var n,r=e.parentNode;"LI"==r.nodeName&&r.firstChild==e&&(n=r.previousSibling,n&&"LI"==n.nodeName&&(n.appendChild(e),b.isEmpty(r)&&b.remove(r))),t(r)&&(n=r.previousSibling,n&&"LI"==n.nodeName&&n.appendChild(e))})}function m(e){function o(e){b.isEmpty(e)&&b.remove(e)}var i,a=e.parentNode,d=a.parentNode;return n(e)&&r(e)?("LI"==d.nodeName?(b.insertAfter(e,d),o(d),b.remove(a)):t(d)?b.remove(a,!0):(d.insertBefore(f(e),a),b.remove(a)),!0):n(e)?("LI"==d.nodeName?(b.insertAfter(e,d),e.appendChild(a),o(d)):t(d)?d.insertBefore(e,a):(d.insertBefore(f(e),a),b.remove(e)),!0):r(e)?("LI"==d.nodeName?b.insertAfter(e,d):t(d)?b.insertAfter(e,a):(b.insertAfter(f(e),a),b.remove(e)),!0):("LI"==d.nodeName?(a=d,i=f(e,"LI")):i=t(d)?f(e,"LI"):f(e),c(a,e,i),u(a.parentNode),!0)}function h(e){function n(n,r){var o;if(t(n)){for(;o=e.lastChild.firstChild;)r.appendChild(o);b.remove(n)}}var r,o;return r=e.previousSibling,r&&t(r)?(r.appendChild(e),!0):r&&"LI"==r.nodeName&&t(r.lastChild)?(r.lastChild.appendChild(e),n(e.lastChild,r.lastChild),!0):(r=e.nextSibling,r&&t(r)?(r.insertBefore(e,r.firstChild),!0):r&&"LI"==r.nodeName&&t(e.lastChild)?!1:(r=e.previousSibling,r&&"LI"==r.nodeName?(o=b.create(e.parentNode.nodeName),r.appendChild(o),o.appendChild(e),n(e.lastChild,o),!0):!1))}function v(){var t=l();if(t.length){for(var n=d(L.getRng(!0)),r=0;r0))return n;for(var o=new tinymce.dom.TreeWalker(e.startContainer);n=o[t?"next":"prev"]();)if(3==n.nodeType&&n.data.length>0)return n}function r(e,n){var r,o,i=e.parentNode;for(t(n.lastChild)&&(o=n.lastChild),r=n.lastChild,r&&"BR"==r.nodeName&&e.hasChildNodes()&&b.remove(r);r=e.firstChild;)n.appendChild(r);o&&n.appendChild(o),b.remove(e),b.isEmpty(i)&&b.remove(i)}if(L.isCollapsed()){var o=b.getParent(L.getStart(),"LI");if(o){var i=L.getRng(!0),a=b.getParent(n(i,e),"LI");if(a&&a!=o){var f=d(i);return e?r(a,o):r(o,a),s(f),!0}if(!a&&!e&&N(o.parentNode.nodeName))return!0}}},e.addCommand("Indent",function(){return v()?void 0:!0}),e.addCommand("Outdent",function(){return C()?void 0:!0}),e.addCommand("InsertUnorderedList",function(){y("UL")}),e.addCommand("InsertOrderedList",function(){y("OL")}),e.on("keydown",function(t){9==t.keyCode&&e.dom.getParent(e.selection.getStart(),"LI")&&(t.preventDefault(),t.shiftKey?C():v())})}),e.addButton("indent",{icon:"indent",title:"Increase indent",cmd:"Indent",onPostRender:function(){var t=this;e.on("nodechange",function(){var r=e.dom.getParent(e.selection.getNode(),"LI,UL,OL");t.disabled(r&&("LI"!=r.nodeName||n(r)))})}}),e.on("keydown",function(e){e.keyCode==tinymce.util.VK.BACKSPACE?a.backspaceDelete()&&e.preventDefault():e.keyCode==tinymce.util.VK.DELETE&&a.backspaceDelete(!0)&&e.preventDefault()})}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var e,n,t,r,o,i,u,a=tinymce.util.Tools.resolve("tinymce.PluginManager"),s=function(){},y=function(e){return function(){return e}},c=function(n){return function(e){return!n(e)}},f=y(!1),d=y(!0),l=function(){return m},m=(e=function(e){return e.isNone()},{fold:function(e,n){return e()},is:f,isSome:f,isNone:d,getOr:t=function(e){return e},getOrThunk:n=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:y(null),getOrUndefined:y(undefined),or:t,orThunk:n,map:l,each:s,bind:l,exists:f,forall:d,filter:l,equals:e,equals_:e,toArray:function(){return[]},toString:y("none()")}),p=function(t){var e=y(t),n=function(){return o},r=function(e){return e(t)},o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:d,isNone:f,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:n,orThunk:n,map:function(e){return p(e(t))},each:function(e){e(t)},bind:r,exists:r,forall:r,filter:function(e){return e(t)?o:m},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(f,function(e){return n(t,e)})}};return o},g={some:p,none:l,from:function(e){return null===e||e===undefined?m:p(e)}},v=function(r){return function(e){return t=typeof(n=e),(null===n?"null":"object"==t&&(Array.prototype.isPrototypeOf(n)||n.constructor&&"Array"===n.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(n)||n.constructor&&"String"===n.constructor.name)?"string":t)===r;var n,t}},h=function(n){return function(e){return typeof e===n}},S=v("string"),b=v("array"),C=h("boolean"),O=h("function"),N=h("number"),L=Array.prototype.slice,T=Array.prototype.push,D=function(e,n){for(var t=e.length,r=new Array(t),o=0;o=e.childNodes.length?t.data.length:0}:t.previousSibling&&je(t.previousSibling)?{container:t.previousSibling,offset:t.previousSibling.data.length}:t.nextSibling&&je(t.nextSibling)?{container:t.nextSibling,offset:0}:{container:e,offset:n}},un=function(e){var n=e.cloneRange(),t=on(e.startContainer,e.startOffset);n.setStart(t.container,t.offset);var r=on(e.endContainer,e.endOffset);return n.setEnd(r.container,r.offset),n},an=tinymce.util.Tools.resolve("tinymce.dom.DomQuery"),sn=function(e,n){var t=n||e.selection.getStart(!0);return e.dom.getParent(t,"OL,UL,DL",dn(e,t))},cn=function(e){var n,t,r,o=sn(e),i=e.selection.getSelectedBlocks();return r=i,(t=o)&&1===r.length&&r[0]===t?(n=o,Fe.grep(n.querySelectorAll("ol,ul,dl"),function(e){return qe(e)})):Fe.grep(i,function(e){return qe(e)&&o!==e})},fn=function(e){var t,n,r,o=e.selection.getSelectedBlocks();return Fe.grep((t=e,n=o,r=Fe.map(n,function(e){var n=t.dom.getParent(e,"li,dd,dt",dn(t,e));return n||e}),an.unique(r)),function(e){return We(e)})},dn=function(e,n){var t=e.dom.getParents(n,"TD,TH");return 0e.length?On:Cn)(t,e,n)},[]),I(r).map(function(e){return e.list}).toArray()},In=function(a,e,s){var n,t=En(e,(n=D(fn(a),le.fromDom),gn(E(n,c(Ln)),E(B(n),c(Ln)),function(e,n){return{start:e,end:n}})));k(t,function(e){var n,t;n=e.entries,t=s,k(w(n,Dn),function(e){return function(e,n){switch(e){case"Indent":n.depth++;break;case"Outdent":n.depth--;break;case"Flatten":n.depth=0}n.dirty=!0}(t,e),0});var r,o,i,u=(r=a,o=e.entries,P(function(e,n){if(0===e.length)return[];for(var t=n(e[0]),r=[],o=[],i=0,u=e.length;i 1) { + return protocolMatches[1] === 'www.' ? 'https://' : protocolMatches[1]; + } else { + return 'https://'; + } + }; + var getUrl = function (pattern, url) { + var protocol = getProtocol(url); + var match = pattern.regex.exec(url); + var newUrl = protocol + pattern.url; + var _loop_1 = function (i) { + newUrl = newUrl.replace('$' + i, function () { + return match[i] ? match[i] : ''; + }); + }; + for (var i = 0; i < match.length; i++) { + _loop_1(i); + } + return newUrl.replace(/\?$/, ''); + }; + var matchPattern = function (url) { + var patterns = urlPatterns.filter(function (pattern) { + return pattern.regex.test(url); + }); + if (patterns.length > 0) { + return global$1.extend({}, patterns[0], { url: getUrl(patterns[0], url) }); + } else { + return null; + } + }; + + var getIframeHtml = function (data) { + var allowFullscreen = data.allowFullscreen ? ' allowFullscreen="1"' : ''; + return ''; + }; + var getFlashHtml = function (data) { + var html = ''; + if (data.poster) { + html += ''; + } + html += ''; + return html; + }; + var getAudioHtml = function (data, audioTemplateCallback) { + if (audioTemplateCallback) { + return audioTemplateCallback(data); + } else { + return ''; + } + }; + var getVideoHtml = function (data, videoTemplateCallback) { + if (videoTemplateCallback) { + return videoTemplateCallback(data); + } else { + return ''; + } + }; + var getScriptHtml = function (data) { + return ''; + }; + var dataToHtml = function (editor, dataIn) { + var data = global$1.extend({}, dataIn); + if (!data.source) { + global$1.extend(data, htmlToData(getScripts(editor), data.embed)); + if (!data.source) { + return ''; + } + } + if (!data.altsource) { + data.altsource = ''; + } + if (!data.poster) { + data.poster = ''; + } + data.source = editor.convertURL(data.source, 'source'); + data.altsource = editor.convertURL(data.altsource, 'source'); + data.sourcemime = guess(data.source); + data.altsourcemime = guess(data.altsource); + data.poster = editor.convertURL(data.poster, 'poster'); + var pattern = matchPattern(data.source); + if (pattern) { + data.source = pattern.url; + data.type = pattern.type; + data.allowFullscreen = pattern.allowFullscreen; + data.width = data.width || String(pattern.w); + data.height = data.height || String(pattern.h); + } + if (data.embed) { + return updateHtml(data.embed, data, true); + } else { + var videoScript = getVideoScriptMatch(getScripts(editor), data.source); + if (videoScript) { + data.type = 'script'; + data.width = String(videoScript.width); + data.height = String(videoScript.height); + } + var audioTemplateCallback = getAudioTemplateCallback(editor); + var videoTemplateCallback = getVideoTemplateCallback(editor); + data.width = data.width || '300'; + data.height = data.height || '150'; + global$1.each(data, function (value, key) { + data[key] = editor.dom.encode('' + value); + }); + if (data.type === 'iframe') { + return getIframeHtml(data); + } else if (data.sourcemime === 'application/x-shockwave-flash') { + return getFlashHtml(data); + } else if (data.sourcemime.indexOf('audio') !== -1) { + return getAudioHtml(data, audioTemplateCallback); + } else if (data.type === 'script') { + return getScriptHtml(data); + } else { + return getVideoHtml(data, videoTemplateCallback); + } + } + }; + + var global$6 = tinymce.util.Tools.resolve('tinymce.util.Promise'); + + var cache = {}; + var embedPromise = function (data, dataToHtml, handler) { + return new global$6(function (res, rej) { + var wrappedResolve = function (response) { + if (response.html) { + cache[data.source] = response; + } + return res({ + url: data.source, + html: response.html ? response.html : dataToHtml(data) + }); + }; + if (cache[data.source]) { + wrappedResolve(cache[data.source]); + } else { + handler({ url: data.source }, wrappedResolve, rej); + } + }); + }; + var defaultPromise = function (data, dataToHtml) { + return new global$6(function (res) { + res({ + html: dataToHtml(data), + url: data.source + }); + }); + }; + var loadedData = function (editor) { + return function (data) { + return dataToHtml(editor, data); + }; + }; + var getEmbedHtml = function (editor, data) { + var embedHandler = getUrlResolver(editor); + return embedHandler ? embedPromise(data, loadedData(editor), embedHandler) : defaultPromise(data, loadedData(editor)); + }; + var isCached = function (url) { + return cache.hasOwnProperty(url); + }; + + var extractMeta = function (sourceInput, data) { + return get(data, sourceInput).bind(function (mainData) { + return get(mainData, 'meta'); + }); + }; + var getValue = function (data, metaData, sourceInput) { + return function (prop) { + var _a; + var getFromData = function () { + return get(data, prop); + }; + var getFromMetaData = function () { + return get(metaData, prop); + }; + var getNonEmptyValue = function (c) { + return get(c, 'value').bind(function (v) { + return v.length > 0 ? Optional.some(v) : Optional.none(); + }); + }; + var getFromValueFirst = function () { + return getFromData().bind(function (child) { + return isObject(child) ? getNonEmptyValue(child).orThunk(getFromMetaData) : getFromMetaData().orThunk(function () { + return Optional.from(child); + }); + }); + }; + var getFromMetaFirst = function () { + return getFromMetaData().orThunk(function () { + return getFromData().bind(function (child) { + return isObject(child) ? getNonEmptyValue(child) : Optional.from(child); + }); + }); + }; + return _a = {}, _a[prop] = (prop === sourceInput ? getFromValueFirst() : getFromMetaFirst()).getOr(''), _a; + }; + }; + var getDimensions = function (data, metaData) { + var dimensions = {}; + get(data, 'dimensions').each(function (dims) { + each([ + 'width', + 'height' + ], function (prop) { + get(metaData, prop).orThunk(function () { + return get(dims, prop); + }).each(function (value) { + return dimensions[prop] = value; + }); + }); + }); + return dimensions; + }; + var unwrap = function (data, sourceInput) { + var metaData = sourceInput ? extractMeta(sourceInput, data).getOr({}) : {}; + var get = getValue(data, metaData, sourceInput); + return __assign(__assign(__assign(__assign(__assign({}, get('source')), get('altsource')), get('poster')), get('embed')), getDimensions(data, metaData)); + }; + var wrap = function (data) { + var wrapped = __assign(__assign({}, data), { + source: { value: get(data, 'source').getOr('') }, + altsource: { value: get(data, 'altsource').getOr('') }, + poster: { value: get(data, 'poster').getOr('') } + }); + each([ + 'width', + 'height' + ], function (prop) { + get(data, prop).each(function (value) { + var dimensions = wrapped.dimensions || {}; + dimensions[prop] = value; + wrapped.dimensions = dimensions; + }); + }); + return wrapped; + }; + var handleError = function (editor) { + return function (error) { + var errorMessage = error && error.msg ? 'Media embed handler error: ' + error.msg : 'Media embed handler threw unknown error.'; + editor.notificationManager.open({ + type: 'error', + text: errorMessage + }); + }; + }; + var snippetToData = function (editor, embedSnippet) { + return htmlToData(getScripts(editor), embedSnippet); + }; + var isMediaElement = function (element) { + return element.getAttribute('data-mce-object') || element.getAttribute('data-ephox-embed-iri'); + }; + var getEditorData = function (editor) { + var element = editor.selection.getNode(); + var snippet = isMediaElement(element) ? editor.serializer.serialize(element, { selection: true }) : ''; + return __assign({ embed: snippet }, htmlToData(getScripts(editor), snippet)); + }; + var addEmbedHtml = function (api, editor) { + return function (response) { + if (isString(response.url) && response.url.trim().length > 0) { + var html = response.html; + var snippetData = snippetToData(editor, html); + var nuData = __assign(__assign({}, snippetData), { + source: response.url, + embed: html + }); + api.setData(wrap(nuData)); + } + }; + }; + var selectPlaceholder = function (editor, beforeObjects) { + var afterObjects = editor.dom.select('img[data-mce-object]'); + for (var i = 0; i < beforeObjects.length; i++) { + for (var y = afterObjects.length - 1; y >= 0; y--) { + if (beforeObjects[i] === afterObjects[y]) { + afterObjects.splice(y, 1); + } + } + } + editor.selection.select(afterObjects[0]); + }; + var handleInsert = function (editor, html) { + var beforeObjects = editor.dom.select('img[data-mce-object]'); + editor.insertContent(html); + selectPlaceholder(editor, beforeObjects); + editor.nodeChanged(); + }; + var submitForm = function (prevData, newData, editor) { + newData.embed = updateHtml(newData.embed, newData); + if (newData.embed && (prevData.source === newData.source || isCached(newData.source))) { + handleInsert(editor, newData.embed); + } else { + getEmbedHtml(editor, newData).then(function (response) { + handleInsert(editor, response.html); + }).catch(handleError(editor)); + } + }; + var showDialog = function (editor) { + var editorData = getEditorData(editor); + var currentData = Cell(editorData); + var initialData = wrap(editorData); + var handleSource = function (prevData, api) { + var serviceData = unwrap(api.getData(), 'source'); + if (prevData.source !== serviceData.source) { + addEmbedHtml(win, editor)({ + url: serviceData.source, + html: '' + }); + getEmbedHtml(editor, serviceData).then(addEmbedHtml(win, editor)).catch(handleError(editor)); + } + }; + var handleEmbed = function (api) { + var data = unwrap(api.getData()); + var dataFromEmbed = snippetToData(editor, data.embed); + api.setData(wrap(dataFromEmbed)); + }; + var handleUpdate = function (api, sourceInput) { + var data = unwrap(api.getData(), sourceInput); + var embed = dataToHtml(editor, data); + api.setData(wrap(__assign(__assign({}, data), { embed: embed }))); + }; + var mediaInput = [{ + name: 'source', + type: 'urlinput', + filetype: 'media', + label: 'Source' + }]; + var sizeInput = !hasDimensions(editor) ? [] : [{ + type: 'sizeinput', + name: 'dimensions', + label: 'Constrain proportions', + constrain: true + }]; + var generalTab = { + title: 'General', + name: 'general', + items: flatten([ + mediaInput, + sizeInput + ]) + }; + var embedTextarea = { + type: 'textarea', + name: 'embed', + label: 'Paste your embed code below:' + }; + var embedTab = { + title: 'Embed', + items: [embedTextarea] + }; + var advancedFormItems = []; + if (hasAltSource(editor)) { + advancedFormItems.push({ + name: 'altsource', + type: 'urlinput', + filetype: 'media', + label: 'Alternative source URL' + }); + } + if (hasPoster(editor)) { + advancedFormItems.push({ + name: 'poster', + type: 'urlinput', + filetype: 'image', + label: 'Media poster (Image URL)' + }); + } + var advancedTab = { + title: 'Advanced', + name: 'advanced', + items: advancedFormItems + }; + var tabs = [ + generalTab, + embedTab + ]; + if (advancedFormItems.length > 0) { + tabs.push(advancedTab); + } + var body = { + type: 'tabpanel', + tabs: tabs + }; + var win = editor.windowManager.open({ + title: 'Insert/Edit Media', + size: 'normal', + body: body, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + onSubmit: function (api) { + var serviceData = unwrap(api.getData()); + submitForm(currentData.get(), serviceData, editor); + api.close(); + }, + onChange: function (api, detail) { + switch (detail.name) { + case 'source': + handleSource(currentData.get(), api); + break; + case 'embed': + handleEmbed(api); + break; + case 'dimensions': + case 'altsource': + case 'poster': + handleUpdate(api, detail.name); + break; + } + currentData.set(unwrap(api.getData())); + }, + initialData: initialData + }); + }; + + var get$1 = function (editor) { + var showDialog$1 = function () { + showDialog(editor); + }; + return { showDialog: showDialog$1 }; + }; + + var register = function (editor) { + var showDialog$1 = function () { + showDialog(editor); + }; + editor.addCommand('mceMedia', showDialog$1); + }; + + var global$7 = tinymce.util.Tools.resolve('tinymce.html.Node'); + + var global$8 = tinymce.util.Tools.resolve('tinymce.Env'); + + var sanitize = function (editor, html) { + if (shouldFilterHtml(editor) === false) { + return html; + } + var writer = global$5(); + var blocked; + global$3({ + validate: false, + allow_conditional_comments: false, + comment: function (text) { + writer.comment(text); + }, + cdata: function (text) { + writer.cdata(text); + }, + text: function (text, raw) { + writer.text(text, raw); + }, + start: function (name, attrs, empty) { + blocked = true; + if (name === 'script' || name === 'noscript' || name === 'svg') { + return; + } + for (var i = attrs.length - 1; i >= 0; i--) { + var attrName = attrs[i].name; + if (attrName.indexOf('on') === 0) { + delete attrs.map[attrName]; + attrs.splice(i, 1); + } + if (attrName === 'style') { + attrs[i].value = editor.dom.serializeStyle(editor.dom.parseStyle(attrs[i].value), name); + } + } + writer.start(name, attrs, empty); + blocked = false; + }, + end: function (name) { + if (blocked) { + return; + } + writer.end(name); + } + }, global$4({})).parse(html); + return writer.getContent(); + }; + + var createPlaceholderNode = function (editor, node) { + var name = node.name; + var placeHolder = new global$7('img', 1); + placeHolder.shortEnded = true; + retainAttributesAndInnerHtml(editor, node, placeHolder); + placeHolder.attr({ + 'width': node.attr('width') || '300', + 'height': node.attr('height') || (name === 'audio' ? '30' : '150'), + 'style': node.attr('style'), + 'src': global$8.transparentSrc, + 'data-mce-object': name, + 'class': 'mce-object mce-object-' + name + }); + return placeHolder; + }; + var createPreviewIframeNode = function (editor, node) { + var name = node.name; + var previewWrapper = new global$7('span', 1); + previewWrapper.attr({ + 'contentEditable': 'false', + 'style': node.attr('style'), + 'data-mce-object': name, + 'class': 'mce-preview-object mce-object-' + name + }); + retainAttributesAndInnerHtml(editor, node, previewWrapper); + var previewNode = new global$7(name, 1); + previewNode.attr({ + src: node.attr('src'), + allowfullscreen: node.attr('allowfullscreen'), + style: node.attr('style'), + class: node.attr('class'), + width: node.attr('width'), + height: node.attr('height'), + frameborder: '0' + }); + var shimNode = new global$7('span', 1); + shimNode.attr('class', 'mce-shim'); + previewWrapper.append(previewNode); + previewWrapper.append(shimNode); + return previewWrapper; + }; + var retainAttributesAndInnerHtml = function (editor, sourceNode, targetNode) { + var attrName; + var attrValue; + var ai; + var attribs = sourceNode.attributes; + ai = attribs.length; + while (ai--) { + attrName = attribs[ai].name; + attrValue = attribs[ai].value; + if (attrName !== 'width' && attrName !== 'height' && attrName !== 'style') { + if (attrName === 'data' || attrName === 'src') { + attrValue = editor.convertURL(attrValue, attrName); + } + targetNode.attr('data-mce-p-' + attrName, attrValue); + } + } + var innerHtml = sourceNode.firstChild && sourceNode.firstChild.value; + if (innerHtml) { + targetNode.attr('data-mce-html', escape(sanitize(editor, innerHtml))); + targetNode.firstChild = null; + } + }; + var isPageEmbedWrapper = function (node) { + var nodeClass = node.attr('class'); + return nodeClass && /\btiny-pageembed\b/.test(nodeClass); + }; + var isWithinEmbedWrapper = function (node) { + while (node = node.parent) { + if (node.attr('data-ephox-embed-iri') || isPageEmbedWrapper(node)) { + return true; + } + } + return false; + }; + var placeHolderConverter = function (editor) { + return function (nodes) { + var i = nodes.length; + var node; + var videoScript; + while (i--) { + node = nodes[i]; + if (!node.parent) { + continue; + } + if (node.parent.attr('data-mce-object')) { + continue; + } + if (node.name === 'script') { + videoScript = getVideoScriptMatch(getScripts(editor), node.attr('src')); + if (!videoScript) { + continue; + } + } + if (videoScript) { + if (videoScript.width) { + node.attr('width', videoScript.width.toString()); + } + if (videoScript.height) { + node.attr('height', videoScript.height.toString()); + } + } + if (node.name === 'iframe' && hasLiveEmbeds(editor) && global$8.ceFalse) { + if (!isWithinEmbedWrapper(node)) { + node.replace(createPreviewIframeNode(editor, node)); + } + } else { + if (!isWithinEmbedWrapper(node)) { + node.replace(createPlaceholderNode(editor, node)); + } + } + } + }; + }; + + var setup = function (editor) { + editor.on('preInit', function () { + var specialElements = editor.schema.getSpecialElements(); + global$1.each('video audio iframe object'.split(' '), function (name) { + specialElements[name] = new RegExp(']*>', 'gi'); + }); + var boolAttrs = editor.schema.getBoolAttrs(); + global$1.each('webkitallowfullscreen mozallowfullscreen allowfullscreen'.split(' '), function (name) { + boolAttrs[name] = {}; + }); + editor.parser.addNodeFilter('iframe,video,audio,object,embed,script', placeHolderConverter(editor)); + editor.serializer.addAttributeFilter('data-mce-object', function (nodes, name) { + var i = nodes.length; + var node; + var realElm; + var ai; + var attribs; + var innerHtml; + var innerNode; + var realElmName; + var className; + while (i--) { + node = nodes[i]; + if (!node.parent) { + continue; + } + realElmName = node.attr(name); + realElm = new global$7(realElmName, 1); + if (realElmName !== 'audio' && realElmName !== 'script') { + className = node.attr('class'); + if (className && className.indexOf('mce-preview-object') !== -1) { + realElm.attr({ + width: node.firstChild.attr('width'), + height: node.firstChild.attr('height') + }); + } else { + realElm.attr({ + width: node.attr('width'), + height: node.attr('height') + }); + } + } + realElm.attr({ style: node.attr('style') }); + attribs = node.attributes; + ai = attribs.length; + while (ai--) { + var attrName = attribs[ai].name; + if (attrName.indexOf('data-mce-p-') === 0) { + realElm.attr(attrName.substr(11), attribs[ai].value); + } + } + if (realElmName === 'script') { + realElm.attr('type', 'text/javascript'); + } + innerHtml = node.attr('data-mce-html'); + if (innerHtml) { + innerNode = new global$7('#text', 3); + innerNode.raw = true; + innerNode.value = sanitize(editor, unescape(innerHtml)); + realElm.append(innerNode); + } + node.replace(realElm); + } + }); + }); + editor.on('SetContent', function () { + editor.$('span.mce-preview-object').each(function (index, elm) { + var $elm = editor.$(elm); + if ($elm.find('span.mce-shim').length === 0) { + $elm.append(''); + } + }); + }); + }; + + var setup$1 = function (editor) { + editor.on('ResolveName', function (e) { + var name; + if (e.target.nodeType === 1 && (name = e.target.getAttribute('data-mce-object'))) { + e.name = name; + } + }); + }; + + var setup$2 = function (editor) { + editor.on('click keyup touchend', function () { + var selectedNode = editor.selection.getNode(); + if (selectedNode && editor.dom.hasClass(selectedNode, 'mce-preview-object')) { + if (editor.dom.getAttrib(selectedNode, 'data-mce-selected')) { + selectedNode.setAttribute('data-mce-selected', '2'); + } + } + }); + editor.on('ObjectSelected', function (e) { + var objectType = e.target.getAttribute('data-mce-object'); + if (objectType === 'audio' || objectType === 'script') { + e.preventDefault(); + } + }); + editor.on('ObjectResized', function (e) { + var target = e.target; + var html; + if (target.getAttribute('data-mce-object')) { + html = target.getAttribute('data-mce-html'); + if (html) { + html = unescape(html); + target.setAttribute('data-mce-html', escape(updateHtml(html, { + width: String(e.width), + height: String(e.height) + }))); + } + } + }); + }; + + var stateSelectorAdapter = function (editor, selector) { + return function (buttonApi) { + return editor.selection.selectorChangedWithUnbind(selector.join(','), buttonApi.setActive).unbind; + }; + }; + var register$1 = function (editor) { + editor.ui.registry.addToggleButton('media', { + tooltip: 'Insert/edit media', + icon: 'embed', + onAction: function () { + editor.execCommand('mceMedia'); + }, + onSetup: stateSelectorAdapter(editor, [ + 'img[data-mce-object]', + 'span[data-mce-object]', + 'div[data-ephox-embed-iri]' + ]) + }); + editor.ui.registry.addMenuItem('media', { + icon: 'embed', + text: 'Media...', + onAction: function () { + editor.execCommand('mceMedia'); + } + }); + }; + + function Plugin () { + global.add('media', function (editor) { + register(editor); + register$1(editor); + setup$1(editor); + setup(editor); + setup$2(editor); + return get$1(editor); + }); + } + + Plugin(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/media/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/media/plugin.min.js index 7c71528f43ec..454b053ee1ca 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/media/plugin.min.js +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/media/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("media",function(e,t){function i(e){return-1!=e.indexOf(".mp3")?"audio/mpeg":-1!=e.indexOf(".wav")?"audio/wav":-1!=e.indexOf(".mp4")?"video/mp4":-1!=e.indexOf(".webm")?"video/webm":-1!=e.indexOf(".ogg")?"video/ogg":-1!=e.indexOf(".swf")?"application/x-shockwave-flash":""}function r(t){var i=e.settings.media_scripts;if(i)for(var r=0;r':"application/x-shockwave-flash"==o.source1mime?(a+='',o.poster&&(a+=''),a+=""):-1!=o.source1mime.indexOf("audio")?e.settings.audio_template_callback?a=e.settings.audio_template_callback(o):a+='":"script"==o.type?a+='':a=e.settings.video_template_callback?e.settings.video_template_callback(o):'"}return a}function s(e){var t={};return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",start:function(e,i){if(t.source1||"param"!=e||(t.source1=i.map.movie),("iframe"==e||"object"==e||"embed"==e||"video"==e||"audio"==e)&&(t.type||(t.type=e),t=tinymce.extend(i.map,t)),"script"==e){var o=r(i.map.src);if(!o)return;t={type:"script",source1:i.map.src,width:o.width,height:o.height}}"source"==e&&(t.source1?t.source2||(t.source2=i.map.src):t.source1=i.map.src),"img"!=e||t.poster||(t.poster=i.map.src)}}).parse(e),t.source1=t.source1||t.src||t.data,t.source2=t.source2||"",t.poster=t.poster||"",t}function n(t){return t.getAttribute("data-mce-object")?s(e.serializer.serialize(t,{selection:!0})):{}}function m(e,t,i){function r(e,t){var i,r,o,a;for(i in t)if(o=""+t[i],e.map[i])for(r=e.length;r--;)a=e[r],a.name==i&&(o?(e.map[i]=o,a.value=o):(delete e.map[i],e.splice(r,1)));else o&&(e.push({name:i,value:o}),e.map[i]=o)}var o,a=new tinymce.html.Writer,c=0;return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",comment:function(e){a.comment(e)},cdata:function(e){a.cdata(e)},text:function(e,t){a.text(e,t)},start:function(e,s,n){switch(e){case"video":case"object":case"embed":case"img":case"iframe":r(s,{width:t.width,height:t.height})}if(i)switch(e){case"video":r(s,{poster:t.poster,src:""}),t.source2&&r(s,{src:""});break;case"iframe":r(s,{src:t.source1});break;case"source":if(c++,2>=c&&(r(s,{src:t["source"+c],type:t["source"+c+"mime"]}),!t["source"+c]))return;break;case"img":if(!t.poster)return;o=!0}a.start(e,s,n)},end:function(e){if("video"==e&&i)for(var s=1;2>=s;s++)if(t["source"+s]){var n=[];n.map={},s>c&&(r(n,{src:t["source"+s],type:t["source"+s+"mime"]}),a.start("source",n,!0))}if(t.poster&&"object"==e&&i&&!o){var m=[];m.map={},r(m,{src:t.poster,width:t.width,height:t.height}),a.start("img",m,!0)}a.end(e)}},new tinymce.html.Schema({})).parse(e),a.getContent()}var u=[{regex:/youtu\.be\/([\w\-.]+)/,type:"iframe",w:425,h:350,url:"//www.youtube.com/embed/$1"},{regex:/youtube\.com(.+)v=([^&]+)/,type:"iframe",w:425,h:350,url:"//www.youtube.com/embed/$2"},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc"},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'//maps.google.com/maps/ms?msid=$2&output=embed"'}];e.on("ResolveName",function(e){var t;1==e.target.nodeType&&(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)}),e.on("preInit",function(){var t=e.schema.getSpecialElements();tinymce.each("video audio iframe object".split(" "),function(e){t[e]=new RegExp("]*>","gi")});var i=e.schema.getBoolAttrs();tinymce.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(e){i[e]={}}),e.parser.addNodeFilter("iframe,video,audio,object,embed,script",function(t,i){for(var o,a,c,s,n,m,u,d,l=t.length;l--;)if(a=t[l],a.parent&&("script"!=a.name||(d=r(a.attr("src"))))){for(c=new tinymce.html.Node("img",1),c.shortEnded=!0,d&&(d.width&&a.attr("width",d.width.toString()),d.height&&a.attr("height",d.height.toString())),m=a.attributes,o=m.length;o--;)s=m[o].name,n=m[o].value,"width"!==s&&"height"!==s&&"style"!==s&&(("data"==s||"src"==s)&&(n=e.convertURL(n,s)),c.attr("data-mce-p-"+s,n));u=a.firstChild&&a.firstChild.value,u&&(c.attr("data-mce-html",escape(u)),c.firstChild=null),c.attr({width:a.attr("width")||"300",height:a.attr("height")||("audio"==i?"30":"150"),style:a.attr("style"),src:tinymce.Env.transparentSrc,"data-mce-object":i,"class":"mce-object mce-object-"+i}),a.replace(c)}}),e.serializer.addAttributeFilter("data-mce-object",function(e,t){for(var i,r,o,a,c,s,n,m=e.length;m--;)if(i=e[m],i.parent){for(n=i.attr(t),r=new tinymce.html.Node(n,1),"audio"!=n&&"script"!=n&&r.attr({width:i.attr("width"),height:i.attr("height")}),r.attr({style:i.attr("style")}),a=i.attributes,o=a.length;o--;){var u=a[o].name;0===u.indexOf("data-mce-p-")&&r.attr(u.substr(11),a[o].value)}"script"==n&&r.attr("type","text/javascript"),c=i.attr("data-mce-html"),c&&(s=new tinymce.html.Node("#text",3),s.raw=!0,s.value=unescape(c),r.append(s)),i.replace(r)}})}),e.on("ObjectSelected",function(e){var t=e.target.getAttribute("data-mce-object");("audio"==t||"script"==t)&&e.preventDefault()}),e.on("objectResized",function(e){var t,i=e.target;i.getAttribute("data-mce-object")&&(t=i.getAttribute("data-mce-html"),t&&(t=unescape(t),i.setAttribute("data-mce-html",escape(m(t,{width:e.width,height:e.height})))))}),e.addButton("media",{tooltip:"Insert/edit video",onclick:o,stateSelector:["img[data-mce-object=video]","img[data-mce-object=iframe]"]}),e.addMenuItem("media",{icon:"media",text:"Insert video",onclick:o,context:"insert",prependToContext:!0})}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var e,t,r,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),p=function(){return(p=Object.assign||function(e){for(var t,r=1,n=arguments.length;r"):"application/x-shockwave-flash"===n.sourcemime?(l='',s.poster&&(l+=''),l+=""):-1!==n.sourcemime.indexOf("audio")?(c=n,(u=h)?u(c):'"):"script"===n.type?'\n'; - moduleCount++; - } - - // Expose globally - exports.define = define; - exports.require = require; - - expose(["tinymce/pasteplugin/Utils","tinymce/pasteplugin/Clipboard","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Quirks","tinymce/pasteplugin/Plugin"]); - - load('classes/Utils.js'); - load('classes/Clipboard.js'); - load('classes/WordFilter.js'); - load('classes/Quirks.js'); - load('classes/Plugin.js'); - - writeScripts(); -})(this); - -// $hash: 37d8db4ae3360166a44dd2a51471ece2 \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/paste/plugin.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/paste/plugin.js old mode 100755 new mode 100644 index 3a038798201c..dd0359c9d78b --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/paste/plugin.js +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/paste/plugin.js @@ -1,1206 +1,1707 @@ /** - * Compiled inline version. (Library mode) - */ - -/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */ -/*globals $code */ - -(function(exports, undefined) { - "use strict"; - - var modules = {}; - - function require(ids, callback) { - var module, defs = []; - - for (var i = 0; i < ids.length; ++i) { - module = modules[ids[i]] || resolve(ids[i]); - if (!module) { - throw 'module definition dependecy not found: ' + ids[i]; - } - - defs.push(module); - } - - callback.apply(null, defs); - } - - function define(id, dependencies, definition) { - if (typeof id !== 'string') { - throw 'invalid module definition, module id must be defined and be a string'; - } - - if (dependencies === undefined) { - throw 'invalid module definition, dependencies must be specified'; - } - - if (definition === undefined) { - throw 'invalid module definition, definition function must be specified'; - } - - require(dependencies, function() { - modules[id] = definition.apply(null, arguments); - }); - } - - function defined(id) { - return !!modules[id]; - } - - function resolve(id) { - var target = exports; - var fragments = id.split(/[.\/]/); - - for (var fi = 0; fi < fragments.length; ++fi) { - if (!target[fragments[fi]]) { - return; - } - - target = target[fragments[fi]]; - } - - return target; - } - - function expose(ids) { - for (var i = 0; i < ids.length; i++) { - var target = exports; - var id = ids[i]; - var fragments = id.split(/[.\/]/); - - for (var fi = 0; fi < fragments.length - 1; ++fi) { - if (target[fragments[fi]] === undefined) { - target[fragments[fi]] = {}; - } - - target = target[fragments[fi]]; - } - - target[fragments[fragments.length - 1]] = modules[id]; - } - } - -// Included from: js/tinymce/plugins/paste/classes/Utils.js - -/** - * Utils.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class contails various utility functions for the paste plugin. - * - * @class tinymce.pasteplugin.Clipboard - * @private - */ -define("tinymce/pasteplugin/Utils", [ - "tinymce/util/Tools", - "tinymce/html/DomParser", - "tinymce/html/Schema" -], function(Tools, DomParser, Schema) { - function filter(content, items) { - Tools.each(items, function(v) { - if (v.constructor == RegExp) { - content = content.replace(v, ''); - } else { - content = content.replace(v[0], v[1]); - } - }); - - return content; - } - - /** - * Gets the innerText of the specified element. It will handle edge cases - * and works better than textContent on Gecko. - * - * @param {String} html HTML string to get text from. - * @return {String} String of text with line feeds. - */ - function innerText(html) { - var schema = new Schema(), domParser = new DomParser({}, schema), text = ''; - var shortEndedElements = schema.getShortEndedElements(); - var ignoreElements = Tools.makeMap('script noscript style textarea video audio iframe object', ' '); - var blockElements = schema.getBlockElements(); - - function walk(node) { - var name = node.name, currentNode = node; - - if (name === 'br') { - text += '\n'; - return; - } - - // img/input/hr - if (shortEndedElements[name]) { - text += ' '; - } - - // Ingore script, video contents - if (ignoreElements[name]) { - text += ' '; - return; - } - - if (node.type == 3) { - text += node.value; - } - - // Walk all children - if (!node.shortEnded) { - if ((node = node.firstChild)) { - do { - walk(node); - } while ((node = node.next)); - } - } - - // Add \n or \n\n for blocks or P - if (blockElements[name] && currentNode.next) { - text += '\n'; - - if (name == 'p') { - text += '\n'; - } - } - } - - walk(domParser.parse(html)); - - return text; - } - - return { - filter: filter, - innerText: innerText - }; -}); - -// Included from: js/tinymce/plugins/paste/classes/Clipboard.js - -/** - * Clipboard.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class contains logic for getting HTML contents out of the clipboard. - * - * We need to make a lot of ugly hacks to get the contents out of the clipboard since - * the W3C Clipboard API is broken in all browsers that have it: Gecko/WebKit/Blink. - * We might rewrite this the way those API:s stabilize. Browsers doesn't handle pasting - * from applications like Word the same way as it does when pasting into a contentEditable area - * so we need to do lots of extra work to try to get to this clipboard data. - * - * Current implementation steps: - * 1. On keydown with paste keys Ctrl+V or Shift+Insert create - * a paste bin element and move focus to that element. - * 2. Wait for the browser to fire a "paste" event and get the contents out of the paste bin. - * 3. Check if the paste was successful if true, process the HTML. - * (4). If the paste was unsuccessful use IE execCommand, Clipboard API, document.dataTransfer old WebKit API etc. - * - * @class tinymce.pasteplugin.Clipboard - * @private - */ -define("tinymce/pasteplugin/Clipboard", [ - "tinymce/Env", - "tinymce/util/VK", - "tinymce/pasteplugin/Utils" -], function(Env, VK, Utils) { - return function(editor) { - var self = this, pasteBinElm, lastRng, keyboardPasteTimeStamp = 0; - var pasteBinDefaultContent = '%MCEPASTEBIN%', keyboardPastePlainTextState; - - /** - * Pastes the specified HTML. This means that the HTML is filtered and then - * inserted at the current selection in the editor. It will also fire paste events - * for custom user filtering. - * - * @param {String} html HTML code to paste into the current selection. - */ - function pasteHtml(html) { - var args, dom = editor.dom; - - args = editor.fire('BeforePastePreProcess', {content: html}); // Internal event used by Quirks - args = editor.fire('PastePreProcess', args); - html = args.content; - - if (!args.isDefaultPrevented()) { - // User has bound PastePostProcess events then we need to pass it through a DOM node - // This is not ideal but we don't want to let the browser mess up the HTML for example - // some browsers add   to P tags etc - if (editor.hasEventListeners('PastePostProcess') && !args.isDefaultPrevented()) { - // We need to attach the element to the DOM so Sizzle selectors work on the contents - var tempBody = dom.add(editor.getBody(), 'div', {style: 'display:none'}, html); - args = editor.fire('PastePostProcess', {node: tempBody}); - dom.remove(tempBody); - html = args.node.innerHTML; - } - - if (!args.isDefaultPrevented()) { - editor.insertContent(html); - } - } - } - - /** - * Pastes the specified text. This means that the plain text is processed - * and converted into BR and P elements. It will fire paste events for custom filtering. - * - * @param {String} text Text to paste as the current selection location. - */ - function pasteText(text) { - text = editor.dom.encode(text).replace(/\r\n/g, '\n'); - - var startBlock = editor.dom.getParent(editor.selection.getStart(), editor.dom.isBlock); - - // Create start block html for example

    - var forcedRootBlockName = editor.settings.forced_root_block; - var forcedRootBlockStartHtml; - if (forcedRootBlockName) { - forcedRootBlockStartHtml = editor.dom.createHTML(forcedRootBlockName, editor.settings.forced_root_block_attrs); - forcedRootBlockStartHtml = forcedRootBlockStartHtml.substr(0, forcedRootBlockStartHtml.length - 3) + '>'; - } - - if ((startBlock && /^(PRE|DIV)$/.test(startBlock.nodeName)) || !forcedRootBlockName) { - text = Utils.filter(text, [ - [/\n/g, "
    "] - ]); - } else { - text = Utils.filter(text, [ - [/\n\n/g, "

    " + forcedRootBlockStartHtml], - [/^(.*<\/p>)(

    )$/, forcedRootBlockStartHtml + '$1'], - [/\n/g, "
    "] - ]); - - if (text.indexOf('

    ') != -1) { - text = forcedRootBlockStartHtml + text; - } - } - - pasteHtml(text); - } - - /** - * Creates a paste bin element as close as possible to the current caret location and places the focus inside that element - * so that when the real paste event occurs the contents gets inserted into this element - * instead of the current editor selection element. - */ - function createPasteBin() { - var dom = editor.dom, body = editor.getBody(); - var viewport = editor.dom.getViewPort(editor.getWin()), scrollTop = viewport.y, top = 20; - var scrollContainer; - - lastRng = editor.selection.getRng(); - - if (editor.inline) { - scrollContainer = editor.selection.getScrollContainer(); - - if (scrollContainer) { - scrollTop = scrollContainer.scrollTop; - } - } - - // Calculate top cordinate this is needed to avoid scrolling to top of document - // We want the paste bin to be as close to the caret as possible to avoid scrolling - if (lastRng.getClientRects) { - var rects = lastRng.getClientRects(); - - if (rects.length) { - // Client rects gets us closes to the actual - // caret location in for example a wrapped paragraph block - top = scrollTop + (rects[0].top - dom.getPos(body).y); - } else { - top = scrollTop; - - // Check if we can find a closer location by checking the range element - var container = lastRng.startContainer; - if (container) { - if (container.nodeType == 3 && container.parentNode != body) { - container = container.parentNode; - } - - if (container.nodeType == 1) { - top = dom.getPos(container, scrollContainer || body).y; - } - } - } - } - - // Create a pastebin - pasteBinElm = dom.add(editor.getBody(), 'div', { - id: "mcepastebin", - contentEditable: true, - "data-mce-bogus": "1", - style: 'position: absolute; top: ' + top + 'px;' + - 'width: 10px; height: 10px; overflow: hidden; opacity: 0' - }, pasteBinDefaultContent); - - // Move paste bin out of sight since the controlSelection rect gets displayed otherwise on IE and Gecko - if (Env.ie || Env.gecko) { - dom.setStyle(pasteBinElm, 'left', dom.getStyle(body, 'direction', true) == 'rtl' ? 0xFFFF : -0xFFFF); - } - - // Prevent focus events from bubbeling fixed FocusManager issues - dom.bind(pasteBinElm, 'beforedeactivate focusin focusout', function(e) { - e.stopPropagation(); - }); - - pasteBinElm.focus(); - editor.selection.select(pasteBinElm, true); - } - - /** - * Removes the paste bin if it exists. - */ - function removePasteBin() { - if (pasteBinElm) { - var pasteBinClone; - - // WebKit/Blink might clone the div so - // lets make sure we remove all clones - // TODO: Man o man is this ugly. WebKit is the new IE! Remove this if they ever fix it! - while ((pasteBinClone = editor.dom.get('mcepastebin'))) { - editor.dom.remove(pasteBinClone); - editor.dom.unbind(pasteBinClone); - } - - if (lastRng) { - editor.selection.setRng(lastRng); - } - } - - keyboardPastePlainTextState = false; - pasteBinElm = lastRng = null; - } - - /** - * Returns the contents of the paste bin as a HTML string. - * - * @return {String} Get the contents of the paste bin. - */ - function getPasteBinHtml() { - var html = pasteBinDefaultContent, pasteBinClones, i; - - // Since WebKit/Chrome might clone the paste bin when pasting - // for example: we need to check if any of them contains some useful html. - // TODO: Man o man is this ugly. WebKit is the new IE! Remove this if they ever fix it! - pasteBinClones = editor.dom.select('div[id=mcepastebin]'); - i = pasteBinClones.length; - while (i--) { - var cloneHtml = pasteBinClones[i].innerHTML; - - if (html == pasteBinDefaultContent) { - html = ''; - } - - if (cloneHtml.length > html.length) { - html = cloneHtml; - } - } - - return html; - } - - /** - * Gets various content types out of a datatransfer object. - * - * @param {DataTransfer} dataTransfer Event fired on paste. - * @return {Object} Object with mime types and data for those mime types. - */ - function getDataTransferItems(dataTransfer) { - var data = {}; - - if (dataTransfer && dataTransfer.types) { - // Use old WebKit API - var legacyText = dataTransfer.getData('Text'); - if (legacyText && legacyText.length > 0) { - data['text/plain'] = legacyText; - } - - for (var i = 0; i < dataTransfer.types.length; i++) { - var contentType = dataTransfer.types[i]; - data[contentType] = dataTransfer.getData(contentType); - } - } - - return data; - } - - /** - * Gets various content types out of the Clipboard API. It will also get the - * plain text using older IE and WebKit API:s. - * - * @param {ClipboardEvent} clipboardEvent Event fired on paste. - * @return {Object} Object with mime types and data for those mime types. - */ - function getClipboardContent(clipboardEvent) { - return getDataTransferItems(clipboardEvent.clipboardData || editor.getDoc().dataTransfer); - } - - /** - * Checks if the clipboard contains image data if it does it will take that data - * and convert it into a data url image and paste that image at the caret location. - * - * @param {ClipboardEvent} e Paste event object. - * @param {Object} clipboardContent Collection of clipboard contents. - * @return {Boolean} true/false if the image data was found or not. - */ - function pasteImageData(e, clipboardContent) { - function pasteImage(item) { - if (items[i].type == 'image/png') { - var reader = new FileReader(); - - reader.onload = function() { - pasteHtml(''); - }; - - reader.readAsDataURL(item.getAsFile()); - - return true; - } - } - - // If paste data images are disabled or there is HTML or plain text - // contents then proceed with the normal paste process - if (!editor.settings.paste_data_images || "text/html" in clipboardContent || "text/plain" in clipboardContent) { - return; - } - - if (e.clipboardData) { - var items = e.clipboardData.items; - - if (items) { - for (var i = 0; i < items.length; i++) { - if (pasteImage(items[i])) { - return true; - } - } - } - } - } - - function getCaretRangeFromEvent(e) { - var doc = editor.getDoc(), rng; - - if (doc.caretPositionFromPoint) { - var point = doc.caretPositionFromPoint(e.clientX, e.clientY); - rng = doc.createRange(); - rng.setStart(point.offsetNode, point.offset); - rng.collapse(true); - } else if (doc.caretRangeFromPoint) { - rng = doc.caretRangeFromPoint(e.clientX, e.clientY); - } - - return rng; - } - - function hasContentType(clipboardContent, mimeType) { - return mimeType in clipboardContent && clipboardContent[mimeType].length > 0; - } - - function registerEventHandlers() { - editor.on('keydown', function(e) { - if (e.isDefaultPrevented()) { - return; - } - - // Ctrl+V or Shift+Insert - if ((VK.metaKeyPressed(e) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45)) { - keyboardPastePlainTextState = e.shiftKey && e.keyCode == 86; - - // Prevent undoManager keydown handler from making an undo level with the pastebin in it - e.stopImmediatePropagation(); - - keyboardPasteTimeStamp = new Date().getTime(); - - // IE doesn't support Ctrl+Shift+V and it doesn't even produce a paste event - // so lets fake a paste event and let IE use the execCommand/dataTransfer methods - if (Env.ie && keyboardPastePlainTextState) { - e.preventDefault(); - editor.fire('paste', {ieFake: true}); - return; - } - - removePasteBin(); - createPasteBin(); - } - }); - - editor.on('paste', function(e) { - var clipboardContent = getClipboardContent(e); - var isKeyBoardPaste = new Date().getTime() - keyboardPasteTimeStamp < 1000; - var plainTextMode = self.pasteFormat == "text" || keyboardPastePlainTextState; - - if (e.isDefaultPrevented()) { - removePasteBin(); - return; - } - - if (pasteImageData(e, clipboardContent)) { - removePasteBin(); - return; - } - - // Not a keyboard paste prevent default paste and try to grab the clipboard contents using different APIs - if (!isKeyBoardPaste) { - e.preventDefault(); - } - - // Try IE only method if paste isn't a keyboard paste - if (Env.ie && (!isKeyBoardPaste || e.ieFake)) { - createPasteBin(); - - editor.dom.bind(pasteBinElm, 'paste', function(e) { - e.stopPropagation(); - }); - - editor.getDoc().execCommand('Paste', false, null); - clipboardContent["text/html"] = getPasteBinHtml(); - } - - setTimeout(function() { - var html = getPasteBinHtml(); - - // WebKit has a nice bug where it clones the paste bin if you paste from for example notepad - if (pasteBinElm && pasteBinElm.firstChild && pasteBinElm.firstChild.id === 'mcepastebin') { - plainTextMode = true; - } - - removePasteBin(); - - if (html == pasteBinDefaultContent || !isKeyBoardPaste) { - html = clipboardContent['text/html'] || clipboardContent['text/plain'] || pasteBinDefaultContent; - - if (html == pasteBinDefaultContent) { - if (!isKeyBoardPaste) { - editor.windowManager.alert('Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.'); - } - - return; - } - } - - // Force plain text mode if we only got a text/plain content type - if (!hasContentType(clipboardContent, 'text/html') && hasContentType(clipboardContent, 'text/plain')) { - plainTextMode = true; - } - - if (plainTextMode) { - pasteText(clipboardContent['text/plain'] || Utils.innerText(html)); - } else { - pasteHtml(html); - } - }, 0); - }); - - editor.on('dragstart', function(e) { - if (e.dataTransfer.types) { - try { - e.dataTransfer.setData('mce-internal', editor.selection.getContent()); - } catch (ex) { - // IE 10 throws an error since it doesn't support custom data items - } - } - }); - - editor.on('drop', function(e) { - var rng = getCaretRangeFromEvent(e); - - if (rng && !e.isDefaultPrevented()) { - var dropContent = getDataTransferItems(e.dataTransfer); - var content = dropContent['mce-internal'] || dropContent['text/html'] || dropContent['text/plain']; - - if (content) { - e.preventDefault(); - - editor.undoManager.transact(function() { - if (dropContent['mce-internal']) { - editor.execCommand('Delete'); - } - - editor.selection.setRng(rng); - - if (!dropContent['text/html']) { - pasteText(content); - } else { - pasteHtml(content); - } - }); - } - } - }); - } - - self.pasteHtml = pasteHtml; - self.pasteText = pasteText; - - editor.on('preInit', function() { - registerEventHandlers(); - - // Remove all data images from paste for example from Gecko - // except internal images like video elements - editor.parser.addNodeFilter('img', function(nodes) { - if (!editor.settings.paste_data_images) { - var i = nodes.length; - - while (i--) { - var src = nodes[i].attributes.map.src; - if (src && src.indexOf('data:image') === 0) { - if (!nodes[i].attr('data-mce-object') && src !== Env.transparentSrc) { - nodes[i].remove(); - } - } - } - } - }); - }); - - // Fix for #6504 we need to remove the paste bin on IE if the user paste in a file - editor.on('PreProcess', function() { - editor.dom.remove(editor.dom.get('mcepastebin')); - }); - }; -}); - -// Included from: js/tinymce/plugins/paste/classes/WordFilter.js - -/** - * WordFilter.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing + * Version: 5.5.1 (2020-10-01) */ - -/** - * This class parses word HTML into proper TinyMCE markup. - * - * @class tinymce.pasteplugin.Quirks - * @private - */ -define("tinymce/pasteplugin/WordFilter", [ - "tinymce/util/Tools", - "tinymce/html/DomParser", - "tinymce/html/Schema", - "tinymce/html/Serializer", - "tinymce/html/Node", - "tinymce/pasteplugin/Utils" -], function(Tools, DomParser, Schema, Serializer, Node, Utils) { - function isWordContent(content) { - return (/ 1) { - currentListNode.attr('start', '' + start); - } - - paragraphNode.wrap(currentListNode); - } else { - currentListNode.append(paragraphNode); - } - - paragraphNode.name = 'li'; - listStartTextNode.value = ''; - - var nextNode = listStartTextNode.next; - if (nextNode && nextNode.type == 3) { - nextNode.value = nextNode.value.replace(/^\u00a0+/, ''); - } - - // Append list to previous list if it exists - if (level > lastLevel && prevListNode) { - prevListNode.lastChild.append(currentListNode); - } - - lastLevel = level; - } - - var paragraphs = node.getAll('p'); - - for (var i = 0; i < paragraphs.length; i++) { - node = paragraphs[i]; - - if (node.name == 'p' && node.firstChild) { - // Find first text node in paragraph - var nodeText = ''; - var listStartTextNode = node.firstChild; - - while (listStartTextNode) { - nodeText = listStartTextNode.value; - if (nodeText) { - break; - } - - listStartTextNode = listStartTextNode.firstChild; - } - - // Detect unordered lists look for bullets - if (/^\s*[\u2022\u00b7\u00a7\u00d8\u25CF]\s*$/.test(nodeText)) { - convertParagraphToLi(node, listStartTextNode, 'ul'); - continue; - } - - // Detect ordered lists 1., a. or ixv. - if (/^\s*\w+\.$/.test(nodeText)) { - // Parse OL start number - var matches = /([0-9])\./.exec(nodeText); - var start = 1; - if (matches) { - start = parseInt(matches[1], 10); - } - - convertParagraphToLi(node, listStartTextNode, 'ol', start); - continue; - } - - currentListNode = null; - } - } - } - - function filterStyles(node, styleValue) { - // Parse out list indent level for lists - if (node.name === 'p') { - var matches = /mso-list:\w+ \w+([0-9]+)/.exec(styleValue); - - if (matches) { - node._listLevel = parseInt(matches[1], 10); - } - } - - if (editor.getParam("paste_retain_style_properties", "none")) { - var outputStyle = ""; - - Tools.each(editor.dom.parseStyle(styleValue), function(value, name) { - // Convert various MS styles to W3C styles - switch (name) { - case "horiz-align": - name = "text-align"; - return; - - case "vert-align": - name = "vertical-align"; - return; - - case "font-color": - case "mso-foreground": - name = "color"; - return; - - case "mso-background": - case "mso-highlight": - name = "background"; - break; - } - - // Output only valid styles - if (retainStyleProperties == "all" || (validStyles && validStyles[name])) { - outputStyle += name + ':' + value + ';'; - } - }); - - if (outputStyle) { - return outputStyle; - } - } - - return null; - } - - if (settings.paste_enable_default_filters === false) { - return; - } - - // Detect is the contents is Word junk HTML - if (isWordContent(e.content)) { - e.wordContent = true; // Mark it for other processors - - // Remove basic Word junk - content = Utils.filter(content, [ - // Word comments like conditional comments etc - //gi, - - // Remove comments, scripts (e.g., msoShowComment), XML tag, VML content, - // MS Office namespaced tags, and a few other tags - /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi, - - // Convert into for line-though - [/<(\/?)s>/gi, "<$1strike>"], - - // Replace nsbp entites to char since it's easier to handle - [/ /gi, "\u00a0"], - - // Convert ___ to string of alternating - // breaking/non-breaking spaces of same length - [/([\s\u00a0]*)<\/span>/gi, - function(str, spaces) { - return (spaces.length > 0) ? - spaces.replace(/./, " ").slice(Math.floor(spaces.length / 2)).split("").join("\u00a0") : ""; - } - ] - ]); - - var validElements = settings.paste_word_valid_elements; - if (!validElements) { - validElements = '@[style],-strong/b,-em/i,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,' + - '-table[width],-tr,-td[colspan|rowspan|width],-th,-thead,-tfoot,-tbody,-a[href|name],sub,sup,strike,br'; - } - - // Setup strict schema - var schema = new Schema({ - valid_elements: validElements - }); - - // Parse HTML into DOM structure - var domParser = new DomParser({}, schema); - - domParser.addAttributeFilter('style', function(nodes) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - node.attr('style', filterStyles(node, node.attr('style'))); - - // Remove pointess spans - if (node.name == 'span' && !node.attributes.length) { - node.unwrap(); - } - } - }); - - domParser.addNodeFilter('a', function(nodes) { - var i = nodes.length, node, href, name; - - while (i--) { - node = nodes[i]; - href = node.attr('href'); - name = node.attr('name'); - - if (href && href.indexOf('file://') === 0) { - href = href.split('#')[1]; - if (href) { - href = '#' + href; - } - } - - if (!href && !name) { - node.unwrap(); - } else { - node.attr({ - href: href, - name: name - }); - } - } - }); - // Parse into DOM structure - var rootNode = domParser.parse(content); - - // Process DOM - convertFakeListsToProperLists(rootNode); - - // Serialize DOM back to HTML - e.content = new Serializer({}, schema).serialize(rootNode); - } - }); - } - - WordFilter.isWordContent = isWordContent; - - return WordFilter; -}); - -// Included from: js/tinymce/plugins/paste/classes/Quirks.js - -/** - * Quirks.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class contains various fixes for browsers. These issues can not be feature - * detected since we have no direct control over the clipboard. However we might be able - * to remove some of these fixes once the browsers gets updated/fixed. - * - * @class tinymce.pasteplugin.Quirks - * @private - */ -define("tinymce/pasteplugin/Quirks", [ - "tinymce/Env", - "tinymce/util/Tools", - "tinymce/pasteplugin/WordFilter", - "tinymce/pasteplugin/Utils" -], function(Env, Tools, WordFilter, Utils) { - "use strict"; - - return function(editor) { - function addPreProcessFilter(filterFunc) { - editor.on('BeforePastePreProcess', function(e) { - e.content = filterFunc(e.content); - }); - } - - /** - * Removes WebKit fragment comments and converted-space spans. - * - * This: - * a b - * - * Becomes: - * a b - */ - function removeWebKitFragments(html) { - html = Utils.filter(html, [ - /^[\s\S]*|[\s\S]*$/g, // WebKit fragment - [/\u00a0<\/span>/g, '\u00a0'], // WebKit   - /
    $/i // Traling BR elements - ]); - - return html; - } - - /** - * Removes BR elements after block elements. IE9 has a nasty bug where it puts a BR element after each - * block element when pasting from word. This removes those elements. - * - * This: - *

    a


    b

    - * - * Becomes: - *

    a

    b

    - */ - function removeExplorerBrElementsAfterBlocks(html) { - // Only filter word specific content - if (!WordFilter.isWordContent(html)) { - return html; - } - - // Produce block regexp based on the block elements in schema - var blockElements = []; - - Tools.each(editor.schema.getBlockElements(), function(block, blockName) { - blockElements.push(blockName); - }); - - var explorerBlocksRegExp = new RegExp( - '(?:
     [\\s\\r\\n]+|
    )*(<\\/?(' + blockElements.join('|') + ')[^>]*>)(?:
     [\\s\\r\\n]+|
    )*', - 'g' - ); - - // Remove BR:s from: X
    - html = Utils.filter(html, [ - [explorerBlocksRegExp, '$1'] - ]); - - // IE9 also adds an extra BR element for each soft-linefeed and it also adds a BR for each word wrap break - html = Utils.filter(html, [ - [/

    /g, '

    '], // Replace multiple BR elements with uppercase BR to keep them intact - [/
    /g, ' '], // Replace single br elements with space since they are word wrap BR:s - [/

    /g, '
    '] // Replace back the double brs but into a single BR - ]); - - return html; - } - - /** - * WebKit has a nasty bug where the all runtime styles gets added to style attributes when copy/pasting contents. - * This fix solves that by simply removing the whole style attribute. - * - * Todo: This can be made smarter. Keeping styles that override existing ones etc. - * - * @param {String} content Content that needs to be processed. - * @return {String} Processed contents. - */ - function removeWebKitStyles(content) { - if (editor.settings.paste_remove_styles || editor.settings.paste_remove_styles_if_webkit !== false) { - content = content.replace(/ style=\"[^\"]+\"/g, ''); - } - - return content; - } - - // Sniff browsers and apply fixes since we can't feature detect - if (Env.webkit) { - addPreProcessFilter(removeWebKitStyles); - addPreProcessFilter(removeWebKitFragments); - } - - if (Env.ie) { - addPreProcessFilter(removeExplorerBrElementsAfterBlocks); - } - }; -}); - -// Included from: js/tinymce/plugins/paste/classes/Plugin.js - -/** - * Plugin.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class contains the tinymce plugin logic for the paste plugin. - * - * @class tinymce.pasteplugin.Plugin - * @private - */ -define("tinymce/pasteplugin/Plugin", [ - "tinymce/PluginManager", - "tinymce/pasteplugin/Clipboard", - "tinymce/pasteplugin/WordFilter", - "tinymce/pasteplugin/Quirks" -], function(PluginManager, Clipboard, WordFilter, Quirks) { - var userIsInformed; - - PluginManager.add('paste', function(editor) { - var self = this, clipboard, settings = editor.settings; - - function togglePlainTextPaste() { - if (clipboard.pasteFormat == "text") { - this.active(false); - clipboard.pasteFormat = "html"; - } else { - clipboard.pasteFormat = "text"; - this.active(true); - - if (!userIsInformed) { - editor.windowManager.alert( - 'Paste is now in plain text mode. Contents will now ' + - 'be pasted as plain text until you toggle this option off.' - ); - - userIsInformed = true; - } - } - } - - self.clipboard = clipboard = new Clipboard(editor); - self.quirks = new Quirks(editor); - self.wordFilter = new WordFilter(editor); - - if (editor.settings.paste_as_text) { - self.clipboard.pasteFormat = "text"; - } - - if (settings.paste_preprocess) { - editor.on('PastePreProcess', function(e) { - settings.paste_preprocess.call(self, self, e); - }); - } - - if (settings.paste_postprocess) { - editor.on('PastePostProcess', function(e) { - settings.paste_postprocess.call(self, self, e); - }); - } - - editor.addCommand('mceInsertClipboardContent', function(ui, value) { - if (value.content) { - self.clipboard.pasteHtml(value.content); - } - - if (value.text) { - self.clipboard.pasteText(value.text); - } - }); - - // Block all drag/drop events - if (editor.paste_block_drop) { - editor.on('dragend dragover draggesture dragdrop drop drag', function(e) { - e.preventDefault(); - e.stopPropagation(); - }); - } - - // Prevent users from dropping data images on Gecko - if (!editor.settings.paste_data_images) { - editor.on('drop', function(e) { - var dataTransfer = e.dataTransfer; - - if (dataTransfer && dataTransfer.files && dataTransfer.files.length > 0) { - e.preventDefault(); - } - }); - } - - editor.addButton('pastetext', { - icon: 'pastetext', - tooltip: 'Paste as text', - onclick: togglePlainTextPaste, - active: self.clipboard.pasteFormat == "text" - }); - - editor.addMenuItem('pastetext', { - text: 'Paste as text', - selectable: true, - active: clipboard.pasteFormat, - onclick: togglePlainTextPaste - }); - }); -}); - -expose(["tinymce/pasteplugin/Utils","tinymce/pasteplugin/Clipboard","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Quirks","tinymce/pasteplugin/Plugin"]); -})(this); \ No newline at end of file +(function () { + 'use strict'; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; + }; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var hasProPlugin = function (editor) { + if (editor.hasPlugin('powerpaste', true)) { + if (typeof window.console !== 'undefined' && window.console.log) { + window.console.log('PowerPaste is incompatible with Paste plugin! Remove \'paste\' from the \'plugins\' option.'); + } + return true; + } else { + return false; + } + }; + + var get = function (clipboard, quirks) { + return { + clipboard: clipboard, + quirks: quirks + }; + }; + + var noop = function () { + }; + var constant = function (value) { + return function () { + return value; + }; + }; + var never = constant(false); + var always = constant(true); + + var none = function () { + return NONE; + }; + var NONE = function () { + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; + }(); + var some = function (a) { + var constant_a = constant(a); + var self = function () { + return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; + }; + var from = function (value) { + return value === null || value === undefined ? NONE : some(value); + }; + var Optional = { + some: some, + none: none, + from: from + }; + + var isSimpleType = function (type) { + return function (value) { + return typeof value === type; + }; + }; + var isFunction = isSimpleType('function'); + + var nativeSlice = Array.prototype.slice; + var map = function (xs, f) { + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; + }; + var each = function (xs, f) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } + }; + var filter = function (xs, pred) { + var r = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + r.push(x); + } + } + return r; + }; + var foldl = function (xs, f, acc) { + each(xs, function (x) { + acc = f(acc, x); + }); + return acc; + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + var value = function () { + var subject = Cell(Optional.none()); + var clear = function () { + return subject.set(Optional.none()); + }; + var set = function (s) { + return subject.set(Optional.some(s)); + }; + var isSet = function () { + return subject.get().isSome(); + }; + var on = function (f) { + return subject.get().each(f); + }; + return { + clear: clear, + set: set, + isSet: isSet, + on: on + }; + }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.Env'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay'); + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.Promise'); + + var global$4 = tinymce.util.Tools.resolve('tinymce.util.VK'); + + var firePastePreProcess = function (editor, html, internal, isWordHtml) { + return editor.fire('PastePreProcess', { + content: html, + internal: internal, + wordContent: isWordHtml + }); + }; + var firePastePostProcess = function (editor, node, internal, isWordHtml) { + return editor.fire('PastePostProcess', { + node: node, + internal: internal, + wordContent: isWordHtml + }); + }; + var firePastePlainTextToggle = function (editor, state) { + return editor.fire('PastePlainTextToggle', { state: state }); + }; + var firePaste = function (editor, ieFake) { + return editor.fire('paste', { ieFake: ieFake }); + }; + + var shouldBlockDrop = function (editor) { + return editor.getParam('paste_block_drop', false); + }; + var shouldPasteDataImages = function (editor) { + return editor.getParam('paste_data_images', false); + }; + var shouldFilterDrop = function (editor) { + return editor.getParam('paste_filter_drop', true); + }; + var getPreProcess = function (editor) { + return editor.getParam('paste_preprocess'); + }; + var getPostProcess = function (editor) { + return editor.getParam('paste_postprocess'); + }; + var getWebkitStyles = function (editor) { + return editor.getParam('paste_webkit_styles'); + }; + var shouldRemoveWebKitStyles = function (editor) { + return editor.getParam('paste_remove_styles_if_webkit', true); + }; + var shouldMergeFormats = function (editor) { + return editor.getParam('paste_merge_formats', true); + }; + var isSmartPasteEnabled = function (editor) { + return editor.getParam('smart_paste', true); + }; + var isPasteAsTextEnabled = function (editor) { + return editor.getParam('paste_as_text', false); + }; + var getRetainStyleProps = function (editor) { + return editor.getParam('paste_retain_style_properties'); + }; + var getWordValidElements = function (editor) { + var defaultValidElements = '-strong/b,-em/i,-u,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,' + '-p/div,-a[href|name],sub,sup,strike,br,del,table[width],tr,' + 'td[colspan|rowspan|width],th[colspan|rowspan|width],thead,tfoot,tbody'; + return editor.getParam('paste_word_valid_elements', defaultValidElements); + }; + var shouldConvertWordFakeLists = function (editor) { + return editor.getParam('paste_convert_word_fake_lists', true); + }; + var shouldUseDefaultFilters = function (editor) { + return editor.getParam('paste_enable_default_filters', true); + }; + var getValidate = function (editor) { + return editor.getParam('validate'); + }; + var getAllowHtmlDataUrls = function (editor) { + return editor.getParam('allow_html_data_urls', false, 'boolean'); + }; + var getPasteDataImages = function (editor) { + return editor.getParam('paste_data_images', false, 'boolean'); + }; + var getImagesDataImgFilter = function (editor) { + return editor.getParam('images_dataimg_filter'); + }; + var getImagesReuseFilename = function (editor) { + return editor.getParam('images_reuse_filename'); + }; + var getForcedRootBlock = function (editor) { + return editor.getParam('forced_root_block'); + }; + var getForcedRootBlockAttrs = function (editor) { + return editor.getParam('forced_root_block_attrs'); + }; + var getTabSpaces = function (editor) { + return editor.getParam('paste_tab_spaces', 4, 'number'); + }; + + var internalMimeType = 'x-tinymce/html'; + var internalMark = ''; + var mark = function (html) { + return internalMark + html; + }; + var unmark = function (html) { + return html.replace(internalMark, ''); + }; + var isMarked = function (html) { + return html.indexOf(internalMark) !== -1; + }; + var internalHtmlMime = function () { + return internalMimeType; + }; + + var global$5 = tinymce.util.Tools.resolve('tinymce.html.Entities'); + + var global$6 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var isPlainText = function (text) { + return !/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(text); + }; + var toBRs = function (text) { + return text.replace(/\r?\n/g, '
    '); + }; + var openContainer = function (rootTag, rootAttrs) { + var key; + var attrs = []; + var tag = '<' + rootTag; + if (typeof rootAttrs === 'object') { + for (key in rootAttrs) { + if (rootAttrs.hasOwnProperty(key)) { + attrs.push(key + '="' + global$5.encodeAllRaw(rootAttrs[key]) + '"'); + } + } + if (attrs.length) { + tag += ' ' + attrs.join(' '); + } + } + return tag + '>'; + }; + var toBlockElements = function (text, rootTag, rootAttrs) { + var blocks = text.split(/\n\n/); + var tagOpen = openContainer(rootTag, rootAttrs); + var tagClose = ''; + var paragraphs = global$6.map(blocks, function (p) { + return p.split(/\n/).join('
    '); + }); + var stitch = function (p) { + return tagOpen + p + tagClose; + }; + return paragraphs.length === 1 ? paragraphs[0] : global$6.map(paragraphs, stitch).join(''); + }; + var convert = function (text, rootTag, rootAttrs) { + return rootTag ? toBlockElements(text, rootTag === true ? 'p' : rootTag, rootAttrs) : toBRs(text); + }; + + var global$7 = tinymce.util.Tools.resolve('tinymce.html.DomParser'); + + var global$8 = tinymce.util.Tools.resolve('tinymce.html.Serializer'); + + var nbsp = '\xA0'; + + var global$9 = tinymce.util.Tools.resolve('tinymce.html.Node'); + + var global$a = tinymce.util.Tools.resolve('tinymce.html.Schema'); + + function filter$1(content, items) { + global$6.each(items, function (v) { + if (v.constructor === RegExp) { + content = content.replace(v, ''); + } else { + content = content.replace(v[0], v[1]); + } + }); + return content; + } + function innerText(html) { + var schema = global$a(); + var domParser = global$7({}, schema); + var text = ''; + var shortEndedElements = schema.getShortEndedElements(); + var ignoreElements = global$6.makeMap('script noscript style textarea video audio iframe object', ' '); + var blockElements = schema.getBlockElements(); + function walk(node) { + var name = node.name, currentNode = node; + if (name === 'br') { + text += '\n'; + return; + } + if (name === 'wbr') { + return; + } + if (shortEndedElements[name]) { + text += ' '; + } + if (ignoreElements[name]) { + text += ' '; + return; + } + if (node.type === 3) { + text += node.value; + } + if (!node.shortEnded) { + if (node = node.firstChild) { + do { + walk(node); + } while (node = node.next); + } + } + if (blockElements[name] && currentNode.next) { + text += '\n'; + if (name === 'p') { + text += '\n'; + } + } + } + html = filter$1(html, [//g]); + walk(domParser.parse(html)); + return text; + } + function trimHtml(html) { + function trimSpaces(all, s1, s2) { + if (!s1 && !s2) { + return ' '; + } + return nbsp; + } + html = filter$1(html, [ + /^[\s\S]*]*>\s*|\s*<\/body[^>]*>[\s\S]*$/ig, + /|/g, + [ + /( ?)\u00a0<\/span>( ?)/g, + trimSpaces + ], + /
    /g, + /
    $/i + ]); + return html; + } + function createIdGenerator(prefix) { + var count = 0; + return function () { + return prefix + count++; + }; + } + + function isWordContent(content) { + return / 1) { + currentListNode.attr('start', '' + start); + } + paragraphNode.wrap(currentListNode); + } else { + currentListNode.append(paragraphNode); + } + paragraphNode.name = 'li'; + if (level > lastLevel && prevListNode) { + prevListNode.lastChild.append(currentListNode); + } + lastLevel = level; + removeIgnoredNodes(paragraphNode); + trimListStart(paragraphNode, /^\u00a0+/); + trimListStart(paragraphNode, /^\s*([\u2022\u00b7\u00a7\u25CF]|\w+\.)/); + trimListStart(paragraphNode, /^\u00a0+/); + } + var elements = []; + var child = node.firstChild; + while (typeof child !== 'undefined' && child !== null) { + elements.push(child); + child = child.walk(); + if (child !== null) { + while (typeof child !== 'undefined' && child.parent !== node) { + child = child.walk(); + } + } + } + for (var i = 0; i < elements.length; i++) { + node = elements[i]; + if (node.name === 'p' && node.firstChild) { + var nodeText = getText(node); + if (isBulletList(nodeText)) { + convertParagraphToLi(node, 'ul'); + continue; + } + if (isNumericList(nodeText)) { + var matches = /([0-9]+)\./.exec(nodeText); + var start = 1; + if (matches) { + start = parseInt(matches[1], 10); + } + convertParagraphToLi(node, 'ol', start); + continue; + } + if (node._listLevel) { + convertParagraphToLi(node, 'ul', 1); + continue; + } + currentListNode = null; + } else { + prevListNode = currentListNode; + currentListNode = null; + } + } + } + function filterStyles(editor, validStyles, node, styleValue) { + var outputStyles = {}, matches; + var styles = editor.dom.parseStyle(styleValue); + global$6.each(styles, function (value, name) { + switch (name) { + case 'mso-list': + matches = /\w+ \w+([0-9]+)/i.exec(styleValue); + if (matches) { + node._listLevel = parseInt(matches[1], 10); + } + if (/Ignore/i.test(value) && node.firstChild) { + node._listIgnore = true; + node.firstChild._listIgnore = true; + } + break; + case 'horiz-align': + name = 'text-align'; + break; + case 'vert-align': + name = 'vertical-align'; + break; + case 'font-color': + case 'mso-foreground': + name = 'color'; + break; + case 'mso-background': + case 'mso-highlight': + name = 'background'; + break; + case 'font-weight': + case 'font-style': + if (value !== 'normal') { + outputStyles[name] = value; + } + return; + case 'mso-element': + if (/^(comment|comment-list)$/i.test(value)) { + node.remove(); + return; + } + break; + } + if (name.indexOf('mso-comment') === 0) { + node.remove(); + return; + } + if (name.indexOf('mso-') === 0) { + return; + } + if (getRetainStyleProps(editor) === 'all' || validStyles && validStyles[name]) { + outputStyles[name] = value; + } + }); + if (/(bold)/i.test(outputStyles['font-weight'])) { + delete outputStyles['font-weight']; + node.wrap(new global$9('b', 1)); + } + if (/(italic)/i.test(outputStyles['font-style'])) { + delete outputStyles['font-style']; + node.wrap(new global$9('i', 1)); + } + outputStyles = editor.dom.serializeStyle(outputStyles, node.name); + if (outputStyles) { + return outputStyles; + } + return null; + } + var filterWordContent = function (editor, content) { + var validStyles; + var retainStyleProperties = getRetainStyleProps(editor); + if (retainStyleProperties) { + validStyles = global$6.makeMap(retainStyleProperties.split(/[, ]/)); + } + content = filter$1(content, [ + /
    /gi, + /]+id="?docs-internal-[^>]*>/gi, + //gi, + /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi, + [ + /<(\/?)s>/gi, + '<$1strike>' + ], + [ + / /gi, + nbsp + ], + [ + /([\s\u00a0]*)<\/span>/gi, + function (str, spaces) { + return spaces.length > 0 ? spaces.replace(/./, ' ').slice(Math.floor(spaces.length / 2)).split('').join(nbsp) : ''; + } + ] + ]); + var validElements = getWordValidElements(editor); + var schema = global$a({ + valid_elements: validElements, + valid_children: '-li[p]' + }); + global$6.each(schema.elements, function (rule) { + if (!rule.attributes.class) { + rule.attributes.class = {}; + rule.attributesOrder.push('class'); + } + if (!rule.attributes.style) { + rule.attributes.style = {}; + rule.attributesOrder.push('style'); + } + }); + var domParser = global$7({}, schema); + domParser.addAttributeFilter('style', function (nodes) { + var i = nodes.length, node; + while (i--) { + node = nodes[i]; + node.attr('style', filterStyles(editor, validStyles, node, node.attr('style'))); + if (node.name === 'span' && node.parent && !node.attributes.length) { + node.unwrap(); + } + } + }); + domParser.addAttributeFilter('class', function (nodes) { + var i = nodes.length, node, className; + while (i--) { + node = nodes[i]; + className = node.attr('class'); + if (/^(MsoCommentReference|MsoCommentText|msoDel)$/i.test(className)) { + node.remove(); + } + node.attr('class', null); + } + }); + domParser.addNodeFilter('del', function (nodes) { + var i = nodes.length; + while (i--) { + nodes[i].remove(); + } + }); + domParser.addNodeFilter('a', function (nodes) { + var i = nodes.length, node, href, name; + while (i--) { + node = nodes[i]; + href = node.attr('href'); + name = node.attr('name'); + if (href && href.indexOf('#_msocom_') !== -1) { + node.remove(); + continue; + } + if (href && href.indexOf('file://') === 0) { + href = href.split('#')[1]; + if (href) { + href = '#' + href; + } + } + if (!href && !name) { + node.unwrap(); + } else { + if (name && !/^_?(?:toc|edn|ftn)/i.test(name)) { + node.unwrap(); + continue; + } + node.attr({ + href: href, + name: name + }); + } + } + }); + var rootNode = domParser.parse(content); + if (shouldConvertWordFakeLists(editor)) { + convertFakeListsToProperLists(rootNode); + } + content = global$8({ validate: getValidate(editor) }, schema).serialize(rootNode); + return content; + }; + var preProcess = function (editor, content) { + return shouldUseDefaultFilters(editor) ? filterWordContent(editor, content) : content; + }; + + var preProcess$1 = function (editor, html) { + var parser = global$7({}, editor.schema); + parser.addNodeFilter('meta', function (nodes) { + global$6.each(nodes, function (node) { + node.remove(); + }); + }); + var fragment = parser.parse(html, { + forced_root_block: false, + isRootContent: true + }); + return global$8({ validate: getValidate(editor) }, editor.schema).serialize(fragment); + }; + var processResult = function (content, cancelled) { + return { + content: content, + cancelled: cancelled + }; + }; + var postProcessFilter = function (editor, html, internal, isWordHtml) { + var tempBody = editor.dom.create('div', { style: 'display:none' }, html); + var postProcessArgs = firePastePostProcess(editor, tempBody, internal, isWordHtml); + return processResult(postProcessArgs.node.innerHTML, postProcessArgs.isDefaultPrevented()); + }; + var filterContent = function (editor, content, internal, isWordHtml) { + var preProcessArgs = firePastePreProcess(editor, content, internal, isWordHtml); + var filteredContent = preProcess$1(editor, preProcessArgs.content); + if (editor.hasEventListeners('PastePostProcess') && !preProcessArgs.isDefaultPrevented()) { + return postProcessFilter(editor, filteredContent, internal, isWordHtml); + } else { + return processResult(filteredContent, preProcessArgs.isDefaultPrevented()); + } + }; + var process = function (editor, html, internal) { + var isWordHtml = isWordContent(html); + var content = isWordHtml ? preProcess(editor, html) : html; + return filterContent(editor, content, internal, isWordHtml); + }; + + var pasteHtml = function (editor, html) { + editor.insertContent(html, { + merge: shouldMergeFormats(editor), + paste: true + }); + return true; + }; + var isAbsoluteUrl = function (url) { + return /^https?:\/\/[\w\?\-\/+=.&%@~#]+$/i.test(url); + }; + var isImageUrl = function (url) { + return isAbsoluteUrl(url) && /.(gif|jpe?g|png)$/.test(url); + }; + var createImage = function (editor, url, pasteHtmlFn) { + editor.undoManager.extra(function () { + pasteHtmlFn(editor, url); + }, function () { + editor.insertContent(''); + }); + return true; + }; + var createLink = function (editor, url, pasteHtmlFn) { + editor.undoManager.extra(function () { + pasteHtmlFn(editor, url); + }, function () { + editor.execCommand('mceInsertLink', false, url); + }); + return true; + }; + var linkSelection = function (editor, html, pasteHtmlFn) { + return editor.selection.isCollapsed() === false && isAbsoluteUrl(html) ? createLink(editor, html, pasteHtmlFn) : false; + }; + var insertImage = function (editor, html, pasteHtmlFn) { + return isImageUrl(html) ? createImage(editor, html, pasteHtmlFn) : false; + }; + var smartInsertContent = function (editor, html) { + global$6.each([ + linkSelection, + insertImage, + pasteHtml + ], function (action) { + return action(editor, html, pasteHtml) !== true; + }); + }; + var insertContent = function (editor, html, pasteAsText) { + if (pasteAsText || isSmartPasteEnabled(editor) === false) { + pasteHtml(editor, html); + } else { + smartInsertContent(editor, html); + } + }; + + var repeat = function (s, count) { + return count <= 0 ? '' : new Array(count + 1).join(s); + }; + + var isCollapsibleWhitespace = function (c) { + return ' \f\t\x0B'.indexOf(c) !== -1; + }; + var isNewLineChar = function (c) { + return c === '\n' || c === '\r'; + }; + var isNewline = function (text, idx) { + return idx < text.length && idx >= 0 ? isNewLineChar(text[idx]) : false; + }; + var normalizeWhitespace = function (editor, text) { + var tabSpace = repeat(' ', getTabSpaces(editor)); + var normalizedText = text.replace(/\t/g, tabSpace); + var result = foldl(normalizedText, function (acc, c) { + if (isCollapsibleWhitespace(c) || c === nbsp) { + if (acc.pcIsSpace || acc.str === '' || acc.str.length === normalizedText.length - 1 || isNewline(normalizedText, acc.str.length + 1)) { + return { + pcIsSpace: false, + str: acc.str + nbsp + }; + } else { + return { + pcIsSpace: true, + str: acc.str + ' ' + }; + } + } else { + return { + pcIsSpace: isNewLineChar(c), + str: acc.str + c + }; + } + }, { + pcIsSpace: false, + str: '' + }); + return result.str; + }; + + var doPaste = function (editor, content, internal, pasteAsText) { + var args = process(editor, content, internal); + if (args.cancelled === false) { + insertContent(editor, args.content, pasteAsText); + } + }; + var pasteHtml$1 = function (editor, html, internalFlag) { + var internal = internalFlag ? internalFlag : isMarked(html); + doPaste(editor, unmark(html), internal, false); + }; + var pasteText = function (editor, text) { + var encodedText = editor.dom.encode(text).replace(/\r\n/g, '\n'); + var normalizedText = normalizeWhitespace(editor, encodedText); + var html = convert(normalizedText, getForcedRootBlock(editor), getForcedRootBlockAttrs(editor)); + doPaste(editor, html, false, true); + }; + var getDataTransferItems = function (dataTransfer) { + var items = {}; + var mceInternalUrlPrefix = 'data:text/mce-internal,'; + if (dataTransfer) { + if (dataTransfer.getData) { + var legacyText = dataTransfer.getData('Text'); + if (legacyText && legacyText.length > 0) { + if (legacyText.indexOf(mceInternalUrlPrefix) === -1) { + items['text/plain'] = legacyText; + } + } + } + if (dataTransfer.types) { + for (var i = 0; i < dataTransfer.types.length; i++) { + var contentType = dataTransfer.types[i]; + try { + items[contentType] = dataTransfer.getData(contentType); + } catch (ex) { + items[contentType] = ''; + } + } + } + } + return items; + }; + var getClipboardContent = function (editor, clipboardEvent) { + return getDataTransferItems(clipboardEvent.clipboardData || editor.getDoc().dataTransfer); + }; + var hasContentType = function (clipboardContent, mimeType) { + return mimeType in clipboardContent && clipboardContent[mimeType].length > 0; + }; + var hasHtmlOrText = function (content) { + return hasContentType(content, 'text/html') || hasContentType(content, 'text/plain'); + }; + var parseDataUri = function (uri) { + var matches = /data:([^;]+);base64,([a-z0-9\+\/=]+)/i.exec(uri); + if (matches) { + return { + type: matches[1], + data: decodeURIComponent(matches[2]) + }; + } else { + return { + type: null, + data: null + }; + } + }; + var isValidDataUriImage = function (editor, imgElm) { + var filter = getImagesDataImgFilter(editor); + return filter ? filter(imgElm) : true; + }; + var extractFilename = function (editor, str) { + var m = str.match(/([\s\S]+?)\.(?:jpeg|jpg|png|gif)$/i); + return m ? editor.dom.encode(m[1]) : null; + }; + var uniqueId = createIdGenerator('mceclip'); + var pasteImage = function (editor, imageItem) { + var _a = parseDataUri(imageItem.uri), base64 = _a.data, type = _a.type; + var id = uniqueId(); + var name = getImagesReuseFilename(editor) && imageItem.blob.name ? extractFilename(editor, imageItem.blob.name) : id; + var img = new Image(); + img.src = imageItem.uri; + if (isValidDataUriImage(editor, img)) { + var blobCache = editor.editorUpload.blobCache; + var blobInfo = void 0; + var existingBlobInfo = blobCache.getByData(base64, type); + if (!existingBlobInfo) { + blobInfo = blobCache.create(id, imageItem.blob, base64, name); + blobCache.add(blobInfo); + } else { + blobInfo = existingBlobInfo; + } + pasteHtml$1(editor, '', false); + } else { + pasteHtml$1(editor, '', false); + } + }; + var isClipboardEvent = function (event) { + return event.type === 'paste'; + }; + var readBlobsAsDataUris = function (items) { + return global$3.all(map(items, function (item) { + return new global$3(function (resolve) { + var blob = item.getAsFile ? item.getAsFile() : item; + var reader = new window.FileReader(); + reader.onload = function () { + resolve({ + blob: blob, + uri: reader.result + }); + }; + reader.readAsDataURL(blob); + }); + })); + }; + var getImagesFromDataTransfer = function (dataTransfer) { + var items = dataTransfer.items ? map(from$1(dataTransfer.items), function (item) { + return item.getAsFile(); + }) : []; + var files = dataTransfer.files ? from$1(dataTransfer.files) : []; + var images = filter(items.length > 0 ? items : files, function (file) { + return /^image\/(jpeg|png|gif|bmp)$/.test(file.type); + }); + return images; + }; + var pasteImageData = function (editor, e, rng) { + var dataTransfer = isClipboardEvent(e) ? e.clipboardData : e.dataTransfer; + if (getPasteDataImages(editor) && dataTransfer) { + var images = getImagesFromDataTransfer(dataTransfer); + if (images.length > 0) { + e.preventDefault(); + readBlobsAsDataUris(images).then(function (blobResults) { + if (rng) { + editor.selection.setRng(rng); + } + each(blobResults, function (result) { + pasteImage(editor, result); + }); + }); + return true; + } + } + return false; + }; + var isBrokenAndroidClipboardEvent = function (e) { + var clipboardData = e.clipboardData; + return navigator.userAgent.indexOf('Android') !== -1 && clipboardData && clipboardData.items && clipboardData.items.length === 0; + }; + var isKeyboardPasteEvent = function (e) { + return global$4.metaKeyPressed(e) && e.keyCode === 86 || e.shiftKey && e.keyCode === 45; + }; + var registerEventHandlers = function (editor, pasteBin, pasteFormat) { + var keyboardPasteEvent = value(); + var keyboardPastePlainTextState; + editor.on('keydown', function (e) { + function removePasteBinOnKeyUp(e) { + if (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) { + pasteBin.remove(); + } + } + if (isKeyboardPasteEvent(e) && !e.isDefaultPrevented()) { + keyboardPastePlainTextState = e.shiftKey && e.keyCode === 86; + if (keyboardPastePlainTextState && global$1.webkit && navigator.userAgent.indexOf('Version/') !== -1) { + return; + } + e.stopImmediatePropagation(); + keyboardPasteEvent.set(e); + window.setTimeout(function () { + keyboardPasteEvent.clear(); + }, 100); + if (global$1.ie && keyboardPastePlainTextState) { + e.preventDefault(); + firePaste(editor, true); + return; + } + pasteBin.remove(); + pasteBin.create(); + editor.once('keyup', removePasteBinOnKeyUp); + editor.once('paste', function () { + editor.off('keyup', removePasteBinOnKeyUp); + }); + } + }); + function insertClipboardContent(clipboardContent, isKeyBoardPaste, plainTextMode, internal) { + var content; + if (hasContentType(clipboardContent, 'text/html')) { + content = clipboardContent['text/html']; + } else { + content = pasteBin.getHtml(); + internal = internal ? internal : isMarked(content); + if (pasteBin.isDefaultContent(content)) { + plainTextMode = true; + } + } + content = trimHtml(content); + pasteBin.remove(); + var isPlainTextHtml = internal === false && isPlainText(content); + var isImage = isImageUrl(content); + if (!content.length || isPlainTextHtml && !isImage) { + plainTextMode = true; + } + if (plainTextMode || isImage) { + if (hasContentType(clipboardContent, 'text/plain') && isPlainTextHtml) { + content = clipboardContent['text/plain']; + } else { + content = innerText(content); + } + } + if (pasteBin.isDefaultContent(content)) { + if (!isKeyBoardPaste) { + editor.windowManager.alert('Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.'); + } + return; + } + if (plainTextMode) { + pasteText(editor, content); + } else { + pasteHtml$1(editor, content, internal); + } + } + var getLastRng = function () { + return pasteBin.getLastRng() || editor.selection.getRng(); + }; + editor.on('paste', function (e) { + var isKeyBoardPaste = keyboardPasteEvent.isSet(); + var clipboardContent = getClipboardContent(editor, e); + var plainTextMode = pasteFormat.get() === 'text' || keyboardPastePlainTextState; + var internal = hasContentType(clipboardContent, internalHtmlMime()); + keyboardPastePlainTextState = false; + if (e.isDefaultPrevented() || isBrokenAndroidClipboardEvent(e)) { + pasteBin.remove(); + return; + } + if (!hasHtmlOrText(clipboardContent) && pasteImageData(editor, e, getLastRng())) { + pasteBin.remove(); + return; + } + if (!isKeyBoardPaste) { + e.preventDefault(); + } + if (global$1.ie && (!isKeyBoardPaste || e.ieFake) && !hasContentType(clipboardContent, 'text/html')) { + pasteBin.create(); + editor.dom.bind(pasteBin.getEl(), 'paste', function (e) { + e.stopPropagation(); + }); + editor.getDoc().execCommand('Paste', false, null); + clipboardContent['text/html'] = pasteBin.getHtml(); + } + if (hasContentType(clipboardContent, 'text/html')) { + e.preventDefault(); + if (!internal) { + internal = isMarked(clipboardContent['text/html']); + } + insertClipboardContent(clipboardContent, isKeyBoardPaste, plainTextMode, internal); + } else { + global$2.setEditorTimeout(editor, function () { + insertClipboardContent(clipboardContent, isKeyBoardPaste, plainTextMode, internal); + }, 0); + } + }); + }; + var registerEventsAndFilters = function (editor, pasteBin, pasteFormat) { + registerEventHandlers(editor, pasteBin, pasteFormat); + var src; + editor.parser.addNodeFilter('img', function (nodes, name, args) { + var isPasteInsert = function (args) { + return args.data && args.data.paste === true; + }; + var remove = function (node) { + if (!node.attr('data-mce-object') && src !== global$1.transparentSrc) { + node.remove(); + } + }; + var isWebKitFakeUrl = function (src) { + return src.indexOf('webkit-fake-url') === 0; + }; + var isDataUri = function (src) { + return src.indexOf('data:') === 0; + }; + if (!getPasteDataImages(editor) && isPasteInsert(args)) { + var i = nodes.length; + while (i--) { + src = nodes[i].attr('src'); + if (!src) { + continue; + } + if (isWebKitFakeUrl(src)) { + remove(nodes[i]); + } else if (!getAllowHtmlDataUrls(editor) && isDataUri(src)) { + remove(nodes[i]); + } + } + } + }); + }; + + var getPasteBinParent = function (editor) { + return global$1.ie && editor.inline ? document.body : editor.getBody(); + }; + var isExternalPasteBin = function (editor) { + return getPasteBinParent(editor) !== editor.getBody(); + }; + var delegatePasteEvents = function (editor, pasteBinElm, pasteBinDefaultContent) { + if (isExternalPasteBin(editor)) { + editor.dom.bind(pasteBinElm, 'paste keyup', function (_e) { + if (!isDefault(editor, pasteBinDefaultContent)) { + editor.fire('paste'); + } + }); + } + }; + var create = function (editor, lastRngCell, pasteBinDefaultContent) { + var dom = editor.dom, body = editor.getBody(); + lastRngCell.set(editor.selection.getRng()); + var pasteBinElm = editor.dom.add(getPasteBinParent(editor), 'div', { + 'id': 'mcepastebin', + 'class': 'mce-pastebin', + 'contentEditable': true, + 'data-mce-bogus': 'all', + 'style': 'position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0' + }, pasteBinDefaultContent); + if (global$1.ie || global$1.gecko) { + dom.setStyle(pasteBinElm, 'left', dom.getStyle(body, 'direction', true) === 'rtl' ? 65535 : -65535); + } + dom.bind(pasteBinElm, 'beforedeactivate focusin focusout', function (e) { + e.stopPropagation(); + }); + delegatePasteEvents(editor, pasteBinElm, pasteBinDefaultContent); + pasteBinElm.focus(); + editor.selection.select(pasteBinElm, true); + }; + var remove = function (editor, lastRngCell) { + if (getEl(editor)) { + var pasteBinClone = void 0; + var lastRng = lastRngCell.get(); + while (pasteBinClone = editor.dom.get('mcepastebin')) { + editor.dom.remove(pasteBinClone); + editor.dom.unbind(pasteBinClone); + } + if (lastRng) { + editor.selection.setRng(lastRng); + } + } + lastRngCell.set(null); + }; + var getEl = function (editor) { + return editor.dom.get('mcepastebin'); + }; + var getHtml = function (editor) { + var copyAndRemove = function (toElm, fromElm) { + toElm.appendChild(fromElm); + editor.dom.remove(fromElm, true); + }; + var pasteBinClones = global$6.grep(getPasteBinParent(editor).childNodes, function (elm) { + return elm.id === 'mcepastebin'; + }); + var pasteBinElm = pasteBinClones.shift(); + global$6.each(pasteBinClones, function (pasteBinClone) { + copyAndRemove(pasteBinElm, pasteBinClone); + }); + var dirtyWrappers = editor.dom.select('div[id=mcepastebin]', pasteBinElm); + for (var i = dirtyWrappers.length - 1; i >= 0; i--) { + var cleanWrapper = editor.dom.create('div'); + pasteBinElm.insertBefore(cleanWrapper, dirtyWrappers[i]); + copyAndRemove(cleanWrapper, dirtyWrappers[i]); + } + return pasteBinElm ? pasteBinElm.innerHTML : ''; + }; + var getLastRng = function (lastRng) { + return lastRng.get(); + }; + var isDefaultContent = function (pasteBinDefaultContent, content) { + return content === pasteBinDefaultContent; + }; + var isPasteBin = function (elm) { + return elm && elm.id === 'mcepastebin'; + }; + var isDefault = function (editor, pasteBinDefaultContent) { + var pasteBinElm = getEl(editor); + return isPasteBin(pasteBinElm) && isDefaultContent(pasteBinDefaultContent, pasteBinElm.innerHTML); + }; + var PasteBin = function (editor) { + var lastRng = Cell(null); + var pasteBinDefaultContent = '%MCEPASTEBIN%'; + return { + create: function () { + return create(editor, lastRng, pasteBinDefaultContent); + }, + remove: function () { + return remove(editor, lastRng); + }, + getEl: function () { + return getEl(editor); + }, + getHtml: function () { + return getHtml(editor); + }, + getLastRng: function () { + return getLastRng(lastRng); + }, + isDefault: function () { + return isDefault(editor, pasteBinDefaultContent); + }, + isDefaultContent: function (content) { + return isDefaultContent(pasteBinDefaultContent, content); + } + }; + }; + + var Clipboard = function (editor, pasteFormat) { + var pasteBin = PasteBin(editor); + editor.on('PreInit', function () { + return registerEventsAndFilters(editor, pasteBin, pasteFormat); + }); + return { + pasteFormat: pasteFormat, + pasteHtml: function (html, internalFlag) { + return pasteHtml$1(editor, html, internalFlag); + }, + pasteText: function (text) { + return pasteText(editor, text); + }, + pasteImageData: function (e, rng) { + return pasteImageData(editor, e, rng); + }, + getDataTransferItems: getDataTransferItems, + hasHtmlOrText: hasHtmlOrText, + hasContentType: hasContentType + }; + }; + + var togglePlainTextPaste = function (editor, clipboard) { + if (clipboard.pasteFormat.get() === 'text') { + clipboard.pasteFormat.set('html'); + firePastePlainTextToggle(editor, false); + } else { + clipboard.pasteFormat.set('text'); + firePastePlainTextToggle(editor, true); + } + editor.focus(); + }; + + var register = function (editor, clipboard) { + editor.addCommand('mceTogglePlainTextPaste', function () { + togglePlainTextPaste(editor, clipboard); + }); + editor.addCommand('mceInsertClipboardContent', function (ui, value) { + if (value.content) { + clipboard.pasteHtml(value.content, value.internal); + } + if (value.text) { + clipboard.pasteText(value.text); + } + }); + }; + + var hasWorkingClipboardApi = function (clipboardData) { + return global$1.iOS === false && typeof (clipboardData === null || clipboardData === void 0 ? void 0 : clipboardData.setData) === 'function'; + }; + var setHtml5Clipboard = function (clipboardData, html, text) { + if (hasWorkingClipboardApi(clipboardData)) { + try { + clipboardData.clearData(); + clipboardData.setData('text/html', html); + clipboardData.setData('text/plain', text); + clipboardData.setData(internalHtmlMime(), html); + return true; + } catch (e) { + return false; + } + } else { + return false; + } + }; + var setClipboardData = function (evt, data, fallback, done) { + if (setHtml5Clipboard(evt.clipboardData, data.html, data.text)) { + evt.preventDefault(); + done(); + } else { + fallback(data.html, done); + } + }; + var fallback = function (editor) { + return function (html, done) { + var markedHtml = mark(html); + var outer = editor.dom.create('div', { + 'contenteditable': 'false', + 'data-mce-bogus': 'all' + }); + var inner = editor.dom.create('div', { contenteditable: 'true' }, markedHtml); + editor.dom.setStyles(outer, { + position: 'fixed', + top: '0', + left: '-3000px', + width: '1000px', + overflow: 'hidden' + }); + outer.appendChild(inner); + editor.dom.add(editor.getBody(), outer); + var range = editor.selection.getRng(); + inner.focus(); + var offscreenRange = editor.dom.createRng(); + offscreenRange.selectNodeContents(inner); + editor.selection.setRng(offscreenRange); + global$2.setTimeout(function () { + editor.selection.setRng(range); + outer.parentNode.removeChild(outer); + done(); + }, 0); + }; + }; + var getData = function (editor) { + return { + html: editor.selection.getContent({ contextual: true }), + text: editor.selection.getContent({ format: 'text' }) + }; + }; + var isTableSelection = function (editor) { + return !!editor.dom.getParent(editor.selection.getStart(), 'td[data-mce-selected],th[data-mce-selected]', editor.getBody()); + }; + var hasSelectedContent = function (editor) { + return !editor.selection.isCollapsed() || isTableSelection(editor); + }; + var cut = function (editor) { + return function (evt) { + if (hasSelectedContent(editor)) { + setClipboardData(evt, getData(editor), fallback(editor), function () { + if (global$1.browser.isChrome()) { + var rng_1 = editor.selection.getRng(); + global$2.setEditorTimeout(editor, function () { + editor.selection.setRng(rng_1); + editor.execCommand('Delete'); + }, 0); + } else { + editor.execCommand('Delete'); + } + }); + } + }; + }; + var copy = function (editor) { + return function (evt) { + if (hasSelectedContent(editor)) { + setClipboardData(evt, getData(editor), fallback(editor), function () { + }); + } + }; + }; + var register$1 = function (editor) { + editor.on('cut', cut(editor)); + editor.on('copy', copy(editor)); + }; + + var global$b = tinymce.util.Tools.resolve('tinymce.dom.RangeUtils'); + + var getCaretRangeFromEvent = function (editor, e) { + return global$b.getCaretRangeFromPoint(e.clientX, e.clientY, editor.getDoc()); + }; + var isPlainTextFileUrl = function (content) { + var plainTextContent = content['text/plain']; + return plainTextContent ? plainTextContent.indexOf('file://') === 0 : false; + }; + var setFocusedRange = function (editor, rng) { + editor.focus(); + editor.selection.setRng(rng); + }; + var setup = function (editor, clipboard, draggingInternallyState) { + if (shouldBlockDrop(editor)) { + editor.on('dragend dragover draggesture dragdrop drop drag', function (e) { + e.preventDefault(); + e.stopPropagation(); + }); + } + if (!shouldPasteDataImages(editor)) { + editor.on('drop', function (e) { + var dataTransfer = e.dataTransfer; + if (dataTransfer && dataTransfer.files && dataTransfer.files.length > 0) { + e.preventDefault(); + } + }); + } + editor.on('drop', function (e) { + var rng = getCaretRangeFromEvent(editor, e); + if (e.isDefaultPrevented() || draggingInternallyState.get()) { + return; + } + var dropContent = clipboard.getDataTransferItems(e.dataTransfer); + var internal = clipboard.hasContentType(dropContent, internalHtmlMime()); + if ((!clipboard.hasHtmlOrText(dropContent) || isPlainTextFileUrl(dropContent)) && clipboard.pasteImageData(e, rng)) { + return; + } + if (rng && shouldFilterDrop(editor)) { + var content_1 = dropContent['mce-internal'] || dropContent['text/html'] || dropContent['text/plain']; + if (content_1) { + e.preventDefault(); + global$2.setEditorTimeout(editor, function () { + editor.undoManager.transact(function () { + if (dropContent['mce-internal']) { + editor.execCommand('Delete'); + } + setFocusedRange(editor, rng); + content_1 = trimHtml(content_1); + if (!dropContent['text/html']) { + clipboard.pasteText(content_1); + } else { + clipboard.pasteHtml(content_1, internal); + } + }); + }); + } + } + }); + editor.on('dragstart', function (_e) { + draggingInternallyState.set(true); + }); + editor.on('dragover dragend', function (e) { + if (shouldPasteDataImages(editor) && draggingInternallyState.get() === false) { + e.preventDefault(); + setFocusedRange(editor, getCaretRangeFromEvent(editor, e)); + } + if (e.type === 'dragend') { + draggingInternallyState.set(false); + } + }); + }; + + var setup$1 = function (editor) { + var plugin = editor.plugins.paste; + var preProcess = getPreProcess(editor); + if (preProcess) { + editor.on('PastePreProcess', function (e) { + preProcess.call(plugin, plugin, e); + }); + } + var postProcess = getPostProcess(editor); + if (postProcess) { + editor.on('PastePostProcess', function (e) { + postProcess.call(plugin, plugin, e); + }); + } + }; + + function addPreProcessFilter(editor, filterFunc) { + editor.on('PastePreProcess', function (e) { + e.content = filterFunc(editor, e.content, e.internal, e.wordContent); + }); + } + function addPostProcessFilter(editor, filterFunc) { + editor.on('PastePostProcess', function (e) { + filterFunc(editor, e.node); + }); + } + function removeExplorerBrElementsAfterBlocks(editor, html) { + if (!isWordContent(html)) { + return html; + } + var blockElements = []; + global$6.each(editor.schema.getBlockElements(), function (block, blockName) { + blockElements.push(blockName); + }); + var explorerBlocksRegExp = new RegExp('(?:
     [\\s\\r\\n]+|
    )*(<\\/?(' + blockElements.join('|') + ')[^>]*>)(?:
     [\\s\\r\\n]+|
    )*', 'g'); + html = filter$1(html, [[ + explorerBlocksRegExp, + '$1' + ]]); + html = filter$1(html, [ + [ + /

    /g, + '

    ' + ], + [ + /
    /g, + ' ' + ], + [ + /

    /g, + '
    ' + ] + ]); + return html; + } + function removeWebKitStyles(editor, content, internal, isWordHtml) { + if (isWordHtml || internal) { + return content; + } + var webKitStylesSetting = getWebkitStyles(editor); + var webKitStyles; + if (shouldRemoveWebKitStyles(editor) === false || webKitStylesSetting === 'all') { + return content; + } + if (webKitStylesSetting) { + webKitStyles = webKitStylesSetting.split(/[, ]/); + } + if (webKitStyles) { + var dom_1 = editor.dom, node_1 = editor.selection.getNode(); + content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, function (all, before, value, after) { + var inputStyles = dom_1.parseStyle(dom_1.decode(value)); + var outputStyles = {}; + if (webKitStyles === 'none') { + return before + after; + } + for (var i = 0; i < webKitStyles.length; i++) { + var inputValue = inputStyles[webKitStyles[i]], currentValue = dom_1.getStyle(node_1, webKitStyles[i], true); + if (/color/.test(webKitStyles[i])) { + inputValue = dom_1.toHex(inputValue); + currentValue = dom_1.toHex(currentValue); + } + if (currentValue !== inputValue) { + outputStyles[webKitStyles[i]] = inputValue; + } + } + outputStyles = dom_1.serializeStyle(outputStyles, 'span'); + if (outputStyles) { + return before + ' style="' + outputStyles + '"' + after; + } + return before + after; + }); + } else { + content = content.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi, '$1$3'); + } + content = content.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi, function (all, before, value, after) { + return before + ' style="' + value + '"' + after; + }); + return content; + } + function removeUnderlineAndFontInAnchor(editor, root) { + editor.$('a', root).find('font,u').each(function (i, node) { + editor.dom.remove(node, true); + }); + } + var setup$2 = function (editor) { + if (global$1.webkit) { + addPreProcessFilter(editor, removeWebKitStyles); + } + if (global$1.ie) { + addPreProcessFilter(editor, removeExplorerBrElementsAfterBlocks); + addPostProcessFilter(editor, removeUnderlineAndFontInAnchor); + } + }; + + var makeSetupHandler = function (editor, clipboard) { + return function (api) { + api.setActive(clipboard.pasteFormat.get() === 'text'); + var pastePlainTextToggleHandler = function (e) { + return api.setActive(e.state); + }; + editor.on('PastePlainTextToggle', pastePlainTextToggleHandler); + return function () { + return editor.off('PastePlainTextToggle', pastePlainTextToggleHandler); + }; + }; + }; + var register$2 = function (editor, clipboard) { + editor.ui.registry.addToggleButton('pastetext', { + active: false, + icon: 'paste-text', + tooltip: 'Paste as text', + onAction: function () { + return editor.execCommand('mceTogglePlainTextPaste'); + }, + onSetup: makeSetupHandler(editor, clipboard) + }); + editor.ui.registry.addToggleMenuItem('pastetext', { + text: 'Paste as text', + icon: 'paste-text', + onAction: function () { + return editor.execCommand('mceTogglePlainTextPaste'); + }, + onSetup: makeSetupHandler(editor, clipboard) + }); + }; + + function Plugin () { + global.add('paste', function (editor) { + if (hasProPlugin(editor) === false) { + var draggingInternallyState = Cell(false); + var pasteFormat = Cell(isPasteAsTextEnabled(editor) ? 'text' : 'html'); + var clipboard = Clipboard(editor, pasteFormat); + var quirks = setup$2(editor); + register$2(editor, clipboard); + register(editor, clipboard); + setup$1(editor); + register$1(editor); + setup(editor, clipboard, draggingInternallyState); + return get(clipboard, quirks); + } + }); + } + + Plugin(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/paste/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/paste/plugin.min.js old mode 100755 new mode 100644 index 3cce5f864fd6..15160d421b6c --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/paste/plugin.min.js +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/paste/plugin.min.js @@ -1 +1,9 @@ -!function(e,t){"use strict";function n(e,t){for(var n,i=[],r=0;r"),t&&/^(PRE|DIV)$/.test(t.nodeName)||!a?e=n.filter(e,[[/\n/g,"
    "]]):(e=n.filter(e,[[/\n\n/g,"

    "+o],[/^(.*<\/p>)(

    )$/,o+"$1"],[/\n/g,"
    "]]),-1!=e.indexOf("

    ")&&(e=o+e)),r(e)}function o(){var t=i.dom,n=i.getBody(),r=i.dom.getViewPort(i.getWin()),a=r.y,o=20,s;if(h=i.selection.getRng(),i.inline&&(s=i.selection.getScrollContainer(),s&&(a=s.scrollTop)),h.getClientRects){var c=h.getClientRects();if(c.length)o=a+(c[0].top-t.getPos(n).y);else{o=a;var l=h.startContainer;l&&(3==l.nodeType&&l.parentNode!=n&&(l=l.parentNode),1==l.nodeType&&(o=t.getPos(l,s||n).y))}}v=t.add(i.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"1",style:"position: absolute; top: "+o+"px;width: 10px; height: 10px; overflow: hidden; opacity: 0"},b),(e.ie||e.gecko)&&t.setStyle(v,"left","rtl"==t.getStyle(n,"direction",!0)?65535:-65535),t.bind(v,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),v.focus(),i.selection.select(v,!0)}function s(){if(v){for(var e;e=i.dom.get("mcepastebin");)i.dom.remove(e),i.dom.unbind(e);h&&i.selection.setRng(h)}x=!1,v=h=null}function c(){var e=b,t,n;for(t=i.dom.select("div[id=mcepastebin]"),n=t.length;n--;){var r=t[n].innerHTML;e==b&&(e=""),r.length>e.length&&(e=r)}return e}function l(e){var t={};if(e&&e.types){var n=e.getData("Text");n&&n.length>0&&(t["text/plain"]=n);for(var i=0;i')},t.readAsDataURL(e.getAsFile()),!0}}if(!(!i.settings.paste_data_images||"text/html"in t||"text/plain"in t)&&e.clipboardData){var a=e.clipboardData.items;if(a)for(var o=0;o0}function m(){i.on("keydown",function(n){if(!n.isDefaultPrevented()&&(t.metaKeyPressed(n)&&86==n.keyCode||n.shiftKey&&45==n.keyCode)){if(x=n.shiftKey&&86==n.keyCode,n.stopImmediatePropagation(),y=(new Date).getTime(),e.ie&&x)return n.preventDefault(),void i.fire("paste",{ieFake:!0});s(),o()}}),i.on("paste",function(t){var l=u(t),d=(new Date).getTime()-y<1e3,m="text"==g.pasteFormat||x;return t.isDefaultPrevented()?void s():p(t,l)?void s():(d||t.preventDefault(),!e.ie||d&&!t.ieFake||(o(),i.dom.bind(v,"paste",function(e){e.stopPropagation()}),i.getDoc().execCommand("Paste",!1,null),l["text/html"]=c()),void setTimeout(function(){var e=c();return v&&v.firstChild&&"mcepastebin"===v.firstChild.id&&(m=!0),s(),e!=b&&d||(e=l["text/html"]||l["text/plain"]||b,e!=b)?(!f(l,"text/html")&&f(l,"text/plain")&&(m=!0),void(m?a(l["text/plain"]||n.innerText(e)):r(e))):void(d||i.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."))},0))}),i.on("dragstart",function(e){if(e.dataTransfer.types)try{e.dataTransfer.setData("mce-internal",i.selection.getContent())}catch(t){}}),i.on("drop",function(e){var t=d(e);if(t&&!e.isDefaultPrevented()){var n=l(e.dataTransfer),o=n["mce-internal"]||n["text/html"]||n["text/plain"];o&&(e.preventDefault(),i.undoManager.transact(function(){n["mce-internal"]&&i.execCommand("Delete"),i.selection.setRng(t),n["text/html"]?r(o):a(o)}))}})}var g=this,v,h,y=0,b="%MCEPASTEBIN%",x;g.pasteHtml=r,g.pasteText=a,i.on("preInit",function(){m(),i.parser.addNodeFilter("img",function(t){if(!i.settings.paste_data_images)for(var n=t.length;n--;){var r=t[n].attributes.map.src;r&&0===r.indexOf("data:image")&&(t[n].attr("data-mce-object")||r===e.transparentSrc||t[n].remove())}})}),i.on("PreProcess",function(){i.dom.remove(i.dom.get("mcepastebin"))})}}),i(g,[l,u,p,v,h,c],function(e,t,n,i,r,a){function o(e){return/c?n&&(n=n.parent.parent):(i=n,n=null)),n&&n.name==o?n.append(e):(i=i||n,n=new r(o,1),s>1&&n.attr("start",""+s),e.wrap(n)),e.name="li",t.value="";var l=t.next;l&&3==l.type&&(l.value=l.value.replace(/^\u00a0+/,"")),c>a&&i&&i.lastChild.append(n),a=c}for(var n,i,a=1,o=e.getAll("p"),s=0;s/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\xa0"],[/([\s\u00a0]*)<\/span>/gi,function(e,t){return t.length>0?t.replace(/./," ").slice(Math.floor(t.length/2)).split("").join("\xa0"):""}]]);var g=c.paste_word_valid_elements;g||(g="@[style],-strong/b,-em/i,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-table[width],-tr,-td[colspan|rowspan|width],-th,-thead,-tfoot,-tbody,-a[href|name],sub,sup,strike,br");var v=new n({valid_elements:g}),h=new t({},v);h.addAttributeFilter("style",function(e){for(var t=e.length,n;t--;)n=e[t],n.attr("style",p(n,n.attr("style"))),"span"!=n.name||n.attributes.length||n.unwrap()}),h.addNodeFilter("a",function(e){for(var t=e.length,n,i,r;t--;)n=e[t],i=n.attr("href"),r=n.attr("name"),i&&0===i.indexOf("file://")&&(i=i.split("#")[1],i&&(i="#"+i)),i||r?n.attr({href:i,name:r}):n.unwrap()});var y=h.parse(d);u(y),l.content=new i({},v).serialize(y)}})}return s.isWordContent=o,s}),i(y,[f,l,g,c],function(e,t,n,i){return function(r){function a(e){r.on("BeforePastePreProcess",function(t){t.content=e(t.content)})}function o(e){return e=i.filter(e,[/^[\s\S]*|[\s\S]*$/g,[/\u00a0<\/span>/g,"\xa0"],/
    $/i])}function s(e){if(!n.isWordContent(e))return e;var a=[];t.each(r.schema.getBlockElements(),function(e,t){a.push(t)});var o=new RegExp("(?:
     [\\s\\r\\n]+|
    )*(<\\/?("+a.join("|")+")[^>]*>)(?:
     [\\s\\r\\n]+|
    )*","g");return e=i.filter(e,[[o,"$1"]]),e=i.filter(e,[[/

    /g,"

    "],[/
    /g," "],[/

    /g,"
    "]])}function c(e){return(r.settings.paste_remove_styles||r.settings.paste_remove_styles_if_webkit!==!1)&&(e=e.replace(/ style=\"[^\"]+\"/g,"")),e}e.webkit&&(a(c),a(o)),e.ie&&a(s)}}),i(b,[x,d,g,y],function(e,t,n,i){var r;e.add("paste",function(e){function a(){"text"==s.pasteFormat?(this.active(!1),s.pasteFormat="html"):(s.pasteFormat="text",this.active(!0),r||(e.windowManager.alert("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off."),r=!0))}var o=this,s,c=e.settings;o.clipboard=s=new t(e),o.quirks=new i(e),o.wordFilter=new n(e),e.settings.paste_as_text&&(o.clipboard.pasteFormat="text"),c.paste_preprocess&&e.on("PastePreProcess",function(e){c.paste_preprocess.call(o,o,e)}),c.paste_postprocess&&e.on("PastePostProcess",function(e){c.paste_postprocess.call(o,o,e)}),e.addCommand("mceInsertClipboardContent",function(e,t){t.content&&o.clipboard.pasteHtml(t.content),t.text&&o.clipboard.pasteText(t.text)}),e.paste_block_drop&&e.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),e.settings.paste_data_images||e.on("drop",function(e){var t=e.dataTransfer;t&&t.files&&t.files.length>0&&e.preventDefault()}),e.addButton("pastetext",{icon:"pastetext",tooltip:"Paste as text",onclick:a,active:"text"==o.clipboard.pasteFormat}),e.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:s.pasteFormat,onclick:a})})}),o([c,d,g,y,b])}(this); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var e,t,n,r,m=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},o=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(e){return function(){return e}},i=a(!1),s=a(!0),u=function(){return l},l=(e=function(e){return e.isNone()},{fold:function(e,t){return e()},is:i,isSome:i,isNone:s,getOr:n=function(e){return e},getOrThunk:t=function(e){return e()},getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(undefined),or:n,orThunk:t,map:u,each:function(){},bind:u,exists:i,forall:s,filter:u,equals:e,equals_:e,toArray:function(){return[]},toString:a("none()")}),c=function(n){var e=a(n),t=function(){return o},r=function(e){return e(n)},o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:s,isNone:i,getOr:e,getOrThunk:e,getOrDie:e,getOrNull:e,getOrUndefined:e,or:t,orThunk:t,map:function(e){return c(e(n))},each:function(e){e(n)},bind:r,exists:r,forall:r,filter:function(e){return e(n)?o:l},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(i,function(e){return t(n,e)})}};return o},p={some:c,none:u,from:function(e){return null===e||e===undefined?l:c(e)}},f=(r="function",function(e){return typeof e===r}),d=Array.prototype.slice,g=function(e,t){for(var n=e.length,r=new Array(n),o=0;o"}(t,n),a="",i=A.map(r,function(e){return e.split(/\n/).join("
    ")});return 1===i.length?i[0]:A.map(i,function(e){return o+e+a}).join("")},F=tinymce.util.Tools.resolve("tinymce.html.DomParser"),E=tinymce.util.Tools.resolve("tinymce.html.Serializer"),M="\xa0",N=tinymce.util.Tools.resolve("tinymce.html.Node"),B=tinymce.util.Tools.resolve("tinymce.html.Schema");function j(t,e){return A.each(e,function(e){t=e.constructor===RegExp?t.replace(e,""):t.replace(e[0],e[1])}),t}function H(e){var t=B(),n=F({},t),r="",o=t.getShortEndedElements(),a=A.makeMap("script noscript style textarea video audio iframe object"," "),i=t.getBlockElements();return e=j(e,[//g]),function s(e){var t=e.name,n=e;if("br"!==t){if("wbr"!==t)if(o[t]&&(r+=" "),a[t])r+=" ";else{if(3===e.type&&(r+=e.value),!e.shortEnded&&(e=e.firstChild))for(;s(e),e=e.next;);i[t]&&n.next&&(r+="\n","p"===t&&(r+="\n"))}}else r+="\n"}(n.parse(e)),r}function $(e){return e=j(e,[/^[\s\S]*]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/|/g,[/( ?)\u00a0<\/span>( ?)/g,function(e,t,n){return t||n?M:" "}],/
    /g,/
    $/i])}function L(e){return//gi,/]+id="?docs-internal-[^>]*>/gi,//gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,M],[/([\s\u00a0]*)<\/span>/gi,function(e,t){return 0')}),!0);var r,o,a},ee=function(e,t,n){var r,o;n||!1===e.getParam("smart_paste",!0)?Y(e,t):(r=e,o=t,A.each([J,Q,Y],function(e){return!0!==e(r,o,Y)}))},te=function(e){return"\n"===e||"\r"===e},ne=function(e,t){var n,r,o,a,i=(n=" ",(r=e.getParam("paste_tab_spaces",4,"number"))<=0?"":new Array(r+1).join(n)),s=t.replace(/\t/g,i);return(a={pcIsSpace:!(o=function(e,t){return-1!==" \f\t\x0B".indexOf(t)||t===M?e.pcIsSpace||""===e.str||e.str.length===s.length-1||(n=s,(r=e.str.length+1)"));re(e,s,!1,!0)},ie=function(e){var t,n={};if(e&&(!e.getData||(t=e.getData("Text"))&&0',!1)):oe(e,'',!1)},fe=function(t,e,n){var r,o,a,i,s="paste"===e.type?e.clipboardData:e.dataTransfer;if(D(t)&&s){var u=(a=(o=s).items?g(h(o.items),function(e){return e.getAsFile()}):[],i=o.files?h(o.files):[],function(e,t){for(var n=[],r=0,o=e.length;r)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(o),i=G(o);o.length&&(!a||i)||(n=!0),(n||i)&&(o=se(e,"text/plain")&&a?e["text/plain"]:H(o)),u.isDefaultContent(o)?t||s.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):n?ae(s,o):oe(s,o,r)}s.on("keydown",function(e){function t(e){de(e)&&!e.isDefaultPrevented()&&u.remove()}if(de(e)&&!e.isDefaultPrevented()){if((c=e.shiftKey&&86===e.keyCode)&&y.webkit&&-1!==navigator.userAgent.indexOf("Version/"))return;if(e.stopImmediatePropagation(),f.set(e),window.setTimeout(function(){f.clear()},100),y.ie&&c)return e.preventDefault(),n=!0,void s.fire("paste",{ieFake:n});u.remove(),u.create(),s.once("keyup",t),s.once("paste",function(){s.off("keyup",t)})}var n});s.on("paste",function(e){var t,n,r=f.isSet(),o=(t=s,ie(e.clipboardData||t.getDoc().dataTransfer)),a="text"===l.get()||c,i=se(o,k);c=!1,!(e.isDefaultPrevented()||(n=e.clipboardData,-1!==navigator.userAgent.indexOf("Android")&&n&&n.items&&0===n.items.length))&&(ue(o)||!fe(s,e,u.getLastRng()||s.selection.getRng()))?(r||e.preventDefault(),!y.ie||r&&!e.ieFake||se(o,"text/html")||(u.create(),s.dom.bind(u.getEl(),"paste",function(e){e.stopPropagation()}),s.getDoc().execCommand("Paste",!1,null),o["text/html"]=u.getHtml()),se(o,"text/html")?(e.preventDefault(),i=i||O(o["text/html"]),d(o,r,a,i)):b.setEditorTimeout(s,function(){d(o,r,a,i)},0)):u.remove()})},pe=function(i,e,t){var s;me(i,e,t),i.parser.addNodeFilter("img",function(e,t,n){var r,o=function(e){e.attr("data-mce-object")||s===y.transparentSrc||e.remove()};if(!D(i)&&((r=n).data&&!0===r.data.paste))for(var a=e.length;a--;)(s=e[a].attr("src"))&&(0!==s.indexOf("webkit-fake-url")&&(i.getParam("allow_html_data_urls",!1,"boolean")||0!==s.indexOf("data:"))||o(e[a]))})},ge=function(e){return y.ie&&e.inline?document.body:e.getBody()},ve=function(t,e,n){var r;ge(r=t)!==r.getBody()&&t.dom.bind(e,"paste keyup",function(e){be(t,n)||t.fire("paste")})},he=function(e){return e.dom.get("mcepastebin")},ye=function(e,t){return t===e},be=function(e,t){var n,r=he(e);return(n=r)&&"mcepastebin"===n.id&&ye(t,r.innerHTML)},xe=function(e){var t=m(null),n="%MCEPASTEBIN%";return{create:function(){return function(e,t,n){var r=e.dom,o=e.getBody();t.set(e.selection.getRng());var a=e.dom.add(ge(e),"div",{id:"mcepastebin","class":"mce-pastebin",contentEditable:!0,"data-mce-bogus":"all",style:"position: fixed; top: 50%; width: 10px; height: 10px; overflow: hidden; opacity: 0"},n);(y.ie||y.gecko)&&r.setStyle(a,"left","rtl"===r.getStyle(o,"direction",!0)?65535:-65535),r.bind(a,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),ve(e,a,n),a.focus(),e.selection.select(a,!0)}(e,t,n)},remove:function(){return function(e,t){if(he(e)){for(var n=void 0,r=t.get();n=e.dom.get("mcepastebin");)e.dom.remove(n),e.dom.unbind(n);r&&e.selection.setRng(r)}t.set(null)}(e,t)},getEl:function(){return he(e)},getHtml:function(){return function(n){var t=function(e,t){e.appendChild(t),n.dom.remove(t,!0)},e=A.grep(ge(n).childNodes,function(e){return"mcepastebin"===e.id}),r=e.shift();A.each(e,function(e){t(r,e)});for(var o=n.dom.select("div[id=mcepastebin]",r),a=o.length-1;0<=a;a--){var i=n.dom.create("div");r.insertBefore(i,o[a]),t(i,o[a])}return r?r.innerHTML:""}(e)},getLastRng:function(){return t.get()},isDefault:function(){return be(e,n)},isDefaultContent:function(e){return e===n}}},Pe=function(n,r){n.addCommand("mceTogglePlainTextPaste",function(){var e,t;e=n,"text"===(t=r).pasteFormat.get()?(t.pasteFormat.set("html"),w(e,!1)):(t.pasteFormat.set("text"),w(e,!0)),e.focus()}),n.addCommand("mceInsertClipboardContent",function(e,t){t.content&&r.pasteHtml(t.content,t.internal),t.text&&r.pasteText(t.text)})},we=function(e,t,n){if(r=e,!1!==y.iOS||"function"!=typeof(null==r?void 0:r.setData))return!1;try{return e.clearData(),e.setData("text/html",t),e.setData("text/plain",n),e.setData(k,t),!0}catch(o){return!1}var r},_e=function(e,t,n,r){we(e.clipboardData,t.html,t.text)?(e.preventDefault(),r()):n(t.html,r)},Te=function(s){return function(e,t){var n=S+e,r=s.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),o=s.dom.create("div",{contenteditable:"true"},n);s.dom.setStyles(r,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),r.appendChild(o),s.dom.add(s.getBody(),r);var a=s.selection.getRng();o.focus();var i=s.dom.createRng();i.selectNodeContents(o),s.selection.setRng(i),b.setTimeout(function(){s.selection.setRng(a),r.parentNode.removeChild(r),t()},0)}},Ce=function(e){return{html:e.selection.getContent({contextual:!0}),text:e.selection.getContent({format:"text"})}},De=function(e){return!e.selection.isCollapsed()||!!(t=e).dom.getParent(t.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",t.getBody());var t},ke=function(e){var t,n;e.on("cut",(t=e,function(e){De(t)&&_e(e,Ce(t),Te(t),function(){var e;y.browser.isChrome()?(e=t.selection.getRng(),b.setEditorTimeout(t,function(){t.selection.setRng(e),t.execCommand("Delete")},0)):t.execCommand("Delete")})})),e.on("copy",(n=e,function(e){De(n)&&_e(e,Ce(n),Te(n),function(){})}))},Se=tinymce.util.Tools.resolve("tinymce.dom.RangeUtils"),Oe=function(e,t){return Se.getCaretRangeFromPoint(t.clientX,t.clientY,e.getDoc())},Re=function(e,t){e.focus(),e.selection.setRng(t)},Ae=function(i,s,u){i.getParam("paste_block_drop",!1)&&i.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),_(i)||i.on("drop",function(e){var t=e.dataTransfer;t&&t.files&&0 [\\s\\r\\n]+|
    )*(<\\/?("+n.join("|")+")[^>]*>)(?:
     [\\s\\r\\n]+|
    )*","g"),"$1"]]),t=j(t,[[/

    /g,"

    "],[/
    /g," "],[/

    /g,"
    "]])}function Ee(e,t,n,r){if(r||n)return t;var l,c,f,o=e.getParam("paste_webkit_styles");return!1===e.getParam("paste_remove_styles_if_webkit",!0)||"all"===o?t:(o&&(l=o.split(/[, ]/)),t=(t=l?(c=e.dom,f=e.selection.getNode(),t.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(e,t,n,r){var o=c.parseStyle(c.decode(n)),a={};if("none"===l)return t+r;for(var i=0;i]+) style="([^"]*)"([^>]*>)/gi,"$1$3")).replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(e,t,n,r){return t+' style="'+n+'"'+r}))}function Me(n,e){n.$("a",e).find("font,u").each(function(e,t){n.dom.remove(t,!0)})}var Ne=function(n,r){return function(t){t.setActive("text"===r.pasteFormat.get());var e=function(e){return t.setActive(e.state)};return n.on("PastePlainTextToggle",e),function(){return n.off("PastePlainTextToggle",e)}}};o.add("paste",function(e){if(!1==(!!e.hasPlugin("powerpaste",!0)&&("undefined"!=typeof window.console&&window.console.log&&window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),!0))){var t=m(!1),n=m(e.getParam("paste_as_text",!1)?"text":"html"),r=(c=n,f=xe(l=e),l.on("PreInit",function(){return pe(l,f,c)}),{pasteFormat:c,pasteHtml:function(e,t){return oe(l,e,t)},pasteText:function(e){return ae(l,e)},pasteImageData:function(e,t){return fe(l,e,t)},getDataTransferItems:ie,hasHtmlOrText:ue,hasContentType:se});i=e,y.webkit&&Ie(i,Ee),y.ie&&(Ie(i,Fe),u=Me,(s=i).on("PastePostProcess",function(e){u(s,e.node)}));return a=r,(o=e).ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:function(){return o.execCommand("mceTogglePlainTextPaste")},onSetup:Ne(o,a)}),o.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",icon:"paste-text",onAction:function(){return o.execCommand("mceTogglePlainTextPaste")},onSetup:Ne(o,a)}),Pe(e,r),function(e){var t=e.plugins.paste,n=e.getParam("paste_preprocess");n&&e.on("PastePreProcess",function(e){n.call(t,t,e)});var r=e.getParam("paste_postprocess");r&&e.on("PastePostProcess",function(e){r.call(t,t,e)})}(e),ke(e),Ae(e,r,t),{clipboard:r,quirks:void 0}}var o,a,i,s,u,l,c,f})}(); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/preview/plugin.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/preview/plugin.js new file mode 100644 index 000000000000..9e08db6ec436 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/preview/plugin.js @@ -0,0 +1,127 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +(function () { + 'use strict'; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var global$1 = tinymce.util.Tools.resolve('tinymce.Env'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var getContentStyle = function (editor) { + return editor.getParam('content_style', '', 'string'); + }; + var shouldUseContentCssCors = function (editor) { + return editor.getParam('content_css_cors', false, 'boolean'); + }; + var getBodyClassByHash = function (editor) { + var bodyClass = editor.getParam('body_class', '', 'hash'); + return bodyClass[editor.id] || ''; + }; + var getBodyClass = function (editor) { + var bodyClass = editor.getParam('body_class', '', 'string'); + if (bodyClass.indexOf('=') === -1) { + return bodyClass; + } else { + return getBodyClassByHash(editor); + } + }; + var getBodyIdByHash = function (editor) { + var bodyId = editor.getParam('body_id', '', 'hash'); + return bodyId[editor.id] || bodyId; + }; + var getBodyId = function (editor) { + var bodyId = editor.getParam('body_id', 'tinymce', 'string'); + if (bodyId.indexOf('=') === -1) { + return bodyId; + } else { + return getBodyIdByHash(editor); + } + }; + + var getPreviewHtml = function (editor) { + var headHtml = ''; + var encode = editor.dom.encode; + var contentStyle = getContentStyle(editor); + headHtml += ''; + if (contentStyle) { + headHtml += ''; + } + var cors = shouldUseContentCssCors(editor) ? ' crossorigin="anonymous"' : ''; + global$2.each(editor.contentCSS, function (url) { + headHtml += ''; + }); + var bodyId = getBodyId(editor); + var bodyClass = getBodyClass(editor); + var isMetaKeyPressed = global$1.mac ? 'e.metaKey' : 'e.ctrlKey && !e.altKey'; + var preventClicksOnLinksScript = ' '; + var directionality = editor.getBody().dir; + var dirAttr = directionality ? ' dir="' + encode(directionality) + '"' : ''; + var previewHtml = '' + '' + '' + headHtml + '' + '' + editor.getContent() + preventClicksOnLinksScript + '' + ''; + return previewHtml; + }; + + var open = function (editor) { + var content = getPreviewHtml(editor); + var dataApi = editor.windowManager.open({ + title: 'Preview', + size: 'large', + body: { + type: 'panel', + items: [{ + name: 'preview', + type: 'iframe', + sandboxed: true + }] + }, + buttons: [{ + type: 'cancel', + name: 'close', + text: 'Close', + primary: true + }], + initialData: { preview: content } + }); + dataApi.focus('close'); + }; + + var register = function (editor) { + editor.addCommand('mcePreview', function () { + open(editor); + }); + }; + + var register$1 = function (editor) { + editor.ui.registry.addButton('preview', { + icon: 'preview', + tooltip: 'Preview', + onAction: function () { + return editor.execCommand('mcePreview'); + } + }); + editor.ui.registry.addMenuItem('preview', { + icon: 'preview', + text: 'Preview', + onAction: function () { + return editor.execCommand('mcePreview'); + } + }); + }; + + function Plugin () { + global.add('preview', function (editor) { + register(editor); + register$1(editor); + }); + } + + Plugin(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/preview/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/preview/plugin.min.js new file mode 100644 index 000000000000..7317b19efef5 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/preview/plugin.min.js @@ -0,0 +1,9 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),f=tinymce.util.Tools.resolve("tinymce.Env"),w=tinymce.util.Tools.resolve("tinymce.util.Tools"),i=function(e){var t=function(t){var n="",i=t.dom.encode,e=t.getParam("content_style","","string");n+='',e&&(n+='");var o=t.getParam("content_css_cors",!1,"boolean")?' crossorigin="anonymous"':"";w.each(t.contentCSS,function(e){n+='"});var r,a,c,s,d,m,l,y=-1===(s=(r=t).getParam("body_id","tinymce","string")).indexOf("=")?s:(c=(a=r).getParam("body_id","","hash"))[a.id]||c,u=-1===(l=(d=t).getParam("body_class","","string")).indexOf("=")?l:(m=d).getParam("body_class","","hash")[m.id]||"",v='\n'; - moduleCount++; - } - - // Expose globally - exports.define = define; - exports.require = require; - - expose(["tinymce/spellcheckerplugin/DomTextMatcher","tinymce/spellcheckerplugin/Plugin"]); - - load('classes/DomTextMatcher.js'); - load('classes/Plugin.js'); - - writeScripts(); -})(this); - -// $hash: a7eb34dfa6d2129bc1715cc8f6e4d9c1 \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/spellchecker/plugin.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/spellchecker/plugin.js old mode 100755 new mode 100644 index 01061c1b3653..80526fee2d47 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/spellchecker/plugin.js +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/spellchecker/plugin.js @@ -1,903 +1,737 @@ /** - * Compiled inline version. (Library mode) - */ - -/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */ -/*globals $code */ - -(function(exports, undefined) { - "use strict"; - - var modules = {}; - - function require(ids, callback) { - var module, defs = []; - - for (var i = 0; i < ids.length; ++i) { - module = modules[ids[i]] || resolve(ids[i]); - if (!module) { - throw 'module definition dependecy not found: ' + ids[i]; - } - - defs.push(module); - } - - callback.apply(null, defs); - } - - function define(id, dependencies, definition) { - if (typeof id !== 'string') { - throw 'invalid module definition, module id must be defined and be a string'; - } - - if (dependencies === undefined) { - throw 'invalid module definition, dependencies must be specified'; - } - - if (definition === undefined) { - throw 'invalid module definition, definition function must be specified'; - } - - require(dependencies, function() { - modules[id] = definition.apply(null, arguments); - }); - } - - function defined(id) { - return !!modules[id]; - } - - function resolve(id) { - var target = exports; - var fragments = id.split(/[.\/]/); - - for (var fi = 0; fi < fragments.length; ++fi) { - if (!target[fragments[fi]]) { - return; - } - - target = target[fragments[fi]]; - } - - return target; - } - - function expose(ids) { - for (var i = 0; i < ids.length; i++) { - var target = exports; - var id = ids[i]; - var fragments = id.split(/[.\/]/); - - for (var fi = 0; fi < fragments.length - 1; ++fi) { - if (target[fragments[fi]] === undefined) { - target[fragments[fi]] = {}; - } - - target = target[fragments[fi]]; - } - - target[fragments[fragments.length - 1]] = modules[id]; - } - } - -// Included from: js/tinymce/plugins/spellchecker/classes/DomTextMatcher.js - -/** - * DomTextMatcher.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*eslint no-labels:0, no-constant-condition: 0 */ - -/** - * This class logic for filtering text and matching words. - * - * @class tinymce.spellcheckerplugin.TextFilter - * @private - */ -define("tinymce/spellcheckerplugin/DomTextMatcher", [], function() { - // Based on work developed by: James Padolsey http://james.padolsey.com - // released under UNLICENSE that is compatible with LGPL - // TODO: Handle contentEditable edgecase: - //

    texttexttexttexttext

    - return function(node, editor) { - var m, matches = [], text, dom = editor.dom; - var blockElementsMap, hiddenTextElementsMap, shortEndedElementsMap; - - blockElementsMap = editor.schema.getBlockElements(); // H1-H6, P, TD etc - hiddenTextElementsMap = editor.schema.getWhiteSpaceElements(); // TEXTAREA, PRE, STYLE, SCRIPT - shortEndedElementsMap = editor.schema.getShortEndedElements(); // BR, IMG, INPUT - - function createMatch(m, data) { - if (!m[0]) { - throw 'findAndReplaceDOMText cannot handle zero-length matches'; - } - - return { - start: m.index, - end: m.index + m[0].length, - text: m[0], - data: data - }; - } - - function getText(node) { - var txt; - - if (node.nodeType === 3) { - return node.data; - } - - if (hiddenTextElementsMap[node.nodeName] && !blockElementsMap[node.nodeName]) { - return ''; - } - - txt = ''; - - if (blockElementsMap[node.nodeName] || shortEndedElementsMap[node.nodeName]) { - txt += '\n'; - } - - if ((node = node.firstChild)) { - do { - txt += getText(node); - } while ((node = node.nextSibling)); - } - - return txt; - } - - function stepThroughMatches(node, matches, replaceFn) { - var startNode, endNode, startNodeIndex, - endNodeIndex, innerNodes = [], atIndex = 0, curNode = node, - matchLocation, matchIndex = 0; - - matches = matches.slice(0); - matches.sort(function(a, b) { - return a.start - b.start; - }); - - matchLocation = matches.shift(); - - out: while (true) { - if (blockElementsMap[curNode.nodeName] || shortEndedElementsMap[curNode.nodeName]) { - atIndex++; - } - - if (curNode.nodeType === 3) { - if (!endNode && curNode.length + atIndex >= matchLocation.end) { - // We've found the ending - endNode = curNode; - endNodeIndex = matchLocation.end - atIndex; - } else if (startNode) { - // Intersecting node - innerNodes.push(curNode); - } - - if (!startNode && curNode.length + atIndex > matchLocation.start) { - // We've found the match start - startNode = curNode; - startNodeIndex = matchLocation.start - atIndex; - } - - atIndex += curNode.length; - } - - if (startNode && endNode) { - curNode = replaceFn({ - startNode: startNode, - startNodeIndex: startNodeIndex, - endNode: endNode, - endNodeIndex: endNodeIndex, - innerNodes: innerNodes, - match: matchLocation.text, - matchIndex: matchIndex - }); - - // replaceFn has to return the node that replaced the endNode - // and then we step back so we can continue from the end of the - // match: - atIndex -= (endNode.length - endNodeIndex); - startNode = null; - endNode = null; - innerNodes = []; - matchLocation = matches.shift(); - matchIndex++; - - if (!matchLocation) { - break; // no more matches - } - } else if ((!hiddenTextElementsMap[curNode.nodeName] || blockElementsMap[curNode.nodeName]) && curNode.firstChild) { - // Move down - curNode = curNode.firstChild; - continue; - } else if (curNode.nextSibling) { - // Move forward: - curNode = curNode.nextSibling; - continue; - } - - // Move forward or up: - while (true) { - if (curNode.nextSibling) { - curNode = curNode.nextSibling; - break; - } else if (curNode.parentNode !== node) { - curNode = curNode.parentNode; - } else { - break out; - } - } - } - } - - /** - * Generates the actual replaceFn which splits up text nodes - * and inserts the replacement element. - */ - function genReplacer(callback) { - function makeReplacementNode(fill, matchIndex) { - var match = matches[matchIndex]; - - if (!match.stencil) { - match.stencil = callback(match); - } - - var clone = match.stencil.cloneNode(false); - clone.setAttribute('data-mce-index', matchIndex); - - if (fill) { - clone.appendChild(dom.doc.createTextNode(fill)); - } - - return clone; - } - - return function(range) { - var before, after, parentNode, startNode = range.startNode, - endNode = range.endNode, matchIndex = range.matchIndex, - doc = dom.doc; - - if (startNode === endNode) { - var node = startNode; - - parentNode = node.parentNode; - if (range.startNodeIndex > 0) { - // Add "before" text node (before the match) - before = doc.createTextNode(node.data.substring(0, range.startNodeIndex)); - parentNode.insertBefore(before, node); - } - - // Create the replacement node: - var el = makeReplacementNode(range.match, matchIndex); - parentNode.insertBefore(el, node); - if (range.endNodeIndex < node.length) { - // Add "after" text node (after the match) - after = doc.createTextNode(node.data.substring(range.endNodeIndex)); - parentNode.insertBefore(after, node); - } - - node.parentNode.removeChild(node); - - return el; - } else { - // Replace startNode -> [innerNodes...] -> endNode (in that order) - before = doc.createTextNode(startNode.data.substring(0, range.startNodeIndex)); - after = doc.createTextNode(endNode.data.substring(range.endNodeIndex)); - var elA = makeReplacementNode(startNode.data.substring(range.startNodeIndex), matchIndex); - var innerEls = []; - - for (var i = 0, l = range.innerNodes.length; i < l; ++i) { - var innerNode = range.innerNodes[i]; - var innerEl = makeReplacementNode(innerNode.data, matchIndex); - innerNode.parentNode.replaceChild(innerEl, innerNode); - innerEls.push(innerEl); - } - - var elB = makeReplacementNode(endNode.data.substring(0, range.endNodeIndex), matchIndex); - - parentNode = startNode.parentNode; - parentNode.insertBefore(before, startNode); - parentNode.insertBefore(elA, startNode); - parentNode.removeChild(startNode); - - parentNode = endNode.parentNode; - parentNode.insertBefore(elB, endNode); - parentNode.insertBefore(after, endNode); - parentNode.removeChild(endNode); - - return elB; - } - }; - } - - function unwrapElement(element) { - var parentNode = element.parentNode; - parentNode.insertBefore(element.firstChild, element); - element.parentNode.removeChild(element); - } - - function getWrappersByIndex(index) { - var elements = node.getElementsByTagName('*'), wrappers = []; - - index = typeof(index) == "number" ? "" + index : null; - - for (var i = 0; i < elements.length; i++) { - var element = elements[i], dataIndex = element.getAttribute('data-mce-index'); - - if (dataIndex !== null && dataIndex.length) { - if (dataIndex === index || index === null) { - wrappers.push(element); - } - } - } - - return wrappers; - } - - /** - * Returns the index of a specific match object or -1 if it isn't found. - * - * @param {Match} match Text match object. - * @return {Number} Index of match or -1 if it isn't found. - */ - function indexOf(match) { - var i = matches.length; - while (i--) { - if (matches[i] === match) { - return i; - } - } - - return -1; - } - - /** - * Filters the matches. If the callback returns true it stays if not it gets removed. - * - * @param {Function} callback Callback to execute for each match. - * @return {DomTextMatcher} Current DomTextMatcher instance. - */ - function filter(callback) { - var filteredMatches = []; - - each(function(match, i) { - if (callback(match, i)) { - filteredMatches.push(match); - } - }); - - matches = filteredMatches; - - /*jshint validthis:true*/ - return this; - } - - /** - * Executes the specified callback for each match. - * - * @param {Function} callback Callback to execute for each match. - * @return {DomTextMatcher} Current DomTextMatcher instance. - */ - function each(callback) { - for (var i = 0, l = matches.length; i < l; i++) { - if (callback(matches[i], i) === false) { - break; - } - } - - /*jshint validthis:true*/ - return this; - } - - /** - * Wraps the current matches with nodes created by the specified callback. - * Multiple clones of these matches might occur on matches that are on multiple nodex. - * - * @param {Function} callback Callback to execute in order to create elements for matches. - * @return {DomTextMatcher} Current DomTextMatcher instance. - */ - function wrap(callback) { - if (matches.length) { - stepThroughMatches(node, matches, genReplacer(callback)); - } - - /*jshint validthis:true*/ - return this; - } - - /** - * Finds the specified regexp and adds them to the matches collection. - * - * @param {RegExp} regex Global regexp to search the current node by. - * @param {Object} [data] Optional custom data element for the match. - * @return {DomTextMatcher} Current DomTextMatcher instance. - */ - function find(regex, data) { - if (text && regex.global) { - while ((m = regex.exec(text))) { - matches.push(createMatch(m, data)); - } - } - - return this; - } - - /** - * Unwraps the specified match object or all matches if unspecified. - * - * @param {Object} [match] Optional match object. - * @return {DomTextMatcher} Current DomTextMatcher instance. - */ - function unwrap(match) { - var i, elements = getWrappersByIndex(match ? indexOf(match) : null); - - i = elements.length; - while (i--) { - unwrapElement(elements[i]); - } - - return this; - } - - /** - * Returns a match object by the specified DOM element. - * - * @param {DOMElement} element Element to return match object for. - * @return {Object} Match object for the specified element. - */ - function matchFromElement(element) { - return matches[element.getAttribute('data-mce-index')]; - } - - /** - * Returns a DOM element from the specified match element. This will be the first element if it's split - * on multiple nodes. - * - * @param {Object} match Match element to get first element of. - * @return {DOMElement} DOM element for the specified match object. - */ - function elementFromMatch(match) { - return getWrappersByIndex(indexOf(match))[0]; - } - - /** - * Adds match the specified range for example a grammar line. - * - * @param {Number} start Start offset. - * @param {Number} length Length of the text. - * @param {Object} data Custom data object for match. - * @return {DomTextMatcher} Current DomTextMatcher instance. - */ - function add(start, length, data) { - matches.push({ - start: start, - end: start + length, - text: text.substr(start, length), - data: data - }); - - return this; - } - - /** - * Returns a DOM range for the specified match. - * - * @param {Object} match Match object to get range for. - * @return {DOMRange} DOM Range for the specified match. - */ - function rangeFromMatch(match) { - var wrappers = getWrappersByIndex(indexOf(match)); - - var rng = editor.dom.createRng(); - rng.setStartBefore(wrappers[0]); - rng.setEndAfter(wrappers[wrappers.length - 1]); - - return rng; - } - - /** - * Replaces the specified match with the specified text. - * - * @param {Object} match Match object to replace. - * @param {String} text Text to replace the match with. - * @return {DOMRange} DOM range produced after the replace. - */ - function replace(match, text) { - var rng = rangeFromMatch(match); - - rng.deleteContents(); - - if (text.length > 0) { - rng.insertNode(editor.dom.doc.createTextNode(text)); - } - - return rng; - } - - /** - * Resets the DomTextMatcher instance. This will remove any wrapped nodes and remove any matches. - * - * @return {[type]} [description] - */ - function reset() { - matches.splice(0, matches.length); - unwrap(); - - return this; - } - - text = getText(node); - - return { - text: text, - matches: matches, - each: each, - filter: filter, - reset: reset, - matchFromElement: matchFromElement, - elementFromMatch: elementFromMatch, - find: find, - add: add, - wrap: wrap, - unwrap: unwrap, - replace: replace, - rangeFromMatch: rangeFromMatch, - indexOf: indexOf - }; - }; -}); - -// Included from: js/tinymce/plugins/spellchecker/classes/Plugin.js - -/** - * Plugin.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing + * Version: 5.5.1 (2020-10-01) */ - -/*jshint camelcase:false */ - -/** - * This class contains all core logic for the spellchecker plugin. - * - * @class tinymce.spellcheckerplugin.Plugin - * @private - */ -define("tinymce/spellcheckerplugin/Plugin", [ - "tinymce/spellcheckerplugin/DomTextMatcher", - "tinymce/PluginManager", - "tinymce/util/Tools", - "tinymce/ui/Menu", - "tinymce/dom/DOMUtils", - "tinymce/util/JSONRequest", - "tinymce/util/URI" -], function(DomTextMatcher, PluginManager, Tools, Menu, DOMUtils, JSONRequest, URI) { - PluginManager.add('spellchecker', function(editor, url) { - var languageMenuItems, self = this, lastSuggestions, started, suggestionsMenu, settings = editor.settings; - - function getTextMatcher() { - if (!self.textMatcher) { - self.textMatcher = new DomTextMatcher(editor.getBody(), editor); - } - - return self.textMatcher; - } - - function buildMenuItems(listName, languageValues) { - var items = []; - - Tools.each(languageValues, function(languageValue) { - items.push({ - selectable: true, - text: languageValue.name, - data: languageValue.value - }); - }); - - return items; - } - - var languagesString = settings.spellchecker_languages || - 'English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,' + - 'German=de,Italian=it,Polish=pl,Portuguese=pt_BR,' + - 'Spanish=es,Swedish=sv'; - - languageMenuItems = buildMenuItems('Language', - Tools.map(languagesString.split(','), - function(lang_pair) { - var lang = lang_pair.split('='); - - return { - name: lang[0], - value: lang[1] - }; - } - ) - ); - - function isEmpty(obj) { - /*jshint unused:false*/ - /*eslint no-unused-vars:0 */ - for (var name in obj) { - return false; - } - - return true; - } - - function showSuggestions(match) { - var items = [], suggestions = lastSuggestions[match.text]; - - Tools.each(suggestions, function(suggestion) { - items.push({ - text: suggestion, - onclick: function() { - var rng = getTextMatcher().replace(match, suggestion); - rng.collapse(false); - editor.selection.setRng(rng); - checkIfFinished(); - } - }); - }); - - items.push.apply(items, [ - {text: '-'}, - - {text: 'Ignore', onclick: function() { - ignoreWord(match); - }}, - - {text: 'Ignore all', onclick: function() { - ignoreWord(match, true); - }}, - - {text: 'Finish', onclick: finish} - ]); - - // Render menu - suggestionsMenu = new Menu({ - items: items, - context: 'contextmenu', - onautohide: function(e) { - if (e.target.className.indexOf('spellchecker') != -1) { - e.preventDefault(); - } - }, - onhide: function() { - suggestionsMenu.remove(); - suggestionsMenu = null; - } - }); - - suggestionsMenu.renderTo(document.body); - - // Position menu - var matchNode = getTextMatcher().elementFromMatch(match); - var pos = DOMUtils.DOM.getPos(editor.getContentAreaContainer()); - var targetPos = editor.dom.getPos(matchNode); - var root = editor.dom.getRoot(); - - // Adjust targetPos for scrolling in the editor - if (root.nodeName == 'BODY') { - targetPos.x -= root.ownerDocument.documentElement.scrollLeft || root.scrollLeft; - targetPos.y -= root.ownerDocument.documentElement.scrollTop || root.scrollTop; - } else { - targetPos.x -= root.scrollLeft; - targetPos.y -= root.scrollTop; - } - - pos.x += targetPos.x; - pos.y += targetPos.y; - - suggestionsMenu.moveTo(pos.x, pos.y + matchNode.offsetHeight); - } - - function spellcheck() { - var words = [], uniqueWords = {}; - - if (started) { - finish(); - return; - } else { - finish(); - } - - started = true; - - function doneCallback(suggestions) { - editor.setProgressState(false); - - if (isEmpty(suggestions)) { - editor.windowManager.alert('No misspellings found'); - started = false; - return; - } - - lastSuggestions = suggestions; - - getTextMatcher().filter(function(match) { - return !!suggestions[match.text]; - }).wrap(function() { - return editor.dom.create('span', { - "class": 'mce-spellchecker-word', - "data-mce-bogus": 1 - }); - }); - - editor.fire('SpellcheckStart'); - } - - // Regexp for finding word specific characters this will split words by - // spaces, quotes, copy right characters etc. It's escaped with unicode characters - // to make it easier to output scripts on servers using different encodings - // so if you add any characters outside the 128 byte range make sure to escape it - var nonWordSeparatorCharacters = editor.getParam('spellchecker_wordchar_pattern') || new RegExp("[^" + - "\\s!\"#$%&()*+,-./:;<=>?@[\\]^_{|}`" + - "\u00a7\u00a9\u00ab\u00ae\u00b1\u00b6\u00b7\u00b8\u00bb" + - "\u00bc\u00bd\u00be\u00bf\u00d7\u00f7\u00a4\u201d\u201c\u201e" + - "]+", "g"); - - // Find all words and make an unique words array - getTextMatcher().find(nonWordSeparatorCharacters).each(function(match) { - var word = match.text; - - // TODO: Fix so it remembers correctly spelled words - if (!uniqueWords[word]) { - // Ignore numbers and single character words - if (/^\d+$/.test(word) || word.length == 1) { - return; - } - - words.push(word); - uniqueWords[word] = true; - } - }); - - function defaultSpellcheckCallback(method, words, doneCallback) { - JSONRequest.sendRPC({ - url: new URI(url).toAbsolute(settings.spellchecker_rpc_url), - method: method, - params: { - lang: settings.spellchecker_language || "en", - words: words - }, - success: function(result) { - doneCallback(result); - }, - error: function(error, xhr) { - if (error == "JSON Parse error.") { - error = "Non JSON response:" + xhr.responseText; - } else { - error = "Error: " + error; - } - - editor.windowManager.alert(error); - editor.setProgressState(false); - finish(); - } - }); - } - - editor.setProgressState(true); - - var spellCheckCallback = settings.spellchecker_callback || defaultSpellcheckCallback; - spellCheckCallback("spellcheck", words, doneCallback); - - editor.focus(); - } - - function checkIfFinished() { - if (!editor.dom.select('span.mce-spellchecker-word').length) { - finish(); - } - } - - function ignoreWord(wordMatch, all) { - editor.selection.collapse(); - - if (all) { - getTextMatcher().each(function(match) { - if (match.text == wordMatch.text) { - getTextMatcher().unwrap(match); - } - }); - } else { - getTextMatcher().unwrap(wordMatch); - } - - checkIfFinished(); - } - - function finish() { - getTextMatcher().reset(); - self.textMatcher = null; - - if (started) { - started = false; - editor.fire('SpellcheckEnd'); - } - } - - editor.on('click', function(e) { - if (e.target.className == "mce-spellchecker-word") { - e.preventDefault(); - - var match = getTextMatcher().matchFromElement(e.target); - editor.selection.setRng(getTextMatcher().rangeFromMatch(match)); - - showSuggestions(match); - } - }); - - editor.addMenuItem('spellchecker', { - text: 'Spellcheck', - context: 'tools', - onclick: spellcheck, - selectable: true, - onPostRender: function() { - var self = this; - - editor.on('SpellcheckStart SpellcheckEnd', function() { - self.active(started); - }); - } - }); - - function updateSelection(e) { - var selectedLanguage = settings.spellchecker_language; - - e.control.items().each(function(ctrl) { - ctrl.active(ctrl.settings.data === selectedLanguage); - }); - } - - var buttonArgs = { - tooltip: 'Spellcheck', - onclick: spellcheck, - onPostRender: function() { - var self = this; - - editor.on('SpellcheckStart SpellcheckEnd', function() { - self.active(started); - }); - } - }; - - if (languageMenuItems.length > 1) { - buttonArgs.type = 'splitbutton'; - buttonArgs.menu = languageMenuItems; - buttonArgs.onshow = updateSelection; - buttonArgs.onselect = function(e) { - settings.spellchecker_language = e.control.settings.data; - }; - } - - editor.addButton('spellchecker', buttonArgs); - editor.addCommand('mceSpellCheck', spellcheck); - - editor.on('remove', function() { - if (suggestionsMenu) { - suggestionsMenu.remove(); - suggestionsMenu = null; - } - }); - - this.getTextMatcher = getTextMatcher; - - // Set default spellchecker language if it's not specified - settings.spellchecker_language = settings.spellchecker_language || settings.language || 'en'; - }); -}); - -expose(["tinymce/spellcheckerplugin/DomTextMatcher","tinymce/spellcheckerplugin/Plugin"]); -})(this); \ No newline at end of file +(function () { + 'use strict'; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; + }; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var hasProPlugin = function (editor) { + if (editor.hasPlugin('tinymcespellchecker', true)) { + if (typeof window.console !== 'undefined' && window.console.log) { + window.console.log('Spell Checker Pro is incompatible with Spell Checker plugin! ' + 'Remove \'spellchecker\' from the \'plugins\' option.'); + } + return true; + } else { + return false; + } + }; + + var hasOwnProperty = Object.hasOwnProperty; + var isEmpty = function (r) { + for (var x in r) { + if (hasOwnProperty.call(r, x)) { + return false; + } + } + return true; + }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.util.URI'); + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.XHR'); + + var fireSpellcheckStart = function (editor) { + return editor.fire('SpellcheckStart'); + }; + var fireSpellcheckEnd = function (editor) { + return editor.fire('SpellcheckEnd'); + }; + + var getLanguages = function (editor) { + var defaultLanguages = 'English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv'; + return editor.getParam('spellchecker_languages', defaultLanguages); + }; + var getLanguage = function (editor) { + var defaultLanguage = editor.getParam('language', 'en'); + return editor.getParam('spellchecker_language', defaultLanguage); + }; + var getRpcUrl = function (editor) { + return editor.getParam('spellchecker_rpc_url'); + }; + var getSpellcheckerCallback = function (editor) { + return editor.getParam('spellchecker_callback'); + }; + var getSpellcheckerWordcharPattern = function (editor) { + var defaultPattern = new RegExp('[^' + '\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`' + '\xA7\xA9\xAB\xAE\xB1\xB6\xB7\xB8\xBB' + '\xBC\xBD\xBE\xBF\xD7\xF7\xA4\u201D\u201C\u201E\xA0\u2002\u2003\u2009' + ']+', 'g'); + return editor.getParam('spellchecker_wordchar_pattern', defaultPattern); + }; + + function isContentEditableFalse(node) { + return node && node.nodeType === 1 && node.contentEditable === 'false'; + } + var DomTextMatcher = function (node, editor) { + var m, matches = []; + var dom = editor.dom; + var blockElementsMap = editor.schema.getBlockElements(); + var hiddenTextElementsMap = editor.schema.getWhiteSpaceElements(); + var shortEndedElementsMap = editor.schema.getShortEndedElements(); + function createMatch(m, data) { + if (!m[0]) { + throw new Error('findAndReplaceDOMText cannot handle zero-length matches'); + } + return { + start: m.index, + end: m.index + m[0].length, + text: m[0], + data: data + }; + } + function getText(node) { + var txt; + if (node.nodeType === 3) { + return node.data; + } + if (hiddenTextElementsMap[node.nodeName] && !blockElementsMap[node.nodeName]) { + return ''; + } + if (isContentEditableFalse(node)) { + return '\n'; + } + txt = ''; + if (blockElementsMap[node.nodeName] || shortEndedElementsMap[node.nodeName]) { + txt += '\n'; + } + if (node = node.firstChild) { + do { + txt += getText(node); + } while (node = node.nextSibling); + } + return txt; + } + function stepThroughMatches(node, matches, replaceFn) { + var startNode, endNode, startNodeIndex, endNodeIndex, innerNodes = [], atIndex = 0, curNode = node, matchLocation, matchIndex = 0; + matches = matches.slice(0); + matches.sort(function (a, b) { + return a.start - b.start; + }); + matchLocation = matches.shift(); + out: + while (true) { + if (blockElementsMap[curNode.nodeName] || shortEndedElementsMap[curNode.nodeName] || isContentEditableFalse(curNode)) { + atIndex++; + } + if (curNode.nodeType === 3) { + if (!endNode && curNode.length + atIndex >= matchLocation.end) { + endNode = curNode; + endNodeIndex = matchLocation.end - atIndex; + } else if (startNode) { + innerNodes.push(curNode); + } + if (!startNode && curNode.length + atIndex > matchLocation.start) { + startNode = curNode; + startNodeIndex = matchLocation.start - atIndex; + } + atIndex += curNode.length; + } + if (startNode && endNode) { + curNode = replaceFn({ + startNode: startNode, + startNodeIndex: startNodeIndex, + endNode: endNode, + endNodeIndex: endNodeIndex, + innerNodes: innerNodes, + match: matchLocation.text, + matchIndex: matchIndex + }); + atIndex -= endNode.length - endNodeIndex; + startNode = null; + endNode = null; + innerNodes = []; + matchLocation = matches.shift(); + matchIndex++; + if (!matchLocation) { + break; + } + } else if ((!hiddenTextElementsMap[curNode.nodeName] || blockElementsMap[curNode.nodeName]) && curNode.firstChild) { + if (!isContentEditableFalse(curNode)) { + curNode = curNode.firstChild; + continue; + } + } else if (curNode.nextSibling) { + curNode = curNode.nextSibling; + continue; + } + while (true) { + if (curNode.nextSibling) { + curNode = curNode.nextSibling; + break; + } else if (curNode.parentNode !== node) { + curNode = curNode.parentNode; + } else { + break out; + } + } + } + } + function genReplacer(callback) { + function makeReplacementNode(fill, matchIndex) { + var match = matches[matchIndex]; + if (!match.stencil) { + match.stencil = callback(match); + } + var clone = match.stencil.cloneNode(false); + clone.setAttribute('data-mce-index', matchIndex); + if (fill) { + clone.appendChild(dom.doc.createTextNode(fill)); + } + return clone; + } + return function (range) { + var before; + var after; + var parentNode; + var startNode = range.startNode; + var endNode = range.endNode; + var matchIndex = range.matchIndex; + var doc = dom.doc; + if (startNode === endNode) { + var node_1 = startNode; + parentNode = node_1.parentNode; + if (range.startNodeIndex > 0) { + before = doc.createTextNode(node_1.data.substring(0, range.startNodeIndex)); + parentNode.insertBefore(before, node_1); + } + var el = makeReplacementNode(range.match, matchIndex); + parentNode.insertBefore(el, node_1); + if (range.endNodeIndex < node_1.length) { + after = doc.createTextNode(node_1.data.substring(range.endNodeIndex)); + parentNode.insertBefore(after, node_1); + } + node_1.parentNode.removeChild(node_1); + return el; + } + before = doc.createTextNode(startNode.data.substring(0, range.startNodeIndex)); + after = doc.createTextNode(endNode.data.substring(range.endNodeIndex)); + var elA = makeReplacementNode(startNode.data.substring(range.startNodeIndex), matchIndex); + for (var i = 0, l = range.innerNodes.length; i < l; ++i) { + var innerNode = range.innerNodes[i]; + var innerEl = makeReplacementNode(innerNode.data, matchIndex); + innerNode.parentNode.replaceChild(innerEl, innerNode); + } + var elB = makeReplacementNode(endNode.data.substring(0, range.endNodeIndex), matchIndex); + parentNode = startNode.parentNode; + parentNode.insertBefore(before, startNode); + parentNode.insertBefore(elA, startNode); + parentNode.removeChild(startNode); + parentNode = endNode.parentNode; + parentNode.insertBefore(elB, endNode); + parentNode.insertBefore(after, endNode); + parentNode.removeChild(endNode); + return elB; + }; + } + function unwrapElement(element) { + var parentNode = element.parentNode; + while (element.childNodes.length > 0) { + parentNode.insertBefore(element.childNodes[0], element); + } + parentNode.removeChild(element); + } + function hasClass(elm) { + return elm.className.indexOf('mce-spellchecker-word') !== -1; + } + function getWrappersByIndex(index) { + var elements = node.getElementsByTagName('*'), wrappers = []; + index = typeof index === 'number' ? '' + index : null; + for (var i = 0; i < elements.length; i++) { + var element = elements[i], dataIndex = element.getAttribute('data-mce-index'); + if (dataIndex !== null && dataIndex.length && hasClass(element)) { + if (dataIndex === index || index === null) { + wrappers.push(element); + } + } + } + return wrappers; + } + function indexOf(match) { + var i = matches.length; + while (i--) { + if (matches[i] === match) { + return i; + } + } + return -1; + } + function filter(callback) { + var filteredMatches = []; + each(function (match, i) { + if (callback(match, i)) { + filteredMatches.push(match); + } + }); + matches = filteredMatches; + return this; + } + function each(callback) { + for (var i = 0, l = matches.length; i < l; i++) { + if (callback(matches[i], i) === false) { + break; + } + } + return this; + } + function wrap(callback) { + if (matches.length) { + stepThroughMatches(node, matches, genReplacer(callback)); + } + return this; + } + function find(regex, data) { + if (text && regex.global) { + while (m = regex.exec(text)) { + matches.push(createMatch(m, data)); + } + } + return this; + } + function unwrap(match) { + var i; + var elements = getWrappersByIndex(match ? indexOf(match) : null); + i = elements.length; + while (i--) { + unwrapElement(elements[i]); + } + return this; + } + function matchFromElement(element) { + return matches[element.getAttribute('data-mce-index')]; + } + function elementFromMatch(match) { + return getWrappersByIndex(indexOf(match))[0]; + } + function add(start, length, data) { + matches.push({ + start: start, + end: start + length, + text: text.substr(start, length), + data: data + }); + return this; + } + function rangeFromMatch(match) { + var wrappers = getWrappersByIndex(indexOf(match)); + var rng = editor.dom.createRng(); + rng.setStartBefore(wrappers[0]); + rng.setEndAfter(wrappers[wrappers.length - 1]); + return rng; + } + function replace(match, text) { + var rng = rangeFromMatch(match); + rng.deleteContents(); + if (text.length > 0) { + rng.insertNode(editor.dom.doc.createTextNode(text)); + } + return rng; + } + function reset() { + matches.splice(0, matches.length); + unwrap(); + return this; + } + var text = getText(node); + return { + text: text, + matches: matches, + each: each, + filter: filter, + reset: reset, + matchFromElement: matchFromElement, + elementFromMatch: elementFromMatch, + find: find, + add: add, + wrap: wrap, + unwrap: unwrap, + replace: replace, + rangeFromMatch: rangeFromMatch, + indexOf: indexOf + }; + }; + + var getTextMatcher = function (editor, textMatcherState) { + if (!textMatcherState.get()) { + var textMatcher = DomTextMatcher(editor.getBody(), editor); + textMatcherState.set(textMatcher); + } + return textMatcherState.get(); + }; + var defaultSpellcheckCallback = function (editor, pluginUrl, currentLanguageState) { + return function (method, text, doneCallback, errorCallback) { + var data = { + method: method, + lang: currentLanguageState.get() + }; + var postData = ''; + data[method === 'addToDictionary' ? 'word' : 'text'] = text; + global$1.each(data, function (value, key) { + if (postData) { + postData += '&'; + } + postData += key + '=' + encodeURIComponent(value); + }); + global$3.send({ + url: new global$2(pluginUrl).toAbsolute(getRpcUrl(editor)), + type: 'post', + content_type: 'application/x-www-form-urlencoded', + data: postData, + success: function (result) { + var parseResult = JSON.parse(result); + if (!parseResult) { + var message = editor.translate('Server response wasn\'t proper JSON.'); + errorCallback(message); + } else if (parseResult.error) { + errorCallback(parseResult.error); + } else { + doneCallback(parseResult); + } + }, + error: function () { + var message = editor.translate('The spelling service was not found: (') + getRpcUrl(editor) + editor.translate(')'); + errorCallback(message); + } + }); + }; + }; + var sendRpcCall = function (editor, pluginUrl, currentLanguageState, name, data, successCallback, errorCallback) { + var userSpellcheckCallback = getSpellcheckerCallback(editor); + var spellCheckCallback = userSpellcheckCallback ? userSpellcheckCallback : defaultSpellcheckCallback(editor, pluginUrl, currentLanguageState); + spellCheckCallback.call(editor.plugins.spellchecker, name, data, successCallback, errorCallback); + }; + var spellcheck = function (editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState) { + if (finish(editor, startedState, textMatcherState)) { + return; + } + var errorCallback = function (message) { + editor.notificationManager.open({ + text: message, + type: 'error' + }); + editor.setProgressState(false); + finish(editor, startedState, textMatcherState); + }; + var successCallback = function (data) { + markErrors(editor, startedState, textMatcherState, lastSuggestionsState, data); + }; + editor.setProgressState(true); + sendRpcCall(editor, pluginUrl, currentLanguageState, 'spellcheck', getTextMatcher(editor, textMatcherState).text, successCallback, errorCallback); + editor.focus(); + }; + var checkIfFinished = function (editor, startedState, textMatcherState) { + if (!editor.dom.select('span.mce-spellchecker-word').length) { + finish(editor, startedState, textMatcherState); + } + }; + var addToDictionary = function (editor, pluginUrl, startedState, textMatcherState, currentLanguageState, word, spans) { + editor.setProgressState(true); + sendRpcCall(editor, pluginUrl, currentLanguageState, 'addToDictionary', word, function () { + editor.setProgressState(false); + editor.dom.remove(spans, true); + checkIfFinished(editor, startedState, textMatcherState); + }, function (message) { + editor.notificationManager.open({ + text: message, + type: 'error' + }); + editor.setProgressState(false); + }); + }; + var ignoreWord = function (editor, startedState, textMatcherState, word, spans, all) { + editor.selection.collapse(); + if (all) { + global$1.each(editor.dom.select('span.mce-spellchecker-word'), function (span) { + if (span.getAttribute('data-mce-word') === word) { + editor.dom.remove(span, true); + } + }); + } else { + editor.dom.remove(spans, true); + } + checkIfFinished(editor, startedState, textMatcherState); + }; + var finish = function (editor, startedState, textMatcherState) { + var bookmark = editor.selection.getBookmark(); + getTextMatcher(editor, textMatcherState).reset(); + editor.selection.moveToBookmark(bookmark); + textMatcherState.set(null); + if (startedState.get()) { + startedState.set(false); + fireSpellcheckEnd(editor); + return true; + } + }; + var getElmIndex = function (elm) { + var value = elm.getAttribute('data-mce-index'); + if (typeof value === 'number') { + return '' + value; + } + return value; + }; + var findSpansByIndex = function (editor, index) { + var spans = []; + var nodes = global$1.toArray(editor.getBody().getElementsByTagName('span')); + if (nodes.length) { + for (var i = 0; i < nodes.length; i++) { + var nodeIndex = getElmIndex(nodes[i]); + if (nodeIndex === null || !nodeIndex.length) { + continue; + } + if (nodeIndex === index.toString()) { + spans.push(nodes[i]); + } + } + } + return spans; + }; + var markErrors = function (editor, startedState, textMatcherState, lastSuggestionsState, data) { + var hasDictionarySupport = !!data.dictionary; + var suggestions = data.words; + editor.setProgressState(false); + if (isEmpty(suggestions)) { + var message = editor.translate('No misspellings found.'); + editor.notificationManager.open({ + text: message, + type: 'info' + }); + startedState.set(false); + return; + } + lastSuggestionsState.set({ + suggestions: suggestions, + hasDictionarySupport: hasDictionarySupport + }); + var bookmark = editor.selection.getBookmark(); + getTextMatcher(editor, textMatcherState).find(getSpellcheckerWordcharPattern(editor)).filter(function (match) { + return !!suggestions[match.text]; + }).wrap(function (match) { + return editor.dom.create('span', { + 'class': 'mce-spellchecker-word', + 'aria-invalid': 'spelling', + 'data-mce-bogus': 1, + 'data-mce-word': match.text + }); + }); + editor.selection.moveToBookmark(bookmark); + startedState.set(true); + fireSpellcheckStart(editor); + }; + + var get = function (editor, startedState, lastSuggestionsState, textMatcherState, currentLanguageState, _url) { + var getLanguage = function () { + return currentLanguageState.get(); + }; + var getWordCharPattern = function () { + return getSpellcheckerWordcharPattern(editor); + }; + var markErrors$1 = function (data) { + markErrors(editor, startedState, textMatcherState, lastSuggestionsState, data); + }; + var getTextMatcher = function () { + return textMatcherState.get(); + }; + return { + getTextMatcher: getTextMatcher, + getWordCharPattern: getWordCharPattern, + markErrors: markErrors$1, + getLanguage: getLanguage + }; + }; + + var register = function (editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState) { + editor.addCommand('mceSpellCheck', function () { + spellcheck(editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState); + }); + }; + + var __assign = function () { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + + var spellcheckerEvents = 'SpellcheckStart SpellcheckEnd'; + var buildMenuItems = function (listName, languageValues) { + var items = []; + global$1.each(languageValues, function (languageValue) { + items.push({ + selectable: true, + text: languageValue.name, + data: languageValue.value + }); + }); + return items; + }; + var getItems = function (editor) { + return global$1.map(getLanguages(editor).split(','), function (langPair) { + var langPairs = langPair.split('='); + return { + name: langPairs[0], + value: langPairs[1] + }; + }); + }; + var register$1 = function (editor, pluginUrl, startedState, textMatcherState, currentLanguageState, lastSuggestionsState) { + var languageMenuItems = buildMenuItems('Language', getItems(editor)); + var startSpellchecking = function () { + spellcheck(editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState); + }; + var buttonArgs = { + tooltip: 'Spellcheck', + onAction: startSpellchecking, + icon: 'spell-check', + onSetup: function (buttonApi) { + var setButtonState = function () { + buttonApi.setActive(startedState.get()); + }; + editor.on(spellcheckerEvents, setButtonState); + return function () { + editor.off(spellcheckerEvents, setButtonState); + }; + } + }; + var splitButtonArgs = __assign(__assign({}, buttonArgs), { + type: 'splitbutton', + select: function (value) { + return value === currentLanguageState.get(); + }, + fetch: function (callback) { + var items = global$1.map(languageMenuItems, function (languageItem) { + return { + type: 'choiceitem', + value: languageItem.data, + text: languageItem.text + }; + }); + callback(items); + }, + onItemAction: function (splitButtonApi, value) { + currentLanguageState.set(value); + } + }); + if (languageMenuItems.length > 1) { + editor.ui.registry.addSplitButton('spellchecker', splitButtonArgs); + } else { + editor.ui.registry.addToggleButton('spellchecker', buttonArgs); + } + editor.ui.registry.addToggleMenuItem('spellchecker', { + text: 'Spellcheck', + icon: 'spell-check', + onSetup: function (menuApi) { + menuApi.setActive(startedState.get()); + var setMenuItemCheck = function () { + menuApi.setActive(startedState.get()); + }; + editor.on(spellcheckerEvents, setMenuItemCheck); + return function () { + editor.off(spellcheckerEvents, setMenuItemCheck); + }; + }, + onAction: startSpellchecking + }); + }; + + var ignoreAll = true; + var getSuggestions = function (editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, currentLanguageState, word, spans) { + var items = []; + var suggestions = lastSuggestionsState.get().suggestions[word]; + global$1.each(suggestions, function (suggestion) { + items.push({ + text: suggestion, + onAction: function () { + editor.insertContent(editor.dom.encode(suggestion)); + editor.dom.remove(spans); + checkIfFinished(editor, startedState, textMatcherState); + } + }); + }); + var hasDictionarySupport = lastSuggestionsState.get().hasDictionarySupport; + if (hasDictionarySupport) { + items.push({ type: 'separator' }); + items.push({ + text: 'Add to dictionary', + onAction: function () { + addToDictionary(editor, pluginUrl, startedState, textMatcherState, currentLanguageState, word, spans); + } + }); + } + items.push.apply(items, [ + { type: 'separator' }, + { + text: 'Ignore', + onAction: function () { + ignoreWord(editor, startedState, textMatcherState, word, spans); + } + }, + { + text: 'Ignore all', + onAction: function () { + ignoreWord(editor, startedState, textMatcherState, word, spans, ignoreAll); + } + } + ]); + return items; + }; + var setup = function (editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, currentLanguageState) { + var update = function (element) { + var target = element; + if (target.className === 'mce-spellchecker-word') { + var spans = findSpansByIndex(editor, getElmIndex(target)); + if (spans.length > 0) { + var rng = editor.dom.createRng(); + rng.setStartBefore(spans[0]); + rng.setEndAfter(spans[spans.length - 1]); + editor.selection.setRng(rng); + return getSuggestions(editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, currentLanguageState, target.getAttribute('data-mce-word'), spans); + } + } else { + return []; + } + }; + editor.ui.registry.addContextMenu('spellchecker', { update: update }); + }; + + function Plugin () { + global.add('spellchecker', function (editor, pluginUrl) { + if (hasProPlugin(editor) === false) { + var startedState = Cell(false); + var currentLanguageState = Cell(getLanguage(editor)); + var textMatcherState = Cell(null); + var lastSuggestionsState = Cell(null); + register$1(editor, pluginUrl, startedState, textMatcherState, currentLanguageState, lastSuggestionsState); + setup(editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, currentLanguageState); + register(editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState); + return get(editor, startedState, lastSuggestionsState, textMatcherState, currentLanguageState); + } + }); + } + + Plugin(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/spellchecker/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/spellchecker/plugin.min.js old mode 100755 new mode 100644 index 350473eb6c69..612c34802fe5 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/spellchecker/plugin.min.js +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/spellchecker/plugin.min.js @@ -1 +1,9 @@ -!function(e,t){"use strict";function n(e,t){for(var n,o=[],r=0;r=d.end?(r=c,a=d.end-s):o&&l.push(c),!o&&c.length+s>d.start&&(o=c,i=d.start-s),s+=c.length),o&&r){if(c=n({startNode:o,startNodeIndex:i,endNode:r,endNodeIndex:a,innerNodes:l,match:d.text,matchIndex:u}),s-=r.length-a,o=null,r=null,l=[],d=t.shift(),u++,!d)break}else{if((!S[c.nodeName]||N[c.nodeName])&&c.firstChild){c=c.firstChild;continue}if(c.nextSibling){c=c.nextSibling;continue}}for(;;){if(c.nextSibling){c=c.nextSibling;break}if(c.parentNode===e)break e;c=c.parentNode}}}function i(e){function t(t,n){var o=w[n];o.stencil||(o.stencil=e(o));var r=o.stencil.cloneNode(!1);return r.setAttribute("data-mce-index",n),t&&r.appendChild(P.doc.createTextNode(t)),r}return function(e){var n,o,r,i=e.startNode,a=e.endNode,l=e.matchIndex,s=P.doc;if(i===a){var c=i;r=c.parentNode,e.startNodeIndex>0&&(n=s.createTextNode(c.data.substring(0,e.startNodeIndex)),r.insertBefore(n,c));var d=t(e.match,l);return r.insertBefore(d,c),e.endNodeIndexm;++m){var g=e.innerNodes[m],h=t(g.data,l);g.parentNode.replaceChild(h,g),f.push(h)}var v=t(a.data.substring(0,e.endNodeIndex),l);return r=i.parentNode,r.insertBefore(n,i),r.insertBefore(u,i),r.removeChild(i),r=a.parentNode,r.insertBefore(v,a),r.insertBefore(o,a),r.removeChild(a),v}}function a(e){var t=e.parentNode;t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)}function l(t){var n=e.getElementsByTagName("*"),o=[];t="number"==typeof t?""+t:null;for(var r=0;rt&&e(w[t],t)!==!1;t++);return this}function u(t){return w.length&&r(e,w,i(t)),this}function f(e,t){if(C&&e.global)for(;x=e.exec(C);)w.push(n(x,t));return this}function m(e){var t,n=l(e?s(e):null);for(t=n.length;t--;)a(n[t]);return this}function p(e){return w[e.getAttribute("data-mce-index")]}function g(e){return l(s(e))[0]}function h(e,t,n){return w.push({start:e,end:e+t,text:C.substr(e,t),data:n}),this}function v(e){var n=l(s(e)),o=t.dom.createRng();return o.setStartBefore(n[0]),o.setEndAfter(n[n.length-1]),o}function b(e,n){var o=v(e);return o.deleteContents(),n.length>0&&o.insertNode(t.dom.doc.createTextNode(n)),o}function y(){return w.splice(0,w.length),m(),this}var x,w=[],C,P=t.dom,N,S,k;return N=t.schema.getBlockElements(),S=t.schema.getWhiteSpaceElements(),k=t.schema.getShortEndedElements(),C=o(e),{text:C,matches:w,each:d,filter:c,reset:y,matchFromElement:p,elementFromMatch:g,find:f,add:h,wrap:u,unwrap:m,replace:b,rangeFromMatch:v,indexOf:s}}}),o(c,[s,d,u,f,m,p,g],function(e,t,n,o,r,i,a){t.add("spellchecker",function(t,l){function s(){return b.textMatcher||(b.textMatcher=new e(t.getBody(),t)),b.textMatcher}function c(e,t){var o=[];return n.each(t,function(e){o.push({selectable:!0,text:e.name,data:e.value})}),o}function d(e){for(var t in e)return!1;return!0}function u(e){var i=[],a=y[e.text];n.each(a,function(n){i.push({text:n,onclick:function(){var o=s().replace(e,n);o.collapse(!1),t.selection.setRng(o),m()}})}),i.push.apply(i,[{text:"-"},{text:"Ignore",onclick:function(){p(e)}},{text:"Ignore all",onclick:function(){p(e,!0)}},{text:"Finish",onclick:g}]),w=new o({items:i,context:"contextmenu",onautohide:function(e){-1!=e.target.className.indexOf("spellchecker")&&e.preventDefault()},onhide:function(){w.remove(),w=null}}),w.renderTo(document.body);var l=s().elementFromMatch(e),c=r.DOM.getPos(t.getContentAreaContainer()),d=t.dom.getPos(l),u=t.dom.getRoot();"BODY"==u.nodeName?(d.x-=u.ownerDocument.documentElement.scrollLeft||u.scrollLeft,d.y-=u.ownerDocument.documentElement.scrollTop||u.scrollTop):(d.x-=u.scrollLeft,d.y-=u.scrollTop),c.x+=d.x,c.y+=d.y,w.moveTo(c.x,c.y+l.offsetHeight)}function f(){function e(e){return t.setProgressState(!1),d(e)?(t.windowManager.alert("No misspellings found"),void(x=!1)):(y=e,s().filter(function(t){return!!e[t.text]}).wrap(function(){return t.dom.create("span",{"class":"mce-spellchecker-word","data-mce-bogus":1})}),void t.fire("SpellcheckStart"))}function n(e,n,o){i.sendRPC({url:new a(l).toAbsolute(C.spellchecker_rpc_url),method:e,params:{lang:C.spellchecker_language||"en",words:n},success:function(e){o(e)},error:function(e,n){e="JSON Parse error."==e?"Non JSON response:"+n.responseText:"Error: "+e,t.windowManager.alert(e),t.setProgressState(!1),g()}})}var o=[],r={};if(x)return void g();g(),x=!0;var c=t.getParam("spellchecker_wordchar_pattern")||new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`\xa7\xa9\xab\xae\xb1\xb6\xb7\xb8\xbb\xbc\xbd\xbe\xbf\xd7\xf7\xa4\u201d\u201c\u201e]+',"g");s().find(c).each(function(e){var t=e.text;if(!r[t]){if(/^\d+$/.test(t)||1==t.length)return;o.push(t),r[t]=!0}}),t.setProgressState(!0);var u=C.spellchecker_callback||n;u("spellcheck",o,e),t.focus()}function m(){t.dom.select("span.mce-spellchecker-word").length||g()}function p(e,n){t.selection.collapse(),n?s().each(function(t){t.text==e.text&&s().unwrap(t)}):s().unwrap(e),m()}function g(){s().reset(),b.textMatcher=null,x&&(x=!1,t.fire("SpellcheckEnd"))}function h(e){var t=C.spellchecker_language;e.control.items().each(function(e){e.active(e.settings.data===t)})}var v,b=this,y,x,w,C=t.settings,P=C.spellchecker_languages||"English=en,Danish=da,Dutch=nl,Finnish=fi,French=fr_FR,German=de,Italian=it,Polish=pl,Portuguese=pt_BR,Spanish=es,Swedish=sv";v=c("Language",n.map(P.split(","),function(e){var t=e.split("=");return{name:t[0],value:t[1]}})),t.on("click",function(e){if("mce-spellchecker-word"==e.target.className){e.preventDefault();var n=s().matchFromElement(e.target);t.selection.setRng(s().rangeFromMatch(n)),u(n)}}),t.addMenuItem("spellchecker",{text:"Spellcheck",context:"tools",onclick:f,selectable:!0,onPostRender:function(){var e=this;t.on("SpellcheckStart SpellcheckEnd",function(){e.active(x)})}});var N={tooltip:"Spellcheck",onclick:f,onPostRender:function(){var e=this;t.on("SpellcheckStart SpellcheckEnd",function(){e.active(x)})}};v.length>1&&(N.type="splitbutton",N.menu=v,N.onshow=h,N.onselect=function(e){C.spellchecker_language=e.control.settings.data}),t.addButton("spellchecker",N),t.addCommand("mceSpellCheck",f),t.on("remove",function(){w&&(w.remove(),w=null)}),this.getTextMatcher=s,C.spellchecker_language=C.spellchecker_language||C.language||"en"})}),a([s,c])}(this); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var N=function(e){var t=e;return{get:function(){return t},set:function(e){t=e}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=Object.hasOwnProperty,g=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=tinymce.util.Tools.resolve("tinymce.util.URI"),f=tinymce.util.Tools.resolve("tinymce.util.XHR"),h=function(e){return e.getParam("spellchecker_rpc_url")},k=function(e){var t=new RegExp('[^\\s!"#$%&()*+,-./:;<=>?@[\\]^_{|}`\xa7\xa9\xab\xae\xb1\xb6\xb7\xb8\xbb\xbc\xbd\xbe\xbf\xd7\xf7\xa4\u201d\u201c\u201e\xa0\u2002\u2003\u2009]+',"g");return e.getParam("spellchecker_wordchar_pattern",t)};function p(e){return e&&1===e.nodeType&&"false"===e.contentEditable}var r=function(i,r){var n,a=[],v=r.dom,f=r.schema.getBlockElements(),h=r.schema.getWhiteSpaceElements(),g=r.schema.getShortEndedElements();function o(e){var t=i.getElementsByTagName("*"),n=[];e="number"==typeof e?""+e:null;for(var r=0;r=c.end?(o=u,i=c.end-l):r&&s.push(u),!r&&u.length+l>c.start&&(r=u,a=c.start-l),l+=u.length),r&&o){if(u=n({startNode:r,startNodeIndex:a,endNode:o,endNodeIndex:i,innerNodes:s,match:c.text,matchIndex:d}),l-=o.length-i,o=r=null,s=[],d++,!(c=t.shift()))break}else if(h[u.nodeName]&&!f[u.nodeName]||!u.firstChild){if(u.nextSibling){u=u.nextSibling;continue}}else if(!p(u)){u=u.firstChild;continue}for(;;){if(u.nextSibling){u=u.nextSibling;break}if(u.parentNode===e)break e;u=u.parentNode}}}(i,a,(o=e,function(e){var t,n,r=e.startNode,o=e.endNode,a=e.matchIndex,i=v.doc;if(r===o){var c=r,s=c.parentNode;0 0) { + for (i = x + 1; i < el.length; i++) { + if (canSelect(el[i])) { + return el[i]; + } + } + } else { + for (i = x - 1; i >= 0; i--) { + if (canSelect(el[i])) { + return el[i]; + } + } + } + return null; + } + var v = global$5.explode(getTabFocus(editor)); + if (v.length === 1) { + v[1] = v[0]; + v[0] = ':prev'; + } + var el; + if (e.shiftKey) { + if (v[0] === ':prev') { + el = find(-1); + } else { + el = DOM.get(v[0]); + } + } else { + if (v[1] === ':next') { + el = find(1); + } else { + el = DOM.get(v[1]); + } + } + if (el) { + var focusEditor = global$2.get(el.id || el.name); + if (el.id && focusEditor) { + focusEditor.focus(); + } else { + global$4.setTimeout(function () { + if (!global$3.webkit) { + window.focus(); + } + el.focus(); + }, 10); + } + e.preventDefault(); + } + } + editor.on('init', function () { + if (editor.inline) { + DOM.setAttrib(editor.getBody(), 'tabIndex', null); + } + editor.on('keyup', tabCancel); + if (global$3.gecko) { + editor.on('keypress keydown', tabHandler); + } else { + editor.on('keydown', tabHandler); + } + }); + }; + + function Plugin () { + global.add('tabfocus', function (editor) { + setup(editor); + }); + } + + Plugin(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/tabfocus/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/tabfocus/plugin.min.js new file mode 100644 index 000000000000..fa164938c600 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/tabfocus/plugin.min.js @@ -0,0 +1,9 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),c=tinymce.util.Tools.resolve("tinymce.EditorManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),y=tinymce.util.Tools.resolve("tinymce.util.Delay"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),f=tinymce.util.Tools.resolve("tinymce.util.VK"),m=t.DOM,n=function(e){e.keyCode!==f.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()},i=function(s){function e(i){var o,l,e,t,n,u;function r(e){var t=m.select(":input:enabled,*[tabindex]:not(iframe)");function n(e){return/INPUT|TEXTAREA|BUTTON/.test(e.tagName)&&c.get(i.id)&&-1!==e.tabIndex&&function t(e){return"BODY"===e.nodeName||"hidden"!==e.type&&"none"!==e.style.display&&"hidden"!==e.style.visibility&&t(e.parentNode)}(e)}if(d.each(t,function(e,t){if(e.id===s.id)return o=t,!1}),0 0) { - rng = dom.createRng(); - node = selectedCells[0]; - endNode = selectedCells[selectedCells.length - 1]; - rng.setStartBefore(node); - rng.setEndAfter(node); - - setPoint(node, 1); - walker = new TreeWalker(node, dom.getParent(selectedCells[0], 'table')); - - do { - if (node.nodeName == 'TD' || node.nodeName == 'TH') { - if (!dom.hasClass(node, 'mce-item-selected')) { - break; - } - - lastNode = node; - } - } while ((node = walker.next())); - - setPoint(lastNode); - - sel.setRng(rng); - } - - editor.nodeChanged(); - startCell = tableGrid = startTable = null; - } - }); - - editor.on('KeyUp', function() { - clear(); - }); - - return { - clear: clear - }; - }; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/table/classes/Plugin.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/table/classes/Plugin.js deleted file mode 100755 index a0d87ea578ca..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/table/classes/Plugin.js +++ /dev/null @@ -1,794 +0,0 @@ -/** - * Plugin.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class contains all core logic for the table plugin. - * - * @class tinymce.tableplugin.Plugin - * @private - */ -define("tinymce/tableplugin/Plugin", [ - "tinymce/tableplugin/TableGrid", - "tinymce/tableplugin/Quirks", - "tinymce/tableplugin/CellSelection", - "tinymce/util/Tools", - "tinymce/dom/TreeWalker", - "tinymce/Env", - "tinymce/PluginManager" -], function(TableGrid, Quirks, CellSelection, Tools, TreeWalker, Env, PluginManager) { - var each = Tools.each; - - function Plugin(editor) { - var winMan, clipboardRows, self = this; // Might be selected cells on reload - - function removePxSuffix(size) { - return size ? size.replace(/px$/, '') : ""; - } - - function addSizeSuffix(size) { - if (/^[0-9]+$/.test(size)) { - size += "px"; - } - - return size; - } - - function unApplyAlign(elm) { - each('left center right'.split(' '), function(name) { - editor.formatter.remove('align' + name, {}, elm); - }); - } - - function tableDialog() { - var dom = editor.dom, tableElm, data; - - tableElm = dom.getParent(editor.selection.getStart(), 'table'); - - data = { - width: removePxSuffix(dom.getStyle(tableElm, 'width') || dom.getAttrib(tableElm, 'width')), - height: removePxSuffix(dom.getStyle(tableElm, 'height') || dom.getAttrib(tableElm, 'height')), - cellspacing: dom.getAttrib(tableElm, 'cellspacing'), - cellpadding: dom.getAttrib(tableElm, 'cellpadding'), - border: dom.getAttrib(tableElm, 'border'), - caption: !!dom.select('caption', tableElm)[0] - }; - - each('left center right'.split(' '), function(name) { - if (editor.formatter.matchNode(tableElm, 'align' + name)) { - data.align = name; - } - }); - - editor.windowManager.open({ - title: "Table properties", - items: { - type: 'form', - layout: 'grid', - columns: 2, - data: data, - defaults: { - type: 'textbox', - maxWidth: 50 - }, - items: [ - {label: 'Width', name: 'width'}, - {label: 'Height', name: 'height'}, - {label: 'Cell spacing', name: 'cellspacing'}, - {label: 'Cell padding', name: 'cellpadding'}, - {label: 'Border', name: 'border'}, - {label: 'Caption', name: 'caption', type: 'checkbox'}, - { - label: 'Alignment', - minWidth: 90, - name: 'align', - type: 'listbox', - text: 'None', - maxWidth: null, - values: [ - {text: 'None', value: ''}, - {text: 'Left', value: 'left'}, - {text: 'Center', value: 'center'}, - {text: 'Right', value: 'right'} - ] - } - ] - }, - - onsubmit: function() { - var data = this.toJSON(), captionElm; - - editor.undoManager.transact(function() { - editor.dom.setAttribs(tableElm, { - cellspacing: data.cellspacing, - cellpadding: data.cellpadding, - border: data.border - }); - - editor.dom.setStyles(tableElm, { - width: addSizeSuffix(data.width), - height: addSizeSuffix(data.height) - }); - - // Toggle caption on/off - captionElm = dom.select('caption', tableElm)[0]; - - if (captionElm && !data.caption) { - dom.remove(captionElm); - } - - if (!captionElm && data.caption) { - captionElm = dom.create('caption'); - captionElm.innerHTML = !Env.ie ? '
    ' : '\u00a0'; - tableElm.insertBefore(captionElm, tableElm.firstChild); - } - - unApplyAlign(tableElm); - if (data.align) { - editor.formatter.apply('align' + data.align, {}, tableElm); - } - - editor.focus(); - editor.addVisual(); - }); - } - }); - } - - function mergeDialog(grid, cell) { - editor.windowManager.open({ - title: "Merge cells", - body: [ - {label: 'Cols', name: 'cols', type: 'textbox', size: 10}, - {label: 'Rows', name: 'rows', type: 'textbox', size: 10} - ], - onsubmit: function() { - var data = this.toJSON(); - - editor.undoManager.transact(function() { - grid.merge(cell, data.cols, data.rows); - }); - } - }); - } - - function cellDialog() { - var dom = editor.dom, cellElm, data, cells = []; - - // Get selected cells or the current cell - cells = editor.dom.select('td.mce-item-selected,th.mce-item-selected'); - cellElm = editor.dom.getParent(editor.selection.getStart(), 'td,th'); - if (!cells.length && cellElm) { - cells.push(cellElm); - } - - cellElm = cellElm || cells[0]; - - if (!cellElm) { - // If this element is null, return now to avoid crashing. - return; - } - - data = { - width: removePxSuffix(dom.getStyle(cellElm, 'width') || dom.getAttrib(cellElm, 'width')), - height: removePxSuffix(dom.getStyle(cellElm, 'height') || dom.getAttrib(cellElm, 'height')), - scope: dom.getAttrib(cellElm, 'scope') - }; - - data.type = cellElm.nodeName.toLowerCase(); - - each('left center right'.split(' '), function(name) { - if (editor.formatter.matchNode(cellElm, 'align' + name)) { - data.align = name; - } - }); - - editor.windowManager.open({ - title: "Cell properties", - items: { - type: 'form', - data: data, - layout: 'grid', - columns: 2, - defaults: { - type: 'textbox', - maxWidth: 50 - }, - items: [ - {label: 'Width', name: 'width'}, - {label: 'Height', name: 'height'}, - { - label: 'Cell type', - name: 'type', - type: 'listbox', - text: 'None', - minWidth: 90, - maxWidth: null, - values: [ - {text: 'Cell', value: 'td'}, - {text: 'Header cell', value: 'th'} - ] - }, - { - label: 'Scope', - name: 'scope', - type: 'listbox', - text: 'None', - minWidth: 90, - maxWidth: null, - values: [ - {text: 'None', value: ''}, - {text: 'Row', value: 'row'}, - {text: 'Column', value: 'col'}, - {text: 'Row group', value: 'rowgroup'}, - {text: 'Column group', value: 'colgroup'} - ] - }, - { - label: 'Alignment', - name: 'align', - type: 'listbox', - text: 'None', - minWidth: 90, - maxWidth: null, - values: [ - {text: 'None', value: ''}, - {text: 'Left', value: 'left'}, - {text: 'Center', value: 'center'}, - {text: 'Right', value: 'right'} - ] - } - ] - }, - - onsubmit: function() { - var data = this.toJSON(); - - editor.undoManager.transact(function() { - each(cells, function(cellElm) { - editor.dom.setAttrib(cellElm, 'scope', data.scope); - - editor.dom.setStyles(cellElm, { - width: addSizeSuffix(data.width), - height: addSizeSuffix(data.height) - }); - - // Switch cell type - if (data.type && cellElm.nodeName.toLowerCase() != data.type) { - cellElm = dom.rename(cellElm, data.type); - } - - // Apply/remove alignment - unApplyAlign(cellElm); - if (data.align) { - editor.formatter.apply('align' + data.align, {}, cellElm); - } - }); - - editor.focus(); - }); - } - }); - } - - function rowDialog() { - var dom = editor.dom, tableElm, cellElm, rowElm, data, rows = []; - - tableElm = editor.dom.getParent(editor.selection.getStart(), 'table'); - cellElm = editor.dom.getParent(editor.selection.getStart(), 'td,th'); - - each(tableElm.rows, function(row) { - each(row.cells, function(cell) { - if (dom.hasClass(cell, 'mce-item-selected') || cell == cellElm) { - rows.push(row); - return false; - } - }); - }); - - rowElm = rows[0]; - if (!rowElm) { - // If this element is null, return now to avoid crashing. - return; - } - - data = { - height: removePxSuffix(dom.getStyle(rowElm, 'height') || dom.getAttrib(rowElm, 'height')), - scope: dom.getAttrib(rowElm, 'scope') - }; - - data.type = rowElm.parentNode.nodeName.toLowerCase(); - - each('left center right'.split(' '), function(name) { - if (editor.formatter.matchNode(rowElm, 'align' + name)) { - data.align = name; - } - }); - - editor.windowManager.open({ - title: "Row properties", - items: { - type: 'form', - data: data, - columns: 2, - defaults: { - type: 'textbox' - }, - items: [ - { - type: 'listbox', - name: 'type', - label: 'Row type', - text: 'None', - maxWidth: null, - values: [ - {text: 'Header', value: 'thead'}, - {text: 'Body', value: 'tbody'}, - {text: 'Footer', value: 'tfoot'} - ] - }, - { - type: 'listbox', - name: 'align', - label: 'Alignment', - text: 'None', - maxWidth: null, - values: [ - {text: 'None', value: ''}, - {text: 'Left', value: 'left'}, - {text: 'Center', value: 'center'}, - {text: 'Right', value: 'right'} - ] - }, - {label: 'Height', name: 'height'} - ] - }, - - onsubmit: function() { - var data = this.toJSON(), tableElm, oldParentElm, parentElm; - - editor.undoManager.transact(function() { - var toType = data.type; - - each(rows, function(rowElm) { - editor.dom.setAttrib(rowElm, 'scope', data.scope); - - editor.dom.setStyles(rowElm, { - height: addSizeSuffix(data.height) - }); - - if (toType != rowElm.parentNode.nodeName.toLowerCase()) { - tableElm = dom.getParent(rowElm, 'table'); - - oldParentElm = rowElm.parentNode; - parentElm = dom.select(toType, tableElm)[0]; - if (!parentElm) { - parentElm = dom.create(toType); - if (tableElm.firstChild) { - tableElm.insertBefore(parentElm, tableElm.firstChild); - } else { - tableElm.appendChild(parentElm); - } - } - - parentElm.appendChild(rowElm); - - if (!oldParentElm.hasChildNodes()) { - dom.remove(oldParentElm); - } - } - - // Apply/remove alignment - unApplyAlign(rowElm); - if (data.align) { - editor.formatter.apply('align' + data.align, {}, rowElm); - } - }); - - editor.focus(); - }); - } - }); - } - - function cmd(command) { - return function() { - editor.execCommand(command); - }; - } - - function insertTable(cols, rows) { - var y, x, html; - - html = ''; - - for (y = 0; y < rows; y++) { - html += ''; - - for (x = 0; x < cols; x++) { - html += ''; - } - - html += ''; - } - - html += '
    ' + (Env.ie ? " " : '
    ') + '
    '; - - editor.insertContent(html); - } - - function handleDisabledState(ctrl, selector) { - function bindStateListener() { - ctrl.disabled(!editor.dom.getParent(editor.selection.getStart(), selector)); - - editor.selection.selectorChanged(selector, function(state) { - ctrl.disabled(!state); - }); - } - - if (editor.initialized) { - bindStateListener(); - } else { - editor.on('init', bindStateListener); - } - } - - function postRender() { - /*jshint validthis:true*/ - handleDisabledState(this, 'table'); - } - - function postRenderCell() { - /*jshint validthis:true*/ - handleDisabledState(this, 'td,th'); - } - - function generateTableGrid() { - var html = ''; - - html = ''; - - for (var y = 0; y < 10; y++) { - html += ''; - - for (var x = 0; x < 10; x++) { - html += ''; - } - - html += ''; - } - - html += '
    '; - - html += ''; - - return html; - } - - function selectGrid(tx, ty, control) { - var table = control.getEl().getElementsByTagName('table')[0]; - var rel = control.parent().rel, x, y, focusCell, cell; - - if (control.isRtl() || rel == 'tl-tr') { - for (y = 9; y >= 0; y--) { - for (x = 0; x < 10; x++) { - cell = table.rows[y].childNodes[x].firstChild; - - editor.dom.toggleClass( - cell, - 'mce-active', - x >= tx && y <= ty - ); - - if (x >= tx && y <= ty) { - focusCell = cell; - } - } - } - - tx = 9 - tx; - table.nextSibling.innerHTML = tx + ' x ' + (ty + 1); - } else { - for (y = 0; y < 10; y++) { - for (x = 0; x < 10; x++) { - cell = table.rows[y].childNodes[x].firstChild; - - editor.dom.toggleClass( - cell, - 'mce-active', - x <= tx && y <= ty - ); - - if (x <= tx && y <= ty) { - focusCell = cell; - } - } - } - - table.nextSibling.innerHTML = (tx + 1) + ' x ' + (ty + 1); - } - - return focusCell.parentNode; - } - - editor.addMenuItem('inserttable', { - text: 'Insert table', - icon: 'table', - context: 'table', - onhide: function() { - var elements = this.menu.items()[0].getEl().getElementsByTagName('a'); - editor.dom.removeClass(elements, 'mce-active'); - editor.dom.addClass(elements[0], 'mce-active'); - }, - menu: [ - { - type: 'container', - html: generateTableGrid(), - - onPostRender: function() { - this.lastX = this.lastY = 0; - }, - - onmousemove: function(e) { - var target = e.target, x, y; - - if (target.nodeName == 'A') { - x = parseInt(target.getAttribute('data-mce-x'), 10); - y = parseInt(target.getAttribute('data-mce-y'), 10); - - if (x !== this.lastX || y !== this.lastY) { - selectGrid(x, y, e.control); - - this.lastX = x; - this.lastY = y; - } - } - }, - - onkeydown: function(e) { - var x = this.lastX, y = this.lastY, isHandled; - - switch (e.keyCode) { - case 37: // DOM_VK_LEFT - if (x > 0) { - x--; - isHandled = true; - } - break; - - case 39: // DOM_VK_RIGHT - isHandled = true; - - if (x < 9) { - x++; - } - break; - - case 38: // DOM_VK_UP - isHandled = true; - - if (y > 0) { - y--; - } - break; - - case 40: // DOM_VK_DOWN - isHandled = true; - - if (y < 9) { - y++; - } - break; - } - - if (isHandled) { - e.preventDefault(); - e.stopPropagation(); - - selectGrid(x, y, e.control).focus(); - - this.lastX = x; - this.lastY = y; - } - }, - - onclick: function(e) { - if (e.target.nodeName == 'A') { - e.preventDefault(); - e.stopPropagation(); - this.parent().cancel(); - - insertTable(this.lastX + 1, this.lastY + 1); - } - } - } - ] - }); - - editor.addMenuItem('tableprops', { - text: 'Table properties', - context: 'table', - onPostRender: postRender, - onclick: tableDialog - }); - - editor.addMenuItem('deletetable', { - text: 'Delete table', - context: 'table', - onPostRender: postRender, - cmd: 'mceTableDelete' - }); - - editor.addMenuItem('cell', { - separator: 'before', - text: 'Cell', - context: 'table', - menu: [ - {text: 'Cell properties', onclick: cmd('mceTableCellProps'), onPostRender: postRenderCell}, - {text: 'Merge cells', onclick: cmd('mceTableMergeCells'), onPostRender: postRenderCell}, - {text: 'Split cell', onclick: cmd('mceTableSplitCells'), onPostRender: postRenderCell} - ] - }); - - editor.addMenuItem('row', { - text: 'Row', - context: 'table', - menu: [ - {text: 'Insert row before', onclick: cmd('mceTableInsertRowBefore'), onPostRender: postRenderCell}, - {text: 'Insert row after', onclick: cmd('mceTableInsertRowAfter'), onPostRender: postRenderCell}, - {text: 'Delete row', onclick: cmd('mceTableDeleteRow'), onPostRender: postRenderCell}, - {text: 'Row properties', onclick: cmd('mceTableRowProps'), onPostRender: postRenderCell}, - {text: '-'}, - {text: 'Cut row', onclick: cmd('mceTableCutRow'), onPostRender: postRenderCell}, - {text: 'Copy row', onclick: cmd('mceTableCopyRow'), onPostRender: postRenderCell}, - {text: 'Paste row before', onclick: cmd('mceTablePasteRowBefore'), onPostRender: postRenderCell}, - {text: 'Paste row after', onclick: cmd('mceTablePasteRowAfter'), onPostRender: postRenderCell} - ] - }); - - editor.addMenuItem('column', { - text: 'Column', - context: 'table', - menu: [ - {text: 'Insert column before', onclick: cmd('mceTableInsertColBefore'), onPostRender: postRenderCell}, - {text: 'Insert column after', onclick: cmd('mceTableInsertColAfter'), onPostRender: postRenderCell}, - {text: 'Delete column', onclick: cmd('mceTableDeleteCol'), onPostRender: postRenderCell} - ] - }); - - var menuItems = []; - each("inserttable tableprops deletetable | cell row column".split(' '), function(name) { - if (name == '|') { - menuItems.push({text: '-'}); - } else { - menuItems.push(editor.menuItems[name]); - } - }); - - editor.addButton("table", { - type: "menubutton", - title: "Table", - menu: menuItems - }); - - // Select whole table is a table border is clicked - if (!Env.isIE) { - editor.on('click', function(e) { - e = e.target; - - if (e.nodeName === 'TABLE') { - editor.selection.select(e); - editor.nodeChanged(); - } - }); - } - - self.quirks = new Quirks(editor); - - editor.on('Init', function() { - winMan = editor.windowManager; - self.cellSelection = new CellSelection(editor); - }); - - // Register action commands - each({ - mceTableSplitCells: function(grid) { - grid.split(); - }, - - mceTableMergeCells: function(grid) { - var rowSpan, colSpan, cell; - - cell = editor.dom.getParent(editor.selection.getStart(), 'th,td'); - if (cell) { - rowSpan = cell.rowSpan; - colSpan = cell.colSpan; - } - - if (!editor.dom.select('td.mce-item-selected,th.mce-item-selected').length) { - mergeDialog(grid, cell); - } else { - grid.merge(); - } - }, - - mceTableInsertRowBefore: function(grid) { - grid.insertRow(true); - }, - - mceTableInsertRowAfter: function(grid) { - grid.insertRow(); - }, - - mceTableInsertColBefore: function(grid) { - grid.insertCol(true); - }, - - mceTableInsertColAfter: function(grid) { - grid.insertCol(); - }, - - mceTableDeleteCol: function(grid) { - grid.deleteCols(); - }, - - mceTableDeleteRow: function(grid) { - grid.deleteRows(); - }, - - mceTableCutRow: function(grid) { - clipboardRows = grid.cutRows(); - }, - - mceTableCopyRow: function(grid) { - clipboardRows = grid.copyRows(); - }, - - mceTablePasteRowBefore: function(grid) { - grid.pasteRows(clipboardRows, true); - }, - - mceTablePasteRowAfter: function(grid) { - grid.pasteRows(clipboardRows); - }, - - mceTableDelete: function(grid) { - grid.deleteTable(); - } - }, function(func, name) { - editor.addCommand(name, function() { - var grid = new TableGrid(editor); - - if (grid) { - func(grid); - editor.execCommand('mceRepaint'); - self.cellSelection.clear(); - } - }); - }); - - // Register dialog commands - each({ - mceInsertTable: function() { - tableDialog(); - }, - - mceTableRowProps: rowDialog, - mceTableCellProps: cellDialog - }, function(func, name) { - editor.addCommand(name, function(ui, val) { - func(val); - }); - }); - } - - PluginManager.add('table', Plugin); -}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/table/classes/Quirks.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/table/classes/Quirks.js deleted file mode 100755 index 61e2a5255345..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/table/classes/Quirks.js +++ /dev/null @@ -1,370 +0,0 @@ -/** - * Quirks.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class includes fixes for various browser quirks. - * - * @class tinymce.tableplugin.Quirks - * @private - */ -define("tinymce/tableplugin/Quirks", [ - "tinymce/util/VK", - "tinymce/Env", - "tinymce/util/Tools" -], function(VK, Env, Tools) { - var each = Tools.each; - - function getSpanVal(td, name) { - return parseInt(td.getAttribute(name) || 1, 10); - } - - return function(editor) { - /** - * Fixed caret movement around tables on WebKit. - */ - function moveWebKitSelection() { - function eventHandler(e) { - var key = e.keyCode; - - function handle(upBool, sourceNode) { - var siblingDirection = upBool ? 'previousSibling' : 'nextSibling'; - var currentRow = editor.dom.getParent(sourceNode, 'tr'); - var siblingRow = currentRow[siblingDirection]; - - if (siblingRow) { - moveCursorToRow(editor, sourceNode, siblingRow, upBool); - e.preventDefault(); - return true; - } else { - var tableNode = editor.dom.getParent(currentRow, 'table'); - var middleNode = currentRow.parentNode; - var parentNodeName = middleNode.nodeName.toLowerCase(); - if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) { - var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody'); - if (targetParent !== null) { - return moveToRowInTarget(upBool, targetParent, sourceNode); - } - } - return escapeTable(upBool, currentRow, siblingDirection, tableNode); - } - } - - function getTargetParent(upBool, topNode, secondNode, nodeName) { - var tbodies = editor.dom.select('>' + nodeName, topNode); - var position = tbodies.indexOf(secondNode); - if (upBool && position === 0 || !upBool && position === tbodies.length - 1) { - return getFirstHeadOrFoot(upBool, topNode); - } else if (position === -1) { - var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1; - return tbodies[topOrBottom]; - } else { - return tbodies[position + (upBool ? -1 : 1)]; - } - } - - function getFirstHeadOrFoot(upBool, parent) { - var tagName = upBool ? 'thead' : 'tfoot'; - var headOrFoot = editor.dom.select('>' + tagName, parent); - return headOrFoot.length !== 0 ? headOrFoot[0] : null; - } - - function moveToRowInTarget(upBool, targetParent, sourceNode) { - var targetRow = getChildForDirection(targetParent, upBool); - - if (targetRow) { - moveCursorToRow(editor, sourceNode, targetRow, upBool); - } - - e.preventDefault(); - return true; - } - - function escapeTable(upBool, currentRow, siblingDirection, table) { - var tableSibling = table[siblingDirection]; - - if (tableSibling) { - moveCursorToStartOfElement(tableSibling); - return true; - } else { - var parentCell = editor.dom.getParent(table, 'td,th'); - if (parentCell) { - return handle(upBool, parentCell, e); - } else { - var backUpSibling = getChildForDirection(currentRow, !upBool); - moveCursorToStartOfElement(backUpSibling); - e.preventDefault(); - return false; - } - } - } - - function getChildForDirection(parent, up) { - var child = parent && parent[up ? 'lastChild' : 'firstChild']; - // BR is not a valid table child to return in this case we return the table cell - return child && child.nodeName === 'BR' ? editor.dom.getParent(child, 'td,th') : child; - } - - function moveCursorToStartOfElement(n) { - editor.selection.setCursorLocation(n, 0); - } - - function isVerticalMovement() { - return key == VK.UP || key == VK.DOWN; - } - - function isInTable(editor) { - var node = editor.selection.getNode(); - var currentRow = editor.dom.getParent(node, 'tr'); - return currentRow !== null; - } - - function columnIndex(column) { - var colIndex = 0; - var c = column; - while (c.previousSibling) { - c = c.previousSibling; - colIndex = colIndex + getSpanVal(c, "colspan"); - } - return colIndex; - } - - function findColumn(rowElement, columnIndex) { - var c = 0, r = 0; - - each(rowElement.children, function(cell, i) { - c = c + getSpanVal(cell, "colspan"); - r = i; - if (c > columnIndex) { - return false; - } - }); - return r; - } - - function moveCursorToRow(ed, node, row, upBool) { - var srcColumnIndex = columnIndex(editor.dom.getParent(node, 'td,th')); - var tgtColumnIndex = findColumn(row, srcColumnIndex); - var tgtNode = row.childNodes[tgtColumnIndex]; - var rowCellTarget = getChildForDirection(tgtNode, upBool); - moveCursorToStartOfElement(rowCellTarget || tgtNode); - } - - function shouldFixCaret(preBrowserNode) { - var newNode = editor.selection.getNode(); - var newParent = editor.dom.getParent(newNode, 'td,th'); - var oldParent = editor.dom.getParent(preBrowserNode, 'td,th'); - - return newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent); - } - - function checkSameParentTable(nodeOne, NodeTwo) { - return editor.dom.getParent(nodeOne, 'TABLE') === editor.dom.getParent(NodeTwo, 'TABLE'); - } - - if (isVerticalMovement() && isInTable(editor)) { - var preBrowserNode = editor.selection.getNode(); - setTimeout(function() { - if (shouldFixCaret(preBrowserNode)) { - handle(!e.shiftKey && key === VK.UP, preBrowserNode, e); - } - }, 0); - } - } - - editor.on('KeyDown', function(e) { - eventHandler(e); - }); - } - - function fixBeforeTableCaretBug() { - // Checks if the selection/caret is at the start of the specified block element - function isAtStart(rng, par) { - var doc = par.ownerDocument, rng2 = doc.createRange(), elm; - - rng2.setStartBefore(par); - rng2.setEnd(rng.endContainer, rng.endOffset); - - elm = doc.createElement('body'); - elm.appendChild(rng2.cloneContents()); - - // Check for text characters of other elements that should be treated as content - return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length === 0; - } - - // Fixes an bug where it's impossible to place the caret before a table in Gecko - // this fix solves it by detecting when the caret is at the beginning of such a table - // and then manually moves the caret infront of the table - editor.on('KeyDown', function(e) { - var rng, table, dom = editor.dom; - - // On gecko it's not possible to place the caret before a table - if (e.keyCode == 37 || e.keyCode == 38) { - rng = editor.selection.getRng(); - table = dom.getParent(rng.startContainer, 'table'); - - if (table && editor.getBody().firstChild == table) { - if (isAtStart(rng, table)) { - rng = dom.createRng(); - - rng.setStartBefore(table); - rng.setEndBefore(table); - - editor.selection.setRng(rng); - - e.preventDefault(); - } - } - } - }); - } - - // Fixes an issue on Gecko where it's impossible to place the caret behind a table - // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled - function fixTableCaretPos() { - editor.on('KeyDown SetContent VisualAid', function() { - var last; - - // Skip empty text nodes from the end - for (last = editor.getBody().lastChild; last; last = last.previousSibling) { - if (last.nodeType == 3) { - if (last.nodeValue.length > 0) { - break; - } - } else if (last.nodeType == 1 && !last.getAttribute('data-mce-bogus')) { - break; - } - } - - if (last && last.nodeName == 'TABLE') { - if (editor.settings.forced_root_block) { - editor.dom.add( - editor.getBody(), - editor.settings.forced_root_block, - editor.settings.forced_root_block_attrs, - Env.ie && Env.ie < 11 ? ' ' : '
    ' - ); - } else { - editor.dom.add(editor.getBody(), 'br', {'data-mce-bogus': '1'}); - } - } - }); - - editor.on('PreProcess', function(o) { - var last = o.node.lastChild; - - if (last && (last.nodeName == "BR" || (last.childNodes.length == 1 && - (last.firstChild.nodeName == 'BR' || last.firstChild.nodeValue == '\u00a0'))) && - last.previousSibling && last.previousSibling.nodeName == "TABLE") { - editor.dom.remove(last); - } - }); - } - - // this nasty hack is here to work around some WebKit selection bugs. - function fixTableCellSelection() { - function tableCellSelected(ed, rng, n, currentCell) { - // The decision of when a table cell is selected is somewhat involved. The fact that this code is - // required is actually a pointer to the root cause of this bug. A cell is selected when the start - // and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases) - // or the parent of the table (in the case of the selection containing the last cell of a table). - var TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE'); - var tableParent, allOfCellSelected, tableCellSelection; - - if (table) { - tableParent = table.parentNode; - } - - allOfCellSelected = rng.startContainer.nodeType == TEXT_NODE && - rng.startOffset === 0 && - rng.endOffset === 0 && - currentCell && - (n.nodeName == "TR" || n == tableParent); - - tableCellSelection = (n.nodeName == "TD" || n.nodeName == "TH") && !currentCell; - - return allOfCellSelected || tableCellSelection; - } - - function fixSelection() { - var rng = editor.selection.getRng(); - var n = editor.selection.getNode(); - var currentCell = editor.dom.getParent(rng.startContainer, 'TD,TH'); - - if (!tableCellSelected(editor, rng, n, currentCell)) { - return; - } - - if (!currentCell) { - currentCell = n; - } - - // Get the very last node inside the table cell - var end = currentCell.lastChild; - while (end.lastChild) { - end = end.lastChild; - } - - // Select the entire table cell. Nothing outside of the table cell should be selected. - rng.setEnd(end, end.nodeValue.length); - editor.selection.setRng(rng); - } - - editor.on('KeyDown', function() { - fixSelection(); - }); - - editor.on('MouseDown', function(e) { - if (e.button != 2) { - fixSelection(); - } - }); - } - - /** - * Delete table if all cells are selected. - */ - function deleteTable() { - editor.on('keydown', function(e) { - if ((e.keyCode == VK.DELETE || e.keyCode == VK.BACKSPACE) && !e.isDefaultPrevented()) { - var table = editor.dom.getParent(editor.selection.getStart(), 'table'); - - if (table) { - var cells = editor.dom.select('td,th', table), i = cells.length; - while (i--) { - if (!editor.dom.hasClass(cells[i], 'mce-item-selected')) { - return; - } - } - - e.preventDefault(); - editor.execCommand('mceTableDelete'); - } - } - }); - } - - deleteTable(); - - if (Env.webkit) { - moveWebKitSelection(); - fixTableCellSelection(); - } - - if (Env.gecko) { - fixBeforeTableCaretBug(); - fixTableCaretPos(); - } - - if (Env.ie > 10) { - fixBeforeTableCaretBug(); - fixTableCaretPos(); - } - }; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/table/classes/TableGrid.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/table/classes/TableGrid.js deleted file mode 100755 index eea3cd23d932..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/table/classes/TableGrid.js +++ /dev/null @@ -1,833 +0,0 @@ -/** - * TableGrid.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class creates a grid out of a table element. This - * makes it a whole lot easier to handle complex tables with - * col/row spans. - * - * @class tinymce.tableplugin.TableGrid - * @private - */ -define("tinymce/tableplugin/TableGrid", [ - "tinymce/util/Tools", - "tinymce/Env" -], function(Tools, Env) { - var each = Tools.each; - - function getSpanVal(td, name) { - return parseInt(td.getAttribute(name) || 1, 10); - } - - return function(editor, table) { - var grid, startPos, endPos, selectedCell, selection = editor.selection, dom = selection.dom; - - function buildGrid() { - var startY = 0; - - grid = []; - - each(['thead', 'tbody', 'tfoot'], function(part) { - var rows = dom.select('> ' + part + ' tr', table); - - each(rows, function(tr, y) { - y += startY; - - each(dom.select('> td, > th', tr), function(td, x) { - var x2, y2, rowspan, colspan; - - // Skip over existing cells produced by rowspan - if (grid[y]) { - while (grid[y][x]) { - x++; - } - } - - // Get col/rowspan from cell - rowspan = getSpanVal(td, 'rowspan'); - colspan = getSpanVal(td, 'colspan'); - - // Fill out rowspan/colspan right and down - for (y2 = y; y2 < y + rowspan; y2++) { - if (!grid[y2]) { - grid[y2] = []; - } - - for (x2 = x; x2 < x + colspan; x2++) { - grid[y2][x2] = { - part: part, - real: y2 == y && x2 == x, - elm: td, - rowspan: rowspan, - colspan: colspan - }; - } - } - }); - }); - - startY += rows.length; - }); - } - - function cloneNode(node, children) { - node = node.cloneNode(children); - node.removeAttribute('id'); - - return node; - } - - function getCell(x, y) { - var row; - - row = grid[y]; - if (row) { - return row[x]; - } - } - - function setSpanVal(td, name, val) { - if (td) { - val = parseInt(val, 10); - - if (val === 1) { - td.removeAttribute(name, 1); - } else { - td.setAttribute(name, val, 1); - } - } - } - - function isCellSelected(cell) { - return cell && (dom.hasClass(cell.elm, 'mce-item-selected') || cell == selectedCell); - } - - function getSelectedRows() { - var rows = []; - - each(table.rows, function(row) { - each(row.cells, function(cell) { - if (dom.hasClass(cell, 'mce-item-selected') || (selectedCell && cell == selectedCell.elm)) { - rows.push(row); - return false; - } - }); - }); - - return rows; - } - - function deleteTable() { - var rng = dom.createRng(); - - rng.setStartAfter(table); - rng.setEndAfter(table); - - selection.setRng(rng); - - dom.remove(table); - } - - function cloneCell(cell) { - var formatNode, cloneFormats = {}; - - if (editor.settings.table_clone_elements !== false) { - cloneFormats = Tools.makeMap( - (editor.settings.table_clone_elements || 'strong em b i span font h1 h2 h3 h4 h5 h6 p div').toUpperCase(), - /[ ,]/ - ); - } - - // Clone formats - Tools.walk(cell, function(node) { - var curNode; - - if (node.nodeType == 3) { - each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) { - if (!cloneFormats[node.nodeName]) { - return; - } - - node = cloneNode(node, false); - - if (!formatNode) { - formatNode = curNode = node; - } else if (curNode) { - curNode.appendChild(node); - } - - curNode = node; - }); - - // Add something to the inner node - if (curNode) { - curNode.innerHTML = Env.ie ? ' ' : '
    '; - } - - return false; - } - }, 'childNodes'); - - cell = cloneNode(cell, false); - setSpanVal(cell, 'rowSpan', 1); - setSpanVal(cell, 'colSpan', 1); - - if (formatNode) { - cell.appendChild(formatNode); - } else { - if (!Env.ie) { - cell.innerHTML = '
    '; - } - } - - return cell; - } - - function cleanup() { - var rng = dom.createRng(), row; - - // Empty rows - each(dom.select('tr', table), function(tr) { - if (tr.cells.length === 0) { - dom.remove(tr); - } - }); - - // Empty table - if (dom.select('tr', table).length === 0) { - rng.setStartBefore(table); - rng.setEndBefore(table); - selection.setRng(rng); - dom.remove(table); - return; - } - - // Empty header/body/footer - each(dom.select('thead,tbody,tfoot', table), function(part) { - if (part.rows.length === 0) { - dom.remove(part); - } - }); - - // Restore selection to start position if it still exists - buildGrid(); - - // If we have a valid startPos object - if (startPos) { - // Restore the selection to the closest table position - row = grid[Math.min(grid.length - 1, startPos.y)]; - if (row) { - selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true); - selection.collapse(true); - } - } - } - - function fillLeftDown(x, y, rows, cols) { - var tr, x2, r, c, cell; - - tr = grid[y][x].elm.parentNode; - for (r = 1; r <= rows; r++) { - tr = dom.getNext(tr, 'tr'); - - if (tr) { - // Loop left to find real cell - for (x2 = x; x2 >= 0; x2--) { - cell = grid[y + r][x2].elm; - - if (cell.parentNode == tr) { - // Append clones after - for (c = 1; c <= cols; c++) { - dom.insertAfter(cloneCell(cell), cell); - } - - break; - } - } - - if (x2 == -1) { - // Insert nodes before first cell - for (c = 1; c <= cols; c++) { - tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]); - } - } - } - } - } - - function split() { - each(grid, function(row, y) { - each(row, function(cell, x) { - var colSpan, rowSpan, i; - - if (isCellSelected(cell)) { - cell = cell.elm; - colSpan = getSpanVal(cell, 'colspan'); - rowSpan = getSpanVal(cell, 'rowspan'); - - if (colSpan > 1 || rowSpan > 1) { - setSpanVal(cell, 'rowSpan', 1); - setSpanVal(cell, 'colSpan', 1); - - // Insert cells right - for (i = 0; i < colSpan - 1; i++) { - dom.insertAfter(cloneCell(cell), cell); - } - - fillLeftDown(x, y, rowSpan - 1, colSpan); - } - } - }); - }); - } - - function merge(cell, cols, rows) { - var pos, startX, startY, endX, endY, x, y, startCell, endCell, children, count; - - // Use specified cell and cols/rows - if (cell) { - pos = getPos(cell); - startX = pos.x; - startY = pos.y; - endX = startX + (cols - 1); - endY = startY + (rows - 1); - } else { - startPos = endPos = null; - - // Calculate start/end pos by checking for selected cells in grid works better with context menu - each(grid, function(row, y) { - each(row, function(cell, x) { - if (isCellSelected(cell)) { - if (!startPos) { - startPos = {x: x, y: y}; - } - - endPos = {x: x, y: y}; - } - }); - }); - - // Use selection, but make sure startPos is valid before accessing - if (startPos) { - startX = startPos.x; - startY = startPos.y; - endX = endPos.x; - endY = endPos.y; - } - } - - // Find start/end cells - startCell = getCell(startX, startY); - endCell = getCell(endX, endY); - - // Check if the cells exists and if they are of the same part for example tbody = tbody - if (startCell && endCell && startCell.part == endCell.part) { - // Split and rebuild grid - split(); - buildGrid(); - - // Set row/col span to start cell - startCell = getCell(startX, startY).elm; - setSpanVal(startCell, 'colSpan', (endX - startX) + 1); - setSpanVal(startCell, 'rowSpan', (endY - startY) + 1); - - // Remove other cells and add it's contents to the start cell - for (y = startY; y <= endY; y++) { - for (x = startX; x <= endX; x++) { - if (!grid[y] || !grid[y][x]) { - continue; - } - - cell = grid[y][x].elm; - - /*jshint loopfunc:true */ - /*eslint loop-func:0 */ - if (cell != startCell) { - // Move children to startCell - children = Tools.grep(cell.childNodes); - each(children, function(node) { - startCell.appendChild(node); - }); - - // Remove bogus nodes if there is children in the target cell - if (children.length) { - children = Tools.grep(startCell.childNodes); - count = 0; - each(children, function(node) { - if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1) { - startCell.removeChild(node); - } - }); - } - - dom.remove(cell); - } - } - } - - // Remove empty rows etc and restore caret location - cleanup(); - } - } - - function insertRow(before) { - var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan; - - // Find first/last row - each(grid, function(row, y) { - each(row, function(cell) { - if (isCellSelected(cell)) { - cell = cell.elm; - rowElm = cell.parentNode; - newRow = cloneNode(rowElm, false); - posY = y; - - if (before) { - return false; - } - } - }); - - if (before) { - return !posY; - } - }); - - // If posY is undefined there is nothing for us to do here...just return to avoid crashing below - if (posY === undefined) { - return; - } - - for (x = 0; x < grid[0].length; x++) { - // Cell not found could be because of an invalid table structure - if (!grid[posY][x]) { - continue; - } - - cell = grid[posY][x].elm; - - if (cell != lastCell) { - if (!before) { - rowSpan = getSpanVal(cell, 'rowspan'); - if (rowSpan > 1) { - setSpanVal(cell, 'rowSpan', rowSpan + 1); - continue; - } - } else { - // Check if cell above can be expanded - if (posY > 0 && grid[posY - 1][x]) { - otherCell = grid[posY - 1][x].elm; - rowSpan = getSpanVal(otherCell, 'rowSpan'); - if (rowSpan > 1) { - setSpanVal(otherCell, 'rowSpan', rowSpan + 1); - continue; - } - } - } - - // Insert new cell into new row - newCell = cloneCell(cell); - setSpanVal(newCell, 'colSpan', cell.colSpan); - - newRow.appendChild(newCell); - - lastCell = cell; - } - } - - if (newRow.hasChildNodes()) { - if (!before) { - dom.insertAfter(newRow, rowElm); - } else { - rowElm.parentNode.insertBefore(newRow, rowElm); - } - } - } - - function insertCol(before) { - var posX, lastCell; - - // Find first/last column - each(grid, function(row) { - each(row, function(cell, x) { - if (isCellSelected(cell)) { - posX = x; - - if (before) { - return false; - } - } - }); - - if (before) { - return !posX; - } - }); - - each(grid, function(row, y) { - var cell, rowSpan, colSpan; - - if (!row[posX]) { - return; - } - - cell = row[posX].elm; - if (cell != lastCell) { - colSpan = getSpanVal(cell, 'colspan'); - rowSpan = getSpanVal(cell, 'rowspan'); - - if (colSpan == 1) { - if (!before) { - dom.insertAfter(cloneCell(cell), cell); - fillLeftDown(posX, y, rowSpan - 1, colSpan); - } else { - cell.parentNode.insertBefore(cloneCell(cell), cell); - fillLeftDown(posX, y, rowSpan - 1, colSpan); - } - } else { - setSpanVal(cell, 'colSpan', cell.colSpan + 1); - } - - lastCell = cell; - } - }); - } - - function deleteCols() { - var cols = []; - - // Get selected column indexes - each(grid, function(row) { - each(row, function(cell, x) { - if (isCellSelected(cell) && Tools.inArray(cols, x) === -1) { - each(grid, function(row) { - var cell = row[x].elm, colSpan; - - colSpan = getSpanVal(cell, 'colSpan'); - - if (colSpan > 1) { - setSpanVal(cell, 'colSpan', colSpan - 1); - } else { - dom.remove(cell); - } - }); - - cols.push(x); - } - }); - }); - - cleanup(); - } - - function deleteRows() { - var rows; - - function deleteRow(tr) { - var nextTr, pos, lastCell; - - nextTr = dom.getNext(tr, 'tr'); - - // Move down row spanned cells - each(tr.cells, function(cell) { - var rowSpan = getSpanVal(cell, 'rowSpan'); - - if (rowSpan > 1) { - setSpanVal(cell, 'rowSpan', rowSpan - 1); - pos = getPos(cell); - fillLeftDown(pos.x, pos.y, 1, 1); - } - }); - - // Delete cells - pos = getPos(tr.cells[0]); - each(grid[pos.y], function(cell) { - var rowSpan; - - cell = cell.elm; - - if (cell != lastCell) { - rowSpan = getSpanVal(cell, 'rowSpan'); - - if (rowSpan <= 1) { - dom.remove(cell); - } else { - setSpanVal(cell, 'rowSpan', rowSpan - 1); - } - - lastCell = cell; - } - }); - } - - // Get selected rows and move selection out of scope - rows = getSelectedRows(); - - // Delete all selected rows - each(rows.reverse(), function(tr) { - deleteRow(tr); - }); - - cleanup(); - } - - function cutRows() { - var rows = getSelectedRows(); - - dom.remove(rows); - cleanup(); - - return rows; - } - - function copyRows() { - var rows = getSelectedRows(); - - each(rows, function(row, i) { - rows[i] = cloneNode(row, true); - }); - - return rows; - } - - function pasteRows(rows, before) { - var selectedRows = getSelectedRows(), - targetRow = selectedRows[before ? 0 : selectedRows.length - 1], - targetCellCount = targetRow.cells.length; - - // Nothing to paste - if (!rows) { - return; - } - - // Calc target cell count - each(grid, function(row) { - var match; - - targetCellCount = 0; - each(row, function(cell) { - if (cell.real) { - targetCellCount += cell.colspan; - } - - if (cell.elm.parentNode == targetRow) { - match = 1; - } - }); - - if (match) { - return false; - } - }); - - if (!before) { - rows.reverse(); - } - - each(rows, function(row) { - var i, cellCount = row.cells.length, cell; - - // Remove col/rowspans - for (i = 0; i < cellCount; i++) { - cell = row.cells[i]; - setSpanVal(cell, 'colSpan', 1); - setSpanVal(cell, 'rowSpan', 1); - } - - // Needs more cells - for (i = cellCount; i < targetCellCount; i++) { - row.appendChild(cloneCell(row.cells[cellCount - 1])); - } - - // Needs less cells - for (i = targetCellCount; i < cellCount; i++) { - dom.remove(row.cells[i]); - } - - // Add before/after - if (before) { - targetRow.parentNode.insertBefore(row, targetRow); - } else { - dom.insertAfter(row, targetRow); - } - }); - - // Remove current selection - dom.removeClass(dom.select('td.mce-item-selected,th.mce-item-selected'), 'mce-item-selected'); - } - - function getPos(target) { - var pos; - - each(grid, function(row, y) { - each(row, function(cell, x) { - if (cell.elm == target) { - pos = {x : x, y : y}; - return false; - } - }); - - return !pos; - }); - - return pos; - } - - function setStartCell(cell) { - startPos = getPos(cell); - } - - function findEndPos() { - var maxX, maxY; - - maxX = maxY = 0; - - each(grid, function(row, y) { - each(row, function(cell, x) { - var colSpan, rowSpan; - - if (isCellSelected(cell)) { - cell = grid[y][x]; - - if (x > maxX) { - maxX = x; - } - - if (y > maxY) { - maxY = y; - } - - if (cell.real) { - colSpan = cell.colspan - 1; - rowSpan = cell.rowspan - 1; - - if (colSpan) { - if (x + colSpan > maxX) { - maxX = x + colSpan; - } - } - - if (rowSpan) { - if (y + rowSpan > maxY) { - maxY = y + rowSpan; - } - } - } - } - }); - }); - - return {x : maxX, y : maxY}; - } - - function setEndCell(cell) { - var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan, x, y; - - endPos = getPos(cell); - - if (startPos && endPos) { - // Get start/end positions - startX = Math.min(startPos.x, endPos.x); - startY = Math.min(startPos.y, endPos.y); - endX = Math.max(startPos.x, endPos.x); - endY = Math.max(startPos.y, endPos.y); - - // Expand end positon to include spans - maxX = endX; - maxY = endY; - - // Expand startX - for (y = startY; y <= maxY; y++) { - cell = grid[y][startX]; - - if (!cell.real) { - if (startX - (cell.colspan - 1) < startX) { - startX -= cell.colspan - 1; - } - } - } - - // Expand startY - for (x = startX; x <= maxX; x++) { - cell = grid[startY][x]; - - if (!cell.real) { - if (startY - (cell.rowspan - 1) < startY) { - startY -= cell.rowspan - 1; - } - } - } - - // Find max X, Y - for (y = startY; y <= endY; y++) { - for (x = startX; x <= endX; x++) { - cell = grid[y][x]; - - if (cell.real) { - colSpan = cell.colspan - 1; - rowSpan = cell.rowspan - 1; - - if (colSpan) { - if (x + colSpan > maxX) { - maxX = x + colSpan; - } - } - - if (rowSpan) { - if (y + rowSpan > maxY) { - maxY = y + rowSpan; - } - } - } - } - } - - // Remove current selection - dom.removeClass(dom.select('td.mce-item-selected,th.mce-item-selected'), 'mce-item-selected'); - - // Add new selection - for (y = startY; y <= maxY; y++) { - for (x = startX; x <= maxX; x++) { - if (grid[y][x]) { - dom.addClass(grid[y][x].elm, 'mce-item-selected'); - } - } - } - } - } - - table = table || dom.getParent(selection.getStart(), 'table'); - - buildGrid(); - - selectedCell = dom.getParent(selection.getStart(), 'th,td'); - if (selectedCell) { - startPos = getPos(selectedCell); - endPos = findEndPos(); - selectedCell = getCell(startPos.x, startPos.y); - } - - Tools.extend(this, { - deleteTable: deleteTable, - split: split, - merge: merge, - insertRow: insertRow, - insertCol: insertCol, - deleteCols: deleteCols, - deleteRows: deleteRows, - cutRows: cutRows, - copyRows: copyRows, - pasteRows: pasteRows, - getPos: getPos, - setStartCell: setStartCell, - setEndCell: setEndCell - }); - }; -}); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/table/plugin.dev.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/table/plugin.dev.js deleted file mode 100755 index 253bd3ecf69b..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/table/plugin.dev.js +++ /dev/null @@ -1,119 +0,0 @@ -/** - * Inline development version. Only to be used while developing since it uses document.write to load scripts. - */ - -/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */ -/*globals $code */ - -(function(exports) { - "use strict"; - - var html = "", baseDir; - var modules = {}, exposedModules = [], moduleCount = 0; - - var scripts = document.getElementsByTagName('script'); - for (var i = 0; i < scripts.length; i++) { - var src = scripts[i].src; - - if (src.indexOf('/plugin.dev.js') != -1) { - baseDir = src.substring(0, src.lastIndexOf('/')); - } - } - - function require(ids, callback) { - var module, defs = []; - - for (var i = 0; i < ids.length; ++i) { - module = modules[ids[i]] || resolve(ids[i]); - if (!module) { - throw 'module definition dependecy not found: ' + ids[i]; - } - - defs.push(module); - } - - callback.apply(null, defs); - } - - function resolve(id) { - var target = exports; - var fragments = id.split(/[.\/]/); - - for (var fi = 0; fi < fragments.length; ++fi) { - if (!target[fragments[fi]]) { - return; - } - - target = target[fragments[fi]]; - } - - return target; - } - - function register(id) { - var target = exports; - var fragments = id.split(/[.\/]/); - - for (var fi = 0; fi < fragments.length - 1; ++fi) { - if (target[fragments[fi]] === undefined) { - target[fragments[fi]] = {}; - } - - target = target[fragments[fi]]; - } - - target[fragments[fragments.length - 1]] = modules[id]; - } - - function define(id, dependencies, definition) { - if (typeof id !== 'string') { - throw 'invalid module definition, module id must be defined and be a string'; - } - - if (dependencies === undefined) { - throw 'invalid module definition, dependencies must be specified'; - } - - if (definition === undefined) { - throw 'invalid module definition, definition function must be specified'; - } - - require(dependencies, function() { - modules[id] = definition.apply(null, arguments); - }); - - if (--moduleCount === 0) { - for (var i = 0; i < exposedModules.length; i++) { - register(exposedModules[i]); - } - } - } - - function expose(ids) { - exposedModules = ids; - } - - function writeScripts() { - document.write(html); - } - - function load(path) { - html += '\n'; - moduleCount++; - } - - // Expose globally - exports.define = define; - exports.require = require; - - expose(["tinymce/tableplugin/TableGrid","tinymce/tableplugin/Quirks","tinymce/tableplugin/CellSelection","tinymce/tableplugin/Plugin"]); - - load('classes/TableGrid.js'); - load('classes/Quirks.js'); - load('classes/CellSelection.js'); - load('classes/Plugin.js'); - - writeScripts(); -})(this); - -// $hash: 8a0327b8917332b89e69b02d5ba10c30 \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/table/plugin.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/table/plugin.js old mode 100755 new mode 100644 index ff9bfe82f1e4..5273df8e3c56 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/table/plugin.js +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/table/plugin.js @@ -1,2260 +1,10260 @@ /** - * Compiled inline version. (Library mode) - */ - -/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */ -/*globals $code */ - -(function(exports, undefined) { - "use strict"; - - var modules = {}; - - function require(ids, callback) { - var module, defs = []; - - for (var i = 0; i < ids.length; ++i) { - module = modules[ids[i]] || resolve(ids[i]); - if (!module) { - throw 'module definition dependecy not found: ' + ids[i]; - } - - defs.push(module); - } - - callback.apply(null, defs); - } - - function define(id, dependencies, definition) { - if (typeof id !== 'string') { - throw 'invalid module definition, module id must be defined and be a string'; - } - - if (dependencies === undefined) { - throw 'invalid module definition, dependencies must be specified'; - } - - if (definition === undefined) { - throw 'invalid module definition, definition function must be specified'; - } - - require(dependencies, function() { - modules[id] = definition.apply(null, arguments); - }); - } - - function defined(id) { - return !!modules[id]; - } - - function resolve(id) { - var target = exports; - var fragments = id.split(/[.\/]/); - - for (var fi = 0; fi < fragments.length; ++fi) { - if (!target[fragments[fi]]) { - return; - } - - target = target[fragments[fi]]; - } - - return target; - } - - function expose(ids) { - for (var i = 0; i < ids.length; i++) { - var target = exports; - var id = ids[i]; - var fragments = id.split(/[.\/]/); - - for (var fi = 0; fi < fragments.length - 1; ++fi) { - if (target[fragments[fi]] === undefined) { - target[fragments[fi]] = {}; - } - - target = target[fragments[fi]]; - } - - target[fragments[fragments.length - 1]] = modules[id]; - } - } - -// Included from: js/tinymce/plugins/table/classes/TableGrid.js - -/** - * TableGrid.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class creates a grid out of a table element. This - * makes it a whole lot easier to handle complex tables with - * col/row spans. - * - * @class tinymce.tableplugin.TableGrid - * @private - */ -define("tinymce/tableplugin/TableGrid", [ - "tinymce/util/Tools", - "tinymce/Env" -], function(Tools, Env) { - var each = Tools.each; - - function getSpanVal(td, name) { - return parseInt(td.getAttribute(name) || 1, 10); - } - - return function(editor, table) { - var grid, startPos, endPos, selectedCell, selection = editor.selection, dom = selection.dom; - - function buildGrid() { - var startY = 0; - - grid = []; - - each(['thead', 'tbody', 'tfoot'], function(part) { - var rows = dom.select('> ' + part + ' tr', table); - - each(rows, function(tr, y) { - y += startY; - - each(dom.select('> td, > th', tr), function(td, x) { - var x2, y2, rowspan, colspan; - - // Skip over existing cells produced by rowspan - if (grid[y]) { - while (grid[y][x]) { - x++; - } - } - - // Get col/rowspan from cell - rowspan = getSpanVal(td, 'rowspan'); - colspan = getSpanVal(td, 'colspan'); - - // Fill out rowspan/colspan right and down - for (y2 = y; y2 < y + rowspan; y2++) { - if (!grid[y2]) { - grid[y2] = []; - } - - for (x2 = x; x2 < x + colspan; x2++) { - grid[y2][x2] = { - part: part, - real: y2 == y && x2 == x, - elm: td, - rowspan: rowspan, - colspan: colspan - }; - } - } - }); - }); - - startY += rows.length; - }); - } - - function cloneNode(node, children) { - node = node.cloneNode(children); - node.removeAttribute('id'); - - return node; - } - - function getCell(x, y) { - var row; - - row = grid[y]; - if (row) { - return row[x]; - } - } - - function setSpanVal(td, name, val) { - if (td) { - val = parseInt(val, 10); - - if (val === 1) { - td.removeAttribute(name, 1); - } else { - td.setAttribute(name, val, 1); - } - } - } - - function isCellSelected(cell) { - return cell && (dom.hasClass(cell.elm, 'mce-item-selected') || cell == selectedCell); - } - - function getSelectedRows() { - var rows = []; - - each(table.rows, function(row) { - each(row.cells, function(cell) { - if (dom.hasClass(cell, 'mce-item-selected') || (selectedCell && cell == selectedCell.elm)) { - rows.push(row); - return false; - } - }); - }); - - return rows; - } - - function deleteTable() { - var rng = dom.createRng(); - - rng.setStartAfter(table); - rng.setEndAfter(table); - - selection.setRng(rng); - - dom.remove(table); - } - - function cloneCell(cell) { - var formatNode, cloneFormats = {}; - - if (editor.settings.table_clone_elements !== false) { - cloneFormats = Tools.makeMap( - (editor.settings.table_clone_elements || 'strong em b i span font h1 h2 h3 h4 h5 h6 p div').toUpperCase(), - /[ ,]/ - ); - } - - // Clone formats - Tools.walk(cell, function(node) { - var curNode; - - if (node.nodeType == 3) { - each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) { - if (!cloneFormats[node.nodeName]) { - return; - } - - node = cloneNode(node, false); - - if (!formatNode) { - formatNode = curNode = node; - } else if (curNode) { - curNode.appendChild(node); - } - - curNode = node; - }); - - // Add something to the inner node - if (curNode) { - curNode.innerHTML = Env.ie ? ' ' : '
    '; - } - - return false; - } - }, 'childNodes'); - - cell = cloneNode(cell, false); - setSpanVal(cell, 'rowSpan', 1); - setSpanVal(cell, 'colSpan', 1); - - if (formatNode) { - cell.appendChild(formatNode); - } else { - if (!Env.ie) { - cell.innerHTML = '
    '; - } - } - - return cell; - } - - function cleanup() { - var rng = dom.createRng(), row; - - // Empty rows - each(dom.select('tr', table), function(tr) { - if (tr.cells.length === 0) { - dom.remove(tr); - } - }); - - // Empty table - if (dom.select('tr', table).length === 0) { - rng.setStartBefore(table); - rng.setEndBefore(table); - selection.setRng(rng); - dom.remove(table); - return; - } - - // Empty header/body/footer - each(dom.select('thead,tbody,tfoot', table), function(part) { - if (part.rows.length === 0) { - dom.remove(part); - } - }); - - // Restore selection to start position if it still exists - buildGrid(); - - // If we have a valid startPos object - if (startPos) { - // Restore the selection to the closest table position - row = grid[Math.min(grid.length - 1, startPos.y)]; - if (row) { - selection.select(row[Math.min(row.length - 1, startPos.x)].elm, true); - selection.collapse(true); - } - } - } - - function fillLeftDown(x, y, rows, cols) { - var tr, x2, r, c, cell; - - tr = grid[y][x].elm.parentNode; - for (r = 1; r <= rows; r++) { - tr = dom.getNext(tr, 'tr'); - - if (tr) { - // Loop left to find real cell - for (x2 = x; x2 >= 0; x2--) { - cell = grid[y + r][x2].elm; - - if (cell.parentNode == tr) { - // Append clones after - for (c = 1; c <= cols; c++) { - dom.insertAfter(cloneCell(cell), cell); - } - - break; - } - } - - if (x2 == -1) { - // Insert nodes before first cell - for (c = 1; c <= cols; c++) { - tr.insertBefore(cloneCell(tr.cells[0]), tr.cells[0]); - } - } - } - } - } - - function split() { - each(grid, function(row, y) { - each(row, function(cell, x) { - var colSpan, rowSpan, i; - - if (isCellSelected(cell)) { - cell = cell.elm; - colSpan = getSpanVal(cell, 'colspan'); - rowSpan = getSpanVal(cell, 'rowspan'); - - if (colSpan > 1 || rowSpan > 1) { - setSpanVal(cell, 'rowSpan', 1); - setSpanVal(cell, 'colSpan', 1); - - // Insert cells right - for (i = 0; i < colSpan - 1; i++) { - dom.insertAfter(cloneCell(cell), cell); - } - - fillLeftDown(x, y, rowSpan - 1, colSpan); - } - } - }); - }); - } - - function merge(cell, cols, rows) { - var pos, startX, startY, endX, endY, x, y, startCell, endCell, children, count; - - // Use specified cell and cols/rows - if (cell) { - pos = getPos(cell); - startX = pos.x; - startY = pos.y; - endX = startX + (cols - 1); - endY = startY + (rows - 1); - } else { - startPos = endPos = null; - - // Calculate start/end pos by checking for selected cells in grid works better with context menu - each(grid, function(row, y) { - each(row, function(cell, x) { - if (isCellSelected(cell)) { - if (!startPos) { - startPos = {x: x, y: y}; - } - - endPos = {x: x, y: y}; - } - }); - }); - - // Use selection, but make sure startPos is valid before accessing - if (startPos) { - startX = startPos.x; - startY = startPos.y; - endX = endPos.x; - endY = endPos.y; - } - } - - // Find start/end cells - startCell = getCell(startX, startY); - endCell = getCell(endX, endY); - - // Check if the cells exists and if they are of the same part for example tbody = tbody - if (startCell && endCell && startCell.part == endCell.part) { - // Split and rebuild grid - split(); - buildGrid(); - - // Set row/col span to start cell - startCell = getCell(startX, startY).elm; - setSpanVal(startCell, 'colSpan', (endX - startX) + 1); - setSpanVal(startCell, 'rowSpan', (endY - startY) + 1); - - // Remove other cells and add it's contents to the start cell - for (y = startY; y <= endY; y++) { - for (x = startX; x <= endX; x++) { - if (!grid[y] || !grid[y][x]) { - continue; - } - - cell = grid[y][x].elm; - - /*jshint loopfunc:true */ - /*eslint loop-func:0 */ - if (cell != startCell) { - // Move children to startCell - children = Tools.grep(cell.childNodes); - each(children, function(node) { - startCell.appendChild(node); - }); - - // Remove bogus nodes if there is children in the target cell - if (children.length) { - children = Tools.grep(startCell.childNodes); - count = 0; - each(children, function(node) { - if (node.nodeName == 'BR' && dom.getAttrib(node, 'data-mce-bogus') && count++ < children.length - 1) { - startCell.removeChild(node); - } - }); - } - - dom.remove(cell); - } - } - } - - // Remove empty rows etc and restore caret location - cleanup(); - } - } - - function insertRow(before) { - var posY, cell, lastCell, x, rowElm, newRow, newCell, otherCell, rowSpan; - - // Find first/last row - each(grid, function(row, y) { - each(row, function(cell) { - if (isCellSelected(cell)) { - cell = cell.elm; - rowElm = cell.parentNode; - newRow = cloneNode(rowElm, false); - posY = y; - - if (before) { - return false; - } - } - }); - - if (before) { - return !posY; - } - }); - - // If posY is undefined there is nothing for us to do here...just return to avoid crashing below - if (posY === undefined) { - return; - } - - for (x = 0; x < grid[0].length; x++) { - // Cell not found could be because of an invalid table structure - if (!grid[posY][x]) { - continue; - } - - cell = grid[posY][x].elm; - - if (cell != lastCell) { - if (!before) { - rowSpan = getSpanVal(cell, 'rowspan'); - if (rowSpan > 1) { - setSpanVal(cell, 'rowSpan', rowSpan + 1); - continue; - } - } else { - // Check if cell above can be expanded - if (posY > 0 && grid[posY - 1][x]) { - otherCell = grid[posY - 1][x].elm; - rowSpan = getSpanVal(otherCell, 'rowSpan'); - if (rowSpan > 1) { - setSpanVal(otherCell, 'rowSpan', rowSpan + 1); - continue; - } - } - } - - // Insert new cell into new row - newCell = cloneCell(cell); - setSpanVal(newCell, 'colSpan', cell.colSpan); - - newRow.appendChild(newCell); - - lastCell = cell; - } - } - - if (newRow.hasChildNodes()) { - if (!before) { - dom.insertAfter(newRow, rowElm); - } else { - rowElm.parentNode.insertBefore(newRow, rowElm); - } - } - } - - function insertCol(before) { - var posX, lastCell; - - // Find first/last column - each(grid, function(row) { - each(row, function(cell, x) { - if (isCellSelected(cell)) { - posX = x; - - if (before) { - return false; - } - } - }); - - if (before) { - return !posX; - } - }); - - each(grid, function(row, y) { - var cell, rowSpan, colSpan; - - if (!row[posX]) { - return; - } - - cell = row[posX].elm; - if (cell != lastCell) { - colSpan = getSpanVal(cell, 'colspan'); - rowSpan = getSpanVal(cell, 'rowspan'); - - if (colSpan == 1) { - if (!before) { - dom.insertAfter(cloneCell(cell), cell); - fillLeftDown(posX, y, rowSpan - 1, colSpan); - } else { - cell.parentNode.insertBefore(cloneCell(cell), cell); - fillLeftDown(posX, y, rowSpan - 1, colSpan); - } - } else { - setSpanVal(cell, 'colSpan', cell.colSpan + 1); - } - - lastCell = cell; - } - }); - } - - function deleteCols() { - var cols = []; - - // Get selected column indexes - each(grid, function(row) { - each(row, function(cell, x) { - if (isCellSelected(cell) && Tools.inArray(cols, x) === -1) { - each(grid, function(row) { - var cell = row[x].elm, colSpan; - - colSpan = getSpanVal(cell, 'colSpan'); - - if (colSpan > 1) { - setSpanVal(cell, 'colSpan', colSpan - 1); - } else { - dom.remove(cell); - } - }); - - cols.push(x); - } - }); - }); - - cleanup(); - } - - function deleteRows() { - var rows; - - function deleteRow(tr) { - var nextTr, pos, lastCell; - - nextTr = dom.getNext(tr, 'tr'); - - // Move down row spanned cells - each(tr.cells, function(cell) { - var rowSpan = getSpanVal(cell, 'rowSpan'); - - if (rowSpan > 1) { - setSpanVal(cell, 'rowSpan', rowSpan - 1); - pos = getPos(cell); - fillLeftDown(pos.x, pos.y, 1, 1); - } - }); - - // Delete cells - pos = getPos(tr.cells[0]); - each(grid[pos.y], function(cell) { - var rowSpan; - - cell = cell.elm; - - if (cell != lastCell) { - rowSpan = getSpanVal(cell, 'rowSpan'); - - if (rowSpan <= 1) { - dom.remove(cell); - } else { - setSpanVal(cell, 'rowSpan', rowSpan - 1); - } - - lastCell = cell; - } - }); - } - - // Get selected rows and move selection out of scope - rows = getSelectedRows(); - - // Delete all selected rows - each(rows.reverse(), function(tr) { - deleteRow(tr); - }); - - cleanup(); - } - - function cutRows() { - var rows = getSelectedRows(); - - dom.remove(rows); - cleanup(); - - return rows; - } - - function copyRows() { - var rows = getSelectedRows(); - - each(rows, function(row, i) { - rows[i] = cloneNode(row, true); - }); - - return rows; - } - - function pasteRows(rows, before) { - var selectedRows = getSelectedRows(), - targetRow = selectedRows[before ? 0 : selectedRows.length - 1], - targetCellCount = targetRow.cells.length; - - // Nothing to paste - if (!rows) { - return; - } - - // Calc target cell count - each(grid, function(row) { - var match; - - targetCellCount = 0; - each(row, function(cell) { - if (cell.real) { - targetCellCount += cell.colspan; - } - - if (cell.elm.parentNode == targetRow) { - match = 1; - } - }); - - if (match) { - return false; - } - }); - - if (!before) { - rows.reverse(); - } - - each(rows, function(row) { - var i, cellCount = row.cells.length, cell; - - // Remove col/rowspans - for (i = 0; i < cellCount; i++) { - cell = row.cells[i]; - setSpanVal(cell, 'colSpan', 1); - setSpanVal(cell, 'rowSpan', 1); - } - - // Needs more cells - for (i = cellCount; i < targetCellCount; i++) { - row.appendChild(cloneCell(row.cells[cellCount - 1])); - } - - // Needs less cells - for (i = targetCellCount; i < cellCount; i++) { - dom.remove(row.cells[i]); - } - - // Add before/after - if (before) { - targetRow.parentNode.insertBefore(row, targetRow); - } else { - dom.insertAfter(row, targetRow); - } - }); - - // Remove current selection - dom.removeClass(dom.select('td.mce-item-selected,th.mce-item-selected'), 'mce-item-selected'); - } - - function getPos(target) { - var pos; - - each(grid, function(row, y) { - each(row, function(cell, x) { - if (cell.elm == target) { - pos = {x : x, y : y}; - return false; - } - }); - - return !pos; - }); - - return pos; - } - - function setStartCell(cell) { - startPos = getPos(cell); - } - - function findEndPos() { - var maxX, maxY; - - maxX = maxY = 0; - - each(grid, function(row, y) { - each(row, function(cell, x) { - var colSpan, rowSpan; - - if (isCellSelected(cell)) { - cell = grid[y][x]; - - if (x > maxX) { - maxX = x; - } - - if (y > maxY) { - maxY = y; - } - - if (cell.real) { - colSpan = cell.colspan - 1; - rowSpan = cell.rowspan - 1; - - if (colSpan) { - if (x + colSpan > maxX) { - maxX = x + colSpan; - } - } - - if (rowSpan) { - if (y + rowSpan > maxY) { - maxY = y + rowSpan; - } - } - } - } - }); - }); - - return {x : maxX, y : maxY}; - } - - function setEndCell(cell) { - var startX, startY, endX, endY, maxX, maxY, colSpan, rowSpan, x, y; - - endPos = getPos(cell); - - if (startPos && endPos) { - // Get start/end positions - startX = Math.min(startPos.x, endPos.x); - startY = Math.min(startPos.y, endPos.y); - endX = Math.max(startPos.x, endPos.x); - endY = Math.max(startPos.y, endPos.y); - - // Expand end positon to include spans - maxX = endX; - maxY = endY; - - // Expand startX - for (y = startY; y <= maxY; y++) { - cell = grid[y][startX]; - - if (!cell.real) { - if (startX - (cell.colspan - 1) < startX) { - startX -= cell.colspan - 1; - } - } - } - - // Expand startY - for (x = startX; x <= maxX; x++) { - cell = grid[startY][x]; - - if (!cell.real) { - if (startY - (cell.rowspan - 1) < startY) { - startY -= cell.rowspan - 1; - } - } - } - - // Find max X, Y - for (y = startY; y <= endY; y++) { - for (x = startX; x <= endX; x++) { - cell = grid[y][x]; - - if (cell.real) { - colSpan = cell.colspan - 1; - rowSpan = cell.rowspan - 1; - - if (colSpan) { - if (x + colSpan > maxX) { - maxX = x + colSpan; - } - } - - if (rowSpan) { - if (y + rowSpan > maxY) { - maxY = y + rowSpan; - } - } - } - } - } - - // Remove current selection - dom.removeClass(dom.select('td.mce-item-selected,th.mce-item-selected'), 'mce-item-selected'); - - // Add new selection - for (y = startY; y <= maxY; y++) { - for (x = startX; x <= maxX; x++) { - if (grid[y][x]) { - dom.addClass(grid[y][x].elm, 'mce-item-selected'); - } - } - } - } - } - - table = table || dom.getParent(selection.getStart(), 'table'); - - buildGrid(); - - selectedCell = dom.getParent(selection.getStart(), 'th,td'); - if (selectedCell) { - startPos = getPos(selectedCell); - endPos = findEndPos(); - selectedCell = getCell(startPos.x, startPos.y); - } - - Tools.extend(this, { - deleteTable: deleteTable, - split: split, - merge: merge, - insertRow: insertRow, - insertCol: insertCol, - deleteCols: deleteCols, - deleteRows: deleteRows, - cutRows: cutRows, - copyRows: copyRows, - pasteRows: pasteRows, - getPos: getPos, - setStartCell: setStartCell, - setEndCell: setEndCell - }); - }; -}); - -// Included from: js/tinymce/plugins/table/classes/Quirks.js - -/** - * Quirks.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class includes fixes for various browser quirks. - * - * @class tinymce.tableplugin.Quirks - * @private - */ -define("tinymce/tableplugin/Quirks", [ - "tinymce/util/VK", - "tinymce/Env", - "tinymce/util/Tools" -], function(VK, Env, Tools) { - var each = Tools.each; - - function getSpanVal(td, name) { - return parseInt(td.getAttribute(name) || 1, 10); - } - - return function(editor) { - /** - * Fixed caret movement around tables on WebKit. - */ - function moveWebKitSelection() { - function eventHandler(e) { - var key = e.keyCode; - - function handle(upBool, sourceNode) { - var siblingDirection = upBool ? 'previousSibling' : 'nextSibling'; - var currentRow = editor.dom.getParent(sourceNode, 'tr'); - var siblingRow = currentRow[siblingDirection]; - - if (siblingRow) { - moveCursorToRow(editor, sourceNode, siblingRow, upBool); - e.preventDefault(); - return true; - } else { - var tableNode = editor.dom.getParent(currentRow, 'table'); - var middleNode = currentRow.parentNode; - var parentNodeName = middleNode.nodeName.toLowerCase(); - if (parentNodeName === 'tbody' || parentNodeName === (upBool ? 'tfoot' : 'thead')) { - var targetParent = getTargetParent(upBool, tableNode, middleNode, 'tbody'); - if (targetParent !== null) { - return moveToRowInTarget(upBool, targetParent, sourceNode); - } - } - return escapeTable(upBool, currentRow, siblingDirection, tableNode); - } - } - - function getTargetParent(upBool, topNode, secondNode, nodeName) { - var tbodies = editor.dom.select('>' + nodeName, topNode); - var position = tbodies.indexOf(secondNode); - if (upBool && position === 0 || !upBool && position === tbodies.length - 1) { - return getFirstHeadOrFoot(upBool, topNode); - } else if (position === -1) { - var topOrBottom = secondNode.tagName.toLowerCase() === 'thead' ? 0 : tbodies.length - 1; - return tbodies[topOrBottom]; - } else { - return tbodies[position + (upBool ? -1 : 1)]; - } - } - - function getFirstHeadOrFoot(upBool, parent) { - var tagName = upBool ? 'thead' : 'tfoot'; - var headOrFoot = editor.dom.select('>' + tagName, parent); - return headOrFoot.length !== 0 ? headOrFoot[0] : null; - } - - function moveToRowInTarget(upBool, targetParent, sourceNode) { - var targetRow = getChildForDirection(targetParent, upBool); - - if (targetRow) { - moveCursorToRow(editor, sourceNode, targetRow, upBool); - } - - e.preventDefault(); - return true; - } - - function escapeTable(upBool, currentRow, siblingDirection, table) { - var tableSibling = table[siblingDirection]; - - if (tableSibling) { - moveCursorToStartOfElement(tableSibling); - return true; - } else { - var parentCell = editor.dom.getParent(table, 'td,th'); - if (parentCell) { - return handle(upBool, parentCell, e); - } else { - var backUpSibling = getChildForDirection(currentRow, !upBool); - moveCursorToStartOfElement(backUpSibling); - e.preventDefault(); - return false; - } - } - } - - function getChildForDirection(parent, up) { - var child = parent && parent[up ? 'lastChild' : 'firstChild']; - // BR is not a valid table child to return in this case we return the table cell - return child && child.nodeName === 'BR' ? editor.dom.getParent(child, 'td,th') : child; - } - - function moveCursorToStartOfElement(n) { - editor.selection.setCursorLocation(n, 0); - } - - function isVerticalMovement() { - return key == VK.UP || key == VK.DOWN; - } - - function isInTable(editor) { - var node = editor.selection.getNode(); - var currentRow = editor.dom.getParent(node, 'tr'); - return currentRow !== null; - } - - function columnIndex(column) { - var colIndex = 0; - var c = column; - while (c.previousSibling) { - c = c.previousSibling; - colIndex = colIndex + getSpanVal(c, "colspan"); - } - return colIndex; - } - - function findColumn(rowElement, columnIndex) { - var c = 0, r = 0; - - each(rowElement.children, function(cell, i) { - c = c + getSpanVal(cell, "colspan"); - r = i; - if (c > columnIndex) { - return false; - } - }); - return r; - } - - function moveCursorToRow(ed, node, row, upBool) { - var srcColumnIndex = columnIndex(editor.dom.getParent(node, 'td,th')); - var tgtColumnIndex = findColumn(row, srcColumnIndex); - var tgtNode = row.childNodes[tgtColumnIndex]; - var rowCellTarget = getChildForDirection(tgtNode, upBool); - moveCursorToStartOfElement(rowCellTarget || tgtNode); - } - - function shouldFixCaret(preBrowserNode) { - var newNode = editor.selection.getNode(); - var newParent = editor.dom.getParent(newNode, 'td,th'); - var oldParent = editor.dom.getParent(preBrowserNode, 'td,th'); - - return newParent && newParent !== oldParent && checkSameParentTable(newParent, oldParent); - } - - function checkSameParentTable(nodeOne, NodeTwo) { - return editor.dom.getParent(nodeOne, 'TABLE') === editor.dom.getParent(NodeTwo, 'TABLE'); - } - - if (isVerticalMovement() && isInTable(editor)) { - var preBrowserNode = editor.selection.getNode(); - setTimeout(function() { - if (shouldFixCaret(preBrowserNode)) { - handle(!e.shiftKey && key === VK.UP, preBrowserNode, e); - } - }, 0); - } - } - - editor.on('KeyDown', function(e) { - eventHandler(e); - }); - } - - function fixBeforeTableCaretBug() { - // Checks if the selection/caret is at the start of the specified block element - function isAtStart(rng, par) { - var doc = par.ownerDocument, rng2 = doc.createRange(), elm; - - rng2.setStartBefore(par); - rng2.setEnd(rng.endContainer, rng.endOffset); - - elm = doc.createElement('body'); - elm.appendChild(rng2.cloneContents()); - - // Check for text characters of other elements that should be treated as content - return elm.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi, '-').replace(/<[^>]+>/g, '').length === 0; - } - - // Fixes an bug where it's impossible to place the caret before a table in Gecko - // this fix solves it by detecting when the caret is at the beginning of such a table - // and then manually moves the caret infront of the table - editor.on('KeyDown', function(e) { - var rng, table, dom = editor.dom; - - // On gecko it's not possible to place the caret before a table - if (e.keyCode == 37 || e.keyCode == 38) { - rng = editor.selection.getRng(); - table = dom.getParent(rng.startContainer, 'table'); - - if (table && editor.getBody().firstChild == table) { - if (isAtStart(rng, table)) { - rng = dom.createRng(); - - rng.setStartBefore(table); - rng.setEndBefore(table); - - editor.selection.setRng(rng); - - e.preventDefault(); - } - } - } - }); - } - - // Fixes an issue on Gecko where it's impossible to place the caret behind a table - // This fix will force a paragraph element after the table but only when the forced_root_block setting is enabled - function fixTableCaretPos() { - editor.on('KeyDown SetContent VisualAid', function() { - var last; - - // Skip empty text nodes from the end - for (last = editor.getBody().lastChild; last; last = last.previousSibling) { - if (last.nodeType == 3) { - if (last.nodeValue.length > 0) { - break; - } - } else if (last.nodeType == 1 && !last.getAttribute('data-mce-bogus')) { - break; - } - } - - if (last && last.nodeName == 'TABLE') { - if (editor.settings.forced_root_block) { - editor.dom.add( - editor.getBody(), - editor.settings.forced_root_block, - editor.settings.forced_root_block_attrs, - Env.ie && Env.ie < 11 ? ' ' : '
    ' - ); - } else { - editor.dom.add(editor.getBody(), 'br', {'data-mce-bogus': '1'}); - } - } - }); - - editor.on('PreProcess', function(o) { - var last = o.node.lastChild; - - if (last && (last.nodeName == "BR" || (last.childNodes.length == 1 && - (last.firstChild.nodeName == 'BR' || last.firstChild.nodeValue == '\u00a0'))) && - last.previousSibling && last.previousSibling.nodeName == "TABLE") { - editor.dom.remove(last); - } - }); - } - - // this nasty hack is here to work around some WebKit selection bugs. - function fixTableCellSelection() { - function tableCellSelected(ed, rng, n, currentCell) { - // The decision of when a table cell is selected is somewhat involved. The fact that this code is - // required is actually a pointer to the root cause of this bug. A cell is selected when the start - // and end offsets are 0, the start container is a text, and the selection node is either a TR (most cases) - // or the parent of the table (in the case of the selection containing the last cell of a table). - var TEXT_NODE = 3, table = ed.dom.getParent(rng.startContainer, 'TABLE'); - var tableParent, allOfCellSelected, tableCellSelection; - - if (table) { - tableParent = table.parentNode; - } - - allOfCellSelected = rng.startContainer.nodeType == TEXT_NODE && - rng.startOffset === 0 && - rng.endOffset === 0 && - currentCell && - (n.nodeName == "TR" || n == tableParent); - - tableCellSelection = (n.nodeName == "TD" || n.nodeName == "TH") && !currentCell; - - return allOfCellSelected || tableCellSelection; - } - - function fixSelection() { - var rng = editor.selection.getRng(); - var n = editor.selection.getNode(); - var currentCell = editor.dom.getParent(rng.startContainer, 'TD,TH'); - - if (!tableCellSelected(editor, rng, n, currentCell)) { - return; - } - - if (!currentCell) { - currentCell = n; - } - - // Get the very last node inside the table cell - var end = currentCell.lastChild; - while (end.lastChild) { - end = end.lastChild; - } - - // Select the entire table cell. Nothing outside of the table cell should be selected. - rng.setEnd(end, end.nodeValue.length); - editor.selection.setRng(rng); - } - - editor.on('KeyDown', function() { - fixSelection(); - }); - - editor.on('MouseDown', function(e) { - if (e.button != 2) { - fixSelection(); - } - }); - } - - /** - * Delete table if all cells are selected. - */ - function deleteTable() { - editor.on('keydown', function(e) { - if ((e.keyCode == VK.DELETE || e.keyCode == VK.BACKSPACE) && !e.isDefaultPrevented()) { - var table = editor.dom.getParent(editor.selection.getStart(), 'table'); - - if (table) { - var cells = editor.dom.select('td,th', table), i = cells.length; - while (i--) { - if (!editor.dom.hasClass(cells[i], 'mce-item-selected')) { - return; - } - } - - e.preventDefault(); - editor.execCommand('mceTableDelete'); - } - } - }); - } - - deleteTable(); - - if (Env.webkit) { - moveWebKitSelection(); - fixTableCellSelection(); - } - - if (Env.gecko) { - fixBeforeTableCaretBug(); - fixTableCaretPos(); - } - - if (Env.ie > 10) { - fixBeforeTableCaretBug(); - fixTableCaretPos(); - } - }; -}); - -// Included from: js/tinymce/plugins/table/classes/CellSelection.js - -/** - * CellSelection.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class handles table cell selection by faking it using a css class that gets applied - * to cells when dragging the mouse from one cell to another. - * - * @class tinymce.tableplugin.CellSelection - * @private - */ -define("tinymce/tableplugin/CellSelection", [ - "tinymce/tableplugin/TableGrid", - "tinymce/dom/TreeWalker", - "tinymce/util/Tools" -], function(TableGrid, TreeWalker, Tools) { - return function(editor) { - var dom = editor.dom, tableGrid, startCell, startTable, hasCellSelection = true; - - function clear() { - // Restore selection possibilities - editor.getBody().style.webkitUserSelect = ''; - - if (hasCellSelection) { - editor.dom.removeClass( - editor.dom.select('td.mce-item-selected,th.mce-item-selected'), - 'mce-item-selected' - ); - - hasCellSelection = false; - } - } - - function cellSelectionHandler(e) { - var sel, table, target = e.target; - - if (startCell && (tableGrid || target != startCell) && (target.nodeName == 'TD' || target.nodeName == 'TH')) { - table = dom.getParent(target, 'table'); - if (table == startTable) { - if (!tableGrid) { - tableGrid = new TableGrid(editor, table); - tableGrid.setStartCell(startCell); - - editor.getBody().style.webkitUserSelect = 'none'; - } - - tableGrid.setEndCell(target); - hasCellSelection = true; - } - - // Remove current selection - sel = editor.selection.getSel(); - - try { - if (sel.removeAllRanges) { - sel.removeAllRanges(); - } else { - sel.empty(); - } - } catch (ex) { - // IE9 might throw errors here - } - - e.preventDefault(); - } - } - - // Add cell selection logic - editor.on('MouseDown', function(e) { - if (e.button != 2) { - clear(); - - startCell = dom.getParent(e.target, 'td,th'); - startTable = dom.getParent(startCell, 'table'); - } - }); - - editor.on('mouseover', cellSelectionHandler); - - editor.on('remove', function() { - dom.unbind(editor.getDoc(), 'mouseover', cellSelectionHandler); - }); - - editor.on('MouseUp', function() { - var rng, sel = editor.selection, selectedCells, walker, node, lastNode, endNode; - - function setPoint(node, start) { - var walker = new TreeWalker(node, node); - - do { - // Text node - if (node.nodeType == 3 && Tools.trim(node.nodeValue).length !== 0) { - if (start) { - rng.setStart(node, 0); - } else { - rng.setEnd(node, node.nodeValue.length); - } - - return; - } - - // BR element - if (node.nodeName == 'BR') { - if (start) { - rng.setStartBefore(node); - } else { - rng.setEndBefore(node); - } - - return; - } - } while ((node = (start ? walker.next() : walker.prev()))); - } - - // Move selection to startCell - if (startCell) { - if (tableGrid) { - editor.getBody().style.webkitUserSelect = ''; - } - - // Try to expand text selection as much as we can only Gecko supports cell selection - selectedCells = dom.select('td.mce-item-selected,th.mce-item-selected'); - if (selectedCells.length > 0) { - rng = dom.createRng(); - node = selectedCells[0]; - endNode = selectedCells[selectedCells.length - 1]; - rng.setStartBefore(node); - rng.setEndAfter(node); - - setPoint(node, 1); - walker = new TreeWalker(node, dom.getParent(selectedCells[0], 'table')); - - do { - if (node.nodeName == 'TD' || node.nodeName == 'TH') { - if (!dom.hasClass(node, 'mce-item-selected')) { - break; - } - - lastNode = node; - } - } while ((node = walker.next())); - - setPoint(lastNode); - - sel.setRng(rng); - } - - editor.nodeChanged(); - startCell = tableGrid = startTable = null; - } - }); - - editor.on('KeyUp', function() { - clear(); - }); - - return { - clear: clear - }; - }; -}); - -// Included from: js/tinymce/plugins/table/classes/Plugin.js - -/** - * Plugin.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class contains all core logic for the table plugin. + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ * - * @class tinymce.tableplugin.Plugin - * @private + * Version: 5.5.1 (2020-10-01) */ -define("tinymce/tableplugin/Plugin", [ - "tinymce/tableplugin/TableGrid", - "tinymce/tableplugin/Quirks", - "tinymce/tableplugin/CellSelection", - "tinymce/util/Tools", - "tinymce/dom/TreeWalker", - "tinymce/Env", - "tinymce/PluginManager" -], function(TableGrid, Quirks, CellSelection, Tools, TreeWalker, Env, PluginManager) { - var each = Tools.each; - - function Plugin(editor) { - var winMan, clipboardRows, self = this; // Might be selected cells on reload - - function removePxSuffix(size) { - return size ? size.replace(/px$/, '') : ""; - } - - function addSizeSuffix(size) { - if (/^[0-9]+$/.test(size)) { - size += "px"; - } - - return size; - } - - function unApplyAlign(elm) { - each('left center right'.split(' '), function(name) { - editor.formatter.remove('align' + name, {}, elm); - }); - } - - function tableDialog() { - var dom = editor.dom, tableElm, data; - - tableElm = dom.getParent(editor.selection.getStart(), 'table'); - - data = { - width: removePxSuffix(dom.getStyle(tableElm, 'width') || dom.getAttrib(tableElm, 'width')), - height: removePxSuffix(dom.getStyle(tableElm, 'height') || dom.getAttrib(tableElm, 'height')), - cellspacing: dom.getAttrib(tableElm, 'cellspacing'), - cellpadding: dom.getAttrib(tableElm, 'cellpadding'), - border: dom.getAttrib(tableElm, 'border'), - caption: !!dom.select('caption', tableElm)[0] - }; - - each('left center right'.split(' '), function(name) { - if (editor.formatter.matchNode(tableElm, 'align' + name)) { - data.align = name; - } - }); - - editor.windowManager.open({ - title: "Table properties", - items: { - type: 'form', - layout: 'grid', - columns: 2, - data: data, - defaults: { - type: 'textbox', - maxWidth: 50 - }, - items: [ - {label: 'Width', name: 'width'}, - {label: 'Height', name: 'height'}, - {label: 'Cell spacing', name: 'cellspacing'}, - {label: 'Cell padding', name: 'cellpadding'}, - {label: 'Border', name: 'border'}, - {label: 'Caption', name: 'caption', type: 'checkbox'}, - { - label: 'Alignment', - minWidth: 90, - name: 'align', - type: 'listbox', - text: 'None', - maxWidth: null, - values: [ - {text: 'None', value: ''}, - {text: 'Left', value: 'left'}, - {text: 'Center', value: 'center'}, - {text: 'Right', value: 'right'} - ] - } - ] - }, - - onsubmit: function() { - var data = this.toJSON(), captionElm; - - editor.undoManager.transact(function() { - editor.dom.setAttribs(tableElm, { - cellspacing: data.cellspacing, - cellpadding: data.cellpadding, - border: data.border - }); - - editor.dom.setStyles(tableElm, { - width: addSizeSuffix(data.width), - height: addSizeSuffix(data.height) - }); - - // Toggle caption on/off - captionElm = dom.select('caption', tableElm)[0]; - - if (captionElm && !data.caption) { - dom.remove(captionElm); - } - - if (!captionElm && data.caption) { - captionElm = dom.create('caption'); - captionElm.innerHTML = !Env.ie ? '
    ' : '\u00a0'; - tableElm.insertBefore(captionElm, tableElm.firstChild); - } - - unApplyAlign(tableElm); - if (data.align) { - editor.formatter.apply('align' + data.align, {}, tableElm); - } - - editor.focus(); - editor.addVisual(); - }); - } - }); - } - - function mergeDialog(grid, cell) { - editor.windowManager.open({ - title: "Merge cells", - body: [ - {label: 'Cols', name: 'cols', type: 'textbox', size: 10}, - {label: 'Rows', name: 'rows', type: 'textbox', size: 10} - ], - onsubmit: function() { - var data = this.toJSON(); - - editor.undoManager.transact(function() { - grid.merge(cell, data.cols, data.rows); - }); - } - }); - } - - function cellDialog() { - var dom = editor.dom, cellElm, data, cells = []; - - // Get selected cells or the current cell - cells = editor.dom.select('td.mce-item-selected,th.mce-item-selected'); - cellElm = editor.dom.getParent(editor.selection.getStart(), 'td,th'); - if (!cells.length && cellElm) { - cells.push(cellElm); - } - - cellElm = cellElm || cells[0]; - - if (!cellElm) { - // If this element is null, return now to avoid crashing. - return; - } - - data = { - width: removePxSuffix(dom.getStyle(cellElm, 'width') || dom.getAttrib(cellElm, 'width')), - height: removePxSuffix(dom.getStyle(cellElm, 'height') || dom.getAttrib(cellElm, 'height')), - scope: dom.getAttrib(cellElm, 'scope') - }; - - data.type = cellElm.nodeName.toLowerCase(); - - each('left center right'.split(' '), function(name) { - if (editor.formatter.matchNode(cellElm, 'align' + name)) { - data.align = name; - } - }); - - editor.windowManager.open({ - title: "Cell properties", - items: { - type: 'form', - data: data, - layout: 'grid', - columns: 2, - defaults: { - type: 'textbox', - maxWidth: 50 - }, - items: [ - {label: 'Width', name: 'width'}, - {label: 'Height', name: 'height'}, - { - label: 'Cell type', - name: 'type', - type: 'listbox', - text: 'None', - minWidth: 90, - maxWidth: null, - values: [ - {text: 'Cell', value: 'td'}, - {text: 'Header cell', value: 'th'} - ] - }, - { - label: 'Scope', - name: 'scope', - type: 'listbox', - text: 'None', - minWidth: 90, - maxWidth: null, - values: [ - {text: 'None', value: ''}, - {text: 'Row', value: 'row'}, - {text: 'Column', value: 'col'}, - {text: 'Row group', value: 'rowgroup'}, - {text: 'Column group', value: 'colgroup'} - ] - }, - { - label: 'Alignment', - name: 'align', - type: 'listbox', - text: 'None', - minWidth: 90, - maxWidth: null, - values: [ - {text: 'None', value: ''}, - {text: 'Left', value: 'left'}, - {text: 'Center', value: 'center'}, - {text: 'Right', value: 'right'} - ] - } - ] - }, - - onsubmit: function() { - var data = this.toJSON(); - - editor.undoManager.transact(function() { - each(cells, function(cellElm) { - editor.dom.setAttrib(cellElm, 'scope', data.scope); - - editor.dom.setStyles(cellElm, { - width: addSizeSuffix(data.width), - height: addSizeSuffix(data.height) - }); - - // Switch cell type - if (data.type && cellElm.nodeName.toLowerCase() != data.type) { - cellElm = dom.rename(cellElm, data.type); - } - - // Apply/remove alignment - unApplyAlign(cellElm); - if (data.align) { - editor.formatter.apply('align' + data.align, {}, cellElm); - } - }); - - editor.focus(); - }); - } - }); - } - - function rowDialog() { - var dom = editor.dom, tableElm, cellElm, rowElm, data, rows = []; - - tableElm = editor.dom.getParent(editor.selection.getStart(), 'table'); - cellElm = editor.dom.getParent(editor.selection.getStart(), 'td,th'); - - each(tableElm.rows, function(row) { - each(row.cells, function(cell) { - if (dom.hasClass(cell, 'mce-item-selected') || cell == cellElm) { - rows.push(row); - return false; - } - }); - }); - - rowElm = rows[0]; - if (!rowElm) { - // If this element is null, return now to avoid crashing. - return; - } - - data = { - height: removePxSuffix(dom.getStyle(rowElm, 'height') || dom.getAttrib(rowElm, 'height')), - scope: dom.getAttrib(rowElm, 'scope') - }; - - data.type = rowElm.parentNode.nodeName.toLowerCase(); - - each('left center right'.split(' '), function(name) { - if (editor.formatter.matchNode(rowElm, 'align' + name)) { - data.align = name; - } - }); - - editor.windowManager.open({ - title: "Row properties", - items: { - type: 'form', - data: data, - columns: 2, - defaults: { - type: 'textbox' - }, - items: [ - { - type: 'listbox', - name: 'type', - label: 'Row type', - text: 'None', - maxWidth: null, - values: [ - {text: 'Header', value: 'thead'}, - {text: 'Body', value: 'tbody'}, - {text: 'Footer', value: 'tfoot'} - ] - }, - { - type: 'listbox', - name: 'align', - label: 'Alignment', - text: 'None', - maxWidth: null, - values: [ - {text: 'None', value: ''}, - {text: 'Left', value: 'left'}, - {text: 'Center', value: 'center'}, - {text: 'Right', value: 'right'} - ] - }, - {label: 'Height', name: 'height'} - ] - }, - - onsubmit: function() { - var data = this.toJSON(), tableElm, oldParentElm, parentElm; - - editor.undoManager.transact(function() { - var toType = data.type; - - each(rows, function(rowElm) { - editor.dom.setAttrib(rowElm, 'scope', data.scope); - - editor.dom.setStyles(rowElm, { - height: addSizeSuffix(data.height) - }); - - if (toType != rowElm.parentNode.nodeName.toLowerCase()) { - tableElm = dom.getParent(rowElm, 'table'); - - oldParentElm = rowElm.parentNode; - parentElm = dom.select(toType, tableElm)[0]; - if (!parentElm) { - parentElm = dom.create(toType); - if (tableElm.firstChild) { - tableElm.insertBefore(parentElm, tableElm.firstChild); - } else { - tableElm.appendChild(parentElm); - } - } - - parentElm.appendChild(rowElm); - - if (!oldParentElm.hasChildNodes()) { - dom.remove(oldParentElm); - } - } - - // Apply/remove alignment - unApplyAlign(rowElm); - if (data.align) { - editor.formatter.apply('align' + data.align, {}, rowElm); - } - }); - - editor.focus(); - }); - } - }); - } - - function cmd(command) { - return function() { - editor.execCommand(command); - }; - } - - function insertTable(cols, rows) { - var y, x, html; - - html = ''; - - for (y = 0; y < rows; y++) { - html += ''; - - for (x = 0; x < cols; x++) { - html += ''; - } - - html += ''; - } - - html += '
    ' + (Env.ie ? " " : '
    ') + '
    '; - - editor.insertContent(html); - } - - function handleDisabledState(ctrl, selector) { - function bindStateListener() { - ctrl.disabled(!editor.dom.getParent(editor.selection.getStart(), selector)); - - editor.selection.selectorChanged(selector, function(state) { - ctrl.disabled(!state); - }); - } - - if (editor.initialized) { - bindStateListener(); - } else { - editor.on('init', bindStateListener); - } - } - - function postRender() { - /*jshint validthis:true*/ - handleDisabledState(this, 'table'); - } - - function postRenderCell() { - /*jshint validthis:true*/ - handleDisabledState(this, 'td,th'); - } - - function generateTableGrid() { - var html = ''; - - html = ''; - - for (var y = 0; y < 10; y++) { - html += ''; - - for (var x = 0; x < 10; x++) { - html += ''; - } - - html += ''; - } - - html += '
    '; - - html += ''; - - return html; - } - - function selectGrid(tx, ty, control) { - var table = control.getEl().getElementsByTagName('table')[0]; - var rel = control.parent().rel, x, y, focusCell, cell; - - if (control.isRtl() || rel == 'tl-tr') { - for (y = 9; y >= 0; y--) { - for (x = 0; x < 10; x++) { - cell = table.rows[y].childNodes[x].firstChild; - - editor.dom.toggleClass( - cell, - 'mce-active', - x >= tx && y <= ty - ); - - if (x >= tx && y <= ty) { - focusCell = cell; - } - } - } - - tx = 9 - tx; - table.nextSibling.innerHTML = tx + ' x ' + (ty + 1); - } else { - for (y = 0; y < 10; y++) { - for (x = 0; x < 10; x++) { - cell = table.rows[y].childNodes[x].firstChild; - - editor.dom.toggleClass( - cell, - 'mce-active', - x <= tx && y <= ty - ); - - if (x <= tx && y <= ty) { - focusCell = cell; - } - } - } - - table.nextSibling.innerHTML = (tx + 1) + ' x ' + (ty + 1); - } - - return focusCell.parentNode; - } - - editor.addMenuItem('inserttable', { - text: 'Insert table', - icon: 'table', - context: 'table', - onhide: function() { - var elements = this.menu.items()[0].getEl().getElementsByTagName('a'); - editor.dom.removeClass(elements, 'mce-active'); - editor.dom.addClass(elements[0], 'mce-active'); - }, - menu: [ - { - type: 'container', - html: generateTableGrid(), - - onPostRender: function() { - this.lastX = this.lastY = 0; - }, - - onmousemove: function(e) { - var target = e.target, x, y; - - if (target.nodeName == 'A') { - x = parseInt(target.getAttribute('data-mce-x'), 10); - y = parseInt(target.getAttribute('data-mce-y'), 10); - - if (x !== this.lastX || y !== this.lastY) { - selectGrid(x, y, e.control); - - this.lastX = x; - this.lastY = y; - } - } - }, - - onkeydown: function(e) { - var x = this.lastX, y = this.lastY, isHandled; - - switch (e.keyCode) { - case 37: // DOM_VK_LEFT - if (x > 0) { - x--; - isHandled = true; - } - break; - - case 39: // DOM_VK_RIGHT - isHandled = true; - - if (x < 9) { - x++; - } - break; - - case 38: // DOM_VK_UP - isHandled = true; - - if (y > 0) { - y--; - } - break; - - case 40: // DOM_VK_DOWN - isHandled = true; - - if (y < 9) { - y++; - } - break; - } - - if (isHandled) { - e.preventDefault(); - e.stopPropagation(); - - selectGrid(x, y, e.control).focus(); - - this.lastX = x; - this.lastY = y; - } - }, - - onclick: function(e) { - if (e.target.nodeName == 'A') { - e.preventDefault(); - e.stopPropagation(); - this.parent().cancel(); - - insertTable(this.lastX + 1, this.lastY + 1); - } - } - } - ] - }); - - editor.addMenuItem('tableprops', { - text: 'Table properties', - context: 'table', - onPostRender: postRender, - onclick: tableDialog - }); - - editor.addMenuItem('deletetable', { - text: 'Delete table', - context: 'table', - onPostRender: postRender, - cmd: 'mceTableDelete' - }); - - editor.addMenuItem('cell', { - separator: 'before', - text: 'Cell', - context: 'table', - menu: [ - {text: 'Cell properties', onclick: cmd('mceTableCellProps'), onPostRender: postRenderCell}, - {text: 'Merge cells', onclick: cmd('mceTableMergeCells'), onPostRender: postRenderCell}, - {text: 'Split cell', onclick: cmd('mceTableSplitCells'), onPostRender: postRenderCell} - ] - }); - - editor.addMenuItem('row', { - text: 'Row', - context: 'table', - menu: [ - {text: 'Insert row before', onclick: cmd('mceTableInsertRowBefore'), onPostRender: postRenderCell}, - {text: 'Insert row after', onclick: cmd('mceTableInsertRowAfter'), onPostRender: postRenderCell}, - {text: 'Delete row', onclick: cmd('mceTableDeleteRow'), onPostRender: postRenderCell}, - {text: 'Row properties', onclick: cmd('mceTableRowProps'), onPostRender: postRenderCell}, - {text: '-'}, - {text: 'Cut row', onclick: cmd('mceTableCutRow'), onPostRender: postRenderCell}, - {text: 'Copy row', onclick: cmd('mceTableCopyRow'), onPostRender: postRenderCell}, - {text: 'Paste row before', onclick: cmd('mceTablePasteRowBefore'), onPostRender: postRenderCell}, - {text: 'Paste row after', onclick: cmd('mceTablePasteRowAfter'), onPostRender: postRenderCell} - ] - }); - - editor.addMenuItem('column', { - text: 'Column', - context: 'table', - menu: [ - {text: 'Insert column before', onclick: cmd('mceTableInsertColBefore'), onPostRender: postRenderCell}, - {text: 'Insert column after', onclick: cmd('mceTableInsertColAfter'), onPostRender: postRenderCell}, - {text: 'Delete column', onclick: cmd('mceTableDeleteCol'), onPostRender: postRenderCell} - ] - }); - - var menuItems = []; - each("inserttable tableprops deletetable | cell row column".split(' '), function(name) { - if (name == '|') { - menuItems.push({text: '-'}); - } else { - menuItems.push(editor.menuItems[name]); - } - }); - - editor.addButton("table", { - type: "menubutton", - title: "Table", - menu: menuItems - }); - - // Select whole table is a table border is clicked - if (!Env.isIE) { - editor.on('click', function(e) { - e = e.target; - - if (e.nodeName === 'TABLE') { - editor.selection.select(e); - editor.nodeChanged(); - } - }); - } - - self.quirks = new Quirks(editor); - - editor.on('Init', function() { - winMan = editor.windowManager; - self.cellSelection = new CellSelection(editor); - }); - - // Register action commands - each({ - mceTableSplitCells: function(grid) { - grid.split(); - }, - - mceTableMergeCells: function(grid) { - var rowSpan, colSpan, cell; - - cell = editor.dom.getParent(editor.selection.getStart(), 'th,td'); - if (cell) { - rowSpan = cell.rowSpan; - colSpan = cell.colSpan; - } - - if (!editor.dom.select('td.mce-item-selected,th.mce-item-selected').length) { - mergeDialog(grid, cell); - } else { - grid.merge(); - } - }, - - mceTableInsertRowBefore: function(grid) { - grid.insertRow(true); - }, - - mceTableInsertRowAfter: function(grid) { - grid.insertRow(); - }, - - mceTableInsertColBefore: function(grid) { - grid.insertCol(true); - }, - - mceTableInsertColAfter: function(grid) { - grid.insertCol(); - }, - - mceTableDeleteCol: function(grid) { - grid.deleteCols(); - }, - - mceTableDeleteRow: function(grid) { - grid.deleteRows(); - }, - - mceTableCutRow: function(grid) { - clipboardRows = grid.cutRows(); - }, - - mceTableCopyRow: function(grid) { - clipboardRows = grid.copyRows(); - }, - - mceTablePasteRowBefore: function(grid) { - grid.pasteRows(clipboardRows, true); - }, - - mceTablePasteRowAfter: function(grid) { - grid.pasteRows(clipboardRows); - }, - - mceTableDelete: function(grid) { - grid.deleteTable(); - } - }, function(func, name) { - editor.addCommand(name, function() { - var grid = new TableGrid(editor); - - if (grid) { - func(grid); - editor.execCommand('mceRepaint'); - self.cellSelection.clear(); - } - }); - }); - - // Register dialog commands - each({ - mceInsertTable: function() { - tableDialog(); - }, - - mceTableRowProps: rowDialog, - mceTableCellProps: cellDialog - }, function(func, name) { - editor.addCommand(name, function(ui, val) { - func(val); - }); - }); - } - - PluginManager.add('table', Plugin); -}); - -expose(["tinymce/tableplugin/TableGrid","tinymce/tableplugin/Quirks","tinymce/tableplugin/CellSelection","tinymce/tableplugin/Plugin"]); -})(this); \ No newline at end of file +(function () { + 'use strict'; + + var noop = function () { + }; + var compose = function (fa, fb) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return fa(fb.apply(null, args)); + }; + }; + var compose1 = function (fbc, fab) { + return function (a) { + return fbc(fab(a)); + }; + }; + var constant = function (value) { + return function () { + return value; + }; + }; + var identity = function (x) { + return x; + }; + function curry(fn) { + var initialArgs = []; + for (var _i = 1; _i < arguments.length; _i++) { + initialArgs[_i - 1] = arguments[_i]; + } + return function () { + var restArgs = []; + for (var _i = 0; _i < arguments.length; _i++) { + restArgs[_i] = arguments[_i]; + } + var all = initialArgs.concat(restArgs); + return fn.apply(null, all); + }; + } + var not = function (f) { + return function (t) { + return !f(t); + }; + }; + var die = function (msg) { + return function () { + throw new Error(msg); + }; + }; + var never = constant(false); + var always = constant(true); + + var none = function () { + return NONE; + }; + var NONE = function () { + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; + }(); + var some = function (a) { + var constant_a = constant(a); + var self = function () { + return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; + }; + var from = function (value) { + return value === null || value === undefined ? NONE : some(value); + }; + var Optional = { + some: some, + none: none, + from: from + }; + + var typeOf = function (x) { + var t = typeof x; + if (x === null) { + return 'null'; + } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } else { + return t; + } + }; + var isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isSimpleType = function (type) { + return function (value) { + return typeof value === type; + }; + }; + var isString = isType('string'); + var isObject = isType('object'); + var isArray = isType('array'); + var isBoolean = isSimpleType('boolean'); + var isNullable = function (a) { + return a === null || a === undefined; + }; + var isNonNullable = function (a) { + return !isNullable(a); + }; + var isFunction = isSimpleType('function'); + var isNumber = isSimpleType('number'); + + var nativeSlice = Array.prototype.slice; + var nativeIndexOf = Array.prototype.indexOf; + var nativePush = Array.prototype.push; + var rawIndexOf = function (ts, t) { + return nativeIndexOf.call(ts, t); + }; + var contains = function (xs, x) { + return rawIndexOf(xs, x) > -1; + }; + var exists = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return true; + } + } + return false; + }; + var range = function (num, f) { + var r = []; + for (var i = 0; i < num; i++) { + r.push(f(i)); + } + return r; + }; + var map = function (xs, f) { + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; + }; + var each = function (xs, f) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } + }; + var eachr = function (xs, f) { + for (var i = xs.length - 1; i >= 0; i--) { + var x = xs[i]; + f(x, i); + } + }; + var partition = function (xs, pred) { + var pass = []; + var fail = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + var arr = pred(x, i) ? pass : fail; + arr.push(x); + } + return { + pass: pass, + fail: fail + }; + }; + var filter = function (xs, pred) { + var r = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + r.push(x); + } + } + return r; + }; + var foldr = function (xs, f, acc) { + eachr(xs, function (x) { + acc = f(acc, x); + }); + return acc; + }; + var foldl = function (xs, f, acc) { + each(xs, function (x) { + acc = f(acc, x); + }); + return acc; + }; + var findUntil = function (xs, pred, until) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Optional.some(x); + } else if (until(x, i)) { + break; + } + } + return Optional.none(); + }; + var find = function (xs, pred) { + return findUntil(xs, pred, never); + }; + var findIndex = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Optional.some(i); + } + } + return Optional.none(); + }; + var flatten = function (xs) { + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); + } + nativePush.apply(r, xs[i]); + } + return r; + }; + var bind = function (xs, f) { + return flatten(map(xs, f)); + }; + var forall = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; ++i) { + var x = xs[i]; + if (pred(x, i) !== true) { + return false; + } + } + return true; + }; + var reverse = function (xs) { + var r = nativeSlice.call(xs, 0); + r.reverse(); + return r; + }; + var pure = function (x) { + return [x]; + }; + var head = function (xs) { + return xs.length === 0 ? Optional.none() : Optional.some(xs[0]); + }; + var last = function (xs) { + return xs.length === 0 ? Optional.none() : Optional.some(xs[xs.length - 1]); + }; + var findMap = function (arr, f) { + for (var i = 0; i < arr.length; i++) { + var r = f(arr[i], i); + if (r.isSome()) { + return r; + } + } + return Optional.none(); + }; + + var __assign = function () { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) + s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + } + + var cached = function (f) { + var called = false; + var r; + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!called) { + called = true; + r = f.apply(null, args); + } + return r; + }; + }; + + var DeviceType = function (os, browser, userAgent, mediaMatch) { + var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true; + var isiPhone = os.isiOS() && !isiPad; + var isMobile = os.isiOS() || os.isAndroid(); + var isTouch = isMobile || mediaMatch('(pointer:coarse)'); + var isTablet = isiPad || !isiPhone && isMobile && mediaMatch('(min-device-width:768px)'); + var isPhone = isiPhone || isMobile && !isTablet; + var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false; + var isDesktop = !isPhone && !isTablet && !iOSwebview; + return { + isiPad: constant(isiPad), + isiPhone: constant(isiPhone), + isTablet: constant(isTablet), + isPhone: constant(isPhone), + isTouch: constant(isTouch), + isAndroid: os.isAndroid, + isiOS: os.isiOS, + isWebView: constant(iOSwebview), + isDesktop: constant(isDesktop) + }; + }; + + var firstMatch = function (regexes, s) { + for (var i = 0; i < regexes.length; i++) { + var x = regexes[i]; + if (x.test(s)) { + return x; + } + } + return undefined; + }; + var find$1 = function (regexes, agent) { + var r = firstMatch(regexes, agent); + if (!r) { + return { + major: 0, + minor: 0 + }; + } + var group = function (i) { + return Number(agent.replace(r, '$' + i)); + }; + return nu(group(1), group(2)); + }; + var detect = function (versionRegexes, agent) { + var cleanedAgent = String(agent).toLowerCase(); + if (versionRegexes.length === 0) { + return unknown(); + } + return find$1(versionRegexes, cleanedAgent); + }; + var unknown = function () { + return nu(0, 0); + }; + var nu = function (major, minor) { + return { + major: major, + minor: minor + }; + }; + var Version = { + nu: nu, + detect: detect, + unknown: unknown + }; + + var detect$1 = function (candidates, userAgent) { + var agent = String(userAgent).toLowerCase(); + return find(candidates, function (candidate) { + return candidate.search(agent); + }); + }; + var detectBrowser = function (browsers, userAgent) { + return detect$1(browsers, userAgent).map(function (browser) { + var version = Version.detect(browser.versionRegexes, userAgent); + return { + current: browser.name, + version: version + }; + }); + }; + var detectOs = function (oses, userAgent) { + return detect$1(oses, userAgent).map(function (os) { + var version = Version.detect(os.versionRegexes, userAgent); + return { + current: os.name, + version: version + }; + }); + }; + var UaString = { + detectBrowser: detectBrowser, + detectOs: detectOs + }; + + var checkRange = function (str, substr, start) { + return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr; + }; + var contains$1 = function (str, substr) { + return str.indexOf(substr) !== -1; + }; + var startsWith = function (str, prefix) { + return checkRange(str, prefix, 0); + }; + var endsWith = function (str, suffix) { + return checkRange(str, suffix, str.length - suffix.length); + }; + var blank = function (r) { + return function (s) { + return s.replace(r, ''); + }; + }; + var trim = blank(/^\s+|\s+$/g); + var isNotEmpty = function (s) { + return s.length > 0; + }; + + var normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/; + var checkContains = function (target) { + return function (uastring) { + return contains$1(uastring, target); + }; + }; + var browsers = [ + { + name: 'Edge', + versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/], + search: function (uastring) { + return contains$1(uastring, 'edge/') && contains$1(uastring, 'chrome') && contains$1(uastring, 'safari') && contains$1(uastring, 'applewebkit'); + } + }, + { + name: 'Chrome', + versionRegexes: [ + /.*?chrome\/([0-9]+)\.([0-9]+).*/, + normalVersionRegex + ], + search: function (uastring) { + return contains$1(uastring, 'chrome') && !contains$1(uastring, 'chromeframe'); + } + }, + { + name: 'IE', + versionRegexes: [ + /.*?msie\ ?([0-9]+)\.([0-9]+).*/, + /.*?rv:([0-9]+)\.([0-9]+).*/ + ], + search: function (uastring) { + return contains$1(uastring, 'msie') || contains$1(uastring, 'trident'); + } + }, + { + name: 'Opera', + versionRegexes: [ + normalVersionRegex, + /.*?opera\/([0-9]+)\.([0-9]+).*/ + ], + search: checkContains('opera') + }, + { + name: 'Firefox', + versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/], + search: checkContains('firefox') + }, + { + name: 'Safari', + versionRegexes: [ + normalVersionRegex, + /.*?cpu os ([0-9]+)_([0-9]+).*/ + ], + search: function (uastring) { + return (contains$1(uastring, 'safari') || contains$1(uastring, 'mobile/')) && contains$1(uastring, 'applewebkit'); + } + } + ]; + var oses = [ + { + name: 'Windows', + search: checkContains('win'), + versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/] + }, + { + name: 'iOS', + search: function (uastring) { + return contains$1(uastring, 'iphone') || contains$1(uastring, 'ipad'); + }, + versionRegexes: [ + /.*?version\/\ ?([0-9]+)\.([0-9]+).*/, + /.*cpu os ([0-9]+)_([0-9]+).*/, + /.*cpu iphone os ([0-9]+)_([0-9]+).*/ + ] + }, + { + name: 'Android', + search: checkContains('android'), + versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/] + }, + { + name: 'OSX', + search: checkContains('mac os x'), + versionRegexes: [/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/] + }, + { + name: 'Linux', + search: checkContains('linux'), + versionRegexes: [] + }, + { + name: 'Solaris', + search: checkContains('sunos'), + versionRegexes: [] + }, + { + name: 'FreeBSD', + search: checkContains('freebsd'), + versionRegexes: [] + }, + { + name: 'ChromeOS', + search: checkContains('cros'), + versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/] + } + ]; + var PlatformInfo = { + browsers: constant(browsers), + oses: constant(oses) + }; + + var edge = 'Edge'; + var chrome = 'Chrome'; + var ie = 'IE'; + var opera = 'Opera'; + var firefox = 'Firefox'; + var safari = 'Safari'; + var unknown$1 = function () { + return nu$1({ + current: undefined, + version: Version.unknown() + }); + }; + var nu$1 = function (info) { + var current = info.current; + var version = info.version; + var isBrowser = function (name) { + return function () { + return current === name; + }; + }; + return { + current: current, + version: version, + isEdge: isBrowser(edge), + isChrome: isBrowser(chrome), + isIE: isBrowser(ie), + isOpera: isBrowser(opera), + isFirefox: isBrowser(firefox), + isSafari: isBrowser(safari) + }; + }; + var Browser = { + unknown: unknown$1, + nu: nu$1, + edge: constant(edge), + chrome: constant(chrome), + ie: constant(ie), + opera: constant(opera), + firefox: constant(firefox), + safari: constant(safari) + }; + + var windows = 'Windows'; + var ios = 'iOS'; + var android = 'Android'; + var linux = 'Linux'; + var osx = 'OSX'; + var solaris = 'Solaris'; + var freebsd = 'FreeBSD'; + var chromeos = 'ChromeOS'; + var unknown$2 = function () { + return nu$2({ + current: undefined, + version: Version.unknown() + }); + }; + var nu$2 = function (info) { + var current = info.current; + var version = info.version; + var isOS = function (name) { + return function () { + return current === name; + }; + }; + return { + current: current, + version: version, + isWindows: isOS(windows), + isiOS: isOS(ios), + isAndroid: isOS(android), + isOSX: isOS(osx), + isLinux: isOS(linux), + isSolaris: isOS(solaris), + isFreeBSD: isOS(freebsd), + isChromeOS: isOS(chromeos) + }; + }; + var OperatingSystem = { + unknown: unknown$2, + nu: nu$2, + windows: constant(windows), + ios: constant(ios), + android: constant(android), + linux: constant(linux), + osx: constant(osx), + solaris: constant(solaris), + freebsd: constant(freebsd), + chromeos: constant(chromeos) + }; + + var detect$2 = function (userAgent, mediaMatch) { + var browsers = PlatformInfo.browsers(); + var oses = PlatformInfo.oses(); + var browser = UaString.detectBrowser(browsers, userAgent).fold(Browser.unknown, Browser.nu); + var os = UaString.detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu); + var deviceType = DeviceType(os, browser, userAgent, mediaMatch); + return { + browser: browser, + os: os, + deviceType: deviceType + }; + }; + var PlatformDetection = { detect: detect$2 }; + + var mediaMatch = function (query) { + return window.matchMedia(query).matches; + }; + var platform = cached(function () { + return PlatformDetection.detect(navigator.userAgent, mediaMatch); + }); + var detect$3 = function () { + return platform(); + }; + + var compareDocumentPosition = function (a, b, match) { + return (a.compareDocumentPosition(b) & match) !== 0; + }; + var documentPositionContainedBy = function (a, b) { + return compareDocumentPosition(a, b, Node.DOCUMENT_POSITION_CONTAINED_BY); + }; + + var COMMENT = 8; + var DOCUMENT = 9; + var DOCUMENT_FRAGMENT = 11; + var ELEMENT = 1; + var TEXT = 3; + + var fromHtml = function (html, scope) { + var doc = scope || document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); + }; + var fromTag = function (tag, scope) { + var doc = scope || document; + var node = doc.createElement(tag); + return fromDom(node); + }; + var fromText = function (text, scope) { + var doc = scope || document; + var node = doc.createTextNode(text); + return fromDom(node); + }; + var fromDom = function (node) { + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: node }; + }; + var fromPoint = function (docElm, x, y) { + return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); + }; + var SugarElement = { + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint + }; + + var is = function (element, selector) { + var dom = element.dom; + if (dom.nodeType !== ELEMENT) { + return false; + } else { + var elem = dom; + if (elem.matches !== undefined) { + return elem.matches(selector); + } else if (elem.msMatchesSelector !== undefined) { + return elem.msMatchesSelector(selector); + } else if (elem.webkitMatchesSelector !== undefined) { + return elem.webkitMatchesSelector(selector); + } else if (elem.mozMatchesSelector !== undefined) { + return elem.mozMatchesSelector(selector); + } else { + throw new Error('Browser lacks native selectors'); + } + } + }; + var bypassSelector = function (dom) { + return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0; + }; + var all = function (selector, scope) { + var base = scope === undefined ? document : scope.dom; + return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), SugarElement.fromDom); + }; + var one = function (selector, scope) { + var base = scope === undefined ? document : scope.dom; + return bypassSelector(base) ? Optional.none() : Optional.from(base.querySelector(selector)).map(SugarElement.fromDom); + }; + + var eq = function (e1, e2) { + return e1.dom === e2.dom; + }; + var regularContains = function (e1, e2) { + var d1 = e1.dom; + var d2 = e2.dom; + return d1 === d2 ? false : d1.contains(d2); + }; + var ieContains = function (e1, e2) { + return documentPositionContainedBy(e1.dom, e2.dom); + }; + var contains$2 = function (e1, e2) { + return detect$3().browser.isIE() ? ieContains(e1, e2) : regularContains(e1, e2); + }; + var is$1 = is; + + var keys = Object.keys; + var hasOwnProperty = Object.hasOwnProperty; + var each$1 = function (obj, f) { + var props = keys(obj); + for (var k = 0, len = props.length; k < len; k++) { + var i = props[k]; + var x = obj[i]; + f(x, i); + } + }; + var map$1 = function (obj, f) { + return tupleMap(obj, function (x, i) { + return { + k: i, + v: f(x, i) + }; + }); + }; + var tupleMap = function (obj, f) { + var r = {}; + each$1(obj, function (x, i) { + var tuple = f(x, i); + r[tuple.k] = tuple.v; + }); + return r; + }; + var objAcc = function (r) { + return function (x, i) { + r[i] = x; + }; + }; + var internalFilter = function (obj, pred, onTrue, onFalse) { + var r = {}; + each$1(obj, function (x, i) { + (pred(x, i) ? onTrue : onFalse)(x, i); + }); + return r; + }; + var filter$1 = function (obj, pred) { + var t = {}; + internalFilter(obj, pred, objAcc(t), noop); + return t; + }; + var mapToArray = function (obj, f) { + var r = []; + each$1(obj, function (value, name) { + r.push(f(value, name)); + }); + return r; + }; + var values = function (obj) { + return mapToArray(obj, function (v) { + return v; + }); + }; + var get = function (obj, key) { + return has(obj, key) ? Optional.from(obj[key]) : Optional.none(); + }; + var has = function (obj, key) { + return hasOwnProperty.call(obj, key); + }; + var hasNonNullableKey = function (obj, key) { + return has(obj, key) && obj[key] !== undefined && obj[key] !== null; + }; + + var validSectionList = [ + 'tfoot', + 'thead', + 'tbody', + 'colgroup' + ]; + var isValidSection = function (parentName) { + return contains(validSectionList, parentName); + }; + var grid = function (rows, columns) { + return { + rows: rows, + columns: columns + }; + }; + var address = function (row, column) { + return { + row: row, + column: column + }; + }; + var detail = function (element, rowspan, colspan) { + return { + element: element, + rowspan: rowspan, + colspan: colspan + }; + }; + var detailnew = function (element, rowspan, colspan, isNew) { + return { + element: element, + rowspan: rowspan, + colspan: colspan, + isNew: isNew + }; + }; + var extended = function (element, rowspan, colspan, row, column) { + return { + element: element, + rowspan: rowspan, + colspan: colspan, + row: row, + column: column + }; + }; + var rowdata = function (element, cells, section) { + return { + element: element, + cells: cells, + section: section + }; + }; + var elementnew = function (element, isNew) { + return { + element: element, + isNew: isNew + }; + }; + var rowdatanew = function (element, cells, section, isNew) { + return { + element: element, + cells: cells, + section: section, + isNew: isNew + }; + }; + var rowcells = function (cells, section) { + return { + cells: cells, + section: section + }; + }; + var rowdetails = function (details, section) { + return { + details: details, + section: section + }; + }; + var bounds = function (startRow, startCol, finishRow, finishCol) { + return { + startRow: startRow, + startCol: startCol, + finishRow: finishRow, + finishCol: finishCol + }; + }; + var columnext = function (element, colspan, column) { + return { + element: element, + colspan: colspan, + column: column + }; + }; + + var Global = typeof window !== 'undefined' ? window : Function('return this;')(); + + var name = function (element) { + var r = element.dom.nodeName; + return r.toLowerCase(); + }; + var type = function (element) { + return element.dom.nodeType; + }; + var isType$1 = function (t) { + return function (element) { + return type(element) === t; + }; + }; + var isComment = function (element) { + return type(element) === COMMENT || name(element) === '#comment'; + }; + var isElement = isType$1(ELEMENT); + var isText = isType$1(TEXT); + var isDocument = isType$1(DOCUMENT); + var isDocumentFragment = isType$1(DOCUMENT_FRAGMENT); + + var owner = function (element) { + return SugarElement.fromDom(element.dom.ownerDocument); + }; + var documentOrOwner = function (dos) { + return isDocument(dos) ? dos : owner(dos); + }; + var defaultView = function (element) { + return SugarElement.fromDom(documentOrOwner(element).dom.defaultView); + }; + var parent = function (element) { + return Optional.from(element.dom.parentNode).map(SugarElement.fromDom); + }; + var parents = function (element, isRoot) { + var stop = isFunction(isRoot) ? isRoot : never; + var dom = element.dom; + var ret = []; + while (dom.parentNode !== null && dom.parentNode !== undefined) { + var rawParent = dom.parentNode; + var p = SugarElement.fromDom(rawParent); + ret.push(p); + if (stop(p) === true) { + break; + } else { + dom = rawParent; + } + } + return ret; + }; + var offsetParent = function (element) { + return Optional.from(element.dom.offsetParent).map(SugarElement.fromDom); + }; + var prevSibling = function (element) { + return Optional.from(element.dom.previousSibling).map(SugarElement.fromDom); + }; + var nextSibling = function (element) { + return Optional.from(element.dom.nextSibling).map(SugarElement.fromDom); + }; + var children = function (element) { + return map(element.dom.childNodes, SugarElement.fromDom); + }; + var child = function (element, index) { + var cs = element.dom.childNodes; + return Optional.from(cs[index]).map(SugarElement.fromDom); + }; + var firstChild = function (element) { + return child(element, 0); + }; + + var isShadowRoot = function (dos) { + return isDocumentFragment(dos); + }; + var supported = isFunction(Element.prototype.attachShadow) && isFunction(Node.prototype.getRootNode); + var isSupported = constant(supported); + var getRootNode = supported ? function (e) { + return SugarElement.fromDom(e.dom.getRootNode()); + } : documentOrOwner; + var getShadowRoot = function (e) { + var r = getRootNode(e); + return isShadowRoot(r) ? Optional.some(r) : Optional.none(); + }; + var getShadowHost = function (e) { + return SugarElement.fromDom(e.dom.host); + }; + var getOriginalEventTarget = function (event) { + if (isSupported() && isNonNullable(event.target)) { + var el = SugarElement.fromDom(event.target); + if (isElement(el) && isOpenShadowHost(el)) { + if (event.composed && event.composedPath) { + var composedPath = event.composedPath(); + if (composedPath) { + return head(composedPath); + } + } + } + } + return Optional.from(event.target); + }; + var isOpenShadowHost = function (element) { + return isNonNullable(element.dom.shadowRoot); + }; + + var inBody = function (element) { + var dom = isText(element) ? element.dom.parentNode : element.dom; + if (dom === undefined || dom === null || dom.ownerDocument === null) { + return false; + } + var doc = dom.ownerDocument; + return getShadowRoot(SugarElement.fromDom(dom)).fold(function () { + return doc.body.contains(dom); + }, compose1(inBody, getShadowHost)); + }; + var body = function () { + return getBody(SugarElement.fromDom(document)); + }; + var getBody = function (doc) { + var b = doc.dom.body; + if (b === null || b === undefined) { + throw new Error('Body is not available yet'); + } + return SugarElement.fromDom(b); + }; + + var ancestors = function (scope, predicate, isRoot) { + return filter(parents(scope, isRoot), predicate); + }; + var children$1 = function (scope, predicate) { + return filter(children(scope), predicate); + }; + var descendants = function (scope, predicate) { + var result = []; + each(children(scope), function (x) { + if (predicate(x)) { + result = result.concat([x]); + } + result = result.concat(descendants(x, predicate)); + }); + return result; + }; + + var ancestors$1 = function (scope, selector, isRoot) { + return ancestors(scope, function (e) { + return is(e, selector); + }, isRoot); + }; + var children$2 = function (scope, selector) { + return children$1(scope, function (e) { + return is(e, selector); + }); + }; + var descendants$1 = function (scope, selector) { + return all(selector, scope); + }; + + function ClosestOrAncestor (is, ancestor, scope, a, isRoot) { + return is(scope, a) ? Optional.some(scope) : isFunction(isRoot) && isRoot(scope) ? Optional.none() : ancestor(scope, a, isRoot); + } + + var ancestor = function (scope, predicate, isRoot) { + var element = scope.dom; + var stop = isFunction(isRoot) ? isRoot : never; + while (element.parentNode) { + element = element.parentNode; + var el = SugarElement.fromDom(element); + if (predicate(el)) { + return Optional.some(el); + } else if (stop(el)) { + break; + } + } + return Optional.none(); + }; + var closest = function (scope, predicate, isRoot) { + var is = function (s, test) { + return test(s); + }; + return ClosestOrAncestor(is, ancestor, scope, predicate, isRoot); + }; + var child$1 = function (scope, predicate) { + var pred = function (node) { + return predicate(SugarElement.fromDom(node)); + }; + var result = find(scope.dom.childNodes, pred); + return result.map(SugarElement.fromDom); + }; + var descendant = function (scope, predicate) { + var descend = function (node) { + for (var i = 0; i < node.childNodes.length; i++) { + var child_1 = SugarElement.fromDom(node.childNodes[i]); + if (predicate(child_1)) { + return Optional.some(child_1); + } + var res = descend(node.childNodes[i]); + if (res.isSome()) { + return res; + } + } + return Optional.none(); + }; + return descend(scope.dom); + }; + + var ancestor$1 = function (scope, selector, isRoot) { + return ancestor(scope, function (e) { + return is(e, selector); + }, isRoot); + }; + var child$2 = function (scope, selector) { + return child$1(scope, function (e) { + return is(e, selector); + }); + }; + var descendant$1 = function (scope, selector) { + return one(selector, scope); + }; + var closest$1 = function (scope, selector, isRoot) { + var is$1 = function (element, selector) { + return is(element, selector); + }; + return ClosestOrAncestor(is$1, ancestor$1, scope, selector, isRoot); + }; + + var rawSet = function (dom, key, value) { + if (isString(value) || isBoolean(value) || isNumber(value)) { + dom.setAttribute(key, value + ''); + } else { + console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom); + throw new Error('Attribute value was not simple'); + } + }; + var set = function (element, key, value) { + rawSet(element.dom, key, value); + }; + var setAll = function (element, attrs) { + var dom = element.dom; + each$1(attrs, function (v, k) { + rawSet(dom, k, v); + }); + }; + var get$1 = function (element, key) { + var v = element.dom.getAttribute(key); + return v === null ? undefined : v; + }; + var getOpt = function (element, key) { + return Optional.from(get$1(element, key)); + }; + var remove = function (element, key) { + element.dom.removeAttribute(key); + }; + var clone = function (element) { + return foldl(element.dom.attributes, function (acc, attr) { + acc[attr.name] = attr.value; + return acc; + }, {}); + }; + + var isSupported$1 = function (dom) { + return dom.style !== undefined && isFunction(dom.style.getPropertyValue); + }; + + var internalSet = function (dom, property, value) { + if (!isString(value)) { + console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom); + throw new Error('CSS value must be a string: ' + value); + } + if (isSupported$1(dom)) { + dom.style.setProperty(property, value); + } + }; + var internalRemove = function (dom, property) { + if (isSupported$1(dom)) { + dom.style.removeProperty(property); + } + }; + var set$1 = function (element, property, value) { + var dom = element.dom; + internalSet(dom, property, value); + }; + var setAll$1 = function (element, css) { + var dom = element.dom; + each$1(css, function (v, k) { + internalSet(dom, k, v); + }); + }; + var get$2 = function (element, property) { + var dom = element.dom; + var styles = window.getComputedStyle(dom); + var r = styles.getPropertyValue(property); + return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r; + }; + var getUnsafeProperty = function (dom, property) { + return isSupported$1(dom) ? dom.style.getPropertyValue(property) : ''; + }; + var getRaw = function (element, property) { + var dom = element.dom; + var raw = getUnsafeProperty(dom, property); + return Optional.from(raw).filter(function (r) { + return r.length > 0; + }); + }; + var remove$1 = function (element, property) { + var dom = element.dom; + internalRemove(dom, property); + if (getOpt(element, 'style').map(trim).is('')) { + remove(element, 'style'); + } + }; + var copy = function (source, target) { + var sourceDom = source.dom; + var targetDom = target.dom; + if (isSupported$1(sourceDom) && isSupported$1(targetDom)) { + targetDom.style.cssText = sourceDom.style.cssText; + } + }; + + var getAttrValue = function (cell, name, fallback) { + if (fallback === void 0) { + fallback = 0; + } + return getOpt(cell, name).map(function (value) { + return parseInt(value, 10); + }).getOr(fallback); + }; + var getSpan = function (cell, type) { + return getAttrValue(cell, type, 1); + }; + var hasColspan = function (cell) { + return getSpan(cell, 'colspan') > 1; + }; + var hasRowspan = function (cell) { + return getSpan(cell, 'rowspan') > 1; + }; + var getCssValue = function (element, property) { + return parseInt(get$2(element, property), 10); + }; + var minWidth = constant(10); + var minHeight = constant(10); + + var firstLayer = function (scope, selector) { + return filterFirstLayer(scope, selector, always); + }; + var filterFirstLayer = function (scope, selector, predicate) { + return bind(children(scope), function (x) { + return is(x, selector) ? predicate(x) ? [x] : [] : filterFirstLayer(x, selector, predicate); + }); + }; + + var lookup = function (tags, element, isRoot) { + if (isRoot === void 0) { + isRoot = never; + } + if (isRoot(element)) { + return Optional.none(); + } + if (contains(tags, name(element))) { + return Optional.some(element); + } + var isRootOrUpperTable = function (elm) { + return is(elm, 'table') || isRoot(elm); + }; + return ancestor$1(element, tags.join(','), isRootOrUpperTable); + }; + var cell = function (element, isRoot) { + return lookup([ + 'td', + 'th' + ], element, isRoot); + }; + var cells = function (ancestor) { + return firstLayer(ancestor, 'th,td'); + }; + var columns = function (ancestor) { + return firstLayer(ancestor, 'col'); + }; + var table = function (element, isRoot) { + return closest$1(element, 'table', isRoot); + }; + var rows = function (ancestor) { + return firstLayer(ancestor, 'tr'); + }; + var columnGroups = function (ancestor) { + return firstLayer(ancestor, 'colgroup'); + }; + + var fromRowsOrColGroups = function (elems, getSection) { + return map(elems, function (row) { + if (name(row) === 'colgroup') { + var cells$1 = map(columns(row), function (column) { + var colspan = getAttrValue(column, 'span', 1); + return detail(column, 1, colspan); + }); + return rowdata(row, cells$1, 'colgroup'); + } else { + var cells$1 = map(cells(row), function (cell) { + var rowspan = getAttrValue(cell, 'rowspan', 1); + var colspan = getAttrValue(cell, 'colspan', 1); + return detail(cell, rowspan, colspan); + }); + return rowdata(row, cells$1, getSection(row)); + } + }); + }; + var getParentSection = function (group) { + return parent(group).map(function (parent) { + var parentName = name(parent); + return isValidSection(parentName) ? parentName : 'tbody'; + }).getOr('tbody'); + }; + var fromTable = function (table) { + var rows$1 = rows(table); + var columnGroups$1 = columnGroups(table); + var elems = __spreadArrays(columnGroups$1, rows$1); + return fromRowsOrColGroups(elems, getParentSection); + }; + var fromPastedRows = function (elems, section) { + return fromRowsOrColGroups(elems, function () { + return section; + }); + }; + + var key = function (row, column) { + return row + ',' + column; + }; + var getAt = function (warehouse, row, column) { + var raw = warehouse.access[key(row, column)]; + return raw !== undefined ? Optional.some(raw) : Optional.none(); + }; + var findItem = function (warehouse, item, comparator) { + var filtered = filterItems(warehouse, function (detail) { + return comparator(item, detail.element); + }); + return filtered.length > 0 ? Optional.some(filtered[0]) : Optional.none(); + }; + var filterItems = function (warehouse, predicate) { + var all = bind(warehouse.all, function (r) { + return r.cells; + }); + return filter(all, predicate); + }; + var generateColumns = function (rowData) { + var columnsGroup = {}; + var index = 0; + each(rowData.cells, function (column) { + var colspan = column.colspan; + range(colspan, function (columnIndex) { + var colIndex = index + columnIndex; + columnsGroup[colIndex] = columnext(column.element, colspan, colIndex); + }); + index += colspan; + }); + return columnsGroup; + }; + var generate = function (list) { + var access = {}; + var cells = []; + var columns = {}; + var maxRows = 0; + var maxColumns = 0; + var rowCount = 0; + each(list, function (rowData) { + if (rowData.section === 'colgroup') { + columns = generateColumns(rowData); + } else { + var currentRow_1 = []; + each(rowData.cells, function (rowCell) { + var start = 0; + while (access[key(rowCount, start)] !== undefined) { + start++; + } + var current = extended(rowCell.element, rowCell.rowspan, rowCell.colspan, rowCount, start); + for (var occupiedColumnPosition = 0; occupiedColumnPosition < rowCell.colspan; occupiedColumnPosition++) { + for (var occupiedRowPosition = 0; occupiedRowPosition < rowCell.rowspan; occupiedRowPosition++) { + var rowPosition = rowCount + occupiedRowPosition; + var columnPosition = start + occupiedColumnPosition; + var newpos = key(rowPosition, columnPosition); + access[newpos] = current; + maxColumns = Math.max(maxColumns, columnPosition + 1); + } + } + currentRow_1.push(current); + }); + maxRows++; + cells.push(rowdata(rowData.element, currentRow_1, rowData.section)); + rowCount++; + } + }); + var grid$1 = grid(maxRows, maxColumns); + return { + grid: grid$1, + access: access, + all: cells, + columns: columns + }; + }; + var fromTable$1 = function (table) { + var list = fromTable(table); + return generate(list); + }; + var justCells = function (warehouse) { + return bind(warehouse.all, function (w) { + return w.cells; + }); + }; + var justColumns = function (warehouse) { + return values(warehouse.columns); + }; + var hasColumns = function (warehouse) { + return keys(warehouse.columns).length > 0; + }; + var getColumnAt = function (warehouse, columnIndex) { + return Optional.from(warehouse.columns[columnIndex]); + }; + var Warehouse = { + fromTable: fromTable$1, + generate: generate, + getAt: getAt, + findItem: findItem, + filterItems: filterItems, + justCells: justCells, + justColumns: justColumns, + hasColumns: hasColumns, + getColumnAt: getColumnAt + }; + + var inSelection = function (bounds, detail) { + var leftEdge = detail.column; + var rightEdge = detail.column + detail.colspan - 1; + var topEdge = detail.row; + var bottomEdge = detail.row + detail.rowspan - 1; + return leftEdge <= bounds.finishCol && rightEdge >= bounds.startCol && (topEdge <= bounds.finishRow && bottomEdge >= bounds.startRow); + }; + var isWithin = function (bounds, detail) { + return detail.column >= bounds.startCol && detail.column + detail.colspan - 1 <= bounds.finishCol && detail.row >= bounds.startRow && detail.row + detail.rowspan - 1 <= bounds.finishRow; + }; + var isRectangular = function (warehouse, bounds) { + var isRect = true; + var detailIsWithin = curry(isWithin, bounds); + for (var i = bounds.startRow; i <= bounds.finishRow; i++) { + for (var j = bounds.startCol; j <= bounds.finishCol; j++) { + isRect = isRect && Warehouse.getAt(warehouse, i, j).exists(detailIsWithin); + } + } + return isRect ? Optional.some(bounds) : Optional.none(); + }; + + var getBounds = function (detailA, detailB) { + return bounds(Math.min(detailA.row, detailB.row), Math.min(detailA.column, detailB.column), Math.max(detailA.row + detailA.rowspan - 1, detailB.row + detailB.rowspan - 1), Math.max(detailA.column + detailA.colspan - 1, detailB.column + detailB.colspan - 1)); + }; + var getAnyBox = function (warehouse, startCell, finishCell) { + var startCoords = Warehouse.findItem(warehouse, startCell, eq); + var finishCoords = Warehouse.findItem(warehouse, finishCell, eq); + return startCoords.bind(function (sc) { + return finishCoords.map(function (fc) { + return getBounds(sc, fc); + }); + }); + }; + var getBox = function (warehouse, startCell, finishCell) { + return getAnyBox(warehouse, startCell, finishCell).bind(function (bounds) { + return isRectangular(warehouse, bounds); + }); + }; + + var moveBy = function (warehouse, cell, row, column) { + return Warehouse.findItem(warehouse, cell, eq).bind(function (detail) { + var startRow = row > 0 ? detail.row + detail.rowspan - 1 : detail.row; + var startCol = column > 0 ? detail.column + detail.colspan - 1 : detail.column; + var dest = Warehouse.getAt(warehouse, startRow + row, startCol + column); + return dest.map(function (d) { + return d.element; + }); + }); + }; + var intercepts = function (warehouse, start, finish) { + return getAnyBox(warehouse, start, finish).map(function (bounds) { + var inside = Warehouse.filterItems(warehouse, curry(inSelection, bounds)); + return map(inside, function (detail) { + return detail.element; + }); + }); + }; + var parentCell = function (warehouse, innerCell) { + var isContainedBy = function (c1, c2) { + return contains$2(c2, c1); + }; + return Warehouse.findItem(warehouse, innerCell, isContainedBy).map(function (detail) { + return detail.element; + }); + }; + + var moveBy$1 = function (cell, deltaRow, deltaColumn) { + return table(cell).bind(function (table) { + var warehouse = getWarehouse(table); + return moveBy(warehouse, cell, deltaRow, deltaColumn); + }); + }; + var intercepts$1 = function (table, first, last) { + var warehouse = getWarehouse(table); + return intercepts(warehouse, first, last); + }; + var nestedIntercepts = function (table, first, firstTable, last, lastTable) { + var warehouse = getWarehouse(table); + var optStartCell = eq(table, firstTable) ? Optional.some(first) : parentCell(warehouse, first); + var optLastCell = eq(table, lastTable) ? Optional.some(last) : parentCell(warehouse, last); + return optStartCell.bind(function (startCell) { + return optLastCell.bind(function (lastCell) { + return intercepts(warehouse, startCell, lastCell); + }); + }); + }; + var getBox$1 = function (table, first, last) { + var warehouse = getWarehouse(table); + return getBox(warehouse, first, last); + }; + var getWarehouse = Warehouse.fromTable; + + var before = function (marker, element) { + var parent$1 = parent(marker); + parent$1.each(function (v) { + v.dom.insertBefore(element.dom, marker.dom); + }); + }; + var after = function (marker, element) { + var sibling = nextSibling(marker); + sibling.fold(function () { + var parent$1 = parent(marker); + parent$1.each(function (v) { + append(v, element); + }); + }, function (v) { + before(v, element); + }); + }; + var prepend = function (parent, element) { + var firstChild$1 = firstChild(parent); + firstChild$1.fold(function () { + append(parent, element); + }, function (v) { + parent.dom.insertBefore(element.dom, v.dom); + }); + }; + var append = function (parent, element) { + parent.dom.appendChild(element.dom); + }; + var wrap = function (element, wrapper) { + before(element, wrapper); + append(wrapper, element); + }; + + var before$1 = function (marker, elements) { + each(elements, function (x) { + before(marker, x); + }); + }; + var after$1 = function (marker, elements) { + each(elements, function (x, i) { + var e = i === 0 ? marker : elements[i - 1]; + after(e, x); + }); + }; + var append$1 = function (parent, elements) { + each(elements, function (x) { + append(parent, x); + }); + }; + + var empty = function (element) { + element.dom.textContent = ''; + each(children(element), function (rogue) { + remove$2(rogue); + }); + }; + var remove$2 = function (element) { + var dom = element.dom; + if (dom.parentNode !== null) { + dom.parentNode.removeChild(dom); + } + }; + var unwrap = function (wrapper) { + var children$1 = children(wrapper); + if (children$1.length > 0) { + before$1(wrapper, children$1); + } + remove$2(wrapper); + }; + + function NodeValue (is, name) { + var get = function (element) { + if (!is(element)) { + throw new Error('Can only get ' + name + ' value of a ' + name + ' node'); + } + return getOption(element).getOr(''); + }; + var getOption = function (element) { + return is(element) ? Optional.from(element.dom.nodeValue) : Optional.none(); + }; + var set = function (element, value) { + if (!is(element)) { + throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node'); + } + element.dom.nodeValue = value; + }; + return { + get: get, + getOption: getOption, + set: set + }; + } + + var api = NodeValue(isText, 'text'); + var get$3 = function (element) { + return api.get(element); + }; + var getOption = function (element) { + return api.getOption(element); + }; + var set$2 = function (element, value) { + return api.set(element, value); + }; + + var TagBoundaries = [ + 'body', + 'p', + 'div', + 'article', + 'aside', + 'figcaption', + 'figure', + 'footer', + 'header', + 'nav', + 'section', + 'ol', + 'ul', + 'li', + 'table', + 'thead', + 'tbody', + 'tfoot', + 'caption', + 'tr', + 'td', + 'th', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'blockquote', + 'pre', + 'address' + ]; + + function DomUniverse () { + var clone$1 = function (element) { + return SugarElement.fromDom(element.dom.cloneNode(false)); + }; + var document = function (element) { + return documentOrOwner(element).dom; + }; + var isBoundary = function (element) { + if (!isElement(element)) { + return false; + } + if (name(element) === 'body') { + return true; + } + return contains(TagBoundaries, name(element)); + }; + var isEmptyTag = function (element) { + if (!isElement(element)) { + return false; + } + return contains([ + 'br', + 'img', + 'hr', + 'input' + ], name(element)); + }; + var isNonEditable = function (element) { + return isElement(element) && get$1(element, 'contenteditable') === 'false'; + }; + var comparePosition = function (element, other) { + return element.dom.compareDocumentPosition(other.dom); + }; + var copyAttributesTo = function (source, destination) { + var as = clone(source); + setAll(destination, as); + }; + return { + up: constant({ + selector: ancestor$1, + closest: closest$1, + predicate: ancestor, + all: parents + }), + down: constant({ + selector: descendants$1, + predicate: descendants + }), + styles: constant({ + get: get$2, + getRaw: getRaw, + set: set$1, + remove: remove$1 + }), + attrs: constant({ + get: get$1, + set: set, + remove: remove, + copyTo: copyAttributesTo + }), + insert: constant({ + before: before, + after: after, + afterAll: after$1, + append: append, + appendAll: append$1, + prepend: prepend, + wrap: wrap + }), + remove: constant({ + unwrap: unwrap, + remove: remove$2 + }), + create: constant({ + nu: SugarElement.fromTag, + clone: clone$1, + text: SugarElement.fromText + }), + query: constant({ + comparePosition: comparePosition, + prevSibling: prevSibling, + nextSibling: nextSibling + }), + property: constant({ + children: children, + name: name, + parent: parent, + document: document, + isText: isText, + isComment: isComment, + isElement: isElement, + getText: get$3, + setText: set$2, + isBoundary: isBoundary, + isEmptyTag: isEmptyTag, + isNonEditable: isNonEditable + }), + eq: eq, + is: is$1 + }; + } + + var all$1 = function (universe, look, elements, f) { + var head = elements[0]; + var tail = elements.slice(1); + return f(universe, look, head, tail); + }; + var oneAll = function (universe, look, elements) { + return elements.length > 0 ? all$1(universe, look, elements, unsafeOne) : Optional.none(); + }; + var unsafeOne = function (universe, look, head, tail) { + var start = look(universe, head); + return foldr(tail, function (b, a) { + var current = look(universe, a); + return commonElement(universe, b, current); + }, start); + }; + var commonElement = function (universe, start, end) { + return start.bind(function (s) { + return end.filter(curry(universe.eq, s)); + }); + }; + + var eq$1 = function (universe, item) { + return curry(universe.eq, item); + }; + var ancestors$2 = function (universe, start, end, isRoot) { + if (isRoot === void 0) { + isRoot = never; + } + var ps1 = [start].concat(universe.up().all(start)); + var ps2 = [end].concat(universe.up().all(end)); + var prune = function (path) { + var index = findIndex(path, isRoot); + return index.fold(function () { + return path; + }, function (ind) { + return path.slice(0, ind + 1); + }); + }; + var pruned1 = prune(ps1); + var pruned2 = prune(ps2); + var shared = find(pruned1, function (x) { + return exists(pruned2, eq$1(universe, x)); + }); + return { + firstpath: pruned1, + secondpath: pruned2, + shared: shared + }; + }; + + var sharedOne = oneAll; + var ancestors$3 = ancestors$2; + + var universe = DomUniverse(); + var sharedOne$1 = function (look, elements) { + return sharedOne(universe, function (_universe, element) { + return look(element); + }, elements); + }; + var ancestors$4 = function (start, finish, isRoot) { + return ancestors$3(universe, start, finish, isRoot); + }; + + var lookupTable = function (container) { + return ancestor$1(container, 'table'); + }; + var identify = function (start, finish, isRoot) { + var getIsRoot = function (rootTable) { + return function (element) { + return isRoot !== undefined && isRoot(element) || eq(element, rootTable); + }; + }; + if (eq(start, finish)) { + return Optional.some({ + boxes: Optional.some([start]), + start: start, + finish: finish + }); + } else { + return lookupTable(start).bind(function (startTable) { + return lookupTable(finish).bind(function (finishTable) { + if (eq(startTable, finishTable)) { + return Optional.some({ + boxes: intercepts$1(startTable, start, finish), + start: start, + finish: finish + }); + } else if (contains$2(startTable, finishTable)) { + var ancestorCells = ancestors$1(finish, 'td,th', getIsRoot(startTable)); + var finishCell = ancestorCells.length > 0 ? ancestorCells[ancestorCells.length - 1] : finish; + return Optional.some({ + boxes: nestedIntercepts(startTable, start, startTable, finish, finishTable), + start: start, + finish: finishCell + }); + } else if (contains$2(finishTable, startTable)) { + var ancestorCells = ancestors$1(start, 'td,th', getIsRoot(finishTable)); + var startCell = ancestorCells.length > 0 ? ancestorCells[ancestorCells.length - 1] : start; + return Optional.some({ + boxes: nestedIntercepts(finishTable, start, startTable, finish, finishTable), + start: start, + finish: startCell + }); + } else { + return ancestors$4(start, finish).shared.bind(function (lca) { + return closest$1(lca, 'table', isRoot).bind(function (lcaTable) { + var finishAncestorCells = ancestors$1(finish, 'td,th', getIsRoot(lcaTable)); + var finishCell = finishAncestorCells.length > 0 ? finishAncestorCells[finishAncestorCells.length - 1] : finish; + var startAncestorCells = ancestors$1(start, 'td,th', getIsRoot(lcaTable)); + var startCell = startAncestorCells.length > 0 ? startAncestorCells[startAncestorCells.length - 1] : start; + return Optional.some({ + boxes: nestedIntercepts(lcaTable, start, startTable, finish, finishTable), + start: startCell, + finish: finishCell + }); + }); + }); + } + }); + }); + } + }; + var retrieve = function (container, selector) { + var sels = descendants$1(container, selector); + return sels.length > 0 ? Optional.some(sels) : Optional.none(); + }; + var getLast = function (boxes, lastSelectedSelector) { + return find(boxes, function (box) { + return is(box, lastSelectedSelector); + }); + }; + var getEdges = function (container, firstSelectedSelector, lastSelectedSelector) { + return descendant$1(container, firstSelectedSelector).bind(function (first) { + return descendant$1(container, lastSelectedSelector).bind(function (last) { + return sharedOne$1(lookupTable, [ + first, + last + ]).map(function (table) { + return { + first: first, + last: last, + table: table + }; + }); + }); + }); + }; + var expandTo = function (finish, firstSelectedSelector) { + return ancestor$1(finish, 'table').bind(function (table) { + return descendant$1(table, firstSelectedSelector).bind(function (start) { + return identify(start, finish).bind(function (identified) { + return identified.boxes.map(function (boxes) { + return { + boxes: boxes, + start: identified.start, + finish: identified.finish + }; + }); + }); + }); + }); + }; + var shiftSelection = function (boxes, deltaRow, deltaColumn, firstSelectedSelector, lastSelectedSelector) { + return getLast(boxes, lastSelectedSelector).bind(function (last) { + return moveBy$1(last, deltaRow, deltaColumn).bind(function (finish) { + return expandTo(finish, firstSelectedSelector); + }); + }); + }; + + var retrieve$1 = function (container, selector) { + return retrieve(container, selector); + }; + var retrieveBox = function (container, firstSelectedSelector, lastSelectedSelector) { + return getEdges(container, firstSelectedSelector, lastSelectedSelector).bind(function (edges) { + var isRoot = function (ancestor) { + return eq(container, ancestor); + }; + var sectionSelector = 'thead,tfoot,tbody,table'; + var firstAncestor = ancestor$1(edges.first, sectionSelector, isRoot); + var lastAncestor = ancestor$1(edges.last, sectionSelector, isRoot); + return firstAncestor.bind(function (fA) { + return lastAncestor.bind(function (lA) { + return eq(fA, lA) ? getBox$1(edges.table, edges.first, edges.last) : Optional.none(); + }); + }); + }); + }; + + var generate$1 = function (cases) { + if (!isArray(cases)) { + throw new Error('cases must be an array'); + } + if (cases.length === 0) { + throw new Error('there must be at least one case'); + } + var constructors = []; + var adt = {}; + each(cases, function (acase, count) { + var keys$1 = keys(acase); + if (keys$1.length !== 1) { + throw new Error('one and only one name per case'); + } + var key = keys$1[0]; + var value = acase[key]; + if (adt[key] !== undefined) { + throw new Error('duplicate key detected:' + key); + } else if (key === 'cata') { + throw new Error('cannot have a case named cata (sorry)'); + } else if (!isArray(value)) { + throw new Error('case arguments must be an array'); + } + constructors.push(key); + adt[key] = function () { + var argLength = arguments.length; + if (argLength !== value.length) { + throw new Error('Wrong number of arguments to case ' + key + '. Expected ' + value.length + ' (' + value + '), got ' + argLength); + } + var args = new Array(argLength); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + var match = function (branches) { + var branchKeys = keys(branches); + if (constructors.length !== branchKeys.length) { + throw new Error('Wrong number of arguments to match. Expected: ' + constructors.join(',') + '\nActual: ' + branchKeys.join(',')); + } + var allReqd = forall(constructors, function (reqKey) { + return contains(branchKeys, reqKey); + }); + if (!allReqd) { + throw new Error('Not all branches were specified when using match. Specified: ' + branchKeys.join(', ') + '\nRequired: ' + constructors.join(', ')); + } + return branches[key].apply(null, args); + }; + return { + fold: function () { + if (arguments.length !== cases.length) { + throw new Error('Wrong number of arguments to fold. Expected ' + cases.length + ', got ' + arguments.length); + } + var target = arguments[count]; + return target.apply(null, args); + }, + match: match, + log: function (label) { + console.log(label, { + constructors: constructors, + constructor: key, + params: args + }); + } + }; + }; + }); + return adt; + }; + var Adt = { generate: generate$1 }; + + var type$1 = Adt.generate([ + { none: [] }, + { multiple: ['elements'] }, + { single: ['element'] } + ]); + var cata = function (subject, onNone, onMultiple, onSingle) { + return subject.fold(onNone, onMultiple, onSingle); + }; + var none$1 = type$1.none; + var multiple = type$1.multiple; + var single = type$1.single; + + var Selections = function (lazyRoot, getStart, selectedSelector) { + var get = function () { + return retrieve$1(lazyRoot(), selectedSelector).fold(function () { + return getStart().map(single).getOrThunk(none$1); + }, function (cells) { + return multiple(cells); + }); + }; + return { get: get }; + }; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var statsStruct = function (minRow, minCol, maxRow, maxCol) { + return { + minRow: minRow, + minCol: minCol, + maxRow: maxRow, + maxCol: maxCol + }; + }; + var findSelectedStats = function (house, isSelected) { + var totalColumns = house.grid.columns; + var totalRows = house.grid.rows; + var minRow = totalRows; + var minCol = totalColumns; + var maxRow = 0; + var maxCol = 0; + each$1(house.access, function (detail) { + if (isSelected(detail)) { + var startRow = detail.row; + var endRow = startRow + detail.rowspan - 1; + var startCol = detail.column; + var endCol = startCol + detail.colspan - 1; + if (startRow < minRow) { + minRow = startRow; + } else if (endRow > maxRow) { + maxRow = endRow; + } + if (startCol < minCol) { + minCol = startCol; + } else if (endCol > maxCol) { + maxCol = endCol; + } + } + }); + return statsStruct(minRow, minCol, maxRow, maxCol); + }; + var makeCell = function (list, seenSelected, rowIndex) { + var row = list[rowIndex].element; + var td = SugarElement.fromTag('td'); + append(td, SugarElement.fromTag('br')); + var f = seenSelected ? append : prepend; + f(row, td); + }; + var fillInGaps = function (list, house, stats, isSelected) { + var totalColumns = house.grid.columns; + var totalRows = house.grid.rows; + for (var i = 0; i < totalRows; i++) { + var seenSelected = false; + for (var j = 0; j < totalColumns; j++) { + if (!(i < stats.minRow || i > stats.maxRow || j < stats.minCol || j > stats.maxCol)) { + var needCell = Warehouse.getAt(house, i, j).filter(isSelected).isNone(); + if (needCell) { + makeCell(list, seenSelected, i); + } else { + seenSelected = true; + } + } + } + } + }; + var clean = function (table, stats) { + var emptyRows = filter(firstLayer(table, 'tr'), function (row) { + return row.dom.childElementCount === 0; + }); + each(emptyRows, remove$2); + if (stats.minCol === stats.maxCol || stats.minRow === stats.maxRow) { + each(firstLayer(table, 'th,td'), function (cell) { + remove(cell, 'rowspan'); + remove(cell, 'colspan'); + }); + } + remove(table, 'width'); + remove(table, 'height'); + remove$1(table, 'width'); + remove$1(table, 'height'); + }; + var extract = function (table, selectedSelector) { + var isSelected = function (detail) { + return is(detail.element, selectedSelector); + }; + var list = fromTable(table); + var house = Warehouse.generate(list); + var stats = findSelectedStats(house, isSelected); + var selector = 'th:not(' + selectedSelector + ')' + ',td:not(' + selectedSelector + ')'; + var unselectedCells = filterFirstLayer(table, 'th,td', function (cell) { + return is(cell, selector); + }); + each(unselectedCells, remove$2); + fillInGaps(list, house, stats, isSelected); + clean(table, stats); + return table; + }; + + var nbsp = '\xA0'; + + var getEnd = function (element) { + return name(element) === 'img' ? 1 : getOption(element).fold(function () { + return children(element).length; + }, function (v) { + return v.length; + }); + }; + var isTextNodeWithCursorPosition = function (el) { + return getOption(el).filter(function (text) { + return text.trim().length !== 0 || text.indexOf(nbsp) > -1; + }).isSome(); + }; + var elementsWithCursorPosition = [ + 'img', + 'br' + ]; + var isCursorPosition = function (elem) { + var hasCursorPosition = isTextNodeWithCursorPosition(elem); + return hasCursorPosition || contains(elementsWithCursorPosition, name(elem)); + }; + + var first = function (element) { + return descendant(element, isCursorPosition); + }; + var last$1 = function (element) { + return descendantRtl(element, isCursorPosition); + }; + var descendantRtl = function (scope, predicate) { + var descend = function (element) { + var children$1 = children(element); + for (var i = children$1.length - 1; i >= 0; i--) { + var child = children$1[i]; + if (predicate(child)) { + return Optional.some(child); + } + var res = descend(child); + if (res.isSome()) { + return res; + } + } + return Optional.none(); + }; + return descend(scope); + }; + + var clone$1 = function (original, isDeep) { + return SugarElement.fromDom(original.dom.cloneNode(isDeep)); + }; + var shallow = function (original) { + return clone$1(original, false); + }; + var deep = function (original) { + return clone$1(original, true); + }; + var shallowAs = function (original, tag) { + var nu = SugarElement.fromTag(tag); + var attributes = clone(original); + setAll(nu, attributes); + return nu; + }; + var copy$1 = function (original, tag) { + var nu = shallowAs(original, tag); + var cloneChildren = children(deep(original)); + append$1(nu, cloneChildren); + return nu; + }; + + var createCell = function () { + var td = SugarElement.fromTag('td'); + append(td, SugarElement.fromTag('br')); + return td; + }; + var createCol = function () { + return SugarElement.fromTag('col'); + }; + var createColgroup = function () { + return SugarElement.fromTag('colgroup'); + }; + var replace = function (cell, tag, attrs) { + var replica = copy$1(cell, tag); + each$1(attrs, function (v, k) { + if (v === null) { + remove(replica, k); + } else { + set(replica, k, v); + } + }); + return replica; + }; + var pasteReplace = function (cell) { + return cell; + }; + var newRow = function (doc) { + return function () { + return SugarElement.fromTag('tr', doc.dom); + }; + }; + var cloneFormats = function (oldCell, newCell, formats) { + var first$1 = first(oldCell); + return first$1.map(function (firstText) { + var formatSelector = formats.join(','); + var parents = ancestors$1(firstText, formatSelector, function (element) { + return eq(element, oldCell); + }); + return foldr(parents, function (last, parent) { + var clonedFormat = shallow(parent); + remove(clonedFormat, 'contenteditable'); + append(last, clonedFormat); + return clonedFormat; + }, newCell); + }).getOr(newCell); + }; + var cellOperations = function (mutate, doc, formatsToClone) { + var cloneCss = function (prev, clone) { + copy(prev.element, clone); + remove$1(clone, 'height'); + if (prev.colspan !== 1) { + remove$1(prev.element, 'width'); + } + }; + var newCell = function (prev) { + var docu = owner(prev.element); + var td = SugarElement.fromTag(name(prev.element), docu.dom); + var formats = formatsToClone.getOr([ + 'strong', + 'em', + 'b', + 'i', + 'span', + 'font', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'p', + 'div' + ]); + var lastNode = formats.length > 0 ? cloneFormats(prev.element, td, formats) : td; + append(lastNode, SugarElement.fromTag('br')); + cloneCss(prev, td); + mutate(prev.element, td); + return td; + }; + var newCol = function (prev) { + var doc = owner(prev.element); + var col = SugarElement.fromTag(name(prev.element), doc.dom); + cloneCss(prev, col); + mutate(prev.element, col); + return col; + }; + return { + col: newCol, + colgroup: createColgroup, + row: newRow(doc), + cell: newCell, + replace: replace, + gap: createCell + }; + }; + var paste = function (doc) { + return { + col: createCol, + colgroup: createColgroup, + row: newRow(doc), + cell: createCell, + replace: pasteReplace, + gap: createCell + }; + }; + + var fromHtml$1 = function (html, scope) { + var doc = scope || document; + var div = doc.createElement('div'); + div.innerHTML = html; + return children(SugarElement.fromDom(div)); + }; + var fromDom$1 = function (nodes) { + return map(nodes, SugarElement.fromDom); + }; + + var selection = function (selections) { + return cata(selections.get(), constant([]), identity, pure); + }; + var unmergable = function (selections) { + var hasSpan = function (elem, type) { + return getOpt(elem, type).exists(function (span) { + return parseInt(span, 10) > 1; + }); + }; + var hasRowOrColSpan = function (elem) { + return hasSpan(elem, 'rowspan') || hasSpan(elem, 'colspan'); + }; + var candidates = selection(selections); + return candidates.length > 0 && forall(candidates, hasRowOrColSpan) ? Optional.some(candidates) : Optional.none(); + }; + var mergable = function (table, selections, ephemera) { + return cata(selections.get(), Optional.none, function (cells) { + if (cells.length <= 1) { + return Optional.none(); + } else { + return retrieveBox(table, ephemera.firstSelectedSelector, ephemera.lastSelectedSelector).map(function (bounds) { + return { + bounds: bounds, + cells: cells + }; + }); + } + }, Optional.none); + }; + + var strSelected = 'data-mce-selected'; + var strSelectedSelector = 'td[' + strSelected + '],th[' + strSelected + ']'; + var strAttributeSelector = '[' + strSelected + ']'; + var strFirstSelected = 'data-mce-first-selected'; + var strFirstSelectedSelector = 'td[' + strFirstSelected + '],th[' + strFirstSelected + ']'; + var strLastSelected = 'data-mce-last-selected'; + var strLastSelectedSelector = 'td[' + strLastSelected + '],th[' + strLastSelected + ']'; + var attributeSelector = strAttributeSelector; + var ephemera = { + selected: strSelected, + selectedSelector: strSelectedSelector, + firstSelected: strFirstSelected, + firstSelectedSelector: strFirstSelectedSelector, + lastSelected: strLastSelected, + lastSelectedSelector: strLastSelectedSelector + }; + + var noMenu = function (cell) { + return { + element: cell, + mergable: Optional.none(), + unmergable: Optional.none(), + selection: [cell] + }; + }; + var forMenu = function (selections, table, cell) { + return { + element: cell, + mergable: mergable(table, selections, ephemera), + unmergable: unmergable(selections), + selection: selection(selections) + }; + }; + var paste$1 = function (element, clipboard, generators) { + return { + element: element, + clipboard: clipboard, + generators: generators + }; + }; + var pasteRows = function (selections, cell, clipboard, generators) { + return { + selection: selection(selections), + clipboard: clipboard, + generators: generators + }; + }; + + var extractSelected = function (cells) { + return table(cells[0]).map(deep).map(function (replica) { + return [extract(replica, attributeSelector)]; + }); + }; + var serializeElements = function (editor, elements) { + return map(elements, function (elm) { + return editor.selection.serializer.serialize(elm.dom, {}); + }).join(''); + }; + var getTextContent = function (elements) { + return map(elements, function (element) { + return element.dom.innerText; + }).join(''); + }; + var registerEvents = function (editor, selections, actions, cellSelection) { + editor.on('BeforeGetContent', function (e) { + var multiCellContext = function (cells) { + e.preventDefault(); + extractSelected(cells).each(function (elements) { + e.content = e.format === 'text' ? getTextContent(elements) : serializeElements(editor, elements); + }); + }; + if (e.selection === true) { + cata(selections.get(), noop, multiCellContext, noop); + } + }); + editor.on('BeforeSetContent', function (e) { + if (e.selection === true && e.paste === true) { + var cellOpt = Optional.from(editor.dom.getParent(editor.selection.getStart(), 'th,td')); + cellOpt.each(function (domCell) { + var cell = SugarElement.fromDom(domCell); + table(cell).each(function (table) { + var elements = filter(fromHtml$1(e.content), function (content) { + return name(content) !== 'meta'; + }); + var isTable = function (elm) { + return name(elm) === 'table'; + }; + if (elements.length === 1 && isTable(elements[0])) { + e.preventDefault(); + var doc = SugarElement.fromDom(editor.getDoc()); + var generators = paste(doc); + var targets = paste$1(cell, elements[0], generators); + actions.pasteCells(table, targets).each(function (rng) { + editor.selection.setRng(rng); + editor.focus(); + cellSelection.clear(table); + }); + } + }); + }); + } + }); + }; + + var adt = Adt.generate([ + { none: [] }, + { only: ['index'] }, + { + left: [ + 'index', + 'next' + ] + }, + { + middle: [ + 'prev', + 'index', + 'next' + ] + }, + { + right: [ + 'prev', + 'index' + ] + } + ]); + var ColumnContext = __assign({}, adt); + + var neighbours = function (input, index) { + if (input.length === 0) { + return ColumnContext.none(); + } + if (input.length === 1) { + return ColumnContext.only(0); + } + if (index === 0) { + return ColumnContext.left(0, 1); + } + if (index === input.length - 1) { + return ColumnContext.right(index - 1, index); + } + if (index > 0 && index < input.length - 1) { + return ColumnContext.middle(index - 1, index, index + 1); + } + return ColumnContext.none(); + }; + var determine = function (input, column, step, tableSize, resize) { + var result = input.slice(0); + var context = neighbours(input, column); + var onNone = constant(map(result, constant(0))); + var onOnly = function (index) { + return tableSize.singleColumnWidth(result[index], step); + }; + var onLeft = function (index, next) { + return resize.calcLeftEdgeDeltas(result, index, next, step, tableSize.minCellWidth(), tableSize.isRelative); + }; + var onMiddle = function (prev, index, next) { + return resize.calcMiddleDeltas(result, prev, index, next, step, tableSize.minCellWidth(), tableSize.isRelative); + }; + var onRight = function (prev, index) { + return resize.calcRightEdgeDeltas(result, prev, index, step, tableSize.minCellWidth(), tableSize.isRelative); + }; + return context.fold(onNone, onOnly, onLeft, onMiddle, onRight); + }; + + var columns$1 = function (warehouse) { + var grid = warehouse.grid; + var cols = range(grid.columns, identity); + var rowsArr = range(grid.rows, identity); + return map(cols, function (col) { + var getBlock = function () { + return bind(rowsArr, function (r) { + return Warehouse.getAt(warehouse, r, col).filter(function (detail) { + return detail.column === col; + }).toArray(); + }); + }; + var isSingle = function (detail) { + return detail.colspan === 1; + }; + var getFallback = function () { + return Warehouse.getAt(warehouse, 0, col); + }; + return decide(getBlock, isSingle, getFallback); + }); + }; + var decide = function (getBlock, isSingle, getFallback) { + var inBlock = getBlock(); + var singleInBlock = find(inBlock, isSingle); + var detailOption = singleInBlock.orThunk(function () { + return Optional.from(inBlock[0]).orThunk(getFallback); + }); + return detailOption.map(function (detail) { + return detail.element; + }); + }; + var rows$1 = function (warehouse) { + var grid = warehouse.grid; + var rowsArr = range(grid.rows, identity); + var cols = range(grid.columns, identity); + return map(rowsArr, function (row) { + var getBlock = function () { + return bind(cols, function (c) { + return Warehouse.getAt(warehouse, row, c).filter(function (detail) { + return detail.row === row; + }).fold(constant([]), function (detail) { + return [detail]; + }); + }); + }; + var isSingle = function (detail) { + return detail.rowspan === 1; + }; + var getFallback = function () { + return Warehouse.getAt(warehouse, row, 0); + }; + return decide(getBlock, isSingle, getFallback); + }); + }; + + var deduce = function (xs, index) { + if (index < 0 || index >= xs.length - 1) { + return Optional.none(); + } + var current = xs[index].fold(function () { + var rest = reverse(xs.slice(0, index)); + return findMap(rest, function (a, i) { + return a.map(function (aa) { + return { + value: aa, + delta: i + 1 + }; + }); + }); + }, function (c) { + return Optional.some({ + value: c, + delta: 0 + }); + }); + var next = xs[index + 1].fold(function () { + var rest = xs.slice(index + 1); + return findMap(rest, function (a, i) { + return a.map(function (aa) { + return { + value: aa, + delta: i + 1 + }; + }); + }); + }, function (n) { + return Optional.some({ + value: n, + delta: 1 + }); + }); + return current.bind(function (c) { + return next.map(function (n) { + var extras = n.delta + c.delta; + return Math.abs(n.value - c.value) / extras; + }); + }); + }; + + var onDirection = function (isLtr, isRtl) { + return function (element) { + return getDirection(element) === 'rtl' ? isRtl : isLtr; + }; + }; + var getDirection = function (element) { + return get$2(element, 'direction') === 'rtl' ? 'rtl' : 'ltr'; + }; + + function Dimension (name, getOffset) { + var set = function (element, h) { + if (!isNumber(h) && !h.match(/^[0-9]+$/)) { + throw new Error(name + '.set accepts only positive integer values. Value was ' + h); + } + var dom = element.dom; + if (isSupported$1(dom)) { + dom.style[name] = h + 'px'; + } + }; + var get = function (element) { + var r = getOffset(element); + if (r <= 0 || r === null) { + var css = get$2(element, name); + return parseFloat(css) || 0; + } + return r; + }; + var getOuter = get; + var aggregate = function (element, properties) { + return foldl(properties, function (acc, property) { + var val = get$2(element, property); + var value = val === undefined ? 0 : parseInt(val, 10); + return isNaN(value) ? acc : acc + value; + }, 0); + }; + var max = function (element, value, properties) { + var cumulativeInclusions = aggregate(element, properties); + var absoluteMax = value > cumulativeInclusions ? value - cumulativeInclusions : 0; + return absoluteMax; + }; + return { + set: set, + get: get, + getOuter: getOuter, + aggregate: aggregate, + max: max + }; + } + + var api$1 = Dimension('height', function (element) { + var dom = element.dom; + return inBody(element) ? dom.getBoundingClientRect().height : dom.offsetHeight; + }); + var get$4 = function (element) { + return api$1.get(element); + }; + var getOuter = function (element) { + return api$1.getOuter(element); + }; + + var r = function (left, top) { + var translate = function (x, y) { + return r(left + x, top + y); + }; + return { + left: left, + top: top, + translate: translate + }; + }; + var SugarPosition = r; + + var boxPosition = function (dom) { + var box = dom.getBoundingClientRect(); + return SugarPosition(box.left, box.top); + }; + var firstDefinedOrZero = function (a, b) { + if (a !== undefined) { + return a; + } else { + return b !== undefined ? b : 0; + } + }; + var absolute = function (element) { + var doc = element.dom.ownerDocument; + var body = doc.body; + var win = doc.defaultView; + var html = doc.documentElement; + if (body === element.dom) { + return SugarPosition(body.offsetLeft, body.offsetTop); + } + var scrollTop = firstDefinedOrZero(win === null || win === void 0 ? void 0 : win.pageYOffset, html.scrollTop); + var scrollLeft = firstDefinedOrZero(win === null || win === void 0 ? void 0 : win.pageXOffset, html.scrollLeft); + var clientTop = firstDefinedOrZero(html.clientTop, body.clientTop); + var clientLeft = firstDefinedOrZero(html.clientLeft, body.clientLeft); + return viewport(element).translate(scrollLeft - clientLeft, scrollTop - clientTop); + }; + var viewport = function (element) { + var dom = element.dom; + var doc = dom.ownerDocument; + var body = doc.body; + if (body === dom) { + return SugarPosition(body.offsetLeft, body.offsetTop); + } + if (!inBody(element)) { + return SugarPosition(0, 0); + } + return boxPosition(dom); + }; + + var api$2 = Dimension('width', function (element) { + return element.dom.offsetWidth; + }); + var get$5 = function (element) { + return api$2.get(element); + }; + var getOuter$1 = function (element) { + return api$2.getOuter(element); + }; + + var rowInfo = function (row, y) { + return { + row: row, + y: y + }; + }; + var colInfo = function (col, x) { + return { + col: col, + x: x + }; + }; + var rtlEdge = function (cell) { + var pos = absolute(cell); + return pos.left + getOuter$1(cell); + }; + var ltrEdge = function (cell) { + return absolute(cell).left; + }; + var getLeftEdge = function (index, cell) { + return colInfo(index, ltrEdge(cell)); + }; + var getRightEdge = function (index, cell) { + return colInfo(index, rtlEdge(cell)); + }; + var getTop = function (cell) { + return absolute(cell).top; + }; + var getTopEdge = function (index, cell) { + return rowInfo(index, getTop(cell)); + }; + var getBottomEdge = function (index, cell) { + return rowInfo(index, getTop(cell) + getOuter(cell)); + }; + var findPositions = function (getInnerEdge, getOuterEdge, array) { + if (array.length === 0) { + return []; + } + var lines = map(array.slice(1), function (cellOption, index) { + return cellOption.map(function (cell) { + return getInnerEdge(index, cell); + }); + }); + var lastLine = array[array.length - 1].map(function (cell) { + return getOuterEdge(array.length - 1, cell); + }); + return lines.concat([lastLine]); + }; + var negate = function (step) { + return -step; + }; + var height = { + delta: identity, + positions: function (optElements) { + return findPositions(getTopEdge, getBottomEdge, optElements); + }, + edge: getTop + }; + var ltr = { + delta: identity, + edge: ltrEdge, + positions: function (optElements) { + return findPositions(getLeftEdge, getRightEdge, optElements); + } + }; + var rtl = { + delta: negate, + edge: rtlEdge, + positions: function (optElements) { + return findPositions(getRightEdge, getLeftEdge, optElements); + } + }; + var detect$4 = onDirection(ltr, rtl); + var width = { + delta: function (amount, table) { + return detect$4(table).delta(amount, table); + }, + positions: function (cols, table) { + return detect$4(table).positions(cols, table); + }, + edge: function (cell) { + return detect$4(cell).edge(cell); + } + }; + + var units = { + unsupportedLength: [ + 'em', + 'ex', + 'cap', + 'ch', + 'ic', + 'rem', + 'lh', + 'rlh', + 'vw', + 'vh', + 'vi', + 'vb', + 'vmin', + 'vmax', + 'cm', + 'mm', + 'Q', + 'in', + 'pc', + 'pt', + 'px' + ], + fixed: [ + 'px', + 'pt' + ], + relative: ['%'], + empty: [''] + }; + var pattern = function () { + var decimalDigits = '[0-9]+'; + var signedInteger = '[+-]?' + decimalDigits; + var exponentPart = '[eE]' + signedInteger; + var dot = '\\.'; + var opt = function (input) { + return '(?:' + input + ')?'; + }; + var unsignedDecimalLiteral = [ + 'Infinity', + decimalDigits + dot + opt(decimalDigits) + opt(exponentPart), + dot + decimalDigits + opt(exponentPart), + decimalDigits + opt(exponentPart) + ].join('|'); + var float = '[+-]?(?:' + unsignedDecimalLiteral + ')'; + return new RegExp('^(' + float + ')(.*)$'); + }(); + var isUnit = function (unit, accepted) { + return exists(accepted, function (acc) { + return exists(units[acc], function (check) { + return unit === check; + }); + }); + }; + var parse = function (input, accepted) { + var match = Optional.from(pattern.exec(input)); + return match.bind(function (array) { + var value = Number(array[1]); + var unitRaw = array[2]; + if (isUnit(unitRaw, accepted)) { + return Optional.some({ + value: value, + unit: unitRaw + }); + } else { + return Optional.none(); + } + }); + }; + + var needManualCalc = function () { + var browser = detect$3().browser; + return browser.isIE() || browser.isEdge(); + }; + var toNumber = function (px, fallback) { + var num = parseFloat(px); + return isNaN(num) ? fallback : num; + }; + var getProp = function (elm, name, fallback) { + return toNumber(get$2(elm, name), fallback); + }; + var getCalculatedHeight = function (cell) { + var height = cell.dom.getBoundingClientRect().height; + var boxSizing = get$2(cell, 'box-sizing'); + if (boxSizing === 'border-box') { + return height; + } else { + var paddingTop = getProp(cell, 'padding-top', 0); + var paddingBottom = getProp(cell, 'padding-bottom', 0); + var borderTop = getProp(cell, 'border-top-width', 0); + var borderBottom = getProp(cell, 'border-bottom-width', 0); + var borders = borderTop + borderBottom; + return height - paddingTop - paddingBottom - borders; + } + }; + var getCalculatedWidth = function (cell) { + var width = cell.dom.getBoundingClientRect().width; + var boxSizing = get$2(cell, 'box-sizing'); + if (boxSizing === 'border-box') { + return width; + } else { + var paddingLeft = getProp(cell, 'padding-left', 0); + var paddingRight = getProp(cell, 'padding-right', 0); + var borderLeft = getProp(cell, 'border-left-width', 0); + var borderRight = getProp(cell, 'border-right-width', 0); + var borders = borderLeft + borderRight; + return width - paddingLeft - paddingRight - borders; + } + }; + var getHeight = function (cell) { + return needManualCalc() ? getCalculatedHeight(cell) : getProp(cell, 'height', get$4(cell)); + }; + var getWidth = function (cell) { + return needManualCalc() ? getCalculatedWidth(cell) : getProp(cell, 'width', get$5(cell)); + }; + + var rPercentageBasedSizeRegex = /(\d+(\.\d+)?)%/; + var rPixelBasedSizeRegex = /(\d+(\.\d+)?)px|em/; + var getPercentSize = function (elm, getter) { + var relativeParent = offsetParent(elm).getOr(getBody(owner(elm))); + return getter(elm) / getter(relativeParent) * 100; + }; + var setPixelWidth = function (cell, amount) { + set$1(cell, 'width', amount + 'px'); + }; + var setPercentageWidth = function (cell, amount) { + set$1(cell, 'width', amount + '%'); + }; + var setHeight = function (cell, amount) { + set$1(cell, 'height', amount + 'px'); + }; + var getHeightValue = function (cell) { + return getRaw(cell, 'height').getOrThunk(function () { + return getHeight(cell) + 'px'; + }); + }; + var convert = function (cell, number, getter, setter) { + var newSize = table(cell).map(function (table) { + var total = getter(table); + return Math.floor(number / 100 * total); + }).getOr(number); + setter(cell, newSize); + return newSize; + }; + var normalizePixelSize = function (value, cell, getter, setter) { + var number = parseInt(value, 10); + return endsWith(value, '%') && name(cell) !== 'table' ? convert(cell, number, getter, setter) : number; + }; + var getTotalHeight = function (cell) { + var value = getHeightValue(cell); + if (!value) { + return get$4(cell); + } + return normalizePixelSize(value, cell, get$4, setHeight); + }; + var get$6 = function (cell, type, f) { + var v = f(cell); + var span = getSpan(cell, type); + return v / span; + }; + var getRawWidth = function (element) { + var cssWidth = getRaw(element, 'width'); + return cssWidth.fold(function () { + return Optional.from(get$1(element, 'width')); + }, function (width) { + return Optional.some(width); + }); + }; + var normalizePercentageWidth = function (cellWidth, tableSize) { + return cellWidth / tableSize.pixelWidth() * 100; + }; + var choosePercentageSize = function (element, width, tableSize) { + var percentMatch = rPercentageBasedSizeRegex.exec(width); + if (percentMatch !== null) { + return parseFloat(percentMatch[1]); + } else { + var intWidth = getWidth(element); + return normalizePercentageWidth(intWidth, tableSize); + } + }; + var getPercentageWidth = function (cell, tableSize) { + var width = getRawWidth(cell); + return width.fold(function () { + var intWidth = get$5(cell); + return normalizePercentageWidth(intWidth, tableSize); + }, function (w) { + return choosePercentageSize(cell, w, tableSize); + }); + }; + var normalizePixelWidth = function (cellWidth, tableSize) { + return cellWidth / 100 * tableSize.pixelWidth(); + }; + var choosePixelSize = function (element, width, tableSize) { + var pixelMatch = rPixelBasedSizeRegex.exec(width); + if (pixelMatch !== null) { + return parseInt(pixelMatch[1], 10); + } + var percentMatch = rPercentageBasedSizeRegex.exec(width); + if (percentMatch !== null) { + var floatWidth = parseFloat(percentMatch[1]); + return normalizePixelWidth(floatWidth, tableSize); + } + return getWidth(element); + }; + var getPixelWidth = function (cell, tableSize) { + var width = getRawWidth(cell); + return width.fold(function () { + return getWidth(cell); + }, function (w) { + return choosePixelSize(cell, w, tableSize); + }); + }; + var getHeight$1 = function (cell) { + return get$6(cell, 'rowspan', getTotalHeight); + }; + var getGenericWidth = function (cell) { + var width = getRawWidth(cell); + return width.bind(function (w) { + return parse(w, [ + 'fixed', + 'relative', + 'empty' + ]); + }); + }; + var setGenericWidth = function (cell, amount, unit) { + set$1(cell, 'width', amount + unit); + }; + var getPixelTableWidth = function (table) { + return get$5(table) + 'px'; + }; + var getPercentTableWidth = function (table) { + return getPercentSize(table, get$5) + '%'; + }; + var isPercentSizing = function (table) { + return getRawWidth(table).exists(function (size) { + return rPercentageBasedSizeRegex.test(size); + }); + }; + var isPixelSizing = function (table) { + return getRawWidth(table).exists(function (size) { + return rPixelBasedSizeRegex.test(size); + }); + }; + var isNoneSizing = function (table) { + return getRawWidth(table).isNone(); + }; + var percentageBasedSizeRegex = constant(rPercentageBasedSizeRegex); + var pixelBasedSizeRegex = constant(rPixelBasedSizeRegex); + + var getRaw$1 = function (cell, property, getter) { + return getRaw(cell, property).fold(function () { + return getter(cell) + 'px'; + }, function (raw) { + return raw; + }); + }; + var getRawW = function (cell, tableSize) { + return getRaw$1(cell, 'width', function (e) { + return getPixelWidth(e, tableSize); + }); + }; + var getRawH = function (cell) { + return getRaw$1(cell, 'height', getHeight$1); + }; + var justCols = function (warehouse) { + return map(Warehouse.justColumns(warehouse), function (column) { + return Optional.from(column.element); + }); + }; + var getWidthFrom = function (warehouse, getWidth, fallback, tableSize) { + var columns = Warehouse.hasColumns(warehouse) ? justCols(warehouse) : columns$1(warehouse); + var backups = map(columns, function (cellOption) { + return cellOption.map(width.edge); + }); + return map(columns, function (cellOption, c) { + var columnCell = cellOption.filter(not(hasColspan)); + return columnCell.fold(function () { + var deduced = deduce(backups, c); + return fallback(deduced); + }, function (cell) { + return getWidth(cell, tableSize); + }); + }); + }; + var getDeduced = function (deduced) { + return deduced.map(function (d) { + return d + 'px'; + }).getOr(''); + }; + var getRawWidths = function (warehouse, tableSize) { + return getWidthFrom(warehouse, getRawW, getDeduced, tableSize); + }; + var getPercentageWidths = function (warehouse, tableSize) { + return getWidthFrom(warehouse, getPercentageWidth, function (deduced) { + return deduced.fold(function () { + return tableSize.minCellWidth(); + }, function (cellWidth) { + return cellWidth / tableSize.pixelWidth() * 100; + }); + }, tableSize); + }; + var getPixelWidths = function (warehouse, tableSize) { + return getWidthFrom(warehouse, getPixelWidth, function (deduced) { + return deduced.getOrThunk(tableSize.minCellWidth); + }, tableSize); + }; + var getHeightFrom = function (warehouse, direction, getHeight, fallback) { + var rows = rows$1(warehouse); + var backups = map(rows, function (cellOption) { + return cellOption.map(direction.edge); + }); + return map(rows, function (cellOption, c) { + var rowCell = cellOption.filter(not(hasRowspan)); + return rowCell.fold(function () { + var deduced = deduce(backups, c); + return fallback(deduced); + }, function (cell) { + return getHeight(cell); + }); + }); + }; + var getPixelHeights = function (warehouse, direction) { + return getHeightFrom(warehouse, direction, getHeight$1, function (deduced) { + return deduced.getOrThunk(minHeight); + }); + }; + var getRawHeights = function (warehouse, direction) { + return getHeightFrom(warehouse, direction, getRawH, getDeduced); + }; + + var total = function (start, end, measures) { + var r = 0; + for (var i = start; i < end; i++) { + r += measures[i] !== undefined ? measures[i] : 0; + } + return r; + }; + var recalculateWidthForCells = function (warehouse, widths) { + var all = Warehouse.justCells(warehouse); + return map(all, function (cell) { + var width = total(cell.column, cell.column + cell.colspan, widths); + return { + element: cell.element, + width: width, + colspan: cell.colspan + }; + }); + }; + var recalculateWidthForColumns = function (warehouse, widths) { + var groups = Warehouse.justColumns(warehouse); + return map(groups, function (column, index) { + return { + element: column.element, + width: widths[index], + colspan: column.colspan + }; + }); + }; + var recalculateHeightForCells = function (warehouse, heights) { + var all = Warehouse.justCells(warehouse); + return map(all, function (cell) { + var height = total(cell.row, cell.row + cell.rowspan, heights); + return { + element: cell.element, + height: height, + rowspan: cell.rowspan + }; + }); + }; + var matchRowHeight = function (warehouse, heights) { + return map(warehouse.all, function (row, i) { + return { + element: row.element, + height: heights[i] + }; + }); + }; + + var sumUp = function (newSize) { + return foldr(newSize, function (b, a) { + return b + a; + }, 0); + }; + var recalculate = function (warehouse, widths) { + if (Warehouse.hasColumns(warehouse)) { + return recalculateWidthForColumns(warehouse, widths); + } else { + return recalculateWidthForCells(warehouse, widths); + } + }; + var recalculateAndApply = function (warehouse, widths, tableSize) { + var newSizes = recalculate(warehouse, widths); + each(newSizes, function (cell) { + tableSize.setElementWidth(cell.element, cell.width); + }); + }; + var adjustWidth = function (table, delta, index, resizing, tableSize) { + var warehouse = Warehouse.fromTable(table); + var step = tableSize.getCellDelta(delta); + var widths = tableSize.getWidths(warehouse, tableSize); + var isLastColumn = index === warehouse.grid.columns - 1; + var clampedStep = resizing.clampTableDelta(widths, index, step, tableSize.minCellWidth(), isLastColumn); + var deltas = determine(widths, index, clampedStep, tableSize, resizing); + var newWidths = map(deltas, function (dx, i) { + return dx + widths[i]; + }); + recalculateAndApply(warehouse, newWidths, tableSize); + resizing.resizeTable(tableSize.adjustTableWidth, clampedStep, isLastColumn); + }; + var adjustHeight = function (table, delta, index, direction) { + var warehouse = Warehouse.fromTable(table); + var heights = getPixelHeights(warehouse, direction); + var newHeights = map(heights, function (dy, i) { + return index === i ? Math.max(delta + dy, minHeight()) : dy; + }); + var newCellSizes = recalculateHeightForCells(warehouse, newHeights); + var newRowSizes = matchRowHeight(warehouse, newHeights); + each(newRowSizes, function (row) { + setHeight(row.element, row.height); + }); + each(newCellSizes, function (cell) { + setHeight(cell.element, cell.height); + }); + var total = sumUp(newHeights); + setHeight(table, total); + }; + var adjustWidthTo = function (table, list, tableSize) { + var warehouse = Warehouse.generate(list); + var widths = tableSize.getWidths(warehouse, tableSize); + recalculateAndApply(warehouse, widths, tableSize); + }; + + var zero = function (array) { + return map(array, constant(0)); + }; + var surround = function (sizes, startIndex, endIndex, results, f) { + return f(sizes.slice(0, startIndex)).concat(results).concat(f(sizes.slice(endIndex))); + }; + var clampDeltaHelper = function (predicate) { + return function (sizes, index, delta, minCellSize) { + if (!predicate(delta)) { + return delta; + } else { + var newSize = Math.max(minCellSize, sizes[index] - Math.abs(delta)); + var diff = Math.abs(newSize - sizes[index]); + return delta >= 0 ? diff : -diff; + } + }; + }; + var clampNegativeDelta = clampDeltaHelper(function (delta) { + return delta < 0; + }); + var clampDelta = clampDeltaHelper(always); + var resizeTable = function () { + var calcFixedDeltas = function (sizes, index, next, delta, minCellSize) { + var clampedDelta = clampNegativeDelta(sizes, index, delta, minCellSize); + return surround(sizes, index, next + 1, [ + clampedDelta, + 0 + ], zero); + }; + var calcRelativeDeltas = function (sizes, index, delta, minCellSize) { + var ratio = (100 + delta) / 100; + var newThis = Math.max(minCellSize, (sizes[index] + delta) / ratio); + return map(sizes, function (size, idx) { + var newSize = idx === index ? newThis : size / ratio; + return newSize - size; + }); + }; + var calcLeftEdgeDeltas = function (sizes, index, next, delta, minCellSize, relativeSizing) { + if (relativeSizing) { + return calcRelativeDeltas(sizes, index, delta, minCellSize); + } else { + return calcFixedDeltas(sizes, index, next, delta, minCellSize); + } + }; + var calcMiddleDeltas = function (sizes, _prev, index, next, delta, minCellSize, relativeSizing) { + return calcLeftEdgeDeltas(sizes, index, next, delta, minCellSize, relativeSizing); + }; + var resizeTable = function (resizer, delta) { + return resizer(delta); + }; + var calcRightEdgeDeltas = function (sizes, _prev, index, delta, minCellSize, relativeSizing) { + if (relativeSizing) { + return calcRelativeDeltas(sizes, index, delta, minCellSize); + } else { + var clampedDelta = clampNegativeDelta(sizes, index, delta, minCellSize); + return zero(sizes.slice(0, index)).concat([clampedDelta]); + } + }; + return { + resizeTable: resizeTable, + clampTableDelta: clampNegativeDelta, + calcLeftEdgeDeltas: calcLeftEdgeDeltas, + calcMiddleDeltas: calcMiddleDeltas, + calcRightEdgeDeltas: calcRightEdgeDeltas + }; + }; + var preserveTable = function () { + var calcLeftEdgeDeltas = function (sizes, index, next, delta, minCellSize) { + var idx = delta >= 0 ? next : index; + var clampedDelta = clampDelta(sizes, idx, delta, minCellSize); + return surround(sizes, index, next + 1, [ + clampedDelta, + -clampedDelta + ], zero); + }; + var calcMiddleDeltas = function (sizes, _prev, index, next, delta, minCellSize) { + return calcLeftEdgeDeltas(sizes, index, next, delta, minCellSize); + }; + var resizeTable = function (resizer, delta, isLastColumn) { + if (isLastColumn) { + resizer(delta); + } + }; + var calcRightEdgeDeltas = function (sizes, _prev, _index, delta, _minCellSize, relativeSizing) { + if (relativeSizing) { + return zero(sizes); + } else { + var diff = delta / sizes.length; + return map(sizes, constant(diff)); + } + }; + var clampTableDelta = function (sizes, index, delta, minCellSize, isLastColumn) { + if (isLastColumn) { + if (delta >= 0) { + return delta; + } else { + var maxDelta = foldl(sizes, function (a, b) { + return a + b - minCellSize; + }, 0); + return Math.max(-maxDelta, delta); + } + } else { + return clampNegativeDelta(sizes, index, delta, minCellSize); + } + }; + return { + resizeTable: resizeTable, + clampTableDelta: clampTableDelta, + calcLeftEdgeDeltas: calcLeftEdgeDeltas, + calcMiddleDeltas: calcMiddleDeltas, + calcRightEdgeDeltas: calcRightEdgeDeltas + }; + }; + + var only = function (element) { + var parent = Optional.from(element.dom.documentElement).map(SugarElement.fromDom).getOr(element); + return { + parent: constant(parent), + view: constant(element), + origin: constant(SugarPosition(0, 0)) + }; + }; + var detached = function (editable, chrome) { + var origin = function () { + return absolute(chrome); + }; + return { + parent: constant(chrome), + view: constant(editable), + origin: origin + }; + }; + var body$1 = function (editable, chrome) { + return { + parent: constant(chrome), + view: constant(editable), + origin: constant(SugarPosition(0, 0)) + }; + }; + var ResizeWire = { + only: only, + detached: detached, + body: body$1 + }; + + var adt$1 = Adt.generate([ + { invalid: ['raw'] }, + { pixels: ['value'] }, + { percent: ['value'] } + ]); + var validateFor = function (suffix, type, value) { + var rawAmount = value.substring(0, value.length - suffix.length); + var amount = parseFloat(rawAmount); + return rawAmount === amount.toString() ? type(amount) : adt$1.invalid(value); + }; + var from$1 = function (value) { + if (endsWith(value, '%')) { + return validateFor('%', adt$1.percent, value); + } + if (endsWith(value, 'px')) { + return validateFor('px', adt$1.pixels, value); + } + return adt$1.invalid(value); + }; + var Size = __assign(__assign({}, adt$1), { from: from$1 }); + + var redistributeToPercent = function (widths, totalWidth) { + return map(widths, function (w) { + var colType = Size.from(w); + return colType.fold(function () { + return w; + }, function (px) { + var ratio = px / totalWidth * 100; + return ratio + '%'; + }, function (pc) { + return pc + '%'; + }); + }); + }; + var redistributeToPx = function (widths, totalWidth, newTotalWidth) { + var scale = newTotalWidth / totalWidth; + return map(widths, function (w) { + var colType = Size.from(w); + return colType.fold(function () { + return w; + }, function (px) { + return px * scale + 'px'; + }, function (pc) { + return pc / 100 * newTotalWidth + 'px'; + }); + }); + }; + var redistributeEmpty = function (newWidthType, columns) { + var f = newWidthType.fold(function () { + return constant(''); + }, function (pixels) { + var num = pixels / columns; + return constant(num + 'px'); + }, function () { + var num = 100 / columns; + return constant(num + '%'); + }); + return range(columns, f); + }; + var redistributeValues = function (newWidthType, widths, totalWidth) { + return newWidthType.fold(function () { + return widths; + }, function (px) { + return redistributeToPx(widths, totalWidth, px); + }, function (_pc) { + return redistributeToPercent(widths, totalWidth); + }); + }; + var redistribute = function (widths, totalWidth, newWidth) { + var newType = Size.from(newWidth); + var floats = forall(widths, function (s) { + return s === '0px'; + }) ? redistributeEmpty(newType, widths.length) : redistributeValues(newType, widths, totalWidth); + return normalize(floats); + }; + var sum = function (values, fallback) { + if (values.length === 0) { + return fallback; + } + return foldr(values, function (rest, v) { + return Size.from(v).fold(constant(0), identity, identity) + rest; + }, 0); + }; + var roundDown = function (num, unit) { + var floored = Math.floor(num); + return { + value: floored + unit, + remainder: num - floored + }; + }; + var add = function (value, amount) { + return Size.from(value).fold(constant(value), function (px) { + return px + amount + 'px'; + }, function (pc) { + return pc + amount + '%'; + }); + }; + var normalize = function (values) { + if (values.length === 0) { + return values; + } + var scan = foldr(values, function (rest, value) { + var info = Size.from(value).fold(function () { + return { + value: value, + remainder: 0 + }; + }, function (num) { + return roundDown(num, 'px'); + }, function (num) { + return { + value: num + '%', + remainder: 0 + }; + }); + return { + output: [info.value].concat(rest.output), + remainder: rest.remainder + info.remainder + }; + }, { + output: [], + remainder: 0 + }); + var r = scan.output; + return r.slice(0, r.length - 1).concat([add(r[r.length - 1], Math.round(scan.remainder))]); + }; + var validate = Size.from; + + var redistributeToW = function (newWidths, cells, unit) { + each(cells, function (cell) { + var widths = newWidths.slice(cell.column, cell.colspan + cell.column); + var w = sum(widths, minWidth()); + set$1(cell.element, 'width', w + unit); + }); + }; + var redistributeToColumns = function (newWidths, columns, unit) { + each(columns, function (column, index) { + var width = sum([newWidths[index]], minWidth()); + set$1(column.element, 'width', width + unit); + }); + }; + var redistributeToH = function (newHeights, rows, cells, unit) { + each(cells, function (cell) { + var heights = newHeights.slice(cell.row, cell.rowspan + cell.row); + var h = sum(heights, minHeight()); + set$1(cell.element, 'height', h + unit); + }); + each(rows, function (row, i) { + set$1(row.element, 'height', newHeights[i]); + }); + }; + var getUnit = function (newSize) { + return validate(newSize).fold(constant('px'), constant('px'), constant('%')); + }; + var redistribute$1 = function (table, optWidth, optHeight, tableSize) { + var warehouse = Warehouse.fromTable(table); + var rows = warehouse.all; + var cells = Warehouse.justCells(warehouse); + var columns = Warehouse.justColumns(warehouse); + optWidth.each(function (newWidth) { + var widthUnit = getUnit(newWidth); + var totalWidth = get$5(table); + var oldWidths = getRawWidths(warehouse, tableSize); + var nuWidths = redistribute(oldWidths, totalWidth, newWidth); + if (Warehouse.hasColumns(warehouse)) { + redistributeToColumns(nuWidths, columns, widthUnit); + } else { + redistributeToW(nuWidths, cells, widthUnit); + } + set$1(table, 'width', newWidth); + }); + optHeight.each(function (newHeight) { + var hUnit = getUnit(newHeight); + var totalHeight = get$4(table); + var oldHeights = getRawHeights(warehouse, height); + var nuHeights = redistribute(oldHeights, totalHeight, newHeight); + redistributeToH(nuHeights, rows, cells, hUnit); + set$1(table, 'height', newHeight); + }); + }; + var isPercentSizing$1 = isPercentSizing; + var isPixelSizing$1 = isPixelSizing; + var isNoneSizing$1 = isNoneSizing; + var getPercentTableWidth$1 = getPercentTableWidth; + + var getGridSize = function (table) { + var warehouse = Warehouse.fromTable(table); + return warehouse.grid; + }; + + var Event = function (fields) { + var handlers = []; + var bind = function (handler) { + if (handler === undefined) { + throw new Error('Event bind error: undefined handler'); + } + handlers.push(handler); + }; + var unbind = function (handler) { + handlers = filter(handlers, function (h) { + return h !== handler; + }); + }; + var trigger = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var event = {}; + each(fields, function (name, i) { + event[name] = args[i]; + }); + each(handlers, function (handler) { + handler(event); + }); + }; + return { + bind: bind, + unbind: unbind, + trigger: trigger + }; + }; + + var create = function (typeDefs) { + var registry = map$1(typeDefs, function (event) { + return { + bind: event.bind, + unbind: event.unbind + }; + }); + var trigger = map$1(typeDefs, function (event) { + return event.trigger; + }); + return { + registry: registry, + trigger: trigger + }; + }; + + var last$2 = function (fn, rate) { + var timer = null; + var cancel = function () { + if (timer !== null) { + clearTimeout(timer); + timer = null; + } + }; + var throttle = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (timer !== null) { + clearTimeout(timer); + } + timer = setTimeout(function () { + fn.apply(null, args); + timer = null; + }, rate); + }; + return { + cancel: cancel, + throttle: throttle + }; + }; + + var sort = function (arr) { + return arr.slice(0).sort(); + }; + var reqMessage = function (required, keys) { + throw new Error('All required keys (' + sort(required).join(', ') + ') were not specified. Specified keys were: ' + sort(keys).join(', ') + '.'); + }; + var unsuppMessage = function (unsupported) { + throw new Error('Unsupported keys for object: ' + sort(unsupported).join(', ')); + }; + var validateStrArr = function (label, array) { + if (!isArray(array)) { + throw new Error('The ' + label + ' fields must be an array. Was: ' + array + '.'); + } + each(array, function (a) { + if (!isString(a)) { + throw new Error('The value ' + a + ' in the ' + label + ' fields was not a string.'); + } + }); + }; + var invalidTypeMessage = function (incorrect, type) { + throw new Error('All values need to be of type: ' + type + '. Keys (' + sort(incorrect).join(', ') + ') were not.'); + }; + var checkDupes = function (everything) { + var sorted = sort(everything); + var dupe = find(sorted, function (s, i) { + return i < sorted.length - 1 && s === sorted[i + 1]; + }); + dupe.each(function (d) { + throw new Error('The field: ' + d + ' occurs more than once in the combined fields: [' + sorted.join(', ') + '].'); + }); + }; + + var base = function (handleUnsupported, required) { + return baseWith(handleUnsupported, required, { + validate: isFunction, + label: 'function' + }); + }; + var baseWith = function (handleUnsupported, required, pred) { + if (required.length === 0) { + throw new Error('You must specify at least one required field.'); + } + validateStrArr('required', required); + checkDupes(required); + return function (obj) { + var keys$1 = keys(obj); + var allReqd = forall(required, function (req) { + return contains(keys$1, req); + }); + if (!allReqd) { + reqMessage(required, keys$1); + } + handleUnsupported(required, keys$1); + var invalidKeys = filter(required, function (key) { + return !pred.validate(obj[key], key); + }); + if (invalidKeys.length > 0) { + invalidTypeMessage(invalidKeys, pred.label); + } + return obj; + }; + }; + var handleExact = function (required, keys) { + var unsupported = filter(keys, function (key) { + return !contains(required, key); + }); + if (unsupported.length > 0) { + unsuppMessage(unsupported); + } + }; + var exactly = function (required) { + return base(handleExact, required); + }; + + var DragMode = exactly([ + 'compare', + 'extract', + 'mutate', + 'sink' + ]); + var DragSink = exactly([ + 'element', + 'start', + 'stop', + 'destroy' + ]); + var DragApi = exactly([ + 'forceDrop', + 'drop', + 'move', + 'delayDrop' + ]); + + function InDrag () { + var previous = Optional.none(); + var reset = function () { + previous = Optional.none(); + }; + var update = function (mode, nu) { + var result = previous.map(function (old) { + return mode.compare(old, nu); + }); + previous = Optional.some(nu); + return result; + }; + var onEvent = function (event, mode) { + var dataOption = mode.extract(event); + dataOption.each(function (data) { + var offset = update(mode, data); + offset.each(function (d) { + events.trigger.move(d); + }); + }); + }; + var events = create({ move: Event(['info']) }); + return { + onEvent: onEvent, + reset: reset, + events: events.registry + }; + } + + function NoDrag () { + return { + onEvent: noop, + reset: noop + }; + } + + function Movement () { + var noDragState = NoDrag(); + var inDragState = InDrag(); + var dragState = noDragState; + var on = function () { + dragState.reset(); + dragState = inDragState; + }; + var off = function () { + dragState.reset(); + dragState = noDragState; + }; + var onEvent = function (event, mode) { + dragState.onEvent(event, mode); + }; + var isOn = function () { + return dragState === inDragState; + }; + return { + on: on, + off: off, + isOn: isOn, + onEvent: onEvent, + events: inDragState.events + }; + } + + var setup = function (mutation, mode, settings) { + var active = false; + var events = create({ + start: Event([]), + stop: Event([]) + }); + var movement = Movement(); + var drop = function () { + sink.stop(); + if (movement.isOn()) { + movement.off(); + events.trigger.stop(); + } + }; + var throttledDrop = last$2(drop, 200); + var go = function (parent) { + sink.start(parent); + movement.on(); + events.trigger.start(); + }; + var mousemove = function (event) { + throttledDrop.cancel(); + movement.onEvent(event, mode); + }; + movement.events.move.bind(function (event) { + mode.mutate(mutation, event.info); + }); + var on = function () { + active = true; + }; + var off = function () { + active = false; + }; + var runIfActive = function (f) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (active) { + f.apply(null, args); + } + }; + }; + var sink = mode.sink(DragApi({ + forceDrop: drop, + drop: runIfActive(drop), + move: runIfActive(mousemove), + delayDrop: runIfActive(throttledDrop.throttle) + }), settings); + var destroy = function () { + sink.destroy(); + }; + return { + element: sink.element, + go: go, + on: on, + off: off, + destroy: destroy, + events: events.registry + }; + }; + + var mkEvent = function (target, x, y, stop, prevent, kill, raw) { + return { + target: target, + x: x, + y: y, + stop: stop, + prevent: prevent, + kill: kill, + raw: raw + }; + }; + var fromRawEvent = function (rawEvent) { + var target = SugarElement.fromDom(getOriginalEventTarget(rawEvent).getOr(rawEvent.target)); + var stop = function () { + return rawEvent.stopPropagation(); + }; + var prevent = function () { + return rawEvent.preventDefault(); + }; + var kill = compose(prevent, stop); + return mkEvent(target, rawEvent.clientX, rawEvent.clientY, stop, prevent, kill, rawEvent); + }; + var handle = function (filter, handler) { + return function (rawEvent) { + if (filter(rawEvent)) { + handler(fromRawEvent(rawEvent)); + } + }; + }; + var binder = function (element, event, filter, handler, useCapture) { + var wrapped = handle(filter, handler); + element.dom.addEventListener(event, wrapped, useCapture); + return { unbind: curry(unbind, element, event, wrapped, useCapture) }; + }; + var bind$1 = function (element, event, filter, handler) { + return binder(element, event, filter, handler, false); + }; + var unbind = function (element, event, handler, useCapture) { + element.dom.removeEventListener(event, handler, useCapture); + }; + + var filter$2 = always; + var bind$2 = function (element, event, handler) { + return bind$1(element, event, filter$2, handler); + }; + var fromRawEvent$1 = fromRawEvent; + + var read = function (element, attr) { + var value = get$1(element, attr); + return value === undefined || value === '' ? [] : value.split(' '); + }; + var add$1 = function (element, attr, id) { + var old = read(element, attr); + var nu = old.concat([id]); + set(element, attr, nu.join(' ')); + return true; + }; + var remove$3 = function (element, attr, id) { + var nu = filter(read(element, attr), function (v) { + return v !== id; + }); + if (nu.length > 0) { + set(element, attr, nu.join(' ')); + } else { + remove(element, attr); + } + return false; + }; + + var supports = function (element) { + return element.dom.classList !== undefined; + }; + var get$7 = function (element) { + return read(element, 'class'); + }; + var add$2 = function (element, clazz) { + return add$1(element, 'class', clazz); + }; + var remove$4 = function (element, clazz) { + return remove$3(element, 'class', clazz); + }; + + var add$3 = function (element, clazz) { + if (supports(element)) { + element.dom.classList.add(clazz); + } else { + add$2(element, clazz); + } + }; + var cleanClass = function (element) { + var classList = supports(element) ? element.dom.classList : get$7(element); + if (classList.length === 0) { + remove(element, 'class'); + } + }; + var remove$5 = function (element, clazz) { + if (supports(element)) { + var classList = element.dom.classList; + classList.remove(clazz); + } else { + remove$4(element, clazz); + } + cleanClass(element); + }; + var has$1 = function (element, clazz) { + return supports(element) && element.dom.classList.contains(clazz); + }; + + var css = function (namespace) { + var dashNamespace = namespace.replace(/\./g, '-'); + var resolve = function (str) { + return dashNamespace + '-' + str; + }; + return { resolve: resolve }; + }; + + var styles = css('ephox-dragster'); + var resolve = styles.resolve; + + var Blocker = function (options) { + var settings = __assign({ layerClass: resolve('blocker') }, options); + var div = SugarElement.fromTag('div'); + set(div, 'role', 'presentation'); + setAll$1(div, { + position: 'fixed', + left: '0px', + top: '0px', + width: '100%', + height: '100%' + }); + add$3(div, resolve('blocker')); + add$3(div, settings.layerClass); + var element = function () { + return div; + }; + var destroy = function () { + remove$2(div); + }; + return { + element: element, + destroy: destroy + }; + }; + + var compare = function (old, nu) { + return SugarPosition(nu.left - old.left, nu.top - old.top); + }; + var extract$1 = function (event) { + return Optional.some(SugarPosition(event.x, event.y)); + }; + var mutate = function (mutation, info) { + mutation.mutate(info.left, info.top); + }; + var sink = function (dragApi, settings) { + var blocker = Blocker(settings); + var mdown = bind$2(blocker.element(), 'mousedown', dragApi.forceDrop); + var mup = bind$2(blocker.element(), 'mouseup', dragApi.drop); + var mmove = bind$2(blocker.element(), 'mousemove', dragApi.move); + var mout = bind$2(blocker.element(), 'mouseout', dragApi.delayDrop); + var destroy = function () { + blocker.destroy(); + mup.unbind(); + mmove.unbind(); + mout.unbind(); + mdown.unbind(); + }; + var start = function (parent) { + append(parent, blocker.element()); + }; + var stop = function () { + remove$2(blocker.element()); + }; + return DragSink({ + element: blocker.element, + start: start, + stop: stop, + destroy: destroy + }); + }; + var MouseDrag = DragMode({ + compare: compare, + extract: extract$1, + sink: sink, + mutate: mutate + }); + + var transform = function (mutation, settings) { + if (settings === void 0) { + settings = {}; + } + var mode = settings.mode !== undefined ? settings.mode : MouseDrag; + return setup(mutation, mode, settings); + }; + + var isContentEditableTrue = function (elm) { + return get$1(elm, 'contenteditable') === 'true'; + }; + var findClosestContentEditable = function (target, isRoot) { + return closest$1(target, '[contenteditable]', isRoot); + }; + + var styles$1 = css('ephox-snooker'); + var resolve$1 = styles$1.resolve; + + var Mutation = function () { + var events = create({ + drag: Event([ + 'xDelta', + 'yDelta' + ]) + }); + var mutate = function (x, y) { + events.trigger.drag(x, y); + }; + return { + mutate: mutate, + events: events.registry + }; + }; + + var BarMutation = function () { + var events = create({ + drag: Event([ + 'xDelta', + 'yDelta', + 'target' + ]) + }); + var target = Optional.none(); + var delegate = Mutation(); + delegate.events.drag.bind(function (event) { + target.each(function (t) { + events.trigger.drag(event.xDelta, event.yDelta, t); + }); + }); + var assign = function (t) { + target = Optional.some(t); + }; + var get = function () { + return target; + }; + return { + assign: assign, + get: get, + mutate: delegate.mutate, + events: events.registry + }; + }; + + var col = function (column, x, y, w, h) { + var bar = SugarElement.fromTag('div'); + setAll$1(bar, { + position: 'absolute', + left: x - w / 2 + 'px', + top: y + 'px', + height: h + 'px', + width: w + 'px' + }); + setAll(bar, { + 'data-column': column, + 'role': 'presentation' + }); + return bar; + }; + var row = function (r, x, y, w, h) { + var bar = SugarElement.fromTag('div'); + setAll$1(bar, { + position: 'absolute', + left: x + 'px', + top: y - h / 2 + 'px', + height: h + 'px', + width: w + 'px' + }); + setAll(bar, { + 'data-row': r, + 'role': 'presentation' + }); + return bar; + }; + + var resizeBar = resolve$1('resizer-bar'); + var resizeRowBar = resolve$1('resizer-rows'); + var resizeColBar = resolve$1('resizer-cols'); + var BAR_THICKNESS = 7; + var destroy = function (wire) { + var previous = descendants$1(wire.parent(), '.' + resizeBar); + each(previous, remove$2); + }; + var drawBar = function (wire, positions, create) { + var origin = wire.origin(); + each(positions, function (cpOption) { + cpOption.each(function (cp) { + var bar = create(origin, cp); + add$3(bar, resizeBar); + append(wire.parent(), bar); + }); + }); + }; + var refreshCol = function (wire, colPositions, position, tableHeight) { + drawBar(wire, colPositions, function (origin, cp) { + var colBar = col(cp.col, cp.x - origin.left, position.top - origin.top, BAR_THICKNESS, tableHeight); + add$3(colBar, resizeColBar); + return colBar; + }); + }; + var refreshRow = function (wire, rowPositions, position, tableWidth) { + drawBar(wire, rowPositions, function (origin, cp) { + var rowBar = row(cp.row, position.left - origin.left, cp.y - origin.top, tableWidth, BAR_THICKNESS); + add$3(rowBar, resizeRowBar); + return rowBar; + }); + }; + var refreshGrid = function (wire, table, rows, cols) { + var position = absolute(table); + var rowPositions = rows.length > 0 ? height.positions(rows, table) : []; + refreshRow(wire, rowPositions, position, getOuter$1(table)); + var colPositions = cols.length > 0 ? width.positions(cols, table) : []; + refreshCol(wire, colPositions, position, getOuter(table)); + }; + var refresh = function (wire, table) { + destroy(wire); + var warehouse = Warehouse.fromTable(table); + var rows = rows$1(warehouse); + var cols = columns$1(warehouse); + refreshGrid(wire, table, rows, cols); + }; + var each$2 = function (wire, f) { + var bars = descendants$1(wire.parent(), '.' + resizeBar); + each(bars, f); + }; + var hide = function (wire) { + each$2(wire, function (bar) { + set$1(bar, 'display', 'none'); + }); + }; + var show = function (wire) { + each$2(wire, function (bar) { + set$1(bar, 'display', 'block'); + }); + }; + var isRowBar = function (element) { + return has$1(element, resizeRowBar); + }; + var isColBar = function (element) { + return has$1(element, resizeColBar); + }; + + var resizeBarDragging = resolve$1('resizer-bar-dragging'); + var BarManager = function (wire) { + var mutation = BarMutation(); + var resizing = transform(mutation, {}); + var hoverTable = Optional.none(); + var getResizer = function (element, type) { + return Optional.from(get$1(element, type)); + }; + mutation.events.drag.bind(function (event) { + getResizer(event.target, 'data-row').each(function (_dataRow) { + var currentRow = getCssValue(event.target, 'top'); + set$1(event.target, 'top', currentRow + event.yDelta + 'px'); + }); + getResizer(event.target, 'data-column').each(function (_dataCol) { + var currentCol = getCssValue(event.target, 'left'); + set$1(event.target, 'left', currentCol + event.xDelta + 'px'); + }); + }); + var getDelta = function (target, dir) { + var newX = getCssValue(target, dir); + var oldX = getAttrValue(target, 'data-initial-' + dir, 0); + return newX - oldX; + }; + resizing.events.stop.bind(function () { + mutation.get().each(function (target) { + hoverTable.each(function (table) { + getResizer(target, 'data-row').each(function (row) { + var delta = getDelta(target, 'top'); + remove(target, 'data-initial-top'); + events.trigger.adjustHeight(table, delta, parseInt(row, 10)); + }); + getResizer(target, 'data-column').each(function (column) { + var delta = getDelta(target, 'left'); + remove(target, 'data-initial-left'); + events.trigger.adjustWidth(table, delta, parseInt(column, 10)); + }); + refresh(wire, table); + }); + }); + }); + var handler = function (target, dir) { + events.trigger.startAdjust(); + mutation.assign(target); + set(target, 'data-initial-' + dir, getCssValue(target, dir)); + add$3(target, resizeBarDragging); + set$1(target, 'opacity', '0.2'); + resizing.go(wire.parent()); + }; + var mousedown = bind$2(wire.parent(), 'mousedown', function (event) { + if (isRowBar(event.target)) { + handler(event.target, 'top'); + } + if (isColBar(event.target)) { + handler(event.target, 'left'); + } + }); + var isRoot = function (e) { + return eq(e, wire.view()); + }; + var findClosestEditableTable = function (target) { + return closest$1(target, 'table', isRoot).filter(function (table) { + return findClosestContentEditable(table, isRoot).exists(isContentEditableTrue); + }); + }; + var mouseover = bind$2(wire.view(), 'mouseover', function (event) { + findClosestEditableTable(event.target).fold(function () { + if (inBody(event.target)) { + destroy(wire); + } + }, function (table) { + hoverTable = Optional.some(table); + refresh(wire, table); + }); + }); + var destroy$1 = function () { + mousedown.unbind(); + mouseover.unbind(); + resizing.destroy(); + destroy(wire); + }; + var refresh$1 = function (tbl) { + refresh(wire, tbl); + }; + var events = create({ + adjustHeight: Event([ + 'table', + 'delta', + 'row' + ]), + adjustWidth: Event([ + 'table', + 'delta', + 'column' + ]), + startAdjust: Event([]) + }); + return { + destroy: destroy$1, + refresh: refresh$1, + on: resizing.on, + off: resizing.off, + hideBars: curry(hide, wire), + showBars: curry(show, wire), + events: events.registry + }; + }; + + var create$1 = function (wire, resizing, lazySizing) { + var hdirection = height; + var vdirection = width; + var manager = BarManager(wire); + var events = create({ + beforeResize: Event([ + 'table', + 'type' + ]), + afterResize: Event([ + 'table', + 'type' + ]), + startDrag: Event([]) + }); + manager.events.adjustHeight.bind(function (event) { + var table = event.table; + events.trigger.beforeResize(table, 'row'); + var delta = hdirection.delta(event.delta, table); + adjustHeight(table, delta, event.row, hdirection); + events.trigger.afterResize(table, 'row'); + }); + manager.events.startAdjust.bind(function (_event) { + events.trigger.startDrag(); + }); + manager.events.adjustWidth.bind(function (event) { + var table = event.table; + events.trigger.beforeResize(table, 'col'); + var delta = vdirection.delta(event.delta, table); + var tableSize = lazySizing(table); + adjustWidth(table, delta, event.column, resizing, tableSize); + events.trigger.afterResize(table, 'col'); + }); + return { + on: manager.on, + off: manager.off, + hideBars: manager.hideBars, + showBars: manager.showBars, + destroy: manager.destroy, + events: events.registry + }; + }; + var TableResize = { create: create$1 }; + + var fireNewRow = function (editor, row) { + return editor.fire('newrow', { node: row }); + }; + var fireNewCell = function (editor, cell) { + return editor.fire('newcell', { node: cell }); + }; + var fireObjectResizeStart = function (editor, target, width, height, origin) { + editor.fire('ObjectResizeStart', { + target: target, + width: width, + height: height, + origin: origin + }); + }; + var fireObjectResized = function (editor, target, width, height, origin) { + editor.fire('ObjectResized', { + target: target, + width: width, + height: height, + origin: origin + }); + }; + var fireTableSelectionChange = function (editor, cells, start, finish, otherCells) { + editor.fire('TableSelectionChange', { + cells: cells, + start: start, + finish: finish, + otherCells: otherCells + }); + }; + var fireTableSelectionClear = function (editor) { + editor.fire('TableSelectionClear'); + }; + + var defaultTableToolbar = 'tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol'; + var defaultStyles = { + 'border-collapse': 'collapse', + 'width': '100%' + }; + var determineDefaultStyles = function (editor) { + if (isPixelsForced(editor)) { + var editorWidth = editor.getBody().offsetWidth; + return __assign(__assign({}, defaultStyles), { width: editorWidth + 'px' }); + } else if (isResponsiveForced(editor)) { + return filter$1(defaultStyles, function (_value, key) { + return key !== 'width'; + }); + } else { + return defaultStyles; + } + }; + var defaultAttributes = { border: '1' }; + var defaultColumnResizingBehaviour = 'preservetable'; + var getTableSizingMode = function (editor) { + return editor.getParam('table_sizing_mode', 'auto'); + }; + var getTableResponseWidth = function (editor) { + return editor.getParam('table_responsive_width'); + }; + var getDefaultAttributes = function (editor) { + return editor.getParam('table_default_attributes', defaultAttributes, 'object'); + }; + var getDefaultStyles = function (editor) { + return editor.getParam('table_default_styles', determineDefaultStyles(editor), 'object'); + }; + var hasTableResizeBars = function (editor) { + return editor.getParam('table_resize_bars', true, 'boolean'); + }; + var hasTabNavigation = function (editor) { + return editor.getParam('table_tab_navigation', true, 'boolean'); + }; + var hasAdvancedCellTab = function (editor) { + return editor.getParam('table_cell_advtab', true, 'boolean'); + }; + var hasAdvancedRowTab = function (editor) { + return editor.getParam('table_row_advtab', true, 'boolean'); + }; + var hasAdvancedTableTab = function (editor) { + return editor.getParam('table_advtab', true, 'boolean'); + }; + var hasAppearanceOptions = function (editor) { + return editor.getParam('table_appearance_options', true, 'boolean'); + }; + var hasTableGrid = function (editor) { + return editor.getParam('table_grid', true, 'boolean'); + }; + var shouldStyleWithCss = function (editor) { + return editor.getParam('table_style_by_css', false, 'boolean'); + }; + var getCellClassList = function (editor) { + return editor.getParam('table_cell_class_list', [], 'array'); + }; + var getRowClassList = function (editor) { + return editor.getParam('table_row_class_list', [], 'array'); + }; + var getTableClassList = function (editor) { + return editor.getParam('table_class_list', [], 'array'); + }; + var isPercentagesForced = function (editor) { + return getTableSizingMode(editor) === 'relative' || getTableResponseWidth(editor) === true; + }; + var isPixelsForced = function (editor) { + return getTableSizingMode(editor) === 'fixed' || getTableResponseWidth(editor) === false; + }; + var isResponsiveForced = function (editor) { + return getTableSizingMode(editor) === 'responsive'; + }; + var getToolbar = function (editor) { + return editor.getParam('table_toolbar', defaultTableToolbar); + }; + var useColumnGroup = function (editor) { + return editor.getParam('table_use_colgroups', false, 'boolean'); + }; + var getTableHeaderType = function (editor) { + var defaultValue = 'section'; + var value = editor.getParam('table_header_type', defaultValue, 'string'); + var validValues = [ + 'section', + 'cells', + 'sectionCells', + 'auto' + ]; + if (!contains(validValues, value)) { + return defaultValue; + } else { + return value; + } + }; + var getColumnResizingBehaviour = function (editor) { + var validModes = [ + 'preservetable', + 'resizetable' + ]; + var givenMode = editor.getParam('table_column_resizing', defaultColumnResizingBehaviour, 'string'); + return find(validModes, function (mode) { + return mode === givenMode; + }).getOr(defaultColumnResizingBehaviour); + }; + var isPreserveTableColumnResizing = function (editor) { + return getColumnResizingBehaviour(editor) === 'preservetable'; + }; + var getCloneElements = function (editor) { + var cloneElements = editor.getParam('table_clone_elements'); + if (isString(cloneElements)) { + return Optional.some(cloneElements.split(/[ ,]/)); + } else if (Array.isArray(cloneElements)) { + return Optional.some(cloneElements); + } else { + return Optional.none(); + } + }; + var hasObjectResizing = function (editor) { + var objectResizing = editor.getParam('object_resizing', true); + return isString(objectResizing) ? objectResizing === 'table' : objectResizing; + }; + + var getNodeName = function (elm) { + return elm.nodeName.toLowerCase(); + }; + var getBody$1 = function (editor) { + return SugarElement.fromDom(editor.getBody()); + }; + var getPixelWidth$1 = function (elm) { + return elm.getBoundingClientRect().width; + }; + var getPixelHeight = function (elm) { + return elm.getBoundingClientRect().height; + }; + var getIsRoot = function (editor) { + return function (element) { + return eq(element, getBody$1(editor)); + }; + }; + var removePxSuffix = function (size) { + return size ? size.replace(/px$/, '') : ''; + }; + var addPxSuffix = function (size) { + return /^\d+(\.\d+)?$/.test(size) ? size + 'px' : size; + }; + var removeDataStyle = function (table) { + remove(table, 'data-mce-style'); + var removeStyleAttribute = function (element) { + return remove(element, 'data-mce-style'); + }; + each(cells(table), removeStyleAttribute); + each(columns(table), removeStyleAttribute); + }; + var getRawWidth$1 = function (editor, elm) { + var raw = editor.dom.getStyle(elm, 'width') || editor.dom.getAttrib(elm, 'width'); + return Optional.from(raw).filter(isNotEmpty); + }; + var isPercentage = function (value) { + return /^(\d+(\.\d+)?)%$/.test(value); + }; + var isPixel = function (value) { + return /^(\d+(\.\d+)?)px$/.test(value); + }; + var getSelectionStart = function (editor) { + return SugarElement.fromDom(editor.selection.getStart()); + }; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; + }; + + var noneSize = function (table) { + var getWidth = function () { + return get$5(table); + }; + var zero = constant(0); + return { + width: getWidth, + pixelWidth: getWidth, + getWidths: getPixelWidths, + getCellDelta: zero, + singleColumnWidth: constant([0]), + minCellWidth: zero, + setElementWidth: noop, + adjustTableWidth: noop, + isRelative: true, + label: 'none' + }; + }; + var percentageSize = function (initialWidth, table) { + var floatWidth = Cell(parseFloat(initialWidth)); + var pixelWidth = Cell(get$5(table)); + var getCellDelta = function (delta) { + return delta / pixelWidth.get() * 100; + }; + var singleColumnWidth = function (w, _delta) { + return [100 - w]; + }; + var minCellWidth = function () { + return minWidth() / pixelWidth.get() * 100; + }; + var adjustTableWidth = function (delta) { + var currentWidth = floatWidth.get(); + var change = delta / 100 * currentWidth; + var newWidth = currentWidth + change; + setPercentageWidth(table, newWidth); + floatWidth.set(newWidth); + pixelWidth.set(get$5(table)); + }; + return { + width: floatWidth.get, + pixelWidth: pixelWidth.get, + getWidths: getPercentageWidths, + getCellDelta: getCellDelta, + singleColumnWidth: singleColumnWidth, + minCellWidth: minCellWidth, + setElementWidth: setPercentageWidth, + adjustTableWidth: adjustTableWidth, + isRelative: true, + label: 'percent' + }; + }; + var pixelSize = function (initialWidth, table) { + var width = Cell(initialWidth); + var getWidth = width.get; + var getCellDelta = identity; + var singleColumnWidth = function (w, delta) { + var newNext = Math.max(minWidth(), w + delta); + return [newNext - w]; + }; + var adjustTableWidth = function (delta) { + var newWidth = getWidth() + delta; + setPixelWidth(table, newWidth); + width.set(newWidth); + }; + return { + width: getWidth, + pixelWidth: getWidth, + getWidths: getPixelWidths, + getCellDelta: getCellDelta, + singleColumnWidth: singleColumnWidth, + minCellWidth: minWidth, + setElementWidth: setPixelWidth, + adjustTableWidth: adjustTableWidth, + isRelative: false, + label: 'pixel' + }; + }; + var chooseSize = function (element, width) { + var percentMatch = percentageBasedSizeRegex().exec(width); + if (percentMatch !== null) { + return percentageSize(percentMatch[1], element); + } + var pixelMatch = pixelBasedSizeRegex().exec(width); + if (pixelMatch !== null) { + var intWidth = parseInt(pixelMatch[1], 10); + return pixelSize(intWidth, element); + } + var fallbackWidth = get$5(element); + return pixelSize(fallbackWidth, element); + }; + var getTableSize = function (table) { + var width = getRawWidth(table); + return width.fold(function () { + return noneSize(table); + }, function (w) { + return chooseSize(table, w); + }); + }; + var TableSize = { + getTableSize: getTableSize, + pixelSize: pixelSize, + percentageSize: percentageSize, + noneSize: noneSize + }; + + var get$8 = function (editor, table) { + if (isPercentagesForced(editor)) { + var width = getRawWidth$1(editor, table.dom).filter(isPercentage).getOrThunk(function () { + return getPercentTableWidth$1(table); + }); + return TableSize.percentageSize(width, table); + } else if (isPixelsForced(editor)) { + return TableSize.pixelSize(get$5(table), table); + } else { + return TableSize.getTableSize(table); + } + }; + + var cleanupLegacyAttributes = function (element) { + remove(element, 'width'); + }; + var convertToPercentSize = function (table, tableSize) { + var newWidth = getPercentTableWidth(table); + redistribute$1(table, Optional.some(newWidth), Optional.none(), tableSize); + cleanupLegacyAttributes(table); + }; + var convertToPixelSize = function (table, tableSize) { + var newWidth = getPixelTableWidth(table); + redistribute$1(table, Optional.some(newWidth), Optional.none(), tableSize); + cleanupLegacyAttributes(table); + }; + var convertToNoneSize = function (table) { + remove$1(table, 'width'); + var columns$1 = columns(table); + var rowElements = columns$1.length > 0 ? columns$1 : cells(table); + each(rowElements, function (cell) { + remove$1(cell, 'width'); + cleanupLegacyAttributes(cell); + }); + cleanupLegacyAttributes(table); + }; + + var enforcePercentage = function (editor, table) { + var tableSizing = get$8(editor, table); + convertToPercentSize(table, tableSizing); + }; + var enforcePixels = function (editor, table) { + var tableSizing = get$8(editor, table); + convertToPixelSize(table, tableSizing); + }; + var enforceNone = convertToNoneSize; + var syncPixels = function (table) { + var warehouse = Warehouse.fromTable(table); + if (!Warehouse.hasColumns(warehouse)) { + each(cells(table), function (cell) { + var computedWidth = get$2(cell, 'width'); + set$1(cell, 'width', computedWidth); + remove(cell, 'width'); + }); + } + }; + + var createContainer = function () { + var container = SugarElement.fromTag('div'); + setAll$1(container, { + position: 'static', + height: '0', + width: '0', + padding: '0', + margin: '0', + border: '0' + }); + append(body(), container); + return container; + }; + var get$9 = function (editor, _container) { + return editor.inline ? ResizeWire.body(getBody$1(editor), createContainer()) : ResizeWire.only(SugarElement.fromDom(editor.getDoc())); + }; + var remove$6 = function (editor, wire) { + if (editor.inline) { + remove$2(wire.parent()); + } + }; + + var getResizeHandler = function (editor) { + var selectionRng = Optional.none(); + var resize = Optional.none(); + var wire = Optional.none(); + var startW; + var startRawW; + var isTable = function (elm) { + return elm.nodeName === 'TABLE'; + }; + var lazyResize = function () { + return resize; + }; + var lazyWire = function () { + return wire.getOr(ResizeWire.only(SugarElement.fromDom(editor.getBody()))); + }; + var lazySizing = function (table) { + return get$8(editor, table); + }; + var lazyResizingBehaviour = function () { + return isPreserveTableColumnResizing(editor) ? preserveTable() : resizeTable(); + }; + var getNumColumns = function (table) { + return getGridSize(table).columns; + }; + var afterCornerResize = function (table, origin, width) { + var isRightEdgeResize = endsWith(origin, 'e'); + if (width !== startW && startRawW !== '') { + set$1(table, 'width', startRawW); + var resizing = lazyResizingBehaviour(); + var tableSize = lazySizing(table); + var col = isPreserveTableColumnResizing(editor) || isRightEdgeResize ? getNumColumns(table) - 1 : 0; + adjustWidth(table, width - startW, col, resizing, tableSize); + } else if (isPercentage(startRawW)) { + var percentW = parseFloat(startRawW.replace('%', '')); + var targetPercentW = width * percentW / startW; + set$1(table, 'width', targetPercentW + '%'); + } + if (isPixel(startRawW)) { + syncPixels(table); + } + }; + var destroy = function () { + resize.each(function (sz) { + sz.destroy(); + }); + wire.each(function (w) { + remove$6(editor, w); + }); + }; + editor.on('init', function () { + var rawWire = get$9(editor); + wire = Optional.some(rawWire); + if (hasObjectResizing(editor) && hasTableResizeBars(editor)) { + var resizing = lazyResizingBehaviour(); + var sz = TableResize.create(rawWire, resizing, lazySizing); + sz.on(); + sz.events.startDrag.bind(function (_event) { + selectionRng = Optional.some(editor.selection.getRng()); + }); + sz.events.beforeResize.bind(function (event) { + var rawTable = event.table.dom; + fireObjectResizeStart(editor, rawTable, getPixelWidth$1(rawTable), getPixelHeight(rawTable), 'bar-' + event.type); + }); + sz.events.afterResize.bind(function (event) { + var table = event.table; + var rawTable = table.dom; + removeDataStyle(table); + selectionRng.each(function (rng) { + editor.selection.setRng(rng); + editor.focus(); + }); + fireObjectResized(editor, rawTable, getPixelWidth$1(rawTable), getPixelHeight(rawTable), 'bar-' + event.type); + editor.undoManager.add(); + }); + resize = Optional.some(sz); + } + }); + editor.on('ObjectResizeStart', function (e) { + var targetElm = e.target; + if (isTable(targetElm)) { + var table = SugarElement.fromDom(targetElm); + each(editor.dom.select('.mce-clonedresizable'), function (clone) { + editor.dom.addClass(clone, 'mce-' + getColumnResizingBehaviour(editor) + '-columns'); + }); + if (!isPixelSizing$1(table) && isPixelsForced(editor)) { + enforcePixels(editor, table); + } else if (!isPercentSizing$1(table) && isPercentagesForced(editor)) { + enforcePercentage(editor, table); + } + startW = e.width; + startRawW = isResponsiveForced(editor) ? '' : getRawWidth$1(editor, targetElm).getOr(''); + } + }); + editor.on('ObjectResized', function (e) { + var targetElm = e.target; + if (isTable(targetElm)) { + var table = SugarElement.fromDom(targetElm); + if (startRawW === '') { + enforcePercentage(editor, table); + } + var origin_1 = e.origin; + if (startsWith(origin_1, 'corner-')) { + afterCornerResize(table, origin_1, e.width); + } + removeDataStyle(table); + } + }); + editor.on('SwitchMode', function () { + lazyResize().each(function (resize) { + if (editor.mode.isReadOnly()) { + resize.hideBars(); + } else { + resize.showBars(); + } + }); + }); + return { + lazyResize: lazyResize, + lazyWire: lazyWire, + destroy: destroy + }; + }; + + var point = function (element, offset) { + return { + element: element, + offset: offset + }; + }; + + var scan = function (universe, element, direction) { + if (universe.property().isText(element) && universe.property().getText(element).trim().length === 0 || universe.property().isComment(element)) { + return direction(element).bind(function (elem) { + return scan(universe, elem, direction).orThunk(function () { + return Optional.some(elem); + }); + }); + } else { + return Optional.none(); + } + }; + var toEnd = function (universe, element) { + if (universe.property().isText(element)) { + return universe.property().getText(element).length; + } + var children = universe.property().children(element); + return children.length; + }; + var freefallRtl = function (universe, element) { + var candidate = scan(universe, element, universe.query().prevSibling).getOr(element); + if (universe.property().isText(candidate)) { + return point(candidate, toEnd(universe, candidate)); + } + var children = universe.property().children(candidate); + return children.length > 0 ? freefallRtl(universe, children[children.length - 1]) : point(candidate, toEnd(universe, candidate)); + }; + + var freefallRtl$1 = freefallRtl; + + var universe$1 = DomUniverse(); + var freefallRtl$2 = function (element) { + return freefallRtl$1(universe$1, element); + }; + + var halve = function (main, other) { + var width = getGenericWidth(main); + width.each(function (w) { + var newWidth = w.value / 2; + setGenericWidth(main, newWidth, w.unit); + setGenericWidth(other, newWidth, w.unit); + }); + }; + + var addCell = function (gridRow, index, cell) { + var cells = gridRow.cells; + var before = cells.slice(0, index); + var after = cells.slice(index); + var newCells = before.concat([cell]).concat(after); + return setCells(gridRow, newCells); + }; + var mutateCell = function (gridRow, index, cell) { + var cells = gridRow.cells; + cells[index] = cell; + }; + var setCells = function (gridRow, cells) { + return rowcells(cells, gridRow.section); + }; + var mapCells = function (gridRow, f) { + var cells = gridRow.cells; + var r = map(cells, f); + return rowcells(r, gridRow.section); + }; + var getCell = function (gridRow, index) { + return gridRow.cells[index]; + }; + var getCellElement = function (gridRow, index) { + return getCell(gridRow, index).element; + }; + var cellLength = function (gridRow) { + return gridRow.cells.length; + }; + var extractGridDetails = function (grid) { + var result = partition(grid, function (row) { + return row.section === 'colgroup'; + }); + return { + rows: result.fail, + cols: result.pass + }; + }; + + var cat = function (arr) { + var r = []; + var push = function (x) { + r.push(x); + }; + for (var i = 0; i < arr.length; i++) { + arr[i].each(push); + } + return r; + }; + var lift2 = function (oa, ob, f) { + return oa.isSome() && ob.isSome() ? Optional.some(f(oa.getOrDie(), ob.getOrDie())) : Optional.none(); + }; + + var setIfNot = function (element, property, value, ignore) { + if (value === ignore) { + remove(element, property); + } else { + set(element, property, value); + } + }; + var insert = function (table, selector, element) { + last(children$2(table, selector)).fold(function () { + return prepend(table, element); + }, function (child) { + return after(child, element); + }); + }; + var generateSection = function (table, sectionName) { + var section = child$2(table, sectionName).getOrThunk(function () { + var newSection = SugarElement.fromTag(sectionName, owner(table).dom); + if (sectionName === 'thead') { + insert(table, 'caption,colgroup', newSection); + } else if (sectionName === 'colgroup') { + insert(table, 'caption', newSection); + } else { + append(table, newSection); + } + return newSection; + }); + empty(section); + return section; + }; + var render = function (table, grid) { + var newRows = []; + var newCells = []; + var syncRows = function (gridSection) { + return map(gridSection, function (row) { + if (row.isNew) { + newRows.push(row.element); + } + var tr = row.element; + empty(tr); + each(row.cells, function (cell) { + if (cell.isNew) { + newCells.push(cell.element); + } + setIfNot(cell.element, 'colspan', cell.colspan, 1); + setIfNot(cell.element, 'rowspan', cell.rowspan, 1); + append(tr, cell.element); + }); + return tr; + }); + }; + var syncColGroup = function (gridSection) { + return bind(gridSection, function (colGroup) { + return map(colGroup.cells, function (col) { + setIfNot(col.element, 'span', col.colspan, 1); + return col.element; + }); + }); + }; + var renderSection = function (gridSection, sectionName) { + var section = generateSection(table, sectionName); + var sync = sectionName === 'colgroup' ? syncColGroup : syncRows; + var sectionElems = sync(gridSection); + append$1(section, sectionElems); + }; + var removeSection = function (sectionName) { + child$2(table, sectionName).each(remove$2); + }; + var renderOrRemoveSection = function (gridSection, sectionName) { + if (gridSection.length > 0) { + renderSection(gridSection, sectionName); + } else { + removeSection(sectionName); + } + }; + var headSection = []; + var bodySection = []; + var footSection = []; + var columnGroupsSection = []; + each(grid, function (row) { + switch (row.section) { + case 'thead': + headSection.push(row); + break; + case 'tbody': + bodySection.push(row); + break; + case 'tfoot': + footSection.push(row); + break; + case 'colgroup': + columnGroupsSection.push(row); + break; + } + }); + renderOrRemoveSection(columnGroupsSection, 'colgroup'); + renderOrRemoveSection(headSection, 'thead'); + renderOrRemoveSection(bodySection, 'tbody'); + renderOrRemoveSection(footSection, 'tfoot'); + return { + newRows: newRows, + newCells: newCells + }; + }; + var copy$2 = function (grid) { + return map(grid, function (row) { + var tr = shallow(row.element); + each(row.cells, function (cell) { + var clonedCell = deep(cell.element); + setIfNot(clonedCell, 'colspan', cell.colspan, 1); + setIfNot(clonedCell, 'rowspan', cell.rowspan, 1); + append(tr, clonedCell); + }); + return tr; + }); + }; + + var getColumn = function (grid, index) { + return map(grid, function (row) { + return getCell(row, index); + }); + }; + var getRow = function (grid, index) { + return grid[index]; + }; + var findDiff = function (xs, comp) { + if (xs.length === 0) { + return 0; + } + var first = xs[0]; + var index = findIndex(xs, function (x) { + return !comp(first.element, x.element); + }); + return index.fold(function () { + return xs.length; + }, function (ind) { + return ind; + }); + }; + var subgrid = function (grid, row, column, comparator) { + var restOfRow = getRow(grid, row).cells.slice(column); + var endColIndex = findDiff(restOfRow, comparator); + var restOfColumn = getColumn(grid, column).slice(row); + var endRowIndex = findDiff(restOfColumn, comparator); + return { + colspan: endColIndex, + rowspan: endRowIndex + }; + }; + + var toDetails = function (grid, comparator) { + var seen = map(grid, function (row) { + return map(row.cells, never); + }); + var updateSeen = function (rowIndex, columnIndex, rowspan, colspan) { + for (var row = rowIndex; row < rowIndex + rowspan; row++) { + for (var column = columnIndex; column < columnIndex + colspan; column++) { + seen[row][column] = true; + } + } + }; + return map(grid, function (row, rowIndex) { + var details = bind(row.cells, function (cell, columnIndex) { + if (seen[rowIndex][columnIndex] === false) { + var result = subgrid(grid, rowIndex, columnIndex, comparator); + updateSeen(rowIndex, columnIndex, result.rowspan, result.colspan); + return [detailnew(cell.element, result.rowspan, result.colspan, cell.isNew)]; + } else { + return []; + } + }); + return rowdetails(details, row.section); + }); + }; + var toGrid = function (warehouse, generators, isNew) { + var grid = []; + if (Warehouse.hasColumns(warehouse)) { + var groupElementNew = map(Warehouse.justColumns(warehouse), function (column) { + return elementnew(column.element, isNew); + }); + grid.push(rowcells(groupElementNew, 'colgroup')); + } + for (var rowIndex = 0; rowIndex < warehouse.grid.rows; rowIndex++) { + var rowCells = []; + for (var columnIndex = 0; columnIndex < warehouse.grid.columns; columnIndex++) { + var element = Warehouse.getAt(warehouse, rowIndex, columnIndex).map(function (item) { + return elementnew(item.element, isNew); + }).getOrThunk(function () { + return elementnew(generators.gap(), true); + }); + rowCells.push(element); + } + var row = rowcells(rowCells, warehouse.all[rowIndex].section); + grid.push(row); + } + return grid; + }; + + var fromWarehouse = function (warehouse, generators) { + return toGrid(warehouse, generators, false); + }; + var deriveRows = function (rendered, generators) { + var findRow = function (details) { + var rowOfCells = findMap(details, function (detail) { + return parent(detail.element).map(function (row) { + var isNew = parent(row).isNone(); + return elementnew(row, isNew); + }); + }); + return rowOfCells.getOrThunk(function () { + return elementnew(generators.row(), true); + }); + }; + return map(rendered, function (details) { + var row = findRow(details.details); + return rowdatanew(row.element, details.details, details.section, row.isNew); + }); + }; + var toDetailList = function (grid, generators) { + var rendered = toDetails(grid, eq); + return deriveRows(rendered, generators); + }; + var findInWarehouse = function (warehouse, element) { + return findMap(warehouse.all, function (r) { + return find(r.cells, function (e) { + return eq(element, e.element); + }); + }); + }; + var run = function (operation, extract, adjustment, postAction, genWrappers) { + return function (wire, table, target, generators, sizing) { + var warehouse = Warehouse.fromTable(table); + var output = extract(warehouse, target).map(function (info) { + var model = fromWarehouse(warehouse, generators); + var result = operation(model, info, eq, genWrappers(generators)); + var grid = toDetailList(result.grid, generators); + return { + grid: grid, + cursor: result.cursor + }; + }); + return output.fold(function () { + return Optional.none(); + }, function (out) { + var newElements = render(table, out.grid); + var tableSizing = Optional.from(sizing).getOrThunk(function () { + return TableSize.getTableSize(table); + }); + adjustment(table, out.grid, tableSizing); + postAction(table); + refresh(wire, table); + return Optional.some({ + cursor: out.cursor, + newRows: newElements.newRows, + newCells: newElements.newCells + }); + }); + }; + }; + var onCell = function (warehouse, target) { + return cell(target.element).bind(function (cell) { + return findInWarehouse(warehouse, cell); + }); + }; + var onPaste = function (warehouse, target) { + return cell(target.element).bind(function (cell) { + return findInWarehouse(warehouse, cell).map(function (details) { + var value = __assign(__assign({}, details), { + generators: target.generators, + clipboard: target.clipboard + }); + return value; + }); + }); + }; + var onPasteByEditor = function (warehouse, target) { + var details = map(target.selection, function (cell$1) { + return cell(cell$1).bind(function (lc) { + return findInWarehouse(warehouse, lc); + }); + }); + var cells = cat(details); + return cells.length > 0 ? Optional.some({ + cells: cells, + generators: target.generators, + clipboard: target.clipboard + }) : Optional.none(); + }; + var onMergable = function (_warehouse, target) { + return target.mergable; + }; + var onUnmergable = function (_warehouse, target) { + return target.unmergable; + }; + var onCells = function (warehouse, target) { + var details = map(target.selection, function (cell$1) { + return cell(cell$1).bind(function (lc) { + return findInWarehouse(warehouse, lc); + }); + }); + var cells = cat(details); + return cells.length > 0 ? Optional.some(cells) : Optional.none(); + }; + + var merge = function (grid, bounds, comparator, substitution) { + var rows = extractGridDetails(grid).rows; + if (rows.length === 0) { + return grid; + } + for (var i = bounds.startRow; i <= bounds.finishRow; i++) { + for (var j = bounds.startCol; j <= bounds.finishCol; j++) { + mutateCell(rows[i], j, elementnew(substitution(), false)); + } + } + return grid; + }; + var unmerge = function (grid, target, comparator, substitution) { + var rows = extractGridDetails(grid).rows; + var first = true; + for (var i = 0; i < rows.length; i++) { + for (var j = 0; j < cellLength(rows[0]); j++) { + var current = getCellElement(rows[i], j); + var isToReplace = comparator(current, target); + if (isToReplace === true && first === false) { + mutateCell(rows[i], j, elementnew(substitution(), true)); + } else if (isToReplace === true) { + first = false; + } + } + } + return grid; + }; + var uniqueCells = function (row, comparator) { + return foldl(row, function (rest, cell) { + return exists(rest, function (currentCell) { + return comparator(currentCell.element, cell.element); + }) ? rest : rest.concat([cell]); + }, []); + }; + var splitCols = function (grid, index, comparator, substitution) { + if (index > 0 && index < grid[0].cells.length) { + each(grid, function (row) { + var prevCell = row.cells[index - 1]; + var current = row.cells[index]; + var isToReplace = comparator(current.element, prevCell.element); + if (isToReplace) { + mutateCell(row, index, elementnew(substitution(), true)); + } + }); + } + return grid; + }; + var splitRows = function (grid, index, comparator, substitution) { + var rows = extractGridDetails(grid).rows; + if (index > 0 && index < rows.length) { + var rowPrevCells = rows[index - 1].cells; + var cells = uniqueCells(rowPrevCells, comparator); + each(cells, function (cell) { + var replacement = Optional.none(); + var _loop_1 = function (i) { + var _loop_2 = function (j) { + var current = rows[i].cells[j]; + var isToReplace = comparator(current.element, cell.element); + if (isToReplace) { + if (replacement.isNone()) { + replacement = Optional.some(substitution()); + } + replacement.each(function (sub) { + mutateCell(rows[i], j, elementnew(sub, true)); + }); + } + }; + for (var j = 0; j < cellLength(rows[0]); j++) { + _loop_2(j); + } + }; + for (var i = index; i < rows.length; i++) { + _loop_1(i); + } + }); + } + return grid; + }; + + var value = function (o) { + var is = function (v) { + return o === v; + }; + var or = function (_opt) { + return value(o); + }; + var orThunk = function (_f) { + return value(o); + }; + var map = function (f) { + return value(f(o)); + }; + var mapError = function (_f) { + return value(o); + }; + var each = function (f) { + f(o); + }; + var bind = function (f) { + return f(o); + }; + var fold = function (_, onValue) { + return onValue(o); + }; + var exists = function (f) { + return f(o); + }; + var forall = function (f) { + return f(o); + }; + var toOptional = function () { + return Optional.some(o); + }; + return { + is: is, + isValue: always, + isError: never, + getOr: constant(o), + getOrThunk: constant(o), + getOrDie: constant(o), + or: or, + orThunk: orThunk, + fold: fold, + map: map, + mapError: mapError, + each: each, + bind: bind, + exists: exists, + forall: forall, + toOptional: toOptional + }; + }; + var error = function (message) { + var getOrThunk = function (f) { + return f(); + }; + var getOrDie = function () { + return die(String(message))(); + }; + var or = function (opt) { + return opt; + }; + var orThunk = function (f) { + return f(); + }; + var map = function (_f) { + return error(message); + }; + var mapError = function (f) { + return error(f(message)); + }; + var bind = function (_f) { + return error(message); + }; + var fold = function (onError, _) { + return onError(message); + }; + return { + is: never, + isValue: never, + isError: always, + getOr: identity, + getOrThunk: getOrThunk, + getOrDie: getOrDie, + or: or, + orThunk: orThunk, + fold: fold, + map: map, + mapError: mapError, + each: noop, + bind: bind, + exists: never, + forall: always, + toOptional: Optional.none + }; + }; + var fromOption = function (opt, err) { + return opt.fold(function () { + return error(err); + }, value); + }; + var Result = { + value: value, + error: error, + fromOption: fromOption + }; + + var measure = function (startAddress, gridA, gridB) { + if (startAddress.row >= gridA.length || startAddress.column > cellLength(gridA[0])) { + return Result.error('invalid start address out of table bounds, row: ' + startAddress.row + ', column: ' + startAddress.column); + } + var rowRemainder = gridA.slice(startAddress.row); + var colRemainder = rowRemainder[0].cells.slice(startAddress.column); + var colRequired = cellLength(gridB[0]); + var rowRequired = gridB.length; + return Result.value({ + rowDelta: rowRemainder.length - rowRequired, + colDelta: colRemainder.length - colRequired + }); + }; + var measureWidth = function (gridA, gridB) { + var colLengthA = cellLength(gridA[0]); + var colLengthB = cellLength(gridB[0]); + return { + rowDelta: 0, + colDelta: colLengthA - colLengthB + }; + }; + var measureHeight = function (gridA, gridB) { + var rowLengthA = gridA.length; + var rowLengthB = gridB.length; + return { + rowDelta: rowLengthA - rowLengthB, + colDelta: 0 + }; + }; + var generateElements = function (cells, row, generators) { + var getGenerator = row.section === 'colgroup' ? generators.col : generators.cell; + return map(cells, function () { + return elementnew(getGenerator(), true); + }); + }; + var rowFill = function (grid, amount, generators) { + return grid.concat(range(amount, function () { + var row = grid[grid.length - 1]; + return setCells(row, generateElements(row.cells, row, generators)); + })); + }; + var colFill = function (grid, amount, generators) { + return map(grid, function (row) { + var newChildren = generateElements(range(amount, identity), row, generators); + return setCells(row, row.cells.concat(newChildren)); + }); + }; + var tailor = function (gridA, delta, generators) { + var fillCols = delta.colDelta < 0 ? colFill : identity; + var fillRows = delta.rowDelta < 0 ? rowFill : identity; + var modifiedCols = fillCols(gridA, Math.abs(delta.colDelta), generators); + return fillRows(modifiedCols, Math.abs(delta.rowDelta), generators); + }; + + var isSpanning = function (grid, row, col, comparator) { + var candidate = getCell(grid[row], col); + var matching = curry(comparator, candidate.element); + var currentRow = grid[row]; + return grid.length > 1 && cellLength(currentRow) > 1 && (col > 0 && matching(getCellElement(currentRow, col - 1)) || col < currentRow.cells.length - 1 && matching(getCellElement(currentRow, col + 1)) || row > 0 && matching(getCellElement(grid[row - 1], col)) || row < grid.length - 1 && matching(getCellElement(grid[row + 1], col))); + }; + var mergeTables = function (startAddress, gridA, gridB, generator, comparator) { + var startRow = startAddress.row; + var startCol = startAddress.column; + var mergeHeight = gridB.length; + var mergeWidth = cellLength(gridB[0]); + var endRow = startRow + mergeHeight; + var endCol = startCol + mergeWidth; + for (var r = startRow; r < endRow; r++) { + for (var c = startCol; c < endCol; c++) { + if (isSpanning(gridA, r, c, comparator)) { + unmerge(gridA, getCellElement(gridA[r], c), comparator, generator.cell); + } + var newCell = getCellElement(gridB[r - startRow], c - startCol); + var replacement = generator.replace(newCell); + mutateCell(gridA[r], c, elementnew(replacement, true)); + } + } + return gridA; + }; + var merge$1 = function (startAddress, gridA, gridB, generator, comparator) { + var result = measure(startAddress, gridA, gridB); + return result.map(function (delta) { + var fittedGrid = tailor(gridA, delta, generator); + return mergeTables(startAddress, fittedGrid, gridB, generator, comparator); + }); + }; + var insertCols = function (index, gridA, gridB, generator, comparator) { + splitCols(gridA, index, comparator, generator.cell); + var delta = measureHeight(gridB, gridA); + var fittedNewGrid = tailor(gridB, delta, generator); + var secondDelta = measureHeight(gridA, fittedNewGrid); + var fittedOldGrid = tailor(gridA, secondDelta, generator); + return map(fittedOldGrid, function (gridRow, i) { + var newCells = gridRow.cells.slice(0, index).concat(fittedNewGrid[i].cells).concat(gridRow.cells.slice(index, gridRow.cells.length)); + return setCells(gridRow, newCells); + }); + }; + var insertRows = function (index, gridA, gridB, generator, comparator) { + splitRows(gridA, index, comparator, generator.cell); + var delta = measureWidth(gridB, gridA); + var fittedNewGrid = tailor(gridB, delta, generator); + var secondDelta = measureWidth(gridA, fittedNewGrid); + var fittedOldGrid = tailor(gridA, secondDelta, generator); + var _a = extractGridDetails(fittedOldGrid), oldCols = _a.cols, oldRows = _a.rows; + return oldCols.concat(oldRows.slice(0, index)).concat(fittedNewGrid).concat(oldRows.slice(index, oldRows.length)); + }; + + var insertRowAt = function (grid, index, example, comparator, substitution) { + var _a = extractGridDetails(grid), rows = _a.rows, cols = _a.cols; + var before = rows.slice(0, index); + var after = rows.slice(index); + var between = mapCells(rows[example], function (ex, c) { + var withinSpan = index > 0 && index < rows.length && comparator(getCellElement(rows[index - 1], c), getCellElement(rows[index], c)); + var ret = withinSpan ? getCell(rows[index], c) : elementnew(substitution(ex.element, comparator), true); + return ret; + }); + return cols.concat(before).concat([between]).concat(after); + }; + var getElementFor = function (row, column, section, withinSpan, example, comparator, substitution) { + if (section === 'colgroup' || !withinSpan) { + return elementnew(substitution(getCellElement(row, example), comparator), true); + } else { + return getCell(row, column); + } + }; + var insertColumnAt = function (grid, index, example, comparator, substitution) { + return map(grid, function (row) { + var withinSpan = index > 0 && index < cellLength(row) && comparator(getCellElement(row, index - 1), getCellElement(row, index)); + var sub = getElementFor(row, index, row.section, withinSpan, example, comparator, substitution); + return addCell(row, index, sub); + }); + }; + var deleteColumnsAt = function (grid, start, finish) { + var rows = map(grid, function (row) { + var cells = row.cells.slice(0, start).concat(row.cells.slice(finish + 1)); + return rowcells(cells, row.section); + }); + return filter(rows, function (row) { + return row.cells.length > 0; + }); + }; + var deleteRowsAt = function (grid, start, finish) { + var _a = extractGridDetails(grid), rows = _a.rows, cols = _a.cols; + return cols.concat(rows.slice(0, start)).concat(rows.slice(finish + 1)); + }; + + var replaceIn = function (grid, targets, comparator, substitution) { + var isTarget = function (cell) { + return exists(targets, function (target) { + return comparator(cell.element, target.element); + }); + }; + return map(grid, function (row) { + return mapCells(row, function (cell) { + return isTarget(cell) ? elementnew(substitution(cell.element, comparator), true) : cell; + }); + }); + }; + var notStartRow = function (grid, rowIndex, colIndex, comparator) { + return getCellElement(grid[rowIndex], colIndex) !== undefined && (rowIndex > 0 && comparator(getCellElement(grid[rowIndex - 1], colIndex), getCellElement(grid[rowIndex], colIndex))); + }; + var notStartColumn = function (row, index, comparator) { + return index > 0 && comparator(getCellElement(row, index - 1), getCellElement(row, index)); + }; + var replaceColumn = function (grid, index, comparator, substitution) { + var targets = bind(grid, function (row, i) { + var alreadyAdded = notStartRow(grid, i, index, comparator) || notStartColumn(row, index, comparator); + return alreadyAdded ? [] : [getCell(row, index)]; + }); + return replaceIn(grid, targets, comparator, substitution); + }; + var replaceRow = function (grid, index, comparator, substitution) { + var rows = extractGridDetails(grid).rows; + var targetRow = rows[index]; + var targets = bind(targetRow.cells, function (item, i) { + var alreadyAdded = notStartRow(rows, index, i, comparator) || notStartColumn(targetRow, i, comparator); + return alreadyAdded ? [] : [item]; + }); + return replaceIn(grid, targets, comparator, substitution); + }; + + var verifyGenerators = exactly([ + 'cell', + 'row', + 'replace', + 'gap', + 'col', + 'colgroup' + ]); + var elementToData = function (element) { + var colspan = getAttrValue(element, 'colspan', 1); + var rowspan = getAttrValue(element, 'rowspan', 1); + return { + element: element, + colspan: colspan, + rowspan: rowspan + }; + }; + var modification = function (generators, toData) { + if (toData === void 0) { + toData = elementToData; + } + verifyGenerators(generators); + var position = Cell(Optional.none()); + var nu = function (data) { + switch (name(data.element)) { + case 'col': + return generators.col(data); + default: + return generators.cell(data); + } + }; + var nuFrom = function (element) { + var data = toData(element); + return nu(data); + }; + var add = function (element) { + var replacement = nuFrom(element); + if (position.get().isNone()) { + position.set(Optional.some(replacement)); + } + recent = Optional.some({ + item: element, + replacement: replacement + }); + return replacement; + }; + var recent = Optional.none(); + var getOrInit = function (element, comparator) { + return recent.fold(function () { + return add(element); + }, function (p) { + return comparator(element, p.item) ? p.replacement : add(element); + }); + }; + return { + getOrInit: getOrInit, + cursor: position.get + }; + }; + var transform$1 = function (scope, tag) { + return function (generators) { + var position = Cell(Optional.none()); + verifyGenerators(generators); + var list = []; + var find$1 = function (element, comparator) { + return find(list, function (x) { + return comparator(x.item, element); + }); + }; + var makeNew = function (element) { + var attrs = { scope: scope }; + var cell = generators.replace(element, tag, attrs); + list.push({ + item: element, + sub: cell + }); + if (position.get().isNone()) { + position.set(Optional.some(cell)); + } + return cell; + }; + var replaceOrInit = function (element, comparator) { + return find$1(element, comparator).fold(function () { + return makeNew(element); + }, function (p) { + return comparator(element, p.item) ? p.sub : makeNew(element); + }); + }; + return { + replaceOrInit: replaceOrInit, + cursor: position.get + }; + }; + }; + var merging = function (generators) { + verifyGenerators(generators); + var position = Cell(Optional.none()); + var combine = function (cell) { + if (position.get().isNone()) { + position.set(Optional.some(cell)); + } + return function () { + var raw = generators.cell({ + element: cell, + colspan: 1, + rowspan: 1 + }); + remove$1(raw, 'width'); + remove$1(cell, 'width'); + return raw; + }; + }; + return { + combine: combine, + cursor: position.get + }; + }; + var Generators = { + modification: modification, + transform: transform$1, + merging: merging + }; + + var blockList = [ + 'body', + 'p', + 'div', + 'article', + 'aside', + 'figcaption', + 'figure', + 'footer', + 'header', + 'nav', + 'section', + 'ol', + 'ul', + 'table', + 'thead', + 'tfoot', + 'tbody', + 'caption', + 'tr', + 'td', + 'th', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'blockquote', + 'pre', + 'address' + ]; + var isList = function (universe, item) { + var tagName = universe.property().name(item); + return contains([ + 'ol', + 'ul' + ], tagName); + }; + var isBlock = function (universe, item) { + var tagName = universe.property().name(item); + return contains(blockList, tagName); + }; + var isEmptyTag = function (universe, item) { + return contains([ + 'br', + 'img', + 'hr', + 'input' + ], universe.property().name(item)); + }; + + var universe$2 = DomUniverse(); + var isBlock$1 = function (element) { + return isBlock(universe$2, element); + }; + var isList$1 = function (element) { + return isList(universe$2, element); + }; + var isEmptyTag$1 = function (element) { + return isEmptyTag(universe$2, element); + }; + + var merge$2 = function (cells) { + var isBr = function (el) { + return name(el) === 'br'; + }; + var advancedBr = function (children) { + return forall(children, function (c) { + return isBr(c) || isText(c) && get$3(c).trim().length === 0; + }); + }; + var isListItem = function (el) { + return name(el) === 'li' || ancestor(el, isList$1).isSome(); + }; + var siblingIsBlock = function (el) { + return nextSibling(el).map(function (rightSibling) { + if (isBlock$1(rightSibling)) { + return true; + } + if (isEmptyTag$1(rightSibling)) { + return name(rightSibling) === 'img' ? false : true; + } + return false; + }).getOr(false); + }; + var markCell = function (cell) { + return last$1(cell).bind(function (rightEdge) { + var rightSiblingIsBlock = siblingIsBlock(rightEdge); + return parent(rightEdge).map(function (parent) { + return rightSiblingIsBlock === true || isListItem(parent) || isBr(rightEdge) || isBlock$1(parent) && !eq(cell, parent) ? [] : [SugarElement.fromTag('br')]; + }); + }).getOr([]); + }; + var markContent = function () { + var content = bind(cells, function (cell) { + var children$1 = children(cell); + return advancedBr(children$1) ? [] : children$1.concat(markCell(cell)); + }); + return content.length === 0 ? [SugarElement.fromTag('br')] : content; + }; + var contents = markContent(); + empty(cells[0]); + append$1(cells[0], contents); + }; + + var prune = function (table) { + var cells$1 = cells(table); + if (cells$1.length === 0) { + remove$2(table); + } + }; + var outcome = function (grid, cursor) { + return { + grid: grid, + cursor: cursor + }; + }; + var elementFromGrid = function (grid, row, column) { + var rows = extractGridDetails(grid).rows; + return findIn(rows, row, column).orThunk(function () { + return findIn(rows, 0, 0); + }); + }; + var findIn = function (grid, row, column) { + return Optional.from(grid[row]).bind(function (r) { + return Optional.from(r.cells[column]).bind(function (c) { + return Optional.from(c.element); + }); + }); + }; + var bundle = function (grid, row, column) { + var rows = extractGridDetails(grid).rows; + return outcome(grid, findIn(rows, row, column)); + }; + var uniqueRows = function (details) { + return foldl(details, function (rest, detail) { + return exists(rest, function (currentDetail) { + return currentDetail.row === detail.row; + }) ? rest : rest.concat([detail]); + }, []).sort(function (detailA, detailB) { + return detailA.row - detailB.row; + }); + }; + var uniqueColumns = function (details) { + return foldl(details, function (rest, detail) { + return exists(rest, function (currentDetail) { + return currentDetail.column === detail.column; + }) ? rest : rest.concat([detail]); + }, []).sort(function (detailA, detailB) { + return detailA.column - detailB.column; + }); + }; + var opInsertRowsBefore = function (grid, details, comparator, genWrappers) { + var example = details[0].row; + var targetIndex = details[0].row; + var rows = uniqueRows(details); + var newGrid = foldl(rows, function (newG, _row) { + return insertRowAt(newG, targetIndex, example, comparator, genWrappers.getOrInit); + }, grid); + return bundle(newGrid, targetIndex, details[0].column); + }; + var opInsertRowsAfter = function (grid, details, comparator, genWrappers) { + var rows = uniqueRows(details); + var example = rows[rows.length - 1].row; + var targetIndex = rows[rows.length - 1].row + rows[rows.length - 1].rowspan; + var newGrid = foldl(rows, function (newG, _row) { + return insertRowAt(newG, targetIndex, example, comparator, genWrappers.getOrInit); + }, grid); + return bundle(newGrid, targetIndex, details[0].column); + }; + var opInsertColumnsBefore = function (grid, details, comparator, genWrappers) { + var columns = uniqueColumns(details); + var example = columns[0].column; + var targetIndex = columns[0].column; + var newGrid = foldl(columns, function (newG, _row) { + return insertColumnAt(newG, targetIndex, example, comparator, genWrappers.getOrInit); + }, grid); + return bundle(newGrid, details[0].row, targetIndex); + }; + var opInsertColumnsAfter = function (grid, details, comparator, genWrappers) { + var example = details[details.length - 1].column; + var targetIndex = details[details.length - 1].column + details[details.length - 1].colspan; + var columns = uniqueColumns(details); + var newGrid = foldl(columns, function (newG, _row) { + return insertColumnAt(newG, targetIndex, example, comparator, genWrappers.getOrInit); + }, grid); + return bundle(newGrid, details[0].row, targetIndex); + }; + var opMakeRowHeader = function (grid, detail, comparator, genWrappers) { + var newGrid = replaceRow(grid, detail.row, comparator, genWrappers.replaceOrInit); + return bundle(newGrid, detail.row, detail.column); + }; + var opMakeColumnHeader = function (grid, detail, comparator, genWrappers) { + var newGrid = replaceColumn(grid, detail.column, comparator, genWrappers.replaceOrInit); + return bundle(newGrid, detail.row, detail.column); + }; + var opUnmakeRowHeader = function (grid, detail, comparator, genWrappers) { + var newGrid = replaceRow(grid, detail.row, comparator, genWrappers.replaceOrInit); + return bundle(newGrid, detail.row, detail.column); + }; + var opUnmakeColumnHeader = function (grid, detail, comparator, genWrappers) { + var newGrid = replaceColumn(grid, detail.column, comparator, genWrappers.replaceOrInit); + return bundle(newGrid, detail.row, detail.column); + }; + var opEraseColumns = function (grid, details, _comparator, _genWrappers) { + var columns = uniqueColumns(details); + var newGrid = deleteColumnsAt(grid, columns[0].column, columns[columns.length - 1].column); + var cursor = elementFromGrid(newGrid, details[0].row, details[0].column); + return outcome(newGrid, cursor); + }; + var opEraseRows = function (grid, details, _comparator, _genWrappers) { + var rows = uniqueRows(details); + var newGrid = deleteRowsAt(grid, rows[0].row, rows[rows.length - 1].row); + var cursor = elementFromGrid(newGrid, details[0].row, details[0].column); + return outcome(newGrid, cursor); + }; + var opMergeCells = function (grid, mergable, comparator, _genWrappers) { + var cells = mergable.cells; + merge$2(cells); + var newGrid = merge(grid, mergable.bounds, comparator, constant(cells[0])); + return outcome(newGrid, Optional.from(cells[0])); + }; + var opUnmergeCells = function (grid, unmergable, comparator, genWrappers) { + var newGrid = foldr(unmergable, function (b, cell) { + return unmerge(b, cell, comparator, genWrappers.combine(cell)); + }, grid); + return outcome(newGrid, Optional.from(unmergable[0])); + }; + var opPasteCells = function (grid, pasteDetails, comparator, _genWrappers) { + var gridify = function (table, generators) { + var wh = Warehouse.fromTable(table); + return toGrid(wh, generators, true); + }; + var gridB = gridify(pasteDetails.clipboard, pasteDetails.generators); + var startAddress = address(pasteDetails.row, pasteDetails.column); + var mergedGrid = merge$1(startAddress, grid, gridB, pasteDetails.generators, comparator); + return mergedGrid.fold(function () { + return outcome(grid, Optional.some(pasteDetails.element)); + }, function (nuGrid) { + var cursor = elementFromGrid(nuGrid, pasteDetails.row, pasteDetails.column); + return outcome(nuGrid, cursor); + }); + }; + var gridifyRows = function (rows, generators, context) { + var pasteDetails = fromPastedRows(rows, context.section); + var wh = Warehouse.generate(pasteDetails); + return toGrid(wh, generators, true); + }; + var opPasteColsBefore = function (grid, pasteDetails, comparator, _genWrappers) { + var rows = extractGridDetails(grid).rows; + var index = pasteDetails.cells[0].column; + var context = rows[pasteDetails.cells[0].row]; + var gridB = gridifyRows(pasteDetails.clipboard, pasteDetails.generators, context); + var mergedGrid = insertCols(index, grid, gridB, pasteDetails.generators, comparator); + var cursor = elementFromGrid(mergedGrid, pasteDetails.cells[0].row, pasteDetails.cells[0].column); + return outcome(mergedGrid, cursor); + }; + var opPasteColsAfter = function (grid, pasteDetails, comparator, _genWrappers) { + var rows = extractGridDetails(grid).rows; + var index = pasteDetails.cells[pasteDetails.cells.length - 1].column + pasteDetails.cells[pasteDetails.cells.length - 1].colspan; + var context = rows[pasteDetails.cells[0].row]; + var gridB = gridifyRows(pasteDetails.clipboard, pasteDetails.generators, context); + var mergedGrid = insertCols(index, grid, gridB, pasteDetails.generators, comparator); + var cursor = elementFromGrid(mergedGrid, pasteDetails.cells[0].row, pasteDetails.cells[0].column); + return outcome(mergedGrid, cursor); + }; + var opPasteRowsBefore = function (grid, pasteDetails, comparator, _genWrappers) { + var rows = extractGridDetails(grid).rows; + var index = pasteDetails.cells[0].row; + var context = rows[index]; + var gridB = gridifyRows(pasteDetails.clipboard, pasteDetails.generators, context); + var mergedGrid = insertRows(index, grid, gridB, pasteDetails.generators, comparator); + var cursor = elementFromGrid(mergedGrid, pasteDetails.cells[0].row, pasteDetails.cells[0].column); + return outcome(mergedGrid, cursor); + }; + var opPasteRowsAfter = function (grid, pasteDetails, comparator, _genWrappers) { + var rows = extractGridDetails(grid).rows; + var index = pasteDetails.cells[pasteDetails.cells.length - 1].row + pasteDetails.cells[pasteDetails.cells.length - 1].rowspan; + var context = rows[pasteDetails.cells[0].row]; + var gridB = gridifyRows(pasteDetails.clipboard, pasteDetails.generators, context); + var mergedGrid = insertRows(index, grid, gridB, pasteDetails.generators, comparator); + var cursor = elementFromGrid(mergedGrid, pasteDetails.cells[0].row, pasteDetails.cells[0].column); + return outcome(mergedGrid, cursor); + }; + var opGetColumnType = function (table, target) { + var house = Warehouse.fromTable(table); + var details = onCells(house, target); + return details.bind(function (selectedCells) { + var lastSelectedCell = selectedCells[selectedCells.length - 1]; + var minColRange = selectedCells[0].column; + var maxColRange = lastSelectedCell.column + lastSelectedCell.colspan; + var selectedColumnCells = flatten(map(house.all, function (row) { + return filter(row.cells, function (cell) { + return cell.column >= minColRange && cell.column < maxColRange; + }); + })); + return getCellsType(selectedColumnCells, function (cell) { + return name(cell.element) === 'th'; + }); + }).getOr(''); + }; + var getCellsType = function (cells, headerPred) { + var headerCells = filter(cells, headerPred); + if (headerCells.length === 0) { + return Optional.some('td'); + } else if (headerCells.length === cells.length) { + return Optional.some('th'); + } else { + return Optional.none(); + } + }; + var resize = adjustWidthTo; + var insertRowsBefore = run(opInsertRowsBefore, onCells, noop, noop, Generators.modification); + var insertRowsAfter = run(opInsertRowsAfter, onCells, noop, noop, Generators.modification); + var insertColumnsBefore = run(opInsertColumnsBefore, onCells, resize, noop, Generators.modification); + var insertColumnsAfter = run(opInsertColumnsAfter, onCells, resize, noop, Generators.modification); + var eraseColumns = run(opEraseColumns, onCells, resize, prune, Generators.modification); + var eraseRows = run(opEraseRows, onCells, noop, prune, Generators.modification); + var makeColumnHeader = run(opMakeColumnHeader, onCell, noop, noop, Generators.transform('row', 'th')); + var unmakeColumnHeader = run(opUnmakeColumnHeader, onCell, noop, noop, Generators.transform(null, 'td')); + var makeRowHeader = run(opMakeRowHeader, onCell, noop, noop, Generators.transform('col', 'th')); + var unmakeRowHeader = run(opUnmakeRowHeader, onCell, noop, noop, Generators.transform(null, 'td')); + var mergeCells = run(opMergeCells, onMergable, noop, noop, Generators.merging); + var unmergeCells = run(opUnmergeCells, onUnmergable, resize, noop, Generators.merging); + var pasteCells = run(opPasteCells, onPaste, resize, noop, Generators.modification); + var pasteColsBefore = run(opPasteColsBefore, onPasteByEditor, noop, noop, Generators.modification); + var pasteColsAfter = run(opPasteColsAfter, onPasteByEditor, noop, noop, Generators.modification); + var pasteRowsBefore = run(opPasteRowsBefore, onPasteByEditor, noop, noop, Generators.modification); + var pasteRowsAfter = run(opPasteRowsAfter, onPasteByEditor, noop, noop, Generators.modification); + var getColumnType = opGetColumnType; + + var getSection = function (elm) { + return getNodeName(elm.parentNode); + }; + var mapSectionNameToType = function (section) { + if (section === 'thead') { + return 'header'; + } else if (section === 'tfoot') { + return 'footer'; + } else { + return 'body'; + } + }; + var detectHeaderRow = function (editor, elm) { + var isThead = getSection(elm) === 'thead'; + var areAllCellsThs = !exists(elm.cells, function (c) { + return getNodeName(c) !== 'th'; + }); + return isThead || areAllCellsThs ? Optional.some({ + thead: isThead, + ths: areAllCellsThs + }) : Optional.none(); + }; + var getRowType = function (editor, elm) { + return mapSectionNameToType(detectHeaderRow(editor, elm).fold(function () { + return getSection(elm); + }, function (_rowConfig) { + return 'thead'; + })); + }; + var switchRowSection = function (dom, rowElm, newSectionName) { + var tableElm = dom.getParent(rowElm, 'table'); + var oldSectionElm = rowElm.parentNode; + var oldSectionName = getNodeName(oldSectionElm); + if (newSectionName !== oldSectionName) { + var sectionElm_1 = dom.select(newSectionName, tableElm)[0]; + if (!sectionElm_1) { + sectionElm_1 = dom.create(newSectionName); + var firstTableChild_1 = tableElm.firstChild; + if (newSectionName === 'thead') { + last(children$2(SugarElement.fromDom(tableElm), 'caption,colgroup')).fold(function () { + return tableElm.insertBefore(sectionElm_1, firstTableChild_1); + }, function (c) { + return dom.insertAfter(sectionElm_1, c.dom); + }); + } else { + tableElm.appendChild(sectionElm_1); + } + } + if (newSectionName === 'tbody' && oldSectionName === 'thead' && sectionElm_1.firstChild) { + sectionElm_1.insertBefore(rowElm, sectionElm_1.firstChild); + } else { + sectionElm_1.appendChild(rowElm); + } + if (!oldSectionElm.hasChildNodes()) { + dom.remove(oldSectionElm); + } + } + }; + var switchCellType = function (dom, cells, newCellType, scope) { + return each(cells, function (c) { + var newCell = getNodeName(c) !== newCellType ? dom.rename(c, newCellType) : c; + dom.setAttrib(newCell, 'scope', scope); + }); + }; + var switchSectionType = function (editor, rowElm, newType) { + var determineHeaderRowType = function () { + var allTableRows = table(SugarElement.fromDom(rowElm.cells[0])).map(function (table) { + return rows(table); + }).getOr([]); + return findMap(allTableRows, function (row) { + return detectHeaderRow(editor, row.dom); + }).map(function (detectedType) { + if (detectedType.thead && detectedType.ths) { + return 'sectionCells'; + } else { + return detectedType.thead ? 'section' : 'cells'; + } + }).getOr('section'); + }; + var dom = editor.dom; + if (newType === 'header') { + var headerRowTypeSetting = getTableHeaderType(editor); + var headerRowType = headerRowTypeSetting === 'auto' ? determineHeaderRowType() : headerRowTypeSetting; + switchCellType(dom, rowElm.cells, headerRowType === 'section' ? 'td' : 'th', 'col'); + switchRowSection(dom, rowElm, headerRowType === 'cells' ? 'tbody' : 'thead'); + } else { + switchCellType(dom, rowElm.cells, 'td', null); + switchRowSection(dom, rowElm, newType === 'footer' ? 'tfoot' : 'tbody'); + } + }; + + var getSelectionStartCellFallback = function (start) { + return table(start).bind(function (table) { + return retrieve$1(table, ephemera.firstSelectedSelector); + }).fold(function () { + return start; + }, function (cells) { + return cells[0]; + }); + }; + var getSelectionStartFromSelector = function (selector) { + return function (start) { + var startCellName = name(start); + var startCell = startCellName === 'col' || startCellName === 'colgroup' ? getSelectionStartCellFallback(start) : start; + return closest$1(startCell, selector); + }; + }; + var getSelectionStartCell = getSelectionStartFromSelector('th,td'); + var getSelectionStartCellOrCaption = getSelectionStartFromSelector('th,td,caption'); + var getCellsFromSelection = function (start, selections) { + return getSelectionStartCell(start).map(function (_cell) { + return selection(selections); + }).getOr([]); + }; + var getRowsFromSelection = function (start, selector) { + var cellOpt = getSelectionStartCell(start); + var rowsOpt = cellOpt.bind(function (cell) { + return table(cell); + }).map(function (table) { + return rows(table); + }); + return lift2(cellOpt, rowsOpt, function (cell, rows) { + return filter(rows, function (row) { + return exists(fromDom$1(row.dom.cells), function (rowCell) { + return get$1(rowCell, selector) === '1' || eq(rowCell, cell); + }); + }); + }).getOr([]); + }; + + var TableActions = function (editor, lazyWire, selections) { + var isTableBody = function (editor) { + return name(getBody$1(editor)) === 'table'; + }; + var lastRowGuard = function (table) { + return isTableBody(editor) === false || getGridSize(table).rows > 1; + }; + var lastColumnGuard = function (table) { + return isTableBody(editor) === false || getGridSize(table).columns > 1; + }; + var cloneFormats = getCloneElements(editor); + var execute = function (operation, guard, mutate, lazyWire) { + return function (table, target) { + removeDataStyle(table); + var wire = lazyWire(); + var doc = SugarElement.fromDom(editor.getDoc()); + var generators = cellOperations(mutate, doc, cloneFormats); + var sizing = get$8(editor, table); + return guard(table) ? operation(wire, table, target, generators, sizing).bind(function (result) { + each(result.newRows, function (row) { + fireNewRow(editor, row.dom); + }); + each(result.newCells, function (cell) { + fireNewCell(editor, cell.dom); + }); + return result.cursor.map(function (cell) { + var des = freefallRtl$2(cell); + var rng = editor.dom.createRng(); + rng.setStart(des.element.dom, des.offset); + rng.setEnd(des.element.dom, des.offset); + return rng; + }); + }) : Optional.none(); + }; + }; + var deleteRow = execute(eraseRows, lastRowGuard, noop, lazyWire); + var deleteColumn = execute(eraseColumns, lastColumnGuard, noop, lazyWire); + var insertRowsBefore$1 = execute(insertRowsBefore, always, noop, lazyWire); + var insertRowsAfter$1 = execute(insertRowsAfter, always, noop, lazyWire); + var insertColumnsBefore$1 = execute(insertColumnsBefore, always, halve, lazyWire); + var insertColumnsAfter$1 = execute(insertColumnsAfter, always, halve, lazyWire); + var mergeCells$1 = execute(mergeCells, always, noop, lazyWire); + var unmergeCells$1 = execute(unmergeCells, always, noop, lazyWire); + var pasteColsBefore$1 = execute(pasteColsBefore, always, noop, lazyWire); + var pasteColsAfter$1 = execute(pasteColsAfter, always, noop, lazyWire); + var pasteRowsBefore$1 = execute(pasteRowsBefore, always, noop, lazyWire); + var pasteRowsAfter$1 = execute(pasteRowsAfter, always, noop, lazyWire); + var pasteCells$1 = execute(pasteCells, always, noop, lazyWire); + var extractType = function (args, validTypes) { + return get(args, 'type').filter(function (type) { + return contains(validTypes, type); + }); + }; + var setTableCellType = function (editor, args) { + return extractType(args, [ + 'td', + 'th' + ]).each(function (type) { + var cells = map(getCellsFromSelection(getSelectionStart(editor), selections), function (c) { + return c.dom; + }); + switchCellType(editor.dom, cells, type, null); + }); + }; + var setTableRowType = function (editor, args) { + return extractType(args, [ + 'header', + 'body', + 'footer' + ]).each(function (type) { + map(getRowsFromSelection(getSelectionStart(editor), ephemera.selected), function (row) { + return switchSectionType(editor, row.dom, type); + }); + }); + }; + var makeColumnHeader$1 = execute(makeColumnHeader, always, noop, lazyWire); + var unmakeColumnHeader$1 = execute(unmakeColumnHeader, always, noop, lazyWire); + var getTableRowType = function (editor) { + var rows = getRowsFromSelection(getSelectionStart(editor), ephemera.selected); + if (rows.length > 0) { + var rowTypes = map(rows, function (r) { + return getRowType(editor, r.dom); + }); + var hasHeader = contains(rowTypes, 'header'); + var hasFooter = contains(rowTypes, 'footer'); + if (!hasHeader && !hasFooter) { + return 'body'; + } else { + var hasBody = contains(rowTypes, 'body'); + if (hasHeader && !hasBody && !hasFooter) { + return 'header'; + } else if (!hasHeader && !hasBody && hasFooter) { + return 'footer'; + } else { + return ''; + } + } + } + }; + var getTableCellType = function (editor) { + return getCellsType(getCellsFromSelection(getSelectionStart(editor), selections), function (cell) { + return name(cell) === 'th'; + }).getOr(''); + }; + var getTableColType = getColumnType; + return { + deleteRow: deleteRow, + deleteColumn: deleteColumn, + insertRowsBefore: insertRowsBefore$1, + insertRowsAfter: insertRowsAfter$1, + insertColumnsBefore: insertColumnsBefore$1, + insertColumnsAfter: insertColumnsAfter$1, + mergeCells: mergeCells$1, + unmergeCells: unmergeCells$1, + pasteColsBefore: pasteColsBefore$1, + pasteColsAfter: pasteColsAfter$1, + pasteRowsBefore: pasteRowsBefore$1, + pasteRowsAfter: pasteRowsAfter$1, + pasteCells: pasteCells$1, + setTableCellType: setTableCellType, + setTableRowType: setTableRowType, + makeColumnHeader: makeColumnHeader$1, + unmakeColumnHeader: unmakeColumnHeader$1, + getTableRowType: getTableRowType, + getTableCellType: getTableCellType, + getTableColType: getTableColType + }; + }; + + var DefaultRenderOptions = { + styles: { + 'border-collapse': 'collapse', + 'width': '100%' + }, + attributes: { border: '1' }, + colGroups: false + }; + var tableHeaderCell = function () { + return SugarElement.fromTag('th'); + }; + var tableCell = function () { + return SugarElement.fromTag('td'); + }; + var tableColumn = function () { + return SugarElement.fromTag('col'); + }; + var createRow = function (columns, rowHeaders, columnHeaders, rowIndex) { + var tr = SugarElement.fromTag('tr'); + for (var j = 0; j < columns; j++) { + var td = rowIndex < rowHeaders || j < columnHeaders ? tableHeaderCell() : tableCell(); + if (j < columnHeaders) { + set(td, 'scope', 'row'); + } + if (rowIndex < rowHeaders) { + set(td, 'scope', 'col'); + } + append(td, SugarElement.fromTag('br')); + append(tr, td); + } + return tr; + }; + var createGroupRow = function (columns) { + var columnGroup = SugarElement.fromTag('colgroup'); + range(columns, function () { + return append(columnGroup, tableColumn()); + }); + return columnGroup; + }; + var createRows = function (rows, columns, rowHeaders, columnHeaders) { + return range(rows, function (r) { + return createRow(columns, rowHeaders, columnHeaders, r); + }); + }; + var render$1 = function (rows, columns, rowHeaders, columnHeaders, headerType, renderOpts) { + if (renderOpts === void 0) { + renderOpts = DefaultRenderOptions; + } + var table = SugarElement.fromTag('table'); + var rowHeadersGoInThead = headerType !== 'cells'; + setAll$1(table, renderOpts.styles); + setAll(table, renderOpts.attributes); + if (renderOpts.colGroups) { + append(table, createGroupRow(columns)); + } + var actualRowHeaders = Math.min(rows, rowHeaders); + if (rowHeadersGoInThead && rowHeaders > 0) { + var thead = SugarElement.fromTag('thead'); + append(table, thead); + var theadRowHeaders = headerType === 'sectionCells' ? actualRowHeaders : 0; + var theadRows = createRows(rowHeaders, columns, theadRowHeaders, columnHeaders); + append$1(thead, theadRows); + } + var tbody = SugarElement.fromTag('tbody'); + append(table, tbody); + var numRows = rowHeadersGoInThead ? rows - actualRowHeaders : rows; + var numRowHeaders = rowHeadersGoInThead ? 0 : rowHeaders; + var tbodyRows = createRows(numRows, columns, numRowHeaders, columnHeaders); + append$1(tbody, tbodyRows); + return table; + }; + + var get$a = function (element) { + return element.dom.innerHTML; + }; + var getOuter$2 = function (element) { + var container = SugarElement.fromTag('div'); + var clone = SugarElement.fromDom(element.dom.cloneNode(true)); + append(container, clone); + return get$a(container); + }; + + var placeCaretInCell = function (editor, cell) { + editor.selection.select(cell.dom, true); + editor.selection.collapse(true); + }; + var selectFirstCellInTable = function (editor, tableElm) { + descendant$1(tableElm, 'td,th').each(curry(placeCaretInCell, editor)); + }; + var fireEvents = function (editor, table) { + each(descendants$1(table, 'tr'), function (row) { + fireNewRow(editor, row.dom); + each(descendants$1(row, 'th,td'), function (cell) { + fireNewCell(editor, cell.dom); + }); + }); + }; + var isPercentage$1 = function (width) { + return isString(width) && width.indexOf('%') !== -1; + }; + var insert$1 = function (editor, columns, rows, colHeaders, rowHeaders) { + var defaultStyles = getDefaultStyles(editor); + var options = { + styles: defaultStyles, + attributes: getDefaultAttributes(editor), + colGroups: useColumnGroup(editor) + }; + var table = render$1(rows, columns, rowHeaders, colHeaders, getTableHeaderType(editor), options); + set(table, 'data-mce-id', '__mce'); + var html = getOuter$2(table); + editor.insertContent(html); + return descendant$1(getBody$1(editor), 'table[data-mce-id="__mce"]').map(function (table) { + if (isPixelsForced(editor)) { + enforcePixels(editor, table); + } else if (isResponsiveForced(editor)) { + enforceNone(table); + } else if (isPercentagesForced(editor) || isPercentage$1(defaultStyles.width)) { + enforcePercentage(editor, table); + } + removeDataStyle(table); + remove(table, 'data-mce-id'); + fireEvents(editor, table); + selectFirstCellInTable(editor, table); + return table.dom; + }).getOr(null); + }; + var insertTableWithDataValidation = function (editor, rows, columns, options, errorMsg) { + if (options === void 0) { + options = {}; + } + var checkInput = function (val) { + return isNumber(val) && val > 0; + }; + if (checkInput(rows) && checkInput(columns)) { + var headerRows = options.headerRows || 0; + var headerColumns = options.headerColumns || 0; + return insert$1(editor, columns, rows, headerColumns, headerRows); + } else { + console.error(errorMsg); + return null; + } + }; + + var getClipboardElements = function (getClipboard) { + return function () { + return getClipboard().fold(function () { + return []; + }, function (elems) { + return map(elems, function (e) { + return e.dom; + }); + }); + }; + }; + var setClipboardElements = function (setClipboard) { + return function (elems) { + var elmsOpt = elems.length > 0 ? Optional.some(fromDom$1(elems)) : Optional.none(); + setClipboard(elmsOpt); + }; + }; + var getApi = function (editor, clipboard, resizeHandler, selectionTargets) { + return { + insertTable: function (columns, rows, options) { + if (options === void 0) { + options = {}; + } + return insertTableWithDataValidation(editor, rows, columns, options, 'Invalid values for insertTable - rows and columns values are required to insert a table.'); + }, + setClipboardRows: setClipboardElements(clipboard.setRows), + getClipboardRows: getClipboardElements(clipboard.getRows), + setClipboardCols: setClipboardElements(clipboard.setColumns), + getClipboardCols: getClipboardElements(clipboard.getColumns), + resizeHandler: resizeHandler, + selectionTargets: selectionTargets + }; + }; + + var constrainSpan = function (element, property, value) { + var currentColspan = getAttrValue(element, property, 1); + if (value === 1 || currentColspan <= 1) { + remove(element, property); + } else { + set(element, property, Math.min(value, currentColspan)); + } + }; + var generateColGroup = function (house, minColRange, maxColRange) { + if (Warehouse.hasColumns(house)) { + var colsToCopy = filter(Warehouse.justColumns(house), function (col) { + return col.column >= minColRange && col.column < maxColRange; + }); + var copiedCols = map(colsToCopy, function (c) { + var clonedCol = deep(c.element); + constrainSpan(clonedCol, 'span', maxColRange - minColRange); + return clonedCol; + }); + var fakeColgroup = SugarElement.fromTag('colgroup'); + append$1(fakeColgroup, copiedCols); + return [fakeColgroup]; + } else { + return []; + } + }; + var generateRows = function (house, minColRange, maxColRange) { + return map(house.all, function (row) { + var cellsToCopy = filter(row.cells, function (cell) { + return cell.column >= minColRange && cell.column < maxColRange; + }); + var copiedCells = map(cellsToCopy, function (cell) { + var clonedCell = deep(cell.element); + constrainSpan(clonedCell, 'colspan', maxColRange - minColRange); + return clonedCell; + }); + var fakeTR = SugarElement.fromTag('tr'); + append$1(fakeTR, copiedCells); + return fakeTR; + }); + }; + var copyCols = function (table, target) { + var house = Warehouse.fromTable(table); + var details = onCells(house, target); + return details.map(function (selectedCells) { + var lastSelectedCell = selectedCells[selectedCells.length - 1]; + var minColRange = selectedCells[0].column; + var maxColRange = lastSelectedCell.column + lastSelectedCell.colspan; + var fakeColGroups = generateColGroup(house, minColRange, maxColRange); + var fakeRows = generateRows(house, minColRange, maxColRange); + return __spreadArrays(fakeColGroups, fakeRows); + }); + }; + + var copyRows = function (table, target, generators) { + var warehouse = Warehouse.fromTable(table); + var details = onCells(warehouse, target); + return details.map(function (selectedCells) { + var grid = toGrid(warehouse, generators, false); + var rows = extractGridDetails(grid).rows; + var slicedGrid = rows.slice(selectedCells[0].row, selectedCells[selectedCells.length - 1].row + selectedCells[selectedCells.length - 1].rowspan); + var slicedDetails = toDetailList(slicedGrid, generators); + return copy$2(slicedDetails); + }); + }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var getTDTHOverallStyle = function (dom, elm, name) { + var cells = dom.select('td,th', elm); + var firstChildStyle; + var checkChildren = function (firstChildStyle, elms) { + for (var i = 0; i < elms.length; i++) { + var currentStyle = dom.getStyle(elms[i], name); + if (typeof firstChildStyle === 'undefined') { + firstChildStyle = currentStyle; + } + if (firstChildStyle !== currentStyle) { + return ''; + } + } + return firstChildStyle; + }; + return checkChildren(firstChildStyle, cells); + }; + var applyAlign = function (editor, elm, name) { + if (name) { + editor.formatter.apply('align' + name, {}, elm); + } + }; + var applyVAlign = function (editor, elm, name) { + if (name) { + editor.formatter.apply('valign' + name, {}, elm); + } + }; + var unApplyAlign = function (editor, elm) { + global$1.each('left center right'.split(' '), function (name) { + editor.formatter.remove('align' + name, {}, elm); + }); + }; + var unApplyVAlign = function (editor, elm) { + global$1.each('top middle bottom'.split(' '), function (name) { + editor.formatter.remove('valign' + name, {}, elm); + }); + }; + + var isListGroup = function (item) { + return hasNonNullableKey(item, 'menu'); + }; + var buildListItems = function (inputList, startItems) { + var appendItems = function (values, acc) { + return acc.concat(map(values, function (item) { + var text = item.text || item.title; + if (isListGroup(item)) { + return { + text: text, + items: buildListItems(item.menu) + }; + } else { + return { + text: text, + value: item.value + }; + } + })); + }; + return appendItems(inputList, startItems || []); + }; + var rgbToHex = function (dom) { + return function (value) { + return startsWith(value, 'rgb') ? dom.toHex(value) : value; + }; + }; + var extractAdvancedStyles = function (dom, elm) { + var element = SugarElement.fromDom(elm); + return { + borderwidth: getRaw(element, 'border-width').getOr(''), + borderstyle: getRaw(element, 'border-style').getOr(''), + bordercolor: getRaw(element, 'border-color').map(rgbToHex(dom)).getOr(''), + backgroundcolor: getRaw(element, 'background-color').map(rgbToHex(dom)).getOr('') + }; + }; + var getSharedValues = function (data) { + var baseData = data[0]; + var comparisonData = data.slice(1); + each(comparisonData, function (items) { + each(keys(baseData), function (key) { + each$1(items, function (itemValue, itemKey) { + var comparisonValue = baseData[key]; + if (comparisonValue !== '' && key === itemKey) { + if (comparisonValue !== itemValue) { + baseData[key] = ''; + } + } + }); + }); + }); + return baseData; + }; + var getAdvancedTab = function (dialogName) { + var advTabItems = [ + { + name: 'borderstyle', + type: 'listbox', + label: 'Border style', + items: [ + { + text: 'Select...', + value: '' + }, + { + text: 'Solid', + value: 'solid' + }, + { + text: 'Dotted', + value: 'dotted' + }, + { + text: 'Dashed', + value: 'dashed' + }, + { + text: 'Double', + value: 'double' + }, + { + text: 'Groove', + value: 'groove' + }, + { + text: 'Ridge', + value: 'ridge' + }, + { + text: 'Inset', + value: 'inset' + }, + { + text: 'Outset', + value: 'outset' + }, + { + text: 'None', + value: 'none' + }, + { + text: 'Hidden', + value: 'hidden' + } + ] + }, + { + name: 'bordercolor', + type: 'colorinput', + label: 'Border color' + }, + { + name: 'backgroundcolor', + type: 'colorinput', + label: 'Background color' + } + ]; + var borderWidth = { + name: 'borderwidth', + type: 'input', + label: 'Border width' + }; + var items = dialogName === 'cell' ? [borderWidth].concat(advTabItems) : advTabItems; + return { + title: 'Advanced', + name: 'advanced', + items: items + }; + }; + var getAlignment = function (formats, formatName, editor, elm) { + return find(formats, function (name) { + return editor.formatter.matchNode(elm, formatName + name); + }).getOr(''); + }; + var getHAlignment = curry(getAlignment, [ + 'left', + 'center', + 'right' + ], 'align'); + var getVAlignment = curry(getAlignment, [ + 'top', + 'middle', + 'bottom' + ], 'valign'); + var extractDataFromSettings = function (editor, hasAdvTableTab) { + var style = getDefaultStyles(editor); + var attrs = getDefaultAttributes(editor); + var extractAdvancedStyleData = function (dom) { + return { + borderstyle: get(style, 'border-style').getOr(''), + bordercolor: rgbToHex(dom)(get(style, 'border-color').getOr('')), + backgroundcolor: rgbToHex(dom)(get(style, 'background-color').getOr('')) + }; + }; + var defaultData = { + height: '', + width: '100%', + cellspacing: '', + cellpadding: '', + caption: false, + class: '', + align: '', + border: '' + }; + var getBorder = function () { + var borderWidth = style['border-width']; + if (shouldStyleWithCss(editor) && borderWidth) { + return { border: borderWidth }; + } + return get(attrs, 'border').fold(function () { + return {}; + }, function (border) { + return { border: border }; + }); + }; + var advStyle = hasAdvTableTab ? extractAdvancedStyleData(editor.dom) : {}; + var getCellPaddingCellSpacing = function () { + var spacing = get(style, 'border-spacing').or(get(attrs, 'cellspacing')).fold(function () { + return {}; + }, function (cellspacing) { + return { cellspacing: cellspacing }; + }); + var padding = get(style, 'border-padding').or(get(attrs, 'cellpadding')).fold(function () { + return {}; + }, function (cellpadding) { + return { cellpadding: cellpadding }; + }); + return __assign(__assign({}, spacing), padding); + }; + var data = __assign(__assign(__assign(__assign(__assign(__assign({}, defaultData), style), attrs), advStyle), getBorder()), getCellPaddingCellSpacing()); + return data; + }; + var extractDataFromTableElement = function (editor, elm, hasAdvTableTab) { + var getBorder = function (dom, elm) { + var optBorderWidth = getRaw(SugarElement.fromDom(elm), 'border-width'); + if (shouldStyleWithCss(editor) && optBorderWidth.isSome()) { + return optBorderWidth.getOr(''); + } + return dom.getAttrib(elm, 'border') || getTDTHOverallStyle(editor.dom, elm, 'border-width') || getTDTHOverallStyle(editor.dom, elm, 'border'); + }; + var dom = editor.dom; + return __assign({ + width: dom.getStyle(elm, 'width') || dom.getAttrib(elm, 'width'), + height: dom.getStyle(elm, 'height') || dom.getAttrib(elm, 'height'), + cellspacing: dom.getStyle(elm, 'border-spacing') || dom.getAttrib(elm, 'cellspacing'), + cellpadding: dom.getAttrib(elm, 'cellpadding') || getTDTHOverallStyle(editor.dom, elm, 'padding'), + border: getBorder(dom, elm), + caption: !!dom.select('caption', elm)[0], + class: dom.getAttrib(elm, 'class', ''), + align: getHAlignment(editor, elm) + }, hasAdvTableTab ? extractAdvancedStyles(dom, elm) : {}); + }; + var extractDataFromRowElement = function (editor, elm, hasAdvancedRowTab) { + var dom = editor.dom; + return __assign({ + height: dom.getStyle(elm, 'height') || dom.getAttrib(elm, 'height'), + scope: dom.getAttrib(elm, 'scope'), + class: dom.getAttrib(elm, 'class', ''), + type: getRowType(editor, elm), + align: getHAlignment(editor, elm) + }, hasAdvancedRowTab ? extractAdvancedStyles(dom, elm) : {}); + }; + var extractDataFromCellElement = function (editor, cell, hasAdvancedCellTab, column) { + var dom = editor.dom; + var colElm = column.getOr(cell); + var getStyle = function (element, style) { + return dom.getStyle(element, style) || dom.getAttrib(element, style); + }; + return __assign({ + width: getStyle(colElm, 'width'), + height: getStyle(cell, 'height'), + scope: dom.getAttrib(cell, 'scope'), + celltype: getNodeName(cell), + class: dom.getAttrib(cell, 'class', ''), + halign: getHAlignment(editor, cell), + valign: getVAlignment(editor, cell) + }, hasAdvancedCellTab ? extractAdvancedStyles(dom, cell) : {}); + }; + + var getClassList = function (editor) { + var classes = buildListItems(getCellClassList(editor)); + if (classes.length > 0) { + return Optional.some({ + name: 'class', + type: 'listbox', + label: 'Class', + items: classes + }); + } + return Optional.none(); + }; + var children$3 = [ + { + name: 'width', + type: 'input', + label: 'Width' + }, + { + name: 'height', + type: 'input', + label: 'Height' + }, + { + name: 'celltype', + type: 'listbox', + label: 'Cell type', + items: [ + { + text: 'Cell', + value: 'td' + }, + { + text: 'Header cell', + value: 'th' + } + ] + }, + { + name: 'scope', + type: 'listbox', + label: 'Scope', + items: [ + { + text: 'None', + value: '' + }, + { + text: 'Row', + value: 'row' + }, + { + text: 'Column', + value: 'col' + }, + { + text: 'Row group', + value: 'rowgroup' + }, + { + text: 'Column group', + value: 'colgroup' + } + ] + }, + { + name: 'halign', + type: 'listbox', + label: 'H Align', + items: [ + { + text: 'None', + value: '' + }, + { + text: 'Left', + value: 'left' + }, + { + text: 'Center', + value: 'center' + }, + { + text: 'Right', + value: 'right' + } + ] + }, + { + name: 'valign', + type: 'listbox', + label: 'V Align', + items: [ + { + text: 'None', + value: '' + }, + { + text: 'Top', + value: 'top' + }, + { + text: 'Middle', + value: 'middle' + }, + { + text: 'Bottom', + value: 'bottom' + } + ] + } + ]; + var getItems = function (editor) { + return children$3.concat(getClassList(editor).toArray()); + }; + + var modifiers = function (testTruthy) { + return function (editor, node) { + var dom = editor.dom; + var setAttrib = function (attr, value) { + if (!testTruthy || value) { + dom.setAttrib(node, attr, value); + } + }; + var setStyle = function (prop, value) { + if (!testTruthy || value) { + dom.setStyle(node, prop, value); + } + }; + var setFormat = function (formatName, value) { + if (!testTruthy || value) { + if (value === '') { + editor.formatter.remove(formatName, { value: null }, node, true); + } else { + editor.formatter.apply(formatName, { value: value }, node); + } + } + }; + return { + setAttrib: setAttrib, + setStyle: setStyle, + setFormat: setFormat + }; + }; + }; + var DomModifier = { + normal: modifiers(false), + ifTruthy: modifiers(true) + }; + + var getSelectedCells = function (cells) { + return table(cells[0]).map(function (table) { + var warehouse = Warehouse.fromTable(table); + var allCells = Warehouse.justCells(warehouse); + var filtered = filter(allCells, function (cellA) { + return exists(cells, function (cellB) { + return eq(cellA.element, cellB); + }); + }); + return map(filtered, function (cell) { + return { + element: cell.element.dom, + column: Warehouse.getColumnAt(warehouse, cell.column).map(function (col) { + return col.element.dom; + }) + }; + }); + }); + }; + var updateSimpleProps = function (modifier, colModifier, data) { + modifier.setAttrib('scope', data.scope); + modifier.setAttrib('class', data.class); + modifier.setStyle('height', addPxSuffix(data.height)); + colModifier.setStyle('width', addPxSuffix(data.width)); + }; + var updateAdvancedProps = function (modifier, data) { + modifier.setFormat('tablecellbackgroundcolor', data.backgroundcolor); + modifier.setFormat('tablecellbordercolor', data.bordercolor); + modifier.setFormat('tablecellborderstyle', data.borderstyle); + modifier.setFormat('tablecellborderwidth', addPxSuffix(data.borderwidth)); + }; + var applyCellData = function (editor, cells, data) { + var dom = editor.dom; + var isSingleCell = cells.length === 1; + if (cells.length >= 1) { + getSelectedCells(cells).each(function (selectedCells) { + return each(selectedCells, function (item) { + var cellElement = item.element; + var cellElm = data.celltype && getNodeName(cellElement) !== data.celltype ? dom.rename(cellElement, data.celltype) : cellElement; + var modifier = isSingleCell ? DomModifier.normal(editor, cellElm) : DomModifier.ifTruthy(editor, cellElm); + var colModifier = item.column.map(function (col) { + return isSingleCell ? DomModifier.normal(editor, col) : DomModifier.ifTruthy(editor, col); + }).getOr(modifier); + updateSimpleProps(modifier, colModifier, data); + if (hasAdvancedCellTab(editor)) { + updateAdvancedProps(modifier, data); + } + if (isSingleCell) { + unApplyAlign(editor, cellElm); + unApplyVAlign(editor, cellElm); + } + if (data.halign) { + applyAlign(editor, cellElm, data.halign); + } + if (data.valign) { + applyVAlign(editor, cellElm, data.valign); + } + }); + }); + } + }; + var onSubmitCellForm = function (editor, cells, api) { + var data = api.getData(); + api.close(); + editor.undoManager.transact(function () { + applyCellData(editor, cells, data); + editor.focus(); + }); + }; + var getData = function (editor, cells) { + var cellsData = getSelectedCells(cells).map(function (selectedCells) { + return map(selectedCells, function (item) { + return extractDataFromCellElement(editor, item.element, hasAdvancedCellTab(editor), item.column); + }); + }); + return getSharedValues(cellsData.getOrDie()); + }; + var open = function (editor, selections) { + var cells = getCellsFromSelection(getSelectionStart(editor), selections); + if (cells.length === 0) { + return; + } + var data = getData(editor, cells); + var dialogTabPanel = { + type: 'tabpanel', + tabs: [ + { + title: 'General', + name: 'general', + items: getItems(editor) + }, + getAdvancedTab('cell') + ] + }; + var dialogPanel = { + type: 'panel', + items: [{ + type: 'grid', + columns: 2, + items: getItems(editor) + }] + }; + editor.windowManager.open({ + title: 'Cell Properties', + size: 'normal', + body: hasAdvancedCellTab(editor) ? dialogTabPanel : dialogPanel, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + initialData: data, + onSubmit: curry(onSubmitCellForm, editor, cells) + }); + }; + + var getClassList$1 = function (editor) { + var classes = buildListItems(getRowClassList(editor)); + if (classes.length > 0) { + return Optional.some({ + name: 'class', + type: 'listbox', + label: 'Class', + items: classes + }); + } + return Optional.none(); + }; + var formChildren = [ + { + type: 'listbox', + name: 'type', + label: 'Row type', + items: [ + { + text: 'Header', + value: 'header' + }, + { + text: 'Body', + value: 'body' + }, + { + text: 'Footer', + value: 'footer' + } + ] + }, + { + type: 'listbox', + name: 'align', + label: 'Alignment', + items: [ + { + text: 'None', + value: '' + }, + { + text: 'Left', + value: 'left' + }, + { + text: 'Center', + value: 'center' + }, + { + text: 'Right', + value: 'right' + } + ] + }, + { + label: 'Height', + name: 'height', + type: 'input' + } + ]; + var getItems$1 = function (editor) { + return formChildren.concat(getClassList$1(editor).toArray()); + }; + + var updateSimpleProps$1 = function (modifier, data) { + modifier.setAttrib('scope', data.scope); + modifier.setAttrib('class', data.class); + modifier.setStyle('height', addPxSuffix(data.height)); + }; + var updateAdvancedProps$1 = function (modifier, data) { + modifier.setStyle('background-color', data.backgroundcolor); + modifier.setStyle('border-color', data.bordercolor); + modifier.setStyle('border-style', data.borderstyle); + }; + var applyRowData = function (editor, rows, oldData, data) { + var isSingleRow = rows.length === 1; + each(rows, function (rowElm) { + if (data.type !== getNodeName(rowElm.parentNode)) { + switchSectionType(editor, rowElm, data.type); + } + var modifier = isSingleRow ? DomModifier.normal(editor, rowElm) : DomModifier.ifTruthy(editor, rowElm); + updateSimpleProps$1(modifier, data); + if (hasAdvancedRowTab(editor)) { + updateAdvancedProps$1(modifier, data); + } + if (data.align !== oldData.align) { + unApplyAlign(editor, rowElm); + applyAlign(editor, rowElm, data.align); + } + }); + }; + var onSubmitRowForm = function (editor, rows, oldData, api) { + var data = api.getData(); + api.close(); + editor.undoManager.transact(function () { + applyRowData(editor, rows, oldData, data); + editor.focus(); + }); + }; + var open$1 = function (editor) { + var rows = getRowsFromSelection(getSelectionStart(editor), ephemera.selected); + if (rows.length === 0) { + return; + } + var rowsData = map(rows, function (rowElm) { + return extractDataFromRowElement(editor, rowElm.dom, hasAdvancedRowTab(editor)); + }); + var data = getSharedValues(rowsData); + var dialogTabPanel = { + type: 'tabpanel', + tabs: [ + { + title: 'General', + name: 'general', + items: getItems$1(editor) + }, + getAdvancedTab('row') + ] + }; + var dialogPanel = { + type: 'panel', + items: [{ + type: 'grid', + columns: 2, + items: getItems$1(editor) + }] + }; + editor.windowManager.open({ + title: 'Row Properties', + size: 'normal', + body: hasAdvancedRowTab(editor) ? dialogTabPanel : dialogPanel, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + initialData: data, + onSubmit: curry(onSubmitRowForm, editor, map(rows, function (r) { + return r.dom; + }), data) + }); + }; + + var global$2 = tinymce.util.Tools.resolve('tinymce.Env'); + + var getItems$2 = function (editor, classes, insertNewTable) { + var rowColCountItems = !insertNewTable ? [] : [ + { + type: 'input', + name: 'cols', + label: 'Cols', + inputMode: 'numeric' + }, + { + type: 'input', + name: 'rows', + label: 'Rows', + inputMode: 'numeric' + } + ]; + var alwaysItems = [ + { + type: 'input', + name: 'width', + label: 'Width' + }, + { + type: 'input', + name: 'height', + label: 'Height' + } + ]; + var appearanceItems = hasAppearanceOptions(editor) ? [ + { + type: 'input', + name: 'cellspacing', + label: 'Cell spacing', + inputMode: 'numeric' + }, + { + type: 'input', + name: 'cellpadding', + label: 'Cell padding', + inputMode: 'numeric' + }, + { + type: 'input', + name: 'border', + label: 'Border width' + }, + { + type: 'label', + label: 'Caption', + items: [{ + type: 'checkbox', + name: 'caption', + label: 'Show caption' + }] + } + ] : []; + var alignmentItem = [{ + type: 'listbox', + name: 'align', + label: 'Alignment', + items: [ + { + text: 'None', + value: '' + }, + { + text: 'Left', + value: 'left' + }, + { + text: 'Center', + value: 'center' + }, + { + text: 'Right', + value: 'right' + } + ] + }]; + var classListItem = classes.length > 0 ? [{ + type: 'listbox', + name: 'class', + label: 'Class', + items: classes + }] : []; + return rowColCountItems.concat(alwaysItems).concat(appearanceItems).concat(alignmentItem).concat(classListItem); + }; + + var styleTDTH = function (dom, elm, name, value) { + if (elm.tagName === 'TD' || elm.tagName === 'TH') { + if (isString(name)) { + dom.setStyle(elm, name, value); + } else { + dom.setStyle(elm, name); + } + } else { + if (elm.children) { + for (var i = 0; i < elm.children.length; i++) { + styleTDTH(dom, elm.children[i], name, value); + } + } + } + }; + var applyDataToElement = function (editor, tableElm, data) { + var dom = editor.dom; + var attrs = {}; + var styles = {}; + attrs.class = data.class; + styles.height = addPxSuffix(data.height); + if (dom.getAttrib(tableElm, 'width') && !shouldStyleWithCss(editor)) { + attrs.width = removePxSuffix(data.width); + } else { + styles.width = addPxSuffix(data.width); + } + if (shouldStyleWithCss(editor)) { + styles['border-width'] = addPxSuffix(data.border); + styles['border-spacing'] = addPxSuffix(data.cellspacing); + } else { + attrs.border = data.border; + attrs.cellpadding = data.cellpadding; + attrs.cellspacing = data.cellspacing; + } + if (shouldStyleWithCss(editor) && tableElm.children) { + for (var i = 0; i < tableElm.children.length; i++) { + styleTDTH(dom, tableElm.children[i], { + 'border-width': addPxSuffix(data.border), + 'padding': addPxSuffix(data.cellpadding) + }); + if (hasAdvancedTableTab(editor)) { + styleTDTH(dom, tableElm.children[i], { 'border-color': data.bordercolor }); + } + } + } + if (hasAdvancedTableTab(editor)) { + styles['background-color'] = data.backgroundcolor; + styles['border-color'] = data.bordercolor; + styles['border-style'] = data.borderstyle; + } + attrs.style = dom.serializeStyle(__assign(__assign({}, getDefaultStyles(editor)), styles)); + dom.setAttribs(tableElm, __assign(__assign({}, getDefaultAttributes(editor)), attrs)); + }; + var onSubmitTableForm = function (editor, tableElm, api) { + var dom = editor.dom; + var captionElm; + var data = api.getData(); + api.close(); + if (data.class === '') { + delete data.class; + } + editor.undoManager.transact(function () { + if (!tableElm) { + var cols = parseInt(data.cols, 10) || 1; + var rows = parseInt(data.rows, 10) || 1; + tableElm = insert$1(editor, cols, rows, 0, 0); + } + applyDataToElement(editor, tableElm, data); + captionElm = dom.select('caption', tableElm)[0]; + if (captionElm && !data.caption) { + dom.remove(captionElm); + } + if (!captionElm && data.caption) { + captionElm = dom.create('caption'); + captionElm.innerHTML = !global$2.ie ? '
    ' : nbsp; + tableElm.insertBefore(captionElm, tableElm.firstChild); + } + if (data.align === '') { + unApplyAlign(editor, tableElm); + } else { + applyAlign(editor, tableElm, data.align); + } + editor.focus(); + editor.addVisual(); + }); + }; + var open$2 = function (editor, insertNewTable) { + var dom = editor.dom; + var tableElm; + var data = extractDataFromSettings(editor, hasAdvancedTableTab(editor)); + if (insertNewTable === false) { + tableElm = dom.getParent(editor.selection.getStart(), 'table'); + if (tableElm) { + data = extractDataFromTableElement(editor, tableElm, hasAdvancedTableTab(editor)); + } else { + if (hasAdvancedTableTab(editor)) { + data.borderstyle = ''; + data.bordercolor = ''; + data.backgroundcolor = ''; + } + } + } else { + data.cols = '1'; + data.rows = '1'; + if (hasAdvancedTableTab(editor)) { + data.borderstyle = ''; + data.bordercolor = ''; + data.backgroundcolor = ''; + } + } + var classes = buildListItems(getTableClassList(editor)); + if (classes.length > 0) { + if (data.class) { + data.class = data.class.replace(/\s*mce\-item\-table\s*/g, ''); + } + } + var generalPanel = { + type: 'grid', + columns: 2, + items: getItems$2(editor, classes, insertNewTable) + }; + var nonAdvancedForm = function () { + return { + type: 'panel', + items: [generalPanel] + }; + }; + var advancedForm = function () { + return { + type: 'tabpanel', + tabs: [ + { + title: 'General', + name: 'general', + items: [generalPanel] + }, + getAdvancedTab('table') + ] + }; + }; + var dialogBody = hasAdvancedTableTab(editor) ? advancedForm() : nonAdvancedForm(); + editor.windowManager.open({ + title: 'Table Properties', + size: 'normal', + body: dialogBody, + onSubmit: curry(onSubmitTableForm, editor, tableElm), + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + initialData: data + }); + }; + + var getSelectionStartCellOrCaption$1 = function (editor) { + return getSelectionStartCellOrCaption(getSelectionStart(editor)); + }; + var getSelectionStartCell$1 = function (editor) { + return getSelectionStartCell(getSelectionStart(editor)); + }; + var registerCommands = function (editor, actions, cellSelection, selections, clipboard) { + var isRoot = getIsRoot(editor); + var eraseTable = function () { + return getSelectionStartCellOrCaption$1(editor).each(function (cellOrCaption) { + table(cellOrCaption, isRoot).filter(not(isRoot)).each(function (table) { + var cursor = SugarElement.fromText(''); + after(table, cursor); + remove$2(table); + if (editor.dom.isEmpty(editor.getBody())) { + editor.setContent(''); + editor.selection.setCursorLocation(); + } else { + var rng = editor.dom.createRng(); + rng.setStart(cursor.dom, 0); + rng.setEnd(cursor.dom, 0); + editor.selection.setRng(rng); + editor.nodeChanged(); + } + }); + }); + }; + var setSizingMode = function (sizing) { + return getSelectionStartCellOrCaption$1(editor).each(function (cellOrCaption) { + var isForcedSizing = isResponsiveForced(editor) || isPixelsForced(editor) || isPercentagesForced(editor); + if (!isForcedSizing) { + table(cellOrCaption, isRoot).each(function (table) { + if (sizing === 'relative' && !isPercentSizing$1(table)) { + enforcePercentage(editor, table); + } else if (sizing === 'fixed' && !isPixelSizing$1(table)) { + enforcePixels(editor, table); + } else if (sizing === 'responsive' && !isNoneSizing$1(table)) { + enforceNone(table); + } + removeDataStyle(table); + }); + } + }); + }; + var getTableFromCell = function (cell) { + return table(cell, isRoot); + }; + var actOnSelection = function (execute) { + return getSelectionStartCell$1(editor).each(function (cell) { + getTableFromCell(cell).each(function (table) { + var targets = forMenu(selections, table, cell); + execute(table, targets).each(function (rng) { + editor.selection.setRng(rng); + editor.focus(); + cellSelection.clear(table); + removeDataStyle(table); + }); + }); + }); + }; + var copyRowSelection = function () { + return getSelectionStartCell$1(editor).map(function (cell) { + return getTableFromCell(cell).bind(function (table) { + var targets = forMenu(selections, table, cell); + var generators = cellOperations(noop, SugarElement.fromDom(editor.getDoc()), Optional.none()); + return copyRows(table, targets, generators); + }); + }); + }; + var copyColSelection = function () { + return getSelectionStartCell$1(editor).map(function (cell) { + return getTableFromCell(cell).bind(function (table) { + var targets = forMenu(selections, table, cell); + return copyCols(table, targets); + }); + }); + }; + var pasteOnSelection = function (execute, getRows) { + return getRows().each(function (rows) { + var clonedRows = map(rows, function (row) { + return deep(row); + }); + getSelectionStartCell$1(editor).each(function (cell) { + return getTableFromCell(cell).each(function (table) { + var generators = paste(SugarElement.fromDom(editor.getDoc())); + var targets = pasteRows(selections, cell, clonedRows, generators); + execute(table, targets).each(function (rng) { + editor.selection.setRng(rng); + editor.focus(); + cellSelection.clear(table); + }); + }); + }); + }); + }; + each$1({ + mceTableSplitCells: function () { + return actOnSelection(actions.unmergeCells); + }, + mceTableMergeCells: function () { + return actOnSelection(actions.mergeCells); + }, + mceTableInsertRowBefore: function () { + return actOnSelection(actions.insertRowsBefore); + }, + mceTableInsertRowAfter: function () { + return actOnSelection(actions.insertRowsAfter); + }, + mceTableInsertColBefore: function () { + return actOnSelection(actions.insertColumnsBefore); + }, + mceTableInsertColAfter: function () { + return actOnSelection(actions.insertColumnsAfter); + }, + mceTableDeleteCol: function () { + return actOnSelection(actions.deleteColumn); + }, + mceTableDeleteRow: function () { + return actOnSelection(actions.deleteRow); + }, + mceTableCutCol: function (_grid) { + return copyColSelection().each(function (selection) { + clipboard.setColumns(selection); + actOnSelection(actions.deleteColumn); + }); + }, + mceTableCutRow: function (_grid) { + return copyRowSelection().each(function (selection) { + clipboard.setRows(selection); + actOnSelection(actions.deleteRow); + }); + }, + mceTableCopyCol: function (_grid) { + return copyColSelection().each(function (selection) { + return clipboard.setColumns(selection); + }); + }, + mceTableCopyRow: function (_grid) { + return copyRowSelection().each(function (selection) { + return clipboard.setRows(selection); + }); + }, + mceTablePasteColBefore: function (_grid) { + return pasteOnSelection(actions.pasteColsBefore, clipboard.getColumns); + }, + mceTablePasteColAfter: function (_grid) { + return pasteOnSelection(actions.pasteColsAfter, clipboard.getColumns); + }, + mceTablePasteRowBefore: function (_grid) { + return pasteOnSelection(actions.pasteRowsBefore, clipboard.getRows); + }, + mceTablePasteRowAfter: function (_grid) { + return pasteOnSelection(actions.pasteRowsAfter, clipboard.getRows); + }, + mceTableDelete: eraseTable, + mceTableSizingMode: function (ui, sizing) { + return setSizingMode(sizing); + } + }, function (func, name) { + return editor.addCommand(name, func); + }); + each$1({ + mceTableCellType: function (_ui, args) { + return actions.setTableCellType(editor, args); + }, + mceTableRowType: function (_ui, args) { + return actions.setTableRowType(editor, args); + } + }, function (func, name) { + return editor.addCommand(name, func); + }); + editor.addCommand('mceTableColType', function (_ui, args) { + return get(args, 'type').each(function (type) { + return actOnSelection(type === 'th' ? actions.makeColumnHeader : actions.unmakeColumnHeader); + }); + }); + each$1({ + mceTableProps: curry(open$2, editor, false), + mceTableRowProps: curry(open$1, editor), + mceTableCellProps: curry(open, editor, selections) + }, function (func, name) { + return editor.addCommand(name, function () { + return func(); + }); + }); + editor.addCommand('mceInsertTable', function (_ui, args) { + if (isObject(args) && keys(args).length > 0) { + insertTableWithDataValidation(editor, args.rows, args.columns, args.options, 'Invalid values for mceInsertTable - rows and columns values are required to insert a table.'); + } else { + open$2(editor, true); + } + }); + editor.addCommand('mceTableApplyCellStyle', function (_ui, args) { + if (!isObject(args)) { + return; + } + var cells = getCellsFromSelection(getSelectionStart(editor), selections); + if (cells.length === 0) { + return; + } + each$1(args, function (value, style) { + var formatName = 'tablecell' + style.toLowerCase().replace('-', ''); + if (editor.formatter.has(formatName) && isString(value)) { + each(cells, function (cell) { + DomModifier.normal(editor, cell.dom).setFormat(formatName, value); + }); + } + }); + }); + }; + + var registerQueryCommands = function (editor, actions, selections) { + var isRoot = getIsRoot(editor); + var getTableFromCell = function (cell) { + return table(cell, isRoot); + }; + each$1({ + mceTableRowType: function () { + return actions.getTableRowType(editor); + }, + mceTableCellType: function () { + return actions.getTableCellType(editor); + }, + mceTableColType: function () { + return getSelectionStartCell(getSelectionStart(editor)).bind(function (cell) { + return getTableFromCell(cell).map(function (table) { + var targets = forMenu(selections, table, cell); + return actions.getTableColType(table, targets); + }); + }).getOr(''); + } + }, function (func, name) { + return editor.addQueryValueHandler(name, func); + }); + }; + + var Clipboard = function () { + var rows = Cell(Optional.none()); + var cols = Cell(Optional.none()); + var clearClipboard = function (clipboard) { + clipboard.set(Optional.none()); + }; + return { + getRows: rows.get, + setRows: function (r) { + rows.set(r); + clearClipboard(cols); + }, + clearRows: function () { + return clearClipboard(rows); + }, + getColumns: cols.get, + setColumns: function (c) { + cols.set(c); + clearClipboard(rows); + }, + clearColumns: function () { + return clearClipboard(cols); + } + }; + }; + + var cellFormats = { + tablecellbackgroundcolor: { + selector: 'td,th', + styles: { backgroundColor: '%value' }, + remove_similar: true + }, + tablecellbordercolor: { + selector: 'td,th', + styles: { borderColor: '%value' }, + remove_similar: true + }, + tablecellborderstyle: { + selector: 'td,th', + styles: { borderStyle: '%value' }, + remove_similar: true + }, + tablecellborderwidth: { + selector: 'td,th', + styles: { borderWidth: '%value' }, + remove_similar: true + } + }; + var registerFormats = function (editor) { + editor.formatter.register(cellFormats); + }; + + var adt$2 = Adt.generate([ + { none: ['current'] }, + { first: ['current'] }, + { + middle: [ + 'current', + 'target' + ] + }, + { last: ['current'] } + ]); + var none$2 = function (current) { + if (current === void 0) { + current = undefined; + } + return adt$2.none(current); + }; + var CellLocation = __assign(__assign({}, adt$2), { none: none$2 }); + + var detect$5 = function (current, isRoot) { + return table(current, isRoot).bind(function (table) { + var all = cells(table); + var index = findIndex(all, function (x) { + return eq(current, x); + }); + return index.map(function (index) { + return { + index: index, + all: all + }; + }); + }); + }; + var next = function (current, isRoot) { + var detection = detect$5(current, isRoot); + return detection.fold(function () { + return CellLocation.none(current); + }, function (info) { + return info.index + 1 < info.all.length ? CellLocation.middle(current, info.all[info.index + 1]) : CellLocation.last(current); + }); + }; + var prev = function (current, isRoot) { + var detection = detect$5(current, isRoot); + return detection.fold(function () { + return CellLocation.none(); + }, function (info) { + return info.index - 1 >= 0 ? CellLocation.middle(current, info.all[info.index - 1]) : CellLocation.first(current); + }); + }; + + var create$2 = function (start, soffset, finish, foffset) { + return { + start: start, + soffset: soffset, + finish: finish, + foffset: foffset + }; + }; + var SimRange = { create: create$2 }; + + var adt$3 = Adt.generate([ + { before: ['element'] }, + { + on: [ + 'element', + 'offset' + ] + }, + { after: ['element'] } + ]); + var cata$1 = function (subject, onBefore, onOn, onAfter) { + return subject.fold(onBefore, onOn, onAfter); + }; + var getStart = function (situ) { + return situ.fold(identity, identity, identity); + }; + var before$2 = adt$3.before; + var on = adt$3.on; + var after$2 = adt$3.after; + var Situ = { + before: before$2, + on: on, + after: after$2, + cata: cata$1, + getStart: getStart + }; + + var adt$4 = Adt.generate([ + { domRange: ['rng'] }, + { + relative: [ + 'startSitu', + 'finishSitu' + ] + }, + { + exact: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + } + ]); + var exactFromRange = function (simRange) { + return adt$4.exact(simRange.start, simRange.soffset, simRange.finish, simRange.foffset); + }; + var getStart$1 = function (selection) { + return selection.match({ + domRange: function (rng) { + return SugarElement.fromDom(rng.startContainer); + }, + relative: function (startSitu, _finishSitu) { + return Situ.getStart(startSitu); + }, + exact: function (start, _soffset, _finish, _foffset) { + return start; + } + }); + }; + var domRange = adt$4.domRange; + var relative = adt$4.relative; + var exact = adt$4.exact; + var getWin = function (selection) { + var start = getStart$1(selection); + return defaultView(start); + }; + var range$1 = SimRange.create; + var SimSelection = { + domRange: domRange, + relative: relative, + exact: exact, + exactFromRange: exactFromRange, + getWin: getWin, + range: range$1 + }; + + var selectNodeContents = function (win, element) { + var rng = win.document.createRange(); + selectNodeContentsUsing(rng, element); + return rng; + }; + var selectNodeContentsUsing = function (rng, element) { + return rng.selectNodeContents(element.dom); + }; + var setStart = function (rng, situ) { + situ.fold(function (e) { + rng.setStartBefore(e.dom); + }, function (e, o) { + rng.setStart(e.dom, o); + }, function (e) { + rng.setStartAfter(e.dom); + }); + }; + var setFinish = function (rng, situ) { + situ.fold(function (e) { + rng.setEndBefore(e.dom); + }, function (e, o) { + rng.setEnd(e.dom, o); + }, function (e) { + rng.setEndAfter(e.dom); + }); + }; + var relativeToNative = function (win, startSitu, finishSitu) { + var range = win.document.createRange(); + setStart(range, startSitu); + setFinish(range, finishSitu); + return range; + }; + var exactToNative = function (win, start, soffset, finish, foffset) { + var rng = win.document.createRange(); + rng.setStart(start.dom, soffset); + rng.setEnd(finish.dom, foffset); + return rng; + }; + var toRect = function (rect) { + return { + left: rect.left, + top: rect.top, + right: rect.right, + bottom: rect.bottom, + width: rect.width, + height: rect.height + }; + }; + var getFirstRect = function (rng) { + var rects = rng.getClientRects(); + var rect = rects.length > 0 ? rects[0] : rng.getBoundingClientRect(); + return rect.width > 0 || rect.height > 0 ? Optional.some(rect).map(toRect) : Optional.none(); + }; + + var adt$5 = Adt.generate([ + { + ltr: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + }, + { + rtl: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + } + ]); + var fromRange = function (win, type, range) { + return type(SugarElement.fromDom(range.startContainer), range.startOffset, SugarElement.fromDom(range.endContainer), range.endOffset); + }; + var getRanges = function (win, selection) { + return selection.match({ + domRange: function (rng) { + return { + ltr: constant(rng), + rtl: Optional.none + }; + }, + relative: function (startSitu, finishSitu) { + return { + ltr: cached(function () { + return relativeToNative(win, startSitu, finishSitu); + }), + rtl: cached(function () { + return Optional.some(relativeToNative(win, finishSitu, startSitu)); + }) + }; + }, + exact: function (start, soffset, finish, foffset) { + return { + ltr: cached(function () { + return exactToNative(win, start, soffset, finish, foffset); + }), + rtl: cached(function () { + return Optional.some(exactToNative(win, finish, foffset, start, soffset)); + }) + }; + } + }); + }; + var doDiagnose = function (win, ranges) { + var rng = ranges.ltr(); + if (rng.collapsed) { + var reversed = ranges.rtl().filter(function (rev) { + return rev.collapsed === false; + }); + return reversed.map(function (rev) { + return adt$5.rtl(SugarElement.fromDom(rev.endContainer), rev.endOffset, SugarElement.fromDom(rev.startContainer), rev.startOffset); + }).getOrThunk(function () { + return fromRange(win, adt$5.ltr, rng); + }); + } else { + return fromRange(win, adt$5.ltr, rng); + } + }; + var diagnose = function (win, selection) { + var ranges = getRanges(win, selection); + return doDiagnose(win, ranges); + }; + var asLtrRange = function (win, selection) { + var diagnosis = diagnose(win, selection); + return diagnosis.match({ + ltr: function (start, soffset, finish, foffset) { + var rng = win.document.createRange(); + rng.setStart(start.dom, soffset); + rng.setEnd(finish.dom, foffset); + return rng; + }, + rtl: function (start, soffset, finish, foffset) { + var rng = win.document.createRange(); + rng.setStart(finish.dom, foffset); + rng.setEnd(start.dom, soffset); + return rng; + } + }); + }; + var ltr$1 = adt$5.ltr; + var rtl$1 = adt$5.rtl; + + var searchForPoint = function (rectForOffset, x, y, maxX, length) { + if (length === 0) { + return 0; + } else if (x === maxX) { + return length - 1; + } + var xDelta = maxX; + for (var i = 1; i < length; i++) { + var rect = rectForOffset(i); + var curDeltaX = Math.abs(x - rect.left); + if (y <= rect.bottom) { + if (y < rect.top || curDeltaX > xDelta) { + return i - 1; + } else { + xDelta = curDeltaX; + } + } + } + return 0; + }; + var inRect = function (rect, x, y) { + return x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom; + }; + + var locateOffset = function (doc, textnode, x, y, rect) { + var rangeForOffset = function (o) { + var r = doc.dom.createRange(); + r.setStart(textnode.dom, o); + r.collapse(true); + return r; + }; + var rectForOffset = function (o) { + var r = rangeForOffset(o); + return r.getBoundingClientRect(); + }; + var length = get$3(textnode).length; + var offset = searchForPoint(rectForOffset, x, y, rect.right, length); + return rangeForOffset(offset); + }; + var locate = function (doc, node, x, y) { + var r = doc.dom.createRange(); + r.selectNode(node.dom); + var rects = r.getClientRects(); + var foundRect = findMap(rects, function (rect) { + return inRect(rect, x, y) ? Optional.some(rect) : Optional.none(); + }); + return foundRect.map(function (rect) { + return locateOffset(doc, node, x, y, rect); + }); + }; + + var searchInChildren = function (doc, node, x, y) { + var r = doc.dom.createRange(); + var nodes = children(node); + return findMap(nodes, function (n) { + r.selectNode(n.dom); + return inRect(r.getBoundingClientRect(), x, y) ? locateNode(doc, n, x, y) : Optional.none(); + }); + }; + var locateNode = function (doc, node, x, y) { + return isText(node) ? locate(doc, node, x, y) : searchInChildren(doc, node, x, y); + }; + var locate$1 = function (doc, node, x, y) { + var r = doc.dom.createRange(); + r.selectNode(node.dom); + var rect = r.getBoundingClientRect(); + var boundedX = Math.max(rect.left, Math.min(rect.right, x)); + var boundedY = Math.max(rect.top, Math.min(rect.bottom, y)); + return locateNode(doc, node, boundedX, boundedY); + }; + + var COLLAPSE_TO_LEFT = true; + var COLLAPSE_TO_RIGHT = false; + var getCollapseDirection = function (rect, x) { + return x - rect.left < rect.right - x ? COLLAPSE_TO_LEFT : COLLAPSE_TO_RIGHT; + }; + var createCollapsedNode = function (doc, target, collapseDirection) { + var r = doc.dom.createRange(); + r.selectNode(target.dom); + r.collapse(collapseDirection); + return r; + }; + var locateInElement = function (doc, node, x) { + var cursorRange = doc.dom.createRange(); + cursorRange.selectNode(node.dom); + var rect = cursorRange.getBoundingClientRect(); + var collapseDirection = getCollapseDirection(rect, x); + var f = collapseDirection === COLLAPSE_TO_LEFT ? first : last$1; + return f(node).map(function (target) { + return createCollapsedNode(doc, target, collapseDirection); + }); + }; + var locateInEmpty = function (doc, node, x) { + var rect = node.dom.getBoundingClientRect(); + var collapseDirection = getCollapseDirection(rect, x); + return Optional.some(createCollapsedNode(doc, node, collapseDirection)); + }; + var search = function (doc, node, x) { + var f = children(node).length === 0 ? locateInEmpty : locateInElement; + return f(doc, node, x); + }; + + var caretPositionFromPoint = function (doc, x, y) { + return Optional.from(doc.dom.caretPositionFromPoint(x, y)).bind(function (pos) { + if (pos.offsetNode === null) { + return Optional.none(); + } + var r = doc.dom.createRange(); + r.setStart(pos.offsetNode, pos.offset); + r.collapse(); + return Optional.some(r); + }); + }; + var caretRangeFromPoint = function (doc, x, y) { + return Optional.from(doc.dom.caretRangeFromPoint(x, y)); + }; + var searchTextNodes = function (doc, node, x, y) { + var r = doc.dom.createRange(); + r.selectNode(node.dom); + var rect = r.getBoundingClientRect(); + var boundedX = Math.max(rect.left, Math.min(rect.right, x)); + var boundedY = Math.max(rect.top, Math.min(rect.bottom, y)); + return locate$1(doc, node, boundedX, boundedY); + }; + var searchFromPoint = function (doc, x, y) { + return SugarElement.fromPoint(doc, x, y).bind(function (elem) { + var fallback = function () { + return search(doc, elem, x); + }; + return children(elem).length === 0 ? fallback() : searchTextNodes(doc, elem, x, y).orThunk(fallback); + }); + }; + var availableSearch = document.caretPositionFromPoint ? caretPositionFromPoint : document.caretRangeFromPoint ? caretRangeFromPoint : searchFromPoint; + var fromPoint$1 = function (win, x, y) { + var doc = SugarElement.fromDom(win.document); + return availableSearch(doc, x, y).map(function (rng) { + return SimRange.create(SugarElement.fromDom(rng.startContainer), rng.startOffset, SugarElement.fromDom(rng.endContainer), rng.endOffset); + }); + }; + + var beforeSpecial = function (element, offset) { + var name$1 = name(element); + if ('input' === name$1) { + return Situ.after(element); + } else if (!contains([ + 'br', + 'img' + ], name$1)) { + return Situ.on(element, offset); + } else { + return offset === 0 ? Situ.before(element) : Situ.after(element); + } + }; + var preprocessRelative = function (startSitu, finishSitu) { + var start = startSitu.fold(Situ.before, beforeSpecial, Situ.after); + var finish = finishSitu.fold(Situ.before, beforeSpecial, Situ.after); + return SimSelection.relative(start, finish); + }; + var preprocessExact = function (start, soffset, finish, foffset) { + var startSitu = beforeSpecial(start, soffset); + var finishSitu = beforeSpecial(finish, foffset); + return SimSelection.relative(startSitu, finishSitu); + }; + var preprocess = function (selection) { + return selection.match({ + domRange: function (rng) { + var start = SugarElement.fromDom(rng.startContainer); + var finish = SugarElement.fromDom(rng.endContainer); + return preprocessExact(start, rng.startOffset, finish, rng.endOffset); + }, + relative: preprocessRelative, + exact: preprocessExact + }); + }; + + var makeRange = function (start, soffset, finish, foffset) { + var doc = owner(start); + var rng = doc.dom.createRange(); + rng.setStart(start.dom, soffset); + rng.setEnd(finish.dom, foffset); + return rng; + }; + var after$3 = function (start, soffset, finish, foffset) { + var r = makeRange(start, soffset, finish, foffset); + var same = eq(start, finish) && soffset === foffset; + return r.collapsed && !same; + }; + + var getNativeSelection = function (win) { + return Optional.from(win.getSelection()); + }; + var doSetNativeRange = function (win, rng) { + getNativeSelection(win).each(function (selection) { + selection.removeAllRanges(); + selection.addRange(rng); + }); + }; + var doSetRange = function (win, start, soffset, finish, foffset) { + var rng = exactToNative(win, start, soffset, finish, foffset); + doSetNativeRange(win, rng); + }; + var setLegacyRtlRange = function (win, selection, start, soffset, finish, foffset) { + selection.collapse(start.dom, soffset); + selection.extend(finish.dom, foffset); + }; + var setRangeFromRelative = function (win, relative) { + return diagnose(win, relative).match({ + ltr: function (start, soffset, finish, foffset) { + doSetRange(win, start, soffset, finish, foffset); + }, + rtl: function (start, soffset, finish, foffset) { + getNativeSelection(win).each(function (selection) { + if (selection.setBaseAndExtent) { + selection.setBaseAndExtent(start.dom, soffset, finish.dom, foffset); + } else if (selection.extend) { + try { + setLegacyRtlRange(win, selection, start, soffset, finish, foffset); + } catch (e) { + doSetRange(win, finish, foffset, start, soffset); + } + } else { + doSetRange(win, finish, foffset, start, soffset); + } + }); + } + }); + }; + var setExact = function (win, start, soffset, finish, foffset) { + var relative = preprocessExact(start, soffset, finish, foffset); + setRangeFromRelative(win, relative); + }; + var setRelative = function (win, startSitu, finishSitu) { + var relative = preprocessRelative(startSitu, finishSitu); + setRangeFromRelative(win, relative); + }; + var toNative = function (selection) { + var win = SimSelection.getWin(selection).dom; + var getDomRange = function (start, soffset, finish, foffset) { + return exactToNative(win, start, soffset, finish, foffset); + }; + var filtered = preprocess(selection); + return diagnose(win, filtered).match({ + ltr: getDomRange, + rtl: getDomRange + }); + }; + var readRange = function (selection) { + if (selection.rangeCount > 0) { + var firstRng = selection.getRangeAt(0); + var lastRng = selection.getRangeAt(selection.rangeCount - 1); + return Optional.some(SimRange.create(SugarElement.fromDom(firstRng.startContainer), firstRng.startOffset, SugarElement.fromDom(lastRng.endContainer), lastRng.endOffset)); + } else { + return Optional.none(); + } + }; + var doGetExact = function (selection) { + if (selection.anchorNode === null || selection.focusNode === null) { + return readRange(selection); + } else { + var anchor = SugarElement.fromDom(selection.anchorNode); + var focus_1 = SugarElement.fromDom(selection.focusNode); + return after$3(anchor, selection.anchorOffset, focus_1, selection.focusOffset) ? Optional.some(SimRange.create(anchor, selection.anchorOffset, focus_1, selection.focusOffset)) : readRange(selection); + } + }; + var setToElement = function (win, element) { + var rng = selectNodeContents(win, element); + doSetNativeRange(win, rng); + }; + var getExact = function (win) { + return getNativeSelection(win).filter(function (sel) { + return sel.rangeCount > 0; + }).bind(doGetExact); + }; + var get$b = function (win) { + return getExact(win).map(function (range) { + return SimSelection.exact(range.start, range.soffset, range.finish, range.foffset); + }); + }; + var getFirstRect$1 = function (win, selection) { + var rng = asLtrRange(win, selection); + return getFirstRect(rng); + }; + var getAtPoint = function (win, x, y) { + return fromPoint$1(win, x, y); + }; + var clear = function (win) { + getNativeSelection(win).each(function (selection) { + return selection.removeAllRanges(); + }); + }; + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.VK'); + + var forward = function (editor, isRoot, cell, actions) { + return go(editor, isRoot, next(cell), actions); + }; + var backward = function (editor, isRoot, cell, actions) { + return go(editor, isRoot, prev(cell), actions); + }; + var getCellFirstCursorPosition = function (editor, cell) { + var selection = SimSelection.exact(cell, 0, cell, 0); + return toNative(selection); + }; + var getNewRowCursorPosition = function (editor, table) { + var rows = descendants$1(table, 'tr'); + return last(rows).bind(function (last) { + return descendant$1(last, 'td,th').map(function (first) { + return getCellFirstCursorPosition(editor, first); + }); + }); + }; + var go = function (editor, isRoot, cell, actions) { + return cell.fold(Optional.none, Optional.none, function (current, next) { + return first(next).map(function (cell) { + return getCellFirstCursorPosition(editor, cell); + }); + }, function (current) { + return table(current, isRoot).bind(function (table) { + var targets = noMenu(current); + editor.undoManager.transact(function () { + actions.insertRowsAfter(table, targets); + }); + return getNewRowCursorPosition(editor, table); + }); + }); + }; + var rootElements = [ + 'table', + 'li', + 'dl' + ]; + var handle$1 = function (event, editor, actions) { + if (event.keyCode === global$3.TAB) { + var body_1 = getBody$1(editor); + var isRoot_1 = function (element) { + var name$1 = name(element); + return eq(element, body_1) || contains(rootElements, name$1); + }; + var rng = editor.selection.getRng(); + if (rng.collapsed) { + var start = SugarElement.fromDom(rng.startContainer); + cell(start, isRoot_1).each(function (cell) { + event.preventDefault(); + var navigation = event.shiftKey ? backward : forward; + var rng = navigation(editor, isRoot_1, cell, actions); + rng.each(function (range) { + editor.selection.setRng(range); + }); + }); + } + } + }; + + var create$3 = function (selection, kill) { + return { + selection: selection, + kill: kill + }; + }; + var Response = { create: create$3 }; + + var create$4 = function (start, soffset, finish, foffset) { + return { + start: Situ.on(start, soffset), + finish: Situ.on(finish, foffset) + }; + }; + var Situs = { create: create$4 }; + + var convertToRange = function (win, selection) { + var rng = asLtrRange(win, selection); + return SimRange.create(SugarElement.fromDom(rng.startContainer), rng.startOffset, SugarElement.fromDom(rng.endContainer), rng.endOffset); + }; + var makeSitus = Situs.create; + + var sync = function (container, isRoot, start, soffset, finish, foffset, selectRange) { + if (!(eq(start, finish) && soffset === foffset)) { + return closest$1(start, 'td,th', isRoot).bind(function (s) { + return closest$1(finish, 'td,th', isRoot).bind(function (f) { + return detect$6(container, isRoot, s, f, selectRange); + }); + }); + } else { + return Optional.none(); + } + }; + var detect$6 = function (container, isRoot, start, finish, selectRange) { + if (!eq(start, finish)) { + return identify(start, finish, isRoot).bind(function (cellSel) { + var boxes = cellSel.boxes.getOr([]); + if (boxes.length > 0) { + selectRange(container, boxes, cellSel.start, cellSel.finish); + return Optional.some(Response.create(Optional.some(makeSitus(start, 0, start, getEnd(start))), true)); + } else { + return Optional.none(); + } + }); + } else { + return Optional.none(); + } + }; + var update = function (rows, columns, container, selected, annotations) { + var updateSelection = function (newSels) { + annotations.clearBeforeUpdate(container); + annotations.selectRange(container, newSels.boxes, newSels.start, newSels.finish); + return newSels.boxes; + }; + return shiftSelection(selected, rows, columns, annotations.firstSelectedSelector, annotations.lastSelectedSelector).map(updateSelection); + }; + + var traverse = function (item, mode) { + return { + item: item, + mode: mode + }; + }; + var backtrack = function (universe, item, _direction, transition) { + if (transition === void 0) { + transition = sidestep; + } + return universe.property().parent(item).map(function (p) { + return traverse(p, transition); + }); + }; + var sidestep = function (universe, item, direction, transition) { + if (transition === void 0) { + transition = advance; + } + return direction.sibling(universe, item).map(function (p) { + return traverse(p, transition); + }); + }; + var advance = function (universe, item, direction, transition) { + if (transition === void 0) { + transition = advance; + } + var children = universe.property().children(item); + var result = direction.first(children); + return result.map(function (r) { + return traverse(r, transition); + }); + }; + var successors = [ + { + current: backtrack, + next: sidestep, + fallback: Optional.none() + }, + { + current: sidestep, + next: advance, + fallback: Optional.some(backtrack) + }, + { + current: advance, + next: advance, + fallback: Optional.some(sidestep) + } + ]; + var go$1 = function (universe, item, mode, direction, rules) { + if (rules === void 0) { + rules = successors; + } + var ruleOpt = find(rules, function (succ) { + return succ.current === mode; + }); + return ruleOpt.bind(function (rule) { + return rule.current(universe, item, direction, rule.next).orThunk(function () { + return rule.fallback.bind(function (fb) { + return go$1(universe, item, fb, direction); + }); + }); + }); + }; + + var left = function () { + var sibling = function (universe, item) { + return universe.query().prevSibling(item); + }; + var first = function (children) { + return children.length > 0 ? Optional.some(children[children.length - 1]) : Optional.none(); + }; + return { + sibling: sibling, + first: first + }; + }; + var right = function () { + var sibling = function (universe, item) { + return universe.query().nextSibling(item); + }; + var first = function (children) { + return children.length > 0 ? Optional.some(children[0]) : Optional.none(); + }; + return { + sibling: sibling, + first: first + }; + }; + var Walkers = { + left: left, + right: right + }; + + var hone = function (universe, item, predicate, mode, direction, isRoot) { + var next = go$1(universe, item, mode, direction); + return next.bind(function (n) { + if (isRoot(n.item)) { + return Optional.none(); + } else { + return predicate(n.item) ? Optional.some(n.item) : hone(universe, n.item, predicate, n.mode, direction, isRoot); + } + }); + }; + var left$1 = function (universe, item, predicate, isRoot) { + return hone(universe, item, predicate, sidestep, Walkers.left(), isRoot); + }; + var right$1 = function (universe, item, predicate, isRoot) { + return hone(universe, item, predicate, sidestep, Walkers.right(), isRoot); + }; + + var isLeaf = function (universe) { + return function (element) { + return universe.property().children(element).length === 0; + }; + }; + var before$3 = function (universe, item, isRoot) { + return seekLeft(universe, item, isLeaf(universe), isRoot); + }; + var after$4 = function (universe, item, isRoot) { + return seekRight(universe, item, isLeaf(universe), isRoot); + }; + var seekLeft = left$1; + var seekRight = right$1; + + var universe$3 = DomUniverse(); + var before$4 = function (element, isRoot) { + return before$3(universe$3, element, isRoot); + }; + var after$5 = function (element, isRoot) { + return after$4(universe$3, element, isRoot); + }; + var seekLeft$1 = function (element, predicate, isRoot) { + return seekLeft(universe$3, element, predicate, isRoot); + }; + var seekRight$1 = function (element, predicate, isRoot) { + return seekRight(universe$3, element, predicate, isRoot); + }; + + var ancestor$2 = function (scope, predicate, isRoot) { + return ancestor(scope, predicate, isRoot).isSome(); + }; + + var adt$6 = Adt.generate([ + { none: ['message'] }, + { success: [] }, + { failedUp: ['cell'] }, + { failedDown: ['cell'] } + ]); + var isOverlapping = function (bridge, before, after) { + var beforeBounds = bridge.getRect(before); + var afterBounds = bridge.getRect(after); + return afterBounds.right > beforeBounds.left && afterBounds.left < beforeBounds.right; + }; + var isRow = function (elem) { + return closest$1(elem, 'tr'); + }; + var verify = function (bridge, before, beforeOffset, after, afterOffset, failure, isRoot) { + return closest$1(after, 'td,th', isRoot).bind(function (afterCell) { + return closest$1(before, 'td,th', isRoot).map(function (beforeCell) { + if (!eq(afterCell, beforeCell)) { + return sharedOne$1(isRow, [ + afterCell, + beforeCell + ]).fold(function () { + return isOverlapping(bridge, beforeCell, afterCell) ? adt$6.success() : failure(beforeCell); + }, function (_sharedRow) { + return failure(beforeCell); + }); + } else { + return eq(after, afterCell) && getEnd(afterCell) === afterOffset ? failure(beforeCell) : adt$6.none('in same cell'); + } + }); + }).getOr(adt$6.none('default')); + }; + var cata$2 = function (subject, onNone, onSuccess, onFailedUp, onFailedDown) { + return subject.fold(onNone, onSuccess, onFailedUp, onFailedDown); + }; + var BeforeAfter = __assign(__assign({}, adt$6), { + verify: verify, + cata: cata$2 + }); + + var inParent = function (parent, children, element, index) { + return { + parent: parent, + children: children, + element: element, + index: index + }; + }; + var indexInParent = function (element) { + return parent(element).bind(function (parent) { + var children$1 = children(parent); + return indexOf(children$1, element).map(function (index) { + return inParent(parent, children$1, element, index); + }); + }); + }; + var indexOf = function (elements, element) { + return findIndex(elements, curry(eq, element)); + }; + + var isBr = function (elem) { + return name(elem) === 'br'; + }; + var gatherer = function (cand, gather, isRoot) { + return gather(cand, isRoot).bind(function (target) { + return isText(target) && get$3(target).trim().length === 0 ? gatherer(target, gather, isRoot) : Optional.some(target); + }); + }; + var handleBr = function (isRoot, element, direction) { + return direction.traverse(element).orThunk(function () { + return gatherer(element, direction.gather, isRoot); + }).map(direction.relative); + }; + var findBr = function (element, offset) { + return child(element, offset).filter(isBr).orThunk(function () { + return child(element, offset - 1).filter(isBr); + }); + }; + var handleParent = function (isRoot, element, offset, direction) { + return findBr(element, offset).bind(function (br) { + return direction.traverse(br).fold(function () { + return gatherer(br, direction.gather, isRoot).map(direction.relative); + }, function (adjacent) { + return indexInParent(adjacent).map(function (info) { + return Situ.on(info.parent, info.index); + }); + }); + }); + }; + var tryBr = function (isRoot, element, offset, direction) { + var target = isBr(element) ? handleBr(isRoot, element, direction) : handleParent(isRoot, element, offset, direction); + return target.map(function (tgt) { + return { + start: tgt, + finish: tgt + }; + }); + }; + var process = function (analysis) { + return BeforeAfter.cata(analysis, function (_message) { + return Optional.none(); + }, function () { + return Optional.none(); + }, function (cell) { + return Optional.some(point(cell, 0)); + }, function (cell) { + return Optional.some(point(cell, getEnd(cell))); + }); + }; + + var moveDown = function (caret, amount) { + return { + left: caret.left, + top: caret.top + amount, + right: caret.right, + bottom: caret.bottom + amount + }; + }; + var moveUp = function (caret, amount) { + return { + left: caret.left, + top: caret.top - amount, + right: caret.right, + bottom: caret.bottom - amount + }; + }; + var translate = function (caret, xDelta, yDelta) { + return { + left: caret.left + xDelta, + top: caret.top + yDelta, + right: caret.right + xDelta, + bottom: caret.bottom + yDelta + }; + }; + var getTop$1 = function (caret) { + return caret.top; + }; + var getBottom = function (caret) { + return caret.bottom; + }; + + var getPartialBox = function (bridge, element, offset) { + if (offset >= 0 && offset < getEnd(element)) { + return bridge.getRangedRect(element, offset, element, offset + 1); + } else if (offset > 0) { + return bridge.getRangedRect(element, offset - 1, element, offset); + } + return Optional.none(); + }; + var toCaret = function (rect) { + return { + left: rect.left, + top: rect.top, + right: rect.right, + bottom: rect.bottom + }; + }; + var getElemBox = function (bridge, element) { + return Optional.some(bridge.getRect(element)); + }; + var getBoxAt = function (bridge, element, offset) { + if (isElement(element)) { + return getElemBox(bridge, element).map(toCaret); + } else if (isText(element)) { + return getPartialBox(bridge, element, offset).map(toCaret); + } else { + return Optional.none(); + } + }; + var getEntireBox = function (bridge, element) { + if (isElement(element)) { + return getElemBox(bridge, element).map(toCaret); + } else if (isText(element)) { + return bridge.getRangedRect(element, 0, element, getEnd(element)).map(toCaret); + } else { + return Optional.none(); + } + }; + + var JUMP_SIZE = 5; + var NUM_RETRIES = 100; + var adt$7 = Adt.generate([ + { none: [] }, + { retry: ['caret'] } + ]); + var isOutside = function (caret, box) { + return caret.left < box.left || Math.abs(box.right - caret.left) < 1 || caret.left > box.right; + }; + var inOutsideBlock = function (bridge, element, caret) { + return closest(element, isBlock$1).fold(never, function (cell) { + return getEntireBox(bridge, cell).exists(function (box) { + return isOutside(caret, box); + }); + }); + }; + var adjustDown = function (bridge, element, guessBox, original, caret) { + var lowerCaret = moveDown(caret, JUMP_SIZE); + if (Math.abs(guessBox.bottom - original.bottom) < 1) { + return adt$7.retry(lowerCaret); + } else if (guessBox.top > caret.bottom) { + return adt$7.retry(lowerCaret); + } else if (guessBox.top === caret.bottom) { + return adt$7.retry(moveDown(caret, 1)); + } else { + return inOutsideBlock(bridge, element, caret) ? adt$7.retry(translate(lowerCaret, JUMP_SIZE, 0)) : adt$7.none(); + } + }; + var adjustUp = function (bridge, element, guessBox, original, caret) { + var higherCaret = moveUp(caret, JUMP_SIZE); + if (Math.abs(guessBox.top - original.top) < 1) { + return adt$7.retry(higherCaret); + } else if (guessBox.bottom < caret.top) { + return adt$7.retry(higherCaret); + } else if (guessBox.bottom === caret.top) { + return adt$7.retry(moveUp(caret, 1)); + } else { + return inOutsideBlock(bridge, element, caret) ? adt$7.retry(translate(higherCaret, JUMP_SIZE, 0)) : adt$7.none(); + } + }; + var upMovement = { + point: getTop$1, + adjuster: adjustUp, + move: moveUp, + gather: before$4 + }; + var downMovement = { + point: getBottom, + adjuster: adjustDown, + move: moveDown, + gather: after$5 + }; + var isAtTable = function (bridge, x, y) { + return bridge.elementFromPoint(x, y).filter(function (elm) { + return name(elm) === 'table'; + }).isSome(); + }; + var adjustForTable = function (bridge, movement, original, caret, numRetries) { + return adjustTil(bridge, movement, original, movement.move(caret, JUMP_SIZE), numRetries); + }; + var adjustTil = function (bridge, movement, original, caret, numRetries) { + if (numRetries === 0) { + return Optional.some(caret); + } + if (isAtTable(bridge, caret.left, movement.point(caret))) { + return adjustForTable(bridge, movement, original, caret, numRetries - 1); + } + return bridge.situsFromPoint(caret.left, movement.point(caret)).bind(function (guess) { + return guess.start.fold(Optional.none, function (element) { + return getEntireBox(bridge, element).bind(function (guessBox) { + return movement.adjuster(bridge, element, guessBox, original, caret).fold(Optional.none, function (newCaret) { + return adjustTil(bridge, movement, original, newCaret, numRetries - 1); + }); + }).orThunk(function () { + return Optional.some(caret); + }); + }, Optional.none); + }); + }; + var ieTryDown = function (bridge, caret) { + return bridge.situsFromPoint(caret.left, caret.bottom + JUMP_SIZE); + }; + var ieTryUp = function (bridge, caret) { + return bridge.situsFromPoint(caret.left, caret.top - JUMP_SIZE); + }; + var checkScroll = function (movement, adjusted, bridge) { + if (movement.point(adjusted) > bridge.getInnerHeight()) { + return Optional.some(movement.point(adjusted) - bridge.getInnerHeight()); + } else if (movement.point(adjusted) < 0) { + return Optional.some(-movement.point(adjusted)); + } else { + return Optional.none(); + } + }; + var retry = function (movement, bridge, caret) { + var moved = movement.move(caret, JUMP_SIZE); + var adjusted = adjustTil(bridge, movement, caret, moved, NUM_RETRIES).getOr(moved); + return checkScroll(movement, adjusted, bridge).fold(function () { + return bridge.situsFromPoint(adjusted.left, movement.point(adjusted)); + }, function (delta) { + bridge.scrollBy(0, delta); + return bridge.situsFromPoint(adjusted.left, movement.point(adjusted) - delta); + }); + }; + var Retries = { + tryUp: curry(retry, upMovement), + tryDown: curry(retry, downMovement), + ieTryUp: ieTryUp, + ieTryDown: ieTryDown, + getJumpSize: constant(JUMP_SIZE) + }; + + var MAX_RETRIES = 20; + var findSpot = function (bridge, isRoot, direction) { + return bridge.getSelection().bind(function (sel) { + return tryBr(isRoot, sel.finish, sel.foffset, direction).fold(function () { + return Optional.some(point(sel.finish, sel.foffset)); + }, function (brNeighbour) { + var range = bridge.fromSitus(brNeighbour); + var analysis = BeforeAfter.verify(bridge, sel.finish, sel.foffset, range.finish, range.foffset, direction.failure, isRoot); + return process(analysis); + }); + }); + }; + var scan$1 = function (bridge, isRoot, element, offset, direction, numRetries) { + if (numRetries === 0) { + return Optional.none(); + } + return tryCursor(bridge, isRoot, element, offset, direction).bind(function (situs) { + var range = bridge.fromSitus(situs); + var analysis = BeforeAfter.verify(bridge, element, offset, range.finish, range.foffset, direction.failure, isRoot); + return BeforeAfter.cata(analysis, function () { + return Optional.none(); + }, function () { + return Optional.some(situs); + }, function (cell) { + if (eq(element, cell) && offset === 0) { + return tryAgain(bridge, element, offset, moveUp, direction); + } else { + return scan$1(bridge, isRoot, cell, 0, direction, numRetries - 1); + } + }, function (cell) { + if (eq(element, cell) && offset === getEnd(cell)) { + return tryAgain(bridge, element, offset, moveDown, direction); + } else { + return scan$1(bridge, isRoot, cell, getEnd(cell), direction, numRetries - 1); + } + }); + }); + }; + var tryAgain = function (bridge, element, offset, move, direction) { + return getBoxAt(bridge, element, offset).bind(function (box) { + return tryAt(bridge, direction, move(box, Retries.getJumpSize())); + }); + }; + var tryAt = function (bridge, direction, box) { + var browser = detect$3().browser; + if (browser.isChrome() || browser.isSafari() || browser.isFirefox() || browser.isEdge()) { + return direction.otherRetry(bridge, box); + } else if (browser.isIE()) { + return direction.ieRetry(bridge, box); + } else { + return Optional.none(); + } + }; + var tryCursor = function (bridge, isRoot, element, offset, direction) { + return getBoxAt(bridge, element, offset).bind(function (box) { + return tryAt(bridge, direction, box); + }); + }; + var handle$2 = function (bridge, isRoot, direction) { + return findSpot(bridge, isRoot, direction).bind(function (spot) { + return scan$1(bridge, isRoot, spot.element, spot.offset, direction, MAX_RETRIES).map(bridge.fromSitus); + }); + }; + + var inSameTable = function (elem, table) { + return ancestor$2(elem, function (e) { + return parent(e).exists(function (p) { + return eq(p, table); + }); + }); + }; + var simulate = function (bridge, isRoot, direction, initial, anchor) { + return closest$1(initial, 'td,th', isRoot).bind(function (start) { + return closest$1(start, 'table', isRoot).bind(function (table) { + if (!inSameTable(anchor, table)) { + return Optional.none(); + } + return handle$2(bridge, isRoot, direction).bind(function (range) { + return closest$1(range.finish, 'td,th', isRoot).map(function (finish) { + return { + start: start, + finish: finish, + range: range + }; + }); + }); + }); + }); + }; + var navigate = function (bridge, isRoot, direction, initial, anchor, precheck) { + if (detect$3().browser.isIE()) { + return Optional.none(); + } else { + return precheck(initial, isRoot).orThunk(function () { + return simulate(bridge, isRoot, direction, initial, anchor).map(function (info) { + var range = info.range; + return Response.create(Optional.some(makeSitus(range.start, range.soffset, range.finish, range.foffset)), true); + }); + }); + } + }; + var firstUpCheck = function (initial, isRoot) { + return closest$1(initial, 'tr', isRoot).bind(function (startRow) { + return closest$1(startRow, 'table', isRoot).bind(function (table) { + var rows = descendants$1(table, 'tr'); + if (eq(startRow, rows[0])) { + return seekLeft$1(table, function (element) { + return last$1(element).isSome(); + }, isRoot).map(function (last) { + var lastOffset = getEnd(last); + return Response.create(Optional.some(makeSitus(last, lastOffset, last, lastOffset)), true); + }); + } else { + return Optional.none(); + } + }); + }); + }; + var lastDownCheck = function (initial, isRoot) { + return closest$1(initial, 'tr', isRoot).bind(function (startRow) { + return closest$1(startRow, 'table', isRoot).bind(function (table) { + var rows = descendants$1(table, 'tr'); + if (eq(startRow, rows[rows.length - 1])) { + return seekRight$1(table, function (element) { + return first(element).isSome(); + }, isRoot).map(function (first) { + return Response.create(Optional.some(makeSitus(first, 0, first, 0)), true); + }); + } else { + return Optional.none(); + } + }); + }); + }; + var select = function (bridge, container, isRoot, direction, initial, anchor, selectRange) { + return simulate(bridge, isRoot, direction, initial, anchor).bind(function (info) { + return detect$6(container, isRoot, info.start, info.finish, selectRange); + }); + }; + + var value$1 = function () { + var subject = Cell(Optional.none()); + var clear = function () { + return subject.set(Optional.none()); + }; + var set = function (s) { + return subject.set(Optional.some(s)); + }; + var isSet = function () { + return subject.get().isSome(); + }; + var on = function (f) { + return subject.get().each(f); + }; + return { + clear: clear, + set: set, + isSet: isSet, + on: on + }; + }; + + var findCell = function (target, isRoot) { + return closest$1(target, 'td,th', isRoot); + }; + function MouseSelection (bridge, container, isRoot, annotations) { + var cursor = value$1(); + var clearstate = cursor.clear; + var mousedown = function (event) { + annotations.clear(container); + findCell(event.target, isRoot).each(cursor.set); + }; + var mouseover = function (event) { + cursor.on(function (start) { + annotations.clearBeforeUpdate(container); + findCell(event.target, isRoot).each(function (finish) { + identify(start, finish, isRoot).each(function (cellSel) { + var boxes = cellSel.boxes.getOr([]); + if (boxes.length > 1 || boxes.length === 1 && !eq(start, finish)) { + annotations.selectRange(container, boxes, cellSel.start, cellSel.finish); + bridge.selectContents(finish); + } + }); + }); + }); + }; + var mouseup = function (_event) { + clearstate(); + }; + return { + clearstate: clearstate, + mousedown: mousedown, + mouseover: mouseover, + mouseup: mouseup + }; + } + + var down = { + traverse: nextSibling, + gather: after$5, + relative: Situ.before, + otherRetry: Retries.tryDown, + ieRetry: Retries.ieTryDown, + failure: BeforeAfter.failedDown + }; + var up = { + traverse: prevSibling, + gather: before$4, + relative: Situ.before, + otherRetry: Retries.tryUp, + ieRetry: Retries.ieTryUp, + failure: BeforeAfter.failedUp + }; + + var isKey = function (key) { + return function (keycode) { + return keycode === key; + }; + }; + var isUp = isKey(38); + var isDown = isKey(40); + var isNavigation = function (keycode) { + return keycode >= 37 && keycode <= 40; + }; + var ltr$2 = { + isBackward: isKey(37), + isForward: isKey(39) + }; + var rtl$2 = { + isBackward: isKey(39), + isForward: isKey(37) + }; + + var get$c = function (_DOC) { + var doc = _DOC !== undefined ? _DOC.dom : document; + var x = doc.body.scrollLeft || doc.documentElement.scrollLeft; + var y = doc.body.scrollTop || doc.documentElement.scrollTop; + return SugarPosition(x, y); + }; + var by = function (x, y, _DOC) { + var doc = _DOC !== undefined ? _DOC.dom : document; + var win = doc.defaultView; + if (win) { + win.scrollBy(x, y); + } + }; + + var WindowBridge = function (win) { + var elementFromPoint = function (x, y) { + return SugarElement.fromPoint(SugarElement.fromDom(win.document), x, y); + }; + var getRect = function (element) { + return element.dom.getBoundingClientRect(); + }; + var getRangedRect = function (start, soffset, finish, foffset) { + var sel = SimSelection.exact(start, soffset, finish, foffset); + return getFirstRect$1(win, sel); + }; + var getSelection = function () { + return get$b(win).map(function (exactAdt) { + return convertToRange(win, exactAdt); + }); + }; + var fromSitus = function (situs) { + var relative = SimSelection.relative(situs.start, situs.finish); + return convertToRange(win, relative); + }; + var situsFromPoint = function (x, y) { + return getAtPoint(win, x, y).map(function (exact) { + return Situs.create(exact.start, exact.soffset, exact.finish, exact.foffset); + }); + }; + var clearSelection = function () { + clear(win); + }; + var collapseSelection = function (toStart) { + if (toStart === void 0) { + toStart = false; + } + get$b(win).each(function (sel) { + return sel.fold(function (rng) { + return rng.collapse(toStart); + }, function (startSitu, finishSitu) { + var situ = toStart ? startSitu : finishSitu; + setRelative(win, situ, situ); + }, function (start, soffset, finish, foffset) { + var node = toStart ? start : finish; + var offset = toStart ? soffset : foffset; + setExact(win, node, offset, node, offset); + }); + }); + }; + var selectContents = function (element) { + setToElement(win, element); + }; + var setSelection = function (sel) { + setExact(win, sel.start, sel.soffset, sel.finish, sel.foffset); + }; + var setRelativeSelection = function (start, finish) { + setRelative(win, start, finish); + }; + var getInnerHeight = function () { + return win.innerHeight; + }; + var getScrollY = function () { + var pos = get$c(SugarElement.fromDom(win.document)); + return pos.top; + }; + var scrollBy = function (x, y) { + by(x, y, SugarElement.fromDom(win.document)); + }; + return { + elementFromPoint: elementFromPoint, + getRect: getRect, + getRangedRect: getRangedRect, + getSelection: getSelection, + fromSitus: fromSitus, + situsFromPoint: situsFromPoint, + clearSelection: clearSelection, + collapseSelection: collapseSelection, + setSelection: setSelection, + setRelativeSelection: setRelativeSelection, + selectContents: selectContents, + getInnerHeight: getInnerHeight, + getScrollY: getScrollY, + scrollBy: scrollBy + }; + }; + + var rc = function (rows, cols) { + return { + rows: rows, + cols: cols + }; + }; + var mouse = function (win, container, isRoot, annotations) { + var bridge = WindowBridge(win); + var handlers = MouseSelection(bridge, container, isRoot, annotations); + return { + clearstate: handlers.clearstate, + mousedown: handlers.mousedown, + mouseover: handlers.mouseover, + mouseup: handlers.mouseup + }; + }; + var keyboard = function (win, container, isRoot, annotations) { + var bridge = WindowBridge(win); + var clearToNavigate = function () { + annotations.clear(container); + return Optional.none(); + }; + var keydown = function (event, start, soffset, finish, foffset, direction) { + var realEvent = event.raw; + var keycode = realEvent.which; + var shiftKey = realEvent.shiftKey === true; + var handler = retrieve(container, annotations.selectedSelector).fold(function () { + if (isDown(keycode) && shiftKey) { + return curry(select, bridge, container, isRoot, down, finish, start, annotations.selectRange); + } else if (isUp(keycode) && shiftKey) { + return curry(select, bridge, container, isRoot, up, finish, start, annotations.selectRange); + } else if (isDown(keycode)) { + return curry(navigate, bridge, isRoot, down, finish, start, lastDownCheck); + } else if (isUp(keycode)) { + return curry(navigate, bridge, isRoot, up, finish, start, firstUpCheck); + } else { + return Optional.none; + } + }, function (selected) { + var update$1 = function (attempts) { + return function () { + var navigation = findMap(attempts, function (delta) { + return update(delta.rows, delta.cols, container, selected, annotations); + }); + return navigation.fold(function () { + return getEdges(container, annotations.firstSelectedSelector, annotations.lastSelectedSelector).map(function (edges) { + var relative = isDown(keycode) || direction.isForward(keycode) ? Situ.after : Situ.before; + bridge.setRelativeSelection(Situ.on(edges.first, 0), relative(edges.table)); + annotations.clear(container); + return Response.create(Optional.none(), true); + }); + }, function (_) { + return Optional.some(Response.create(Optional.none(), true)); + }); + }; + }; + if (isDown(keycode) && shiftKey) { + return update$1([rc(+1, 0)]); + } else if (isUp(keycode) && shiftKey) { + return update$1([rc(-1, 0)]); + } else if (direction.isBackward(keycode) && shiftKey) { + return update$1([ + rc(0, -1), + rc(-1, 0) + ]); + } else if (direction.isForward(keycode) && shiftKey) { + return update$1([ + rc(0, +1), + rc(+1, 0) + ]); + } else if (isNavigation(keycode) && shiftKey === false) { + return clearToNavigate; + } else { + return Optional.none; + } + }); + return handler(); + }; + var keyup = function (event, start, soffset, finish, foffset) { + return retrieve(container, annotations.selectedSelector).fold(function () { + var realEvent = event.raw; + var keycode = realEvent.which; + var shiftKey = realEvent.shiftKey === true; + if (shiftKey === false) { + return Optional.none(); + } + if (isNavigation(keycode)) { + return sync(container, isRoot, start, soffset, finish, foffset, annotations.selectRange); + } else { + return Optional.none(); + } + }, Optional.none); + }; + return { + keydown: keydown, + keyup: keyup + }; + }; + var external = function (win, container, isRoot, annotations) { + var bridge = WindowBridge(win); + return function (start, finish) { + annotations.clearBeforeUpdate(container); + identify(start, finish, isRoot).each(function (cellSel) { + var boxes = cellSel.boxes.getOr([]); + annotations.selectRange(container, boxes, cellSel.start, cellSel.finish); + bridge.selectContents(finish); + bridge.collapseSelection(); + }); + }; + }; + + var remove$7 = function (element, classes) { + each(classes, function (x) { + remove$5(element, x); + }); + }; + + var addClass = function (clazz) { + return function (element) { + add$3(element, clazz); + }; + }; + var removeClasses = function (classes) { + return function (element) { + remove$7(element, classes); + }; + }; + + var byClass = function (ephemera) { + var addSelectionClass = addClass(ephemera.selected); + var removeSelectionClasses = removeClasses([ + ephemera.selected, + ephemera.lastSelected, + ephemera.firstSelected + ]); + var clear = function (container) { + var sels = descendants$1(container, ephemera.selectedSelector); + each(sels, removeSelectionClasses); + }; + var selectRange = function (container, cells, start, finish) { + clear(container); + each(cells, addSelectionClass); + add$3(start, ephemera.firstSelected); + add$3(finish, ephemera.lastSelected); + }; + return { + clearBeforeUpdate: clear, + clear: clear, + selectRange: selectRange, + selectedSelector: ephemera.selectedSelector, + firstSelectedSelector: ephemera.firstSelectedSelector, + lastSelectedSelector: ephemera.lastSelectedSelector + }; + }; + var byAttr = function (ephemera, onSelection, onClear) { + var removeSelectionAttributes = function (element) { + remove(element, ephemera.selected); + remove(element, ephemera.firstSelected); + remove(element, ephemera.lastSelected); + }; + var addSelectionAttribute = function (element) { + set(element, ephemera.selected, '1'); + }; + var clear = function (container) { + clearBeforeUpdate(container); + onClear(); + }; + var clearBeforeUpdate = function (container) { + var sels = descendants$1(container, ephemera.selectedSelector); + each(sels, removeSelectionAttributes); + }; + var selectRange = function (container, cells, start, finish) { + clear(container); + each(cells, addSelectionAttribute); + set(start, ephemera.firstSelected, '1'); + set(finish, ephemera.lastSelected, '1'); + onSelection(cells, start, finish); + }; + return { + clearBeforeUpdate: clearBeforeUpdate, + clear: clear, + selectRange: selectRange, + selectedSelector: ephemera.selectedSelector, + firstSelectedSelector: ephemera.firstSelectedSelector, + lastSelectedSelector: ephemera.lastSelectedSelector + }; + }; + var SelectionAnnotation = { + byClass: byClass, + byAttr: byAttr + }; + + var getUpOrLeftCells = function (grid, selectedCells, generators) { + var upGrid = grid.slice(0, selectedCells[selectedCells.length - 1].row + 1); + var upDetails = toDetailList(upGrid, generators); + return bind(upDetails, function (detail) { + var slicedCells = detail.cells.slice(0, selectedCells[selectedCells.length - 1].column + 1); + return map(slicedCells, function (cell) { + return cell.element; + }); + }); + }; + var getDownOrRightCells = function (grid, selectedCells, generators) { + var downGrid = grid.slice(selectedCells[0].row + selectedCells[0].rowspan - 1, grid.length); + var downDetails = toDetailList(downGrid, generators); + return bind(downDetails, function (detail) { + var slicedCells = detail.cells.slice(selectedCells[0].column + selectedCells[0].colspan - 1, detail.cells.length); + return map(slicedCells, function (cell) { + return cell.element; + }); + }); + }; + var getOtherCells = function (table, target, generators) { + var warehouse = Warehouse.fromTable(table); + var details = onCells(warehouse, target); + return details.map(function (selectedCells) { + var grid = toGrid(warehouse, generators, false); + var upOrLeftCells = getUpOrLeftCells(grid, selectedCells, generators); + var downOrRightCells = getDownOrRightCells(grid, selectedCells, generators); + return { + upOrLeftCells: upOrLeftCells, + downOrRightCells: downOrRightCells + }; + }); + }; + + var hasInternalTarget = function (e) { + return has$1(SugarElement.fromDom(e.target), 'ephox-snooker-resizer-bar') === false; + }; + function CellSelection (editor, lazyResize, selectionTargets) { + var onSelection = function (cells, start, finish) { + selectionTargets.targets().each(function (targets) { + var tableOpt = table(start); + tableOpt.each(function (table) { + var cloneFormats = getCloneElements(editor); + var generators = cellOperations(noop, SugarElement.fromDom(editor.getDoc()), cloneFormats); + var otherCells = getOtherCells(table, targets, generators); + fireTableSelectionChange(editor, cells, start, finish, otherCells); + }); + }); + }; + var onClear = function () { + return fireTableSelectionClear(editor); + }; + var annotations = SelectionAnnotation.byAttr(ephemera, onSelection, onClear); + editor.on('init', function (_e) { + var win = editor.getWin(); + var body = getBody$1(editor); + var isRoot = getIsRoot(editor); + var syncSelection = function () { + var sel = editor.selection; + var start = SugarElement.fromDom(sel.getStart()); + var end = SugarElement.fromDom(sel.getEnd()); + var shared = sharedOne$1(table, [ + start, + end + ]); + shared.fold(function () { + return annotations.clear(body); + }, noop); + }; + var mouseHandlers = mouse(win, body, isRoot, annotations); + var keyHandlers = keyboard(win, body, isRoot, annotations); + var external$1 = external(win, body, isRoot, annotations); + var hasShiftKey = function (event) { + return event.raw.shiftKey === true; + }; + editor.on('TableSelectorChange', function (e) { + return external$1(e.start, e.finish); + }); + var handleResponse = function (event, response) { + if (!hasShiftKey(event)) { + return; + } + if (response.kill) { + event.kill(); + } + response.selection.each(function (ns) { + var relative = SimSelection.relative(ns.start, ns.finish); + var rng = asLtrRange(win, relative); + editor.selection.setRng(rng); + }); + }; + var keyup = function (event) { + var wrappedEvent = fromRawEvent$1(event); + if (wrappedEvent.raw.shiftKey && isNavigation(wrappedEvent.raw.which)) { + var rng = editor.selection.getRng(); + var start = SugarElement.fromDom(rng.startContainer); + var end = SugarElement.fromDom(rng.endContainer); + keyHandlers.keyup(wrappedEvent, start, rng.startOffset, end, rng.endOffset).each(function (response) { + handleResponse(wrappedEvent, response); + }); + } + }; + var keydown = function (event) { + var wrappedEvent = fromRawEvent$1(event); + lazyResize().each(function (resize) { + return resize.hideBars(); + }); + var rng = editor.selection.getRng(); + var start = SugarElement.fromDom(rng.startContainer); + var end = SugarElement.fromDom(rng.endContainer); + var direction = onDirection(ltr$2, rtl$2)(SugarElement.fromDom(editor.selection.getStart())); + keyHandlers.keydown(wrappedEvent, start, rng.startOffset, end, rng.endOffset, direction).each(function (response) { + handleResponse(wrappedEvent, response); + }); + lazyResize().each(function (resize) { + return resize.showBars(); + }); + }; + var isLeftMouse = function (raw) { + return raw.button === 0; + }; + var isLeftButtonPressed = function (raw) { + if (raw.buttons === undefined) { + return true; + } + if (global$2.browser.isEdge() && raw.buttons === 0) { + return true; + } + return (raw.buttons & 1) !== 0; + }; + var dragStart = function (_e) { + mouseHandlers.clearstate(); + }; + var mouseDown = function (e) { + if (isLeftMouse(e) && hasInternalTarget(e)) { + mouseHandlers.mousedown(fromRawEvent$1(e)); + } + }; + var mouseOver = function (e) { + if (isLeftButtonPressed(e) && hasInternalTarget(e)) { + mouseHandlers.mouseover(fromRawEvent$1(e)); + } + }; + var mouseUp = function (e) { + if (isLeftMouse(e) && hasInternalTarget(e)) { + mouseHandlers.mouseup(fromRawEvent$1(e)); + } + }; + var getDoubleTap = function () { + var lastTarget = Cell(SugarElement.fromDom(body)); + var lastTimeStamp = Cell(0); + var touchEnd = function (t) { + var target = SugarElement.fromDom(t.target); + if (name(target) === 'td' || name(target) === 'th') { + var lT = lastTarget.get(); + var lTS = lastTimeStamp.get(); + if (eq(lT, target) && t.timeStamp - lTS < 300) { + t.preventDefault(); + external$1(target, target); + } + } + lastTarget.set(target); + lastTimeStamp.set(t.timeStamp); + }; + return { touchEnd: touchEnd }; + }; + var doubleTap = getDoubleTap(); + editor.on('dragstart', dragStart); + editor.on('mousedown', mouseDown); + editor.on('mouseover', mouseOver); + editor.on('mouseup', mouseUp); + editor.on('touchend', doubleTap.touchEnd); + editor.on('keyup', keyup); + editor.on('keydown', keydown); + editor.on('NodeChange', syncSelection); + }); + return { clear: annotations.clear }; + } + + var getSelectionTargets = function (editor, selections) { + var targets = Cell(Optional.none()); + var changeHandlers = Cell([]); + var findTargets = function () { + return getSelectionStartCellOrCaption(getSelectionStart(editor)).bind(function (cellOrCaption) { + var table$1 = table(cellOrCaption); + var isCaption = function (elem) { + return name(elem) === 'caption'; + }; + return table$1.map(function (table) { + if (isCaption(cellOrCaption)) { + return noMenu(cellOrCaption); + } else { + return forMenu(selections, table, cellOrCaption); + } + }); + }); + }; + var resetTargets = function () { + targets.set(cached(findTargets)()); + each(changeHandlers.get(), function (handler) { + return handler(); + }); + }; + var onSetup = function (api, isDisabled) { + var handler = function () { + return targets.get().fold(function () { + api.setDisabled(true); + }, function (targets) { + api.setDisabled(isDisabled(targets)); + }); + }; + handler(); + changeHandlers.set(changeHandlers.get().concat([handler])); + return function () { + changeHandlers.set(filter(changeHandlers.get(), function (h) { + return h !== handler; + })); + }; + }; + var onSetupTable = function (api) { + return onSetup(api, function (_) { + return false; + }); + }; + var onSetupCellOrRow = function (api) { + return onSetup(api, function (targets) { + return name(targets.element) === 'caption'; + }); + }; + var onSetupPasteable = function (getClipboardData) { + return function (api) { + return onSetup(api, function (targets) { + return name(targets.element) === 'caption' || getClipboardData().isNone(); + }); + }; + }; + var onSetupMergeable = function (api) { + return onSetup(api, function (targets) { + return targets.mergable.isNone(); + }); + }; + var onSetupUnmergeable = function (api) { + return onSetup(api, function (targets) { + return targets.unmergable.isNone(); + }); + }; + editor.on('NodeChange ExecCommand TableSelectorChange', resetTargets); + return { + onSetupTable: onSetupTable, + onSetupCellOrRow: onSetupCellOrRow, + onSetupPasteable: onSetupPasteable, + onSetupMergeable: onSetupMergeable, + onSetupUnmergeable: onSetupUnmergeable, + resetTargets: resetTargets, + targets: function () { + return targets.get(); + } + }; + }; + + var addButtons = function (editor, selectionTargets, clipboard) { + editor.ui.registry.addMenuButton('table', { + tooltip: 'Table', + icon: 'table', + fetch: function (callback) { + return callback('inserttable | cell row column | advtablesort | tableprops deletetable'); + } + }); + var cmd = function (command) { + return function () { + return editor.execCommand(command); + }; + }; + editor.ui.registry.addButton('tableprops', { + tooltip: 'Table properties', + onAction: cmd('mceTableProps'), + icon: 'table', + onSetup: selectionTargets.onSetupTable + }); + editor.ui.registry.addButton('tabledelete', { + tooltip: 'Delete table', + onAction: cmd('mceTableDelete'), + icon: 'table-delete-table', + onSetup: selectionTargets.onSetupTable + }); + editor.ui.registry.addButton('tablecellprops', { + tooltip: 'Cell properties', + onAction: cmd('mceTableCellProps'), + icon: 'table-cell-properties', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tablemergecells', { + tooltip: 'Merge cells', + onAction: cmd('mceTableMergeCells'), + icon: 'table-merge-cells', + onSetup: selectionTargets.onSetupMergeable + }); + editor.ui.registry.addButton('tablesplitcells', { + tooltip: 'Split cell', + onAction: cmd('mceTableSplitCells'), + icon: 'table-split-cells', + onSetup: selectionTargets.onSetupUnmergeable + }); + editor.ui.registry.addButton('tableinsertrowbefore', { + tooltip: 'Insert row before', + onAction: cmd('mceTableInsertRowBefore'), + icon: 'table-insert-row-above', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tableinsertrowafter', { + tooltip: 'Insert row after', + onAction: cmd('mceTableInsertRowAfter'), + icon: 'table-insert-row-after', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tabledeleterow', { + tooltip: 'Delete row', + onAction: cmd('mceTableDeleteRow'), + icon: 'table-delete-row', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tablerowprops', { + tooltip: 'Row properties', + onAction: cmd('mceTableRowProps'), + icon: 'table-row-properties', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tableinsertcolbefore', { + tooltip: 'Insert column before', + onAction: cmd('mceTableInsertColBefore'), + icon: 'table-insert-column-before', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tableinsertcolafter', { + tooltip: 'Insert column after', + onAction: cmd('mceTableInsertColAfter'), + icon: 'table-insert-column-after', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tabledeletecol', { + tooltip: 'Delete column', + onAction: cmd('mceTableDeleteCol'), + icon: 'table-delete-column', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tablecutrow', { + tooltip: 'Cut row', + icon: 'cut-row', + onAction: cmd('mceTableCutRow'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tablecopyrow', { + tooltip: 'Copy row', + icon: 'duplicate-row', + onAction: cmd('mceTableCopyRow'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tablepasterowbefore', { + tooltip: 'Paste row before', + icon: 'paste-row-before', + onAction: cmd('mceTablePasteRowBefore'), + onSetup: selectionTargets.onSetupPasteable(clipboard.getRows) + }); + editor.ui.registry.addButton('tablepasterowafter', { + tooltip: 'Paste row after', + icon: 'paste-row-after', + onAction: cmd('mceTablePasteRowAfter'), + onSetup: selectionTargets.onSetupPasteable(clipboard.getRows) + }); + editor.ui.registry.addButton('tablecutcol', { + tooltip: 'Cut column', + icon: 'cut-column', + onAction: cmd('mceTableCutCol'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tablecopycol', { + tooltip: 'Copy column', + icon: 'duplicate-column', + onAction: cmd('mceTableCopyCol'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tablepastecolbefore', { + tooltip: 'Paste column before', + icon: 'paste-column-before', + onAction: cmd('mceTablePasteColBefore'), + onSetup: selectionTargets.onSetupPasteable(clipboard.getColumns) + }); + editor.ui.registry.addButton('tablepastecolafter', { + tooltip: 'Paste column after', + icon: 'paste-column-after', + onAction: cmd('mceTablePasteColAfter'), + onSetup: selectionTargets.onSetupPasteable(clipboard.getColumns) + }); + editor.ui.registry.addButton('tableinsertdialog', { + tooltip: 'Insert table', + onAction: cmd('mceInsertTable'), + icon: 'table' + }); + }; + var addToolbars = function (editor) { + var isTable = function (table) { + return editor.dom.is(table, 'table') && editor.getBody().contains(table); + }; + var toolbar = getToolbar(editor); + if (toolbar.length > 0) { + editor.ui.registry.addContextToolbar('table', { + predicate: isTable, + items: toolbar, + scope: 'node', + position: 'node' + }); + } + }; + + var addMenuItems = function (editor, selectionTargets, clipboard) { + var cmd = function (command) { + return function () { + return editor.execCommand(command); + }; + }; + var insertTableAction = function (_a) { + var numRows = _a.numRows, numColumns = _a.numColumns; + editor.undoManager.transact(function () { + insert$1(editor, numColumns, numRows, 0, 0); + }); + editor.addVisual(); + }; + var tableProperties = { + text: 'Table properties', + onSetup: selectionTargets.onSetupTable, + onAction: cmd('mceTableProps') + }; + var deleteTable = { + text: 'Delete table', + icon: 'table-delete-table', + onSetup: selectionTargets.onSetupTable, + onAction: cmd('mceTableDelete') + }; + editor.ui.registry.addMenuItem('tableinsertrowbefore', { + text: 'Insert row before', + icon: 'table-insert-row-above', + onAction: cmd('mceTableInsertRowBefore'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addMenuItem('tableinsertrowafter', { + text: 'Insert row after', + icon: 'table-insert-row-after', + onAction: cmd('mceTableInsertRowAfter'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addMenuItem('tabledeleterow', { + text: 'Delete row', + icon: 'table-delete-row', + onAction: cmd('mceTableDeleteRow'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addMenuItem('tablerowprops', { + text: 'Row properties', + icon: 'table-row-properties', + onAction: cmd('mceTableRowProps'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addMenuItem('tablecutrow', { + text: 'Cut row', + icon: 'cut-row', + onAction: cmd('mceTableCutRow'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addMenuItem('tablecopyrow', { + text: 'Copy row', + icon: 'duplicate-row', + onAction: cmd('mceTableCopyRow'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addMenuItem('tablepasterowbefore', { + text: 'Paste row before', + icon: 'paste-row-before', + onAction: cmd('mceTablePasteRowBefore'), + onSetup: selectionTargets.onSetupPasteable(clipboard.getRows) + }); + editor.ui.registry.addMenuItem('tablepasterowafter', { + text: 'Paste row after', + icon: 'paste-row-after', + onAction: cmd('mceTablePasteRowAfter'), + onSetup: selectionTargets.onSetupPasteable(clipboard.getRows) + }); + var row = { + type: 'nestedmenuitem', + text: 'Row', + getSubmenuItems: function () { + return 'tableinsertrowbefore tableinsertrowafter tabledeleterow tablerowprops | tablecutrow tablecopyrow tablepasterowbefore tablepasterowafter'; + } + }; + editor.ui.registry.addMenuItem('tableinsertcolumnbefore', { + text: 'Insert column before', + icon: 'table-insert-column-before', + onAction: cmd('mceTableInsertColBefore'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addMenuItem('tableinsertcolumnafter', { + text: 'Insert column after', + icon: 'table-insert-column-after', + onAction: cmd('mceTableInsertColAfter'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addMenuItem('tabledeletecolumn', { + text: 'Delete column', + icon: 'table-delete-column', + onAction: cmd('mceTableDeleteCol'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addMenuItem('tablecutcolumn', { + text: 'Cut column', + icon: 'cut-column', + onAction: cmd('mceTableCutCol'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addMenuItem('tablecopycolumn', { + text: 'Copy column', + icon: 'duplicate-column', + onAction: cmd('mceTableCopyCol'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addMenuItem('tablepastecolumnbefore', { + text: 'Paste column before', + icon: 'paste-column-before', + onAction: cmd('mceTablePasteColBefore'), + onSetup: selectionTargets.onSetupPasteable(clipboard.getColumns) + }); + editor.ui.registry.addMenuItem('tablepastecolumnafter', { + text: 'Paste column after', + icon: 'paste-column-after', + onAction: cmd('mceTablePasteColAfter'), + onSetup: selectionTargets.onSetupPasteable(clipboard.getColumns) + }); + var column = { + type: 'nestedmenuitem', + text: 'Column', + getSubmenuItems: function () { + return 'tableinsertcolumnbefore tableinsertcolumnafter tabledeletecolumn | tablecutcolumn tablecopycolumn tablepastecolumnbefore tablepastecolumnafter'; + } + }; + editor.ui.registry.addMenuItem('tablecellprops', { + text: 'Cell properties', + icon: 'table-cell-properties', + onAction: cmd('mceTableCellProps'), + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addMenuItem('tablemergecells', { + text: 'Merge cells', + icon: 'table-merge-cells', + onAction: cmd('mceTableMergeCells'), + onSetup: selectionTargets.onSetupMergeable + }); + editor.ui.registry.addMenuItem('tablesplitcells', { + text: 'Split cell', + icon: 'table-split-cells', + onAction: cmd('mceTableSplitCells'), + onSetup: selectionTargets.onSetupUnmergeable + }); + var cell = { + type: 'nestedmenuitem', + text: 'Cell', + getSubmenuItems: function () { + return 'tablecellprops tablemergecells tablesplitcells'; + } + }; + if (hasTableGrid(editor) === false) { + editor.ui.registry.addMenuItem('inserttable', { + text: 'Table', + icon: 'table', + onAction: cmd('mceInsertTable') + }); + } else { + editor.ui.registry.addNestedMenuItem('inserttable', { + text: 'Table', + icon: 'table', + getSubmenuItems: function () { + return [{ + type: 'fancymenuitem', + fancytype: 'inserttable', + onAction: insertTableAction + }]; + } + }); + } + editor.ui.registry.addMenuItem('inserttabledialog', { + text: 'Insert table', + icon: 'table', + onAction: cmd('mceInsertTable') + }); + editor.ui.registry.addMenuItem('tableprops', tableProperties); + editor.ui.registry.addMenuItem('deletetable', deleteTable); + editor.ui.registry.addNestedMenuItem('row', row); + editor.ui.registry.addNestedMenuItem('column', column); + editor.ui.registry.addNestedMenuItem('cell', cell); + editor.ui.registry.addContextMenu('table', { + update: function () { + selectionTargets.resetTargets(); + return selectionTargets.targets().fold(function () { + return ''; + }, function (targets) { + if (name(targets.element) === 'caption') { + return 'tableprops deletetable'; + } else { + return 'cell row column | advtablesort | tableprops deletetable'; + } + }); + } + }); + }; + + function Plugin(editor) { + var selections = Selections(function () { + return getBody$1(editor); + }, function () { + return getSelectionStartCellOrCaption(getSelectionStart(editor)); + }, ephemera.selectedSelector); + var selectionTargets = getSelectionTargets(editor, selections); + var resizeHandler = getResizeHandler(editor); + var cellSelection = CellSelection(editor, resizeHandler.lazyResize, selectionTargets); + var actions = TableActions(editor, resizeHandler.lazyWire, selections); + var clipboard = Clipboard(); + registerCommands(editor, actions, cellSelection, selections, clipboard); + registerQueryCommands(editor, actions, selections); + registerEvents(editor, selections, actions, cellSelection); + addMenuItems(editor, selectionTargets, clipboard); + addButtons(editor, selectionTargets, clipboard); + addToolbars(editor); + editor.on('PreInit', function () { + editor.serializer.addTempAttr(ephemera.firstSelected); + editor.serializer.addTempAttr(ephemera.lastSelected); + registerFormats(editor); + }); + if (hasTabNavigation(editor)) { + editor.on('keydown', function (e) { + handle$1(e, editor, actions); + }); + } + editor.on('remove', function () { + resizeHandler.destroy(); + }); + return getApi(editor, clipboard, resizeHandler, selectionTargets); + } + function Plugin$1 () { + global.add('table', Plugin); + } + + Plugin$1(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/table/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/table/plugin.min.js old mode 100755 new mode 100644 index a2aac1e06ffd..17330b459a8a --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/table/plugin.min.js +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/table/plugin.min.js @@ -1 +1,9 @@ -!function(e,t){"use strict";function n(e,t){for(var n,o=[],i=0;i "+t+" tr",a);i(n,function(n,r){r+=e,i(I.select("> td, > th",n),function(e,n){var i,a,l,s;if(A[r])for(;A[r][n];)n++;for(l=o(e,"rowspan"),s=o(e,"colspan"),a=r;r+l>a;a++)for(A[a]||(A[a]=[]),i=n;n+s>i;i++)A[a][i]={part:t,real:a==r&&i==n,elm:e,rowspan:l,colspan:s}})}),e+=n.length})}function s(e,t){return e=e.cloneNode(t),e.removeAttribute("id"),e}function c(e,t){var n;return n=A[t],n?n[e]:void 0}function d(e,t,n){e&&(n=parseInt(n,10),1===n?e.removeAttribute(t,1):e.setAttribute(t,n,1))}function u(e){return e&&(I.hasClass(e.elm,"mce-item-selected")||e==M)}function f(){var e=[];return i(a.rows,function(t){i(t.cells,function(n){return I.hasClass(n,"mce-item-selected")||M&&n==M.elm?(e.push(t),!1):void 0})}),e}function m(){var e=I.createRng();e.setStartAfter(a),e.setEndAfter(a),E.setRng(e),I.remove(a)}function p(t){var o,a={};return r.settings.table_clone_elements!==!1&&(a=e.makeMap((r.settings.table_clone_elements||"strong em b i span font h1 h2 h3 h4 h5 h6 p div").toUpperCase(),/[ ,]/)),e.walk(t,function(e){var r;return 3==e.nodeType?(i(I.getParents(e.parentNode,null,t).reverse(),function(e){a[e.nodeName]&&(e=s(e,!1),o?r&&r.appendChild(e):o=r=e,r=e)}),r&&(r.innerHTML=n.ie?" ":'
    '),!1):void 0},"childNodes"),t=s(t,!1),d(t,"rowSpan",1),d(t,"colSpan",1),o?t.appendChild(o):n.ie||(t.innerHTML='
    '),t}function g(){var e=I.createRng(),t;return i(I.select("tr",a),function(e){0===e.cells.length&&I.remove(e)}),0===I.select("tr",a).length?(e.setStartBefore(a),e.setEndBefore(a),E.setRng(e),void I.remove(a)):(i(I.select("thead,tbody,tfoot",a),function(e){0===e.rows.length&&I.remove(e)}),l(),void(B&&(t=A[Math.min(A.length-1,B.y)],t&&(E.select(t[Math.min(t.length-1,B.x)].elm,!0),E.collapse(!0)))))}function h(e,t,n,o){var i,r,a,l,s;for(i=A[t][e].elm.parentNode,a=1;n>=a;a++)if(i=I.getNext(i,"tr")){for(r=e;r>=0;r--)if(s=A[t+a][r].elm,s.parentNode==i){for(l=1;o>=l;l++)I.insertAfter(p(s),s);break}if(-1==r)for(l=1;o>=l;l++)i.insertBefore(p(i.cells[0]),i.cells[0])}}function v(){i(A,function(e,t){i(e,function(e,n){var i,r,a;if(u(e)&&(e=e.elm,i=o(e,"colspan"),r=o(e,"rowspan"),i>1||r>1)){for(d(e,"rowSpan",1),d(e,"colSpan",1),a=0;i-1>a;a++)I.insertAfter(p(e),e);h(n,t,r-1,i)}})})}function b(t,n,o){var r,a,s,f,m,p,h,b,y,w,x;if(t?(r=S(t),a=r.x,s=r.y,f=a+(n-1),m=s+(o-1)):(B=_=null,i(A,function(e,t){i(e,function(e,n){u(e)&&(B||(B={x:n,y:t}),_={x:n,y:t})})}),B&&(a=B.x,s=B.y,f=_.x,m=_.y)),b=c(a,s),y=c(f,m),b&&y&&b.part==y.part){for(v(),l(),b=c(a,s).elm,d(b,"colSpan",f-a+1),d(b,"rowSpan",m-s+1),h=s;m>=h;h++)for(p=a;f>=p;p++)A[h]&&A[h][p]&&(t=A[h][p].elm,t!=b&&(w=e.grep(t.childNodes),i(w,function(e){b.appendChild(e)}),w.length&&(w=e.grep(b.childNodes),x=0,i(w,function(e){"BR"==e.nodeName&&I.getAttrib(e,"data-mce-bogus")&&x++0&&A[n-1][l]&&(g=A[n-1][l].elm,h=o(g,"rowSpan"),h>1)){d(g,"rowSpan",h+1);continue}}else if(h=o(r,"rowspan"),h>1){d(r,"rowSpan",h+1);continue}m=p(r),d(m,"colSpan",r.colSpan),f.appendChild(m),a=r}f.hasChildNodes()&&(e?c.parentNode.insertBefore(f,c):I.insertAfter(f,c))}}function w(e){var t,n;i(A,function(n){return i(n,function(n,o){return u(n)&&(t=o,e)?!1:void 0}),e?!t:void 0}),i(A,function(i,r){var a,l,s;i[t]&&(a=i[t].elm,a!=n&&(s=o(a,"colspan"),l=o(a,"rowspan"),1==s?e?(a.parentNode.insertBefore(p(a),a),h(t,r,l-1,s)):(I.insertAfter(p(a),a),h(t,r,l-1,s)):d(a,"colSpan",a.colSpan+1),n=a))})}function x(){var t=[];i(A,function(n){i(n,function(n,r){u(n)&&-1===e.inArray(t,r)&&(i(A,function(e){var t=e[r].elm,n;n=o(t,"colSpan"),n>1?d(t,"colSpan",n-1):I.remove(t)}),t.push(r))})}),g()}function C(){function e(e){var t,n,r;t=I.getNext(e,"tr"),i(e.cells,function(e){var t=o(e,"rowSpan");t>1&&(d(e,"rowSpan",t-1),n=S(e),h(n.x,n.y,1,1))}),n=S(e.cells[0]),i(A[n.y],function(e){var t;e=e.elm,e!=r&&(t=o(e,"rowSpan"),1>=t?I.remove(e):d(e,"rowSpan",t-1),r=e)})}var t;t=f(),i(t.reverse(),function(t){e(t)}),g()}function P(){var e=f();return I.remove(e),g(),e}function R(){var e=f();return i(e,function(t,n){e[n]=s(t,!0)}),e}function T(e,t){var n=f(),o=n[t?0:n.length-1],r=o.cells.length;e&&(i(A,function(e){var t;return r=0,i(e,function(e){e.real&&(r+=e.colspan),e.elm.parentNode==o&&(t=1)}),t?!1:void 0}),t||e.reverse(),i(e,function(e){var n,i=e.cells.length,a;for(n=0;i>n;n++)a=e.cells[n],d(a,"colSpan",1),d(a,"rowSpan",1);for(n=i;r>n;n++)e.appendChild(p(e.cells[i-1]));for(n=r;i>n;n++)I.remove(e.cells[n]);t?o.parentNode.insertBefore(e,o):I.insertAfter(e,o)}),I.removeClass(I.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"))}function S(e){var t;return i(A,function(n,o){return i(n,function(n,i){return n.elm==e?(t={x:i,y:o},!1):void 0}),!t}),t}function N(e){B=S(e)}function k(){var e,t;return e=t=0,i(A,function(n,o){i(n,function(n,i){var r,a;u(n)&&(n=A[o][i],i>e&&(e=i),o>t&&(t=o),n.real&&(r=n.colspan-1,a=n.rowspan-1,r&&i+r>e&&(e=i+r),a&&o+a>t&&(t=o+a)))})}),{x:e,y:t}}function D(e){var t,n,o,i,r,a,l,s,c,d;if(_=S(e),B&&_){for(t=Math.min(B.x,_.x),n=Math.min(B.y,_.y),o=Math.max(B.x,_.x),i=Math.max(B.y,_.y),r=o,a=i,d=n;a>=d;d++)e=A[d][t],e.real||t-(e.colspan-1)=c;c++)e=A[n][c],e.real||n-(e.rowspan-1)=d;d++)for(c=t;o>=c;c++)e=A[d][c],e.real&&(l=e.colspan-1,s=e.rowspan-1,l&&c+l>r&&(r=c+l),s&&d+s>a&&(a=d+s));for(I.removeClass(I.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),d=n;a>=d;d++)for(c=t;r>=c;c++)A[d][c]&&I.addClass(A[d][c].elm,"mce-item-selected")}}var A,B,_,M,E=r.selection,I=E.dom;a=a||I.getParent(E.getStart(),"table"),l(),M=I.getParent(E.getStart(),"th,td"),M&&(B=S(M),_=k(),M=c(B.x,B.y)),e.extend(this,{deleteTable:m,split:v,merge:b,insertRow:y,insertCol:w,deleteCols:x,deleteRows:C,cutRows:P,copyRows:R,pasteRows:T,getPos:S,setStartCell:N,setEndCell:D})}}),o(u,[f,d,c],function(e,t,n){function o(e,t){return parseInt(e.getAttribute(t)||1,10)}var i=n.each;return function(n){function r(){function t(t){function r(e,o){var i=e?"previousSibling":"nextSibling",r=n.dom.getParent(o,"tr"),l=r[i];if(l)return h(n,o,l,e),t.preventDefault(),!0;var d=n.dom.getParent(r,"table"),u=r.parentNode,f=u.nodeName.toLowerCase();if("tbody"===f||f===(e?"tfoot":"thead")){var m=a(e,d,u,"tbody");if(null!==m)return s(e,m,o)}return c(e,r,i,d)}function a(e,t,o,i){var r=n.dom.select(">"+i,t),a=r.indexOf(o);if(e&&0===a||!e&&a===r.length-1)return l(e,t);if(-1===a){var s="thead"===o.tagName.toLowerCase()?0:r.length-1;return r[s]}return r[a+(e?-1:1)]}function l(e,t){var o=e?"thead":"tfoot",i=n.dom.select(">"+o,t);return 0!==i.length?i[0]:null}function s(e,o,i){var r=d(o,e);return r&&h(n,i,r,e),t.preventDefault(),!0}function c(e,o,i,a){var l=a[i];if(l)return u(l),!0;var s=n.dom.getParent(a,"td,th");if(s)return r(e,s,t);var c=d(o,!e);return u(c),t.preventDefault(),!1}function d(e,t){var o=e&&e[t?"lastChild":"firstChild"];return o&&"BR"===o.nodeName?n.dom.getParent(o,"td,th"):o}function u(e){n.selection.setCursorLocation(e,0)}function f(){return y==e.UP||y==e.DOWN}function m(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"tr");return null!==n}function p(e){for(var t=0,n=e;n.previousSibling;)n=n.previousSibling,t+=o(n,"colspan");return t}function g(e,t){var n=0,r=0;return i(e.children,function(e,i){return n+=o(e,"colspan"),r=i,n>t?!1:void 0}),r}function h(e,t,o,i){var r=p(n.dom.getParent(t,"td,th")),a=g(o,r),l=o.childNodes[a],s=d(l,i);u(s||l)}function v(e){var t=n.selection.getNode(),o=n.dom.getParent(t,"td,th"),i=n.dom.getParent(e,"td,th");return o&&o!==i&&b(o,i)}function b(e,t){return n.dom.getParent(e,"TABLE")===n.dom.getParent(t,"TABLE")}var y=t.keyCode;if(f()&&m(n)){var w=n.selection.getNode();setTimeout(function(){v(w)&&r(!t.shiftKey&&y===e.UP,w,t)},0)}}n.on("KeyDown",function(e){t(e)})}function a(){function e(e,t){var n=t.ownerDocument,o=n.createRange(),i;return o.setStartBefore(t),o.setEnd(e.endContainer,e.endOffset),i=n.createElement("body"),i.appendChild(o.cloneContents()),0===i.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length}n.on("KeyDown",function(t){var o,i,r=n.dom;(37==t.keyCode||38==t.keyCode)&&(o=n.selection.getRng(),i=r.getParent(o.startContainer,"table"),i&&n.getBody().firstChild==i&&e(o,i)&&(o=r.createRng(),o.setStartBefore(i),o.setEndBefore(i),n.selection.setRng(o),t.preventDefault()))})}function l(){n.on("KeyDown SetContent VisualAid",function(){var e;for(e=n.getBody().lastChild;e;e=e.previousSibling)if(3==e.nodeType){if(e.nodeValue.length>0)break}else if(1==e.nodeType&&!e.getAttribute("data-mce-bogus"))break;e&&"TABLE"==e.nodeName&&(n.settings.forced_root_block?n.dom.add(n.getBody(),n.settings.forced_root_block,n.settings.forced_root_block_attrs,t.ie&&t.ie<11?" ":'
    '):n.dom.add(n.getBody(),"br",{"data-mce-bogus":"1"}))}),n.on("PreProcess",function(e){var t=e.node.lastChild;t&&("BR"==t.nodeName||1==t.childNodes.length&&("BR"==t.firstChild.nodeName||"\xa0"==t.firstChild.nodeValue))&&t.previousSibling&&"TABLE"==t.previousSibling.nodeName&&n.dom.remove(t)})}function s(){function e(e,t,n,o){var i=3,r=e.dom.getParent(t.startContainer,"TABLE"),a,l,s;return r&&(a=r.parentNode),l=t.startContainer.nodeType==i&&0===t.startOffset&&0===t.endOffset&&o&&("TR"==n.nodeName||n==a),s=("TD"==n.nodeName||"TH"==n.nodeName)&&!o,l||s}function t(){var t=n.selection.getRng(),o=n.selection.getNode(),i=n.dom.getParent(t.startContainer,"TD,TH");if(e(n,t,o,i)){i||(i=o);for(var r=i.lastChild;r.lastChild;)r=r.lastChild;t.setEnd(r,r.nodeValue.length),n.selection.setRng(t)}}n.on("KeyDown",function(){t()}),n.on("MouseDown",function(e){2!=e.button&&t()})}function c(){n.on("keydown",function(t){if((t.keyCode==e.DELETE||t.keyCode==e.BACKSPACE)&&!t.isDefaultPrevented()){var o=n.dom.getParent(n.selection.getStart(),"table");if(o){for(var i=n.dom.select("td,th",o),r=i.length;r--;)if(!n.dom.hasClass(i[r],"mce-item-selected"))return;t.preventDefault(),n.execCommand("mceTableDelete")}}})}c(),t.webkit&&(r(),s()),t.gecko&&(a(),l()),t.ie>10&&(a(),l())}}),o(m,[s,p,c],function(e,t,n){return function(o){function i(){o.getBody().style.webkitUserSelect="",d&&(o.dom.removeClass(o.dom.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),d=!1)}function r(t){var n,i,r=t.target;if(s&&(l||r!=s)&&("TD"==r.nodeName||"TH"==r.nodeName)){i=a.getParent(r,"table"),i==c&&(l||(l=new e(o,i),l.setStartCell(s),o.getBody().style.webkitUserSelect="none"),l.setEndCell(r),d=!0),n=o.selection.getSel();try{n.removeAllRanges?n.removeAllRanges():n.empty()}catch(u){}t.preventDefault()}}var a=o.dom,l,s,c,d=!0;return o.on("MouseDown",function(e){2!=e.button&&(i(),s=a.getParent(e.target,"td,th"),c=a.getParent(s,"table"))}),o.on("mouseover",r),o.on("remove",function(){a.unbind(o.getDoc(),"mouseover",r)}),o.on("MouseUp",function(){function e(e,o){var r=new t(e,e);do{if(3==e.nodeType&&0!==n.trim(e.nodeValue).length)return void(o?i.setStart(e,0):i.setEnd(e,e.nodeValue.length));if("BR"==e.nodeName)return void(o?i.setStartBefore(e):i.setEndBefore(e))}while(e=o?r.next():r.prev())}var i,r=o.selection,d,u,f,m,p;if(s){if(l&&(o.getBody().style.webkitUserSelect=""),d=a.select("td.mce-item-selected,th.mce-item-selected"),d.length>0){i=a.createRng(),f=d[0],p=d[d.length-1],i.setStartBefore(f),i.setEndAfter(f),e(f,1),u=new t(f,a.getParent(d[0],"table"));do if("TD"==f.nodeName||"TH"==f.nodeName){if(!a.hasClass(f,"mce-item-selected"))break;m=f}while(f=u.next());e(m),r.setRng(i)}o.nodeChanged(),s=l=c=null}}),o.on("KeyUp",function(){i()}),{clear:i}}}),o(g,[s,u,m,c,p,d,h],function(e,t,n,o,i,r,a){function l(o){function i(e){return e?e.replace(/px$/,""):""}function a(e){return/^[0-9]+$/.test(e)&&(e+="px"),e}function l(e){s("left center right".split(" "),function(t){o.formatter.remove("align"+t,{},e)})}function c(){var e=o.dom,t,n;t=e.getParent(o.selection.getStart(),"table"),n={width:i(e.getStyle(t,"width")||e.getAttrib(t,"width")),height:i(e.getStyle(t,"height")||e.getAttrib(t,"height")),cellspacing:e.getAttrib(t,"cellspacing"),cellpadding:e.getAttrib(t,"cellpadding"),border:e.getAttrib(t,"border"),caption:!!e.select("caption",t)[0]},s("left center right".split(" "),function(e){o.formatter.matchNode(t,"align"+e)&&(n.align=e)}),o.windowManager.open({title:"Table properties",items:{type:"form",layout:"grid",columns:2,data:n,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width"},{label:"Height",name:"height"},{label:"Cell spacing",name:"cellspacing"},{label:"Cell padding",name:"cellpadding"},{label:"Border",name:"border"},{label:"Caption",name:"caption",type:"checkbox"},{label:"Alignment",minWidth:90,name:"align",type:"listbox",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]},onsubmit:function(){var n=this.toJSON(),i;o.undoManager.transact(function(){o.dom.setAttribs(t,{cellspacing:n.cellspacing,cellpadding:n.cellpadding,border:n.border}),o.dom.setStyles(t,{width:a(n.width),height:a(n.height)}),i=e.select("caption",t)[0],i&&!n.caption&&e.remove(i),!i&&n.caption&&(i=e.create("caption"),i.innerHTML=r.ie?"\xa0":'
    ',t.insertBefore(i,t.firstChild)),l(t),n.align&&o.formatter.apply("align"+n.align,{},t),o.focus(),o.addVisual()})}})}function d(e,t){o.windowManager.open({title:"Merge cells",body:[{label:"Cols",name:"cols",type:"textbox",size:10},{label:"Rows",name:"rows",type:"textbox",size:10}],onsubmit:function(){var n=this.toJSON();o.undoManager.transact(function(){e.merge(t,n.cols,n.rows)})}})}function u(){var e=o.dom,t,n,r=[];r=o.dom.select("td.mce-item-selected,th.mce-item-selected"),t=o.dom.getParent(o.selection.getStart(),"td,th"),!r.length&&t&&r.push(t),t=t||r[0],t&&(n={width:i(e.getStyle(t,"width")||e.getAttrib(t,"width")),height:i(e.getStyle(t,"height")||e.getAttrib(t,"height")),scope:e.getAttrib(t,"scope")},n.type=t.nodeName.toLowerCase(),s("left center right".split(" "),function(e){o.formatter.matchNode(t,"align"+e)&&(n.align=e)}),o.windowManager.open({title:"Cell properties",items:{type:"form",data:n,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width"},{label:"Height",name:"height"},{label:"Cell type",name:"type",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"Alignment",name:"align",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]},onsubmit:function(){var t=this.toJSON();o.undoManager.transact(function(){s(r,function(n){o.dom.setAttrib(n,"scope",t.scope),o.dom.setStyles(n,{width:a(t.width),height:a(t.height)}),t.type&&n.nodeName.toLowerCase()!=t.type&&(n=e.rename(n,t.type)),l(n),t.align&&o.formatter.apply("align"+t.align,{},n)}),o.focus()})}}))}function f(){var e=o.dom,t,n,r,c,d=[];t=o.dom.getParent(o.selection.getStart(),"table"),n=o.dom.getParent(o.selection.getStart(),"td,th"),s(t.rows,function(t){s(t.cells,function(o){return e.hasClass(o,"mce-item-selected")||o==n?(d.push(t),!1):void 0})}),r=d[0],r&&(c={height:i(e.getStyle(r,"height")||e.getAttrib(r,"height")),scope:e.getAttrib(r,"scope")},c.type=r.parentNode.nodeName.toLowerCase(),s("left center right".split(" "),function(e){o.formatter.matchNode(r,"align"+e)&&(c.align=e)}),o.windowManager.open({title:"Row properties",items:{type:"form",data:c,columns:2,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"None",maxWidth:null,values:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"}]},onsubmit:function(){var t=this.toJSON(),n,i,r;o.undoManager.transact(function(){var c=t.type;s(d,function(s){o.dom.setAttrib(s,"scope",t.scope),o.dom.setStyles(s,{height:a(t.height)}),c!=s.parentNode.nodeName.toLowerCase()&&(n=e.getParent(s,"table"),i=s.parentNode,r=e.select(c,n)[0],r||(r=e.create(c),n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r)),r.appendChild(s),i.hasChildNodes()||e.remove(i)),l(s),t.align&&o.formatter.apply("align"+t.align,{},s)}),o.focus()})}}))}function m(e){return function(){o.execCommand(e)}}function p(e,t){var n,i,a;for(a="",n=0;t>n;n++){for(a+="",i=0;e>i;i++)a+="";a+=""}a+="
    "+(r.ie?" ":"
    ")+"
    ",o.insertContent(a)}function g(e,t){function n(){e.disabled(!o.dom.getParent(o.selection.getStart(),t)),o.selection.selectorChanged(t,function(t){e.disabled(!t)})}o.initialized?n():o.on("init",n)}function h(){g(this,"table")}function v(){g(this,"td,th")}function b(){var e="";e='';for(var t=0;10>t;t++){e+="";for(var n=0;10>n;n++)e+='";e+=""}return e+="
    ",e+=''}function y(e,t,n){var i=n.getEl().getElementsByTagName("table")[0],r=n.parent().rel,a,l,s,c;if(n.isRtl()||"tl-tr"==r){for(l=9;l>=0;l--)for(a=0;10>a;a++)c=i.rows[l].childNodes[a].firstChild,o.dom.toggleClass(c,"mce-active",a>=e&&t>=l),a>=e&&t>=l&&(s=c);e=9-e,i.nextSibling.innerHTML=e+" x "+(t+1)}else{for(l=0;10>l;l++)for(a=0;10>a;a++)c=i.rows[l].childNodes[a].firstChild,o.dom.toggleClass(c,"mce-active",e>=a&&t>=l),e>=a&&t>=l&&(s=c);i.nextSibling.innerHTML=e+1+" x "+(t+1)}return s.parentNode}var w,x,C=this;o.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",onhide:function(){var e=this.menu.items()[0].getEl().getElementsByTagName("a");o.dom.removeClass(e,"mce-active"),o.dom.addClass(e[0],"mce-active")},menu:[{type:"container",html:b(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(e){var t=e.target,n,o;"A"==t.nodeName&&(n=parseInt(t.getAttribute("data-mce-x"),10),o=parseInt(t.getAttribute("data-mce-y"),10),(n!==this.lastX||o!==this.lastY)&&(y(n,o,e.control),this.lastX=n,this.lastY=o))},onkeydown:function(e){var t=this.lastX,n=this.lastY,o;switch(e.keyCode){case 37:t>0&&(t--,o=!0);break;case 39:o=!0,9>t&&t++;break;case 38:o=!0,n>0&&n--;break;case 40:o=!0,9>n&&n++}o&&(e.preventDefault(),e.stopPropagation(),y(t,n,e.control).focus(),this.lastX=t,this.lastY=n)},onclick:function(e){"A"==e.target.nodeName&&(e.preventDefault(),e.stopPropagation(),this.parent().cancel(),p(this.lastX+1,this.lastY+1))}}]}),o.addMenuItem("tableprops",{text:"Table properties",context:"table",onPostRender:h,onclick:c}),o.addMenuItem("deletetable",{text:"Delete table",context:"table",onPostRender:h,cmd:"mceTableDelete"}),o.addMenuItem("cell",{separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:m("mceTableCellProps"),onPostRender:v},{text:"Merge cells",onclick:m("mceTableMergeCells"),onPostRender:v},{text:"Split cell",onclick:m("mceTableSplitCells"),onPostRender:v}]}),o.addMenuItem("row",{text:"Row",context:"table",menu:[{text:"Insert row before",onclick:m("mceTableInsertRowBefore"),onPostRender:v},{text:"Insert row after",onclick:m("mceTableInsertRowAfter"),onPostRender:v},{text:"Delete row",onclick:m("mceTableDeleteRow"),onPostRender:v},{text:"Row properties",onclick:m("mceTableRowProps"),onPostRender:v},{text:"-"},{text:"Cut row",onclick:m("mceTableCutRow"),onPostRender:v},{text:"Copy row",onclick:m("mceTableCopyRow"),onPostRender:v},{text:"Paste row before",onclick:m("mceTablePasteRowBefore"),onPostRender:v},{text:"Paste row after",onclick:m("mceTablePasteRowAfter"),onPostRender:v}]}),o.addMenuItem("column",{text:"Column",context:"table",menu:[{text:"Insert column before",onclick:m("mceTableInsertColBefore"),onPostRender:v},{text:"Insert column after",onclick:m("mceTableInsertColAfter"),onPostRender:v},{text:"Delete column",onclick:m("mceTableDeleteCol"),onPostRender:v}]});var P=[];s("inserttable tableprops deletetable | cell row column".split(" "),function(e){P.push("|"==e?{text:"-"}:o.menuItems[e])}),o.addButton("table",{type:"menubutton",title:"Table",menu:P}),r.isIE||o.on("click",function(e){e=e.target,"TABLE"===e.nodeName&&(o.selection.select(e),o.nodeChanged())}),C.quirks=new t(o),o.on("Init",function(){w=o.windowManager,C.cellSelection=new n(o)}),s({mceTableSplitCells:function(e){e.split()},mceTableMergeCells:function(e){var t,n,i;i=o.dom.getParent(o.selection.getStart(),"th,td"),i&&(t=i.rowSpan,n=i.colSpan),o.dom.select("td.mce-item-selected,th.mce-item-selected").length?e.merge():d(e,i)},mceTableInsertRowBefore:function(e){e.insertRow(!0)},mceTableInsertRowAfter:function(e){e.insertRow()},mceTableInsertColBefore:function(e){e.insertCol(!0)},mceTableInsertColAfter:function(e){e.insertCol()},mceTableDeleteCol:function(e){e.deleteCols()},mceTableDeleteRow:function(e){e.deleteRows()},mceTableCutRow:function(e){x=e.cutRows()},mceTableCopyRow:function(e){x=e.copyRows()},mceTablePasteRowBefore:function(e){e.pasteRows(x,!0)},mceTablePasteRowAfter:function(e){e.pasteRows(x)},mceTableDelete:function(e){e.deleteTable()}},function(t,n){o.addCommand(n,function(){var n=new e(o);n&&(t(n),o.execCommand("mceRepaint"),C.cellSelection.clear())})}),s({mceInsertTable:function(){c()},mceTableRowProps:f,mceTableCellProps:u},function(e,t){o.addCommand(t,function(t,n){e(n)})})}var s=o.each;a.add("table",l)}),a([s,u,m,g])}(this); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var y=function(){},b=function(n){return function(){return n}},u=function(n){return n};function w(r){for(var o=[],n=1;n=e.length&&n.substr(t,t+e.length)===e},nn=function(n,e){return-1!==n.indexOf(e)},en=function(n,e){return Z(n,e,0)},tn=function(n,e){return Z(n,e,n.length-e.length)},rn=(V=/^\s+|\s+$/g,function(n){return n.replace(V,"")}),on=function(n){return 0=n.startCol&&o<=n.finishRow&&u>=n.startRow},st=function(n,e){return e.column>=n.startCol&&e.column+e.colspan-1<=n.finishCol&&e.row>=n.startRow&&e.row+e.rowspan-1<=n.finishRow},dt=function(n,e,t){var r=lt.findItem(n,e,Bn),o=lt.findItem(n,t,Bn);return r.bind(function(r){return o.map(function(n){return e=r,t=n,{startRow:Math.min(e.row,t.row),startCol:Math.min(e.column,t.column),finishRow:Math.max(e.row+e.rowspan-1,t.row+t.rowspan-1),finishCol:Math.max(e.column+e.colspan-1,t.column+t.colspan-1)};var e,t})})},mt=function(e,n,t){return dt(e,n,t).bind(function(n){return function(n,e){for(var t=!0,r=w(st,e),o=e.startRow;o<=e.finishRow;o++)for(var u=e.startCol;u<=e.finishCol;u++)t=t&<.getAt(n,o,u).exists(r);return t?S.some(e):S.none()}(e,n)})},gt=function(t,n,e){return dt(t,n,e).map(function(n){var e=lt.filterItems(t,w(ft,n));return B(e,function(n){return n.element})})},pt=function(n,e){return lt.findItem(n,e,function(n,e){return In(e,n)}).map(function(n){return n.element})},ht=function(i,c,a){return et(i).bind(function(n){var r,e,o,u,t=bt(n);return r=t,e=i,o=c,u=a,lt.findItem(r,e,Bn).bind(function(n){var e=0t.maxRow||st.maxCol||(lt.getAt(e,l,s).filter(r).isNone()?(o=f,0,u=n[l].element,i=Dn.fromTag("td"),St(i,Dn.fromTag("br")),(o?St:Ct)(u,i)):f=!0)}},ir=function(n,e){var t,u,r,i,c,a,l,o,f,s,d=function(n){return On(n.element,e)},m=ut(n),g=lt.generate(m),p=(u=d,r=(t=g).grid.columns,i=t.grid.rows,c=r,l=a=0,Nn(t.access,function(n){var e,t,r,o;u(n)&&(t=(e=n.row)+n.rowspan-1,o=(r=n.column)+n.colspan-1,e=r.length-1)return S.none();var n=r[o].fold(function(){var n,e,t=(n=r.slice(0,o),(e=x.call(n,0)).reverse(),e);return L(t,function(n,e){return n.map(function(n){return{value:n,delta:e+1}})})},function(n){return S.some({value:n,delta:0})}),e=r[o+1].fold(function(){var n=r.slice(o+1);return L(n,function(n,e){return n.map(function(n){return{value:n,delta:e+1}})})},function(n){return S.some({value:n,delta:1})});return n.bind(function(t){return e.map(function(n){var e=n.delta+t.delta;return Math.abs(n.value-t.value)/e})})},Lr=function(e,t){return function(n){return"rtl"===Hr(n)?t:e}},Hr=function(n){return"rtl"===ze(n,"direction")?"rtl":"ltr"};function qr(r,o){var n=function(n){var e=o(n);if(e<=0||null===e){var t=ze(n,r);return parseFloat(t)||0}return e},u=function(o,n){return k(n,function(n,e){var t=ze(o,e),r=t===undefined?0:parseInt(t,10);return isNaN(r)?n:n+r},0)};return{set:function(n,e){if(!v(e)&&!e.match(/^[0-9]+$/))throw new Error(r+".set accepts only positive integer values. Value was "+e);var t=n.dom;Ne(t)&&(t.style[r]=e+"px")},get:n,getOuter:n,aggregate:u,max:function(n,e,t){var r=u(n,t);return r=e.length||n.column>Sc(e[0]))return qc.error("invalid start address out of table bounds, row: "+n.row+", column: "+n.column);var r=e.slice(n.row),o=r[0].cells.slice(n.column),u=Sc(t[0]),i=t.length;return qc.value({rowDelta:r.length-i,colDelta:o.length-u})}(t,r,o).map(function(n){var e=Xc(r,n,u);return Yc(t,e,o,u,i)})},Qc=function(r,n,e,t,o){var u,i,c,a;u=n,i=r,c=o,a=t.cell,0=t&&n.column=t&&n.column=o&&n.column',r.insertBefore(o,r.firstChild)),""===i.align?bl(t,r):vl(t,r,i.align),t.focus(),t.addVisual()})},$l=function(n,e){var t,r,o,u,i,c,a,l,f=n.dom,s=Al(n,Ei(n));!1===e?(t=f.getParent(n.selection.getStart(),"table"))?(o=t,u=Ei(r=n),l=r.dom,s=H({width:l.getStyle(o,"width")||l.getAttrib(o,"width"),height:l.getStyle(o,"height")||l.getAttrib(o,"height"),cellspacing:l.getStyle(o,"border-spacing")||l.getAttrib(o,"cellspacing"),cellpadding:l.getAttrib(o,"cellpadding")||hl(r.dom,o,"padding"),border:(i=l,c=o,a=Le(Dn.fromDom(c),"border-width"),Ii(r)&&a.isSome()?a.getOr(""):i.getAttrib(c,"border")||hl(r.dom,c,"border-width")||hl(r.dom,c,"border")),caption:!!l.select("caption",o)[0],"class":l.getAttrib(o,"class",""),align:Dl(r,o)},u?Sl(l,o):{})):Ei(n)&&(s.borderstyle="",s.bordercolor="",s.backgroundcolor=""):(s.cols="1",s.rows="1",Ei(n)&&(s.borderstyle="",s.bordercolor="",s.backgroundcolor=""));var d=yl(n.getParam("table_class_list",[],"array"));0=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom}),bf=function(t,r,n,e,o){var u=function(n){var e=t.dom.createRange();return e.setStart(r.dom,n),e.collapse(!0),e},i=kt(r).length,c=function(n,e,t,r,o){if(0===o)return 0;if(e===r)return o-1;for(var u=r,i=1;ir.left&&o.leftt.right;var e,t})});var t},ks={point:function(n){return n.bottom},adjuster:function(n,e,t,r,o){var u=Ts(o,5);return Math.abs(t.bottom-r.bottom)<1||t.top>o.bottom?Is.retry(u):t.top===o.bottom?Is.retry(Ts(o,1)):Ps(n,e,o)?Is.retry(Ds(u,5,0)):Is.none()},move:Ts,gather:ps},Ms=function(t,r,o,u,i){return 0===i?S.some(u):(a=t,l=u.left,f=r.point(u),a.elementFromPoint(l,f).filter(function(n){return"table"===Gn(n)}).isSome()?(e=u,c=i-1,Ms(t,n=r,o,n.move(e,5),c)):t.situsFromPoint(u.left,r.point(u)).bind(function(n){return n.start.fold(S.none,function(e){return Es(t,e).bind(function(n){return r.adjuster(t,e,n,o,u).fold(S.none,function(n){return Ms(t,r,o,n,i-1)})}).orThunk(function(){return S.some(u)})},S.none)}));var n,e,c,a,l,f},Ns=function(e,t,n){var r,o,u,i=e.move(n,5),c=Ms(t,e,n,i,100).getOr(i);return o=c,u=t,((r=e).point(o)>u.getInnerHeight()?S.some(r.point(o)-u.getInnerHeight()):r.point(o)<0?S.some(-r.point(o)):S.none()).fold(function(){return t.situsFromPoint(c.left,e.point(c))},function(n){return t.scrollBy(0,n),t.situsFromPoint(c.left,e.point(c)-n)})},js={tryUp:w(Ns,{point:function(n){return n.top},adjuster:function(n,e,t,r,o){var u=Rs(o,5);return Math.abs(t.top-r.top)<1||t.bottom 0) { + el = dom.create('div', null); + el.appendChild(n[0].cloneNode(true)); + } + global$1.each(dom.select('*', el), function (n) { + if (hasClass(n, getCreationDateClasses(editor).replace(/\s+/g, '|'))) { + n.innerHTML = getDateTime(editor, getCdateFormat(editor)); + } + if (hasClass(n, getModificationDateClasses(editor).replace(/\s+/g, '|'))) { + n.innerHTML = getDateTime(editor, getMdateFormat(editor)); + } + if (hasClass(n, getSelectedContentClasses(editor).replace(/\s+/g, '|'))) { + n.innerHTML = sel; + } + }); + replaceVals(editor, el); + editor.execCommand('mceInsertContent', false, el.innerHTML); + editor.addVisual(); + }; + + var register = function (editor) { + editor.addCommand('mceInsertTemplate', curry(insertTemplate, editor)); + }; + + var setup = function (editor) { + editor.on('PreProcess', function (o) { + var dom = editor.dom, dateFormat = getMdateFormat(editor); + global$1.each(dom.select('div', o.node), function (e) { + if (dom.hasClass(e, 'mceTmpl')) { + global$1.each(dom.select('*', e), function (e) { + if (dom.hasClass(e, getModificationDateClasses(editor).replace(/\s+/g, '|'))) { + e.innerHTML = getDateTime(editor, dateFormat); + } + }); + replaceVals(editor, e); + } + }); + }); + }; + + var none = function () { + return NONE; + }; + var NONE = function () { + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; + }(); + var some = function (a) { + var constant_a = constant(a); + var self = function () { + return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; + }; + var from = function (value) { + return value === null || value === undefined ? NONE : some(value); + }; + var Optional = { + some: some, + none: none, + from: from + }; + + var map = function (xs, f) { + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; + }; + var findUntil = function (xs, pred, until) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Optional.some(x); + } else if (until(x, i)) { + break; + } + } + return Optional.none(); + }; + var find = function (xs, pred) { + return findUntil(xs, pred, never); + }; + + var global$3 = tinymce.util.Tools.resolve('tinymce.Env'); + + var global$4 = tinymce.util.Tools.resolve('tinymce.util.Promise'); + + var hasOwnProperty = Object.hasOwnProperty; + var get = function (obj, key) { + return has(obj, key) ? Optional.from(obj[key]) : Optional.none(); + }; + var has = function (obj, key) { + return hasOwnProperty.call(obj, key); + }; + + var entitiesAttr = { + '"': '"', + '<': '<', + '>': '>', + '&': '&', + '\'': ''' + }; + var htmlEscape = function (html) { + return html.replace(/["'<>&]/g, function (match) { + return get(entitiesAttr, match).getOr(match); + }); + }; + + var getPreviewContent = function (editor, html) { + if (html.indexOf('') === -1) { + var contentCssEntries_1 = ''; + var contentStyle = getContentStyle(editor); + if (contentStyle) { + contentCssEntries_1 += ''; + } + var cors_1 = shouldUseContentCssCors(editor) ? ' crossorigin="anonymous"' : ''; + global$1.each(editor.contentCSS, function (url) { + contentCssEntries_1 += ''; + }); + var bodyClass = getBodyClass(editor); + var encode = editor.dom.encode; + var isMetaKeyPressed = global$3.mac ? 'e.metaKey' : 'e.ctrlKey && !e.altKey'; + var preventClicksOnLinksScript = ' '; + var directionality = editor.getBody().dir; + var dirAttr = directionality ? ' dir="' + encode(directionality) + '"' : ''; + html = '' + '' + '' + '' + contentCssEntries_1 + preventClicksOnLinksScript + '' + '' + html + '' + ''; + } + return replaceTemplateValues(html, getPreviewReplaceValues(editor)); + }; + var open = function (editor, templateList) { + var createTemplates = function () { + if (!templateList || templateList.length === 0) { + var message = editor.translate('No templates defined.'); + editor.notificationManager.open({ + text: message, + type: 'info' + }); + return Optional.none(); + } + return Optional.from(global$1.map(templateList, function (template, index) { + var isUrlTemplate = function (t) { + return t.url !== undefined; + }; + return { + selected: index === 0, + text: template.title, + value: { + url: isUrlTemplate(template) ? Optional.from(template.url) : Optional.none(), + content: !isUrlTemplate(template) ? Optional.from(template.content) : Optional.none(), + description: template.description + } + }; + })); + }; + var createSelectBoxItems = function (templates) { + return map(templates, function (t) { + return { + text: t.text, + value: t.text + }; + }); + }; + var findTemplate = function (templates, templateTitle) { + return find(templates, function (t) { + return t.text === templateTitle; + }); + }; + var loadFailedAlert = function (api) { + editor.windowManager.alert('Could not load the specified template.', function () { + return api.focus('template'); + }); + }; + var getTemplateContent = function (t) { + return new global$4(function (resolve, reject) { + t.value.url.fold(function () { + return resolve(t.value.content.getOr('')); + }, function (url) { + return global$2.send({ + url: url, + success: function (html) { + resolve(html); + }, + error: function (e) { + reject(e); + } + }); + }); + }); + }; + var onChange = function (templates, updateDialog) { + return function (api, change) { + if (change.name === 'template') { + var newTemplateTitle = api.getData().template; + findTemplate(templates, newTemplateTitle).each(function (t) { + api.block('Loading...'); + getTemplateContent(t).then(function (previewHtml) { + updateDialog(api, t, previewHtml); + }).catch(function () { + updateDialog(api, t, ''); + api.disable('save'); + loadFailedAlert(api); + }); + }); + } + }; + }; + var onSubmit = function (templates) { + return function (api) { + var data = api.getData(); + findTemplate(templates, data.template).each(function (t) { + getTemplateContent(t).then(function (previewHtml) { + insertTemplate(editor, false, previewHtml); + api.close(); + }).catch(function () { + api.disable('save'); + loadFailedAlert(api); + }); + }); + }; + }; + var openDialog = function (templates) { + var selectBoxItems = createSelectBoxItems(templates); + var buildDialogSpec = function (bodyItems, initialData) { + return { + title: 'Insert Template', + size: 'large', + body: { + type: 'panel', + items: bodyItems + }, + initialData: initialData, + buttons: [ + { + type: 'cancel', + name: 'cancel', + text: 'Cancel' + }, + { + type: 'submit', + name: 'save', + text: 'Save', + primary: true + } + ], + onSubmit: onSubmit(templates), + onChange: onChange(templates, updateDialog) + }; + }; + var updateDialog = function (dialogApi, template, previewHtml) { + var content = getPreviewContent(editor, previewHtml); + var bodyItems = [ + { + type: 'selectbox', + name: 'template', + label: 'Templates', + items: selectBoxItems + }, + { + type: 'htmlpanel', + html: '

    ' + htmlEscape(template.value.description) + '

    ' + }, + { + label: 'Preview', + type: 'iframe', + name: 'preview', + sandboxed: false + } + ]; + var initialData = { + template: template.text, + preview: content + }; + dialogApi.unblock(); + dialogApi.redial(buildDialogSpec(bodyItems, initialData)); + dialogApi.focus('template'); + }; + var dialogApi = editor.windowManager.open(buildDialogSpec([], { + template: '', + preview: '' + })); + dialogApi.block('Loading...'); + getTemplateContent(templates[0]).then(function (previewHtml) { + updateDialog(dialogApi, templates[0], previewHtml); + }).catch(function () { + updateDialog(dialogApi, templates[0], ''); + dialogApi.disable('save'); + loadFailedAlert(dialogApi); + }); + }; + var optTemplates = createTemplates(); + optTemplates.each(openDialog); + }; + + var showDialog = function (editor) { + return function (templates) { + open(editor, templates); + }; + }; + var register$1 = function (editor) { + editor.ui.registry.addButton('template', { + icon: 'template', + tooltip: 'Insert template', + onAction: createTemplateList(editor, showDialog(editor)) + }); + editor.ui.registry.addMenuItem('template', { + icon: 'template', + text: 'Insert template...', + onAction: createTemplateList(editor, showDialog(editor)) + }); + }; + + function Plugin () { + global.add('template', function (editor) { + register$1(editor); + register(editor); + setup(editor); + }); + } + + Plugin(); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/template/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/template/plugin.min.js new file mode 100644 index 000000000000..3cce3a6f6483 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/template/plugin.min.js @@ -0,0 +1,9 @@ +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),t=function(){},o=function(e){return function(){return e}};var n,r,a,c=o(!1),u=o(!0),_=tinymce.util.Tools.resolve("tinymce.util.Tools"),s=tinymce.util.Tools.resolve("tinymce.util.XHR"),i=function(e){return e.getParam("template_mdate_classes","mdate")},l=function(e){return e.getParam("template_replace_values")},f=function(e){return e.getParam("template_mdate_format",e.translate("%Y-%m-%d"))},m=function(e,t){if((e=""+e).length":">","&":"&","'":"'"},N=function(e){return e.replace(/["'<>&]/g,function(e){return(A(t=C,n=e)?O.from(t[n]):O.none()).getOr(e);var t,n})},I=function(M,t){var e=function(e){return function(e,t){for(var n=e.length,r=new Array(n),a=0;a")&&(o="",(c=r.getParam("content_style","","string"))&&(o+='"),u=r.getParam("content_css_cors",!1,"boolean")?' crossorigin="anonymous"':"",_.each(r.contentCSS,function(e){o+='"}),i=-1===(g=(p=r).getParam("body_class","","string")).indexOf("=")?g:(d=p).getParam("body_class","","hash")[d.id]||"",l=r.dom.encode,s='\n'; - moduleCount++; - } - - // Expose globally - exports.define = define; - exports.require = require; - - expose(["tinymce/dom/EventUtils","tinymce/dom/Sizzle","tinymce/dom/DomQuery","tinymce/html/Styles","tinymce/dom/TreeWalker","tinymce/util/Tools","tinymce/dom/Range","tinymce/html/Entities","tinymce/Env","tinymce/dom/StyleSheetLoader","tinymce/dom/DOMUtils","tinymce/dom/ScriptLoader","tinymce/AddOnManager","tinymce/html/Node","tinymce/html/Schema","tinymce/html/SaxParser","tinymce/html/DomParser","tinymce/html/Writer","tinymce/html/Serializer","tinymce/dom/Serializer","tinymce/dom/TridentSelection","tinymce/util/VK","tinymce/dom/ControlSelection","tinymce/dom/RangeUtils","tinymce/dom/Selection","tinymce/Formatter","tinymce/UndoManager","tinymce/EnterKey","tinymce/ForceBlocks","tinymce/EditorCommands","tinymce/util/URI","tinymce/util/Class","tinymce/ui/Selector","tinymce/ui/Collection","tinymce/ui/DomUtils","tinymce/ui/Control","tinymce/ui/Factory","tinymce/ui/KeyboardNavigation","tinymce/ui/Container","tinymce/ui/DragHelper","tinymce/ui/Scrollable","tinymce/ui/Panel","tinymce/ui/Movable","tinymce/ui/Resizable","tinymce/ui/FloatPanel","tinymce/ui/Window","tinymce/ui/MessageBox","tinymce/WindowManager","tinymce/util/Quirks","tinymce/util/Observable","tinymce/Shortcuts","tinymce/Editor","tinymce/util/I18n","tinymce/FocusManager","tinymce/EditorManager","tinymce/LegacyInput","tinymce/util/XHR","tinymce/util/JSON","tinymce/util/JSONRequest","tinymce/util/JSONP","tinymce/util/LocalStorage","tinymce/Compat","tinymce/ui/Layout","tinymce/ui/AbsoluteLayout","tinymce/ui/Tooltip","tinymce/ui/Widget","tinymce/ui/Button","tinymce/ui/ButtonGroup","tinymce/ui/Checkbox","tinymce/ui/PanelButton","tinymce/ui/ColorButton","tinymce/ui/ComboBox","tinymce/ui/Path","tinymce/ui/ElementPath","tinymce/ui/FormItem","tinymce/ui/Form","tinymce/ui/FieldSet","tinymce/ui/FilePicker","tinymce/ui/FitLayout","tinymce/ui/FlexLayout","tinymce/ui/FlowLayout","tinymce/ui/FormatControls","tinymce/ui/GridLayout","tinymce/ui/Iframe","tinymce/ui/Label","tinymce/ui/Toolbar","tinymce/ui/MenuBar","tinymce/ui/MenuButton","tinymce/ui/ListBox","tinymce/ui/MenuItem","tinymce/ui/Menu","tinymce/ui/Radio","tinymce/ui/ResizeHandle","tinymce/ui/Spacer","tinymce/ui/SplitButton","tinymce/ui/StackLayout","tinymce/ui/TabPanel","tinymce/ui/TextBox","tinymce/ui/Throbber"]); - - load('classes/dom/EventUtils.js'); - load('classes/dom/Sizzle.js'); - load('classes/dom/DomQuery.js'); - load('classes/html/Styles.js'); - load('classes/dom/TreeWalker.js'); - load('classes/util/Tools.js'); - load('classes/dom/Range.js'); - load('classes/html/Entities.js'); - load('classes/Env.js'); - load('classes/dom/StyleSheetLoader.js'); - load('classes/dom/DOMUtils.js'); - load('classes/dom/ScriptLoader.js'); - load('classes/AddOnManager.js'); - load('classes/html/Node.js'); - load('classes/html/Schema.js'); - load('classes/html/SaxParser.js'); - load('classes/html/DomParser.js'); - load('classes/html/Writer.js'); - load('classes/html/Serializer.js'); - load('classes/dom/Serializer.js'); - load('classes/dom/TridentSelection.js'); - load('classes/util/VK.js'); - load('classes/dom/ControlSelection.js'); - load('classes/dom/RangeUtils.js'); - load('classes/dom/Selection.js'); - load('classes/Formatter.js'); - load('classes/UndoManager.js'); - load('classes/EnterKey.js'); - load('classes/ForceBlocks.js'); - load('classes/EditorCommands.js'); - load('classes/util/URI.js'); - load('classes/util/Class.js'); - load('classes/ui/Selector.js'); - load('classes/ui/Collection.js'); - load('classes/ui/DomUtils.js'); - load('classes/ui/Control.js'); - load('classes/ui/Factory.js'); - load('classes/ui/KeyboardNavigation.js'); - load('classes/ui/Container.js'); - load('classes/ui/DragHelper.js'); - load('classes/ui/Scrollable.js'); - load('classes/ui/Panel.js'); - load('classes/ui/Movable.js'); - load('classes/ui/Resizable.js'); - load('classes/ui/FloatPanel.js'); - load('classes/ui/Window.js'); - load('classes/ui/MessageBox.js'); - load('classes/WindowManager.js'); - load('classes/util/Quirks.js'); - load('classes/util/Observable.js'); - load('classes/Shortcuts.js'); - load('classes/Editor.js'); - load('classes/util/I18n.js'); - load('classes/FocusManager.js'); - load('classes/EditorManager.js'); - load('classes/LegacyInput.js'); - load('classes/util/XHR.js'); - load('classes/util/JSON.js'); - load('classes/util/JSONRequest.js'); - load('classes/util/JSONP.js'); - load('classes/util/LocalStorage.js'); - load('classes/Compat.js'); - load('classes/ui/Layout.js'); - load('classes/ui/AbsoluteLayout.js'); - load('classes/ui/Tooltip.js'); - load('classes/ui/Widget.js'); - load('classes/ui/Button.js'); - load('classes/ui/ButtonGroup.js'); - load('classes/ui/Checkbox.js'); - load('classes/ui/PanelButton.js'); - load('classes/ui/ColorButton.js'); - load('classes/ui/ComboBox.js'); - load('classes/ui/Path.js'); - load('classes/ui/ElementPath.js'); - load('classes/ui/FormItem.js'); - load('classes/ui/Form.js'); - load('classes/ui/FieldSet.js'); - load('classes/ui/FilePicker.js'); - load('classes/ui/FitLayout.js'); - load('classes/ui/FlexLayout.js'); - load('classes/ui/FlowLayout.js'); - load('classes/ui/FormatControls.js'); - load('classes/ui/GridLayout.js'); - load('classes/ui/Iframe.js'); - load('classes/ui/Label.js'); - load('classes/ui/Toolbar.js'); - load('classes/ui/MenuBar.js'); - load('classes/ui/MenuButton.js'); - load('classes/ui/ListBox.js'); - load('classes/ui/MenuItem.js'); - load('classes/ui/Menu.js'); - load('classes/ui/Radio.js'); - load('classes/ui/ResizeHandle.js'); - load('classes/ui/Spacer.js'); - load('classes/ui/SplitButton.js'); - load('classes/ui/StackLayout.js'); - load('classes/ui/TabPanel.js'); - load('classes/ui/TextBox.js'); - load('classes/ui/Throbber.js'); - - writeScripts(); -})(this); - -// $hash: 5c5f43e325219b538abe4534d1f0aabf \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/tinymce.full.min.js b/common/static/js/vendor/tinymce/js/tinymce/tinymce.full.min.js index 1a9cc8d9c5d8..a1cbec923f49 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/tinymce.full.min.js +++ b/common/static/js/vendor/tinymce/js/tinymce/tinymce.full.min.js @@ -1,30 +1,415 @@ -// 4.0.20 (2014-03-18) -!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;ir;r++)if(o=n[r],o&&o.func.call(o.scope,e)===!1&&e.preventDefault(),e.isImmediatePropagationStopped())return}var a=this,s={},l,c,u,d,f;c=o+(+new Date).toString(32),d="onmouseenter"in document.documentElement,u="onfocusin"in document.documentElement,f={mouseenter:"mouseover",mouseleave:"mouseout"},l=1,a.domLoaded=!1,a.events=s,a.bind=function(t,o,p,m){function h(e){i(n(e||_.event),g)}var g,v,y,b,C,x,w,_=window;if(t&&3!==t.nodeType&&8!==t.nodeType){for(t[c]?g=t[c]:(g=l++,t[c]=g,s[g]={}),m=m||t,o=o.split(" "),y=o.length;y--;)b=o[y],x=h,C=w=!1,"DOMContentLoaded"===b&&(b="ready"),a.domLoaded&&"ready"===b&&"complete"==t.readyState?p.call(m,n({type:b})):(d||(C=f[b],C&&(x=function(e){var t,r;if(t=e.currentTarget,r=e.relatedTarget,r&&t.contains)r=t.contains(r);else for(;r&&r!==t;)r=r.parentNode;r||(e=n(e||_.event),e.type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,i(e,g))})),u||"focusin"!==b&&"focusout"!==b||(w=!0,C="focusin"===b?"focus":"blur",x=function(e){e=n(e||_.event),e.type="focus"===e.type?"focusin":"focusout",i(e,g)}),v=s[g][b],v?"ready"===b&&a.domLoaded?p({type:b}):v.push({func:p,scope:m}):(s[g][b]=v=[{func:p,scope:m}],v.fakeName=C,v.capture=w,v.nativeHandler=x,"ready"===b?r(t,x,a):e(t,C||b,x,w)));return t=v=0,p}},a.unbind=function(e,n,r){var i,o,l,u,d,f;if(!e||3===e.nodeType||8===e.nodeType)return a;if(i=e[c]){if(f=s[i],n){for(n=n.split(" "),l=n.length;l--;)if(d=n[l],o=f[d]){if(r)for(u=o.length;u--;)if(o[u].func===r){var p=o.nativeHandler,m=o.fakeName,h=o.capture;o=o.slice(0,u).concat(o.slice(u+1)),o.nativeHandler=p,o.fakeName=m,o.capture=h,f[d]=o}r&&0!==o.length||(delete f[d],t(e,o.fakeName||d,o.nativeHandler,o.capture))}}else{for(d in f)o=f[d],t(e,o.fakeName||d,o.nativeHandler,o.capture);f={}}for(d in f)return a;delete s[i];try{delete e[c]}catch(g){e[c]=null}}return a},a.fire=function(e,t,r){var o;if(!e||3===e.nodeType||8===e.nodeType)return a;r=n(null,r),r.type=t,r.target=e;do o=e[c],o&&i(r,o),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow;while(e&&!r.isPropagationStopped());return a},a.clean=function(e){var t,n,r=a.unbind;if(!e||3===e.nodeType||8===e.nodeType)return a;if(e[c]&&r(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(r(e),n=e.getElementsByTagName("*"),t=n.length;t--;)e=n[t],e[c]&&r(e);return a},a.destroy=function(){s={}},a.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}}var o="mce-data-",a=/^(?:mouse|contextmenu)|click/,s={keyLocation:1,layerX:1,layerY:1,returnValue:1};return i.Event=new i,i.Event.bind(window,"ready",function(){}),i}),r(c,[],function(){function e(e){return ht.test(e+"")}function n(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>_.cacheLength&&delete e[t.shift()],e[n]=r,r}}function r(e){return e[I]=!0,e}function i(e){var t=B.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t=null}}function o(e,t,n,r){var i,o,a,s,l,c,f,p,m,h;if((t?t.ownerDocument||t:F)!==B&&A(t),t=t||B,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(D&&!r){if(i=gt.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&O(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return Z.apply(n,t.getElementsByTagName(e)),n;if((a=i[3])&&z.getElementsByClassName&&t.getElementsByClassName)return Z.apply(n,t.getElementsByClassName(a)),n}if(z.qsa&&!M.test(e)){if(f=!0,p=I,m=t,h=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=u(e),(f=t.getAttribute("id"))?p=f.replace(bt,"\\$&"):t.setAttribute("id",p),p="[id='"+p+"'] ",l=c.length;l--;)c[l]=p+d(c[l]);m=mt.test(e)&&t.parentNode||t,h=c.join(",")}if(h)try{return Z.apply(n,m.querySelectorAll(h)),n}catch(g){}finally{f||t.removeAttribute("id")}}}return b(e.replace(lt,"$1"),t,n,r)}function a(e,t){var n=t&&e,r=n&&(~t.sourceIndex||G)-(~e.sourceIndex||G);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function u(e,t){var n,r,i,a,s,l,c,u=q[e+" "];if(u)return t?0:u.slice(0);for(s=e,l=[],c=_.preFilter;s;){(!n||(r=ct.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=ut.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(lt," ")}),s=s.slice(n.length));for(a in _.filter)!(r=pt[a].exec(s))||c[a]&&!(r=c[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?o.error(e):q(e,l).slice(0)}function d(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function f(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=V++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,c,u=W+" "+o;if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i)if(c=t[I]||(t[I]={}),(l=c[r])&&l[0]===u){if((s=l[1])===!0||s===w)return s===!0}else if(l=c[r]=[u],l[1]=e(t,n,a)||w,l[1]===!0)return!0}}function p(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function m(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),c&&t.push(s));return a}function h(e,t,n,i,o,a){return i&&!i[I]&&(i=h(i)),o&&!o[I]&&(o=h(o,a)),r(function(r,a,s,l){var c,u,d,f=[],p=[],h=a.length,g=r||y(t||"*",s.nodeType?[s]:s,[]),v=!e||!r&&t?g:m(g,f,e,s,l),b=n?o||(r?e:h||i)?[]:a:v;if(n&&n(v,b,s,l),i)for(c=m(b,p),i(c,[],s,l),u=c.length;u--;)(d=c[u])&&(b[p[u]]=!(v[p[u]]=d));if(r){if(o||e){if(o){for(c=[],u=b.length;u--;)(d=b[u])&&c.push(v[u]=d);o(null,b=[],c,l)}for(u=b.length;u--;)(d=b[u])&&(c=o?tt.call(r,d):f[u])>-1&&(r[c]=!(a[c]=d))}}else b=m(b===a?b.splice(h,b.length):b),o?o(null,a,b,l):Z.apply(a,b)})}function g(e){for(var t,n,r,i=e.length,o=_.relative[e[0].type],a=o||_.relative[" "],s=o?1:0,l=f(function(e){return e===t},a,!0),c=f(function(e){return tt.call(t,e)>-1},a,!0),u=[function(e,n,r){return!o&&(r||n!==k)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];i>s;s++)if(n=_.relative[e[s].type])u=[f(p(u),n)];else{if(n=_.filter[e[s].type].apply(null,e[s].matches),n[I]){for(r=++s;i>r&&!_.relative[e[r].type];r++);return h(s>1&&p(u),s>1&&d(e.slice(0,s-1)).replace(lt,"$1"),n,r>s&&g(e.slice(s,r)),i>r&&g(e=e.slice(r)),i>r&&d(e))}u.push(n)}return p(u)}function v(e,t){var n=0,i=t.length>0,a=e.length>0,s=function(r,s,l,c,u){var d,f,p,h=[],g=0,v="0",y=r&&[],b=null!=u,C=k,x=r||a&&_.find.TAG("*",u&&s.parentNode||s),N=W+=null==C?1:Math.random()||.1;for(b&&(k=s!==B&&s,w=n);null!=(d=x[v]);v++){if(a&&d){for(f=0;p=e[f++];)if(p(d,s,l)){c.push(d);break}b&&(W=N,w=++n)}i&&((d=!p&&d)&&g--,r&&y.push(d))}if(g+=v,i&&v!==g){for(f=0;p=t[f++];)p(y,h,s,l);if(r){if(g>0)for(;v--;)y[v]||h[v]||(h[v]=J.call(c));h=m(h)}Z.apply(c,h),b&&!r&&h.length>0&&g+t.length>1&&o.uniqueSort(c)}return b&&(W=N,k=C),y};return i?r(s):s}function y(e,t,n){for(var r=0,i=t.length;i>r;r++)o(e,t[r],n);return n}function b(e,t,n,r){var i,o,a,s,l,c=u(e);if(!r&&1===c.length){if(o=c[0]=c[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&9===t.nodeType&&D&&_.relative[o[1].type]){if(t=(_.find.ID(a.matches[0].replace(xt,wt),t)||[])[0],!t)return n;e=e.slice(o.shift().value.length)}for(i=pt.needsContext.test(e)?0:o.length;i--&&(a=o[i],!_.relative[s=a.type]);)if((l=_.find[s])&&(r=l(a.matches[0].replace(xt,wt),mt.test(o[0].type)&&t.parentNode||t))){if(o.splice(i,1),e=r.length&&d(o),!e)return Z.apply(n,r),n;break}}return S(e,c)(r,t,!D,n,mt.test(e)),n}function C(){}var x,w,_,N,E,S,k,T,R,A,B,L,D,M,H,P,O,I="sizzle"+-new Date,F=window.document,z={},W=0,V=0,U=n(),q=n(),$=n(),j=!1,K=function(){return 0},Y=typeof t,G=1<<31,X=[],J=X.pop,Q=X.push,Z=X.push,et=X.slice,tt=X.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},nt="[\\x20\\t\\r\\n\\f]",rt="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",it=rt.replace("w","w#"),ot="([*^$|!~]?=)",at="\\["+nt+"*("+rt+")"+nt+"*(?:"+ot+nt+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+it+")|)|)"+nt+"*\\]",st=":("+rt+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+at.replace(3,8)+")*)|.*)\\)|)",lt=new RegExp("^"+nt+"+|((?:^|[^\\\\])(?:\\\\.)*)"+nt+"+$","g"),ct=new RegExp("^"+nt+"*,"+nt+"*"),ut=new RegExp("^"+nt+"*([\\x20\\t\\r\\n\\f>+~])"+nt+"*"),dt=new RegExp(st),ft=new RegExp("^"+it+"$"),pt={ID:new RegExp("^#("+rt+")"),CLASS:new RegExp("^\\.("+rt+")"),NAME:new RegExp("^\\[name=['\"]?("+rt+")['\"]?\\]"),TAG:new RegExp("^("+rt.replace("w","w*")+")"),ATTR:new RegExp("^"+at),PSEUDO:new RegExp("^"+st),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+nt+"*(even|odd|(([+-]|)(\\d*)n|)"+nt+"*(?:([+-]|)"+nt+"*(\\d+)|))"+nt+"*\\)|)","i"),needsContext:new RegExp("^"+nt+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+nt+"*((?:-\\d)?\\d*)"+nt+"*\\)|)(?=[^-]|$)","i")},mt=/[\x20\t\r\n\f]*[+~]/,ht=/^[^{]+\{\s*\[native code/,gt=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,vt=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,bt=/'|\\/g,Ct=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,xt=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,wt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)};try{Z.apply(X=et.call(F.childNodes),F.childNodes),X[F.childNodes.length].nodeType}catch(_t){Z={apply:X.length?function(e,t){Q.apply(e,et.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}E=o.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},A=o.setDocument=function(n){var r=n?n.ownerDocument||n:F;return r!==B&&9===r.nodeType&&r.documentElement?(B=r,L=r.documentElement,D=!E(r),z.getElementsByTagName=i(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),z.attributes=i(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),z.getElementsByClassName=i(function(e){return e.innerHTML="",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),z.getByName=i(function(e){e.id=I+0,e.appendChild(B.createElement("a")).setAttribute("name",I),e.appendChild(B.createElement("i")).setAttribute("name",I),L.appendChild(e);var t=r.getElementsByName&&r.getElementsByName(I).length===2+r.getElementsByName(I+0).length;return L.removeChild(e),t}),z.sortDetached=i(function(e){return e.compareDocumentPosition&&1&e.compareDocumentPosition(B.createElement("div"))}),_.attrHandle=i(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==Y&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},z.getByName?(_.find.ID=function(e,t){if(typeof t.getElementById!==Y&&D){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},_.filter.ID=function(e){var t=e.replace(xt,wt);return function(e){return e.getAttribute("id")===t}}):(_.find.ID=function(e,n){if(typeof n.getElementById!==Y&&D){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==Y&&r.getAttributeNode("id").value===e?[r]:t:[]}},_.filter.ID=function(e){var t=e.replace(xt,wt);return function(e){var n=typeof e.getAttributeNode!==Y&&e.getAttributeNode("id");return n&&n.value===t}}),_.find.TAG=z.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==Y?t.getElementsByTagName(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},_.find.NAME=z.getByName&&function(e,t){return typeof t.getElementsByName!==Y?t.getElementsByName(name):void 0},_.find.CLASS=z.getElementsByClassName&&function(e,t){return typeof t.getElementsByClassName!==Y&&D?t.getElementsByClassName(e):void 0},H=[],M=[":focus"],(z.qsa=e(r.querySelectorAll))&&(i(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||M.push("\\["+nt+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||M.push(":checked")}),i(function(e){e.innerHTML="",e.querySelectorAll("[i^='']").length&&M.push("[*^$]="+nt+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||M.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),M.push(",.*:")})),(z.matchesSelector=e(P=L.matchesSelector||L.mozMatchesSelector||L.webkitMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&i(function(e){z.disconnectedMatch=P.call(e,"div"),P.call(e,"[s!='']:x"),H.push("!=",st)}),M=new RegExp(M.join("|")),H=H.length&&new RegExp(H.join("|")),O=e(L.contains)||L.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},K=L.compareDocumentPosition?function(e,t){if(e===t)return j=!0,0;var n=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return n?1&n||T&&t.compareDocumentPosition(e)===n?e===r||O(F,e)?-1:t===r||O(F,t)?1:R?tt.call(R,e)-tt.call(R,t):0:4&n?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var n,i=0,o=e.parentNode,s=t.parentNode,l=[e],c=[t];if(e===t)return j=!0,0;if(!o||!s)return e===r?-1:t===r?1:o?-1:s?1:0;if(o===s)return a(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)c.unshift(n);for(;l[i]===c[i];)i++;return i?a(l[i],c[i]):l[i]===F?-1:c[i]===F?1:0},B):B},o.matches=function(e,t){return o(e,null,null,t)},o.matchesSelector=function(e,t){if((e.ownerDocument||e)!==B&&A(e),t=t.replace(Ct,"='$1']"),z.matchesSelector&&D&&(!H||!H.test(t))&&!M.test(t))try{var n=P.call(e,t);if(n||z.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return o(t,B,null,[e]).length>0},o.contains=function(e,t){return(e.ownerDocument||e)!==B&&A(e),O(e,t)},o.attr=function(e,t){var n;return(e.ownerDocument||e)!==B&&A(e),D&&(t=t.toLowerCase()),(n=_.attrHandle[t])?n(e):!D||z.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},o.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},o.uniqueSort=function(e){var t,n=[],r=0,i=0;if(j=!z.detectDuplicates,T=!z.sortDetached,R=!z.sortStable&&e.slice(0),e.sort(K),j){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return e},N=o.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=N(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=N(t);return n},_=o.selectors={cacheLength:50,createPseudo:r,match:pt,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(xt,wt),e[3]=(e[4]||e[5]||"").replace(xt,wt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||o.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&o.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return pt.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&dt.test(n)&&(t=u(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(xt,wt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=U[e+" "];return t||(t=new RegExp("(^|"+nt+")"+e+"("+nt+"|$)"))&&U(e,function(e){return t.test(e.className||typeof e.getAttribute!==Y&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=o.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,f,p,m,h=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;h;){for(d=t;d=d[h];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;m=h="only"===e&&!m&&"nextSibling"}return!0}if(m=[a?g.firstChild:g.lastChild],a&&y){for(u=g[I]||(g[I]={}),c=u[e]||[],p=c[0]===W&&c[1],f=c[0]===W&&c[2],d=p&&g.childNodes[p];d=++p&&d&&d[h]||(f=p=0)||m.pop();)if(1===d.nodeType&&++f&&d===t){u[e]=[W,p,f];break}}else if(y&&(c=(t[I]||(t[I]={}))[e])&&c[0]===W)f=c[1];else for(;(d=++p&&d&&d[h]||(f=p=0)||m.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++f||(y&&((d[I]||(d[I]={}))[e]=[W,f]),d!==t)););return f-=i,f===r||f%r===0&&f/r>=0}}},PSEUDO:function(e,t){var n,i=_.pseudos[e]||_.setFilters[e.toLowerCase()]||o.error("unsupported pseudo: "+e);return i[I]?i(t):i.length>1?(n=[e,e,"",t],_.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,n){for(var r,o=i(e,t),a=o.length;a--;)r=tt.call(e,o[a]),e[r]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:r(function(e){var t=[],n=[],i=S(e.replace(lt,"$1"));return i[I]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),!n.pop()}}),has:r(function(e){return function(t){return o(e,t).length>0}}),contains:r(function(e){return function(t){return(t.textContent||t.innerText||N(t)).indexOf(e)>-1}}),lang:r(function(e){return ft.test(e||"")||o.error("unsupported lang: "+e),e=e.replace(xt,wt).toLowerCase(),function(t){var n;do if(n=D?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===L},focus:function(e){return e===B.activeElement&&(!B.hasFocus||B.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!_.pseudos.empty(e)},header:function(e){return yt.test(e.nodeName)},input:function(e){return vt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;++rn;n++)t[n]=e[n];return t}function f(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1}function p(e){return null===e||e===t?"":(""+e).replace(N,"")}function m(e,t){var n,r,i,o,a;if(e)if(n=e.length,n===o){for(r in e)if(e.hasOwnProperty(r)&&(a=e[r],t.call(a,a,r)===!1))break}else for(i=0;n>i&&(a=e[i],t.call(a,a,r)!==!1);i++);return e}function h(e,n,r){for(var i=[],o=e[n];o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!c(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i}function g(e,t,n,r){for(var i=[];e;e=e[n])r&&e.nodeType!==r||e===t||i.push(e);return i}var v=document,y=Array.prototype.push,b=Array.prototype.slice,C=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,x=e.Event,w=l("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"),_=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},N=/^\s*|\s*$/g;return c.fn=c.prototype={constructor:c,selector:"",length:0,init:function(e,t){var n=this,r,a;if(!e)return n;if(e.nodeType)return n.context=n[0]=e,n.length=1,n;if(i(e)){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:C.exec(e),!r)return c(t||document).find(e);if(r[1])for(a=o(e).firstChild;a;)this.add(a),a=a.nextSibling;else{if(a=v.getElementById(r[2]),a.id!==r[2])return n.find(e);n.length=1,n[0]=a}}else this.add(e);return n},toArray:function(){return d(this)},add:function(e){var t=this;return _(e)?y.apply(t,e):e instanceof c?t.add(e.toArray()):y.call(t,e),t},attr:function(e,n){var i=this;if("object"==typeof e)m(e,function(e,t){i.attr(t,e)});else{if(!r(n))return i[0]&&1===i[0].nodeType?i[0].getAttribute(e):t;this.each(function(){1===this.nodeType&&this.setAttribute(e,n)})}return i},css:function(e,n){var i=this;if("object"==typeof e)m(e,function(e,t){i.css(t,e)});else{if(e=e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),!r(n))return i[0]?i[0].style[e]:t;"number"!=typeof n||w[e]||(n+="px"),i.each(function(){var t=this.style;"opacity"===e&&this.runtimeStyle&&"undefined"==typeof this.runtimeStyle.opacity&&(t.filter=""===n?"":"alpha(opacity="+100*n+")");try{t[e]=n}catch(r){}})}return i},remove:function(){for(var e=this,t,n=this.length;n--;)t=e[n],x.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var e=this,t,n=this.length;n--;)for(t=e[n];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(e){var t=this,n;if(r(e)){for(n=t.length;n--;)t[n].innerHTML=e;return t}return t[0]?t[0].innerHTML:""},text:function(e){var t=this,n;if(r(e)){for(n=t.length;n--;)t[n].innerText=t[0].textContent=e;return t}return t[0]?t[0].innerText||t[0].textContent:""},append:function(){return a(this,arguments,function(e){1===this.nodeType&&this.appendChild(e)})},prepend:function(){return a(this,arguments,function(e){1===this.nodeType&&this.insertBefore(e,this.firstChild)})},before:function(){var e=this;return e[0]&&e[0].parentNode?a(e,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)}):e},after:function(){var e=this;return e[0]&&e[0].parentNode?a(e,arguments,function(e){this.parentNode.insertBefore(e,this)}):e},appendTo:function(e){return c(e).append(this),this},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(e,t){var n=this;return-1!==e.indexOf(" ")?m(e.split(" "),function(){n.toggleClass(this,t)}):n.each(function(n){var r;s(n,e)!==t&&(r=n.className,t?n.className+=r?" "+e:e:n.className=p((" "+r+" ").replace(" "+e+" "," ")))}),n},hasClass:function(e){return s(this[0],e)},each:function(e){return m(this,e)},on:function(e,t){return this.each(function(){x.bind(this,e,t)})},off:function(e,t){return this.each(function(){x.unbind(this,e,t)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new c(b.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},replaceWith:function(e){var t=this;return t[0]&&t[0].parentNode.replaceChild(c(e)[0],t[0]),t},wrap:function(e){return e=c(e)[0],this.each(function(){var t=this,n=e.cloneNode(!1);t.parentNode.insertBefore(n,t),n.appendChild(t)})},unwrap:function(){return this.each(function(){for(var e=this,t=e.firstChild,n;t;)n=t,t=t.nextSibling,e.parentNode.insertBefore(n,e)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),c(e)},find:function(e){var t,n,r=[];for(t=0,n=this.length;n>t;t++)c.find(e,this[t],r);return c(r)},push:y,sort:[].sort,splice:[].splice},u(c,{extend:u,toArray:d,inArray:f,isArray:_,each:m,trim:p,makeMap:l,find:n,expr:n.selectors,unique:n.uniqueSort,text:n.getText,isXMLDoc:n.isXML,contains:n.contains,filter:function(e,t,n){return n&&(e=":not("+e+")"),t=1===t.length?c.find.matchesSelector(t[0],e)?[t[0]]:[]:c.find.matches(e,t)}}),m({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t){return h(e,"parentNode",t)},next:function(e){return g(e,"nextSibling",1)},prev:function(e){return g(e,"previousSibling",1)},nextNodes:function(e){return g(e,"nextSibling")},prevNodes:function(e){return g(e,"previousSibling")},children:function(e){return g(e.firstChild,"nextSibling",1)},contents:function(e){return d(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,t){c.fn[e]=function(n){var r=this,i;if(r.length>1)throw new Error("DomQuery only supports traverse functions on a single node.");return r[0]&&(i=t(r[0],n)),i=c(i),n&&"parentsUntil"!==e?i.filter(n):i}}),c.fn.filter=function(e){return c.filter(e)},c.fn.is=function(e){return!!e&&this.filter(e).length>0},c.fn.init.prototype=c.fn,c}),r(d,[],function(){return function(e,t){function n(e,t,n,r){function i(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+i(t)+i(n)+i(r)}var r=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,i=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,o=/\s*([^:]+):\s*([^;]+);?/g,a=/\s+$/,s,l,c={},u,d="\ufeff"; -for(e=e||{},u=("\\\" \\' \\; \\: ; : "+d).split(" "),l=0;l-1&&n||(h[e+t]=-1==l?s[0]:s.join(" "),delete h[e+"-top"+t],delete h[e+"-right"+t],delete h[e+"-bottom"+t],delete h[e+"-left"+t])}}function u(e){var t=h[e],n;if(t){for(t=t.split(" "),n=t.length;n--;)if(t[n]!==t[0])return!1;return h[e]=t[0],!0}}function d(e,t,n,r){u(t)&&u(n)&&u(r)&&(h[e]=h[t]+" "+h[n]+" "+h[r],delete h[t],delete h[n],delete h[r])}function f(e){return b=!0,c[e]}function p(e,t){return b&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return c[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e}function m(t,n,r,i,o,a){return(o=o||a)?(o=p(o),"'"+o.replace(/\'/g,"\\'")+"'"):(n=p(n||r||i),!e.allow_script_urls&&/(java|vb)script:/i.test(n.replace(/[\s\r\n]+/,""))?"":(C&&(n=C.call(x,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"))}var h={},g,v,y,b,C=e.url_converter,x=e.url_converter_scope||this;if(t){for(t=t.replace(/[\u0000-\u001F]/g,""),t=t.replace(/\\[\"\';:\uFEFF]/g,f).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,f)});g=o.exec(t);){if(v=g[1].replace(a,"").toLowerCase(),y=g[2].replace(a,""),v&&y.length>0){if(!e.allow_script_urls&&("behavior"==v||/expression\s*\(/.test(y)))continue;"font-weight"===v&&"700"===y?y="bold":("color"===v||"background-color"===v)&&(y=y.toLowerCase()),y=y.replace(r,n),y=y.replace(i,m),h[v]=b?p(y,!0):y}o.lastIndex=g.index+g[0].length}s("border","",!0),s("border","-width"),s("border","-color"),s("border","-style"),s("padding",""),s("margin",""),d("border","border-width","border-style","border-color"),"medium none"===h.border&&delete h.border,"none"===h["border-image"]&&delete h["border-image"]}return h},serialize:function(e,n){function r(n){var r,o,a,l;if(r=t.styles[n])for(o=0,a=r.length;a>o;o++)n=r[o],l=e[n],l!==s&&l.length>0&&(i+=(i.length>0?" ":"")+n+": "+l+";")}var i="",o,a;if(n&&t&&t.styles)r("*"),r(n);else for(o in e)a=e[o],a!==s&&a.length>0&&(i+=(i.length>0?" ":"")+o+": "+a+";");return i}}}}),r(f,[],function(){return function(e,t){function n(e,n,r,i){var o,a;if(e){if(!i&&e[n])return e[n];if(e!=t){if(o=e[r])return o;for(a=e.parentNode;a&&a!=t;a=a.parentNode)if(o=a[r])return o}}}var r=e;this.current=function(){return r},this.next=function(e){return r=n(r,"firstChild","nextSibling",e)},this.prev=function(e){return r=n(r,"lastChild","previousSibling",e)}}}),r(p,[],function(){function e(e){return null===e||e===t?"":(""+e).replace(h,"")}function n(e,n){return n?"array"==n&&g(e)?!0:typeof e==n:e!==t}function r(e){var t=[],n,r;for(n=0,r=e.length;r>n;n++)t[n]=e[n];return t}function i(e,t,n){var r;for(e=e||[],t=t||",","string"==typeof e&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n}function o(e,n,r){var i,o;if(!e)return 0;if(r=r||e,e.length!==t){for(i=0,o=e.length;o>i;i++)if(n.call(r,e[i],i,e)===!1)return 0}else for(i in e)if(e.hasOwnProperty(i)&&n.call(r,e[i],i,e)===!1)return 0;return 1}function a(e,t){var n=[];return o(e,function(e){n.push(t(e))}),n}function s(e,t){var n=[];return o(e,function(e){(!t||t(e))&&n.push(e)}),n}function l(e,t,n){var r=this,i,o,a,s,l,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),a=e[3].match(/(^|\.)(\w+)$/i)[2],o=r.createNS(e[3].replace(/\.\w+$/,""),n),!o[a]){if("static"==e[2])return o[a]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[a]));t[a]||(t[a]=function(){},c=1),o[a]=t[a],r.extend(o[a].prototype,t),e[5]&&(i=r.resolve(e[5]).prototype,s=e[5].match(/\.(\w+)$/i)[1],l=o[a],o[a]=c?function(){return i[s].apply(this,arguments)}:function(){return this.parent=i[s],l.apply(this,arguments)},o[a].prototype[a]=o[a],r.each(i,function(e,t){o[a].prototype[t]=i[t]}),r.each(t,function(e,t){i[t]?o[a].prototype[t]=function(){return this.parent=i[t],e.apply(this,arguments)}:t!=a&&(o[a].prototype[t]=e)})),r.each(t["static"],function(e,t){o[a][t]=e})}}function c(e,t){var n,r;if(e)for(n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}function u(e,n){var r,i,o,a=arguments,s;for(r=1,i=a.length;i>r;r++){n=a[r];for(o in n)n.hasOwnProperty(o)&&(s=n[o],s!==t&&(e[o]=s))}return e}function d(e,t,n,r){r=r||this,e&&(n&&(e=e[n]),o(e,function(e,i){return t.call(r,e,i,n)===!1?!1:void d(e,t,n,r)}))}function f(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;nn&&(t=t[e[n]],t);n++);return t}function m(t,r){return!t||n(t,"array")?t:a(t.split(r||","),e)}var h=/^\s*|\s*$/g,g=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return{trim:e,isArray:g,is:n,toArray:r,makeMap:i,each:o,map:a,grep:s,inArray:c,extend:u,create:l,walk:d,createNS:f,resolve:p,explode:m}}),r(m,[p],function(e){function t(n){function r(){return H.createDocumentFragment()}function i(e,t){_(F,e,t)}function o(e,t){_(z,e,t)}function a(e){i(e.parentNode,j(e))}function s(e){i(e.parentNode,j(e)+1)}function l(e){o(e.parentNode,j(e))}function c(e){o(e.parentNode,j(e)+1)}function u(e){e?(M[U]=M[V],M[q]=M[W]):(M[V]=M[U],M[W]=M[q]),M.collapsed=F}function d(e){a(e),c(e)}function f(e){i(e,0),o(e,1===e.nodeType?e.childNodes.length:e.nodeValue.length)}function p(e,t){var n=M[V],r=M[W],i=M[U],o=M[q],a=t.startContainer,s=t.startOffset,l=t.endContainer,c=t.endOffset;return 0===e?w(n,r,a,s):1===e?w(i,o,a,s):2===e?w(i,o,l,c):3===e?w(n,r,l,c):void 0}function m(){N(I)}function h(){return N(P)}function g(){return N(O)}function v(e){var t=this[V],r=this[W],i,o;3!==t.nodeType&&4!==t.nodeType||!t.nodeValue?(t.childNodes.length>0&&(o=t.childNodes[r]),o?t.insertBefore(e,o):3==t.nodeType?n.insertAfter(e,t):t.appendChild(e)):r?r>=t.nodeValue.length?n.insertAfter(e,t):(i=t.splitText(r),t.parentNode.insertBefore(e,i)):t.parentNode.insertBefore(e,t)}function y(e){var t=M.extractContents();M.insertNode(e),e.appendChild(t),M.selectNode(e)}function b(){return $(new t(n),{startContainer:M[V],startOffset:M[W],endContainer:M[U],endOffset:M[q],collapsed:M.collapsed,commonAncestorContainer:M.commonAncestorContainer})}function C(e,t){var n;if(3==e.nodeType)return e;if(0>t)return e;for(n=e.firstChild;n&&t>0;)--t,n=n.nextSibling;return n?n:e}function x(){return M[V]==M[U]&&M[W]==M[q]}function w(e,t,r,i){var o,a,s,l,c,u;if(e==r)return t==i?0:i>t?-1:1;for(o=r;o&&o.parentNode!=e;)o=o.parentNode;if(o){for(a=0,s=e.firstChild;s!=o&&t>a;)a++,s=s.nextSibling;return a>=t?-1:1}for(o=e;o&&o.parentNode!=r;)o=o.parentNode;if(o){for(a=0,s=r.firstChild;s!=o&&i>a;)a++,s=s.nextSibling;return i>a?-1:1}for(l=n.findCommonAncestor(e,r),c=e;c&&c.parentNode!=l;)c=c.parentNode;for(c||(c=l),u=r;u&&u.parentNode!=l;)u=u.parentNode;if(u||(u=l),c==u)return 0;for(s=l.firstChild;s;){if(s==c)return-1;if(s==u)return 1;s=s.nextSibling}}function _(e,t,r){var i,o;for(e?(M[V]=t,M[W]=r):(M[U]=t,M[q]=r),i=M[U];i.parentNode;)i=i.parentNode;for(o=M[V];o.parentNode;)o=o.parentNode;o==i?w(M[V],M[W],M[U],M[q])>0&&M.collapse(e):M.collapse(e),M.collapsed=x(),M.commonAncestorContainer=n.findCommonAncestor(M[V],M[U])}function N(e){var t,n=0,r=0,i,o,a,s,l,c;if(M[V]==M[U])return E(e);for(t=M[U],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[V])return S(t,e);++n}for(t=M[V],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[U])return k(t,e);++r}for(o=r-n,a=M[V];o>0;)a=a.parentNode,o--;for(s=M[U];0>o;)s=s.parentNode,o++;for(l=a.parentNode,c=s.parentNode;l!=c;l=l.parentNode,c=c.parentNode)a=l,s=c;return T(a,s,e)}function E(e){var t,n,i,o,a,s,l,c,u;if(e!=I&&(t=r()),M[W]==M[q])return t;if(3==M[V].nodeType){if(n=M[V].nodeValue,i=n.substring(M[W],M[q]),e!=O&&(o=M[V],c=M[W],u=M[q]-M[W],0===c&&u>=o.nodeValue.length-1?o.parentNode.removeChild(o):o.deleteData(c,u),M.collapse(F)),e==I)return;return i.length>0&&t.appendChild(H.createTextNode(i)),t}for(o=C(M[V],M[W]),a=M[q]-M[W];o&&a>0;)s=o.nextSibling,l=L(o,e),t&&t.appendChild(l),--a,o=s;return e!=O&&M.collapse(F),t}function S(e,t){var n,i,o,a,s,l;if(t!=I&&(n=r()),i=R(e,t),n&&n.appendChild(i),o=j(e),a=o-M[W],0>=a)return t!=O&&(M.setEndBefore(e),M.collapse(z)),n;for(i=e.previousSibling;a>0;)s=i.previousSibling,l=L(i,t),n&&n.insertBefore(l,n.firstChild),--a,i=s;return t!=O&&(M.setEndBefore(e),M.collapse(z)),n}function k(e,t){var n,i,o,a,s,l;for(t!=I&&(n=r()),o=A(e,t),n&&n.appendChild(o),i=j(e),++i,a=M[q]-i,o=e.nextSibling;o&&a>0;)s=o.nextSibling,l=L(o,t),n&&n.appendChild(l),--a,o=s;return t!=O&&(M.setStartAfter(e),M.collapse(F)),n}function T(e,t,n){var i,o,a,s,l,c,u;for(n!=I&&(o=r()),i=A(e,n),o&&o.appendChild(i),a=j(e),s=j(t),++a,l=s-a,c=e.nextSibling;l>0;)u=c.nextSibling,i=L(c,n),o&&o.appendChild(i),c=u,--l;return i=R(t,n),o&&o.appendChild(i),n!=O&&(M.setStartAfter(e),M.collapse(F)),o}function R(e,t){var n=C(M[U],M[q]-1),r,i,o,a,s,l=n!=M[U];if(n==e)return B(n,l,z,t);for(r=n.parentNode,i=B(r,z,z,t);r;){for(;n;)o=n.previousSibling,a=B(n,l,z,t),t!=I&&i.insertBefore(a,i.firstChild),l=F,n=o;if(r==e)return i;n=r.previousSibling,r=r.parentNode,s=B(r,z,z,t),t!=I&&s.appendChild(i),i=s}}function A(e,t){var n=C(M[V],M[W]),r=n!=M[V],i,o,a,s,l;if(n==e)return B(n,r,F,t);for(i=n.parentNode,o=B(i,z,F,t);i;){for(;n;)a=n.nextSibling,s=B(n,r,F,t),t!=I&&o.appendChild(s),r=F,n=a;if(i==e)return o;n=i.nextSibling,i=i.parentNode,l=B(i,z,F,t),t!=I&&l.appendChild(o),o=l}}function B(e,t,r,i){var o,a,s,l,c;if(t)return L(e,i);if(3==e.nodeType){if(o=e.nodeValue,r?(l=M[W],a=o.substring(l),s=o.substring(0,l)):(l=M[q],a=o.substring(0,l),s=o.substring(l)),i!=O&&(e.nodeValue=s),i==I)return;return c=n.clone(e,z),c.nodeValue=a,c}if(i!=I)return n.clone(e,z)}function L(e,t){return t!=I?t==O?n.clone(e,F):e:void e.parentNode.removeChild(e)}function D(){return n.create("body",null,g()).outerText}var M=this,H=n.doc,P=0,O=1,I=2,F=!0,z=!1,W="startOffset",V="startContainer",U="endContainer",q="endOffset",$=e.extend,j=n.nodeIndex;return $(M,{startContainer:H,startOffset:0,endContainer:H,endOffset:0,collapsed:F,commonAncestorContainer:H,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:i,setEnd:o,setStartBefore:a,setStartAfter:s,setEndBefore:l,setEndAfter:c,collapse:u,selectNode:d,selectNodeContents:f,compareBoundaryPoints:p,deleteContents:m,extractContents:h,cloneContents:g,insertNode:v,surroundContents:y,cloneRange:b,toStringIE:D}),M}return t.prototype.toString=function(){return this.toStringIE()},t}),r(h,[p],function(e){function t(e){var t;return t=document.createElement("div"),t.innerHTML=e,t.textContent||t.innerText||e}function n(e,t){var n,r,i,a={};if(e){for(e=e.split(","),t=t||10,n=0;n\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=/[<>&\"\']/g,u=/&(#x|#)?([\w]+);/g,d={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};o={'"':""","'":"'","<":"<",">":">","&":"&"},a={"<":"<",">":">","&":"&",""":'"',"'":"'"},i=n("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var f={encodeRaw:function(e,t){return e.replace(t?s:l,function(e){return o[e]||e})},encodeAllRaw:function(e){return(""+e).replace(c,function(e){return o[e]||e})},encodeNumeric:function(e,t){return e.replace(t?s:l,function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":o[e]||"&#"+e.charCodeAt(0)+";"})},encodeNamed:function(e,t,n){return n=n||i,e.replace(t?s:l,function(e){return o[e]||n[e]||e})},getEncodeFunc:function(e,t){function a(e,n){return e.replace(n?s:l,function(e){return o[e]||t[e]||"&#"+e.charCodeAt(0)+";"||e})}function c(e,n){return f.encodeNamed(e,n,t)}return t=n(t)||i,e=r(e.replace(/\+/g,",")),e.named&&e.numeric?a:e.named?t?c:f.encodeNamed:e.numeric?f.encodeNumeric:f.encodeRaw},decode:function(e){return e.replace(u,function(e,n,r){return n?(r=parseInt(r,2===n.length?16:10),r>65535?(r-=65536,String.fromCharCode(55296+(r>>10),56320+(1023&r))):d[r]||String.fromCharCode(r)):a[e]||i[e]||t(e)})}};return f}),r(g,[],function(){var e=navigator,t=e.userAgent,n,r,i,o,a,s,l;n=window.opera&&window.opera.buildNumber,r=/WebKit/.test(t),i=!r&&!n&&/MSIE/gi.test(t)&&/Explorer/gi.test(e.appName),i=i&&/MSIE (\w+)\./.exec(t)[1],o=-1==t.indexOf("Trident/")||-1==t.indexOf("rv:")&&-1==e.appName.indexOf("Netscape")?!1:11,i=i||o,a=!r&&!o&&/Gecko/.test(t),s=-1!=t.indexOf("Mac"),l=/(iPad|iPhone)/.test(t);var c=!l||t.match(/AppleWebKit\/(\d*)/)[1]>=534;return{opera:n,webkit:r,ie:i,gecko:a,mac:s,iOS:l,contentEditable:c,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!=i,range:window.getSelection&&"Range"in window,documentMode:i?document.documentMode||7:10}}),r(v,[],function(){return function(e,t){function n(t){e.getElementsByTagName("head")[0].appendChild(t)}function r(t,r,s){function l(){for(var e=v.passed,t=e.length;t--;)e[t]();v.status=2,v.passed=[],v.failed=[]}function c(){for(var e=v.failed,t=e.length;t--;)e[t]();v.status=3,v.passed=[],v.failed=[]}function u(){var e=navigator.userAgent.match(/WebKit\/(\d*)/);return!!(e&&e[1]<536)}function d(e,t){e()||((new Date).getTime()-g0)return h=e.createElement("style"),h.textContent='@import "'+t+'"',p(),void n(h);f()}n(m),m.href=t}}var i=0,o={},a;t=t||{},a=t.maxLoadTime||5e3,this.load=r}}),r(y,[c,d,l,f,m,h,g,p,v],function(e,n,r,i,o,a,s,l,c){function u(e,t){var i=this,o;i.doc=e,i.win=window,i.files={},i.counter=0,i.stdMode=!v||e.documentMode>=8,i.boxModel=!v||"CSS1Compat"==e.compatMode||i.stdMode,i.hasOuterHTML="outerHTML"in e.createElement("a"),i.styleSheetLoader=new c(e),this.boundEvents=[],i.settings=t=h({keep_values:!1,hex_colors:1},t),i.schema=t.schema,i.styles=new n({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),i.fixDoc(e),i.events=t.ownEvents?new r(t.proxy):r.Event,o=t.schema?t.schema.getBlockElements():{},i.isBlock=function(e){if(!e)return!1;var t=e.nodeType;return t?!(1!==t||!o[e.nodeName]):!!o[e]}}var d=l.each,f=l.is,p=l.grep,m=l.trim,h=l.extend,g=s.webkit,v=s.ie,y=/^([a-z0-9],?)+$/i,b=/^[ \t\r\n]*$/,C=l.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," ");return u.prototype={root:null,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},fixDoc:function(e){var t=this.settings,n;if(v&&t.schema){"abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video".replace(/\w+/g,function(t){e.createElement(t)});for(n in t.schema.getCustomElements())e.createElement(n)}},clone:function(e,t){var n=this,r,i;return!v||1!==e.nodeType||t?e.cloneNode(t):(i=n.doc,t?r.firstChild:(r=i.createElement(e.nodeName),d(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),r))},getRoot:function(){var e=this;return e.get(e.settings.root_element)||e.doc.body},getViewPort:function(e){var t,n;return e=e?e:this.win,t=e.document,n=this.boxModel?t.documentElement:t.body,{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop,w:e.innerWidth||n.clientWidth,h:e.innerHeight||n.clientHeight}},getRect:function(e){var t=this,n,r;return e=t.get(e),n=t.getPos(e),r=t.getSize(e),{x:n.x,y:n.y,w:r.w,h:r.h}},getSize:function(e){var t=this,n,r;return e=t.get(e),n=t.getStyle(e,"width"),r=t.getStyle(e,"height"),-1===n.indexOf("px")&&(n=0),-1===r.indexOf("px")&&(r=0),{w:parseInt(n,10)||e.offsetWidth||e.clientWidth,h:parseInt(r,10)||e.offsetHeight||e.clientHeight}},getParent:function(e,t,n){return this.getParents(e,t,n,!1)},getParents:function(e,n,r,i){var o=this,a,s=[];for(e=o.get(e),i=i===t,r=r||("BODY"!=o.getRoot().nodeName?o.getRoot().parentNode:null),f(n,"string")&&(a=n,n="*"===n?function(e){return 1==e.nodeType}:function(e){return o.is(e,a)});e&&e!=r&&e.nodeType&&9!==e.nodeType;){if(!n||n(e)){if(!i)return e;s.push(e)}e=e.parentNode}return i?s:null},get:function(e){var t;return e&&this.doc&&"string"==typeof e&&(t=e,e=this.doc.getElementById(e),e&&e.id!==t)?this.doc.getElementsByName(t)[1]:e},getNext:function(e,t){return this._findSib(e,t,"nextSibling")},getPrev:function(e,t){return this._findSib(e,t,"previousSibling")},select:function(t,n){var r=this;return e(t,r.get(n)||r.get(r.settings.root_element)||r.doc,[])},is:function(n,r){var i;if(n.length===t){if("*"===r)return 1==n.nodeType;if(y.test(r)){for(r=r.toLowerCase().split(/,/),n=n.nodeName.toLowerCase(),i=r.length-1;i>=0;i--)if(r[i]==n)return!0;return!1}}if(n.nodeType&&1!=n.nodeType)return!1;var o=n.nodeType?[n]:n;return e(r,o[0].ownerDocument||o[0],null,o).length>0},add:function(e,t,n,r,i){var o=this;return this.run(e,function(e){var a;return a=f(t,"string")?o.doc.createElement(t):t,o.setAttribs(a,n),r&&(r.nodeType?a.appendChild(r):o.setHTML(a,r)),i?a:e.appendChild(a)})},create:function(e,t,n){return this.add(this.doc.createElement(e),e,t,n,1)},createHTML:function(e,t,n){var r="",i;r+="<"+e;for(i in t)t.hasOwnProperty(i)&&null!==t[i]&&(r+=" "+i+'="'+this.encode(t[i])+'"');return"undefined"!=typeof n?r+">"+n+"":r+" />"},createFragment:function(e){var t,n,r=this.doc,i;for(i=r.createElement("div"),t=r.createDocumentFragment(),e&&(i.innerHTML=e);n=i.firstChild;)t.appendChild(n);return t},remove:function(e,t){return this.run(e,function(e){var n,r=e.parentNode;if(!r)return null;if(t)for(;n=e.firstChild;)!v||3!==n.nodeType||n.nodeValue?r.insertBefore(n,e):e.removeChild(n);return r.removeChild(e)})},setStyle:function(e,t,n){return this.run(e,function(e){var r=this,i,o;if(t)if("string"==typeof t){i=e.style,t=t.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"number"!=typeof n||C[t]||(n+="px"),"opacity"===t&&e.runtimeStyle&&"undefined"==typeof e.runtimeStyle.opacity&&(i.filter=""===n?"":"alpha(opacity="+100*n+")"),"float"==t&&(t="cssFloat"in e.style?"cssFloat":"styleFloat");try{i[t]=n}catch(a){}r.settings.update_styles&&e.removeAttribute("data-mce-style")}else for(o in t)r.setStyle(e,o,t[o])})},getStyle:function(e,n,r){if(e=this.get(e)){if(this.doc.defaultView&&r){n=n.replace(/[A-Z]/g,function(e){return"-"+e});try{return this.doc.defaultView.getComputedStyle(e,null).getPropertyValue(n)}catch(i){return null}}return n=n.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"float"==n&&(n=v?"styleFloat":"cssFloat"),e.currentStyle&&r?e.currentStyle[n]:e.style?e.style[n]:t}},setStyles:function(e,t){this.setStyle(e,t)},css:function(e,t,n){this.setStyle(e,t,n)},removeAllAttribs:function(e){return this.run(e,function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t))})},setAttrib:function(e,t,n){var r=this;if(e&&t)return this.run(e,function(e){var i=r.settings,o=e.getAttribute(t);if(null!==n)switch(t){case"style":if(!f(n,"string"))return void d(n,function(t,n){r.setStyle(e,n,t)});i.keep_values&&(n?e.setAttribute("data-mce-style",n,2):e.removeAttribute("data-mce-style",2)),e.style.cssText=n;break;case"class":e.className=n||"";break;case"src":case"href":i.keep_values&&(i.url_converter&&(n=i.url_converter.call(i.url_converter_scope||r,n,t,e)),r.setAttrib(e,"data-mce-"+t,n,2));break;case"shape":e.setAttribute("data-mce-style",n)}f(n)&&null!==n&&0!==n.length?e.setAttribute(t,""+n,2):e.removeAttribute(t,2),o!=n&&i.onSetAttrib&&i.onSetAttrib({attrElm:e,attrName:t,attrValue:n})})},setAttribs:function(e,t){var n=this;return this.run(e,function(e){d(t,function(t,r){n.setAttrib(e,r,t)})})},getAttrib:function(e,t,n){var r,i=this,o;if(e=i.get(e),!e||1!==e.nodeType)return n===o?!1:n;if(f(n)||(n=""),/^(src|href|style|coords|shape)$/.test(t)&&(r=e.getAttribute("data-mce-"+t)))return r;if(v&&i.props[t]&&(r=e[i.props[t]],r=r&&r.nodeValue?r.nodeValue:r),r||(r=e.getAttribute(t,2)),/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(t))return e[i.props[t]]===!0&&""===r?t:r?t:"";if("FORM"===e.nodeName&&e.getAttributeNode(t))return e.getAttributeNode(t).nodeValue;if("style"===t&&(r=r||e.style.cssText,r&&(r=i.serializeStyle(i.parseStyle(r),e.nodeName),i.settings.keep_values&&e.setAttribute("data-mce-style",r))),g&&"class"===t&&r&&(r=r.replace(/(apple|webkit)\-[a-z\-]+/gi,"")),v)switch(t){case"rowspan":case"colspan":1===r&&(r="");break;case"size":("+0"===r||20===r||0===r)&&(r="");break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":0===r&&(r="");break;case"hspace":-1===r&&(r="");break;case"maxlength":case"tabindex":(32768===r||2147483647===r||"32768"===r)&&(r="");break;case"multiple":case"compact":case"noshade":case"nowrap":return 65535===r?t:n;case"shape":r=r.toLowerCase();break;default:0===t.indexOf("on")&&r&&(r=(""+r).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1"))}return r!==o&&null!==r&&""!==r?""+r:n},getPos:function(e,t){var n=this,r=0,i=0,o,a=n.doc,s;if(e=n.get(e),t=t||a.body,e){if(t===a.body&&e.getBoundingClientRect)return s=e.getBoundingClientRect(),t=n.boxModel?a.documentElement:a.body,r=s.left+(a.documentElement.scrollLeft||a.body.scrollLeft)-t.clientLeft,i=s.top+(a.documentElement.scrollTop||a.body.scrollTop)-t.clientTop,{x:r,y:i};for(o=e;o&&o!=t&&o.nodeType;)r+=o.offsetLeft||0,i+=o.offsetTop||0,o=o.offsetParent;for(o=e.parentNode;o&&o!=t&&o.nodeType;)r-=o.scrollLeft||0,i-=o.scrollTop||0,o=o.parentNode}return{x:r,y:i}},parseStyle:function(e){return this.styles.parse(e)},serializeStyle:function(e,t){return this.styles.serialize(e,t)},addStyle:function(e){var t=this,n=t.doc,r,i;if(t!==u.DOM&&n===document){var o=u.DOM.addedStyles;if(o=o||[],o[e])return;o[e]=!0,u.DOM.addedStyles=o}i=n.getElementById("mceDefaultStyles"),i||(i=n.createElement("style"),i.id="mceDefaultStyles",i.type="text/css",r=n.getElementsByTagName("head")[0],r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i)),i.styleSheet?i.styleSheet.cssText+=e:i.appendChild(n.createTextNode(e))},loadCSS:function(e){var t=this,n=t.doc,r;return t!==u.DOM&&n===document?void u.DOM.loadCSS(e):(e||(e=""),r=n.getElementsByTagName("head")[0],void d(e.split(","),function(e){var i;t.files[e]||(t.files[e]=!0,i=t.create("link",{rel:"stylesheet",href:e}),v&&n.documentMode&&n.recalc&&(i.onload=function(){n.recalc&&n.recalc(),i.onload=null}),r.appendChild(i))}))},addClass:function(e,t){return this.run(e,function(e){var n;return t?this.hasClass(e,t)?e.className:(n=this.removeClass(e,t),e.className=n=(""!==n?n+" ":"")+t,n):0})},removeClass:function(e,t){var n=this,r;return n.run(e,function(e){var i;return n.hasClass(e,t)?(r||(r=new RegExp("(^|\\s+)"+t+"(\\s+|$)","g")),i=e.className.replace(r," "),i=m(" "!=i?i:""),e.className=i,i||(e.removeAttribute("class"),e.removeAttribute("className")),i):e.className})},hasClass:function(e,t){return e=this.get(e),e&&t?-1!==(" "+e.className+" ").indexOf(" "+t+" "):!1},toggleClass:function(e,n,r){r=r===t?!this.hasClass(e,n):r,this.hasClass(e,n)!==r&&(r?this.addClass(e,n):this.removeClass(e,n))},show:function(e){return this.setStyle(e,"display","block")},hide:function(e){return this.setStyle(e,"display","none")},isHidden:function(e){return e=this.get(e),!e||"none"==e.style.display||"none"==this.getStyle(e,"display")},uniqueId:function(e){return(e?e:"mce_")+this.counter++},setHTML:function(e,t){var n=this;return n.run(e,function(e){if(v){for(;e.firstChild;)e.removeChild(e.firstChild);try{e.innerHTML="
    "+t,e.removeChild(e.firstChild)}catch(r){var i=n.create("div");i.innerHTML="
    "+t,d(p(i.childNodes),function(t,n){n&&e.canHaveHTML&&e.appendChild(t)})}}else e.innerHTML=t;return t})},getOuterHTML:function(e){var t,n=this;return(e=n.get(e))?1===e.nodeType&&n.hasOuterHTML?e.outerHTML:(t=(e.ownerDocument||n.doc).createElement("body"),t.appendChild(e.cloneNode(!0)),t.innerHTML):null},setOuterHTML:function(e,t,n){var r=this;return r.run(e,function(e){function i(){var i,o;for(o=n.createElement("body"),o.innerHTML=t,i=o.lastChild;i;)r.insertAfter(i.cloneNode(!0),e),i=i.previousSibling;r.remove(e)}if(1==e.nodeType)if(n=n||e.ownerDocument||r.doc,v)try{1==e.nodeType&&r.hasOuterHTML?e.outerHTML=t:i()}catch(o){i()}else i()})},decode:a.decode,encode:a.encodeAllRaw,insertAfter:function(e,t){return t=this.get(t),this.run(e,function(e){var n,r;return n=t.parentNode,r=t.nextSibling,r?n.insertBefore(e,r):n.appendChild(e),e})},replace:function(e,t,n){var r=this;return r.run(t,function(t){return f(t,"array")&&(e=e.cloneNode(!0)),n&&d(p(t.childNodes),function(t){e.appendChild(t)}),t.parentNode.replaceChild(e,t)})},rename:function(e,t){var n=this,r;return e.nodeName!=t.toUpperCase()&&(r=n.create(t),d(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),n.replace(r,e,1)),r||e},findCommonAncestor:function(e,t){for(var n=e,r;n;){for(r=t;r&&n!=r;)r=r.parentNode;if(n==r)break;n=n.parentNode}return!n&&e.ownerDocument?e.ownerDocument.documentElement:n},toHex:function(e){return this.styles.toHex(l.trim(e))},run:function(e,t,n){var r=this,i;return"string"==typeof e&&(e=r.get(e)),e?(n=n||this,e.nodeType||!e.length&&0!==e.length?t.call(n,e):(i=[],d(e,function(e,o){e&&("string"==typeof e&&(e=r.get(e)),i.push(t.call(n,e,o)))}),i)):!1},getAttribs:function(e){var t;if(e=this.get(e),!e)return[];if(v){if(t=[],"OBJECT"==e.nodeName)return e.attributes;"OPTION"===e.nodeName&&this.getAttrib(e,"selected")&&t.push({specified:1,nodeName:"selected"});var n=/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;return e.cloneNode(!1).outerHTML.replace(n,"").replace(/[\w:\-]+/gi,function(e){t.push({specified:1,nodeName:e})}),t}return e.attributes},isEmpty:function(e,t){var n=this,r,o,a,s,l,c=0;if(e=e.firstChild){s=new i(e,e.parentNode),t=t||n.schema?n.schema.getNonEmptyElements():null;do{if(a=e.nodeType,1===a){if(e.getAttribute("data-mce-bogus"))continue;if(l=e.nodeName.toLowerCase(),t&&t[l]){if("br"===l){c++;continue}return!1}for(o=n.getAttribs(e),r=e.attributes.length;r--;)if(l=e.attributes[r].nodeName,"name"===l||"data-mce-bookmark"===l)return!1}if(8==a)return!1;if(3===a&&!b.test(e.nodeValue))return!1}while(e=s.next())}return 1>=c},createRng:function(){var e=this.doc;return e.createRange?e.createRange():new o(this)},nodeIndex:function(e,t){var n=0,r,i;if(e)for(r=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)i=e.nodeType,(!t||3!=i||i!=r&&e.nodeValue.length)&&(n++,r=i);return n},split:function(e,t,n){function r(e){function t(e){var t=e.previousSibling&&"SPAN"==e.previousSibling.nodeName,n=e.nextSibling&&"SPAN"==e.nextSibling.nodeName;return t&&n}var n,o=e.childNodes,a=e.nodeType;if(1!=a||"bookmark"!=e.getAttribute("data-mce-type")){for(n=o.length-1;n>=0;n--)r(o[n]);if(9!=a){if(3==a&&e.nodeValue.length>0){var s=m(e.nodeValue).length;if(!i.isBlock(e.parentNode)||s>0||0===s&&t(e))return}else if(1==a&&(o=e.childNodes,1==o.length&&o[0]&&1==o[0].nodeType&&"bookmark"==o[0].getAttribute("data-mce-type")&&e.parentNode.insertBefore(o[0],e),o.length||/^(br|hr|input|img)$/i.test(e.nodeName)))return;i.remove(e)}return e}}var i=this,o=i.createRng(),a,s,l;return e&&t?(o.setStart(e.parentNode,i.nodeIndex(e)),o.setEnd(t.parentNode,i.nodeIndex(t)),a=o.extractContents(),o=i.createRng(),o.setStart(t.parentNode,i.nodeIndex(t)+1),o.setEnd(e.parentNode,i.nodeIndex(e)+1),s=o.extractContents(),l=e.parentNode,l.insertBefore(r(a),e),n?l.replaceChild(n,t):l.insertBefore(t,e),l.insertBefore(r(s),e),i.remove(e),n||t):void 0},bind:function(e,t,n,r){var i=this;if(l.isArray(e)){for(var o=e.length;o--;)e[o]=i.bind(e[o],t,n,r);return e}return!i.settings.collect||e!==i.doc&&e!==i.win||i.boundEvents.push([e,t,n,r]),i.events.bind(e,t,n,r||i)},unbind:function(e,t,n){var r=this,i;if(l.isArray(e)){for(i=e.length;i--;)e[i]=r.unbind(e[i],t,n);return e}if(r.boundEvents&&(e===r.doc||e===r.win))for(i=r.boundEvents.length;i--;){var o=r.boundEvents[i];e!=o[0]||t&&t!=o[1]||n&&n!=o[2]||this.events.unbind(o[0],o[1],o[2])}return this.events.unbind(e,t,n)},fire:function(e,t,n){return this.events.fire(e,t,n)},getContentEditable:function(e){var t;return 1!=e.nodeType?null:(t=e.getAttribute("data-mce-contenteditable"),t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null)},destroy:function(){var t=this;if(t.boundEvents){for(var n=t.boundEvents.length;n--;){var r=t.boundEvents[n];this.events.unbind(r[0],r[1],r[2])}t.boundEvents=null}e.setDocument&&e.setDocument(),t.win=t.doc=t.root=t.events=t.frag=null},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},_findSib:function(e,t,n){var r=this,i=t;if(e)for("string"==typeof i&&(i=function(e){return r.is(e,t)}),e=e[n];e;e=e[n])if(i(e))return e;return null}},u.DOM=new u(document),u}),r(b,[y,p],function(e,t){function n(){function e(e,t){function n(){o.remove(s),a&&(a.onreadystatechange=a.onload=a=null),t() -}function i(){"undefined"!=typeof console&&console.log&&console.log("Failed to load: "+e)}var o=r,a,s;s=o.uniqueId(),a=document.createElement("script"),a.id=s,a.type="text/javascript",a.src=e,"onreadystatechange"in a?a.onreadystatechange=function(){/loaded|complete/.test(a.readyState)&&n()}:a.onload=n,a.onerror=i,(document.getElementsByTagName("head")[0]||document.body).appendChild(a)}var t=0,n=1,a=2,s={},l=[],c={},u=[],d=0,f;this.isDone=function(e){return s[e]==a},this.markDone=function(e){s[e]=a},this.add=this.load=function(e,n,r){var i=s[e];i==f&&(l.push(e),s[e]=t),n&&(c[e]||(c[e]=[]),c[e].push({func:n,scope:r||this}))},this.loadQueue=function(e,t){this.loadScripts(l,e,t)},this.loadScripts=function(t,r,l){function p(e){i(c[e],function(e){e.func.call(e.scope)}),c[e]=f}var m;u.push({func:r,scope:l||this}),(m=function(){var r=o(t);t.length=0,i(r,function(t){return s[t]==a?void p(t):void(s[t]!=n&&(s[t]=n,d++,e(t,function(){s[t]=a,d--,p(t),m()})))}),d||(i(u,function(e){e.func.call(e.scope)}),u.length=0)})()}}var r=e.DOM,i=t.each,o=t.grep;return n.ScriptLoader=new n,n}),r(C,[b,p],function(e,n){function r(){var e=this;e.items=[],e.urls={},e.lookup={}}var i=n.each;return r.prototype={get:function(e){return this.lookup[e]?this.lookup[e].instance:t},dependencies:function(e){var t;return this.lookup[e]&&(t=this.lookup[e].dependencies),t||[]},requireLangPack:function(t,n){if(r.language&&r.languageLoad!==!1){if(n&&new RegExp("([, ]|\\b)"+r.language+"([, ]|\\b)").test(n)===!1)return;e.ScriptLoader.add(this.urls[t]+"/langs/"+r.language+".js")}},add:function(e,t,n){return this.items.push(t),this.lookup[e]={instance:t,dependencies:n},t},createUrl:function(e,t){return"object"==typeof t?t:{prefix:e.prefix,resource:t,suffix:e.suffix}},addComponents:function(t,n){var r=this.urls[t];i(n,function(t){e.ScriptLoader.add(r+"/"+t)})},load:function(n,o,a,s){function l(){var r=c.dependencies(n);i(r,function(e){var n=c.createUrl(o,e);c.load(n.resource,n,t,t)}),a&&a.call(s?s:e)}var c=this,u=o;c.urls[n]||("object"==typeof o&&(u=o.prefix+o.resource+o.suffix),0!==u.indexOf("/")&&-1==u.indexOf("://")&&(u=r.baseURL+"/"+u),c.urls[n]=u.substring(0,u.lastIndexOf("/")),c.lookup[n]?l():e.ScriptLoader.add(u,l,s))}},r.PluginManager=new r,r.ThemeManager=new r,r}),r(x,[],function(){function e(e,t,n){var r,i,o=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[o])return e[o];if(e!==t){if(r=e[a])return r;for(i=e.parent;i&&i!==t;i=i.parent)if(r=i[a])return r}}function t(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}var n=/^[ \t\r\n]*$/,r={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};return t.prototype={replace:function(e){var t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t},attr:function(e,t){var n=this,r,i,o;if("string"!=typeof e){for(i in e)n.attr(i,e[i]);return n}if(r=n.attributes){if(t!==o){if(null===t){if(e in r.map)for(delete r.map[e],i=r.length;i--;)if(r[i].name===e)return r=r.splice(i,1),n;return n}if(e in r.map){for(i=r.length;i--;)if(r[i].name===e){r[i].value=t;break}}else r.push({name:e,value:t});return r.map[e]=t,n}return r.map[e]}},clone:function(){var e=this,n=new t(e.name,e.type),r,i,o,a,s;if(o=e.attributes){for(s=[],s.map={},r=0,i=o.length;i>r;r++)a=o[r],"id"!==a.name&&(s[s.length]={name:a.name,value:a.value},s.map[a.name]=a.value);n.attributes=s}return n.value=e.value,n.shortEnded=e.shortEnded,n},wrap:function(e){var t=this;return t.parent.insert(e,t),e.append(t),t},unwrap:function(){var e=this,t,n;for(t=e.firstChild;t;)n=t.next,e.insert(t,e,!0),t=n;e.remove()},remove:function(){var e=this,t=e.parent,n=e.next,r=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):r.next=n,t.lastChild===e?(t.lastChild=r,r&&(r.next=null)):n.prev=r,e.parent=e.next=e.prev=null),e},append:function(e){var t=this,n;return e.parent&&e.remove(),n=t.lastChild,n?(n.next=e,e.prev=n,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e},insert:function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},getAll:function(t){var n=this,r,i=[];for(r=n.firstChild;r;r=e(r,n))r.name===t&&i.push(r);return i},empty:function(){var t=this,n,r,i;if(t.firstChild){for(n=[],i=t.firstChild;i;i=e(i,t))n.push(i);for(r=n.length;r--;)i=n[r],i.parent=i.firstChild=i.lastChild=i.next=i.prev=null}return t.firstChild=t.lastChild=null,t},isEmpty:function(t){var r=this,i=r.firstChild,o,a;if(i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(t[i.name])return!1;for(o=i.attributes.length;o--;)if(a=i.attributes[o].name,"name"===a||0===a.indexOf("data-mce-"))return!1}if(8===i.type)return!1;if(3===i.type&&!n.test(i.value))return!1}while(i=e(i,r));return!0},walk:function(t){return e(this,null,t)}},t.create=function(e,n){var i,o;if(i=new t(e,r[e]||1),n)for(o in n)i.attr(o,n[o]);return i},t}),r(w,[p],function(e){function t(e,t){return e?e.split(t||" "):[]}function n(e){function n(e,n,r){function i(e){var t={},n,r;for(n=0,r=e.length;r>n;n++)t[e[n]]={};return t}var o,l,c,u=arguments;for(r=r||[],n=n||"","string"==typeof r&&(r=t(r)),l=3;lo;o++)i.attributes[n[o]]={},i.attributesOrder.push(n[o])}var a={},s,l,c,u,d,f;return r[e]?r[e]:(s=t("id accesskey class dir lang style tabindex title"),l=t("address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"),c=t("a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment"),"html4"!=e&&(s.push.apply(s,t("contenteditable contextmenu draggable dropzone hidden spellcheck translate")),l.push.apply(l,t("article aside details dialog figure header footer hgroup section nav")),c.push.apply(c,t("audio canvas command datalist mark meter output progress time wbr video ruby bdi keygen"))),"html5-strict"!=e&&(s.push("xml:lang"),f=t("acronym applet basefont big font strike tt"),c.push.apply(c,f),o(f,function(e){n(e,"",c)}),d=t("center dir isindex noframes"),l.push.apply(l,d),u=[].concat(l,c),o(d,function(e){n(e,"",u)})),u=u||[].concat(l,c),n("html","manifest","head body"),n("head","","base command link meta noscript script style title"),n("title hr noscript br"),n("base","href target"),n("link","href rel media hreflang type sizes hreflang"),n("meta","name http-equiv content charset"),n("style","media type scoped"),n("script","src async defer type charset"),n("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",u),n("address dt dd div caption","",u),n("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","",c),n("blockquote","cite",u),n("ol","reversed start type","li"),n("ul","","li"),n("li","value",u),n("dl","","dt dd"),n("a","href target rel media hreflang type",c),n("q","cite",c),n("ins del","cite datetime",u),n("img","src alt usemap ismap width height"),n("iframe","src name width height",u),n("embed","src type width height"),n("object","data type typemustmatch name usemap form width height",u,"param"),n("param","name value"),n("map","name",u,"area"),n("area","alt coords shape href target rel media hreflang type"),n("table","border","caption colgroup thead tfoot tbody tr"+("html4"==e?" col":"")),n("colgroup","span","col"),n("col","span"),n("tbody thead tfoot","","tr"),n("tr","","td th"),n("td","colspan rowspan headers",u),n("th","colspan rowspan headers scope abbr",u),n("form","accept-charset action autocomplete enctype method name novalidate target",u),n("fieldset","disabled form name",u,"legend"),n("label","form for",c),n("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),n("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"==e?u:c),n("select","disabled form multiple name required size","option optgroup"),n("optgroup","disabled label","option"),n("option","disabled label selected value"),n("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),n("menu","type label",u,"li"),n("noscript","",u),"html4"!=e&&(n("wbr"),n("ruby","",c,"rt rp"),n("figcaption","",u),n("mark rt rp summary bdi","",c),n("canvas","width height",u),n("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height",u,"track source"),n("audio","src crossorigin preload autoplay mediagroup loop muted controls",u,"track source"),n("source","src type media"),n("track","kind src srclang label default"),n("datalist","",c,"option"),n("article section nav aside header footer","",u),n("hgroup","","h1 h2 h3 h4 h5 h6"),n("figure","",u,"figcaption"),n("time","datetime",c),n("dialog","open",u),n("command","type label icon disabled checked radiogroup command"),n("output","for form name",c),n("progress","value max",c),n("meter","value min max low high optimum",c),n("details","open",u,"summary"),n("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!=e&&(i("script","language xml:space"),i("style","xml:space"),i("object","declare classid codebase codetype archive standby align border hspace vspace"),i("param","valuetype type"),i("a","charset name rev shape coords"),i("br","clear"),i("applet","codebase archive code object alt name width height align hspace vspace"),i("img","name longdesc align border hspace vspace"),i("iframe","longdesc frameborder marginwidth marginheight scrolling align"),i("font basefont","size color face"),i("input","usemap align"),i("select","onchange"),i("textarea"),i("h1 h2 h3 h4 h5 h6 div p legend caption","align"),i("ul","type compact"),i("li","type"),i("ol dl menu dir","compact"),i("pre","width xml:space"),i("hr","align noshade size width"),i("isindex","prompt"),i("table","summary width frame rules cellspacing cellpadding align bgcolor"),i("col","width align char charoff valign"),i("colgroup","width align char charoff valign"),i("thead","align char charoff valign"),i("tr","align char charoff valign bgcolor"),i("th","axis align char charoff valign nowrap bgcolor width height"),i("form","accept"),i("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),i("tfoot","align char charoff valign"),i("tbody","align char charoff valign"),i("area","nohref"),i("body","background bgcolor text link vlink alink")),"html4"!=e&&(i("input button select textarea","autofocus"),i("input textarea","placeholder"),i("a","download"),i("link script img","crossorigin"),i("iframe","srcdoc sandbox seamless allowfullscreen")),o(t("a form meter progress dfn"),function(e){a[e]&&delete a[e].children[e]}),delete a.caption.children.table,r[e]=a,a)}var r={},i=e.makeMap,o=e.each,a=e.extend,s=e.explode,l=e.inArray;return function(e){function c(t,n,o){var s=e[t];return s?s=i(s,",",i(s.toUpperCase()," ")):(s=r[t],s||(s=i(n," ",i(n.toUpperCase()," ")),s=a(s,o),r[t]=s)),s}function u(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")}function d(e){var n,r,o,a,s,c,d,f,p,m,h,g,y,C,x,w,_,N,E,S=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,k=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,T=/[*?+]/;if(e)for(e=t(e,","),v["@"]&&(w=v["@"].attributes,_=v["@"].attributesOrder),n=0,r=e.length;r>n;n++)if(s=S.exec(e[n])){if(C=s[1],p=s[2],x=s[3],f=s[5],g={},y=[],c={attributes:g,attributesOrder:y},"#"===C&&(c.paddEmpty=!0),"-"===C&&(c.removeEmpty=!0),"!"===s[4]&&(c.removeEmptyAttrs=!0),w){for(N in w)g[N]=w[N];y.push.apply(y,_)}if(f)for(f=t(f,"|"),o=0,a=f.length;a>o;o++)if(s=k.exec(f[o])){if(d={},h=s[1],m=s[2].replace(/::/g,":"),C=s[3],E=s[4],"!"===h&&(c.attributesRequired=c.attributesRequired||[],c.attributesRequired.push(m),d.required=!0),"-"===h){delete g[m],y.splice(l(y,m),1);continue}C&&("="===C&&(c.attributesDefault=c.attributesDefault||[],c.attributesDefault.push({name:m,value:E}),d.defaultValue=E),":"===C&&(c.attributesForced=c.attributesForced||[],c.attributesForced.push({name:m,value:E}),d.forcedValue=E),"<"===C&&(d.validValues=i(E,"?"))),T.test(m)?(c.attributePatterns=c.attributePatterns||[],d.pattern=u(m),c.attributePatterns.push(d)):(g[m]||y.push(m),g[m]=d)}w||"@"!=p||(w=g,_=y),x&&(c.outputName=p,v[x]=c),T.test(p)?(c.pattern=u(p),b.push(c)):v[p]=c}}function f(e){v={},b=[],d(e),o(x,function(e,t){y[t]=e.children})}function p(e){var n=/^(~)?(.+)$/;e&&(r.text_block_elements=r.block_elements=null,o(t(e,","),function(e){var t=n.exec(e),r="~"===t[1],i=r?"span":"div",s=t[2];if(y[s]=y[i],R[s]=i,r||(S[s.toUpperCase()]={},S[s]={}),!v[s]){var l=v[i];l=a({},l),delete l.removeEmptyAttrs,delete l.removeEmpty,v[s]=l}o(y,function(e,t){e[i]&&(y[t]=e=a({},y[t]),e[s]=e[i])})}))}function m(e){var n=/^([+\-]?)(\w+)\[([^\]]+)\]$/;e&&o(t(e,","),function(e){var r=n.exec(e),i,s;r&&(s=r[1],i=s?y[r[2]]:y[r[2]]={"#comment":{}},i=y[r[2]],o(t(r[3],"|"),function(e){"-"===s?(y[r[2]]=i=a({},y[r[2]]),delete i[e]):i[e]={}}))})}function h(e){var t=v[e],n;if(t)return t;for(n=b.length;n--;)if(t=b[n],t.pattern.test(e))return t}var g=this,v={},y={},b=[],C,x,w,_,N,E,S,k,T,R={},A={};e=e||{},x=n(e.schema),e.verify_html===!1&&(e.valid_elements="*[*]"),e.valid_styles&&(C={},o(e.valid_styles,function(e,t){C[t]=s(e)})),w=c("whitespace_elements","pre script noscript style textarea video audio iframe object"),_=c("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),N=c("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),E=c("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),k=c("non_empty_elements","td th iframe video audio object script",N),T=c("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),S=c("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup",T),o((e.special||"script noscript style textarea").split(" "),function(e){A[e]=new RegExp("]*>","gi")}),e.valid_elements?f(e.valid_elements):(o(x,function(e,t){v[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},y[t]=e.children}),"html5"!=e.schema&&o(t("strong/b em/i"),function(e){e=t(e,"/"),v[e[1]].outputName=e[0]}),v.img.attributesDefault=[{name:"alt",value:""}],o(t("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){v[e]&&(v[e].removeEmpty=!0)}),o(t("p h1 h2 h3 h4 h5 h6 th td pre div address caption"),function(e){v[e].paddEmpty=!0}),o(t("span"),function(e){v[e].removeEmptyAttrs=!0})),p(e.custom_elements),m(e.valid_children),d(e.extended_valid_elements),m("+ol[ul|ol],+ul[ul|ol]"),e.invalid_elements&&o(s(e.invalid_elements),function(e){v[e]&&delete v[e]}),h("span")||d("span[!data-mce-type|*]"),g.children=y,g.styles=C,g.getBoolAttrs=function(){return E},g.getBlockElements=function(){return S},g.getTextBlockElements=function(){return T},g.getShortEndedElements=function(){return N},g.getSelfClosingElements=function(){return _},g.getNonEmptyElements=function(){return k},g.getWhiteSpaceElements=function(){return w},g.getSpecialElements=function(){return A},g.isValidChild=function(e,t){var n=y[e];return!(!n||!n[t])},g.isValid=function(e,t){var n,r,i=h(e);if(i){if(!t)return!0;if(i.attributes[t])return!0;if(n=i.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},g.getElementRule=h,g.getCustomElements=function(){return R},g.addValidElements=d,g.setValidElements=f,g.addCustomElements=p,g.addValidChildren=m,g.elements=v}}),r(_,[w,h,p],function(e,t,n){var r=n.each;return function(i,o){function a(){}var s=this;i=i||{},s.schema=o=o||new e,i.fix_self_closing!==!1&&(i.fix_self_closing=!0),r("comment cdata text start end pi doctype".split(" "),function(e){e&&(s[e]=i[e]||a)}),s.parse=function(e){function r(e){var t,n;for(t=f.length;t--&&f[t].name!==e;);if(t>=0){for(n=f.length-1;n>=t;n--)e=f[n],e.valid&&s.end(e.name);f.length=t}}function a(e,t,n,r,o){var a,s,l=/[\s\u0000-\u001F]+/g;if(t=t.toLowerCase(),n=t in C?t:F(n||r||o||""),w&&!v&&0!==t.indexOf("data-")){if(a=k[t],!a&&T){for(s=T.length;s--&&(a=T[s],!a.pattern.test(t)););-1===s&&(a=null)}if(!a)return;if(a.validValues&&!(n in a.validValues))return}if(W[t]&&!i.allow_script_urls){var c=n.replace(l,"");try{if(c=decodeURIComponent(c),V.test(c))return}catch(u){if(c=unescape(c),V.test(c))return}}p.map[t]=n,p.push({name:t,value:n})}var s=this,l,c=0,u,d,f=[],p,m,h,g,v,y,b,C,x,w,_,N,E,S,k,T,R,A,B,L,D,M,H,P,O,I=0,F=t.decode,z,W=n.makeMap("src,href"),V=/(java|vb)script:/i;for(M=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),H=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,b=o.getShortEndedElements(),D=i.self_closing_elements||o.getSelfClosingElements(),C=o.getBoolAttrs(),w=i.validate,y=i.remove_internals,z=i.fix_self_closing,P=o.getSpecialElements();l=M.exec(e);){if(c0&&f[f.length-1].name===u&&r(u),!w||(_=o.getElementRule(u))){if(N=!0,w&&(k=_.attributes,T=_.attributePatterns),(S=l[8])?(v=-1!==S.indexOf("data-mce-type"),v&&y&&(N=!1),p=[],p.map={},S.replace(H,a)):(p=[],p.map={}),w&&!v){if(R=_.attributesRequired,A=_.attributesDefault,B=_.attributesForced,L=_.removeEmptyAttrs,L&&!p.length&&(N=!1),B)for(m=B.length;m--;)E=B[m],g=E.name,O=E.value,"{$uid}"===O&&(O="mce_"+I++),p.map[g]=O,p.push({name:g,value:O});if(A)for(m=A.length;m--;)E=A[m],g=E.name,g in p.map||(O=E.value,"{$uid}"===O&&(O="mce_"+I++),p.map[g]=O,p.push({name:g,value:O}));if(R){for(m=R.length;m--&&!(R[m]in p.map););-1===m&&(N=!1)}p.map["data-mce-bogus"]&&(N=!1)}N&&s.start(u,p,x)}else N=!1;if(d=P[u]){d.lastIndex=c=l.index+l[0].length,(l=d.exec(e))?(N&&(h=e.substr(c,l.index-c)),c=l.index+l[0].length):(h=e.substr(c),c=e.length),N&&(h.length>0&&s.text(h,!0),s.end(u)),M.lastIndex=c;continue}x||(S&&S.indexOf("/")==S.length-1?N&&s.end(u):f.push({name:u,valid:N}))}else(u=l[1])?(">"===u.charAt(0)&&(u=" "+u),i.allow_conditional_comments||"[if"!==u.substr(0,3)||(u=" "+u),s.comment(u)):(u=l[2])?s.cdata(u):(u=l[3])?s.doctype(u):(u=l[4])&&s.pi(u,l[5]);c=l.index+l[0].length}for(c=0;m--)u=f[m],u.valid&&s.end(u.name)}}}),r(N,[x,w,_,p],function(e,t,n,r){var i=r.makeMap,o=r.each,a=r.explode,s=r.extend;return function(r,l){function c(t){var n,r,o,a,s,c,d,f,p,m,h,g,v,y;for(h=i("tr,td,th,tbody,thead,tfoot,table"),m=l.getNonEmptyElements(),g=l.getTextBlockElements(),n=0;n1){for(a.reverse(),s=c=u.filterNode(a[0].clone()),p=0;p0?(t.value=n,t=t.prev):(r=t.prev,t.remove(),t=r)}function g(e){var t,n={};for(t in e)"li"!==t&&"p"!=t&&(n[t]=e[t]);return n}var v,y,b,C,x,w,_,N,E,S,k,T,R,A=[],B,L,D,M,H,P,O,I;if(o=o||{},p={},m={},T=s(i("script,style,head,html,body,title,meta,param"),l.getBlockElements()),O=l.getNonEmptyElements(),P=l.children,k=r.validate,I="forced_root_block"in o?o.forced_root_block:r.forced_root_block,H=l.getWhiteSpaceElements(),R=/^[ \t\r\n]+/,L=/[ \t\r\n]+$/,D=/[ \t\r\n]+/g,M=/^[ \t\r\n]+$/,v=new n({validate:k,allow_script_urls:r.allow_script_urls,allow_conditional_comments:r.allow_conditional_comments,self_closing_elements:g(l.getSelfClosingElements()),cdata:function(e){b.append(u("#cdata",4)).value=e},text:function(e,t){var n;B||(e=e.replace(D," "),b.lastChild&&T[b.lastChild.name]&&(e=e.replace(R,""))),0!==e.length&&(n=u("#text",3),n.raw=!!t,b.append(n).value=e)},comment:function(e){b.append(u("#comment",8)).value=e},pi:function(e,t){b.append(u(e,7)).value=t,h(b)},doctype:function(e){var t;t=b.append(u("#doctype",10)),t.value=e,h(b)},start:function(e,t,n){var r,i,o,a,s;if(o=k?l.getElementRule(e):{}){for(r=u(o.outputName||e,1),r.attributes=t,r.shortEnded=n,b.append(r),s=P[b.name],s&&P[r.name]&&!s[r.name]&&A.push(r),i=f.length;i--;)a=f[i].name,a in t.map&&(E=m[a],E?E.push(r):m[a]=[r]);T[e]&&h(r),n||(b=r),!B&&H[e]&&(B=!0)}},end:function(t){var n,r,i,o,a;if(r=k?l.getElementRule(t):{}){if(T[t]&&!B){if(n=b.firstChild,n&&3===n.type)if(i=n.value.replace(R,""),i.length>0)n.value=i,n=n.next;else for(o=n.next,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.next,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o;if(n=b.lastChild,n&&3===n.type)if(i=n.value.replace(L,""),i.length>0)n.value=i,n=n.prev;else for(o=n.prev,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.prev,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o}if(B&&H[t]&&(B=!1),(r.removeEmpty||r.paddEmpty)&&b.isEmpty(O))if(r.paddEmpty)b.empty().append(new e("#text","3")).value="\xa0";else if(!b.attributes.map.name&&!b.attributes.map.id)return a=b.parent,b.empty().remove(),void(b=a);b=b.parent}}},l),y=b=new e(o.context||r.root_name,11),v.parse(t),k&&A.length&&(o.context?o.invalid=!0:c(A)),I&&("body"==y.name||o.isRootContent)&&a(),!o.invalid){for(S in p){for(E=d[S],C=p[S],_=C.length;_--;)C[_].parent||C.splice(_,1);for(x=0,w=E.length;w>x;x++)E[x](C,S,o)}for(x=0,w=f.length;w>x;x++)if(E=f[x],E.name in m){for(C=m[E.name],_=C.length;_--;)C[_].parent||C.splice(_,1);for(_=0,N=E.callbacks.length;N>_;_++)E.callbacks[_](C,E.name,o)}}return y},r.remove_trailing_brs&&u.addNodeFilter("br",function(t){var n,r=t.length,i,o=s({},l.getBlockElements()),a=l.getNonEmptyElements(),c,u,d,f,p,m;for(o.body=1,n=0;r>n;n++)if(i=t[n],c=i.parent,o[i.parent.name]&&i===c.lastChild){for(d=i.prev;d;){if(f=d.name,"span"!==f||"bookmark"!==d.attr("data-mce-type")){if("br"!==f)break;if("br"===f){i=null;break}}d=d.prev}i&&(i.remove(),c.isEmpty(a)&&(p=l.getElementRule(c.name),p&&(p.removeEmpty?c.remove():p.paddEmpty&&(c.empty().append(new e("#text",3)).value="\xa0"))))}else{for(u=i;c&&c.firstChild===u&&c.lastChild===u&&(u=c,!o[c.name]);)c=c.parent;u===c&&(m=new e("#text",3),m.value="\xa0",i.replace(m))}}),r.allow_html_in_named_anchor||u.addAttributeFilter("id,name",function(e){for(var t=e.length,n,r,i,o;t--;)if(o=e[t],"a"===o.name&&o.firstChild&&!o.attr("href")){i=o.parent,n=o.lastChild;do r=n.prev,i.insert(n,o),n=r;while(n)}})}}),r(E,[h,p],function(e,t){var n=t.makeMap;return function(t){var r=[],i,o,a,s,l;return t=t||{},i=t.indent,o=n(t.indent_before||""),a=n(t.indent_after||""),s=e.getEncodeFunc(t.entity_encoding||"raw",t.entities),l="html"==t.element_format,{start:function(e,t,n){var c,u,d,f;if(i&&o[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n")),r.push("<",e),t)for(c=0,u=t.length;u>c;c++)d=t[c],r.push(" ",d.name,'="',s(d.value,!0),'"');r[r.length]=!n||l?">":" />",n&&i&&a[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n"))},end:function(e){var t;r.push(""),i&&a[e]&&r.length>0&&(t=r[r.length-1],t.length>0&&"\n"!==t&&r.push("\n"))},text:function(e,t){e.length>0&&(r[r.length]=t?e:s(e))},cdata:function(e){r.push("")},comment:function(e){r.push("")},pi:function(e,t){t?r.push(""):r.push(""),i&&r.push("\n")},doctype:function(e){r.push("",i?"\n":"")},reset:function(){r.length=0},getContent:function(){return r.join("").replace(/\n$/,"")}}}}),r(S,[E,w],function(e,t){return function(n,r){var i=this,o=new e(n);n=n||{},n.validate="validate"in n?n.validate:!0,i.schema=r=r||new t,i.writer=o,i.serialize=function(e){function t(e){var n=i[e.type],s,l,c,u,d,f,p,m,h;if(n)n(e);else{if(s=e.name,l=e.shortEnded,c=e.attributes,a&&c&&c.length>1){for(f=[],f.map={},h=r.getElementRule(e.name),p=0,m=h.attributesOrder.length;m>p;p++)u=h.attributesOrder[p],u in c.map&&(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));for(p=0,m=c.length;m>p;p++)u=c[p].name,u in f.map||(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));c=f}if(o.start(e.name,c,l),!l){if(e=e.firstChild)do t(e);while(e=e.next);o.end(s)}}}var i,a;return a=n.validate,i={3:function(e){o.text(e.value,e.raw)},8:function(e){o.comment(e.value)},7:function(e){o.pi(e.name,e.value)},10:function(e){o.doctype(e.value)},4:function(e){o.cdata(e.value)},11:function(e){if(e=e.firstChild)do t(e);while(e=e.next)}},o.reset(),1!=e.type||n.inner?i[11](e):t(e),o.getContent()}}}),r(k,[y,N,h,S,x,w,g,p],function(e,t,n,r,i,o,a,s){var l=s.each,c=s.trim,u=e.DOM;return function(e,i){var s,d,f;return i&&(s=i.dom,d=i.schema),s=s||u,d=d||new o(e),e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs="remove_trailing_brs"in e?e.remove_trailing_brs:!0,f=new t(e,d),f.addAttributeFilter("src,href,style",function(t,n){for(var r=t.length,i,o,a="data-mce-"+n,l=e.url_converter,c=e.url_converter_scope,u;r--;)i=t[r],o=i.attributes.map[a],o!==u?(i.attr(n,o.length>0?o:null),i.attr(a,null)):(o=i.attributes.map[n],"style"===n?o=s.serializeStyle(s.parseStyle(o),i.name):l&&(o=l.call(c,o,n,i.name)),i.attr(n,o.length>0?o:null))}),f.addAttributeFilter("class",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null)}),f.addAttributeFilter("data-mce-type",function(e,t,n){for(var r=e.length,i;r--;)i=e[r],"bookmark"!==i.attributes.map["data-mce-type"]||n.cleanup||i.remove()}),f.addAttributeFilter("data-mce-expando",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),f.addNodeFilter("noscript",function(e){for(var t=e.length,r;t--;)r=e[t].firstChild,r&&(r.value=n.decode(r.value))}),f.addNodeFilter("script,style",function(e,t){function n(e){return e.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}for(var r=e.length,i,o;r--;)if(i=e[r],o=i.firstChild?i.firstChild.value:"","script"===t){var a=(i.attr("type")||"text/javascript").replace(/^mce\-/,"");i.attr("type","text/javascript"===a?null:a),o.length>0&&(i.firstChild.value="// ")}else o.length>0&&(i.firstChild.value="")}),f.addNodeFilter("#comment",function(e){for(var t=e.length,n;t--;)n=e[t],0===n.value.indexOf("[CDATA[")?(n.name="#cdata",n.type=4,n.value=n.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===n.value.indexOf("mce:protected ")&&(n.name="#text",n.type=3,n.raw=!0,n.value=unescape(n.value).substr(14))}),f.addNodeFilter("xml:namespace,input",function(e,t){for(var n=e.length,r;n--;)r=e[n],7===r.type?r.remove():1===r.type&&("input"!==t||"type"in r.attributes.map||r.attr("type","text"))}),e.fix_list_elements&&f.addNodeFilter("ul,ol",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.parent,("ul"===r.name||"ol"===r.name)&&n.prev&&"li"===n.prev.name&&n.prev.append(n)}),f.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),{schema:d,addNodeFilter:f.addNodeFilter,addAttributeFilter:f.addAttributeFilter,serialize:function(t,n){var i=this,o,u,p,m,h;return a.ie&&s.select("script,style,select,map").length>0?(h=t.innerHTML,t=t.cloneNode(!1),s.setHTML(t,h)):t=t.cloneNode(!0),o=t.ownerDocument.implementation,o.createHTMLDocument&&(u=o.createHTMLDocument(""),l("BODY"==t.nodeName?t.childNodes:[t],function(e){u.body.appendChild(u.importNode(e,!0))}),t="BODY"!=t.nodeName?u.body.firstChild:u.body,p=s.doc,s.doc=u),n=n||{},n.format=n.format||"html",n.selection&&(n.forced_root_block=""),n.no_events||(n.node=t,i.onPreProcess(n)),m=new r(e,d),n.content=m.serialize(f.parse(c(n.getInner?t.innerHTML:s.getOuterHTML(t)),n)),n.cleanup||(n.content=n.content.replace(/\uFEFF/g,"")),n.no_events||i.onPostProcess(n),p&&(s.doc=p),n.node=null,n.content},addRules:function(e){d.addValidElements(e)},setRules:function(e){d.setValidElements(e)},onPreProcess:function(e){i&&i.fire("PreProcess",e)},onPostProcess:function(e){i&&i.fire("PostProcess",e)}}}}),r(T,[],function(){function e(e){function t(t,n){var r,i=0,o,a,s,l,c,u,d=-1,f;if(r=t.duplicate(),r.collapse(n),f=r.parentElement(),f.ownerDocument===e.dom.doc){for(;"false"===f.contentEditable;)f=f.parentNode;if(!f.hasChildNodes())return{node:f,inside:1};for(s=f.children,o=s.length-1;o>=i;)if(u=Math.floor((i+o)/2),l=s[u],r.moveToElementText(l),d=r.compareEndPoints(n?"StartToStart":"EndToEnd",t),d>0)o=u-1;else{if(!(0>d))return{node:l};i=u+1}if(0>d)for(l?r.collapse(!1):(r.moveToElementText(f),r.collapse(!0),l=f,a=!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",1)&&f==r.parentElement();)c++;else for(r.collapse(!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",-1)&&f==r.parentElement();)c++;return{node:l,position:d,offset:c,inside:a}}}function n(){function n(e){var n=t(o,e),r,i,s=0,l,c,u;if(r=n.node,i=n.offset,n.inside&&!r.hasChildNodes())return void a[e?"setStart":"setEnd"](r,0);if(i===c)return void a[e?"setStartBefore":"setEndAfter"](r);if(n.position<0){if(l=n.inside?r.firstChild:r.nextSibling,!l)return void a[e?"setStartAfter":"setEndAfter"](r);if(!i)return void(3==l.nodeType?a[e?"setStart":"setEnd"](l,0):a[e?"setStartBefore":"setEndBefore"](l)); -for(;l;){if(u=l.nodeValue,s+=u.length,s>=i){r=l,s-=i,s=u.length-s;break}l=l.nextSibling}}else{if(l=r.previousSibling,!l)return a[e?"setStartBefore":"setEndBefore"](r);if(!i)return void(3==r.nodeType?a[e?"setStart":"setEnd"](l,r.nodeValue.length):a[e?"setStartAfter":"setEndAfter"](l));for(;l;){if(s+=l.nodeValue.length,s>=i){r=l,s-=i;break}l=l.previousSibling}}a[e?"setStart":"setEnd"](r,s)}var o=e.getRng(),a=i.createRng(),s,l,c,u,d;if(s=o.item?o.item(0):o.parentElement(),s.ownerDocument!=i.doc)return a;if(l=e.isCollapsed(),o.item)return a.setStart(s.parentNode,i.nodeIndex(s)),a.setEnd(a.startContainer,a.startOffset+1),a;try{n(!0),l||n()}catch(f){if(-2147024809!=f.number)throw f;d=r.getBookmark(2),c=o.duplicate(),c.collapse(!0),s=c.parentElement(),l||(c=o.duplicate(),c.collapse(!1),u=c.parentElement(),u.innerHTML=u.innerHTML),s.innerHTML=s.innerHTML,r.moveToBookmark(d),o=e.getRng(),n(!0),l||n()}return a}var r=this,i=e.dom,o=!1;this.getBookmark=function(n){function r(e){var t,n,r,o,a=[];for(t=e.parentNode,n=i.getRoot().parentNode;t!=n&&9!==t.nodeType;){for(r=t.children,o=r.length;o--;)if(e===r[o]){a.push(o);break}e=t,t=t.parentNode}return a}function o(e){var n;return n=t(a,e),n?{position:n.position,offset:n.offset,indexes:r(n.node),inside:n.inside}:void 0}var a=e.getRng(),s={};return 2===n&&(a.item?s.start={ctrl:!0,indexes:r(a.item(0))}:(s.start=o(!0),e.isCollapsed()||(s.end=o()))),s},this.moveToBookmark=function(e){function t(e){var t,n,r,o;for(t=i.getRoot(),n=e.length-1;n>=0;n--)o=t.children,r=e[n],r<=o.length-1&&(t=o[r]);return t}function n(n){var i=e[n?"start":"end"],a,s,l,c;i&&(a=i.position>0,s=o.createTextRange(),s.moveToElementText(t(i.indexes)),c=i.offset,c!==l?(s.collapse(i.inside||a),s.moveStart("character",a?-c:c)):s.collapse(n),r.setEndPoint(n?"StartToStart":"EndToStart",s),n&&r.collapse(!0))}var r,o=i.doc.body;e.start&&(e.start.ctrl?(r=o.createControlRange(),r.addElement(t(e.start.indexes)),r.select()):(r=o.createTextRange(),n(!0),n(),r.select()))},this.addRange=function(t){function n(e){var t,n,a,d,m;a=i.create("a"),t=e?s:c,n=e?l:u,d=r.duplicate(),(t==f||t==f.documentElement)&&(t=p,n=0),3==t.nodeType?(t.parentNode.insertBefore(a,t),d.moveToElementText(a),d.moveStart("character",n),i.remove(a),r.setEndPoint(e?"StartToStart":"EndToEnd",d)):(m=t.childNodes,m.length?(n>=m.length?i.insertAfter(a,m[m.length-1]):t.insertBefore(a,m[n]),d.moveToElementText(a)):t.canHaveHTML&&(t.innerHTML="",a=t.firstChild,d.moveToElementText(a),d.collapse(o)),r.setEndPoint(e?"StartToStart":"EndToEnd",d),i.remove(a))}var r,a,s,l,c,u,d,f=e.dom.doc,p=f.body,m,h;if(s=t.startContainer,l=t.startOffset,c=t.endContainer,u=t.endOffset,r=p.createTextRange(),s==c&&1==s.nodeType){if(l==u&&!s.hasChildNodes()){if(s.canHaveHTML)return d=s.previousSibling,d&&!d.hasChildNodes()&&i.isBlock(d)?d.innerHTML="":d=null,s.innerHTML="",r.moveToElementText(s.lastChild),r.select(),i.doc.selection.clear(),s.innerHTML="",void(d&&(d.innerHTML=""));l=i.nodeIndex(s),s=s.parentNode}if(l==u-1)try{if(h=s.childNodes[l],a=p.createControlRange(),a.addElement(h),a.select(),m=e.getRng(),m.item&&h===m.item(0))return}catch(g){}}n(!0),n(),r.select()},this.getRangeAt=n}return e}),r(R,[g],function(e){return{BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey},metaKeyPressed:function(t){return(e.mac?t.metaKey:t.ctrlKey)&&!t.altKey}}}),r(A,[R,p,g],function(e,t,n){return function(r,i){function o(e){var t=i.settings.object_resizing;return t===!1||n.iOS?!1:("string"!=typeof t&&(t="table,img,div"),"false"===e.getAttribute("data-mce-resize")?!1:i.dom.is(e,t))}function a(t){var n,r;n=t.screenX-k,r=t.screenY-T,H=n*E[2]+B,P=r*E[3]+L,H=5>H?5:H,P=5>P?5:P,(e.modifierPressed(t)||"IMG"==w.nodeName&&E[2]*E[3]!==0)&&(H=Math.round(P/D),P=Math.round(H*D)),C.setStyles(_,{width:H,height:P}),E[2]<0&&_.clientWidth<=H&&C.setStyle(_,"left",R+(B-H)),E[3]<0&&_.clientHeight<=P&&C.setStyle(_,"top",A+(L-P)),M||(i.fire("ObjectResizeStart",{target:w,width:B,height:L}),M=!0)}function s(){function e(e,t){t&&(w.style[e]||!i.schema.isValid(w.nodeName.toLowerCase(),e)?C.setStyle(w,e,t):C.setAttrib(w,e,t))}M=!1,e("width",H),e("height",P),C.unbind(O,"mousemove",a),C.unbind(O,"mouseup",s),I!=O&&(C.unbind(I,"mousemove",a),C.unbind(I,"mouseup",s)),C.remove(_),F&&"TABLE"!=w.nodeName||l(w),i.fire("ObjectResized",{target:w,width:H,height:P}),i.nodeChanged()}function l(e,t,r){var l,u,d,f,p,m=i.getBody();g(),l=C.getPos(e,m),R=l.x,A=l.y,p=e.getBoundingClientRect(),u=p.width||p.right-p.left,d=p.height||p.bottom-p.top,w!=e&&(h(),w=e,H=P=0),f=i.fire("ObjectSelected",{target:e}),o(e)&&!f.isDefaultPrevented()?x(N,function(e,o){function l(t){k=t.screenX,T=t.screenY,B=w.clientWidth,L=w.clientHeight,D=L/B,E=e,_=w.cloneNode(!0),C.addClass(_,"mce-clonedresizable"),_.contentEditable=!1,_.unSelectabe=!0,C.setStyles(_,{left:R,top:A,margin:0}),_.removeAttribute("data-mce-selected"),i.getBody().appendChild(_),C.bind(O,"mousemove",a),C.bind(O,"mouseup",s),I!=O&&(C.bind(I,"mousemove",a),C.bind(I,"mouseup",s))}var c,f;return t?void(o==t&&l(r)):(c=C.get("mceResizeHandle"+o),c?C.show(c):(f=i.getBody(),c=C.add(f,"div",{id:"mceResizeHandle"+o,"data-mce-bogus":!0,"class":"mce-resizehandle",unselectable:!0,style:"cursor:"+o+"-resize; margin:0; padding:0"}),n.ie&&(c.contentEditable=!1)),e.elm||(C.bind(c,"mousedown",function(e){e.stopImmediatePropagation(),e.preventDefault(),l(e)}),e.elm=c),void C.setStyles(c,{left:u*e[0]+R-c.offsetWidth/2,top:d*e[1]+A-c.offsetHeight/2}))}):c(),w.setAttribute("data-mce-selected","1")}function c(){var e,t;g(),w&&w.removeAttribute("data-mce-selected");for(e in N)t=C.get("mceResizeHandle"+e),t&&(C.unbind(t),C.remove(t))}function u(e){function t(e,t){if(e)do if(e===t)return!0;while(e=e.parentNode)}var n;return x(C.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),n="mousedown"==e.type?e.target:r.getNode(),n=C.getParent(n,F?"table":"table,img,hr"),t(n,i.getBody())&&(v(),t(r.getStart(),n)&&t(r.getEnd(),n)&&(!F||n!=r.getStart()&&"IMG"!==r.getStart().nodeName))?void l(n):void c()}function d(e,t,n){e&&e.attachEvent&&e.attachEvent("on"+t,n)}function f(e,t,n){e&&e.detachEvent&&e.detachEvent("on"+t,n)}function p(e){var t=e.srcElement,n,r,o,a,s,c,u;n=t.getBoundingClientRect(),c=S.clientX-n.left,u=S.clientY-n.top;for(r in N)if(o=N[r],a=t.offsetWidth*o[0],s=t.offsetHeight*o[1],Math.abs(a-c)<8&&Math.abs(s-u)<8){E=o;break}M=!0,i.getDoc().selection.empty(),l(t,r,S)}function m(e){var t=e.srcElement;if(t!=w){if(h(),0===t.id.indexOf("mceResizeHandle"))return void(e.returnValue=!1);("IMG"==t.nodeName||"TABLE"==t.nodeName)&&(c(),w=t,d(t,"resizestart",p))}}function h(){f(w,"resizestart",p)}function g(){for(var e in N){var t=N[e];t.elm&&(C.unbind(t.elm),delete t.elm)}}function v(){try{i.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}}function y(e){var t;if(F){t=O.body.createControlRange();try{return t.addElement(e),t.select(),!0}catch(n){}}}function b(){w=_=null,F&&(h(),f(i.getBody(),"controlselect",m))}var C=i.dom,x=t.each,w,_,N,E,S,k,T,R,A,B,L,D,M,H,P,O=i.getDoc(),I=document,F=n.ie&&n.ie<11;N={n:[.5,0,0,-1],e:[1,.5,1,0],s:[.5,1,0,1],w:[0,.5,-1,0],nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var z=".mce-content-body";return i.contentStyles.push(z+" div.mce-resizehandle {position: absolute;border: 1px solid black;background: #FFF;width: 5px;height: 5px;z-index: 10000}"+z+" .mce-resizehandle:hover {background: #000}"+z+" img[data-mce-selected], hr[data-mce-selected] {outline: 1px solid black;resize: none}"+z+" .mce-clonedresizable {position: absolute;"+(n.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"),i.on("init",function(){F?(i.on("ObjectResized",function(e){"TABLE"!=e.target.nodeName&&(c(),y(e.target))}),d(i.getBody(),"controlselect",m),i.on("mousedown",function(e){S=e})):(v(),n.ie>=11&&(i.on("mouseup",function(e){var t=e.target.nodeName;/^(TABLE|IMG|HR)$/.test(t)&&(i.selection.select(e.target,"TABLE"==t),i.nodeChanged())}),i.dom.bind(i.getBody(),"mscontrolselect",function(e){/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"==e.target.tagName&&window.setTimeout(function(){i.selection.select(e.target)},0))}))),i.on("nodechange mousedown mouseup ResizeEditor",u),i.on("keydown keyup",function(e){w&&"TABLE"==w.nodeName&&u(e)})}),i.on("remove",g),{isResizable:o,showResizeRect:l,hideResizeRect:c,updateResizeRect:u,controlSelect:y,destroy:b}}}),r(B,[p,f],function(e,t){function n(e){this.walk=function(t,n){function i(e){var t;return t=e[0],3===t.nodeType&&t===l&&c>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===d&&e.length>0&&t===u&&3===t.nodeType&&e.splice(e.length-1,1),e}function o(e,t,n){for(var r=[];e&&e!=n;e=e[t])r.push(e);return r}function a(e,t){do{if(e.parentNode==t)return e;e=e.parentNode}while(e)}function s(e,t,r){var a=r?"nextSibling":"previousSibling";for(h=e,g=h.parentNode;h&&h!=t;h=g)g=h.parentNode,v=o(h==e?h:h[a],a),v.length&&(r||v.reverse(),n(i(v)))}var l=t.startContainer,c=t.startOffset,u=t.endContainer,d=t.endOffset,f,p,m,h,g,v,y;if(y=e.select("td.mce-item-selected,th.mce-item-selected"),y.length>0)return void r(y,function(e){n([e])});if(1==l.nodeType&&l.hasChildNodes()&&(l=l.childNodes[c]),1==u.nodeType&&u.hasChildNodes()&&(u=u.childNodes[Math.min(d-1,u.childNodes.length-1)]),l==u)return n(i([l]));for(f=e.findCommonAncestor(l,u),h=l;h;h=h.parentNode){if(h===u)return s(l,f,!0);if(h===f)break}for(h=u;h;h=h.parentNode){if(h===l)return s(u,f);if(h===f)break}p=a(l,f)||l,m=a(u,f)||u,s(l,p,!0),v=o(p==l?p:p.nextSibling,"nextSibling",m==u?m.nextSibling:m),v.length&&n(i(v)),s(u,m)},this.split=function(e){function t(e,t){return e.splitText(t)}var n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset;return n==i&&3==n.nodeType?r>0&&rr?(o-=r,n=i=t(i,o).previousSibling,o=i.nodeValue.length,r=0):o=0):(3==n.nodeType&&r>0&&r0&&o0)return c=p,u=n?p.nodeValue.length:0,void(i=!0);if(e.isBlock(p)||m[p.nodeName.toLowerCase()])return;s=p}o&&s&&(c=s,i=!0,u=0)}var c,u,d,f=e.getRoot(),p,m,h,g,v;if(c=n[(r?"start":"end")+"Container"],u=n[(r?"start":"end")+"Offset"],v=1==c.nodeType&&u===c.childNodes.length,m=e.schema.getNonEmptyElements(),g=r,1==c.nodeType&&u>c.childNodes.length-1&&(g=!1),9===c.nodeType&&(c=e.getRoot(),u=0),c===f){if(g&&(p=c.childNodes[u>0?u-1:0],p&&(h=p.nodeName.toLowerCase(),m[p.nodeName]||"TABLE"==p.nodeName)))return;if(c.hasChildNodes()&&(u=Math.min(!g&&u>0?u-1:u,c.childNodes.length-1),c=c.childNodes[u],u=0,c.hasChildNodes()&&!/TABLE/.test(c.nodeName))){p=c,d=new t(c,f);do{if(3===p.nodeType&&p.nodeValue.length>0){u=g?0:p.nodeValue.length,c=p,i=!0;break}if(m[p.nodeName.toLowerCase()]){u=e.nodeIndex(p),c=p.parentNode,"IMG"!=p.nodeName||g||u++,i=!0;break}}while(p=g?d.next():d.prev())}}o&&(3===c.nodeType&&0===u&&l(!0),1===c.nodeType&&(p=c.childNodes[u],p||(p=c.childNodes[u-1]),!p||"BR"!==p.nodeName||s(p,"A")||a(p)||a(p,!0)||l(!0,p))),g&&!o&&3===c.nodeType&&u===c.nodeValue.length&&l(!1),i&&n["set"+(r?"Start":"End")](c,u)}var i,o;return o=n.collapsed,r(!0),o||r(),i&&o&&n.collapse(!0),i}}var r=e.each;return n.compareRanges=function(e,t){if(e&&t){if(!e.item&&!e.duplicate)return e.startContainer==t.startContainer&&e.startOffset==t.startOffset;if(e.item&&t.item&&e.item(0)===t.item(0))return!0;if(e.isEqual&&t.isEqual&&t.isEqual(e))return!0}return!1},n}),r(L,[f,T,A,B,g,p],function(e,n,r,i,o,a){function s(e,t,i,o){var a=this;a.dom=e,a.win=t,a.serializer=i,a.editor=o,a.controlSelection=new r(a,o),a.win.getSelection||(a.tridentSel=new n(a))}var l=a.each,c=a.grep,u=a.trim,d=o.ie,f=o.opera;return s.prototype={setCursorLocation:function(e,t){var n=this,r=n.dom.createRng();e?(r.setStart(e,t),r.setEnd(e,t),n.setRng(r),n.collapse(!1)):(n._moveEndPoint(r,n.editor.getBody(),!0),n.setRng(r))},getContent:function(e){var n=this,r=n.getRng(),i=n.dom.create("body"),o=n.getSel(),a,s,l;return e=e||{},a=s="",e.get=!0,e.format=e.format||"html",e.selection=!0,n.editor.fire("BeforeGetContent",e),"text"==e.format?n.isCollapsed()?"":r.text||(o.toString?o.toString():""):(r.cloneContents?(l=r.cloneContents(),l&&i.appendChild(l)):r.item!==t||r.htmlText!==t?(i.innerHTML="
    "+(r.item?r.item(0).outerHTML:r.htmlText),i.removeChild(i.firstChild)):i.innerHTML=r.toString(),/^\s/.test(i.innerHTML)&&(a=" "),/\s+$/.test(i.innerHTML)&&(s=" "),e.getInner=!0,e.content=n.isCollapsed()?"":a+n.serializer.serialize(i,e)+s,n.editor.fire("GetContent",e),e.content)},setContent:function(e,t){var n=this,r=n.getRng(),i,o=n.win.document,a,s;if(t=t||{format:"html"},t.set=!0,t.selection=!0,e=t.content=e,t.no_events||n.editor.fire("BeforeSetContent",t),e=t.content,r.insertNode){e+='_',r.startContainer==o&&r.endContainer==o?o.body.innerHTML=e:(r.deleteContents(),0===o.body.childNodes.length?o.body.innerHTML=e:r.createContextualFragment?r.insertNode(r.createContextualFragment(e)):(a=o.createDocumentFragment(),s=o.createElement("div"),a.appendChild(s),s.outerHTML=e,r.insertNode(a))),i=n.dom.get("__caret"),r=o.createRange(),r.setStartBefore(i),r.setEndBefore(i),n.setRng(r),n.dom.remove("__caret");try{n.setRng(r)}catch(l){}}else r.item&&(o.execCommand("Delete",!1,null),r=n.getRng()),/^\s+/.test(e)?(r.pasteHTML('_'+e),n.dom.remove("__mce_tmp")):r.pasteHTML(e);t.no_events||n.editor.fire("SetContent",t)},getStart:function(){var e=this,t=e.getRng(),n,r,i,o;if(t.duplicate||t.item){if(t.item)return t.item(0);for(i=t.duplicate(),i.collapse(1),n=i.parentElement(),n.ownerDocument!==e.dom.doc&&(n=e.dom.getRoot()),r=o=t.parentElement();o=o.parentNode;)if(o==n){n=r;break}return n}return n=t.startContainer,1==n.nodeType&&n.hasChildNodes()&&(n=n.childNodes[Math.min(n.childNodes.length-1,t.startOffset)]),n&&3==n.nodeType?n.parentNode:n},getEnd:function(){var e=this,t=e.getRng(),n,r;return t.duplicate||t.item?t.item?t.item(0):(t=t.duplicate(),t.collapse(0),n=t.parentElement(),n.ownerDocument!==e.dom.doc&&(n=e.dom.getRoot()),n&&"BODY"==n.nodeName?n.lastChild||n:n):(n=t.endContainer,r=t.endOffset,1==n.nodeType&&n.hasChildNodes()&&(n=n.childNodes[r>0?r-1:r]),n&&3==n.nodeType?n.parentNode:n)},getBookmark:function(e,t){function n(e,t){var n=0;return l(a.select(e),function(e,r){e==t&&(n=r)}),n}function r(e){function t(t){var n,r,i,o=t?"start":"end";n=e[o+"Container"],r=e[o+"Offset"],1==n.nodeType&&"TR"==n.nodeName&&(i=n.childNodes,n=i[Math.min(t?r:r-1,i.length-1)],n&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r)))}return t(!0),t(),e}function i(){function e(e,n){var i=e[n?"startContainer":"endContainer"],a=e[n?"startOffset":"endOffset"],s=[],l,c,u=0;if(3==i.nodeType){if(t)for(l=i.previousSibling;l&&3==l.nodeType;l=l.previousSibling)a+=l.nodeValue.length;s.push(a)}else c=i.childNodes,a>=c.length&&c.length&&(u=1,a=Math.max(0,c.length-1)),s.push(o.dom.nodeIndex(c[a],t)+u);for(;i&&i!=r;i=i.parentNode)s.push(o.dom.nodeIndex(i,t));return s}var n=o.getRng(!0),r=a.getRoot(),i={};return i.start=e(n,!0),o.isCollapsed()||(i.end=e(n)),i}var o=this,a=o.dom,s,c,u,d,f,p,m="",h;if(2==e)return p=o.getNode(),f=p?p.nodeName:null,"IMG"==f?{name:f,index:n(f,p)}:o.tridentSel?o.tridentSel.getBookmark(e):i();if(e)return{rng:o.getRng()};if(s=o.getRng(),u=a.uniqueId(),d=o.isCollapsed(),h="overflow:hidden;line-height:0px",s.duplicate||s.item){if(s.item)return p=s.item(0),f=p.nodeName,{name:f,index:n(f,p)};c=s.duplicate();try{s.collapse(),s.pasteHTML(''+m+""),d||(c.collapse(!1),s.moveToElementText(c.parentElement()),0===s.compareEndPoints("StartToEnd",c)&&c.move("character",-1),c.pasteHTML(''+m+""))}catch(g){return null}}else{if(p=o.getNode(),f=p.nodeName,"IMG"==f)return{name:f,index:n(f,p)};c=r(s.cloneRange()),d||(c.collapse(!1),c.insertNode(a.create("span",{"data-mce-type":"bookmark",id:u+"_end",style:h},m))),s=r(s),s.collapse(!0),s.insertNode(a.create("span",{"data-mce-type":"bookmark",id:u+"_start",style:h},m))}return o.moveToBookmark({id:u,keep:1}),{id:u}},moveToBookmark:function(e){function t(t){var n=e[t?"start":"end"],r,i,o,l;if(n){for(o=n[0],i=s,r=n.length-1;r>=1;r--){if(l=i.childNodes,n[r]>l.length-1)return;i=l[n[r]]}3===i.nodeType&&(o=Math.min(n[0],i.nodeValue.length)),1===i.nodeType&&(o=Math.min(n[0],i.childNodes.length)),t?a.setStart(i,o):a.setEnd(i,o)}return!0}function n(t){var n=o.get(e.id+"_"+t),r,i,a,s,d=e.keep;if(n&&(r=n.parentNode,"start"==t?(d?(r=n.firstChild,i=1):i=o.nodeIndex(n),u=p=r,m=h=i):(d?(r=n.firstChild,i=1):i=o.nodeIndex(n),p=r,h=i),!d)){for(s=n.previousSibling,a=n.nextSibling,l(c(n.childNodes),function(e){3==e.nodeType&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});n=o.get(e.id+"_"+t);)o.remove(n,1);s&&a&&s.nodeType==a.nodeType&&3==s.nodeType&&!f&&(i=s.nodeValue.length,s.appendData(a.nodeValue),o.remove(a),"start"==t?(u=p=s,m=h=i):(p=s,h=i))}}function r(e){return!o.isBlock(e)||e.innerHTML||d||(e.innerHTML='
    '),e}var i=this,o=i.dom,a,s,u,p,m,h;if(e)if(e.start){if(a=o.createRng(),s=o.getRoot(),i.tridentSel)return i.tridentSel.moveToBookmark(e);t(!0)&&t()&&i.setRng(a)}else e.id?(n("start"),n("end"),u&&(a=o.createRng(),a.setStart(r(u),m),a.setEnd(r(p),h),i.setRng(a))):e.name?i.select(o.select(e.name)[e.index]):e.rng&&i.setRng(e.rng)},select:function(e,t){var n=this,r=n.dom,i=r.createRng(),o;if(n.lastFocusBookmark=null,e){if(!t&&n.controlSelection.controlSelect(e))return;o=r.nodeIndex(e),i.setStart(e.parentNode,o),i.setEnd(e.parentNode,o+1),t&&(n._moveEndPoint(i,e,!0),n._moveEndPoint(i,e)),n.setRng(i)}return e},isCollapsed:function(){var e=this,t=e.getRng(),n=e.getSel();return!t||t.item?!1:t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!n||t.collapsed},collapse:function(e){var t=this,n=t.getRng(),r;n.item&&(r=n.item(0),n=t.win.document.body.createTextRange(),n.moveToElementText(r)),n.collapse(!!e),t.setRng(n)},getSel:function(){var e=this.win;return e.getSelection?e.getSelection():e.document.selection},getRng:function(e){function t(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}}var n=this,r,i,o,a=n.win.document,s;if(!e&&n.lastFocusBookmark){var l=n.lastFocusBookmark;return l.startContainer?(i=a.createRange(),i.setStart(l.startContainer,l.startOffset),i.setEnd(l.endContainer,l.endOffset)):i=l,i}if(e&&n.tridentSel)return n.tridentSel.getRangeAt(0);try{(r=n.getSel())&&(i=r.rangeCount>0?r.getRangeAt(0):r.createRange?r.createRange():a.createRange())}catch(c){}if(d&&i&&i.setStart&&a.selection){try{s=a.selection.createRange()}catch(c){}s&&s.item&&(o=s.item(0),i=a.createRange(),i.setStartBefore(o),i.setEndAfter(o))}return i||(i=a.createRange?a.createRange():a.body.createTextRange()),i.setStart&&9===i.startContainer.nodeType&&i.collapsed&&(o=n.dom.getRoot(),i.setStart(o,0),i.setEnd(o,0)),n.selectedRange&&n.explicitRange&&(0===t(i.START_TO_START,i,n.selectedRange)&&0===t(i.END_TO_END,i,n.selectedRange)?i=n.explicitRange:(n.selectedRange=null,n.explicitRange=null)),i},setRng:function(e,t){var n=this,r;if(e.select)try{e.select()}catch(i){}else if(n.tridentSel){if(e.cloneRange)try{return void n.tridentSel.addRange(e)}catch(i){}}else if(r=n.getSel()){n.explicitRange=e;try{r.removeAllRanges(),r.addRange(e)}catch(i){}t===!1&&r.extend&&(r.collapse(e.endContainer,e.endOffset),r.extend(e.startContainer,e.startOffset)),n.selectedRange=r.rangeCount>0?r.getRangeAt(0):null}},setNode:function(e){var t=this;return t.setContent(t.dom.getOuterHTML(e)),e},getNode:function(){function e(e,t){for(var n=e;e&&3===e.nodeType&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n}var t=this,n=t.getRng(),r,i=n.startContainer,o=n.endContainer,a=n.startOffset,s=n.endOffset,l=t.dom.getRoot();return n?n.setStart?(r=n.commonAncestorContainer,!n.collapsed&&(i==o&&2>s-a&&i.hasChildNodes()&&(r=i.childNodes[a]),3===i.nodeType&&3===o.nodeType&&(i=i.length===a?e(i.nextSibling,!0):i.parentNode,o=0===s?e(o.previousSibling,!1):o.parentNode,i&&i===o))?i:r&&3==r.nodeType?r.parentNode:r):(r=n.item?n.item(0):n.parentElement(),r.ownerDocument!==t.win.document&&(r=l),r):l},getSelectedBlocks:function(t,n){var r=this,i=r.dom,o,a,s=[];if(a=i.getRoot(),t=i.getParent(t||r.getStart(),i.isBlock),n=i.getParent(n||r.getEnd(),i.isBlock),t&&t!=a&&s.push(t),t&&n&&t!=n){o=t;for(var l=new e(t,a);(o=l.next())&&o!=n;)i.isBlock(o)&&s.push(o)}return n&&t!=n&&n!=a&&s.push(n),s},isForward:function(){var e=this.dom,t=this.getSel(),n,r;return t&&t.anchorNode&&t.focusNode?(n=e.createRng(),n.setStart(t.anchorNode,t.anchorOffset),n.collapse(!0),r=e.createRng(),r.setStart(t.focusNode,t.focusOffset),r.collapse(!0),n.compareBoundaryPoints(n.START_TO_START,r)<=0):!0},normalize:function(){var e=this,t=e.getRng();return!d&&new i(e.dom).normalize(t)&&e.setRng(t,e.isForward()),t},selectorChanged:function(e,t){var n=this,r;return n.selectorChangedData||(n.selectorChangedData={},r={},n.editor.on("NodeChange",function(e){var t=e.element,i=n.dom,o=i.getParents(t,null,i.getRoot()),a={};l(n.selectorChangedData,function(e,t){l(o,function(n){return i.is(n,t)?(r[t]||(l(e,function(e){e(!0,{node:n,selector:t,parents:o})}),r[t]=e),a[t]=e,!1):void 0})}),l(r,function(e,n){a[n]||(delete r[n],l(e,function(e){e(!1,{node:t,selector:n,parents:o})}))})})),n.selectorChangedData[e]||(n.selectorChangedData[e]=[]),n.selectorChangedData[e].push(t),n},getScrollContainer:function(){for(var e,t=this.dom.getRoot();t&&"BODY"!=t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e){function t(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}}var n,r,i=this,o=i.dom,a=o.getRoot(),s,l;if("BODY"!=a.nodeName){var c=i.getScrollContainer();if(c)return n=t(e).y-t(c).y,l=c.clientHeight,s=c.scrollTop,void((s>n||n+25>s+l)&&(c.scrollTop=s>n?n:n-l+25))}r=o.getViewPort(i.editor.getWin()),n=o.getPos(e).y,s=r.y,l=r.h,(ns+l)&&i.editor.getWin().scrollTo(0,s>n?n:n-l+25)},_moveEndPoint:function(t,n,r){var i=n,a=new e(n,i),s=this.dom.schema.getNonEmptyElements();do{if(3==n.nodeType&&0!==u(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(s[n.nodeName])return void(r?t.setStartBefore(n):"BR"==n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(o.ie&&o.ie<11&&this.dom.isBlock(n)&&this.dom.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?a.next():a.prev());"BODY"==i.nodeName&&(r?t.setStart(i,0):t.setEnd(i,i.childNodes.length))},destroy:function(){this.win=null,this.controlSelection.destroy()}},s}),r(D,[f,B,p],function(e,t,n){return function(r){function i(e){return e.nodeType&&(e=e.nodeName),!!r.schema.getTextBlockElements()[e.toLowerCase()]}function o(e,t){return I.getParents(e,t,I.getRoot())}function a(e){return 1===e.nodeType&&"_mce_caret"===e.id}function s(){u({alignleft:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},defaultBlock:"div"},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"right"}}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},defaultBlock:"div"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},wrap_links:!1},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},wrap_links:!1},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0},onformat:function(e,t,n){et(n,function(t,n){I.setAttrib(e,n,t)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]}),et("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){u(e,{block:e,remove:"all"})}),u(r.settings.formats)}function l(){r.addShortcut("ctrl+b","bold_desc","Bold"),r.addShortcut("ctrl+i","italic_desc","Italic"),r.addShortcut("ctrl+u","underline_desc","Underline");for(var e=1;6>=e;e++)r.addShortcut("ctrl+"+e,"",["FormatBlock",!1,"h"+e]);r.addShortcut("ctrl+7","",["FormatBlock",!1,"p"]),r.addShortcut("ctrl+8","",["FormatBlock",!1,"div"]),r.addShortcut("ctrl+9","",["FormatBlock",!1,"address"])}function c(e){return e?O[e]:O}function u(e,t){e&&("string"!=typeof e?et(e,function(e,t){u(t,e)}):(t=t.length?t:[t],et(t,function(e){e.deep===X&&(e.deep=!e.selector),e.split===X&&(e.split=!e.selector||e.inline),e.remove===X&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),O[e]=t))}function d(e){var t;return r.dom.getParent(e,function(e){return t=r.dom.getStyle(e,"text-decoration"),t&&"none"!==t}),t}function f(e){var t;1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType&&(t=d(e.parentNode),r.dom.getStyle(e,"color")&&t?r.dom.setStyle(e,"text-decoration",t):r.dom.getStyle(e,"textdecoration")===t&&r.dom.setStyle(e,"text-decoration",null))}function p(t,n,o){function s(e,t){t=t||h,e&&(t.onformat&&t.onformat(e,t,n,o),et(t.styles,function(t,r){I.setStyle(e,r,E(t,n))}),et(t.attributes,function(t,r){I.setAttrib(e,r,E(t,n))}),et(t.classes,function(t){t=E(t,n),I.hasClass(e,t)||I.addClass(e,t)}))}function l(){function t(t,n){var r=new e(n);for(o=r.current();o;o=r.prev())if(o.childNodes.length>1||o==t||"BR"==o.tagName)return o}var n=r.selection.getRng(),i=n.startContainer,a=n.endContainer;if(i!=a&&0===n.endOffset){var s=t(i,a),l=3==s.nodeType?s.length:s.childNodes.length;n.setEnd(s,l)}return n}function u(e,t,n,r,i){var o=[],a=-1,s,l=-1,c=-1,u;return et(e.childNodes,function(e,t){return"UL"===e.nodeName||"OL"===e.nodeName?(a=t,s=e,!1):void 0}),et(e.childNodes,function(e,n){"SPAN"===e.nodeName&&"bookmark"==I.getAttrib(e,"data-mce-type")&&(e.id==t.id+"_start"?l=n:e.id==t.id+"_end"&&(c=n))}),0>=a||a>l&&c>a?(et(tt(e.childNodes),i),0):(u=I.clone(n,K),et(tt(e.childNodes),function(e,t){(a>l&&a>t||l>a&&t>a)&&(o.push(e),e.parentNode.removeChild(e))}),a>l?e.insertBefore(u,s):l>a&&e.insertBefore(u,s.nextSibling),r.push(u),et(o,function(e){u.appendChild(e)}),u)}function d(e,r,o){var l=[],c,d,f=!0;c=h.inline||h.block,d=I.create(c),s(d),z.walk(e,function(e){function p(e){var y,C,x,_,N;return N=f,y=e.nodeName.toLowerCase(),C=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&J(e)&&(N=f,f="true"===J(e),_=!0),w(y,"br")?(v=0,void(h.block&&I.remove(e))):h.wrapper&&g(e,t,n)?void(v=0):f&&!_&&h.block&&!h.wrapper&&i(y)&&W(C,c)?(e=I.rename(e,c),s(e),l.push(e),void(v=0)):h.selector&&(et(m,function(t){"collapsed"in t&&t.collapsed!==b||I.is(e,t.selector)&&!a(e)&&(s(e,t),x=!0)}),!h.inline||x)?void(v=0):void(!f||_||!W(c,y)||!W(C,c)||!o&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||a(e)||h.inline&&V(e)?"li"==y&&r?v=u(e,r,d,l,p):(v=0,et(tt(e.childNodes),p),_&&(f=N),v=0):(v||(v=I.clone(d,K),e.parentNode.insertBefore(v,e),l.push(v)),v.appendChild(e)))}var v;et(e,p)}),h.wrap_links===!1&&et(l,function(e){function t(e){var n,r,i;if("A"===e.nodeName){for(r=I.clone(d,K),l.push(r),i=tt(e.childNodes),n=0;n1||!V(e))&&0===o)return void I.remove(e,1);if(h.inline||h.wrapper){if(h.exact||1!==o||(e=i(e)),et(m,function(t){et(I.select(t.inline,e),function(e){var r;if(!L(e)){if(t.wrap_links===!1){r=e.parentNode;do if("A"===r.nodeName)return;while(r=r.parentNode)}R(t,n,e,t.exact?e:null)}})}),g(e.parentNode,t,n))return I.remove(e,1),e=0,Y;h.merge_with_parents&&I.getParent(e.parentNode,function(r){return g(r,t,n)?(I.remove(e,1),e=0,Y):void 0}),e&&h.merge_siblings!==!1&&(e=D(B(e),e),e=D(e,B(e,Y)))}})}var m=c(t),h=m[0],v,y,b=!o&&F.isCollapsed();if(h)if(o)o.nodeType?(y=I.createRng(),y.setStartBefore(o),y.setEndAfter(o),d(T(y,m),null,!0)):d(o,null,!0);else if(b&&h.inline&&!I.select("td.mce-item-selected,th.mce-item-selected").length)H("apply",t,n);else{var C=r.selection.getNode();U||!m[0].defaultBlock||I.getParent(C,I.isBlock)||p(m[0].defaultBlock),r.selection.setRng(l()),v=F.getBookmark(),d(T(F.getRng(Y),m),v),h.styles&&(h.styles.color||h.styles.textDecoration)&&(nt(C,f,"childNodes"),f(C)),F.moveToBookmark(v),P(F.getRng(Y)),r.nodeChanged()}}function m(e,t,n){function i(e){var n,r,o,a,s;if(1===e.nodeType&&J(e)&&(a=b,b="true"===J(e),s=!0),n=tt(e.childNodes),b&&!s)for(r=0,o=p.length;o>r&&!R(p[r],t,e,e);r++);if(m.deep&&n.length){for(r=0,o=n.length;o>r;r++)i(n[r]);s&&(b=a)}}function a(n){var r;return et(o(n.parentNode).reverse(),function(n){var i;r||"_start"==n.id||"_end"==n.id||(i=g(n,e,t),i&&i.split!==!1&&(r=n))}),r}function s(e,n,r,i){var o,a,s,l,c,u;if(e){for(u=e.parentNode,o=n.parentNode;o&&o!=u;o=o.parentNode){for(a=I.clone(o,K),c=0;c=0;a--){if(s=t[a].selector,!s||t[a].defaultBlock)return Y;for(i=r.length-1;i>=0;i--)if(I.is(r[i],s))return Y}return K}function C(e,t,n){var i;return G||(G={},i={},r.on("NodeChange",function(e){var t=o(e.element),n={};et(G,function(e,r){et(t,function(o){return g(o,r,{},e.similar)?(i[r]||(et(e,function(e){e(!0,{node:o,format:r,parents:t})}),i[r]=e),n[r]=e,!1):void 0})}),et(i,function(r,o){n[o]||(delete i[o],et(r,function(n){n(!1,{node:e.element,format:o,parents:t})}))})})),et(e.split(","),function(e){G[e]||(G[e]=[],G[e].similar=n),G[e].push(t)}),this}function x(e,t){return w(e,t.inline)?Y:w(e,t.block)?Y:t.selector?1==e.nodeType&&I.is(e,t.selector):void 0}function w(e,t){return e=e||"",t=t||"",e=""+(e.nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()==t.toLowerCase()}function _(e,t){return N(I.getStyle(e,t),t)}function N(e,t){return("color"==t||"backgroundColor"==t)&&(e=I.toHex(e)),"fontWeight"==t&&700==e&&(e="bold"),"fontFamily"==t&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e}function E(e,t){return"string"!=typeof e?e=e(t):t&&(e=e.replace(/%(\w+)/g,function(e,n){return t[n]||e})),e}function S(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)}function k(e,t,n){var r=I.create(t,n);return e.parentNode.insertBefore(r,e),r.appendChild(e),r}function T(t,n,a){function s(e){function t(e){return"BR"==e.nodeName&&e.getAttribute("data-mce-bogus")&&!e.nextSibling}var r,i,o,a,s;if(r=i=e?g:y,a=e?"previousSibling":"nextSibling",s=I.getRoot(),3==r.nodeType&&!S(r)&&(e?v>0:br?n:r,-1===n||a||n++):(n=o.indexOf(" ",t),r=o.indexOf("\xa0",t),n=-1!==n&&(-1===r||r>n)?n:r),n}var s,l,c,u;if(3===t.nodeType){if(c=o(t,n),-1!==c)return{container:t,offset:c};u=t}for(s=new e(t,I.getParent(t,V)||r.getBody());l=s[i?"prev":"next"]();)if(3===l.nodeType){if(u=l,c=o(l),-1!==c)return{container:l,offset:c}}else if(V(l))break;return u?(n=i?0:u.length,{container:u,offset:n}):void 0}function d(e,r){var i,a,s,l;for(3==e.nodeType&&0===e.nodeValue.length&&e[r]&&(e=e[r]),i=o(e),a=0;ap?p:v],3==g.nodeType&&(v=0)),1==y.nodeType&&y.hasChildNodes()&&(p=y.childNodes.length-1,y=y.childNodes[b>p?p:b-1],3==y.nodeType&&(b=y.nodeValue.length)),g=c(g),y=c(y),(L(g.parentNode)||L(g))&&(g=L(g)?g:g.parentNode,g=g.nextSibling||g,3==g.nodeType&&(v=0)),(L(y.parentNode)||L(y))&&(y=L(y)?y:y.parentNode,y=y.previousSibling||y,3==y.nodeType&&(b=y.length)),n[0].inline&&(t.collapsed&&(h=u(g,v,!0),h&&(g=h.container,v=h.offset),h=u(y,b),h&&(y=h.container,b=h.offset)),m=l(y,b),m.node)){for(;m.node&&0===m.offset&&m.node.previousSibling;)m=l(m.node.previousSibling);m.node&&m.offset>0&&3===m.node.nodeType&&" "===m.node.nodeValue.charAt(m.offset-1)&&m.offset>1&&(y=m.node,y.splitText(m.offset-1))}return(n[0].inline||n[0].block_expand)&&(n[0].inline&&3==g.nodeType&&0!==v||(g=s(!0)),n[0].inline&&3==y.nodeType&&b!==y.nodeValue.length||(y=s())),n[0].selector&&n[0].expand!==K&&!n[0].inline&&(g=d(g,"previousSibling"),y=d(y,"nextSibling")),(n[0].block||n[0].selector)&&(g=f(g,"previousSibling"),y=f(y,"nextSibling"),n[0].block&&(V(g)||(g=s(!0)),V(y)||(y=s()))),1==g.nodeType&&(v=q(g),g=g.parentNode),1==y.nodeType&&(b=q(y)+1,y=y.parentNode),{startContainer:g,startOffset:v,endContainer:y,endOffset:b}}function R(e,t,n,r){var i,o,a;if(!x(n,e))return K;if("all"!=e.remove)for(et(e.styles,function(e,i){e=N(E(e,t),i),"number"==typeof i&&(i=e,r=0),(!r||w(_(r,i),e))&&I.setStyle(n,i,""),a=1}),a&&""===I.getAttrib(n,"style")&&(n.removeAttribute("style"),n.removeAttribute("data-mce-style")),et(e.attributes,function(e,i){var o;if(e=E(e,t),"number"==typeof i&&(i=e,r=0),!r||w(I.getAttrib(r,i),e)){if("class"==i&&(e=I.getAttrib(n,i),e&&(o="",et(e.split(/\s+/),function(e){/mce\w+/.test(e)&&(o+=(o?" ":"")+e)}),o)))return void I.setAttrib(n,i,o);"class"==i&&n.removeAttribute("className"),j.test(i)&&n.removeAttribute("data-mce-"+i),n.removeAttribute(i)}}),et(e.classes,function(e){e=E(e,t),(!r||I.hasClass(r,e))&&I.removeClass(n,e)}),o=I.getAttribs(n),i=0;ia?a:o]),3===i.nodeType&&n&&o>=i.nodeValue.length&&(i=new e(i,r.getBody()).next()||i),3!==i.nodeType||n||0!==o||(i=new e(i,r.getBody()).prev()||i),i}function H(t,n,o){function a(e){var t=I.create("span",{id:y,"data-mce-bogus":!0,style:b?"color:red":""});return e&&t.appendChild(r.getDoc().createTextNode($)),t}function s(e,t){for(;e;){if(3===e.nodeType&&e.nodeValue!==$||e.childNodes.length>1)return!1;t&&1===e.nodeType&&t.push(e),e=e.firstChild}return!0}function l(e){for(;e;){if(e.id===y)return e;e=e.parentNode}}function u(t){var n;if(t)for(n=new e(t,t),t=n.current();t;t=n.next())if(3===t.nodeType)return t}function d(e,t){var n,r;if(e)r=F.getRng(!0),s(e)?(t!==!1&&(r.setStartBefore(e),r.setEndBefore(e)),I.remove(e)):(n=u(e),n.nodeValue.charAt(0)===$&&(n=n.deleteData(0,1)),I.remove(e,1)),F.setRng(r);else if(e=l(F.getStart()),!e)for(;e=I.get(y);)d(e,!1)}function f(){var e,t,r,i,s,d,f;e=F.getRng(!0),i=e.startOffset,d=e.startContainer,f=d.nodeValue,t=l(F.getStart()),t&&(r=u(t)),f&&i>0&&i=0;p--)u.appendChild(I.clone(f[p],!1)),u=u.firstChild;u.appendChild(I.doc.createTextNode($)),u=u.firstChild;var v=I.getParent(d,i);v&&I.isEmpty(v)?d.parentNode.replaceChild(h,d):I.insertAfter(h,d),F.setCursorLocation(u,1),I.isEmpty(d)&&I.remove(d)}}function v(){var e;e=l(F.getStart()),e&&!I.isEmpty(e)&&nt(e,function(e){1!=e.nodeType||e.id===y||I.isEmpty(e)||I.setAttrib(e,"data-mce-bogus",null)},"childNodes")}var y="_mce_caret",b=r.settings.caret_debug;r._hasCaretEvents||(Z=function(){var e=[],t;if(s(l(F.getStart()),e))for(t=e.length;t--;)I.setAttrib(e[t],"data-mce-bogus","1")},Q=function(e){var t=e.keyCode;d(),(8==t||37==t||39==t)&&d(l(F.getStart())),v()},r.on("SetContent",function(e){e.selection&&v()}),r._hasCaretEvents=!0),"apply"==t?f():h()}function P(t){var n=t.startContainer,r=t.startOffset,i,o,a,s,l;if(3==n.nodeType&&r>=n.nodeValue.length&&(r=q(n),n=n.parentNode,i=!0),1==n.nodeType)for(s=n.childNodes,n=s[Math.min(r,s.length-1)],o=new e(n,I.getParent(n,I.isBlock)),(r>s.length-1||i)&&o.next(),a=o.current();a;a=o.next())if(3==a.nodeType&&!S(a))return l=I.create("a",null,$),a.parentNode.insertBefore(l,a),t.setStart(a,0),F.setRng(t),void I.remove(l)}var O={},I=r.dom,F=r.selection,z=new t(I),W=r.schema.isValidChild,V=I.isBlock,U=r.settings.forced_root_block,q=I.nodeIndex,$="\ufeff",j=/^(src|href|style)$/,K=!1,Y=!0,G,X,J=I.getContentEditable,Q,Z,et=n.each,tt=n.grep,nt=n.walk,rt=n.extend;rt(this,{get:c,register:u,apply:p,remove:m,toggle:h,match:v,matchAll:y,matchNode:g,canApply:b,formatChanged:C}),s(),l(),r.on("BeforeGetContent",function(){Z&&Z()}),r.on("mouseup keydown",function(e){Q&&Q(e)})}}),r(M,[g,p],function(e,t){var n=t.trim,r;return r=new RegExp(["]+data-mce-bogus[^>]+>[\u200b\ufeff]+<\\/span>","]+data-mce-bogus[^>]+><\\/div>",'\\s?data-mce-selected="[^"]+"'].join("|"),"gi"),function(t){function i(){return n(t.getContent({format:"raw",no_events:1}).replace(r,""))}function o(e){a.typing=!1,a.add({},e)}var a=this,s=0,l=[],c,u,d;return t.on("init",function(){a.add()}),t.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&a.beforeChange()}),t.on("ExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&o(e)}),t.on("ObjectResizeStart",function(){a.beforeChange()}),t.on("SaveContent ObjectResized blur",o),t.dom.bind(t.dom.getRoot(),"dragend",o),t.on("KeyUp",function(n){var r=n.keyCode;(r>=33&&36>=r||r>=37&&40>=r||45==r||13==r||n.ctrlKey)&&(o(),t.nodeChanged()),(46==r||8==r||e.mac&&(91==r||93==r))&&t.nodeChanged(),u&&a.typing&&(t.isDirty()||(t.isNotDirty=!l[0]||i()==l[0].content,t.isNotDirty||t.fire("change",{level:l[0],lastLevel:null})),t.fire("TypingUndo"),u=!1,t.nodeChanged())}),t.on("KeyDown",function(e){var t=e.keyCode;return t>=33&&36>=t||t>=37&&40>=t||45==t?void(a.typing&&o(e)):void((16>t||t>20)&&224!=t&&91!=t&&!a.typing&&(a.beforeChange(),a.typing=!0,a.add({},e),u=!0))}),t.on("MouseDown",function(e){a.typing&&o(e)}),t.addShortcut("ctrl+z","","Undo"),t.addShortcut("ctrl+y,ctrl+shift+z","","Redo"),t.on("AddUndo Undo Redo ClearUndos MouseUp",function(e){e.isDefaultPrevented()||t.nodeChanged()}),a={data:l,typing:!1,beforeChange:function(){d||(c=t.selection.getBookmark(2,!0))},add:function(e,n){var r,o=t.settings,a;if(e=e||{},e.content=i(),d||t.removed)return null;if(t.fire("BeforeAddUndo",{level:e,originalEvent:n}).isDefaultPrevented())return null;if(a=l[s],a&&a.content==e.content)return null;if(l[s]&&(l[s].beforeBookmark=c),o.custom_undo_redo_levels&&l.length>o.custom_undo_redo_levels){for(r=0;r0&&(t.isNotDirty=!1,t.fire("change",u)),e},undo:function(){var e;return a.typing&&(a.add(),a.typing=!1),s>0&&(e=l[--s],0===s&&(t.isNotDirty=!0),t.setContent(e.content,{format:"raw"}),t.selection.moveToBookmark(e.beforeBookmark),t.fire("undo",{level:e})),e},redo:function(){var e;return s0||a.typing&&l[0]&&i()!=l[0].content},hasRedo:function(){return sL)&&(u=a.create("br"),t.parentNode.insertBefore(u,t)),l.setStartBefore(t),l.setEndBefore(t)):(l.setStartAfter(t),l.setEndAfter(t)):(l.setStart(t,0),l.setEnd(t,0));s.setRng(l),a.remove(u),s.scrollIntoView(t)}function g(e){var t=l.forced_root_block;t&&t.toLowerCase()===e.tagName.toLowerCase()&&a.setAttribs(e,l.forced_root_block_attrs)}function v(e){var t=R,n,i,o;if(e||"TABLE"==O?(n=a.create(e||F),g(n)):n=B.cloneNode(!1),o=n,l.keep_styles!==!1)do if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U|VAR|CITE|DFN|CODE|MARK|Q|SUP|SUB|SAMP)$/.test(t.nodeName)){if("_mce_caret"==t.id)continue;i=t.cloneNode(!1),a.setAttrib(i,"id",""),n.hasChildNodes()?(i.appendChild(n.firstChild),n.appendChild(i)):(o=i,n.appendChild(i))}while(t=t.parentNode);return r||(o.innerHTML='
    '),n}function y(t){var n,r,i;if(3==R.nodeType&&(t?A>0:A0)return!0}function w(){var e,t,n;R&&3==R.nodeType&&A>=R.nodeValue.length&&(r||x()||(e=a.create("br"),S.insertNode(e),S.setStartAfter(e),S.setEndAfter(e),t=!0)),e=a.create("br"),S.insertNode(e),r&&"PRE"==O&&(!L||8>L)&&e.parentNode.insertBefore(a.doc.createTextNode("\r"),e),n=a.create("span",{}," "),e.parentNode.insertBefore(n,e),s.scrollIntoView(n),a.remove(n),t?(S.setStartBefore(e),S.setEndBefore(e)):(S.setStartAfter(e),S.setEndAfter(e)),s.setRng(S),c.add()}function _(e){do 3===e.nodeType&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;while(e)}function N(e){var t=a.getRoot(),n,r;for(n=e;n!==t&&"false"!==a.getContentEditable(n);)"true"===a.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==t?r:t}function E(e){var t;r||(e.normalize(),t=e.lastChild,(!t||/^(left|right)$/gi.test(a.getStyle(t,"float",!0)))&&a.add(e,"br"))}var S,k,T,R,A,B,L,D,M,H,P,O,I,F,z;if(S=s.getRng(!0),!o.isDefaultPrevented()){if(!S.collapsed)return void i.execCommand("Delete");if(new t(a).normalize(S),R=S.startContainer,A=S.startOffset,F=(l.force_p_newlines?"p":"")||l.forced_root_block,F=F?F.toUpperCase():"",L=a.doc.documentMode,D=o.shiftKey,1==R.nodeType&&R.hasChildNodes()&&(z=A>R.childNodes.length-1,R=R.childNodes[Math.min(A,R.childNodes.length-1)]||R,A=z&&3==R.nodeType?R.nodeValue.length:0),T=N(R)){if(c.beforeChange(),!a.isBlock(T)&&T!=a.getRoot())return void((!F||D)&&w());if((F&&!D||!F&&D)&&(R=b(R,A)),B=a.getParent(R,a.isBlock),P=B?a.getParent(B.parentNode,a.isBlock):null,O=B?B.nodeName.toUpperCase():"",I=P?P.nodeName.toUpperCase():"","LI"!=I||o.ctrlKey||(B=P,O=I),"LI"==O){if(!F&&D)return void w();if(a.isEmpty(B))return void C()}if("PRE"==O&&l.br_in_pre!==!1){if(!D)return void w()}else if(!F&&!D&&"LI"!=O||F&&D)return void w();F&&B===i.getBody()||(F=F||"P",y()?(M=/^(H[1-6]|PRE|FIGURE)$/.test(O)&&"HGROUP"!=I?v(F):v(),l.end_container_on_empty_block&&f(P)&&a.isEmpty(B)?M=a.split(P,B):a.insertAfter(M,B),h(M)):y(!0)?(M=B.parentNode.insertBefore(v(),B),p(M),h(B)):(k=S.cloneRange(),k.setEndAfter(B),H=k.extractContents(),_(H),M=H.firstChild,a.insertAfter(H,B),m(M),E(B),h(M)),a.setAttrib(M,"id",""),i.fire("NewBlock",{newBlock:M}),c.add())}}}var a=i.dom,s=i.selection,l=i.settings,c=i.undoManager,u=i.schema,d=u.getNonEmptyElements();i.on("keydown",function(e){13==e.keyCode&&o(e)!==!1&&e.preventDefault()})}}),r(P,[],function(){return function(e){function t(){var t=i.getStart(),s=e.getBody(),l,c,u,d,f,p,m,h=-16777215,g,v,y,b,C;if(C=n.forced_root_block,t&&1===t.nodeType&&C){for(;t&&t!=s;){if(a[t.nodeName])return;t=t.parentNode}if(l=i.getRng(),l.setStart){c=l.startContainer,u=l.startOffset,d=l.endContainer,f=l.endOffset;try{v=e.getDoc().activeElement===s}catch(x){}}else l.item&&(t=l.item(0),l=e.getDoc().body.createTextRange(),l.moveToElementText(t)),v=l.parentElement().ownerDocument===e.getDoc(),y=l.duplicate(),y.collapse(!0),u=-1*y.move("character",h),y.collapsed||(y=l.duplicate(),y.collapse(!1),f=-1*y.move("character",h)-u);for(t=s.firstChild,b=s.nodeName.toLowerCase();t;)if((3===t.nodeType||1==t.nodeType&&!a[t.nodeName])&&o.isValidChild(b,C.toLowerCase())){if(3===t.nodeType&&0===t.nodeValue.length){m=t,t=t.nextSibling,r.remove(m);continue}p||(p=r.create(C,e.settings.forced_root_block_attrs),t.parentNode.insertBefore(p,t),g=!0),m=t,t=t.nextSibling,p.appendChild(m)}else p=null,t=t.nextSibling;if(g&&v){if(l.setStart)l.setStart(c,u),l.setEnd(d,f),i.setRng(l);else try{l=e.getDoc().body.createTextRange(),l.moveToElementText(s),l.collapse(!0),l.moveStart("character",u),f>0&&l.moveEnd("character",f),l.select()}catch(x){}e.nodeChanged()}}}var n=e.settings,r=e.dom,i=e.selection,o=e.schema,a=o.getBlockElements();n.forced_root_block&&e.on("NodeChange",t)}}),r(O,[S,g,p],function(e,n,r){var i=r.each,o=r.extend,a=r.map,s=r.inArray,l=r.explode,c=n.gecko,u=n.ie,d=!0,f=!1;return function(r){function p(e,t,n){var r;return e=e.toLowerCase(),(r=N.exec[e])?(r(e,t,n),d):f}function m(e){var t;return e=e.toLowerCase(),(t=N.state[e])?t(e):-1}function h(e){var t;return e=e.toLowerCase(),(t=N.value[e])?t(e):f}function g(e,t){t=t||"exec",i(e,function(e,n){i(n.toLowerCase().split(","),function(n){N[t][n]=e})})}function v(e,n,i){return n===t&&(n=f),i===t&&(i=null),r.getDoc().execCommand(e,n,i)}function y(e){return S.match(e)}function b(e,n){S.toggle(e,n?{value:n}:t),r.nodeChanged()}function C(e){k=_.getBookmark(e)}function x(){_.moveToBookmark(k)}var w=r.dom,_=r.selection,N={state:{},exec:{},value:{}},E=r.settings,S=r.formatter,k;o(this,{execCommand:p,queryCommandState:m,queryCommandValue:h,addCommands:g}),g({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){r.undoManager.add()},"Cut,Copy,Paste":function(e){var t=r.getDoc(),i;try{v(e)}catch(o){i=d}if(i||!t.queryCommandSupported(e)){var a=r.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");n.mac&&(a=a.replace(/Ctrl\+/g,"\u2318+")),r.windowManager.alert(a)}},unlink:function(){if(_.isCollapsed()){var e=_.getNode();return void("A"==e.tagName&&r.dom.remove(e,!0))}S.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t=e.substring(7);"full"==t&&(t="justify"),i("left,center,right,justify".split(","),function(e){t!=e&&S.remove("align"+e)}),b("align"+t),p("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;v(e),t=w.getParent(_.getNode(),"ol,ul"),t&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(C(),w.split(n,t),x()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){b(e)},"ForeColor,HiliteColor,FontName":function(e,t,n){b(e,n)},FontSize:function(e,t,n){var r,i;n>=1&&7>=n&&(i=l(E.font_size_style_values),r=l(E.font_size_classes),n=r?r[n-1]||n:i[n-1]||n),b(e,n)},RemoveFormat:function(e){S.remove(e)},mceBlockQuote:function(){b("blockquote")},FormatBlock:function(e,t,n){return b(n||"p")},mceCleanup:function(){var e=_.getBookmark();r.setContent(r.getContent({cleanup:d}),{cleanup:d}),_.moveToBookmark(e)},mceRemoveNode:function(e,t,n){var i=n||_.getNode();i!=r.getBody()&&(C(),r.dom.remove(i,d),x())},mceSelectNodeDepth:function(e,t,n){var i=0;w.getParent(_.getNode(),function(e){return 1==e.nodeType&&i++==n?(_.select(e),f):void 0},r.getBody())},mceSelectNode:function(e,t,n){_.select(n)},mceInsertContent:function(t,n,i){function o(e){function t(e){return r[e]&&3==r[e].nodeType}var n,r,i;return n=_.getRng(!0),r=n.startContainer,i=n.startOffset,3==r.nodeType&&(i>0?e=e.replace(/^ /," "):t("previousSibling")||(e=e.replace(/^ /," ")),i|)$/," "):t("nextSibling")||(e=e.replace(/( | )(
    |)$/," "))),e}var a,s,l,c,d,f,p,m,h,g,v;/^ | $/.test(i)&&(i=o(i)),a=r.parser,s=new e({},r.schema),v='ÈB;',f={content:i,format:"html",selection:!0},r.fire("BeforeSetContent",f),i=f.content,-1==i.indexOf("{$caret}")&&(i+="{$caret}"),i=i.replace(/\{\$caret\}/,v),m=_.getRng();var y=m.startContainer||(m.parentElement?m.parentElement():null),b=r.getBody();y===b&&_.isCollapsed()&&w.isBlock(b.firstChild)&&w.isEmpty(b.firstChild)&&(m=w.createRng(),m.setStart(b.firstChild,0),m.setEnd(b.firstChild,0),_.setRng(m)),_.isCollapsed()||r.getDoc().execCommand("Delete",!1,null),l=_.getNode();var C={context:l.nodeName.toLowerCase()};if(d=a.parse(i,C),h=d.lastChild,"mce_marker"==h.attr("id"))for(p=h,h=h.prev;h;h=h.walk(!0))if(3==h.type||!w.isBlock(h.name)){h.parent.insert(p,h,"br"===h.name);break}if(C.invalid){for(_.setContent(v),l=_.getNode(),c=r.getBody(),9==l.nodeType?l=h=c:h=l;h!==c;)l=h,h=h.parentNode;i=l==c?c.innerHTML:w.getOuterHTML(l),i=s.serialize(a.parse(i.replace(//i,function(){return s.serialize(d)}))),l==c?w.setHTML(c,i):w.setOuterHTML(l,i)}else i=s.serialize(d),h=l.firstChild,g=l.lastChild,!h||h===g&&"BR"===h.nodeName?w.setHTML(l,i):_.setContent(i);p=w.get("mce_marker"),_.scrollIntoView(p),m=w.createRng(),h=p.previousSibling,h&&3==h.nodeType?(m.setStart(h,h.nodeValue.length),u||(g=p.nextSibling,g&&3==g.nodeType&&(h.appendData(g.data),g.parentNode.removeChild(g)))):(m.setStartBefore(p),m.setEndBefore(p)),w.remove(p),_.setRng(m),r.fire("SetContent",f),r.addVisual()},mceInsertRawHTML:function(e,t,n){_.setContent("tiny_mce_marker"),r.setContent(r.getContent().replace(/tiny_mce_marker/g,function(){return n}))},mceToggleFormat:function(e,t,n){b(n)},mceSetContent:function(e,t,n){r.setContent(n)},"Indent,Outdent":function(e){var t,n,o;t=E.indentation,n=/[a-z%]+$/i.exec(t),t=parseInt(t,10),m("InsertUnorderedList")||m("InsertOrderedList")?v(e):(E.forced_root_block||w.getParent(_.getNode(),w.isBlock)||S.apply("div"),i(_.getSelectedBlocks(),function(i){if("LI"!=i.nodeName){var a=r.getParam("indent_use_margin",!1)?"margin":"padding";a+="rtl"==w.getStyle(i,"direction",!0)?"Right":"Left","outdent"==e?(o=Math.max(0,parseInt(i.style[a]||0,10)-t),w.setStyle(i,a,o?o+n:"")):(o=parseInt(i.style[a]||0,10)+t+n,w.setStyle(i,a,o))}}))},mceRepaint:function(){if(c)try{C(d),_.getSel()&&_.getSel().selectAllChildren(r.getBody()),_.collapse(d),x()}catch(e){}},InsertHorizontalRule:function(){r.execCommand("mceInsertContent",!1,"
    ")},mceToggleVisualAid:function(){r.hasVisual=!r.hasVisual,r.addVisual()},mceReplaceContent:function(e,t,n){r.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,_.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=w.getParent(_.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||S.remove("link"),n.href&&S.apply("link",n,r)},selectAll:function(){var e=w.getRoot(),t;_.getRng().setStart?(t=w.createRng(),t.setStart(e,0),t.setEnd(e,e.childNodes.length),_.setRng(t)):(t=_.getRng(),t.item||(t.moveToElementText(e),t.select()))},"delete":function(){v("Delete");var e=r.getBody();w.isEmpty(e)&&(r.setContent(""),e.firstChild&&w.isBlock(e.firstChild)?r.selection.setCursorLocation(e.firstChild,0):r.selection.setCursorLocation(e,0))},mceNewDocument:function(){r.setContent("")}}),g({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t="align"+e.substring(7),n=_.isCollapsed()?[w.getParent(_.getNode(),w.isBlock)]:_.getSelectedBlocks(),r=a(n,function(e){return!!S.matchNode(e,t)});return-1!==s(r,d)},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return y(e)},mceBlockQuote:function(){return y("blockquote")},Outdent:function(){var e;if(E.inline_styles){if((e=w.getParent(_.getStart(),w.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return d;if((e=w.getParent(_.getEnd(),w.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return d}return m("InsertUnorderedList")||m("InsertOrderedList")||!E.inline_styles&&!!w.getParent(_.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=w.getParent(_.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),g({"FontSize,FontName":function(e){var t=0,n;return(n=w.getParent(_.getNode(),"span"))&&(t="fontsize"==e?n.style.fontSize:n.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()),t}},"value"),g({Undo:function(){r.undoManager.undo()},Redo:function(){r.undoManager.redo()}})}}),r(I,[p],function(e){function t(e,i){var o=this,a,s;if(e=r(e),i=o.settings=i||{},/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))return void(o.source=e);var l=0===e.indexOf("//");0!==e.indexOf("/")||l||(e=(i.base_uri?i.base_uri.protocol||"http":"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(s=i.base_uri?i.base_uri.path:new t(location.href).directory,e=""===i.base_uri.protocol?"//mce_host"+o.toAbsPath(s,e):(i.base_uri&&i.base_uri.protocol||"http")+"://mce_host"+o.toAbsPath(s,e)),e=e.replace(/@@/g,"(mce_at)"),e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),n(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(t,n){var r=e[n];r&&(r=r.replace(/\(mce_at\)/g,"@@")),o[t]=r}),a=i.base_uri,a&&(o.protocol||(o.protocol=a.protocol),o.userInfo||(o.userInfo=a.userInfo),o.port||"mce_host"!==o.host||(o.port=a.port),o.host&&"mce_host"!==o.host||(o.host=a.host),o.source=""),l&&(o.protocol="")}var n=e.each,r=e.trim;return t.prototype={setPath:function(e){var t=this;e=/^(.*?)\/?(\w+)?$/.exec(e),t.path=e[0],t.directory=e[1],t.file=e[2],t.source="",t.getURI()},toRelative:function(e){var n=this,r;if("./"===e)return e;if(e=new t(e,{base_uri:n}),"mce_host"!=e.host&&n.host!=e.host&&e.host||n.port!=e.port||n.protocol!=e.protocol&&""!==e.protocol)return e.getURI();var i=n.getURI(),o=e.getURI();return i==o||"/"==i.charAt(i.length-1)&&i.substr(0,i.length-1)==o?i:(r=n.toRelPath(n.path,e.path),e.query&&(r+="?"+e.query),e.anchor&&(r+="#"+e.anchor),r)},toAbsolute:function(e,n){return e=new t(e,{base_uri:this}),e.getURI(this.host==e.host&&this.protocol==e.protocol?n:0)},toRelPath:function(e,t){var n,r=0,i="",o,a;if(e=e.substring(0,e.lastIndexOf("/")),e=e.split("/"),n=t.split("/"),e.length>=n.length)for(o=0,a=e.length;a>o;o++)if(o>=n.length||e[o]!=n[o]){r=o+1;break}if(e.lengtho;o++)if(o>=e.length||e[o]!=n[o]){r=o+1;break}if(1===r)return t;for(o=0,a=e.length-(r-1);a>o;o++)i+="../";for(o=r-1,a=n.length;a>o;o++)i+=o!=r-1?"/"+n[o]:n[o]; -return i},toAbsPath:function(e,t){var r,i=0,o=[],a,s;for(a=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),n(e,function(e){e&&o.push(e)}),e=o,r=t.length-1,o=[];r>=0;r--)0!==t[r].length&&"."!==t[r]&&(".."!==t[r]?i>0?i--:o.push(t[r]):i++);return r=e.length-i,s=0>=r?o.reverse().join("/"):e.slice(0,r).join("/")+"/"+o.reverse().join("/"),0!==s.indexOf("/")&&(s="/"+s),a&&s.lastIndexOf("/")!==s.length-1&&(s+=a),s},getURI:function(e){var t,n=this;return(!n.source||e)&&(t="",e||(t+=n.protocol?n.protocol+"://":"//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},t}),r(F,[p],function(e){function t(){}var n=e.each,r=e.extend,i,o;return t.extend=i=function(e){function t(){var e,t,n,r=this;if(!o&&(r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)n=t[e],n.init&&n.init.apply(r,arguments)}function a(){return this}function s(e,t){return function(){var n=this,r=n._super,i;return n._super=c[e],i=t.apply(n,arguments),n._super=r,i}}var l=this,c=l.prototype,u,d,f;o=!0,u=new l,o=!1,e.Mixins&&(n(e.Mixins,function(t){t=t;for(var n in t)"init"!==n&&(e[n]=t[n])}),c.Mixins&&(e.Mixins=c.Mixins.concat(e.Mixins))),e.Methods&&n(e.Methods.split(","),function(t){e[t]=a}),e.Properties&&n(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){var t=this,r;return e!==r?(t[n]=e,t):t[n]}}),e.Statics&&n(e.Statics,function(e,n){t[n]=e}),e.Defaults&&c.Defaults&&(e.Defaults=r({},c.Defaults,e.Defaults));for(d in e)f=e[d],u[d]="function"==typeof f&&c[d]?s(d,f):f;return t.prototype=u,t.constructor=t,t.extend=i,t},t}),r(z,[F],function(e){function t(e){for(var t=[],n=e.length,r;n--;)r=e[n],r.__checked||(t.push(r),r.__checked=1);for(n=t.length;n--;)delete t[n].__checked;return t}var n=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,r=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i=/^\s*|\s*$/g,o,a=e.extend({init:function(e){function t(e){return e?(e=e.toLowerCase(),function(t){return"*"===e||t.type===e}):void 0}function o(e){return e?function(t){return t._name===e}:void 0}function a(e){return e?(e=e.split("."),function(t){for(var n=e.length;n--;)if(!t.hasClass(e[n]))return!1;return!0}):void 0}function s(e,t,n){return e?function(r){var i=r[e]?r[e]():"";return t?"="===t?i===n:"*="===t?i.indexOf(n)>=0:"~="===t?(" "+i+" ").indexOf(" "+n+" ")>=0:"!="===t?i!=n:"^="===t?0===i.indexOf(n):"$="===t?i.substr(i.length-n.length)===n:!1:!!n}:void 0}function l(e){var t;return e?(e=/(?:not\((.+)\))|(.+)/i.exec(e),e[1]?(t=u(e[1],[]),function(e){return!d(e,t)}):(e=e[2],function(t,n,r){return"first"===e?0===n:"last"===e?n===r-1:"even"===e?n%2===0:"odd"===e?n%2===1:t[e]?t[e]():!1})):void 0}function c(e,r,c){function u(e){e&&r.push(e)}var d;return d=n.exec(e.replace(i,"")),u(t(d[1])),u(o(d[2])),u(a(d[3])),u(s(d[4],d[5],d[6])),u(l(d[7])),r.psuedo=!!d[7],r.direct=c,r}function u(e,t){var n=[],i,o,a;do if(r.exec(""),o=r.exec(e),o&&(e=o[3],n.push(o[1]),o[2])){i=o[3];break}while(o);for(i&&u(i,t),e=[],a=0;a"!=n[a]&&e.push(c(n[a],[],">"===n[a-1]));return t.push(e),t}var d=this.match;this._selectors=u(e,[])},match:function(e,t){var n,r,i,o,a,s,l,c,u,d,f,p,m;for(t=t||this._selectors,n=0,r=t.length;r>n;n++){for(a=t[n],o=a.length,m=e,p=0,i=o-1;i>=0;i--)for(c=a[i];m;){if(c.psuedo)for(f=m.parent().items(),u=d=f.length;u--&&f[u]!==m;);for(s=0,l=c.length;l>s;s++)if(!c[s](m,u,d)){s=l+1;break}if(s===l){p++;break}if(i===o-1)break;m=m.parent()}if(p===o)return!0}return!1},find:function(e){function n(e,t,i){var o,a,s,l,c,u=t[i];for(o=0,a=e.length;a>o;o++){for(c=e[o],s=0,l=u.length;l>s;s++)if(!u[s](c,o,a)){s=l+1;break}if(s===l)i==t.length-1?r.push(c):c.items&&n(c.items(),t,i+1);else if(u.direct)return;c.items&&n(c.items(),t,i)}}var r=[],i,s,l=this._selectors;if(e.items){for(i=0,s=l.length;s>i;i++)n(e.items(),l[i],0);s>1&&(r=t(r))}return o||(o=a.Collection),new o(r)}});return a}),r(W,[p,z,F],function(e,t,n){var r,i,o=Array.prototype.push,a=Array.prototype.slice;return i={length:0,init:function(e){e&&this.add(e)},add:function(t){var n=this;return e.isArray(t)?o.apply(n,t):t instanceof r?n.add(t.toArray()):o.call(n,t),n},set:function(e){var t=this,n=t.length,r;for(t.length=0,t.add(e),r=t.length;n>r;r++)delete t[r];return t},filter:function(e){var n=this,i,o,a=[],s,l;for("string"==typeof e?(e=new t(e),l=function(t){return e.match(t)}):l=e,i=0,o=n.length;o>i;i++)s=n[i],l(s)&&a.push(s);return new r(a)},slice:function(){return new r(a.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(t){return e.each(this,t),this},toArray:function(){return e.toArray(this)},indexOf:function(e){for(var t=this,n=t.length;n--&&t[n]!==e;);return n},reverse:function(){return new r(e.toArray(this).reverse())},hasClass:function(e){return this[0]?this[0].hasClass(e):!1},prop:function(e,t){var n=this,r,i;return t!==r?(n.each(function(n){n[e]&&n[e](t)}),n):(i=n[0],i&&i[e]?i[e]():void 0)},exec:function(t){var n=this,r=e.toArray(arguments).slice(1);return n.each(function(e){e[t]&&e[t].apply(e,r)}),n},remove:function(){for(var e=this.length;e--;)this[e].remove();return this}},e.each("fire on off show hide addClass removeClass append prepend before after reflow".split(" "),function(t){i[t]=function(){var n=e.toArray(arguments);return this.each(function(e){t in e&&e[t].apply(e,n)}),this}}),e.each("text name disabled active selected checked visible parent value data".split(" "),function(e){i[e]=function(t){return this.prop(e,t)}}),r=n.extend(i),t.Collection=r,r}),r(V,[p,y],function(e,t){return{id:function(){return t.DOM.uniqueId()},createFragment:function(e){return t.DOM.createFragment(e)},getWindowSize:function(){return t.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var r=e.getBoundingClientRect();t=Math.max(r.width||r.right-r.left,e.offsetWidth),n=Math.max(r.height||r.bottom-r.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,n){return t.DOM.getPos(e,n)},getViewPort:function(e){return t.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,n){return t.DOM.addClass(e,n)},removeClass:function(e,n){return t.DOM.removeClass(e,n)},hasClass:function(e,n){return t.DOM.hasClass(e,n)},toggleClass:function(e,n,r){return t.DOM.toggleClass(e,n,r)},css:function(e,n,r){return t.DOM.setStyle(e,n,r)},on:function(e,n,r,i){return t.DOM.bind(e,n,r,i)},off:function(e,n,r){return t.DOM.unbind(e,n,r)},fire:function(e,n,r){return t.DOM.fire(e,n,r)},innerHtml:function(e,n){t.DOM.setHTML(e,n)}}}),r(U,[F,p,W,V],function(e,t,n,r){var i=t.makeMap("focusin focusout scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave wheel keydown keypress keyup contextmenu"," "),o={},a="onmousewheel"in document,s=!1,l=e.extend({Statics:{elementIdCache:o},isRtl:function(){return l.rtl},classPrefix:"mce-",init:function(e){var n=this,i,o;if(n.settings=e=t.extend({},n.Defaults,e),n._id=e.id||r.id(),n._text=n._name="",n._width=n._height=0,n._aria={role:e.role},i=e.classes)for(i=i.split(" "),i.map={},o=i.length;o--;)i.map[i[o]]=!0;n._classes=i||[],n.visible(!0),t.each("title text width height name classes visible disabled active value".split(" "),function(t){var r=e[t],i;r!==i?n[t](r):n["_"+t]===i&&(n["_"+t]=!1)}),n.on("click",function(){return n.disabled()?!1:void 0}),e.classes&&t.each(e.classes.split(" "),function(e){n.addClass(e)}),n.settings=e,n._borderBox=n.parseBox(e.border),n._paddingBox=n.parseBox(e.padding),n._marginBox=n.parseBox(e.margin),e.hidden&&n.hide()},Properties:"parent,title,text,width,height,disabled,active,name,value",Methods:"renderHtml",getContainerElm:function(){return document.body},getParentCtrl:function(e){for(var t,n=this.getRoot().controlIdLookup;e&&n&&!(t=n[e.id]);)e=e.parentNode;return t},parseBox:function(e){var t,n=10;if(e)return"number"==typeof e?(e=e||0,{top:e,left:e,bottom:e,right:e}):(e=e.split(" "),t=e.length,1===t?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],n)||0,right:parseInt(e[1],n)||0,bottom:parseInt(e[2],n)||0,left:parseInt(e[3],n)||0})},borderBox:function(){return this._borderBox},paddingBox:function(){return this._paddingBox},marginBox:function(){return this._marginBox},measureBox:function(e,t){function n(t){var n=document.defaultView;return n?(t=t.replace(/[A-Z]/g,function(e){return"-"+e}),n.getComputedStyle(e,null).getPropertyValue(t)):e.currentStyle[t]}function r(e){var t=parseFloat(n(e),10);return isNaN(t)?0:t}return{top:r(t+"TopWidth"),right:r(t+"RightWidth"),bottom:r(t+"BottomWidth"),left:r(t+"LeftWidth")}},initLayoutRect:function(){var e=this,t=e.settings,n,i,o=e.getEl(),a,s,l,c,u,d,f,p;n=e._borderBox=e._borderBox||e.measureBox(o,"border"),e._paddingBox=e._paddingBox||e.measureBox(o,"padding"),e._marginBox=e._marginBox||e.measureBox(o,"margin"),p=r.getSize(o),d=t.minWidth,f=t.minHeight,l=d||p.width,c=f||p.height,a=t.width,s=t.height,u=t.autoResize,u="undefined"!=typeof u?u:!a&&!s,a=a||l,s=s||c;var m=n.left+n.right,h=n.top+n.bottom,g=t.maxWidth||65535,v=t.maxHeight||65535;return e._layoutRect=i={x:t.x||0,y:t.y||0,w:a,h:s,deltaW:m,deltaH:h,contentW:a-m,contentH:s-h,innerW:a-m,innerH:s-h,startMinWidth:d||0,startMinHeight:f||0,minW:Math.min(l,g),minH:Math.min(c,v),maxW:g,maxH:v,autoResize:u,scrollW:0},e._lastLayoutRect={},i},layoutRect:function(e){var t=this,n=t._layoutRect,r,i,o,a,s,c;return n||(n=t.initLayoutRect()),e?(o=n.deltaW,a=n.deltaH,e.x!==s&&(n.x=e.x),e.y!==s&&(n.y=e.y),e.minW!==s&&(n.minW=e.minW),e.minH!==s&&(n.minH=e.minH),i=e.w,i!==s&&(i=in.maxW?n.maxW:i,n.w=i,n.innerW=i-o),i=e.h,i!==s&&(i=in.maxH?n.maxH:i,n.h=i,n.innerH=i-a),i=e.innerW,i!==s&&(i=in.maxW-o?n.maxW-o:i,n.innerW=i,n.w=i+o),i=e.innerH,i!==s&&(i=in.maxH-a?n.maxH-a:i,n.innerH=i,n.h=i+a),e.contentW!==s&&(n.contentW=e.contentW),e.contentH!==s&&(n.contentH=e.contentH),r=t._lastLayoutRect,(r.x!==n.x||r.y!==n.y||r.w!==n.w||r.h!==n.h)&&(c=l.repaintControls,c&&c.map&&!c.map[t._id]&&(c.push(t),c.map[t._id]=!0),r.x=n.x,r.y=n.y,r.w=n.w,r.h=n.h),t):n},repaint:function(){var e=this,t,n,r,i,o=0,a=0,s,l;l=document.createRange?function(e){return e}:Math.round,t=e.getEl().style,r=e._layoutRect,s=e._lastRepaintRect||{},i=e._borderBox,o=i.left+i.right,a=i.top+i.bottom,r.x!==s.x&&(t.left=l(r.x)+"px",s.x=r.x),r.y!==s.y&&(t.top=l(r.y)+"px",s.y=r.y),r.w!==s.w&&(t.width=l(r.w-o)+"px",s.w=r.w),r.h!==s.h&&(t.height=l(r.h-a)+"px",s.h=r.h),e._hasBody&&r.innerW!==s.innerW&&(n=e.getEl("body").style,n.width=l(r.innerW)+"px",s.innerW=r.innerW),e._hasBody&&r.innerH!==s.innerH&&(n=n||e.getEl("body").style,n.height=l(r.innerH)+"px",s.innerH=r.innerH),e._lastRepaintRect=s,e.fire("repaint",{},!1)},on:function(e,t){function n(e){var t,n;return function(i){return t||r.parents().each(function(r){var i=r.settings.callbacks;return i&&(t=i[e])?(n=r,!1):void 0}),t.call(n,i)}}var r=this,o,a,s,l;if(t)for("string"==typeof t&&(t=n(t)),s=e.toLowerCase().split(" "),l=s.length;l--;)e=s[l],o=r._bindings,o||(o=r._bindings={}),a=o[e],a||(a=o[e]=[]),a.push(t),i[e]&&(r._nativeEvents?r._nativeEvents[e]=!0:r._nativeEvents={name:!0},r._rendered&&r.bindPendingEvents());return r},off:function(e,t){var n=this,r,i=n._bindings,o,a,s,l;if(i)if(e)for(s=e.toLowerCase().split(" "),r=s.length;r--;){if(e=s[r],o=i[e],!e){for(a in i)i[a].length=0;return n}if(o)if(t)for(l=o.length;l--;)o[l]===t&&o.splice(l,1);else o.length=0}else n._bindings=[];return n},fire:function(e,t,n){function r(){return!1}function i(){return!0}var o=this,a,s,l,c;if(e=e.toLowerCase(),t=t||{},t.type||(t.type=e),t.control||(t.control=o),t.preventDefault||(t.preventDefault=function(){t.isDefaultPrevented=i},t.stopPropagation=function(){t.isPropagationStopped=i},t.stopImmediatePropagation=function(){t.isImmediatePropagationStopped=i},t.isDefaultPrevented=r,t.isPropagationStopped=r,t.isImmediatePropagationStopped=r),o._bindings&&(l=o._bindings[e]))for(a=0,s=l.length;s>a&&(t.isImmediatePropagationStopped()||l[a].call(o,t)!==!1);a++);if(n!==!1)for(c=o.parent();c&&!t.isPropagationStopped();)c.fire(e,t,!1),c=c.parent();return t},hasEventListeners:function(e){return e in this._bindings},parents:function(e){var t=this,r,i=new n;for(r=t.parent();r;r=r.parent())i.add(r);return e&&(i=i.filter(e)),i},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},findCommonAncestor:function(e,t){for(var n;e;){for(n=t;n&&e!=n;)n=n.parent();if(e==n)break;e=e.parent()}return e},hasClass:function(e,t){var n=this._classes[t||"control"];return e=this.classPrefix+e,n&&!!n.map[e]},addClass:function(e,t){var n=this,r,i;return e=this.classPrefix+e,r=n._classes[t||"control"],r||(r=[],r.map={},n._classes[t||"control"]=r),r.map[e]||(r.map[e]=e,r.push(e),n._rendered&&(i=n.getEl(t),i&&(i.className=r.join(" ")))),n},removeClass:function(e,t){var n=this,r,i,o;if(e=this.classPrefix+e,r=n._classes[t||"control"],r&&r.map[e])for(delete r.map[e],i=r.length;i--;)r[i]===e&&r.splice(i,1);return n._rendered&&(o=n.getEl(t),o&&(o.className=r.join(" "))),n},toggleClass:function(e,t,n){var r=this;return t?r.addClass(e,n):r.removeClass(e,n),r},classes:function(e){var t=this._classes[e||"control"];return t?t.join(" "):""},innerHtml:function(e){return r.innerHtml(this.getEl(),e),this},getEl:function(e,t){var n,i=e?this._id+"-"+e:this._id;return n=o[i]=(t===!0?null:o[i])||r.get(i)},visible:function(e){var t=this,n;return"undefined"!=typeof e?(t._visible!==e&&(t._rendered&&(t.getEl().style.display=e?"":"none"),t._visible=e,n=t.parent(),n&&(n._lastRect=null),t.fire(e?"show":"hide")),t):t._visible},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,r=n.getEl(n.ariaTarget);return"undefined"==typeof t?n._aria[e]:(n._aria[e]=t,n._rendered&&r.setAttribute("role"==e?e:"aria-"+e,t),n)},encode:function(e,t){return t!==!1&&l.translate&&(e=l.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},before:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t),!0),t},after:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t)),t},remove:function(){var e=this,t=e.getEl(),n=e.parent(),i,a;if(e.items){var s=e.items().toArray();for(a=s.length;a--;)s[a].remove()}n&&n.items&&(i=[],n.items().each(function(t){t!==e&&i.push(t)}),n.items().set(i),n._lastRect=null),e._eventsRoot&&e._eventsRoot==e&&r.off(t);var l=e.getRoot().controlIdLookup;if(l&&delete l[e._id],delete o[e._id],t&&t.parentNode){var c=t.getElementsByTagName("*");for(a=c.length;a--;)delete o[c[a].id];t.parentNode.removeChild(t)}return e._rendered=!1,e},renderBefore:function(e){var t=this;return e.parentNode.insertBefore(r.createFragment(t.renderHtml()),e),t.postRender(),t},renderTo:function(e){var t=this;return e=e||t.getContainerElm(),e.appendChild(r.createFragment(t.renderHtml())),t.postRender(),t},postRender:function(){var e=this,t=e.settings,n,i,o,a,s;for(a in t)0===a.indexOf("on")&&e.on(a.substr(2),t[a]);if(e._eventsRoot){for(o=e.parent();!s&&o;o=o.parent())s=o._eventsRoot;if(s)for(a in s._nativeEvents)e._nativeEvents[a]=!0}e.bindPendingEvents(),t.style&&(n=e.getEl(),n&&(n.setAttribute("style",t.style),n.style.cssText=t.style)),e._visible||r.css(e.getEl(),"display","none"),e.settings.border&&(i=e.borderBox(),r.css(e.getEl(),{"border-top-width":i.top,"border-right-width":i.right,"border-bottom-width":i.bottom,"border-left-width":i.left}));var l=e.getRoot();l.controlIdLookup||(l.controlIdLookup={}),l.controlIdLookup[e._id]=e;for(var c in e._aria)e.aria(c,e._aria[c]);e.fire("postrender",{},!1)},scrollIntoView:function(e){function t(e,t){var n,r,i=e;for(n=r=0;i&&i!=t&&i.nodeType;)n+=i.offsetLeft||0,r+=i.offsetTop||0,i=i.offsetParent;return{x:n,y:r}}var n=this.getEl(),r=n.parentNode,i,o,a,s,l,c,u=t(n,r);return i=u.x,o=u.y,a=n.offsetWidth,s=n.offsetHeight,l=r.clientWidth,c=r.clientHeight,"end"==e?(i-=l-a,o-=c-s):"center"==e&&(i-=l/2-a/2,o-=c/2-s/2),r.scrollLeft=i,r.scrollTop=o,this},bindPendingEvents:function(){function e(e){var t=o.getParentCtrl(e.target);t&&t.fire(e.type,e)}function t(){var e=d._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),d._lastHoverCtrl=null)}function n(e){var t=o.getParentCtrl(e.target),n=d._lastHoverCtrl,r=0,i,a,s;if(t!==n){if(d._lastHoverCtrl=t,a=t.parents().toArray().reverse(),a.push(t),n){for(s=n.parents().toArray().reverse(),s.push(n),r=0;r=r;i--)n=s[i],n.fire("mouseleave",{target:n.getEl()})}for(i=r;il;l++)d=u[l]._eventsRoot;for(d||(d=u[u.length-1]||o),o._eventsRoot=d,c=l,l=0;c>l;l++)u[l]._eventsRoot=d;for(p in f){if(!f)return!1;"wheel"!==p||s?("mouseenter"===p||"mouseleave"===p?d._hasMouseEnter||(r.on(d.getEl(),"mouseleave",t),r.on(d.getEl(),"mouseover",n),d._hasMouseEnter=1):d[p]||(r.on(d.getEl(),p,e),d[p]=!0),f[p]=!1):a?r.on(o.getEl(),"mousewheel",i):r.on(o.getEl(),"DOMMouseScroll",i)}}},getRoot:function(){for(var e=this,t,n=[];e;){if(e.rootControl){t=e.rootControl;break}n.push(e),t=e,e=e.parent()}t||(t=this);for(var r=n.length;r--;)n[r].rootControl=t;return t},reflow:function(){return this.repaint(),this}});return l}),r(q,[],function(){var e={},t;return{add:function(t,n){e[t.toLowerCase()]=n},has:function(t){return!!e[t.toLowerCase()]},create:function(n,r){var i,o,a;if(!t){a=tinymce.ui;for(o in a)e[o.toLowerCase()]=a[o];t=!0}if("string"==typeof n?(r=r||{},r.type=n):(r=n,n=r.type),n=n.toLowerCase(),i=e[n],!i)throw new Error("Could not find control by type: "+n);return i=new i(r),i.type=n,i}}}),r($,[],function(){return function(e){function t(e){return e=e||b,e&&e.getAttribute("role")}function n(e){for(var n,r=e||b;r=r.parentNode;)if(n=t(r))return n}function r(e){var t=b;return t?t.getAttribute("aria-"+e):void 0}function i(e){return"INPUT"==e.tagName||"TEXTAREA"==e.tagName}function o(e){return i(e)&&!e.hidden?!0:/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell)$/.test(t(e))?!0:!1}function a(e){function t(e){if(1==e.nodeType&&"none"!=e.style.display){o(e)&&n.push(e);for(var r=0;re?e=t.length-1:e>=t.length&&(e=0),t[e]&&t[e].focus(),e}function u(e,t){var n=-1,r=s();t=t||a(r.getEl());for(var i=0;i=0&&(n=t.getEl(),n&&n.parentNode.removeChild(n),n=e.getEl(),n&&n.parentNode.removeChild(n)),t.parent(this)},create:function(t){var n=this,i,a=[];return o.isArray(t)||(t=[t]),o.each(t,function(t){t&&(t instanceof e||("string"==typeof t&&(t={type:t}),i=o.extend({},n.settings.defaults,t),t.type=i.type=i.type||t.type||n.settings.defaultType||(i.defaults?i.defaults.type:null),t=r.create(i)),a.push(t))}),a},renderNew:function(){var e=this;return e.items().each(function(t,n){var r,i;t.parent(e),t._rendered||(r=e.getEl("body"),i=a.createFragment(t.renderHtml()),r.hasChildNodes()&&n<=r.childNodes.length-1?r.insertBefore(i,r.childNodes[n]):r.appendChild(i),t.postRender())}),e._layout.applyClasses(e),e._lastRect=null,e},append:function(e){return this.add(e).renderNew()},prepend:function(e){var t=this;return t.items().set(t.create(e).concat(t.items().toArray())),t.renderNew()},insert:function(e,t,n){var r=this,i,o,a;return e=r.create(e),i=r.items(),!n&&t=0&&t
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "},postRender:function(){var e=this,t;return e.items().exec("postRender"),e._super(),e._layout.postRender(e),e._rendered=!0,e.settings.style&&a.css(e.getEl(),e.settings.style),e.settings.border&&(t=e.borderBox(),a.css(e.getEl(),{"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left})),e.parent()||(e.keyboardNav=new i({root:e})),e},initLayoutRect:function(){var e=this,t=e._super();return e._layout.recalc(e),t},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;return n&&n.w==t.w&&n.h==t.h?void 0:(e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0)},reflow:function(){var t;if(this.visible()){for(e.repaintControls=[],e.repaintControls.map={},this.recalc(),t=e.repaintControls.length;t--;)e.repaintControls[t].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),e.repaintControls=[]}return this}})}),r(K,[V],function(e){function t(){var e=document,t,n,r,i,o,a,s,l,c=Math.max;return t=e.documentElement,n=e.body,r=c(t.scrollWidth,n.scrollWidth),i=c(t.clientWidth,n.clientWidth),o=c(t.offsetWidth,n.offsetWidth),a=c(t.scrollHeight,n.scrollHeight),s=c(t.clientHeight,n.clientHeight),l=c(t.offsetHeight,n.offsetHeight),{width:o>r?i:r,height:l>a?s:a}}return function(n,r){function i(){return a.getElementById(r.handle||n)}var o,a=document,s,l,c,u,d,f;r=r||{},l=function(n){var l=t(),p,m;n.preventDefault(),s=n.button,p=i(),d=n.screenX,f=n.screenY,m=window.getComputedStyle?window.getComputedStyle(p,null).getPropertyValue("cursor"):p.runtimeStyle.cursor,o=a.createElement("div"),e.css(o,{position:"absolute",top:0,left:0,width:l.width,height:l.height,zIndex:2147483647,opacity:1e-4,background:"red",cursor:m}),a.body.appendChild(o),e.on(a,"mousemove",u),e.on(a,"mouseup",c),r.start(n)},u=function(e){return e.button!==s?c(e):(e.deltaX=e.screenX-d,e.deltaY=e.screenY-f,e.preventDefault(),void r.drag(e))},c=function(t){e.off(a,"mousemove",u),e.off(a,"mouseup",c),o.parentNode.removeChild(o),r.stop&&r.stop(t)},this.destroy=function(){e.off(i())},e.on(i(),"mousedown",l)}}),r(Y,[V,K],function(e,t){return{init:function(){var e=this;e.on("repaint",e.renderScroll)},renderScroll:function(){function n(){function t(t,a,s,l,c,u){var d,f,p,m,h,g,v,y,b;if(f=i.getEl("scroll"+t)){if(y=a.toLowerCase(),b=s.toLowerCase(),i.getEl("absend")&&e.css(i.getEl("absend"),y,i.layoutRect()[l]-1),!c)return void e.css(f,"display","none");e.css(f,"display","block"),d=i.getEl("body"),p=i.getEl("scroll"+t+"t"),m=d["client"+s]-2*o,m-=n&&r?f["client"+u]:0,h=d["scroll"+s],g=m/h,v={},v[y]=d["offset"+a]+o,v[b]=m,e.css(f,v),v={},v[y]=d["scroll"+a]*g,v[b]=m*g,e.css(p,v)}}var n,r,a;a=i.getEl("body"),n=a.scrollWidth>a.clientWidth,r=a.scrollHeight>a.clientHeight,t("h","Left","Width","contentW",n,"Height"),t("v","Top","Height","contentH",r,"Width")}function r(){function n(n,r,a,s,l){var c,u=i._id+"-scroll"+n,d=i.classPrefix;i.getEl().appendChild(e.createFragment('
    ')),i.draghelper=new t(u+"t",{start:function(){c=i.getEl("body")["scroll"+r],e.addClass(e.get(u),d+"active")},drag:function(e){var t,u,d,f,p=i.layoutRect();u=p.contentW>p.innerW,d=p.contentH>p.innerH,f=i.getEl("body")["client"+a]-2*o,f-=u&&d?i.getEl("scroll"+n)["client"+l]:0,t=f/i.getEl("body")["scroll"+a],i.getEl("body")["scroll"+r]=c+e["delta"+s]/t},stop:function(){e.removeClass(e.get(u),d+"active")}})}i.addClass("scroll"),n("v","Top","Height","Y","Width"),n("h","Left","Width","X","Height")}var i=this,o=2;i.settings.autoScroll&&(i._hasScroll||(i._hasScroll=!0,r(),i.on("wheel",function(e){var t=i.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),e.on(i.getEl("body"),"scroll",n)),n())}}}),r(G,[j,Y],function(e,t){return e.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[t],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),"undefined"==typeof n?n='
    '+t.renderHtml(e)+"
    ":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'
    '+(e._preBodyHtml||"")+n+"
    "}})}),r(X,[V],function(e){function t(t,n,r){var i,o,a,s,l,c,u,d,f,p;return f=e.getViewPort(),o=e.getPos(n),a=o.x,s=o.y,t._fixed&&(a-=f.x,s-=f.y),i=t.getEl(),p=e.getSize(i),l=p.width,c=p.height,p=e.getSize(n),u=p.width,d=p.height,r=(r||"").split(""),"b"===r[0]&&(s+=d),"r"===r[1]&&(a+=u),"c"===r[0]&&(s+=Math.round(d/2)),"c"===r[1]&&(a+=Math.round(u/2)),"b"===r[3]&&(s-=c),"r"===r[4]&&(a-=l),"c"===r[3]&&(s-=Math.round(c/2)),"c"===r[4]&&(a-=Math.round(l/2)),{x:a,y:s,w:l,h:c}}return{testMoveRel:function(n,r){for(var i=e.getViewPort(),o=0;o0&&a.x+a.w0&&a.y+a.hi.x&&a.x+a.wi.y&&a.y+a.he?0:e+n>t?(e=t-n,0>e?0:e):e}var i=this;if(i.settings.constrainToViewport){var o=e.getViewPort(window),a=i.layoutRect();t=r(t,o.w+o.x,a.w),n=r(n,o.h+o.y,a.h)}return i._rendered?i.layoutRect({x:t,y:n}).repaint():(i.settings.x=t,i.settings.y=n),i.fire("move",{x:t,y:n}),i}}}),r(J,[V],function(e){return{resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(t,n){if(1>=t||1>=n){var r=e.getWindowSize();t=1>=t?t*r.w:t,n=1>=n?n*r.h:n}return this._layoutRect.autoResize=!1,this.layoutRect({minW:t,minH:n,w:t,h:n}).reflow()},resizeBy:function(e,t){var n=this,r=n.layoutRect();return n.resizeTo(r.w+e,r.h+t)}}}),r(Q,[G,X,J,V],function(e,t,n,r){function i(e){var t;for(t=s.length;t--;)s[t]===e&&s.splice(t,1);for(t=l.length;t--;)l[t]===e&&l.splice(t,1)}var o,a,s=[],l=[],c,u=e.extend({Mixins:[t,n],init:function(e){function t(){var e,t=u.zIndex||65535,n;if(l.length)for(e=0;en&&(e.fixed(!1).layoutRect({y:e._autoFixY}).repaint(),t(!1,e._autoFixY-n)):(e._autoFixY=e.layoutRect().y,e._autoFixY'),n=n.firstChild,d.getContainerElm().appendChild(n),setTimeout(function(){r.addClass(n,i+"in"),r.addClass(d.getEl(),i+"in")},0),c=!0),l.push(d),t()}}),d.on("close hide",function(e){if(e.control==d){for(var n=l.length;n--;)l[n]===d&&l.splice(n,1);t()}}),d.on("show",function(){d.parents().each(function(e){return e._fixed?(d.fixed(!0),!1):void 0})}),e.popover&&(d._preBodyHtml='
    ',d.addClass("popover").addClass("bottom").addClass(d.isRtl()?"end":"start"))},fixed:function(e){var t=this;if(t._fixed!=e){if(t._rendered){var n=r.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.toggleClass("fixed",e),t._fixed=e}return t},show:function(){var e=this,t,n=e._super();for(t=s.length;t--&&s[t]!==e;);return-1===t&&s.push(e),n},hide:function(){return i(this),this._super()},hideAll:function(){u.hideAll()},close:function(){var e=this;return e.fire("close"),e.remove()},remove:function(){i(this),this._super()},postRender:function(){var e=this;return e.settings.bodyRole&&this.getEl("body").setAttribute("role",e.settings.bodyRole),e._super()}});return u.hideAll=function(){for(var e=s.length;e--;){var t=s[e];t&&t.settings.autohide&&(t.hide(),s.splice(e,1))}},u}),r(Z,[Q,G,V,K],function(e,t,n,r){var i=e.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var n=this;n._super(e),n.isRtl()&&n.addClass("rtl"),n.addClass("window"),n._fixed=!0,e.buttons&&(n.statusbar=new t({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:n.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons}),n.statusbar.addClass("foot"),n.statusbar.parent(n)),n.on("click",function(e){-1!=e.target.className.indexOf(n.classPrefix+"close")&&n.close() -}),n.on("cancel",function(){n.close()}),n.aria("describedby",n.describedBy||n._id+"-none"),n.aria("label",e.title),n._fullscreen=!1},recalc:function(){var e=this,t=e.statusbar,r,i,o,a;e._fullscreen&&(e.layoutRect(n.getWindowSize()),e.layoutRect().contentH=e.layoutRect().innerH),e._super(),r=e.layoutRect(),e.settings.title&&!e._fullscreen&&(i=r.headerW,i>r.w&&(o=r.x-Math.max(0,i/2),e.layoutRect({w:i,x:o}),a=!0)),t&&(t.layoutRect({w:e.layoutRect().innerW}).recalc(),i=t.layoutRect().minW+r.deltaW,i>r.w&&(o=r.x-Math.max(0,i-r.w),e.layoutRect({w:i,x:o}),a=!0)),a&&e.recalc()},initLayoutRect:function(){var e=this,t=e._super(),r=0,i;if(e.settings.title&&!e._fullscreen){i=e.getEl("head");var o=n.getSize(i);t.headerW=o.width,t.headerH=o.height,r+=t.headerH}e.statusbar&&(r+=e.statusbar.layoutRect().h),t.deltaH+=r,t.minH+=r,t.h+=r;var a=n.getWindowSize();return t.x=Math.max(0,a.w/2-t.w/2),t.y=Math.max(0,a.h/2-t.h/2),t},renderHtml:function(){var e=this,t=e._layout,n=e._id,r=e.classPrefix,i=e.settings,o="",a="",s=i.html;return e.preRender(),t.preRender(e),i.title&&(o='
    '+e.encode(i.title)+'
    '),i.url&&(s=''),"undefined"==typeof s&&(s=t.renderHtml(e)),e.statusbar&&(a=e.statusbar.renderHtml()),'
    '+o+'
    '+s+"
    "+a+"
    "},fullscreen:function(e){var t=this,r=document.documentElement,i,o=t.classPrefix,a;if(e!=t._fullscreen)if(n.on(window,"resize",function(){var e;if(t._fullscreen)if(i)t._timer||(t._timer=setTimeout(function(){var e=n.getWindowSize();t.moveTo(0,0).resizeTo(e.w,e.h),t._timer=0},50));else{e=(new Date).getTime();var r=n.getWindowSize();t.moveTo(0,0).resizeTo(r.w,r.h),(new Date).getTime()-e>50&&(i=!0)}}),a=t.layoutRect(),t._fullscreen=e,e){t._initial={x:a.x,y:a.y,w:a.w,h:a.h},t._borderBox=t.parseBox("0"),t.getEl("head").style.display="none",a.deltaH-=a.headerH+2,n.addClass(r,o+"fullscreen"),n.addClass(document.body,o+"fullscreen"),t.addClass("fullscreen");var s=n.getWindowSize();t.moveTo(0,0).resizeTo(s.w,s.h)}else t._borderBox=t.parseBox(t.settings.border),t.getEl("head").style.display="",a.deltaH+=a.headerH,n.removeClass(r,o+"fullscreen"),n.removeClass(document.body,o+"fullscreen"),t.removeClass("fullscreen"),t.moveTo(t._initial.x,t._initial.y).resizeTo(t._initial.w,t._initial.h);return t.reflow()},postRender:function(){var e=this,t;setTimeout(function(){e.addClass("in")},0),e._super(),e.statusbar&&e.statusbar.postRender(),e.focus(),this.dragHelper=new r(e._id+"-dragh",{start:function(){t={x:e.layoutRect().x,y:e.layoutRect().y}},drag:function(n){e.moveTo(t.x+n.deltaX,t.y+n.deltaY)}}),e.on("submit",function(t){t.isDefaultPrevented()||e.close()})},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e=this,t=e.classPrefix;e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove(),e._fullscreen&&(n.removeClass(document.documentElement,t+"fullscreen"),n.removeClass(document.body,t+"fullscreen"))}});return i}),r(et,[Z],function(e){var t=e.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(n){var r,i=n.callback||function(){};switch(n.buttons){case t.OK_CANCEL:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}},{type:"button",text:"Cancel",onClick:function(e){e.control.parents()[1].close(),i(!1)}}];break;case t.YES_NO:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}}];break;case t.YES_NO_CANCEL:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close()}}];break;default:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}}]}return new e({padding:20,x:n.x,y:n.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:r,title:n.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:n.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:n.onClose,onCancel:function(){i(!1)}}).renderTo(document.body).reflow()},alert:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,t.msgBox(e)},confirm:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,e.buttons=t.OK_CANCEL,t.msgBox(e)}}});return t}),r(tt,[Z,et],function(e,t){return function(n){function r(){return o.length?o[o.length-1]:void 0}var i=this,o=[];i.windows=o,i.open=function(t,r){var i;return n.editorManager.activeEditor=n,t.title=t.title||" ",t.url=t.url||t.file,t.url&&(t.width=parseInt(t.width||320,10),t.height=parseInt(t.height||240,10)),t.body&&(t.items={defaults:t.defaults,type:t.bodyType||"form",items:t.body}),t.url||t.buttons||(t.buttons=[{text:"Ok",subtype:"primary",onclick:function(){i.find("form")[0].submit()}},{text:"Cancel",onclick:function(){i.close()}}]),i=new e(t),o.push(i),i.on("close",function(){for(var e=o.length;e--;)o[e]===i&&o.splice(e,1);n.focus()}),t.data&&i.on("postRender",function(){this.find("*").each(function(e){var n=e.name();n in t.data&&e.value(t.data[n])})}),i.features=t||{},i.params=r||{},n.nodeChanged(),i.renderTo(document.body).reflow()},i.alert=function(e,r,i){t.alert(e,function(){r?r.call(i||this):n.focus()})},i.confirm=function(e,n,r){t.confirm(e,function(e){n.call(r||this,e)})},i.close=function(){r()&&r().close()},i.getParams=function(){return r()?r().params:null},i.setParams=function(e){r()&&(r().params=e)}}}),r(nt,[R,B,x,h,g,p],function(e,t,n,r,i,o){return function(a){function s(e,t){try{a.getDoc().execCommand(e,!1,t)}catch(n){}}function l(){var e=a.getDoc().documentMode;return e?e:6}function c(e){return e.isDefaultPrevented()}function u(){function t(e){var t=new i(function(){});o.each(a.getBody().getElementsByTagName("*"),function(e){"SPAN"==e.tagName&&e.setAttribute("mce-data-marked",1),!e.hasAttribute("data-mce-style")&&e.hasAttribute("style")&&a.dom.setAttrib(e,"style",e.getAttribute("style"))}),t.observe(a.getDoc(),{childList:!0,attributes:!0,subtree:!0,attributeFilter:["style"]}),a.getDoc().execCommand(e?"ForwardDelete":"Delete",!1,null);var n=a.selection.getRng(),r=n.startContainer.parentNode;o.each(t.takeRecords(),function(e){if("style"==e.attributeName){var t=e.target.getAttribute("data-mce-style");t?e.target.setAttribute("style",t):e.target.removeAttribute("style")}o.each(e.addedNodes,function(e){if("SPAN"==e.nodeName&&!e.getAttribute("mce-data-marked")){var t,i;e==r&&(t=n.startOffset,i=e.firstChild),U.remove(e,!0),i&&(n.setStart(i,t),n.setEnd(i,t),a.selection.setRng(n))}})}),t.disconnect(),o.each(a.dom.select("span[mce-data-marked]"),function(e){e.removeAttribute("mce-data-marked")})}var n=a.getDoc(),r="data:text/mce-internal,",i=window.MutationObserver,s;i||(s=!0,i=function(){function e(e){var t=e.relatedNode||e.target;n.push({target:t,addedNodes:[t]})}function t(e){var t=e.relatedNode||e.target;n.push({target:t,attributeName:e.attrName})}var n=[],r;this.observe=function(n){r=n,r.addEventListener("DOMSubtreeModified",e,!1),r.addEventListener("DOMNodeInsertedIntoDocument",e,!1),r.addEventListener("DOMNodeInserted",e,!1),r.addEventListener("DOMAttrModified",t,!1)},this.disconnect=function(){r.removeEventListener("DOMNodeInserted",e),r.removeEventListener("DOMAttrModified",t),r.removeEventListener("DOMSubtreeModified",e,!1)},this.takeRecords=function(){return n}}),a.on("keydown",function(n){var r=n.keyCode==V,i=e.metaKeyPressed(n);if(!c(n)&&(r||n.keyCode==W)){var o=a.selection.getRng(),s=o.startContainer,l=o.startOffset;if(!i&&o.collapsed&&3==s.nodeType&&(r?l0))return;n.preventDefault(),i&&a.selection.getSel().modify("extend",r?"forward":"backward","word"),t(r)}}),a.on("keypress",function(n){c(n)||q.isCollapsed()||!n.charCode||e.metaKeyPressed(n)||(n.preventDefault(),t(!0),a.selection.setContent(String.fromCharCode(n.charCode)))}),a.addCommand("Delete",function(){t()}),a.addCommand("ForwardDelete",function(){t(!0)}),s||(a.on("dragstart",function(e){e.dataTransfer.setData("URL","data:text/mce-internal,"+escape(a.selection.getContent()))}),a.on("drop",function(e){if(!c(e)){var i=e.dataTransfer.getData("URL");if(!i||-1==i.indexOf(r)||!n.caretRangeFromPoint)return;i=unescape(i.substr(r.length)),n.caretRangeFromPoint&&(e.preventDefault(),t(),a.selection.setRng(n.caretRangeFromPoint(e.x,e.y)),a.insertContent(i))}}),a.on("cut",function(e){!c(e)&&e.clipboardData&&(e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/html",a.selection.getContent()),e.clipboardData.setData("text/plain",a.selection.getContent({format:"text"})),t(!0))}))}function d(){function e(e){var t=U.create("body"),n=e.cloneContents();return t.appendChild(n),q.serializer.serialize(t,{format:"html"})}function n(n){if(!n.setStart){if(n.item)return!1;var r=n.duplicate();return r.moveToElementText(a.getBody()),t.compareRanges(n,r)}var i=e(n),o=U.createRng();o.selectNode(a.getBody());var s=e(o);return i===s}a.on("keydown",function(e){var t=e.keyCode,r,i;if(!c(e)&&(t==V||t==W)){if(r=a.selection.isCollapsed(),i=a.getBody(),r&&!U.isEmpty(i))return;if(!r&&!n(a.selection.getRng()))return;e.preventDefault(),a.setContent(""),i.firstChild&&U.isBlock(i.firstChild)?a.selection.setCursorLocation(i.firstChild,0):a.selection.setCursorLocation(i,0),a.nodeChanged()}})}function f(){a.on("keydown",function(t){!c(t)&&65==t.keyCode&&e.metaKeyPressed(t)&&(t.preventDefault(),a.execCommand("SelectAll"))})}function p(){a.settings.content_editable||(U.bind(a.getDoc(),"focusin",function(){q.setRng(q.getRng())}),U.bind(a.getDoc(),"mousedown",function(e){e.target==a.getDoc().documentElement&&(a.getBody().focus(),q.setRng(q.getRng()))}))}function m(){a.on("keydown",function(e){if(!c(e)&&e.keyCode===W&&q.isCollapsed()&&0===q.getRng(!0).startOffset){var t=q.getNode(),n=t.previousSibling;if("HR"==t.nodeName)return U.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(U.remove(n),e.preventDefault())}})}function h(){window.Range.prototype.getClientRects||a.on("mousedown",function(e){if(!c(e)&&"HTML"===e.target.nodeName){var t=a.getBody();t.blur(),setTimeout(function(){t.focus()},0)}})}function g(){a.on("click",function(e){e=e.target,/^(IMG|HR)$/.test(e.nodeName)&&q.getSel().setBaseAndExtent(e,0,e,1),"A"==e.nodeName&&U.hasClass(e,"mce-item-anchor")&&q.select(e),a.nodeChanged()})}function v(){function e(){var e=U.getAttribs(q.getStart().cloneNode(!1));return function(){var t=q.getStart();t!==a.getBody()&&(U.setAttrib(t,"style",null),z(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function t(){return!q.isCollapsed()&&U.getParent(q.getStart(),U.isBlock)!=U.getParent(q.getEnd(),U.isBlock)}a.on("keypress",function(n){var r;return c(n)||8!=n.keyCode&&46!=n.keyCode||!t()?void 0:(r=e(),a.getDoc().execCommand("delete",!1,null),r(),n.preventDefault(),!1)}),U.bind(a.getDoc(),"cut",function(n){var r;!c(n)&&t()&&(r=e(),setTimeout(function(){r()},0))})}function y(){var e,n;a.on("selectionchange",function(){n&&(clearTimeout(n),n=0),n=window.setTimeout(function(){if(!a.removed){var n=q.getRng();e&&t.compareRanges(n,e)||(a.nodeChanged(),e=n)}},50)})}function b(){document.body.setAttribute("role","application")}function C(){a.on("keydown",function(e){if(!c(e)&&e.keyCode===W&&q.isCollapsed()&&0===q.getRng(!0).startOffset){var t=q.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function x(){l()>7||(s("RespectVisibilityInDesign",!0),a.contentStyles.push(".mceHideBrInPre pre br {display: none}"),U.addClass(a.getBody(),"mceHideBrInPre"),j.addNodeFilter("pre",function(e){for(var t=e.length,r,i,o,a;t--;)for(r=e[t].getAll("br"),i=r.length;i--;)o=r[i],a=o.prev,a&&3===a.type&&"\n"!=a.value.charAt(a.value-1)?a.value+="\n":o.parent.insert(new n("#text",3),o,!0).value="\n"}),K.addNodeFilter("pre",function(e){for(var t=e.length,n,r,i,o;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)i=n[r],o=i.prev,o&&3==o.type&&(o.value=o.value.replace(/\r?\n$/,""))}))}function w(){U.bind(a.getBody(),"mouseup",function(){var e,t=q.getNode();"IMG"==t.nodeName&&((e=U.getStyle(t,"width"))&&(U.setAttrib(t,"width",e.replace(/[^0-9%]+/g,"")),U.setStyle(t,"width","")),(e=U.getStyle(t,"height"))&&(U.setAttrib(t,"height",e.replace(/[^0-9%]+/g,"")),U.setStyle(t,"height","")))})}function _(){a.on("keydown",function(t){var n,r,i,o,s;if(!c(t)&&t.keyCode==e.BACKSPACE&&(n=q.getRng(),r=n.startContainer,i=n.startOffset,o=U.getRoot(),s=r,n.collapsed&&0===i)){for(;s&&s.parentNode&&s.parentNode.firstChild==s&&s.parentNode!=o;)s=s.parentNode;"BLOCKQUOTE"===s.tagName&&(a.formatter.toggle("blockquote",null,s),n=U.createRng(),n.setStart(r,0),n.setEnd(r,0),q.setRng(n))}})}function N(){function e(){a._refreshContentEditable(),s("StyleWithCSS",!1),s("enableInlineTableEditing",!1),$.object_resizing||s("enableObjectResizing",!1)}$.readonly||a.on("BeforeExecCommand MouseDown",e)}function E(){function e(){z(U.select("a"),function(e){var t=e.parentNode,n=U.getRoot();if(t.lastChild===e){for(;t&&!U.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}U.add(t,"br",{"data-mce-bogus":1})}})}a.on("SetContent ExecCommand",function(t){("setcontent"==t.type||"mceInsertLink"===t.command)&&e()})}function S(){$.forced_root_block&&a.on("init",function(){s("DefaultParagraphSeparator",$.forced_root_block)})}function k(){a.on("Undo Redo SetContent",function(e){e.initial||a.execCommand("mceRepaint")})}function T(){a.on("keydown",function(e){var t;c(e)||e.keyCode!=W||(t=a.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),a.undoManager.beforeChange(),U.remove(t.item(0)),a.undoManager.add()))})}function R(){var e;l()>=10&&(e="",z("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"}),a.contentStyles.push(e+"{padding-right: 1px !important}"))}function A(){l()<9&&(j.addNodeFilter("noscript",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.firstChild,r&&n.attr("data-mce-innertext",r.value)}),K.addNodeFilter("noscript",function(e){for(var t=e.length,i,o,a;t--;)i=e[t],o=e[t].firstChild,o?o.value=r.decode(o.value):(a=i.attributes.map["data-mce-innertext"],a&&(i.attr("data-mce-innertext",null),o=new n("#text",3),o.value=a,o.raw=!0,i.append(o)))}))}function B(){function e(e,t){var n=i.createTextRange();try{n.moveToPoint(e,t)}catch(r){n=null}return n}function t(t){var r;t.button?(r=e(t.x,t.y),r&&(r.compareEndPoints("StartToStart",a)>0?r.setEndPoint("StartToStart",a):r.setEndPoint("EndToEnd",a),r.select())):n()}function n(){var e=r.selection.createRange();a&&!e.item&&0===e.compareEndPoints("StartToEnd",e)&&a.select(),U.unbind(r,"mouseup",n),U.unbind(r,"mousemove",t),a=o=0}var r=U.doc,i=r.body,o,a,s;r.documentElement.unselectable=!0,U.bind(r,"mousedown contextmenu",function(i){if("HTML"===i.target.nodeName){if(o&&n(),s=r.documentElement,s.scrollHeight>s.clientHeight)return;o=1,a=e(i.x,i.y),a&&(U.bind(r,"mouseup",n),U.bind(r,"mousemove",t),U.getRoot().focus(),a.select())}})}function L(){a.on("keyup focusin mouseup",function(t){65==t.keyCode&&e.metaKeyPressed(t)||q.normalize()},!0)}function D(){a.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function M(){a.inline||a.on("keydown",function(){document.activeElement==document.body&&a.getWin().focus()})}function H(){a.inline||(a.contentStyles.push("body {min-height: 150px}"),a.on("click",function(e){"HTML"==e.target.nodeName&&(a.getBody().focus(),a.selection.normalize(),a.nodeChanged())}))}function P(){i.mac&&a.on("keydown",function(t){!e.metaKeyPressed(t)||37!=t.keyCode&&39!=t.keyCode||(t.preventDefault(),a.selection.getSel().modify("move",37==t.keyCode?"backward":"forward","word"))})}function O(){s("AutoUrlDetect",!1)}function I(){a.inline||a.on("focus blur",function(){var e=a.dom.create("br");a.getBody().appendChild(e),e.parentNode.removeChild(e)},!0)}function F(){a.on("click",function(e){"A"===e.target.tagName&&e.preventDefault()}),a.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}var z=o.each,W=e.BACKSPACE,V=e.DELETE,U=a.dom,q=a.selection,$=a.settings,j=a.parser,K=a.serializer,Y=i.gecko,G=i.ie,X=i.webkit;C(),_(),d(),L(),X&&(u(),p(),g(),S(),i.iOS?(y(),M(),H(),F()):f()),G&&i.ie<11&&(m(),b(),x(),w(),T(),R(),A(),B()),i.ie>=11&&(H(),I()),i.ie&&(f(),O()),Y&&(m(),h(),v(),N(),E(),k(),D(),P())}}),r(rt,[p],function(e){function t(){return!1}function n(){return!0}var r="__bindings",i=e.makeMap("focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave keydown keypress keyup contextmenu dragstart dragend dragover draggesture dragdrop drop drag"," ");return{fire:function(e,i,o){var a=this,s,l,c,u,d;if(!a.removed){if(e=e.toLowerCase(),i=i||{},i.type=e,i.target||(i.target=a),i.preventDefault||(i.preventDefault=function(){i.isDefaultPrevented=n},i.stopPropagation=function(){i.isPropagationStopped=n},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=n},i.isDefaultPrevented=t,i.isPropagationStopped=t,i.isImmediatePropagationStopped=t),a[r]&&(s=a[r][e]))for(l=0,c=s.length;c>l&&(s[l]=u=s[l],!i.isImmediatePropagationStopped());l++)if(u.call(a,i)===!1)return i.preventDefault(),i;if(o!==!1&&a.parent)for(d=a.parent();d&&!i.isPropagationStopped();)d.fire(e,i,!1),d=d.parent();return i}},on:function(e,t,n){var o=this,a,s,l,c;if(t===!1&&(t=function(){return!1}),t)for(l=e.toLowerCase().split(" "),c=l.length;c--;)e=l[c],a=o[r],a||(a=o[r]={}),s=a[e],s||(s=a[e]=[],o.bindNative&&i[e]&&o.bindNative(e)),n?s.unshift(t):s.push(t);return o},off:function(e,t){var n=this,o,a=n[r],s,l,c,u;if(a)if(e)for(c=e.toLowerCase().split(" "),o=c.length;o--;){if(e=c[o],s=a[e],!e){for(l in a)a[e].length=0;return n}if(s){if(t)for(u=s.length;u--;)s[u]===t&&s.splice(u,1);else s.length=0;!s.length&&n.unbindNative&&i[e]&&(n.unbindNative(e),delete a[e])}}else{if(n.unbindNative)for(e in a)n.unbindNative(e);n[r]=[]}return n},hasEventListeners:function(e){var t=this[r];return e=e.toLowerCase(),!(!t||!t[e]||0===t[e].length)}}}),r(it,[p,g],function(e,t){var n=e.each,r=e.explode,i={f9:120,f10:121,f11:122};return function(o){var a=this,s={};o.on("keyup keypress keydown",function(e){(e.altKey||e.ctrlKey||e.metaKey)&&n(s,function(n){var r=t.mac?e.metaKey:e.ctrlKey;if(n.ctrl==r&&n.alt==e.altKey&&n.shift==e.shiftKey)return e.keyCode==n.keyCode||e.charCode&&e.charCode==n.charCode?(e.preventDefault(),"keydown"==e.type&&n.func.call(n.scope),!0):void 0})}),a.add=function(t,a,l,c){var u;return u=l,"string"==typeof l?l=function(){o.execCommand(u,!1,null)}:e.isArray(u)&&(l=function(){o.execCommand(u[0],u[1],u[2])}),n(r(t.toLowerCase()),function(e){var t={func:l,scope:c||o,desc:o.translate(a),alt:!1,ctrl:!1,shift:!1};n(r(e,"+"),function(e){switch(e){case"alt":case"ctrl":case"shift":t[e]=!0;break;default:t.charCode=e.charCodeAt(0),t.keyCode=i[e]||e.toUpperCase().charCodeAt(0)}}),s[(t.ctrl?"ctrl":"")+","+(t.alt?"alt":"")+","+(t.shift?"shift":"")+","+t.keyCode]=t}),!0}}}),r(ot,[y,C,x,k,S,L,D,M,H,P,O,I,b,l,tt,w,N,nt,g,p,rt,it],function(e,n,r,i,o,a,s,l,c,u,d,f,p,m,h,g,v,y,b,C,x,w){function _(e,t){return"selectionchange"==t?e.getDoc():!e.inline&&/^mouse|click|contextmenu|drop/.test(t)?e.getDoc():e.getBody()}function N(e,t,r){var i=this,o,a;o=i.documentBaseUrl=r.documentBaseURL,a=r.baseURI,i.settings=t=T({id:e,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:o,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:!0,entity_encoding:"named",url_converter:i.convertURL,url_converter_scope:i,ie7_compat:!0},t),n.language=t.language||"en",n.languageLoad=t.language_load,n.baseURL=r.baseURL,i.id=t.id=e,i.isNotDirty=!0,i.plugins={},i.documentBaseURI=new f(t.document_base_url||o,{base_uri:a}),i.baseURI=a,i.contentCSS=[],i.contentStyles=[],i.shortcuts=new w(i),i.execCommands={},i.queryStateCommands={},i.queryValueCommands={},i.loadedCSS={},i.suffix=r.suffix,i.editorManager=r,i.inline=t.inline,r.fire("SetupEditor",i),i.execCallback("setup",i)}var E=e.DOM,S=n.ThemeManager,k=n.PluginManager,T=C.extend,R=C.each,A=C.explode,B=C.inArray,L=C.trim,D=C.resolve,M=m.Event,H=b.gecko,P=b.ie;return N.prototype={render:function(){function e(){E.unbind(window,"ready",e),n.render()}function t(){var e=p.ScriptLoader;if(r.language&&"en"!=r.language&&!r.language_url&&(r.language_url=n.editorManager.baseURL+"/langs/"+r.language+".js"),r.language_url&&e.add(r.language_url),r.theme&&"function"!=typeof r.theme&&"-"!=r.theme.charAt(0)&&!S.urls[r.theme]){var t=r.theme_url;t=t?n.documentBaseURI.toAbsolute(t):"themes/"+r.theme+"/theme"+o+".js",S.load(r.theme,t)}C.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),R(r.external_plugins,function(e,t){k.load(t,e),r.plugins+=" "+t}),R(r.plugins.split(/[ ,]/),function(e){if(e=L(e),e&&!k.urls[e])if("-"==e.charAt(0)){e=e.substr(1,e.length);var t=k.dependencies(e);R(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=k.createUrl(t,e),k.load(e.resource,e)})}else k.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),e.loadQueue(function(){n.removed||n.init()})}var n=this,r=n.settings,i=n.id,o=n.suffix;if(!M.domLoaded)return void E.bind(window,"ready",e);if(n.getElement()&&b.contentEditable){r.inline?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");var a=n.getElement().form||E.getParent(i,"form");a&&(n.formElement=a,r.hidden_input&&!/TEXTAREA|INPUT/i.test(n.getElement().nodeName)&&(E.insertAfter(E.create("input",{type:"hidden",name:i}),i),n.hasHiddenInput=!0),n.formEventDelegate=function(e){n.fire(e.type,e)},E.bind(a,"submit reset",n.formEventDelegate),n.on("reset",function(){n.setContent(n.startContent,{format:"raw"})}),!r.submit_patch||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=function(){return n.editorManager.triggerSave(),n.isNotDirty=!0,a._mceOldSubmit(a)})),n.windowManager=new h(n),"xml"==r.encoding&&n.on("GetContent",function(e){e.save&&(e.content=E.encode(e.content))}),r.add_form_submit_trigger&&n.on("submit",function(){n.initialized&&n.save()}),r.add_unload_trigger&&(n._beforeUnload=function(){!n.initialized||n.destroyed||n.isHidden()||n.save({format:"raw",no_events:!0,set_dirty:!1})},n.editorManager.on("BeforeUnload",n._beforeUnload)),t()}},init:function(){function e(n){var r=k.get(n),i,o;i=k.urls[n]||t.documentBaseUrl.replace(/\/$/,""),n=L(n),r&&-1===B(h,n)&&(R(k.dependencies(n),function(t){e(t)}),o=new r(t,i),t.plugins[n]=o,o.init&&(o.init(t,i),h.push(n)))}var t=this,n=t.settings,r=t.getElement(),i,o,a,s,l,c,u,d,f,p,m,h=[];if(t.rtl=this.editorManager.i18n.rtl,t.editorManager.add(t),n.aria_label=n.aria_label||E.getAttrib(r,"aria-label",t.getLang("aria.rich_text_area")),n.theme&&("function"!=typeof n.theme?(n.theme=n.theme.replace(/-/,""),c=S.get(n.theme),t.theme=new c(t,S.urls[n.theme]),t.theme.init&&t.theme.init(t,S.urls[n.theme]||t.documentBaseUrl.replace(/\/$/,""))):t.theme=n.theme),R(n.plugins.replace(/\-/g,"").split(/[ ,]/),e),n.render_ui&&t.theme&&(t.orgDisplay=r.style.display,"function"!=typeof n.theme?(i=n.width||r.style.width||r.offsetWidth,o=n.height||r.style.height||r.offsetHeight,a=n.min_height||100,p=/^[0-9\.]+(|px)$/i,p.test(""+i)&&(i=Math.max(parseInt(i,10),100)),p.test(""+o)&&(o=Math.max(parseInt(o,10),a)),l=t.theme.renderUI({targetNode:r,width:i,height:o,deltaWidth:n.delta_width,deltaHeight:n.delta_height}),n.content_editable||(E.setStyles(l.sizeContainer||l.editorContainer,{wi2dth:i,h2eight:o}),o=(l.iframeHeight||o)+("number"==typeof o?l.deltaHeight||0:""),a>o&&(o=a))):(l=n.theme(t,r),l.editorContainer.nodeType&&(l.editorContainer=l.editorContainer.id=l.editorContainer.id||t.id+"_parent"),l.iframeContainer.nodeType&&(l.iframeContainer=l.iframeContainer.id=l.iframeContainer.id||t.id+"_iframecontainer"),o=l.iframeHeight||r.offsetHeight),t.editorContainer=l.editorContainer),n.content_css&&R(A(n.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),n.content_style&&t.contentStyles.push(n.content_style),n.content_editable)return r=s=l=null,t.initContentBody();for(t.iframeHTML=n.doctype+"",n.document_base_url!=t.documentBaseUrl&&(t.iframeHTML+=''),!b.caretAfter&&n.ie7_compat&&(t.iframeHTML+=''),t.iframeHTML+='',m=0;m',t.loadedCSS[g]=!0}d=n.body_id||"tinymce",-1!=d.indexOf("=")&&(d=t.getParam("body_id","","hash"),d=d[t.id]||d),f=n.body_class||"",-1!=f.indexOf("=")&&(f=t.getParam("body_class","","hash"),f=f[t.id]||""),t.iframeHTML+='
    ";var v='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody(true);})()';if(document.domain!=location.hostname&&(u=v),s=E.add(l.iframeContainer,"iframe",{id:t.id+"_ifr",src:u||'javascript:""',frameBorder:"0",allowTransparency:"true",title:t.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),style:{width:"100%",height:o,display:"block"}}),P)try{t.getDoc()}catch(y){s.src=u=v}t.contentAreaContainer=l.iframeContainer,l.editorContainer&&(E.get(l.editorContainer).style.display=t.orgDisplay),E.get(t.id).style.display="none",E.setAttrib(t.id,"aria-hidden",!0),u||t.initContentBody(),r=s=l=null},initContentBody:function(t){var n=this,o=n.settings,f=E.get(n.id),p=n.getDoc(),m,h;o.inline||(n.getElement().style.visibility=n.orgVisibility),t||o.content_editable||(p.open(),p.write(n.iframeHTML),p.close()),o.content_editable&&(n.on("remove",function(){var e=this.getBody();E.removeClass(e,"mce-content-body"),E.removeClass(e,"mce-edit-focus"),E.setAttrib(e,"tabIndex",null),E.setAttrib(e,"contentEditable",null)}),E.addClass(f,"mce-content-body"),f.tabIndex=-1,n.contentDocument=p=o.content_document||document,n.contentWindow=o.content_window||window,n.bodyElement=f,o.content_document=o.content_window=null,o.root_name=f.nodeName.toLowerCase()),m=n.getBody(),m.disabled=!0,o.readonly||(n.inline&&"static"==E.getStyle(m,"position",!0)&&(m.style.position="relative"),m.contentEditable=n.getParam("content_editable_state",!0)),m.disabled=!1,n.schema=new g(o),n.dom=new e(p,{keep_values:!0,url_converter:n.convertURL,url_converter_scope:n,hex_colors:o.force_hex_style_colors,class_filter:o.class_filter,update_styles:!0,root_element:o.content_editable?n.id:null,collect:o.content_editable,schema:n.schema,onSetAttrib:function(e){n.fire("SetAttrib",e)}}),n.parser=new v(o,n.schema),n.parser.addAttributeFilter("src,href,style",function(e,t){for(var r=e.length,i,o=n.dom,a,s;r--;)i=e[r],a=i.attr(t),s="data-mce-"+t,i.attributes.map[s]||("style"===t?i.attr(s,o.serializeStyle(o.parseStyle(a),i.name)):i.attr(s,n.convertURL(a,t,i.name)))}),n.parser.addNodeFilter("script",function(e){for(var t=e.length,n;t--;)n=e[t],n.attr("type","mce-"+(n.attr("type")||"text/javascript"))}),n.parser.addNodeFilter("#cdata",function(e){for(var t=e.length,n;t--;)n=e[t],n.type=8,n.name="#comment",n.value="[CDATA["+n.value+"]]"}),n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t=e.length,i,o=n.schema.getNonEmptyElements();t--;)i=e[t],i.isEmpty(o)&&(i.empty().append(new r("br",1)).shortEnded=!0)}),n.serializer=new i(o,n),n.selection=new a(n.dom,n.getWin(),n.serializer,n),n.formatter=new s(n),n.undoManager=new l(n),n.forceBlocks=new u(n),n.enterKey=new c(n),n.editorCommands=new d(n),n.fire("PreInit"),o.browser_spellcheck||o.gecko_spellcheck||(p.body.spellcheck=!1,E.setAttrib(m,"spellcheck","false")),n.fire("PostRender"),n.quirks=y(n),o.directionality&&(m.dir=o.directionality),o.nowrap&&(m.style.whiteSpace="nowrap"),o.protect&&n.on("BeforeSetContent",function(e){R(o.protect,function(t){e.content=e.content.replace(t,function(e){return""})})}),n.on("SetContent",function(){n.addVisual(n.getBody())}),o.padd_empty_editor&&n.on("PostProcess",function(e){e.content=e.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
    [\r\n]*)$/,"")}),n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"}),n.initialized=!0,R(n._pendingNativeEvents,function(e){n.dom.bind(_(n,e),e,function(e){n.fire(e.type,e)})}),n.fire("init"),n.focus(!0),n.nodeChanged({initial:!0}),n.execCallback("init_instance_callback",n),n.contentStyles.length>0&&(h="",R(n.contentStyles,function(e){h+=e+"\r\n"}),n.dom.addStyle(h)),R(n.contentCSS,function(e){n.loadedCSS[e]||(n.dom.loadCSS(e),n.loadedCSS[e]=!0)}),o.auto_focus&&setTimeout(function(){var e=n.editorManager.get(o.auto_focus);e.selection.select(e.getBody(),1),e.selection.collapse(1),e.getBody().focus(),e.getWin().focus()},100),f=p=m=null},focus:function(e){var t,n=this,r=n.selection,i=n.settings.content_editable,o,a,s=n.getDoc(),l;e||(o=r.getRng(),o.item&&(a=o.item(0)),n._refreshContentEditable(),i||(b.opera||n.getBody().focus(),n.getWin().focus()),(H||i)&&(l=n.getBody(),l.setActive&&b.ie<11?l.setActive():l.focus(),i&&r.normalize()),a&&a.ownerDocument==s&&(o=s.body.createControlRange(),o.addElement(a),o.select())),n.editorManager.activeEditor!=n&&((t=n.editorManager.activeEditor)&&t.fire("deactivate",{relatedTarget:n}),n.fire("activate",{relatedTarget:t})),n.editorManager.activeEditor=n},execCallback:function(e){var t=this,n=t.settings[e],r;if(n)return t.callbackLookup&&(r=t.callbackLookup[e])&&(n=r.func,r=r.scope),"string"==typeof n&&(r=n.replace(/\.\w+$/,""),r=r?D(r):0,n=D(n),t.callbackLookup=t.callbackLookup||{},t.callbackLookup[e]={func:n,scope:r}),n.apply(r||t,Array.prototype.slice.call(arguments,1))},translate:function(e){var t=this.settings.language||"en",n=this.editorManager.i18n;return e?n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"}):""},getLang:function(e,n){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(n!==t?n:"{#"+e+"}")},getParam:function(e,t,n){var r=e in this.settings?this.settings[e]:t,i;return"hash"===n?(i={},"string"==typeof r?R(r.split(r.indexOf("=")>0?/[;,](?![^=;,]*(?:[;,]|$))/:","),function(e){e=e.split("="),i[L(e[0])]=L(e.length>1?e[1]:e)}):i=r,i):r},nodeChanged:function(){var e=this,t=e.selection,n,r,i;!e.initialized||e.settings.disable_nodechange||e.settings.readonly||(i=e.getBody(),n=t.getStart()||i,n=P&&n.ownerDocument!=e.getDoc()?e.getBody():n,"IMG"==n.nodeName&&t.isCollapsed()&&(n=n.parentNode),r=[],e.dom.getParent(n,function(e){return e===i?!0:void r.push(e) -}),e.fire("NodeChange",{element:n,parents:r}))},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.text||t.icon||(t.icon=e),n.buttons=n.buttons||{},t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems||{},n.menuItems[e]=t},addCommand:function(e,t,n){this.execCommands[e]={func:t,scope:n||this}},addQueryStateHandler:function(e,t,n){this.queryStateCommands[e]={func:t,scope:n||this}},addQueryValueHandler:function(e,t,n){this.queryValueCommands[e]={func:t,scope:n||this}},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){var i=this,o=0,a;return/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||r&&r.skip_focus||i.focus(),r=T({},r),r=i.fire("BeforeExecCommand",{command:e,ui:t,value:n}),r.isDefaultPrevented()?!1:(a=i.execCommands[e])&&a.func.call(a.scope,t,n)!==!0?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):(R(i.plugins,function(r){return r.execCommand&&r.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),o=!0,!1):void 0}),o?o:i.theme&&i.theme.execCommand&&i.theme.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):i.editorCommands.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):(i.getDoc().execCommand(e,t,n),void i.fire("ExecCommand",{command:e,ui:t,value:n})))},queryCommandState:function(e){var t=this,n,r;if(!t._isHidden()){if((n=t.queryStateCommands[e])&&(r=n.func.call(n.scope),r!==!0))return r;if(r=t.editorCommands.queryCommandState(e),-1!==r)return r;try{return t.getDoc().queryCommandState(e)}catch(i){}}},queryCommandValue:function(e){var n=this,r,i;if(!n._isHidden()){if((r=n.queryValueCommands[e])&&(i=r.func.call(r.scope),i!==!0))return i;if(i=n.editorCommands.queryCommandValue(e),i!==t)return i;try{return n.getDoc().queryCommandValue(e)}catch(o){}}},show:function(){var e=this;E.show(e.getContainer()),E.hide(e.id),e.load(),e.fire("show")},hide:function(){var e=this,t=e.getDoc();P&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),E.hide(e.getContainer()),E.setStyle(e.id,"display",e.orgDisplay),e.fire("hide")},isHidden:function(){return!E.isHidden(this.id)},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var n=this,r=n.getElement(),i;return r?(e=e||{},e.load=!0,i=n.setContent(r.value!==t?r.value:r.innerHTML,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,i):void 0},save:function(e){var t=this,n=t.getElement(),r,i;if(n&&t.initialized)return e=e||{},e.save=!0,e.element=n,r=e.content=t.getContent(e),e.no_events||t.fire("SaveContent",e),r=e.content,/TEXTAREA|INPUT/i.test(n.nodeName)?n.value=r:(t.inline||(n.innerHTML=r),(i=E.getParent(t.id,"form"))&&R(i.elements,function(e){return e.name==t.id?(e.value=r,!1):void 0})),e.element=n=null,e.set_dirty!==!1&&(t.isNotDirty=!0),r},setContent:function(e,t){var n=this,r=n.getBody(),i;return t=t||{},t.format=t.format||"html",t.set=!0,t.content=e,t.no_events||n.fire("BeforeSetContent",t),e=t.content,0===e.length||/^\s+$/.test(e)?(i=n.settings.forced_root_block,i&&n.schema.isValidChild(r.nodeName.toLowerCase(),i.toLowerCase())?(e=P&&11>P?"":'
    ',e=n.dom.createHTML(i,n.settings.forced_root_block_attrs,e)):P||(e='
    '),r.innerHTML=e,n.fire("SetContent",t)):("raw"!==t.format&&(e=new o({},n.schema).serialize(n.parser.parse(e,{isRootContent:!0}))),t.content=L(e),n.dom.setHTML(r,t.content),t.no_events||n.fire("SetContent",t)),t.content},getContent:function(e){var t=this,n,r=t.getBody();return e=e||{},e.format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),n="raw"==e.format?r.innerHTML:"text"==e.format?r.innerText||r.textContent:t.serializer.serialize(r,e),e.content="text"!=e.format?L(n):n,e.no_events||t.fire("GetContent",e),e.content},insertContent:function(e){this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},getContainer:function(){var e=this;return e.container||(e.container=E.get(e.editorContainer||e.id+"_parent")),e.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return E.get(this.settings.content_element||this.id)},getWin:function(){var e=this,t;return e.contentWindow||(t=E.get(e.id+"_ifr"),t&&(e.contentWindow=t.contentWindow)),e.contentWindow},getDoc:function(){var e=this,t;return e.contentDocument||(t=e.getWin(),t&&(e.contentDocument=t.document)),e.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(e,t,n){var r=this,i=r.settings;return i.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!i.convert_urls||n&&"LINK"==n.nodeName||0===e.indexOf("file:")||0===e.length?e:i.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,i.remove_script_host)},addVisual:function(e){var n=this,r=n.settings,i=n.dom,o;e=e||n.getBody(),n.hasVisual===t&&(n.hasVisual=r.visual),R(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return o=r.visual_table_class||"mce-item-table",t=i.getAttrib(e,"border"),void(t&&"0"!=t||(n.hasVisual?i.addClass(e,o):i.removeClass(e,o)));case"A":return void(i.getAttrib(e,"href",!1)||(t=i.getAttrib(e,"name")||e.id,o=r.visual_anchor_class||"mce-item-anchor",t&&(n.hasVisual?i.addClass(e,o):i.removeClass(e,o))))}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this;if(!e.removed){e.save(),e.fire("remove"),e.off(),e.removed=1,e.hasHiddenInput&&E.remove(e.getElement().nextSibling),E.setStyle(e.id,"display",e.orgDisplay),e.settings.content_editable||(M.unbind(e.getWin()),M.unbind(e.getDoc()));var t=e.getContainer();M.unbind(e.getBody()),M.unbind(t),e.editorManager.remove(e),E.remove(t),e.destroy()}},bindNative:function(e){var t=this;t.settings.readonly||(t.initialized?t.dom.bind(_(t,e),e,function(n){t.fire(e,n)}):t._pendingNativeEvents?t._pendingNativeEvents.push(e):t._pendingNativeEvents=[e])},unbindNative:function(e){var t=this;t.initialized&&t.dom.unbind(e)},destroy:function(e){var t=this,n;if(!t.destroyed){if(!e&&!t.removed)return void t.remove();e&&H&&(M.unbind(t.getDoc()),M.unbind(t.getWin()),M.unbind(t.getBody())),e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),t.selection.destroy(),t.dom.destroy()),n=t.formElement,n&&(n._mceOldSubmit&&(n.submit=n._mceOldSubmit,n._mceOldSubmit=null),E.unbind(n,"submit reset",t.formEventDelegate)),t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.settings.content_element=t.bodyElement=t.contentDocument=t.contentWindow=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null),t.destroyed=1}},_refreshContentEditable:function(){var e=this,t,n;e._isHidden()&&(t=e.getBody(),n=t.parentNode,n.removeChild(t),n.appendChild(t),t.focus())},_isHidden:function(){var e;return H?(e=this.selection.getSel(),!e||!e.rangeCount||0===e.rangeCount):0}},T(N.prototype,x),N}),r(at,[],function(){var e={};return{rtl:!1,add:function(t,n){for(var r in n)e[r]=n[r];this.rtl=this.rtl||"rtl"===e._dir},translate:function(t){if("undefined"==typeof t)return t;if("string"!=typeof t&&t.raw)return t.raw;if(t.push){var n=t.slice(1);t=(e[t[0]]||t[0]).replace(/\{([^\}]+)\}/g,function(e,t){return n[t]})}return e[t]||t},data:e}}),r(st,[y,g],function(e,t){function n(e){function a(){try{return document.activeElement}catch(e){return document.body}}function s(e){return e&&e.startContainer?{startContainer:e.startContainer,startOffset:e.startOffset,endContainer:e.endContainer,endOffset:e.endOffset}:e}function l(e,t){var n;return t.startContainer?(n=e.getDoc().createRange(),n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n=t,n}function c(e){return!!o.getParent(e,n.isEditorUIElement)}function u(e,t){for(var n=t.getBody();e;){if(e==n)return!0;e=e.parentNode}}function d(n){var d=n.editor;d.on("init",function(){(d.inline||t.ie)&&(d.on("nodechange keyup",function(){var e=document.activeElement;e&&e.id==d.id+"_ifr"&&(e=d.getBody()),u(e,d)&&(d.lastRng=d.selection.getRng())}),t.webkit&&!r&&(r=function(){var t=e.activeEditor;if(t&&t.selection){var n=t.selection.getRng();n&&!n.collapsed&&(d.lastRng=n)}},o.bind(document,"selectionchange",r)))}),d.on("setcontent",function(){d.lastRng=null}),d.on("mousedown",function(){d.selection.lastFocusBookmark=null}),d.on("focusin",function(){var t=e.focusedEditor;d.selection.lastFocusBookmark&&(d.selection.setRng(l(d,d.selection.lastFocusBookmark)),d.selection.lastFocusBookmark=null),t!=d&&(t&&t.fire("blur",{focusedEditor:d}),e.activeEditor=d,e.focusedEditor=d,d.fire("focus",{blurredEditor:t}),d.focus(!0)),d.lastRng=null}),d.on("focusout",function(){window.setTimeout(function(){var t=e.focusedEditor;c(a())||t!=d||(d.fire("blur",{focusedEditor:null}),e.focusedEditor=null,d.selection&&(d.selection.lastFocusBookmark=null))},0)}),i||(i=function(t){var n=e.activeEditor;n&&t.target.ownerDocument==document&&(n.selection&&(n.selection.lastFocusBookmark=s(n.lastRng)),c(t.target)||e.focusedEditor!=n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null))},o.bind(document,"focusin",i))}function f(t){e.focusedEditor==t.editor&&(e.focusedEditor=null),e.activeEditor||(o.unbind(document,"selectionchange",r),o.unbind(document,"focusin",i),r=i=null)}e.on("AddEditor",d),e.on("RemoveEditor",f)}var r,i,o=e.DOM;return n.isEditorUIElement=function(e){return-1!==e.className.toString().indexOf("mce-")},n}),r(lt,[ot,y,I,g,p,rt,at,st],function(e,n,r,i,o,a,s,l){var c=n.DOM,u=o.explode,d=o.each,f=o.extend,p=0,m,h={majorVersion:"4",minorVersion:"0.20",releaseDate:"2014-03-18",editors:[],i18n:s,activeEditor:null,setup:function(){var e=this,t,n,i="",o;if(n=document.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/"),o=window.tinymce||window.tinyMCEPreInit)t=o.base||o.baseURL,i=o.suffix;else for(var a=document.getElementsByTagName("script"),s=0;s0&&d(u(m),function(n){c.get(n)?(l=new e(n,t,a),s.push(l),l.render(!0)):d(document.forms,function(r){d(r.elements,function(r){r.name===n&&(n="mce_editor_"+p++,c.setAttrib(r,"id",n),l=new e(n,t,a),s.push(l),l.render(1))})})});break;case"textareas":case"specific_textareas":d(c.select("textarea"),function(r){t.editor_deselector&&i(r,t.editor_deselector)||(!t.editor_selector||i(r,t.editor_selector))&&(l=new e(n(r),t,a),s.push(l),l.render(!0))})}t.oninit&&(m=h=0,d(s,function(e){h++,e.initialized?m++:e.on("init",function(){m++,m==h&&r(t,"oninit")}),m==h&&r(t,"oninit")}))}var a=this,s=[],l;a.settings=t,c.bind(window,"ready",o)},get:function(e){return e===t?this.editors:this.editors[e]},add:function(e){var t=this,n=t.editors;return n[e.id]=e,n.push(e),t.activeEditor=e,t.fire("AddEditor",{editor:e}),m||(m=function(){t.fire("BeforeUnload")},c.bind(window,"beforeunload",m)),e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i,o;{if(e){if("string"==typeof e)return e=e.selector||e,void d(c.select(e),function(e){t.remove(r[e.id])});if(i=e,!r[i.id])return null;for(delete r[i.id],n=0;n=0;n--)t.remove(r[n])}},execCommand:function(t,n,r){var i=this,o=i.get(r);switch(t){case"mceAddEditor":return i.get(r)||new e(r,i.settings,i).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(i.execCommand("mceAddEditor",0,r),!0)}return i.activeEditor?i.activeEditor.execCommand(t,n,r):!1},triggerSave:function(){d(this.editors,function(e){e.save()})},addI18n:function(e,t){s.add(e,t)},translate:function(e){return s.translate(e)}};return f(h,a),h.setup(),window.tinymce=window.tinyMCE=h,h}),r(ct,[lt,p],function(e,t){var n=t.each,r=t.explode;e.on("AddEditor",function(e){var t=e.editor;t.on("preInit",function(){function e(e,t){n(t,function(t,n){t&&s.setStyle(e,n,t)}),s.rename(e,"span")}function i(e){s=t.dom,l.convert_fonts_to_spans&&n(s.select("font,u,strike",e.node),function(e){o[e.nodeName.toLowerCase()](s,e)})}var o,a,s,l=t.settings;l.inline_styles&&(a=r(l.font_size_legacy_values),o={font:function(t,n){e(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:a[parseInt(n.size,10)-1]})},u:function(t,n){e(n,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(ut,[],function(){return{send:function(e){function t(){!e.async||4==n.readyState||r++>1e4?(e.success&&1e4>r&&200==n.status?e.success.call(e.success_scope,""+n.responseText,n,e):e.error&&e.error.call(e.error_scope,r>1e4?"TIMED_OUT":"GENERAL",n,e),n=null):setTimeout(t,10)}var n,r=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=e.async===!1?!1:!0,e.data=e.data||"",n=new XMLHttpRequest){if(n.overrideMimeType&&n.overrideMimeType(e.content_type),n.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.content_type&&n.setRequestHeader("Content-Type",e.content_type),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.send(e.data),!e.async)return t();setTimeout(t,10)}}}}),r(dt,[],function(){function e(t,n){var r,i,o,a;if(n=n||'"',null===t)return"null";if(o=typeof t,"string"==o)return i="\bb t\nn\ff\rr\"\"''\\\\",n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=i.indexOf(t),r+1?"\\"+i.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+n;if("object"==o){if(t.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(t)){for(r=0,i="[";r0?",":"")+e(t[r],n);return i+"]"}i="{";for(a in t)t.hasOwnProperty(a)&&(i+="function"!=typeof t[a]?(i.length>1?","+n:n)+a+n+":"+e(t[a],n):"");return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}}),r(ft,[dt,ut,p],function(e,t,n){function r(e){this.settings=i({},e),this.count=0}var i=n.extend;return r.sendRPC=function(e){return(new r).send(e)},r.prototype={send:function(n){var r=n.error,o=n.success;n=i(this.settings,n),n.success=function(t,i){t=e.parse(t),"undefined"==typeof t&&(t={error:"JSON Parse error."}),t.error?r.call(n.error_scope||n.scope,t.error,i):o.call(n.success_scope||n.scope,t.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=e.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",t.send(n)}},r}),r(pt,[y],function(e){return{callbacks:{},count:0,send:function(n){var r=this,i=e.DOM,o=n.count!==t?n.count:r.count,a="tinymce_jsonp_"+o;r.callbacks[o]=function(e){i.remove(a),delete r.callbacks[o],n.callback(e)},i.add(i.doc.body,"script",{id:a,src:n.url,type:"text/javascript"}),r.count++}}}),r(mt,[],function(){function e(){s=[];for(var e in a)s.push(e);i.length=s.length}function n(){function n(e){var n,r;return r=e!==t?u+e:i.indexOf(",",u),-1===r||r>i.length?null:(n=i.substring(u,r),u=r+1,n)}var r,i,s,u=0;if(a={},c){o.load(l),i=o.getAttribute(l)||"";do{var d=n();if(null===d)break;if(r=n(parseInt(d,32)||0),null!==r){if(d=n(),null===d)break;s=n(parseInt(d,32)||0),r&&(a[r]=s)}}while(null!==r);e()}}function r(){var t,n="";if(c){for(var r in a)t=a[r],n+=(n?",":"")+r.length.toString(32)+","+r+","+t.length.toString(32)+","+t;o.setAttribute(l,n);try{o.save(l)}catch(i){}e()}}var i,o,a,s,l,c;try{if(window.localStorage)return localStorage}catch(u){}return l="tinymce",o=document.documentElement,c=!!o.addBehavior,c&&o.addBehavior("#default#userData"),i={key:function(e){return s[e]},getItem:function(e){return e in a?a[e]:null},setItem:function(e,t){a[e]=""+t,r()},removeItem:function(e){delete a[e],r()},clear:function(){a={},r()}},n(),i}),r(ht,[y,l,b,C,p,g],function(e,t,n,r,i,o){var a=window.tinymce;return a.DOM=e.DOM,a.ScriptLoader=n.ScriptLoader,a.PluginManager=r.PluginManager,a.ThemeManager=r.ThemeManager,a.dom=a.dom||{},a.dom.Event=t.Event,i.each(i,function(e,t){a[t]=e}),i.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(e){a[e]=o[e.substr(2).toLowerCase()]}),{}}),r(gt,[F,p],function(e,t){return e.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=t.extend({},this.Defaults,e)},preRender:function(e){e.addClass(this.settings.containerClass,"body")},applyClasses:function(e){var t=this,n=t.settings,r,i,o;r=e.items().filter(":visible"),i=n.firstControlClass,o=n.lastControlClass,r.each(function(e){e.removeClass(i).removeClass(o),n.controlClass&&e.addClass(n.controlClass)}),r.eq(0).addClass(i),r.eq(-1).addClass(o)},renderHtml:function(e){var t=this,n=t.settings,r,i="";return r=e.items(),r.eq(0).addClass(n.firstControlClass),r.eq(-1).addClass(n.lastControlClass),r.each(function(e){n.controlClass&&e.addClass(n.controlClass),i+=e.renderHtml()}),i},recalc:function(){},postRender:function(){}})}),r(vt,[gt],function(e){return e.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'
    '+this._super(e)}})}),r(yt,[U,X],function(e,t){return e.extend({Mixins:[t],Defaults:{classes:"widget tooltip tooltip-n"},text:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t._rendered&&(t.getEl().lastChild.innerHTML=t.encode(e)),t):t._value},renderHtml:function(){var e=this,t=e.classPrefix;return'"},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(bt,[U,yt],function(e,t){var n,r=e.extend({init:function(e){var t=this;t._super(e),t.canFocus=!0,e.tooltip&&r.tooltips!==!1&&(t.on("mouseenter",function(n){var r=t.tooltip().moveTo(-65535);if(n.control==t){var i=r.text(e.tooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);r.toggleClass("tooltip-n","bc-tc"==i),r.toggleClass("tooltip-nw","bc-tl"==i),r.toggleClass("tooltip-ne","bc-tr"==i),r.moveRel(t.getEl(),i)}else r.hide()}),t.on("mouseleave mousedown click",function(){t.tooltip().hide()})),t.aria("label",e.ariaLabel||e.tooltip)},tooltip:function(){return n||(n=new t({type:"tooltip"}),n.renderTo()),n},active:function(e){var t=this,n;return e!==n&&(t.aria("pressed",e),t.toggleClass("active",e)),t._super(e)},disabled:function(e){var t=this,n;return e!==n&&(t.aria("disabled",e),t.toggleClass("disabled",e)),t._super(e)},postRender:function(){var e=this,t=e.settings;e._rendered=!0,e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&e.focus()},remove:function(){this._super(),n&&(n.remove(),n=null)}});return r}),r(Ct,[bt],function(e){return e.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t=this,n;t.on("click mousedown",function(e){e.preventDefault()}),t._super(e),n=e.size,e.subtype&&t.addClass(e.subtype),n&&t.addClass("btn-"+n)},icon:function(e){var t=this,n=t.classPrefix;if("undefined"==typeof e)return t.settings.icon;if(t.settings.icon=e,e=e?n+"ico "+n+"i-"+t.settings.icon:"",t._rendered){var r=t.getEl().firstChild,i=r.getElementsByTagName("i")[0];e?(i&&i==r.firstChild||(i=document.createElement("i"),r.insertBefore(i,r.firstChild)),i.className=e):i&&r.removeChild(i),t.text(t._text)}return t},repaint:function(){var e=this.getEl().firstChild.style;e.width=e.height="100%",this._super()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon,i="";return e.settings.image&&(r="none",i=" style=\"background-image: url('"+e.settings.image+"')\""),r=e.settings.icon?n+"ico "+n+"i-"+r:"",'
    "}})}),r(xt,[j],function(e){return e.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this,t=e._layout;return e.addClass("btn-group"),e.preRender(),t.preRender(e),'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(wt,[bt],function(e){return e.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){var t=this;return"undefined"!=typeof e?(e?t.addClass("checked"):t.removeClass("checked"),t._checked=e,t.aria("checked",e),t):t._checked},value:function(e){return this.checked(e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'
    '+e.encode(e._text)+"
    "}})}),r(_t,[Ct,Q],function(e,t){return e.extend({showPanel:function(){var e=this,n=e.settings;if(e.active(!0),e.panel)e.panel.show();else{var r=n.panel;r.type&&(r={layout:"grid",items:r}),r.role=r.role||"dialog",r.popover=!0,r.autohide=!0,r.ariaRoot=!0,e.panel=new t(r).on("hide",function(){e.active(!1)}).on("cancel",function(t){t.stopPropagation(),e.focus(),e.hidePanel()}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}e.panel.moveRel(e.getEl(),n.popoverAlign||(e.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var e=this;e.panel&&e.panel.hide()},postRender:function(){var e=this;return e.aria("haspopup",!0),e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():(e.showPanel(),e.panel.focus(!!t.aria)))}),e._super()}})}),r(Nt,[_t,y],function(e,t){var n=t.DOM;return e.extend({init:function(e){this._super(e),this.addClass("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",i=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"";return'
    '},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(r){r.aria&&"down"==r.aria.key||r.control!=e||n.getParent(r.target,"."+e.classPrefix+"open")||(r.stopImmediatePropagation(),t.call(e,r))}),delete e.settings.onclick,e._super()}})}),r(Et,[bt,q,V],function(e,t,n){return e.extend({init:function(e){var t=this;t._super(e),t.addClass("combobox"),t.subinput=!0,t.ariaTarget="inp",e=t.settings,e.menu=e.menu||e.values,e.menu&&(e.icon="caret"),t.on("click",function(n){for(var r=n.target,i=t.getEl();r&&r!=i;)r.id&&-1!=r.id.indexOf("-open")&&(t.fire("action"),e.menu&&(t.showMenu(),n.aria&&t.menu.items()[0].focus())),r=r.parentNode}),t.on("keydown",function(e){"INPUT"==e.target.nodeName&&13==e.keyCode&&t.parents().reverse().each(function(n){return e.preventDefault(),t.fire("change"),n.hasEventListeners("submit")&&n.toJSON?(n.fire("submit",{data:n.toJSON()}),!1):void 0})}),e.placeholder&&(t.addClass("placeholder"),t.on("focusin",function(){t._hasOnChange||(n.on(t.getEl("inp"),"change",function(){t.fire("change")}),t._hasOnChange=!0),t.hasClass("placeholder")&&(t.getEl("inp").value="",t.removeClass("placeholder"))}),t.on("focusout",function(){0===t.value().length&&(t.getEl("inp").value=e.placeholder,t.addClass("placeholder"))}))},showMenu:function(){var e=this,n=e.settings,r;e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(e.getContainerElm()),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control===e.menu&&e.focus()}),e.menu.on("show hide",function(t){t.control.items().each(function(t){t.active(t.value()==e.value())})}).fire("show"),e.menu.on("select",function(t){e.value(t.control.value())}),e.on("focusin",function(t){"INPUT"==t.target.tagName&&e.menu.hide()}),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},value:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t.removeClass("placeholder"),t._rendered&&(t.getEl("inp").value=e),t):t._rendered?(e=t.getEl("inp").value,e!=t.settings.placeholder?e:""):t._value},disabled:function(e){var t=this;return t._rendered&&"undefined"!=typeof e&&(t.getEl("inp").disabled=e),t._super(e)},focus:function(){this.getEl("inp").focus()},repaint:function(){var e=this,t=e.getEl(),r=e.getEl("open"),i=e.layoutRect(),o,a;o=r?i.w-n.getSize(r).width-10:i.w-10;var s=document;return s.all&&(!s.documentMode||s.documentMode<=8)&&(a=e.layoutRect().h-2+"px"),n.css(t.firstChild,{width:o,lineHeight:a}),e._super(),e},postRender:function(){var e=this;return n.on(this.getEl("inp"),"change",function(){e.fire("change")}),e._super()},remove:function(){n.off(this.getEl("inp")),this._super()},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix,i=n.value||n.placeholder||"",o,a,s="",l="";return"spellcheck"in n&&(l+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(l+=' maxlength="'+n.maxLength+'"'),n.size&&(l+=' size="'+n.size+'"'),n.subtype&&(l+=' type="'+n.subtype+'"'),e.disabled()&&(l+=' disabled="disabled"'),o=n.icon,o&&"caret"!=o&&(o=r+"ico "+r+"i-"+n.icon),a=e._text,(o||a)&&(s='
    ",e.addClass("has-open")),'
    "+s+"
    "}})}),r(St,[bt],function(e){return e.extend({init:function(e){var t=this;e.delimiter||(e.delimiter="\xbb"),t._super(e),t.addClass("path"),t.canFocus=!0,t.on("click",function(e){var n,r=e.target;(n=r.getAttribute("data-index"))&&t.fire("select",{value:t.data()[n],index:n})})},focus:function(){var e=this;return e.getEl().firstChild.focus(),e},data:function(e){var t=this;return"undefined"!=typeof e?(t._data=e,t.update(),t):t._data},update:function(){this.innerHtml(this._getPathHtml())},postRender:function(){var e=this;e._super(),e.data(e.settings.data)},renderHtml:function(){var e=this;return'
    '+e._getPathHtml()+"
    "},_getPathHtml:function(){var e=this,t=e._data||[],n,r,i="",o=e.classPrefix;for(n=0,r=t.length;r>n;n++)i+=(n>0?'":"")+'
    '+t[n].name+"
    ";return i||(i='
     
    '),i}})}),r(kt,[St,lt],function(e,t){return e.extend({postRender:function(){function e(e){if(1===e.nodeType){if("BR"==e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}var n=this,r=t.activeEditor;return n.on("select",function(t){var n=[],i,o=r.getBody();for(r.focus(),i=r.selection.getStart();i&&i!=o;)e(i)||n.push(i),i=i.parentNode;r.selection.select(n[n.length-1-t.index]),r.nodeChanged()}),r.on("nodeChange",function(t){for(var i=[],o=t.parents,a=o.length;a--;)if(1==o[a].nodeType&&!e(o[a])){var s=r.fire("ResolveName",{name:o[a].nodeName.toLowerCase(),target:o[a]});i.push({name:s.name})}n.data(i)}),n._super()}})}),r(Tt,[j],function(e){return e.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.addClass("formitem"),t.preRender(e),'
    '+(e.settings.title?'
    '+e.settings.title+"
    ":"")+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(Rt,[j,Tt],function(e,t){return e.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var e=this,n=e.items();n.each(function(n){var r,i=n.settings.label;i&&(r=new t({layout:"flex",autoResize:"overflow",defaults:{flex:1},items:[{type:"label",id:n._id+"-l",text:i,flex:0,forId:n._id,disabled:n.disabled()}]}),r.type="formitem",n.aria("labelledby",n._id+"-l"),"undefined"==typeof n.settings.flex&&(n.settings.flex=1),e.replace(n,r),r.add(n))})},recalcLabels:function(){var e=this,t=0,n=[],r,i;if(e.settings.labelGapCalc!==!1)for(e.items().filter("formitem").each(function(e){var r=e.items()[0],i=r.getEl().clientWidth;t=i>t?i:t,n.push(r)}),i=e.settings.labelGap||0,r=n.length;r--;)n[r].settings.minWidth=t+i},visible:function(e){var t=this._super(e);return e===!0&&this._rendered&&this.recalcLabels(),t},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var e=this;e._super(),e.recalcLabels(),e.fromJSON(e.settings.data)}})}),r(At,[Rt],function(e){return e.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'
    '+(e.settings.title?''+e.settings.title+"":"")+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(Bt,[Et],function(e){return e.extend({init:function(e){var t=this,n=tinymce.activeEditor,r;e.spellcheck=!1,r=n.settings.file_browser_callback,r&&(e.icon="browse",e.onaction=function(){r(t.getEl("inp").id,t.getEl("inp").value,e.filetype,window)}),t._super(e)}})}),r(Lt,[vt],function(e){return e.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox();e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc() -})}})}),r(Dt,[vt],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,p,m,h,g,v=[],y,b,C,x,w,_,N,E,S,k,T,R,A,B,L,D,M,H,P,O,I,F,z=Math.max,W=Math.min;for(r=e.items().filter(":visible"),i=e.layoutRect(),o=e._paddingBox,a=e.settings,f=e.isRtl()?a.direction||"row-reversed":a.direction,s=a.align,l=e.isRtl()?a.pack||"end":a.pack,c=a.spacing||0,("row-reversed"==f||"column-reverse"==f)&&(r=r.set(r.toArray().reverse()),f=f.split("-")[0]),"column"==f?(S="y",N="h",E="minH",k="maxH",R="innerH",T="top",A="deltaH",B="contentH",P="left",M="w",L="x",D="innerW",H="minW",O="right",I="deltaW",F="contentW"):(S="x",N="w",E="minW",k="maxW",R="innerW",T="left",A="deltaW",B="contentW",P="top",M="h",L="y",D="innerH",H="minH",O="bottom",I="deltaH",F="contentH"),d=i[R]-o[T]-o[T],_=u=0,t=0,n=r.length;n>t;t++)p=r[t],m=p.layoutRect(),h=p.settings,g=h.flex,d-=n-1>t?c:0,g>0&&(u+=g,m[k]&&v.push(p),m.flex=g),d-=m[E],y=o[P]+m[H]+o[O],y>_&&(_=y);if(x={},x[E]=0>d?i[E]-d+i[A]:i[R]-d+i[A],x[H]=_+i[I],x[B]=i[R]-d,x[F]=_,x.minW=W(x.minW,i.maxW),x.minH=W(x.minH,i.maxH),x.minW=z(x.minW,i.startMinWidth),x.minH=z(x.minH,i.startMinHeight),!i.autoResize||x.minW==i.minW&&x.minH==i.minH){for(C=d/u,t=0,n=v.length;n>t;t++)p=v[t],m=p.layoutRect(),b=m[k],y=m[E]+m.flex*C,y>b?(d-=m[k]-m[E],u-=m.flex,m.flex=0,m.maxFlexSize=b):m.maxFlexSize=0;for(C=d/u,w=o[T],x={},0===u&&("end"==l?w=d+o[T]:"center"==l?(w=Math.round(i[R]/2-(i[R]-d)/2)+o[T],0>w&&(w=o[T])):"justify"==l&&(w=o[T],c=Math.floor(d/(r.length-1)))),x[L]=o[P],t=0,n=r.length;n>t;t++)p=r[t],m=p.layoutRect(),y=m.maxFlexSize||m[E],"center"===s?x[L]=Math.round(i[D]/2-m[M]/2):"stretch"===s?(x[M]=z(m[H]||0,i[D]-o[P]-o[O]),x[L]=o[P]):"end"===s&&(x[L]=i[D]-m[M]-o.top),m.flex>0&&(y+=m.flex*C),x[N]=y,x[S]=w,p.layoutRect(x),p.recalc&&p.recalc(),w+=y+c}else if(x.w=x.minW,x.h=x.minH,e.layoutRect(x),this.recalc(e),null===e._lastRect){var V=e.parent();V&&(V._lastRect=null,V.recalc())}}})}),r(Mt,[gt],function(e){return e.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})}})}),r(Ht,[U,bt,Q,p,lt,g],function(e,t,n,r,i,o){function a(e){function t(t){function n(e){return e.replace(/%(\w+)/g,"")}var r,i,o=e.dom,a="",l,c;return c=e.settings.preview_styles,c===!1?"":(c||(c="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"),(t=e.formatter.get(t))?(t=t[0],r=t.block||t.inline||"span",i=o.create(r),s(t.styles,function(e,t){e=n(e),e&&o.setStyle(i,t,e)}),s(t.attributes,function(e,t){e=n(e),e&&o.setAttrib(i,t,e)}),s(t.classes,function(e){e=n(e),o.hasClass(i,e)||o.addClass(i,e)}),e.fire("PreviewFormats"),o.setStyles(i,{position:"absolute",left:-65535}),e.getBody().appendChild(i),l=o.getStyle(e.getBody(),"fontSize",!0),l=/px$/.test(l)?parseInt(l,10):0,s(c.split(" "),function(t){var n=o.getStyle(i,t,!0);if(!("background-color"==t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=o.getStyle(e.getBody(),t,!0),"#ffffff"==o.toHex(n).toLowerCase())||"color"==t&&"#000000"==o.toHex(n).toLowerCase())){if("font-size"==t&&/em|%$/.test(n)){if(0===l)return;n=parseFloat(n,10)/(/%$/.test(n)?100:1),n=n*l+"px"}"border"==t&&n&&(a+="padding:0 2px;"),a+=t+":"+n+";"}}),e.fire("AfterPreviewFormats"),o.remove(i),a):void 0)}function r(t,n){return function(){var r=this;e.on("nodeChange",function(i){var o=e.formatter,a=null;s(i.parents,function(e){return s(t,function(t){return n?o.matchNode(e,n,{value:t.value})&&(a=t.value):o.matchNode(e,t.value)&&(a=t.value),a?!1:void 0}),a?!1:void 0}),r.value(a)})}}function i(e){e=e.split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}function o(){function n(e){var t=[];if(e)return s(e,function(e){var r={text:e.title,icon:e.icon};if(e.items)r.menu=n(e.items);else{var a=e.format||"custom"+i++;e.format||(e.name=a,o.push(e)),r.format=a}t.push(r)}),t}function r(){var t;return t=n(e.settings.style_formats_merge?e.settings.style_formats?a.concat(e.settings.style_formats):a:e.settings.style_formats||a)}var i=0,o=[],a=[{title:"Headers",items:[{title:"Header 1",format:"h1"},{title:"Header 2",format:"h2"},{title:"Header 3",format:"h3"},{title:"Header 4",format:"h4"},{title:"Header 5",format:"h5"},{title:"Header 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];return e.on("init",function(){s(o,function(t){e.formatter.register(t.name,t)})}),{type:"menu",items:r(),onPostRender:function(t){e.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){return this.settings.format?t(this.settings.format):void 0},onPostRender:function(){var t=this,n=this.settings.format;n&&t.parent().on("show",function(){t.disabled(!e.formatter.canApply(n)),t.active(e.formatter.match(n))})},onclick:function(){this.settings.format&&f(this.settings.format)}}}}function a(){return e.undoManager?e.undoManager.hasUndo():!1}function l(){return e.undoManager?e.undoManager.hasRedo():!1}function c(){var t=this;t.disabled(!a()),e.on("Undo Redo AddUndo TypingUndo",function(){t.disabled(!a())})}function u(){var t=this;t.disabled(!l()),e.on("Undo Redo AddUndo TypingUndo",function(){t.disabled(!l())})}function d(){var t=this;e.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(e.hasVisual)}function f(t){t.control&&(t=t.control.value()),t&&e.execCommand("mceToggleFormat",!1,t)}var p;p=o(),s({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t,n){e.addButton(n,{tooltip:t,onPostRender:function(){var t=this;e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})},onclick:function(){f(n)}})}),s({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],hr:["Insert horizontal rule","InsertHorizontalRule"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),s({blockquote:["Blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:function(){var t=this;e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})}})}),e.addButton("undo",{tooltip:"Undo",onPostRender:c,cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:u,cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",shortcut:"Ctrl+N",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Ctrl+Z",onPostRender:c,cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Ctrl+Y",onPostRender:u,cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:d,cmd:"mceToggleVisualAid"}),s({cut:["Cut","Cut","Ctrl+X"],copy:["Copy","Copy","Ctrl+C"],paste:["Paste","Paste","Ctrl+V"],selectall:["Select all","SelectAll","Ctrl+A"],bold:["Bold","Bold","Ctrl+B"],italic:["Italic","Italic","Ctrl+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:p}),e.addButton("formatselect",function(){var n=[],o=i(e.settings.block_formats||"Paragraph=p;Address=address;Pre=pre;Header 1=h1;Header 2=h2;Header 3=h3;Header 4=h4;Header 5=h5;Header 6=h6");return s(o,function(e){n.push({text:e[0],value:e[1],textStyle:function(){return t(e[1])}})}),{type:"listbox",text:o[0][0],values:n,fixedWidth:!0,onselect:f,onPostRender:r(n)}}),e.addButton("fontselect",function(){var t="Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",n=[],o=i(e.settings.font_formats||t);return s(o,function(e){n.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:n,fixedWidth:!0,onPostRender:r(n,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var t=[],n="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||n;return s(i.split(" "),function(e){t.push({text:e,value:e})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:t,fixedWidth:!0,onPostRender:r(t,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:p})}var s=r.each;i.on("AddEditor",function(t){t.editor.rtl&&(e.rtl=!0),a(t.editor)}),e.translate=function(e){return i.translate(e)},t.tooltips=!o.iOS}),r(Pt,[vt],function(e){return e.extend({recalc:function(e){var t=e.settings,n,r,i,o,a,s,l,c,u,d,f,p,m,h,g,v,y,b,C,x,w,_,N=[],E=[],S,k,T,R;for(t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e._paddingBox,C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]),d=0;r>d;d++)N.push(0);for(f=0;n>f;f++)E.push(0);for(f=0;n>f;f++)for(d=0;r>d&&(u=i[f*r+d],u);d++)c=u.layoutRect(),S=c.minW,k=c.minH,N[d]=S>N[d]?S:N[d],E[f]=k>E[f]?k:E[f];for(T=o.innerW-g.left-g.right,w=0,d=0;r>d;d++)w+=N[d]+(d>0?y:0),T-=(d>0?y:0)+N[d];for(R=o.innerH-g.top-g.bottom,_=0,f=0;n>f;f++)_+=E[f]+(f>0?b:0),R-=(f>0?b:0)+E[f];if(w+=g.left+g.right,_+=g.top+g.bottom,l={},l.minW=w+(o.w-o.innerW),l.minH=_+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW==o.minW&&l.minH==o.minH){o.autoResize&&(l=e.layoutRect(l),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH);var A;A="start"==t.packV?0:R>0?Math.floor(R/n):0;var B=0,L=t.flexWidths;if(L)for(d=0;dd;d++)N[d]+=L?L[d]*D:D;for(m=g.top,f=0;n>f;f++){for(p=g.left,s=E[f]+A,d=0;r>d&&(u=i[f*r+d],u);d++)h=u.settings,c=u.layoutRect(),a=Math.max(N[d],c.startMinWidth),c.x=p,c.y=m,v=h.alignH||(C?C[d]||C[0]:null),"center"==v?c.x=p+a/2-c.w/2:"right"==v?c.x=p+a-c.w:"stretch"==v&&(c.w=a),v=h.alignV||(x?x[d]||x[0]:null),"center"==v?c.y=m+s/2-c.h/2:"bottom"==v?c.y=m+s-c.h:"stretch"==v&&(c.h=s),u.layoutRect(c),p+=a+y,u.recalc&&u.recalc();m+=s+b}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var M=e.parent();M&&(M._lastRect=null,M.recalc())}}})}),r(Ot,[bt],function(e){return e.extend({renderHtml:function(){var e=this;return e.addClass("iframe"),e.canFocus=!1,''},src:function(e){this.getEl().src=e},html:function(e,t){var n=this,r=this.getEl().contentWindow.document.body;return r?(r.innerHTML=e,t&&t()):setTimeout(function(){n.html(e)},0),this}})}),r(It,[bt,V],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t.addClass("widget"),t.addClass("label"),t.canFocus=!1,e.multiline&&t.addClass("autoscroll"),e.strong&&t.addClass("strong")},initLayoutRect:function(){var e=this,n=e._super();if(e.settings.multiline){var r=t.getSize(e.getEl());r.width>n.maxW&&(n.minW=n.maxW,e.addClass("multiline")),e.getEl().style.width=n.minW+"px",n.startMinH=n.h=n.minH=Math.min(n.maxH,t.getSize(e.getEl()).height)}return n},repaint:function(){var e=this;return e.settings.multiline||(e.getEl().style.lineHeight=e.layoutRect().h+"px"),e._super()},text:function(e){var t=this;return t._rendered&&e&&this.innerHtml(t.encode(e)),t._super(e)},renderHtml:function(){var e=this,t=e.settings.forId;return'"}})}),r(Ft,[j],function(e){return e.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){var t=this;t._super(e),t.addClass("toolbar")},postRender:function(){var e=this;return e.items().addClass("toolbar-item"),e._super()}})}),r(zt,[Ft],function(e){return e.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}})}),r(Wt,[Ct,q,zt],function(e,t,n){function r(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}var i=e.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),t.addClass("menubtn"),e.fixedWidth&&t.addClass("fixed-width"),t.aria("haspopup",!0),t.hasPopup=!0},showMenu:function(){var e=this,n=e.settings,r;return e.menu&&e.menu.visible()?e.hideMenu():(e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control.parent()===e.menu&&(t.stopPropagation(),e.focus(),e.hideMenu())}),e.menu.on("select",function(){e.focus()}),e.menu.on("show hide",function(t){t.control==e.menu&&e.activeMenu("show"==t.type),e.aria("expanded","show"==t.type)}).fire("show")),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),void e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]))},hideMenu:function(){var e=this;e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide())},activeMenu:function(e){this.toggleClass("active",e)},renderHtml:function(){var e=this,t=e._id,r=e.classPrefix,i=e.settings.icon?r+"ico "+r+"i-"+e.settings.icon:"";return e.aria("role",e.parent()instanceof n?"menuitem":"button"),'
    '},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&r(t.target,e.getEl())&&(e.showMenu(),t.aria&&e.menu.items()[0].focus())}),e.on("mouseenter",function(t){var n=t.control,r=e.parent(),o;n&&r&&n instanceof i&&n.parent()==r&&(r.items().filter("MenuButton").each(function(e){e.hideMenu&&e!=n&&(e.menu&&e.menu.visible()&&(o=!0),e.hideMenu())}),o&&(n.focus(),n.showMenu()))}),e._super()},text:function(e){var t=this,n,r;if(t._rendered)for(r=t.getEl("open").getElementsByTagName("span"),n=0;n0&&(o=n[0].text,t._value=n[0].value),e.menu=n}e.text=e.text||o||n[0].text,t._super(e),t.addClass("listbox"),t.on("select",function(n){var r=n.control;a&&(n.lastControl=a),e.multiple?r.active(!r.active()):t.value(n.control.settings.value),a=r})},value:function(e){function t(e,n){e.items().each(function(e){r=e.value()===n,r&&(i=i||e.text()),e.active(r),e.menu&&t(e.menu,n)})}var n=this,r,i,o,a;if("undefined"!=typeof e){if(n.menu)t(n.menu,e);else for(o=n.settings.menu,a=0;a'+("-"!==o?' ":"")+("-"!==o?''+o+"":"")+(l?'
    '+l+"
    ":"")+(r.menu?'
    ':"")+""},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var r=e.getEl("text");r&&r.setAttribute("style",n)}return e.on("mouseenter click",function(n){n.control===e&&(t.menu||"click"!==n.type?(e.showMenu(),n.aria&&e.menu.focus(!0)):(e.fire("select"),e.parent().hideAll()))}),e._super(),e},active:function(e){return"undefined"!=typeof e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(qt,[Q,Ut,p],function(e,t,n){var r=e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){var t=this;if(e.autohide=!0,e.constrainToViewport=!0,e.itemDefaults)for(var r=e.items,i=r.length;i--;)r[i]=n.extend({},e.itemDefaults,r[i]);t._super(e),t.addClass("menu")},repaint:function(){return this.toggleClass("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var e=this;e.hideAll(),e.fire("select")},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;return n.icon||n.selectable?(e._hasIcons=!0,!1):void 0}),e._super()}});return r}),r($t,[wt],function(e){return e.extend({Defaults:{classes:"radio",role:"radio"}})}),r(jt,[bt,K],function(e,t){return e.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.addClass("resizehandle"),"both"==e.settings.direction&&e.addClass("resizehandle-both"),e.canFocus=!1,'
    '},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!=e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},stop:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),r(Kt,[bt],function(e){return e.extend({renderHtml:function(){var e=this;return e.addClass("spacer"),e.canFocus=!1,'
    '}})}),r(Yt,[Wt,V],function(e,t){return e.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e=this,n=e.getEl(),r=e.layoutRect(),i,o;return e._super(),i=n.firstChild,o=n.lastChild,t.css(i,{width:r.w-t.getSize(o).width,height:r.h-2}),t.css(o,{height:r.h-2}),e},activeMenu:function(e){var n=this;t.toggleClass(n.getEl().lastChild,n.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"";return'
    '},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(e){var n=e.target;if(e.control==this)for(;n;){if(e.aria&&"down"!=e.aria.key||"BUTTON"==n.nodeName&&-1==n.className.indexOf("open"))return e.stopImmediatePropagation(),void t.call(this,e);n=n.parentNode}}),delete e.settings.onclick,e._super()}})}),r(Gt,[Mt],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"}})}),r(Xt,[G,V],function(e,t){return e.extend({lastIdx:0,Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){var n;this.activeTabId&&(n=this.getEl(this.activeTabId),t.removeClass(n,this.classPrefix+"active"),n.setAttribute("aria-selected","false")),this.activeTabId="t"+e,n=this.getEl("t"+e),n.setAttribute("aria-selected","true"),t.addClass(n,this.classPrefix+"active"),e!=this.lastIdx&&(this.items()[this.lastIdx].hide(),this.lastIdx=e),this.items()[e].show().fire("showtab"),this.reflow()},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){var o=e._id+"-t"+i;t.aria("role","tabpanel"),t.aria("labelledby",o),n+='"}),'
    '+n+'
    '+t.renderHtml(e)+"
    "},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]==t.target&&e.activateTab(r)})},initLayoutRect:function(){var e=this,n,r,i;r=t.getSize(e.getEl("head")).width,r=0>r?0:r,i=0,e.items().each(function(t,n){r=Math.max(r,t.layoutRect().minW),i=Math.max(i,t.layoutRect().minH),e.settings.activeTab!=n&&t.hide()}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=r,e.settings.h=i,e.layoutRect({x:0,y:0,w:r,h:i})});var o=t.getSize(e.getEl("head")).height;return e.settings.minWidth=r,e.settings.minHeight=i+o,n=e._super(),n.deltaH+=o,n.innerH=n.h-n.deltaH,n}})}),r(Jt,[bt,V],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t._value=e.value||"",t.addClass("textbox"),e.multiline?t.addClass("multiline"):t.on("keydown",function(e){13==e.keyCode&&t.parents().reverse().each(function(t){return e.preventDefault(),t.hasEventListeners("submit")&&t.toJSON?(t.fire("submit",{data:t.toJSON()}),!1):void 0})})},disabled:function(e){var t=this;return t._rendered&&"undefined"!=typeof e&&(t.getEl().disabled=e),t._super(e)},value:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t._rendered&&(t.getEl().value=e),t):t._rendered?t.getEl().value:t._value},repaint:function(){var e=this,t,n,r,i=0,o=0,a;t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{};var s=document;return!e.settings.multiline&&s.all&&(!s.documentMode||s.documentMode<=8)&&(t.lineHeight=n.h-o+"px"),r=e._borderBox,i=r.left+r.right+8,o=r.top+r.bottom+(e.settings.multiline?8:0),n.x!==a.x&&(t.left=n.x+"px",a.x=n.x),n.y!==a.y&&(t.top=n.y+"px",a.y=n.y),n.w!==a.w&&(t.width=n.w-i+"px",a.w=n.w),n.h!==a.h&&(t.height=n.h-o+"px",a.h=n.h),e._lastRepaintRect=a,e.fire("repaint",{},!1),e},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.encode(e._value,!1),i="";return"spellcheck"in n&&(i+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(i+=' maxlength="'+n.maxLength+'"'),n.size&&(i+=' size="'+n.size+'"'),n.subtype&&(i+=' type="'+n.subtype+'"'),e.disabled()&&(i+=' disabled="disabled"'),n.multiline?'":'"},postRender:function(){var e=this;return t.on(e.getEl(),"change",function(t){e.fire("change",t)}),e._super()},remove:function(){t.off(this.getEl()),this._super()}})}),r(Qt,[V],function(e){return function(t){var n=this,r;n.show=function(i){return n.hide(),r=!0,window.setTimeout(function(){r&&t.appendChild(e.createFragment('
    '))},i||0),n},n.hide=function(){var e=t.lastChild;return e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),r=!1,n}}}),a([l,c,u,d,f,p,m,h,g,v,y,b,C,x,w,_,N,E,S,k,T,R,A,B,L,D,M,H,P,O,I,F,z,W,V,U,q,$,j,K,Y,G,X,J,Q,Z,et,tt,nt,rt,it,ot,at,st,lt,ct,ut,dt,ft,pt,mt,ht,gt,vt,yt,bt,Ct,xt,wt,_t,Nt,Et,St,kt,Tt,Rt,At,Bt,Lt,Dt,Mt,Ht,Pt,Ot,It,Ft,zt,Wt,Vt,Ut,qt,$t,jt,Kt,Yt,Gt,Xt,Jt,Qt])}(this); -;tinymce.ThemeManager.add("modern",function(e){function t(){function t(t){var n,o=[];if(t)return d(t.split(/[ ,]/),function(t){function i(){var i=e.selection;"bullist"==r&&i.selectorChanged("ul > li",function(e,i){for(var n,o=i.parents.length;o--&&(n=i.parents[o].nodeName,"OL"!=n&&"UL"!=n););t.active(e&&"UL"==n)}),"numlist"==r&&i.selectorChanged("ol > li",function(e,i){for(var n,o=i.parents.length;o--&&(n=i.parents[o].nodeName,"OL"!=n&&"UL"!=n););t.active(e&&"OL"==n)}),t.settings.stateSelector&&i.selectorChanged(t.settings.stateSelector,function(e){t.active(e)},!0),t.settings.disabledStateSelector&&i.selectorChanged(t.settings.disabledStateSelector,function(e){t.disabled(e)})}var r;"|"==t?n=null:c.has(t)?(t={type:t},u.toolbar_items_size&&(t.size=u.toolbar_items_size),o.push(t),n=null):(n||(n={type:"buttongroup",items:[]},o.push(n)),e.buttons[t]&&(r=t,t=e.buttons[r],"function"==typeof t&&(t=t()),t.type=t.type||"button",u.toolbar_items_size&&(t.size=u.toolbar_items_size),t=c.create(t),n.items.push(t),e.initialized?i():e.on("init",i)))}),i.push({type:"toolbar",layout:"flow",items:o}),!0}for(var i=[],n=1;10>n&&t(u["toolbar"+n]);n++);return i.length||t(u.toolbar||f),i}function i(){function t(t){var i;return"|"==t?{text:"|"}:i=e.menuItems[t]}function i(i){var n,o,r,a,s;if(s=tinymce.makeMap((u.removed_menuitems||"").split(/[ ,]/)),u.menu?(o=u.menu[i],a=!0):o=h[i],o){n={text:o.title},r=[],d((o.items||"").split(/[ ,]/),function(e){var i=t(e);i&&!s[e]&&r.push(t(e))}),a||d(e.menuItems,function(e){e.context==i&&("before"==e.separator&&r.push({text:"|"}),e.prependToContext?r.unshift(e):r.push(e),"after"==e.separator&&r.push({text:"|"}))});for(var l=0;l=2?o-2:0),i.setEnd(s,o>=1?o-1:0),o-=1;while(" "!=i.toString()&&""!==i.toString()&&160!=i.toString().charCodeAt(0)&&o-2>=0&&i.toString()!=n);if(i.toString()==n||160==i.toString().charCodeAt(0)?(i.setStart(s,o),i.setEnd(s,r),o+=1):0===i.startOffset?(i.setStart(s,0),i.setEnd(s,r)):(i.setStart(s,o),i.setEnd(s,r)),f=i.toString(),"."==f.charAt(f.length-1)&&i.setEnd(s,r-1),f=i.toString(),a=f.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i),a&&("www."==a[1]?a[1]="http://www.":/@$/.test(a[1])&&!/^mailto:/.test(a[1])&&(a[1]="mailto:"+a[1]),d=t.selection.getBookmark(),t.selection.setRng(i),t.execCommand("createlink",!1,a[1]+a[2]),t.selection.moveToBookmark(d),t.nodeChanged(),tinymce.Env.webkit)){t.selection.collapse(!1);var g=Math.min(s.length,r+1);i.setStart(s,g),i.setEnd(s,g),t.selection.setRng(i)}}var r;return t.on("keydown",function(e){if(13==e.keyCode)return i(t)}),tinymce.Env.ie?void t.on("focus",function(){if(!r){r=!0;try{t.execCommand("AutoUrlDetect",!1,!0)}catch(t){}}}):(t.on("keypress",function(n){if(41==n.which)return e(t)}),void t.on("keyup",function(e){if(32==e.keyCode)return n(t)}))}); -;tinymce.PluginManager.add("charmap",function(e){function a(){function a(e){for(;e;){if("TD"==e.nodeName)return e;e=e.parentNode}}var i,r,o,n;i='';var l=25;for(o=0;o<10;o++){for(i+="",r=0;r
    '+(s?String.fromCharCode(parseInt(s[0],10)):" ")+"
    "}i+="
    "}i+="";var c={type:"container",html:i,onclick:function(a){var t=a.target;/^(TD|DIV)$/.test(t.nodeName)&&(e.execCommand("mceInsertContent",!1,tinymce.trim(t.innerText||t.textContent)),a.ctrlKey||n.close())},onmouseover:function(e){var t=a(e.target);t&&n.find("#preview").text(t.firstChild.firstChild.data)}};n=e.windowManager.open({title:"Special character",spacing:10,padding:10,items:[c,{type:"label",name:"preview",text:" ",style:"font-size: 40px; text-align: center",border:1,minWidth:100,minHeight:80}],buttons:[{text:"Close",onclick:function(){n.close()}}]})}var t=[["160","no-break space"],["38","ampersand"],["34","quotation mark"],["162","cent sign"],["8364","euro sign"],["163","pound sign"],["165","yen sign"],["169","copyright sign"],["174","registered sign"],["8482","trade mark sign"],["8240","per mille sign"],["181","micro sign"],["183","middle dot"],["8226","bullet"],["8230","three dot leader"],["8242","minutes / feet"],["8243","seconds / inches"],["167","section sign"],["182","paragraph sign"],["223","sharp s / ess-zed"],["8249","single left-pointing angle quotation mark"],["8250","single right-pointing angle quotation mark"],["171","left pointing guillemet"],["187","right pointing guillemet"],["8216","left single quotation mark"],["8217","right single quotation mark"],["8220","left double quotation mark"],["8221","right double quotation mark"],["8218","single low-9 quotation mark"],["8222","double low-9 quotation mark"],["60","less-than sign"],["62","greater-than sign"],["8804","less-than or equal to"],["8805","greater-than or equal to"],["8211","en dash"],["8212","em dash"],["175","macron"],["8254","overline"],["164","currency sign"],["166","broken bar"],["168","diaeresis"],["161","inverted exclamation mark"],["191","turned question mark"],["710","circumflex accent"],["732","small tilde"],["176","degree sign"],["8722","minus sign"],["177","plus-minus sign"],["247","division sign"],["8260","fraction slash"],["215","multiplication sign"],["185","superscript one"],["178","superscript two"],["179","superscript three"],["188","fraction one quarter"],["189","fraction one half"],["190","fraction three quarters"],["402","function / florin"],["8747","integral"],["8721","n-ary sumation"],["8734","infinity"],["8730","square root"],["8764","similar to"],["8773","approximately equal to"],["8776","almost equal to"],["8800","not equal to"],["8801","identical to"],["8712","element of"],["8713","not an element of"],["8715","contains as member"],["8719","n-ary product"],["8743","logical and"],["8744","logical or"],["172","not sign"],["8745","intersection"],["8746","union"],["8706","partial differential"],["8704","for all"],["8707","there exists"],["8709","diameter"],["8711","backward difference"],["8727","asterisk operator"],["8733","proportional to"],["8736","angle"],["180","acute accent"],["184","cedilla"],["170","feminine ordinal indicator"],["186","masculine ordinal indicator"],["8224","dagger"],["8225","double dagger"],["192","A - grave"],["193","A - acute"],["194","A - circumflex"],["195","A - tilde"],["196","A - diaeresis"],["197","A - ring above"],["198","ligature AE"],["199","C - cedilla"],["200","E - grave"],["201","E - acute"],["202","E - circumflex"],["203","E - diaeresis"],["204","I - grave"],["205","I - acute"],["206","I - circumflex"],["207","I - diaeresis"],["208","ETH"],["209","N - tilde"],["210","O - grave"],["211","O - acute"],["212","O - circumflex"],["213","O - tilde"],["214","O - diaeresis"],["216","O - slash"],["338","ligature OE"],["352","S - caron"],["217","U - grave"],["218","U - acute"],["219","U - circumflex"],["220","U - diaeresis"],["221","Y - acute"],["376","Y - diaeresis"],["222","THORN"],["224","a - grave"],["225","a - acute"],["226","a - circumflex"],["227","a - tilde"],["228","a - diaeresis"],["229","a - ring above"],["230","ligature ae"],["231","c - cedilla"],["232","e - grave"],["233","e - acute"],["234","e - circumflex"],["235","e - diaeresis"],["236","i - grave"],["237","i - acute"],["238","i - circumflex"],["239","i - diaeresis"],["240","eth"],["241","n - tilde"],["242","o - grave"],["243","o - acute"],["244","o - circumflex"],["245","o - tilde"],["246","o - diaeresis"],["248","o slash"],["339","ligature oe"],["353","s - caron"],["249","u - grave"],["250","u - acute"],["251","u - circumflex"],["252","u - diaeresis"],["253","y - acute"],["254","thorn"],["255","y - diaeresis"],["913","Alpha"],["914","Beta"],["915","Gamma"],["916","Delta"],["917","Epsilon"],["918","Zeta"],["919","Eta"],["920","Theta"],["921","Iota"],["922","Kappa"],["923","Lambda"],["924","Mu"],["925","Nu"],["926","Xi"],["927","Omicron"],["928","Pi"],["929","Rho"],["931","Sigma"],["932","Tau"],["933","Upsilon"],["934","Phi"],["935","Chi"],["936","Psi"],["937","Omega"],["945","alpha"],["946","beta"],["947","gamma"],["948","delta"],["949","epsilon"],["950","zeta"],["951","eta"],["952","theta"],["953","iota"],["954","kappa"],["955","lambda"],["956","mu"],["957","nu"],["958","xi"],["959","omicron"],["960","pi"],["961","rho"],["962","final sigma"],["963","sigma"],["964","tau"],["965","upsilon"],["966","phi"],["967","chi"],["968","psi"],["969","omega"],["8501","alef symbol"],["982","pi symbol"],["8476","real part symbol"],["978","upsilon - hook symbol"],["8472","Weierstrass p"],["8465","imaginary part"],["8592","leftwards arrow"],["8593","upwards arrow"],["8594","rightwards arrow"],["8595","downwards arrow"],["8596","left right arrow"],["8629","carriage return"],["8656","leftwards double arrow"],["8657","upwards double arrow"],["8658","rightwards double arrow"],["8659","downwards double arrow"],["8660","left right double arrow"],["8756","therefore"],["8834","subset of"],["8835","superset of"],["8836","not a subset of"],["8838","subset of or equal to"],["8839","superset of or equal to"],["8853","circled plus"],["8855","circled times"],["8869","perpendicular"],["8901","dot operator"],["8968","left ceiling"],["8969","right ceiling"],["8970","left floor"],["8971","right floor"],["9001","left-pointing angle bracket"],["9002","right-pointing angle bracket"],["9674","lozenge"],["9824","black spade suit"],["9827","black club suit"],["9829","black heart suit"],["9830","black diamond suit"],["8194","en space"],["8195","em space"],["8201","thin space"],["8204","zero width non-joiner"],["8205","zero width joiner"],["8206","left-to-right mark"],["8207","right-to-left mark"],["173","soft hyphen"]];e.addButton("charmap",{icon:"charmap",tooltip:"Special character",onclick:a}),e.addMenuItem("charmap",{icon:"charmap",text:"Special character",onclick:a,context:"insert"})}); -;tinymce.PluginManager.add("code",function(e){function o(){e.windowManager.open({title:"Source code",body:{type:"textbox",name:"code",multiline:!0,minWidth:e.getParam("code_dialog_width",600),minHeight:e.getParam("code_dialog_height",Math.min(tinymce.DOM.getViewPort().h-200,500)),value:e.getContent({source_view:!0}),spellcheck:!1,style:"direction: ltr; text-align: left"},onSubmit:function(o){e.focus(),e.undoManager.transact(function(){e.setContent(o.data.code)}),e.selection.setCursorLocation(),e.nodeChanged()}})}e.addCommand("mceCodeEditor",o),e.addButton("code",{icon:"code",tooltip:"Source code",onclick:o}),e.addMenuItem("code",{icon:"code",text:"Source code",context:"tools",onclick:o})}); -;tinymce.PluginManager.requireLangPack("codemirror"),tinymce.PluginManager.add("codemirror",function(e,t){function n(){e.focus(),e.selection.collapse(!0),e.selection.setContent('');var n,o=tinyMCE.baseURL.indexOf("/static/");n=o>0?tinyMCE.baseURL.substring(0,o):window.location.origin;var i="?CodeMirrorPath="+e.settings.codemirror.path+"&ParentOrigin="+window.location.origin,a=e.windowManager.open({title:"HTML source code",url:t+"/source.html"+i,width:800,height:550,resizable:!0,maximizable:!0,buttons:[{text:"OK",subtype:"primary",onclick:function(){s({type:"save"})}},{text:"Cancel",onclick:function(){s({type:"cancel"})}}]}),c=a.getEl().getElementsByTagName("iframe")[0].contentWindow,s=function(e){c.postMessage(e,n)},r=function(t){if(n===t.origin){var o;if("init"===t.data.type)o={content:e.getContent({source_view:!0})},e.fire("ShowCodeEditor",o),s({type:"init",content:o.content}),e.dom.remove(e.dom.select(".CmCaReT"));else if("setText"===t.data.type){o={content:t.data.text};var i=t.data.isDirty;e.fire("SaveCodeEditor",o),e.setContent(o.content);var c=e.dom.select("span#CmCaReT")[0];if(c)e.selection.scrollIntoView(c),e.selection.setCursorLocation(c,0),e.dom.remove(c);else{var r=e.getContent(),d=r.replace('',"");r!==d&&e.setContent(d)}e.isNotDirty=!i,i&&e.nodeChanged()}else"closeWindow"===t.data.type&&a.close()}};a.on("close",function(){window.removeEventListener("message",r)}),window.addEventListener("message",r,!1)}e.addButton("code",{title:"Edit HTML",text:"HTML",icon:!1,onclick:n}),e.addMenuItem("code",{icon:"code",text:"Edit HTML",context:"tools",onclick:n})}); -;tinymce.PluginManager.add("contextmenu",function(e){var n,t=e.settings.contextmenu_never_use_native;e.on("contextmenu",function(i){var o;if(!i.ctrlKey||t){if(i.preventDefault(),o=e.settings.contextmenu||"link image inserttable | cell row column deletetable",n)n.show();else{var c=[];tinymce.each(o.split(/[ ,]/),function(n){var t=e.menuItems[n];"|"==n&&(t={text:n}),t&&(t.shortcut="",c.push(t))});for(var a=0;a0&&/^[0-9]+$/.test(e)&&(e+="px"),e}if(e.settings.image_advtab){var n=s.toJSON(),i=m.parseStyle(n.style);delete i.margin,i["margin-top"]=i["margin-bottom"]=t(n.vspace),i["margin-left"]=i["margin-right"]=t(n.hspace),i["border-width"]=t(n.border),s.find("#style").value(m.serializeStyle(m.parseStyle(m.serializeStyle(i))))}}var s,d,u,h,g={},m=e.dom,p=e.selection.getNode();d=m.getAttrib(p,"width"),u=m.getAttrib(p,"height"),"IMG"!=p.nodeName||p.getAttribute("data-mce-object")||p.getAttribute("data-mce-placeholder")?p=null:g={src:m.getAttrib(p,"src"),alt:m.getAttrib(p,"alt"),width:d,height:u},n&&(h={type:"listbox",label:"Image list",values:i(),value:g.src&&e.convertURL(g.src,"src"),onselect:function(e){var t=s.find("#alt");(!t.value()||e.lastControl&&t.value()==e.lastControl.text())&&t.value(e.control.text()),s.find("#src").value(e.control.value())},onPostRender:function(){h=this}});var y=[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0,onchange:r},h,{name:"alt",type:"textbox",label:"Image description"},{type:"container",label:"Dimensions",layout:"flex",direction:"row",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:5,size:3,onchange:a},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:5,size:3,onchange:a},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}];e.fire('EditImage', g),e.settings.image_advtab?(p&&(g.hspace=l(p.style.marginLeft||p.style.marginRight),g.vspace=l(p.style.marginTop||p.style.marginBottom),g.border=l(p.style.borderWidth),g.style=e.dom.serializeStyle(e.dom.parseStyle(e.dom.getAttrib(p,"style")))),s=e.windowManager.open({title:"Insert/edit image",data:g,bodyType:"tabpanel",body:[{title:"General",type:"form",items:y},{title:"Advanced",type:"form",pack:"start",items:[{label:"Style",name:"style",type:"textbox"},{type:"form",layout:"grid",packV:"start",columns:2,padding:0,alignH:["left","right"],defaults:{type:"textbox",maxWidth:50,onchange:c},items:[{label:"Vertical space",name:"vspace"},{label:"Horizontal space",name:"hspace"},{label:"Border",name:"border"}]}]}],onSubmit:o})):s=e.windowManager.open({title:"Insert/edit image",data:g,body:y,onSubmit:o})}e.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:n(i),stateSelector:"img:not([data-mce-object],[data-mce-placeholder])"}),e.addMenuItem("image",{icon:"image",text:"Insert image",onclick:n(i),context:"insert",prependToContext:!0})}); -;tinymce.PluginManager.add("insertdatetime",function(e){function t(t,a){function n(e,t){if(e=""+e,e.length'+n+"";var i=e.dom.getParent(e.selection.getStart(),"time");if(i)return void e.dom.setOuterHTML(i,n)}e.insertContent(n)}var n,r,i="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),d="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),c="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),m="January February March April May June July August September October November December".split(" "),u=[];e.addCommand("mceInsertDate",function(){a(e.getParam("insertdatetime_dateformat",e.translate("%Y-%m-%d")))}),e.addCommand("mceInsertTime",function(){a(e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S")))}),e.addButton("insertdatetime",{type:"splitbutton",title:"Insert date/time",onclick:function(){a(n||r)},menu:u}),tinymce.each(e.settings.insertdatetime_formats||["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"],function(e){r||(r=e),u.push({text:t(e),onclick:function(){n=e,a(e)}})}),e.addMenuItem("insertdatetime",{icon:"date",text:"Insert date/time",menu:u,context:"insert"})}); -;tinymce.PluginManager.add("link",function(e){function t(t){return function(){var n=e.settings.link_list;"string"==typeof n?tinymce.util.XHR.send({url:n,success:function(e){t(tinymce.util.JSON.parse(e))}}):t(n)}}function n(t){function n(e){var t=f.find("#text");(!t.value()||e.lastControl&&t.value()==e.lastControl.text())&&t.value(e.control.text()),f.find("#href").value(e.control.value())}function l(){var n=[{text:"None",value:""}];return tinymce.each(t,function(t){n.push({text:t.text||t.title,value:e.convertURL(t.value||t.url,"href"),menu:t.menu})}),n}function i(t){var n=[{text:"None",value:""}];return tinymce.each(e.settings.rel_list,function(e){n.push({text:e.text||e.title,value:e.value,selected:t===e.value})}),n}function r(t){var n=[];return e.settings.target_list||(n.push({text:"None",value:""}),n.push({text:"New window",value:"_blank"})),tinymce.each(e.settings.target_list,function(e){n.push({text:e.text||e.title,value:e.value,selected:t===e.value})}),n}function a(t){var l=[];return tinymce.each(e.dom.select("a:not([href])"),function(e){var n=e.name||e.id;n&&l.push({text:n,value:"#"+n,selected:-1!=t.indexOf("#"+n)})}),l.length?(l.unshift({text:"None",value:""}),{name:"anchor",type:"listbox",label:"Anchors",values:l,onselect:n}):void 0}function o(){h&&h.value(e.convertURL(this.value(),"href")),!c&&0===x.text.length&&k&&this.parent().parent().find("#text")[0].value(this.value())}var u,s,c,f,d,h,v,g,x={},m=e.selection,p=e.dom;u=m.getNode(),s=p.getParent(u,"a[href]");var k=!0;if(/=0;y--)if(3!=b[y].nodeType){k=!1;break}}x.text=c=s?s.innerText||s.textContent:m.getContent({format:"text"}),x.href=s?p.getAttrib(s,"href"):"",x.target=s?p.getAttrib(s,"target"):e.settings.default_link_target||"",x.rel=s?p.getAttrib(s,"rel"):"",e.fire("EditLink",x),k&&(d={name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){x.text=this.value()}}),t&&(h={type:"listbox",label:"Link list",values:l(),onselect:n,value:e.convertURL(x.href,"href"),onPostRender:function(){h=this}}),e.settings.target_list!==!1&&(g={name:"target",type:"listbox",label:"Target",values:r(x.target)}),e.settings.rel_list&&(v={name:"rel",type:"listbox",label:"Rel",values:i(x.rel)}),f=e.windowManager.open({title:"Insert link",data:x,body:[{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:o,onkeyup:o},d,a(x.href),h,v,g],onSubmit:function(t){function n(t,n){var l=e.selection.getRng();window.setTimeout(function(){e.windowManager.confirm(t,function(t){e.selection.setRng(l),n(t)})},0)}function l(){s?(e.focus(),k&&i.text!=c&&(s.innerText=i.text),p.setAttribs(s,{href:r,target:i.target?i.target:null,rel:i.rel?i.rel:null}),m.select(s),e.undoManager.add()):k?e.insertContent(p.createHTML("a",{href:r,target:i.target?i.target:null,rel:i.rel?i.rel:null},p.encode(i.text))):e.execCommand("mceInsertLink",!1,{href:r,target:i.target,rel:i.rel?i.rel:null})}var i=t.data;e.fire("SaveLink",i);var r=i.href;return r?r.indexOf("@")>0&&-1==r.indexOf("//")&&-1==r.indexOf(":")?void n("The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",function(e){e&&(r="mailto:"+r),l()}):/^\s*www\./i.test(r)?void n("The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",function(e){e&&(r="http://"+r),l()}):void l():void e.execCommand("unlink")}})}e.addButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Ctrl+K",onclick:t(n),stateSelector:"a[href]"}),e.addButton("unlink",{icon:"unlink",tooltip:"Remove link",cmd:"unlink",stateSelector:"a[href]"}),e.addShortcut("Ctrl+K","",t(n)),this.showDialog=n,e.addMenuItem("link",{icon:"link",text:"Insert link",shortcut:"Ctrl+K",onclick:t(n),stateSelector:"a[href]",context:"insert",prependToContext:!0})}); -;tinymce.PluginManager.add("lists",function(e){function t(e){return e&&/^(OL|UL)$/.test(e.nodeName)}function n(e){return e.parentNode.firstChild==e}function r(e){return e.parentNode.lastChild==e}function o(t){return t&&!!e.schema.getTextBlockElements()[t.nodeName]}function i(e){return e&&"SPAN"===e.nodeName&&"bookmark"===e.getAttribute("data-mce-type")}var a=this;e.on("init",function(){function d(e){function t(t){var r,o,i;o=e[t?"startContainer":"endContainer"],i=e[t?"startOffset":"endOffset"],1==o.nodeType&&(r=b.create("span",{"data-mce-type":"bookmark"}),o.hasChildNodes()?(i=Math.min(i,o.childNodes.length-1),t?o.insertBefore(r,o.childNodes[i]):b.insertAfter(r,o.childNodes[i])):o.appendChild(r),o=r,i=0),n[t?"startContainer":"endContainer"]=o,n[t?"startOffset":"endOffset"]=i}var n={};return t(!0),e.collapsed||t(),n}function s(e){function t(t){function n(e){for(var t=e.parentNode.firstChild,n=0;t;){if(t==e)return n;(1!=t.nodeType||"bookmark"!=t.getAttribute("data-mce-type"))&&n++,t=t.nextSibling}return-1}var r,o,i;r=i=e[t?"startContainer":"endContainer"],o=e[t?"startOffset":"endOffset"],r&&(1==r.nodeType&&(o=n(r),r=r.parentNode,b.remove(i)),e[t?"startContainer":"endContainer"]=r,e[t?"startOffset":"endOffset"]=o)}t(!0),t();var n=b.createRng();n.setStart(e.startContainer,e.startOffset),e.endContainer&&n.setEnd(e.endContainer,e.endOffset),L.setRng(n)}function f(t,n){var r,o,i,a=b.createFragment(),d=e.schema.getBlockElements();if(e.settings.forced_root_block&&(n=n||e.settings.forced_root_block),n&&(o=b.create(n),o.tagName===e.settings.forced_root_block&&b.setAttribs(o,e.settings.forced_root_block_attrs),a.appendChild(o)),t)for(;r=t.firstChild;){var s=r.nodeName;i||"SPAN"==s&&"bookmark"==r.getAttribute("data-mce-type")||(i=!0),d[s]?(a.appendChild(r),o=null):n?(o||(o=b.create(n),a.appendChild(o)),o.appendChild(r)):a.appendChild(r)}return e.settings.forced_root_block?i||tinymce.Env.ie&&!(tinymce.Env.ie>10)||o.appendChild(b.create("br",{"data-mce-bogus":"1"})):a.appendChild(b.create("br")),a}function l(){return tinymce.grep(L.getSelectedBlocks(),function(e){return"LI"==e.nodeName})}function c(e,t,n){var r,o,i=b.select('span[data-mce-type="bookmark"]',e);n=n||f(t),r=b.createRng(),r.setStartAfter(t),r.setEndAfter(e),o=r.extractContents(),b.isEmpty(o)||b.insertAfter(o,e),b.insertAfter(n,e),b.isEmpty(t.parentNode)&&(tinymce.each(i,function(e){t.parentNode.parentNode.insertBefore(e,t.parentNode)}),b.remove(t.parentNode)),b.remove(t)}function p(e){var n,r;if(n=e.nextSibling,n&&t(n)&&n.nodeName==e.nodeName){for(;r=n.firstChild;)e.appendChild(r);b.remove(n)}if(n=e.previousSibling,n&&t(n)&&n.nodeName==e.nodeName){for(;r=n.firstChild;)e.insertBefore(r,e.firstChild);b.remove(n)}}function u(e){tinymce.each(tinymce.grep(b.select("ol,ul",e)),function(e){var n,r=e.parentNode;"LI"==r.nodeName&&r.firstChild==e&&(n=r.previousSibling,n&&"LI"==n.nodeName&&(n.appendChild(e),b.isEmpty(r)&&b.remove(r))),t(r)&&(n=r.previousSibling,n&&"LI"==n.nodeName&&n.appendChild(e))})}function m(e){function o(e){b.isEmpty(e)&&b.remove(e)}var i,a=e.parentNode,d=a.parentNode;return n(e)&&r(e)?("LI"==d.nodeName?(b.insertAfter(e,d),o(d),b.remove(a)):t(d)?b.remove(a,!0):(d.insertBefore(f(e),a),b.remove(a)),!0):n(e)?("LI"==d.nodeName?(b.insertAfter(e,d),e.appendChild(a),o(d)):t(d)?d.insertBefore(e,a):(d.insertBefore(f(e),a),b.remove(e)),!0):r(e)?("LI"==d.nodeName?b.insertAfter(e,d):t(d)?b.insertAfter(e,a):(b.insertAfter(f(e),a),b.remove(e)),!0):("LI"==d.nodeName?(a=d,i=f(e,"LI")):i=t(d)?f(e,"LI"):f(e),c(a,e,i),u(a.parentNode),!0)}function h(e){function n(n,r){var o;if(t(n)){for(;o=e.lastChild.firstChild;)r.appendChild(o);b.remove(n)}}var r,o;return r=e.previousSibling,r&&t(r)?(r.appendChild(e),!0):r&&"LI"==r.nodeName&&t(r.lastChild)?(r.lastChild.appendChild(e),n(e.lastChild,r.lastChild),!0):(r=e.nextSibling,r&&t(r)?(r.insertBefore(e,r.firstChild),!0):r&&"LI"==r.nodeName&&t(e.lastChild)?!1:(r=e.previousSibling,r&&"LI"==r.nodeName?(o=b.create(e.parentNode.nodeName),r.appendChild(o),o.appendChild(e),n(e.lastChild,o),!0):!1))}function v(){var t=l();if(t.length){for(var n=d(L.getRng(!0)),r=0;r0))return n;for(var o=new tinymce.dom.TreeWalker(e.startContainer);n=o[t?"next":"prev"]();)if(3==n.nodeType&&n.data.length>0)return n}function r(e,n){var r,o,i=e.parentNode;for(t(n.lastChild)&&(o=n.lastChild),r=n.lastChild,r&&"BR"==r.nodeName&&e.hasChildNodes()&&b.remove(r);r=e.firstChild;)n.appendChild(r);o&&n.appendChild(o),b.remove(e),b.isEmpty(i)&&b.remove(i)}if(L.isCollapsed()){var o=b.getParent(L.getStart(),"LI");if(o){var i=L.getRng(!0),a=b.getParent(n(i,e),"LI");if(a&&a!=o){var f=d(i);return e?r(a,o):r(o,a),s(f),!0}if(!a&&!e&&N(o.parentNode.nodeName))return!0}}},e.addCommand("Indent",function(){return v()?void 0:!0}),e.addCommand("Outdent",function(){return C()?void 0:!0}),e.addCommand("InsertUnorderedList",function(){y("UL")}),e.addCommand("InsertOrderedList",function(){y("OL")}),e.on("keydown",function(t){9==t.keyCode&&e.dom.getParent(e.selection.getStart(),"LI")&&(t.preventDefault(),t.shiftKey?C():v())})}),e.addButton("indent",{icon:"indent",title:"Increase indent",cmd:"Indent",onPostRender:function(){var t=this;e.on("nodechange",function(){var r=e.dom.getParent(e.selection.getNode(),"LI,UL,OL");t.disabled(r&&("LI"!=r.nodeName||n(r)))})}}),e.on("keydown",function(e){e.keyCode==tinymce.util.VK.BACKSPACE?a.backspaceDelete()&&e.preventDefault():e.keyCode==tinymce.util.VK.DELETE&&a.backspaceDelete(!0)&&e.preventDefault()})}); -;tinymce.PluginManager.add("media",function(e,t){function i(e){return-1!=e.indexOf(".mp3")?"audio/mpeg":-1!=e.indexOf(".wav")?"audio/wav":-1!=e.indexOf(".mp4")?"video/mp4":-1!=e.indexOf(".webm")?"video/webm":-1!=e.indexOf(".ogg")?"video/ogg":-1!=e.indexOf(".swf")?"application/x-shockwave-flash":""}function r(t){var i=e.settings.media_scripts;if(i)for(var r=0;r':"application/x-shockwave-flash"==o.source1mime?(a+='',o.poster&&(a+=''),a+=""):-1!=o.source1mime.indexOf("audio")?e.settings.audio_template_callback?a=e.settings.audio_template_callback(o):a+='":"script"==o.type?a+='':a=e.settings.video_template_callback?e.settings.video_template_callback(o):'"}return a}function s(e){var t={};return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",start:function(e,i){if(t.source1||"param"!=e||(t.source1=i.map.movie),("iframe"==e||"object"==e||"embed"==e||"video"==e||"audio"==e)&&(t.type||(t.type=e),t=tinymce.extend(i.map,t)),"script"==e){var o=r(i.map.src);if(!o)return;t={type:"script",source1:i.map.src,width:o.width,height:o.height}}"source"==e&&(t.source1?t.source2||(t.source2=i.map.src):t.source1=i.map.src),"img"!=e||t.poster||(t.poster=i.map.src)}}).parse(e),t.source1=t.source1||t.src||t.data,t.source2=t.source2||"",t.poster=t.poster||"",t}function n(t){return t.getAttribute("data-mce-object")?s(e.serializer.serialize(t,{selection:!0})):{}}function m(e,t,i){function r(e,t){var i,r,o,a;for(i in t)if(o=""+t[i],e.map[i])for(r=e.length;r--;)a=e[r],a.name==i&&(o?(e.map[i]=o,a.value=o):(delete e.map[i],e.splice(r,1)));else o&&(e.push({name:i,value:o}),e.map[i]=o)}var o,a=new tinymce.html.Writer,c=0;return new tinymce.html.SaxParser({validate:!1,allow_conditional_comments:!0,special:"script,noscript",comment:function(e){a.comment(e)},cdata:function(e){a.cdata(e)},text:function(e,t){a.text(e,t)},start:function(e,s,n){switch(e){case"video":case"object":case"embed":case"img":case"iframe":r(s,{width:t.width,height:t.height})}if(i)switch(e){case"video":r(s,{poster:t.poster,src:""}),t.source2&&r(s,{src:""});break;case"iframe":r(s,{src:t.source1});break;case"source":if(c++,2>=c&&(r(s,{src:t["source"+c],type:t["source"+c+"mime"]}),!t["source"+c]))return;break;case"img":if(!t.poster)return;o=!0}a.start(e,s,n)},end:function(e){if("video"==e&&i)for(var s=1;2>=s;s++)if(t["source"+s]){var n=[];n.map={},s>c&&(r(n,{src:t["source"+s],type:t["source"+s+"mime"]}),a.start("source",n,!0))}if(t.poster&&"object"==e&&i&&!o){var m=[];m.map={},r(m,{src:t.poster,width:t.width,height:t.height}),a.start("img",m,!0)}a.end(e)}},new tinymce.html.Schema({})).parse(e),a.getContent()}var u=[{regex:/youtu\.be\/([\w\-.]+)/,type:"iframe",w:425,h:350,url:"//www.youtube.com/embed/$1"},{regex:/youtube\.com(.+)v=([^&]+)/,type:"iframe",w:425,h:350,url:"//www.youtube.com/embed/$2"},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"//player.vimeo.com/video/$1?title=0&byline=0&portrait=0&color=8dc7dc"},{regex:/maps\.google\.([a-z]{2,3})\/maps\/(.+)msid=(.+)/,type:"iframe",w:425,h:350,url:'//maps.google.com/maps/ms?msid=$2&output=embed"'}];e.on("ResolveName",function(e){var t;1==e.target.nodeType&&(t=e.target.getAttribute("data-mce-object"))&&(e.name=t)}),e.on("preInit",function(){var t=e.schema.getSpecialElements();tinymce.each("video audio iframe object".split(" "),function(e){t[e]=new RegExp("]*>","gi")});var i=e.schema.getBoolAttrs();tinymce.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(e){i[e]={}}),e.parser.addNodeFilter("iframe,video,audio,object,embed,script",function(t,i){for(var o,a,c,s,n,m,u,d,l=t.length;l--;)if(a=t[l],a.parent&&("script"!=a.name||(d=r(a.attr("src"))))){for(c=new tinymce.html.Node("img",1),c.shortEnded=!0,d&&(d.width&&a.attr("width",d.width.toString()),d.height&&a.attr("height",d.height.toString())),m=a.attributes,o=m.length;o--;)s=m[o].name,n=m[o].value,"width"!==s&&"height"!==s&&"style"!==s&&(("data"==s||"src"==s)&&(n=e.convertURL(n,s)),c.attr("data-mce-p-"+s,n));u=a.firstChild&&a.firstChild.value,u&&(c.attr("data-mce-html",escape(u)),c.firstChild=null),c.attr({width:a.attr("width")||"300",height:a.attr("height")||("audio"==i?"30":"150"),style:a.attr("style"),src:tinymce.Env.transparentSrc,"data-mce-object":i,"class":"mce-object mce-object-"+i}),a.replace(c)}}),e.serializer.addAttributeFilter("data-mce-object",function(e,t){for(var i,r,o,a,c,s,n,m=e.length;m--;)if(i=e[m],i.parent){for(n=i.attr(t),r=new tinymce.html.Node(n,1),"audio"!=n&&"script"!=n&&r.attr({width:i.attr("width"),height:i.attr("height")}),r.attr({style:i.attr("style")}),a=i.attributes,o=a.length;o--;){var u=a[o].name;0===u.indexOf("data-mce-p-")&&r.attr(u.substr(11),a[o].value)}"script"==n&&r.attr("type","text/javascript"),c=i.attr("data-mce-html"),c&&(s=new tinymce.html.Node("#text",3),s.raw=!0,s.value=unescape(c),r.append(s)),i.replace(r)}})}),e.on("ObjectSelected",function(e){var t=e.target.getAttribute("data-mce-object");("audio"==t||"script"==t)&&e.preventDefault()}),e.on("objectResized",function(e){var t,i=e.target;i.getAttribute("data-mce-object")&&(t=i.getAttribute("data-mce-html"),t&&(t=unescape(t),i.setAttribute("data-mce-html",escape(m(t,{width:e.width,height:e.height})))))}),e.addButton("media",{tooltip:"Insert/edit video",onclick:o,stateSelector:["img[data-mce-object=video]","img[data-mce-object=iframe]"]}),e.addMenuItem("media",{icon:"media",text:"Insert video",onclick:o,context:"insert",prependToContext:!0})}); -;!function(e,t){"use strict";function n(e,t){for(var n,i=[],r=0;r"),t&&/^(PRE|DIV)$/.test(t.nodeName)||!a?e=n.filter(e,[[/\n/g,"
    "]]):(e=n.filter(e,[[/\n\n/g,"

    "+o],[/^(.*<\/p>)(

    )$/,o+"$1"],[/\n/g,"
    "]]),-1!=e.indexOf("

    ")&&(e=o+e)),r(e)}function o(){var t=i.dom,n=i.getBody(),r=i.dom.getViewPort(i.getWin()),a=r.y,o=20,s;if(h=i.selection.getRng(),i.inline&&(s=i.selection.getScrollContainer(),s&&(a=s.scrollTop)),h.getClientRects){var c=h.getClientRects();if(c.length)o=a+(c[0].top-t.getPos(n).y);else{o=a;var l=h.startContainer;l&&(3==l.nodeType&&l.parentNode!=n&&(l=l.parentNode),1==l.nodeType&&(o=t.getPos(l,s||n).y))}}v=t.add(i.getBody(),"div",{id:"mcepastebin",contentEditable:!0,"data-mce-bogus":"1",style:"position: absolute; top: "+o+"px;width: 10px; height: 10px; overflow: hidden; opacity: 0"},b),(e.ie||e.gecko)&&t.setStyle(v,"left","rtl"==t.getStyle(n,"direction",!0)?65535:-65535),t.bind(v,"beforedeactivate focusin focusout",function(e){e.stopPropagation()}),v.focus(),i.selection.select(v,!0)}function s(){if(v){for(var e;e=i.dom.get("mcepastebin");)i.dom.remove(e),i.dom.unbind(e);h&&i.selection.setRng(h)}x=!1,v=h=null}function c(){var e=b,t,n;for(t=i.dom.select("div[id=mcepastebin]"),n=t.length;n--;){var r=t[n].innerHTML;e==b&&(e=""),r.length>e.length&&(e=r)}return e}function l(e){var t={};if(e&&e.types){var n=e.getData("Text");n&&n.length>0&&(t["text/plain"]=n);for(var i=0;i')},t.readAsDataURL(e.getAsFile()),!0}}if(!(!i.settings.paste_data_images||"text/html"in t||"text/plain"in t)&&e.clipboardData){var a=e.clipboardData.items;if(a)for(var o=0;o0}function m(){i.on("keydown",function(n){if(!n.isDefaultPrevented()&&(t.metaKeyPressed(n)&&86==n.keyCode||n.shiftKey&&45==n.keyCode)){if(x=n.shiftKey&&86==n.keyCode,n.stopImmediatePropagation(),y=(new Date).getTime(),e.ie&&x)return n.preventDefault(),void i.fire("paste",{ieFake:!0});s(),o()}}),i.on("paste",function(t){var l=u(t),d=(new Date).getTime()-y<1e3,m="text"==g.pasteFormat||x;return t.isDefaultPrevented()?void s():p(t,l)?void s():(d||t.preventDefault(),!e.ie||d&&!t.ieFake||(o(),i.dom.bind(v,"paste",function(e){e.stopPropagation()}),i.getDoc().execCommand("Paste",!1,null),l["text/html"]=c()),void setTimeout(function(){var e=c();return v&&v.firstChild&&"mcepastebin"===v.firstChild.id&&(m=!0),s(),e!=b&&d||(e=l["text/html"]||l["text/plain"]||b,e!=b)?(!f(l,"text/html")&&f(l,"text/plain")&&(m=!0),void(m?a(l["text/plain"]||n.innerText(e)):r(e))):void(d||i.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."))},0))}),i.on("dragstart",function(e){if(e.dataTransfer.types)try{e.dataTransfer.setData("mce-internal",i.selection.getContent())}catch(t){}}),i.on("drop",function(e){var t=d(e);if(t&&!e.isDefaultPrevented()){var n=l(e.dataTransfer),o=n["mce-internal"]||n["text/html"]||n["text/plain"];o&&(e.preventDefault(),i.undoManager.transact(function(){n["mce-internal"]&&i.execCommand("Delete"),i.selection.setRng(t),n["text/html"]?r(o):a(o)}))}})}var g=this,v,h,y=0,b="%MCEPASTEBIN%",x;g.pasteHtml=r,g.pasteText=a,i.on("preInit",function(){m(),i.parser.addNodeFilter("img",function(t){if(!i.settings.paste_data_images)for(var n=t.length;n--;){var r=t[n].attributes.map.src;r&&0===r.indexOf("data:image")&&(t[n].attr("data-mce-object")||r===e.transparentSrc||t[n].remove())}})}),i.on("PreProcess",function(){i.dom.remove(i.dom.get("mcepastebin"))})}}),i(g,[l,u,p,v,h,c],function(e,t,n,i,r,a){function o(e){return/c?n&&(n=n.parent.parent):(i=n,n=null)),n&&n.name==o?n.append(e):(i=i||n,n=new r(o,1),s>1&&n.attr("start",""+s),e.wrap(n)),e.name="li",t.value="";var l=t.next;l&&3==l.type&&(l.value=l.value.replace(/^\u00a0+/,"")),c>a&&i&&i.lastChild.append(n),a=c}for(var n,i,a=1,o=e.getAll("p"),s=0;s/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\xa0"],[/([\s\u00a0]*)<\/span>/gi,function(e,t){return t.length>0?t.replace(/./," ").slice(Math.floor(t.length/2)).split("").join("\xa0"):""}]]);var g=c.paste_word_valid_elements;g||(g="@[style],-strong/b,-em/i,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-table[width],-tr,-td[colspan|rowspan|width],-th,-thead,-tfoot,-tbody,-a[href|name],sub,sup,strike,br");var v=new n({valid_elements:g}),h=new t({},v);h.addAttributeFilter("style",function(e){for(var t=e.length,n;t--;)n=e[t],n.attr("style",p(n,n.attr("style"))),"span"!=n.name||n.attributes.length||n.unwrap()}),h.addNodeFilter("a",function(e){for(var t=e.length,n,i,r;t--;)n=e[t],i=n.attr("href"),r=n.attr("name"),i&&0===i.indexOf("file://")&&(i=i.split("#")[1],i&&(i="#"+i)),i||r?n.attr({href:i,name:r}):n.unwrap()});var y=h.parse(d);u(y),l.content=new i({},v).serialize(y)}})}return s.isWordContent=o,s}),i(y,[f,l,g,c],function(e,t,n,i){return function(r){function a(e){r.on("BeforePastePreProcess",function(t){t.content=e(t.content)})}function o(e){return e=i.filter(e,[/^[\s\S]*|[\s\S]*$/g,[/\u00a0<\/span>/g,"\xa0"],/
    $/i])}function s(e){if(!n.isWordContent(e))return e;var a=[];t.each(r.schema.getBlockElements(),function(e,t){a.push(t)});var o=new RegExp("(?:
     [\\s\\r\\n]+|
    )*(<\\/?("+a.join("|")+")[^>]*>)(?:
     [\\s\\r\\n]+|
    )*","g");return e=i.filter(e,[[o,"$1"]]),e=i.filter(e,[[/

    /g,"

    "],[/
    /g," "],[/

    /g,"
    "]])}function c(e){return(r.settings.paste_remove_styles||r.settings.paste_remove_styles_if_webkit!==!1)&&(e=e.replace(/ style=\"[^\"]+\"/g,"")),e}e.webkit&&(a(c),a(o)),e.ie&&a(s)}}),i(b,[x,d,g,y],function(e,t,n,i){var r;e.add("paste",function(e){function a(){"text"==s.pasteFormat?(this.active(!1),s.pasteFormat="html"):(s.pasteFormat="text",this.active(!0),r||(e.windowManager.alert("Paste is now in plain text mode. Contents will now be pasted as plain text until you toggle this option off."),r=!0))}var o=this,s,c=e.settings;o.clipboard=s=new t(e),o.quirks=new i(e),o.wordFilter=new n(e),e.settings.paste_as_text&&(o.clipboard.pasteFormat="text"),c.paste_preprocess&&e.on("PastePreProcess",function(e){c.paste_preprocess.call(o,o,e)}),c.paste_postprocess&&e.on("PastePostProcess",function(e){c.paste_postprocess.call(o,o,e)}),e.addCommand("mceInsertClipboardContent",function(e,t){t.content&&o.clipboard.pasteHtml(t.content),t.text&&o.clipboard.pasteText(t.text)}),e.paste_block_drop&&e.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),e.settings.paste_data_images||e.on("drop",function(e){var t=e.dataTransfer;t&&t.files&&t.files.length>0&&e.preventDefault()}),e.addButton("pastetext",{icon:"pastetext",tooltip:"Paste as text",onclick:a,active:"text"==o.clipboard.pasteFormat}),e.addMenuItem("pastetext",{text:"Paste as text",selectable:!0,active:s.pasteFormat,onclick:a})})}),o([c,d,g,y,b])}(this); -;tinymce.PluginManager.add("print",function(t){t.addCommand("mcePrint",function(){t.getWin().print()}),t.addButton("print",{title:"Print",cmd:"mcePrint"}),t.addShortcut("Ctrl+P","","mcePrint"),t.addMenuItem("print",{text:"Print",cmd:"mcePrint",icon:"print",shortcut:"Ctrl+P",context:"file"})}); -;tinymce.PluginManager.add("save",function(e){function a(){var a;if(a=tinymce.DOM.getParent(e.id,"form"),!e.getParam("save_enablewhendirty",!0)||e.isDirty())return tinymce.triggerSave(),e.getParam("save_onsavecallback")?void(e.execCallback("save_onsavecallback",e)&&(e.startContent=tinymce.trim(e.getContent({format:"raw"})),e.nodeChanged())):void(a?(e.isNotDirty=!0,a.onsubmit&&!a.onsubmit()||("function"==typeof a.submit?a.submit():e.windowManager.alert("Error: Form submit field collision.")),e.nodeChanged()):e.windowManager.alert("Error: No form element found."))}function n(){var a=tinymce.trim(e.startContent);return e.getParam("save_oncancelcallback")?void e.execCallback("save_oncancelcallback",e):(e.setContent(a),e.undoManager.clear(),void e.nodeChanged())}function t(){var a=this;e.on("nodeChange",function(){a.disabled(e.getParam("save_enablewhendirty",!0)&&!e.isDirty())})}e.addCommand("mceSave",a),e.addCommand("mceCancel",n),e.addButton("save",{icon:"save",text:"Save",cmd:"mceSave",disabled:!0,onPostRender:t}),e.addButton("cancel",{text:"Cancel",icon:!1,cmd:"mceCancel",disabled:!0,onPostRender:t}),e.addShortcut("ctrl+s","","mceSave")}); -;!function(){function e(e,t,n,a,r){function i(e,t){if(t=t||0,!e[0])throw"findAndReplaceDOMText cannot handle zero-length matches";var n=e.index;if(t>0){var a=e[t];if(!a)throw"Invalid capture group";n+=e[0].indexOf(a),e[0]=a}return[n,n+e[0].length,[e[0]]]}function d(e){var t;if(3===e.nodeType)return e.data;if(h[e.nodeName]&&!u[e.nodeName])return"";if(t="",(u[e.nodeName]||m[e.nodeName])&&(t+="\n"),e=e.firstChild)do t+=d(e);while(e=e.nextSibling);return t}function o(e,t,n){var a,r,i,d,o=[],l=0,c=e,s=t.shift(),f=0;e:for(;;){if((u[c.nodeName]||m[c.nodeName])&&l++,3===c.nodeType&&(!r&&c.length+l>=s[1]?(r=c,d=s[1]-l):a&&o.push(c),!a&&c.length+l>s[0]&&(a=c,i=s[0]-l),l+=c.length),a&&r){if(c=n({startNode:a,startNodeIndex:i,endNode:r,endNodeIndex:d,innerNodes:o,match:s[2],matchIndex:f}),l-=r.length-d,a=null,r=null,o=[],s=t.shift(),f++,!s)break}else{if((!h[c.nodeName]||u[c.nodeName])&&c.firstChild){c=c.firstChild;continue}if(c.nextSibling){c=c.nextSibling;continue}}for(;;){if(c.nextSibling){c=c.nextSibling;break}if(c.parentNode===e)break e;c=c.parentNode}}}function l(e){var t;if("function"!=typeof e){var n=e.nodeType?e:f.createElement(e);t=function(e,t){var a=n.cloneNode(!1);return a.setAttribute("data-mce-index",t),e&&a.appendChild(f.createTextNode(e)),a}}else t=e;return function(e){var n,a,r,i=e.startNode,d=e.endNode,o=e.matchIndex;if(i===d){var l=i;r=l.parentNode,e.startNodeIndex>0&&(n=f.createTextNode(l.data.substring(0,e.startNodeIndex)),r.insertBefore(n,l));var c=t(e.match[0],o);return r.insertBefore(c,l),e.endNodeIndexs&&f[o].setAttribute("data-mce-index",m-1)}return t.undoManager.add(),s=p,n?(g=d(p+1).length>0,c.next()):(g=d(p-1).length>0,c.prev()),!r&&g},c.done=function(e){var n,r,d,o;for(r=tinymce.toArray(t.getBody().getElementsByTagName("span")),n=0;n "+t+" tr",a);i(n,function(n,r){r+=e,i(I.select("> td, > th",n),function(e,n){var i,a,l,s;if(A[r])for(;A[r][n];)n++;for(l=o(e,"rowspan"),s=o(e,"colspan"),a=r;r+l>a;a++)for(A[a]||(A[a]=[]),i=n;n+s>i;i++)A[a][i]={part:t,real:a==r&&i==n,elm:e,rowspan:l,colspan:s}})}),e+=n.length})}function s(e,t){return e=e.cloneNode(t),e.removeAttribute("id"),e}function c(e,t){var n;return n=A[t],n?n[e]:void 0}function d(e,t,n){e&&(n=parseInt(n,10),1===n?e.removeAttribute(t,1):e.setAttribute(t,n,1))}function u(e){return e&&(I.hasClass(e.elm,"mce-item-selected")||e==M)}function f(){var e=[];return i(a.rows,function(t){i(t.cells,function(n){return I.hasClass(n,"mce-item-selected")||M&&n==M.elm?(e.push(t),!1):void 0})}),e}function m(){var e=I.createRng();e.setStartAfter(a),e.setEndAfter(a),E.setRng(e),I.remove(a)}function p(t){var o,a={};return r.settings.table_clone_elements!==!1&&(a=e.makeMap((r.settings.table_clone_elements||"strong em b i span font h1 h2 h3 h4 h5 h6 p div").toUpperCase(),/[ ,]/)),e.walk(t,function(e){var r;return 3==e.nodeType?(i(I.getParents(e.parentNode,null,t).reverse(),function(e){a[e.nodeName]&&(e=s(e,!1),o?r&&r.appendChild(e):o=r=e,r=e)}),r&&(r.innerHTML=n.ie?" ":'
    '),!1):void 0},"childNodes"),t=s(t,!1),d(t,"rowSpan",1),d(t,"colSpan",1),o?t.appendChild(o):n.ie||(t.innerHTML='
    '),t}function g(){var e=I.createRng(),t;return i(I.select("tr",a),function(e){0===e.cells.length&&I.remove(e)}),0===I.select("tr",a).length?(e.setStartBefore(a),e.setEndBefore(a),E.setRng(e),void I.remove(a)):(i(I.select("thead,tbody,tfoot",a),function(e){0===e.rows.length&&I.remove(e)}),l(),void(B&&(t=A[Math.min(A.length-1,B.y)],t&&(E.select(t[Math.min(t.length-1,B.x)].elm,!0),E.collapse(!0)))))}function h(e,t,n,o){var i,r,a,l,s;for(i=A[t][e].elm.parentNode,a=1;n>=a;a++)if(i=I.getNext(i,"tr")){for(r=e;r>=0;r--)if(s=A[t+a][r].elm,s.parentNode==i){for(l=1;o>=l;l++)I.insertAfter(p(s),s);break}if(-1==r)for(l=1;o>=l;l++)i.insertBefore(p(i.cells[0]),i.cells[0])}}function v(){i(A,function(e,t){i(e,function(e,n){var i,r,a;if(u(e)&&(e=e.elm,i=o(e,"colspan"),r=o(e,"rowspan"),i>1||r>1)){for(d(e,"rowSpan",1),d(e,"colSpan",1),a=0;i-1>a;a++)I.insertAfter(p(e),e);h(n,t,r-1,i)}})})}function b(t,n,o){var r,a,s,f,m,p,h,b,y,w,x;if(t?(r=S(t),a=r.x,s=r.y,f=a+(n-1),m=s+(o-1)):(B=_=null,i(A,function(e,t){i(e,function(e,n){u(e)&&(B||(B={x:n,y:t}),_={x:n,y:t})})}),B&&(a=B.x,s=B.y,f=_.x,m=_.y)),b=c(a,s),y=c(f,m),b&&y&&b.part==y.part){for(v(),l(),b=c(a,s).elm,d(b,"colSpan",f-a+1),d(b,"rowSpan",m-s+1),h=s;m>=h;h++)for(p=a;f>=p;p++)A[h]&&A[h][p]&&(t=A[h][p].elm,t!=b&&(w=e.grep(t.childNodes),i(w,function(e){b.appendChild(e)}),w.length&&(w=e.grep(b.childNodes),x=0,i(w,function(e){"BR"==e.nodeName&&I.getAttrib(e,"data-mce-bogus")&&x++0&&A[n-1][l]&&(g=A[n-1][l].elm,h=o(g,"rowSpan"),h>1)){d(g,"rowSpan",h+1);continue}}else if(h=o(r,"rowspan"),h>1){d(r,"rowSpan",h+1);continue}m=p(r),d(m,"colSpan",r.colSpan),f.appendChild(m),a=r}f.hasChildNodes()&&(e?c.parentNode.insertBefore(f,c):I.insertAfter(f,c))}}function w(e){var t,n;i(A,function(n){return i(n,function(n,o){return u(n)&&(t=o,e)?!1:void 0}),e?!t:void 0}),i(A,function(i,r){var a,l,s;i[t]&&(a=i[t].elm,a!=n&&(s=o(a,"colspan"),l=o(a,"rowspan"),1==s?e?(a.parentNode.insertBefore(p(a),a),h(t,r,l-1,s)):(I.insertAfter(p(a),a),h(t,r,l-1,s)):d(a,"colSpan",a.colSpan+1),n=a))})}function x(){var t=[];i(A,function(n){i(n,function(n,r){u(n)&&-1===e.inArray(t,r)&&(i(A,function(e){var t=e[r].elm,n;n=o(t,"colSpan"),n>1?d(t,"colSpan",n-1):I.remove(t)}),t.push(r))})}),g()}function C(){function e(e){var t,n,r;t=I.getNext(e,"tr"),i(e.cells,function(e){var t=o(e,"rowSpan");t>1&&(d(e,"rowSpan",t-1),n=S(e),h(n.x,n.y,1,1))}),n=S(e.cells[0]),i(A[n.y],function(e){var t;e=e.elm,e!=r&&(t=o(e,"rowSpan"),1>=t?I.remove(e):d(e,"rowSpan",t-1),r=e)})}var t;t=f(),i(t.reverse(),function(t){e(t)}),g()}function P(){var e=f();return I.remove(e),g(),e}function R(){var e=f();return i(e,function(t,n){e[n]=s(t,!0)}),e}function T(e,t){var n=f(),o=n[t?0:n.length-1],r=o.cells.length;e&&(i(A,function(e){var t;return r=0,i(e,function(e){e.real&&(r+=e.colspan),e.elm.parentNode==o&&(t=1)}),t?!1:void 0}),t||e.reverse(),i(e,function(e){var n,i=e.cells.length,a;for(n=0;i>n;n++)a=e.cells[n],d(a,"colSpan",1),d(a,"rowSpan",1);for(n=i;r>n;n++)e.appendChild(p(e.cells[i-1]));for(n=r;i>n;n++)I.remove(e.cells[n]);t?o.parentNode.insertBefore(e,o):I.insertAfter(e,o)}),I.removeClass(I.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"))}function S(e){var t;return i(A,function(n,o){return i(n,function(n,i){return n.elm==e?(t={x:i,y:o},!1):void 0}),!t}),t}function N(e){B=S(e)}function k(){var e,t;return e=t=0,i(A,function(n,o){i(n,function(n,i){var r,a;u(n)&&(n=A[o][i],i>e&&(e=i),o>t&&(t=o),n.real&&(r=n.colspan-1,a=n.rowspan-1,r&&i+r>e&&(e=i+r),a&&o+a>t&&(t=o+a)))})}),{x:e,y:t}}function D(e){var t,n,o,i,r,a,l,s,c,d;if(_=S(e),B&&_){for(t=Math.min(B.x,_.x),n=Math.min(B.y,_.y),o=Math.max(B.x,_.x),i=Math.max(B.y,_.y),r=o,a=i,d=n;a>=d;d++)e=A[d][t],e.real||t-(e.colspan-1)=c;c++)e=A[n][c],e.real||n-(e.rowspan-1)=d;d++)for(c=t;o>=c;c++)e=A[d][c],e.real&&(l=e.colspan-1,s=e.rowspan-1,l&&c+l>r&&(r=c+l),s&&d+s>a&&(a=d+s));for(I.removeClass(I.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),d=n;a>=d;d++)for(c=t;r>=c;c++)A[d][c]&&I.addClass(A[d][c].elm,"mce-item-selected")}}var A,B,_,M,E=r.selection,I=E.dom;a=a||I.getParent(E.getStart(),"table"),l(),M=I.getParent(E.getStart(),"th,td"),M&&(B=S(M),_=k(),M=c(B.x,B.y)),e.extend(this,{deleteTable:m,split:v,merge:b,insertRow:y,insertCol:w,deleteCols:x,deleteRows:C,cutRows:P,copyRows:R,pasteRows:T,getPos:S,setStartCell:N,setEndCell:D})}}),o(u,[f,d,c],function(e,t,n){function o(e,t){return parseInt(e.getAttribute(t)||1,10)}var i=n.each;return function(n){function r(){function t(t){function r(e,o){var i=e?"previousSibling":"nextSibling",r=n.dom.getParent(o,"tr"),l=r[i];if(l)return h(n,o,l,e),t.preventDefault(),!0;var d=n.dom.getParent(r,"table"),u=r.parentNode,f=u.nodeName.toLowerCase();if("tbody"===f||f===(e?"tfoot":"thead")){var m=a(e,d,u,"tbody");if(null!==m)return s(e,m,o)}return c(e,r,i,d)}function a(e,t,o,i){var r=n.dom.select(">"+i,t),a=r.indexOf(o);if(e&&0===a||!e&&a===r.length-1)return l(e,t);if(-1===a){var s="thead"===o.tagName.toLowerCase()?0:r.length-1;return r[s]}return r[a+(e?-1:1)]}function l(e,t){var o=e?"thead":"tfoot",i=n.dom.select(">"+o,t);return 0!==i.length?i[0]:null}function s(e,o,i){var r=d(o,e);return r&&h(n,i,r,e),t.preventDefault(),!0}function c(e,o,i,a){var l=a[i];if(l)return u(l),!0;var s=n.dom.getParent(a,"td,th");if(s)return r(e,s,t);var c=d(o,!e);return u(c),t.preventDefault(),!1}function d(e,t){var o=e&&e[t?"lastChild":"firstChild"];return o&&"BR"===o.nodeName?n.dom.getParent(o,"td,th"):o}function u(e){n.selection.setCursorLocation(e,0)}function f(){return y==e.UP||y==e.DOWN}function m(e){var t=e.selection.getNode(),n=e.dom.getParent(t,"tr");return null!==n}function p(e){for(var t=0,n=e;n.previousSibling;)n=n.previousSibling,t+=o(n,"colspan");return t}function g(e,t){var n=0,r=0;return i(e.children,function(e,i){return n+=o(e,"colspan"),r=i,n>t?!1:void 0}),r}function h(e,t,o,i){var r=p(n.dom.getParent(t,"td,th")),a=g(o,r),l=o.childNodes[a],s=d(l,i);u(s||l)}function v(e){var t=n.selection.getNode(),o=n.dom.getParent(t,"td,th"),i=n.dom.getParent(e,"td,th");return o&&o!==i&&b(o,i)}function b(e,t){return n.dom.getParent(e,"TABLE")===n.dom.getParent(t,"TABLE")}var y=t.keyCode;if(f()&&m(n)){var w=n.selection.getNode();setTimeout(function(){v(w)&&r(!t.shiftKey&&y===e.UP,w,t)},0)}}n.on("KeyDown",function(e){t(e)})}function a(){function e(e,t){var n=t.ownerDocument,o=n.createRange(),i;return o.setStartBefore(t),o.setEnd(e.endContainer,e.endOffset),i=n.createElement("body"),i.appendChild(o.cloneContents()),0===i.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length}n.on("KeyDown",function(t){var o,i,r=n.dom;(37==t.keyCode||38==t.keyCode)&&(o=n.selection.getRng(),i=r.getParent(o.startContainer,"table"),i&&n.getBody().firstChild==i&&e(o,i)&&(o=r.createRng(),o.setStartBefore(i),o.setEndBefore(i),n.selection.setRng(o),t.preventDefault()))})}function l(){n.on("KeyDown SetContent VisualAid",function(){var e;for(e=n.getBody().lastChild;e;e=e.previousSibling)if(3==e.nodeType){if(e.nodeValue.length>0)break}else if(1==e.nodeType&&!e.getAttribute("data-mce-bogus"))break;e&&"TABLE"==e.nodeName&&(n.settings.forced_root_block?n.dom.add(n.getBody(),n.settings.forced_root_block,n.settings.forced_root_block_attrs,t.ie&&t.ie<11?" ":'
    '):n.dom.add(n.getBody(),"br",{"data-mce-bogus":"1"}))}),n.on("PreProcess",function(e){var t=e.node.lastChild;t&&("BR"==t.nodeName||1==t.childNodes.length&&("BR"==t.firstChild.nodeName||"\xa0"==t.firstChild.nodeValue))&&t.previousSibling&&"TABLE"==t.previousSibling.nodeName&&n.dom.remove(t)})}function s(){function e(e,t,n,o){var i=3,r=e.dom.getParent(t.startContainer,"TABLE"),a,l,s;return r&&(a=r.parentNode),l=t.startContainer.nodeType==i&&0===t.startOffset&&0===t.endOffset&&o&&("TR"==n.nodeName||n==a),s=("TD"==n.nodeName||"TH"==n.nodeName)&&!o,l||s}function t(){var t=n.selection.getRng(),o=n.selection.getNode(),i=n.dom.getParent(t.startContainer,"TD,TH");if(e(n,t,o,i)){i||(i=o);for(var r=i.lastChild;r.lastChild;)r=r.lastChild;t.setEnd(r,r.nodeValue.length),n.selection.setRng(t)}}n.on("KeyDown",function(){t()}),n.on("MouseDown",function(e){2!=e.button&&t()})}function c(){n.on("keydown",function(t){if((t.keyCode==e.DELETE||t.keyCode==e.BACKSPACE)&&!t.isDefaultPrevented()){var o=n.dom.getParent(n.selection.getStart(),"table");if(o){for(var i=n.dom.select("td,th",o),r=i.length;r--;)if(!n.dom.hasClass(i[r],"mce-item-selected"))return;t.preventDefault(),n.execCommand("mceTableDelete")}}})}c(),t.webkit&&(r(),s()),t.gecko&&(a(),l()),t.ie>10&&(a(),l())}}),o(m,[s,p,c],function(e,t,n){return function(o){function i(){o.getBody().style.webkitUserSelect="",d&&(o.dom.removeClass(o.dom.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),d=!1)}function r(t){var n,i,r=t.target;if(s&&(l||r!=s)&&("TD"==r.nodeName||"TH"==r.nodeName)){i=a.getParent(r,"table"),i==c&&(l||(l=new e(o,i),l.setStartCell(s),o.getBody().style.webkitUserSelect="none"),l.setEndCell(r),d=!0),n=o.selection.getSel();try{n.removeAllRanges?n.removeAllRanges():n.empty()}catch(u){}t.preventDefault()}}var a=o.dom,l,s,c,d=!0;return o.on("MouseDown",function(e){2!=e.button&&(i(),s=a.getParent(e.target,"td,th"),c=a.getParent(s,"table"))}),o.on("mouseover",r),o.on("remove",function(){a.unbind(o.getDoc(),"mouseover",r)}),o.on("MouseUp",function(){function e(e,o){var r=new t(e,e);do{if(3==e.nodeType&&0!==n.trim(e.nodeValue).length)return void(o?i.setStart(e,0):i.setEnd(e,e.nodeValue.length));if("BR"==e.nodeName)return void(o?i.setStartBefore(e):i.setEndBefore(e))}while(e=o?r.next():r.prev())}var i,r=o.selection,d,u,f,m,p;if(s){if(l&&(o.getBody().style.webkitUserSelect=""),d=a.select("td.mce-item-selected,th.mce-item-selected"),d.length>0){i=a.createRng(),f=d[0],p=d[d.length-1],i.setStartBefore(f),i.setEndAfter(f),e(f,1),u=new t(f,a.getParent(d[0],"table"));do if("TD"==f.nodeName||"TH"==f.nodeName){if(!a.hasClass(f,"mce-item-selected"))break;m=f}while(f=u.next());e(m),r.setRng(i)}o.nodeChanged(),s=l=c=null}}),o.on("KeyUp",function(){i()}),{clear:i}}}),o(g,[s,u,m,c,p,d,h],function(e,t,n,o,i,r,a){function l(o){function i(e){return e?e.replace(/px$/,""):""}function a(e){return/^[0-9]+$/.test(e)&&(e+="px"),e}function l(e){s("left center right".split(" "),function(t){o.formatter.remove("align"+t,{},e)})}function c(){var e=o.dom,t,n;t=e.getParent(o.selection.getStart(),"table"),n={width:i(e.getStyle(t,"width")||e.getAttrib(t,"width")),height:i(e.getStyle(t,"height")||e.getAttrib(t,"height")),cellspacing:e.getAttrib(t,"cellspacing"),cellpadding:e.getAttrib(t,"cellpadding"),border:e.getAttrib(t,"border"),caption:!!e.select("caption",t)[0]},s("left center right".split(" "),function(e){o.formatter.matchNode(t,"align"+e)&&(n.align=e)}),o.windowManager.open({title:"Table properties",items:{type:"form",layout:"grid",columns:2,data:n,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width"},{label:"Height",name:"height"},{label:"Cell spacing",name:"cellspacing"},{label:"Cell padding",name:"cellpadding"},{label:"Border",name:"border"},{label:"Caption",name:"caption",type:"checkbox"},{label:"Alignment",minWidth:90,name:"align",type:"listbox",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]},onsubmit:function(){var n=this.toJSON(),i;o.undoManager.transact(function(){o.dom.setAttribs(t,{cellspacing:n.cellspacing,cellpadding:n.cellpadding,border:n.border}),o.dom.setStyles(t,{width:a(n.width),height:a(n.height)}),i=e.select("caption",t)[0],i&&!n.caption&&e.remove(i),!i&&n.caption&&(i=e.create("caption"),i.innerHTML=r.ie?"\xa0":'
    ',t.insertBefore(i,t.firstChild)),l(t),n.align&&o.formatter.apply("align"+n.align,{},t),o.focus(),o.addVisual()})}})}function d(e,t){o.windowManager.open({title:"Merge cells",body:[{label:"Cols",name:"cols",type:"textbox",size:10},{label:"Rows",name:"rows",type:"textbox",size:10}],onsubmit:function(){var n=this.toJSON();o.undoManager.transact(function(){e.merge(t,n.cols,n.rows)})}})}function u(){var e=o.dom,t,n,r=[];r=o.dom.select("td.mce-item-selected,th.mce-item-selected"),t=o.dom.getParent(o.selection.getStart(),"td,th"),!r.length&&t&&r.push(t),t=t||r[0],t&&(n={width:i(e.getStyle(t,"width")||e.getAttrib(t,"width")),height:i(e.getStyle(t,"height")||e.getAttrib(t,"height")),scope:e.getAttrib(t,"scope")},n.type=t.nodeName.toLowerCase(),s("left center right".split(" "),function(e){o.formatter.matchNode(t,"align"+e)&&(n.align=e)}),o.windowManager.open({title:"Cell properties",items:{type:"form",data:n,layout:"grid",columns:2,defaults:{type:"textbox",maxWidth:50},items:[{label:"Width",name:"width"},{label:"Height",name:"height"},{label:"Cell type",name:"type",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Row",value:"row"},{text:"Column",value:"col"},{text:"Row group",value:"rowgroup"},{text:"Column group",value:"colgroup"}]},{label:"Alignment",name:"align",type:"listbox",text:"None",minWidth:90,maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]}]},onsubmit:function(){var t=this.toJSON();o.undoManager.transact(function(){s(r,function(n){o.dom.setAttrib(n,"scope",t.scope),o.dom.setStyles(n,{width:a(t.width),height:a(t.height)}),t.type&&n.nodeName.toLowerCase()!=t.type&&(n=e.rename(n,t.type)),l(n),t.align&&o.formatter.apply("align"+t.align,{},n)}),o.focus()})}}))}function f(){var e=o.dom,t,n,r,c,d=[];t=o.dom.getParent(o.selection.getStart(),"table"),n=o.dom.getParent(o.selection.getStart(),"td,th"),s(t.rows,function(t){s(t.cells,function(o){return e.hasClass(o,"mce-item-selected")||o==n?(d.push(t),!1):void 0})}),r=d[0],r&&(c={height:i(e.getStyle(r,"height")||e.getAttrib(r,"height")),scope:e.getAttrib(r,"scope")},c.type=r.parentNode.nodeName.toLowerCase(),s("left center right".split(" "),function(e){o.formatter.matchNode(r,"align"+e)&&(c.align=e)}),o.windowManager.open({title:"Row properties",items:{type:"form",data:c,columns:2,defaults:{type:"textbox"},items:[{type:"listbox",name:"type",label:"Row type",text:"None",maxWidth:null,values:[{text:"Header",value:"thead"},{text:"Body",value:"tbody"},{text:"Footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,values:[{text:"None",value:""},{text:"Left",value:"left"},{text:"Center",value:"center"},{text:"Right",value:"right"}]},{label:"Height",name:"height"}]},onsubmit:function(){var t=this.toJSON(),n,i,r;o.undoManager.transact(function(){var c=t.type;s(d,function(s){o.dom.setAttrib(s,"scope",t.scope),o.dom.setStyles(s,{height:a(t.height)}),c!=s.parentNode.nodeName.toLowerCase()&&(n=e.getParent(s,"table"),i=s.parentNode,r=e.select(c,n)[0],r||(r=e.create(c),n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r)),r.appendChild(s),i.hasChildNodes()||e.remove(i)),l(s),t.align&&o.formatter.apply("align"+t.align,{},s)}),o.focus()})}}))}function m(e){return function(){o.execCommand(e)}}function p(e,t){var n,i,a;for(a="",n=0;t>n;n++){for(a+="",i=0;e>i;i++)a+="";a+=""}a+="
    "+(r.ie?" ":"
    ")+"
    ",o.insertContent(a)}function g(e,t){function n(){e.disabled(!o.dom.getParent(o.selection.getStart(),t)),o.selection.selectorChanged(t,function(t){e.disabled(!t)})}o.initialized?n():o.on("init",n)}function h(){g(this,"table")}function v(){g(this,"td,th")}function b(){var e="";e='';for(var t=0;10>t;t++){e+="";for(var n=0;10>n;n++)e+='";e+=""}return e+="
    ",e+='

    '}function y(e,t,n){var i=n.getEl().getElementsByTagName("table")[0],r=n.parent().rel,a,l,s,c;if(n.isRtl()||"tl-tr"==r){for(l=9;l>=0;l--)for(a=0;10>a;a++)c=i.rows[l].childNodes[a].firstChild,o.dom.toggleClass(c,"mce-active",a>=e&&t>=l),a>=e&&t>=l&&(s=c);e=9-e,i.nextSibling.innerHTML=e+" x "+(t+1)}else{for(l=0;10>l;l++)for(a=0;10>a;a++)c=i.rows[l].childNodes[a].firstChild,o.dom.toggleClass(c,"mce-active",e>=a&&t>=l),e>=a&&t>=l&&(s=c);i.nextSibling.innerHTML=e+1+" x "+(t+1)}return s.parentNode}var w,x,C=this;o.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",onhide:function(){var e=this.menu.items()[0].getEl().getElementsByTagName("a");o.dom.removeClass(e,"mce-active"),o.dom.addClass(e[0],"mce-active")},menu:[{type:"container",html:b(),onPostRender:function(){this.lastX=this.lastY=0},onmousemove:function(e){var t=e.target,n,o;"A"==t.nodeName&&(n=parseInt(t.getAttribute("data-mce-x"),10),o=parseInt(t.getAttribute("data-mce-y"),10),(n!==this.lastX||o!==this.lastY)&&(y(n,o,e.control),this.lastX=n,this.lastY=o))},onkeydown:function(e){var t=this.lastX,n=this.lastY,o;switch(e.keyCode){case 37:t>0&&(t--,o=!0);break;case 39:o=!0,9>t&&t++;break;case 38:o=!0,n>0&&n--;break;case 40:o=!0,9>n&&n++}o&&(e.preventDefault(),e.stopPropagation(),y(t,n,e.control).focus(),this.lastX=t,this.lastY=n)},onclick:function(e){"A"==e.target.nodeName&&(e.preventDefault(),e.stopPropagation(),this.parent().cancel(),p(this.lastX+1,this.lastY+1))}}]}),o.addMenuItem("tableprops",{text:"Table properties",context:"table",onPostRender:h,onclick:c}),o.addMenuItem("deletetable",{text:"Delete table",context:"table",onPostRender:h,cmd:"mceTableDelete"}),o.addMenuItem("cell",{separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:m("mceTableCellProps"),onPostRender:v},{text:"Merge cells",onclick:m("mceTableMergeCells"),onPostRender:v},{text:"Split cell",onclick:m("mceTableSplitCells"),onPostRender:v}]}),o.addMenuItem("row",{text:"Row",context:"table",menu:[{text:"Insert row before",onclick:m("mceTableInsertRowBefore"),onPostRender:v},{text:"Insert row after",onclick:m("mceTableInsertRowAfter"),onPostRender:v},{text:"Delete row",onclick:m("mceTableDeleteRow"),onPostRender:v},{text:"Row properties",onclick:m("mceTableRowProps"),onPostRender:v},{text:"-"},{text:"Cut row",onclick:m("mceTableCutRow"),onPostRender:v},{text:"Copy row",onclick:m("mceTableCopyRow"),onPostRender:v},{text:"Paste row before",onclick:m("mceTablePasteRowBefore"),onPostRender:v},{text:"Paste row after",onclick:m("mceTablePasteRowAfter"),onPostRender:v}]}),o.addMenuItem("column",{text:"Column",context:"table",menu:[{text:"Insert column before",onclick:m("mceTableInsertColBefore"),onPostRender:v},{text:"Insert column after",onclick:m("mceTableInsertColAfter"),onPostRender:v},{text:"Delete column",onclick:m("mceTableDeleteCol"),onPostRender:v}]});var P=[];s("inserttable tableprops deletetable | cell row column".split(" "),function(e){P.push("|"==e?{text:"-"}:o.menuItems[e])}),o.addButton("table",{type:"menubutton",title:"Table",menu:P}),r.isIE||o.on("click",function(e){e=e.target,"TABLE"===e.nodeName&&(o.selection.select(e),o.nodeChanged())}),C.quirks=new t(o),o.on("Init",function(){w=o.windowManager,C.cellSelection=new n(o)}),s({mceTableSplitCells:function(e){e.split()},mceTableMergeCells:function(e){var t,n,i;i=o.dom.getParent(o.selection.getStart(),"th,td"),i&&(t=i.rowSpan,n=i.colSpan),o.dom.select("td.mce-item-selected,th.mce-item-selected").length?e.merge():d(e,i)},mceTableInsertRowBefore:function(e){e.insertRow(!0)},mceTableInsertRowAfter:function(e){e.insertRow()},mceTableInsertColBefore:function(e){e.insertCol(!0)},mceTableInsertColAfter:function(e){e.insertCol()},mceTableDeleteCol:function(e){e.deleteCols()},mceTableDeleteRow:function(e){e.deleteRows()},mceTableCutRow:function(e){x=e.cutRows()},mceTableCopyRow:function(e){x=e.copyRows()},mceTablePasteRowBefore:function(e){e.pasteRows(x,!0)},mceTablePasteRowAfter:function(e){e.pasteRows(x)},mceTableDelete:function(e){e.deleteTable()}},function(t,n){o.addCommand(n,function(){var n=new e(o);n&&(t(n),o.execCommand("mceRepaint"),C.cellSelection.clear())})}),s({mceInsertTable:function(){c()},mceTableRowProps:f,mceTableCellProps:u},function(e,t){o.addCommand(t,function(t,n){e(n)})})}var s=o.each;a.add("table",l)}),a([s,u,m,g])}(this); -;tinymce.PluginManager.add("textcolor",function(e){function t(){var t,o,r=[];for(o=e.settings.textcolor_map||["000000","Black","993300","Burnt orange","333300","Dark olive","003300","Dark green","003366","Dark azure","000080","Navy Blue","333399","Indigo","333333","Very dark gray","800000","Maroon","FF6600","Orange","808000","Olive","008000","Green","008080","Teal","0000FF","Blue","666699","Grayish blue","808080","Gray","FF0000","Red","FF9900","Amber","99CC00","Yellow green","339966","Sea green","33CCCC","Turquoise","3366FF","Royal blue","800080","Purple","999999","Medium gray","FF00FF","Magenta","FFCC00","Gold","FFFF00","Yellow","00FF00","Lime","00FFFF","Aqua","00CCFF","Sky blue","993366","Brown","C0C0C0","Silver","FF99CC","Pink","FFCC99","Peach","FFFF99","Light yellow","CCFFCC","Pale green","CCFFFF","Pale cyan","99CCFF","Light sky blue","CC99FF","Plum","FFFFFF","White"],t=0;t',a=o.length-1,c=e.settings.textcolor_rows||5,i=e.settings.textcolor_cols||8,F=0;c>F;F++){for(l+="",n=0;i>n;n++)d=F*i+n,d>a?l+="":(r=o[d],l+='
    ');l+=""}return l+=""}function r(t){var o,r=this.parent();(o=t.target.getAttribute("data-mce-color"))&&(this.lastId&&document.getElementById(this.lastId).setAttribute("aria-selected",!1),t.target.setAttribute("aria-selected",!0),this.lastId=t.target.id,r.hidePanel(),o="#"+o,r.color(o),e.execCommand(r.settings.selectcmd,!1,o))}function l(){var t=this;t._color&&e.execCommand(t.settings.selectcmd,!1,t._color)}e.addButton("forecolor",{type:"colorbutton",tooltip:"Text color",selectcmd:"ForeColor",panel:{role:"application",ariaRemember:!0,html:o,onclick:r},onclick:l}),e.addButton("backcolor",{type:"colorbutton",tooltip:"Background color",selectcmd:"HiliteColor",panel:{role:"application",ariaRemember:!0,html:o,onclick:r},onclick:l})}); -;tinymce.PluginManager.add("visualblocks",function(e,s){function o(){var s=this;s.active(a),e.on("VisualBlocks",function(){s.active(e.dom.hasClass(e.getBody(),"mce-visualblocks"))})}var l,t,a;window.NodeList&&(e.addCommand("mceVisualBlocks",function(){var o,c=e.dom;l||(l=c.uniqueId(),o=c.create("link",{id:l,rel:"stylesheet",href:s+"/css/visualblocks.css"}),e.getDoc().getElementsByTagName("head")[0].appendChild(o)),e.on("PreviewFormats AfterPreviewFormats",function(s){a&&c.toggleClass(e.getBody(),"mce-visualblocks","afterpreviewformats"==s.type)}),c.toggleClass(e.getBody(),"mce-visualblocks"),a=e.dom.hasClass(e.getBody(),"mce-visualblocks"),t&&t.active(c.hasClass(e.getBody(),"mce-visualblocks")),e.fire("VisualBlocks")}),e.addButton("visualblocks",{title:"Show blocks",cmd:"mceVisualBlocks",onPostRender:o}),e.addMenuItem("visualblocks",{text:"Show blocks",cmd:"mceVisualBlocks",onPostRender:o,selectable:!0,context:"view",prependToContext:!0}),e.on("init",function(){e.settings.visualblocks_default_state&&e.execCommand("mceVisualBlocks",!1,null,{skip_focus:!0})}),e.on("remove",function(){e.dom.removeClass(e.getBody(),"mce-visualblocks")}))}); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var r=function(e){if(null===e)return"null";if(e===undefined)return"undefined";var t=typeof e;return"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t},t=function(e){return{eq:e}},s=t(function(e,t){return e===t}),i=function(o){return t(function(e,t){if(e.length!==t.length)return!1;for(var n=e.length,r=0;r=r.length&&n.substr(o,o+r.length)===r;var n,r,o},ze=function(t){return function(e){return e.replace(t,"")}},je=ze(/^\s+|\s+$/g),He=ze(/^\s+/g),Ve=ze(/\s+$/g),qe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,$e=function(t){return function(e){return Fe(e,t)}},We=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Fe(e,"edge/")&&Fe(e,"chrome")&&Fe(e,"safari")&&Fe(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,qe],search:function(e){return Fe(e,"chrome")&&!Fe(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Fe(e,"msie")||Fe(e,"trident")}},{name:"Opera",versionRegexes:[qe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:$e("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:$e("firefox")},{name:"Safari",versionRegexes:[qe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Fe(e,"safari")||Fe(e,"mobile/"))&&Fe(e,"applewebkit")}}],Ke=[{name:"Windows",search:$e("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Fe(e,"iphone")||Fe(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:$e("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:$e("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:$e("linux"),versionRegexes:[]},{name:"Solaris",search:$e("sunos"),versionRegexes:[]},{name:"FreeBSD",search:$e("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:$e("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Xe={browsers:N(We),oses:N(Ke)},Ye="Firefox",Ge=function(e){var t=e.current,n=e.version,r=function(e){return function(){return t===e}};return{current:t,version:n,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r(Ye),isSafari:r("Safari")}},Je={unknown:function(){return Ge({current:undefined,version:Pe.unknown()})},nu:Ge,edge:N("Edge"),chrome:N("Chrome"),ie:N("IE"),opera:N("Opera"),firefox:N(Ye),safari:N("Safari")},Qe="Windows",Ze="Android",et="Solaris",tt="FreeBSD",nt="ChromeOS",rt=function(e){var t=e.current,n=e.version,r=function(e){return function(){return t===e}};return{current:t,version:n,isWindows:r(Qe),isiOS:r("iOS"),isAndroid:r(Ze),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r(et),isFreeBSD:r(tt),isChromeOS:r(nt)}},ot={unknown:function(){return rt({current:undefined,version:Pe.unknown()})},nu:rt,windows:N(Qe),ios:N("iOS"),android:N(Ze),linux:N("Linux"),osx:N("OSX"),solaris:N(et),freebsd:N(tt),chromeos:N(nt)},it=function(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,p=Xe.browsers(),g=Xe.oses(),h=Ie(p,e).fold(Je.unknown,Je.nu),v=Me(g,e).fold(ot.unknown,ot.nu);return{browser:h,os:v,deviceType:(r=h,o=e,i=t,a=(n=v).isiOS()&&!0===/ipad/i.test(o),u=n.isiOS()&&!a,s=n.isiOS()||n.isAndroid(),c=s||i("(pointer:coarse)"),l=a||!u&&s&&i("(min-device-width:768px)"),f=u||s&&!l,d=r.isSafari()&&n.isiOS()&&!1===/safari/i.test(o),m=!f&&!l&&!d,{isiPad:N(a),isiPhone:N(u),isTablet:N(l),isPhone:N(f),isTouch:N(c),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:N(d),isDesktop:N(m)})}},at=function(e){return window.matchMedia(e).matches},ut=(ke=!(Ne=function(){return it(navigator.userAgent,at)}),function(){for(var e=[],t=0;t=a.length&&r(o)}))})})},dr=function(n){return{is:function(e){return n===e},isValue:k,isError:p,getOr:N(n),getOrThunk:N(n),getOrDie:N(n),or:function(e){return dr(n)},orThunk:function(e){return dr(n)},fold:function(e,t){return t(n)},map:function(e){return dr(e(n))},mapError:function(e){return dr(n)},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOptional:function(){return U.some(n)}}},mr=function(n){return{is:p,isValue:p,isError:k,getOr:o,getOrThunk:function(e){return e()},getOrDie:function(){return m(String(n))()},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return mr(n)},mapError:function(e){return mr(e(n))},each:V,bind:function(e){return mr(n)},exists:p,forall:k,toOptional:U.none}},pr={value:dr,error:mr,fromOption:function(e,t){return e.fold(function(){return mr(t)},dr)}},gr=function(a){if(!S(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};return $(a,function(e,r){var t=ne(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!S(i))throw new Error("case arguments must be an array");u.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Wo=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ko=/[<>&\"\']/g,Xo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Yo={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"},Go={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},Jo={"<":"<",">":">","&":"&",""":'"',"'":"'"},Qo=function(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n>10),56320+(1023&t))):Yo[t]||String.fromCharCode(t):Jo[e]||Zo[e]||(n=e,(r=Nt.fromTag("div").dom).innerHTML=n,r.textContent||r.innerText||n);var n,r})}},oi={},ii={},ai=xt.makeMap,ui=xt.each,si=xt.extend,ci=xt.explode,li=xt.inArray,fi=function(e,t){return(e=xt.trim(e))?e.split(t||" "):[]},di=function(e){var s,t,n,r,o,i,c={},a=function(e,t,n){var r,o,i=function(e,t){for(var n={},r=0,o=e.length;r
    ');return rn(n.element,r),xd(r,function(){return ln(r)})},Nd=function(n,r,o,i){Rd(n,function(e,t){return kd(n,r,o,i)},o)},Ed=function(e,t,n,r,o){var i,a,u={elm:r.element.dom,alignToTop:o};i=u,e.fire("ScrollIntoView",i).isDefaultPrevented()||(n(t,vn(t).top,r,o),a=u,e.fire("AfterScrollIntoView",a))},kd=function(e,t,n,r){var o=Nt.fromDom(e.getBody()),i=Nt.fromDom(e.getDoc());o.dom.offsetWidth;var a=Sd(Nt.fromDom(n.startContainer),n.startOffset);Ed(e,i,t,a,r),a.cleanup()},_d=function(e,t,n,r){var o,i=Nt.fromDom(e.getDoc());Ed(e,i,n,(o=t,xd(Nt.fromDom(o),V)),r)},Rd=function(e,t,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,a=n.endOffset;t(Nt.fromDom(r),Nt.fromDom(i));var u=e.dom.createRng();u.setStart(r,o),u.setEnd(i,a),e.selection.setRng(n)},Td=function(e,t,n,r){var o,i=e.pos;n?yn(i.left,i.top,r):(o=i.top-t+e.height,yn(i.left,o,r))},Ad=function(e,t,n,r,o){var i=n+t,a=r.pos.top,u=r.bottom,s=n<=u-a;aa.bottom&&bn(n.element,!0===r)},Bd=function(e,t,n){return Nd(e,Dd,t,n)},Pd=function(e,t,n){return _d(e,t,Dd,n)},Ld=function(e,t,n){return Nd(e,Od,t,n)},Id=function(e,t,n){return _d(e,t,Od,n)},Md=function(e,t,n){(e.inline?Bd:Ld)(e,t,n)},Fd=function(e){var t=Zt(e).dom;return e.dom===t.activeElement},Ud=function(e){return void 0===e&&(e=Nt.fromDom(document)),U.from(e.dom.activeElement).map(Nt.fromDom)},zd=function(e,t,n,r){return{start:e,soffset:t,finish:n,foffset:r}},jd=gr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Hd=(jd.before,jd.on,jd.after,function(e){return e.fold(o,o,o)}),Vd=gr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),qd={domRange:Vd.domRange,relative:Vd.relative,exact:Vd.exact,exactFromRange:function(e){return Vd.exact(e.start,e.soffset,e.finish,e.foffset)},getWin:function(e){var t=e.match({domRange:function(e){return Nt.fromDom(e.startContainer)},relative:function(e,t){return Hd(e)},exact:function(e,t,n,r){return e}});return zt(t)},range:zd},$d=st().browser,Wd=function(e,t){var n=Lt(t)?Uf(t).length:Wt(t).length+1;return n":" />",n&&s&&l[e]&&0"),s&&l[e]&&0")},comment:function(e){u.push("\x3c!--",e,"--\x3e")},pi:function(e,t){t?u.push(""):u.push(""),s&&u.push("\n")},doctype:function(e){u.push("",s?"\n":"")},reset:function(){u.length=0},getContent:function(){return u.join("").replace(/\n$/,"")}}},Tm=function(t,p){void 0===p&&(p=pi());var g=Rm(t);(t=t||{}).validate=!("validate"in t)||t.validate;return{serialize:function(e){var f=t.validate,d={3:function(e){g.text(e.value,e.raw)},8:function(e){g.comment(e.value)},7:function(e){g.pi(e.name,e.value)},10:function(e){g.doctype(e.value)},4:function(e){g.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;m(e),e=e.next;);}};g.reset();var m=function(e){var t,n,r,o,i,a,u,s,c,l=d[e.type];if(l)l(e);else{if(t=e.name,n=e.shortEnded,r=e.attributes,f&&r&&1]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g;for(u.lastIndex=r=n;o=u.exec(t);){if(r=u.lastIndex,"/"===o[1])i--;else if(!o[1]){if(o[2]in a)continue;i++}if(0===i)break}return r};function Om(W,K){void 0===K&&(K=pi());var e=function(){};!1!==(W=W||{}).fix_self_closing&&(W.fix_self_closing=!0);var X=W.comment?W.comment:e,Y=W.cdata?W.cdata:e,G=W.text?W.text:e,J=W.start?W.start:e,Q=W.end?W.end:e,Z=W.pi?W.pi:e,ee=W.doctype?W.doctype:e,n=function(m,e){void 0===e&&(e="html");for(var t,n,r,p,o,i,a,g,u,s,c,l,f,h,v,d,y,b,C,w=m.html,x=0,S=[],N=0,E=ri.decode,k=xt.makeMap("src,href,data,background,formaction,poster,xlink:href"),_=/((java|vb)script|mhtml):/i,R="html"===e?0:1,T=function(e){for(var t,n=S.length;n--&&S[n].name!==e;);if(0<=n){for(t=S.length-1;n<=t;t--)(e=S[t]).valid&&Q(e.name);S.length=n}},A=function(e,t){return G(Am(e,m),t)},D=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),W.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),X(Am(e,m)))},O=function(e,t){var n=e||"",r=!Ue(n,"--"),o=function(e,t,n){void 0===n&&(n=0);var r=e.toLowerCase();if(-1!==r.indexOf("[if ",n)&&(u=n,/^\s*\[if [\w\W]+\]>.*/.test(r.substr(u)))){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(t){var i=r.indexOf(">",n);return-1!==i?i:r.length}var a=/--!?>/;a.lastIndex=n;var u,s=a.exec(e);return s?s.index+s[0].length:r.length}(w,r,t);return e=w.substr(t,o-t),D(r?n+e:e),o+1},B=function(e,t,n,r,o){var i,a,u,s,c,l;if(t=t.toLowerCase(),u=t in F?t:E(n||r||o||""),n=de(m.uris,u).getOr(u),U&&!g&&!1==(0===(s=t).indexOf("data-")||0===s.indexOf("aria-"))){if(!(i=h[t])&&v){for(a=v.length;a--&&!(i=v[a]).pattern.test(t););-1===a&&(i=null)}if(!i)return;if(i.validValues&&!(n in i.validValues))return}if(k[t]&&!W.allow_script_urls){var f=n.replace(/[\s\u0000-\u001F]+/g,"");try{f=decodeURIComponent(f)}catch(d){f=unescape(f)}if(_.test(f))return;if(l=f,!(c=W).allow_html_data_urls&&(/^data:image\//i.test(l)?!1===c.allow_svg_data_urls&&/^data:image\/svg\+xml/i.test(l):/^data:/i.test(l)))return}g&&(t in k||0===t.indexOf("on"))||(p.map[t]=n,p.push({name:t,value:n}))},P=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),L=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,I=K.getShortEndedElements(),M=W.self_closing_elements||K.getSelfClosingElements(),F=K.getBoolAttrs(),U=W.validate,z=W.remove_internals,j=W.fix_self_closing,H=K.getSpecialElements(),V=w+">";t=P.exec(V);){var q=t[0];if(xw.length){A(E(w.substr(t.index))),x=t.index+q.length;continue}":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),u=n in I,j&&M[n]&&0]*data-mce-bogus="all"[^>]*>/g,f=e.schema;a=e.getTempAttrs(),u=c,s=new RegExp(["\\s?("+a.join("|")+')="[^"]+"'].join("|"),"gi"),c=u.replace(s,"");for(var d=f.getShortEndedElements();i=l.exec(c);)r=l.lastIndex,o=i[0].length,n=d[i[1]]?r:Lm.findEndTag(f,c,r),c=c.substring(0,r-o)+c.substring(n),l.lastIndex=r-o;return uo(c)},Mm=Im,Fm=function(e,t,n,r){var o,i,a,u,s;if(t.format=n,t.get=!0,t.getInner=!0,t.no_events||e.fire("BeforeGetContent",t),"raw"===t.format)o=xt.trim(Mm(e.serializer,r.innerHTML));else if("text"===t.format)o=uo(r.innerText||r.textContent);else{if("tree"===t.format)return e.serializer.serialize(r,t);a=(i=e).serializer.serialize(r,t),u=fc(i),s=new RegExp("^(<"+u+"[^>]*>( | |\\s|\xa0|
    |)<\\/"+u+">[\r\n]*|
    [\r\n]*)$"),o=a.replace(s,"")}return"text"===t.format||no(Nt.fromDom(r))?t.content=o:t.content=xt.trim(o),t.no_events||e.fire("GetContent",t),t.content},Um=xt.each,zm=function(o){this.compare=function(e,t){if(e.nodeName!==t.nodeName)return!1;var n=function(n){var r={};return Um(o.getAttribs(n),function(e){var t=e.nodeName.toLowerCase();0!==t.indexOf("_")&&"style"!==t&&0!==t.indexOf("data-")&&(r[t]=o.getAttrib(n,t))}),r},r=function(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(void 0===(n=t[r]))return!1;if(e[r]!==n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0};return!!r(n(e),n(t))&&(!!r(o.parseStyle(o.getAttrib(e,"style")),o.parseStyle(o.getAttrib(t,"style")))&&(!$l(e)&&!$l(t)))}},jm=function(n,r,o){return U.from(o.container()).filter(On).exists(function(e){var t=n?0:-1;return r(e.data.charAt(o.offset()+t))})},Hm=E(jm,!0,Kl),Vm=E(jm,!1,Kl),qm=function(e){var t=e.container();return On(t)&&(0===t.data.length||ao(t.data)&&Kf.isBookmarkNode(t.parentNode))},$m=function(t,n){return function(e){return U.from(Zc(t?0:-1,e)).filter(n).isSome()}},Wm=function(e){return Mn(e)&&"block"===Yn(Nt.fromDom(e),"display")},Km=function(e){return Un(e)&&!(Nn(t=e)&&"all"===t.getAttribute("data-mce-bogus"));var t},Xm=$m(!0,Wm),Ym=$m(!1,Wm),Gm=$m(!0,jn),Jm=$m(!1,jn),Qm=$m(!0,Tn),Zm=$m(!1,Tn),ep=$m(!0,Km),tp=$m(!1,Km),np=function(e){var t=qu(e,"br"),n=j(function(e){for(var t=[],n=e.dom;n;)t.push(Nt.fromDom(n)),n=n.lastChild;return t}(e).slice(-1),Gr);t.length===n.length&&$(n,ln)},rp=function(e){cn(e),un(e,Nt.fromHtml('
    '))},op=function(n){Yt(n).each(function(t){Ht(t).each(function(e){Xr(n)&&Gr(t)&&Xr(e)&&ln(t)})})},ip=function(e,t,n){return At(t,e)?function(e,t){for(var n=A(t)?t:p,r=e.dom,o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,a=Nt.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(e,function(e){return n(e)||Rt(e,t)}).slice(0,-1):[]},ap=function(e,t){return ip(e,t,p)},up=function(e,t){return[e].concat(ap(e,t))},sp=function(e,t,n){return Rl(e,t,n,qm)},cp=function(e,t){return K(up(Nt.fromDom(t.container()),e),Xr)},lp=function(e,n,r){return sp(e,n.dom,r).forall(function(t){return cp(n,r).fold(function(){return!1===Qc(t,r,n.dom)},function(e){return!1===Qc(t,r,n.dom)&&At(e,Nt.fromDom(t.container()))})})},fp=function(t,n,r){return cp(n,r).fold(function(){return sp(t,n.dom,r).forall(function(e){return!1===Qc(e,r,n.dom)})},function(e){return sp(t,e.dom,r).isNone()})},dp=E(fp,!1),mp=E(fp,!0),pp=E(lp,!1),gp=E(lp,!0),hp=function(e){return ul(e).exists(Gr)},vp=function(e,t,n){var r=j(up(Nt.fromDom(n.container()),t),Xr),o=Z(r).getOr(t);return kl(e,o.dom,n).filter(hp)},yp=function(e,t){return ul(t).exists(Gr)||vp(!0,e,t).isSome()},bp=function(e,t){return n=t,U.from(n.getNode(!0)).map(Nt.fromDom).exists(Gr)||vp(!1,e,t).isSome();var n},Cp=E(vp,!1),wp=E(vp,!0),xp=function(e){return Is.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd()},Sp=function(e,t){var n=j(up(Nt.fromDom(t.container()),e),Xr);return Z(n).getOr(e)},Np=function(e,t){return xp(t)?Vm(t):Vm(t)||Dl(Sp(e,t).dom,t).exists(Vm)},Ep=function(e,t){return xp(t)?Hm(t):Hm(t)||Al(Sp(e,t).dom,t).exists(Hm)},kp=function(e){return ul(e).bind(function(e){return Sr(e,Pt)}).exists(function(e){return t=Yn(e,"white-space"),I(["pre","pre-wrap"],t);var t})},_p=function(e,t){return r=t,Dl(e.dom,r).isNone()||(n=t,Al(e.dom,n).isNone())||dp(e,t)||mp(e,t)||bp(e,t)||yp(e,t);var n,r},Rp=function(e,t){return!kp(t)&&(dp(e,t)||pp(e,t)||bp(e,t)||Np(e,t))},Tp=function(e,t){return!kp(t)&&(mp(e,t)||gp(e,t)||yp(e,t)||Ep(e,t))},Ap=function(e,t){return Rp(e,t)||Tp(e,(r=(n=t).container(),o=n.offset(),On(r)&&o=e.data.length&&Tp(o,Us(e,e.data.length)),u=0===t&&Rp(o,Us(e,0)),e.replaceData(t,n,(c=u,l=a,W(s=i,function(e,t){return Kl(t)||Wl(t)?e.previousCharIsSpace||""===e.str&&c||e.str.length===s.length-1&&l?{previousCharIsSpace:!1,str:e.str+oo}:{previousCharIsSpace:!0,str:e.str+" "}:{previousCharIsSpace:!1,str:e.str+t}},{previousCharIsSpace:!1,str:""}).str)))},Mp=function(e,t){var n=e.data.slice(t),r=n.length-He(n).length;return Ip(e,t,r)},Fp=function(e,t){var n=e.data.slice(0,t),r=n.length-Ve(n).length;return Ip(e,t-r,r)},Up=function(e,t,n,r){void 0===r&&(r=!0);var o=Ve(e.data).length,i=r?e:t,a=r?t:e;return r?i.appendData(a.data):i.insertData(0,a.data),ln(Nt.fromDom(a)),n&&Mp(i,o),i},zp=function(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===Us.isTextPosition(n)&&o===r.parentNode&&i>Us.before(r).offset()?Us(t.container(),t.offset()-1):t;var n,r,o,i},jp=function(e){return To(e.previousSibling)?U.some((t=e.previousSibling,On(t)?Us(t,t.data.length):Us.after(t))):e.previousSibling?Bl(e.previousSibling):U.none();var t},Hp=function(e){return To(e.nextSibling)?U.some((t=e.nextSibling,On(t)?Us(t,0):Us.before(t))):e.nextSibling?Ol(e.nextSibling):U.none();var t},Vp=function(r,o){return jp(o).orThunk(function(){return Hp(o)}).orThunk(function(){return e=r,t=o,n=Us.before(t.previousSibling?t.previousSibling:t.parentNode),Dl(e,n).fold(function(){return Al(e,Us.after(t))},U.some);var e,t,n})},qp=function(n,r){return Hp(r).orThunk(function(){return jp(r)}).orThunk(function(){return t=r,Al(e=n,Us.after(t)).fold(function(){return Dl(e,Us.before(t))},U.some);var e,t})},$p=function(e,t,n){return(e?qp:Vp)(t,n).map(E(zp,n))},Wp=function(t,n,e){e.fold(function(){t.focus()},function(e){t.selection.setRng(e.toRange(),n)})},Kp=function(e,t){return t&&me(e.schema.getBlockElements(),Dt(t))},Xp=function(e){if(Uo(e)){var t=Nt.fromHtml('
    ');return cn(e),un(e,t),U.some(Us.before(t.dom))}return U.none()},Yp=function(e,t,a){var n,r,o,i,u=Ht(e).filter(Lt),s=Vt(e).filter(Lt);return ln(e),r=s,o=t,i=function(e,t,n){var r=e.dom,o=t.dom,i=r.data.length;return Up(r,o,a),n.container()===o?Us(r,i):n},((n=u).isSome()&&r.isSome()&&o.isSome()?U.some(i(n.getOrDie(),r.getOrDie(),o.getOrDie())):U.none()).orThunk(function(){return a&&(u.each(function(e){return Fp(e.dom,e.dom.length)}),s.each(function(e){return Mp(e.dom,0)})),t})},Gp=function(t,n,e,r){void 0===r&&(r=!0);var o,i,a=$p(n,t.getBody(),e.dom),u=xr(e,E(Kp,t),(o=t.getBody(),function(e){return e.dom===o})),s=Yp(e,a,(i=e,me(t.schema.getTextInlineElements(),Dt(i))));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(Xp).fold(function(){r&&Wp(t,n,s)},function(e){r&&Wp(t,n,U.some(e))})},Jp=function(e,t){return{start:e,end:t}},Qp=gr([{removeTable:["element"]},{emptyCells:["cells"]},{deleteCellSelection:["rng","cell"]}]),Zp=function(e,t){return kr(Nt.fromDom(e),"td,th",t)},eg=function(e,t){return Nr(e,"table",t)},tg=function(e){return!Rt(e.start,e.end)},ng=function(e,t){return eg(e.start,t).bind(function(r){return eg(e.end,t).bind(function(e){return t=Rt(r,e),n=r,t?U.some(n):U.none();var t,n})})},rg=function(e){return qu(e,"td,th")},og=function(r,e){var t=Zp(e.startContainer,r),n=Zp(e.endContainer,r);return e.collapsed?U.none():as(t,n,Jp).fold(function(){return t.fold(function(){return n.bind(function(t){return eg(t,r).bind(function(e){return Z(rg(e)).map(function(e){return Jp(e,t)})})})},function(t){return eg(t,r).bind(function(e){return ee(rg(e)).map(function(e){return Jp(t,e)})})})},function(e){return ig(r,e)?U.none():(n=r,eg((t=e).start,n).bind(function(e){return ee(rg(e)).map(function(e){return Jp(t.start,e)})}));var t,n})},ig=function(e,t){return ng(t,e).isSome()},ag=function(e,t,n){return e.filter(function(e){return tg(e)&&ig(n,e)}).orThunk(function(){return og(n,t)}).bind(function(e){return ng(t=e,n).map(function(e){return{rng:t,table:e,cells:rg(e)}});var t})},ug=function(e,t){return X(e,function(e){return Rt(e,t)})},sg=function(e,r,o){return e.filter(function(e){return n=o,!tg(t=e)&&ng(t,n).exists(function(e){var t=e.dom.rows;return 1===t.length&&1===t[0].cells.length})&&Af(e.start,r);var t,n}).map(function(e){return e.start})},cg=function(n){return as(ug((r=n).cells,r.rng.start),ug(r.cells,r.rng.end),function(e,t){return r.cells.slice(e,t+1)}).map(function(e){var t=n.cells;return e.length===t.length?Qp.removeTable(n.table):Qp.emptyCells(e)});var r},lg=function(e,t){var n,r,o,i,a,u=(n=e,function(e){return Rt(n,e)}),s=(o=u,i=Zp((r=t).startContainer,o),a=Zp(r.endContainer,o),as(i,a,Jp));return sg(s,t,u).map(function(e){return Qp.deleteCellSelection(t,e)}).orThunk(function(){return ag(s,t,u).bind(cg)})},fg=function(e){var t;return(8===Ot(t=e)||"#comment"===Dt(t)?Ht:Yt)(e).bind(fg).orThunk(function(){return U.some(e)})},dg=function(e,t){return $(t,rp),e.selection.setCursorLocation(t[0].dom,0),!0},mg=function(e,t,n){t.deleteContents();var r,o,i=fg(n).getOr(n),a=Nt.fromDom(e.dom.getParent(i.dom,e.dom.isBlock));return Uo(a)&&(rp(a),e.selection.setCursorLocation(a.dom,0)),Rt(n,a)||(r=jt(a).is(n)?[]:jt(o=a).map(Wt).map(function(e){return j(e,function(e){return!Rt(o,e)})}).getOr([]),$(r.concat(Wt(n)),function(e){Rt(e,a)||At(e,a)||ln(e)})),!0},pg=function(e,t){return Gp(e,!1,t),!0},gg=function(n,e,r,t){return vg(e,t).fold(function(){return t=n,lg(e,r).map(function(e){return e.fold(E(pg,t),E(dg,t),E(mg,t))});var t},function(e){return yg(n,e)}).getOr(!1)},hg=function(e,t){return K(up(t,e),to)},vg=function(e,t){return K(up(t,e),function(e){return"caption"===Dt(e)})},yg=function(e,t){return rp(t),e.selection.setCursorLocation(t.dom,0),U.some(!0)},bg=function(u,s,c,l,f){return _l(c,u.getBody(),f).bind(function(e){return o=c,i=f,a=e,Ol((r=l).dom).bind(function(t){return Bl(r.dom).map(function(e){return o?i.isEqual(t)&&a.isEqual(e):i.isEqual(e)&&a.isEqual(t)})}).getOr(!0)?yg(u,l):(t=l,n=e,vg(s,Nt.fromDom(n.getNode())).map(function(e){return!1===Rt(e,t)}));var t,n,r,o,i,a}).or(U.some(!0))},Cg=function(o,i,a,e){var u=Us.fromRangeStart(o.selection.getRng());return hg(a,e).bind(function(e){return Uo(e)?yg(o,e):(t=a,n=e,r=u,_l(i,o.getBody(),r).bind(function(e){return hg(t,Nt.fromDom(e.getNode())).map(function(e){return!1===Rt(e,n)})}));var t,n,r}).getOr(!1)},wg=function(e,t){return(e?Qm:Zm)(t)},xg=function(a,u,r){var s=Nt.fromDom(a.getBody());return vg(s,r).fold(function(){return Cg(a,u,s,r)||(e=a,t=u,n=Us.fromRangeStart(e.selection.getRng()),wg(t,n)||kl(t,e.getBody(),n).exists(function(e){return wg(t,e)}));var e,t,n},function(e){return t=a,n=u,r=s,o=e,i=Us.fromRangeStart(t.selection.getRng()),(Uo(o)?yg(t,o):bg(t,r,n,o,i)).getOr(!1);var t,n,r,o,i})},Sg=function(e,t){var n,r,o,i,a,u=Nt.fromDom(e.selection.getStart(!0)),s=_f(e);return e.selection.isCollapsed()&&0===s.length?xg(e,t,u):(n=e,r=u,o=Nt.fromDom(n.getBody()),i=n.selection.getRng(),0!==(a=_f(n)).length?dg(n,a):gg(n,o,i,r))},Ng=function(a){var u=Us.fromRangeStart(a),s=Us.fromRangeEnd(a),c=a.commonAncestorContainer;return kl(!1,c,s).map(function(e){return!Qc(u,s,c)&&Qc(u,e,c)?(t=u.container(),n=u.offset(),r=e.container(),o=e.offset(),(i=document.createRange()).setStart(t,n),i.setEnd(r,o),i):a;var t,n,r,o,i}).getOr(a)},Eg=function(e){return e.collapsed?e:Ng(e)},kg=function(e,t){var n,r;return e.getBlockElements()[t.name]&&((r=t).firstChild&&r.firstChild===r.lastChild)&&("br"===(n=t.firstChild).name||n.value===oo)},_g=function(e,t){var n,r,o,i=t.firstChild,a=t.lastChild;return i&&"meta"===i.name&&(i=i.next),a&&"mce_marker"===a.attr("id")&&(a=a.prev),r=a,o=(n=e).getNonEmptyElements(),r&&(r.isEmpty(o)||kg(n,r))&&(a=a.prev),!(!i||i!==a)&&("ul"===i.name||"ol"===i.name)},Rg=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&((t=e.firstChild).data===oo||In(t));var t},Tg=function(e){return 0)?$/," "):l.replace(/ ()?$/," "));var p=e.parser,g=n.merge,h=Tm({validate:e.getParam("validate")},e.schema),v='',y={content:t,format:"html",selection:!0,paste:n.paste};if((y=e.fire("BeforeSetContent",y)).isDefaultPrevented())e.fire("SetContent",{content:y.content,format:"html",selection:!0,paste:n.paste});else{-1===(t=y.content).indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,v);var b,C,w=(a=d.getRng()).startContainer||(a.parentElement?a.parentElement():null),x=e.getBody();w===x&&d.isCollapsed()&&m.isBlock(x.firstChild)&&(b=e,(C=x.firstChild)&&!b.schema.getShortEndedElements()[C.nodeName])&&m.isEmpty(x.firstChild)&&((a=m.createRng()).setStart(x.firstChild,0),a.setEnd(x.firstChild,0),d.setRng(a)),d.isCollapsed()||Lg(e);var S,N,E,k,_,R,T,A,D,O,B,P,L,I,M={context:(r=d.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},F=p.parse(t,M);if(!0===n.paste&&_g(e.schema,F)&&Ag(m,r))return a=Bg(h,m,d.getRng(),F),d.setRng(a),void e.fire("SetContent",y);if(!function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}(F),"mce_marker"===(u=F.lastChild).attr("id"))for(u=(i=u).prev;u;u=u.walk(!0))if(3===u.type||!m.isBlock(u.name)){e.schema.isValidChild(u.parent.name,"span")&&u.parent.insert(i,u,"br"===u.name);break}if(e._selectionOverrides.showBlockCaretContainer(r),M.invalid){for(e.selection.setContent(v),r=d.getNode(),o=e.getBody(),9===r.nodeType?r=u=o:u=r;u!==o;)u=(r=u).parentNode;t=r===o?o.innerHTML:m.getOuterHTML(r),t=h.serialize(p.parse(t.replace(//i,function(){return h.serialize(F)}))),r===o?m.setHTML(o,t):m.setOuterHTML(r,t)}else t=h.serialize(F),S=e,N=t,"all"===(E=r).getAttribute("data-mce-bogus")?E.parentNode.insertBefore(S.dom.createFragment(N),E):(k=E.firstChild,_=E.lastChild,!k||k===_&&"BR"===k.nodeName?S.dom.setHTML(E,N):S.selection.setContent(N));T=g,O=(R=e).schema.getTextInlineElements(),B=R.dom,T&&(A=R.getBody(),D=new zm(B),xt.each(B.select("*[data-mce-fragment]"),function(e){for(var t=e.parentNode;t&&t!==A;t=t.parentNode)O[e.nodeName.toLowerCase()]&&D.compare(t,e)&&B.remove(e,!0)})),function(n,e){var t,r,o=n.dom,i=n.selection;if(e){i.scrollIntoView(e);var a=function(e){for(var t=n.getBody();e&&e!==t;e=e.parentNode)if("false"===o.getContentEditable(e))return e;return null}(e);if(a)return o.remove(e),i.select(a);var u=o.createRng(),s=e.previousSibling;s&&3===s.nodeType?(u.setStart(s,s.nodeValue.length),vt.ie||(r=e.nextSibling)&&3===r.nodeType&&(s.appendData(r.data),r.parentNode.removeChild(r))):(u.setStartBefore(e),u.setEndBefore(e));var c=o.getParent(e,o.isBlock);o.remove(e),c&&o.isEmpty(c)&&(n.$(c).empty(),u.setStart(c,0),u.setEnd(c,0),Pg(c)||c.getAttribute("data-mce-fragment")||!(t=function(e){var t=Us.fromRangeStart(e);if(t=wl(n.getBody()).next(t))return t.toRange()}(u))?o.add(c,o.create("br",{"data-mce-bogus":"1"})):(u=t,o.remove(c))),i.setRng(u)}}(e,m.get("mce_marker")),P=e.getBody(),xt.each(P.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),L=m,I=d.getStart(),U.from(L.getParent(I,"td,th")).map(Nt.fromDom).each(op),e.fire("SetContent",y),e.addVisual()}},Mg=function(e,t){t(e),e.firstChild&&Mg(e.firstChild,t),e.next&&Mg(e.next,t)},Fg=function(e,t,n){var r=function(e,n,t){var r={},o={},i=[];for(var a in t.firstChild&&Mg(t.firstChild,function(t){$(e,function(e){e.name===t.name&&(r[e.name]?r[e.name].nodes.push(t):r[e.name]={filter:e,nodes:[t]})}),$(n,function(e){"string"==typeof t.attr(e.name)&&(o[e.name]?o[e.name].nodes.push(t):o[e.name]={filter:e,nodes:[t]})})}),r)r.hasOwnProperty(a)&&i.push(r[a]);for(var u in o)o.hasOwnProperty(u)&&i.push(o[u]);return i}(e,t,n);$(r,function(t){$(t.filter.callbacks,function(e){e(t.nodes,t.filter.name,{})})})},Ug=function(e){return e instanceof Em},zg=function(e,t){var r;e.dom.setHTML(e.getBody(),t),pm(r=e)&&Ol(r.getBody()).each(function(e){var t=e.getNode(),n=Tn(t)?Ol(t).getOr(e):e;r.selection.setRng(n.toRange())})},jg=function(u,s,c){return c.format=c.format?c.format:"html",c.set=!0,c.content=Ug(s)?"":s,Ug(s)||c.no_events||(u.fire("BeforeSetContent",c),s=c.content),U.from(u.getBody()).fold(N(s),function(e){return Ug(s)?function(e,t,n,r){Fg(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);var o=Tm({validate:e.validate},e.schema).serialize(n);return r.content=no(Nt.fromDom(t))?o:xt.trim(o),zg(e,r.content),r.no_events||e.fire("SetContent",r),n}(u,e,s,c):(t=u,n=e,o=c,0===(r=s).length||/^\s+$/.test(r)?(a='
    ',"TABLE"===n.nodeName?r=""+a+"":/^(UL|OL)$/.test(n.nodeName)&&(r="
  • "+a+"
  • "),r=(i=fc(t))&&t.schema.isValidChild(n.nodeName.toLowerCase(),i.toLowerCase())?(r=a,t.dom.createHTML(i,dc(t),r)):r||'
    ',zg(t,r),t.fire("SetContent",o)):("raw"!==o.format&&(r=Tm({validate:t.validate},t.schema).serialize(t.parser.parse(r,{isRootContent:!0,insert:!0}))),o.content=no(Nt.fromDom(n))?r:xt.trim(r),zg(t,o.content),o.no_events||t.fire("SetContent",o)),o.content);var t,n,r,o,i,a})},Hg=nf,Vg=function(e,t,n){var r=e.formatter.get(n);if(r)for(var o=0;o
    ").append(n.childNodes)}))},lh[Bm="pre"]||(lh[Bm]=[]),lh[Bm].push(Pm);var mh=xt.each,ph=function(e){return Nn(e)&&!$l(e)&&!Ll(e)&&!Rn(e)},gh=function(e,t){for(var n=e;n;n=n[t]){if(On(n)&&0!==n.nodeValue.length)return e;if(Nn(n)&&!$l(n))return n}return e},hh=function(e,t,n){var r,o,i=new zm(e);if(t&&n&&(t=gh(t,"previousSibling"),n=gh(n,"nextSibling"),i.compare(t,n))){for(r=t.nextSibling;r&&r!==n;)r=(o=r).nextSibling,t.appendChild(o);return e.remove(n),xt.each(xt.grep(n.childNodes),function(e){t.appendChild(e)}),t}return n},vh=function(e,t,n,r){var o;r&&!1!==t.merge_siblings&&(o=hh(e,Jl(r),r),hh(e,o,Jl(o,!0)))},yh=function(e,t,n){mh(e.childNodes,function(e){ph(e)&&(t(e)&&n(e),e.hasChildNodes()&&yh(e,t,n))})},bh=function(t,n){return function(e){return!(!e||!of(t,e,n))}},Ch=function(r,o,i){return function(e){var t,n;r.setStyle(e,o,i),""===e.getAttribute("style")&&e.removeAttribute("style"),t=r,"SPAN"===(n=e).nodeName&&0===t.getAttribs(n).length&&t.remove(n,!0)}},wh=gr([{keep:[]},{rename:["name"]},{removed:[]}]),xh=/^(src|href|style)$/,Sh=xt.each,Nh=nf,Eh=function(e,t,n){return e.isChildOf(t,n)&&t!==n&&!e.isBlock(n)},kh=function(e,t,n){var r,o=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"];return Nn(o)&&(r=o.childNodes.length-1,!n&&i&&i--,o=o.childNodes[r=o.nodeValue.length&&(o=new Hr(o,e.getBody()).next()||o),On(o)&&!n&&0===i&&(o=new Hr(o,e.getBody()).prev()||o),o},_h=function(e,t){var n=t?"firstChild":"lastChild";if(/^(TR|TH|TD)$/.test(e.nodeName)&&e[n]){var r=e[n];return"TR"===e.nodeName&&r[n]||r}return e},Rh=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},Th=function(e,t,n,r,o){var i=Nt.fromDom(t),a=Nt.fromDom(e.create(r,o)),u=(n?$t:qt)(i);return sn(a,u),n?(rn(i,a),an(a,i)):(on(i,a),un(a,i)),a.dom},Ah=function(e,t,n,r){return!(t=Jl(t,n,r))||"BR"===t.nodeName||e.isBlock(t)},Dh=function(e,r,o,t,i){var n,a,u,s,c,l=e.dom;if(u=l,!(Nh(s=t,(c=r).inline)||Nh(s,c.block)||c.selector&&(Nn(s)&&u.is(s,c.selector))||(a=t,r.links&&"A"===a.nodeName)))return wh.keep();var f,d,m,p,g,h,v,y=t;if(r.inline&&"all"===r.remove&&S(r.preserve_attributes)){var b=j(l.getAttribs(y),function(e){return I(r.preserve_attributes,e.name.toLowerCase())});if(l.removeAllAttribs(y),$(b,function(e){return l.setAttrib(y,e.name,e.value)}),0e?t.cells.length:e},0)},qh=function(e,t){for(var n=e.rows,r=0;r")?{type:"fragmented",fragments:r,content:"",bookmark:null,beforeBookmark:null}:{type:"complete",fragments:null,content:o,bookmark:null,beforeBookmark:null}},lv=function(e,t,n){"fragmented"===t.type?uv(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(n?t.beforeBookmark:t.bookmark)},fv=function(e){return"fragmented"===e.type?e.fragments.join(""):e.content},dv=function(e){var t=Nt.fromTag("body",sv.get().getOrThunk(function(){var e=document.implementation.createHTMLDocument("undo");return sv.set(U.some(e)),e}));return es(t,fv(e)),$(qu(t,"*[data-mce-bogus]"),fn),t.dom.innerHTML},mv=function(e,t){return!(!e||!t)&&(r=t,fv(e)===fv(r)||(n=t,dv(e)===dv(n)));var n,r},pv=function(e){return 0===e.get()},gv=function(e,t,n){pv(n)&&(e.typing=t)},hv=function(e,t){e.typing&&(gv(e,!1,t),e.add())},vv=function(e){return e instanceof Em},yv=function(e,t){Fg(e.serializer.getNodeFilters(),e.serializer.getAttributeFilters(),t)},bv=function(){return{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},Cv=function(f){return{undoManager:{beforeChange:function(e,t){return n=f,r=t,void(pv(e)&&r.set(U.some(uc(n.selection))));var n,r},addUndoLevel:function(e,t,n,r,o,i){return function(e,t,n,r,o,i,a){var u=cv(e);if(i=i||{},i=xt.extend(i,u),!1===pv(r)||e.removed)return null;var s=t.data[n.get()];if(e.fire("BeforeAddUndo",{level:i,lastLevel:s,originalEvent:a}).isDefaultPrevented())return null;if(s&&mv(s,i))return null;t.data[n.get()]&&o.get().each(function(e){t.data[n.get()].beforeBookmark=e});var c=e.getParam("custom_undo_redo_levels",0,"number");if(c&&t.data.length>c){for(var l=0;lt.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){return r=e,o=t,void((n=c).inline?Pd:Id)(n,r,o);var n,r,o},placeCaretAt:function(e,t){return g(ed(e,t,c.getDoc()))},getBoundingClientRect:function(){var e=p();return e.collapsed?Us.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){s=l=f=null,b.destroy()}},y=Kf(v),b=Qf(v,c);return v.bookmarkManager=y,v.controlSelection=b,v},Bv=function(e,a,u){e.addNodeFilter("font",function(e){$(e,function(e){var t,n=a.parse(e.attr("style")),r=e.attr("color"),o=e.attr("face"),i=e.attr("size");r&&(n.color=r),o&&(n["font-family"]=o),i&&(n["font-size"]=u[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",a.serialize(n)),t=e,$(["color","face","size"],function(e){t.attr(e,null)})})})},Pv=function(e,t){var n,r=hi();t.convert_fonts_to_spans&&Bv(e,r,xt.explode(t.font_size_legacy_values)),n=r,e.addNodeFilter("strike",function(e){$(e,function(e){var t=n.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",n.serialize(t))})})},Lv=function(e){var t,n=decodeURIComponent(e).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(t=r[1]),{type:t,data:n[1]}},Iv=function(e,t){var n;try{n=atob(t)}catch(pk){return U.none()}for(var r=new Uint8Array(n.length),o=0;o)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")};i--;)r=(n=e[i]).firstChild?n.firstChild.value:"","script"===t?((o=n.attr("type"))&&n.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===s.element_format&&0")):"xhtml"===s.element_format&&0",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:u.convertURL,url_converter_scope:u},xe(xe({},s),a?yy:{}));return Ny(gy||hy,gy,c,r,o)},ky=function(e,t,n){return U.from(t.settings[n]).filter(e)},_y=function(e,t,n,r){var o,i,a,u=t in e.settings?e.settings[t]:n;return"hash"===r?(a={},"string"==typeof(i=u)?$(0)\s*/g,"$1"),xt.map(c.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var t=xt.map(e.split(/(?:~\+|~|\+)/),ub),n=t.pop();return t.length&&(n.siblings=t),n}).reverse()):[],f=l.length?(l[0].name||(l[0].name=t),t=e.selector,ab(l,n)):ab([t],n),d=ib.select(t,f)[0]||f.firstChild;return ob(e.styles,function(e,t){var n=u(e);n&&ib.setStyle(d,t,n)}),ob(e.attributes,function(e,t){var n=u(e);n&&ib.setAttrib(d,t,n)}),ob(e.classes,function(e){var t=u(e);ib.hasClass(d,t)||ib.addClass(d,t)}),n.fire("PreviewFormats"),ib.setStyles(f,{position:"absolute",left:-65535}),n.getBody().appendChild(f),r=ib.getStyle(n.getBody(),"fontSize",!0),r=/px$/.test(r)?parseInt(r,10):0,ob(a.split(" "),function(e){var t=ib.getStyle(d,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=ib.getStyle(n.getBody(),e,!0),"#ffffff"===ib.toHex(t).toLowerCase())||"color"===e&&"#000000"===ib.toHex(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===r)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*r+"px"}"border"===e&&t&&(i+="padding:0 2px;"),i+=e+":"+t+";"}}),n.fire("AfterPreviewFormats"),ib.remove(f),i},cb=function(s){var e=tb(s),t=ku(null);return function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])}(s),sh(s),{get:e.get,has:e.has,register:e.register,unregister:e.unregister,apply:function(e,t,n){var r,o,i;r=e,o=t,i=n,Nv(s).formatter.apply(r,o,i)},remove:function(e,t,n,r){var o,i,a,u;o=e,i=t,a=n,u=r,Nv(s).formatter.remove(o,i,a,u)},toggle:function(e,t,n){var r,o,i;r=e,o=t,i=n,Nv(s).formatter.toggle(r,o,i)},match:E(Xg,s),matchAll:E(Yg,s),matchNode:E(Kg,s),canApply:E(Gg,s),formatChanged:E(eb,s,t),getCssText:E(sb,s)}},lb=function(n,r,o){var i=ku(!1),a=function(e){gv(r,!1,o),r.add({},e)};n.on("init",function(){r.add()}),n.on("BeforeExecCommand",function(e){var t=e.command.toLowerCase();"undo"!==t&&"redo"!==t&&"mcerepaint"!==t&&(hv(r,o),r.beforeChange())}),n.on("ExecCommand",function(e){var t=e.command.toLowerCase();"undo"!==t&&"redo"!==t&&"mcerepaint"!==t&&a(e)}),n.on("ObjectResizeStart cut",function(){r.beforeChange()}),n.on("SaveContent ObjectResized blur",a),n.on("dragend",a),n.on("keyup",function(e){var t=e.keyCode;e.isDefaultPrevented()||((33<=t&&t<=36||37<=t&&t<=40||45===t||e.ctrlKey)&&(a(),n.nodeChanged()),46!==t&&8!==t||n.nodeChanged(),i.get()&&r.typing&&!1===mv(cv(n),r.data[0])&&(!1===n.isDirty()&&(n.setDirty(!0),n.fire("change",{level:r.data[0],lastLevel:null})),n.fire("TypingUndo"),i.set(!1),n.nodeChanged()))}),n.on("keydown",function(e){var t,n=e.keyCode;e.isDefaultPrevented()||(33<=n&&n<=36||37<=n&&n<=40||45===n?r.typing&&a(e):(t=e.ctrlKey&&!e.altKey||e.metaKey,!(n<16||20t;var t}},Iw=function(n){return function(e){return t=n,e.line===t;var t}},Mw=Un,Fw=Gc,Uw=function(e,t){return Math.abs(e.left-t)},zw=function(e,t){return Math.abs(e.right-t)},jw=function(e,t){return e>=t.left&&e<=t.right},Hw=function(e,t){return e>=t.top&&e<=t.bottom},Vw=function(e,o){return be(e,function(e,t){var n=Math.min(Uw(e,o),zw(e,o)),r=Math.min(Uw(t,o),zw(t,o));return jw(o,t)||!jw(o,e)&&(r===n&&Mw(t.node)||r'),u=o,1===t?e.$(s).after(u):e.$(s).before(u),e.selection.select(u,!0),e.selection.collapse())}},ex=function(e,t){var n=t?Ms.Forwards:Ms.Backwards,r=e.selection.getRng();return Xw(e,n,r,ep,tp,Qw).orThunk(function(){return Zw(e,n,r),U.none()})},tx=function(e,t){var n=t?1:-1,r=e.selection.getRng();return Yw(e,n,r,function(e){return ep(e)||Qm(e)},function(e){return tp(e)||Zm(e)},Qw).orThunk(function(){return Zw(e,n,r),U.none()})},nx=function(t,e){return ex(t,e).exists(function(e){return Ww(t,e),!0})},rx=function(t,e){return tx(t,e).exists(function(e){return Ww(t,e),!0})},ox=function(e,t){return Jw(e,t,t?tp:ep)},ix=function(e){return I(["figcaption"],Dt(e))},ax=function(e){var t=document.createRange();return t.setStartBefore(e.dom),t.setEndBefore(e.dom),t},ux=function(e,t,n){(n?un:an)(e,t)},sx=function(e,t,n,r){return""===t?(l=e,f=r,d=Nt.fromTag("br"),ux(l,d,f),ax(d)):(o=e,i=r,a=t,u=n,s=Nt.fromTag(a),c=Nt.fromTag("br"),$n(s,u),un(s,c),ux(o,s,i),ax(c));var o,i,a,u,s,c,l,f,d},cx=function(e,t,n){return t?(o=e.dom,_w(o,n).breakAt.isNone()):(r=e.dom,kw(r,n).breakAt.isNone());var r,o},lx=function(t,n){var e,r,o=Nt.fromDom(t.getBody()),i=Us.fromRangeStart(t.selection.getRng()),a=fc(t),u=dc(t);return e=i,r=E(Rt,o),Sr(Nt.fromDom(e.container()),Xr,r).filter(ix).exists(function(){if(cx(o,n,i)){var e=sx(o,a,u,n);return t.selection.setRng(e),!0}return!1})},fx=function(e,t){return!!e.selection.isCollapsed()&&lx(e,t)},dx=function(e,r){return Y(F(e,function(e){return xe({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:V},e)}),function(e){return t=e,(n=r).keyCode===t.keyCode&&n.shiftKey===t.shiftKey&&n.altKey===t.altKey&&n.ctrlKey===t.ctrlKey&&n.metaKey===t.metaKey?[e]:[];var t,n})},mx=function(e){for(var t=[],n=1;nt}),xx=function(t,n){return Z(n.getClientRects()).bind(function(e){return Cx(t,e.left,e.top)}).bind(function(e){return Ew(Bl(t=e).map(function(e){return kw(t,e).positions.concat(e)}).getOr([]),n);var t})},Sx=function(t,n){return ee(n.getClientRects()).bind(function(e){return wx(t,e.left,e.top)}).bind(function(e){return Ew(Ol(t=e).map(function(e){return[e].concat(_w(t,e).positions)}).getOr([]),n);var t})},Nx=function(e,t,n){var r,o,i,a,u=e(t,n);return(a=u).breakType===nb.Wrap&&0===a.positions.length||!In(n.getNode())&&((i=u).breakType===nb.Br&&1===i.positions.length)?(r=e,o=t,!u.breakAt.exists(function(e){return r(o,e).breakAt.isSome()})):u.breakAt.isNone()},Ex=E(Nx,kw),kx=E(Nx,_w),_x=function(t,e,n,r){var o,i,a,u,s=t.selection.getRng(),c=e?1:-1;return!(!Uc()||(o=e,i=s,a=n,u=Us.fromRangeStart(i),!Tl(!o,a).exists(function(e){return e.isEqual(u)})))&&(qb(c,t,n,!e,!1).each(function(e){Ww(t,e)}),!0)},Rx=function(e,t){var n=t.getNode(e);return Nn(n)&&"TABLE"===n.nodeName?U.some(n):U.none()},Tx=function(u,s,c){var e=Rx(!!s,c),t=!1===s;e.fold(function(){return Ww(u,c.toRange())},function(a){return Tl(t,u.getBody()).filter(function(e){return e.isEqual(c)}).fold(function(){return Ww(u,c.toRange())},function(e){return n=s,o=a,t=c,void((i=fc(r=u))?r.undoManager.transact(function(){var e=Nt.fromTag(i);$n(e,dc(r)),un(e,Nt.fromTag("br")),(n?on:rn)(Nt.fromDom(o),e);var t=r.dom.createRng();t.setStart(e.dom,0),t.setEnd(e.dom,0),Ww(r,t)}):Ww(r,t.toRange()));var n,r,o,t,i})})},Ax=function(e,t,n,r){var o,i,a,u,s,c,l=e.selection.getRng(),f=Us.fromRangeStart(l),d=e.getBody();if(!t&&Ex(r,f)){var m=(u=d,xx(s=n,c=f).orThunk(function(){return Z(c.getClientRects()).bind(function(e){return Nw(Rw(u,Us.before(s)),e.left)})}).getOr(Us.before(s)));return Tx(e,t,m),!0}if(t&&kx(r,f)){m=(o=d,Sx(i=n,a=f).orThunk(function(){return Z(a.getClientRects()).bind(function(e){return Nw(Tw(o,Us.after(i)),e.left)})}).getOr(Us.after(i)));return Tx(e,t,m),!0}return!1},Dx=function(n,r,o){return U.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(function(t){return U.from(n.dom.getParent(t,"table")).map(function(e){return o(n,r,e,t)})}).getOr(!1)},Ox=function(e,t){return Dx(e,t,_x)},Bx=function(e,t){return Dx(e,t,Ax)},Px=function(i,a){i.on("keydown",function(e){var t,n,r,o;!1===e.isDefaultPrevented()&&(t=i,n=a,r=e,o=st().os,px([{keyCode:Gf.RIGHT,action:mx(nx,t,!0)},{keyCode:Gf.LEFT,action:mx(nx,t,!1)},{keyCode:Gf.UP,action:mx(rx,t,!1)},{keyCode:Gf.DOWN,action:mx(rx,t,!0)},{keyCode:Gf.RIGHT,action:mx(Ox,t,!0)},{keyCode:Gf.LEFT,action:mx(Ox,t,!1)},{keyCode:Gf.UP,action:mx(Bx,t,!1)},{keyCode:Gf.DOWN,action:mx(Bx,t,!0)},{keyCode:Gf.RIGHT,action:mx(gx,t,!0)},{keyCode:Gf.LEFT,action:mx(gx,t,!1)},{keyCode:Gf.UP,action:mx(hx,t,!1)},{keyCode:Gf.DOWN,action:mx(hx,t,!0)},{keyCode:Gf.RIGHT,action:mx(VC,t,n,!0)},{keyCode:Gf.LEFT,action:mx(VC,t,n,!1)},{keyCode:Gf.RIGHT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:mx(WC,t,n)},{keyCode:Gf.LEFT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:mx(KC,t,n)},{keyCode:Gf.UP,action:mx(fx,t,!1)},{keyCode:Gf.DOWN,action:mx(fx,t,!0)}],r).each(function(e){r.preventDefault()}))})},Lx=function(o,i){o.on("keydown",function(e){var t,n,r;!1===e.isDefaultPrevented()&&(t=o,n=i,r=e,px([{keyCode:Gf.BACKSPACE,action:mx(lw,t,!1)},{keyCode:Gf.BACKSPACE,action:mx(aC,t,!1)},{keyCode:Gf.DELETE,action:mx(aC,t,!0)},{keyCode:Gf.BACKSPACE,action:mx(Jb,t,!1)},{keyCode:Gf.DELETE,action:mx(Jb,t,!0)},{keyCode:Gf.BACKSPACE,action:mx(JC,t,n,!1)},{keyCode:Gf.DELETE,action:mx(JC,t,n,!0)},{keyCode:Gf.BACKSPACE,action:mx(Sg,t,!1)},{keyCode:Gf.DELETE,action:mx(Sg,t,!0)},{keyCode:Gf.BACKSPACE,action:mx(uC,t,!1)},{keyCode:Gf.DELETE,action:mx(uC,t,!0)},{keyCode:Gf.BACKSPACE,action:mx(rw,t,!1)},{keyCode:Gf.DELETE,action:mx(rw,t,!0)},{keyCode:Gf.BACKSPACE,action:mx(jb,t,!1)},{keyCode:Gf.DELETE,action:mx(jb,t,!0)},{keyCode:Gf.BACKSPACE,action:mx(Mb,t,!1)},{keyCode:Gf.DELETE,action:mx(Mb,t,!0)},{keyCode:Gf.BACKSPACE,action:mx(tw,t,!1)},{keyCode:Gf.DELETE,action:mx(tw,t,!0)}],r).each(function(e){r.preventDefault()}))}),o.on("keyup",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=o,n=e,px([{keyCode:Gf.BACKSPACE,action:mx(iC,t)},{keyCode:Gf.DELETE,action:mx(iC,t)}],n))})},Ix=function(e,t){var n,r,o=t,i=e.dom,a=e.schema.getMoveCaretBeforeOnEnterElements();if(t){!/^(LI|DT|DD)$/.test(t.nodeName)||(r=function(e){for(;e;){if(1===e.nodeType||3===e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}(t.firstChild))&&/^(UL|OL|DL)$/.test(r.nodeName)&&t.insertBefore(i.doc.createTextNode(oo),t.firstChild);var u=i.createRng();if(t.normalize(),t.hasChildNodes()){for(var s=new Hr(t,t);n=s.current();){if(On(n)){u.setStart(n,0),u.setEnd(n,0);break}if(a[n.nodeName.toLowerCase()]){u.setStartBefore(n),u.setEndBefore(n);break}o=n,n=s.next()}n||(u.setStart(o,0),u.setEnd(o,0))}else In(t)?t.nextSibling&&i.isBlock(t.nextSibling)?(u.setStartBefore(t),u.setEndBefore(t)):(u.setStartAfter(t),u.setEndAfter(t)):(u.setStart(t,0),u.setEnd(t,0));e.selection.setRng(u),Md(e,u)}},Mx=function(e){return U.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))},Fx=function(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t},Ux=function(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)},zx=function(e){var t=e.parentNode;return/^(LI|DT|DD)$/.test(t.nodeName)?t:e},jx=function(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&!Nn(r);)r=r[n?"nextSibling":"previousSibling"];return r===t},Hx=function(e,t,n,r,o){var i,a,u,s,c,l,f=e.dom,d=e.selection.getRng();n!==e.getBody()&&(Ux(i=n)&&Ux(i.parentNode)&&(o="LI"),a=o?t(o):f.create("BR"),jx(n,r,!0)&&jx(n,r,!1)?Fx(n,"LI")?f.insertAfter(a,zx(n)):f.replace(a,n):jx(n,r,!0)?Fx(n,"LI")?(f.insertAfter(a,zx(n)),a.appendChild(f.doc.createTextNode(" ")),a.appendChild(n)):n.parentNode.insertBefore(a,n):jx(n,r,!1)?f.insertAfter(a,zx(n)):(n=zx(n),(u=d.cloneRange()).setStartAfter(r),u.setEndAfter(n),s=u.extractContents(),"LI"===o&&(l="LI",(c=s).firstChild&&c.firstChild.nodeName===l)?(a=s.firstChild,f.insertAfter(s,n)):(f.insertAfter(s,n),f.insertAfter(a,n))),f.remove(r),Ix(e,a))},Vx=function(e){e.innerHTML='
    '},qx=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},$x=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},Wx=function(e,t,n){return!1===On(t)?n:e?1===n&&t.data.charAt(n-1)===io?0:n:n===t.data.length-1&&t.data.charAt(n)===io?t.data.length:n},Kx=function(e,t){for(var n,r=e.getRoot(),o=t;o!==r&&"false"!==e.getContentEditable(o);)"true"===e.getContentEditable(o)&&(n=o),o=o.parentNode;return o!==r?n:r},Xx=function(e,t){var n=fc(e);n&&n.toLowerCase()===t.tagName.toLowerCase()&&function(e,o,t){var i=e.dom;U.from(t.style).map(i.parseStyle).each(function(e){var t=Qn(Nt.fromDom(o)),n=xe(xe({},t),e);i.setStyles(o,n)});var n=U.from(t["class"]).map(function(e){return e.split(/\s+/)}),r=U.from(o.className).map(function(e){return j(e.split(/\s+/),function(e){return""!==e})});as(n,r,function(t,e){var n=j(e,function(e){return!I(t,e)}),r=Se(t,n);i.setAttrib(o,"class",r.join(" "))});var a=["style","class"],u=le(t,function(e,t){return!I(a,t)});i.setAttribs(o,u)}(e,t,dc(e))},Yx=function(a,e){var t,u,i,s,n,r,o,c,l,f=a.dom,d=a.schema,m=d.getNonEmptyElements(),p=a.selection.getRng(),g=function(e){var t,n=u,r=d.getTextInlineElements(),o=e||"TABLE"===c||"HR"===c?f.create(e||N):s.cloneNode(!1),i=o;if(!1===a.getParam("keep_styles",!0))f.setAttrib(o,"style",null),f.setAttrib(o,"class",null);else do{if(r[n.nodeName]){if(Ll(n)||$l(n))continue;t=n.cloneNode(!1),f.setAttrib(t,"id",""),o.hasChildNodes()?t.appendChild(o.firstChild):i=t,o.appendChild(t)}}while((n=n.parentNode)&&n!==E);return Xx(a,o),Vx(i),o},h=function(e){var t,n,r=Wx(e,u,i);if(On(u)&&(e?0u.childNodes.length-1,u=u.childNodes[Math.min(i,u.childNodes.length-1)]||u,i=l&&On(u)?u.nodeValue.length:0);var C,w,x,S,N,E=Kx(f,u);E&&((N&&!y||!N&&y)&&(u=function(e,t,n,r,o){var i,a,u,s,c,l,f=t||"P",d=e.dom,m=Kx(d,r),p=d.getParent(r,d.isBlock);if(!p||!$x(d,p)){if(c=(p=p||m)===e.getBody()||(l=p)&&/^(TD|TH|CAPTION)$/.test(l.nodeName)?p.nodeName.toLowerCase():p.parentNode.nodeName.toLowerCase(),!p.hasChildNodes())return i=d.create(f),Xx(e,i),p.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(u=r;u.parentNode!==p;)u=u.parentNode;for(;u&&!d.isBlock(u);)u=(a=u).previousSibling;if(a&&e.schema.isValidChild(c,f.toLowerCase())){for(i=d.create(f),Xx(e,i),a.parentNode.insertBefore(i,a),u=a;u&&!d.isBlock(u);)s=u.nextSibling,i.appendChild(u),u=s;n.setStart(r,o),n.setEnd(r,o)}}return r}(a,N,p,u,i)),s=f.getParent(u,f.isBlock),o=s?f.getParent(s.parentNode,f.isBlock):null,c=s?s.nodeName.toUpperCase():"","LI"!==(C=o?o.nodeName.toUpperCase():"")||b||(o=(s=o).parentNode,c=C),/^(LI|DT|DD)$/.test(c)&&f.isEmpty(s)?Hx(a,g,o,s,N):N&&s===a.getBody()||(N=N||"P",lo(s)?(n=Co(s),f.isEmpty(s)&&Vx(s),Xx(a,n),Ix(a,n)):h()?v():h(!0)?(n=s.parentNode.insertBefore(g(),s),Ix(a,qx(s,"HR")?n:s)):((S=(x=p).cloneRange()).setStart(x.startContainer,Wx(!0,x.startContainer,x.startOffset)),S.setEnd(x.endContainer,Wx(!1,x.endContainer,x.endOffset)),(t=S.cloneRange()).setEndAfter(s),r=t.extractContents(),w=r,$(Vu(Nt.fromDom(w),Lt),function(e){var t=e.dom;t.nodeValue=uo(t.nodeValue)}),function(e){for(;On(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;);}(r),n=r.firstChild,f.insertAfter(r,s),function(e,t,n){var r,o,i,a=n,u=[];if(a){for(;a=a.firstChild;){if(e.isBlock(a))return;Nn(a)&&!t[a.nodeName.toLowerCase()]&&u.push(a)}for(r=u.length;r--;)!(a=u[r]).hasChildNodes()||a.firstChild===a.lastChild&&""===a.firstChild.nodeValue?e.remove(a):(o=e,(i=a)&&"A"===i.nodeName&&o.isEmpty(i)&&e.remove(a))}}(f,m,n),function(e,t){t.normalize();var n=t.lastChild;n&&!/^(left|right)$/gi.test(e.getStyle(n,"float",!0))||e.add(t,"br")}(f,s),f.isEmpty(s)&&Vx(s),n.normalize(),f.isEmpty(n)?(f.remove(n),v()):(Xx(a,n),Ix(a,n))),f.setAttrib(n,"id",""),a.fire("NewBlock",{newBlock:n})))},Gx=function(e,t,n){var r=e.create("span",{}," ");n.parentNode.insertBefore(r,n),t.scrollIntoView(r),e.remove(r)},Jx=function(e,t,n,r){var o=e.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),t.setRng(o)},Qx=function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();ud(i,a).each(function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset)});var u,s=a.startOffset,c=a.startContainer;1===c.nodeType&&c.hasChildNodes()&&(u=s>c.childNodes.length-1,c=c.childNodes[Math.min(s,c.childNodes.length-1)]||c,s=u&&3===c.nodeType?c.nodeValue.length:0);var l=i.getParent(c,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=!(!t||!t.ctrlKey);"LI"!==d||m||(l=f),c&&3===c.nodeType&&s>=c.nodeValue.length&&!function(e,t,n){for(var r,o=new Hr(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||0a&&(s=r.pageX+o-a),r.pageY+i>u&&(c=r.pageY+i-u),n.style.width=o-s+"px",n.style.height=i-c+"px",v(g.clientX,g.clientY))})}},VS=function(e,l){return function(c){e.on(function(e){var t,n,r,o,i,a,u,s;e.dragging&&(u=(o=l).selection,s=u.getSel().getRangeAt(0).startContainer,i=3===s.nodeType?s.parentNode:s,a=e.element,i===a||o.dom.isChildOf(i,a)||FS(i)||(n=e.element,(r=n.cloneNode(!0)).removeAttribute("data-mce-selected"),t=r,l.fire("drop",{clientX:c.clientX,clientY:c.clientY}).isDefaultPrevented()||l.undoManager.transact(function(){zS(e.element),l.insertContent(l.dom.getOuterHTML(t)),l._selectionOverrides.hideFakeCaret()})))}),qS(e)}},qS=function(e){e.on(function(e){zS(e.ghost)}),e.clear()},$S=function(e){var t,n,r,o=(t=ku(U.none()),{clear:function(){return t.set(U.none())},set:function(e){return t.set(U.some(e))},isSet:function(){return t.get().isSome()},on:function(e){return t.get().each(e)}}),i=bu.DOM,a=document,u=jS(o,e),s=HS(o,e),c=VS(o,e),l=(n=o,function(){n.on(function(e){e.dragging&&r.fire("dragend")}),qS(n)});(r=e).on("mousedown",u),e.on("mousemove",s),e.on("mouseup",c),i.bind(a,"mousemove",s),i.bind(a,"mouseup",l),e.on("remove",function(){i.unbind(a,"mousemove",s),i.unbind(a,"mouseup",l)})},WS=function(e){var n,i,a,u,t;$S(e),(n=e).on("drop",function(e){var t="undefined"!=typeof e.clientX?n.getDoc().elementFromPoint(e.clientX,e.clientY):null;!FS(t)&&"false"!==n.dom.getContentEditableParent(t)||e.preventDefault()}),e.getParam("block_unsupported_drop",!0,"boolean")&&(a=function(e){var t;e.defaultPrevented||(t=e.dataTransfer)&&(I(t.types,"Files")||0').attr("id",p)).appendTo(u.getBody());var i=l.createRng();t===n&&vt.ie?(o.empty().append('

    \xa0

    ').append(t),i.setStartAfter(o[0].firstChild.firstChild),i.setEndAfter(t)):(o.empty().append(oo).append(t).append(oo),i.setStart(o[0].firstChild,1),i.setEnd(o[0].lastChild,0)),o.css({top:l.getPos(e,u.getBody()).y}),o[0].focus();var a=c.getSel();return a.removeAllRanges(),a.addRange(i),i}(e,n.targetClone,t),o=Nt.fromDom(e);return $(qu(Nt.fromDom(u.getBody()),"*[data-mce-selected]"),function(e){Rt(o,e)||Kn(e,i)}),l.getAttrib(e,i)||e.setAttribute(i,"1"),s=e,S(),r},w=function(e,t){if(!e)return null;if(e.collapsed){if(!y(e)){var n=t?1:-1,r=al(n,d,e),o=r.getNode(!t);if(jc(o))return v(n,o,!!t&&!r.isAtEnd(),!1);var i=r.getNode(t);if(jc(i))return v(n,i,!t&&!r.isAtEnd(),!1)}return null}var a=e.startContainer,u=e.startOffset,s=e.endOffset;if(3===a.nodeType&&0===u&&XS(a.parentNode)&&(a=a.parentNode,u=l.nodeIndex(a),a=a.parentNode),1!==a.nodeType)return null;if(s===u+1&&a===e.endContainer){var c=a.childNodes[u];if(g(c))return C(c)}return null},x=function(){s&&s.removeAttribute(i),Er(Nt.fromDom(u.getBody()),"#"+p).each(ln),s=null},S=function(){m.hide()};return vt.ceFalse&&function(){u.on("mouseup",function(e){var t=r();t.collapsed&&Ly(u,e.clientX,e.clientY)&&Wb(u,t,!1).each(h)}),u.on("click",function(e){var t=YS(u,e.target);t&&(XS(t)&&(e.preventDefault(),u.focus()),KS(t)&&l.isChildOf(t,c.getNode())&&x())}),u.on("blur NewBlock",x),u.on("ResizeWindow FullscreenStateChanged",m.reposition);var a=function(e){var t=wl(e);if(!e.firstChild)return!1;var n,r=Us.before(e.firstChild),o=t.next(r);return o&&!(ep(n=o)||tp(n)||Gm(n)||Jm(n))},i=function(e,t){var n,r,o=l.getParent(e,f),i=l.getParent(t,f);return!(!o||e===i||!l.isChildOf(o,i)||!1!==XS(YS(u,o)))||o&&(n=o,r=i,!(l.getParent(n,f)===l.getParent(r,f)))&&a(o)};u.on("tap",function(e){var t=e.target,n=YS(u,t);XS(n)?(e.preventDefault(),$b(u,n).each(w)):g(t)&&$b(u,t).each(w)},!0),u.on("mousedown",function(e){var t,n,r,o=e.target;o!==d&&"HTML"!==o.nodeName&&!l.isChildOf(o,d)||!1===Ly(u,e.clientX,e.clientY)||((t=YS(u,o))?XS(t)?(e.preventDefault(),$b(u,t).each(w)):(x(),KS(t)&&e.shiftKey||Yf(e.clientX,e.clientY,c.getRng())||(S(),c.placeCaretAt(e.clientX,e.clientY))):g(o)?$b(u,o).each(w):!1===jc(o)&&(x(),S(),(n=$w(d,e.clientX,e.clientY))&&(i(o,n.node)||(e.preventDefault(),r=v(1,n.node,n.before,!1),u.getBody().focus(),h(r)))))}),u.on("keypress",function(e){Gf.modifierPressed(e)||XS(c.getNode())&&e.preventDefault()}),u.on("GetSelectionRange",function(e){var t=e.range;if(s){if(!s.parentNode)return void(s=null);(t=t.cloneRange()).selectNode(s),e.range=t}}),u.on("SetSelectionRange",function(e){e.range=b(e.range);var t=w(e.range,e.forward);t&&(e.range=t)});var n,e,o;u.on("AfterSetSelectionRange",function(e){var t,n=e.range,r=n.startContainer.parentNode;y(n)||"mcepastebin"===r.id||S(),t=r,l.hasClass(t,"mce-offscreen-selection")||x()}),u.on("copy",function(e){var t,n,r=e.clipboardData;e.isDefaultPrevented()||!e.clipboardData||vt.ie||(t=(n=l.get(p))?n.getElementsByTagName("*")[0]:n)&&(e.preventDefault(),r.clearData(),r.setData("text/html",t.outerHTML),r.setData("text/plain",t.outerText||t.innerText))}),WS(u),e=Pu(function(){var e,t;n.removed||!n.getBody().contains(document.activeElement)||(e=n.selection.getRng()).collapsed&&(t=Kb(n,e,!1),n.selection.setRng(t))},0),(n=u).on("focus",function(){e.throttle()}),n.on("blur",function(){e.cancel()}),(o=u).on("init",function(){o.on("focusin",function(e){var t,n,r=e.target;jn(r)&&(t=Xf(o.getBody(),r),n=Un(t)?t:r,o.selection.getNode()!==n&&$b(o,n).each(function(e){return o.selection.setRng(e)}))})})}(),{showCaret:v,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(Co(e),h(r()),c.scrollIntoView(e))},hideFakeCaret:S,destroy:function(){m.destroy(),s=null}}},JS=function(u){var s,n,r,o=xt.each,c=Gf.BACKSPACE,l=Gf.DELETE,f=u.dom,d=u.selection,e=u.parser,t=vt.gecko,i=vt.ie,a=vt.webkit,m="data:text/mce-internal,",p=i?"Text":"URL",g=function(e,t){try{u.getDoc().execCommand(e,!1,t)}catch(n){}},h=function(e){return e.isDefaultPrevented()},v=function(){u.shortcuts.add("meta+a",null,"SelectAll")},y=function(){u.on("keydown",function(e){if(!h(e)&&e.keyCode===c&&d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})},b=function(){u.inline||(u.contentStyles.push("body {min-height: 150px}"),u.on("click",function(e){var t;if("HTML"===e.target.nodeName){if(11")+"";e.getParam("document_base_url","")!==e.documentBaseUrl&&(t+=''),t+='';var n=cc(e,"body_id","tinymce"),r=cc(e,"body_class","");return lc(e)&&(t+=''),t+='
    '},uN=function(e,t){var n,r,o,i,a=e.editorManager.translate("Rich Text Area. Press ALT-0 for help."),u=(n=e.id,r=a,t.height,o=e.getParam("iframe_attrs",{}),i=Nt.fromTag("iframe"),$n(i,o),$n(i,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),zu(i,"tox-edit-area__iframe"),i.dom);u.onload=function(){u.onload=null,e.fire("load")};var s=function(e,t){if(document.domain!==window.location.hostname&&vt.browser.isIE()){var n=Gy("mce");e[n]=function(){oN(e)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return iN.setAttrib(t,"src",r),!0}return!1}(e,u);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=u,e.iframeHTML=aN(e),iN.add(t.iframeContainer,u),s},sN=bu.DOM,cN=function(t,n,e){var r=Fy.get(e),o=Fy.urls[e]||t.documentBaseUrl.replace(/\/$/,"");if(e=xt.trim(e),r&&-1===xt.inArray(n,e)){if(xt.each(Fy.dependencies(e),function(e){cN(t,n,e)}),t.plugins[e])return;try{var i=new r(t,o,t.$);(t.plugins[e]=i).init&&(i.init(t,o),n.push(e))}catch(pk){!function(e,t,n){var r=Au.translate(["Failed to initialize plugin: {0}",t]);Wy(r,n),Hy(e,r)}(t,e,pk)}}},lN=function(e){return e.replace(/^\-/,"")},fN=function(e){return{editorContainer:e,iframeContainer:e,api:{}}},dN=function(e){var t,n,r=e.getElement();return e.inline?fN(null):(t=r,n=sN.create("div"),sN.insertAfter(n,t),fN(n))},mN=function(e){var t,n,r,o=e.getElement();return e.orgDisplay=o.style.display,q(Cc(e))?e.theme.renderUI():A(Cc(e))?(n=(t=e).getElement(),(r=Cc(t)(t,n)).editorContainer.nodeType&&(r.editorContainer.id=r.editorContainer.id||t.id+"_parent"),r.iframeContainer&&r.iframeContainer.nodeType&&(r.iframeContainer.id=r.iframeContainer.id||t.id+"_iframecontainer"),r.height=r.iframeHeight?r.iframeHeight:n.offsetHeight,r):dN(e)},pN=function(e){var n,t,r,o,i,a,u,s,c;e.fire("ScriptsLoaded"),n=e,t=xt.trim(pc(n)),r=n.ui.registry.getAll().icons,o=xe(xe({},Ry.get("default").icons),Ry.get(t).icons),oe(o,function(e,t){me(r,t)||n.ui.registry.addIcon(t,e)}),u=Cc(i=e),q(u)?(i.settings.theme=lN(u),a=Uy.get(u),i.theme=new a(i,Uy.urls[u]),i.theme.init&&i.theme.init(i,Uy.urls[u]||i.documentBaseUrl.replace(/\/$/,""),i.$)):i.theme={},s=e,c=[],xt.each(xc(s).split(/[ ,]/),function(e){cN(s,c,lN(e))});var l=mN(e);e.ui=xe(xe({},e.ui),l.api);var f,d,m,p,g={editorContainer:l.editorContainer,iframeContainer:l.iframeContainer};return e.editorContainer=g.editorContainer?g.editorContainer:null,(f=e).contentCSS=f.contentCSS.concat(Ky(f)),e.inline?oN(e):(p=uN(d=e,m=g),m.editorContainer&&(iN.get(m.editorContainer).style.display=d.orgDisplay,d.hidden=iN.isHidden(m.editorContainer)),d.getElement().style.display="none",iN.setAttrib(d.id,"aria-hidden","true"),void(p||oN(d)))},gN=bu.DOM,hN=function(e){return"-"===e.charAt(0)},vN=function(e,t){var n,r=hc(t),o=t.getParam("language_url","","string");!1===Au.hasCode(r)&&"en"!==r&&(n=""!==o?o:t.editorManager.baseURL+"/langs/"+r+".js",e.add(n,V,undefined,function(){Vy(t,"LanguageLoadError",qy("language",n,r))}))},yN=function(t,e,n){return U.from(e).filter(function(e){return 0")},mceToggleVisualAid:function(){i.hasVisual=!i.hasVisual,i.addVisual()},mceReplaceContent:function(e,t,n){i.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,i.selection.getContent({format:"text"})))},mceInsertLink:function(e,t,n){"string"==typeof n&&(n={href:n});var r=i.dom.getParent(i.selection.getNode(),"a");n.href=n.href.replace(/ /g,"%20"),r&&n.href||i.formatter.remove("link"),n.href&&i.formatter.apply("link",n,r)},selectAll:function(){var e,t=i.dom.getParent(i.selection.getStart(),Fn);t&&((e=i.dom.createRng()).selectNodeContents(t),i.selection.setRng(e))},mceNewDocument:function(){i.setContent("")},InsertLineBreak:function(e,t,n){return iS(i,n),!0}});var e=function(r){return function(){var e=i.selection,t=e.isCollapsed()?[i.dom.getParent(e.getNode(),i.dom.isBlock)]:e.getSelectedBlocks(),n=LN(t,function(e){return!!i.formatter.matchNode(e,r)});return-1!==IN(n,!0)}};a.addCommands({JustifyLeft:e("alignleft"),JustifyCenter:e("aligncenter"),JustifyRight:e("alignright"),JustifyFull:e("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return a.isFormatMatch(e)},mceBlockQuote:function(){return a.isFormatMatch("blockquote")},Outdent:function(){return aw(i)},"InsertUnorderedList,InsertOrderedList":function(e){var t=i.dom.getParent(i.selection.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),a.addCommands({Undo:function(){i.undoManager.undo()},Redo:function(){i.undoManager.redo()}}),a.addQueryValueHandler("FontName",function(){return AN(t=i,function(e){return RN(t.getBody(),e.dom)}).getOr("");var t},this),a.addQueryValueHandler("FontSize",function(){return AN(t=i,function(e){return _N(t.getBody(),e.dom)}).getOr("");var t},this),a.addQueryValueHandler("LineHeight",function(){return AN(t=i,function(n){var e=Nt.fromDom(t.getBody());return SN(n,function(e){return Jn(e,"line-height")},E(Rt,e)).getOrThunk(function(){var e=parseFloat(Yn(n,"line-height")),t=parseFloat(Yn(n,"font-size"));return String(e/t)})}).getOr("");var t},this)},FN);function FN(e){this.commands={state:{},exec:{},value:{}},this.editor=e,this.setupCommands(e)}var UN="data-mce-contenteditable",zN=function(e,t,n){var r,o;Hu(e,t)&&!1===n?(o=t,Mu(r=e)?r.dom.classList.remove(o):Uu(r,o),ju(r)):n&&zu(e,t)},jN=function(e,t,n){try{e.getDoc().execCommand(t,!1,String(n))}catch(r){}},HN=function(e,t){e.dom.contentEditable=t?"true":"false"},VN=function(e,t){var n,r,o,i=Nt.fromDom(e.getBody());zN(i,"mce-content-readonly",t),t?(e.selection.controlSelection.hideResizeRect(),e._selectionOverrides.hideFakeCaret(),o=e,U.from(o.selection.getNode()).each(function(e){e.removeAttribute("data-mce-selected")}),e.readonly=!0,HN(i,!1),$(qu(i,'*[contenteditable="true"]'),function(e){qn(e,UN,"true"),HN(e,!1)})):(e.readonly=!1,HN(i,!0),$(qu(i,"*["+UN+'="true"]'),function(e){Kn(e,UN),HN(e,!0)}),jN(e,"StyleWithCSS",!1),jN(e,"enableInlineTableEditing",!1),jN(e,"enableObjectResizing",!1),(pm(r=e)||mm(r))&&e.focus(),(n=e).selection.setRng(n.selection.getRng()),e.nodeChanged())},qN=function(e){return e.readonly},$N=function(t){t.parser.addAttributeFilter("contenteditable",function(e){qN(t)&&$(e,function(e){e.attr(UN,e.attr("contenteditable")),e.attr("contenteditable","false")})}),t.serializer.addAttributeFilter(UN,function(e){qN(t)&&$(e,function(e){e.attr("contenteditable",e.attr(UN))})}),t.serializer.addTempAttr(UN)},WN=xt.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," "),KN=(XN.isNative=function(e){return!!WN[e.toLowerCase()]},XN.prototype.fire=function(e,t){var n=e.toLowerCase(),r=t||{};r.type=n,r.target||(r.target=this.scope),r.preventDefault||(r.preventDefault=function(){r.isDefaultPrevented=k},r.stopPropagation=function(){r.isPropagationStopped=k},r.stopImmediatePropagation=function(){r.isImmediatePropagationStopped=k},r.isDefaultPrevented=p,r.isPropagationStopped=p,r.isImmediatePropagationStopped=p),this.settings.beforeFire&&this.settings.beforeFire(r);var o=this.bindings[n];if(o)for(var i=0,a=o.length;i"),this.parseShortcut);return o[o.length-1]=xt.extend(o[o.length-1],{func:n,scope:r||this.editor}),xt.extend(o[0],{desc:this.editor.translate(t),subpatterns:o.slice(1)})},fE.prototype.hasModifier=function(e){return e.altKey||e.ctrlKey||e.metaKey},fE.prototype.isFunctionKey=function(e){return"keydown"===e.type&&112<=e.keyCode&&e.keyCode<=123},fE.prototype.matchShortcut=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},fE.prototype.executeShortcutAction=function(e){return e.func?e.func.call(e.scope):null},fE);function fE(e){this.shortcuts={},this.pendingPatterns=[],this.editor=e;var n=this;e.on("keyup keypress keydown",function(t){!n.hasModifier(t)&&!n.isFunctionKey(t)||t.isDefaultPrevented()||(aE(n.shortcuts,function(e){if(n.matchShortcut(t,e))return n.pendingPatterns=e.subpatterns.slice(0),"keydown"===t.type&&n.executeShortcutAction(e),!0}),n.matchShortcut(t,n.pendingPatterns[0])&&(1===n.pendingPatterns.length&&"keydown"===t.type&&n.executeShortcutAction(n.pendingPatterns[0]),n.pendingPatterns.shift()))})}var dE=function(){var e,t,n,r,o,i,a,u,s=(t={},n={},r={},o={},i={},a={},{addButton:(u=function(n,r){return function(e,t){return n[e.toLowerCase()]=xe(xe({},t),{type:r})}})(e={},"button"),addGroupToolbarButton:u(e,"grouptoolbarbutton"),addToggleButton:u(e,"togglebutton"),addMenuButton:u(e,"menubutton"),addSplitButton:u(e,"splitbutton"),addMenuItem:u(t,"menuitem"),addNestedMenuItem:u(t,"nestedmenuitem"),addToggleMenuItem:u(t,"togglemenuitem"),addAutocompleter:u(n,"autocompleter"),addContextMenu:u(o,"contextmenu"),addContextToolbar:u(i,"contexttoolbar"),addContextForm:u(i,"contextform"),addSidebar:u(a,"sidebar"),addIcon:function(e,t){return r[e.toLowerCase()]=t},getAll:function(){return{buttons:e,menuItems:t,icons:r,popups:n,contextMenus:o,contextToolbars:i,sidebars:a}}});return{addAutocompleter:s.addAutocompleter,addButton:s.addButton,addContextForm:s.addContextForm,addContextMenu:s.addContextMenu,addContextToolbar:s.addContextToolbar,addIcon:s.addIcon,addMenuButton:s.addMenuButton,addMenuItem:s.addMenuItem,addNestedMenuItem:s.addNestedMenuItem,addSidebar:s.addSidebar,addSplitButton:s.addSplitButton,addToggleButton:s.addToggleButton,addGroupToolbarButton:s.addGroupToolbarButton,addToggleMenuItem:s.addToggleMenuItem,getAll:s.getAll}},mE=xt.each,pE=xt.trim,gE="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),hE={ftp:21,http:80,https:443,mailto:25},vE=(yE.parseDataUri=function(e){var t,n=decodeURIComponent(e).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(t=r[1]),{type:t,data:n[1]}},yE.getDocumentBaseUrl=function(e){var t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname;return/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t},yE.prototype.setPath=function(e){var t=/^(.*?)\/?(\w+)?$/.exec(e);this.path=t[0],this.directory=t[1],this.file=t[2],this.source="",this.getURI()},yE.prototype.toRelative=function(e){var t;if("./"===e)return e;var n=new yE(e,{base_uri:this});if("mce_host"!==n.host&&this.host!==n.host&&n.host||this.port!==n.port||this.protocol!==n.protocol&&""!==n.protocol)return n.getURI();var r=this.getURI(),o=n.getURI();return r===o||"/"===r.charAt(r.length-1)&&r.substr(0,r.length-1)===o?r:(t=this.toRelPath(this.path,n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),t)},yE.prototype.toAbsolute=function(e,t){var n=new yE(e,{base_uri:this});return n.getURI(t&&this.isSameOrigin(n))},yE.prototype.isSameOrigin=function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=hE[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},yE.prototype.toRelPath=function(e,t){var n,r,o=0,i="",a=e.substring(0,e.lastIndexOf("/")).split("/"),u=t.split("/");if(a.length>=u.length)for(n=0,r=a.length;n=u.length||a[n]!==u[n]){o=n+1;break}if(a.length=a.length||a[n]!==u[n]){o=n+1;break}if(1===o)return t;for(n=0,r=a.length-(o-1);n=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(e,t){var n=$E(e.x,t.x),r=$E(e.y,t.y),o=qE(e.x+e.w,t.x+t.w),i=qE(e.y+e.h,t.y+t.h);return o-n<0||i-r<0?null:XE(n,r,o-n,i-r)},clamp:function(e,t,n){var r=e.x,o=e.y,i=e.x+e.w,a=e.y+e.h,u=t.x+t.w,s=t.y+t.h,c=$E(0,t.x-r),l=$E(0,t.y-o),f=$E(0,i-u),d=$E(0,a-s);return r+=c,o+=l,n&&(i+=c,a+=l,r-=f,o-=d),XE(r,o,(i-=f)-r,(a-=d)-o)},create:XE,fromClientRect:function(e){return XE(e.left,e.top,e.width,e.height)}},GE=(zE={},jE={},{load:function(r,o){var i='Script at URL "'+o+'" failed to load',a='Script at URL "'+o+"\" did not call `tinymce.Resource.add('"+r+"', data)` within 1 second";if(zE[r]!==undefined)return zE[r];var e=new _r(function(e,t){var n=function(e,t,n){void 0===n&&(n=1e3);var r=!1,o=null,i=function(n){return function(){for(var e=[],t=0;t "+o.toString()},function(t,n){return"state("+t+")"})}).join("\n")+"}"}}},fn=function(r){return{extract:function(e,o,t){var n=V(t,function(t,n){return r.extract(e.concat(["["+n+"]"]),o,t)});return tn(n)},toString:function(){return"array("+r.toString()+")"}}},dn=function(a){return{extract:function(t,n,e){for(var o=[],r=0,i=a;r ")+")\n"+t.getErrorInfo()}).join("\n"))+"\n\nInput object: "+nn(t.input);var n,e},Bn=yn,Dn=function(t,n){return yn(t,_t(n,ln))},An=at(xn),Mn=function(e,o){return cn(function(t){var n=typeof t;return e(t)?ht(t):bt("Expected type: "+o+" but got: "+n)})},Fn=Mn(et,"number"),In=Mn(S,"string"),Rn=Mn(C,"boolean"),Vn=Mn(_,"function"),Pn=function(n){var t=function(t,n){for(var e=t.next();!e.done;){if(!n(e.value))return!1;e=t.next()}return!0};if(Object(n)!==n)return!0;switch({}.toString.call(n).slice(8,-1)){case"Boolean":case"Number":case"String":case"Date":case"RegExp":case"Blob":case"FileList":case"ImageData":case"ImageBitmap":case"ArrayBuffer":return!0;case"Array":case"Object":return Object.keys(n).every(function(t){return Pn(n[t])});case"Map":return t(n.keys(),Pn)&&t(n.values(),Pn);case"Set":return t(n.keys(),Pn);default:return!1}},Hn=cn(function(t){return Pn(t)?ht(t):bt("Expected value to be acceptable for sending via postMessage")}),zn=function(n){return kn(function(t){return M(n,t)?it.value(t):it.error('Unsupported value: "'+t+'", choose one of "'+n.join(", ")+'".')})},Nn=function(t){return vn(t,t,Ut(),gn())},Ln=function(t,n){return vn(t,t,Ut(),n)},jn=function(t){return Ln(t,In)},Un=function(t,n){return vn(t,t,Ut(),zn(n))},Wn=function(t){return Ln(t,Vn)},Gn=function(t,n){return vn(t,t,Ut(),ln(n))},Xn=function(t,n){return vn(t,t,Ut(),pn(n))},Yn=function(t,n){return vn(t,t,Ut(),fn(n))},qn=function(t){return vn(t,t,Wt(),gn())},Kn=function(t,n){return vn(t,t,Wt(),n)},Jn=function(t){return Kn(t,Fn)},$n=function(t){return Kn(t,In)},Qn=function(t){return Kn(t,Vn)},Zn=function(t,n){return Kn(t,ln(n))},te=function(t,n){return vn(t,t,jt(n),gn())},ne=function(t,n,e){return vn(t,t,jt(n),e)},ee=function(t,n){return ne(t,n,Fn)},oe=function(t,n){return ne(t,n,In)},re=function(t,n,e){return ne(t,n,zn(e))},ie=function(t,n){return ne(t,n,Rn)},ue=function(t,n){return ne(t,n,Vn)},ae=function(t,n,e){return ne(t,n,ln(e))},ce=function(t,n){return hn(t,n)},se=function(t){var n=t;return{get:function(){return n},set:function(t){n=t}}},le=function(t){if(null===t||t===undefined)throw new Error("Node cannot be null or undefined");return{dom:t}},fe={fromHtml:function(t,n){var e=(n||document).createElement("div");if(e.innerHTML=t,!e.hasChildNodes()||1=o.length&&e.substr(r,r+o.length)===o?t.substring(0,t.length-"/*".length):t;var n,e,o,r})},ri=function(t,n){var e=t.toString(),o=e.indexOf(")")+1,r=e.indexOf("("),i=e.substring(r+1,o-1).split(/,\s*/);return t.toFunctionAnnotation=function(){return{name:n,parameters:oi(i)}},t},ii=Xr("alloy-premade"),ui=function(t){return Kt(ii,t)},ai=function(o){return t=function(t){for(var n=[],e=1;e "):o[0].name;return Kt(r,{handler:n,purpose:e})})});return $t(n,{})},yi="alloy.base.behaviour",xi=function(t){var n,e;return On("custom.definition",ln([vn("dom","dom",Ut(),ln([Nn("tag"),te("styles",{}),te("classes",[]),te("attributes",{}),qn("value"),qn("innerHtml")])),Nn("components"),Nn("uid"),te("events",{}),te("apis",{}),vn("eventOrder","eventOrder",((n={})[ko()]=["disabling",yi,"toggling","typeaheadevents"],n[yo()]=[yi,"focusing","keying"],n[Bo()]=[yi,"disabling","toggling","representing"],n[fo()]=[yi,"representing","streaming","invalidating"],n[Ro()]=[yi,"representing","item-events","tooltipping"],n[eo()]=["focusing",yi,"item-type-events"],n[Qe()]=["focusing",yi,"item-type-events"],n[uo()]=["item-type-events","tooltipping"],n[So()]=["receiving","reflecting","tooltipping"],e=n,Lt.mergeWithThunk(at(e))),An()),qn("domModification")]),t)},wi=function(t,n){var e=Pr(t,n);return e===undefined||""===e?[]:e.split(" ")},Si=function(t){return t.dom.classList!==undefined},ki=function(t,n){return r=n,i=wi(e=t,o="class").concat([r]),Vr(e,o,i.join(" ")),!0;var e,o,r,i},Ci=function(t,n){return r=n,0<(i=H(wi(e=t,o="class"),function(t){return t!==r})).length?Vr(e,o,i.join(" ")):Nr(e,o),!1;var e,o,r,i},Oi=function(t,n){Si(t)?t.dom.classList.add(n):ki(t,n)},_i=function(t){0===(Si(t)?t.dom.classList:wi(t,"class")).length&&Nr(t,"class")},Ti=function(t,n){Si(t)?t.dom.classList.remove(n):Ci(t,n),_i(t)},Ei=function(t,n){return Si(t)&&t.dom.classList.contains(n)},Bi=function(n,t){ot(t,function(t){Oi(n,t)})},Di=function(n,t){ot(t,function(t){Ti(n,t)})},Ai=function(t){return t.style!==undefined&&_(t.style.getPropertyValue)},Mi=function(t){return pr(t)},Fi=_(Element.prototype.attachShadow)&&_(Node.prototype.getRootNode),Ii=at(Fi),Ri=Fi?function(t){return fe.fromDom(t.dom.getRootNode())}:vr,Vi=function(t){return Mi(t)?t:fe.fromDom(vr(t).dom.body)},Pi=function(t){return fe.fromDom(t.dom.host)},Hi=function(t){return O(t.dom.shadowRoot)},zi=function(t){var n=mr(t)?t.dom.parentNode:t.dom;if(n===undefined||null===n||null===n.ownerDocument)return!1;var e,o,r,i,u=n.ownerDocument;return r=fe.fromDom(n),i=Ri(r),(Mi(i)?st.some(i):st.none()).fold(function(){return u.body.contains(n)},(e=zi,o=Pi,function(t){return e(o(t))}))},Ni=function(){return Li(fe.fromDom(document))},Li=function(t){var n=t.dom.body;if(null===n||n===undefined)throw new Error("Body is not available yet");return fe.fromDom(n)},ji=function(t,n,e){if(!S(e))throw console.error("Invalid call to CSS.set. Property ",n,":: Value ",e,":: Element ",t),new Error("CSS value must be a string: "+e);Ai(t)&&t.style.setProperty(n,e)},Ui=function(t,n){Ai(t)&&t.style.removeProperty(n)},Wi=function(t,n,e){var o=t.dom;ji(o,n,e)},Gi=function(t,n){var e=t.dom;Ot(n,function(t,n){ji(e,n,t)})},Xi=function(t,n){var e=t.dom;Ot(n,function(t,n){t.fold(function(){Ui(e,n)},function(t){ji(e,n,t)})})},Yi=function(t,n){var e=t.dom,o=window.getComputedStyle(e).getPropertyValue(n);return""!==o||zi(t)?o:qi(e,n)},qi=function(t,n){return Ai(t)?t.style.getPropertyValue(n):""},Ki=function(t,n){var e=t.dom,o=qi(e,n);return st.from(o).filter(function(t){return 0"}),An()),ef=ce("schema",function(){return[qn("preprocess")]}),of=te("defaults",at({})),rf=te("overrides",at({})),uf=ln([Ql,Zl,tf,nf,of,rf]),af=ln([Ql,Zl,tf,of,rf]),cf=ln([Ql,Zl,tf,nf,of,rf]),sf=ln([Ql,ef,tf,Nn("unit"),nf,of,rf]),lf=function(t){return t.fold(st.some,st.none,st.some,st.some)},ff=function(t){var n=function(t){return t.name};return t.fold(n,n,n,n)},df=function(e,o){return function(t){var n=Tn("Converting part type",o,t);return e(n)}},mf=df($l.required,uf),gf=df($l.external,af),pf=df($l.optional,cf),hf=df($l.group,sf),vf=at("entirety"),bf=/* */Object.freeze({__proto__:null,required:mf,external:gf,optional:pf,group:hf,asNamedPart:lf,name:ff,asCommon:function(t){return t.fold(ct,ct,ct,ct)},original:vf}),yf=function(t,n,e,o){return Ht(n.defaults(t,e,o),e,{uid:t.partUids[n.name]},n.overrides(t,e,o))},xf=function(r,t){var n={};return ot(t,function(t){lf(t).each(function(e){var o=wf(r,e.pname);n[e.name]=function(t){var n=Tn("Part: "+e.name+" in "+r,ln(e.schema),t);return nt(nt({},o),{config:t,validated:n})}})}),n},wf=function(t,n){return{uiType:Jl(),owner:t,name:n}},Sf=function(t,n,e){return{uiType:Jl(),owner:t,name:n,config:e,validated:{}}},kf=function(t){return U(t,function(t){return t.fold(st.none,st.some,st.none,st.none).map(function(t){return Gn(t.name,t.schema.concat([pa(vf())]))}).toArray()})},Cf=function(t){return V(t,ff)},Of=function(t,n,e){return o=n,i={},r={},ot(e,function(t){t.fold(function(o){i[o.pname]=ql(!0,function(t,n,e){return o.factory.sketch(yf(t,o,n,e))})},function(t){var n=o.parts[t.name];r[t.name]=at(t.factory.sketch(yf(o,t,n[vf()]),n))},function(o){i[o.pname]=ql(!1,function(t,n,e){return o.factory.sketch(yf(t,o,n,e))})},function(r){i[r.pname]=Kl(!0,function(n,t,e){var o=n[r.name];return V(o,function(t){return r.factory.sketch(Ht(r.defaults(n,t,e),t,r.overrides(n,t)))})})})}),{internals:at(i),externals:at(r)};var o,i,r},_f=function(t,n,e){return Yl(st.some(t),n,n.components,e)},Tf=function(t,n,e){var o=n.partUids[e];return t.getSystem().getByUid(o).toOptional()},Ef=function(t,n,e){return Tf(t,n,e).getOrDie("Could not find part: "+e)},Bf=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return ot(e,function(t){o[t]=at(i.getByUid(r[t]))}),o},Df=function(t,n){var e=t.getSystem();return _t(n.partUids,function(t,n){return at(e.getByUid(t))})},Af=function(t){return kt(t.partUids)},Mf=function(t,n,e){var o={},r=n.partUids,i=t.getSystem();return ot(e,function(t){o[t]=at(i.getByUid(r[t]).getOrDie())}),o},Ff=function(n,t){var e=Cf(t);return Jt(V(e,function(t){return{key:t,value:n+"-"+t}}))},If=function(n){return vn("partUids","partUids",Xt(function(t){return Ff(t.uid,n)}),An())},Rf=/* */Object.freeze({__proto__:null,generate:xf,generateOne:Sf,schemas:kf,names:Cf,substitutes:Of,components:_f,defaultUids:Ff,defaultUidsSchema:If,getAllParts:Df,getAllPartNames:Af,getPart:Tf,getPartOrDie:Ef,getParts:Bf,getPartsOrDie:Mf}),Vf=function(t,n,e,o,r){var i,u,a=(u=r,(0<(i=o).length?[Gn("parts",i)]:[]).concat([Nn("uid"),te("dom",{}),te("components",[]),pa("originalSpec"),te("debug.sketcher",{})]).concat(u));return Tn(t+" [SpecSchema]",sn(a.concat(n)),e)},Pf=function(t,n,e,o,r){var i=Hf(r),u=kf(e),a=If(e),c=Vf(t,n,i,u,[a]),s=Of(0,c,e);return o(c,_f(t,c,s.internals()),i,s.externals())},Hf=function(t){return Ft(t,"uid")?t:nt(nt({},t),{uid:Zr("uid")})};var zf,Nf,Lf=sn([Nn("name"),Nn("factory"),Nn("configFields"),te("apis",{}),te("extraApis",{})]),jf=sn([Nn("name"),Nn("factory"),Nn("configFields"),Nn("partFields"),te("apis",{}),te("extraApis",{})]),Uf=function(t){var i=Tn("Sketcher for "+t.name,Lf,t),n=_t(i.apis,ai),e=_t(i.extraApis,ri);return nt(nt({name:i.name,configFields:i.configFields,sketch:function(t){return n=i.name,e=i.configFields,o=i.factory,r=Hf(t),o(Vf(n,e,r,[],[]),r);var n,e,o,r}},n),e)},Wf=function(t){var n=Tn("Sketcher for "+t.name,jf,t),e=xf(n.name,n.partFields),o=_t(n.apis,ai),r=_t(n.extraApis,ri);return nt(nt({name:n.name,partFields:n.partFields,configFields:n.configFields,sketch:function(t){return Pf(n.name,n.configFields,n.partFields,n.factory,t)},parts:e},o),r)},Gf=function(t){for(var n=[],e=function(t){n.push(t)},o=0;o
    ',e.getDoc());return Er(t,fe.fromDom(n.extractContents())),n.insertNode(t.dom),xr(t).each(function(t){return t.dom.normalize()}),cs(t,as).map(function(t){var n;e.selection.setCursorLocation(t.dom,"img"===lr(n=t)?1:is(n).fold(function(){return kr(n).length},function(t){return t.length}))}),t})},wp=function(t){return Xu(t,"[data-mce-autocompleter]")},Sp=function(t){return t.toString().replace(/\u00A0/g," ").replace(/\uFEFF/g,"")},kp=function(t){return""!==t&&-1!==" \xa0\f\n\r\t\x0B".indexOf(t)},Cp=function(t,n){return t.substring(n.length)},Op=function(t,o,r,i){if(void 0===i&&(i=0),!(n=o).collapsed||3!==n.startContainer.nodeType)return st.none();var n,e=t.getParent(o.startContainer,t.isBlock)||t.getRoot();return yp(t,o.startContainer,o.startOffset,function(t,n,e){return function(t,n,e){for(var o=n-1;0<=o;o--){var r=t.charAt(o);if(kp(r))return st.none();if(r===e)break}return st.some(o)}(e,n,r).getOr(n)},e).bind(function(t){var n=o.cloneRange();if(n.setStart(t.container,t.offset),n.setEnd(o.endContainer,o.endOffset),n.collapsed)return st.none();var e=Sp(n);return 0!==e.lastIndexOf(r)||Cp(e,r).length=t.minChars&&t.matches.getOrThunk(function(){return Mp(n.dom)})(e.range,i,e.text)});if(0===u.length)return st.none();var a=Ep.all(V(u,function(n){return n.fetch(e.text,n.maxResults,o).then(function(t){return{matchText:e.text,items:t,columns:n.columns,onAction:n.onAction}})}));return st.some({lookupData:a,context:e})},Rp=ln([jn("type"),$n("text")]),Vp=ln([te("type","autocompleteitem"),te("active",!1),te("disabled",!1),te("meta",{}),jn("value"),$n("text"),$n("icon")]),Pp=ln([jn("type"),jn("ch"),ee("minChars",1),te("columns",1),ee("maxResults",10),Qn("matches"),Wn("fetch"),Wn("onAction")]),Hp=[ie("disabled",!1),$n("tooltip"),$n("icon"),$n("text"),ue("onSetup",function(){return $})],zp=ln([jn("type"),Wn("onAction")].concat(Hp)),Np=function(t){return On("toolbarbutton",zp,t)},Lp=[ie("active",!1)].concat(Hp),jp=ln(Lp.concat([jn("type"),Wn("onAction")])),Up=function(t){return On("ToggleButton",jp,t)},Wp=[ue("predicate",function(){return!1}),re("scope","node",["node","editor"]),re("position","selection",["node","selection","line"])],Gp=Hp.concat([te("type","contextformbutton"),te("primary",!1),Wn("onAction"),ce("original",ct)]),Xp=Lp.concat([te("type","contextformbutton"),te("primary",!1),Wn("onAction"),ce("original",ct)]),Yp=Hp.concat([te("type","contextformbutton")]),qp=Lp.concat([te("type","contextformtogglebutton")]),Kp=Dn("type",{contextformbutton:Gp,contextformtogglebutton:Xp}),Jp=ln([te("type","contextform"),ue("initValue",function(){return""}),$n("label"),Yn("commands",Kp),Kn("launch",Dn("type",{contextformbutton:Yp,contextformtogglebutton:qp}))].concat(Wp)),$p=ln([te("type","contexttoolbar"),jn("items")].concat(Wp)),Qp=function(t){var n,e,o=t.ui.registry.getAll().popups,r=_t(o,function(t){return On("Autocompleter",Pp,t).fold(function(t){throw new Error(En(t))},function(t){return t})}),i=(n=Bt(r,function(t){return t.ch}),e={},ot(n,function(t){e[t]={}}),kt(e)),u=At(r);return{dataset:r,triggerChars:i,lookupByChar:function(n){return H(u,function(t){return t.ch===n})}}};(hp=pp=pp||{})[hp.CLOSE_ON_EXECUTE=0]="CLOSE_ON_EXECUTE",hp[hp.BUBBLE_TO_SANDBOX=1]="BUBBLE_TO_SANDBOX";var Zp,th,nh=pp,eh="tox-menu-nav__js",oh="tox-collection__item",rh="tox-swatch",ih={normal:eh,color:rh},uh="tox-collection__item--enabled",ah="tox-collection__item-label",ch="tox-collection__item-caret",sh="tox-collection__item--active",lh=function(t){return Mt(ih,t).getOr(eh)},fh=function(t){return{backgroundMenu:"tox-background-menu",selectedMenu:"tox-selected-menu",selectedItem:"tox-collection__item--active",hasIcons:"tox-menu--has-icons",menu:"color"===t?"tox-swatches":"tox-menu",tieredMenu:"tox-tiered-menu"}},dh=function(t){var n=fh(t);return{backgroundMenu:n.backgroundMenu,selectedMenu:n.selectedMenu,menu:n.menu,selectedItem:n.selectedItem,item:lh(t)}},mh=[jg.parts.items({})],gh=function(t,n,e){var o=fh(e);return{dom:{tag:"div",classes:rt([[o.tieredMenu]])},markers:dh(e)}},ph=function(e,o){return function(t){var n=R(t,o);return V(n,function(t){return{dom:e,components:t}})}},hh=function(t,e){var o=[],r=[];return ot(t,function(t,n){e(t,n)?(0o}).getOr(r.length);return st.some({numColumns:e,numRows:Math.ceil(r.length/e)})}return st.none()},Bh=function(t,n){return nc([ag(t,n)])},Dh=function(t){return Bh(Xr("unnamed-events"),t)},Ah=[Nn("lazySink"),Nn("tooltipDom"),te("exclusive",!0),te("tooltipComponents",[]),te("delay",300),re("mode","normal",["normal","follow-highlight"]),te("anchor",function(t){return{anchor:"hotspot",hotspot:t,layouts:{onLtr:at([za,Ha,Ia,Va,Ra,Pa]),onRtl:at([za,Ha,Ia,Va,Ra,Pa])}}}),la("onHide"),la("onShow")],Mh=/* */Object.freeze({__proto__:null,init:function(){var e=se(st.none()),n=se(st.none()),o=function(){e.get().each(function(t){clearTimeout(t)})},t=at("not-implemented");return si({getTooltip:function(){return n.get()},isShowing:function(){return n.get().isSome()},setTooltip:function(t){n.set(st.some(t))},clearTooltip:function(){n.set(st.none())},clearTimer:o,resetTimer:function(t,n){o(),e.set(st.some(setTimeout(function(){t()},n)))},readState:t})}}),Fh=Xr("tooltip.exclusive"),Ih=Xr("tooltip.show"),Rh=Xr("tooltip.hide"),Vh=function(t,n,e){t.getSystem().broadcastOn([Fh],{})},Ph=/* */Object.freeze({__proto__:null,hideAllExclusive:Vh,setComponents:function(t,n,e,o){e.getTooltip().each(function(t){t.getSystem().isConnected()&&ug.set(t,o)})}}),Hh=oc({fields:Ah,name:"tooltipping",active:/* */Object.freeze({__proto__:null,events:function(r,i){var e=function(n){i.getTooltip().each(function(t){el(t),r.onHide(n,t),i.clearTooltip()}),i.clearTimer()};return Jo(rt([[Zo(Ih,function(o){i.resetTimer(function(){var n,t,e;n=o,i.isShowing()||(Vh(n),t=r.lazySink(n).getOrDie(),e=n.getSystem().build({dom:r.tooltipDom,components:r.tooltipComponents,events:Jo("normal"===r.mode?[Zo(uo(),function(t){Wo(n,Ih)}),Zo(ro(),function(t){Wo(n,Rh)})]:[]),behaviours:nc([ug.config({})])}),i.setTooltip(e),Zs(t,e),r.onShow(n,e),qs.position(t,r.anchor(n),e))},r.delay)}),Zo(Rh,function(t){i.resetTimer(function(){e(t)},r.delay)}),Zo(So(),function(t,n){n.universal||M(n.channels,Fh)&&e(t)}),ar(function(t){e(t)})],"normal"===r.mode?[Zo(ao(),function(t){Wo(t,Ih)}),Zo(xo(),function(t){Wo(t,Rh)}),Zo(uo(),function(t){Wo(t,Ih)}),Zo(ro(),function(t){Wo(t,Rh)})]:[Zo(jo(),function(t,n){Wo(t,Ih)}),Zo(Uo(),function(t){Wo(t,Rh)})]]))}}),state:Mh,apis:Ph}),zh=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),Nh=tinymce.util.Tools.resolve("tinymce.util.I18n"),Lh=["input","button","textarea","select"],jh=function(t,n,e){(n.disabled()?qh:Kh)(t,n)},Uh=function(t,n){return!0===n.useNative&&M(Lh,lr(t.element))},Wh=function(t){Vr(t.element,"disabled","disabled")},Gh=function(t){Nr(t.element,"disabled")},Xh=function(t){Vr(t.element,"aria-disabled","true")},Yh=function(t){Vr(t.element,"aria-disabled","false")},qh=function(n,t,e){t.disableClass.each(function(t){Oi(n.element,t)}),(Uh(n,t)?Wh:Xh)(n),t.onDisabled(n)},Kh=function(n,t,e){t.disableClass.each(function(t){Ti(n.element,t)}),(Uh(n,t)?Gh:Yh)(n),t.onEnabled(n)},Jh=function(t,n){return Uh(t,n)?zr(t.element,"disabled"):"true"===Pr(t.element,"aria-disabled")},$h=/* */Object.freeze({__proto__:null,enable:Kh,disable:qh,isDisabled:Jh,onLoad:jh,set:function(t,n,e,o){(o?qh:Kh)(t,n)}}),Qh=/* */Object.freeze({__proto__:null,exhibit:function(t,n){return fi({classes:n.disabled()?n.disableClass.toArray():[]})},events:function(e,t){return Jo([$o(ko(),function(t,n){return Jh(t,e)}),Ja(e,t,jh)])}}),Zh=[ue("disabled",c),te("useNative",!0),qn("disableClass"),la("onDisabled"),la("onEnabled")],tv=oc({fields:Zh,name:"disabling",active:Qh,apis:$h}),nv=tinymce.util.Tools.resolve("tinymce.EditorManager"),ev=function(t){return t.getParam("height",Math.max(t.getElement().offsetHeight,200))},ov=function(t){return t.getParam("width",zh.DOM.getStyle(t.getElement(),"width"))},rv=function(t){return st.from(t.getParam("min_width")).filter(et)},iv=function(t){return st.from(t.getParam("min_height")).filter(et)},uv=function(t){return st.from(t.getParam("max_width")).filter(et)},av=function(t){return st.from(t.getParam("max_height")).filter(et)},cv=function(t){return!1!==t.getParam("menubar",!0,"boolean")},sv=function(t){var n=t.getParam("toolbar",!0),e=!0===n,o=S(n),r=h(n)&&0'+t+"
    "})}return r},Kv=xf(Rg(),Vg()),Jv=function(t){return{value:t}},$v=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,Qv=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,Zv=function(t){return $v.test(t)||Qv.test(t)},tb=function(t){var n={value:t.value.replace($v,function(t,n,e,o){return n+n+e+e+o+o})},e=Qv.exec(n.value);return null===e?["FFFFFF","FF","FF","FF"]:e},nb=function(t){var n=t.toString(16);return 1===n.length?"0"+n:n},eb=function(t){var n=nb(t.red)+nb(t.green)+nb(t.blue);return Jv(n)},ob=Math.min,rb=Math.max,ib=Math.round,ub=/^rgb\((\d+),\s*(\d+),\s*(\d+)\)/,ab=/^rgba\((\d+),\s*(\d+),\s*(\d+),\s*(\d?(?:\.\d+)?)\)/,cb=function(t,n,e,o){return{red:t,green:n,blue:e,alpha:o}},sb=function(t){var n=parseInt(t,10);return n.toString()===t&&0<=n&&n<=255},lb=function(t){var n,e,o,r=(t.hue||0)%360,i=t.saturation/100,u=t.value/100,i=rb(0,ob(i,1)),u=rb(0,ob(u,1));if(0===i)return n=e=o=ib(255*u),cb(n,e,o,1);var a=r/60,c=u*i,s=c*(1-Math.abs(a%2-1)),l=u-c;switch(Math.floor(a)){case 0:n=c,e=s,o=0;break;case 1:n=s,e=c,o=0;break;case 2:n=0,e=c,o=s;break;case 3:n=0,e=s,o=c;break;case 4:n=s,e=0,o=c;break;case 5:n=c,e=0,o=s;break;default:n=e=o=0}return n=ib(255*(n+l)),e=ib(255*(e+l)),o=ib(255*(o+l)),cb(n,e,o,1)},fb=function(t){var n=tb(t),e=parseInt(n[1],16),o=parseInt(n[2],16),r=parseInt(n[3],16);return cb(e,o,r,1)},db=function(t,n,e,o){var r=parseInt(t,10),i=parseInt(n,10),u=parseInt(e,10),a=parseFloat(o);return cb(r,i,u,a)},mb=function(t){return"rgba("+t.red+","+t.green+","+t.blue+","+t.alpha+")"},gb=cb(255,0,0,1),pb=function(t,n){return t.fire("ResizeContent",n)},hb=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),vb="tinymce-custom-colors";var bb="choiceitem",yb=[{type:bb,text:"Light Green",value:"#BFEDD2"},{type:bb,text:"Light Yellow",value:"#FBEEB8"},{type:bb,text:"Light Red",value:"#F8CAC6"},{type:bb,text:"Light Purple",value:"#ECCAFA"},{type:bb,text:"Light Blue",value:"#C2E0F4"},{type:bb,text:"Green",value:"#2DC26B"},{type:bb,text:"Yellow",value:"#F1C40F"},{type:bb,text:"Red",value:"#E03E2D"},{type:bb,text:"Purple",value:"#B96AD9"},{type:bb,text:"Blue",value:"#3598DB"},{type:bb,text:"Dark Turquoise",value:"#169179"},{type:bb,text:"Orange",value:"#E67E23"},{type:bb,text:"Dark Red",value:"#BA372A"},{type:bb,text:"Dark Purple",value:"#843FA1"},{type:bb,text:"Dark Blue",value:"#236FA1"},{type:bb,text:"Light Gray",value:"#ECF0F1"},{type:bb,text:"Medium Gray",value:"#CED4D9"},{type:bb,text:"Gray",value:"#95A5A6"},{type:bb,text:"Dark Gray",value:"#7E8C8D"},{type:bb,text:"Navy Blue",value:"#34495E"},{type:bb,text:"Black",value:"#000000"},{type:bb,text:"White",value:"#ffffff"}],xb=function(e){void 0===e&&(e=10);var t,n=hb.getItem(vb),o=S(n)?JSON.parse(n):[],r=e-(t=o).length<0?t.slice(0,e):t,i=function(t){r.splice(t,1)};return{add:function(t){var n;(-1===(n=A(r,t))?st.none():st.some(n)).each(i),r.unshift(t),r.length>e&&r.pop(),hb.setItem(vb,JSON.stringify(r))},state:function(){return r.slice(0)}}}(10),wb=function(t){return!1!==t.getParam("custom_colors")},Sb=function(t){var n=t.getParam("color_map");return n!==undefined?function(t){var n=[],u=document.createElement("canvas");u.height=1,u.width=1;for(var a=u.getContext("2d"),c=function(t,n){var e=n/255;return("0"+Math.round(t*e+255*(1-e)).toString(16)).slice(-2).toUpperCase()},e=0;e'+e+"":"",r='
    '+t.icon+"
    ",i={_:" "," - ":" ","-":" "},u=e.replace(/\_| \- |\-/g,function(t){return i[t]});return'
    '+r+o+"
    "}),o="auto"!==a.columns&&1'+t.join("")+""});Ir(t.element,r.join(""))},u=r(function(t,n,e,o){n.stop(),c.isReadOnly()||Go(t,zy,{name:a.name,value:o})}),s=[Zo(uo(),r(function(t,n,e){sc(e)})),Zo(go(),u),Zo(Oo(),u),Zo(ao(),r(function(t,n,e){Gu(t.element,"."+sh).each(function(t){Ti(t,sh)}),Oi(e,sh)})),Zo(co(),r(function(t){Gu(t.element,"."+sh).each(function(t){Ti(t,sh)})})),sr(r(function(t,n,e,o){Go(t,zy,{name:a.name,value:o})}))],l=function(t,n){return V(ss(t.element,".tox-collection__item"),n)},f=Ey.parts.field({dom:{tag:"div",classes:["tox-collection"].concat(1!==a.columns?["tox-collection--grid"]:["tox-collection--list"])},components:[],factory:{sketch:ct},behaviours:nc([tv.config({disabled:c.isReadOnly,onDisabled:function(t){l(t,function(t){Oi(t,"tox-collection__item--state-disabled"),Vr(t,"aria-disabled",!0)})},onEnabled:function(t){l(t,function(t){Ti(t,"tox-collection__item--state-disabled"),Nr(t,"aria-disabled")})}}),_v(),ug.config({}),Vl.config({store:{mode:"memory",initialValue:[]},onSetValue:function(o,t){i(o,t),"auto"===a.columns&&Eh(o,5,"tox-collection__item").each(function(t){var n=t.numRows,e=t.numColumns;ng.setGridSize(o,n,e)}),Wo(o,Wy)}}),Ay.config({}),ng.config((n=a.columns,e="normal",1===n?{mode:"menu",moveOnTab:!1,selector:".tox-collection__item"}:"auto"===n?{mode:"flatgrid",selector:".tox-collection__item",initSize:{numColumns:1,numRows:1}}:{mode:"matrix",selectors:{row:"color"===e?".tox-swatches__row":".tox-collection__group",cell:"color"===e?"."+rh:"."+oh}})),ag("collection-events",s)]),eventOrder:((t={})[ko()]=["disabling","alloy.base.behaviour","collection-events"],t)});return My(o,f,["tox-form__group--collection"],[])},Xy=at([qn("data"),te("inputAttributes",{}),te("inputStyles",{}),te("tag","input"),te("inputClasses",[]),la("onSetValue"),te("styles",{}),te("eventOrder",{}),Pl("inputBehaviours",[Vl,dg]),te("selectOnFocus",!0)]),Yy=function(t){return nc([dg.config({onFocus:t.selectOnFocus?function(t){var n=t.element,e=Zi(n);n.dom.setSelectionRange(0,e.length)}:$})])},qy=function(t){return{tag:t.tag,attributes:nt({type:"text"},t.inputAttributes),styles:t.inputStyles,classes:t.inputClasses}},Ky=Uf({name:"Input",configFields:Xy(),factory:function(t,n){return{uid:t.uid,dom:qy(t),components:[],behaviours:nt(nt({},Yy(e=t)),zl(e.inputBehaviours,[Vl.config({store:nt(nt({mode:"manual"},e.data.map(function(t){return{initialValue:t}}).getOr({})),{getValue:function(t){return Zi(t.element)},setValue:function(t,n){Zi(t.element)!==n&&tu(t.element,n)}}),onSetValue:e.onSetValue})])),eventOrder:t.eventOrder};var e}}),Jy={},$y={exports:Jy};xy=undefined,wy=Jy,Sy=$y,ky=undefined,function(t){"object"==typeof wy&&void 0!==Sy?Sy.exports=t():"function"==typeof xy&&xy.amd?xy([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=t()}(function(){return function l(i,u,a){function c(n,t){if(!u[n]){if(!i[n]){var e="function"==typeof ky&&ky;if(!t&&e)return e(n,!0);if(s)return s(n,!0);var o=new Error("Cannot find module '"+n+"'");throw o.code="MODULE_NOT_FOUND",o}var r=u[n]={exports:{}};i[n][0].call(r.exports,function(t){return c(i[n][1][t]||t)},r,r.exports,l,i,u,a)}return u[n].exports}for(var s="function"==typeof ky&&ky,t=0;t"},TS=function(o,t){return{uid:o.uid,dom:o.dom,components:t,behaviours:zl(o.formBehaviours,[Vl.config({store:{mode:"manual",getValue:function(t){var n=Df(t,o);return _t(n,function(t,r){return t().bind(function(t){var n,e,o=Kf.getCurrent(t);return n=o,e=new Error("Cannot find a current component to extract the value from for form part '"+r+"': "+jr(t.element)),n.fold(function(){return it.error(e)},it.value)}).map(Vl.getValue)})},setValue:function(e,t){Ot(t,function(n,t){Tf(e,o,t).each(function(t){Kf.getCurrent(t).each(function(t){Vl.setValue(t,n)})})})}}})]),apis:{getField:function(t,n){return Tf(t,o,n).bind(Kf.getCurrent)}}}},ES={getField:ai(function(t,n,e){return t.getField(n,e)}),sketch:function(t){var e,n=(e=[],{field:function(t,n){return e.push(t),Sf("form",_S(t),n)},record:function(){return e}}),o=t(n),r=n.record(),i=V(r,function(t){return mf({name:t,pname:_S(t)})});return Pf("form",OS,i,TS,o)}},BS=Xr("valid-input"),DS=Xr("invalid-input"),AS=Xr("validating-input"),MS="colorcustom.rgb.",FS=function(d,m,g,p){var h=function(t,n,e,o,r){var i,u,a=d(MS+"range"),c=[Ey.parts.label({dom:{tag:"label",innerHtml:e,attributes:{"aria-label":o}}}),Ey.parts.field({data:r,factory:Ky,inputAttributes:nt({type:"text"},"hex"===n?{"aria-live":"polite"}:{}),inputClasses:[m("textfield")],inputBehaviours:nc([(i=n,u=t,hx.config({invalidClass:m("invalid"),notify:{onValidate:function(t){Go(t,AS,{type:i})},onValid:function(t){Go(t,BS,{type:i,value:Vl.getValue(t)})},onInvalid:function(t){Go(t,DS,{type:i,value:Vl.getValue(t)})}},validator:{validate:function(t){var n=Vl.getValue(t),e=u(n)?it.value(!0):it.error(d("aria.input.invalid"));return ux(e)},validateOnLoad:!1}})),Ay.config({})]),onSetValue:function(t){hx.isInvalid(t)&&hx.run(t).get($)}})],s="hex"!==n?[Ey.parts["aria-descriptor"]({text:a})]:[];return{dom:{tag:"div",attributes:{role:"presentation"}},components:c.concat(s)}},v=function(t,n){var e=n.red,o=n.green,r=n.blue;Vl.setValue(t,{red:e,green:o,blue:r})},b=sp({dom:{tag:"div",classes:[m("rgba-preview")],styles:{"background-color":"white"},attributes:{role:"presentation"}}}),y=function(t,n){b.getOpt(t).each(function(t){Wi(t.element,"background-color","#"+n.value)})};return Uf({factory:function(){var e={red:se(st.some(255)),green:se(st.some(255)),blue:se(st.some(255)),hex:se(st.some("ffffff"))},o=function(t){return e[t].get()},i=function(t,n){e[t].set(n)},r=function(t){var n=t.red,e=t.green,o=t.blue;i("red",st.some(n)),i("green",st.some(e)),i("blue",st.some(o))},n=function(t,n){var e=n.event;"hex"!==e.type?i(e.type,st.none()):p(t)},u=function(r,t,n){var e=parseInt(n,10);i(t,st.some(e)),o("red").bind(function(e){return o("green").bind(function(n){return o("blue").map(function(t){return cb(e,n,t,1)})})}).each(function(t){var n,e,o=(n=r,e=eb(t),ES.getField(n,"hex").each(function(t){dg.isFocused(t)||Vl.setValue(n,{hex:e.value})}),e);y(r,o)})},a=function(t,n){var e=n.event;"hex"===e.type?function(t,n){g(t);var e=Jv(n);i("hex",st.some(n));var o=fb(e);v(t,o),r(o),Go(t,Lx,{hex:e}),y(t,e)}(t,e.value):u(t,e.type,e.value)},t=function(t){return{label:d(MS+t+".label"),description:d(MS+t+".description")}},c=t("red"),s=t("green"),l=t("blue"),f=t("hex");return Ht(ES.sketch(function(t){return{dom:{tag:"form",classes:[m("rgb-form")],attributes:{"aria-label":d("aria.color.picker")}},components:[t.field("red",Ey.sketch(h(sb,"red",c.label,c.description,255))),t.field("green",Ey.sketch(h(sb,"green",s.label,s.description,255))),t.field("blue",Ey.sketch(h(sb,"blue",l.label,l.description,255))),t.field("hex",Ey.sketch(h(Zv,"hex",f.label,f.description,"ffffff"))),b.asSpec()],formBehaviours:nc([hx.config({invalidClass:m("form-invalid")}),ag("rgb-form-events",[Zo(BS,a),Zo(DS,n),Zo(AS,n)])])}}),{apis:{updateHex:function(t,n){var e,o;Vl.setValue(t,{hex:n.value}),e=t,o=fb(n),v(e,o),r(o),y(t,n)}}})},name:"RgbForm",configFields:[],apis:{updateHex:function(t,n,e){t.updateHex(n,e)}},extraApis:{}})},IS=function(t,o){var r=CS.parts.spectrum({dom:{tag:"canvas",attributes:{role:"presentation"},classes:[o("sv-palette-spectrum")]}}),i=CS.parts.thumb({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette-thumb")],innerHtml:"'}}),u=function(t,n){var e,o,r=t.width,i=t.height,u=t.getContext("2d");null!==u&&(u.fillStyle=n,u.fillRect(0,0,r,i),(e=u.createLinearGradient(0,0,r,0)).addColorStop(0,"rgba(255,255,255,1)"),e.addColorStop(1,"rgba(255,255,255,0)"),u.fillStyle=e,u.fillRect(0,0,r,i),(o=u.createLinearGradient(0,0,0,i)).addColorStop(0,"rgba(0,0,0,0)"),o.addColorStop(1,"rgba(0,0,0,1)"),u.fillStyle=o,u.fillRect(0,0,r,i))};return Uf({factory:function(t){var n=at({x:0,y:0}),e=nc([Kf.config({find:st.some}),dg.config({})]);return CS.sketch({dom:{tag:"div",attributes:{role:"presentation"},classes:[o("sv-palette")]},model:{mode:"xy",getInitialValue:n},rounded:!1,components:[r,i],onChange:function(t,n,e){Go(t,Ux,{value:e})},onInit:function(t,n,e,o){u(e.element.dom,mb(gb))},sliderBehaviours:e})},name:"SaturationBrightnessPalette",configFields:[],apis:{setRgba:function(t,n,e){var o,r;o=e,r=n.components()[0].element.dom,u(r,mb(o))}},extraApis:{}})},RS=function(f,d){return Uf({name:"ColourPicker",configFields:[Nn("dom"),te("onValidHex",$),te("onInvalidHex",$)],factory:function(t){var a,v,n,e,o,r=FS(f,d,t.onValidHex,t.onInvalidHex),i=IS(0,d),b={paletteRgba:se(gb)},u=sp(i.sketch({})),c=sp(r.sketch({})),s=function(t,e){u.getOpt(t).each(function(t){var n=fb(e);b.paletteRgba.set(n),i.setRgba(t,n)})},l=function(t,n){c.getOpt(t).each(function(t){r.updateHex(t,n)})},y=function(n,e,t){ot(t,function(t){t(n,e)})};return{uid:t.uid,dom:t.dom,components:[u.asSpec(),(n=d,e=CS.parts.spectrum({dom:{tag:"div",classes:[n("hue-slider-spectrum")],attributes:{role:"presentation"}}}),o=CS.parts.thumb({dom:{tag:"div",classes:[n("hue-slider-thumb")],attributes:{role:"presentation"}}}),CS.sketch({dom:{tag:"div",classes:[n("hue-slider")],attributes:{role:"presentation"}},rounded:!1,model:{mode:"y",getInitialValue:at({y:0})},components:[e,o],sliderBehaviours:nc([dg.config({})]),onChange:function(t,n,e){Go(t,jx,{value:e})}})),c.asSpec()],behaviours:nc([ag("colour-picker-events",[Zo(Ux,(v=[l],function(t,n){var e,o,r,i,u,a,c,s,l,f=n.event.value,d=b.paletteRgba.get(),m=(i=r=0,u=(e=d).red/255,a=e.green/255,c=e.blue/255,s=Math.min(u,Math.min(a,c)),l=Math.max(u,Math.max(a,c)),s===l?Nx(0,0,100*(i=s)):(r=60*((r=u===s?3:c===s?1:5)-(u===s?a-c:c===s?u-a:c-u)/(l-s)),o=(l-s)/l,i=l,Nx(Math.round(r),Math.round(100*o),Math.round(100*i)))),g=Nx(m.hue,f.x,100-f.y),p=lb(g),h=eb(p);y(t,h,v)})),Zo(jx,(a=[s,l],function(t,n){var e,o,r,i=n.event.value,u=(e=i.y,o=Nx((100-e)/100*360,100,100),r=lb(o),eb(r));y(t,u,a)}))]),Kf.config({find:function(t){return c.getOpt(t)}}),ng.config({mode:"acyclic"})])}}})},VS=function(){return Kf.config({find:st.some})},PS=function(t){return Kf.config({find:t.getOpt})},HS=function(t){return Kf.config({find:function(n){return Cr(n.element,t).bind(function(t){return n.getSystem().getByDom(t).toOptional()})}})},zS={"colorcustom.rgb.red.label":"R","colorcustom.rgb.red.description":"Red component","colorcustom.rgb.green.label":"G","colorcustom.rgb.green.description":"Green component","colorcustom.rgb.blue.label":"B","colorcustom.rgb.blue.description":"Blue component","colorcustom.rgb.hex.label":"#","colorcustom.rgb.hex.description":"Hex color code","colorcustom.rgb.range":"Range 0 to 255","colorcustom.sb.saturation":"Saturation","colorcustom.sb.brightness":"Brightness","colorcustom.sb.picker":"Saturation and Brightness Picker","colorcustom.sb.palette":"Saturation and Brightness Palette","colorcustom.sb.instructions":"Use arrow keys to select saturation and brightness, on x and y axes","colorcustom.hue.hue":"Hue","colorcustom.hue.slider":"Hue Slider","colorcustom.hue.palette":"Hue Palette","colorcustom.hue.instructions":"Use arrow keys to select a hue","aria.color.picker":"Color Picker","aria.input.invalid":"Invalid input"},NS=function(t){return zS[t]},LS=tinymce.util.Tools.resolve("tinymce.Resource"),jS=ln([te("preprocess",ct),te("postprocess",ct)]),US=function(t,n,e){return Vl.config(Ht({store:{mode:"manual",getValue:n,setValue:e}},t.map(function(t){return{store:{initialValue:t}}}).getOr({})))},WS=function(t,n,e){return US(t,function(t){return n(t.element)},function(t,n){return e(t.element,n)})},GS=function(r,t){var i=Tn("RepresentingConfigs.memento processors",jS,t);return Vl.config({store:{mode:"manual",getValue:function(t){var n=r.get(t),e=Vl.getValue(n);return i.postprocess(e)},setValue:function(t,n){var e=i.preprocess(n),o=r.get(t);Vl.setValue(o,e)}}})},XS=US,YS=function(t){return WS(t,Fr,Ir)},qS=function(t){return Vl.config({store:{mode:"memory",initialValue:t}})},KS=function(r,n){var e=function(t,n){n.stop()},o=function(t){return function(n,e){ot(t,function(t){t(n,e)})}},i=function(t,n){var e;tv.isDisabled(t)||(e=n.event.raw,a(t,e.dataTransfer.files))},u=function(t,n){var e=n.event.raw.target;a(t,e.files)},a=function(t,n){var e,o;Vl.setValue(t,(e=n,o=new RegExp("("+".jpg,.jpeg,.png,.gif".split(/\s*,\s*/).join("|")+")$","i"),H(J(e),function(t){return o.test(t.name)}))),Go(t,Vy,{name:r.name})},c=sp({dom:{tag:"input",attributes:{type:"file",accept:"image/*"},styles:{display:"none"}},behaviours:nc([ag("input-file-events",[rr(go()),rr(Oo())])])}),t=r.label.map(function(t){return Ry(t,n)}),s=Ey.parts.field({factory:{sketch:function(t){return{uid:t.uid,dom:{tag:"div",classes:["tox-dropzone-container"]},behaviours:nc([qS([]),VS(),tv.config({}),Cg.config({toggleClass:"dragenter",toggleOnExecute:!1}),ag("dropzone-events",[Zo("dragenter",o([e,Cg.toggle])),Zo("dragleave",o([e,Cg.toggle])),Zo("dragover",e),Zo("drop",o([e,i])),Zo(mo(),u)])]),components:[{dom:{tag:"div",classes:["tox-dropzone"],styles:{}},components:[{dom:{tag:"p",innerHtml:n.translate("Drop an image here")}},cp.sketch({dom:{tag:"button",innerHtml:n.translate("Browse for an image"),styles:{position:"relative"},classes:["tox-button","tox-button--secondary"]},components:[c.asSpec()],action:function(t){c.get(t).element.dom.click()},buttonBehaviours:nc([Ay.config({}),Ev(n.isReadOnly),_v()])})]}]}}}});return My(t,s,["tox-form__group--stretched"],[])},JS=Xr("alloy-fake-before-tabstop"),$S=Xr("alloy-fake-after-tabstop"),QS=function(t){return{dom:{tag:"div",styles:{width:"1px",height:"1px",outline:"none"},attributes:{tabindex:"0"},classes:t},behaviours:nc([dg.config({ignore:!0}),Ay.config({})])}},ZS=function(t){return{dom:{tag:"div",classes:["tox-navobj"]},components:[QS([JS]),t,QS([$S])],behaviours:nc([HS(1)])}},tk=function(t,n){Go(t,so(),{raw:{which:9,shiftKey:n}})},nk=function(t,n){var e=n.element;Ei(e,JS)?tk(t,!0):Ei(e,$S)&&tk(t,!1)},ek=function(t){return oy(t,["."+JS,"."+$S].join(","),c)},ok=!(ze().browser.isIE()||ze().browser.isEdge()),rk=function(t,n){var o,r,e=ok&&t.sandboxed,i=nt(nt({},t.label.map(function(t){return{title:t}}).getOr({})),e?{sandbox:"allow-scripts allow-same-origin"}:{}),u=(o=e,r=se(""),{getValue:function(t){return r.get()},setValue:function(t,n){var e;o?Vr(t.element,"srcdoc",n):(Vr(t.element,"src","javascript:''"),(e=t.element.dom.contentWindow.document).open(),e.write(n),e.close()),r.set(n)}}),a=t.label.map(function(t){return Ry(t,n)}),c=Ey.parts.field({factory:{sketch:function(t){return ZS({uid:t.uid,dom:{tag:"iframe",attributes:i},behaviours:nc([Ay.config({}),dg.config({}),XS(st.none(),u.getValue,u.setValue)])})}}});return My(a,c,["tox-form__group--stretched"],[])};function ik(t,n){return ck(document.createElement("canvas"),t,n)}function uk(t){var n=ik(t.width,t.height);return ak(n).drawImage(t,0,0),n}function ak(t){return t.getContext("2d")}function ck(t,n,e){return t.width=n,t.height=e,t}function sk(t){return t.naturalWidth||t.width}function lk(t){return t.naturalHeight||t.height}var fk,dk,mk,gk,pk=window.Promise?window.Promise:(fk=function(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],Sk(t,hk(bk,this),hk(yk,this))},dk=window,mk=fk.immediateFn||"function"==typeof dk.setImmediate&&dk.setImmediate||function(t){setTimeout(t,1)},gk=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},fk.prototype["catch"]=function(t){return this.then(null,t)},fk.prototype.then=function(e,o){var r=this;return new fk(function(t,n){vk.call(r,new wk(e,o,t,n))})},fk.all=function(){for(var t=[],n=0;n").css({position:"absolute",top:0,left:0,width:f.width,height:f.height,zIndex:2147483647,opacity:1e-4,cursor:l}).appendTo(b.body),KC(b).on("mousemove touchmove",x).on("mouseup touchend",w),m.start(t)})}var nO=0,eO=function(s,e,l,o,r){var t,n="tox-",u="tox-crid-"+nO++,a=[{name:"move",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:0,deltaH:0,label:"Crop Mask"},{name:"nw",xMul:0,yMul:0,deltaX:1,deltaY:1,deltaW:-1,deltaH:-1,label:"Top Left Crop Handle"},{name:"ne",xMul:1,yMul:0,deltaX:0,deltaY:1,deltaW:1,deltaH:-1,label:"Top Right Crop Handle"},{name:"sw",xMul:0,yMul:1,deltaX:1,deltaY:0,deltaW:-1,deltaH:1,label:"Bottom Left Crop Handle"},{name:"se",xMul:1,yMul:1,deltaX:0,deltaY:0,deltaW:1,deltaH:1,label:"Bottom Right Crop Handle"}],i=["top","right","bottom","left"],c=function(t,n){return{x:n.x+t.x,y:n.y+t.y,w:n.w,h:n.h}},f=function(t,n){return{x:n.x-t.x,y:n.y-t.y,w:n.w,h:n.h}};function d(t,n,e,o){var r,i=n.x,u=n.y,a=n.w,c=n.h;i+=e*t.deltaX,u+=o*t.deltaY,(a+=e*t.deltaW)<20&&(a=20),(c+=o*t.deltaH)<20&&(c=20),r=s=qC.clamp({x:i,y:u,w:a,h:c},l,"move"===t.name),r=f(l,r),h.fire("updateRect",{rect:r}),p(r)}function m(n){function t(t,n){n.h<0&&(n.h=0),n.w<0&&(n.w=0),KC("#"+u+"-"+t,o).css({left:n.x,top:n.y,width:n.w,height:n.h})}$C.each(a,function(t){KC("#"+u+"-"+t.name,o).css({left:n.w*t.xMul+n.x,top:n.h*t.yMul+n.y})}),t("top",{x:e.x,y:e.y,w:e.w,h:n.y-e.y}),t("right",{x:n.x+n.w,y:n.y,w:e.w-n.x-n.w+e.x,h:n.h}),t("bottom",{x:e.x,y:n.y+n.h,w:e.w,h:e.h-n.y-n.h+e.y}),t("left",{x:e.x,y:n.y,w:n.x-e.x,h:n.h}),t("move",n)}function g(t){m(s=t)}function p(t){g(c(l,t))}KC('
    ').appendTo(o),$C.each(i,function(t){KC("#"+u,o).append('"},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var r=e.getEl("text");r&&r.setAttribute("style",n)}return e.on("mouseenter click",function(n){n.control===e&&(t.menu||"click"!==n.type?(e.showMenu(),n.aria&&e.menu.focus(!0)):(e.fire("select"),e.parent().hideAll()))}),e._super(),e},active:function(e){return"undefined"!=typeof e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(Ut,[J,Vt,f],function(e,t,n){var r=e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){var t=this;if(e.autohide=!0,e.constrainToViewport=!0,e.itemDefaults)for(var r=e.items,i=r.length;i--;)r[i]=n.extend({},e.itemDefaults,r[i]);t._super(e),t.addClass("menu")},repaint:function(){return this.toggleClass("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var e=this;e.hideAll(),e.fire("select")},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;return n.icon||n.selectable?(e._hasIcons=!0,!1):void 0}),e._super()}});return r}),r(qt,[xt],function(e){return e.extend({Defaults:{classes:"radio",role:"radio"}})}),r(jt,[yt,$],function(e,t){return e.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.addClass("resizehandle"),"both"==e.settings.direction&&e.addClass("resizehandle-both"),e.canFocus=!1,'
    '},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!=e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},stop:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),r($t,[yt],function(e){return e.extend({renderHtml:function(){var e=this;return e.addClass("spacer"),e.canFocus=!1,'
    '}})}),r(Kt,[zt,W],function(e,t){return e.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e=this,n=e.getEl(),r=e.layoutRect(),i,o;return e._super(),i=n.firstChild,o=n.lastChild,t.css(i,{width:r.w-t.getSize(o).width,height:r.h-2}),t.css(o,{height:r.h-2}),e},activeMenu:function(e){var n=this;t.toggleClass(n.getEl().lastChild,n.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"";return'
    '},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(e){var n=e.target;if(e.control==this)for(;n;){if(e.aria&&"down"!=e.aria.key||"BUTTON"==n.nodeName&&-1==n.className.indexOf("open"))return e.stopImmediatePropagation(),void t.call(this,e);n=n.parentNode}}),delete e.settings.onclick,e._super()}})}),r(Yt,[Dt],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"}})}),r(Gt,[Y,W],function(e,t){return e.extend({lastIdx:0,Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){var n;this.activeTabId&&(n=this.getEl(this.activeTabId),t.removeClass(n,this.classPrefix+"active"),n.setAttribute("aria-selected","false")),this.activeTabId="t"+e,n=this.getEl("t"+e),n.setAttribute("aria-selected","true"),t.addClass(n,this.classPrefix+"active"),e!=this.lastIdx&&(this.items()[this.lastIdx].hide(),this.lastIdx=e),this.items()[e].show().fire("showtab"),this.reflow()},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){var o=e._id+"-t"+i;t.aria("role","tabpanel"),t.aria("labelledby",o),n+='"}),'
    '+n+'
    '+t.renderHtml(e)+"
    "},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]==t.target&&e.activateTab(r)})},initLayoutRect:function(){var e=this,n,r,i;r=t.getSize(e.getEl("head")).width,r=0>r?0:r,i=0,e.items().each(function(t,n){r=Math.max(r,t.layoutRect().minW),i=Math.max(i,t.layoutRect().minH),e.settings.activeTab!=n&&t.hide()}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=r,e.settings.h=i,e.layoutRect({x:0,y:0,w:r,h:i})});var o=t.getSize(e.getEl("head")).height;return e.settings.minWidth=r,e.settings.minHeight=i+o,n=e._super(),n.deltaH+=o,n.innerH=n.h-n.deltaH,n}})}),r(Xt,[yt,W],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t._value=e.value||"",t.addClass("textbox"),e.multiline?t.addClass("multiline"):t.on("keydown",function(e){13==e.keyCode&&t.parents().reverse().each(function(t){return e.preventDefault(),t.hasEventListeners("submit")&&t.toJSON?(t.fire("submit",{data:t.toJSON()}),!1):void 0 -})})},disabled:function(e){var t=this;return t._rendered&&"undefined"!=typeof e&&(t.getEl().disabled=e),t._super(e)},value:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t._rendered&&(t.getEl().value=e),t):t._rendered?t.getEl().value:t._value},repaint:function(){var e=this,t,n,r,i=0,o=0,a;t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{};var s=document;return!e.settings.multiline&&s.all&&(!s.documentMode||s.documentMode<=8)&&(t.lineHeight=n.h-o+"px"),r=e._borderBox,i=r.left+r.right+8,o=r.top+r.bottom+(e.settings.multiline?8:0),n.x!==a.x&&(t.left=n.x+"px",a.x=n.x),n.y!==a.y&&(t.top=n.y+"px",a.y=n.y),n.w!==a.w&&(t.width=n.w-i+"px",a.w=n.w),n.h!==a.h&&(t.height=n.h-o+"px",a.h=n.h),e._lastRepaintRect=a,e.fire("repaint",{},!1),e},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.encode(e._value,!1),i="";return"spellcheck"in n&&(i+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(i+=' maxlength="'+n.maxLength+'"'),n.size&&(i+=' size="'+n.size+'"'),n.subtype&&(i+=' type="'+n.subtype+'"'),e.disabled()&&(i+=' disabled="disabled"'),n.multiline?'":'"},postRender:function(){var e=this;return t.on(e.getEl(),"change",function(t){e.fire("change",t)}),e._super()},remove:function(){t.off(this.getEl()),this._super()}})}),r(Jt,[W],function(e){return function(t){var n=this,r;n.show=function(i){return n.hide(),r=!0,window.setTimeout(function(){r&&t.appendChild(e.createFragment('
    '))},i||0),n},n.hide=function(){var e=t.lastChild;return e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),r=!1,n}}}),a([l,c,d,u,f,p,m,h,g,v,y,b,C,x,w,_,N,E,k,S,T,R,A,B,L,D,M,H,P,O,I,F,z,W,V,U,q,j,$,K,Y,G,X,J,Q,Z,et,tt,nt,rt,it,ot,at,st,lt,ct,dt,ut,ft,pt,mt,ht,gt,vt,yt,bt,Ct,xt,wt,_t,Nt,Et,kt,St,Tt,Rt,At,Bt,Lt,Dt,Mt,Ht,Pt,Ot,It,Ft,zt,Wt,Vt,Ut,qt,jt,$t,Kt,Yt,Gt,Xt,Jt])}(this); \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/tinymce.js b/common/static/js/vendor/tinymce/js/tinymce/tinymce.js old mode 100755 new mode 100644 index d92519170bc4..4b6edd3285ed --- a/common/static/js/vendor/tinymce/js/tinymce/tinymce.js +++ b/common/static/js/vendor/tinymce/js/tinymce/tinymce.js @@ -1,34814 +1,29448 @@ -// 4.0.20 (2014-03-18) - -/** - * Compiled inline version. (Library mode) - */ - -/*jshint smarttabs:true, undef:true, latedef:true, curly:true, bitwise:true, camelcase:true */ -/*globals $code */ - -(function(exports, undefined) { - "use strict"; - - var modules = {}; - - function require(ids, callback) { - var module, defs = []; - - for (var i = 0; i < ids.length; ++i) { - module = modules[ids[i]] || resolve(ids[i]); - if (!module) { - throw 'module definition dependecy not found: ' + ids[i]; - } - - defs.push(module); - } - - callback.apply(null, defs); - } - - function define(id, dependencies, definition) { - if (typeof id !== 'string') { - throw 'invalid module definition, module id must be defined and be a string'; - } - - if (dependencies === undefined) { - throw 'invalid module definition, dependencies must be specified'; - } - - if (definition === undefined) { - throw 'invalid module definition, definition function must be specified'; - } - - require(dependencies, function() { - modules[id] = definition.apply(null, arguments); - }); - } - - function defined(id) { - return !!modules[id]; - } - - function resolve(id) { - var target = exports; - var fragments = id.split(/[.\/]/); - - for (var fi = 0; fi < fragments.length; ++fi) { - if (!target[fragments[fi]]) { - return; - } - - target = target[fragments[fi]]; - } - - return target; - } - - function expose(ids) { - for (var i = 0; i < ids.length; i++) { - var target = exports; - var id = ids[i]; - var fragments = id.split(/[.\/]/); - - for (var fi = 0; fi < fragments.length - 1; ++fi) { - if (target[fragments[fi]] === undefined) { - target[fragments[fi]] = {}; - } - - target = target[fragments[fi]]; - } - - target[fragments[fragments.length - 1]] = modules[id]; - } - } - -// Included from: js/tinymce/classes/dom/EventUtils.js - -/** - * EventUtils.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*jshint loopfunc:true*/ -/*eslint no-loop-func:0 */ - -define("tinymce/dom/EventUtils", [], function() { - "use strict"; - - var eventExpandoPrefix = "mce-data-"; - var mouseEventRe = /^(?:mouse|contextmenu)|click/; - var deprecated = {keyLocation: 1, layerX: 1, layerY: 1, returnValue: 1}; - - /** - * Binds a native event to a callback on the speified target. - */ - function addEvent(target, name, callback, capture) { - if (target.addEventListener) { - target.addEventListener(name, callback, capture || false); - } else if (target.attachEvent) { - target.attachEvent('on' + name, callback); - } - } - - /** - * Unbinds a native event callback on the specified target. - */ - function removeEvent(target, name, callback, capture) { - if (target.removeEventListener) { - target.removeEventListener(name, callback, capture || false); - } else if (target.detachEvent) { - target.detachEvent('on' + name, callback); - } - } - - /** - * Normalizes a native event object or just adds the event specific methods on a custom event. - */ - function fix(originalEvent, data) { - var name, event = data || {}, undef; - - // Dummy function that gets replaced on the delegation state functions - function returnFalse() { - return false; - } - - // Dummy function that gets replaced on the delegation state functions - function returnTrue() { - return true; - } - - // Copy all properties from the original event - for (name in originalEvent) { - // layerX/layerY is deprecated in Chrome and produces a warning - if (!deprecated[name]) { - event[name] = originalEvent[name]; - } - } - - // Normalize target IE uses srcElement - if (!event.target) { - event.target = event.srcElement || document; - } - - // Calculate pageX/Y if missing and clientX/Y available - if (originalEvent && mouseEventRe.test(originalEvent.type) && originalEvent.pageX === undef && originalEvent.clientX !== undef) { - var eventDoc = event.target.ownerDocument || document; - var doc = eventDoc.documentElement; - var body = eventDoc.body; - - event.pageX = originalEvent.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - - ( doc && doc.clientLeft || body && body.clientLeft || 0); - - event.pageY = originalEvent.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0 ) - - ( doc && doc.clientTop || body && body.clientTop || 0); - } - - // Add preventDefault method - event.preventDefault = function() { - event.isDefaultPrevented = returnTrue; - - // Execute preventDefault on the original event object - if (originalEvent) { - if (originalEvent.preventDefault) { - originalEvent.preventDefault(); - } else { - originalEvent.returnValue = false; // IE - } - } - }; - - // Add stopPropagation - event.stopPropagation = function() { - event.isPropagationStopped = returnTrue; - - // Execute stopPropagation on the original event object - if (originalEvent) { - if (originalEvent.stopPropagation) { - originalEvent.stopPropagation(); - } else { - originalEvent.cancelBubble = true; // IE - } - } - }; - - // Add stopImmediatePropagation - event.stopImmediatePropagation = function() { - event.isImmediatePropagationStopped = returnTrue; - event.stopPropagation(); - }; - - // Add event delegation states - if (!event.isDefaultPrevented) { - event.isDefaultPrevented = returnFalse; - event.isPropagationStopped = returnFalse; - event.isImmediatePropagationStopped = returnFalse; - } - - return event; - } - - /** - * Bind a DOMContentLoaded event across browsers and executes the callback once the page DOM is initialized. - * It will also set/check the domLoaded state of the event_utils instance so ready isn't called multiple times. - */ - function bindOnReady(win, callback, eventUtils) { - var doc = win.document, event = {type: 'ready'}; - - if (eventUtils.domLoaded) { - callback(event); - return; - } - - // Gets called when the DOM is ready - function readyHandler() { - if (!eventUtils.domLoaded) { - eventUtils.domLoaded = true; - callback(event); - } - } - - function waitForDomLoaded() { - // Check complete or interactive state if there is a body - // element on some iframes IE 8 will produce a null body - if (doc.readyState === "complete" || (doc.readyState === "interactive" && doc.body)) { - removeEvent(doc, "readystatechange", waitForDomLoaded); - readyHandler(); - } - } - - function tryScroll() { - try { - // If IE is used, use the trick by Diego Perini licensed under MIT by request to the author. - // http://javascript.nwbox.com/IEContentLoaded/ - doc.documentElement.doScroll("left"); - } catch (ex) { - setTimeout(tryScroll, 0); - return; - } - - readyHandler(); - } - - // Use W3C method - if (doc.addEventListener) { - if (doc.readyState === "complete") { - readyHandler(); - } else { - addEvent(win, 'DOMContentLoaded', readyHandler); - } - } else { - // Use IE method - addEvent(doc, "readystatechange", waitForDomLoaded); - - // Wait until we can scroll, when we can the DOM is initialized - if (doc.documentElement.doScroll && win.self === win.top) { - tryScroll(); - } - } - - // Fallback if any of the above methods should fail for some odd reason - addEvent(win, 'load', readyHandler); - } - - /** - * This class enables you to bind/unbind native events to elements and normalize it's behavior across browsers. - */ - function EventUtils() { - var self = this, events = {}, count, expando, hasFocusIn, hasMouseEnterLeave, mouseEnterLeave; - - expando = eventExpandoPrefix + (+new Date()).toString(32); - hasMouseEnterLeave = "onmouseenter" in document.documentElement; - hasFocusIn = "onfocusin" in document.documentElement; - mouseEnterLeave = {mouseenter: 'mouseover', mouseleave: 'mouseout'}; - count = 1; - - // State if the DOMContentLoaded was executed or not - self.domLoaded = false; - self.events = events; - - /** - * Executes all event handler callbacks for a specific event. - * - * @private - * @param {Event} evt Event object. - * @param {String} id Expando id value to look for. - */ - function executeHandlers(evt, id) { - var callbackList, i, l, callback, container = events[id]; - - callbackList = container && container[evt.type]; - if (callbackList) { - for (i = 0, l = callbackList.length; i < l; i++) { - callback = callbackList[i]; - - // Check if callback exists might be removed if a unbind is called inside the callback - if (callback && callback.func.call(callback.scope, evt) === false) { - evt.preventDefault(); - } - - // Should we stop propagation to immediate listeners - if (evt.isImmediatePropagationStopped()) { - return; - } - } - } - } - - /** - * Binds a callback to an event on the specified target. - * - * @method bind - * @param {Object} target Target node/window or custom object. - * @param {String} names Name of the event to bind. - * @param {function} callback Callback function to execute when the event occurs. - * @param {Object} scope Scope to call the callback function on, defaults to target. - * @return {function} Callback function that got bound. - */ - self.bind = function(target, names, callback, scope) { - var id, callbackList, i, name, fakeName, nativeHandler, capture, win = window; - - // Native event handler function patches the event and executes the callbacks for the expando - function defaultNativeHandler(evt) { - executeHandlers(fix(evt || win.event), id); - } - - // Don't bind to text nodes or comments - if (!target || target.nodeType === 3 || target.nodeType === 8) { - return; - } - - // Create or get events id for the target - if (!target[expando]) { - id = count++; - target[expando] = id; - events[id] = {}; - } else { - id = target[expando]; - } - - // Setup the specified scope or use the target as a default - scope = scope || target; - - // Split names and bind each event, enables you to bind multiple events with one call - names = names.split(' '); - i = names.length; - while (i--) { - name = names[i]; - nativeHandler = defaultNativeHandler; - fakeName = capture = false; - - // Use ready instead of DOMContentLoaded - if (name === "DOMContentLoaded") { - name = "ready"; - } - - // DOM is already ready - if (self.domLoaded && name === "ready" && target.readyState == 'complete') { - callback.call(scope, fix({type: name})); - continue; - } - - // Handle mouseenter/mouseleaver - if (!hasMouseEnterLeave) { - fakeName = mouseEnterLeave[name]; - - if (fakeName) { - nativeHandler = function(evt) { - var current, related; - - current = evt.currentTarget; - related = evt.relatedTarget; - - // Check if related is inside the current target if it's not then the event should - // be ignored since it's a mouseover/mouseout inside the element - if (related && current.contains) { - // Use contains for performance - related = current.contains(related); - } else { - while (related && related !== current) { - related = related.parentNode; - } - } - - // Fire fake event - if (!related) { - evt = fix(evt || win.event); - evt.type = evt.type === 'mouseout' ? 'mouseleave' : 'mouseenter'; - evt.target = current; - executeHandlers(evt, id); - } - }; - } - } - - // Fake bubbeling of focusin/focusout - if (!hasFocusIn && (name === "focusin" || name === "focusout")) { - capture = true; - fakeName = name === "focusin" ? "focus" : "blur"; - nativeHandler = function(evt) { - evt = fix(evt || win.event); - evt.type = evt.type === 'focus' ? 'focusin' : 'focusout'; - executeHandlers(evt, id); - }; - } - - // Setup callback list and bind native event - callbackList = events[id][name]; - if (!callbackList) { - events[id][name] = callbackList = [{func: callback, scope: scope}]; - callbackList.fakeName = fakeName; - callbackList.capture = capture; - - // Add the nativeHandler to the callback list so that we can later unbind it - callbackList.nativeHandler = nativeHandler; - - // Check if the target has native events support - - if (name === "ready") { - bindOnReady(target, nativeHandler, self); - } else { - addEvent(target, fakeName || name, nativeHandler, capture); - } - } else { - if (name === "ready" && self.domLoaded) { - callback({type: name}); - } else { - // If it already has an native handler then just push the callback - callbackList.push({func: callback, scope: scope}); - } - } - } - - target = callbackList = 0; // Clean memory for IE - - return callback; - }; - - /** - * Unbinds the specified event by name, name and callback or all events on the target. - * - * @method unbind - * @param {Object} target Target node/window or custom object. - * @param {String} names Optional event name to unbind. - * @param {function} callback Optional callback function to unbind. - * @return {EventUtils} Event utils instance. - */ - self.unbind = function(target, names, callback) { - var id, callbackList, i, ci, name, eventMap; - - // Don't bind to text nodes or comments - if (!target || target.nodeType === 3 || target.nodeType === 8) { - return self; - } - - // Unbind event or events if the target has the expando - id = target[expando]; - if (id) { - eventMap = events[id]; - - // Specific callback - if (names) { - names = names.split(' '); - i = names.length; - while (i--) { - name = names[i]; - callbackList = eventMap[name]; - - // Unbind the event if it exists in the map - if (callbackList) { - // Remove specified callback - if (callback) { - ci = callbackList.length; - while (ci--) { - if (callbackList[ci].func === callback) { - var nativeHandler = callbackList.nativeHandler; - var fakeName = callbackList.fakeName, capture = callbackList.capture; - - // Clone callbackList since unbind inside a callback would otherwise break the handlers loop - callbackList = callbackList.slice(0, ci).concat(callbackList.slice(ci + 1)); - callbackList.nativeHandler = nativeHandler; - callbackList.fakeName = fakeName; - callbackList.capture = capture; - - eventMap[name] = callbackList; - } - } - } - - // Remove all callbacks if there isn't a specified callback or there is no callbacks left - if (!callback || callbackList.length === 0) { - delete eventMap[name]; - removeEvent(target, callbackList.fakeName || name, callbackList.nativeHandler, callbackList.capture); - } - } - } - } else { - // All events for a specific element - for (name in eventMap) { - callbackList = eventMap[name]; - removeEvent(target, callbackList.fakeName || name, callbackList.nativeHandler, callbackList.capture); - } - - eventMap = {}; - } - - // Check if object is empty, if it isn't then we won't remove the expando map - for (name in eventMap) { - return self; - } - - // Delete event object - delete events[id]; - - // Remove expando from target - try { - // IE will fail here since it can't delete properties from window - delete target[expando]; - } catch (ex) { - // IE will set it to null - target[expando] = null; - } - } - - return self; - }; - - /** - * Fires the specified event on the specified target. - * - * @method fire - * @param {Object} target Target node/window or custom object. - * @param {String} name Event name to fire. - * @param {Object} args Optional arguments to send to the observers. - * @return {EventUtils} Event utils instance. - */ - self.fire = function(target, name, args) { - var id; - - // Don't bind to text nodes or comments - if (!target || target.nodeType === 3 || target.nodeType === 8) { - return self; - } - - // Build event object by patching the args - args = fix(null, args); - args.type = name; - args.target = target; - - do { - // Found an expando that means there is listeners to execute - id = target[expando]; - if (id) { - executeHandlers(args, id); - } - - // Walk up the DOM - target = target.parentNode || target.ownerDocument || target.defaultView || target.parentWindow; - } while (target && !args.isPropagationStopped()); - - return self; - }; - - /** - * Removes all bound event listeners for the specified target. This will also remove any bound - * listeners to child nodes within that target. - * - * @method clean - * @param {Object} target Target node/window object. - * @return {EventUtils} Event utils instance. - */ - self.clean = function(target) { - var i, children, unbind = self.unbind; - - // Don't bind to text nodes or comments - if (!target || target.nodeType === 3 || target.nodeType === 8) { - return self; - } - - // Unbind any element on the specificed target - if (target[expando]) { - unbind(target); - } - - // Target doesn't have getElementsByTagName it's probably a window object then use it's document to find the children - if (!target.getElementsByTagName) { - target = target.document; - } - - // Remove events from each child element - if (target && target.getElementsByTagName) { - unbind(target); - - children = target.getElementsByTagName('*'); - i = children.length; - while (i--) { - target = children[i]; - - if (target[expando]) { - unbind(target); - } - } - } - - return self; - }; - - /** - * Destroys the event object. Call this on IE to remove memory leaks. - */ - self.destroy = function() { - events = {}; - }; - - // Legacy function for canceling events - self.cancel = function(e) { - if (e) { - e.preventDefault(); - e.stopImmediatePropagation(); - } - - return false; - }; - } - - EventUtils.Event = new EventUtils(); - EventUtils.Event.bind(window, 'ready', function() {}); - - return EventUtils; -}); - -// Included from: js/tinymce/classes/dom/Sizzle.js - -/** - * Sizzle.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - * - * @ignore-file - */ - -/*jshint bitwise:false, expr:true, noempty:false, sub:true, eqnull:true, latedef:false, maxlen:255 */ -/*eslint dot-notation:0, no-empty:0, no-cond-assign:0, no-unused-expressions:0, new-cap:0, no-nested-ternary:0, func-style:0, no-bitwise: 0 */ - -/* - * Sizzle CSS Selector Engine - * Copyright, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -define("tinymce/dom/Sizzle", [], function() { -var i, - cachedruns, - Expr, - getText, - isXML, - compile, - outermostContext, - recompare, - sortInput, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + -(new Date()), - preferredDoc = window.document, - support = {}, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - hasDuplicate = false, - sortOrder = function() { return 0; }, - - // General-purpose constants - strundefined = typeof undefined, - MAX_NEGATIVE = 1 << 31, - - // Array methods - arr = [], - pop = arr.pop, - push_native = arr.push, - push = arr.push, - slice = arr.slice, - // Use a stripped-down indexOf if we can't use a native one - indexOf = arr.indexOf || function( elem ) { - var i = 0, - len = this.length; - for ( ; i < len; i++ ) { - if ( this[i] === elem ) { - return i; - } - } - return -1; - }, - - - // Regular expressions - - // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - // http://www.w3.org/TR/css3-syntax/#characters - characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", - - // Loosely modeled on CSS identifier characters - // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors - // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = characterEncoding.replace( "w", "w#" ), - - // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors - operators = "([*^$|!~]?=)", - attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + - "*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", - - // Prefer arguments quoted, - // then not containing pseudos/brackets, - // then attribute selectors/non-parenthetical expressions, - // then anything else - // These preferences are here to reduce the number of selectors - // needing tokenize in the PSEUDO preFilter - pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", - - // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), - - rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ), - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "ID": new RegExp( "^#(" + characterEncoding + ")" ), - "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), - "NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ), - "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + - "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + - "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - // For use in libraries implementing .is() - // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + - whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) - }, - - rsibling = /[\x20\t\r\n\f]*[+~]/, - - rnative = /^[^{]+\{\s*\[native code/, - - // Easily-parseable/retrievable ID or TAG or CLASS selectors - rquickExpr = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/, - - rinputs = /^(?:input|select|textarea|button)$/i, - rheader = /^h\d$/i, - - rescape = /'|\\/g, - rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, - - // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g, - funescape = function( _, escaped ) { - var high = "0x" + escaped - 0x10000; - // NaN means non-codepoint - return high !== high ? - escaped : - // BMP codepoint - high < 0 ? - String.fromCharCode( high + 0x10000 ) : - // Supplemental Plane codepoint (surrogate pair) - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); - }; - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - (arr = slice.call( preferredDoc.childNodes )), - preferredDoc.childNodes - ); - // Support: Android<4.0 - // Detect silently failing push.apply - arr[ preferredDoc.childNodes.length ].nodeType; -} catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - push_native.apply( target, slice.call(els) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - // Can't trust NodeList.length - while ( (target[j++] = els[i++]) ) {} - target.length = j - 1; - } - }; -} - -/** - * For feature detection - * @param {Function} fn The function to test for native support - */ -function isNative( fn ) { - return rnative.test( fn + "" ); -} - -/** - * Create key-value caches of limited size - * @returns {Function(string, Object)} Returns the Object data after storing it on itself with - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var cache, - keys = []; - - cache = function( key, value ) { - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key += " " ) > Expr.cacheLength ) { - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - cache[ key ] = value; - return value; - }; - - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created div and expects a boolean result - */ -function assert( fn ) { - var div = document.createElement("div"); - - try { - return !!fn( div ); - } catch (e) { - return false; - } finally { - // release memory in IE - div = null; - } -} - -function Sizzle( selector, context, results, seed ) { - var match, elem, m, nodeType, - // QSA vars - i, groups, old, nid, newContext, newSelector; - - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } - - context = context || document; - results = results || []; - - if ( !selector || typeof selector !== "string" ) { - return results; - } - - if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { - return []; - } - - if ( documentIsHTML && !seed ) { - - // Shortcuts - if ( (match = rquickExpr.exec( selector )) ) { - // Speed-up: Sizzle("#ID") - if ( (m = match[1]) ) { - if ( nodeType === 9 ) { - elem = context.getElementById( m ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - // Handle the case where IE, Opera, and Webkit return items - // by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - } else { - // Context is not a document - if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && - contains( context, elem ) && elem.id === m ) { - results.push( elem ); - return results; - } - } - - // Speed-up: Sizzle("TAG") - } else if ( match[2] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Speed-up: Sizzle(".CLASS") - } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // QSA path - if ( support.qsa && !rbuggyQSA.test(selector) ) { - old = true; - nid = expando; - newContext = context; - newSelector = nodeType === 9 && selector; - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - groups = tokenize( selector ); - - if ( (old = context.getAttribute("id")) ) { - nid = old.replace( rescape, "\\$&" ); - } else { - context.setAttribute( "id", nid ); - } - nid = "[id='" + nid + "'] "; - - i = groups.length; - while ( i-- ) { - groups[i] = nid + toSelector( groups[i] ); - } - newContext = rsibling.test( selector ) && context.parentNode || context; - newSelector = groups.join(","); - } - - if ( newSelector ) { - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch(qsaError) { - } finally { - if ( !old ) { - context.removeAttribute("id"); - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); -} - -/** - * Detect xml - * @param {Element|Object} elem An element or a document - */ -isXML = Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = elem && (elem.ownerDocument || elem).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - -/** - * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var doc = node ? node.ownerDocument || node : preferredDoc; - - // If no document and documentElement is available, return - if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Set our document - document = doc; - docElem = doc.documentElement; - - // Support tests - documentIsHTML = !isXML( doc ); - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert(function( div ) { - div.appendChild( doc.createComment("") ); - return !div.getElementsByTagName("*").length; - }); - - // Check if attributes should be retrieved by attribute nodes - support.attributes = assert(function( div ) { - div.innerHTML = ""; - var type = typeof div.lastChild.getAttribute("multiple"); - // IE8 returns a string for some attributes even when not present - return type !== "boolean" && type !== "string"; - }); - - // Check if getElementsByClassName can be trusted - support.getElementsByClassName = assert(function( div ) { - // Opera can't find a second classname (in 9.6) - div.innerHTML = ""; - if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) { - return false; - } - - // Safari 3.2 caches class attributes and doesn't catch changes - div.lastChild.className = "e"; - return div.getElementsByClassName("e").length === 2; - }); - - // Check if getElementsByName privileges form controls or returns elements by ID - // If so, assume (for broader support) that getElementById returns elements by name - support.getByName = assert(function( div ) { - // Inject content - div.id = expando + 0; - // Support: Windows 8 Native Apps - // Assigning innerHTML with "name" attributes throws uncatchable exceptions - // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx - div.appendChild( document.createElement("a") ).setAttribute( "name", expando ); - div.appendChild( document.createElement("i") ).setAttribute( "name", expando ); - docElem.appendChild( div ); - - // Test - var pass = doc.getElementsByName && - // buggy browsers will return fewer than the correct 2 - doc.getElementsByName( expando ).length === 2 + - // buggy browsers will return more than the correct 0 - doc.getElementsByName( expando + 0 ).length; - - // Cleanup - docElem.removeChild( div ); - - return pass; - }); - - // Support: Webkit<537.32 - // Detached nodes confoundingly follow *each other* - support.sortDetached = assert(function( div1 ) { - return div1.compareDocumentPosition && - // Should return 1, but Webkit returns 4 (following) - (div1.compareDocumentPosition( document.createElement("div") ) & 1); - }); - - // IE6/7 return modified attributes - Expr.attrHandle = assert(function( div ) { - div.innerHTML = ""; - return div.firstChild && typeof div.firstChild.getAttribute !== strundefined && - div.firstChild.getAttribute("href") === "#"; - }) ? - {} : - { - "href": function( elem ) { - return elem.getAttribute( "href", 2 ); - }, - "type": function( elem ) { - return elem.getAttribute("type"); - } - }; - - // ID find and filter - if ( support.getByName ) { - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== strundefined && documentIsHTML ) { - var m = context.getElementById( id ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [m] : []; - } - }; - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute("id") === attrId; - }; - }; - } else { - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== strundefined && documentIsHTML ) { - var m = context.getElementById( id ); - - return m ? - m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ? - [m] : - undefined : - []; - } - }; - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); - return node && node.value === attrId; - }; - }; - } - - // Tag - Expr.find["TAG"] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== strundefined ) { - return context.getElementsByTagName( tag ); - } - } : - function( tag, context ) { - var elem, - tmp = [], - i = 0, - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( (elem = results[i++]) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; - - // Name - Expr.find["NAME"] = support.getByName && function( tag, context ) { - if ( typeof context.getElementsByName !== strundefined ) { - return context.getElementsByName( name ); - } - }; - - // Class - Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - // QSA and matchesSelector support - - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21), - // no need to also add to buggyMatches since matches checks buggyQSA - // A support test would require too much code (would include document ready) - rbuggyQSA = [ ":focus" ]; - - if ( (support.qsa = isNative(doc.querySelectorAll)) ) { - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert(function( div ) { - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // http://bugs.jquery.com/ticket/12359 - div.innerHTML = ""; - - // IE8 - Some boolean attributes are not treated correctly - if ( !div.querySelectorAll("[selected]").length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" ); - } - - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":checked").length ) { - rbuggyQSA.push(":checked"); - } - }); - - assert(function( div ) { - - // Opera 10-12/IE8 - ^= $= *= and empty values - // Should not select anything - div.innerHTML = ""; - if ( div.querySelectorAll("[i^='']").length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" ); - } - - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":enabled").length ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } - - // Opera 10-11 does not throw on post-comma invalid pseudos - div.querySelectorAll("*,:x"); - rbuggyQSA.push(",.*:"); - }); - } - - if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector || - docElem.mozMatchesSelector || - docElem.webkitMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector) )) ) { - - assert(function( div ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( div, "div" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( div, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - }); - } - - rbuggyQSA = new RegExp( rbuggyQSA.join("|") ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); - - // Element contains another - // Purposefully does not implement inclusive descendant - // As in, an element does not contain itself - contains = isNative(docElem.contains) || docElem.compareDocumentPosition ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - )); - } : - function( a, b ) { - if ( b ) { - while ( (b = b.parentNode) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; - - // Document order sorting - sortOrder = docElem.compareDocumentPosition ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b ); - - if ( compare ) { - // Disconnected nodes - if ( compare & 1 || - (recompare && b.compareDocumentPosition( a ) === compare) ) { - - // Choose the first element that is related to our preferred document - if ( a === doc || contains(preferredDoc, a) ) { - return -1; - } - if ( b === doc || contains(preferredDoc, b) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : - 0; - } - - return compare & 4 ? -1 : 1; - } - - // Not directly comparable, sort on existence of method - return a.compareDocumentPosition ? -1 : 1; - } : - function( a, b ) { - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - - // Parentless nodes are either documents or disconnected - } else if ( !aup || !bup ) { - return a === doc ? -1 : - b === doc ? 1 : - aup ? -1 : - bup ? 1 : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( (cur = cur.parentNode) ) { - ap.unshift( cur ); - } - cur = b; - while ( (cur = cur.parentNode) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[i] === bp[i] ) { - i++; - } - - return i ? - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[i], bp[i] ) : - - // Otherwise nodes in our document sort first - ap[i] === preferredDoc ? -1 : - bp[i] === preferredDoc ? 1 : - 0; - }; - - return document; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -Sizzle.matchesSelector = function( elem, expr ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - // Make sure that attribute selectors are quoted - expr = expr.replace( rattributeQuotes, "='$1']" ); - - // rbuggyQSA always contains :focus, so no need for an existence check - if ( support.matchesSelector && documentIsHTML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) { - try { - var ret = matches.call( elem, expr ); - - // IE 9's matchesSelector returns false on disconnected nodes - if ( ret || support.disconnectedMatch || - // As well, disconnected nodes are said to be in a document - // fragment in IE 9 - elem.document && elem.document.nodeType !== 11 ) { - return ret; - } - } catch(e) {} - } - - return Sizzle( expr, document, null, [elem] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - // Set document vars if needed - if ( ( context.ownerDocument || context ) !== document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - var val; - - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - if ( documentIsHTML ) { - name = name.toLowerCase(); - } - if ( (val = Expr.attrHandle[ name ]) ) { - return val( elem ); - } - if ( !documentIsHTML || support.attributes ) { - return elem.getAttribute( name ); - } - return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ? - name : - val && val.specified ? val.value : null; -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -// Document sorting and removing duplicates -Sizzle.uniqueSort = function( results ) { - var elem, - duplicates = [], - j = 0, - i = 0; - - // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - // Compensate for sort limitations - recompare = !support.sortDetached; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); - - if ( hasDuplicate ) { - while ( (elem = results[i++]) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - return results; -}; - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns Returns -1 if a precedes b, 1 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE ); - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( (cur = cur.nextSibling) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - -// Returns a function to use in pseudos for input types -function createInputPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; - }; -} - -// Returns a function to use in pseudos for buttons -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; - }; -} - -// Returns a function to use in pseudos for positionals -function createPositionalPseudo( fn ) { - return markFunction(function( argument ) { - argument = +argument; - return markFunction(function( seed, matches ) { - var j, - matchIndexes = fn( [], seed.length, argument ), - i = matchIndexes.length; - - // Match elements found at the specified indexes - while ( i-- ) { - if ( seed[ (j = matchIndexes[i]) ] ) { - seed[j] = !(matches[j] = seed[j]); - } - } - }); - }); -} - -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - // If no nodeType, this is expected to be an array - for ( ; (node = elem[i]); i++ ) { - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent for elements - // innerText usage removed for consistency of new lines (see #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - // Do not include comment or processing instruction nodes - - return ret; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "ATTR": function( match ) { - match[1] = match[1].replace( runescape, funescape ); - - // Move the given value to match[3] whether quoted or unquoted - match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); - - if ( match[2] === "~=" ) { - match[3] = " " + match[3] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[1] = match[1].toLowerCase(); - - if ( match[1].slice( 0, 3 ) === "nth" ) { - // nth-* requires argument - if ( !match[3] ) { - Sizzle.error( match[0] ); - } - - // numeric x and y parameters for Expr.filter.CHILD - // remember that false/true cast respectively to 0/1 - match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); - match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); - - // other types prohibit arguments - } else if ( match[3] ) { - Sizzle.error( match[0] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[5] && match[2]; - - if ( matchExpr["CHILD"].test( match[0] ) ) { - return null; - } - - // Accept quoted arguments as-is - if ( match[4] ) { - match[2] = match[4]; - - // Strip excess characters from unquoted arguments - } else if ( unquoted && rpseudo.test( unquoted ) && - // Get excess from tokenize (recursively) - (excess = tokenize( unquoted, true )) && - // advance to the next closing parenthesis - (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { - - // excess is a negative index - match[0] = match[0].slice( 0, excess ); - match[2] = unquoted.slice( 0, excess ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeName ) { - if ( nodeName === "*" ) { - return function() { return true; }; - } - - nodeName = nodeName.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && - classCache( className, function( elem ) { - return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" ); - }); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - result += ""; - - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; - }; - }, - - "CHILD": function( type, what, argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, context, xml ) { - var cache, outerCache, node, diff, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( (node = node[ dir ]) ) { - if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { - return false; - } - } - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - // Seek `elem` from a previously-cached index - outerCache = parent[ expando ] || (parent[ expando ] = {}); - cache = outerCache[ type ] || []; - nodeIndex = cache[0] === dirruns && cache[1]; - diff = cache[0] === dirruns && cache[2]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( (node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - (diff = nodeIndex = 0) || start.pop()) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - outerCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - // Use previously-cached element index if available - } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { - diff = cache[1]; - - // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) - } else { - // Use the same loop as above to seek `elem` from the start - while ( (node = ++nodeIndex && node && node[ dir ] || - (diff = nodeIndex = 0) || start.pop()) ) { - - if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { - // Cache the index of each encountered element - if ( useCache ) { - (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes - // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters - // Remember that setFilters inherits from pseudos - var args, - fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction(function( seed, matches ) { - var idx, - matched = fn( seed, argument ), - i = matched.length; - while ( i-- ) { - idx = indexOf.call( seed, matched[i] ); - seed[ idx ] = !( matches[ idx ] = matched[i] ); - } - }) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - // Potentially complex pseudos - "not": markFunction(function( selector ) { - // Trim the selector passed to compile - // to avoid treating leading and trailing - // spaces as combinators - var input = [], - results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); - - return matcher[ expando ] ? - markFunction(function( seed, matches, context, xml ) { - var elem, - unmatched = matcher( seed, null, xml, [] ), - i = seed.length; - - // Match elements unmatched by `matcher` - while ( i-- ) { - if ( (elem = unmatched[i]) ) { - seed[i] = !(matches[i] = elem); - } - } - }) : - function( elem, context, xml ) { - input[0] = elem; - matcher( input, null, xml, results ); - return !results.pop(); - }; - }), - - "has": markFunction(function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - }), - - "contains": markFunction(function( text ) { - return function( elem ) { - return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; - }; - }), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // or beginning with the identifier C immediately followed by "-". - // The matching of C against the element's language value is performed case-insensitively. - // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { - // lang value must be a valid identifier - if ( !ridentifier.test(lang || "") ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( (elemLang = documentIsHTML ? - elem.lang : - elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { - - elemLang = elemLang.toLowerCase(); - return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; - } - } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); - return false; - }; - }), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); - }, - - // Boolean properties - "enabled": function( elem ) { - return elem.disabled === false; - }, - - "disabled": function( elem ) { - return elem.disabled === true; - }, - - "checked": function( elem ) { - // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); - }, - - "selected": function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - // http://www.w3.org/TR/selectors/#empty-pseudo - // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)), - // not comment, processing instructions, or others - // Thanks to Diego Perini for the nodeName shortcut - // Greater than "@" means alpha characters (specifically not starting with "#" or "?") - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos["empty"]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc) - // use getAttribute instead to test this case - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && - ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type ); - }, - - // Position-in-collection - "first": createPositionalPseudo(function() { - return [ 0 ]; - }), - - "last": createPositionalPseudo(function( matchIndexes, length ) { - return [ length - 1 ]; - }), - - "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - }), - - "even": createPositionalPseudo(function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "odd": createPositionalPseudo(function( matchIndexes, length ) { - var i = 1; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; - for ( ; ++i < length; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }) - } -}; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -function tokenize( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || (match = rcomma.exec( soFar )) ) { - if ( match ) { - // Don't consume trailing commas as valid - soFar = soFar.slice( match[0].length ) || soFar; - } - groups.push( tokens = [] ); - } - - matched = false; - - // Combinators - if ( (match = rcombinators.exec( soFar )) ) { - matched = match.shift(); - tokens.push( { - value: matched, - // Cast descendant combinators to space - type: match[0].replace( rtrim, " " ) - } ); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || - (match = preFilters[ type ]( match ))) ) { - matched = match.shift(); - tokens.push( { - value: matched, - type: type, - matches: match - } ); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // Return the length of the invalid excess - // if we're just parsing - // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -} - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[i].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - checkNonElements = base && dir === "parentNode", - doneName = done++; - - return combinator.first ? - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var data, cache, outerCache, - dirkey = dirruns + " " + doneName; - - // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching - if ( xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || (elem[ expando ] = {}); - if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) { - if ( (data = cache[1]) === true || data === cachedruns ) { - return data === true; - } - } else { - cache = outerCache[ dir ] = [ dirkey ]; - cache[1] = matcher( elem, context, xml ) || cachedruns; - if ( cache[1] === true ) { - return true; - } - } - } - } - } - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[i]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[0]; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( (elem = unmatched[i]) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction(function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or context - elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), - - // Prefilter to get matcher input, preserving a map for seed-results synchronization - matcherIn = preFilter && ( seed || !selector ) ? - condense( elems, preMap, preFilter, context, xml ) : - elems, - - matcherOut = matcher ? - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches - if ( matcher ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // Un-match failing elements by moving them back to matcherIn - i = temp.length; - while ( i-- ) { - if ( (elem = temp[i]) ) { - matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); - } - } - } - - if ( seed ) { - if ( postFinder || preFilter ) { - if ( postFinder ) { - // Get the final matcherOut by condensing this intermediate into postFinder contexts - temp = []; - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) ) { - // Restore matcherIn since elem is not yet a final match - temp.push( (matcherIn[i] = elem) ); - } - } - postFinder( null, (matcherOut = []), temp, xml ); - } - - // Move matched elements from seed to results to keep them synchronized - i = matcherOut.length; - while ( i-- ) { - if ( (elem = matcherOut[i]) && - (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { - - seed[temp] = !(results[temp] = elem); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - }); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - leadingRelative = Expr.relative[ tokens[0].type ], - implicitRelative = leadingRelative || Expr.relative[" "], - i = leadingRelative ? 1 : 0, - - // The foundational matcher ensures that elements are reachable from top-level context(s) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf.call( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - (checkContext = context).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - } ]; - - for ( ; i < len; i++ ) { - if ( (matcher = Expr.relative[ tokens[i].type ]) ) { - matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; - } else { - matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); - - // Return special upon seeing a positional matcher - if ( matcher[ expando ] ) { - // Find the next relative operator (if any) for proper handling - j = ++i; - for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[j].type ] ) { - break; - } - } - return setMatcher( - i > 1 && elementMatcher( matchers ), - i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - // A counter to specify which element is currently being matched - var matcherCachedRuns = 0, - bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, expandContext ) { - var elem, j, matcher, - setMatched = [], - matchedCount = 0, - i = "0", - unmatched = seed && [], - outermost = expandContext != null, - contextBackup = outermostContext, - // We must always have either seed elements or context - elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ), - // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1); - - if ( outermost ) { - outermostContext = context !== document && context; - cachedruns = matcherCachedRuns; - } - - // Add elements passing elementMatchers directly to results - // Keep `i` a string if there are no elements so `matchedCount` will be "00" below - for ( ; (elem = elems[i]) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - while ( (matcher = elementMatchers[j++]) ) { - if ( matcher( elem, context, xml ) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - cachedruns = ++matcherCachedRuns; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - // They will have gone through all possible matchers - if ( (elem = !matcher && elem) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // Apply set filters to unmatched elements - matchedCount += i; - if ( bySet && i !== matchedCount ) { - j = 0; - while ( (matcher = setMatchers[j++]) ) { - matcher( unmatched, setMatched, context, xml ); - } - - if ( seed ) { - // Reintegrate element matches to eliminate the need for sorting - if ( matchedCount > 0 ) { - while ( i-- ) { - if ( !(unmatched[i] || setMatched[i]) ) { - setMatched[i] = pop.call( results ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { - var i, - setMatchers = [], - elementMatchers = [], - cached = compilerCache[ selector + " " ]; - - if ( !cached ) { - // Generate a function of recursive functions that can be used to check each element - if ( !group ) { - group = tokenize( selector ); - } - i = group.length; - while ( i-- ) { - cached = matcherFromTokens( group[i] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); - } - return cached; -}; - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[i], results ); - } - return results; -} - -function select( selector, context, results, seed ) { - var i, tokens, token, type, find, - match = tokenize( selector ); - - if ( !seed ) { - // Try to minimize operations if there is only one group - if ( match.length === 1 ) { - - // Take a shortcut and set the context if the root selector is an ID - tokens = match[0] = match[0].slice( 0 ); - if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && - context.nodeType === 9 && documentIsHTML && - Expr.relative[ tokens[1].type ] ) { - - context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; - if ( !context ) { - return results; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[i]; - - // Abort if we hit a combinator - if ( Expr.relative[ (type = token.type) ] ) { - break; - } - if ( (find = Expr.find[ type ]) ) { - // Search, expanding context for leading sibling combinators - if ( (seed = find( - token.matches[0].replace( runescape, funescape ), - rsibling.test( tokens[0].type ) && context.parentNode || context - )) ) { - - // If seed is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - } - - // Compile and execute a filtering function - // Provide `match` to avoid retokenization if we modified the selector above - compile( selector, match )( - seed, - context, - !documentIsHTML, - results, - rsibling.test( selector ) - ); - return results; -} - -// Deprecated -Expr.pseudos["nth"] = Expr.pseudos["eq"]; - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -// Check sort stability -support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; - -// Initialize with the default document -setDocument(); - -// Always assume the presence of duplicates if sort doesn't -// pass them to our comparison function (as in Google Chrome). -[0, 0].sort( sortOrder ); -support.detectDuplicates = hasDuplicate; - -/* -// EXPOSE -if ( typeof define === "function" && define.amd ) { - define(function() { return Sizzle; }); -} else { - window.Sizzle = Sizzle; -} -*/ - -// EXPOSE -return Sizzle; -}); - -// Included from: js/tinymce/classes/dom/DomQuery.js - -/** - * DomQuery.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - * - * Some of this logic is based on jQuery code that is released under - * MIT license that grants us to sublicense it under LGPL. - * - * @ignore-file - */ - -/** - * @class tinymce.dom.DomQuery - */ -define("tinymce/dom/DomQuery", [ - "tinymce/dom/EventUtils", - "tinymce/dom/Sizzle" -], function(EventUtils, Sizzle) { - var doc = document, push = Array.prototype.push, slice = Array.prototype.slice; - var rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/; - var Event = EventUtils.Event; - - function isDefined(obj) { - return typeof obj !== "undefined"; - } - - function isString(obj) { - return typeof obj === "string"; - } - - function createFragment(html) { - var frag, node, container; - - container = doc.createElement("div"); - frag = doc.createDocumentFragment(); - container.innerHTML = html; - - while ((node = container.firstChild)) { - frag.appendChild(node); - } - - return frag; - } - - function domManipulate(targetNodes, sourceItem, callback) { - var i; - - if (typeof sourceItem === "string") { - sourceItem = createFragment(sourceItem); - } else if (sourceItem.length) { - for (i = 0; i < sourceItem.length; i++) { - domManipulate(targetNodes, sourceItem[i], callback); - } - - return targetNodes; - } - - i = targetNodes.length; - while (i--) { - callback.call(targetNodes[i], sourceItem.parentNode ? sourceItem : sourceItem); - } - - return targetNodes; - } - - function hasClass(node, className) { - return node && className && (' ' + node.className + ' ').indexOf(' ' + className + ' ') !== -1; - } - - /** - * Makes a map object out of a string that gets separated by a delimiter. - * - * @method makeMap - * @param {String} items Item string to split. - * @param {Object} map Optional object to add items to. - * @return {Object} name/value object with items as keys. - */ - function makeMap(items, map) { - var i; - - items = items || []; - - if (typeof(items) == "string") { - items = items.split(' '); - } - - map = map || {}; - - i = items.length; - while (i--) { - map[items[i]] = {}; - } - - return map; - } - - var numericCssMap = makeMap('fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom'); - - function DomQuery(selector, context) { - /*eslint new-cap:0 */ - return new DomQuery.fn.init(selector, context); - } - - /** - * Extends the specified object with another object. - * - * @method extend - * @param {Object} target Object to extend. - * @param {Object..} obj Multiple objects to extend with. - * @return {Object} Same as target, the extended object. - */ - function extend(target) { - var args = arguments, arg, i, key; - - for (i = 1; i < args.length; i++) { - arg = args[i]; - - for (key in arg) { - target[key] = arg[key]; - } - } - - return target; - } - - /** - * Converts the specified object into a real JavaScript array. - * - * @method toArray - * @param {Object} obj Object to convert into array. - * @return {Array} Array object based in input. - */ - function toArray(obj) { - var array = [], i, l; - - for (i = 0, l = obj.length; i < l; i++) { - array[i] = obj[i]; - } - - return array; - } - - /** - * Returns the index of the specified item inside the array. - * - * @method inArray - * @param {Object} item Item to look for. - * @param {Array} array Array to look for item in. - * @return {Number} Index of the item or -1. - */ - function inArray(item, array) { - var i; - - if (array.indexOf) { - return array.indexOf(item); - } - - i = array.length; - while (i--) { - if (array[i] === item) { - return i; - } - } - - return -1; - } - - /** - * Returns true/false if the specified object is an array. - * - * @method isArray - * @param {Object} obj Object to check if it's an array. - * @return {Boolean} true/false if the input object is array or not. - */ - var isArray = Array.isArray || function(obj) { - return Object.prototype.toString.call(obj) === "[object Array]"; - }; - - var whiteSpaceRegExp = /^\s*|\s*$/g; - - function trim(str) { - return (str === null || str === undefined) ? '' : ("" + str).replace(whiteSpaceRegExp, ''); - } - - /** - * Executes the callback function for each item in array/object. If you return false in the - * callback it will break the loop. - * - * @method each - * @param {Object} obj Object to iterate. - * @param {function} callback Callback function to execute for each item. - */ - function each(obj, callback) { - var length, key, i, undef, value; - - if (obj) { - length = obj.length; - - if (length === undef) { - // Loop object items - for (key in obj) { - if (obj.hasOwnProperty(key)) { - value = obj[key]; - if (callback.call(value, value, key) === false) { - break; - } - } - } - } else { - // Loop array items - for (i = 0; i < length; i++) { - value = obj[i]; - if (callback.call(value, value, key) === false) { - break; - } - } - } - } - - return obj; - } - - DomQuery.fn = DomQuery.prototype = { - constructor: DomQuery, - selector: "", - length: 0, - - init: function(selector, context) { - var self = this, match, node; - - if (!selector) { - return self; - } - - if (selector.nodeType) { - self.context = self[0] = selector; - self.length = 1; - - return self; - } - - if (isString(selector)) { - if (selector.charAt(0) === "<" && selector.charAt(selector.length - 1) === ">" && selector.length >= 3) { - match = [null, selector, null]; - } else { - match = rquickExpr.exec(selector); - } - - if (match) { - if (match[1]) { - node = createFragment(selector).firstChild; - while (node) { - this.add(node); - node = node.nextSibling; - } - } else { - node = doc.getElementById(match[2]); - - if (node.id !== match[2]) { - return self.find(selector); - } - - self.length = 1; - self[0] = node; - } - } else { - return DomQuery(context || document).find(selector); - } - } else { - this.add(selector); - } - - return self; - }, - - toArray: function() { - return toArray(this); - }, - - add: function(items) { - var self = this; - - // Force single item into array - if (!isArray(items)) { - if (items instanceof DomQuery) { - self.add(items.toArray()); - } else { - push.call(self, items); - } - } else { - push.apply(self, items); - } - - return self; - }, - - attr: function(name, value) { - var self = this; - - if (typeof name === "object") { - each(name, function(value, name) { - self.attr(name, value); - }); - } else if (isDefined(value)) { - this.each(function() { - if (this.nodeType === 1) { - this.setAttribute(name, value); - } - }); - } else { - return self[0] && self[0].nodeType === 1 ? self[0].getAttribute(name) : undefined; - } - - return self; - }, - - css: function(name, value) { - var self = this; - - if (typeof name === "object") { - each(name, function(value, name) { - self.css(name, value); - }); - } else { - // Camelcase it, if needed - name = name.replace(/-(\D)/g, function(a, b) { - return b.toUpperCase(); - }); - - if (isDefined(value)) { - // Default px suffix on these - if (typeof(value) === 'number' && !numericCssMap[name]) { - value += 'px'; - } - - self.each(function() { - var style = this.style; - - // IE specific opacity - if (name === "opacity" && this.runtimeStyle && typeof(this.runtimeStyle.opacity) === "undefined") { - style.filter = value === '' ? '' : "alpha(opacity=" + (value * 100) + ")"; - } - - try { - style[name] = value; - } catch (ex) { - // Ignore - } - }); - } else { - return self[0] ? self[0].style[name] : undefined; - } - } - - return self; - }, - - remove: function() { - var self = this, node, i = this.length; - - while (i--) { - node = self[i]; - Event.clean(node); - - if (node.parentNode) { - node.parentNode.removeChild(node); - } - } - - return this; - }, - - empty: function() { - var self = this, node, i = this.length; - - while (i--) { - node = self[i]; - while (node.firstChild) { - node.removeChild(node.firstChild); - } - } - - return this; - }, - - html: function(value) { - var self = this, i; - - if (isDefined(value)) { - i = self.length; - while (i--) { - self[i].innerHTML = value; - } - - return self; - } - - return self[0] ? self[0].innerHTML : ''; - }, - - text: function(value) { - var self = this, i; - - if (isDefined(value)) { - i = self.length; - while (i--) { - self[i].innerText = self[0].textContent = value; - } - - return self; - } - - return self[0] ? self[0].innerText || self[0].textContent : ''; - }, - - append: function() { - return domManipulate(this, arguments, function(node) { - if (this.nodeType === 1) { - this.appendChild(node); - } - }); - }, - - prepend: function() { - return domManipulate(this, arguments, function(node) { - if (this.nodeType === 1) { - this.insertBefore(node, this.firstChild); - } - }); - }, - - before: function() { - var self = this; - - if (self[0] && self[0].parentNode) { - return domManipulate(self, arguments, function(node) { - this.parentNode.insertBefore(node, this.nextSibling); - }); - } - - return self; - }, - - after: function() { - var self = this; - - if (self[0] && self[0].parentNode) { - return domManipulate(self, arguments, function(node) { - this.parentNode.insertBefore(node, this); - }); - } - - return self; - }, - - appendTo: function(val) { - DomQuery(val).append(this); - - return this; - }, - - addClass: function(className) { - return this.toggleClass(className, true); - }, - - removeClass: function(className) { - return this.toggleClass(className, false); - }, - - toggleClass: function(className, state) { - var self = this; - - if (className.indexOf(' ') !== -1) { - each(className.split(' '), function() { - self.toggleClass(this, state); - }); - } else { - self.each(function(node) { - var existingClassName; - - if (hasClass(node, className) !== state) { - existingClassName = node.className; - - if (state) { - node.className += existingClassName ? ' ' + className : className; - } else { - node.className = trim((" " + existingClassName + " ").replace(' ' + className + ' ', ' ')); - } - } - }); - } - - return self; - }, - - hasClass: function(className) { - return hasClass(this[0], className); - }, - - each: function(callback) { - return each(this, callback); - }, - - on: function(name, callback) { - return this.each(function() { - Event.bind(this, name, callback); - }); - }, - - off: function(name, callback) { - return this.each(function() { - Event.unbind(this, name, callback); - }); - }, - - show: function() { - return this.css('display', ''); - }, - - hide: function() { - return this.css('display', 'none'); - }, - - slice: function() { - return new DomQuery(slice.apply(this, arguments)); - }, - - eq: function(index) { - return index === -1 ? this.slice(index) : this.slice(index, +index + 1); - }, - - first: function() { - return this.eq(0); - }, - - last: function() { - return this.eq(-1); - }, - - replaceWith: function(content) { - var self = this; - - if (self[0]) { - self[0].parentNode.replaceChild(DomQuery(content)[0], self[0]); - } - - return self; - }, - - wrap: function(wrapper) { - wrapper = DomQuery(wrapper)[0]; - - return this.each(function() { - var self = this, newWrapper = wrapper.cloneNode(false); - self.parentNode.insertBefore(newWrapper, self); - newWrapper.appendChild(self); - }); - }, - - unwrap: function() { - return this.each(function() { - var self = this, node = self.firstChild, currentNode; - - while (node) { - currentNode = node; - node = node.nextSibling; - self.parentNode.insertBefore(currentNode, self); - } - }); - }, - - clone: function() { - var result = []; - - this.each(function() { - result.push(this.cloneNode(true)); - }); - - return DomQuery(result); - }, - - find: function(selector) { - var i, l, ret = []; - - for (i = 0, l = this.length; i < l; i++) { - DomQuery.find(selector, this[i], ret); - } - - return DomQuery(ret); - }, - - push: push, - sort: [].sort, - splice: [].splice - }; - - // Static members - extend(DomQuery, { - extend: extend, - toArray: toArray, - inArray: inArray, - isArray: isArray, - each: each, - trim: trim, - makeMap: makeMap, - - // Sizzle - find: Sizzle, - expr: Sizzle.selectors, - unique: Sizzle.uniqueSort, - text: Sizzle.getText, - isXMLDoc: Sizzle.isXML, - contains: Sizzle.contains, - filter: function(expr, elems, not) { - if (not) { - expr = ":not(" + expr + ")"; - } - - if (elems.length === 1) { - elems = DomQuery.find.matchesSelector(elems[0], expr) ? [elems[0]] : []; - } else { - elems = DomQuery.find.matches(expr, elems); - } - - return elems; - } - }); - - function dir(el, prop, until) { - var matched = [], cur = el[prop]; - - while (cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !DomQuery(cur).is(until))) { - if (cur.nodeType === 1) { - matched.push(cur); - } - - cur = cur[prop]; - } - - return matched; - } - - function sibling(n, el, siblingName, nodeType) { - var r = []; - - for(; n; n = n[siblingName]) { - if ((!nodeType || n.nodeType === nodeType) && n !== el) { - r.push(n); - } - } - - return r; - } - - each({ - parent: function(node) { - var parent = node.parentNode; - - return parent && parent.nodeType !== 11 ? parent : null; - }, - - parents: function(node) { - return dir(node, "parentNode"); - }, - - parentsUntil: function(node, until) { - return dir(node, "parentNode", until); - }, - - next: function(node) { - return sibling(node, 'nextSibling', 1); - }, - - prev: function(node) { - return sibling(node, 'previousSibling', 1); - }, - - nextNodes: function(node) { - return sibling(node, 'nextSibling'); - }, - - prevNodes: function(node) { - return sibling(node, 'previousSibling'); - }, - - children: function(node) { - return sibling(node.firstChild, 'nextSibling', 1); - }, - - contents: function(node) { - return toArray((node.nodeName === "iframe" ? node.contentDocument || node.contentWindow.document : node).childNodes); - } - }, function(name, fn){ - DomQuery.fn[name] = function(selector) { - var self = this, result; - - if (self.length > 1) { - throw new Error("DomQuery only supports traverse functions on a single node."); - } - - if (self[0]) { - result = fn(self[0], selector); - } - - result = DomQuery(result); - - if (selector && name !== "parentsUntil") { - return result.filter(selector); - } - - return result; - }; - }); - - DomQuery.fn.filter = function(selector) { - return DomQuery.filter(selector); - }; - - DomQuery.fn.is = function(selector) { - return !!selector && this.filter(selector).length > 0; - }; - - DomQuery.fn.init.prototype = DomQuery.fn; - - return DomQuery; -}); - -// Included from: js/tinymce/classes/html/Styles.js - -/** - * Styles.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class is used to parse CSS styles it also compresses styles to reduce the output size. - * - * @example - * var Styles = new tinymce.html.Styles({ - * url_converter: function(url) { - * return url; - * } - * }); - * - * styles = Styles.parse('border: 1px solid red'); - * styles.color = 'red'; - * - * console.log(new tinymce.html.StyleSerializer().serialize(styles)); - * - * @class tinymce.html.Styles - * @version 3.4 - */ -define("tinymce/html/Styles", [], function() { - return function(settings, schema) { - /*jshint maxlen:255 */ - /*eslint max-len:0 */ - var rgbRegExp = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi, - urlOrStrRegExp = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi, - styleRegExp = /\s*([^:]+):\s*([^;]+);?/g, - trimRightRegExp = /\s+$/, - undef, i, encodingLookup = {}, encodingItems, invisibleChar = '\uFEFF'; - - settings = settings || {}; - - encodingItems = ('\\" \\\' \\; \\: ; : ' + invisibleChar).split(' '); - for (i = 0; i < encodingItems.length; i++) { - encodingLookup[encodingItems[i]] = invisibleChar + i; - encodingLookup[invisibleChar + i] = encodingItems[i]; - } - - function toHex(match, r, g, b) { - function hex(val) { - val = parseInt(val, 10).toString(16); - - return val.length > 1 ? val : '0' + val; // 0 -> 00 - } - - return '#' + hex(r) + hex(g) + hex(b); - } - - return { - /** - * Parses the specified RGB color value and returns a hex version of that color. - * - * @method toHex - * @param {String} color RGB string value like rgb(1,2,3) - * @return {String} Hex version of that RGB value like #FF00FF. - */ - toHex: function(color) { - return color.replace(rgbRegExp, toHex); - }, - - /** - * Parses the specified style value into an object collection. This parser will also - * merge and remove any redundant items that browsers might have added. It will also convert non hex - * colors to hex values. Urls inside the styles will also be converted to absolute/relative based on settings. - * - * @method parse - * @param {String} css Style value to parse for example: border:1px solid red;. - * @return {Object} Object representation of that style like {border: '1px solid red'} - */ - parse: function(css) { - var styles = {}, matches, name, value, isEncoded, urlConverter = settings.url_converter; - var urlConverterScope = settings.url_converter_scope || this; - - function compress(prefix, suffix, noJoin) { - var top, right, bottom, left; - - top = styles[prefix + '-top' + suffix]; - if (!top) { - return; - } - - right = styles[prefix + '-right' + suffix]; - if (!right) { - return; - } - - bottom = styles[prefix + '-bottom' + suffix]; - if (!bottom) { - return; - } - - left = styles[prefix + '-left' + suffix]; - if (!left) { - return; - } - - var box = [top, right, bottom, left]; - i = box.length - 1; - while (i--) { - if (box[i] !== box[i + 1]) { - break; - } - } - - if (i > -1 && noJoin) { - return; - } - - styles[prefix + suffix] = i == -1 ? box[0] : box.join(' '); - delete styles[prefix + '-top' + suffix]; - delete styles[prefix + '-right' + suffix]; - delete styles[prefix + '-bottom' + suffix]; - delete styles[prefix + '-left' + suffix]; - } - - /** - * Checks if the specific style can be compressed in other words if all border-width are equal. - */ - function canCompress(key) { - var value = styles[key], i; - - if (!value) { - return; - } - - value = value.split(' '); - i = value.length; - while (i--) { - if (value[i] !== value[0]) { - return false; - } - } - - styles[key] = value[0]; - - return true; - } - - /** - * Compresses multiple styles into one style. - */ - function compress2(target, a, b, c) { - if (!canCompress(a)) { - return; - } - - if (!canCompress(b)) { - return; - } - - if (!canCompress(c)) { - return; - } - - // Compress - styles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c]; - delete styles[a]; - delete styles[b]; - delete styles[c]; - } - - // Encodes the specified string by replacing all \" \' ; : with _ - function encode(str) { - isEncoded = true; - - return encodingLookup[str]; - } - - // Decodes the specified string by replacing all _ with it's original value \" \' etc - // It will also decode the \" \' if keep_slashes is set to fale or omitted - function decode(str, keep_slashes) { - if (isEncoded) { - str = str.replace(/\uFEFF[0-9]/g, function(str) { - return encodingLookup[str]; - }); - } - - if (!keep_slashes) { - str = str.replace(/\\([\'\";:])/g, "$1"); - } - - return str; - } - - function processUrl(match, url, url2, url3, str, str2) { - str = str || str2; - - if (str) { - str = decode(str); - - // Force strings into single quote format - return "'" + str.replace(/\'/g, "\\'") + "'"; - } - - url = decode(url || url2 || url3); - - if (!settings.allow_script_urls && /(java|vb)script:/i.test(url.replace(/[\s\r\n]+/, ''))) { - return ""; - } - - // Convert the URL to relative/absolute depending on config - if (urlConverter) { - url = urlConverter.call(urlConverterScope, url, 'style'); - } - - // Output new URL format - return "url('" + url.replace(/\'/g, "\\'") + "')"; - } - - if (css) { - css = css.replace(/[\u0000-\u001F]/g, ''); - - // Encode \" \' % and ; and : inside strings so they don't interfere with the style parsing - css = css.replace(/\\[\"\';:\uFEFF]/g, encode).replace(/\"[^\"]+\"|\'[^\']+\'/g, function(str) { - return str.replace(/[;:]/g, encode); - }); - - // Parse styles - while ((matches = styleRegExp.exec(css))) { - name = matches[1].replace(trimRightRegExp, '').toLowerCase(); - value = matches[2].replace(trimRightRegExp, ''); - - if (name && value.length > 0) { - if (!settings.allow_script_urls && (name == "behavior" || /expression\s*\(/.test(value))) { - continue; - } - - // Opera will produce 700 instead of bold in their style values - if (name === 'font-weight' && value === '700') { - value = 'bold'; - } else if (name === 'color' || name === 'background-color') { // Lowercase colors like RED - value = value.toLowerCase(); - } - - // Convert RGB colors to HEX - value = value.replace(rgbRegExp, toHex); - - // Convert URLs and force them into url('value') format - value = value.replace(urlOrStrRegExp, processUrl); - styles[name] = isEncoded ? decode(value, true) : value; - } - - styleRegExp.lastIndex = matches.index + matches[0].length; - } - // Compress the styles to reduce it's size for example IE will expand styles - compress("border", "", true); - compress("border", "-width"); - compress("border", "-color"); - compress("border", "-style"); - compress("padding", ""); - compress("margin", ""); - compress2('border', 'border-width', 'border-style', 'border-color'); - - // Remove pointless border, IE produces these - if (styles.border === 'medium none') { - delete styles.border; - } - - // IE 11 will produce a border-image: none when getting the style attribute from

    - // So lets asume it shouldn't be there - if (styles['border-image'] === 'none') { - delete styles['border-image']; - } - } - - return styles; - }, - - /** - * Serializes the specified style object into a string. - * - * @method serialize - * @param {Object} styles Object to serialize as string for example: {border: '1px solid red'} - * @param {String} element_name Optional element name, if specified only the styles that matches the schema will be serialized. - * @return {String} String representation of the style object for example: border: 1px solid red. - */ - serialize: function(styles, element_name) { - var css = '', name, value; - - function serializeStyles(name) { - var styleList, i, l, value; - - styleList = schema.styles[name]; - if (styleList) { - for (i = 0, l = styleList.length; i < l; i++) { - name = styleList[i]; - value = styles[name]; - - if (value !== undef && value.length > 0) { - css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';'; - } - } - } - } - - // Serialize styles according to schema - if (element_name && schema && schema.styles) { - // Serialize global styles and element specific styles - serializeStyles('*'); - serializeStyles(element_name); - } else { - // Output the styles in the order they are inside the object - for (name in styles) { - value = styles[name]; - - if (value !== undef && value.length > 0) { - css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';'; - } - } - } - - return css; - } - }; - }; -}); - -// Included from: js/tinymce/classes/dom/TreeWalker.js - -/** - * TreeWalker.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * TreeWalker class enables you to walk the DOM in a linear manner. - * - * @class tinymce.dom.TreeWalker - */ -define("tinymce/dom/TreeWalker", [], function() { - return function(start_node, root_node) { - var node = start_node; - - function findSibling(node, start_name, sibling_name, shallow) { - var sibling, parent; - - if (node) { - // Walk into nodes if it has a start - if (!shallow && node[start_name]) { - return node[start_name]; - } - - // Return the sibling if it has one - if (node != root_node) { - sibling = node[sibling_name]; - if (sibling) { - return sibling; - } - - // Walk up the parents to look for siblings - for (parent = node.parentNode; parent && parent != root_node; parent = parent.parentNode) { - sibling = parent[sibling_name]; - if (sibling) { - return sibling; - } - } - } - } - } - - /** - * Returns the current node. - * - * @method current - * @return {Node} Current node where the walker is. - */ - this.current = function() { - return node; - }; - - /** - * Walks to the next node in tree. - * - * @method next - * @return {Node} Current node where the walker is after moving to the next node. - */ - this.next = function(shallow) { - node = findSibling(node, 'firstChild', 'nextSibling', shallow); - return node; - }; - - /** - * Walks to the previous node in tree. - * - * @method prev - * @return {Node} Current node where the walker is after moving to the previous node. - */ - this.prev = function(shallow) { - node = findSibling(node, 'lastChild', 'previousSibling', shallow); - return node; - }; - }; -}); - -// Included from: js/tinymce/classes/util/Tools.js - -/** - * Tools.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class contains various utlity functions. These are also exposed - * directly on the tinymce namespace. - * - * @class tinymce.util.Tools - */ -define("tinymce/util/Tools", [], function() { - /** - * Removes whitespace from the beginning and end of a string. - * - * @method trim - * @param {String} s String to remove whitespace from. - * @return {String} New string with removed whitespace. - */ - var whiteSpaceRegExp = /^\s*|\s*$/g; - - function trim(str) { - return (str === null || str === undefined) ? '' : ("" + str).replace(whiteSpaceRegExp, ''); - } - - /** - * Returns true/false if the object is an array or not. - * - * @method isArray - * @param {Object} obj Object to check. - * @return {boolean} true/false state if the object is an array or not. - */ - var isArray = Array.isArray || function(obj) { - return Object.prototype.toString.call(obj) === "[object Array]"; - }; - - /** - * Checks if a object is of a specific type for example an array. - * - * @method is - * @param {Object} o Object to check type of. - * @param {string} t Optional type to check for. - * @return {Boolean} true/false if the object is of the specified type. - */ - function is(o, t) { - if (!t) { - return o !== undefined; - } - - if (t == 'array' && isArray(o)) { - return true; - } - - return typeof(o) == t; - } - - /** - * Converts the specified object into a real JavaScript array. - * - * @method toArray - * @param {Object} obj Object to convert into array. - * @return {Array} Array object based in input. - */ - function toArray(obj) { - var array = [], i, l; - - for (i = 0, l = obj.length; i < l; i++) { - array[i] = obj[i]; - } - - return array; - } - - /** - * Makes a name/object map out of an array with names. - * - * @method makeMap - * @param {Array/String} items Items to make map out of. - * @param {String} delim Optional delimiter to split string by. - * @param {Object} map Optional map to add items to. - * @return {Object} Name/value map of items. - */ - function makeMap(items, delim, map) { - var i; - - items = items || []; - delim = delim || ','; - - if (typeof(items) == "string") { - items = items.split(delim); - } - - map = map || {}; - - i = items.length; - while (i--) { - map[items[i]] = {}; - } - - return map; - } - - /** - * Performs an iteration of all items in a collection such as an object or array. This method will execure the - * callback function for each item in the collection, if the callback returns false the iteration will terminate. - * The callback has the following format: cb(value, key_or_index). - * - * @method each - * @param {Object} o Collection to iterate. - * @param {function} cb Callback function to execute for each item. - * @param {Object} s Optional scope to execute the callback in. - * @example - * // Iterate an array - * tinymce.each([1,2,3], function(v, i) { - * console.debug("Value: " + v + ", Index: " + i); - * }); - * - * // Iterate an object - * tinymce.each({a: 1, b: 2, c: 3], function(v, k) { - * console.debug("Value: " + v + ", Key: " + k); - * }); - */ - function each(o, cb, s) { - var n, l; - - if (!o) { - return 0; - } - - s = s || o; - - if (o.length !== undefined) { - // Indexed arrays, needed for Safari - for (n = 0, l = o.length; n < l; n++) { - if (cb.call(s, o[n], n, o) === false) { - return 0; - } - } - } else { - // Hashtables - for (n in o) { - if (o.hasOwnProperty(n)) { - if (cb.call(s, o[n], n, o) === false) { - return 0; - } - } - } - } - - return 1; - } - - /** - * Creates a new array by the return value of each iteration function call. This enables you to convert - * one array list into another. - * - * @method map - * @param {Array} a Array of items to iterate. - * @param {function} f Function to call for each item. It's return value will be the new value. - * @return {Array} Array with new values based on function return values. - */ - function map(a, f) { - var o = []; - - each(a, function(v) { - o.push(f(v)); - }); - - return o; - } - - /** - * Filters out items from the input array by calling the specified function for each item. - * If the function returns false the item will be excluded if it returns true it will be included. - * - * @method grep - * @param {Array} a Array of items to loop though. - * @param {function} f Function to call for each item. Include/exclude depends on it's return value. - * @return {Array} New array with values imported and filtered based in input. - * @example - * // Filter out some items, this will return an array with 4 and 5 - * var items = tinymce.grep([1,2,3,4,5], function(v) {return v > 3;}); - */ - function grep(a, f) { - var o = []; - - each(a, function(v) { - if (!f || f(v)) { - o.push(v); - } - }); - - return o; - } - - /** - * Creates a class, subclass or static singleton. - * More details on this method can be found in the Wiki. - * - * @method create - * @param {String} s Class name, inheritage and prefix. - * @param {Object} p Collection of methods to add to the class. - * @param {Object} root Optional root object defaults to the global window object. - * @example - * // Creates a basic class - * tinymce.create('tinymce.somepackage.SomeClass', { - * SomeClass: function() { - * // Class constructor - * }, - * - * method: function() { - * // Some method - * } - * }); - * - * // Creates a basic subclass class - * tinymce.create('tinymce.somepackage.SomeSubClass:tinymce.somepackage.SomeClass', { - * SomeSubClass: function() { - * // Class constructor - * this.parent(); // Call parent constructor - * }, - * - * method: function() { - * // Some method - * this.parent(); // Call parent method - * }, - * - * 'static': { - * staticMethod: function() { - * // Static method - * } - * } - * }); - * - * // Creates a singleton/static class - * tinymce.create('static tinymce.somepackage.SomeSingletonClass', { - * method: function() { - * // Some method - * } - * }); - */ - function create(s, p, root) { - var self = this, sp, ns, cn, scn, c, de = 0; - - // Parse : : - s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s); - cn = s[3].match(/(^|\.)(\w+)$/i)[2]; // Class name - - // Create namespace for new class - ns = self.createNS(s[3].replace(/\.\w+$/, ''), root); - - // Class already exists - if (ns[cn]) { - return; - } - - // Make pure static class - if (s[2] == 'static') { - ns[cn] = p; - - if (this.onCreate) { - this.onCreate(s[2], s[3], ns[cn]); - } - - return; - } - - // Create default constructor - if (!p[cn]) { - p[cn] = function() {}; - de = 1; - } - - // Add constructor and methods - ns[cn] = p[cn]; - self.extend(ns[cn].prototype, p); - - // Extend - if (s[5]) { - sp = self.resolve(s[5]).prototype; - scn = s[5].match(/\.(\w+)$/i)[1]; // Class name - - // Extend constructor - c = ns[cn]; - if (de) { - // Add passthrough constructor - ns[cn] = function() { - return sp[scn].apply(this, arguments); - }; - } else { - // Add inherit constructor - ns[cn] = function() { - this.parent = sp[scn]; - return c.apply(this, arguments); - }; - } - ns[cn].prototype[cn] = ns[cn]; - - // Add super methods - self.each(sp, function(f, n) { - ns[cn].prototype[n] = sp[n]; - }); - - // Add overridden methods - self.each(p, function(f, n) { - // Extend methods if needed - if (sp[n]) { - ns[cn].prototype[n] = function() { - this.parent = sp[n]; - return f.apply(this, arguments); - }; - } else { - if (n != cn) { - ns[cn].prototype[n] = f; - } - } - }); - } - - // Add static methods - /*jshint sub:true*/ - self.each(p['static'], function(f, n) { - ns[cn][n] = f; - }); - } - - /** - * Returns the index of a value in an array, this method will return -1 if the item wasn't found. - * - * @method inArray - * @param {Array} a Array/Object to search for value in. - * @param {Object} v Value to check for inside the array. - * @return {Number/String} Index of item inside the array inside an object. Or -1 if it wasn't found. - * @example - * // Get index of value in array this will alert 1 since 2 is at that index - * alert(tinymce.inArray([1,2,3], 2)); - */ - function inArray(a, v) { - var i, l; - - if (a) { - for (i = 0, l = a.length; i < l; i++) { - if (a[i] === v) { - return i; - } - } - } - - return -1; - } - - function extend(obj, ext) { - var i, l, name, args = arguments, value; - - for (i = 1, l = args.length; i < l; i++) { - ext = args[i]; - for (name in ext) { - if (ext.hasOwnProperty(name)) { - value = ext[name]; - - if (value !== undefined) { - obj[name] = value; - } - } - } - } - - return obj; - } - - /** - * Executed the specified function for each item in a object tree. - * - * @method walk - * @param {Object} o Object tree to walk though. - * @param {function} f Function to call for each item. - * @param {String} n Optional name of collection inside the objects to walk for example childNodes. - * @param {String} s Optional scope to execute the function in. - */ - function walk(o, f, n, s) { - s = s || this; - - if (o) { - if (n) { - o = o[n]; - } - - each(o, function(o, i) { - if (f.call(s, o, i, n) === false) { - return false; - } - - walk(o, f, n, s); - }); - } - } - - /** - * Creates a namespace on a specific object. - * - * @method createNS - * @param {String} n Namespace to create for example a.b.c.d. - * @param {Object} o Optional object to add namespace to, defaults to window. - * @return {Object} New namespace object the last item in path. - * @example - * // Create some namespace - * tinymce.createNS('tinymce.somepackage.subpackage'); - * - * // Add a singleton - * var tinymce.somepackage.subpackage.SomeSingleton = { - * method: function() { - * // Some method - * } - * }; - */ - function createNS(n, o) { - var i, v; - - o = o || window; - - n = n.split('.'); - for (i = 0; i < n.length; i++) { - v = n[i]; - - if (!o[v]) { - o[v] = {}; - } - - o = o[v]; - } - - return o; - } - - /** - * Resolves a string and returns the object from a specific structure. - * - * @method resolve - * @param {String} n Path to resolve for example a.b.c.d. - * @param {Object} o Optional object to search though, defaults to window. - * @return {Object} Last object in path or null if it couldn't be resolved. - * @example - * // Resolve a path into an object reference - * var obj = tinymce.resolve('a.b.c.d'); - */ - function resolve(n, o) { - var i, l; - - o = o || window; - - n = n.split('.'); - for (i = 0, l = n.length; i < l; i++) { - o = o[n[i]]; - - if (!o) { - break; - } - } - - return o; - } - - /** - * Splits a string but removes the whitespace before and after each value. - * - * @method explode - * @param {string} s String to split. - * @param {string} d Delimiter to split by. - * @example - * // Split a string into an array with a,b,c - * var arr = tinymce.explode('a, b, c'); - */ - function explode(s, d) { - if (!s || is(s, 'array')) { - return s; - } - - return map(s.split(d || ','), trim); - } - - return { - trim: trim, - isArray: isArray, - is: is, - toArray: toArray, - makeMap: makeMap, - each: each, - map: map, - grep: grep, - inArray: inArray, - extend: extend, - create: create, - walk: walk, - createNS: createNS, - resolve: resolve, - explode: explode - }; -}); - -// Included from: js/tinymce/classes/dom/Range.js - -/** - * Range.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("tinymce/dom/Range", [ - "tinymce/util/Tools" -], function(Tools) { - // Range constructor - function Range(dom) { - var self = this, - doc = dom.doc, - EXTRACT = 0, - CLONE = 1, - DELETE = 2, - TRUE = true, - FALSE = false, - START_OFFSET = 'startOffset', - START_CONTAINER = 'startContainer', - END_CONTAINER = 'endContainer', - END_OFFSET = 'endOffset', - extend = Tools.extend, - nodeIndex = dom.nodeIndex; - - function createDocumentFragment() { - return doc.createDocumentFragment(); - } - - function setStart(n, o) { - _setEndPoint(TRUE, n, o); - } - - function setEnd(n, o) { - _setEndPoint(FALSE, n, o); - } - - function setStartBefore(n) { - setStart(n.parentNode, nodeIndex(n)); - } - - function setStartAfter(n) { - setStart(n.parentNode, nodeIndex(n) + 1); - } - - function setEndBefore(n) { - setEnd(n.parentNode, nodeIndex(n)); - } - - function setEndAfter(n) { - setEnd(n.parentNode, nodeIndex(n) + 1); - } - - function collapse(ts) { - if (ts) { - self[END_CONTAINER] = self[START_CONTAINER]; - self[END_OFFSET] = self[START_OFFSET]; - } else { - self[START_CONTAINER] = self[END_CONTAINER]; - self[START_OFFSET] = self[END_OFFSET]; - } - - self.collapsed = TRUE; - } - - function selectNode(n) { - setStartBefore(n); - setEndAfter(n); - } - - function selectNodeContents(n) { - setStart(n, 0); - setEnd(n, n.nodeType === 1 ? n.childNodes.length : n.nodeValue.length); - } - - function compareBoundaryPoints(h, r) { - var sc = self[START_CONTAINER], so = self[START_OFFSET], ec = self[END_CONTAINER], eo = self[END_OFFSET], - rsc = r.startContainer, rso = r.startOffset, rec = r.endContainer, reo = r.endOffset; - - // Check START_TO_START - if (h === 0) { - return _compareBoundaryPoints(sc, so, rsc, rso); - } - - // Check START_TO_END - if (h === 1) { - return _compareBoundaryPoints(ec, eo, rsc, rso); - } - - // Check END_TO_END - if (h === 2) { - return _compareBoundaryPoints(ec, eo, rec, reo); - } - - // Check END_TO_START - if (h === 3) { - return _compareBoundaryPoints(sc, so, rec, reo); - } - } - - function deleteContents() { - _traverse(DELETE); - } - - function extractContents() { - return _traverse(EXTRACT); - } - - function cloneContents() { - return _traverse(CLONE); - } - - function insertNode(n) { - var startContainer = this[START_CONTAINER], - startOffset = this[START_OFFSET], nn, o; - - // Node is TEXT_NODE or CDATA - if ((startContainer.nodeType === 3 || startContainer.nodeType === 4) && startContainer.nodeValue) { - if (!startOffset) { - // At the start of text - startContainer.parentNode.insertBefore(n, startContainer); - } else if (startOffset >= startContainer.nodeValue.length) { - // At the end of text - dom.insertAfter(n, startContainer); - } else { - // Middle, need to split - nn = startContainer.splitText(startOffset); - startContainer.parentNode.insertBefore(n, nn); - } - } else { - // Insert element node - if (startContainer.childNodes.length > 0) { - o = startContainer.childNodes[startOffset]; - } - - if (o) { - startContainer.insertBefore(n, o); - } else { - if (startContainer.nodeType == 3) { - dom.insertAfter(n, startContainer); - } else { - startContainer.appendChild(n); - } - } - } - } - - function surroundContents(n) { - var f = self.extractContents(); - - self.insertNode(n); - n.appendChild(f); - self.selectNode(n); - } - - function cloneRange() { - return extend(new Range(dom), { - startContainer: self[START_CONTAINER], - startOffset: self[START_OFFSET], - endContainer: self[END_CONTAINER], - endOffset: self[END_OFFSET], - collapsed: self.collapsed, - commonAncestorContainer: self.commonAncestorContainer - }); - } - - // Private methods - - function _getSelectedNode(container, offset) { - var child; - - if (container.nodeType == 3 /* TEXT_NODE */) { - return container; - } - - if (offset < 0) { - return container; - } - - child = container.firstChild; - while (child && offset > 0) { - --offset; - child = child.nextSibling; - } - - if (child) { - return child; - } - - return container; - } - - function _isCollapsed() { - return (self[START_CONTAINER] == self[END_CONTAINER] && self[START_OFFSET] == self[END_OFFSET]); - } - - function _compareBoundaryPoints(containerA, offsetA, containerB, offsetB) { - var c, offsetC, n, cmnRoot, childA, childB; - - // In the first case the boundary-points have the same container. A is before B - // if its offset is less than the offset of B, A is equal to B if its offset is - // equal to the offset of B, and A is after B if its offset is greater than the - // offset of B. - if (containerA == containerB) { - if (offsetA == offsetB) { - return 0; // equal - } - - if (offsetA < offsetB) { - return -1; // before - } - - return 1; // after - } - - // In the second case a child node C of the container of A is an ancestor - // container of B. In this case, A is before B if the offset of A is less than or - // equal to the index of the child node C and A is after B otherwise. - c = containerB; - while (c && c.parentNode != containerA) { - c = c.parentNode; - } - - if (c) { - offsetC = 0; - n = containerA.firstChild; - - while (n != c && offsetC < offsetA) { - offsetC++; - n = n.nextSibling; - } - - if (offsetA <= offsetC) { - return -1; // before - } - - return 1; // after - } - - // In the third case a child node C of the container of B is an ancestor container - // of A. In this case, A is before B if the index of the child node C is less than - // the offset of B and A is after B otherwise. - c = containerA; - while (c && c.parentNode != containerB) { - c = c.parentNode; - } - - if (c) { - offsetC = 0; - n = containerB.firstChild; - - while (n != c && offsetC < offsetB) { - offsetC++; - n = n.nextSibling; - } - - if (offsetC < offsetB) { - return -1; // before - } - - return 1; // after - } - - // In the fourth case, none of three other cases hold: the containers of A and B - // are siblings or descendants of sibling nodes. In this case, A is before B if - // the container of A is before the container of B in a pre-order traversal of the - // Ranges' context tree and A is after B otherwise. - cmnRoot = dom.findCommonAncestor(containerA, containerB); - childA = containerA; - - while (childA && childA.parentNode != cmnRoot) { - childA = childA.parentNode; - } - - if (!childA) { - childA = cmnRoot; - } - - childB = containerB; - while (childB && childB.parentNode != cmnRoot) { - childB = childB.parentNode; - } - - if (!childB) { - childB = cmnRoot; - } - - if (childA == childB) { - return 0; // equal - } - - n = cmnRoot.firstChild; - while (n) { - if (n == childA) { - return -1; // before - } - - if (n == childB) { - return 1; // after - } - - n = n.nextSibling; - } - } - - function _setEndPoint(st, n, o) { - var ec, sc; - - if (st) { - self[START_CONTAINER] = n; - self[START_OFFSET] = o; - } else { - self[END_CONTAINER] = n; - self[END_OFFSET] = o; - } - - // If one boundary-point of a Range is set to have a root container - // other than the current one for the Range, the Range is collapsed to - // the new position. This enforces the restriction that both boundary- - // points of a Range must have the same root container. - ec = self[END_CONTAINER]; - while (ec.parentNode) { - ec = ec.parentNode; - } - - sc = self[START_CONTAINER]; - while (sc.parentNode) { - sc = sc.parentNode; - } - - if (sc == ec) { - // The start position of a Range is guaranteed to never be after the - // end position. To enforce this restriction, if the start is set to - // be at a position after the end, the Range is collapsed to that - // position. - if (_compareBoundaryPoints(self[START_CONTAINER], self[START_OFFSET], self[END_CONTAINER], self[END_OFFSET]) > 0) { - self.collapse(st); - } - } else { - self.collapse(st); - } - - self.collapsed = _isCollapsed(); - self.commonAncestorContainer = dom.findCommonAncestor(self[START_CONTAINER], self[END_CONTAINER]); - } - - function _traverse(how) { - var c, endContainerDepth = 0, startContainerDepth = 0, p, depthDiff, startNode, endNode, sp, ep; - - if (self[START_CONTAINER] == self[END_CONTAINER]) { - return _traverseSameContainer(how); - } - - for (c = self[END_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) { - if (p == self[START_CONTAINER]) { - return _traverseCommonStartContainer(c, how); - } - - ++endContainerDepth; - } - - for (c = self[START_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) { - if (p == self[END_CONTAINER]) { - return _traverseCommonEndContainer(c, how); - } - - ++startContainerDepth; - } - - depthDiff = startContainerDepth - endContainerDepth; - - startNode = self[START_CONTAINER]; - while (depthDiff > 0) { - startNode = startNode.parentNode; - depthDiff--; - } - - endNode = self[END_CONTAINER]; - while (depthDiff < 0) { - endNode = endNode.parentNode; - depthDiff++; - } - - // ascend the ancestor hierarchy until we have a common parent. - for (sp = startNode.parentNode, ep = endNode.parentNode; sp != ep; sp = sp.parentNode, ep = ep.parentNode) { - startNode = sp; - endNode = ep; - } - - return _traverseCommonAncestors(startNode, endNode, how); - } - - function _traverseSameContainer(how) { - var frag, s, sub, n, cnt, sibling, xferNode, start, len; - - if (how != DELETE) { - frag = createDocumentFragment(); - } - - // If selection is empty, just return the fragment - if (self[START_OFFSET] == self[END_OFFSET]) { - return frag; - } - - // Text node needs special case handling - if (self[START_CONTAINER].nodeType == 3 /* TEXT_NODE */) { - // get the substring - s = self[START_CONTAINER].nodeValue; - sub = s.substring(self[START_OFFSET], self[END_OFFSET]); - - // set the original text node to its new value - if (how != CLONE) { - n = self[START_CONTAINER]; - start = self[START_OFFSET]; - len = self[END_OFFSET] - self[START_OFFSET]; - - if (start === 0 && len >= n.nodeValue.length - 1) { - n.parentNode.removeChild(n); - } else { - n.deleteData(start, len); - } - - // Nothing is partially selected, so collapse to start point - self.collapse(TRUE); - } - - if (how == DELETE) { - return; - } - - if (sub.length > 0) { - frag.appendChild(doc.createTextNode(sub)); - } - - return frag; - } - - // Copy nodes between the start/end offsets. - n = _getSelectedNode(self[START_CONTAINER], self[START_OFFSET]); - cnt = self[END_OFFSET] - self[START_OFFSET]; - - while (n && cnt > 0) { - sibling = n.nextSibling; - xferNode = _traverseFullySelected(n, how); - - if (frag) { - frag.appendChild(xferNode); - } - - --cnt; - n = sibling; - } - - // Nothing is partially selected, so collapse to start point - if (how != CLONE) { - self.collapse(TRUE); - } - - return frag; - } - - function _traverseCommonStartContainer(endAncestor, how) { - var frag, n, endIdx, cnt, sibling, xferNode; - - if (how != DELETE) { - frag = createDocumentFragment(); - } - - n = _traverseRightBoundary(endAncestor, how); - - if (frag) { - frag.appendChild(n); - } - - endIdx = nodeIndex(endAncestor); - cnt = endIdx - self[START_OFFSET]; - - if (cnt <= 0) { - // Collapse to just before the endAncestor, which - // is partially selected. - if (how != CLONE) { - self.setEndBefore(endAncestor); - self.collapse(FALSE); - } - - return frag; - } - - n = endAncestor.previousSibling; - while (cnt > 0) { - sibling = n.previousSibling; - xferNode = _traverseFullySelected(n, how); - - if (frag) { - frag.insertBefore(xferNode, frag.firstChild); - } - - --cnt; - n = sibling; - } - - // Collapse to just before the endAncestor, which - // is partially selected. - if (how != CLONE) { - self.setEndBefore(endAncestor); - self.collapse(FALSE); - } - - return frag; - } - - function _traverseCommonEndContainer(startAncestor, how) { - var frag, startIdx, n, cnt, sibling, xferNode; - - if (how != DELETE) { - frag = createDocumentFragment(); - } - - n = _traverseLeftBoundary(startAncestor, how); - if (frag) { - frag.appendChild(n); - } - - startIdx = nodeIndex(startAncestor); - ++startIdx; // Because we already traversed it - - cnt = self[END_OFFSET] - startIdx; - n = startAncestor.nextSibling; - while (n && cnt > 0) { - sibling = n.nextSibling; - xferNode = _traverseFullySelected(n, how); - - if (frag) { - frag.appendChild(xferNode); - } - - --cnt; - n = sibling; - } - - if (how != CLONE) { - self.setStartAfter(startAncestor); - self.collapse(TRUE); - } - - return frag; - } - - function _traverseCommonAncestors(startAncestor, endAncestor, how) { - var n, frag, startOffset, endOffset, cnt, sibling, nextSibling; - - if (how != DELETE) { - frag = createDocumentFragment(); - } - - n = _traverseLeftBoundary(startAncestor, how); - if (frag) { - frag.appendChild(n); - } - - startOffset = nodeIndex(startAncestor); - endOffset = nodeIndex(endAncestor); - ++startOffset; - - cnt = endOffset - startOffset; - sibling = startAncestor.nextSibling; - - while (cnt > 0) { - nextSibling = sibling.nextSibling; - n = _traverseFullySelected(sibling, how); - - if (frag) { - frag.appendChild(n); - } - - sibling = nextSibling; - --cnt; - } - - n = _traverseRightBoundary(endAncestor, how); - - if (frag) { - frag.appendChild(n); - } - - if (how != CLONE) { - self.setStartAfter(startAncestor); - self.collapse(TRUE); - } - - return frag; - } - - function _traverseRightBoundary(root, how) { - var next = _getSelectedNode(self[END_CONTAINER], self[END_OFFSET] - 1), parent, clonedParent; - var prevSibling, clonedChild, clonedGrandParent, isFullySelected = next != self[END_CONTAINER]; - - if (next == root) { - return _traverseNode(next, isFullySelected, FALSE, how); - } - - parent = next.parentNode; - clonedParent = _traverseNode(parent, FALSE, FALSE, how); - - while (parent) { - while (next) { - prevSibling = next.previousSibling; - clonedChild = _traverseNode(next, isFullySelected, FALSE, how); - - if (how != DELETE) { - clonedParent.insertBefore(clonedChild, clonedParent.firstChild); - } - - isFullySelected = TRUE; - next = prevSibling; - } - - if (parent == root) { - return clonedParent; - } - - next = parent.previousSibling; - parent = parent.parentNode; - - clonedGrandParent = _traverseNode(parent, FALSE, FALSE, how); - - if (how != DELETE) { - clonedGrandParent.appendChild(clonedParent); - } - - clonedParent = clonedGrandParent; - } - } - - function _traverseLeftBoundary(root, how) { - var next = _getSelectedNode(self[START_CONTAINER], self[START_OFFSET]), isFullySelected = next != self[START_CONTAINER]; - var parent, clonedParent, nextSibling, clonedChild, clonedGrandParent; - - if (next == root) { - return _traverseNode(next, isFullySelected, TRUE, how); - } - - parent = next.parentNode; - clonedParent = _traverseNode(parent, FALSE, TRUE, how); - - while (parent) { - while (next) { - nextSibling = next.nextSibling; - clonedChild = _traverseNode(next, isFullySelected, TRUE, how); - - if (how != DELETE) { - clonedParent.appendChild(clonedChild); - } - - isFullySelected = TRUE; - next = nextSibling; - } - - if (parent == root) { - return clonedParent; - } - - next = parent.nextSibling; - parent = parent.parentNode; - - clonedGrandParent = _traverseNode(parent, FALSE, TRUE, how); - - if (how != DELETE) { - clonedGrandParent.appendChild(clonedParent); - } - - clonedParent = clonedGrandParent; - } - } - - function _traverseNode(n, isFullySelected, isLeft, how) { - var txtValue, newNodeValue, oldNodeValue, offset, newNode; - - if (isFullySelected) { - return _traverseFullySelected(n, how); - } - - if (n.nodeType == 3 /* TEXT_NODE */) { - txtValue = n.nodeValue; - - if (isLeft) { - offset = self[START_OFFSET]; - newNodeValue = txtValue.substring(offset); - oldNodeValue = txtValue.substring(0, offset); - } else { - offset = self[END_OFFSET]; - newNodeValue = txtValue.substring(0, offset); - oldNodeValue = txtValue.substring(offset); - } - - if (how != CLONE) { - n.nodeValue = oldNodeValue; - } - - if (how == DELETE) { - return; - } - - newNode = dom.clone(n, FALSE); - newNode.nodeValue = newNodeValue; - - return newNode; - } - - if (how == DELETE) { - return; - } - - return dom.clone(n, FALSE); - } - - function _traverseFullySelected(n, how) { - if (how != DELETE) { - return how == CLONE ? dom.clone(n, TRUE) : n; - } - - n.parentNode.removeChild(n); - } - - function toStringIE() { - return dom.create('body', null, cloneContents()).outerText; - } - - extend(self, { - // Inital states - startContainer: doc, - startOffset: 0, - endContainer: doc, - endOffset: 0, - collapsed: TRUE, - commonAncestorContainer: doc, - - // Range constants - START_TO_START: 0, - START_TO_END: 1, - END_TO_END: 2, - END_TO_START: 3, - - // Public methods - setStart: setStart, - setEnd: setEnd, - setStartBefore: setStartBefore, - setStartAfter: setStartAfter, - setEndBefore: setEndBefore, - setEndAfter: setEndAfter, - collapse: collapse, - selectNode: selectNode, - selectNodeContents: selectNodeContents, - compareBoundaryPoints: compareBoundaryPoints, - deleteContents: deleteContents, - extractContents: extractContents, - cloneContents: cloneContents, - insertNode: insertNode, - surroundContents: surroundContents, - cloneRange: cloneRange, - toStringIE: toStringIE - }); - - return self; - } - - // Older IE versions doesn't let you override toString by it's constructor so we have to stick it in the prototype - Range.prototype.toString = function() { - return this.toStringIE(); - }; - - return Range; -}); - -// Included from: js/tinymce/classes/html/Entities.js - -/** - * Entities.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*jshint bitwise:false */ -/*eslint no-bitwise:0 */ - -/** - * Entity encoder class. - * - * @class tinymce.html.Entities - * @static - * @version 3.4 - */ -define("tinymce/html/Entities", [ - "tinymce/util/Tools" -], function(Tools) { - var makeMap = Tools.makeMap; - - var namedEntities, baseEntities, reverseEntities, - attrsCharsRegExp = /[&<>\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g, - textCharsRegExp = /[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g, - rawCharsRegExp = /[<>&\"\']/g, - entityRegExp = /&(#x|#)?([\w]+);/g, - asciiMap = { - 128: "\u20AC", 130: "\u201A", 131: "\u0192", 132: "\u201E", 133: "\u2026", 134: "\u2020", - 135: "\u2021", 136: "\u02C6", 137: "\u2030", 138: "\u0160", 139: "\u2039", 140: "\u0152", - 142: "\u017D", 145: "\u2018", 146: "\u2019", 147: "\u201C", 148: "\u201D", 149: "\u2022", - 150: "\u2013", 151: "\u2014", 152: "\u02DC", 153: "\u2122", 154: "\u0161", 155: "\u203A", - 156: "\u0153", 158: "\u017E", 159: "\u0178" - }; - - // Raw entities - baseEntities = { - '\"': '"', // Needs to be escaped since the YUI compressor would otherwise break the code - "'": ''', - '<': '<', - '>': '>', - '&': '&' - }; - - // Reverse lookup table for raw entities - reverseEntities = { - '<': '<', - '>': '>', - '&': '&', - '"': '"', - ''': "'" - }; - - // Decodes text by using the browser - function nativeDecode(text) { - var elm; - - elm = document.createElement("div"); - elm.innerHTML = text; - - return elm.textContent || elm.innerText || text; - } - - // Build a two way lookup table for the entities - function buildEntitiesLookup(items, radix) { - var i, chr, entity, lookup = {}; - - if (items) { - items = items.split(','); - radix = radix || 10; - - // Build entities lookup table - for (i = 0; i < items.length; i += 2) { - chr = String.fromCharCode(parseInt(items[i], radix)); - - // Only add non base entities - if (!baseEntities[chr]) { - entity = '&' + items[i + 1] + ';'; - lookup[chr] = entity; - lookup[entity] = chr; - } - } - - return lookup; - } - } - - // Unpack entities lookup where the numbers are in radix 32 to reduce the size - namedEntities = buildEntitiesLookup( - '50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,' + - '5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,' + - '5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,' + - '5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,' + - '68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,' + - '6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,' + - '6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,' + - '75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,' + - '7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,' + - '7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,' + - 'sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,' + - 'st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,' + - 't9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,' + - 'tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,' + - 'u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,' + - '81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,' + - '8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,' + - '8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,' + - '8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,' + - '8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,' + - 'nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,' + - 'rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,' + - 'Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,' + - '80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,' + - '811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro', 32); - - var Entities = { - /** - * Encodes the specified string using raw entities. This means only the required XML base entities will be endoded. - * - * @method encodeRaw - * @param {String} text Text to encode. - * @param {Boolean} attr Optional flag to specify if the text is attribute contents. - * @return {String} Entity encoded text. - */ - encodeRaw: function(text, attr) { - return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { - return baseEntities[chr] || chr; - }); - }, - - /** - * Encoded the specified text with both the attributes and text entities. This function will produce larger text contents - * since it doesn't know if the context is within a attribute or text node. This was added for compatibility - * and is exposed as the DOMUtils.encode function. - * - * @method encodeAllRaw - * @param {String} text Text to encode. - * @return {String} Entity encoded text. - */ - encodeAllRaw: function(text) { - return ('' + text).replace(rawCharsRegExp, function(chr) { - return baseEntities[chr] || chr; - }); - }, - - /** - * Encodes the specified string using numeric entities. The core entities will be - * encoded as named ones but all non lower ascii characters will be encoded into numeric entities. - * - * @method encodeNumeric - * @param {String} text Text to encode. - * @param {Boolean} attr Optional flag to specify if the text is attribute contents. - * @return {String} Entity encoded text. - */ - encodeNumeric: function(text, attr) { - return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { - // Multi byte sequence convert it to a single entity - if (chr.length > 1) { - return '&#' + (((chr.charCodeAt(0) - 0xD800) * 0x400) + (chr.charCodeAt(1) - 0xDC00) + 0x10000) + ';'; - } - - return baseEntities[chr] || '&#' + chr.charCodeAt(0) + ';'; - }); - }, - - /** - * Encodes the specified string using named entities. The core entities will be encoded - * as named ones but all non lower ascii characters will be encoded into named entities. - * - * @method encodeNamed - * @param {String} text Text to encode. - * @param {Boolean} attr Optional flag to specify if the text is attribute contents. - * @param {Object} entities Optional parameter with entities to use. - * @return {String} Entity encoded text. - */ - encodeNamed: function(text, attr, entities) { - entities = entities || namedEntities; - - return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { - return baseEntities[chr] || entities[chr] || chr; - }); - }, - - /** - * Returns an encode function based on the name(s) and it's optional entities. - * - * @method getEncodeFunc - * @param {String} name Comma separated list of encoders for example named,numeric. - * @param {String} entities Optional parameter with entities to use instead of the built in set. - * @return {function} Encode function to be used. - */ - getEncodeFunc: function(name, entities) { - entities = buildEntitiesLookup(entities) || namedEntities; - - function encodeNamedAndNumeric(text, attr) { - return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function(chr) { - return baseEntities[chr] || entities[chr] || '&#' + chr.charCodeAt(0) + ';' || chr; - }); - } - - function encodeCustomNamed(text, attr) { - return Entities.encodeNamed(text, attr, entities); - } - - // Replace + with , to be compatible with previous TinyMCE versions - name = makeMap(name.replace(/\+/g, ',')); - - // Named and numeric encoder - if (name.named && name.numeric) { - return encodeNamedAndNumeric; - } - - // Named encoder - if (name.named) { - // Custom names - if (entities) { - return encodeCustomNamed; - } - - return Entities.encodeNamed; - } - - // Numeric - if (name.numeric) { - return Entities.encodeNumeric; - } - - // Raw encoder - return Entities.encodeRaw; - }, - - /** - * Decodes the specified string, this will replace entities with raw UTF characters. - * - * @method decode - * @param {String} text Text to entity decode. - * @return {String} Entity decoded string. - */ - decode: function(text) { - return text.replace(entityRegExp, function(all, numeric, value) { - if (numeric) { - value = parseInt(value, numeric.length === 2 ? 16 : 10); - - // Support upper UTF - if (value > 0xFFFF) { - value -= 0x10000; - - return String.fromCharCode(0xD800 + (value >> 10), 0xDC00 + (value & 0x3FF)); - } else { - return asciiMap[value] || String.fromCharCode(value); - } - } - - return reverseEntities[all] || namedEntities[all] || nativeDecode(all); - }); - } - }; - - return Entities; -}); - -// Included from: js/tinymce/classes/Env.js - -/** - * Env.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class contains various environment constants like browser versions etc. - * Normally you don't want to sniff specific browser versions but sometimes you have - * to when it's impossible to feature detect. So use this with care. - * - * @class tinymce.Env - * @static - */ -define("tinymce/Env", [], function() { - var nav = navigator, userAgent = nav.userAgent; - var opera, webkit, ie, ie11, gecko, mac, iDevice; - - opera = window.opera && window.opera.buildNumber; - webkit = /WebKit/.test(userAgent); - ie = !webkit && !opera && (/MSIE/gi).test(userAgent) && (/Explorer/gi).test(nav.appName); - ie = ie && /MSIE (\w+)\./.exec(userAgent)[1]; - ie11 = userAgent.indexOf('Trident/') != -1 && (userAgent.indexOf('rv:') != -1 || nav.appName.indexOf('Netscape') != -1) ? 11 : false; - ie = ie || ie11; - gecko = !webkit && !ie11 && /Gecko/.test(userAgent); - mac = userAgent.indexOf('Mac') != -1; - iDevice = /(iPad|iPhone)/.test(userAgent); - - // Is a iPad/iPhone and not on iOS5 sniff the WebKit version since older iOS WebKit versions - // says it has contentEditable support but there is no visible caret. - var contentEditable = !iDevice || userAgent.match(/AppleWebKit\/(\d*)/)[1] >= 534; - - return { - /** - * Constant that is true if the browser is Opera. - * - * @property opera - * @type Boolean - * @final - */ - opera: opera, - - /** - * Constant that is true if the browser is WebKit (Safari/Chrome). - * - * @property webKit - * @type Boolean - * @final - */ - webkit: webkit, - - /** - * Constant that is more than zero if the browser is IE. - * - * @property ie - * @type Boolean - * @final - */ - ie: ie, - - /** - * Constant that is true if the browser is Gecko. - * - * @property gecko - * @type Boolean - * @final - */ - gecko: gecko, - - /** - * Constant that is true if the os is Mac OS. - * - * @property mac - * @type Boolean - * @final - */ - mac: mac, - - /** - * Constant that is true if the os is iOS. - * - * @property iOS - * @type Boolean - * @final - */ - iOS: iDevice, - - /** - * Constant that is true if the browser supports editing. - * - * @property contentEditable - * @type Boolean - * @final - */ - contentEditable: contentEditable, - - /** - * Transparent image data url. - * - * @property transparentSrc - * @type Boolean - * @final - */ - transparentSrc: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", - - /** - * Returns true/false if the browser can or can't place the caret after a inline block like an image. - * - * @property noCaretAfter - * @type Boolean - * @final - */ - caretAfter: ie != 8, - - /** - * Constant that is true if the browser supports native DOM Ranges. IE 9+. - * - * @property range - * @type Boolean - */ - range: window.getSelection && "Range" in window, - - /** - * Returns the IE document mode for non IE browsers this will fake IE 10. - * - * @property documentMode - * @type Number - */ - documentMode: ie ? (document.documentMode || 7) : 10 - }; -}); - -// Included from: js/tinymce/classes/dom/StyleSheetLoader.js - -/** - * StyleSheetLoader.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class handles loading of external stylesheets and fires events when these are loaded. - * - * @class tinymce.dom.StyleSheetLoader - * @private - */ -define("tinymce/dom/StyleSheetLoader", [], function() { - "use strict"; - - return function(document, settings) { - var idCount = 0, loadedStates = {}, maxLoadTime; - - settings = settings || {}; - maxLoadTime = settings.maxLoadTime || 5000; - - function appendToHead(node) { - document.getElementsByTagName('head')[0].appendChild(node); - } - - /** - * Loads the specified css style sheet file and call the loadedCallback once it's finished loading. - * - * @method load - * @param {String} url Url to be loaded. - * @param {Function} loadedCallback Callback to be executed when loaded. - * @param {Function} errorCallback Callback to be executed when failed loading. - */ - function load(url, loadedCallback, errorCallback) { - var link, style, startTime, state; - - function passed() { - var callbacks = state.passed, i = callbacks.length; - - while (i--) { - callbacks[i](); - } - - state.status = 2; - state.passed = []; - state.failed = []; - } - - function failed() { - var callbacks = state.failed, i = callbacks.length; - - while (i--) { - callbacks[i](); - } - - state.status = 3; - state.passed = []; - state.failed = []; - } - - // Sniffs for older WebKit versions that have the link.onload but a broken one - function isOldWebKit() { - var webKitChunks = navigator.userAgent.match(/WebKit\/(\d*)/); - return !!(webKitChunks && webKitChunks[1] < 536); - } - - // Calls the waitCallback until the test returns true or the timeout occurs - function wait(testCallback, waitCallback) { - if (!testCallback()) { - // Wait for timeout - if ((new Date().getTime()) - startTime < maxLoadTime) { - window.setTimeout(waitCallback, 0); - } else { - failed(); - } - } - } - - // Workaround for WebKit that doesn't properly support the onload event for link elements - // Or WebKit that fires the onload event before the StyleSheet is added to the document - function waitForWebKitLinkLoaded() { - wait(function() { - var styleSheets = document.styleSheets, styleSheet, i = styleSheets.length, owner; - - while (i--) { - styleSheet = styleSheets[i]; - owner = styleSheet.ownerNode ? styleSheet.ownerNode : styleSheet.owningElement; - if (owner && owner.id === link.id) { - passed(); - return true; - } - } - }, waitForWebKitLinkLoaded); - } - - // Workaround for older Geckos that doesn't have any onload event for StyleSheets - function waitForGeckoLinkLoaded() { - wait(function() { - try { - // Accessing the cssRules will throw an exception until the CSS file is loaded - var cssRules = style.sheet.cssRules; - passed(); - return !!cssRules; - } catch (ex) { - // Ignore - } - }, waitForGeckoLinkLoaded); - } - - if (!loadedStates[url]) { - state = { - passed: [], - failed: [] - }; - - loadedStates[url] = state; - } else { - state = loadedStates[url]; - } - - if (loadedCallback) { - state.passed.push(loadedCallback); - } - - if (errorCallback) { - state.failed.push(errorCallback); - } - - // Is loading wait for it to pass - if (state.status == 1) { - return; - } - - // Has finished loading and was success - if (state.status == 2) { - passed(); - return; - } - - // Has finished loading and was a failure - if (state.status == 3) { - failed(); - return; - } - - // Start loading - state.status = 1; - link = document.createElement('link'); - link.rel = 'stylesheet'; - link.type = 'text/css'; - link.id = 'u' + (idCount++); - link.async = false; - link.defer = false; - startTime = new Date().getTime(); - - // Feature detect onload on link element and sniff older webkits since it has an broken onload event - if ("onload" in link && !isOldWebKit()) { - link.onload = waitForWebKitLinkLoaded; - link.onerror = failed; - } else { - // Sniff for old Firefox that doesn't support the onload event on link elements - // TODO: Remove this in the future when everyone uses modern browsers - if (navigator.userAgent.indexOf("Firefox") > 0) { - style = document.createElement('style'); - style.textContent = '@import "' + url + '"'; - waitForGeckoLinkLoaded(); - appendToHead(style); - return; - } else { - // Use the id owner on older webkits - waitForWebKitLinkLoaded(); - } - } - - appendToHead(link); - link.href = url; - } - - this.load = load; - }; -}); - -// Included from: js/tinymce/classes/dom/DOMUtils.js - -/** - * DOMUtils.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Utility class for various DOM manipulation and retrieval functions. - * - * @class tinymce.dom.DOMUtils - * @example - * // Add a class to an element by id in the page - * tinymce.DOM.addClass('someid', 'someclass'); - * - * // Add a class to an element by id inside the editor - * tinymce.activeEditor.dom.addClass('someid', 'someclass'); - */ -define("tinymce/dom/DOMUtils", [ - "tinymce/dom/Sizzle", - "tinymce/html/Styles", - "tinymce/dom/EventUtils", - "tinymce/dom/TreeWalker", - "tinymce/dom/Range", - "tinymce/html/Entities", - "tinymce/Env", - "tinymce/util/Tools", - "tinymce/dom/StyleSheetLoader" -], function(Sizzle, Styles, EventUtils, TreeWalker, Range, Entities, Env, Tools, StyleSheetLoader) { - // Shorten names - var each = Tools.each, is = Tools.is, grep = Tools.grep, trim = Tools.trim, extend = Tools.extend; - var isWebKit = Env.webkit, isIE = Env.ie; - var simpleSelectorRe = /^([a-z0-9],?)+$/i; - var whiteSpaceRegExp = /^[ \t\r\n]*$/; - var numericCssMap = Tools.makeMap('fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom', ' '); - - /** - * Constructs a new DOMUtils instance. Consult the Wiki for more details on settings etc for this class. - * - * @constructor - * @method DOMUtils - * @param {Document} d Document reference to bind the utility class to. - * @param {settings} s Optional settings collection. - */ - function DOMUtils(doc, settings) { - var self = this, blockElementsMap; - - self.doc = doc; - self.win = window; - self.files = {}; - self.counter = 0; - self.stdMode = !isIE || doc.documentMode >= 8; - self.boxModel = !isIE || doc.compatMode == "CSS1Compat" || self.stdMode; - self.hasOuterHTML = "outerHTML" in doc.createElement("a"); - self.styleSheetLoader = new StyleSheetLoader(doc); - this.boundEvents = []; - - self.settings = settings = extend({ - keep_values: false, - hex_colors: 1 - }, settings); - - self.schema = settings.schema; - self.styles = new Styles({ - url_converter: settings.url_converter, - url_converter_scope: settings.url_converter_scope - }, settings.schema); - - self.fixDoc(doc); - self.events = settings.ownEvents ? new EventUtils(settings.proxy) : EventUtils.Event; - blockElementsMap = settings.schema ? settings.schema.getBlockElements() : {}; - - /** - * Returns true/false if the specified element is a block element or not. - * - * @method isBlock - * @param {Node/String} node Element/Node to check. - * @return {Boolean} True/False state if the node is a block element or not. - */ - self.isBlock = function(node) { - // Fix for #5446 - if (!node) { - return false; - } - - // This function is called in module pattern style since it might be executed with the wrong this scope - var type = node.nodeType; - - // If it's a node then check the type and use the nodeName - if (type) { - return !!(type === 1 && blockElementsMap[node.nodeName]); - } - - return !!blockElementsMap[node]; - }; - } - - DOMUtils.prototype = { - root: null, - props: { - "for": "htmlFor", - "class": "className", - className: "className", - checked: "checked", - disabled: "disabled", - maxlength: "maxLength", - readonly: "readOnly", - selected: "selected", - value: "value", - id: "id", - name: "name", - type: "type" - }, - - fixDoc: function(doc) { - var settings = this.settings, name; - - if (isIE && settings.schema) { - // Add missing HTML 4/5 elements to IE - ('abbr article aside audio canvas ' + - 'details figcaption figure footer ' + - 'header hgroup mark menu meter nav ' + - 'output progress section summary ' + - 'time video').replace(/\w+/g, function(name) { - doc.createElement(name); - }); - - // Create all custom elements - for (name in settings.schema.getCustomElements()) { - doc.createElement(name); - } - } - }, - - clone: function(node, deep) { - var self = this, clone, doc; - - // TODO: Add feature detection here in the future - if (!isIE || node.nodeType !== 1 || deep) { - return node.cloneNode(deep); - } - - doc = self.doc; - - // Make a HTML5 safe shallow copy - if (!deep) { - clone = doc.createElement(node.nodeName); - - // Copy attribs - each(self.getAttribs(node), function(attr) { - self.setAttrib(clone, attr.nodeName, self.getAttrib(node, attr.nodeName)); - }); - - return clone; - } -/* - // Setup HTML5 patched document fragment - if (!self.frag) { - self.frag = doc.createDocumentFragment(); - self.fixDoc(self.frag); - } - - // Make a deep copy by adding it to the document fragment then removing it this removed the :section - clone = doc.createElement('div'); - self.frag.appendChild(clone); - clone.innerHTML = node.outerHTML; - self.frag.removeChild(clone); -*/ - return clone.firstChild; - }, - - /** - * Returns the root node of the document. This is normally the body but might be a DIV. Parents like getParent will not - * go above the point of this root node. - * - * @method getRoot - * @return {Element} Root element for the utility class. - */ - getRoot: function() { - var self = this; - - return self.get(self.settings.root_element) || self.doc.body; - }, - - /** - * Returns the viewport of the window. - * - * @method getViewPort - * @param {Window} win Optional window to get viewport of. - * @return {Object} Viewport object with fields x, y, w and h. - */ - getViewPort: function(win) { - var doc, rootElm; - - win = !win ? this.win : win; - doc = win.document; - rootElm = this.boxModel ? doc.documentElement : doc.body; - - // Returns viewport size excluding scrollbars - return { - x: win.pageXOffset || rootElm.scrollLeft, - y: win.pageYOffset || rootElm.scrollTop, - w: win.innerWidth || rootElm.clientWidth, - h: win.innerHeight || rootElm.clientHeight - }; - }, - - /** - * Returns the rectangle for a specific element. - * - * @method getRect - * @param {Element/String} elm Element object or element ID to get rectangle from. - * @return {object} Rectangle for specified element object with x, y, w, h fields. - */ - getRect: function(elm) { - var self = this, pos, size; - - elm = self.get(elm); - pos = self.getPos(elm); - size = self.getSize(elm); - - return { - x: pos.x, y: pos.y, - w: size.w, h: size.h - }; - }, - - /** - * Returns the size dimensions of the specified element. - * - * @method getSize - * @param {Element/String} elm Element object or element ID to get rectangle from. - * @return {object} Rectangle for specified element object with w, h fields. - */ - getSize: function(elm) { - var self = this, w, h; - - elm = self.get(elm); - w = self.getStyle(elm, 'width'); - h = self.getStyle(elm, 'height'); - - // Non pixel value, then force offset/clientWidth - if (w.indexOf('px') === -1) { - w = 0; - } - - // Non pixel value, then force offset/clientWidth - if (h.indexOf('px') === -1) { - h = 0; - } - - return { - w: parseInt(w, 10) || elm.offsetWidth || elm.clientWidth, - h: parseInt(h, 10) || elm.offsetHeight || elm.clientHeight - }; - }, - - /** - * Returns a node by the specified selector function. This function will - * loop through all parent nodes and call the specified function for each node. - * If the function then returns true indicating that it has found what it was looking for, the loop execution will then end - * and the node it found will be returned. - * - * @method getParent - * @param {Node/String} node DOM node to search parents on or ID string. - * @param {function} selector Selection function or CSS selector to execute on each node. - * @param {Node} root Optional root element, never go below this point. - * @return {Node} DOM Node or null if it wasn't found. - */ - getParent: function(node, selector, root) { - return this.getParents(node, selector, root, false); - }, - - /** - * Returns a node list of all parents matching the specified selector function or pattern. - * If the function then returns true indicating that it has found what it was looking for and that node will be collected. - * - * @method getParents - * @param {Node/String} node DOM node to search parents on or ID string. - * @param {function} selector Selection function to execute on each node or CSS pattern. - * @param {Node} root Optional root element, never go below this point. - * @return {Array} Array of nodes or null if it wasn't found. - */ - getParents: function(node, selector, root, collect) { - var self = this, selectorVal, result = []; - - node = self.get(node); - collect = collect === undefined; - - // Default root on inline mode - root = root || (self.getRoot().nodeName != 'BODY' ? self.getRoot().parentNode : null); - - // Wrap node name as func - if (is(selector, 'string')) { - selectorVal = selector; - - if (selector === '*') { - selector = function(node) {return node.nodeType == 1;}; - } else { - selector = function(node) { - return self.is(node, selectorVal); - }; - } - } - - while (node) { - if (node == root || !node.nodeType || node.nodeType === 9) { - break; - } - - if (!selector || selector(node)) { - if (collect) { - result.push(node); - } else { - return node; - } - } - - node = node.parentNode; - } - - return collect ? result : null; - }, - - /** - * Returns the specified element by ID or the input element if it isn't a string. - * - * @method get - * @param {String/Element} n Element id to look for or element to just pass though. - * @return {Element} Element matching the specified id or null if it wasn't found. - */ - get: function(elm) { - var name; - - if (elm && this.doc && typeof(elm) == 'string') { - name = elm; - elm = this.doc.getElementById(elm); - - // IE and Opera returns meta elements when they match the specified input ID, but getElementsByName seems to do the trick - if (elm && elm.id !== name) { - return this.doc.getElementsByName(name)[1]; - } - } - - return elm; - }, - - /** - * Returns the next node that matches selector or function - * - * @method getNext - * @param {Node} node Node to find siblings from. - * @param {String/function} selector Selector CSS expression or function. - * @return {Node} Next node item matching the selector or null if it wasn't found. - */ - getNext: function(node, selector) { - return this._findSib(node, selector, 'nextSibling'); - }, - - /** - * Returns the previous node that matches selector or function - * - * @method getPrev - * @param {Node} node Node to find siblings from. - * @param {String/function} selector Selector CSS expression or function. - * @return {Node} Previous node item matching the selector or null if it wasn't found. - */ - getPrev: function(node, selector) { - return this._findSib(node, selector, 'previousSibling'); - }, - - // #ifndef jquery - - /** - * Selects specific elements by a CSS level 3 pattern. For example "div#a1 p.test". - * This function is optimized for the most common patterns needed in TinyMCE but it also performs well enough - * on more complex patterns. - * - * @method select - * @param {String} selector CSS level 3 pattern to select/find elements by. - * @param {Object} scope Optional root element/scope element to search in. - * @return {Array} Array with all matched elements. - * @example - * // Adds a class to all paragraphs in the currently active editor - * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'someclass'); - * - * // Adds a class to all spans that have the test class in the currently active editor - * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('span.test'), 'someclass') - */ - select: function(selector, scope) { - var self = this; - - //Sizzle.selectors.cacheLength = 0; - return Sizzle(selector, self.get(scope) || self.get(self.settings.root_element) || self.doc, []); - }, - - /** - * Returns true/false if the specified element matches the specified css pattern. - * - * @method is - * @param {Node/NodeList} elm DOM node to match or an array of nodes to match. - * @param {String} selector CSS pattern to match the element against. - */ - is: function(elm, selector) { - var i; - - // If it isn't an array then try to do some simple selectors instead of Sizzle for to boost performance - if (elm.length === undefined) { - // Simple all selector - if (selector === '*') { - return elm.nodeType == 1; - } - - // Simple selector just elements - if (simpleSelectorRe.test(selector)) { - selector = selector.toLowerCase().split(/,/); - elm = elm.nodeName.toLowerCase(); - - for (i = selector.length - 1; i >= 0; i--) { - if (selector[i] == elm) { - return true; - } - } - - return false; - } - } - - // Is non element - if (elm.nodeType && elm.nodeType != 1) { - return false; - } - - var elms = elm.nodeType ? [elm] : elm; - return Sizzle(selector, elms[0].ownerDocument || elms[0], null, elms).length > 0; - }, - - // #endif - - /** - * Adds the specified element to another element or elements. - * - * @method add - * @param {String/Element/Array} parentElm Element id string, DOM node element or array of ids or elements to add to. - * @param {String/Element} name Name of new element to add or existing element to add. - * @param {Object} attrs Optional object collection with arguments to add to the new element(s). - * @param {String} html Optional inner HTML contents to add for each element. - * @return {Element/Array} Element that got created, or an array of created elements if multiple input elements - * were passed in. - * @example - * // Adds a new paragraph to the end of the active editor - * tinymce.activeEditor.dom.add(tinymce.activeEditor.getBody(), 'p', {title: 'my title'}, 'Some content'); - */ - add: function(parentElm, name, attrs, html, create) { - var self = this; - - return this.run(parentElm, function(parentElm) { - var newElm; - - newElm = is(name, 'string') ? self.doc.createElement(name) : name; - self.setAttribs(newElm, attrs); - - if (html) { - if (html.nodeType) { - newElm.appendChild(html); - } else { - self.setHTML(newElm, html); - } - } - - return !create ? parentElm.appendChild(newElm) : newElm; - }); - }, - - /** - * Creates a new element. - * - * @method create - * @param {String} name Name of new element. - * @param {Object} attrs Optional object name/value collection with element attributes. - * @param {String} html Optional HTML string to set as inner HTML of the element. - * @return {Element} HTML DOM node element that got created. - * @example - * // Adds an element where the caret/selection is in the active editor - * var el = tinymce.activeEditor.dom.create('div', {id: 'test', 'class': 'myclass'}, 'some content'); - * tinymce.activeEditor.selection.setNode(el); - */ - create: function(name, attrs, html) { - return this.add(this.doc.createElement(name), name, attrs, html, 1); - }, - - /** - * Creates HTML string for element. The element will be closed unless an empty inner HTML string is passed in. - * - * @method createHTML - * @param {String} name Name of new element. - * @param {Object} attrs Optional object name/value collection with element attributes. - * @param {String} html Optional HTML string to set as inner HTML of the element. - * @return {String} String with new HTML element, for example: test. - * @example - * // Creates a html chunk and inserts it at the current selection/caret location - * tinymce.activeEditor.selection.setContent(tinymce.activeEditor.dom.createHTML('a', {href: 'test.html'}, 'some line')); - */ - createHTML: function(name, attrs, html) { - var outHtml = '', key; - - outHtml += '<' + name; - - for (key in attrs) { - if (attrs.hasOwnProperty(key) && attrs[key] !== null) { - outHtml += ' ' + key + '="' + this.encode(attrs[key]) + '"'; - } - } - - // A call to tinymce.is doesn't work for some odd reason on IE9 possible bug inside their JS runtime - if (typeof(html) != "undefined") { - return outHtml + '>' + html + ''; - } - - return outHtml + ' />'; - }, - - /** - * Creates a document fragment out of the specified HTML string. - * - * @method createFragment - * @param {String} html Html string to create fragment from. - * @return {DocumentFragment} Document fragment node. - */ - createFragment: function(html) { - var frag, node, doc = this.doc, container; - - container = doc.createElement("div"); - frag = doc.createDocumentFragment(); - - if (html) { - container.innerHTML = html; - } - - while ((node = container.firstChild)) { - frag.appendChild(node); - } - - return frag; - }, - - /** - * Removes/deletes the specified element(s) from the DOM. - * - * @method remove - * @param {String/Element/Array} node ID of element or DOM element object or array containing multiple elements/ids. - * @param {Boolean} keep_children Optional state to keep children or not. If set to true all children will be - * placed at the location of the removed element. - * @return {Element/Array} HTML DOM element that got removed, or an array of removed elements if multiple input elements - * were passed in. - * @example - * // Removes all paragraphs in the active editor - * tinymce.activeEditor.dom.remove(tinymce.activeEditor.dom.select('p')); - * - * // Removes an element by id in the document - * tinymce.DOM.remove('mydiv'); - */ - remove: function(node, keep_children) { - return this.run(node, function(node) { - var child, parent = node.parentNode; - - if (!parent) { - return null; - } - - if (keep_children) { - while ((child = node.firstChild)) { - // IE 8 will crash if you don't remove completely empty text nodes - if (!isIE || child.nodeType !== 3 || child.nodeValue) { - parent.insertBefore(child, node); - } else { - node.removeChild(child); - } - } - } - - return parent.removeChild(node); - }); - }, - - /** - * Sets the CSS style value on a HTML element. The name can be a camelcase string - * or the CSS style name like background-color. - * - * @method setStyle - * @param {String/Element/Array} n HTML element/Element ID or Array of elements/ids to set CSS style value on. - * @param {String} na Name of the style value to set. - * @param {String} v Value to set on the style. - * @example - * // Sets a style value on all paragraphs in the currently active editor - * tinymce.activeEditor.dom.setStyle(tinymce.activeEditor.dom.select('p'), 'background-color', 'red'); - * - * // Sets a style value to an element by id in the current document - * tinymce.DOM.setStyle('mydiv', 'background-color', 'red'); - */ - setStyle: function(elm, name, value) { - return this.run(elm, function(elm) { - var self = this, style, key; - - if (name) { - if (typeof(name) === 'string') { - style = elm.style; - - // Camelcase it, if needed - name = name.replace(/-(\D)/g, function(a, b) { - return b.toUpperCase(); - }); - - // Default px suffix on these - if (typeof(value) === 'number' && !numericCssMap[name]) { - value += 'px'; - } - - // IE specific opacity - if (name === "opacity" && elm.runtimeStyle && typeof(elm.runtimeStyle.opacity) === "undefined") { - style.filter = value === '' ? '' : "alpha(opacity=" + (value * 100) + ")"; - } - - if (name == "float") { - // Old IE vs modern browsers - name = "cssFloat" in elm.style ? "cssFloat" : "styleFloat"; - } - - try { - style[name] = value; - } catch (ex) { - // Ignore IE errors - } - - // Force update of the style data - if (self.settings.update_styles) { - elm.removeAttribute('data-mce-style'); - } - } else { - for (key in name) { - self.setStyle(elm, key, name[key]); - } - } - } - }); - }, - - /** - * Returns the current style or runtime/computed value of an element. - * - * @method getStyle - * @param {String/Element} elm HTML element or element id string to get style from. - * @param {String} name Style name to return. - * @param {Boolean} computed Computed style. - * @return {String} Current style or computed style value of an element. - */ - getStyle: function(elm, name, computed) { - elm = this.get(elm); - - if (!elm) { - return; - } - - // W3C - if (this.doc.defaultView && computed) { - // Remove camelcase - name = name.replace(/[A-Z]/g, function(a){ - return '-' + a; - }); - - try { - return this.doc.defaultView.getComputedStyle(elm, null).getPropertyValue(name); - } catch (ex) { - // Old safari might fail - return null; - } - } - - // Camelcase it, if needed - name = name.replace(/-(\D)/g, function(a, b) { - return b.toUpperCase(); - }); - - if (name == 'float') { - name = isIE ? 'styleFloat' : 'cssFloat'; - } - - // IE & Opera - if (elm.currentStyle && computed) { - return elm.currentStyle[name]; - } - - return elm.style ? elm.style[name] : undefined; - }, - - /** - * Sets multiple styles on the specified element(s). - * - * @method setStyles - * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to set styles on. - * @param {Object} o Name/Value collection of style items to add to the element(s). - * @example - * // Sets styles on all paragraphs in the currently active editor - * tinymce.activeEditor.dom.setStyles(tinymce.activeEditor.dom.select('p'), {'background-color': 'red', 'color': 'green'}); - * - * // Sets styles to an element by id in the current document - * tinymce.DOM.setStyles('mydiv', {'background-color': 'red', 'color': 'green'}); - */ - setStyles: function(elm, styles) { - this.setStyle(elm, styles); - }, - - css: function(elm, name, value) { - this.setStyle(elm, name, value); - }, - - /** - * Removes all attributes from an element or elements. - * - * @method removeAllAttribs - * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to remove attributes from. - */ - removeAllAttribs: function(e) { - return this.run(e, function(e) { - var i, attrs = e.attributes; - for (i = attrs.length - 1; i >= 0; i--) { - e.removeAttributeNode(attrs.item(i)); - } - }); - }, - - /** - * Sets the specified attribute of an element or elements. - * - * @method setAttrib - * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to set attribute on. - * @param {String} n Name of attribute to set. - * @param {String} v Value to set on the attribute - if this value is falsy like null, 0 or '' it will remove the attribute instead. - * @example - * // Sets class attribute on all paragraphs in the active editor - * tinymce.activeEditor.dom.setAttrib(tinymce.activeEditor.dom.select('p'), 'class', 'myclass'); - * - * // Sets class attribute on a specific element in the current page - * tinymce.dom.setAttrib('mydiv', 'class', 'myclass'); - */ - setAttrib: function(e, n, v) { - var self = this; - - // What's the point - if (!e || !n) { - return; - } - - return this.run(e, function(e) { - var s = self.settings; - var originalValue = e.getAttribute(n); - if (v !== null) { - switch (n) { - case "style": - if (!is(v, 'string')) { - each(v, function(v, n) { - self.setStyle(e, n, v); - }); - - return; - } - - // No mce_style for elements with these since they might get resized by the user - if (s.keep_values) { - if (v) { - e.setAttribute('data-mce-style', v, 2); - } else { - e.removeAttribute('data-mce-style', 2); - } - } - - e.style.cssText = v; - break; - - case "class": - e.className = v || ''; // Fix IE null bug - break; - - case "src": - case "href": - if (s.keep_values) { - if (s.url_converter) { - v = s.url_converter.call(s.url_converter_scope || self, v, n, e); - } - - self.setAttrib(e, 'data-mce-' + n, v, 2); - } - - break; - - case "shape": - e.setAttribute('data-mce-style', v); - break; - } - } - if (is(v) && v !== null && v.length !== 0) { - e.setAttribute(n, '' + v, 2); - } else { - e.removeAttribute(n, 2); - } - - // fire onChangeAttrib event for attributes that have changed - if (originalValue != v && s.onSetAttrib) { - s.onSetAttrib({attrElm: e, attrName: n, attrValue: v}); - } - }); - }, - - /** - * Sets two or more specified attributes of an element or elements. - * - * @method setAttribs - * @param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set attributes on. - * @param {Object} attrs Name/Value collection of attribute items to add to the element(s). - * @example - * // Sets class and title attributes on all paragraphs in the active editor - * tinymce.activeEditor.dom.setAttribs(tinymce.activeEditor.dom.select('p'), {'class': 'myclass', title: 'some title'}); - * - * // Sets class and title attributes on a specific element in the current page - * tinymce.DOM.setAttribs('mydiv', {'class': 'myclass', title: 'some title'}); - */ - setAttribs: function(elm, attrs) { - var self = this; - - return this.run(elm, function(elm) { - each(attrs, function(value, name) { - self.setAttrib(elm, name, value); - }); - }); - }, - - /** - * Returns the specified attribute by name. - * - * @method getAttrib - * @param {String/Element} elm Element string id or DOM element to get attribute from. - * @param {String} name Name of attribute to get. - * @param {String} defaultVal Optional default value to return if the attribute didn't exist. - * @return {String} Attribute value string, default value or null if the attribute wasn't found. - */ - getAttrib: function(elm, name, defaultVal) { - var value, self = this, undef; - - elm = self.get(elm); - - if (!elm || elm.nodeType !== 1) { - return defaultVal === undef ? false : defaultVal; - } - - if (!is(defaultVal)) { - defaultVal = ''; - } - - // Try the mce variant for these - if (/^(src|href|style|coords|shape)$/.test(name)) { - value = elm.getAttribute("data-mce-" + name); - - if (value) { - return value; - } - } - - if (isIE && self.props[name]) { - value = elm[self.props[name]]; - value = value && value.nodeValue ? value.nodeValue : value; - } - - if (!value) { - value = elm.getAttribute(name, 2); - } - - // Check boolean attribs - if (/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(name)) { - if (elm[self.props[name]] === true && value === '') { - return name; - } - - return value ? name : ''; - } - - // Inner input elements will override attributes on form elements - if (elm.nodeName === "FORM" && elm.getAttributeNode(name)) { - return elm.getAttributeNode(name).nodeValue; - } - - if (name === 'style') { - value = value || elm.style.cssText; - - if (value) { - value = self.serializeStyle(self.parseStyle(value), elm.nodeName); - - if (self.settings.keep_values) { - elm.setAttribute('data-mce-style', value); - } - } - } - - // Remove Apple and WebKit stuff - if (isWebKit && name === "class" && value) { - value = value.replace(/(apple|webkit)\-[a-z\-]+/gi, ''); - } - - // Handle IE issues - if (isIE) { - switch (name) { - case 'rowspan': - case 'colspan': - // IE returns 1 as default value - if (value === 1) { - value = ''; - } - - break; - - case 'size': - // IE returns +0 as default value for size - if (value === '+0' || value === 20 || value === 0) { - value = ''; - } - - break; - - case 'width': - case 'height': - case 'vspace': - case 'checked': - case 'disabled': - case 'readonly': - if (value === 0) { - value = ''; - } - - break; - - case 'hspace': - // IE returns -1 as default value - if (value === -1) { - value = ''; - } - - break; - - case 'maxlength': - case 'tabindex': - // IE returns default value - if (value === 32768 || value === 2147483647 || value === '32768') { - value = ''; - } - - break; - - case 'multiple': - case 'compact': - case 'noshade': - case 'nowrap': - if (value === 65535) { - return name; - } - - return defaultVal; - - case 'shape': - value = value.toLowerCase(); - break; - - default: - // IE has odd anonymous function for event attributes - if (name.indexOf('on') === 0 && value) { - value = ('' + value).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/, '$1'); - } - } - } - - return (value !== undef && value !== null && value !== '') ? '' + value : defaultVal; - }, - - /** - * Returns the absolute x, y position of a node. The position will be returned in an object with x, y fields. - * - * @method getPos - * @param {Element/String} elm HTML element or element id to get x, y position from. - * @param {Element} rootElm Optional root element to stop calculations at. - * @return {object} Absolute position of the specified element object with x, y fields. - */ - getPos: function(elm, rootElm) { - var self = this, x = 0, y = 0, offsetParent, doc = self.doc, pos; - - elm = self.get(elm); - rootElm = rootElm || doc.body; - - if (elm) { - // Use getBoundingClientRect if it exists since it's faster than looping offset nodes - if (rootElm === doc.body && elm.getBoundingClientRect) { - pos = elm.getBoundingClientRect(); - rootElm = self.boxModel ? doc.documentElement : doc.body; - - // Add scroll offsets from documentElement or body since IE with the wrong box model will use d.body and so do WebKit - // Also remove the body/documentelement clientTop/clientLeft on IE 6, 7 since they offset the position - x = pos.left + (doc.documentElement.scrollLeft || doc.body.scrollLeft) - rootElm.clientLeft; - y = pos.top + (doc.documentElement.scrollTop || doc.body.scrollTop) - rootElm.clientTop; - - return {x: x, y: y}; - } - - offsetParent = elm; - while (offsetParent && offsetParent != rootElm && offsetParent.nodeType) { - x += offsetParent.offsetLeft || 0; - y += offsetParent.offsetTop || 0; - offsetParent = offsetParent.offsetParent; - } - - offsetParent = elm.parentNode; - while (offsetParent && offsetParent != rootElm && offsetParent.nodeType) { - x -= offsetParent.scrollLeft || 0; - y -= offsetParent.scrollTop || 0; - offsetParent = offsetParent.parentNode; - } - } - - return {x: x, y: y}; - }, - - /** - * Parses the specified style value into an object collection. This parser will also - * merge and remove any redundant items that browsers might have added. It will also convert non-hex - * colors to hex values. Urls inside the styles will also be converted to absolute/relative based on settings. - * - * @method parseStyle - * @param {String} cssText Style value to parse, for example: border:1px solid red;. - * @return {Object} Object representation of that style, for example: {border: '1px solid red'} - */ - parseStyle: function(cssText) { - return this.styles.parse(cssText); - }, - - /** - * Serializes the specified style object into a string. - * - * @method serializeStyle - * @param {Object} styles Object to serialize as string, for example: {border: '1px solid red'} - * @param {String} name Optional element name. - * @return {String} String representation of the style object, for example: border: 1px solid red. - */ - serializeStyle: function(styles, name) { - return this.styles.serialize(styles, name); - }, - - /** - * Adds a style element at the top of the document with the specified cssText content. - * - * @method addStyle - * @param {String} cssText CSS Text style to add to top of head of document. - */ - addStyle: function(cssText) { - var self = this, doc = self.doc, head, styleElm; - - // Prevent inline from loading the same styles twice - if (self !== DOMUtils.DOM && doc === document) { - var addedStyles = DOMUtils.DOM.addedStyles; - - addedStyles = addedStyles || []; - if (addedStyles[cssText]) { - return; - } - - addedStyles[cssText] = true; - DOMUtils.DOM.addedStyles = addedStyles; - } - - // Create style element if needed - styleElm = doc.getElementById('mceDefaultStyles'); - if (!styleElm) { - styleElm = doc.createElement('style'); - styleElm.id = 'mceDefaultStyles'; - styleElm.type = 'text/css'; - - head = doc.getElementsByTagName('head')[0]; - if (head.firstChild) { - head.insertBefore(styleElm, head.firstChild); - } else { - head.appendChild(styleElm); - } - } - - // Append style data to old or new style element - if (styleElm.styleSheet) { - styleElm.styleSheet.cssText += cssText; - } else { - styleElm.appendChild(doc.createTextNode(cssText)); - } - }, - - /** - * Imports/loads the specified CSS file into the document bound to the class. - * - * @method loadCSS - * @param {String} u URL to CSS file to load. - * @example - * // Loads a CSS file dynamically into the current document - * tinymce.DOM.loadCSS('somepath/some.css'); - * - * // Loads a CSS file into the currently active editor instance - * tinymce.activeEditor.dom.loadCSS('somepath/some.css'); - * - * // Loads a CSS file into an editor instance by id - * tinymce.get('someid').dom.loadCSS('somepath/some.css'); - * - * // Loads multiple CSS files into the current document - * tinymce.DOM.loadCSS('somepath/some.css,somepath/someother.css'); - */ - loadCSS: function(url) { - var self = this, doc = self.doc, head; - - // Prevent inline from loading the same CSS file twice - if (self !== DOMUtils.DOM && doc === document) { - DOMUtils.DOM.loadCSS(url); - return; - } - - if (!url) { - url = ''; - } - - head = doc.getElementsByTagName('head')[0]; - - each(url.split(','), function(url) { - var link; - - if (self.files[url]) { - return; - } - - self.files[url] = true; - link = self.create('link', {rel: 'stylesheet', href: url}); - - // IE 8 has a bug where dynamically loading stylesheets would produce a 1 item remaining bug - // This fix seems to resolve that issue by recalcing the document once a stylesheet finishes loading - // It's ugly but it seems to work fine. - if (isIE && doc.documentMode && doc.recalc) { - link.onload = function() { - if (doc.recalc) { - doc.recalc(); - } - - link.onload = null; - }; - } - - head.appendChild(link); - }); - }, - - /** - * Adds a class to the specified element or elements. - * - * @method addClass - * @param {String/Element/Array} elm Element ID string or DOM element or array with elements or IDs. - * @param {String} cls Class name to add to each element. - * @return {String/Array} String with new class value or array with new class values for all elements. - * @example - * // Adds a class to all paragraphs in the active editor - * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'myclass'); - * - * // Adds a class to a specific element in the current page - * tinymce.DOM.addClass('mydiv', 'myclass'); - */ - addClass: function(elm, cls) { - return this.run(elm, function(elm) { - var clsVal; - - if (!cls) { - return 0; - } - - if (this.hasClass(elm, cls)) { - return elm.className; - } - - clsVal = this.removeClass(elm, cls); - elm.className = clsVal = (clsVal !== '' ? (clsVal + ' ') : '') + cls; - - return clsVal; - }); - }, - - /** - * Removes a class from the specified element or elements. - * - * @method removeClass - * @param {String/Element/Array} elm Element ID string or DOM element or array with elements or IDs. - * @param {String} cls Class name to remove from each element. - * @return {String/Array} String of remaining class name(s), or an array of strings if multiple input elements - * were passed in. - * @example - * // Removes a class from all paragraphs in the active editor - * tinymce.activeEditor.dom.removeClass(tinymce.activeEditor.dom.select('p'), 'myclass'); - * - * // Removes a class from a specific element in the current page - * tinymce.DOM.removeClass('mydiv', 'myclass'); - */ - removeClass: function(elm, cls) { - var self = this, re; - - return self.run(elm, function(elm) { - var val; - - if (self.hasClass(elm, cls)) { - if (!re) { - re = new RegExp("(^|\\s+)" + cls + "(\\s+|$)", "g"); - } - - val = elm.className.replace(re, ' '); - val = trim(val != ' ' ? val : ''); - - elm.className = val; - - // Empty class attr - if (!val) { - elm.removeAttribute('class'); - elm.removeAttribute('className'); - } - - return val; - } - - return elm.className; - }); - }, - - /** - * Returns true if the specified element has the specified class. - * - * @method hasClass - * @param {String/Element} n HTML element or element id string to check CSS class on. - * @param {String} c CSS class to check for. - * @return {Boolean} true/false if the specified element has the specified class. - */ - hasClass: function(elm, cls) { - elm = this.get(elm); - - if (!elm || !cls) { - return false; - } - - return (' ' + elm.className + ' ').indexOf(' ' + cls + ' ') !== -1; - }, - - /** - * Toggles the specified class on/off. - * - * @method toggleClass - * @param {Element} elm Element to toggle class on. - * @param {[type]} cls Class to toggle on/off. - * @param {[type]} state Optional state to set. - */ - toggleClass: function(elm, cls, state) { - state = state === undefined ? !this.hasClass(elm, cls) : state; - - if (this.hasClass(elm, cls) !== state) { - if (state) { - this.addClass(elm, cls); - } else { - this.removeClass(elm, cls); - } - } - }, - - /** - * Shows the specified element(s) by ID by setting the "display" style. - * - * @method show - * @param {String/Element/Array} elm ID of DOM element or DOM element or array with elements or IDs to show. - */ - show: function(elm) { - return this.setStyle(elm, 'display', 'block'); - }, - - /** - * Hides the specified element(s) by ID by setting the "display" style. - * - * @method hide - * @param {String/Element/Array} e ID of DOM element or DOM element or array with elements or IDs to hide. - * @example - * // Hides an element by id in the document - * tinymce.DOM.hide('myid'); - */ - hide: function(elm) { - return this.setStyle(elm, 'display', 'none'); - }, - - /** - * Returns true/false if the element is hidden or not by checking the "display" style. - * - * @method isHidden - * @param {String/Element} e Id or element to check display state on. - * @return {Boolean} true/false if the element is hidden or not. - */ - isHidden: function(elm) { - elm = this.get(elm); - - return !elm || elm.style.display == 'none' || this.getStyle(elm, 'display') == 'none'; - }, - - /** - * Returns a unique id. This can be useful when generating elements on the fly. - * This method will not check if the element already exists. - * - * @method uniqueId - * @param {String} prefix Optional prefix to add in front of all ids - defaults to "mce_". - * @return {String} Unique id. - */ - uniqueId: function(prefix) { - return (!prefix ? 'mce_' : prefix) + (this.counter++); - }, - - /** - * Sets the specified HTML content inside the element or elements. The HTML will first be processed. This means - * URLs will get converted, hex color values fixed etc. Check processHTML for details. - * - * @method setHTML - * @param {Element/String/Array} e DOM element, element id string or array of elements/ids to set HTML inside of. - * @param {String} h HTML content to set as inner HTML of the element. - * @example - * // Sets the inner HTML of all paragraphs in the active editor - * tinymce.activeEditor.dom.setHTML(tinymce.activeEditor.dom.select('p'), 'some inner html'); - * - * // Sets the inner HTML of an element by id in the document - * tinymce.DOM.setHTML('mydiv', 'some inner html'); - */ - setHTML: function(element, html) { - var self = this; - - return self.run(element, function(element) { - if (isIE) { - // Remove all child nodes, IE keeps empty text nodes in DOM - while (element.firstChild) { - element.removeChild(element.firstChild); - } - - try { - // IE will remove comments from the beginning - // unless you padd the contents with something - element.innerHTML = '
    ' + html; - element.removeChild(element.firstChild); - } catch (ex) { - // IE sometimes produces an unknown runtime error on innerHTML if it's a block element - // within a block element for example a div inside a p - // This seems to fix this problem - - // Create new div with HTML contents and a BR in front to keep comments - var newElement = self.create('div'); - newElement.innerHTML = '
    ' + html; - - // Add all children from div to target - each(grep(newElement.childNodes), function(node, i) { - // Skip br element - if (i && element.canHaveHTML) { - element.appendChild(node); - } - }); - } - } else { - element.innerHTML = html; - } - - return html; - }); - }, - - /** - * Returns the outer HTML of an element. - * - * @method getOuterHTML - * @param {String/Element} elm Element ID or element object to get outer HTML from. - * @return {String} Outer HTML string. - * @example - * tinymce.DOM.getOuterHTML(editorElement); - * tinymce.activeEditor.getOuterHTML(tinymce.activeEditor.getBody()); - */ - getOuterHTML: function(elm) { - var doc, self = this; - - elm = self.get(elm); - - if (!elm) { - return null; - } - - if (elm.nodeType === 1 && self.hasOuterHTML) { - return elm.outerHTML; - } - - doc = (elm.ownerDocument || self.doc).createElement("body"); - doc.appendChild(elm.cloneNode(true)); - - return doc.innerHTML; - }, - - /** - * Sets the specified outer HTML on an element or elements. - * - * @method setOuterHTML - * @param {Element/String/Array} elm DOM element, element id string or array of elements/ids to set outer HTML on. - * @param {Object} html HTML code to set as outer value for the element. - * @param {Document} doc Optional document scope to use in this process - defaults to the document of the DOM class. - * @example - * // Sets the outer HTML of all paragraphs in the active editor - * tinymce.activeEditor.dom.setOuterHTML(tinymce.activeEditor.dom.select('p'), '
    some html
    '); - * - * // Sets the outer HTML of an element by id in the document - * tinymce.DOM.setOuterHTML('mydiv', '
    some html
    '); - */ - setOuterHTML: function(elm, html, doc) { - var self = this; - - return self.run(elm, function(elm) { - function set() { - var node, tempElm; - - tempElm = doc.createElement("body"); - tempElm.innerHTML = html; - - node = tempElm.lastChild; - while (node) { - self.insertAfter(node.cloneNode(true), elm); - node = node.previousSibling; - } - - self.remove(elm); - } - - // Only set HTML on elements - if (elm.nodeType == 1) { - doc = doc || elm.ownerDocument || self.doc; - - if (isIE) { - try { - // Try outerHTML for IE it sometimes produces an unknown runtime error - if (elm.nodeType == 1 && self.hasOuterHTML) { - elm.outerHTML = html; - } else { - set(); - } - } catch (ex) { - // Fix for unknown runtime error - set(); - } - } else { - set(); - } - } - }); - }, - - /** - * Entity decodes a string. This method decodes any HTML entities, such as å. - * - * @method decode - * @param {String} s String to decode entities on. - * @return {String} Entity decoded string. - */ - decode: Entities.decode, - - /** - * Entity encodes a string. This method encodes the most common entities, such as <>"&. - * - * @method encode - * @param {String} text String to encode with entities. - * @return {String} Entity encoded string. - */ - encode: Entities.encodeAllRaw, - - /** - * Inserts an element after the reference element. - * - * @method insertAfter - * @param {Element} node Element to insert after the reference. - * @param {Element/String/Array} reference_node Reference element, element id or array of elements to insert after. - * @return {Element/Array} Element that got added or an array with elements. - */ - insertAfter: function(node, reference_node) { - reference_node = this.get(reference_node); - - return this.run(node, function(node) { - var parent, nextSibling; - - parent = reference_node.parentNode; - nextSibling = reference_node.nextSibling; - - if (nextSibling) { - parent.insertBefore(node, nextSibling); - } else { - parent.appendChild(node); - } - - return node; - }); - }, - - /** - * Replaces the specified element or elements with the new element specified. The new element will - * be cloned if multiple input elements are passed in. - * - * @method replace - * @param {Element} newElm New element to replace old ones with. - * @param {Element/String/Array} oldELm Element DOM node, element id or array of elements or ids to replace. - * @param {Boolean} k Optional keep children state, if set to true child nodes from the old object will be added to new ones. - */ - replace: function(newElm, oldElm, keepChildren) { - var self = this; - - return self.run(oldElm, function(oldElm) { - if (is(oldElm, 'array')) { - newElm = newElm.cloneNode(true); - } - - if (keepChildren) { - each(grep(oldElm.childNodes), function(node) { - newElm.appendChild(node); - }); - } - - return oldElm.parentNode.replaceChild(newElm, oldElm); - }); - }, - - /** - * Renames the specified element and keeps its attributes and children. - * - * @method rename - * @param {Element} elm Element to rename. - * @param {String} name Name of the new element. - * @return {Element} New element or the old element if it needed renaming. - */ - rename: function(elm, name) { - var self = this, newElm; - - if (elm.nodeName != name.toUpperCase()) { - // Rename block element - newElm = self.create(name); - - // Copy attribs to new block - each(self.getAttribs(elm), function(attr_node) { - self.setAttrib(newElm, attr_node.nodeName, self.getAttrib(elm, attr_node.nodeName)); - }); - - // Replace block - self.replace(newElm, elm, 1); - } - - return newElm || elm; - }, - - /** - * Find the common ancestor of two elements. This is a shorter method than using the DOM Range logic. - * - * @method findCommonAncestor - * @param {Element} a Element to find common ancestor of. - * @param {Element} b Element to find common ancestor of. - * @return {Element} Common ancestor element of the two input elements. - */ - findCommonAncestor: function(a, b) { - var ps = a, pe; - - while (ps) { - pe = b; - - while (pe && ps != pe) { - pe = pe.parentNode; - } - - if (ps == pe) { - break; - } - - ps = ps.parentNode; - } - - if (!ps && a.ownerDocument) { - return a.ownerDocument.documentElement; - } - - return ps; - }, - - /** - * Parses the specified RGB color value and returns a hex version of that color. - * - * @method toHex - * @param {String} rgbVal RGB string value like rgb(1,2,3) - * @return {String} Hex version of that RGB value like #FF00FF. - */ - toHex: function(rgbVal) { - return this.styles.toHex(Tools.trim(rgbVal)); - }, - - /** - * Executes the specified function on the element by id or dom element node or array of elements/id. - * - * @method run - * @param {String/Element/Array} Element ID or DOM element object or array with ids or elements. - * @param {function} f Function to execute for each item. - * @param {Object} s Optional scope to execute the function in. - * @return {Object/Array} Single object, or an array of objects if multiple input elements were passed in. - */ - run: function(elm, func, scope) { - var self = this, result; - - if (typeof(elm) === 'string') { - elm = self.get(elm); - } - - if (!elm) { - return false; - } - - scope = scope || this; - if (!elm.nodeType && (elm.length || elm.length === 0)) { - result = []; - - each(elm, function(elm, i) { - if (elm) { - if (typeof(elm) == 'string') { - elm = self.get(elm); - } - - result.push(func.call(scope, elm, i)); - } - }); - - return result; - } - - return func.call(scope, elm); - }, - - /** - * Returns a NodeList with attributes for the element. - * - * @method getAttribs - * @param {HTMLElement/string} elm Element node or string id to get attributes from. - * @return {NodeList} NodeList with attributes. - */ - getAttribs: function(elm) { - var attrs; - - elm = this.get(elm); - - if (!elm) { - return []; - } - - if (isIE) { - attrs = []; - - // Object will throw exception in IE - if (elm.nodeName == 'OBJECT') { - return elm.attributes; - } - - // IE doesn't keep the selected attribute if you clone option elements - if (elm.nodeName === 'OPTION' && this.getAttrib(elm, 'selected')) { - attrs.push({specified: 1, nodeName: 'selected'}); - } - - // It's crazy that this is faster in IE but it's because it returns all attributes all the time - var attrRegExp = /<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi; - elm.cloneNode(false).outerHTML.replace(attrRegExp, '').replace(/[\w:\-]+/gi, function(a) { - attrs.push({specified: 1, nodeName: a}); - }); - - return attrs; - } - - return elm.attributes; - }, - - /** - * Returns true/false if the specified node is to be considered empty or not. - * - * @example - * tinymce.DOM.isEmpty(node, {img: true}); - * @method isEmpty - * @param {Object} elements Optional name/value object with elements that are automatically treated as non-empty elements. - * @return {Boolean} true/false if the node is empty or not. - */ - isEmpty: function(node, elements) { - var self = this, i, attributes, type, walker, name, brCount = 0; - - node = node.firstChild; - if (node) { - walker = new TreeWalker(node, node.parentNode); - elements = elements || self.schema ? self.schema.getNonEmptyElements() : null; - - do { - type = node.nodeType; - - if (type === 1) { - // Ignore bogus elements - if (node.getAttribute('data-mce-bogus')) { - continue; - } - - // Keep empty elements like - name = node.nodeName.toLowerCase(); - if (elements && elements[name]) { - // Ignore single BR elements in blocks like


    or


    - if (name === 'br') { - brCount++; - continue; - } - - return false; - } - - // Keep elements with data-bookmark attributes or name attribute like - attributes = self.getAttribs(node); - i = node.attributes.length; - while (i--) { - name = node.attributes[i].nodeName; - if (name === "name" || name === 'data-mce-bookmark') { - return false; - } - } - } - - // Keep comment nodes - if (type == 8) { - return false; - } - - // Keep non whitespace text nodes - if ((type === 3 && !whiteSpaceRegExp.test(node.nodeValue))) { - return false; - } - } while ((node = walker.next())); - } - - return brCount <= 1; - }, - - /** - * Creates a new DOM Range object. This will use the native DOM Range API if it's - * available. If it's not, it will fall back to the custom TinyMCE implementation. - * - * @method createRng - * @return {DOMRange} DOM Range object. - * @example - * var rng = tinymce.DOM.createRng(); - * alert(rng.startContainer + "," + rng.startOffset); - */ - createRng: function() { - var doc = this.doc; - - return doc.createRange ? doc.createRange() : new Range(this); - }, - - /** - * Returns the index of the specified node within its parent. - * - * @method nodeIndex - * @param {Node} node Node to look for. - * @param {boolean} normalized Optional true/false state if the index is what it would be after a normalization. - * @return {Number} Index of the specified node. - */ - nodeIndex: function(node, normalized) { - var idx = 0, lastNodeType, nodeType; - - if (node) { - for (lastNodeType = node.nodeType, node = node.previousSibling; node; node = node.previousSibling) { - nodeType = node.nodeType; - - // Normalize text nodes - if (normalized && nodeType == 3) { - if (nodeType == lastNodeType || !node.nodeValue.length) { - continue; - } - } - idx++; - lastNodeType = nodeType; - } - } - - return idx; - }, - - /** - * Splits an element into two new elements and places the specified split - * element or elements between the new ones. For example splitting the paragraph at the bold element in - * this example

    abcabc123

    would produce

    abc

    abc

    123

    . - * - * @method split - * @param {Element} parentElm Parent element to split. - * @param {Element} splitElm Element to split at. - * @param {Element} replacementElm Optional replacement element to replace the split element with. - * @return {Element} Returns the split element or the replacement element if that is specified. - */ - split: function(parentElm, splitElm, replacementElm) { - var self = this, r = self.createRng(), bef, aft, pa; - - // W3C valid browsers tend to leave empty nodes to the left/right side of the contents - this makes sense - // but we don't want that in our code since it serves no purpose for the end user - // For example splitting this html at the bold element: - //

    text 1CHOPtext 2

    - // would produce: - //

    text 1

    CHOP

    text 2

    - // this function will then trim off empty edges and produce: - //

    text 1

    CHOP

    text 2

    - function trimNode(node) { - var i, children = node.childNodes, type = node.nodeType; - - function surroundedBySpans(node) { - var previousIsSpan = node.previousSibling && node.previousSibling.nodeName == 'SPAN'; - var nextIsSpan = node.nextSibling && node.nextSibling.nodeName == 'SPAN'; - return previousIsSpan && nextIsSpan; - } - - if (type == 1 && node.getAttribute('data-mce-type') == 'bookmark') { - return; - } - - for (i = children.length - 1; i >= 0; i--) { - trimNode(children[i]); - } - - if (type != 9) { - // Keep non whitespace text nodes - if (type == 3 && node.nodeValue.length > 0) { - // If parent element isn't a block or there isn't any useful contents for example "

    " - // Also keep text nodes with only spaces if surrounded by spans. - // eg. "

    a b

    " should keep space between a and b - var trimmedLength = trim(node.nodeValue).length; - if (!self.isBlock(node.parentNode) || trimmedLength > 0 || trimmedLength === 0 && surroundedBySpans(node)) { - return; - } - } else if (type == 1) { - // If the only child is a bookmark then move it up - children = node.childNodes; - - // TODO fix this complex if - if (children.length == 1 && children[0] && children[0].nodeType == 1 && - children[0].getAttribute('data-mce-type') == 'bookmark') { - node.parentNode.insertBefore(children[0], node); - } - - // Keep non empty elements or img, hr etc - if (children.length || /^(br|hr|input|img)$/i.test(node.nodeName)) { - return; - } - } - - self.remove(node); - } - - return node; - } - - if (parentElm && splitElm) { - // Get before chunk - r.setStart(parentElm.parentNode, self.nodeIndex(parentElm)); - r.setEnd(splitElm.parentNode, self.nodeIndex(splitElm)); - bef = r.extractContents(); - - // Get after chunk - r = self.createRng(); - r.setStart(splitElm.parentNode, self.nodeIndex(splitElm) + 1); - r.setEnd(parentElm.parentNode, self.nodeIndex(parentElm) + 1); - aft = r.extractContents(); - - // Insert before chunk - pa = parentElm.parentNode; - pa.insertBefore(trimNode(bef), parentElm); - - // Insert middle chunk - if (replacementElm) { - pa.replaceChild(replacementElm, splitElm); - } else { - pa.insertBefore(splitElm, parentElm); - } - - // Insert after chunk - pa.insertBefore(trimNode(aft), parentElm); - self.remove(parentElm); - - return replacementElm || splitElm; - } - }, - - /** - * Adds an event handler to the specified object. - * - * @method bind - * @param {Element/Document/Window/Array} target Target element to bind events to. - * handler to or an array of elements/ids/documents. - * @param {String} name Name of event handler to add, for example: click. - * @param {function} func Function to execute when the event occurs. - * @param {Object} scope Optional scope to execute the function in. - * @return {function} Function callback handler the same as the one passed in. - */ - bind: function(target, name, func, scope) { - var self = this; - - if (Tools.isArray(target)) { - var i = target.length; - - while (i--) { - target[i] = self.bind(target[i], name, func, scope); - } - - return target; - } - - // Collect all window/document events bound by editor instance - if (self.settings.collect && (target === self.doc || target === self.win)) { - self.boundEvents.push([target, name, func, scope]); - } - - return self.events.bind(target, name, func, scope || self); - }, - - /** - * Removes the specified event handler by name and function from an element or collection of elements. - * - * @method unbind - * @param {Element/Document/Window/Array} target Target element to unbind events on. - * @param {String} name Event handler name, for example: "click" - * @param {function} func Function to remove. - * @return {bool/Array} Bool state of true if the handler was removed, or an array of states if multiple input elements - * were passed in. - */ - unbind: function(target, name, func) { - var self = this, i; - - if (Tools.isArray(target)) { - i = target.length; - - while (i--) { - target[i] = self.unbind(target[i], name, func); - } - - return target; - } - - // Remove any bound events matching the input - if (self.boundEvents && (target === self.doc || target === self.win)) { - i = self.boundEvents.length; - - while (i--) { - var item = self.boundEvents[i]; - - if (target == item[0] && (!name || name == item[1]) && (!func || func == item[2])) { - this.events.unbind(item[0], item[1], item[2]); - } - } - } - - return this.events.unbind(target, name, func); - }, - - /** - * Fires the specified event name with object on target. - * - * @method fire - * @param {Node/Document/Window} target Target element or object to fire event on. - * @param {String} name Name of the event to fire. - * @param {Object} evt Event object to send. - * @return {Event} Event object. - */ - fire: function(target, name, evt) { - return this.events.fire(target, name, evt); - }, - - // Returns the content editable state of a node - getContentEditable: function(node) { - var contentEditable; - - // Check type - if (node.nodeType != 1) { - return null; - } - - // Check for fake content editable - contentEditable = node.getAttribute("data-mce-contenteditable"); - if (contentEditable && contentEditable !== "inherit") { - return contentEditable; - } - - // Check for real content editable - return node.contentEditable !== "inherit" ? node.contentEditable : null; - }, - - /** - * Destroys all internal references to the DOM to solve IE leak issues. - * - * @method destroy - */ - destroy: function() { - var self = this; - - // Unbind all events bound to window/document by editor instance - if (self.boundEvents) { - var i = self.boundEvents.length; - - while (i--) { - var item = self.boundEvents[i]; - this.events.unbind(item[0], item[1], item[2]); - } - - self.boundEvents = null; - } - - // Restore sizzle document to window.document - // Since the current document might be removed producing "Permission denied" on IE see #6325 - if (Sizzle.setDocument) { - Sizzle.setDocument(); - } - - self.win = self.doc = self.root = self.events = self.frag = null; - }, - - // #ifdef debug - - dumpRng: function(r) { - return ( - 'startContainer: ' + r.startContainer.nodeName + - ', startOffset: ' + r.startOffset + - ', endContainer: ' + r.endContainer.nodeName + - ', endOffset: ' + r.endOffset - ); - }, - - // #endif - - _findSib: function(node, selector, name) { - var self = this, func = selector; - - if (node) { - // If expression make a function of it using is - if (typeof(func) == 'string') { - func = function(node) { - return self.is(node, selector); - }; - } - - // Loop all siblings - for (node = node[name]; node; node = node[name]) { - if (func(node)) { - return node; - } - } - } - - return null; - } - }; - - /** - * Instance of DOMUtils for the current document. - * - * @static - * @property DOM - * @type tinymce.dom.DOMUtils - * @example - * // Example of how to add a class to some element by id - * tinymce.DOM.addClass('someid', 'someclass'); - */ - DOMUtils.DOM = new DOMUtils(document); - - return DOMUtils; -}); - -// Included from: js/tinymce/classes/dom/ScriptLoader.js - -/** - * ScriptLoader.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*globals console*/ - -/** - * This class handles asynchronous/synchronous loading of JavaScript files it will execute callbacks - * when various items gets loaded. This class is useful to load external JavaScript files. - * - * @class tinymce.dom.ScriptLoader - * @example - * // Load a script from a specific URL using the global script loader - * tinymce.ScriptLoader.load('somescript.js'); - * - * // Load a script using a unique instance of the script loader - * var scriptLoader = new tinymce.dom.ScriptLoader(); - * - * scriptLoader.load('somescript.js'); - * - * // Load multiple scripts - * var scriptLoader = new tinymce.dom.ScriptLoader(); - * - * scriptLoader.add('somescript1.js'); - * scriptLoader.add('somescript2.js'); - * scriptLoader.add('somescript3.js'); - * - * scriptLoader.loadQueue(function() { - * alert('All scripts are now loaded.'); - * }); - */ -define("tinymce/dom/ScriptLoader", [ - "tinymce/dom/DOMUtils", - "tinymce/util/Tools" -], function(DOMUtils, Tools) { - var DOM = DOMUtils.DOM; - var each = Tools.each, grep = Tools.grep; - - function ScriptLoader() { - var QUEUED = 0, - LOADING = 1, - LOADED = 2, - states = {}, - queue = [], - scriptLoadedCallbacks = {}, - queueLoadedCallbacks = [], - loading = 0, - undef; - - /** - * Loads a specific script directly without adding it to the load queue. - * - * @method load - * @param {String} url Absolute URL to script to add. - * @param {function} callback Optional callback function to execute ones this script gets loaded. - * @param {Object} scope Optional scope to execute callback in. - */ - function loadScript(url, callback) { - var dom = DOM, elm, id; - - // Execute callback when script is loaded - function done() { - dom.remove(id); - - if (elm) { - elm.onreadystatechange = elm.onload = elm = null; - } - - callback(); - } - - function error() { - /*eslint no-console:0 */ - - // Report the error so it's easier for people to spot loading errors - if (typeof(console) !== "undefined" && console.log) { - console.log("Failed to load: " + url); - } - - // We can't mark it as done if there is a load error since - // A) We don't want to produce 404 errors on the server and - // B) the onerror event won't fire on all browsers. - // done(); - } - - id = dom.uniqueId(); - - // Create new script element - elm = document.createElement('script'); - elm.id = id; - elm.type = 'text/javascript'; - elm.src = url; - - // Seems that onreadystatechange works better on IE 10 onload seems to fire incorrectly - if ("onreadystatechange" in elm) { - elm.onreadystatechange = function() { - if (/loaded|complete/.test(elm.readyState)) { - done(); - } - }; - } else { - elm.onload = done; - } - - // Add onerror event will get fired on some browsers but not all of them - elm.onerror = error; - - // Add script to document - (document.getElementsByTagName('head')[0] || document.body).appendChild(elm); - } - - /** - * Returns true/false if a script has been loaded or not. - * - * @method isDone - * @param {String} url URL to check for. - * @return {Boolean} true/false if the URL is loaded. - */ - this.isDone = function(url) { - return states[url] == LOADED; - }; - - /** - * Marks a specific script to be loaded. This can be useful if a script got loaded outside - * the script loader or to skip it from loading some script. - * - * @method markDone - * @param {string} u Absolute URL to the script to mark as loaded. - */ - this.markDone = function(url) { - states[url] = LOADED; - }; - - /** - * Adds a specific script to the load queue of the script loader. - * - * @method add - * @param {String} url Absolute URL to script to add. - * @param {function} callback Optional callback function to execute ones this script gets loaded. - * @param {Object} scope Optional scope to execute callback in. - */ - this.add = this.load = function(url, callback, scope) { - var state = states[url]; - - // Add url to load queue - if (state == undef) { - queue.push(url); - states[url] = QUEUED; - } - - if (callback) { - // Store away callback for later execution - if (!scriptLoadedCallbacks[url]) { - scriptLoadedCallbacks[url] = []; - } - - scriptLoadedCallbacks[url].push({ - func: callback, - scope: scope || this - }); - } - }; - - /** - * Starts the loading of the queue. - * - * @method loadQueue - * @param {function} callback Optional callback to execute when all queued items are loaded. - * @param {Object} scope Optional scope to execute the callback in. - */ - this.loadQueue = function(callback, scope) { - this.loadScripts(queue, callback, scope); - }; - - /** - * Loads the specified queue of files and executes the callback ones they are loaded. - * This method is generally not used outside this class but it might be useful in some scenarios. - * - * @method loadScripts - * @param {Array} scripts Array of queue items to load. - * @param {function} callback Optional callback to execute ones all items are loaded. - * @param {Object} scope Optional scope to execute callback in. - */ - this.loadScripts = function(scripts, callback, scope) { - var loadScripts; - - function execScriptLoadedCallbacks(url) { - // Execute URL callback functions - each(scriptLoadedCallbacks[url], function(callback) { - callback.func.call(callback.scope); - }); - - scriptLoadedCallbacks[url] = undef; - } - - queueLoadedCallbacks.push({ - func: callback, - scope: scope || this - }); - - loadScripts = function() { - var loadingScripts = grep(scripts); - - // Current scripts has been handled - scripts.length = 0; - - // Load scripts that needs to be loaded - each(loadingScripts, function(url) { - // Script is already loaded then execute script callbacks directly - if (states[url] == LOADED) { - execScriptLoadedCallbacks(url); - return; - } - - // Is script not loading then start loading it - if (states[url] != LOADING) { - states[url] = LOADING; - loading++; - - loadScript(url, function() { - states[url] = LOADED; - loading--; - - execScriptLoadedCallbacks(url); - - // Load more scripts if they where added by the recently loaded script - loadScripts(); - }); - } - }); - - // No scripts are currently loading then execute all pending queue loaded callbacks - if (!loading) { - each(queueLoadedCallbacks, function(callback) { - callback.func.call(callback.scope); - }); - - queueLoadedCallbacks.length = 0; - } - }; - - loadScripts(); - }; - } - - ScriptLoader.ScriptLoader = new ScriptLoader(); - - return ScriptLoader; -}); - -// Included from: js/tinymce/classes/AddOnManager.js - -/** - * AddOnManager.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class handles the loading of themes/plugins or other add-ons and their language packs. - * - * @class tinymce.AddOnManager - */ -define("tinymce/AddOnManager", [ - "tinymce/dom/ScriptLoader", - "tinymce/util/Tools" -], function(ScriptLoader, Tools) { - var each = Tools.each; - - function AddOnManager() { - var self = this; - - self.items = []; - self.urls = {}; - self.lookup = {}; - } - - AddOnManager.prototype = { - /** - * Returns the specified add on by the short name. - * - * @method get - * @param {String} name Add-on to look for. - * @return {tinymce.Theme/tinymce.Plugin} Theme or plugin add-on instance or undefined. - */ - get: function(name) { - if (this.lookup[name]) { - return this.lookup[name].instance; - } else { - return undefined; - } - }, - - dependencies: function(name) { - var result; - - if (this.lookup[name]) { - result = this.lookup[name].dependencies; - } - - return result || []; - }, - - /** - * Loads a language pack for the specified add-on. - * - * @method requireLangPack - * @param {String} name Short name of the add-on. - * @param {String} languages Optional comma or space separated list of languages to check if it matches the name. - */ - requireLangPack: function(name, languages) { - if (AddOnManager.language && AddOnManager.languageLoad !== false) { - if (languages && new RegExp('([, ]|\\b)' + AddOnManager.language + '([, ]|\\b)').test(languages) === false) { - return; - } - - ScriptLoader.ScriptLoader.add(this.urls[name] + '/langs/' + AddOnManager.language + '.js'); - } - }, - - /** - * Adds a instance of the add-on by it's short name. - * - * @method add - * @param {String} id Short name/id for the add-on. - * @param {tinymce.Theme/tinymce.Plugin} addOn Theme or plugin to add. - * @return {tinymce.Theme/tinymce.Plugin} The same theme or plugin instance that got passed in. - * @example - * // Create a simple plugin - * tinymce.create('tinymce.plugins.TestPlugin', { - * TestPlugin: function(ed, url) { - * ed.on('click', function(e) { - * ed.windowManager.alert('Hello World!'); - * }); - * } - * }); - * - * // Register plugin using the add method - * tinymce.PluginManager.add('test', tinymce.plugins.TestPlugin); - * - * // Initialize TinyMCE - * tinymce.init({ - * ... - * plugins: '-test' // Init the plugin but don't try to load it - * }); - */ - add: function(id, addOn, dependencies) { - this.items.push(addOn); - this.lookup[id] = {instance: addOn, dependencies: dependencies}; - - return addOn; - }, - - createUrl: function(baseUrl, dep) { - if (typeof dep === "object") { - return dep; - } else { - return {prefix: baseUrl.prefix, resource: dep, suffix: baseUrl.suffix}; - } - }, - - /** - * Add a set of components that will make up the add-on. Using the url of the add-on name as the base url. - * This should be used in development mode. A new compressor/javascript munger process will ensure that the - * components are put together into the plugin.js file and compressed correctly. - * - * @method addComponents - * @param {String} pluginName name of the plugin to load scripts from (will be used to get the base url for the plugins). - * @param {Array} scripts Array containing the names of the scripts to load. - */ - addComponents: function(pluginName, scripts) { - var pluginUrl = this.urls[pluginName]; - - each(scripts, function(script) { - ScriptLoader.ScriptLoader.add(pluginUrl + "/" + script); - }); - }, - - /** - * Loads an add-on from a specific url. - * - * @method load - * @param {String} name Short name of the add-on that gets loaded. - * @param {String} addOnUrl URL to the add-on that will get loaded. - * @param {function} callback Optional callback to execute ones the add-on is loaded. - * @param {Object} scope Optional scope to execute the callback in. - * @example - * // Loads a plugin from an external URL - * tinymce.PluginManager.load('myplugin', '/some/dir/someplugin/plugin.js'); - * - * // Initialize TinyMCE - * tinymce.init({ - * ... - * plugins: '-myplugin' // Don't try to load it again - * }); - */ - load: function(name, addOnUrl, callback, scope) { - var self = this, url = addOnUrl; - - function loadDependencies() { - var dependencies = self.dependencies(name); - - each(dependencies, function(dep) { - var newUrl = self.createUrl(addOnUrl, dep); - - self.load(newUrl.resource, newUrl, undefined, undefined); - }); - - if (callback) { - if (scope) { - callback.call(scope); - } else { - callback.call(ScriptLoader); - } - } - } - - if (self.urls[name]) { - return; - } - - if (typeof addOnUrl === "object") { - url = addOnUrl.prefix + addOnUrl.resource + addOnUrl.suffix; - } - - if (url.indexOf('/') !== 0 && url.indexOf('://') == -1) { - url = AddOnManager.baseURL + '/' + url; - } - - self.urls[name] = url.substring(0, url.lastIndexOf('/')); - - if (self.lookup[name]) { - loadDependencies(); - } else { - ScriptLoader.ScriptLoader.add(url, loadDependencies, scope); - } - } - }; - - AddOnManager.PluginManager = new AddOnManager(); - AddOnManager.ThemeManager = new AddOnManager(); - - return AddOnManager; -}); - -/** - * TinyMCE theme class. - * - * @class tinymce.Theme - */ - -/** - * This method is responsible for rendering/generating the overall user interface with toolbars, buttons, iframe containers etc. - * - * @method renderUI - * @param {Object} obj Object parameter containing the targetNode DOM node that will be replaced visually with an editor instance. - * @return {Object} an object with items like iframeContainer, editorContainer, sizeContainer, deltaWidth, deltaHeight. - */ - -/** - * Plugin base class, this is a pseudo class that describes how a plugin is to be created for TinyMCE. The methods below are all optional. - * - * @class tinymce.Plugin - * @example - * tinymce.PluginManager.add('example', function(editor, url) { - * // Add a button that opens a window - * editor.addButton('example', { - * text: 'My button', - * icon: false, - * onclick: function() { - * // Open window - * editor.windowManager.open({ - * title: 'Example plugin', - * body: [ - * {type: 'textbox', name: 'title', label: 'Title'} - * ], - * onsubmit: function(e) { - * // Insert content when the window form is submitted - * editor.insertContent('Title: ' + e.data.title); - * } - * }); - * } - * }); - * - * // Adds a menu item to the tools menu - * editor.addMenuItem('example', { - * text: 'Example plugin', - * context: 'tools', - * onclick: function() { - * // Open window with a specific url - * editor.windowManager.open({ - * title: 'TinyMCE site', - * url: 'http://www.tinymce.com', - * width: 800, - * height: 600, - * buttons: [{ - * text: 'Close', - * onclick: 'close' - * }] - * }); - * } - * }); - * }); - */ - -// Included from: js/tinymce/classes/html/Node.js - -/** - * Node.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class is a minimalistic implementation of a DOM like node used by the DomParser class. - * - * @example - * var node = new tinymce.html.Node('strong', 1); - * someRoot.append(node); - * - * @class tinymce.html.Node - * @version 3.4 - */ -define("tinymce/html/Node", [], function() { - var whiteSpaceRegExp = /^[ \t\r\n]*$/, typeLookup = { - '#text': 3, - '#comment': 8, - '#cdata': 4, - '#pi': 7, - '#doctype': 10, - '#document-fragment': 11 - }; - - // Walks the tree left/right - function walk(node, root_node, prev) { - var sibling, parent, startName = prev ? 'lastChild' : 'firstChild', siblingName = prev ? 'prev' : 'next'; - - // Walk into nodes if it has a start - if (node[startName]) { - return node[startName]; - } - - // Return the sibling if it has one - if (node !== root_node) { - sibling = node[siblingName]; - - if (sibling) { - return sibling; - } - - // Walk up the parents to look for siblings - for (parent = node.parent; parent && parent !== root_node; parent = parent.parent) { - sibling = parent[siblingName]; - - if (sibling) { - return sibling; - } - } - } - } - - /** - * Constructs a new Node instance. - * - * @constructor - * @method Node - * @param {String} name Name of the node type. - * @param {Number} type Numeric type representing the node. - */ - function Node(name, type) { - this.name = name; - this.type = type; - - if (type === 1) { - this.attributes = []; - this.attributes.map = {}; - } - } - - Node.prototype = { - /** - * Replaces the current node with the specified one. - * - * @example - * someNode.replace(someNewNode); - * - * @method replace - * @param {tinymce.html.Node} node Node to replace the current node with. - * @return {tinymce.html.Node} The old node that got replaced. - */ - replace: function(node) { - var self = this; - - if (node.parent) { - node.remove(); - } - - self.insert(node, self); - self.remove(); - - return self; - }, - - /** - * Gets/sets or removes an attribute by name. - * - * @example - * someNode.attr("name", "value"); // Sets an attribute - * console.log(someNode.attr("name")); // Gets an attribute - * someNode.attr("name", null); // Removes an attribute - * - * @method attr - * @param {String} name Attribute name to set or get. - * @param {String} value Optional value to set. - * @return {String/tinymce.html.Node} String or undefined on a get operation or the current node on a set operation. - */ - attr: function(name, value) { - var self = this, attrs, i, undef; - - if (typeof name !== "string") { - for (i in name) { - self.attr(i, name[i]); - } - - return self; - } - - if ((attrs = self.attributes)) { - if (value !== undef) { - // Remove attribute - if (value === null) { - if (name in attrs.map) { - delete attrs.map[name]; - - i = attrs.length; - while (i--) { - if (attrs[i].name === name) { - attrs = attrs.splice(i, 1); - return self; - } - } - } - - return self; - } - - // Set attribute - if (name in attrs.map) { - // Set attribute - i = attrs.length; - while (i--) { - if (attrs[i].name === name) { - attrs[i].value = value; - break; - } - } - } else { - attrs.push({name: name, value: value}); - } - - attrs.map[name] = value; - - return self; - } else { - return attrs.map[name]; - } - } - }, - - /** - * Does a shallow clones the node into a new node. It will also exclude id attributes since - * there should only be one id per document. - * - * @example - * var clonedNode = node.clone(); - * - * @method clone - * @return {tinymce.html.Node} New copy of the original node. - */ - clone: function() { - var self = this, clone = new Node(self.name, self.type), i, l, selfAttrs, selfAttr, cloneAttrs; - - // Clone element attributes - if ((selfAttrs = self.attributes)) { - cloneAttrs = []; - cloneAttrs.map = {}; - - for (i = 0, l = selfAttrs.length; i < l; i++) { - selfAttr = selfAttrs[i]; - - // Clone everything except id - if (selfAttr.name !== 'id') { - cloneAttrs[cloneAttrs.length] = {name: selfAttr.name, value: selfAttr.value}; - cloneAttrs.map[selfAttr.name] = selfAttr.value; - } - } - - clone.attributes = cloneAttrs; - } - - clone.value = self.value; - clone.shortEnded = self.shortEnded; - - return clone; - }, - - /** - * Wraps the node in in another node. - * - * @example - * node.wrap(wrapperNode); - * - * @method wrap - */ - wrap: function(wrapper) { - var self = this; - - self.parent.insert(wrapper, self); - wrapper.append(self); - - return self; - }, - - /** - * Unwraps the node in other words it removes the node but keeps the children. - * - * @example - * node.unwrap(); - * - * @method unwrap - */ - unwrap: function() { - var self = this, node, next; - - for (node = self.firstChild; node; ) { - next = node.next; - self.insert(node, self, true); - node = next; - } - - self.remove(); - }, - - /** - * Removes the node from it's parent. - * - * @example - * node.remove(); - * - * @method remove - * @return {tinymce.html.Node} Current node that got removed. - */ - remove: function() { - var self = this, parent = self.parent, next = self.next, prev = self.prev; - - if (parent) { - if (parent.firstChild === self) { - parent.firstChild = next; - - if (next) { - next.prev = null; - } - } else { - prev.next = next; - } - - if (parent.lastChild === self) { - parent.lastChild = prev; - - if (prev) { - prev.next = null; - } - } else { - next.prev = prev; - } - - self.parent = self.next = self.prev = null; - } - - return self; - }, - - /** - * Appends a new node as a child of the current node. - * - * @example - * node.append(someNode); - * - * @method append - * @param {tinymce.html.Node} node Node to append as a child of the current one. - * @return {tinymce.html.Node} The node that got appended. - */ - append: function(node) { - var self = this, last; - - if (node.parent) { - node.remove(); - } - - last = self.lastChild; - if (last) { - last.next = node; - node.prev = last; - self.lastChild = node; - } else { - self.lastChild = self.firstChild = node; - } - - node.parent = self; - - return node; - }, - - /** - * Inserts a node at a specific position as a child of the current node. - * - * @example - * parentNode.insert(newChildNode, oldChildNode); - * - * @method insert - * @param {tinymce.html.Node} node Node to insert as a child of the current node. - * @param {tinymce.html.Node} ref_node Reference node to set node before/after. - * @param {Boolean} before Optional state to insert the node before the reference node. - * @return {tinymce.html.Node} The node that got inserted. - */ - insert: function(node, ref_node, before) { - var parent; - - if (node.parent) { - node.remove(); - } - - parent = ref_node.parent || this; - - if (before) { - if (ref_node === parent.firstChild) { - parent.firstChild = node; - } else { - ref_node.prev.next = node; - } - - node.prev = ref_node.prev; - node.next = ref_node; - ref_node.prev = node; - } else { - if (ref_node === parent.lastChild) { - parent.lastChild = node; - } else { - ref_node.next.prev = node; - } - - node.next = ref_node.next; - node.prev = ref_node; - ref_node.next = node; - } - - node.parent = parent; - - return node; - }, - - /** - * Get all children by name. - * - * @method getAll - * @param {String} name Name of the child nodes to collect. - * @return {Array} Array with child nodes matchin the specified name. - */ - getAll: function(name) { - var self = this, node, collection = []; - - for (node = self.firstChild; node; node = walk(node, self)) { - if (node.name === name) { - collection.push(node); - } - } - - return collection; - }, - - /** - * Removes all children of the current node. - * - * @method empty - * @return {tinymce.html.Node} The current node that got cleared. - */ - empty: function() { - var self = this, nodes, i, node; - - // Remove all children - if (self.firstChild) { - nodes = []; - - // Collect the children - for (node = self.firstChild; node; node = walk(node, self)) { - nodes.push(node); - } - - // Remove the children - i = nodes.length; - while (i--) { - node = nodes[i]; - node.parent = node.firstChild = node.lastChild = node.next = node.prev = null; - } - } - - self.firstChild = self.lastChild = null; - - return self; - }, - - /** - * Returns true/false if the node is to be considered empty or not. - * - * @example - * node.isEmpty({img: true}); - * @method isEmpty - * @param {Object} elements Name/value object with elements that are automatically treated as non empty elements. - * @return {Boolean} true/false if the node is empty or not. - */ - isEmpty: function(elements) { - var self = this, node = self.firstChild, i, name; - - if (node) { - do { - if (node.type === 1) { - // Ignore bogus elements - if (node.attributes.map['data-mce-bogus']) { - continue; - } - - // Keep empty elements like - if (elements[node.name]) { - return false; - } - - // Keep elements with data attributes or name attribute like - i = node.attributes.length; - while (i--) { - name = node.attributes[i].name; - if (name === "name" || name.indexOf('data-mce-') === 0) { - return false; - } - } - } - - // Keep comments - if (node.type === 8) { - return false; - } - - // Keep non whitespace text nodes - if ((node.type === 3 && !whiteSpaceRegExp.test(node.value))) { - return false; - } - } while ((node = walk(node, self))); - } - - return true; - }, - - /** - * Walks to the next or previous node and returns that node or null if it wasn't found. - * - * @method walk - * @param {Boolean} prev Optional previous node state defaults to false. - * @return {tinymce.html.Node} Node that is next to or previous of the current node. - */ - walk: function(prev) { - return walk(this, null, prev); - } - }; - - /** - * Creates a node of a specific type. - * - * @static - * @method create - * @param {String} name Name of the node type to create for example "b" or "#text". - * @param {Object} attrs Name/value collection of attributes that will be applied to elements. - */ - Node.create = function(name, attrs) { - var node, attrName; - - // Create node - node = new Node(name, typeLookup[name] || 1); - - // Add attributes if needed - if (attrs) { - for (attrName in attrs) { - node.attr(attrName, attrs[attrName]); - } - } - - return node; - }; - - return Node; -}); - -// Included from: js/tinymce/classes/html/Schema.js - -/** - * Schema.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Schema validator class. - * - * @class tinymce.html.Schema - * @example - * if (tinymce.activeEditor.schema.isValidChild('p', 'span')) - * alert('span is valid child of p.'); - * - * if (tinymce.activeEditor.schema.getElementRule('p')) - * alert('P is a valid element.'); - * - * @class tinymce.html.Schema - * @version 3.4 - */ -define("tinymce/html/Schema", [ - "tinymce/util/Tools" -], function(Tools) { - var mapCache = {}; - var makeMap = Tools.makeMap, each = Tools.each, extend = Tools.extend, explode = Tools.explode, inArray = Tools.inArray; - - function split(items, delim) { - return items ? items.split(delim || ' ') : []; - } - - /** - * Builds a schema lookup table - * - * @private - * @param {String} type html4, html5 or html5-strict schema type. - * @return {Object} Schema lookup table. - */ - function compileSchema(type) { - var schema = {}, globalAttributes, blockContent; - var phrasingContent, flowContent, html4BlockContent, html4PhrasingContent; - - function add(name, attributes, children) { - var ni, i, attributesOrder, args = arguments; - - function arrayToMap(array) { - var map = {}, i, l; - - for (i = 0, l = array.length; i < l; i++) { - map[array[i]] = {}; - } - - return map; - } - - children = children || []; - attributes = attributes || ""; - - if (typeof(children) === "string") { - children = split(children); - } - - // Split string children - for (i = 3; i < args.length; i++) { - if (typeof(args[i]) === "string") { - args[i] = split(args[i]); - } - - children.push.apply(children, args[i]); - } - - name = split(name); - ni = name.length; - while (ni--) { - attributesOrder = [].concat(globalAttributes, split(attributes)); - schema[name[ni]] = { - attributes: arrayToMap(attributesOrder), - attributesOrder: attributesOrder, - children: arrayToMap(children) - }; - } - } - - function addAttrs(name, attributes) { - var ni, schemaItem, i, l; - - name = split(name); - ni = name.length; - attributes = split(attributes); - while (ni--) { - schemaItem = schema[name[ni]]; - for (i = 0, l = attributes.length; i < l; i++) { - schemaItem.attributes[attributes[i]] = {}; - schemaItem.attributesOrder.push(attributes[i]); - } - } - } - - // Use cached schema - if (mapCache[type]) { - return mapCache[type]; - } - - // Attributes present on all elements - globalAttributes = split("id accesskey class dir lang style tabindex title"); - - // Event attributes can be opt-in/opt-out - /*eventAttributes = split("onabort onblur oncancel oncanplay oncanplaythrough onchange onclick onclose oncontextmenu oncuechange " + - "ondblclick ondrag ondragend ondragenter ondragleave ondragover ondragstart ondrop ondurationchange onemptied onended " + - "onerror onfocus oninput oninvalid onkeydown onkeypress onkeyup onload onloadeddata onloadedmetadata onloadstart " + - "onmousedown onmousemove onmouseout onmouseover onmouseup onmousewheel onpause onplay onplaying onprogress onratechange " + - "onreset onscroll onseeked onseeking onseeking onselect onshow onstalled onsubmit onsuspend ontimeupdate onvolumechange " + - "onwaiting" - );*/ - - // Block content elements - blockContent = split( - "address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul" - ); - - // Phrasing content elements from the HTML5 spec (inline) - phrasingContent = split( - "a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd " + - "label map noscript object q s samp script select small span strong sub sup " + - "textarea u var #text #comment" - ); - - // Add HTML5 items to globalAttributes, blockContent, phrasingContent - if (type != "html4") { - globalAttributes.push.apply(globalAttributes, split("contenteditable contextmenu draggable dropzone " + - "hidden spellcheck translate")); - blockContent.push.apply(blockContent, split("article aside details dialog figure header footer hgroup section nav")); - phrasingContent.push.apply(phrasingContent, split("audio canvas command datalist mark meter output progress time wbr " + - "video ruby bdi keygen")); - } - - // Add HTML4 elements unless it's html5-strict - if (type != "html5-strict") { - globalAttributes.push("xml:lang"); - - html4PhrasingContent = split("acronym applet basefont big font strike tt"); - phrasingContent.push.apply(phrasingContent, html4PhrasingContent); - - each(html4PhrasingContent, function(name) { - add(name, "", phrasingContent); - }); - - html4BlockContent = split("center dir isindex noframes"); - blockContent.push.apply(blockContent, html4BlockContent); - - // Flow content elements from the HTML5 spec (block+inline) - flowContent = [].concat(blockContent, phrasingContent); - - each(html4BlockContent, function(name) { - add(name, "", flowContent); - }); - } - - // Flow content elements from the HTML5 spec (block+inline) - flowContent = flowContent || [].concat(blockContent, phrasingContent); - - // HTML4 base schema TODO: Move HTML5 specific attributes to HTML5 specific if statement - // Schema items , , - add("html", "manifest", "head body"); - add("head", "", "base command link meta noscript script style title"); - add("title hr noscript br"); - add("base", "href target"); - add("link", "href rel media hreflang type sizes hreflang"); - add("meta", "name http-equiv content charset"); - add("style", "media type scoped"); - add("script", "src async defer type charset"); - add("body", "onafterprint onbeforeprint onbeforeunload onblur onerror onfocus " + - "onhashchange onload onmessage onoffline ononline onpagehide onpageshow " + - "onpopstate onresize onscroll onstorage onunload", flowContent); - add("address dt dd div caption", "", flowContent); - 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); - add("blockquote", "cite", flowContent); - add("ol", "reversed start type", "li"); - add("ul", "", "li"); - add("li", "value", flowContent); - add("dl", "", "dt dd"); - add("a", "href target rel media hreflang type", phrasingContent); - add("q", "cite", phrasingContent); - add("ins del", "cite datetime", flowContent); - add("img", "src alt usemap ismap width height"); - add("iframe", "src name width height", flowContent); - add("embed", "src type width height"); - add("object", "data type typemustmatch name usemap form width height", flowContent, "param"); - add("param", "name value"); - add("map", "name", flowContent, "area"); - add("area", "alt coords shape href target rel media hreflang type"); - add("table", "border", "caption colgroup thead tfoot tbody tr" + (type == "html4" ? " col" : "")); - add("colgroup", "span", "col"); - add("col", "span"); - add("tbody thead tfoot", "", "tr"); - add("tr", "", "td th"); - add("td", "colspan rowspan headers", flowContent); - add("th", "colspan rowspan headers scope abbr", flowContent); - add("form", "accept-charset action autocomplete enctype method name novalidate target", flowContent); - add("fieldset", "disabled form name", flowContent, "legend"); - add("label", "form for", phrasingContent); - add("input", "accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate " + - "formtarget height list max maxlength min multiple name pattern readonly required size src step type value width" - ); - add("button", "disabled form formaction formenctype formmethod formnovalidate formtarget name type value", - type == "html4" ? flowContent : phrasingContent); - add("select", "disabled form multiple name required size", "option optgroup"); - add("optgroup", "disabled label", "option"); - add("option", "disabled label selected value"); - add("textarea", "cols dirname disabled form maxlength name readonly required rows wrap"); - add("menu", "type label", flowContent, "li"); - add("noscript", "", flowContent); - - // Extend with HTML5 elements - if (type != "html4") { - add("wbr"); - add("ruby", "", phrasingContent, "rt rp"); - add("figcaption", "", flowContent); - add("mark rt rp summary bdi", "", phrasingContent); - add("canvas", "width height", flowContent); - add("video", "src crossorigin poster preload autoplay mediagroup loop " + - "muted controls width height", flowContent, "track source"); - add("audio", "src crossorigin preload autoplay mediagroup loop muted controls", flowContent, "track source"); - add("source", "src type media"); - add("track", "kind src srclang label default"); - add("datalist", "", phrasingContent, "option"); - add("article section nav aside header footer", "", flowContent); - add("hgroup", "", "h1 h2 h3 h4 h5 h6"); - add("figure", "", flowContent, "figcaption"); - add("time", "datetime", phrasingContent); - add("dialog", "open", flowContent); - add("command", "type label icon disabled checked radiogroup command"); - add("output", "for form name", phrasingContent); - add("progress", "value max", phrasingContent); - add("meter", "value min max low high optimum", phrasingContent); - add("details", "open", flowContent, "summary"); - add("keygen", "autofocus challenge disabled form keytype name"); - } - - // Extend with HTML4 attributes unless it's html5-strict - if (type != "html5-strict") { - addAttrs("script", "language xml:space"); - addAttrs("style", "xml:space"); - addAttrs("object", "declare classid codebase codetype archive standby align border hspace vspace"); - addAttrs("param", "valuetype type"); - addAttrs("a", "charset name rev shape coords"); - addAttrs("br", "clear"); - addAttrs("applet", "codebase archive code object alt name width height align hspace vspace"); - addAttrs("img", "name longdesc align border hspace vspace"); - addAttrs("iframe", "longdesc frameborder marginwidth marginheight scrolling align"); - addAttrs("font basefont", "size color face"); - addAttrs("input", "usemap align"); - addAttrs("select", "onchange"); - addAttrs("textarea"); - addAttrs("h1 h2 h3 h4 h5 h6 div p legend caption", "align"); - addAttrs("ul", "type compact"); - addAttrs("li", "type"); - addAttrs("ol dl menu dir", "compact"); - addAttrs("pre", "width xml:space"); - addAttrs("hr", "align noshade size width"); - addAttrs("isindex", "prompt"); - addAttrs("table", "summary width frame rules cellspacing cellpadding align bgcolor"); - addAttrs("col", "width align char charoff valign"); - addAttrs("colgroup", "width align char charoff valign"); - addAttrs("thead", "align char charoff valign"); - addAttrs("tr", "align char charoff valign bgcolor"); - addAttrs("th", "axis align char charoff valign nowrap bgcolor width height"); - addAttrs("form", "accept"); - addAttrs("td", "abbr axis scope align char charoff valign nowrap bgcolor width height"); - addAttrs("tfoot", "align char charoff valign"); - addAttrs("tbody", "align char charoff valign"); - addAttrs("area", "nohref"); - addAttrs("body", "background bgcolor text link vlink alink"); - } - - // Extend with HTML5 attributes unless it's html4 - if (type != "html4") { - addAttrs("input button select textarea", "autofocus"); - addAttrs("input textarea", "placeholder"); - addAttrs("a", "download"); - addAttrs("link script img", "crossorigin"); - addAttrs("iframe", "srcdoc sandbox seamless allowfullscreen"); - } - - // Special: iframe, ruby, video, audio, label - - // Delete children of the same name from it's parent - // For example: form can't have a child of the name form - each(split('a form meter progress dfn'), function(name) { - if (schema[name]) { - delete schema[name].children[name]; - } - }); - - // Delete header, footer, sectioning and heading content descendants - /*each('dt th address', function(name) { - delete schema[name].children[name]; - });*/ - - // Caption can't have tables - delete schema.caption.children.table; - - // TODO: LI:s can only have value if parent is OL - - // TODO: Handle transparent elements - // a ins del canvas map - - mapCache[type] = schema; - - return schema; - } - - /** - * Constructs a new Schema instance. - * - * @constructor - * @method Schema - * @param {Object} settings Name/value settings object. - */ - return function(settings) { - var self = this, elements = {}, children = {}, patternElements = [], validStyles, schemaItems; - var whiteSpaceElementsMap, selfClosingElementsMap, shortEndedElementsMap, boolAttrMap; - var blockElementsMap, nonEmptyElementsMap, textBlockElementsMap, customElementsMap = {}, specialElements = {}; - - // Creates an lookup table map object for the specified option or the default value - function createLookupTable(option, default_value, extendWith) { - var value = settings[option]; - - if (!value) { - // Get cached default map or make it if needed - value = mapCache[option]; - - if (!value) { - value = makeMap(default_value, ' ', makeMap(default_value.toUpperCase(), ' ')); - value = extend(value, extendWith); - - mapCache[option] = value; - } - } else { - // Create custom map - value = makeMap(value, ',', makeMap(value.toUpperCase(), ' ')); - } - - return value; - } - - settings = settings || {}; - schemaItems = compileSchema(settings.schema); - - // Allow all elements and attributes if verify_html is set to false - if (settings.verify_html === false) { - settings.valid_elements = '*[*]'; - } - - // Build styles list - if (settings.valid_styles) { - validStyles = {}; - - // Convert styles into a rule list - each(settings.valid_styles, function(value, key) { - validStyles[key] = explode(value); - }); - } - - // Setup map objects - whiteSpaceElementsMap = createLookupTable('whitespace_elements', 'pre script noscript style textarea video audio iframe object'); - selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li option p td tfoot th thead tr'); - shortEndedElementsMap = createLookupTable('short_ended_elements', 'area base basefont br col frame hr img input isindex link ' + - 'meta param embed source wbr track'); - boolAttrMap = createLookupTable('boolean_attributes', 'checked compact declare defer disabled ismap multiple nohref noresize ' + - 'noshade nowrap readonly selected autoplay loop controls'); - nonEmptyElementsMap = createLookupTable('non_empty_elements', 'td th iframe video audio object script', shortEndedElementsMap); - textBlockElementsMap = createLookupTable('text_block_elements', 'h1 h2 h3 h4 h5 h6 p div address pre form ' + - 'blockquote center dir fieldset header footer article section hgroup aside nav figure'); - blockElementsMap = createLookupTable('block_elements', 'hr table tbody thead tfoot ' + - 'th tr td li ol ul caption dl dt dd noscript menu isindex option ' + - 'datalist select optgroup', textBlockElementsMap); - - each((settings.special || 'script noscript style textarea').split(' '), function(name) { - specialElements[name] = new RegExp('<\/' + name + '[^>]*>','gi'); - }); - - // Converts a wildcard expression string to a regexp for example *a will become /.*a/. - function patternToRegExp(str) { - return new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$'); - } - - // Parses the specified valid_elements string and adds to the current rules - // This function is a bit hard to read since it's heavily optimized for speed - function addValidElements(valid_elements) { - var ei, el, ai, al, matches, element, attr, attrData, elementName, attrName, attrType, attributes, attributesOrder, - prefix, outputName, globalAttributes, globalAttributesOrder, key, value, - elementRuleRegExp = /^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/, - attrRuleRegExp = /^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/, - hasPatternsRegExp = /[*?+]/; - - if (valid_elements) { - // Split valid elements into an array with rules - valid_elements = split(valid_elements, ','); - - if (elements['@']) { - globalAttributes = elements['@'].attributes; - globalAttributesOrder = elements['@'].attributesOrder; - } - - // Loop all rules - for (ei = 0, el = valid_elements.length; ei < el; ei++) { - // Parse element rule - matches = elementRuleRegExp.exec(valid_elements[ei]); - if (matches) { - // Setup local names for matches - prefix = matches[1]; - elementName = matches[2]; - outputName = matches[3]; - attrData = matches[5]; - - // Create new attributes and attributesOrder - attributes = {}; - attributesOrder = []; - - // Create the new element - element = { - attributes: attributes, - attributesOrder: attributesOrder - }; - - // Padd empty elements prefix - if (prefix === '#') { - element.paddEmpty = true; - } - - // Remove empty elements prefix - if (prefix === '-') { - element.removeEmpty = true; - } - - if (matches[4] === '!') { - element.removeEmptyAttrs = true; - } - - // Copy attributes from global rule into current rule - if (globalAttributes) { - for (key in globalAttributes) { - attributes[key] = globalAttributes[key]; - } - - attributesOrder.push.apply(attributesOrder, globalAttributesOrder); - } - - // Attributes defined - if (attrData) { - attrData = split(attrData, '|'); - for (ai = 0, al = attrData.length; ai < al; ai++) { - matches = attrRuleRegExp.exec(attrData[ai]); - if (matches) { - attr = {}; - attrType = matches[1]; - attrName = matches[2].replace(/::/g, ':'); - prefix = matches[3]; - value = matches[4]; - - // Required - if (attrType === '!') { - element.attributesRequired = element.attributesRequired || []; - element.attributesRequired.push(attrName); - attr.required = true; - } - - // Denied from global - if (attrType === '-') { - delete attributes[attrName]; - attributesOrder.splice(inArray(attributesOrder, attrName), 1); - continue; - } - - // Default value - if (prefix) { - // Default value - if (prefix === '=') { - element.attributesDefault = element.attributesDefault || []; - element.attributesDefault.push({name: attrName, value: value}); - attr.defaultValue = value; - } - - // Forced value - if (prefix === ':') { - element.attributesForced = element.attributesForced || []; - element.attributesForced.push({name: attrName, value: value}); - attr.forcedValue = value; - } - - // Required values - if (prefix === '<') { - attr.validValues = makeMap(value, '?'); - } - } - - // Check for attribute patterns - if (hasPatternsRegExp.test(attrName)) { - element.attributePatterns = element.attributePatterns || []; - attr.pattern = patternToRegExp(attrName); - element.attributePatterns.push(attr); - } else { - // Add attribute to order list if it doesn't already exist - if (!attributes[attrName]) { - attributesOrder.push(attrName); - } - - attributes[attrName] = attr; - } - } - } - } - - // Global rule, store away these for later usage - if (!globalAttributes && elementName == '@') { - globalAttributes = attributes; - globalAttributesOrder = attributesOrder; - } - - // Handle substitute elements such as b/strong - if (outputName) { - element.outputName = elementName; - elements[outputName] = element; - } - - // Add pattern or exact element - if (hasPatternsRegExp.test(elementName)) { - element.pattern = patternToRegExp(elementName); - patternElements.push(element); - } else { - elements[elementName] = element; - } - } - } - } - } - - function setValidElements(valid_elements) { - elements = {}; - patternElements = []; - - addValidElements(valid_elements); - - each(schemaItems, function(element, name) { - children[name] = element.children; - }); - } - - // Adds custom non HTML elements to the schema - function addCustomElements(custom_elements) { - var customElementRegExp = /^(~)?(.+)$/; - - if (custom_elements) { - // Flush cached items since we are altering the default maps - mapCache.text_block_elements = mapCache.block_elements = null; - - each(split(custom_elements, ','), function(rule) { - var matches = customElementRegExp.exec(rule), - inline = matches[1] === '~', - cloneName = inline ? 'span' : 'div', - name = matches[2]; - - children[name] = children[cloneName]; - customElementsMap[name] = cloneName; - - // If it's not marked as inline then add it to valid block elements - if (!inline) { - blockElementsMap[name.toUpperCase()] = {}; - blockElementsMap[name] = {}; - } - - // Add elements clone if needed - if (!elements[name]) { - var customRule = elements[cloneName]; - - customRule = extend({}, customRule); - delete customRule.removeEmptyAttrs; - delete customRule.removeEmpty; - - elements[name] = customRule; - } - - // Add custom elements at span/div positions - each(children, function(element, elmName) { - if (element[cloneName]) { - children[elmName] = element = extend({}, children[elmName]); - element[name] = element[cloneName]; - } - }); - }); - } - } - - // Adds valid children to the schema object - function addValidChildren(valid_children) { - var childRuleRegExp = /^([+\-]?)(\w+)\[([^\]]+)\]$/; - - if (valid_children) { - each(split(valid_children, ','), function(rule) { - var matches = childRuleRegExp.exec(rule), parent, prefix; - - if (matches) { - prefix = matches[1]; - - // Add/remove items from default - if (prefix) { - parent = children[matches[2]]; - } else { - parent = children[matches[2]] = {'#comment': {}}; - } - - parent = children[matches[2]]; - - each(split(matches[3], '|'), function(child) { - if (prefix === '-') { - // Clone the element before we delete - // things in it to not mess up default schemas - children[matches[2]] = parent = extend({}, children[matches[2]]); - - delete parent[child]; - } else { - parent[child] = {}; - } - }); - } - }); - } - } - - function getElementRule(name) { - var element = elements[name], i; - - // Exact match found - if (element) { - return element; - } - - // No exact match then try the patterns - i = patternElements.length; - while (i--) { - element = patternElements[i]; - - if (element.pattern.test(name)) { - return element; - } - } - } - - if (!settings.valid_elements) { - // No valid elements defined then clone the elements from the schema spec - each(schemaItems, function(element, name) { - elements[name] = { - attributes: element.attributes, - attributesOrder: element.attributesOrder - }; - - children[name] = element.children; - }); - - // Switch these on HTML4 - if (settings.schema != "html5") { - each(split('strong/b em/i'), function(item) { - item = split(item, '/'); - elements[item[1]].outputName = item[0]; - }); - } - - // Add default alt attribute for images - elements.img.attributesDefault = [{name: 'alt', value: ''}]; - - // Remove these if they are empty by default - each(split('ol ul sub sup blockquote span font a table tbody tr strong em b i'), function(name) { - if (elements[name]) { - elements[name].removeEmpty = true; - } - }); - - // Padd these by default - each(split('p h1 h2 h3 h4 h5 h6 th td pre div address caption'), function(name) { - elements[name].paddEmpty = true; - }); - - // Remove these if they have no attributes - each(split('span'), function(name) { - elements[name].removeEmptyAttrs = true; - }); - - // Remove these by default - // TODO: Reenable in 4.1 - /*each(split('script style'), function(name) { - delete elements[name]; - });*/ - } else { - setValidElements(settings.valid_elements); - } - - addCustomElements(settings.custom_elements); - addValidChildren(settings.valid_children); - addValidElements(settings.extended_valid_elements); - - // Todo: Remove this when we fix list handling to be valid - addValidChildren('+ol[ul|ol],+ul[ul|ol]'); - - // Delete invalid elements - if (settings.invalid_elements) { - each(explode(settings.invalid_elements), function(item) { - if (elements[item]) { - delete elements[item]; - } - }); - } - - // If the user didn't allow span only allow internal spans - if (!getElementRule('span')) { - addValidElements('span[!data-mce-type|*]'); - } - - /** - * Name/value map object with valid parents and children to those parents. - * - * @example - * children = { - * div:{p:{}, h1:{}} - * }; - * @field children - * @type Object - */ - self.children = children; - - /** - * Name/value map object with valid styles for each element. - * - * @field styles - * @type Object - */ - self.styles = validStyles; - - /** - * Returns a map with boolean attributes. - * - * @method getBoolAttrs - * @return {Object} Name/value lookup map for boolean attributes. - */ - self.getBoolAttrs = function() { - return boolAttrMap; - }; - - /** - * Returns a map with block elements. - * - * @method getBlockElements - * @return {Object} Name/value lookup map for block elements. - */ - self.getBlockElements = function() { - return blockElementsMap; - }; - - /** - * Returns a map with text block elements. Such as: p,h1-h6,div,address - * - * @method getTextBlockElements - * @return {Object} Name/value lookup map for block elements. - */ - self.getTextBlockElements = function() { - return textBlockElementsMap; - }; - - /** - * Returns a map with short ended elements such as BR or IMG. - * - * @method getShortEndedElements - * @return {Object} Name/value lookup map for short ended elements. - */ - self.getShortEndedElements = function() { - return shortEndedElementsMap; - }; - - /** - * Returns a map with self closing tags such as
  • . - * - * @method getSelfClosingElements - * @return {Object} Name/value lookup map for self closing tags elements. - */ - self.getSelfClosingElements = function() { - return selfClosingElementsMap; - }; - - /** - * Returns a map with elements that should be treated as contents regardless if it has text - * content in them or not such as TD, VIDEO or IMG. - * - * @method getNonEmptyElements - * @return {Object} Name/value lookup map for non empty elements. - */ - self.getNonEmptyElements = function() { - return nonEmptyElementsMap; - }; - - /** - * Returns a map with elements where white space is to be preserved like PRE or SCRIPT. - * - * @method getWhiteSpaceElements - * @return {Object} Name/value lookup map for white space elements. - */ - self.getWhiteSpaceElements = function() { - return whiteSpaceElementsMap; - }; - - /** - * Returns a map with special elements. These are elements that needs to be parsed - * in a special way such as script, style, textarea etc. The map object values - * are regexps used to find the end of the element. - * - * @method getSpecialElements - * @return {Object} Name/value lookup map for special elements. - */ - self.getSpecialElements = function() { - return specialElements; - }; - - /** - * Returns true/false if the specified element and it's child is valid or not - * according to the schema. - * - * @method isValidChild - * @param {String} name Element name to check for. - * @param {String} child Element child to verify. - * @return {Boolean} True/false if the element is a valid child of the specified parent. - */ - self.isValidChild = function(name, child) { - var parent = children[name]; - - return !!(parent && parent[child]); - }; - - /** - * Returns true/false if the specified element name and optional attribute is - * valid according to the schema. - * - * @method isValid - * @param {String} name Name of element to check. - * @param {String} attr Optional attribute name to check for. - * @return {Boolean} True/false if the element and attribute is valid. - */ - self.isValid = function(name, attr) { - var attrPatterns, i, rule = getElementRule(name); - - // Check if it's a valid element - if (rule) { - if (attr) { - // Check if attribute name exists - if (rule.attributes[attr]) { - return true; - } - - // Check if attribute matches a regexp pattern - attrPatterns = rule.attributePatterns; - if (attrPatterns) { - i = attrPatterns.length; - while (i--) { - if (attrPatterns[i].pattern.test(name)) { - return true; - } - } - } - } else { - return true; - } - } - - // No match - return false; - }; - - /** - * Returns true/false if the specified element is valid or not - * according to the schema. - * - * @method getElementRule - * @param {String} name Element name to check for. - * @return {Object} Element object or undefined if the element isn't valid. - */ - self.getElementRule = getElementRule; - - /** - * Returns an map object of all custom elements. - * - * @method getCustomElements - * @return {Object} Name/value map object of all custom elements. - */ - self.getCustomElements = function() { - return customElementsMap; - }; - - /** - * Parses a valid elements string and adds it to the schema. The valid elements - * format is for example "element[attr=default|otherattr]". - * Existing rules will be replaced with the ones specified, so this extends the schema. - * - * @method addValidElements - * @param {String} valid_elements String in the valid elements format to be parsed. - */ - self.addValidElements = addValidElements; - - /** - * Parses a valid elements string and sets it to the schema. The valid elements - * format is for example "element[attr=default|otherattr]". - * Existing rules will be replaced with the ones specified, so this extends the schema. - * - * @method setValidElements - * @param {String} valid_elements String in the valid elements format to be parsed. - */ - self.setValidElements = setValidElements; - - /** - * Adds custom non HTML elements to the schema. - * - * @method addCustomElements - * @param {String} custom_elements Comma separated list of custom elements to add. - */ - self.addCustomElements = addCustomElements; - - /** - * Parses a valid children string and adds them to the schema structure. The valid children - * format is for example: "element[child1|child2]". - * - * @method addValidChildren - * @param {String} valid_children Valid children elements string to parse - */ - self.addValidChildren = addValidChildren; - - self.elements = elements; - }; -}); - -// Included from: js/tinymce/classes/html/SaxParser.js - -/** - * SaxParser.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*eslint max-depth:[2, 9] */ - -/** - * This class parses HTML code using pure JavaScript and executes various events for each item it finds. It will - * always execute the events in the right order for tag soup code like

    . It will also remove elements - * and attributes that doesn't fit the schema if the validate setting is enabled. - * - * @example - * var parser = new tinymce.html.SaxParser({ - * validate: true, - * - * comment: function(text) { - * console.log('Comment:', text); - * }, - * - * cdata: function(text) { - * console.log('CDATA:', text); - * }, - * - * text: function(text, raw) { - * console.log('Text:', text, 'Raw:', raw); - * }, - * - * start: function(name, attrs, empty) { - * console.log('Start:', name, attrs, empty); - * }, - * - * end: function(name) { - * console.log('End:', name); - * }, - * - * pi: function(name, text) { - * console.log('PI:', name, text); - * }, - * - * doctype: function(text) { - * console.log('DocType:', text); - * } - * }, schema); - * @class tinymce.html.SaxParser - * @version 3.4 - */ -define("tinymce/html/SaxParser", [ - "tinymce/html/Schema", - "tinymce/html/Entities", - "tinymce/util/Tools" -], function(Schema, Entities, Tools) { - var each = Tools.each; - - /** - * Constructs a new SaxParser instance. - * - * @constructor - * @method SaxParser - * @param {Object} settings Name/value collection of settings. comment, cdata, text, start and end are callbacks. - * @param {tinymce.html.Schema} schema HTML Schema class to use when parsing. - */ - return function(settings, schema) { - var self = this; - - function noop() {} - - settings = settings || {}; - self.schema = schema = schema || new Schema(); - - if (settings.fix_self_closing !== false) { - settings.fix_self_closing = true; - } - - // Add handler functions from settings and setup default handlers - each('comment cdata text start end pi doctype'.split(' '), function(name) { - if (name) { - self[name] = settings[name] || noop; - } - }); - - /** - * Parses the specified HTML string and executes the callbacks for each item it finds. - * - * @example - * new SaxParser({...}).parse('text'); - * @method parse - * @param {String} html Html string to sax parse. - */ - self.parse = function(html) { - var self = this, matches, index = 0, value, endRegExp, stack = [], attrList, i, text, name; - var isInternalElement, removeInternalElements, shortEndedElements, fillAttrsMap, isShortEnded; - var validate, elementRule, isValidElement, attr, attribsValue, validAttributesMap, validAttributePatterns; - var attributesRequired, attributesDefault, attributesForced; - var anyAttributesRequired, selfClosing, tokenRegExp, attrRegExp, specialElements, attrValue, idCount = 0; - var decode = Entities.decode, fixSelfClosing, filteredUrlAttrs = Tools.makeMap('src,href'); - var scriptUriRegExp = /(java|vb)script:/i; - - function processEndTag(name) { - var pos, i; - - // Find position of parent of the same type - pos = stack.length; - while (pos--) { - if (stack[pos].name === name) { - break; - } - } - - // Found parent - if (pos >= 0) { - // Close all the open elements - for (i = stack.length - 1; i >= pos; i--) { - name = stack[i]; - - if (name.valid) { - self.end(name.name); - } - } - - // Remove the open elements from the stack - stack.length = pos; - } - } - - function parseAttribute(match, name, value, val2, val3) { - var attrRule, i, trimRegExp = /[\s\u0000-\u001F]+/g; - - name = name.toLowerCase(); - value = name in fillAttrsMap ? name : decode(value || val2 || val3 || ''); // Handle boolean attribute than value attribute - - // Validate name and value pass through all data- attributes - if (validate && !isInternalElement && name.indexOf('data-') !== 0) { - attrRule = validAttributesMap[name]; - - // Find rule by pattern matching - if (!attrRule && validAttributePatterns) { - i = validAttributePatterns.length; - while (i--) { - attrRule = validAttributePatterns[i]; - if (attrRule.pattern.test(name)) { - break; - } - } - - // No rule matched - if (i === -1) { - attrRule = null; - } - } - - // No attribute rule found - if (!attrRule) { - return; - } - - // Validate value - if (attrRule.validValues && !(value in attrRule.validValues)) { - return; - } - } - - // Block any javascript: urls - if (filteredUrlAttrs[name] && !settings.allow_script_urls) { - var uri = value.replace(trimRegExp, ''); - - try { - // Might throw malformed URI sequence - uri = decodeURIComponent(uri); - if (scriptUriRegExp.test(uri)) { - return; - } - } catch (ex) { - // Fallback to non UTF-8 decoder - uri = unescape(uri); - if (scriptUriRegExp.test(uri)) { - return; - } - } - } - - // Add attribute to list and map - attrList.map[name] = value; - attrList.push({ - name: name, - value: value - }); - } - - // Precompile RegExps and map objects - tokenRegExp = new RegExp('<(?:' + - '(?:!--([\\w\\W]*?)-->)|' + // Comment - '(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|' + // CDATA - '(?:!DOCTYPE([\\w\\W]*?)>)|' + // DOCTYPE - '(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + // PI - '(?:\\/([^>]+)>)|' + // End element - '(?:([A-Za-z0-9\\-\\:\\.]+)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/|\\s+)>)' + // Start element - ')', 'g'); - - attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g; - - // Setup lookup tables for empty elements and boolean attributes - shortEndedElements = schema.getShortEndedElements(); - selfClosing = settings.self_closing_elements || schema.getSelfClosingElements(); - fillAttrsMap = schema.getBoolAttrs(); - validate = settings.validate; - removeInternalElements = settings.remove_internals; - fixSelfClosing = settings.fix_self_closing; - specialElements = schema.getSpecialElements(); - - while ((matches = tokenRegExp.exec(html))) { - // Text - if (index < matches.index) { - self.text(decode(html.substr(index, matches.index - index))); - } - - if ((value = matches[6])) { // End element - value = value.toLowerCase(); - - // IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements - if (value.charAt(0) === ':') { - value = value.substr(1); - } - - processEndTag(value); - } else if ((value = matches[7])) { // Start element - value = value.toLowerCase(); - - // IE will add a ":" in front of elements it doesn't understand like custom elements or HTML5 elements - if (value.charAt(0) === ':') { - value = value.substr(1); - } - - isShortEnded = value in shortEndedElements; - - // Is self closing tag for example an
  • after an open
  • - if (fixSelfClosing && selfClosing[value] && stack.length > 0 && stack[stack.length - 1].name === value) { - processEndTag(value); - } - - // Validate element - if (!validate || (elementRule = schema.getElementRule(value))) { - isValidElement = true; - - // Grab attributes map and patters when validation is enabled - if (validate) { - validAttributesMap = elementRule.attributes; - validAttributePatterns = elementRule.attributePatterns; - } - - // Parse attributes - if ((attribsValue = matches[8])) { - isInternalElement = attribsValue.indexOf('data-mce-type') !== -1; // Check if the element is an internal element - - // If the element has internal attributes then remove it if we are told to do so - if (isInternalElement && removeInternalElements) { - isValidElement = false; - } - - attrList = []; - attrList.map = {}; - - attribsValue.replace(attrRegExp, parseAttribute); - } else { - attrList = []; - attrList.map = {}; - } - - // Process attributes if validation is enabled - if (validate && !isInternalElement) { - attributesRequired = elementRule.attributesRequired; - attributesDefault = elementRule.attributesDefault; - attributesForced = elementRule.attributesForced; - anyAttributesRequired = elementRule.removeEmptyAttrs; - - // Check if any attribute exists - if (anyAttributesRequired && !attrList.length) { - isValidElement = false; - } - - // Handle forced attributes - if (attributesForced) { - i = attributesForced.length; - while (i--) { - attr = attributesForced[i]; - name = attr.name; - attrValue = attr.value; - - if (attrValue === '{$uid}') { - attrValue = 'mce_' + idCount++; - } - - attrList.map[name] = attrValue; - attrList.push({name: name, value: attrValue}); - } - } - - // Handle default attributes - if (attributesDefault) { - i = attributesDefault.length; - while (i--) { - attr = attributesDefault[i]; - name = attr.name; - - if (!(name in attrList.map)) { - attrValue = attr.value; - - if (attrValue === '{$uid}') { - attrValue = 'mce_' + idCount++; - } - - attrList.map[name] = attrValue; - attrList.push({name: name, value: attrValue}); - } - } - } - - // Handle required attributes - if (attributesRequired) { - i = attributesRequired.length; - while (i--) { - if (attributesRequired[i] in attrList.map) { - break; - } - } - - // None of the required attributes where found - if (i === -1) { - isValidElement = false; - } - } - - // Invalidate element if it's marked as bogus - if (attrList.map['data-mce-bogus']) { - isValidElement = false; - } - } - - if (isValidElement) { - self.start(value, attrList, isShortEnded); - } - } else { - isValidElement = false; - } - - // Treat script, noscript and style a bit different since they may include code that looks like elements - if ((endRegExp = specialElements[value])) { - endRegExp.lastIndex = index = matches.index + matches[0].length; - - if ((matches = endRegExp.exec(html))) { - if (isValidElement) { - text = html.substr(index, matches.index - index); - } - - index = matches.index + matches[0].length; - } else { - text = html.substr(index); - index = html.length; - } - - if (isValidElement) { - if (text.length > 0) { - self.text(text, true); - } - - self.end(value); - } - - tokenRegExp.lastIndex = index; - continue; - } - - // Push value on to stack - if (!isShortEnded) { - if (!attribsValue || attribsValue.indexOf('/') != attribsValue.length - 1) { - stack.push({name: value, valid: isValidElement}); - } else if (isValidElement) { - self.end(value); - } - } - } else if ((value = matches[1])) { // Comment - // Padd comment value to avoid browsers from parsing invalid comments as HTML - if (value.charAt(0) === '>') { - value = ' ' + value; - } - - if (!settings.allow_conditional_comments && value.substr(0, 3) === '[if') { - value = ' ' + value; - } - - self.comment(value); - } else if ((value = matches[2])) { // CDATA - self.cdata(value); - } else if ((value = matches[3])) { // DOCTYPE - self.doctype(value); - } else if ((value = matches[4])) { // PI - self.pi(value, matches[5]); - } - - index = matches.index + matches[0].length; - } - - // Text - if (index < html.length) { - self.text(decode(html.substr(index))); - } - - // Close any open elements - for (i = stack.length - 1; i >= 0; i--) { - value = stack[i]; - - if (value.valid) { - self.end(value.name); - } - } - }; - }; -}); - -// Included from: js/tinymce/classes/html/DomParser.js - -/** - * DomParser.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class parses HTML code into a DOM like structure of nodes it will remove redundant whitespace and make - * sure that the node tree is valid according to the specified schema. - * So for example:

    a

    b

    c

    will become

    a

    b

    c

    - * - * @example - * var parser = new tinymce.html.DomParser({validate: true}, schema); - * var rootNode = parser.parse('

    content

    '); - * - * @class tinymce.html.DomParser - * @version 3.4 - */ -define("tinymce/html/DomParser", [ - "tinymce/html/Node", - "tinymce/html/Schema", - "tinymce/html/SaxParser", - "tinymce/util/Tools" -], function(Node, Schema, SaxParser, Tools) { - var makeMap = Tools.makeMap, each = Tools.each, explode = Tools.explode, extend = Tools.extend; - - /** - * Constructs a new DomParser instance. - * - * @constructor - * @method DomParser - * @param {Object} settings Name/value collection of settings. comment, cdata, text, start and end are callbacks. - * @param {tinymce.html.Schema} schema HTML Schema class to use when parsing. - */ - return function(settings, schema) { - var self = this, nodeFilters = {}, attributeFilters = [], matchedNodes = {}, matchedAttributes = {}; - - settings = settings || {}; - settings.validate = "validate" in settings ? settings.validate : true; - settings.root_name = settings.root_name || 'body'; - self.schema = schema = schema || new Schema(); - - function fixInvalidChildren(nodes) { - var ni, node, parent, parents, newParent, currentNode, tempNode, childNode, i; - var nonEmptyElements, nonSplitableElements, textBlockElements, sibling, nextNode; - - nonSplitableElements = makeMap('tr,td,th,tbody,thead,tfoot,table'); - nonEmptyElements = schema.getNonEmptyElements(); - textBlockElements = schema.getTextBlockElements(); - - for (ni = 0; ni < nodes.length; ni++) { - node = nodes[ni]; - - // Already removed or fixed - if (!node.parent || node.fixed) { - continue; - } - - // If the invalid element is a text block and the text block is within a parent LI element - // Then unwrap the first text block and convert other sibling text blocks to LI elements similar to Word/Open Office - if (textBlockElements[node.name] && node.parent.name == 'li') { - // Move sibling text blocks after LI element - sibling = node.next; - while (sibling) { - if (textBlockElements[sibling.name]) { - sibling.name = 'li'; - sibling.fixed = true; - node.parent.insert(sibling, node.parent); - } else { - break; - } - - sibling = sibling.next; - } - - // Unwrap current text block - node.unwrap(node); - continue; - } - - // Get list of all parent nodes until we find a valid parent to stick the child into - parents = [node]; - for (parent = node.parent; parent && !schema.isValidChild(parent.name, node.name) && - !nonSplitableElements[parent.name]; parent = parent.parent) { - parents.push(parent); - } - - // Found a suitable parent - if (parent && parents.length > 1) { - // Reverse the array since it makes looping easier - parents.reverse(); - - // Clone the related parent and insert that after the moved node - newParent = currentNode = self.filterNode(parents[0].clone()); - - // Start cloning and moving children on the left side of the target node - for (i = 0; i < parents.length - 1; i++) { - if (schema.isValidChild(currentNode.name, parents[i].name)) { - tempNode = self.filterNode(parents[i].clone()); - currentNode.append(tempNode); - } else { - tempNode = currentNode; - } - - for (childNode = parents[i].firstChild; childNode && childNode != parents[i + 1]; ) { - nextNode = childNode.next; - tempNode.append(childNode); - childNode = nextNode; - } - - currentNode = tempNode; - } - - if (!newParent.isEmpty(nonEmptyElements)) { - parent.insert(newParent, parents[0], true); - parent.insert(node, newParent); - } else { - parent.insert(node, parents[0], true); - } - - // Check if the element is empty by looking through it's contents and special treatment for


    - parent = parents[0]; - if (parent.isEmpty(nonEmptyElements) || parent.firstChild === parent.lastChild && parent.firstChild.name === 'br') { - parent.empty().remove(); - } - } else if (node.parent) { - // If it's an LI try to find a UL/OL for it or wrap it - if (node.name === 'li') { - sibling = node.prev; - if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) { - sibling.append(node); - continue; - } - - sibling = node.next; - if (sibling && (sibling.name === 'ul' || sibling.name === 'ul')) { - sibling.insert(node, sibling.firstChild, true); - continue; - } - - node.wrap(self.filterNode(new Node('ul', 1))); - continue; - } - - // Try wrapping the element in a DIV - if (schema.isValidChild(node.parent.name, 'div') && schema.isValidChild('div', node.name)) { - node.wrap(self.filterNode(new Node('div', 1))); - } else { - // We failed wrapping it, then remove or unwrap it - if (node.name === 'style' || node.name === 'script') { - node.empty().remove(); - } else { - node.unwrap(); - } - } - } - } - } - - /** - * Runs the specified node though the element and attributes filters. - * - * @method filterNode - * @param {tinymce.html.Node} Node the node to run filters on. - * @return {tinymce.html.Node} The passed in node. - */ - self.filterNode = function(node) { - var i, name, list; - - // Run element filters - if (name in nodeFilters) { - list = matchedNodes[name]; - - if (list) { - list.push(node); - } else { - matchedNodes[name] = [node]; - } - } - - // Run attribute filters - i = attributeFilters.length; - while (i--) { - name = attributeFilters[i].name; - - if (name in node.attributes.map) { - list = matchedAttributes[name]; - - if (list) { - list.push(node); - } else { - matchedAttributes[name] = [node]; - } - } - } - - return node; - }; - - /** - * Adds a node filter function to the parser, the parser will collect the specified nodes by name - * and then execute the callback ones it has finished parsing the document. - * - * @example - * parser.addNodeFilter('p,h1', function(nodes, name) { - * for (var i = 0; i < nodes.length; i++) { - * console.log(nodes[i].name); - * } - * }); - * @method addNodeFilter - * @method {String} name Comma separated list of nodes to collect. - * @param {function} callback Callback function to execute once it has collected nodes. - */ - self.addNodeFilter = function(name, callback) { - each(explode(name), function(name) { - var list = nodeFilters[name]; - - if (!list) { - nodeFilters[name] = list = []; - } - - list.push(callback); - }); - }; - - /** - * Adds a attribute filter function to the parser, the parser will collect nodes that has the specified attributes - * and then execute the callback ones it has finished parsing the document. - * - * @example - * parser.addAttributeFilter('src,href', function(nodes, name) { - * for (var i = 0; i < nodes.length; i++) { - * console.log(nodes[i].name); - * } - * }); - * @method addAttributeFilter - * @method {String} name Comma separated list of nodes to collect. - * @param {function} callback Callback function to execute once it has collected nodes. - */ - self.addAttributeFilter = function(name, callback) { - each(explode(name), function(name) { - var i; - - for (i = 0; i < attributeFilters.length; i++) { - if (attributeFilters[i].name === name) { - attributeFilters[i].callbacks.push(callback); - return; - } - } - - attributeFilters.push({name: name, callbacks: [callback]}); - }); - }; - - /** - * Parses the specified HTML string into a DOM like node tree and returns the result. - * - * @example - * var rootNode = new DomParser({...}).parse('text'); - * @method parse - * @param {String} html Html string to sax parse. - * @param {Object} args Optional args object that gets passed to all filter functions. - * @return {tinymce.html.Node} Root node containing the tree. - */ - self.parse = function(html, args) { - var parser, rootNode, node, nodes, i, l, fi, fl, list, name, validate; - var blockElements, startWhiteSpaceRegExp, invalidChildren = [], isInWhiteSpacePreservedElement; - var endWhiteSpaceRegExp, allWhiteSpaceRegExp, isAllWhiteSpaceRegExp, whiteSpaceElements; - var children, nonEmptyElements, rootBlockName; - - args = args || {}; - matchedNodes = {}; - matchedAttributes = {}; - blockElements = extend(makeMap('script,style,head,html,body,title,meta,param'), schema.getBlockElements()); - nonEmptyElements = schema.getNonEmptyElements(); - children = schema.children; - validate = settings.validate; - rootBlockName = "forced_root_block" in args ? args.forced_root_block : settings.forced_root_block; - - whiteSpaceElements = schema.getWhiteSpaceElements(); - startWhiteSpaceRegExp = /^[ \t\r\n]+/; - endWhiteSpaceRegExp = /[ \t\r\n]+$/; - allWhiteSpaceRegExp = /[ \t\r\n]+/g; - isAllWhiteSpaceRegExp = /^[ \t\r\n]+$/; - - function addRootBlocks() { - var node = rootNode.firstChild, next, rootBlockNode; - - // Removes whitespace at beginning and end of block so: - //

    x

    ->

    x

    - function trim(rootBlockNode) { - if (rootBlockNode) { - node = rootBlockNode.firstChild; - if (node && node.type == 3) { - node.value = node.value.replace(startWhiteSpaceRegExp, ''); - } - - node = rootBlockNode.lastChild; - if (node && node.type == 3) { - node.value = node.value.replace(endWhiteSpaceRegExp, ''); - } - } - } - - // Check if rootBlock is valid within rootNode for example if P is valid in H1 if H1 is the contentEditabe root - if (!schema.isValidChild(rootNode.name, rootBlockName.toLowerCase())) { - return; - } - - while (node) { - next = node.next; - - if (node.type == 3 || (node.type == 1 && node.name !== 'p' && - !blockElements[node.name] && !node.attr('data-mce-type'))) { - if (!rootBlockNode) { - // Create a new root block element - rootBlockNode = createNode(rootBlockName, 1); - rootBlockNode.attr(settings.forced_root_block_attrs); - rootNode.insert(rootBlockNode, node); - rootBlockNode.append(node); - } else { - rootBlockNode.append(node); - } - } else { - trim(rootBlockNode); - rootBlockNode = null; - } - - node = next; - } - - trim(rootBlockNode); - } - - function createNode(name, type) { - var node = new Node(name, type), list; - - if (name in nodeFilters) { - list = matchedNodes[name]; - - if (list) { - list.push(node); - } else { - matchedNodes[name] = [node]; - } - } - - return node; - } - - function removeWhitespaceBefore(node) { - var textNode, textVal, sibling; - - for (textNode = node.prev; textNode && textNode.type === 3; ) { - textVal = textNode.value.replace(endWhiteSpaceRegExp, ''); - - if (textVal.length > 0) { - textNode.value = textVal; - textNode = textNode.prev; - } else { - sibling = textNode.prev; - textNode.remove(); - textNode = sibling; - } - } - } - - function cloneAndExcludeBlocks(input) { - var name, output = {}; - - for (name in input) { - if (name !== 'li' && name != 'p') { - output[name] = input[name]; - } - } - - return output; - } - - parser = new SaxParser({ - validate: validate, - allow_script_urls: settings.allow_script_urls, - allow_conditional_comments: settings.allow_conditional_comments, - - // Exclude P and LI from DOM parsing since it's treated better by the DOM parser - self_closing_elements: cloneAndExcludeBlocks(schema.getSelfClosingElements()), - - cdata: function(text) { - node.append(createNode('#cdata', 4)).value = text; - }, - - text: function(text, raw) { - var textNode; - - // Trim all redundant whitespace on non white space elements - if (!isInWhiteSpacePreservedElement) { - text = text.replace(allWhiteSpaceRegExp, ' '); - - if (node.lastChild && blockElements[node.lastChild.name]) { - text = text.replace(startWhiteSpaceRegExp, ''); - } - } - - // Do we need to create the node - if (text.length !== 0) { - textNode = createNode('#text', 3); - textNode.raw = !!raw; - node.append(textNode).value = text; - } - }, - - comment: function(text) { - node.append(createNode('#comment', 8)).value = text; - }, - - pi: function(name, text) { - node.append(createNode(name, 7)).value = text; - removeWhitespaceBefore(node); - }, - - doctype: function(text) { - var newNode; - - newNode = node.append(createNode('#doctype', 10)); - newNode.value = text; - removeWhitespaceBefore(node); - }, - - start: function(name, attrs, empty) { - var newNode, attrFiltersLen, elementRule, attrName, parent; - - elementRule = validate ? schema.getElementRule(name) : {}; - if (elementRule) { - newNode = createNode(elementRule.outputName || name, 1); - newNode.attributes = attrs; - newNode.shortEnded = empty; - - node.append(newNode); - - // Check if node is valid child of the parent node is the child is - // unknown we don't collect it since it's probably a custom element - parent = children[node.name]; - if (parent && children[newNode.name] && !parent[newNode.name]) { - invalidChildren.push(newNode); - } - - attrFiltersLen = attributeFilters.length; - while (attrFiltersLen--) { - attrName = attributeFilters[attrFiltersLen].name; - - if (attrName in attrs.map) { - list = matchedAttributes[attrName]; - - if (list) { - list.push(newNode); - } else { - matchedAttributes[attrName] = [newNode]; - } - } - } - - // Trim whitespace before block - if (blockElements[name]) { - removeWhitespaceBefore(newNode); - } - - // Change current node if the element wasn't empty i.e not
    or - if (!empty) { - node = newNode; - } - - // Check if we are inside a whitespace preserved element - if (!isInWhiteSpacePreservedElement && whiteSpaceElements[name]) { - isInWhiteSpacePreservedElement = true; - } - } - }, - - end: function(name) { - var textNode, elementRule, text, sibling, tempNode; - - elementRule = validate ? schema.getElementRule(name) : {}; - if (elementRule) { - if (blockElements[name]) { - if (!isInWhiteSpacePreservedElement) { - // Trim whitespace of the first node in a block - textNode = node.firstChild; - if (textNode && textNode.type === 3) { - text = textNode.value.replace(startWhiteSpaceRegExp, ''); - - // Any characters left after trim or should we remove it - if (text.length > 0) { - textNode.value = text; - textNode = textNode.next; - } else { - sibling = textNode.next; - textNode.remove(); - textNode = sibling; - - // Remove any pure whitespace siblings - while (textNode && textNode.type === 3) { - text = textNode.value; - sibling = textNode.next; - - if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) { - textNode.remove(); - textNode = sibling; - } - - textNode = sibling; - } - } - } - - // Trim whitespace of the last node in a block - textNode = node.lastChild; - if (textNode && textNode.type === 3) { - text = textNode.value.replace(endWhiteSpaceRegExp, ''); - - // Any characters left after trim or should we remove it - if (text.length > 0) { - textNode.value = text; - textNode = textNode.prev; - } else { - sibling = textNode.prev; - textNode.remove(); - textNode = sibling; - - // Remove any pure whitespace siblings - while (textNode && textNode.type === 3) { - text = textNode.value; - sibling = textNode.prev; - - if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) { - textNode.remove(); - textNode = sibling; - } - - textNode = sibling; - } - } - } - } - - // Trim start white space - // Removed due to: #5424 - /*textNode = node.prev; - if (textNode && textNode.type === 3) { - text = textNode.value.replace(startWhiteSpaceRegExp, ''); - - if (text.length > 0) - textNode.value = text; - else - textNode.remove(); - }*/ - } - - // Check if we exited a whitespace preserved element - if (isInWhiteSpacePreservedElement && whiteSpaceElements[name]) { - isInWhiteSpacePreservedElement = false; - } - - // Handle empty nodes - if (elementRule.removeEmpty || elementRule.paddEmpty) { - if (node.isEmpty(nonEmptyElements)) { - if (elementRule.paddEmpty) { - node.empty().append(new Node('#text', '3')).value = '\u00a0'; - } else { - // Leave nodes that have a name like - if (!node.attributes.map.name && !node.attributes.map.id) { - tempNode = node.parent; - node.empty().remove(); - node = tempNode; - return; - } - } - } - } - - node = node.parent; - } - } - }, schema); - - rootNode = node = new Node(args.context || settings.root_name, 11); - - parser.parse(html); - - // Fix invalid children or report invalid children in a contextual parsing - if (validate && invalidChildren.length) { - if (!args.context) { - fixInvalidChildren(invalidChildren); - } else { - args.invalid = true; - } - } - - // Wrap nodes in the root into block elements if the root is body - if (rootBlockName && (rootNode.name == 'body' || args.isRootContent)) { - addRootBlocks(); - } - - // Run filters only when the contents is valid - if (!args.invalid) { - // Run node filters - for (name in matchedNodes) { - list = nodeFilters[name]; - nodes = matchedNodes[name]; - - // Remove already removed children - fi = nodes.length; - while (fi--) { - if (!nodes[fi].parent) { - nodes.splice(fi, 1); - } - } - - for (i = 0, l = list.length; i < l; i++) { - list[i](nodes, name, args); - } - } - - // Run attribute filters - for (i = 0, l = attributeFilters.length; i < l; i++) { - list = attributeFilters[i]; - - if (list.name in matchedAttributes) { - nodes = matchedAttributes[list.name]; - - // Remove already removed children - fi = nodes.length; - while (fi--) { - if (!nodes[fi].parent) { - nodes.splice(fi, 1); - } - } - - for (fi = 0, fl = list.callbacks.length; fi < fl; fi++) { - list.callbacks[fi](nodes, list.name, args); - } - } - } - } - - return rootNode; - }; - - // Remove
    at end of block elements Gecko and WebKit injects BR elements to - // make it possible to place the caret inside empty blocks. This logic tries to remove - // these elements and keep br elements that where intended to be there intact - if (settings.remove_trailing_brs) { - self.addNodeFilter('br', function(nodes) { - var i, l = nodes.length, node, blockElements = extend({}, schema.getBlockElements()); - var nonEmptyElements = schema.getNonEmptyElements(), parent, lastParent, prev, prevName; - var elementRule, textNode; - - // Remove brs from body element as well - blockElements.body = 1; - - // Must loop forwards since it will otherwise remove all brs in

    a


    - for (i = 0; i < l; i++) { - node = nodes[i]; - parent = node.parent; - - if (blockElements[node.parent.name] && node === parent.lastChild) { - // Loop all nodes to the left of the current node and check for other BR elements - // excluding bookmarks since they are invisible - prev = node.prev; - while (prev) { - prevName = prev.name; - - // Ignore bookmarks - if (prevName !== "span" || prev.attr('data-mce-type') !== 'bookmark') { - // Found a non BR element - if (prevName !== "br") { - break; - } - - // Found another br it's a

    structure then don't remove anything - if (prevName === 'br') { - node = null; - break; - } - } - - prev = prev.prev; - } - - if (node) { - node.remove(); - - // Is the parent to be considered empty after we removed the BR - if (parent.isEmpty(nonEmptyElements)) { - elementRule = schema.getElementRule(parent.name); - - // Remove or padd the element depending on schema rule - if (elementRule) { - if (elementRule.removeEmpty) { - parent.remove(); - } else if (elementRule.paddEmpty) { - parent.empty().append(new Node('#text', 3)).value = '\u00a0'; - } - } - } - } - } else { - // Replaces BR elements inside inline elements like


    - // so they become

     

    - lastParent = node; - while (parent && parent.firstChild === lastParent && parent.lastChild === lastParent) { - lastParent = parent; - - if (blockElements[parent.name]) { - break; - } - - parent = parent.parent; - } - - if (lastParent === parent) { - textNode = new Node('#text', 3); - textNode.value = '\u00a0'; - node.replace(textNode); - } - } - } - }); - } - - // Force anchor names closed, unless the setting "allow_html_in_named_anchor" is explicitly included. - if (!settings.allow_html_in_named_anchor) { - self.addAttributeFilter('id,name', function(nodes) { - var i = nodes.length, sibling, prevSibling, parent, node; - - while (i--) { - node = nodes[i]; - if (node.name === 'a' && node.firstChild && !node.attr('href')) { - parent = node.parent; - - // Move children after current node - sibling = node.lastChild; - do { - prevSibling = sibling.prev; - parent.insert(sibling, node); - sibling = prevSibling; - } while (sibling); - } - } - }); - } - }; -}); - -// Included from: js/tinymce/classes/html/Writer.js - -/** - * Writer.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class is used to write HTML tags out it can be used with the Serializer or the SaxParser. - * - * @class tinymce.html.Writer - * @example - * var writer = new tinymce.html.Writer({indent: true}); - * var parser = new tinymce.html.SaxParser(writer).parse('


    '); - * console.log(writer.getContent()); - * - * @class tinymce.html.Writer - * @version 3.4 - */ -define("tinymce/html/Writer", [ - "tinymce/html/Entities", - "tinymce/util/Tools" -], function(Entities, Tools) { - var makeMap = Tools.makeMap; - - /** - * Constructs a new Writer instance. - * - * @constructor - * @method Writer - * @param {Object} settings Name/value settings object. - */ - return function(settings) { - var html = [], indent, indentBefore, indentAfter, encode, htmlOutput; - - settings = settings || {}; - indent = settings.indent; - indentBefore = makeMap(settings.indent_before || ''); - indentAfter = makeMap(settings.indent_after || ''); - encode = Entities.getEncodeFunc(settings.entity_encoding || 'raw', settings.entities); - htmlOutput = settings.element_format == "html"; - - return { - /** - * Writes the a start element such as

    . - * - * @method start - * @param {String} name Name of the element. - * @param {Array} attrs Optional attribute array or undefined if it hasn't any. - * @param {Boolean} empty Optional empty state if the tag should end like
    . - */ - start: function(name, attrs, empty) { - var i, l, attr, value; - - if (indent && indentBefore[name] && html.length > 0) { - value = html[html.length - 1]; - - if (value.length > 0 && value !== '\n') { - html.push('\n'); - } - } - - html.push('<', name); - - if (attrs) { - for (i = 0, l = attrs.length; i < l; i++) { - attr = attrs[i]; - html.push(' ', attr.name, '="', encode(attr.value, true), '"'); - } - } - - if (!empty || htmlOutput) { - html[html.length] = '>'; - } else { - html[html.length] = ' />'; - } - - if (empty && indent && indentAfter[name] && html.length > 0) { - value = html[html.length - 1]; - - if (value.length > 0 && value !== '\n') { - html.push('\n'); - } - } - }, - - /** - * Writes the a end element such as

    . - * - * @method end - * @param {String} name Name of the element. - */ - end: function(name) { - var value; - - /*if (indent && indentBefore[name] && html.length > 0) { - value = html[html.length - 1]; - - if (value.length > 0 && value !== '\n') - html.push('\n'); - }*/ - - html.push(''); - - if (indent && indentAfter[name] && html.length > 0) { - value = html[html.length - 1]; - - if (value.length > 0 && value !== '\n') { - html.push('\n'); - } - } - }, - - /** - * Writes a text node. - * - * @method text - * @param {String} text String to write out. - * @param {Boolean} raw Optional raw state if true the contents wont get encoded. - */ - text: function(text, raw) { - if (text.length > 0) { - html[html.length] = raw ? text : encode(text); - } - }, - - /** - * Writes a cdata node such as . - * - * @method cdata - * @param {String} text String to write out inside the cdata. - */ - cdata: function(text) { - html.push(''); - }, - - /** - * Writes a comment node such as . - * - * @method cdata - * @param {String} text String to write out inside the comment. - */ - comment: function(text) { - html.push(''); - }, - - /** - * Writes a PI node such as . - * - * @method pi - * @param {String} name Name of the pi. - * @param {String} text String to write out inside the pi. - */ - pi: function(name, text) { - if (text) { - html.push(''); - } else { - html.push(''); - } - - if (indent) { - html.push('\n'); - } - }, - - /** - * Writes a doctype node such as . - * - * @method doctype - * @param {String} text String to write out inside the doctype. - */ - doctype: function(text) { - html.push('', indent ? '\n' : ''); - }, - - /** - * Resets the internal buffer if one wants to reuse the writer. - * - * @method reset - */ - reset: function() { - html.length = 0; - }, - - /** - * Returns the contents that got serialized. - * - * @method getContent - * @return {String} HTML contents that got written down. - */ - getContent: function() { - return html.join('').replace(/\n$/, ''); - } - }; - }; -}); - -// Included from: js/tinymce/classes/html/Serializer.js - -/** - * Serializer.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class is used to serialize down the DOM tree into a string using a Writer instance. - * - * - * @example - * new tinymce.html.Serializer().serialize(new tinymce.html.DomParser().parse('

    text

    ')); - * @class tinymce.html.Serializer - * @version 3.4 - */ -define("tinymce/html/Serializer", [ - "tinymce/html/Writer", - "tinymce/html/Schema" -], function(Writer, Schema) { - /** - * Constructs a new Serializer instance. - * - * @constructor - * @method Serializer - * @param {Object} settings Name/value settings object. - * @param {tinymce.html.Schema} schema Schema instance to use. - */ - return function(settings, schema) { - var self = this, writer = new Writer(settings); - - settings = settings || {}; - settings.validate = "validate" in settings ? settings.validate : true; - - self.schema = schema = schema || new Schema(); - self.writer = writer; - - /** - * Serializes the specified node into a string. - * - * @example - * new tinymce.html.Serializer().serialize(new tinymce.html.DomParser().parse('

    text

    ')); - * @method serialize - * @param {tinymce.html.Node} node Node instance to serialize. - * @return {String} String with HTML based on DOM tree. - */ - self.serialize = function(node) { - var handlers, validate; - - validate = settings.validate; - - handlers = { - // #text - 3: function(node) { - writer.text(node.value, node.raw); - }, - - // #comment - 8: function(node) { - writer.comment(node.value); - }, - - // Processing instruction - 7: function(node) { - writer.pi(node.name, node.value); - }, - - // Doctype - 10: function(node) { - writer.doctype(node.value); - }, - - // CDATA - 4: function(node) { - writer.cdata(node.value); - }, - - // Document fragment - 11: function(node) { - if ((node = node.firstChild)) { - do { - walk(node); - } while ((node = node.next)); - } - } - }; - - writer.reset(); - - function walk(node) { - var handler = handlers[node.type], name, isEmpty, attrs, attrName, attrValue, sortedAttrs, i, l, elementRule; - - if (!handler) { - name = node.name; - isEmpty = node.shortEnded; - attrs = node.attributes; - - // Sort attributes - if (validate && attrs && attrs.length > 1) { - sortedAttrs = []; - sortedAttrs.map = {}; - - elementRule = schema.getElementRule(node.name); - for (i = 0, l = elementRule.attributesOrder.length; i < l; i++) { - attrName = elementRule.attributesOrder[i]; - - if (attrName in attrs.map) { - attrValue = attrs.map[attrName]; - sortedAttrs.map[attrName] = attrValue; - sortedAttrs.push({name: attrName, value: attrValue}); - } - } - - for (i = 0, l = attrs.length; i < l; i++) { - attrName = attrs[i].name; - - if (!(attrName in sortedAttrs.map)) { - attrValue = attrs.map[attrName]; - sortedAttrs.map[attrName] = attrValue; - sortedAttrs.push({name: attrName, value: attrValue}); - } - } - - attrs = sortedAttrs; - } - - writer.start(node.name, attrs, isEmpty); - - if (!isEmpty) { - if ((node = node.firstChild)) { - do { - walk(node); - } while ((node = node.next)); - } - - writer.end(name); - } - } else { - handler(node); - } - } - - // Serialize element and treat all non elements as fragments - if (node.type == 1 && !settings.inner) { - walk(node); - } else { - handlers[11](node); - } - - return writer.getContent(); - }; - }; -}); - -// Included from: js/tinymce/classes/dom/Serializer.js - -/** - * Serializer.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class is used to serialize DOM trees into a string. Consult the TinyMCE Wiki API for - * more details and examples on how to use this class. - * - * @class tinymce.dom.Serializer - */ -define("tinymce/dom/Serializer", [ - "tinymce/dom/DOMUtils", - "tinymce/html/DomParser", - "tinymce/html/Entities", - "tinymce/html/Serializer", - "tinymce/html/Node", - "tinymce/html/Schema", - "tinymce/Env", - "tinymce/util/Tools" -], function(DOMUtils, DomParser, Entities, Serializer, Node, Schema, Env, Tools) { - var each = Tools.each, trim = Tools.trim; - var DOM = DOMUtils.DOM; - - /** - * Constructs a new DOM serializer class. - * - * @constructor - * @method Serializer - * @param {Object} settings Serializer settings object. - * @param {tinymce.Editor} editor Optional editor to bind events to and get schema/dom from. - */ - return function(settings, editor) { - var dom, schema, htmlParser; - - if (editor) { - dom = editor.dom; - schema = editor.schema; - } - - // Default DOM and Schema if they are undefined - dom = dom || DOM; - schema = schema || new Schema(settings); - settings.entity_encoding = settings.entity_encoding || 'named'; - settings.remove_trailing_brs = "remove_trailing_brs" in settings ? settings.remove_trailing_brs : true; - - htmlParser = new DomParser(settings, schema); - - // Convert move data-mce-src, data-mce-href and data-mce-style into nodes or process them if needed - htmlParser.addAttributeFilter('src,href,style', function(nodes, name) { - var i = nodes.length, node, value, internalName = 'data-mce-' + name; - var urlConverter = settings.url_converter, urlConverterScope = settings.url_converter_scope, undef; - - while (i--) { - node = nodes[i]; - - value = node.attributes.map[internalName]; - if (value !== undef) { - // Set external name to internal value and remove internal - node.attr(name, value.length > 0 ? value : null); - node.attr(internalName, null); - } else { - // No internal attribute found then convert the value we have in the DOM - value = node.attributes.map[name]; - - if (name === "style") { - value = dom.serializeStyle(dom.parseStyle(value), node.name); - } else if (urlConverter) { - value = urlConverter.call(urlConverterScope, value, name, node.name); - } - - node.attr(name, value.length > 0 ? value : null); - } - } - }); - - // Remove internal classes mceItem<..> or mceSelected - htmlParser.addAttributeFilter('class', function(nodes) { - var i = nodes.length, node, value; - - while (i--) { - node = nodes[i]; - value = node.attr('class').replace(/(?:^|\s)mce-item-\w+(?!\S)/g, ''); - node.attr('class', value.length > 0 ? value : null); - } - }); - - // Remove bookmark elements - htmlParser.addAttributeFilter('data-mce-type', function(nodes, name, args) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - - if (node.attributes.map['data-mce-type'] === 'bookmark' && !args.cleanup) { - node.remove(); - } - } - }); - - // Remove expando attributes - htmlParser.addAttributeFilter('data-mce-expando', function(nodes, name) { - var i = nodes.length; - - while (i--) { - nodes[i].attr(name, null); - } - }); - - htmlParser.addNodeFilter('noscript', function(nodes) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i].firstChild; - - if (node) { - node.value = Entities.decode(node.value); - } - } - }); - - // Force script into CDATA sections and remove the mce- prefix also add comments around styles - htmlParser.addNodeFilter('script,style', function(nodes, name) { - var i = nodes.length, node, value; - - function trim(value) { - /*jshint maxlen:255 */ - /*eslint max-len:0 */ - return value.replace(/()/g, '\n') - .replace(/^[\r\n]*|[\r\n]*$/g, '') - .replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g, ''); - } - - while (i--) { - node = nodes[i]; - value = node.firstChild ? node.firstChild.value : ''; - - if (name === "script") { - // Remove mce- prefix from script elements and remove default text/javascript mime type (HTML5) - var type = (node.attr('type') || 'text/javascript').replace(/^mce\-/, ''); - node.attr('type', type === 'text/javascript' ? null : type); - - if (value.length > 0) { - node.firstChild.value = '// '; - } - } else { - if (value.length > 0) { - node.firstChild.value = ''; - } - } - } - }); - - // Convert comments to cdata and handle protected comments - htmlParser.addNodeFilter('#comment', function(nodes) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - - if (node.value.indexOf('[CDATA[') === 0) { - node.name = '#cdata'; - node.type = 4; - node.value = node.value.replace(/^\[CDATA\[|\]\]$/g, ''); - } else if (node.value.indexOf('mce:protected ') === 0) { - node.name = "#text"; - node.type = 3; - node.raw = true; - node.value = unescape(node.value).substr(14); - } - } - }); - - htmlParser.addNodeFilter('xml:namespace,input', function(nodes, name) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - if (node.type === 7) { - node.remove(); - } else if (node.type === 1) { - if (name === "input" && !("type" in node.attributes.map)) { - node.attr('type', 'text'); - } - } - } - }); - - // Fix list elements, TODO: Replace this later - if (settings.fix_list_elements) { - htmlParser.addNodeFilter('ul,ol', function(nodes) { - var i = nodes.length, node, parentNode; - - while (i--) { - node = nodes[i]; - parentNode = node.parent; - - if (parentNode.name === 'ul' || parentNode.name === 'ol') { - if (node.prev && node.prev.name === 'li') { - node.prev.append(node); - } - } - } - }); - } - - // Remove internal data attributes - htmlParser.addAttributeFilter('data-mce-src,data-mce-href,data-mce-style,data-mce-selected', function(nodes, name) { - var i = nodes.length; - - while (i--) { - nodes[i].attr(name, null); - } - }); - - // Return public methods - return { - /** - * Schema instance that was used to when the Serializer was constructed. - * - * @field {tinymce.html.Schema} schema - */ - schema: schema, - - /** - * Adds a node filter function to the parser used by the serializer, the parser will collect the specified nodes by name - * and then execute the callback ones it has finished parsing the document. - * - * @example - * parser.addNodeFilter('p,h1', function(nodes, name) { - * for (var i = 0; i < nodes.length; i++) { - * console.log(nodes[i].name); - * } - * }); - * @method addNodeFilter - * @method {String} name Comma separated list of nodes to collect. - * @param {function} callback Callback function to execute once it has collected nodes. - */ - addNodeFilter: htmlParser.addNodeFilter, - - /** - * Adds a attribute filter function to the parser used by the serializer, the parser will - * collect nodes that has the specified attributes - * and then execute the callback ones it has finished parsing the document. - * - * @example - * parser.addAttributeFilter('src,href', function(nodes, name) { - * for (var i = 0; i < nodes.length; i++) { - * console.log(nodes[i].name); - * } - * }); - * @method addAttributeFilter - * @method {String} name Comma separated list of nodes to collect. - * @param {function} callback Callback function to execute once it has collected nodes. - */ - addAttributeFilter: htmlParser.addAttributeFilter, - - /** - * Serializes the specified browser DOM node into a HTML string. - * - * @method serialize - * @param {DOMNode} node DOM node to serialize. - * @param {Object} args Arguments option that gets passed to event handlers. - */ - serialize: function(node, args) { - var self = this, impl, doc, oldDoc, htmlSerializer, content; - - // Explorer won't clone contents of script and style and the - // selected index of select elements are cleared on a clone operation. - if (Env.ie && dom.select('script,style,select,map').length > 0) { - content = node.innerHTML; - node = node.cloneNode(false); - dom.setHTML(node, content); - } else { - node = node.cloneNode(true); - } - - // Nodes needs to be attached to something in WebKit/Opera - // This fix will make DOM ranges and make Sizzle happy! - impl = node.ownerDocument.implementation; - if (impl.createHTMLDocument) { - // Create an empty HTML document - doc = impl.createHTMLDocument(""); - - // Add the element or it's children if it's a body element to the new document - each(node.nodeName == 'BODY' ? node.childNodes : [node], function(node) { - doc.body.appendChild(doc.importNode(node, true)); - }); - - // Grab first child or body element for serialization - if (node.nodeName != 'BODY') { - node = doc.body.firstChild; - } else { - node = doc.body; - } - - // set the new document in DOMUtils so createElement etc works - oldDoc = dom.doc; - dom.doc = doc; - } - - args = args || {}; - args.format = args.format || 'html'; - - // Don't wrap content if we want selected html - if (args.selection) { - args.forced_root_block = ''; - } - - // Pre process - if (!args.no_events) { - args.node = node; - self.onPreProcess(args); - } - - // Setup serializer - htmlSerializer = new Serializer(settings, schema); - - // Parse and serialize HTML - args.content = htmlSerializer.serialize( - htmlParser.parse(trim(args.getInner ? node.innerHTML : dom.getOuterHTML(node)), args) - ); - - // Replace all BOM characters for now until we can find a better solution - if (!args.cleanup) { - args.content = args.content.replace(/\uFEFF/g, ''); - } - - // Post process - if (!args.no_events) { - self.onPostProcess(args); - } - - // Restore the old document if it was changed - if (oldDoc) { - dom.doc = oldDoc; - } - - args.node = null; - - return args.content; - }, - - /** - * Adds valid elements rules to the serializers schema instance this enables you to specify things - * like what elements should be outputted and what attributes specific elements might have. - * Consult the Wiki for more details on this format. - * - * @method addRules - * @param {String} rules Valid elements rules string to add to schema. - */ - addRules: function(rules) { - schema.addValidElements(rules); - }, - - /** - * Sets the valid elements rules to the serializers schema instance this enables you to specify things - * like what elements should be outputted and what attributes specific elements might have. - * Consult the Wiki for more details on this format. - * - * @method setRules - * @param {String} rules Valid elements rules string. - */ - setRules: function(rules) { - schema.setValidElements(rules); - }, - - onPreProcess: function(args) { - if (editor) { - editor.fire('PreProcess', args); - } - }, - - onPostProcess: function(args) { - if (editor) { - editor.fire('PostProcess', args); - } - } - }; - }; -}); - -// Included from: js/tinymce/classes/dom/TridentSelection.js - -/** - * TridentSelection.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Selection class for old explorer versions. This one fakes the - * native selection object available on modern browsers. - * - * @class tinymce.dom.TridentSelection - */ -define("tinymce/dom/TridentSelection", [], function() { - function Selection(selection) { - var self = this, dom = selection.dom, FALSE = false; - - function getPosition(rng, start) { - var checkRng, startIndex = 0, endIndex, inside, - children, child, offset, index, position = -1, parent; - - // Setup test range, collapse it and get the parent - checkRng = rng.duplicate(); - checkRng.collapse(start); - parent = checkRng.parentElement(); - - // Check if the selection is within the right document - if (parent.ownerDocument !== selection.dom.doc) { - return; - } - - // IE will report non editable elements as it's parent so look for an editable one - while (parent.contentEditable === "false") { - parent = parent.parentNode; - } - - // If parent doesn't have any children then return that we are inside the element - if (!parent.hasChildNodes()) { - return {node: parent, inside: 1}; - } - - // Setup node list and endIndex - children = parent.children; - endIndex = children.length - 1; - - // Perform a binary search for the position - while (startIndex <= endIndex) { - index = Math.floor((startIndex + endIndex) / 2); - - // Move selection to node and compare the ranges - child = children[index]; - checkRng.moveToElementText(child); - position = checkRng.compareEndPoints(start ? 'StartToStart' : 'EndToEnd', rng); - - // Before/after or an exact match - if (position > 0) { - endIndex = index - 1; - } else if (position < 0) { - startIndex = index + 1; - } else { - return {node: child}; - } - } - - // Check if child position is before or we didn't find a position - if (position < 0) { - // No element child was found use the parent element and the offset inside that - if (!child) { - checkRng.moveToElementText(parent); - checkRng.collapse(true); - child = parent; - inside = true; - } else { - checkRng.collapse(false); - } - - // Walk character by character in text node until we hit the selected range endpoint, - // hit the end of document or parent isn't the right one - // We need to walk char by char since rng.text or rng.htmlText will trim line endings - offset = 0; - while (checkRng.compareEndPoints(start ? 'StartToStart' : 'StartToEnd', rng) !== 0) { - if (checkRng.move('character', 1) === 0 || parent != checkRng.parentElement()) { - break; - } - - offset++; - } - } else { - // Child position is after the selection endpoint - checkRng.collapse(true); - - // Walk character by character in text node until we hit the selected range endpoint, hit - // the end of document or parent isn't the right one - offset = 0; - while (checkRng.compareEndPoints(start ? 'StartToStart' : 'StartToEnd', rng) !== 0) { - if (checkRng.move('character', -1) === 0 || parent != checkRng.parentElement()) { - break; - } - - offset++; - } - } - - return {node: child, position: position, offset: offset, inside: inside}; - } - - // Returns a W3C DOM compatible range object by using the IE Range API - function getRange() { - var ieRange = selection.getRng(), domRange = dom.createRng(), element, collapsed, tmpRange, element2, bookmark; - - // If selection is outside the current document just return an empty range - element = ieRange.item ? ieRange.item(0) : ieRange.parentElement(); - if (element.ownerDocument != dom.doc) { - return domRange; - } - - collapsed = selection.isCollapsed(); - - // Handle control selection - if (ieRange.item) { - domRange.setStart(element.parentNode, dom.nodeIndex(element)); - domRange.setEnd(domRange.startContainer, domRange.startOffset + 1); - - return domRange; - } - - function findEndPoint(start) { - var endPoint = getPosition(ieRange, start), container, offset, textNodeOffset = 0, sibling, undef, nodeValue; - - container = endPoint.node; - offset = endPoint.offset; - - if (endPoint.inside && !container.hasChildNodes()) { - domRange[start ? 'setStart' : 'setEnd'](container, 0); - return; - } - - if (offset === undef) { - domRange[start ? 'setStartBefore' : 'setEndAfter'](container); - return; - } - - if (endPoint.position < 0) { - sibling = endPoint.inside ? container.firstChild : container.nextSibling; - - if (!sibling) { - domRange[start ? 'setStartAfter' : 'setEndAfter'](container); - return; - } - - if (!offset) { - if (sibling.nodeType == 3) { - domRange[start ? 'setStart' : 'setEnd'](sibling, 0); - } else { - domRange[start ? 'setStartBefore' : 'setEndBefore'](sibling); - } - - return; - } - - // Find the text node and offset - while (sibling) { - nodeValue = sibling.nodeValue; - textNodeOffset += nodeValue.length; - - // We are at or passed the position we where looking for - if (textNodeOffset >= offset) { - container = sibling; - textNodeOffset -= offset; - textNodeOffset = nodeValue.length - textNodeOffset; - break; - } - - sibling = sibling.nextSibling; - } - } else { - // Find the text node and offset - sibling = container.previousSibling; - - if (!sibling) { - return domRange[start ? 'setStartBefore' : 'setEndBefore'](container); - } - - // If there isn't any text to loop then use the first position - if (!offset) { - if (container.nodeType == 3) { - domRange[start ? 'setStart' : 'setEnd'](sibling, container.nodeValue.length); - } else { - domRange[start ? 'setStartAfter' : 'setEndAfter'](sibling); - } - - return; - } - - while (sibling) { - textNodeOffset += sibling.nodeValue.length; - - // We are at or passed the position we where looking for - if (textNodeOffset >= offset) { - container = sibling; - textNodeOffset -= offset; - break; - } - - sibling = sibling.previousSibling; - } - } - - domRange[start ? 'setStart' : 'setEnd'](container, textNodeOffset); - } - - try { - // Find start point - findEndPoint(true); - - // Find end point if needed - if (!collapsed) { - findEndPoint(); - } - } catch (ex) { - // IE has a nasty bug where text nodes might throw "invalid argument" when you - // access the nodeValue or other properties of text nodes. This seems to happend when - // text nodes are split into two nodes by a delete/backspace call. So lets detect it and try to fix it. - if (ex.number == -2147024809) { - // Get the current selection - bookmark = self.getBookmark(2); - - // Get start element - tmpRange = ieRange.duplicate(); - tmpRange.collapse(true); - element = tmpRange.parentElement(); - - // Get end element - if (!collapsed) { - tmpRange = ieRange.duplicate(); - tmpRange.collapse(false); - element2 = tmpRange.parentElement(); - element2.innerHTML = element2.innerHTML; - } - - // Remove the broken elements - element.innerHTML = element.innerHTML; - - // Restore the selection - self.moveToBookmark(bookmark); - - // Since the range has moved we need to re-get it - ieRange = selection.getRng(); - - // Find start point - findEndPoint(true); - - // Find end point if needed - if (!collapsed) { - findEndPoint(); - } - } else { - throw ex; // Throw other errors - } - } - - return domRange; - } - - this.getBookmark = function(type) { - var rng = selection.getRng(), bookmark = {}; - - function getIndexes(node) { - var parent, root, children, i, indexes = []; - - parent = node.parentNode; - root = dom.getRoot().parentNode; - - while (parent != root && parent.nodeType !== 9) { - children = parent.children; - - i = children.length; - while (i--) { - if (node === children[i]) { - indexes.push(i); - break; - } - } - - node = parent; - parent = parent.parentNode; - } - - return indexes; - } - - function getBookmarkEndPoint(start) { - var position; - - position = getPosition(rng, start); - if (position) { - return { - position: position.position, - offset: position.offset, - indexes: getIndexes(position.node), - inside: position.inside - }; - } - } - - // Non ubstructive bookmark - if (type === 2) { - // Handle text selection - if (!rng.item) { - bookmark.start = getBookmarkEndPoint(true); - - if (!selection.isCollapsed()) { - bookmark.end = getBookmarkEndPoint(); - } - } else { - bookmark.start = {ctrl: true, indexes: getIndexes(rng.item(0))}; - } - } - - return bookmark; - }; - - this.moveToBookmark = function(bookmark) { - var rng, body = dom.doc.body; - - function resolveIndexes(indexes) { - var node, i, idx, children; - - node = dom.getRoot(); - for (i = indexes.length - 1; i >= 0; i--) { - children = node.children; - idx = indexes[i]; - - if (idx <= children.length - 1) { - node = children[idx]; - } - } - - return node; - } - - function setBookmarkEndPoint(start) { - var endPoint = bookmark[start ? 'start' : 'end'], moveLeft, moveRng, undef, offset; - - if (endPoint) { - moveLeft = endPoint.position > 0; - - moveRng = body.createTextRange(); - moveRng.moveToElementText(resolveIndexes(endPoint.indexes)); - - offset = endPoint.offset; - if (offset !== undef) { - moveRng.collapse(endPoint.inside || moveLeft); - moveRng.moveStart('character', moveLeft ? -offset : offset); - } else { - moveRng.collapse(start); - } - - rng.setEndPoint(start ? 'StartToStart' : 'EndToStart', moveRng); - - if (start) { - rng.collapse(true); - } - } - } - - if (bookmark.start) { - if (bookmark.start.ctrl) { - rng = body.createControlRange(); - rng.addElement(resolveIndexes(bookmark.start.indexes)); - rng.select(); - } else { - rng = body.createTextRange(); - setBookmarkEndPoint(true); - setBookmarkEndPoint(); - rng.select(); - } - } - }; - - this.addRange = function(rng) { - var ieRng, ctrlRng, startContainer, startOffset, endContainer, endOffset, sibling, - doc = selection.dom.doc, body = doc.body, nativeRng, ctrlElm; - - function setEndPoint(start) { - var container, offset, marker, tmpRng, nodes; - - marker = dom.create('a'); - container = start ? startContainer : endContainer; - offset = start ? startOffset : endOffset; - tmpRng = ieRng.duplicate(); - - if (container == doc || container == doc.documentElement) { - container = body; - offset = 0; - } - - if (container.nodeType == 3) { - container.parentNode.insertBefore(marker, container); - tmpRng.moveToElementText(marker); - tmpRng.moveStart('character', offset); - dom.remove(marker); - ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng); - } else { - nodes = container.childNodes; - - if (nodes.length) { - if (offset >= nodes.length) { - dom.insertAfter(marker, nodes[nodes.length - 1]); - } else { - container.insertBefore(marker, nodes[offset]); - } - - tmpRng.moveToElementText(marker); - } else if (container.canHaveHTML) { - // Empty node selection for example
    |
    - // Setting innerHTML with a span marker then remove that marker seems to keep empty block elements open - container.innerHTML = ''; - marker = container.firstChild; - tmpRng.moveToElementText(marker); - tmpRng.collapse(FALSE); // Collapse false works better than true for some odd reason - } - - ieRng.setEndPoint(start ? 'StartToStart' : 'EndToEnd', tmpRng); - dom.remove(marker); - } - } - - // Setup some shorter versions - startContainer = rng.startContainer; - startOffset = rng.startOffset; - endContainer = rng.endContainer; - endOffset = rng.endOffset; - ieRng = body.createTextRange(); - - // If single element selection then try making a control selection out of it - if (startContainer == endContainer && startContainer.nodeType == 1) { - // Trick to place the caret inside an empty block element like

    - if (startOffset == endOffset && !startContainer.hasChildNodes()) { - if (startContainer.canHaveHTML) { - // Check if previous sibling is an empty block if it is then we need to render it - // IE would otherwise move the caret into the sibling instead of the empty startContainer see: #5236 - // Example this:

    |

    would become this:

    |

    - sibling = startContainer.previousSibling; - if (sibling && !sibling.hasChildNodes() && dom.isBlock(sibling)) { - sibling.innerHTML = ''; - } else { - sibling = null; - } - - startContainer.innerHTML = ''; - ieRng.moveToElementText(startContainer.lastChild); - ieRng.select(); - dom.doc.selection.clear(); - startContainer.innerHTML = ''; - - if (sibling) { - sibling.innerHTML = ''; - } - return; - } else { - startOffset = dom.nodeIndex(startContainer); - startContainer = startContainer.parentNode; - } - } - - if (startOffset == endOffset - 1) { - try { - ctrlElm = startContainer.childNodes[startOffset]; - ctrlRng = body.createControlRange(); - ctrlRng.addElement(ctrlElm); - ctrlRng.select(); - - // Check if the range produced is on the correct element and is a control range - // On IE 8 it will select the parent contentEditable container if you select an inner element see: #5398 - nativeRng = selection.getRng(); - if (nativeRng.item && ctrlElm === nativeRng.item(0)) { - return; - } - } catch (ex) { - // Ignore - } - } - } - - // Set start/end point of selection - setEndPoint(true); - setEndPoint(); - - // Select the new range and scroll it into view - ieRng.select(); - }; - - // Expose range method - this.getRangeAt = getRange; - } - - return Selection; -}); - -// Included from: js/tinymce/classes/util/VK.js - -/** - * VK.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This file exposes a set of the common KeyCodes for use. Please grow it as needed. - */ -define("tinymce/util/VK", [ - "tinymce/Env" -], function(Env) { - return { - BACKSPACE: 8, - DELETE: 46, - DOWN: 40, - ENTER: 13, - LEFT: 37, - RIGHT: 39, - SPACEBAR: 32, - TAB: 9, - UP: 38, - - modifierPressed: function(e) { - return e.shiftKey || e.ctrlKey || e.altKey; - }, - - metaKeyPressed: function(e) { - // Check if ctrl or meta key is pressed also check if alt is false for Polish users - return (Env.mac ? e.metaKey : e.ctrlKey) && !e.altKey; - } - }; -}); - -// Included from: js/tinymce/classes/dom/ControlSelection.js - -/** - * ControlSelection.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class handles control selection of elements. Controls are elements - * that can be resized and needs to be selected as a whole. It adds custom resize handles - * to all browser engines that support properly disabling the built in resize logic. - * - * @class tinymce.dom.ControlSelection - */ -define("tinymce/dom/ControlSelection", [ - "tinymce/util/VK", - "tinymce/util/Tools", - "tinymce/Env" -], function(VK, Tools, Env) { - return function(selection, editor) { - var dom = editor.dom, each = Tools.each; - var selectedElm, selectedElmGhost, resizeHandles, selectedHandle, lastMouseDownEvent; - var startX, startY, selectedElmX, selectedElmY, startW, startH, ratio, resizeStarted; - var width, height, editableDoc = editor.getDoc(), rootDocument = document, isIE = Env.ie && Env.ie < 11; - - // Details about each resize handle how to scale etc - resizeHandles = { - // Name: x multiplier, y multiplier, delta size x, delta size y - n: [0.5, 0, 0, -1], - e: [1, 0.5, 1, 0], - s: [0.5, 1, 0, 1], - w: [0, 0.5, -1, 0], - nw: [0, 0, -1, -1], - ne: [1, 0, 1, -1], - se: [1, 1, 1, 1], - sw: [0, 1, -1, 1] - }; - - // Add CSS for resize handles, cloned element and selected - var rootClass = '.mce-content-body'; - editor.contentStyles.push( - rootClass + ' div.mce-resizehandle {' + - 'position: absolute;' + - 'border: 1px solid black;' + - 'background: #FFF;' + - 'width: 5px;' + - 'height: 5px;' + - 'z-index: 10000' + - '}' + - rootClass + ' .mce-resizehandle:hover {' + - 'background: #000' + - '}' + - rootClass + ' img[data-mce-selected], hr[data-mce-selected] {' + - 'outline: 1px solid black;' + - 'resize: none' + // Have been talks about implementing this in browsers - '}' + - rootClass + ' .mce-clonedresizable {' + - 'position: absolute;' + - (Env.gecko ? '' : 'outline: 1px dashed black;') + // Gecko produces trails while resizing - 'opacity: .5;' + - 'filter: alpha(opacity=50);' + - 'z-index: 10000' + - '}' - ); - - function isResizable(elm) { - var selector = editor.settings.object_resizing; - - if (selector === false || Env.iOS) { - return false; - } - - if (typeof selector != 'string') { - selector = 'table,img,div'; - } - - if (elm.getAttribute('data-mce-resize') === 'false') { - return false; - } - - return editor.dom.is(elm, selector); - } - - function resizeGhostElement(e) { - var deltaX, deltaY; - - // Calc new width/height - deltaX = e.screenX - startX; - deltaY = e.screenY - startY; - - // Calc new size - width = deltaX * selectedHandle[2] + startW; - height = deltaY * selectedHandle[3] + startH; - - // Never scale down lower than 5 pixels - width = width < 5 ? 5 : width; - height = height < 5 ? 5 : height; - - // Constrain proportions when modifier key is pressed or if the nw, ne, sw, se corners are moved on an image - if (VK.modifierPressed(e) || (selectedElm.nodeName == "IMG" && selectedHandle[2] * selectedHandle[3] !== 0)) { - width = Math.round(height / ratio); - height = Math.round(width * ratio); - } - - // Update ghost size - dom.setStyles(selectedElmGhost, { - width: width, - height: height - }); - - // Update ghost X position if needed - if (selectedHandle[2] < 0 && selectedElmGhost.clientWidth <= width) { - dom.setStyle(selectedElmGhost, 'left', selectedElmX + (startW - width)); - } - - // Update ghost Y position if needed - if (selectedHandle[3] < 0 && selectedElmGhost.clientHeight <= height) { - dom.setStyle(selectedElmGhost, 'top', selectedElmY + (startH - height)); - } - - if (!resizeStarted) { - editor.fire('ObjectResizeStart', {target: selectedElm, width: startW, height: startH}); - resizeStarted = true; - } - } - - function endGhostResize() { - resizeStarted = false; - - function setSizeProp(name, value) { - if (value) { - // Resize by using style or attribute - if (selectedElm.style[name] || !editor.schema.isValid(selectedElm.nodeName.toLowerCase(), name)) { - dom.setStyle(selectedElm, name, value); - } else { - dom.setAttrib(selectedElm, name, value); - } - } - } - - // Set width/height properties - setSizeProp('width', width); - setSizeProp('height', height); - - dom.unbind(editableDoc, 'mousemove', resizeGhostElement); - dom.unbind(editableDoc, 'mouseup', endGhostResize); - - if (rootDocument != editableDoc) { - dom.unbind(rootDocument, 'mousemove', resizeGhostElement); - dom.unbind(rootDocument, 'mouseup', endGhostResize); - } - - // Remove ghost and update resize handle positions - dom.remove(selectedElmGhost); - - if (!isIE || selectedElm.nodeName == "TABLE") { - showResizeRect(selectedElm); - } - - editor.fire('ObjectResized', {target: selectedElm, width: width, height: height}); - editor.nodeChanged(); - } - - function showResizeRect(targetElm, mouseDownHandleName, mouseDownEvent) { - var position, targetWidth, targetHeight, e, rect, offsetParent = editor.getBody(); - - unbindResizeHandleEvents(); - - // Get position and size of target - position = dom.getPos(targetElm, offsetParent); - selectedElmX = position.x; - selectedElmY = position.y; - rect = targetElm.getBoundingClientRect(); // Fix for Gecko offsetHeight for table with caption - targetWidth = rect.width || (rect.right - rect.left); - targetHeight = rect.height || (rect.bottom - rect.top); - - // Reset width/height if user selects a new image/table - if (selectedElm != targetElm) { - detachResizeStartListener(); - selectedElm = targetElm; - width = height = 0; - } - - // Makes it possible to disable resizing - e = editor.fire('ObjectSelected', {target: targetElm}); - - if (isResizable(targetElm) && !e.isDefaultPrevented()) { - each(resizeHandles, function(handle, name) { - var handleElm, handlerContainerElm; - - function startDrag(e) { - startX = e.screenX; - startY = e.screenY; - startW = selectedElm.clientWidth; - startH = selectedElm.clientHeight; - ratio = startH / startW; - selectedHandle = handle; - - selectedElmGhost = selectedElm.cloneNode(true); - dom.addClass(selectedElmGhost, 'mce-clonedresizable'); - selectedElmGhost.contentEditable = false; // Hides IE move layer cursor - selectedElmGhost.unSelectabe = true; - dom.setStyles(selectedElmGhost, { - left: selectedElmX, - top: selectedElmY, - margin: 0 - }); - - selectedElmGhost.removeAttribute('data-mce-selected'); - editor.getBody().appendChild(selectedElmGhost); - - dom.bind(editableDoc, 'mousemove', resizeGhostElement); - dom.bind(editableDoc, 'mouseup', endGhostResize); - - if (rootDocument != editableDoc) { - dom.bind(rootDocument, 'mousemove', resizeGhostElement); - dom.bind(rootDocument, 'mouseup', endGhostResize); - } - } - - if (mouseDownHandleName) { - // Drag started by IE native resizestart - if (name == mouseDownHandleName) { - startDrag(mouseDownEvent); - } - - return; - } - - // Get existing or render resize handle - handleElm = dom.get('mceResizeHandle' + name); - if (!handleElm) { - handlerContainerElm = editor.getBody(); - - handleElm = dom.add(handlerContainerElm, 'div', { - id: 'mceResizeHandle' + name, - 'data-mce-bogus': true, - 'class': 'mce-resizehandle', - unselectable: true, - style: 'cursor:' + name + '-resize; margin:0; padding:0' - }); - - // Hides IE move layer cursor - // If we set it on Chrome we get this wounderful bug: #6725 - if (Env.ie) { - handleElm.contentEditable = false; - } - } else { - dom.show(handleElm); - } - - if (!handle.elm) { - dom.bind(handleElm, 'mousedown', function(e) { - e.stopImmediatePropagation(); - e.preventDefault(); - startDrag(e); - }); - - handle.elm = handleElm; - } - - /* - var halfHandleW = handleElm.offsetWidth / 2; - var halfHandleH = handleElm.offsetHeight / 2; - - // Position element - dom.setStyles(handleElm, { - left: Math.floor((targetWidth * handle[0] + selectedElmX) - halfHandleW + (handle[2] * halfHandleW)), - top: Math.floor((targetHeight * handle[1] + selectedElmY) - halfHandleH + (handle[3] * halfHandleH)) - }); - */ - - // Position element - dom.setStyles(handleElm, { - left: (targetWidth * handle[0] + selectedElmX) - (handleElm.offsetWidth / 2), - top: (targetHeight * handle[1] + selectedElmY) - (handleElm.offsetHeight / 2) - }); - }); - } else { - hideResizeRect(); - } - - selectedElm.setAttribute('data-mce-selected', '1'); - } - - function hideResizeRect() { - var name, handleElm; - - unbindResizeHandleEvents(); - - if (selectedElm) { - selectedElm.removeAttribute('data-mce-selected'); - } - - for (name in resizeHandles) { - handleElm = dom.get('mceResizeHandle' + name); - if (handleElm) { - dom.unbind(handleElm); - dom.remove(handleElm); - } - } - } - - function updateResizeRect(e) { - var controlElm; - - function isChildOrEqual(node, parent) { - if (node) { - do { - if (node === parent) { - return true; - } - } while ((node = node.parentNode)); - } - } - - // Remove data-mce-selected from all elements since they might have been copied using Ctrl+c/v - each(dom.select('img[data-mce-selected],hr[data-mce-selected]'), function(img) { - img.removeAttribute('data-mce-selected'); - }); - - controlElm = e.type == 'mousedown' ? e.target : selection.getNode(); - controlElm = dom.getParent(controlElm, isIE ? 'table' : 'table,img,hr'); - - if (isChildOrEqual(controlElm, editor.getBody())) { - disableGeckoResize(); - - if (isChildOrEqual(selection.getStart(), controlElm) && isChildOrEqual(selection.getEnd(), controlElm)) { - if (!isIE || (controlElm != selection.getStart() && selection.getStart().nodeName !== 'IMG')) { - showResizeRect(controlElm); - return; - } - } - } - - hideResizeRect(); - } - - function attachEvent(elm, name, func) { - if (elm && elm.attachEvent) { - elm.attachEvent('on' + name, func); - } - } - - function detachEvent(elm, name, func) { - if (elm && elm.detachEvent) { - elm.detachEvent('on' + name, func); - } - } - - function resizeNativeStart(e) { - var target = e.srcElement, pos, name, corner, cornerX, cornerY, relativeX, relativeY; - - pos = target.getBoundingClientRect(); - relativeX = lastMouseDownEvent.clientX - pos.left; - relativeY = lastMouseDownEvent.clientY - pos.top; - - // Figure out what corner we are draging on - for (name in resizeHandles) { - corner = resizeHandles[name]; - - cornerX = target.offsetWidth * corner[0]; - cornerY = target.offsetHeight * corner[1]; - - if (Math.abs(cornerX - relativeX) < 8 && Math.abs(cornerY - relativeY) < 8) { - selectedHandle = corner; - break; - } - } - - // Remove native selection and let the magic begin - resizeStarted = true; - editor.getDoc().selection.empty(); - showResizeRect(target, name, lastMouseDownEvent); - } - - function nativeControlSelect(e) { - var target = e.srcElement; - - if (target != selectedElm) { - detachResizeStartListener(); - - if (target.id.indexOf('mceResizeHandle') === 0) { - e.returnValue = false; - return; - } - - if (target.nodeName == 'IMG' || target.nodeName == 'TABLE') { - hideResizeRect(); - selectedElm = target; - attachEvent(target, 'resizestart', resizeNativeStart); - } - } - } - - function detachResizeStartListener() { - detachEvent(selectedElm, 'resizestart', resizeNativeStart); - } - - function unbindResizeHandleEvents() { - for (var name in resizeHandles) { - var handle = resizeHandles[name]; - - if (handle.elm) { - dom.unbind(handle.elm); - delete handle.elm; - } - } - } - - function disableGeckoResize() { - try { - // Disable object resizing on Gecko - editor.getDoc().execCommand('enableObjectResizing', false, false); - } catch (ex) { - // Ignore - } - } - - function controlSelect(elm) { - var ctrlRng; - - if (!isIE) { - return; - } - - ctrlRng = editableDoc.body.createControlRange(); - - try { - ctrlRng.addElement(elm); - ctrlRng.select(); - return true; - } catch (ex) { - // Ignore since the element can't be control selected for example a P tag - } - } - - editor.on('init', function() { - if (isIE) { - // Hide the resize rect on resize and reselect the image - editor.on('ObjectResized', function(e) { - if (e.target.nodeName != 'TABLE') { - hideResizeRect(); - controlSelect(e.target); - } - }); - - attachEvent(editor.getBody(), 'controlselect', nativeControlSelect); - - editor.on('mousedown', function(e) { - lastMouseDownEvent = e; - }); - } else { - disableGeckoResize(); - - if (Env.ie >= 11) { - // TODO: Drag/drop doesn't work - editor.on('mouseup', function(e) { - var nodeName = e.target.nodeName; - - if (/^(TABLE|IMG|HR)$/.test(nodeName)) { - editor.selection.select(e.target, nodeName == 'TABLE'); - editor.nodeChanged(); - } - }); - - editor.dom.bind(editor.getBody(), 'mscontrolselect', function(e) { - if (/^(TABLE|IMG|HR)$/.test(e.target.nodeName)) { - e.preventDefault(); - - // This moves the selection from being a control selection to a text like selection like in WebKit #6753 - // TODO: Fix this the day IE works like other browsers without this nasty native ugly control selections. - if (e.target.tagName == 'IMG') { - window.setTimeout(function() { - editor.selection.select(e.target); - }, 0); - } - } - }); - } - } - - editor.on('nodechange mousedown mouseup ResizeEditor', updateResizeRect); - - // Update resize rect while typing in a table - editor.on('keydown keyup', function(e) { - if (selectedElm && selectedElm.nodeName == "TABLE") { - updateResizeRect(e); - } - }); - - // Hide rect on focusout since it would float on top of windows otherwise - //editor.on('focusout', hideResizeRect); - }); - - editor.on('remove', unbindResizeHandleEvents); - - function destroy() { - selectedElm = selectedElmGhost = null; - - if (isIE) { - detachResizeStartListener(); - detachEvent(editor.getBody(), 'controlselect', nativeControlSelect); - } - } - - return { - isResizable: isResizable, - showResizeRect: showResizeRect, - hideResizeRect: hideResizeRect, - updateResizeRect: updateResizeRect, - controlSelect: controlSelect, - destroy: destroy - }; - }; -}); - -// Included from: js/tinymce/classes/dom/RangeUtils.js - -/** - * Range.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * RangeUtils - * - * @class tinymce.dom.RangeUtils - * @private - */ -define("tinymce/dom/RangeUtils", [ - "tinymce/util/Tools", - "tinymce/dom/TreeWalker" -], function(Tools, TreeWalker) { - var each = Tools.each; - - function RangeUtils(dom) { - /** - * Walks the specified range like object and executes the callback for each sibling collection it finds. - * - * @method walk - * @param {Object} rng Range like object. - * @param {function} callback Callback function to execute for each sibling collection. - */ - this.walk = function(rng, callback) { - var startContainer = rng.startContainer, - startOffset = rng.startOffset, - endContainer = rng.endContainer, - endOffset = rng.endOffset, - ancestor, startPoint, - endPoint, node, parent, siblings, nodes; - - // Handle table cell selection the table plugin enables - // you to fake select table cells and perform formatting actions on them - nodes = dom.select('td.mce-item-selected,th.mce-item-selected'); - if (nodes.length > 0) { - each(nodes, function(node) { - callback([node]); - }); - - return; - } - - /** - * Excludes start/end text node if they are out side the range - * - * @private - * @param {Array} nodes Nodes to exclude items from. - * @return {Array} Array with nodes excluding the start/end container if needed. - */ - function exclude(nodes) { - var node; - - // First node is excluded - node = nodes[0]; - if (node.nodeType === 3 && node === startContainer && startOffset >= node.nodeValue.length) { - nodes.splice(0, 1); - } - - // Last node is excluded - node = nodes[nodes.length - 1]; - if (endOffset === 0 && nodes.length > 0 && node === endContainer && node.nodeType === 3) { - nodes.splice(nodes.length - 1, 1); - } - - return nodes; - } - - /** - * Collects siblings - * - * @private - * @param {Node} node Node to collect siblings from. - * @param {String} name Name of the sibling to check for. - * @return {Array} Array of collected siblings. - */ - function collectSiblings(node, name, end_node) { - var siblings = []; - - for (; node && node != end_node; node = node[name]) { - siblings.push(node); - } - - return siblings; - } - - /** - * Find an end point this is the node just before the common ancestor root. - * - * @private - * @param {Node} node Node to start at. - * @param {Node} root Root/ancestor element to stop just before. - * @return {Node} Node just before the root element. - */ - function findEndPoint(node, root) { - do { - if (node.parentNode == root) { - return node; - } - - node = node.parentNode; - } while(node); - } - - function walkBoundary(start_node, end_node, next) { - var siblingName = next ? 'nextSibling' : 'previousSibling'; - - for (node = start_node, parent = node.parentNode; node && node != end_node; node = parent) { - parent = node.parentNode; - siblings = collectSiblings(node == start_node ? node : node[siblingName], siblingName); - - if (siblings.length) { - if (!next) { - siblings.reverse(); - } - - callback(exclude(siblings)); - } - } - } - - // If index based start position then resolve it - if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) { - startContainer = startContainer.childNodes[startOffset]; - } - - // If index based end position then resolve it - if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) { - endContainer = endContainer.childNodes[Math.min(endOffset - 1, endContainer.childNodes.length - 1)]; - } - - // Same container - if (startContainer == endContainer) { - return callback(exclude([startContainer])); - } - - // Find common ancestor and end points - ancestor = dom.findCommonAncestor(startContainer, endContainer); - - // Process left side - for (node = startContainer; node; node = node.parentNode) { - if (node === endContainer) { - return walkBoundary(startContainer, ancestor, true); - } - - if (node === ancestor) { - break; - } - } - - // Process right side - for (node = endContainer; node; node = node.parentNode) { - if (node === startContainer) { - return walkBoundary(endContainer, ancestor); - } - - if (node === ancestor) { - break; - } - } - - // Find start/end point - startPoint = findEndPoint(startContainer, ancestor) || startContainer; - endPoint = findEndPoint(endContainer, ancestor) || endContainer; - - // Walk left leaf - walkBoundary(startContainer, startPoint, true); - - // Walk the middle from start to end point - siblings = collectSiblings( - startPoint == startContainer ? startPoint : startPoint.nextSibling, - 'nextSibling', - endPoint == endContainer ? endPoint.nextSibling : endPoint - ); - - if (siblings.length) { - callback(exclude(siblings)); - } - - // Walk right leaf - walkBoundary(endContainer, endPoint); - }; - - /** - * Splits the specified range at it's start/end points. - * - * @private - * @param {Range/RangeObject} rng Range to split. - * @return {Object} Range position object. - */ - this.split = function(rng) { - var startContainer = rng.startContainer, - startOffset = rng.startOffset, - endContainer = rng.endContainer, - endOffset = rng.endOffset; - - function splitText(node, offset) { - return node.splitText(offset); - } - - // Handle single text node - if (startContainer == endContainer && startContainer.nodeType == 3) { - if (startOffset > 0 && startOffset < startContainer.nodeValue.length) { - endContainer = splitText(startContainer, startOffset); - startContainer = endContainer.previousSibling; - - if (endOffset > startOffset) { - endOffset = endOffset - startOffset; - startContainer = endContainer = splitText(endContainer, endOffset).previousSibling; - endOffset = endContainer.nodeValue.length; - startOffset = 0; - } else { - endOffset = 0; - } - } - } else { - // Split startContainer text node if needed - if (startContainer.nodeType == 3 && startOffset > 0 && startOffset < startContainer.nodeValue.length) { - startContainer = splitText(startContainer, startOffset); - startOffset = 0; - } - - // Split endContainer text node if needed - if (endContainer.nodeType == 3 && endOffset > 0 && endOffset < endContainer.nodeValue.length) { - endContainer = splitText(endContainer, endOffset).previousSibling; - endOffset = endContainer.nodeValue.length; - } - } - - return { - startContainer: startContainer, - startOffset: startOffset, - endContainer: endContainer, - endOffset: endOffset - }; - }; - - /** - * Normalizes the specified range by finding the closest best suitable caret location. - * - * @private - * @param {Range} rng Range to normalize. - * @return {Boolean} True/false if the specified range was normalized or not. - */ - this.normalize = function(rng) { - var normalized, collapsed; - - function normalizeEndPoint(start) { - var container, offset, walker, body = dom.getRoot(), node, nonEmptyElementsMap, nodeName; - var directionLeft, isAfterNode; - - function hasBrBeforeAfter(node, left) { - var walker = new TreeWalker(node, dom.getParent(node.parentNode, dom.isBlock) || body); - - while ((node = walker[left ? 'prev' : 'next']())) { - if (node.nodeName === "BR") { - return true; - } - } - } - - function isPrevNode(node, name) { - return node.previousSibling && node.previousSibling.nodeName == name; - } - - // Walks the dom left/right to find a suitable text node to move the endpoint into - // It will only walk within the current parent block or body and will stop if it hits a block or a BR/IMG - function findTextNodeRelative(left, startNode) { - var walker, lastInlineElement, parentBlockContainer; - - startNode = startNode || container; - parentBlockContainer = dom.getParent(startNode.parentNode, dom.isBlock) || body; - - // Lean left before the BR element if it's the only BR within a block element. Gecko bug: #6680 - // This:


    |

    becomes

    |

    - if (left && startNode.nodeName == 'BR' && isAfterNode && dom.isEmpty(parentBlockContainer)) { - container = startNode.parentNode; - offset = dom.nodeIndex(startNode); - normalized = true; - return; - } - - // Walk left until we hit a text node we can move to or a block/br/img - walker = new TreeWalker(startNode, parentBlockContainer); - while ((node = walker[left ? 'prev' : 'next']())) { - // Found text node that has a length - if (node.nodeType === 3 && node.nodeValue.length > 0) { - container = node; - offset = left ? node.nodeValue.length : 0; - normalized = true; - return; - } - - // Break if we find a block or a BR/IMG/INPUT etc - if (dom.isBlock(node) || nonEmptyElementsMap[node.nodeName.toLowerCase()]) { - return; - } - - lastInlineElement = node; - } - - // Only fetch the last inline element when in caret mode for now - if (collapsed && lastInlineElement) { - container = lastInlineElement; - normalized = true; - offset = 0; - } - } - - container = rng[(start ? 'start' : 'end') + 'Container']; - offset = rng[(start ? 'start' : 'end') + 'Offset']; - isAfterNode = container.nodeType == 1 && offset === container.childNodes.length; - nonEmptyElementsMap = dom.schema.getNonEmptyElements(); - directionLeft = start; - - if (container.nodeType == 1 && offset > container.childNodes.length - 1) { - directionLeft = false; - } - - // If the container is a document move it to the body element - if (container.nodeType === 9) { - container = dom.getRoot(); - offset = 0; - } - - // If the container is body try move it into the closest text node or position - if (container === body) { - // If start is before/after a image, table etc - if (directionLeft) { - node = container.childNodes[offset > 0 ? offset - 1 : 0]; - if (node) { - nodeName = node.nodeName.toLowerCase(); - if (nonEmptyElementsMap[node.nodeName] || node.nodeName == "TABLE") { - return; - } - } - } - - // Resolve the index - if (container.hasChildNodes()) { - offset = Math.min(!directionLeft && offset > 0 ? offset - 1 : offset, container.childNodes.length - 1); - container = container.childNodes[offset]; - offset = 0; - - // Don't walk into elements that doesn't have any child nodes like a IMG - if (container.hasChildNodes() && !/TABLE/.test(container.nodeName)) { - // Walk the DOM to find a text node to place the caret at or a BR - node = container; - walker = new TreeWalker(container, body); - - do { - // Found a text node use that position - if (node.nodeType === 3 && node.nodeValue.length > 0) { - offset = directionLeft ? 0 : node.nodeValue.length; - container = node; - normalized = true; - break; - } - - // Found a BR/IMG element that we can place the caret before - if (nonEmptyElementsMap[node.nodeName.toLowerCase()]) { - offset = dom.nodeIndex(node); - container = node.parentNode; - - // Put caret after image when moving the end point - if (node.nodeName == "IMG" && !directionLeft) { - offset++; - } - - normalized = true; - break; - } - } while ((node = (directionLeft ? walker.next() : walker.prev()))); - } - } - } - - // Lean the caret to the left if possible - if (collapsed) { - // So this: x|x - // Becomes: x|x - // Seems that only gecko has issues with this - if (container.nodeType === 3 && offset === 0) { - findTextNodeRelative(true); - } - - // Lean left into empty inline elements when the caret is before a BR - // So this: |
    - // Becomes: |
    - // Seems that only gecko has issues with this. - // Special edge case for

    x|

    since we don't want

    x|

    - if (container.nodeType === 1) { - node = container.childNodes[offset]; - - // Offset is after the containers last child - // then use the previous child for normalization - if (!node) { - node = container.childNodes[offset - 1]; - } - - if (node && node.nodeName === 'BR' && !isPrevNode(node, 'A') && - !hasBrBeforeAfter(node) && !hasBrBeforeAfter(node, true)) { - findTextNodeRelative(true, node); - } - } - } - - // Lean the start of the selection right if possible - // So this: x[x] - // Becomes: x[x] - if (directionLeft && !collapsed && container.nodeType === 3 && offset === container.nodeValue.length) { - findTextNodeRelative(false); - } - - // Set endpoint if it was normalized - if (normalized) { - rng['set' + (start ? 'Start' : 'End')](container, offset); - } - } - - collapsed = rng.collapsed; - - normalizeEndPoint(true); - - if (!collapsed) { - normalizeEndPoint(); - } - - // If it was collapsed then make sure it still is - if (normalized && collapsed) { - rng.collapse(true); - } - - return normalized; - }; - } - - /** - * Compares two ranges and checks if they are equal. - * - * @static - * @method compareRanges - * @param {DOMRange} rng1 First range to compare. - * @param {DOMRange} rng2 First range to compare. - * @return {Boolean} true/false if the ranges are equal. - */ - RangeUtils.compareRanges = function(rng1, rng2) { - if (rng1 && rng2) { - // Compare native IE ranges - if (rng1.item || rng1.duplicate) { - // Both are control ranges and the selected element matches - if (rng1.item && rng2.item && rng1.item(0) === rng2.item(0)) { - return true; - } - - // Both are text ranges and the range matches - if (rng1.isEqual && rng2.isEqual && rng2.isEqual(rng1)) { - return true; - } - } else { - // Compare w3c ranges - return rng1.startContainer == rng2.startContainer && rng1.startOffset == rng2.startOffset; - } - } - - return false; - }; - - return RangeUtils; -}); - -// Included from: js/tinymce/classes/dom/Selection.js - -/** - * Selection.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class handles text and control selection it's an crossbrowser utility class. - * Consult the TinyMCE Wiki API for more details and examples on how to use this class. - * - * @class tinymce.dom.Selection - * @example - * // Getting the currently selected node for the active editor - * alert(tinymce.activeEditor.selection.getNode().nodeName); - */ -define("tinymce/dom/Selection", [ - "tinymce/dom/TreeWalker", - "tinymce/dom/TridentSelection", - "tinymce/dom/ControlSelection", - "tinymce/dom/RangeUtils", - "tinymce/Env", - "tinymce/util/Tools" -], function(TreeWalker, TridentSelection, ControlSelection, RangeUtils, Env, Tools) { - var each = Tools.each, grep = Tools.grep, trim = Tools.trim; - var isIE = Env.ie, isOpera = Env.opera; - - /** - * Constructs a new selection instance. - * - * @constructor - * @method Selection - * @param {tinymce.dom.DOMUtils} dom DOMUtils object reference. - * @param {Window} win Window to bind the selection object to. - * @param {tinymce.dom.Serializer} serializer DOM serialization class to use for getContent. - */ - function Selection(dom, win, serializer, editor) { - var self = this; - - self.dom = dom; - self.win = win; - self.serializer = serializer; - self.editor = editor; - - self.controlSelection = new ControlSelection(self, editor); - - // No W3C Range support - if (!self.win.getSelection) { - self.tridentSel = new TridentSelection(self); - } - } - - Selection.prototype = { - /** - * Move the selection cursor range to the specified node and offset. - * If there is no node specified it will move it to the first suitable location within the body. - * - * @method setCursorLocation - * @param {Node} node Optional node to put the cursor in. - * @param {Number} offset Optional offset from the start of the node to put the cursor at. - */ - setCursorLocation: function(node, offset) { - var self = this, rng = self.dom.createRng(); - - if (!node) { - self._moveEndPoint(rng, self.editor.getBody(), true); - self.setRng(rng); - } else { - rng.setStart(node, offset); - rng.setEnd(node, offset); - self.setRng(rng); - self.collapse(false); - } - }, - - /** - * Returns the selected contents using the DOM serializer passed in to this class. - * - * @method getContent - * @param {Object} s Optional settings class with for example output format text or html. - * @return {String} Selected contents in for example HTML format. - * @example - * // Alerts the currently selected contents - * alert(tinymce.activeEditor.selection.getContent()); - * - * // Alerts the currently selected contents as plain text - * alert(tinymce.activeEditor.selection.getContent({format: 'text'})); - */ - getContent: function(args) { - var self = this, rng = self.getRng(), tmpElm = self.dom.create("body"); - var se = self.getSel(), whiteSpaceBefore, whiteSpaceAfter, fragment; - - args = args || {}; - whiteSpaceBefore = whiteSpaceAfter = ''; - args.get = true; - args.format = args.format || 'html'; - args.selection = true; - self.editor.fire('BeforeGetContent', args); - - if (args.format == 'text') { - return self.isCollapsed() ? '' : (rng.text || (se.toString ? se.toString() : '')); - } - - if (rng.cloneContents) { - fragment = rng.cloneContents(); - - if (fragment) { - tmpElm.appendChild(fragment); - } - } else if (rng.item !== undefined || rng.htmlText !== undefined) { - // IE will produce invalid markup if elements are present that - // it doesn't understand like custom elements or HTML5 elements. - // Adding a BR in front of the contents and then remoiving it seems to fix it though. - tmpElm.innerHTML = '
    ' + (rng.item ? rng.item(0).outerHTML : rng.htmlText); - tmpElm.removeChild(tmpElm.firstChild); - } else { - tmpElm.innerHTML = rng.toString(); - } - - // Keep whitespace before and after - if (/^\s/.test(tmpElm.innerHTML)) { - whiteSpaceBefore = ' '; - } - - if (/\s+$/.test(tmpElm.innerHTML)) { - whiteSpaceAfter = ' '; - } - - args.getInner = true; - - args.content = self.isCollapsed() ? '' : whiteSpaceBefore + self.serializer.serialize(tmpElm, args) + whiteSpaceAfter; - self.editor.fire('GetContent', args); - - return args.content; - }, - - /** - * Sets the current selection to the specified content. If any contents is selected it will be replaced - * with the contents passed in to this function. If there is no selection the contents will be inserted - * where the caret is placed in the editor/page. - * - * @method setContent - * @param {String} content HTML contents to set could also be other formats depending on settings. - * @param {Object} args Optional settings object with for example data format. - * @example - * // Inserts some HTML contents at the current selection - * tinymce.activeEditor.selection.setContent('Some contents'); - */ - setContent: function(content, args) { - var self = this, rng = self.getRng(), caretNode, doc = self.win.document, frag, temp; - - args = args || {format: 'html'}; - args.set = true; - args.selection = true; - content = args.content = content; - - // Dispatch before set content event - if (!args.no_events) { - self.editor.fire('BeforeSetContent', args); - } - - content = args.content; - - if (rng.insertNode) { - // Make caret marker since insertNode places the caret in the beginning of text after insert - content += '_'; - - // Delete and insert new node - if (rng.startContainer == doc && rng.endContainer == doc) { - // WebKit will fail if the body is empty since the range is then invalid and it can't insert contents - doc.body.innerHTML = content; - } else { - rng.deleteContents(); - - if (doc.body.childNodes.length === 0) { - doc.body.innerHTML = content; - } else { - // createContextualFragment doesn't exists in IE 9 DOMRanges - if (rng.createContextualFragment) { - rng.insertNode(rng.createContextualFragment(content)); - } else { - // Fake createContextualFragment call in IE 9 - frag = doc.createDocumentFragment(); - temp = doc.createElement('div'); - - frag.appendChild(temp); - temp.outerHTML = content; - - rng.insertNode(frag); - } - } - } - - // Move to caret marker - caretNode = self.dom.get('__caret'); - - // Make sure we wrap it compleatly, Opera fails with a simple select call - rng = doc.createRange(); - rng.setStartBefore(caretNode); - rng.setEndBefore(caretNode); - self.setRng(rng); - - // Remove the caret position - self.dom.remove('__caret'); - - try { - self.setRng(rng); - } catch (ex) { - // Might fail on Opera for some odd reason - } - } else { - if (rng.item) { - // Delete content and get caret text selection - doc.execCommand('Delete', false, null); - rng = self.getRng(); - } - - // Explorer removes spaces from the beginning of pasted contents - if (/^\s+/.test(content)) { - rng.pasteHTML('_' + content); - self.dom.remove('__mce_tmp'); - } else { - rng.pasteHTML(content); - } - } - - // Dispatch set content event - if (!args.no_events) { - self.editor.fire('SetContent', args); - } - }, - - /** - * Returns the start element of a selection range. If the start is in a text - * node the parent element will be returned. - * - * @method getStart - * @return {Element} Start element of selection range. - */ - getStart: function() { - var self = this, rng = self.getRng(), startElement, parentElement, checkRng, node; - - if (rng.duplicate || rng.item) { - // Control selection, return first item - if (rng.item) { - return rng.item(0); - } - - // Get start element - checkRng = rng.duplicate(); - checkRng.collapse(1); - startElement = checkRng.parentElement(); - if (startElement.ownerDocument !== self.dom.doc) { - startElement = self.dom.getRoot(); - } - - // Check if range parent is inside the start element, then return the inner parent element - // This will fix issues when a single element is selected, IE would otherwise return the wrong start element - parentElement = node = rng.parentElement(); - while ((node = node.parentNode)) { - if (node == startElement) { - startElement = parentElement; - break; - } - } - - return startElement; - } else { - startElement = rng.startContainer; - - if (startElement.nodeType == 1 && startElement.hasChildNodes()) { - startElement = startElement.childNodes[Math.min(startElement.childNodes.length - 1, rng.startOffset)]; - } - - if (startElement && startElement.nodeType == 3) { - return startElement.parentNode; - } - - return startElement; - } - }, - - /** - * Returns the end element of a selection range. If the end is in a text - * node the parent element will be returned. - * - * @method getEnd - * @return {Element} End element of selection range. - */ - getEnd: function() { - var self = this, rng = self.getRng(), endElement, endOffset; - - if (rng.duplicate || rng.item) { - if (rng.item) { - return rng.item(0); - } - - rng = rng.duplicate(); - rng.collapse(0); - endElement = rng.parentElement(); - if (endElement.ownerDocument !== self.dom.doc) { - endElement = self.dom.getRoot(); - } - - if (endElement && endElement.nodeName == 'BODY') { - return endElement.lastChild || endElement; - } - - return endElement; - } else { - endElement = rng.endContainer; - endOffset = rng.endOffset; - - if (endElement.nodeType == 1 && endElement.hasChildNodes()) { - endElement = endElement.childNodes[endOffset > 0 ? endOffset - 1 : endOffset]; - } - - if (endElement && endElement.nodeType == 3) { - return endElement.parentNode; - } - - return endElement; - } - }, - - /** - * Returns a bookmark location for the current selection. This bookmark object - * can then be used to restore the selection after some content modification to the document. - * - * @method getBookmark - * @param {Number} type Optional state if the bookmark should be simple or not. Default is complex. - * @param {Boolean} normalized Optional state that enables you to get a position that it would be after normalization. - * @return {Object} Bookmark object, use moveToBookmark with this object to restore the selection. - * @example - * // Stores a bookmark of the current selection - * var bm = tinymce.activeEditor.selection.getBookmark(); - * - * tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'Some new content'); - * - * // Restore the selection bookmark - * tinymce.activeEditor.selection.moveToBookmark(bm); - */ - getBookmark: function(type, normalized) { - var self = this, dom = self.dom, rng, rng2, id, collapsed, name, element, chr = '', styles; - - function findIndex(name, element) { - var index = 0; - - each(dom.select(name), function(node, i) { - if (node == element) { - index = i; - } - }); - - return index; - } - - function normalizeTableCellSelection(rng) { - function moveEndPoint(start) { - var container, offset, childNodes, prefix = start ? 'start' : 'end'; - - container = rng[prefix + 'Container']; - offset = rng[prefix + 'Offset']; - - if (container.nodeType == 1 && container.nodeName == "TR") { - childNodes = container.childNodes; - container = childNodes[Math.min(start ? offset : offset - 1, childNodes.length - 1)]; - if (container) { - offset = start ? 0 : container.childNodes.length; - rng['set' + (start ? 'Start' : 'End')](container, offset); - } - } - } - - moveEndPoint(true); - moveEndPoint(); - - return rng; - } - - function getLocation() { - var rng = self.getRng(true), root = dom.getRoot(), bookmark = {}; - - function getPoint(rng, start) { - var container = rng[start ? 'startContainer' : 'endContainer'], - offset = rng[start ? 'startOffset' : 'endOffset'], point = [], node, childNodes, after = 0; - - if (container.nodeType == 3) { - if (normalized) { - for (node = container.previousSibling; node && node.nodeType == 3; node = node.previousSibling) { - offset += node.nodeValue.length; - } - } - - point.push(offset); - } else { - childNodes = container.childNodes; - - if (offset >= childNodes.length && childNodes.length) { - after = 1; - offset = Math.max(0, childNodes.length - 1); - } - - point.push(self.dom.nodeIndex(childNodes[offset], normalized) + after); - } - - for (; container && container != root; container = container.parentNode) { - point.push(self.dom.nodeIndex(container, normalized)); - } - - return point; - } - - bookmark.start = getPoint(rng, true); - - if (!self.isCollapsed()) { - bookmark.end = getPoint(rng); - } - - return bookmark; - } - - if (type == 2) { - element = self.getNode(); - name = element ? element.nodeName : null; - - if (name == 'IMG') { - return {name: name, index: findIndex(name, element)}; - } - - if (self.tridentSel) { - return self.tridentSel.getBookmark(type); - } - - return getLocation(); - } - - // Handle simple range - if (type) { - return {rng: self.getRng()}; - } - - rng = self.getRng(); - id = dom.uniqueId(); - collapsed = self.isCollapsed(); - styles = 'overflow:hidden;line-height:0px'; - - // Explorer method - if (rng.duplicate || rng.item) { - // Text selection - if (!rng.item) { - rng2 = rng.duplicate(); - - try { - // Insert start marker - rng.collapse(); - rng.pasteHTML('' + chr + ''); - - // Insert end marker - if (!collapsed) { - rng2.collapse(false); - - // Detect the empty space after block elements in IE and move the - // end back one character

    ] becomes

    ]

    - rng.moveToElementText(rng2.parentElement()); - if (rng.compareEndPoints('StartToEnd', rng2) === 0) { - rng2.move('character', -1); - } - - rng2.pasteHTML('' + chr + ''); - } - } catch (ex) { - // IE might throw unspecified error so lets ignore it - return null; - } - } else { - // Control selection - element = rng.item(0); - name = element.nodeName; - - return {name: name, index: findIndex(name, element)}; - } - } else { - element = self.getNode(); - name = element.nodeName; - if (name == 'IMG') { - return {name: name, index: findIndex(name, element)}; - } - - // W3C method - rng2 = normalizeTableCellSelection(rng.cloneRange()); - - // Insert end marker - if (!collapsed) { - rng2.collapse(false); - rng2.insertNode(dom.create('span', {'data-mce-type': "bookmark", id: id + '_end', style: styles}, chr)); - } - - rng = normalizeTableCellSelection(rng); - rng.collapse(true); - rng.insertNode(dom.create('span', {'data-mce-type': "bookmark", id: id + '_start', style: styles}, chr)); - } - - self.moveToBookmark({id: id, keep: 1}); - - return {id: id}; - }, - - /** - * Restores the selection to the specified bookmark. - * - * @method moveToBookmark - * @param {Object} bookmark Bookmark to restore selection from. - * @return {Boolean} true/false if it was successful or not. - * @example - * // Stores a bookmark of the current selection - * var bm = tinymce.activeEditor.selection.getBookmark(); - * - * tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + 'Some new content'); - * - * // Restore the selection bookmark - * tinymce.activeEditor.selection.moveToBookmark(bm); - */ - moveToBookmark: function(bookmark) { - var self = this, dom = self.dom, rng, root, startContainer, endContainer, startOffset, endOffset; - - function setEndPoint(start) { - var point = bookmark[start ? 'start' : 'end'], i, node, offset, children; - - if (point) { - offset = point[0]; - - // Find container node - for (node = root, i = point.length - 1; i >= 1; i--) { - children = node.childNodes; - - if (point[i] > children.length - 1) { - return; - } - - node = children[point[i]]; - } - - // Move text offset to best suitable location - if (node.nodeType === 3) { - offset = Math.min(point[0], node.nodeValue.length); - } - - // Move element offset to best suitable location - if (node.nodeType === 1) { - offset = Math.min(point[0], node.childNodes.length); - } - - // Set offset within container node - if (start) { - rng.setStart(node, offset); - } else { - rng.setEnd(node, offset); - } - } - - return true; - } - - function restoreEndPoint(suffix) { - var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev, keep = bookmark.keep; - - if (marker) { - node = marker.parentNode; - - if (suffix == 'start') { - if (!keep) { - idx = dom.nodeIndex(marker); - } else { - node = marker.firstChild; - idx = 1; - } - - startContainer = endContainer = node; - startOffset = endOffset = idx; - } else { - if (!keep) { - idx = dom.nodeIndex(marker); - } else { - node = marker.firstChild; - idx = 1; - } - - endContainer = node; - endOffset = idx; - } - - if (!keep) { - prev = marker.previousSibling; - next = marker.nextSibling; - - // Remove all marker text nodes - each(grep(marker.childNodes), function(node) { - if (node.nodeType == 3) { - node.nodeValue = node.nodeValue.replace(/\uFEFF/g, ''); - } - }); - - // Remove marker but keep children if for example contents where inserted into the marker - // Also remove duplicated instances of the marker for example by a - // split operation or by WebKit auto split on paste feature - while ((marker = dom.get(bookmark.id + '_' + suffix))) { - dom.remove(marker, 1); - } - - // If siblings are text nodes then merge them unless it's Opera since it some how removes the node - // and we are sniffing since adding a lot of detection code for a browser with 3% of the market - // isn't worth the effort. Sorry, Opera but it's just a fact - if (prev && next && prev.nodeType == next.nodeType && prev.nodeType == 3 && !isOpera) { - idx = prev.nodeValue.length; - prev.appendData(next.nodeValue); - dom.remove(next); - - if (suffix == 'start') { - startContainer = endContainer = prev; - startOffset = endOffset = idx; - } else { - endContainer = prev; - endOffset = idx; - } - } - } - } - } - - function addBogus(node) { - // Adds a bogus BR element for empty block elements - if (dom.isBlock(node) && !node.innerHTML && !isIE) { - node.innerHTML = '
    '; - } - - return node; - } - - if (bookmark) { - if (bookmark.start) { - rng = dom.createRng(); - root = dom.getRoot(); - - if (self.tridentSel) { - return self.tridentSel.moveToBookmark(bookmark); - } - - if (setEndPoint(true) && setEndPoint()) { - self.setRng(rng); - } - } else if (bookmark.id) { - // Restore start/end points - restoreEndPoint('start'); - restoreEndPoint('end'); - - if (startContainer) { - rng = dom.createRng(); - rng.setStart(addBogus(startContainer), startOffset); - rng.setEnd(addBogus(endContainer), endOffset); - self.setRng(rng); - } - } else if (bookmark.name) { - self.select(dom.select(bookmark.name)[bookmark.index]); - } else if (bookmark.rng) { - self.setRng(bookmark.rng); - } - } - }, - - /** - * Selects the specified element. This will place the start and end of the selection range around the element. - * - * @method select - * @param {Element} node HMTL DOM element to select. - * @param {Boolean} content Optional bool state if the contents should be selected or not on non IE browser. - * @return {Element} Selected element the same element as the one that got passed in. - * @example - * // Select the first paragraph in the active editor - * tinymce.activeEditor.selection.select(tinymce.activeEditor.dom.select('p')[0]); - */ - select: function(node, content) { - var self = this, dom = self.dom, rng = dom.createRng(), idx; - - // Clear stored range set by FocusManager - self.lastFocusBookmark = null; - - if (node) { - if (!content && self.controlSelection.controlSelect(node)) { - return; - } - - idx = dom.nodeIndex(node); - rng.setStart(node.parentNode, idx); - rng.setEnd(node.parentNode, idx + 1); - - // Find first/last text node or BR element - if (content) { - self._moveEndPoint(rng, node, true); - self._moveEndPoint(rng, node); - } - - self.setRng(rng); - } - - return node; - }, - - /** - * Returns true/false if the selection range is collapsed or not. Collapsed means if it's a caret or a larger selection. - * - * @method isCollapsed - * @return {Boolean} true/false state if the selection range is collapsed or not. - * Collapsed means if it's a caret or a larger selection. - */ - isCollapsed: function() { - var self = this, rng = self.getRng(), sel = self.getSel(); - - if (!rng || rng.item) { - return false; - } - - if (rng.compareEndPoints) { - return rng.compareEndPoints('StartToEnd', rng) === 0; - } - - return !sel || rng.collapsed; - }, - - /** - * Collapse the selection to start or end of range. - * - * @method collapse - * @param {Boolean} to_start Optional boolean state if to collapse to end or not. Defaults to start. - */ - collapse: function(to_start) { - var self = this, rng = self.getRng(), node; - - // Control range on IE - if (rng.item) { - node = rng.item(0); - rng = self.win.document.body.createTextRange(); - rng.moveToElementText(node); - } - - rng.collapse(!!to_start); - self.setRng(rng); - }, - - /** - * Returns the browsers internal selection object. - * - * @method getSel - * @return {Selection} Internal browser selection object. - */ - getSel: function() { - var win = this.win; - - return win.getSelection ? win.getSelection() : win.document.selection; - }, - - /** - * Returns the browsers internal range object. - * - * @method getRng - * @param {Boolean} w3c Forces a compatible W3C range on IE. - * @return {Range} Internal browser range object. - * @see http://www.quirksmode.org/dom/range_intro.html - * @see http://www.dotvoid.com/2001/03/using-the-range-object-in-mozilla/ - */ - getRng: function(w3c) { - var self = this, selection, rng, elm, doc = self.win.document, ieRng; - - function tryCompareBounderyPoints(how, sourceRange, destinationRange) { - try { - return sourceRange.compareBoundaryPoints(how, destinationRange); - } catch (ex) { - // Gecko throws wrong document exception if the range points - // to nodes that where removed from the dom #6690 - // Browsers should mutate existing DOMRange instances so that they always point - // to something in the document this is not the case in Gecko works fine in IE/WebKit/Blink - // For performance reasons just return -1 - return -1; - } - } - - // Use last rng passed from FocusManager if it's available this enables - // calls to editor.selection.getStart() to work when caret focus is lost on IE - if (!w3c && self.lastFocusBookmark) { - var bookmark = self.lastFocusBookmark; - - // Convert bookmark to range IE 11 fix - if (bookmark.startContainer) { - rng = doc.createRange(); - rng.setStart(bookmark.startContainer, bookmark.startOffset); - rng.setEnd(bookmark.endContainer, bookmark.endOffset); - } else { - rng = bookmark; - } - - return rng; - } - - // Found tridentSel object then we need to use that one - if (w3c && self.tridentSel) { - return self.tridentSel.getRangeAt(0); - } - - try { - if ((selection = self.getSel())) { - if (selection.rangeCount > 0) { - rng = selection.getRangeAt(0); - } else { - rng = selection.createRange ? selection.createRange() : doc.createRange(); - } - } - } catch (ex) { - // IE throws unspecified error here if TinyMCE is placed in a frame/iframe - } - - // We have W3C ranges and it's IE then fake control selection since IE9 doesn't handle that correctly yet - // IE 11 doesn't support the selection object so we check for that as well - if (isIE && rng && rng.setStart && doc.selection) { - try { - // IE will sometimes throw an exception here - ieRng = doc.selection.createRange(); - } catch (ex) { - - } - - if (ieRng && ieRng.item) { - elm = ieRng.item(0); - rng = doc.createRange(); - rng.setStartBefore(elm); - rng.setEndAfter(elm); - } - } - - // No range found then create an empty one - // This can occur when the editor is placed in a hidden container element on Gecko - // Or on IE when there was an exception - if (!rng) { - rng = doc.createRange ? doc.createRange() : doc.body.createTextRange(); - } - - // If range is at start of document then move it to start of body - if (rng.setStart && rng.startContainer.nodeType === 9 && rng.collapsed) { - elm = self.dom.getRoot(); - rng.setStart(elm, 0); - rng.setEnd(elm, 0); - } - - if (self.selectedRange && self.explicitRange) { - if (tryCompareBounderyPoints(rng.START_TO_START, rng, self.selectedRange) === 0 && - tryCompareBounderyPoints(rng.END_TO_END, rng, self.selectedRange) === 0) { - // Safari, Opera and Chrome only ever select text which causes the range to change. - // This lets us use the originally set range if the selection hasn't been changed by the user. - rng = self.explicitRange; - } else { - self.selectedRange = null; - self.explicitRange = null; - } - } - - return rng; - }, - - /** - * Changes the selection to the specified DOM range. - * - * @method setRng - * @param {Range} rng Range to select. - */ - setRng: function(rng, forward) { - var self = this, sel; - - // Is IE specific range - if (rng.select) { - try { - rng.select(); - } catch (ex) { - // Needed for some odd IE bug #1843306 - } - - return; - } - - if (!self.tridentSel) { - sel = self.getSel(); - - if (sel) { - self.explicitRange = rng; - - try { - sel.removeAllRanges(); - sel.addRange(rng); - } catch (ex) { - // IE might throw errors here if the editor is within a hidden container and selection is changed - } - - // Forward is set to false and we have an extend function - if (forward === false && sel.extend) { - sel.collapse(rng.endContainer, rng.endOffset); - sel.extend(rng.startContainer, rng.startOffset); - } - - // adding range isn't always successful so we need to check range count otherwise an exception can occur - self.selectedRange = sel.rangeCount > 0 ? sel.getRangeAt(0) : null; - } - } else { - // Is W3C Range fake range on IE - if (rng.cloneRange) { - try { - self.tridentSel.addRange(rng); - return; - } catch (ex) { - //IE9 throws an error here if called before selection is placed in the editor - } - } - } - }, - - /** - * Sets the current selection to the specified DOM element. - * - * @method setNode - * @param {Element} elm Element to set as the contents of the selection. - * @return {Element} Returns the element that got passed in. - * @example - * // Inserts a DOM node at current selection/caret location - * tinymce.activeEditor.selection.setNode(tinymce.activeEditor.dom.create('img', {src: 'some.gif', title: 'some title'})); - */ - setNode: function(elm) { - var self = this; - - self.setContent(self.dom.getOuterHTML(elm)); - - return elm; - }, - - /** - * Returns the currently selected element or the common ancestor element for both start and end of the selection. - * - * @method getNode - * @return {Element} Currently selected element or common ancestor element. - * @example - * // Alerts the currently selected elements node name - * alert(tinymce.activeEditor.selection.getNode().nodeName); - */ - getNode: function() { - var self = this, rng = self.getRng(), elm; - var startContainer = rng.startContainer, endContainer = rng.endContainer; - var startOffset = rng.startOffset, endOffset = rng.endOffset, root = self.dom.getRoot(); - - function skipEmptyTextNodes(node, forwards) { - var orig = node; - - while (node && node.nodeType === 3 && node.length === 0) { - node = forwards ? node.nextSibling : node.previousSibling; - } - - return node || orig; - } - - // Range maybe lost after the editor is made visible again - if (!rng) { - return root; - } - - if (rng.setStart) { - elm = rng.commonAncestorContainer; - - // Handle selection a image or other control like element such as anchors - if (!rng.collapsed) { - if (startContainer == endContainer) { - if (endOffset - startOffset < 2) { - if (startContainer.hasChildNodes()) { - elm = startContainer.childNodes[startOffset]; - } - } - } - - // If the anchor node is a element instead of a text node then return this element - //if (tinymce.isWebKit && sel.anchorNode && sel.anchorNode.nodeType == 1) - // return sel.anchorNode.childNodes[sel.anchorOffset]; - - // Handle cases where the selection is immediately wrapped around a node and return that node instead of it's parent. - // This happens when you double click an underlined word in FireFox. - if (startContainer.nodeType === 3 && endContainer.nodeType === 3) { - if (startContainer.length === startOffset) { - startContainer = skipEmptyTextNodes(startContainer.nextSibling, true); - } else { - startContainer = startContainer.parentNode; - } - - if (endOffset === 0) { - endContainer = skipEmptyTextNodes(endContainer.previousSibling, false); - } else { - endContainer = endContainer.parentNode; - } - - if (startContainer && startContainer === endContainer) { - return startContainer; - } - } - } - - if (elm && elm.nodeType == 3) { - return elm.parentNode; - } - - return elm; - } - - elm = rng.item ? rng.item(0) : rng.parentElement(); - - // IE 7 might return elements outside the iframe - if (elm.ownerDocument !== self.win.document) { - elm = root; - } - - return elm; - }, - - getSelectedBlocks: function(startElm, endElm) { - var self = this, dom = self.dom, node, root, selectedBlocks = []; - - root = dom.getRoot(); - startElm = dom.getParent(startElm || self.getStart(), dom.isBlock); - endElm = dom.getParent(endElm || self.getEnd(), dom.isBlock); - - if (startElm && startElm != root) { - selectedBlocks.push(startElm); - } - - if (startElm && endElm && startElm != endElm) { - node = startElm; - - var walker = new TreeWalker(startElm, root); - while ((node = walker.next()) && node != endElm) { - if (dom.isBlock(node)) { - selectedBlocks.push(node); - } - } - } - - if (endElm && startElm != endElm && endElm != root) { - selectedBlocks.push(endElm); - } - - return selectedBlocks; - }, - - isForward: function() { - var dom = this.dom, sel = this.getSel(), anchorRange, focusRange; - - // No support for selection direction then always return true - if (!sel || !sel.anchorNode || !sel.focusNode) { - return true; - } - - anchorRange = dom.createRng(); - anchorRange.setStart(sel.anchorNode, sel.anchorOffset); - anchorRange.collapse(true); - - focusRange = dom.createRng(); - focusRange.setStart(sel.focusNode, sel.focusOffset); - focusRange.collapse(true); - - return anchorRange.compareBoundaryPoints(anchorRange.START_TO_START, focusRange) <= 0; - }, - - normalize: function() { - var self = this, rng = self.getRng(); - - if (!isIE && new RangeUtils(self.dom).normalize(rng)) { - self.setRng(rng, self.isForward()); - } - - return rng; - }, - - /** - * Executes callback of the current selection matches the specified selector or not and passes the state and args to the callback. - * - * @method selectorChanged - * @param {String} selector CSS selector to check for. - * @param {function} callback Callback with state and args when the selector is matches or not. - */ - selectorChanged: function(selector, callback) { - var self = this, currentSelectors; - - if (!self.selectorChangedData) { - self.selectorChangedData = {}; - currentSelectors = {}; - - self.editor.on('NodeChange', function(e) { - var node = e.element, dom = self.dom, parents = dom.getParents(node, null, dom.getRoot()), matchedSelectors = {}; - - // Check for new matching selectors - each(self.selectorChangedData, function(callbacks, selector) { - each(parents, function(node) { - if (dom.is(node, selector)) { - if (!currentSelectors[selector]) { - // Execute callbacks - each(callbacks, function(callback) { - callback(true, {node: node, selector: selector, parents: parents}); - }); - - currentSelectors[selector] = callbacks; - } - - matchedSelectors[selector] = callbacks; - return false; - } - }); - }); - - // Check if current selectors still match - each(currentSelectors, function(callbacks, selector) { - if (!matchedSelectors[selector]) { - delete currentSelectors[selector]; - - each(callbacks, function(callback) { - callback(false, {node: node, selector: selector, parents: parents}); - }); - } - }); - }); - } - - // Add selector listeners - if (!self.selectorChangedData[selector]) { - self.selectorChangedData[selector] = []; - } - - self.selectorChangedData[selector].push(callback); - - return self; - }, - - getScrollContainer: function() { - var scrollContainer, node = this.dom.getRoot(); - - while (node && node.nodeName != 'BODY') { - if (node.scrollHeight > node.clientHeight) { - scrollContainer = node; - break; - } - - node = node.parentNode; - } - - return scrollContainer; - }, - - scrollIntoView: function(elm) { - var y, viewPort, self = this, dom = self.dom, root = dom.getRoot(), viewPortY, viewPortH; - - function getPos(elm) { - var x = 0, y = 0; - - var offsetParent = elm; - while (offsetParent && offsetParent.nodeType) { - x += offsetParent.offsetLeft || 0; - y += offsetParent.offsetTop || 0; - offsetParent = offsetParent.offsetParent; - } - - return {x: x, y: y}; - } - - if (root.nodeName != 'BODY') { - var scrollContainer = self.getScrollContainer(); - if (scrollContainer) { - y = getPos(elm).y - getPos(scrollContainer).y; - viewPortH = scrollContainer.clientHeight; - viewPortY = scrollContainer.scrollTop; - if (y < viewPortY || y + 25 > viewPortY + viewPortH) { - scrollContainer.scrollTop = y < viewPortY ? y : y - viewPortH + 25; - } - - return; - } - } - - viewPort = dom.getViewPort(self.editor.getWin()); - y = dom.getPos(elm).y; - viewPortY = viewPort.y; - viewPortH = viewPort.h; - if (y < viewPort.y || y + 25 > viewPortY + viewPortH) { - self.editor.getWin().scrollTo(0, y < viewPortY ? y : y - viewPortH + 25); - } - }, - - _moveEndPoint: function(rng, node, start) { - var root = node, walker = new TreeWalker(node, root); - var nonEmptyElementsMap = this.dom.schema.getNonEmptyElements(); - - do { - // Text node - if (node.nodeType == 3 && trim(node.nodeValue).length !== 0) { - if (start) { - rng.setStart(node, 0); - } else { - rng.setEnd(node, node.nodeValue.length); - } - - return; - } - - // BR/IMG/INPUT elements - if (nonEmptyElementsMap[node.nodeName]) { - if (start) { - rng.setStartBefore(node); - } else { - if (node.nodeName == 'BR') { - rng.setEndBefore(node); - } else { - rng.setEndAfter(node); - } - } - - return; - } - - // Found empty text block old IE can place the selection inside those - if (Env.ie && Env.ie < 11 && this.dom.isBlock(node) && this.dom.isEmpty(node)) { - if (start) { - rng.setStart(node, 0); - } else { - rng.setEnd(node, 0); - } - - return; - } - } while ((node = (start ? walker.next() : walker.prev()))); - - // Failed to find any text node or other suitable location then move to the root of body - if (root.nodeName == 'BODY') { - if (start) { - rng.setStart(root, 0); - } else { - rng.setEnd(root, root.childNodes.length); - } - } - }, - - destroy: function() { - this.win = null; - this.controlSelection.destroy(); - } - }; - - return Selection; -}); - -// Included from: js/tinymce/classes/Formatter.js - -/** - * Formatter.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Text formatter engine class. This class is used to apply formats like bold, italic, font size - * etc to the current selection or specific nodes. This engine was build to replace the browsers - * default formatting logic for execCommand due to it's inconsistent and buggy behavior. - * - * @class tinymce.Formatter - * @example - * tinymce.activeEditor.formatter.register('mycustomformat', { - * inline: 'span', - * styles: {color: '#ff0000'} - * }); - * - * tinymce.activeEditor.formatter.apply('mycustomformat'); - */ -define("tinymce/Formatter", [ - "tinymce/dom/TreeWalker", - "tinymce/dom/RangeUtils", - "tinymce/util/Tools" -], function(TreeWalker, RangeUtils, Tools) { - /** - * Constructs a new formatter instance. - * - * @constructor Formatter - * @param {tinymce.Editor} ed Editor instance to construct the formatter engine to. - */ - return function(ed) { - var formats = {}, - dom = ed.dom, - selection = ed.selection, - rangeUtils = new RangeUtils(dom), - isValid = ed.schema.isValidChild, - isBlock = dom.isBlock, - forcedRootBlock = ed.settings.forced_root_block, - nodeIndex = dom.nodeIndex, - INVISIBLE_CHAR = '\uFEFF', - MCE_ATTR_RE = /^(src|href|style)$/, - FALSE = false, - TRUE = true, - formatChangeData, - undef, - getContentEditable = dom.getContentEditable, - disableCaretContainer, - markCaretContainersBogus; - - var each = Tools.each, - grep = Tools.grep, - walk = Tools.walk, - extend = Tools.extend; - - function isTextBlock(name) { - if (name.nodeType) { - name = name.nodeName; - } - - return !!ed.schema.getTextBlockElements()[name.toLowerCase()]; - } - - function getParents(node, selector) { - return dom.getParents(node, selector, dom.getRoot()); - } - - function isCaretNode(node) { - return node.nodeType === 1 && node.id === '_mce_caret'; - } - - function defaultFormats() { - register({ - alignleft: [ - {selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li', styles: {textAlign: 'left'}, defaultBlock: 'div'}, - {selector: 'img,table', collapsed: false, styles: {'float': 'left'}} - ], - - aligncenter: [ - {selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li', styles: {textAlign: 'center'}, defaultBlock: 'div'}, - {selector: 'img', collapsed: false, styles: {display: 'block', marginLeft: 'auto', marginRight: 'auto'}}, - {selector: 'table', collapsed: false, styles: {marginLeft: 'auto', marginRight: 'auto'}} - ], - - alignright: [ - {selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li', styles: {textAlign: 'right'}, defaultBlock: 'div'}, - {selector: 'img,table', collapsed: false, styles: {'float': 'right'}} - ], - - alignjustify: [ - {selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li', styles: {textAlign: 'justify'}, defaultBlock: 'div'} - ], - - bold: [ - {inline: 'strong', remove: 'all'}, - {inline: 'span', styles: {fontWeight: 'bold'}}, - {inline: 'b', remove: 'all'} - ], - - italic: [ - {inline: 'em', remove: 'all'}, - {inline: 'span', styles: {fontStyle: 'italic'}}, - {inline: 'i', remove: 'all'} - ], - - underline: [ - {inline: 'span', styles: {textDecoration: 'underline'}, exact: true}, - {inline: 'u', remove: 'all'} - ], - - strikethrough: [ - {inline: 'span', styles: {textDecoration: 'line-through'}, exact: true}, - {inline: 'strike', remove: 'all'} - ], - - forecolor: {inline: 'span', styles: {color: '%value'}, wrap_links: false}, - hilitecolor: {inline: 'span', styles: {backgroundColor: '%value'}, wrap_links: false}, - fontname: {inline: 'span', styles: {fontFamily: '%value'}}, - fontsize: {inline: 'span', styles: {fontSize: '%value'}}, - fontsize_class: {inline: 'span', attributes: {'class': '%value'}}, - blockquote: {block: 'blockquote', wrapper: 1, remove: 'all'}, - subscript: {inline: 'sub'}, - superscript: {inline: 'sup'}, - code: {inline: 'code'}, - - link: {inline: 'a', selector: 'a', remove: 'all', split: true, deep: true, - onmatch: function() { - return true; - }, - - onformat: function(elm, fmt, vars) { - each(vars, function(value, key) { - dom.setAttrib(elm, key, value); - }); - } - }, - - removeformat: [ - { - selector: 'b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q', - remove: 'all', - split: true, - expand: false, - block_expand: true, - deep: true - }, - {selector: 'span', attributes: ['style', 'class'], remove: 'empty', split: true, expand: false, deep: true}, - {selector: '*', attributes: ['style', 'class'], split: false, expand: false, deep: true} - ] - }); - - // Register default block formats - each('p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp'.split(/\s/), function(name) { - register(name, {block: name, remove: 'all'}); - }); - - // Register user defined formats - register(ed.settings.formats); - } - - function addKeyboardShortcuts() { - // Add some inline shortcuts - ed.addShortcut('ctrl+b', 'bold_desc', 'Bold'); - ed.addShortcut('ctrl+i', 'italic_desc', 'Italic'); - ed.addShortcut('ctrl+u', 'underline_desc', 'Underline'); - - // BlockFormat shortcuts keys - for (var i = 1; i <= 6; i++) { - ed.addShortcut('ctrl+' + i, '', ['FormatBlock', false, 'h' + i]); - } - - ed.addShortcut('ctrl+7', '', ['FormatBlock', false, 'p']); - ed.addShortcut('ctrl+8', '', ['FormatBlock', false, 'div']); - ed.addShortcut('ctrl+9', '', ['FormatBlock', false, 'address']); - } - - // Public functions - - /** - * Returns the format by name or all formats if no name is specified. - * - * @method get - * @param {String} name Optional name to retrive by. - * @return {Array/Object} Array/Object with all registred formats or a specific format. - */ - function get(name) { - return name ? formats[name] : formats; - } - - /** - * Registers a specific format by name. - * - * @method register - * @param {Object/String} name Name of the format for example "bold". - * @param {Object/Array} format Optional format object or array of format variants - * can only be omitted if the first arg is an object. - */ - function register(name, format) { - if (name) { - if (typeof(name) !== 'string') { - each(name, function(format, name) { - register(name, format); - }); - } else { - // Force format into array and add it to internal collection - format = format.length ? format : [format]; - - each(format, function(format) { - // Set deep to false by default on selector formats this to avoid removing - // alignment on images inside paragraphs when alignment is changed on paragraphs - if (format.deep === undef) { - format.deep = !format.selector; - } - - // Default to true - if (format.split === undef) { - format.split = !format.selector || format.inline; - } - - // Default to true - if (format.remove === undef && format.selector && !format.inline) { - format.remove = 'none'; - } - - // Mark format as a mixed format inline + block level - if (format.selector && format.inline) { - format.mixed = true; - format.block_expand = true; - } - - // Split classes if needed - if (typeof(format.classes) === 'string') { - format.classes = format.classes.split(/\s+/); - } - }); - - formats[name] = format; - } - } - } - - function getTextDecoration(node) { - var decoration; - - ed.dom.getParent(node, function(n) { - decoration = ed.dom.getStyle(n, 'text-decoration'); - return decoration && decoration !== 'none'; - }); - - return decoration; - } - - function processUnderlineAndColor(node) { - var textDecoration; - if (node.nodeType === 1 && node.parentNode && node.parentNode.nodeType === 1) { - textDecoration = getTextDecoration(node.parentNode); - if (ed.dom.getStyle(node, 'color') && textDecoration) { - ed.dom.setStyle(node, 'text-decoration', textDecoration); - } else if (ed.dom.getStyle(node, 'textdecoration') === textDecoration) { - ed.dom.setStyle(node, 'text-decoration', null); - } - } - } - - /** - * Applies the specified format to the current selection or specified node. - * - * @method apply - * @param {String} name Name of format to apply. - * @param {Object} vars Optional list of variables to replace within format before applying it. - * @param {Node} node Optional node to apply the format to defaults to current selection. - */ - function apply(name, vars, node) { - var formatList = get(name), format = formatList[0], bookmark, rng, isCollapsed = !node && selection.isCollapsed(); - - function setElementFormat(elm, fmt) { - fmt = fmt || format; - - if (elm) { - if (fmt.onformat) { - fmt.onformat(elm, fmt, vars, node); - } - - each(fmt.styles, function(value, name) { - dom.setStyle(elm, name, replaceVars(value, vars)); - }); - - each(fmt.attributes, function(value, name) { - dom.setAttrib(elm, name, replaceVars(value, vars)); - }); - - each(fmt.classes, function(value) { - value = replaceVars(value, vars); - - if (!dom.hasClass(elm, value)) { - dom.addClass(elm, value); - } - }); - } - } - - function adjustSelectionToVisibleSelection() { - function findSelectionEnd(start, end) { - var walker = new TreeWalker(end); - for (node = walker.current(); node; node = walker.prev()) { - if (node.childNodes.length > 1 || node == start || node.tagName == 'BR') { - return node; - } - } - } - - // Adjust selection so that a end container with a end offset of zero is not included in the selection - // as this isn't visible to the user. - var rng = ed.selection.getRng(); - var start = rng.startContainer; - var end = rng.endContainer; - - if (start != end && rng.endOffset === 0) { - var newEnd = findSelectionEnd(start, end); - var endOffset = newEnd.nodeType == 3 ? newEnd.length : newEnd.childNodes.length; - - rng.setEnd(newEnd, endOffset); - } - - return rng; - } - - function applyStyleToList(node, bookmark, wrapElm, newWrappers, process){ - var nodes = [], listIndex = -1, list, startIndex = -1, endIndex = -1, currentWrapElm; - - // find the index of the first child list. - each(node.childNodes, function(n, index) { - if (n.nodeName === "UL" || n.nodeName === "OL") { - listIndex = index; - list = n; - return false; - } - }); - - // get the index of the bookmarks - each(node.childNodes, function(n, index) { - if (n.nodeName === "SPAN" && dom.getAttrib(n, "data-mce-type") == "bookmark") { - if (n.id == bookmark.id + "_start") { - startIndex = index; - } else if (n.id == bookmark.id + "_end") { - endIndex = index; - } - } - }); - - // if the selection spans across an embedded list, or there isn't an embedded list - handle processing normally - if (listIndex <= 0 || (startIndex < listIndex && endIndex > listIndex)) { - each(grep(node.childNodes), process); - return 0; - } else { - currentWrapElm = dom.clone(wrapElm, FALSE); - - // create a list of the nodes on the same side of the list as the selection - each(grep(node.childNodes), function(n, index) { - if ((startIndex < listIndex && index < listIndex) || (startIndex > listIndex && index > listIndex)) { - nodes.push(n); - n.parentNode.removeChild(n); - } - }); - - // insert the wrapping element either before or after the list. - if (startIndex < listIndex) { - node.insertBefore(currentWrapElm, list); - } else if (startIndex > listIndex) { - node.insertBefore(currentWrapElm, list.nextSibling); - } - - // add the new nodes to the list. - newWrappers.push(currentWrapElm); - - each(nodes, function(node) { - currentWrapElm.appendChild(node); - }); - - return currentWrapElm; - } - } - - function applyRngStyle(rng, bookmark, node_specific) { - var newWrappers = [], wrapName, wrapElm, contentEditable = true; - - // Setup wrapper element - wrapName = format.inline || format.block; - wrapElm = dom.create(wrapName); - setElementFormat(wrapElm); - - rangeUtils.walk(rng, function(nodes) { - var currentWrapElm; - - /** - * Process a list of nodes wrap them. - */ - function process(node) { - var nodeName, parentName, found, hasContentEditableState, lastContentEditable; - - lastContentEditable = contentEditable; - nodeName = node.nodeName.toLowerCase(); - parentName = node.parentNode.nodeName.toLowerCase(); - - // Node has a contentEditable value - if (node.nodeType === 1 && getContentEditable(node)) { - lastContentEditable = contentEditable; - contentEditable = getContentEditable(node) === "true"; - hasContentEditableState = true; // We don't want to wrap the container only it's children - } - - // Stop wrapping on br elements - if (isEq(nodeName, 'br')) { - currentWrapElm = 0; - - // Remove any br elements when we wrap things - if (format.block) { - dom.remove(node); - } - - return; - } - - // If node is wrapper type - if (format.wrapper && matchNode(node, name, vars)) { - currentWrapElm = 0; - return; - } - - // Can we rename the block - // TODO: Break this if up, too complex - if (contentEditable && !hasContentEditableState && format.block && - !format.wrapper && isTextBlock(nodeName) && isValid(parentName, wrapName)) { - node = dom.rename(node, wrapName); - setElementFormat(node); - newWrappers.push(node); - currentWrapElm = 0; - return; - } - - // Handle selector patterns - if (format.selector) { - // Look for matching formats - each(formatList, function(format) { - // Check collapsed state if it exists - if ('collapsed' in format && format.collapsed !== isCollapsed) { - return; - } - - if (dom.is(node, format.selector) && !isCaretNode(node)) { - setElementFormat(node, format); - found = true; - } - }); - - // Continue processing if a selector match wasn't found and a inline element is defined - if (!format.inline || found) { - currentWrapElm = 0; - return; - } - } - - // Is it valid to wrap this item - // TODO: Break this if up, too complex - if (contentEditable && !hasContentEditableState && isValid(wrapName, nodeName) && isValid(parentName, wrapName) && - !(!node_specific && node.nodeType === 3 && - node.nodeValue.length === 1 && - node.nodeValue.charCodeAt(0) === 65279) && - !isCaretNode(node) && - (!format.inline || !isBlock(node))) { - // Start wrapping - if (!currentWrapElm) { - // Wrap the node - currentWrapElm = dom.clone(wrapElm, FALSE); - node.parentNode.insertBefore(currentWrapElm, node); - newWrappers.push(currentWrapElm); - } - - currentWrapElm.appendChild(node); - } else if (nodeName == 'li' && bookmark) { - // Start wrapping - if we are in a list node and have a bookmark, then - // we will always begin by wrapping in a new element. - currentWrapElm = applyStyleToList(node, bookmark, wrapElm, newWrappers, process); - } else { - // Start a new wrapper for possible children - currentWrapElm = 0; - - each(grep(node.childNodes), process); - - if (hasContentEditableState) { - contentEditable = lastContentEditable; // Restore last contentEditable state from stack - } - - // End the last wrapper - currentWrapElm = 0; - } - } - - // Process siblings from range - each(nodes, process); - }); - - // Wrap links inside as well, for example color inside a link when the wrapper is around the link - if (format.wrap_links === false) { - each(newWrappers, function(node) { - function process(node) { - var i, currentWrapElm, children; - - if (node.nodeName === 'A') { - currentWrapElm = dom.clone(wrapElm, FALSE); - newWrappers.push(currentWrapElm); - - children = grep(node.childNodes); - for (i = 0; i < children.length; i++) { - currentWrapElm.appendChild(children[i]); - } - - node.appendChild(currentWrapElm); - } - - each(grep(node.childNodes), process); - } - - process(node); - }); - } - - // Cleanup - each(newWrappers, function(node) { - var childCount; - - function getChildCount(node) { - var count = 0; - - each(node.childNodes, function(node) { - if (!isWhiteSpaceNode(node) && !isBookmarkNode(node)) { - count++; - } - }); - - return count; - } - - function mergeStyles(node) { - var child, clone; - - each(node.childNodes, function(node) { - if (node.nodeType == 1 && !isBookmarkNode(node) && !isCaretNode(node)) { - child = node; - return FALSE; // break loop - } - }); - - // If child was found and of the same type as the current node - if (child && !isBookmarkNode(child) && matchName(child, format)) { - clone = dom.clone(child, FALSE); - setElementFormat(clone); - - dom.replace(clone, node, TRUE); - dom.remove(child, 1); - } - - return clone || node; - } - - childCount = getChildCount(node); - - // Remove empty nodes but only if there is multiple wrappers and they are not block - // elements so never remove single

    since that would remove the - // currrent empty block element where the caret is at - if ((newWrappers.length > 1 || !isBlock(node)) && childCount === 0) { - dom.remove(node, 1); - return; - } - - if (format.inline || format.wrapper) { - // Merges the current node with it's children of similar type to reduce the number of elements - if (!format.exact && childCount === 1) { - node = mergeStyles(node); - } - - // Remove/merge children - each(formatList, function(format) { - // Merge all children of similar type will move styles from child to parent - // this: text - // will become: text - each(dom.select(format.inline, node), function(child) { - var parent; - - if (isBookmarkNode(child)) { - return; - } - - // When wrap_links is set to false we don't want - // to remove the format on children within links - if (format.wrap_links === false) { - parent = child.parentNode; - - do { - if (parent.nodeName === 'A') { - return; - } - } while ((parent = parent.parentNode)); - } - - removeFormat(format, vars, child, format.exact ? child : null); - }); - }); - - // Remove child if direct parent is of same type - if (matchNode(node.parentNode, name, vars)) { - dom.remove(node, 1); - node = 0; - return TRUE; - } - - // Look for parent with similar style format - if (format.merge_with_parents) { - dom.getParent(node.parentNode, function(parent) { - if (matchNode(parent, name, vars)) { - dom.remove(node, 1); - node = 0; - return TRUE; - } - }); - } - - // Merge next and previous siblings if they are similar texttext becomes texttext - if (node && format.merge_siblings !== false) { - node = mergeSiblings(getNonWhiteSpaceSibling(node), node); - node = mergeSiblings(node, getNonWhiteSpaceSibling(node, TRUE)); - } - } - }); - } - - if (format) { - if (node) { - if (node.nodeType) { - rng = dom.createRng(); - rng.setStartBefore(node); - rng.setEndAfter(node); - applyRngStyle(expandRng(rng, formatList), null, true); - } else { - applyRngStyle(node, null, true); - } - } else { - if (!isCollapsed || !format.inline || dom.select('td.mce-item-selected,th.mce-item-selected').length) { - // Obtain selection node before selection is unselected by applyRngStyle() - var curSelNode = ed.selection.getNode(); - - // If the formats have a default block and we can't find a parent block then - // start wrapping it with a DIV this is for forced_root_blocks: false - // It's kind of a hack but people should be using the default block type P since all desktop editors work that way - if (!forcedRootBlock && formatList[0].defaultBlock && !dom.getParent(curSelNode, dom.isBlock)) { - apply(formatList[0].defaultBlock); - } - - // Apply formatting to selection - ed.selection.setRng(adjustSelectionToVisibleSelection()); - bookmark = selection.getBookmark(); - applyRngStyle(expandRng(selection.getRng(TRUE), formatList), bookmark); - - // Colored nodes should be underlined so that the color of the underline matches the text color. - if (format.styles && (format.styles.color || format.styles.textDecoration)) { - walk(curSelNode, processUnderlineAndColor, 'childNodes'); - processUnderlineAndColor(curSelNode); - } - - selection.moveToBookmark(bookmark); - moveStart(selection.getRng(TRUE)); - ed.nodeChanged(); - } else { - performCaretAction('apply', name, vars); - } - } - } - } - - /** - * Removes the specified format from the current selection or specified node. - * - * @method remove - * @param {String} name Name of format to remove. - * @param {Object} vars Optional list of variables to replace within format before removing it. - * @param {Node/Range} node Optional node or DOM range to remove the format from defaults to current selection. - */ - function remove(name, vars, node) { - var formatList = get(name), format = formatList[0], bookmark, rng, contentEditable = true; - - // Merges the styles for each node - function process(node) { - var children, i, l, lastContentEditable, hasContentEditableState; - - // Node has a contentEditable value - if (node.nodeType === 1 && getContentEditable(node)) { - lastContentEditable = contentEditable; - contentEditable = getContentEditable(node) === "true"; - hasContentEditableState = true; // We don't want to wrap the container only it's children - } - - // Grab the children first since the nodelist might be changed - children = grep(node.childNodes); - - // Process current node - if (contentEditable && !hasContentEditableState) { - for (i = 0, l = formatList.length; i < l; i++) { - if (removeFormat(formatList[i], vars, node, node)) { - break; - } - } - } - - // Process the children - if (format.deep) { - if (children.length) { - for (i = 0, l = children.length; i < l; i++) { - process(children[i]); - } - - if (hasContentEditableState) { - contentEditable = lastContentEditable; // Restore last contentEditable state from stack - } - } - } - } - - function findFormatRoot(container) { - var formatRoot; - - // Find format root - each(getParents(container.parentNode).reverse(), function(parent) { - var format; - - // Find format root element - if (!formatRoot && parent.id != '_start' && parent.id != '_end') { - // Is the node matching the format we are looking for - format = matchNode(parent, name, vars); - if (format && format.split !== false) { - formatRoot = parent; - } - } - }); - - return formatRoot; - } - - function wrapAndSplit(format_root, container, target, split) { - var parent, clone, lastClone, firstClone, i, formatRootParent; - - // Format root found then clone formats and split it - if (format_root) { - formatRootParent = format_root.parentNode; - - for (parent = container.parentNode; parent && parent != formatRootParent; parent = parent.parentNode) { - clone = dom.clone(parent, FALSE); - - for (i = 0; i < formatList.length; i++) { - if (removeFormat(formatList[i], vars, clone, clone)) { - clone = 0; - break; - } - } - - // Build wrapper node - if (clone) { - if (lastClone) { - clone.appendChild(lastClone); - } - - if (!firstClone) { - firstClone = clone; - } - - lastClone = clone; - } - } - - // Never split block elements if the format is mixed - if (split && (!format.mixed || !isBlock(format_root))) { - container = dom.split(format_root, container); - } - - // Wrap container in cloned formats - if (lastClone) { - target.parentNode.insertBefore(lastClone, target); - firstClone.appendChild(target); - } - } - - return container; - } - - function splitToFormatRoot(container) { - return wrapAndSplit(findFormatRoot(container), container, container, true); - } - - function unwrap(start) { - var node = dom.get(start ? '_start' : '_end'), - out = node[start ? 'firstChild' : 'lastChild']; - - // If the end is placed within the start the result will be removed - // So this checks if the out node is a bookmark node if it is it - // checks for another more suitable node - if (isBookmarkNode(out)) { - out = out[start ? 'firstChild' : 'lastChild']; - } - - dom.remove(node, true); - - return out; - } - - function removeRngStyle(rng) { - var startContainer, endContainer; - var commonAncestorContainer = rng.commonAncestorContainer; - - rng = expandRng(rng, formatList, TRUE); - - if (format.split) { - startContainer = getContainer(rng, TRUE); - endContainer = getContainer(rng); - - if (startContainer != endContainer) { - // WebKit will render the table incorrectly if we wrap a TH or TD in a SPAN - // so let's see if we can use the first child instead - // This will happen if you triple click a table cell and use remove formatting - if (/^(TR|TH|TD)$/.test(startContainer.nodeName) && startContainer.firstChild) { - if (startContainer.nodeName == "TR") { - startContainer = startContainer.firstChild.firstChild || startContainer; - } else { - startContainer = startContainer.firstChild || startContainer; - } - } - - // Try to adjust endContainer as well if cells on the same row were selected - bug #6410 - if (commonAncestorContainer && - /^T(HEAD|BODY|FOOT|R)$/.test(commonAncestorContainer.nodeName) && - /^(TH|TD)$/.test(endContainer.nodeName) && endContainer.firstChild) { - endContainer = endContainer.firstChild || endContainer; - } - - // Wrap start/end nodes in span element since these might be cloned/moved - startContainer = wrap(startContainer, 'span', {id: '_start', 'data-mce-type': 'bookmark'}); - endContainer = wrap(endContainer, 'span', {id: '_end', 'data-mce-type': 'bookmark'}); - - // Split start/end - splitToFormatRoot(startContainer); - splitToFormatRoot(endContainer); - - // Unwrap start/end to get real elements again - startContainer = unwrap(TRUE); - endContainer = unwrap(); - } else { - startContainer = endContainer = splitToFormatRoot(startContainer); - } - - // Update range positions since they might have changed after the split operations - rng.startContainer = startContainer.parentNode; - rng.startOffset = nodeIndex(startContainer); - rng.endContainer = endContainer.parentNode; - rng.endOffset = nodeIndex(endContainer) + 1; - } - - // Remove items between start/end - rangeUtils.walk(rng, function(nodes) { - each(nodes, function(node) { - process(node); - - // Remove parent span if it only contains text-decoration: underline, yet a parent node is also underlined. - if (node.nodeType === 1 && ed.dom.getStyle(node, 'text-decoration') === 'underline' && - node.parentNode && getTextDecoration(node.parentNode) === 'underline') { - removeFormat({ - 'deep': false, - 'exact': true, - 'inline': 'span', - 'styles': { - 'textDecoration': 'underline' - } - }, null, node); - } - }); - }); - } - - // Handle node - if (node) { - if (node.nodeType) { - rng = dom.createRng(); - rng.setStartBefore(node); - rng.setEndAfter(node); - removeRngStyle(rng); - } else { - removeRngStyle(node); - } - - return; - } - - if (!selection.isCollapsed() || !format.inline || dom.select('td.mce-item-selected,th.mce-item-selected').length) { - bookmark = selection.getBookmark(); - removeRngStyle(selection.getRng(TRUE)); - selection.moveToBookmark(bookmark); - - // Check if start element still has formatting then we are at: "text|text" - // and need to move the start into the next text node - if (format.inline && match(name, vars, selection.getStart())) { - moveStart(selection.getRng(true)); - } - - ed.nodeChanged(); - } else { - performCaretAction('remove', name, vars); - } - } - - /** - * Toggles the specified format on/off. - * - * @method toggle - * @param {String} name Name of format to apply/remove. - * @param {Object} vars Optional list of variables to replace within format before applying/removing it. - * @param {Node} node Optional node to apply the format to or remove from. Defaults to current selection. - */ - function toggle(name, vars, node) { - var fmt = get(name); - - if (match(name, vars, node) && (!('toggle' in fmt[0]) || fmt[0].toggle)) { - remove(name, vars, node); - } else { - apply(name, vars, node); - } - } - - /** - * Return true/false if the specified node has the specified format. - * - * @method matchNode - * @param {Node} node Node to check the format on. - * @param {String} name Format name to check. - * @param {Object} vars Optional list of variables to replace before checking it. - * @param {Boolean} similar Match format that has similar properties. - * @return {Object} Returns the format object it matches or undefined if it doesn't match. - */ - function matchNode(node, name, vars, similar) { - var formatList = get(name), format, i, classes; - - function matchItems(node, format, item_name) { - var key, value, items = format[item_name], i; - - // Custom match - if (format.onmatch) { - return format.onmatch(node, format, item_name); - } - - // Check all items - if (items) { - // Non indexed object - if (items.length === undef) { - for (key in items) { - if (items.hasOwnProperty(key)) { - if (item_name === 'attributes') { - value = dom.getAttrib(node, key); - } else { - value = getStyle(node, key); - } - - if (similar && !value && !format.exact) { - return; - } - - if ((!similar || format.exact) && !isEq(value, normalizeStyleValue(replaceVars(items[key], vars), key))) { - return; - } - } - } - } else { - // Only one match needed for indexed arrays - for (i = 0; i < items.length; i++) { - if (item_name === 'attributes' ? dom.getAttrib(node, items[i]) : getStyle(node, items[i])) { - return format; - } - } - } - } - - return format; - } - - if (formatList && node) { - // Check each format in list - for (i = 0; i < formatList.length; i++) { - format = formatList[i]; - - // Name name, attributes, styles and classes - if (matchName(node, format) && matchItems(node, format, 'attributes') && matchItems(node, format, 'styles')) { - // Match classes - if ((classes = format.classes)) { - for (i = 0; i < classes.length; i++) { - if (!dom.hasClass(node, classes[i])) { - return; - } - } - } - - return format; - } - } - } - } - - /** - * Matches the current selection or specified node against the specified format name. - * - * @method match - * @param {String} name Name of format to match. - * @param {Object} vars Optional list of variables to replace before checking it. - * @param {Node} node Optional node to check. - * @return {boolean} true/false if the specified selection/node matches the format. - */ - function match(name, vars, node) { - var startNode; - - function matchParents(node) { - var root = dom.getRoot(); - - if (node === root) { - return false; - } - - // Find first node with similar format settings - node = dom.getParent(node, function(node) { - return node.parentNode === root || !!matchNode(node, name, vars, true); - }); - - // Do an exact check on the similar format element - return matchNode(node, name, vars); - } - - // Check specified node - if (node) { - return matchParents(node); - } - - // Check selected node - node = selection.getNode(); - if (matchParents(node)) { - return TRUE; - } - - // Check start node if it's different - startNode = selection.getStart(); - if (startNode != node) { - if (matchParents(startNode)) { - return TRUE; - } - } - - return FALSE; - } - - /** - * Matches the current selection against the array of formats and returns a new array with matching formats. - * - * @method matchAll - * @param {Array} names Name of format to match. - * @param {Object} vars Optional list of variables to replace before checking it. - * @return {Array} Array with matched formats. - */ - function matchAll(names, vars) { - var startElement, matchedFormatNames = [], checkedMap = {}; - - // Check start of selection for formats - startElement = selection.getStart(); - dom.getParent(startElement, function(node) { - var i, name; - - for (i = 0; i < names.length; i++) { - name = names[i]; - - if (!checkedMap[name] && matchNode(node, name, vars)) { - checkedMap[name] = true; - matchedFormatNames.push(name); - } - } - }, dom.getRoot()); - - return matchedFormatNames; - } - - /** - * Returns true/false if the specified format can be applied to the current selection or not. It - * will currently only check the state for selector formats, it returns true on all other format types. - * - * @method canApply - * @param {String} name Name of format to check. - * @return {boolean} true/false if the specified format can be applied to the current selection/node. - */ - function canApply(name) { - var formatList = get(name), startNode, parents, i, x, selector; - - if (formatList) { - startNode = selection.getStart(); - parents = getParents(startNode); - - for (x = formatList.length - 1; x >= 0; x--) { - selector = formatList[x].selector; - - // Format is not selector based then always return TRUE - // Is it has a defaultBlock then it's likely it can be applied for example align on a non block element line - if (!selector || formatList[x].defaultBlock) { - return TRUE; - } - - for (i = parents.length - 1; i >= 0; i--) { - if (dom.is(parents[i], selector)) { - return TRUE; - } - } - } - } - - return FALSE; - } - - /** - * Executes the specified callback when the current selection matches the formats or not. - * - * @method formatChanged - * @param {String} formats Comma separated list of formats to check for. - * @param {function} callback Callback with state and args when the format is changed/toggled on/off. - * @param {Boolean} similar True/false state if the match should handle similar or exact formats. - */ - function formatChanged(formats, callback, similar) { - var currentFormats; - - // Setup format node change logic - if (!formatChangeData) { - formatChangeData = {}; - currentFormats = {}; - - ed.on('NodeChange', function(e) { - var parents = getParents(e.element), matchedFormats = {}; - - // Check for new formats - each(formatChangeData, function(callbacks, format) { - each(parents, function(node) { - if (matchNode(node, format, {}, callbacks.similar)) { - if (!currentFormats[format]) { - // Execute callbacks - each(callbacks, function(callback) { - callback(true, {node: node, format: format, parents: parents}); - }); - - currentFormats[format] = callbacks; - } - - matchedFormats[format] = callbacks; - return false; - } - }); - }); - - // Check if current formats still match - each(currentFormats, function(callbacks, format) { - if (!matchedFormats[format]) { - delete currentFormats[format]; - - each(callbacks, function(callback) { - callback(false, {node: e.element, format: format, parents: parents}); - }); - } - }); - }); - } - - // Add format listeners - each(formats.split(','), function(format) { - if (!formatChangeData[format]) { - formatChangeData[format] = []; - formatChangeData[format].similar = similar; - } - - formatChangeData[format].push(callback); - }); - - return this; - } - - // Expose to public - extend(this, { - get: get, - register: register, - apply: apply, - remove: remove, - toggle: toggle, - match: match, - matchAll: matchAll, - matchNode: matchNode, - canApply: canApply, - formatChanged: formatChanged - }); - - // Initialize - defaultFormats(); - addKeyboardShortcuts(); - ed.on('BeforeGetContent', function() { - if (markCaretContainersBogus) { - markCaretContainersBogus(); - } - }); - ed.on('mouseup keydown', function(e) { - if (disableCaretContainer) { - disableCaretContainer(e); - } - }); - - // Private functions - - /** - * Checks if the specified nodes name matches the format inline/block or selector. - * - * @private - * @param {Node} node Node to match against the specified format. - * @param {Object} format Format object o match with. - * @return {boolean} true/false if the format matches. - */ - function matchName(node, format) { - // Check for inline match - if (isEq(node, format.inline)) { - return TRUE; - } - - // Check for block match - if (isEq(node, format.block)) { - return TRUE; - } - - // Check for selector match - if (format.selector) { - return node.nodeType == 1 && dom.is(node, format.selector); - } - } - - /** - * Compares two string/nodes regardless of their case. - * - * @private - * @param {String/Node} Node or string to compare. - * @param {String/Node} Node or string to compare. - * @return {boolean} True/false if they match. - */ - function isEq(str1, str2) { - str1 = str1 || ''; - str2 = str2 || ''; - - str1 = '' + (str1.nodeName || str1); - str2 = '' + (str2.nodeName || str2); - - return str1.toLowerCase() == str2.toLowerCase(); - } - - /** - * Returns the style by name on the specified node. This method modifies the style - * contents to make it more easy to match. This will resolve a few browser issues. - * - * @private - * @param {Node} node to get style from. - * @param {String} name Style name to get. - * @return {String} Style item value. - */ - function getStyle(node, name) { - return normalizeStyleValue(dom.getStyle(node, name), name); - } - - /** - * Normalize style value by name. This method modifies the style contents - * to make it more easy to match. This will resolve a few browser issues. - * - * @private - * @param {Node} node to get style from. - * @param {String} name Style name to get. - * @return {String} Style item value. - */ - function normalizeStyleValue(value, name) { - // Force the format to hex - if (name == 'color' || name == 'backgroundColor') { - value = dom.toHex(value); - } - - // Opera will return bold as 700 - if (name == 'fontWeight' && value == 700) { - value = 'bold'; - } - - // Normalize fontFamily so "'Font name', Font" becomes: "Font name,Font" - if (name == 'fontFamily') { - value = value.replace(/[\'\"]/g, '').replace(/,\s+/g, ','); - } - - return '' + value; - } - - /** - * Replaces variables in the value. The variable format is %var. - * - * @private - * @param {String} value Value to replace variables in. - * @param {Object} vars Name/value array with variables to replace. - * @return {String} New value with replaced variables. - */ - function replaceVars(value, vars) { - if (typeof(value) != "string") { - value = value(vars); - } else if (vars) { - value = value.replace(/%(\w+)/g, function(str, name) { - return vars[name] || str; - }); - } - - return value; - } - - function isWhiteSpaceNode(node) { - return node && node.nodeType === 3 && /^([\t \r\n]+|)$/.test(node.nodeValue); - } - - function wrap(node, name, attrs) { - var wrapper = dom.create(name, attrs); - - node.parentNode.insertBefore(wrapper, node); - wrapper.appendChild(node); - - return wrapper; - } - - /** - * Expands the specified range like object to depending on format. - * - * For example on block formats it will move the start/end position - * to the beginning of the current block. - * - * @private - * @param {Object} rng Range like object. - * @param {Array} formats Array with formats to expand by. - * @return {Object} Expanded range like object. - */ - function expandRng(rng, format, remove) { - var lastIdx, leaf, endPoint, - startContainer = rng.startContainer, - startOffset = rng.startOffset, - endContainer = rng.endContainer, - endOffset = rng.endOffset; - - // This function walks up the tree if there is no siblings before/after the node - function findParentContainer(start) { - var container, parent, sibling, siblingName, root; - - container = parent = start ? startContainer : endContainer; - siblingName = start ? 'previousSibling' : 'nextSibling'; - root = dom.getRoot(); - - function isBogusBr(node) { - return node.nodeName == "BR" && node.getAttribute('data-mce-bogus') && !node.nextSibling; - } - - // If it's a text node and the offset is inside the text - if (container.nodeType == 3 && !isWhiteSpaceNode(container)) { - if (start ? startOffset > 0 : endOffset < container.nodeValue.length) { - return container; - } - } - - /*eslint no-constant-condition:0 */ - while (true) { - // Stop expanding on block elements - if (!format[0].block_expand && isBlock(parent)) { - return parent; - } - - // Walk left/right - for (sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) { - if (!isBookmarkNode(sibling) && !isWhiteSpaceNode(sibling) && !isBogusBr(sibling)) { - return parent; - } - } - - // Check if we can move up are we at root level or body level - if (parent.parentNode == root) { - container = parent; - break; - } - - parent = parent.parentNode; - } - - return container; - } - - // This function walks down the tree to find the leaf at the selection. - // The offset is also returned as if node initially a leaf, the offset may be in the middle of the text node. - function findLeaf(node, offset) { - if (offset === undef) { - offset = node.nodeType === 3 ? node.length : node.childNodes.length; - } - - while (node && node.hasChildNodes()) { - node = node.childNodes[offset]; - if (node) { - offset = node.nodeType === 3 ? node.length : node.childNodes.length; - } - } - return { node: node, offset: offset }; - } - - // If index based start position then resolve it - if (startContainer.nodeType == 1 && startContainer.hasChildNodes()) { - lastIdx = startContainer.childNodes.length - 1; - startContainer = startContainer.childNodes[startOffset > lastIdx ? lastIdx : startOffset]; - - if (startContainer.nodeType == 3) { - startOffset = 0; - } - } - - // If index based end position then resolve it - if (endContainer.nodeType == 1 && endContainer.hasChildNodes()) { - lastIdx = endContainer.childNodes.length - 1; - endContainer = endContainer.childNodes[endOffset > lastIdx ? lastIdx : endOffset - 1]; - - if (endContainer.nodeType == 3) { - endOffset = endContainer.nodeValue.length; - } - } - - // Expands the node to the closes contentEditable false element if it exists - function findParentContentEditable(node) { - var parent = node; - - while (parent) { - if (parent.nodeType === 1 && getContentEditable(parent)) { - return getContentEditable(parent) === "false" ? parent : node; - } - - parent = parent.parentNode; - } - - return node; - } - - function findWordEndPoint(container, offset, start) { - var walker, node, pos, lastTextNode; - - function findSpace(node, offset) { - var pos, pos2, str = node.nodeValue; - - if (typeof(offset) == "undefined") { - offset = start ? str.length : 0; - } - - if (start) { - pos = str.lastIndexOf(' ', offset); - pos2 = str.lastIndexOf('\u00a0', offset); - pos = pos > pos2 ? pos : pos2; - - // Include the space on remove to avoid tag soup - if (pos !== -1 && !remove) { - pos++; - } - } else { - pos = str.indexOf(' ', offset); - pos2 = str.indexOf('\u00a0', offset); - pos = pos !== -1 && (pos2 === -1 || pos < pos2) ? pos : pos2; - } - - return pos; - } - - if (container.nodeType === 3) { - pos = findSpace(container, offset); - - if (pos !== -1) { - return {container: container, offset: pos}; - } - - lastTextNode = container; - } - - // Walk the nodes inside the block - walker = new TreeWalker(container, dom.getParent(container, isBlock) || ed.getBody()); - while ((node = walker[start ? 'prev' : 'next']())) { - if (node.nodeType === 3) { - lastTextNode = node; - pos = findSpace(node); - - if (pos !== -1) { - return {container: node, offset: pos}; - } - } else if (isBlock(node)) { - break; - } - } - - if (lastTextNode) { - if (start) { - offset = 0; - } else { - offset = lastTextNode.length; - } - - return {container: lastTextNode, offset: offset}; - } - } - - function findSelectorEndPoint(container, sibling_name) { - var parents, i, y, curFormat; - - if (container.nodeType == 3 && container.nodeValue.length === 0 && container[sibling_name]) { - container = container[sibling_name]; - } - - parents = getParents(container); - for (i = 0; i < parents.length; i++) { - for (y = 0; y < format.length; y++) { - curFormat = format[y]; - - // If collapsed state is set then skip formats that doesn't match that - if ("collapsed" in curFormat && curFormat.collapsed !== rng.collapsed) { - continue; - } - - if (dom.is(parents[i], curFormat.selector)) { - return parents[i]; - } - } - } - - return container; - } - - function findBlockEndPoint(container, sibling_name) { - var node, root = dom.getRoot(); - - // Expand to block of similar type - if (!format[0].wrapper) { - node = dom.getParent(container, format[0].block, root); - } - - // Expand to first wrappable block element or any block element - if (!node) { - node = dom.getParent(container.nodeType == 3 ? container.parentNode : container, function(node) { - // Fixes #6183 where it would expand to editable parent element in inline mode - return node != root && isTextBlock(node); - }); - } - - // Exclude inner lists from wrapping - if (node && format[0].wrapper) { - node = getParents(node, 'ul,ol').reverse()[0] || node; - } - - // Didn't find a block element look for first/last wrappable element - if (!node) { - node = container; - - while (node[sibling_name] && !isBlock(node[sibling_name])) { - node = node[sibling_name]; - - // Break on BR but include it will be removed later on - // we can't remove it now since we need to check if it can be wrapped - if (isEq(node, 'br')) { - break; - } - } - } - - return node || container; - } - - // Expand to closest contentEditable element - startContainer = findParentContentEditable(startContainer); - endContainer = findParentContentEditable(endContainer); - - // Exclude bookmark nodes if possible - if (isBookmarkNode(startContainer.parentNode) || isBookmarkNode(startContainer)) { - startContainer = isBookmarkNode(startContainer) ? startContainer : startContainer.parentNode; - startContainer = startContainer.nextSibling || startContainer; - - if (startContainer.nodeType == 3) { - startOffset = 0; - } - } - - if (isBookmarkNode(endContainer.parentNode) || isBookmarkNode(endContainer)) { - endContainer = isBookmarkNode(endContainer) ? endContainer : endContainer.parentNode; - endContainer = endContainer.previousSibling || endContainer; - - if (endContainer.nodeType == 3) { - endOffset = endContainer.length; - } - } - - if (format[0].inline) { - if (rng.collapsed) { - // Expand left to closest word boundary - endPoint = findWordEndPoint(startContainer, startOffset, true); - if (endPoint) { - startContainer = endPoint.container; - startOffset = endPoint.offset; - } - - // Expand right to closest word boundary - endPoint = findWordEndPoint(endContainer, endOffset); - if (endPoint) { - endContainer = endPoint.container; - endOffset = endPoint.offset; - } - } - - // Avoid applying formatting to a trailing space. - leaf = findLeaf(endContainer, endOffset); - if (leaf.node) { - while (leaf.node && leaf.offset === 0 && leaf.node.previousSibling) { - leaf = findLeaf(leaf.node.previousSibling); - } - - if (leaf.node && leaf.offset > 0 && leaf.node.nodeType === 3 && - leaf.node.nodeValue.charAt(leaf.offset - 1) === ' ') { - - if (leaf.offset > 1) { - endContainer = leaf.node; - endContainer.splitText(leaf.offset - 1); - } - } - } - } - - // Move start/end point up the tree if the leaves are sharp and if we are in different containers - // Example * becomes !: !

    *texttext*

    ! - // This will reduce the number of wrapper elements that needs to be created - // Move start point up the tree - if (format[0].inline || format[0].block_expand) { - if (!format[0].inline || (startContainer.nodeType != 3 || startOffset === 0)) { - startContainer = findParentContainer(true); - } - - if (!format[0].inline || (endContainer.nodeType != 3 || endOffset === endContainer.nodeValue.length)) { - endContainer = findParentContainer(); - } - } - - // Expand start/end container to matching selector - if (format[0].selector && format[0].expand !== FALSE && !format[0].inline) { - // Find new startContainer/endContainer if there is better one - startContainer = findSelectorEndPoint(startContainer, 'previousSibling'); - endContainer = findSelectorEndPoint(endContainer, 'nextSibling'); - } - - // Expand start/end container to matching block element or text node - if (format[0].block || format[0].selector) { - // Find new startContainer/endContainer if there is better one - startContainer = findBlockEndPoint(startContainer, 'previousSibling'); - endContainer = findBlockEndPoint(endContainer, 'nextSibling'); - - // Non block element then try to expand up the leaf - if (format[0].block) { - if (!isBlock(startContainer)) { - startContainer = findParentContainer(true); - } - - if (!isBlock(endContainer)) { - endContainer = findParentContainer(); - } - } - } - - // Setup index for startContainer - if (startContainer.nodeType == 1) { - startOffset = nodeIndex(startContainer); - startContainer = startContainer.parentNode; - } - - // Setup index for endContainer - if (endContainer.nodeType == 1) { - endOffset = nodeIndex(endContainer) + 1; - endContainer = endContainer.parentNode; - } - - // Return new range like object - return { - startContainer: startContainer, - startOffset: startOffset, - endContainer: endContainer, - endOffset: endOffset - }; - } - - /** - * Removes the specified format for the specified node. It will also remove the node if it doesn't have - * any attributes if the format specifies it to do so. - * - * @private - * @param {Object} format Format object with items to remove from node. - * @param {Object} vars Name/value object with variables to apply to format. - * @param {Node} node Node to remove the format styles on. - * @param {Node} compare_node Optional compare node, if specified the styles will be compared to that node. - * @return {Boolean} True/false if the node was removed or not. - */ - function removeFormat(format, vars, node, compare_node) { - var i, attrs, stylesModified; - - // Check if node matches format - if (!matchName(node, format)) { - return FALSE; - } - - // Should we compare with format attribs and styles - if (format.remove != 'all') { - // Remove styles - each(format.styles, function(value, name) { - value = normalizeStyleValue(replaceVars(value, vars), name); - - // Indexed array - if (typeof(name) === 'number') { - name = value; - compare_node = 0; - } - - if (!compare_node || isEq(getStyle(compare_node, name), value)) { - dom.setStyle(node, name, ''); - } - - stylesModified = 1; - }); - - // Remove style attribute if it's empty - if (stylesModified && dom.getAttrib(node, 'style') === '') { - node.removeAttribute('style'); - node.removeAttribute('data-mce-style'); - } - - // Remove attributes - each(format.attributes, function(value, name) { - var valueOut; - - value = replaceVars(value, vars); - - // Indexed array - if (typeof(name) === 'number') { - name = value; - compare_node = 0; - } - - if (!compare_node || isEq(dom.getAttrib(compare_node, name), value)) { - // Keep internal classes - if (name == 'class') { - value = dom.getAttrib(node, name); - if (value) { - // Build new class value where everything is removed except the internal prefixed classes - valueOut = ''; - each(value.split(/\s+/), function(cls) { - if (/mce\w+/.test(cls)) { - valueOut += (valueOut ? ' ' : '') + cls; - } - }); - - // We got some internal classes left - if (valueOut) { - dom.setAttrib(node, name, valueOut); - return; - } - } - } - - // IE6 has a bug where the attribute doesn't get removed correctly - if (name == "class") { - node.removeAttribute('className'); - } - - // Remove mce prefixed attributes - if (MCE_ATTR_RE.test(name)) { - node.removeAttribute('data-mce-' + name); - } - - node.removeAttribute(name); - } - }); - - // Remove classes - each(format.classes, function(value) { - value = replaceVars(value, vars); - - if (!compare_node || dom.hasClass(compare_node, value)) { - dom.removeClass(node, value); - } - }); - - // Check for non internal attributes - attrs = dom.getAttribs(node); - for (i = 0; i < attrs.length; i++) { - if (attrs[i].nodeName.indexOf('_') !== 0) { - return FALSE; - } - } - } - - // Remove the inline child if it's empty for example or - if (format.remove != 'none') { - removeNode(node, format); - return TRUE; - } - } - - /** - * Removes the node and wrap it's children in paragraphs before doing so or - * appends BR elements to the beginning/end of the block element if forcedRootBlocks is disabled. - * - * If the div in the node below gets removed: - * text
    text
    text - * - * Output becomes: - * text

    text
    text - * - * So when the div is removed the result is: - * text
    text
    text - * - * @private - * @param {Node} node Node to remove + apply BR/P elements to. - * @param {Object} format Format rule. - * @return {Node} Input node. - */ - function removeNode(node, format) { - var parentNode = node.parentNode, rootBlockElm; - - function find(node, next, inc) { - node = getNonWhiteSpaceSibling(node, next, inc); - - return !node || (node.nodeName == 'BR' || isBlock(node)); - } - - if (format.block) { - if (!forcedRootBlock) { - // Append BR elements if needed before we remove the block - if (isBlock(node) && !isBlock(parentNode)) { - if (!find(node, FALSE) && !find(node.firstChild, TRUE, 1)) { - node.insertBefore(dom.create('br'), node.firstChild); - } - - if (!find(node, TRUE) && !find(node.lastChild, FALSE, 1)) { - node.appendChild(dom.create('br')); - } - } - } else { - // Wrap the block in a forcedRootBlock if we are at the root of document - if (parentNode == dom.getRoot()) { - if (!format.list_block || !isEq(node, format.list_block)) { - each(grep(node.childNodes), function(node) { - if (isValid(forcedRootBlock, node.nodeName.toLowerCase())) { - if (!rootBlockElm) { - rootBlockElm = wrap(node, forcedRootBlock); - dom.setAttribs(rootBlockElm, ed.settings.forced_root_block_attrs); - } else { - rootBlockElm.appendChild(node); - } - } else { - rootBlockElm = 0; - } - }); - } - } - } - } - - // Never remove nodes that isn't the specified inline element if a selector is specified too - if (format.selector && format.inline && !isEq(format.inline, node)) { - return; - } - - dom.remove(node, 1); - } - - /** - * Returns the next/previous non whitespace node. - * - * @private - * @param {Node} node Node to start at. - * @param {boolean} next (Optional) Include next or previous node defaults to previous. - * @param {boolean} inc (Optional) Include the current node in checking. Defaults to false. - * @return {Node} Next or previous node or undefined if it wasn't found. - */ - function getNonWhiteSpaceSibling(node, next, inc) { - if (node) { - next = next ? 'nextSibling' : 'previousSibling'; - - for (node = inc ? node : node[next]; node; node = node[next]) { - if (node.nodeType == 1 || !isWhiteSpaceNode(node)) { - return node; - } - } - } - } - - /** - * Checks if the specified node is a bookmark node or not. - * - * @private - * @param {Node} node Node to check if it's a bookmark node or not. - * @return {Boolean} true/false if the node is a bookmark node. - */ - function isBookmarkNode(node) { - return node && node.nodeType == 1 && node.getAttribute('data-mce-type') == 'bookmark'; - } - - /** - * Merges the next/previous sibling element if they match. - * - * @private - * @param {Node} prev Previous node to compare/merge. - * @param {Node} next Next node to compare/merge. - * @return {Node} Next node if we didn't merge and prev node if we did. - */ - function mergeSiblings(prev, next) { - var sibling, tmpSibling; - - /** - * Compares two nodes and checks if it's attributes and styles matches. - * This doesn't compare classes as items since their order is significant. - * - * @private - * @param {Node} node1 First node to compare with. - * @param {Node} node2 Second node to compare with. - * @return {boolean} True/false if the nodes are the same or not. - */ - function compareElements(node1, node2) { - // Not the same name - if (node1.nodeName != node2.nodeName) { - return FALSE; - } - - /** - * Returns all the nodes attributes excluding internal ones, styles and classes. - * - * @private - * @param {Node} node Node to get attributes from. - * @return {Object} Name/value object with attributes and attribute values. - */ - function getAttribs(node) { - var attribs = {}; - - each(dom.getAttribs(node), function(attr) { - var name = attr.nodeName.toLowerCase(); - - // Don't compare internal attributes or style - if (name.indexOf('_') !== 0 && name !== 'style' && name !== 'data-mce-style') { - attribs[name] = dom.getAttrib(node, name); - } - }); - - return attribs; - } - - /** - * Compares two objects checks if it's key + value exists in the other one. - * - * @private - * @param {Object} obj1 First object to compare. - * @param {Object} obj2 Second object to compare. - * @return {boolean} True/false if the objects matches or not. - */ - function compareObjects(obj1, obj2) { - var value, name; - - for (name in obj1) { - // Obj1 has item obj2 doesn't have - if (obj1.hasOwnProperty(name)) { - value = obj2[name]; - - // Obj2 doesn't have obj1 item - if (value === undef) { - return FALSE; - } - - // Obj2 item has a different value - if (obj1[name] != value) { - return FALSE; - } - - // Delete similar value - delete obj2[name]; - } - } - - // Check if obj 2 has something obj 1 doesn't have - for (name in obj2) { - // Obj2 has item obj1 doesn't have - if (obj2.hasOwnProperty(name)) { - return FALSE; - } - } - - return TRUE; - } - - // Attribs are not the same - if (!compareObjects(getAttribs(node1), getAttribs(node2))) { - return FALSE; - } - - // Styles are not the same - if (!compareObjects(dom.parseStyle(dom.getAttrib(node1, 'style')), dom.parseStyle(dom.getAttrib(node2, 'style')))) { - return FALSE; - } - - return !isBookmarkNode(node1) && !isBookmarkNode(node2); - } - - function findElementSibling(node, sibling_name) { - for (sibling = node; sibling; sibling = sibling[sibling_name]) { - if (sibling.nodeType == 3 && sibling.nodeValue.length !== 0) { - return node; - } - - if (sibling.nodeType == 1 && !isBookmarkNode(sibling)) { - return sibling; - } - } - - return node; - } - - // Check if next/prev exists and that they are elements - if (prev && next) { - // If previous sibling is empty then jump over it - prev = findElementSibling(prev, 'previousSibling'); - next = findElementSibling(next, 'nextSibling'); - - // Compare next and previous nodes - if (compareElements(prev, next)) { - // Append nodes between - for (sibling = prev.nextSibling; sibling && sibling != next;) { - tmpSibling = sibling; - sibling = sibling.nextSibling; - prev.appendChild(tmpSibling); - } - - // Remove next node - dom.remove(next); - - // Move children into prev node - each(grep(next.childNodes), function(node) { - prev.appendChild(node); - }); - - return prev; - } - } - - return next; - } - - function getContainer(rng, start) { - var container, offset, lastIdx; - - container = rng[start ? 'startContainer' : 'endContainer']; - offset = rng[start ? 'startOffset' : 'endOffset']; - - if (container.nodeType == 1) { - lastIdx = container.childNodes.length - 1; - - if (!start && offset) { - offset--; - } - - container = container.childNodes[offset > lastIdx ? lastIdx : offset]; - } - - // If start text node is excluded then walk to the next node - if (container.nodeType === 3 && start && offset >= container.nodeValue.length) { - container = new TreeWalker(container, ed.getBody()).next() || container; - } - - // If end text node is excluded then walk to the previous node - if (container.nodeType === 3 && !start && offset === 0) { - container = new TreeWalker(container, ed.getBody()).prev() || container; - } - - return container; - } - - function performCaretAction(type, name, vars) { - var caretContainerId = '_mce_caret', debug = ed.settings.caret_debug; - - // Creates a caret container bogus element - function createCaretContainer(fill) { - var caretContainer = dom.create('span', {id: caretContainerId, 'data-mce-bogus': true, style: debug ? 'color:red' : ''}); - - if (fill) { - caretContainer.appendChild(ed.getDoc().createTextNode(INVISIBLE_CHAR)); - } - - return caretContainer; - } - - function isCaretContainerEmpty(node, nodes) { - while (node) { - if ((node.nodeType === 3 && node.nodeValue !== INVISIBLE_CHAR) || node.childNodes.length > 1) { - return false; - } - - // Collect nodes - if (nodes && node.nodeType === 1) { - nodes.push(node); - } - - node = node.firstChild; - } - - return true; - } - - // Returns any parent caret container element - function getParentCaretContainer(node) { - while (node) { - if (node.id === caretContainerId) { - return node; - } - - node = node.parentNode; - } - } - - // Finds the first text node in the specified node - function findFirstTextNode(node) { - var walker; - - if (node) { - walker = new TreeWalker(node, node); - - for (node = walker.current(); node; node = walker.next()) { - if (node.nodeType === 3) { - return node; - } - } - } - } - - // Removes the caret container for the specified node or all on the current document - function removeCaretContainer(node, move_caret) { - var child, rng; - - if (!node) { - node = getParentCaretContainer(selection.getStart()); - - if (!node) { - while ((node = dom.get(caretContainerId))) { - removeCaretContainer(node, false); - } - } - } else { - rng = selection.getRng(true); - - if (isCaretContainerEmpty(node)) { - if (move_caret !== false) { - rng.setStartBefore(node); - rng.setEndBefore(node); - } - - dom.remove(node); - } else { - child = findFirstTextNode(node); - - if (child.nodeValue.charAt(0) === INVISIBLE_CHAR) { - child = child.deleteData(0, 1); - } - - dom.remove(node, 1); - } - - selection.setRng(rng); - } - } - - // Applies formatting to the caret postion - function applyCaretFormat() { - var rng, caretContainer, textNode, offset, bookmark, container, text; - - rng = selection.getRng(true); - offset = rng.startOffset; - container = rng.startContainer; - text = container.nodeValue; - - caretContainer = getParentCaretContainer(selection.getStart()); - if (caretContainer) { - textNode = findFirstTextNode(caretContainer); - } - - // Expand to word is caret is in the middle of a text node and the char before/after is a alpha numeric character - if (text && offset > 0 && offset < text.length && /\w/.test(text.charAt(offset)) && /\w/.test(text.charAt(offset - 1))) { - // Get bookmark of caret position - bookmark = selection.getBookmark(); - - // Collapse bookmark range (WebKit) - rng.collapse(true); - - // Expand the range to the closest word and split it at those points - rng = expandRng(rng, get(name)); - rng = rangeUtils.split(rng); - - // Apply the format to the range - apply(name, vars, rng); - - // Move selection back to caret position - selection.moveToBookmark(bookmark); - } else { - if (!caretContainer || textNode.nodeValue !== INVISIBLE_CHAR) { - caretContainer = createCaretContainer(true); - textNode = caretContainer.firstChild; - - rng.insertNode(caretContainer); - offset = 1; - - apply(name, vars, caretContainer); - } else { - apply(name, vars, caretContainer); - } - - // Move selection to text node - selection.setCursorLocation(textNode, offset); - } - } - - function removeCaretFormat() { - var rng = selection.getRng(true), container, offset, bookmark, - hasContentAfter, node, formatNode, parents = [], i, caretContainer; - - container = rng.startContainer; - offset = rng.startOffset; - node = container; - - if (container.nodeType == 3) { - if (offset != container.nodeValue.length || container.nodeValue === INVISIBLE_CHAR) { - hasContentAfter = true; - } - - node = node.parentNode; - } - - while (node) { - if (matchNode(node, name, vars)) { - formatNode = node; - break; - } - - if (node.nextSibling) { - hasContentAfter = true; - } - - parents.push(node); - node = node.parentNode; - } - - // Node doesn't have the specified format - if (!formatNode) { - return; - } - - // Is there contents after the caret then remove the format on the element - if (hasContentAfter) { - // Get bookmark of caret position - bookmark = selection.getBookmark(); - - // Collapse bookmark range (WebKit) - rng.collapse(true); - - // Expand the range to the closest word and split it at those points - rng = expandRng(rng, get(name), true); - rng = rangeUtils.split(rng); - - // Remove the format from the range - remove(name, vars, rng); - - // Move selection back to caret position - selection.moveToBookmark(bookmark); - } else { - caretContainer = createCaretContainer(); - - node = caretContainer; - for (i = parents.length - 1; i >= 0; i--) { - node.appendChild(dom.clone(parents[i], false)); - node = node.firstChild; - } - - // Insert invisible character into inner most format element - node.appendChild(dom.doc.createTextNode(INVISIBLE_CHAR)); - node = node.firstChild; - - var block = dom.getParent(formatNode, isTextBlock); - - if (block && dom.isEmpty(block)) { - // Replace formatNode with caretContainer when removing format from empty block like

    |

    - formatNode.parentNode.replaceChild(caretContainer, formatNode); - } else { - // Insert caret container after the formated node - dom.insertAfter(caretContainer, formatNode); - } - - // Move selection to text node - selection.setCursorLocation(node, 1); - - // If the formatNode is empty, we can remove it safely. - if (dom.isEmpty(formatNode)) { - dom.remove(formatNode); - } - } - } - - // Checks if the parent caret container node isn't empty if that is the case it - // will remove the bogus state on all children that isn't empty - function unmarkBogusCaretParents() { - var caretContainer; - - caretContainer = getParentCaretContainer(selection.getStart()); - if (caretContainer && !dom.isEmpty(caretContainer)) { - walk(caretContainer, function(node) { - if (node.nodeType == 1 && node.id !== caretContainerId && !dom.isEmpty(node)) { - dom.setAttrib(node, 'data-mce-bogus', null); - } - }, 'childNodes'); - } - } - - // Only bind the caret events once - if (!ed._hasCaretEvents) { - // Mark current caret container elements as bogus when getting the contents so we don't end up with empty elements - markCaretContainersBogus = function() { - var nodes = [], i; - - if (isCaretContainerEmpty(getParentCaretContainer(selection.getStart()), nodes)) { - // Mark children - i = nodes.length; - while (i--) { - dom.setAttrib(nodes[i], 'data-mce-bogus', '1'); - } - } - }; - - disableCaretContainer = function(e) { - var keyCode = e.keyCode; - - removeCaretContainer(); - - // Remove caret container on keydown and it's a backspace, enter or left/right arrow keys - if (keyCode == 8 || keyCode == 37 || keyCode == 39) { - removeCaretContainer(getParentCaretContainer(selection.getStart())); - } - - unmarkBogusCaretParents(); - }; - - // Remove bogus state if they got filled by contents using editor.selection.setContent - ed.on('SetContent', function(e) { - if (e.selection) { - unmarkBogusCaretParents(); - } - }); - ed._hasCaretEvents = true; - } - - // Do apply or remove caret format - if (type == "apply") { - applyCaretFormat(); - } else { - removeCaretFormat(); - } - } - - /** - * Moves the start to the first suitable text node. - */ - function moveStart(rng) { - var container = rng.startContainer, - offset = rng.startOffset, isAtEndOfText, - walker, node, nodes, tmpNode; - - // Convert text node into index if possible - if (container.nodeType == 3 && offset >= container.nodeValue.length) { - // Get the parent container location and walk from there - offset = nodeIndex(container); - container = container.parentNode; - isAtEndOfText = true; - } - - // Move startContainer/startOffset in to a suitable node - if (container.nodeType == 1) { - nodes = container.childNodes; - container = nodes[Math.min(offset, nodes.length - 1)]; - walker = new TreeWalker(container, dom.getParent(container, dom.isBlock)); - - // If offset is at end of the parent node walk to the next one - if (offset > nodes.length - 1 || isAtEndOfText) { - walker.next(); - } - - for (node = walker.current(); node; node = walker.next()) { - if (node.nodeType == 3 && !isWhiteSpaceNode(node)) { - // IE has a "neat" feature where it moves the start node into the closest element - // we can avoid this by inserting an element before it and then remove it after we set the selection - tmpNode = dom.create('a', null, INVISIBLE_CHAR); - node.parentNode.insertBefore(tmpNode, node); - - // Set selection and remove tmpNode - rng.setStart(node, 0); - selection.setRng(rng); - dom.remove(tmpNode); - - return; - } - } - } - } - }; -}); - -// Included from: js/tinymce/classes/UndoManager.js - -/** - * UndoManager.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class handles the undo/redo history levels for the editor. Since the build in undo/redo has major drawbacks a custom one was needed. - * - * @class tinymce.UndoManager - */ -define("tinymce/UndoManager", [ - "tinymce/Env", - "tinymce/util/Tools" -], function(Env, Tools) { - var trim = Tools.trim, trimContentRegExp; - - trimContentRegExp = new RegExp([ - ']+data-mce-bogus[^>]+>[\u200B\uFEFF]+<\\/span>', // Trim bogus spans like caret containers - ']+data-mce-bogus[^>]+><\\/div>', // Trim bogus divs like resize handles - '\\s?data-mce-selected="[^"]+"' // Trim temporaty data-mce prefixed attributes like data-mce-selected - ].join('|'), 'gi'); - - return function(editor) { - var self = this, index = 0, data = [], beforeBookmark, isFirstTypedCharacter, lock; - - // Returns a trimmed version of the current editor contents - function getContent() { - return trim(editor.getContent({format: 'raw', no_events: 1}).replace(trimContentRegExp, '')); - } - - function addNonTypingUndoLevel(e) { - self.typing = false; - self.add({}, e); - } - - // Add initial undo level when the editor is initialized - editor.on('init', function() { - self.add(); - }); - - // Get position before an execCommand is processed - editor.on('BeforeExecCommand', function(e) { - var cmd = e.command; - - if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint') { - self.beforeChange(); - } - }); - - // Add undo level after an execCommand call was made - editor.on('ExecCommand', function(e) { - var cmd = e.command; - - if (cmd != 'Undo' && cmd != 'Redo' && cmd != 'mceRepaint') { - addNonTypingUndoLevel(e); - } - }); - - editor.on('ObjectResizeStart', function() { - self.beforeChange(); - }); - - editor.on('SaveContent ObjectResized blur', addNonTypingUndoLevel); - editor.dom.bind(editor.dom.getRoot(), 'dragend', addNonTypingUndoLevel); - - editor.on('KeyUp', function(e) { - var keyCode = e.keyCode; - - if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 45 || keyCode == 13 || e.ctrlKey) { - addNonTypingUndoLevel(); - editor.nodeChanged(); - } - - if (keyCode == 46 || keyCode == 8 || (Env.mac && (keyCode == 91 || keyCode == 93))) { - editor.nodeChanged(); - } - - // Fire a TypingUndo event on the first character entered - if (isFirstTypedCharacter && self.typing) { - // Make the it dirty if the content was changed after typing the first character - if (!editor.isDirty()) { - editor.isNotDirty = !data[0] || getContent() == data[0].content; - - // Fire initial change event - if (!editor.isNotDirty) { - editor.fire('change', {level: data[0], lastLevel: null}); - } - } - - editor.fire('TypingUndo'); - isFirstTypedCharacter = false; - editor.nodeChanged(); - } - }); - - editor.on('KeyDown', function(e) { - var keyCode = e.keyCode; - - // Is caracter positon keys left,right,up,down,home,end,pgdown,pgup,enter - if ((keyCode >= 33 && keyCode <= 36) || (keyCode >= 37 && keyCode <= 40) || keyCode == 45) { - if (self.typing) { - addNonTypingUndoLevel(e); - } - - return; - } - - // If key isn't shift,ctrl,alt,capslock,metakey - if ((keyCode < 16 || keyCode > 20) && keyCode != 224 && keyCode != 91 && !self.typing) { - self.beforeChange(); - self.typing = true; - self.add({}, e); - isFirstTypedCharacter = true; - } - }); - - editor.on('MouseDown', function(e) { - if (self.typing) { - addNonTypingUndoLevel(e); - } - }); - - // Add keyboard shortcuts for undo/redo keys - editor.addShortcut('ctrl+z', '', 'Undo'); - editor.addShortcut('ctrl+y,ctrl+shift+z', '', 'Redo'); - - editor.on('AddUndo Undo Redo ClearUndos MouseUp', function(e) { - if (!e.isDefaultPrevented()) { - editor.nodeChanged(); - } - }); - - self = { - // Explose for debugging reasons - data: data, - - /** - * State if the user is currently typing or not. This will add a typing operation into one undo - * level instead of one new level for each keystroke. - * - * @field {Boolean} typing - */ - typing: false, - - /** - * Stores away a bookmark to be used when performing an undo action so that the selection is before - * the change has been made. - * - * @method beforeChange - */ - beforeChange: function() { - if (!lock) { - beforeBookmark = editor.selection.getBookmark(2, true); - } - }, - - /** - * Adds a new undo level/snapshot to the undo list. - * - * @method add - * @param {Object} level Optional undo level object to add. - * @param {DOMEvent} Event Optional event responsible for the creation of the undo level. - * @return {Object} Undo level that got added or null it a level wasn't needed. - */ - add: function(level, event) { - var i, settings = editor.settings, lastLevel; - - level = level || {}; - level.content = getContent(); - - if (lock || editor.removed) { - return null; - } - - if (editor.fire('BeforeAddUndo', {level: level, originalEvent: event}).isDefaultPrevented()) { - return null; - } - - // Add undo level if needed - lastLevel = data[index]; - if (lastLevel && lastLevel.content == level.content) { - return null; - } - - // Set before bookmark on previous level - if (data[index]) { - data[index].beforeBookmark = beforeBookmark; - } - - // Time to compress - if (settings.custom_undo_redo_levels) { - if (data.length > settings.custom_undo_redo_levels) { - for (i = 0; i < data.length - 1; i++) { - data[i] = data[i + 1]; - } - - data.length--; - index = data.length; - } - } - - // Get a non intrusive normalized bookmark - level.bookmark = editor.selection.getBookmark(2, true); - - // Crop array if needed - if (index < data.length - 1) { - data.length = index + 1; - } - - data.push(level); - index = data.length - 1; - - var args = {level: level, lastLevel: lastLevel, originalEvent: event}; - - editor.fire('AddUndo', args); - - if (index > 0) { - editor.isNotDirty = false; - editor.fire('change', args); - } - - return level; - }, - - /** - * Undoes the last action. - * - * @method undo - * @return {Object} Undo level or null if no undo was performed. - */ - undo: function() { - var level; - - if (self.typing) { - self.add(); - self.typing = false; - } - - if (index > 0) { - level = data[--index]; - - // Undo to first index then set dirty state to false - if (index === 0) { - editor.isNotDirty = true; - } - - editor.setContent(level.content, {format: 'raw'}); - editor.selection.moveToBookmark(level.beforeBookmark); - - editor.fire('undo', {level: level}); - } - - return level; - }, - - /** - * Redoes the last action. - * - * @method redo - * @return {Object} Redo level or null if no redo was performed. - */ - redo: function() { - var level; - - if (index < data.length - 1) { - level = data[++index]; - - editor.setContent(level.content, {format: 'raw'}); - editor.selection.moveToBookmark(level.bookmark); - - editor.fire('redo', {level: level}); - } - - return level; - }, - - /** - * Removes all undo levels. - * - * @method clear - */ - clear: function() { - data = []; - index = 0; - self.typing = false; - editor.fire('ClearUndos'); - }, - - /** - * Returns true/false if the undo manager has any undo levels. - * - * @method hasUndo - * @return {Boolean} true/false if the undo manager has any undo levels. - */ - hasUndo: function() { - // Has undo levels or typing and content isn't the same as the initial level - return index > 0 || (self.typing && data[0] && getContent() != data[0].content); - }, - - /** - * Returns true/false if the undo manager has any redo levels. - * - * @method hasRedo - * @return {Boolean} true/false if the undo manager has any redo levels. - */ - hasRedo: function() { - return index < data.length - 1 && !this.typing; - }, - - /** - * Executes the specified function in an undo transation. The selection - * before the modification will be stored to the undo stack and if the DOM changes - * it will add a new undo level. Any methods within the transation that adds undo levels will - * be ignored. So a transation can include calls to execCommand or editor.insertContent. - * - * @method transact - * @param {function} callback Function to execute dom manipulation logic in. - */ - transact: function(callback) { - self.beforeChange(); - - lock = true; - callback(); - lock = false; - - self.add(); - } - }; - - return self; - }; -}); - -// Included from: js/tinymce/classes/EnterKey.js - -/** - * EnterKey.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Contains logic for handling the enter key to split/generate block elements. - */ -define("tinymce/EnterKey", [ - "tinymce/dom/TreeWalker", - "tinymce/dom/RangeUtils", - "tinymce/Env" -], function(TreeWalker, RangeUtils, Env) { - var isIE = Env.ie && Env.ie < 11; - - return function(editor) { - var dom = editor.dom, selection = editor.selection, settings = editor.settings; - var undoManager = editor.undoManager, schema = editor.schema, nonEmptyElementsMap = schema.getNonEmptyElements(); - - function handleEnterKey(evt) { - var rng, tmpRng, editableRoot, container, offset, parentBlock, documentMode, shiftKey, - newBlock, fragment, containerBlock, parentBlockName, containerBlockName, newBlockName, isAfterLastNodeInContainer; - - // Returns true if the block can be split into two blocks or not - function canSplitBlock(node) { - return node && - dom.isBlock(node) && - !/^(TD|TH|CAPTION|FORM)$/.test(node.nodeName) && - !/^(fixed|absolute)/i.test(node.style.position) && - dom.getContentEditable(node) !== "true"; - } - - // Renders empty block on IE - function renderBlockOnIE(block) { - var oldRng; - - if (dom.isBlock(block)) { - oldRng = selection.getRng(); - block.appendChild(dom.create('span', null, '\u00a0')); - selection.select(block); - block.lastChild.outerHTML = ''; - selection.setRng(oldRng); - } - } - - // Remove the first empty inline element of the block so this:

    x

    becomes this:

    x

    - function trimInlineElementsOnLeftSideOfBlock(block) { - var node = block, firstChilds = [], i; - - // Find inner most first child ex:

    *

    - while ((node = node.firstChild)) { - if (dom.isBlock(node)) { - return; - } - - if (node.nodeType == 1 && !nonEmptyElementsMap[node.nodeName.toLowerCase()]) { - firstChilds.push(node); - } - } - - i = firstChilds.length; - while (i--) { - node = firstChilds[i]; - if (!node.hasChildNodes() || (node.firstChild == node.lastChild && node.firstChild.nodeValue === '')) { - dom.remove(node); - } else { - // Remove see #5381 - if (node.nodeName == "A" && (node.innerText || node.textContent) === ' ') { - dom.remove(node); - } - } - } - } - - // Moves the caret to a suitable position within the root for example in the first non - // pure whitespace text node or before an image - function moveToCaretPosition(root) { - var walker, node, rng, lastNode = root, tempElm; - - function firstNonWhiteSpaceNodeSibling(node) { - while (node) { - if (node.nodeType == 1 || (node.nodeType == 3 && node.data && /[\r\n\s]/.test(node.data))) { - return node; - } - - node = node.nextSibling; - } - } - - // Old IE versions doesn't properly render blocks with br elements in them - // For example


    wont be rendered correctly in a contentEditable area - // until you remove the br producing

    - if (Env.ie && Env.ie < 9 && parentBlock && parentBlock.firstChild) { - if (parentBlock.firstChild == parentBlock.lastChild && parentBlock.firstChild.tagName == 'BR') { - dom.remove(parentBlock.firstChild); - } - } - - if (root.nodeName == 'LI') { - var firstChild = firstNonWhiteSpaceNodeSibling(root.firstChild); - - if (firstChild && /^(UL|OL)$/.test(firstChild.nodeName)) { - root.insertBefore(dom.doc.createTextNode('\u00a0'), root.firstChild); - } - } - - rng = dom.createRng(); - - if (root.hasChildNodes()) { - walker = new TreeWalker(root, root); - - while ((node = walker.current())) { - if (node.nodeType == 3) { - rng.setStart(node, 0); - rng.setEnd(node, 0); - break; - } - - if (nonEmptyElementsMap[node.nodeName.toLowerCase()]) { - rng.setStartBefore(node); - rng.setEndBefore(node); - break; - } - - lastNode = node; - node = walker.next(); - } - - if (!node) { - rng.setStart(lastNode, 0); - rng.setEnd(lastNode, 0); - } - } else { - if (root.nodeName == 'BR') { - if (root.nextSibling && dom.isBlock(root.nextSibling)) { - // Trick on older IE versions to render the caret before the BR between two lists - if (!documentMode || documentMode < 9) { - tempElm = dom.create('br'); - root.parentNode.insertBefore(tempElm, root); - } - - rng.setStartBefore(root); - rng.setEndBefore(root); - } else { - rng.setStartAfter(root); - rng.setEndAfter(root); - } - } else { - rng.setStart(root, 0); - rng.setEnd(root, 0); - } - } - - selection.setRng(rng); - - // Remove tempElm created for old IE:s - dom.remove(tempElm); - selection.scrollIntoView(root); - } - - function setForcedBlockAttrs(node) { - var forcedRootBlockName = settings.forced_root_block; - - if (forcedRootBlockName && forcedRootBlockName.toLowerCase() === node.tagName.toLowerCase()) { - dom.setAttribs(node, settings.forced_root_block_attrs); - } - } - - // Creates a new block element by cloning the current one or creating a new one if the name is specified - // This function will also copy any text formatting from the parent block and add it to the new one - function createNewBlock(name) { - var node = container, block, clonedNode, caretNode; - - if (name || parentBlockName == "TABLE") { - block = dom.create(name || newBlockName); - setForcedBlockAttrs(block); - } else { - block = parentBlock.cloneNode(false); - } - - caretNode = block; - - // Clone any parent styles - if (settings.keep_styles !== false) { - do { - if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U|VAR|CITE|DFN|CODE|MARK|Q|SUP|SUB|SAMP)$/.test(node.nodeName)) { - // Never clone a caret containers - if (node.id == '_mce_caret') { - continue; - } - - clonedNode = node.cloneNode(false); - dom.setAttrib(clonedNode, 'id', ''); // Remove ID since it needs to be document unique - - if (block.hasChildNodes()) { - clonedNode.appendChild(block.firstChild); - block.appendChild(clonedNode); - } else { - caretNode = clonedNode; - block.appendChild(clonedNode); - } - } - } while ((node = node.parentNode)); - } - - // BR is needed in empty blocks on non IE browsers - if (!isIE) { - caretNode.innerHTML = '
    '; - } - - return block; - } - - // Returns true/false if the caret is at the start/end of the parent block element - function isCaretAtStartOrEndOfBlock(start) { - var walker, node, name; - - // Caret is in the middle of a text node like "a|b" - if (container.nodeType == 3 && (start ? offset > 0 : offset < container.nodeValue.length)) { - return false; - } - - // If after the last element in block node edge case for #5091 - if (container.parentNode == parentBlock && isAfterLastNodeInContainer && !start) { - return true; - } - - // If the caret if before the first element in parentBlock - if (start && container.nodeType == 1 && container == parentBlock.firstChild) { - return true; - } - - // Caret can be before/after a table - if (container.nodeName === "TABLE" || (container.previousSibling && container.previousSibling.nodeName == "TABLE")) { - return (isAfterLastNodeInContainer && !start) || (!isAfterLastNodeInContainer && start); - } - - // Walk the DOM and look for text nodes or non empty elements - walker = new TreeWalker(container, parentBlock); - - // If caret is in beginning or end of a text block then jump to the next/previous node - if (container.nodeType == 3) { - if (start && offset === 0) { - walker.prev(); - } else if (!start && offset == container.nodeValue.length) { - walker.next(); - } - } - - while ((node = walker.current())) { - if (node.nodeType === 1) { - // Ignore bogus elements - if (!node.getAttribute('data-mce-bogus')) { - // Keep empty elements like but not trailing br:s like

    text|

    - name = node.nodeName.toLowerCase(); - if (nonEmptyElementsMap[name] && name !== 'br') { - return false; - } - } - } else if (node.nodeType === 3 && !/^[ \t\r\n]*$/.test(node.nodeValue)) { - return false; - } - - if (start) { - walker.prev(); - } else { - walker.next(); - } - } - - return true; - } - - // Wraps any text nodes or inline elements in the specified forced root block name - function wrapSelfAndSiblingsInDefaultBlock(container, offset) { - var newBlock, parentBlock, startNode, node, next, rootBlockName, blockName = newBlockName || 'P'; - - // Not in a block element or in a table cell or caption - parentBlock = dom.getParent(container, dom.isBlock); - rootBlockName = editor.getBody().nodeName.toLowerCase(); - if (!parentBlock || !canSplitBlock(parentBlock)) { - parentBlock = parentBlock || editableRoot; - - if (!parentBlock.hasChildNodes()) { - newBlock = dom.create(blockName); - setForcedBlockAttrs(newBlock); - parentBlock.appendChild(newBlock); - rng.setStart(newBlock, 0); - rng.setEnd(newBlock, 0); - return newBlock; - } - - // Find parent that is the first child of parentBlock - node = container; - while (node.parentNode != parentBlock) { - node = node.parentNode; - } - - // Loop left to find start node start wrapping at - while (node && !dom.isBlock(node)) { - startNode = node; - node = node.previousSibling; - } - - if (startNode && schema.isValidChild(rootBlockName, blockName.toLowerCase())) { - newBlock = dom.create(blockName); - setForcedBlockAttrs(newBlock); - startNode.parentNode.insertBefore(newBlock, startNode); - - // Start wrapping until we hit a block - node = startNode; - while (node && !dom.isBlock(node)) { - next = node.nextSibling; - newBlock.appendChild(node); - node = next; - } - - // Restore range to it's past location - rng.setStart(container, offset); - rng.setEnd(container, offset); - } - } - - return container; - } - - // Inserts a block or br before/after or in the middle of a split list of the LI is empty - function handleEmptyListItem() { - function isFirstOrLastLi(first) { - var node = containerBlock[first ? 'firstChild' : 'lastChild']; - - // Find first/last element since there might be whitespace there - while (node) { - if (node.nodeType == 1) { - break; - } - - node = node[first ? 'nextSibling' : 'previousSibling']; - } - - return node === parentBlock; - } - - function getContainerBlock() { - var containerBlockParent = containerBlock.parentNode; - - if (containerBlockParent.nodeName == 'LI') { - return containerBlockParent; - } - - return containerBlock; - } - - // Check if we are in an nested list - var containerBlockParentName = containerBlock.parentNode.nodeName; - if (/^(OL|UL|LI)$/.test(containerBlockParentName)) { - newBlockName = 'LI'; - } - - newBlock = newBlockName ? createNewBlock(newBlockName) : dom.create('BR'); - - if (isFirstOrLastLi(true) && isFirstOrLastLi()) { - if (containerBlockParentName == 'LI') { - // Nested list is inside a LI - dom.insertAfter(newBlock, getContainerBlock()); - } else { - // Is first and last list item then replace the OL/UL with a text block - dom.replace(newBlock, containerBlock); - } - } else if (isFirstOrLastLi(true)) { - if (containerBlockParentName == 'LI') { - // List nested in an LI then move the list to a new sibling LI - dom.insertAfter(newBlock, getContainerBlock()); - newBlock.appendChild(dom.doc.createTextNode(' ')); // Needed for IE so the caret can be placed - newBlock.appendChild(containerBlock); - } else { - // First LI in list then remove LI and add text block before list - containerBlock.parentNode.insertBefore(newBlock, containerBlock); - } - } else if (isFirstOrLastLi()) { - // Last LI in list then remove LI and add text block after list - dom.insertAfter(newBlock, getContainerBlock()); - renderBlockOnIE(newBlock); - } else { - // Middle LI in list the split the list and insert a text block in the middle - // Extract after fragment and insert it after the current block - containerBlock = getContainerBlock(); - tmpRng = rng.cloneRange(); - tmpRng.setStartAfter(parentBlock); - tmpRng.setEndAfter(containerBlock); - fragment = tmpRng.extractContents(); - - if (newBlockName == 'LI' && fragment.firstChild.nodeName == 'LI') { - newBlock = fragment.firstChild; - dom.insertAfter(fragment, containerBlock); - } else { - dom.insertAfter(fragment, containerBlock); - dom.insertAfter(newBlock, containerBlock); - } - } - - dom.remove(parentBlock); - moveToCaretPosition(newBlock); - undoManager.add(); - } - - // Walks the parent block to the right and look for BR elements - function hasRightSideContent() { - var walker = new TreeWalker(container, parentBlock), node; - - while ((node = walker.next())) { - if (nonEmptyElementsMap[node.nodeName.toLowerCase()] || node.length > 0) { - return true; - } - } - } - - // Inserts a BR element if the forced_root_block option is set to false or empty string - function insertBr() { - var brElm, extraBr, marker; - - if (container && container.nodeType == 3 && offset >= container.nodeValue.length) { - // Insert extra BR element at the end block elements - if (!isIE && !hasRightSideContent()) { - brElm = dom.create('br'); - rng.insertNode(brElm); - rng.setStartAfter(brElm); - rng.setEndAfter(brElm); - extraBr = true; - } - } - - brElm = dom.create('br'); - rng.insertNode(brElm); - - // Rendering modes below IE8 doesn't display BR elements in PRE unless we have a \n before it - if (isIE && parentBlockName == 'PRE' && (!documentMode || documentMode < 8)) { - brElm.parentNode.insertBefore(dom.doc.createTextNode('\r'), brElm); - } - - // Insert temp marker and scroll to that - marker = dom.create('span', {}, ' '); - brElm.parentNode.insertBefore(marker, brElm); - selection.scrollIntoView(marker); - dom.remove(marker); - - if (!extraBr) { - rng.setStartAfter(brElm); - rng.setEndAfter(brElm); - } else { - rng.setStartBefore(brElm); - rng.setEndBefore(brElm); - } - - selection.setRng(rng); - undoManager.add(); - } - - // Trims any linebreaks at the beginning of node user for example when pressing enter in a PRE element - function trimLeadingLineBreaks(node) { - do { - if (node.nodeType === 3) { - node.nodeValue = node.nodeValue.replace(/^[\r\n]+/, ''); - } - - node = node.firstChild; - } while (node); - } - - function getEditableRoot(node) { - var root = dom.getRoot(), parent, editableRoot; - - // Get all parents until we hit a non editable parent or the root - parent = node; - while (parent !== root && dom.getContentEditable(parent) !== "false") { - if (dom.getContentEditable(parent) === "true") { - editableRoot = parent; - } - - parent = parent.parentNode; - } - - return parent !== root ? editableRoot : root; - } - - // Adds a BR at the end of blocks that only contains an IMG or INPUT since - // these might be floated and then they won't expand the block - function addBrToBlockIfNeeded(block) { - var lastChild; - - // IE will render the blocks correctly other browsers needs a BR - if (!isIE) { - block.normalize(); // Remove empty text nodes that got left behind by the extract - - // Check if the block is empty or contains a floated last child - lastChild = block.lastChild; - if (!lastChild || (/^(left|right)$/gi.test(dom.getStyle(lastChild, 'float', true)))) { - dom.add(block, 'br'); - } - } - } - - rng = selection.getRng(true); - - // Event is blocked by some other handler for example the lists plugin - if (evt.isDefaultPrevented()) { - return; - } - - // Delete any selected contents - if (!rng.collapsed) { - editor.execCommand('Delete'); - return; - } - - // Setup range items and newBlockName - new RangeUtils(dom).normalize(rng); - container = rng.startContainer; - offset = rng.startOffset; - newBlockName = (settings.force_p_newlines ? 'p' : '') || settings.forced_root_block; - newBlockName = newBlockName ? newBlockName.toUpperCase() : ''; - documentMode = dom.doc.documentMode; - shiftKey = evt.shiftKey; - - // Resolve node index - if (container.nodeType == 1 && container.hasChildNodes()) { - isAfterLastNodeInContainer = offset > container.childNodes.length - 1; - - container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container; - if (isAfterLastNodeInContainer && container.nodeType == 3) { - offset = container.nodeValue.length; - } else { - offset = 0; - } - } - - // Get editable root node normaly the body element but sometimes a div or span - editableRoot = getEditableRoot(container); - - // If there is no editable root then enter is done inside a contentEditable false element - if (!editableRoot) { - return; - } - - undoManager.beforeChange(); - - // If editable root isn't block nor the root of the editor - if (!dom.isBlock(editableRoot) && editableRoot != dom.getRoot()) { - if (!newBlockName || shiftKey) { - insertBr(); - } - - return; - } - - // Wrap the current node and it's sibling in a default block if it's needed. - // for example this text|text2 will become this

    text|text2

    - // This won't happen if root blocks are disabled or the shiftKey is pressed - if ((newBlockName && !shiftKey) || (!newBlockName && shiftKey)) { - container = wrapSelfAndSiblingsInDefaultBlock(container, offset); - } - - // Find parent block and setup empty block paddings - parentBlock = dom.getParent(container, dom.isBlock); - containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null; - - // Setup block names - parentBlockName = parentBlock ? parentBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5 - containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : ''; // IE < 9 & HTML5 - - // Enter inside block contained within a LI then split or insert before/after LI - if (containerBlockName == 'LI' && !evt.ctrlKey) { - parentBlock = containerBlock; - parentBlockName = containerBlockName; - } - - // Handle enter in LI - if (parentBlockName == 'LI') { - if (!newBlockName && shiftKey) { - insertBr(); - return; - } - - // Handle enter inside an empty list item - if (dom.isEmpty(parentBlock)) { - handleEmptyListItem(); - return; - } - } - - // Don't split PRE tags but insert a BR instead easier when writing code samples etc - if (parentBlockName == 'PRE' && settings.br_in_pre !== false) { - if (!shiftKey) { - insertBr(); - return; - } - } else { - // If no root block is configured then insert a BR by default or if the shiftKey is pressed - if ((!newBlockName && !shiftKey && parentBlockName != 'LI') || (newBlockName && shiftKey)) { - insertBr(); - return; - } - } - - // If parent block is root then never insert new blocks - if (newBlockName && parentBlock === editor.getBody()) { - return; - } - - // Default block name if it's not configured - newBlockName = newBlockName || 'P'; - - // Insert new block before/after the parent block depending on caret location - if (isCaretAtStartOrEndOfBlock()) { - // If the caret is at the end of a header we produce a P tag after it similar to Word unless we are in a hgroup - if (/^(H[1-6]|PRE|FIGURE)$/.test(parentBlockName) && containerBlockName != 'HGROUP') { - newBlock = createNewBlock(newBlockName); - } else { - newBlock = createNewBlock(); - } - - // Split the current container block element if enter is pressed inside an empty inner block element - if (settings.end_container_on_empty_block && canSplitBlock(containerBlock) && dom.isEmpty(parentBlock)) { - // Split container block for example a BLOCKQUOTE at the current blockParent location for example a P - newBlock = dom.split(containerBlock, parentBlock); - } else { - dom.insertAfter(newBlock, parentBlock); - } - - moveToCaretPosition(newBlock); - } else if (isCaretAtStartOrEndOfBlock(true)) { - // Insert new block before - newBlock = parentBlock.parentNode.insertBefore(createNewBlock(), parentBlock); - renderBlockOnIE(newBlock); - moveToCaretPosition(parentBlock); - } else { - // Extract after fragment and insert it after the current block - tmpRng = rng.cloneRange(); - tmpRng.setEndAfter(parentBlock); - fragment = tmpRng.extractContents(); - trimLeadingLineBreaks(fragment); - newBlock = fragment.firstChild; - dom.insertAfter(fragment, parentBlock); - trimInlineElementsOnLeftSideOfBlock(newBlock); - addBrToBlockIfNeeded(parentBlock); - moveToCaretPosition(newBlock); - } - - dom.setAttrib(newBlock, 'id', ''); // Remove ID since it needs to be document unique - - // Allow custom handling of new blocks - editor.fire('NewBlock', { newBlock: newBlock }); - - undoManager.add(); - } - - editor.on('keydown', function(evt) { - if (evt.keyCode == 13) { - if (handleEnterKey(evt) !== false) { - evt.preventDefault(); - } - } - }); - }; -}); - -// Included from: js/tinymce/classes/ForceBlocks.js - -/** - * ForceBlocks.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("tinymce/ForceBlocks", [], function() { - return function(editor) { - var settings = editor.settings, dom = editor.dom, selection = editor.selection; - var schema = editor.schema, blockElements = schema.getBlockElements(); - - function addRootBlocks() { - var node = selection.getStart(), rootNode = editor.getBody(), rng; - var startContainer, startOffset, endContainer, endOffset, rootBlockNode; - var tempNode, offset = -0xFFFFFF, wrapped, restoreSelection; - var tmpRng, rootNodeName, forcedRootBlock; - - forcedRootBlock = settings.forced_root_block; - - if (!node || node.nodeType !== 1 || !forcedRootBlock) { - return; - } - - // Check if node is wrapped in block - while (node && node != rootNode) { - if (blockElements[node.nodeName]) { - return; - } - - node = node.parentNode; - } - - // Get current selection - rng = selection.getRng(); - if (rng.setStart) { - startContainer = rng.startContainer; - startOffset = rng.startOffset; - endContainer = rng.endContainer; - endOffset = rng.endOffset; - - try { - restoreSelection = editor.getDoc().activeElement === rootNode; - } catch (ex) { - // IE throws unspecified error here sometimes - } - } else { - // Force control range into text range - if (rng.item) { - node = rng.item(0); - rng = editor.getDoc().body.createTextRange(); - rng.moveToElementText(node); - } - - restoreSelection = rng.parentElement().ownerDocument === editor.getDoc(); - tmpRng = rng.duplicate(); - tmpRng.collapse(true); - startOffset = tmpRng.move('character', offset) * -1; - - if (!tmpRng.collapsed) { - tmpRng = rng.duplicate(); - tmpRng.collapse(false); - endOffset = (tmpRng.move('character', offset) * -1) - startOffset; - } - } - - // Wrap non block elements and text nodes - node = rootNode.firstChild; - rootNodeName = rootNode.nodeName.toLowerCase(); - while (node) { - // TODO: Break this up, too complex - if (((node.nodeType === 3 || (node.nodeType == 1 && !blockElements[node.nodeName]))) && - schema.isValidChild(rootNodeName, forcedRootBlock.toLowerCase())) { - // Remove empty text nodes - if (node.nodeType === 3 && node.nodeValue.length === 0) { - tempNode = node; - node = node.nextSibling; - dom.remove(tempNode); - continue; - } - - if (!rootBlockNode) { - rootBlockNode = dom.create(forcedRootBlock, editor.settings.forced_root_block_attrs); - node.parentNode.insertBefore(rootBlockNode, node); - wrapped = true; - } - - tempNode = node; - node = node.nextSibling; - rootBlockNode.appendChild(tempNode); - } else { - rootBlockNode = null; - node = node.nextSibling; - } - } - - if (wrapped && restoreSelection) { - if (rng.setStart) { - rng.setStart(startContainer, startOffset); - rng.setEnd(endContainer, endOffset); - selection.setRng(rng); - } else { - // Only select if the previous selection was inside the document to prevent auto focus in quirks mode - try { - rng = editor.getDoc().body.createTextRange(); - rng.moveToElementText(rootNode); - rng.collapse(true); - rng.moveStart('character', startOffset); - - if (endOffset > 0) { - rng.moveEnd('character', endOffset); - } - - rng.select(); - } catch (ex) { - // Ignore - } - } - - editor.nodeChanged(); - } - } - - // Force root blocks - if (settings.forced_root_block) { - editor.on('NodeChange', addRootBlocks); - } - }; -}); - -// Included from: js/tinymce/classes/EditorCommands.js - -/** - * EditorCommands.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class enables you to add custom editor commands and it contains - * overrides for native browser commands to address various bugs and issues. - * - * @class tinymce.EditorCommands - */ -define("tinymce/EditorCommands", [ - "tinymce/html/Serializer", - "tinymce/Env", - "tinymce/util/Tools" -], function(Serializer, Env, Tools) { - // Added for compression purposes - var each = Tools.each, extend = Tools.extend; - var map = Tools.map, inArray = Tools.inArray, explode = Tools.explode; - var isGecko = Env.gecko, isIE = Env.ie; - var TRUE = true, FALSE = false; - - return function(editor) { - var dom = editor.dom, - selection = editor.selection, - commands = {state: {}, exec: {}, value: {}}, - settings = editor.settings, - formatter = editor.formatter, - bookmark; - - /** - * Executes the specified command. - * - * @method execCommand - * @param {String} command Command to execute. - * @param {Boolean} ui Optional user interface state. - * @param {Object} value Optional value for command. - * @return {Boolean} true/false if the command was found or not. - */ - function execCommand(command, ui, value) { - var func; - - command = command.toLowerCase(); - if ((func = commands.exec[command])) { - func(command, ui, value); - return TRUE; - } - - return FALSE; - } - - /** - * Queries the current state for a command for example if the current selection is "bold". - * - * @method queryCommandState - * @param {String} command Command to check the state of. - * @return {Boolean/Number} true/false if the selected contents is bold or not, -1 if it's not found. - */ - function queryCommandState(command) { - var func; - - command = command.toLowerCase(); - if ((func = commands.state[command])) { - return func(command); - } - - return -1; - } - - /** - * Queries the command value for example the current fontsize. - * - * @method queryCommandValue - * @param {String} command Command to check the value of. - * @return {Object} Command value of false if it's not found. - */ - function queryCommandValue(command) { - var func; - - command = command.toLowerCase(); - if ((func = commands.value[command])) { - return func(command); - } - - return FALSE; - } - - /** - * Adds commands to the command collection. - * - * @method addCommands - * @param {Object} command_list Name/value collection with commands to add, the names can also be comma separated. - * @param {String} type Optional type to add, defaults to exec. Can be value or state as well. - */ - function addCommands(command_list, type) { - type = type || 'exec'; - - each(command_list, function(callback, command) { - each(command.toLowerCase().split(','), function(command) { - commands[type][command] = callback; - }); - }); - } - - // Expose public methods - extend(this, { - execCommand: execCommand, - queryCommandState: queryCommandState, - queryCommandValue: queryCommandValue, - addCommands: addCommands - }); - - // Private methods - - function execNativeCommand(command, ui, value) { - if (ui === undefined) { - ui = FALSE; - } - - if (value === undefined) { - value = null; - } - - return editor.getDoc().execCommand(command, ui, value); - } - - function isFormatMatch(name) { - return formatter.match(name); - } - - function toggleFormat(name, value) { - formatter.toggle(name, value ? {value: value} : undefined); - editor.nodeChanged(); - } - - function storeSelection(type) { - bookmark = selection.getBookmark(type); - } - - function restoreSelection() { - selection.moveToBookmark(bookmark); - } - - // Add execCommand overrides - addCommands({ - // Ignore these, added for compatibility - 'mceResetDesignMode,mceBeginUndoLevel': function() {}, - - // Add undo manager logic - 'mceEndUndoLevel,mceAddUndoLevel': function() { - editor.undoManager.add(); - }, - - 'Cut,Copy,Paste': function(command) { - var doc = editor.getDoc(), failed; - - // Try executing the native command - try { - execNativeCommand(command); - } catch (ex) { - // Command failed - failed = TRUE; - } - - // Present alert message about clipboard access not being available - if (failed || !doc.queryCommandSupported(command)) { - var msg = editor.translate( - "Your browser doesn't support direct access to the clipboard. " + - "Please use the Ctrl+X/C/V keyboard shortcuts instead." - ); - - if (Env.mac) { - msg = msg.replace(/Ctrl\+/g, '\u2318+'); - } - - editor.windowManager.alert(msg); - } - }, - - // Override unlink command - unlink: function() { - if (selection.isCollapsed()) { - var elm = selection.getNode(); - if (elm.tagName == 'A') { - editor.dom.remove(elm, true); - } - - return; - } - - formatter.remove("link"); - }, - - // Override justify commands to use the text formatter engine - 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull': function(command) { - var align = command.substring(7); - - if (align == 'full') { - align = 'justify'; - } - - // Remove all other alignments first - each('left,center,right,justify'.split(','), function(name) { - if (align != name) { - formatter.remove('align' + name); - } - }); - - toggleFormat('align' + align); - execCommand('mceRepaint'); - }, - - // Override list commands to fix WebKit bug - 'InsertUnorderedList,InsertOrderedList': function(command) { - var listElm, listParent; - - execNativeCommand(command); - - // WebKit produces lists within block elements so we need to split them - // we will replace the native list creation logic to custom logic later on - // TODO: Remove this when the list creation logic is removed - listElm = dom.getParent(selection.getNode(), 'ol,ul'); - if (listElm) { - listParent = listElm.parentNode; - - // If list is within a text block then split that block - if (/^(H[1-6]|P|ADDRESS|PRE)$/.test(listParent.nodeName)) { - storeSelection(); - dom.split(listParent, listElm); - restoreSelection(); - } - } - }, - - // Override commands to use the text formatter engine - 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function(command) { - toggleFormat(command); - }, - - // Override commands to use the text formatter engine - 'ForeColor,HiliteColor,FontName': function(command, ui, value) { - toggleFormat(command, value); - }, - - FontSize: function(command, ui, value) { - var fontClasses, fontSizes; - - // Convert font size 1-7 to styles - if (value >= 1 && value <= 7) { - fontSizes = explode(settings.font_size_style_values); - fontClasses = explode(settings.font_size_classes); - - if (fontClasses) { - value = fontClasses[value - 1] || value; - } else { - value = fontSizes[value - 1] || value; - } - } - - toggleFormat(command, value); - }, - - RemoveFormat: function(command) { - formatter.remove(command); - }, - - mceBlockQuote: function() { - toggleFormat('blockquote'); - }, - - FormatBlock: function(command, ui, value) { - return toggleFormat(value || 'p'); - }, - - mceCleanup: function() { - var bookmark = selection.getBookmark(); - - editor.setContent(editor.getContent({cleanup: TRUE}), {cleanup: TRUE}); - - selection.moveToBookmark(bookmark); - }, - - mceRemoveNode: function(command, ui, value) { - var node = value || selection.getNode(); - - // Make sure that the body node isn't removed - if (node != editor.getBody()) { - storeSelection(); - editor.dom.remove(node, TRUE); - restoreSelection(); - } - }, - - mceSelectNodeDepth: function(command, ui, value) { - var counter = 0; - - dom.getParent(selection.getNode(), function(node) { - if (node.nodeType == 1 && counter++ == value) { - selection.select(node); - return FALSE; - } - }, editor.getBody()); - }, - - mceSelectNode: function(command, ui, value) { - selection.select(value); - }, - - mceInsertContent: function(command, ui, value) { - var parser, serializer, parentNode, rootNode, fragment, args; - var marker, rng, node, node2, bookmarkHtml; - - function trimOrPaddLeftRight(html) { - var rng, container, offset; - - rng = selection.getRng(true); - container = rng.startContainer; - offset = rng.startOffset; - - function hasSiblingText(siblingName) { - return container[siblingName] && container[siblingName].nodeType == 3; - } - - if (container.nodeType == 3) { - if (offset > 0) { - html = html.replace(/^ /, ' '); - } else if (!hasSiblingText('previousSibling')) { - html = html.replace(/^ /, ' '); - } - - if (offset < container.length) { - html = html.replace(/ (
    |)$/, ' '); - } else if (!hasSiblingText('nextSibling')) { - html = html.replace(/( | )(
    |)$/, ' '); - } - } - - return html; - } - - // Check for whitespace before/after value - if (/^ | $/.test(value)) { - value = trimOrPaddLeftRight(value); - } - - // Setup parser and serializer - parser = editor.parser; - serializer = new Serializer({}, editor.schema); - bookmarkHtml = 'ÈB;'; - - // Run beforeSetContent handlers on the HTML to be inserted - args = {content: value, format: 'html', selection: true}; - editor.fire('BeforeSetContent', args); - value = args.content; - - // Add caret at end of contents if it's missing - if (value.indexOf('{$caret}') == -1) { - value += '{$caret}'; - } - - // Replace the caret marker with a span bookmark element - value = value.replace(/\{\$caret\}/, bookmarkHtml); - - // If selection is at |

    then move it into

    |

    - rng = selection.getRng(); - var caretElement = rng.startContainer || (rng.parentElement ? rng.parentElement() : null); - var body = editor.getBody(); - if (caretElement === body && selection.isCollapsed()) { - if (dom.isBlock(body.firstChild) && dom.isEmpty(body.firstChild)) { - rng = dom.createRng(); - rng.setStart(body.firstChild, 0); - rng.setEnd(body.firstChild, 0); - selection.setRng(rng); - } - } - - // Insert node maker where we will insert the new HTML and get it's parent - if (!selection.isCollapsed()) { - editor.getDoc().execCommand('Delete', false, null); - } - - parentNode = selection.getNode(); - - // Parse the fragment within the context of the parent node - var parserArgs = {context: parentNode.nodeName.toLowerCase()}; - fragment = parser.parse(value, parserArgs); - - // Move the caret to a more suitable location - node = fragment.lastChild; - if (node.attr('id') == 'mce_marker') { - marker = node; - - for (node = node.prev; node; node = node.walk(true)) { - if (node.type == 3 || !dom.isBlock(node.name)) { - node.parent.insert(marker, node, node.name === 'br'); - break; - } - } - } - - // If parser says valid we can insert the contents into that parent - if (!parserArgs.invalid) { - value = serializer.serialize(fragment); - - // Check if parent is empty or only has one BR element then set the innerHTML of that parent - node = parentNode.firstChild; - node2 = parentNode.lastChild; - if (!node || (node === node2 && node.nodeName === 'BR')) { - dom.setHTML(parentNode, value); - } else { - selection.setContent(value); - } - } else { - // If the fragment was invalid within that context then we need - // to parse and process the parent it's inserted into - - // Insert bookmark node and get the parent - selection.setContent(bookmarkHtml); - parentNode = selection.getNode(); - rootNode = editor.getBody(); - - // Opera will return the document node when selection is in root - if (parentNode.nodeType == 9) { - parentNode = node = rootNode; - } else { - node = parentNode; - } - - // Find the ancestor just before the root element - while (node !== rootNode) { - parentNode = node; - node = node.parentNode; - } - - // Get the outer/inner HTML depending on if we are in the root and parser and serialize that - value = parentNode == rootNode ? rootNode.innerHTML : dom.getOuterHTML(parentNode); - value = serializer.serialize( - parser.parse( - // Need to replace by using a function since $ in the contents would otherwise be a problem - value.replace(//i, function() { - return serializer.serialize(fragment); - }) - ) - ); - - // Set the inner/outer HTML depending on if we are in the root or not - if (parentNode == rootNode) { - dom.setHTML(rootNode, value); - } else { - dom.setOuterHTML(parentNode, value); - } - } - - marker = dom.get('mce_marker'); - selection.scrollIntoView(marker); - - // Move selection before marker and remove it - rng = dom.createRng(); - - // If previous sibling is a text node set the selection to the end of that node - node = marker.previousSibling; - if (node && node.nodeType == 3) { - rng.setStart(node, node.nodeValue.length); - - // TODO: Why can't we normalize on IE - if (!isIE) { - node2 = marker.nextSibling; - if (node2 && node2.nodeType == 3) { - node.appendData(node2.data); - node2.parentNode.removeChild(node2); - } - } - } else { - // If the previous sibling isn't a text node or doesn't exist set the selection before the marker node - rng.setStartBefore(marker); - rng.setEndBefore(marker); - } - - // Remove the marker node and set the new range - dom.remove(marker); - selection.setRng(rng); - - // Dispatch after event and add any visual elements needed - editor.fire('SetContent', args); - editor.addVisual(); - }, - - mceInsertRawHTML: function(command, ui, value) { - selection.setContent('tiny_mce_marker'); - editor.setContent( - editor.getContent().replace(/tiny_mce_marker/g, function() { - return value; - }) - ); - }, - - mceToggleFormat: function(command, ui, value) { - toggleFormat(value); - }, - - mceSetContent: function(command, ui, value) { - editor.setContent(value); - }, - - 'Indent,Outdent': function(command) { - var intentValue, indentUnit, value; - - // Setup indent level - intentValue = settings.indentation; - indentUnit = /[a-z%]+$/i.exec(intentValue); - intentValue = parseInt(intentValue, 10); - - if (!queryCommandState('InsertUnorderedList') && !queryCommandState('InsertOrderedList')) { - // If forced_root_blocks is set to false we don't have a block to indent so lets create a div - if (!settings.forced_root_block && !dom.getParent(selection.getNode(), dom.isBlock)) { - formatter.apply('div'); - } - - each(selection.getSelectedBlocks(), function(element) { - if (element.nodeName != "LI") { - var indentStyleName = editor.getParam('indent_use_margin', false) ? 'margin' : 'padding'; - - indentStyleName += dom.getStyle(element, 'direction', true) == 'rtl' ? 'Right' : 'Left'; - - if (command == 'outdent') { - value = Math.max(0, parseInt(element.style[indentStyleName] || 0, 10) - intentValue); - dom.setStyle(element, indentStyleName, value ? value + indentUnit : ''); - } else { - value = (parseInt(element.style[indentStyleName] || 0, 10) + intentValue) + indentUnit; - dom.setStyle(element, indentStyleName, value); - } - } - }); - } else { - execNativeCommand(command); - } - }, - - mceRepaint: function() { - if (isGecko) { - try { - storeSelection(TRUE); - - if (selection.getSel()) { - selection.getSel().selectAllChildren(editor.getBody()); - } - - selection.collapse(TRUE); - restoreSelection(); - } catch (ex) { - // Ignore - } - } - }, - - InsertHorizontalRule: function() { - editor.execCommand('mceInsertContent', false, '
    '); - }, - - mceToggleVisualAid: function() { - editor.hasVisual = !editor.hasVisual; - editor.addVisual(); - }, - - mceReplaceContent: function(command, ui, value) { - editor.execCommand('mceInsertContent', false, value.replace(/\{\$selection\}/g, selection.getContent({format: 'text'}))); - }, - - mceInsertLink: function(command, ui, value) { - var anchor; - - if (typeof(value) == 'string') { - value = {href: value}; - } - - anchor = dom.getParent(selection.getNode(), 'a'); - - // Spaces are never valid in URLs and it's a very common mistake for people to make so we fix it here. - value.href = value.href.replace(' ', '%20'); - - // Remove existing links if there could be child links or that the href isn't specified - if (!anchor || !value.href) { - formatter.remove('link'); - } - - // Apply new link to selection - if (value.href) { - formatter.apply('link', value, anchor); - } - }, - - selectAll: function() { - var root = dom.getRoot(), rng; - - if (selection.getRng().setStart) { - rng = dom.createRng(); - rng.setStart(root, 0); - rng.setEnd(root, root.childNodes.length); - selection.setRng(rng); - } else { - // IE will render it's own root level block elements and sometimes - // even put font elements in them when the user starts typing. So we need to - // move the selection to a more suitable element from this: - // |

    to this:

    |

    - rng = selection.getRng(); - if (!rng.item) { - rng.moveToElementText(root); - rng.select(); - } - } - }, - - "delete": function() { - execNativeCommand("Delete"); - - // Check if body is empty after the delete call if so then set the contents - // to an empty string and move the caret to any block produced by that operation - // this fixes the issue with root blocks not being properly produced after a delete call on IE - var body = editor.getBody(); - - if (dom.isEmpty(body)) { - editor.setContent(''); - - if (body.firstChild && dom.isBlock(body.firstChild)) { - editor.selection.setCursorLocation(body.firstChild, 0); - } else { - editor.selection.setCursorLocation(body, 0); - } - } - }, - - mceNewDocument: function() { - editor.setContent(''); - } - }); - - // Add queryCommandState overrides - addCommands({ - // Override justify commands - 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull': function(command) { - var name = 'align' + command.substring(7); - var nodes = selection.isCollapsed() ? [dom.getParent(selection.getNode(), dom.isBlock)] : selection.getSelectedBlocks(); - var matches = map(nodes, function(node) { - return !!formatter.matchNode(node, name); - }); - return inArray(matches, TRUE) !== -1; - }, - - 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function(command) { - return isFormatMatch(command); - }, - - mceBlockQuote: function() { - return isFormatMatch('blockquote'); - }, - - Outdent: function() { - var node; - - if (settings.inline_styles) { - if ((node = dom.getParent(selection.getStart(), dom.isBlock)) && parseInt(node.style.paddingLeft, 10) > 0) { - return TRUE; - } - - if ((node = dom.getParent(selection.getEnd(), dom.isBlock)) && parseInt(node.style.paddingLeft, 10) > 0) { - return TRUE; - } - } - - return ( - queryCommandState('InsertUnorderedList') || - queryCommandState('InsertOrderedList') || - (!settings.inline_styles && !!dom.getParent(selection.getNode(), 'BLOCKQUOTE')) - ); - }, - - 'InsertUnorderedList,InsertOrderedList': function(command) { - var list = dom.getParent(selection.getNode(), 'ul,ol'); - - return list && - ( - command === 'insertunorderedlist' && list.tagName === 'UL' || - command === 'insertorderedlist' && list.tagName === 'OL' - ); - } - }, 'state'); - - // Add queryCommandValue overrides - addCommands({ - 'FontSize,FontName': function(command) { - var value = 0, parent; - - if ((parent = dom.getParent(selection.getNode(), 'span'))) { - if (command == 'fontsize') { - value = parent.style.fontSize; - } else { - value = parent.style.fontFamily.replace(/, /g, ',').replace(/[\'\"]/g, '').toLowerCase(); - } - } - - return value; - } - }, 'value'); - - // Add undo manager logic - addCommands({ - Undo: function() { - editor.undoManager.undo(); - }, - - Redo: function() { - editor.undoManager.redo(); - } - }); - }; -}); - -// Included from: js/tinymce/classes/util/URI.js - -/** - * URI.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class handles parsing, modification and serialization of URI/URL strings. - * @class tinymce.util.URI - */ -define("tinymce/util/URI", [ - "tinymce/util/Tools" -], function(Tools) { - var each = Tools.each, trim = Tools.trim; - - /** - * Constructs a new URI instance. - * - * @constructor - * @method URI - * @param {String} url URI string to parse. - * @param {Object} settings Optional settings object. - */ - function URI(url, settings) { - var self = this, baseUri, base_url; - - // Trim whitespace - url = trim(url); - - // Default settings - settings = self.settings = settings || {}; - - // Strange app protocol that isn't http/https or local anchor - // For example: mailto,skype,tel etc. - if (/^([\w\-]+):([^\/]{2})/i.test(url) || /^\s*#/.test(url)) { - self.source = url; - return; - } - - var isProtocolRelative = url.indexOf('//') === 0; - - // Absolute path with no host, fake host and protocol - if (url.indexOf('/') === 0 && !isProtocolRelative) { - url = (settings.base_uri ? settings.base_uri.protocol || 'http' : 'http') + '://mce_host' + url; - } - - // Relative path http:// or protocol relative //path - if (!/^[\w\-]*:?\/\//.test(url)) { - base_url = settings.base_uri ? settings.base_uri.path : new URI(location.href).directory; - if (settings.base_uri.protocol === "") { - url = '//mce_host' + self.toAbsPath(base_url, url); - } else { - url = ((settings.base_uri && settings.base_uri.protocol) || 'http') + '://mce_host' + self.toAbsPath(base_url, url); - } - } - - // Parse URL (Credits goes to Steave, http://blog.stevenlevithan.com/archives/parseuri) - url = url.replace(/@@/g, '(mce_at)'); // Zope 3 workaround, they use @@something - - /*jshint maxlen: 255 */ - /*eslint max-len: 0 */ - url = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(url); - - each(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"], function(v, i) { - var part = url[i]; - - // Zope 3 workaround, they use @@something - if (part) { - part = part.replace(/\(mce_at\)/g, '@@'); - } - - self[v] = part; - }); - - baseUri = settings.base_uri; - if (baseUri) { - if (!self.protocol) { - self.protocol = baseUri.protocol; - } - - if (!self.userInfo) { - self.userInfo = baseUri.userInfo; - } - - if (!self.port && self.host === 'mce_host') { - self.port = baseUri.port; - } - - if (!self.host || self.host === 'mce_host') { - self.host = baseUri.host; - } - - self.source = ''; - } - - if (isProtocolRelative) { - self.protocol = ''; - } - - //t.path = t.path || '/'; - } - - URI.prototype = { - /** - * Sets the internal path part of the URI. - * - * @method setPath - * @param {string} path Path string to set. - */ - setPath: function(path) { - var self = this; - - path = /^(.*?)\/?(\w+)?$/.exec(path); - - // Update path parts - self.path = path[0]; - self.directory = path[1]; - self.file = path[2]; - - // Rebuild source - self.source = ''; - self.getURI(); - }, - - /** - * Converts the specified URI into a relative URI based on the current URI instance location. - * - * @method toRelative - * @param {String} uri URI to convert into a relative path/URI. - * @return {String} Relative URI from the point specified in the current URI instance. - * @example - * // Converts an absolute URL to an relative URL url will be somedir/somefile.htm - * var url = new tinymce.util.URI('http://www.site.com/dir/').toRelative('http://www.site.com/dir/somedir/somefile.htm'); - */ - toRelative: function(uri) { - var self = this, output; - - if (uri === "./") { - return uri; - } - - uri = new URI(uri, {base_uri: self}); - - // Not on same domain/port or protocol - if ((uri.host != 'mce_host' && self.host != uri.host && uri.host) || self.port != uri.port || - (self.protocol != uri.protocol && uri.protocol !== "")) { - return uri.getURI(); - } - - var tu = self.getURI(), uu = uri.getURI(); - - // Allow usage of the base_uri when relative_urls = true - if (tu == uu || (tu.charAt(tu.length - 1) == "/" && tu.substr(0, tu.length - 1) == uu)) { - return tu; - } - - output = self.toRelPath(self.path, uri.path); - - // Add query - if (uri.query) { - output += '?' + uri.query; - } - - // Add anchor - if (uri.anchor) { - output += '#' + uri.anchor; - } - - return output; - }, - - /** - * Converts the specified URI into a absolute URI based on the current URI instance location. - * - * @method toAbsolute - * @param {String} uri URI to convert into a relative path/URI. - * @param {Boolean} noHost No host and protocol prefix. - * @return {String} Absolute URI from the point specified in the current URI instance. - * @example - * // Converts an relative URL to an absolute URL url will be http://www.site.com/dir/somedir/somefile.htm - * var url = new tinymce.util.URI('http://www.site.com/dir/').toAbsolute('somedir/somefile.htm'); - */ - toAbsolute: function(uri, noHost) { - uri = new URI(uri, {base_uri: this}); - - return uri.getURI(this.host == uri.host && this.protocol == uri.protocol ? noHost : 0); - }, - - /** - * Converts a absolute path into a relative path. - * - * @method toRelPath - * @param {String} base Base point to convert the path from. - * @param {String} path Absolute path to convert into a relative path. - */ - toRelPath: function(base, path) { - var items, breakPoint = 0, out = '', i, l; - - // Split the paths - base = base.substring(0, base.lastIndexOf('/')); - base = base.split('/'); - items = path.split('/'); - - if (base.length >= items.length) { - for (i = 0, l = base.length; i < l; i++) { - if (i >= items.length || base[i] != items[i]) { - breakPoint = i + 1; - break; - } - } - } - - if (base.length < items.length) { - for (i = 0, l = items.length; i < l; i++) { - if (i >= base.length || base[i] != items[i]) { - breakPoint = i + 1; - break; - } - } - } - - if (breakPoint === 1) { - return path; - } - - for (i = 0, l = base.length - (breakPoint - 1); i < l; i++) { - out += "../"; - } - - for (i = breakPoint - 1, l = items.length; i < l; i++) { - if (i != breakPoint - 1) { - out += "/" + items[i]; - } else { - out += items[i]; - } - } - - return out; - }, - - /** - * Converts a relative path into a absolute path. - * - * @method toAbsPath - * @param {String} base Base point to convert the path from. - * @param {String} path Relative path to convert into an absolute path. - */ - toAbsPath: function(base, path) { - var i, nb = 0, o = [], tr, outPath; - - // Split paths - tr = /\/$/.test(path) ? '/' : ''; - base = base.split('/'); - path = path.split('/'); - - // Remove empty chunks - each(base, function(k) { - if (k) { - o.push(k); - } - }); - - base = o; - - // Merge relURLParts chunks - for (i = path.length - 1, o = []; i >= 0; i--) { - // Ignore empty or . - if (path[i].length === 0 || path[i] === ".") { - continue; - } - - // Is parent - if (path[i] === '..') { - nb++; - continue; - } - - // Move up - if (nb > 0) { - nb--; - continue; - } - - o.push(path[i]); - } - - i = base.length - nb; - - // If /a/b/c or / - if (i <= 0) { - outPath = o.reverse().join('/'); - } else { - outPath = base.slice(0, i).join('/') + '/' + o.reverse().join('/'); - } - - // Add front / if it's needed - if (outPath.indexOf('/') !== 0) { - outPath = '/' + outPath; - } - - // Add traling / if it's needed - if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) { - outPath += tr; - } - - return outPath; - }, - - /** - * Returns the full URI of the internal structure. - * - * @method getURI - * @param {Boolean} noProtoHost Optional no host and protocol part. Defaults to false. - */ - getURI: function(noProtoHost) { - var s, self = this; - - // Rebuild source - if (!self.source || noProtoHost) { - s = ''; - - if (!noProtoHost) { - if (self.protocol) { - s += self.protocol + '://'; - } else { - s += '//'; - } - - if (self.userInfo) { - s += self.userInfo + '@'; - } - - if (self.host) { - s += self.host; - } - - if (self.port) { - s += ':' + self.port; - } - } - - if (self.path) { - s += self.path; - } - - if (self.query) { - s += '?' + self.query; - } - - if (self.anchor) { - s += '#' + self.anchor; - } - - self.source = s; - } - - return self.source; - } - }; - - return URI; -}); - -// Included from: js/tinymce/classes/util/Class.js - -/** - * Class.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * This utilitiy class is used for easier inheritage. - * - * Features: - * * Exposed super functions: this._super(); - * * Mixins - * * Dummy functions - * * Property functions: var value = object.value(); and object.value(newValue); - * * Static functions - * * Defaults settings - */ -define("tinymce/util/Class", [ - "tinymce/util/Tools" -], function(Tools) { - var each = Tools.each, extend = Tools.extend; - - var extendClass, initializing; - - function Class() { - } - - // Provides classical inheritance, based on code made by John Resig - Class.extend = extendClass = function(prop) { - var self = this, _super = self.prototype, prototype, name, member; - - // The dummy class constructor - function Class() { - var i, mixins, mixin, self = this; - - // All construction is actually done in the init method - if (!initializing) { - // Run class constuctor - if (self.init) { - self.init.apply(self, arguments); - } - - // Run mixin constructors - mixins = self.Mixins; - if (mixins) { - i = mixins.length; - while (i--) { - mixin = mixins[i]; - if (mixin.init) { - mixin.init.apply(self, arguments); - } - } - } - } - } - - // Dummy function, needs to be extended in order to provide functionality - function dummy() { - return this; - } - - // Creates a overloaded method for the class - // this enables you to use this._super(); to call the super function - function createMethod(name, fn) { - return function(){ - var self = this, tmp = self._super, ret; - - self._super = _super[name]; - ret = fn.apply(self, arguments); - self._super = tmp; - - return ret; - }; - } - - // Instantiate a base class (but only create the instance, - // don't run the init constructor) - initializing = true; - prototype = new self(); - initializing = false; - - // Add mixins - if (prop.Mixins) { - each(prop.Mixins, function(mixin) { - mixin = mixin; - - for (var name in mixin) { - if (name !== "init") { - prop[name] = mixin[name]; - } - } - }); - - if (_super.Mixins) { - prop.Mixins = _super.Mixins.concat(prop.Mixins); - } - } - - // Generate dummy methods - if (prop.Methods) { - each(prop.Methods.split(','), function(name) { - prop[name] = dummy; - }); - } - - // Generate property methods - if (prop.Properties) { - each(prop.Properties.split(','), function(name) { - var fieldName = '_' + name; - - prop[name] = function(value) { - var self = this, undef; - - // Set value - if (value !== undef) { - self[fieldName] = value; - - return self; - } - - // Get value - return self[fieldName]; - }; - }); - } - - // Static functions - if (prop.Statics) { - each(prop.Statics, function(func, name) { - Class[name] = func; - }); - } - - // Default settings - if (prop.Defaults && _super.Defaults) { - prop.Defaults = extend({}, _super.Defaults, prop.Defaults); - } - - // Copy the properties over onto the new prototype - for (name in prop) { - member = prop[name]; - - if (typeof member == "function" && _super[name]) { - prototype[name] = createMethod(name, member); - } else { - prototype[name] = member; - } - } - - // Populate our constructed prototype object - Class.prototype = prototype; - - // Enforce the constructor to be what we expect - Class.constructor = Class; - - // And make this class extendible - Class.extend = extendClass; - - return Class; - }; - - return Class; -}); - -// Included from: js/tinymce/classes/ui/Selector.js - -/** - * Selector.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*eslint no-nested-ternary:0 */ - -/** - * Selector engine, enables you to select controls by using CSS like expressions. - * We currently only support basic CSS expressions to reduce the size of the core - * and the ones we support should be enough for most cases. - * - * @example - * Supported expressions: - * element - * element#name - * element.class - * element[attr] - * element[attr*=value] - * element[attr~=value] - * element[attr!=value] - * element[attr^=value] - * element[attr$=value] - * element: - * element:not() - * element:first - * element:last - * element:odd - * element:even - * element element - * element > element - * - * @class tinymce.ui.Selector - */ -define("tinymce/ui/Selector", [ - "tinymce/util/Class" -], function(Class) { - "use strict"; - - /** - * Produces an array with a unique set of objects. It will not compare the values - * but the references of the objects. - * - * @private - * @method unqiue - * @param {Array} array Array to make into an array with unique items. - * @return {Array} Array with unique items. - */ - function unique(array) { - var uniqueItems = [], i = array.length, item; - - while (i--) { - item = array[i]; - - if (!item.__checked) { - uniqueItems.push(item); - item.__checked = 1; - } - } - - i = uniqueItems.length; - while (i--) { - delete uniqueItems[i].__checked; - } - - return uniqueItems; - } - - var expression = /^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i; - - /*jshint maxlen:255 */ - /*eslint max-len:0 */ - var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, - whiteSpace = /^\s*|\s*$/g, - Collection; - - var Selector = Class.extend({ - /** - * Constructs a new Selector instance. - * - * @constructor - * @method init - * @param {String} selector CSS like selector expression. - */ - init: function(selector) { - var match = this.match; - - function compileNameFilter(name) { - if (name) { - name = name.toLowerCase(); - - return function(item) { - return name === '*' || item.type === name; - }; - } - } - - function compileIdFilter(id) { - if (id) { - return function(item) { - return item._name === id; - }; - } - } - - function compileClassesFilter(classes) { - if (classes) { - classes = classes.split('.'); - - return function(item) { - var i = classes.length; - - while (i--) { - if (!item.hasClass(classes[i])) { - return false; - } - } - - return true; - }; - } - } - - function compileAttrFilter(name, cmp, check) { - if (name) { - return function(item) { - var value = item[name] ? item[name]() : ''; - - return !cmp ? !!check : - cmp === "=" ? value === check : - cmp === "*=" ? value.indexOf(check) >= 0 : - cmp === "~=" ? (" " + value + " ").indexOf(" " + check + " ") >= 0 : - cmp === "!=" ? value != check : - cmp === "^=" ? value.indexOf(check) === 0 : - cmp === "$=" ? value.substr(value.length - check.length) === check : - false; - }; - } - } - - function compilePsuedoFilter(name) { - var notSelectors; - - if (name) { - name = /(?:not\((.+)\))|(.+)/i.exec(name); - - if (!name[1]) { - name = name[2]; - - return function(item, index, length) { - return name === 'first' ? index === 0 : - name === 'last' ? index === length - 1 : - name === 'even' ? index % 2 === 0 : - name === 'odd' ? index % 2 === 1 : - item[name] ? item[name]() : - false; - }; - } else { - // Compile not expression - notSelectors = parseChunks(name[1], []); - - return function(item) { - return !match(item, notSelectors); - }; - } - } - } - - function compile(selector, filters, direct) { - var parts; - - function add(filter) { - if (filter) { - filters.push(filter); - } - } - - // Parse expression into parts - parts = expression.exec(selector.replace(whiteSpace, '')); - - add(compileNameFilter(parts[1])); - add(compileIdFilter(parts[2])); - add(compileClassesFilter(parts[3])); - add(compileAttrFilter(parts[4], parts[5], parts[6])); - add(compilePsuedoFilter(parts[7])); - - // Mark the filter with psuedo for performance - filters.psuedo = !!parts[7]; - filters.direct = direct; - - return filters; - } - - // Parser logic based on Sizzle by John Resig - function parseChunks(selector, selectors) { - var parts = [], extra, matches, i; - - do { - chunker.exec(""); - matches = chunker.exec(selector); - - if (matches) { - selector = matches[3]; - parts.push(matches[1]); - - if (matches[2]) { - extra = matches[3]; - break; - } - } - } while (matches); - - if (extra) { - parseChunks(extra, selectors); - } - - selector = []; - for (i = 0; i < parts.length; i++) { - if (parts[i] != '>') { - selector.push(compile(parts[i], [], parts[i - 1] === '>')); - } - } - - selectors.push(selector); - - return selectors; - } - - this._selectors = parseChunks(selector, []); - }, - - /** - * Returns true/false if the selector matches the specified control. - * - * @method match - * @param {tinymce.ui.Control} control Control to match agains the selector. - * @param {Array} selectors Optional array of selectors, mostly used internally. - * @return {Boolean} true/false state if the control matches or not. - */ - match: function(control, selectors) { - var i, l, si, sl, selector, fi, fl, filters, index, length, siblings, count, item; - - selectors = selectors || this._selectors; - for (i = 0, l = selectors.length; i < l; i++) { - selector = selectors[i]; - sl = selector.length; - item = control; - count = 0; - - for (si = sl - 1; si >= 0; si--) { - filters = selector[si]; - - while (item) { - // Find the index and length since a psuedo filter like :first needs it - if (filters.psuedo) { - siblings = item.parent().items(); - index = length = siblings.length; - while (index--) { - if (siblings[index] === item) { - break; - } - } - } - - for (fi = 0, fl = filters.length; fi < fl; fi++) { - if (!filters[fi](item, index, length)) { - fi = fl + 1; - break; - } - } - - if (fi === fl) { - count++; - break; - } else { - // If it didn't match the right most expression then - // break since it's no point looking at the parents - if (si === sl - 1) { - break; - } - } - - item = item.parent(); - } - } - - // If we found all selectors then return true otherwise continue looking - if (count === sl) { - return true; - } - } - - return false; - }, - - /** - * Returns a tinymce.ui.Collection with matches of the specified selector inside the specified container. - * - * @method find - * @param {tinymce.ui.Control} container Container to look for items in. - * @return {tinymce.ui.Collection} Collection with matched elements. - */ - find: function(container) { - var matches = [], i, l, selectors = this._selectors; - - function collect(items, selector, index) { - var i, l, fi, fl, item, filters = selector[index]; - - for (i = 0, l = items.length; i < l; i++) { - item = items[i]; - - // Run each filter agains the item - for (fi = 0, fl = filters.length; fi < fl; fi++) { - if (!filters[fi](item, i, l)) { - fi = fl + 1; - break; - } - } - - // All filters matched the item - if (fi === fl) { - // Matched item is on the last expression like: panel toolbar [button] - if (index == selector.length - 1) { - matches.push(item); - } else { - // Collect next expression type - if (item.items) { - collect(item.items(), selector, index + 1); - } - } - } else if (filters.direct) { - return; - } - - // Collect child items - if (item.items) { - collect(item.items(), selector, index); - } - } - } - - if (container.items) { - for (i = 0, l = selectors.length; i < l; i++) { - collect(container.items(), selectors[i], 0); - } - - // Unique the matches if needed - if (l > 1) { - matches = unique(matches); - } - } - - // Fix for circular reference - if (!Collection) { - // TODO: Fix me! - Collection = Selector.Collection; - } - - return new Collection(matches); - } - }); - - return Selector; -}); - -// Included from: js/tinymce/classes/ui/Collection.js - -/** - * Collection.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Control collection, this class contains control instances and it enables you to - * perform actions on all the contained items. This is very similar to how jQuery works. - * - * @example - * someCollection.show().disabled(true); - * - * @class tinymce.ui.Collection - */ -define("tinymce/ui/Collection", [ - "tinymce/util/Tools", - "tinymce/ui/Selector", - "tinymce/util/Class" -], function(Tools, Selector, Class) { - "use strict"; - - var Collection, proto, push = Array.prototype.push, slice = Array.prototype.slice; - - proto = { - /** - * Current number of contained control instances. - * - * @field length - * @type Number - */ - length: 0, - - /** - * Constructor for the collection. - * - * @constructor - * @method init - * @param {Array} items Optional array with items to add. - */ - init: function(items) { - if (items) { - this.add(items); - } - }, - - /** - * Adds new items to the control collection. - * - * @method add - * @param {Array} items Array if items to add to collection. - * @return {tinymce.ui.Collection} Current collection instance. - */ - add: function(items) { - var self = this; - - // Force single item into array - if (!Tools.isArray(items)) { - if (items instanceof Collection) { - self.add(items.toArray()); - } else { - push.call(self, items); - } - } else { - push.apply(self, items); - } - - return self; - }, - - /** - * Sets the contents of the collection. This will remove any existing items - * and replace them with the ones specified in the input array. - * - * @method set - * @param {Array} items Array with items to set into the Collection. - * @return {tinymce.ui.Collection} Collection instance. - */ - set: function(items) { - var self = this, len = self.length, i; - - self.length = 0; - self.add(items); - - // Remove old entries - for (i = self.length; i < len; i++) { - delete self[i]; - } - - return self; - }, - - /** - * Filters the collection item based on the specified selector expression or selector function. - * - * @method filter - * @param {String} selector Selector expression to filter items by. - * @return {tinymce.ui.Collection} Collection containing the filtered items. - */ - filter: function(selector) { - var self = this, i, l, matches = [], item, match; - - // Compile string into selector expression - if (typeof(selector) === "string") { - selector = new Selector(selector); - - match = function(item) { - return selector.match(item); - }; - } else { - // Use selector as matching function - match = selector; - } - - for (i = 0, l = self.length; i < l; i++) { - item = self[i]; - - if (match(item)) { - matches.push(item); - } - } - - return new Collection(matches); - }, - - /** - * Slices the items within the collection. - * - * @method slice - * @param {Number} index Index to slice at. - * @param {Number} len Optional length to slice. - * @return {tinymce.ui.Collection} Current collection. - */ - slice: function() { - return new Collection(slice.apply(this, arguments)); - }, - - /** - * Makes the current collection equal to the specified index. - * - * @method eq - * @param {Number} index Index of the item to set the collection to. - * @return {tinymce.ui.Collection} Current collection. - */ - eq: function(index) { - return index === -1 ? this.slice(index) : this.slice(index, +index + 1); - }, - - /** - * Executes the specified callback on each item in collection. - * - * @method each - * @param {function} callback Callback to execute for each item in collection. - * @return {tinymce.ui.Collection} Current collection instance. - */ - each: function(callback) { - Tools.each(this, callback); - - return this; - }, - - /** - * Returns an JavaScript array object of the contents inside the collection. - * - * @method toArray - * @return {Array} Array with all items from collection. - */ - toArray: function() { - return Tools.toArray(this); - }, - - /** - * Finds the index of the specified control or return -1 if it isn't in the collection. - * - * @method indexOf - * @param {Control} ctrl Control instance to look for. - * @return {Number} Index of the specified control or -1. - */ - indexOf: function(ctrl) { - var self = this, i = self.length; - - while (i--) { - if (self[i] === ctrl) { - break; - } - } - - return i; - }, - - /** - * Returns a new collection of the contents in reverse order. - * - * @method reverse - * @return {tinymce.ui.Collection} Collection instance with reversed items. - */ - reverse: function() { - return new Collection(Tools.toArray(this).reverse()); - }, - - /** - * Returns true/false if the class exists or not. - * - * @method hasClass - * @param {String} cls Class to check for. - * @return {Boolean} true/false state if the class exists or not. - */ - hasClass: function(cls) { - return this[0] ? this[0].hasClass(cls) : false; - }, - - /** - * Sets/gets the specific property on the items in the collection. The same as executing control.(); - * - * @method prop - * @param {String} name Property name to get/set. - * @param {Object} value Optional object value to set. - * @return {tinymce.ui.Collection} Current collection instance or value of the first item on a get operation. - */ - prop: function(name, value) { - var self = this, undef, item; - - if (value !== undef) { - self.each(function(item) { - if (item[name]) { - item[name](value); - } - }); - - return self; - } - - item = self[0]; - - if (item && item[name]) { - return item[name](); - } - }, - - /** - * Executes the specific function name with optional arguments an all items in collection if it exists. - * - * @example collection.exec("myMethod", arg1, arg2, arg3); - * @method exec - * @param {String} name Name of the function to execute. - * @param {Object} ... Multiple arguments to pass to each function. - * @return {tinymce.ui.Collection} Current collection. - */ - exec: function(name) { - var self = this, args = Tools.toArray(arguments).slice(1); - - self.each(function(item) { - if (item[name]) { - item[name].apply(item, args); - } - }); - - return self; - }, - - /** - * Remove all items from collection and DOM. - * - * @method remove - * @return {tinymce.ui.Collection} Current collection. - */ - remove: function() { - var i = this.length; - - while (i--) { - this[i].remove(); - } - - return this; - } - - /** - * Fires the specified event by name and arguments on the control. This will execute all - * bound event handlers. - * - * @method fire - * @param {String} name Name of the event to fire. - * @param {Object} args Optional arguments to pass to the event. - * @return {tinymce.ui.Collection} Current collection instance. - */ - // fire: function(event, args) {}, -- Generated by code below - - /** - * Binds a callback to the specified event. This event can both be - * native browser events like "click" or custom ones like PostRender. - * - * The callback function will have two parameters the first one being the control that received the event - * the second one will be the event object either the browsers native event object or a custom JS object. - * - * @method on - * @param {String} name Name of the event to bind. For example "click". - * @param {String/function} callback Callback function to execute ones the event occurs. - * @return {tinymce.ui.Collection} Current collection instance. - */ - // on: function(name, callback) {}, -- Generated by code below - - /** - * Unbinds the specified event and optionally a specific callback. If you omit the name - * parameter all event handlers will be removed. If you omit the callback all event handles - * by the specified name will be removed. - * - * @method off - * @param {String} name Optional name for the event to unbind. - * @param {function} callback Optional callback function to unbind. - * @return {tinymce.ui.Collection} Current collection instance. - */ - // off: function(name, callback) {}, -- Generated by code below - - /** - * Shows the items in the current collection. - * - * @method show - * @return {tinymce.ui.Collection} Current collection instance. - */ - // show: function() {}, -- Generated by code below - - /** - * Hides the items in the current collection. - * - * @method hide - * @return {tinymce.ui.Collection} Current collection instance. - */ - // hide: function() {}, -- Generated by code below - - /** - * Sets/gets the text contents of the items in the current collection. - * - * @method text - * @return {tinymce.ui.Collection} Current collection instance or text value of the first item on a get operation. - */ - // text: function(value) {}, -- Generated by code below - - /** - * Sets/gets the name contents of the items in the current collection. - * - * @method name - * @return {tinymce.ui.Collection} Current collection instance or name value of the first item on a get operation. - */ - // name: function(value) {}, -- Generated by code below - - /** - * Sets/gets the disabled state on the items in the current collection. - * - * @method disabled - * @return {tinymce.ui.Collection} Current collection instance or disabled state of the first item on a get operation. - */ - // disabled: function(state) {}, -- Generated by code below - - /** - * Sets/gets the active state on the items in the current collection. - * - * @method active - * @return {tinymce.ui.Collection} Current collection instance or active state of the first item on a get operation. - */ - // active: function(state) {}, -- Generated by code below - - /** - * Sets/gets the selected state on the items in the current collection. - * - * @method selected - * @return {tinymce.ui.Collection} Current collection instance or selected state of the first item on a get operation. - */ - // selected: function(state) {}, -- Generated by code below - - /** - * Sets/gets the selected state on the items in the current collection. - * - * @method visible - * @return {tinymce.ui.Collection} Current collection instance or visible state of the first item on a get operation. - */ - // visible: function(state) {}, -- Generated by code below - - /** - * Adds a class to all items in the collection. - * - * @method addClass - * @param {String} cls Class to add to each item. - * @return {tinymce.ui.Collection} Current collection instance. - */ - // addClass: function(cls) {}, -- Generated by code below - - /** - * Removes the specified class from all items in collection. - * - * @method removeClass - * @param {String} cls Class to remove from each item. - * @return {tinymce.ui.Collection} Current collection instance. - */ - // removeClass: function(cls) {}, -- Generated by code below - }; - - // Extend tinymce.ui.Collection prototype with some generated control specific methods - Tools.each('fire on off show hide addClass removeClass append prepend before after reflow'.split(' '), function(name) { - proto[name] = function() { - var args = Tools.toArray(arguments); - - this.each(function(ctrl) { - if (name in ctrl) { - ctrl[name].apply(ctrl, args); - } - }); - - return this; - }; - }); - - // Extend tinymce.ui.Collection prototype with some property methods - Tools.each('text name disabled active selected checked visible parent value data'.split(' '), function(name) { - proto[name] = function(value) { - return this.prop(name, value); - }; - }); - - // Create class based on the new prototype - Collection = Class.extend(proto); - - // Stick Collection into Selector to prevent circual references - Selector.Collection = Collection; - - return Collection; -}); - -// Included from: js/tinymce/classes/ui/DomUtils.js - -/** - * DOMUtils.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("tinymce/ui/DomUtils", [ - "tinymce/util/Tools", - "tinymce/dom/DOMUtils" -], function(Tools, DOMUtils) { - "use strict"; - - return { - id: function() { - return DOMUtils.DOM.uniqueId(); - }, - - createFragment: function(html) { - return DOMUtils.DOM.createFragment(html); - }, - - getWindowSize: function() { - return DOMUtils.DOM.getViewPort(); - }, - - getSize: function(elm) { - var width, height; - - if (elm.getBoundingClientRect) { - var rect = elm.getBoundingClientRect(); - - width = Math.max(rect.width || (rect.right - rect.left), elm.offsetWidth); - height = Math.max(rect.height || (rect.bottom - rect.bottom), elm.offsetHeight); - } else { - width = elm.offsetWidth; - height = elm.offsetHeight; - } - - return {width: width, height: height}; - }, - - getPos: function(elm, root) { - return DOMUtils.DOM.getPos(elm, root); - }, - - getViewPort: function(win) { - return DOMUtils.DOM.getViewPort(win); - }, - - get: function(id) { - return document.getElementById(id); - }, - - addClass : function(elm, cls) { - return DOMUtils.DOM.addClass(elm, cls); - }, - - removeClass : function(elm, cls) { - return DOMUtils.DOM.removeClass(elm, cls); - }, - - hasClass : function(elm, cls) { - return DOMUtils.DOM.hasClass(elm, cls); - }, - - toggleClass: function(elm, cls, state) { - return DOMUtils.DOM.toggleClass(elm, cls, state); - }, - - css: function(elm, name, value) { - return DOMUtils.DOM.setStyle(elm, name, value); - }, - - on: function(target, name, callback, scope) { - return DOMUtils.DOM.bind(target, name, callback, scope); - }, - - off: function(target, name, callback) { - return DOMUtils.DOM.unbind(target, name, callback); - }, - - fire: function(target, name, args) { - return DOMUtils.DOM.fire(target, name, args); - }, - - innerHtml: function(elm, html) { - // Workaround for
    in

    bug on IE 8 #6178 - DOMUtils.DOM.setHTML(elm, html); - } - }; -}); - -// Included from: js/tinymce/classes/ui/Control.js - -/** - * Control.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*eslint consistent-this:0 */ - -/** - * This is the base class for all controls and containers. All UI control instances inherit - * from this one as it has the base logic needed by all of them. - * - * @class tinymce.ui.Control - */ -define("tinymce/ui/Control", [ - "tinymce/util/Class", - "tinymce/util/Tools", - "tinymce/ui/Collection", - "tinymce/ui/DomUtils" -], function(Class, Tools, Collection, DomUtils) { - "use strict"; - - var nativeEvents = Tools.makeMap("focusin focusout scroll click dblclick mousedown mouseup mousemove mouseover" + - " mouseout mouseenter mouseleave wheel keydown keypress keyup contextmenu", " "); - - var elementIdCache = {}; - var hasMouseWheelEventSupport = "onmousewheel" in document; - var hasWheelEventSupport = false; - - var Control = Class.extend({ - Statics: { - elementIdCache: elementIdCache - }, - - isRtl: function() { - return Control.rtl; - }, - - /** - * Class/id prefix to use for all controls. - * - * @final - * @field {String} classPrefix - */ - classPrefix: "mce-", - - /** - * Constructs a new control instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - * @setting {String} style Style CSS properties to add. - * @setting {String} border Border box values example: 1 1 1 1 - * @setting {String} padding Padding box values example: 1 1 1 1 - * @setting {String} margin Margin box values example: 1 1 1 1 - * @setting {Number} minWidth Minimal width for the control. - * @setting {Number} minHeight Minimal height for the control. - * @setting {String} classes Space separated list of classes to add. - * @setting {String} role WAI-ARIA role to use for control. - * @setting {Boolean} hidden Is the control hidden by default. - * @setting {Boolean} disabled Is the control disabled by default. - * @setting {String} name Name of the control instance. - */ - init: function(settings) { - var self = this, classes, i; - - self.settings = settings = Tools.extend({}, self.Defaults, settings); - - // Initial states - self._id = settings.id || DomUtils.id(); - self._text = self._name = ''; - self._width = self._height = 0; - self._aria = {role: settings.role}; - - // Setup classes - classes = settings.classes; - if (classes) { - classes = classes.split(' '); - classes.map = {}; - i = classes.length; - while (i--) { - classes.map[classes[i]] = true; - } - } - - self._classes = classes || []; - self.visible(true); - - // Set some properties - Tools.each('title text width height name classes visible disabled active value'.split(' '), function(name) { - var value = settings[name], undef; - - if (value !== undef) { - self[name](value); - } else if (self['_' + name] === undef) { - self['_' + name] = false; - } - }); - - self.on('click', function() { - if (self.disabled()) { - return false; - } - }); - - // TODO: Is this needed duplicate code see above? - if (settings.classes) { - Tools.each(settings.classes.split(' '), function(cls) { - self.addClass(cls); - }); - } - - /** - * Name/value object with settings for the current control. - * - * @field {Object} settings - */ - self.settings = settings; - - self._borderBox = self.parseBox(settings.border); - self._paddingBox = self.parseBox(settings.padding); - self._marginBox = self.parseBox(settings.margin); - - if (settings.hidden) { - self.hide(); - } - }, - - // Will generate getter/setter methods for these properties - Properties: 'parent,title,text,width,height,disabled,active,name,value', - - // Will generate empty dummy functions for these - Methods: 'renderHtml', - - /** - * Returns the root element to render controls into. - * - * @method getContainerElm - * @return {Element} HTML DOM element to render into. - */ - getContainerElm: function() { - return document.body; - }, - - /** - * Returns a control instance for the current DOM element. - * - * @method getParentCtrl - * @param {Element} elm HTML dom element to get parent control from. - * @return {tinymce.ui.Control} Control instance or undefined. - */ - getParentCtrl: function(elm) { - var ctrl, lookup = this.getRoot().controlIdLookup; - - while (elm && lookup) { - ctrl = lookup[elm.id]; - if (ctrl) { - break; - } - - elm = elm.parentNode; - } - - return ctrl; - }, - - /** - * Parses the specified box value. A box value contains 1-4 properties in clockwise order. - * - * @method parseBox - * @param {String/Number} value Box value "0 1 2 3" or "0" etc. - * @return {Object} Object with top/right/bottom/left properties. - * @private - */ - parseBox: function(value) { - var len, radix = 10; - - if (!value) { - return; - } - - if (typeof(value) === "number") { - value = value || 0; - - return { - top: value, - left: value, - bottom: value, - right: value - }; - } - - value = value.split(' '); - len = value.length; - - if (len === 1) { - value[1] = value[2] = value[3] = value[0]; - } else if (len === 2) { - value[2] = value[0]; - value[3] = value[1]; - } else if (len === 3) { - value[3] = value[1]; - } - - return { - top: parseInt(value[0], radix) || 0, - right: parseInt(value[1], radix) || 0, - bottom: parseInt(value[2], radix) || 0, - left: parseInt(value[3], radix) || 0 - }; - }, - - borderBox: function() { - return this._borderBox; - }, - - paddingBox: function() { - return this._paddingBox; - }, - - marginBox: function() { - return this._marginBox; - }, - - measureBox: function(elm, prefix) { - function getStyle(name) { - var defaultView = document.defaultView; - - if (defaultView) { - // Remove camelcase - name = name.replace(/[A-Z]/g, function(a) { - return '-' + a; - }); - - return defaultView.getComputedStyle(elm, null).getPropertyValue(name); - } - - return elm.currentStyle[name]; - } - - function getSide(name) { - var val = parseFloat(getStyle(name), 10); - - return isNaN(val) ? 0 : val; - } - - return { - top: getSide(prefix + "TopWidth"), - right: getSide(prefix + "RightWidth"), - bottom: getSide(prefix + "BottomWidth"), - left: getSide(prefix + "LeftWidth") - }; - }, - - /** - * Initializes the current controls layout rect. - * This will be executed by the layout managers to determine the - * default minWidth/minHeight etc. - * - * @method initLayoutRect - * @return {Object} Layout rect instance. - */ - initLayoutRect: function() { - var self = this, settings = self.settings, borderBox, layoutRect; - var elm = self.getEl(), width, height, minWidth, minHeight, autoResize; - var startMinWidth, startMinHeight, initialSize; - - // Measure the current element - borderBox = self._borderBox = self._borderBox || self.measureBox(elm, 'border'); - self._paddingBox = self._paddingBox || self.measureBox(elm, 'padding'); - self._marginBox = self._marginBox || self.measureBox(elm, 'margin'); - initialSize = DomUtils.getSize(elm); - - // Setup minWidth/minHeight and width/height - startMinWidth = settings.minWidth; - startMinHeight = settings.minHeight; - minWidth = startMinWidth || initialSize.width; - minHeight = startMinHeight || initialSize.height; - width = settings.width; - height = settings.height; - autoResize = settings.autoResize; - autoResize = typeof(autoResize) != "undefined" ? autoResize : !width && !height; - - width = width || minWidth; - height = height || minHeight; - - var deltaW = borderBox.left + borderBox.right; - var deltaH = borderBox.top + borderBox.bottom; - - var maxW = settings.maxWidth || 0xFFFF; - var maxH = settings.maxHeight || 0xFFFF; - - // Setup initial layout rect - self._layoutRect = layoutRect = { - x: settings.x || 0, - y: settings.y || 0, - w: width, - h: height, - deltaW: deltaW, - deltaH: deltaH, - contentW: width - deltaW, - contentH: height - deltaH, - innerW: width - deltaW, - innerH: height - deltaH, - startMinWidth: startMinWidth || 0, - startMinHeight: startMinHeight || 0, - minW: Math.min(minWidth, maxW), - minH: Math.min(minHeight, maxH), - maxW: maxW, - maxH: maxH, - autoResize: autoResize, - scrollW: 0 - }; - - self._lastLayoutRect = {}; - - return layoutRect; - }, - - /** - * Getter/setter for the current layout rect. - * - * @method layoutRect - * @param {Object} [newRect] Optional new layout rect. - * @return {tinymce.ui.Control/Object} Current control or rect object. - */ - layoutRect: function(newRect) { - var self = this, curRect = self._layoutRect, lastLayoutRect, size, deltaWidth, deltaHeight, undef, repaintControls; - - // Initialize default layout rect - if (!curRect) { - curRect = self.initLayoutRect(); - } - - // Set new rect values - if (newRect) { - // Calc deltas between inner and outer sizes - deltaWidth = curRect.deltaW; - deltaHeight = curRect.deltaH; - - // Set x position - if (newRect.x !== undef) { - curRect.x = newRect.x; - } - - // Set y position - if (newRect.y !== undef) { - curRect.y = newRect.y; - } - - // Set minW - if (newRect.minW !== undef) { - curRect.minW = newRect.minW; - } - - // Set minH - if (newRect.minH !== undef) { - curRect.minH = newRect.minH; - } - - // Set new width and calculate inner width - size = newRect.w; - if (size !== undef) { - size = size < curRect.minW ? curRect.minW : size; - size = size > curRect.maxW ? curRect.maxW : size; - curRect.w = size; - curRect.innerW = size - deltaWidth; - } - - // Set new height and calculate inner height - size = newRect.h; - if (size !== undef) { - size = size < curRect.minH ? curRect.minH : size; - size = size > curRect.maxH ? curRect.maxH : size; - curRect.h = size; - curRect.innerH = size - deltaHeight; - } - - // Set new inner width and calculate width - size = newRect.innerW; - if (size !== undef) { - size = size < curRect.minW - deltaWidth ? curRect.minW - deltaWidth : size; - size = size > curRect.maxW - deltaWidth ? curRect.maxW - deltaWidth : size; - curRect.innerW = size; - curRect.w = size + deltaWidth; - } - - // Set new height and calculate inner height - size = newRect.innerH; - if (size !== undef) { - size = size < curRect.minH - deltaHeight ? curRect.minH - deltaHeight : size; - size = size > curRect.maxH - deltaHeight ? curRect.maxH - deltaHeight : size; - curRect.innerH = size; - curRect.h = size + deltaHeight; - } - - // Set new contentW - if (newRect.contentW !== undef) { - curRect.contentW = newRect.contentW; - } - - // Set new contentH - if (newRect.contentH !== undef) { - curRect.contentH = newRect.contentH; - } - - // Compare last layout rect with the current one to see if we need to repaint or not - lastLayoutRect = self._lastLayoutRect; - if (lastLayoutRect.x !== curRect.x || lastLayoutRect.y !== curRect.y || - lastLayoutRect.w !== curRect.w || lastLayoutRect.h !== curRect.h) { - repaintControls = Control.repaintControls; - - if (repaintControls) { - if (repaintControls.map && !repaintControls.map[self._id]) { - repaintControls.push(self); - repaintControls.map[self._id] = true; - } - } - - lastLayoutRect.x = curRect.x; - lastLayoutRect.y = curRect.y; - lastLayoutRect.w = curRect.w; - lastLayoutRect.h = curRect.h; - } - - return self; - } - - return curRect; - }, - - /** - * Repaints the control after a layout operation. - * - * @method repaint - */ - repaint: function() { - var self = this, style, bodyStyle, rect, borderBox, borderW = 0, borderH = 0, lastRepaintRect, round; - - // Use Math.round on all values on IE < 9 - round = !document.createRange ? Math.round : function(value) { - return value; - }; - - style = self.getEl().style; - rect = self._layoutRect; - lastRepaintRect = self._lastRepaintRect || {}; - - borderBox = self._borderBox; - borderW = borderBox.left + borderBox.right; - borderH = borderBox.top + borderBox.bottom; - - if (rect.x !== lastRepaintRect.x) { - style.left = round(rect.x) + 'px'; - lastRepaintRect.x = rect.x; - } - - if (rect.y !== lastRepaintRect.y) { - style.top = round(rect.y) + 'px'; - lastRepaintRect.y = rect.y; - } - - if (rect.w !== lastRepaintRect.w) { - style.width = round(rect.w - borderW) + 'px'; - lastRepaintRect.w = rect.w; - } - - if (rect.h !== lastRepaintRect.h) { - style.height = round(rect.h - borderH) + 'px'; - lastRepaintRect.h = rect.h; - } - - // Update body if needed - if (self._hasBody && rect.innerW !== lastRepaintRect.innerW) { - bodyStyle = self.getEl('body').style; - bodyStyle.width = round(rect.innerW) + 'px'; - lastRepaintRect.innerW = rect.innerW; - } - - if (self._hasBody && rect.innerH !== lastRepaintRect.innerH) { - bodyStyle = bodyStyle || self.getEl('body').style; - bodyStyle.height = round(rect.innerH) + 'px'; - lastRepaintRect.innerH = rect.innerH; - } - - self._lastRepaintRect = lastRepaintRect; - self.fire('repaint', {}, false); - }, - - /** - * Binds a callback to the specified event. This event can both be - * native browser events like "click" or custom ones like PostRender. - * - * The callback function will be passed a DOM event like object that enables yout do stop propagation. - * - * @method on - * @param {String} name Name of the event to bind. For example "click". - * @param {String/function} callback Callback function to execute ones the event occurs. - * @return {tinymce.ui.Control} Current control object. - */ - on: function(name, callback) { - var self = this, bindings, handlers, names, i; - - function resolveCallbackName(name) { - var callback, scope; - - return function(e) { - if (!callback) { - self.parents().each(function(ctrl) { - var callbacks = ctrl.settings.callbacks; - - if (callbacks && (callback = callbacks[name])) { - scope = ctrl; - return false; - } - }); - } - - return callback.call(scope, e); - }; - } - - if (callback) { - if (typeof(callback) == 'string') { - callback = resolveCallbackName(callback); - } - - names = name.toLowerCase().split(' '); - i = names.length; - while (i--) { - name = names[i]; - - bindings = self._bindings; - if (!bindings) { - bindings = self._bindings = {}; - } - - handlers = bindings[name]; - if (!handlers) { - handlers = bindings[name] = []; - } - - handlers.push(callback); - - if (nativeEvents[name]) { - if (!self._nativeEvents) { - self._nativeEvents = {name: true}; - } else { - self._nativeEvents[name] = true; - } - - if (self._rendered) { - self.bindPendingEvents(); - } - } - } - } - - return self; - }, - - /** - * Unbinds the specified event and optionally a specific callback. If you omit the name - * parameter all event handlers will be removed. If you omit the callback all event handles - * by the specified name will be removed. - * - * @method off - * @param {String} [name] Name for the event to unbind. - * @param {function} [callback] Callback function to unbind. - * @return {mxex.ui.Control} Current control object. - */ - off: function(name, callback) { - var self = this, i, bindings = self._bindings, handlers, bindingName, names, hi; - - if (bindings) { - if (name) { - names = name.toLowerCase().split(' '); - i = names.length; - while (i--) { - name = names[i]; - handlers = bindings[name]; - - // Unbind all handlers - if (!name) { - for (bindingName in bindings) { - bindings[bindingName].length = 0; - } - - return self; - } - - if (handlers) { - // Unbind all by name - if (!callback) { - handlers.length = 0; - } else { - // Unbind specific ones - hi = handlers.length; - while (hi--) { - if (handlers[hi] === callback) { - handlers.splice(hi, 1); - } - } - } - } - } - } else { - self._bindings = []; - } - } - - return self; - }, - - /** - * Fires the specified event by name and arguments on the control. This will execute all - * bound event handlers. - * - * @method fire - * @param {String} name Name of the event to fire. - * @param {Object} [args] Arguments to pass to the event. - * @param {Boolean} [bubble] Value to control bubbeling. Defaults to true. - * @return {Object} Current arguments object. - */ - fire: function(name, args, bubble) { - var self = this, i, l, handlers, parentCtrl; - - name = name.toLowerCase(); - - // Dummy function that gets replaced on the delegation state functions - function returnFalse() { - return false; - } - - // Dummy function that gets replaced on the delegation state functions - function returnTrue() { - return true; - } - - // Setup empty object if args is omited - args = args || {}; - - // Stick type into event object - if (!args.type) { - args.type = name; - } - - // Stick control into event - if (!args.control) { - args.control = self; - } - - // Add event delegation methods if they are missing - if (!args.preventDefault) { - // Add preventDefault method - args.preventDefault = function() { - args.isDefaultPrevented = returnTrue; - }; - - // Add stopPropagation - args.stopPropagation = function() { - args.isPropagationStopped = returnTrue; - }; - - // Add stopImmediatePropagation - args.stopImmediatePropagation = function() { - args.isImmediatePropagationStopped = returnTrue; - }; - - // Add event delegation states - args.isDefaultPrevented = returnFalse; - args.isPropagationStopped = returnFalse; - args.isImmediatePropagationStopped = returnFalse; - } - - if (self._bindings) { - handlers = self._bindings[name]; - - if (handlers) { - for (i = 0, l = handlers.length; i < l; i++) { - // Execute callback and break if the callback returns a false - if (!args.isImmediatePropagationStopped() && handlers[i].call(self, args) === false) { - break; - } - } - } - } - - // Bubble event up to parent controls - if (bubble !== false) { - parentCtrl = self.parent(); - while (parentCtrl && !args.isPropagationStopped()) { - parentCtrl.fire(name, args, false); - parentCtrl = parentCtrl.parent(); - } - } - - return args; - }, - - /** - * Returns true/false if the specified event has any listeners. - * - * @method hasEventListeners - * @param {String} name Name of the event to check for. - * @return {Boolean} True/false state if the event has listeners. - */ - hasEventListeners: function(name) { - return name in this._bindings; - }, - - /** - * Returns a control collection with all parent controls. - * - * @method parents - * @param {String} selector Optional selector expression to find parents. - * @return {tinymce.ui.Collection} Collection with all parent controls. - */ - parents: function(selector) { - var self = this, ctrl, parents = new Collection(); - - // Add each parent to collection - for (ctrl = self.parent(); ctrl; ctrl = ctrl.parent()) { - parents.add(ctrl); - } - - // Filter away everything that doesn't match the selector - if (selector) { - parents = parents.filter(selector); - } - - return parents; - }, - - /** - * Returns the control next to the current control. - * - * @method next - * @return {tinymce.ui.Control} Next control instance. - */ - next: function() { - var parentControls = this.parent().items(); - - return parentControls[parentControls.indexOf(this) + 1]; - }, - - /** - * Returns the control previous to the current control. - * - * @method prev - * @return {tinymce.ui.Control} Previous control instance. - */ - prev: function() { - var parentControls = this.parent().items(); - - return parentControls[parentControls.indexOf(this) - 1]; - }, - - /** - * Find the common ancestor for two control instances. - * - * @method findCommonAncestor - * @param {tinymce.ui.Control} ctrl1 First control. - * @param {tinymce.ui.Control} ctrl2 Second control. - * @return {tinymce.ui.Control} Ancestor control instance. - */ - findCommonAncestor: function(ctrl1, ctrl2) { - var parentCtrl; - - while (ctrl1) { - parentCtrl = ctrl2; - - while (parentCtrl && ctrl1 != parentCtrl) { - parentCtrl = parentCtrl.parent(); - } - - if (ctrl1 == parentCtrl) { - break; - } - - ctrl1 = ctrl1.parent(); - } - - return ctrl1; - }, - - /** - * Returns true/false if the specific control has the specific class. - * - * @method hasClass - * @param {String} cls Class to check for. - * @param {String} [group] Sub element group name. - * @return {Boolean} True/false if the control has the specified class. - */ - hasClass: function(cls, group) { - var classes = this._classes[group || 'control']; - - cls = this.classPrefix + cls; - - return classes && !!classes.map[cls]; - }, - - /** - * Adds the specified class to the control - * - * @method addClass - * @param {String} cls Class to check for. - * @param {String} [group] Sub element group name. - * @return {tinymce.ui.Control} Current control object. - */ - addClass: function(cls, group) { - var self = this, classes, elm; - - cls = this.classPrefix + cls; - classes = self._classes[group || 'control']; - - if (!classes) { - classes = []; - classes.map = {}; - self._classes[group || 'control'] = classes; - } - - if (!classes.map[cls]) { - classes.map[cls] = cls; - classes.push(cls); - - if (self._rendered) { - elm = self.getEl(group); - - if (elm) { - elm.className = classes.join(' '); - } - } - } - - return self; - }, - - /** - * Removes the specified class from the control. - * - * @method removeClass - * @param {String} cls Class to remove. - * @param {String} [group] Sub element group name. - * @return {tinymce.ui.Control} Current control object. - */ - removeClass: function(cls, group) { - var self = this, classes, i, elm; - - cls = this.classPrefix + cls; - classes = self._classes[group || 'control']; - if (classes && classes.map[cls]) { - delete classes.map[cls]; - - i = classes.length; - while (i--) { - if (classes[i] === cls) { - classes.splice(i, 1); - } - } - } - - if (self._rendered) { - elm = self.getEl(group); - - if (elm) { - elm.className = classes.join(' '); - } - } - - return self; - }, - - /** - * Toggles the specified class on the control. - * - * @method toggleClass - * @param {String} cls Class to remove. - * @param {Boolean} state True/false state to add/remove class. - * @param {String} [group] Sub element group name. - * @return {tinymce.ui.Control} Current control object. - */ - toggleClass: function(cls, state, group) { - var self = this; - - if (state) { - self.addClass(cls, group); - } else { - self.removeClass(cls, group); - } - - return self; - }, - - /** - * Returns the class string for the specified group name. - * - * @method classes - * @param {String} [group] Group to get clases by. - * @return {String} Classes for the specified group. - */ - classes: function(group) { - var classes = this._classes[group || 'control']; - - return classes ? classes.join(' ') : ''; - }, - - /** - * Sets the inner HTML of the control element. - * - * @method innerHtml - * @param {String} html Html string to set as inner html. - * @return {tinymce.ui.Control} Current control object. - */ - innerHtml: function(html) { - DomUtils.innerHtml(this.getEl(), html); - return this; - }, - - /** - * Returns the control DOM element or sub element. - * - * @method getEl - * @param {String} [suffix] Suffix to get element by. - * @param {Boolean} [dropCache] True if the cache for the element should be dropped. - * @return {Element} HTML DOM element for the current control or it's children. - */ - getEl: function(suffix, dropCache) { - var elm, id = suffix ? this._id + '-' + suffix : this._id; - - elm = elementIdCache[id] = (dropCache === true ? null : elementIdCache[id]) || DomUtils.get(id); - - return elm; - }, - - /** - * Sets/gets the visible for the control. - * - * @method visible - * @param {Boolean} state Value to set to control. - * @return {Boolean/tinymce.ui.Control} Current control on a set operation or current state on a get. - */ - visible: function(state) { - var self = this, parentCtrl; - - if (typeof(state) !== "undefined") { - if (self._visible !== state) { - if (self._rendered) { - self.getEl().style.display = state ? '' : 'none'; - } - - self._visible = state; - - // Parent container needs to reflow - parentCtrl = self.parent(); - if (parentCtrl) { - parentCtrl._lastRect = null; - } - - self.fire(state ? 'show' : 'hide'); - } - - return self; - } - - return self._visible; - }, - - /** - * Sets the visible state to true. - * - * @method show - * @return {tinymce.ui.Control} Current control instance. - */ - show: function() { - return this.visible(true); - }, - - /** - * Sets the visible state to false. - * - * @method hide - * @return {tinymce.ui.Control} Current control instance. - */ - hide: function() { - return this.visible(false); - }, - - /** - * Focuses the current control. - * - * @method focus - * @return {tinymce.ui.Control} Current control instance. - */ - focus: function() { - try { - this.getEl().focus(); - } catch (ex) { - // Ignore IE error - } - - return this; - }, - - /** - * Blurs the current control. - * - * @method blur - * @return {tinymce.ui.Control} Current control instance. - */ - blur: function() { - this.getEl().blur(); - - return this; - }, - - /** - * Sets the specified aria property. - * - * @method aria - * @param {String} name Name of the aria property to set. - * @param {String} value Value of the aria property. - * @return {tinymce.ui.Control} Current control instance. - */ - aria: function(name, value) { - var self = this, elm = self.getEl(self.ariaTarget); - - if (typeof(value) === "undefined") { - return self._aria[name]; - } else { - self._aria[name] = value; - } - - if (self._rendered) { - elm.setAttribute(name == 'role' ? name : 'aria-' + name, value); - } - - return self; - }, - - /** - * Encodes the specified string with HTML entities. It will also - * translate the string to different languages. - * - * @method encode - * @param {String/Object/Array} text Text to entity encode. - * @param {Boolean} [translate=true] False if the contents shouldn't be translated. - * @return {String} Encoded and possible traslated string. - */ - encode: function(text, translate) { - if (translate !== false && Control.translate) { - text = Control.translate(text); - } - - return (text || '').replace(/[&<>"]/g, function(match) { - return '&#' + match.charCodeAt(0) + ';'; - }); - }, - - /** - * Adds items before the current control. - * - * @method before - * @param {Array/tinymce.ui.Collection} items Array of items to prepend before this control. - * @return {tinymce.ui.Control} Current control instance. - */ - before: function(items) { - var self = this, parent = self.parent(); - - if (parent) { - parent.insert(items, parent.items().indexOf(self), true); - } - - return self; - }, - - /** - * Adds items after the current control. - * - * @method after - * @param {Array/tinymce.ui.Collection} items Array of items to append after this control. - * @return {tinymce.ui.Control} Current control instance. - */ - after: function(items) { - var self = this, parent = self.parent(); - - if (parent) { - parent.insert(items, parent.items().indexOf(self)); - } - - return self; - }, - - /** - * Removes the current control from DOM and from UI collections. - * - * @method remove - * @return {tinymce.ui.Control} Current control instance. - */ - remove: function() { - var self = this, elm = self.getEl(), parent = self.parent(), newItems, i; - - if (self.items) { - var controls = self.items().toArray(); - i = controls.length; - while (i--) { - controls[i].remove(); - } - } - - if (parent && parent.items) { - newItems = []; - - parent.items().each(function(item) { - if (item !== self) { - newItems.push(item); - } - }); - - parent.items().set(newItems); - parent._lastRect = null; - } - - if (self._eventsRoot && self._eventsRoot == self) { - DomUtils.off(elm); - } - - var lookup = self.getRoot().controlIdLookup; - if (lookup) { - delete lookup[self._id]; - } - - delete elementIdCache[self._id]; - - if (elm && elm.parentNode) { - var nodes = elm.getElementsByTagName('*'); - - i = nodes.length; - while (i--) { - delete elementIdCache[nodes[i].id]; - } - - elm.parentNode.removeChild(elm); - } - - self._rendered = false; - - return self; - }, - - /** - * Renders the control before the specified element. - * - * @method renderBefore - * @param {Element} elm Element to render before. - * @return {tinymce.ui.Control} Current control instance. - */ - renderBefore: function(elm) { - var self = this; - - elm.parentNode.insertBefore(DomUtils.createFragment(self.renderHtml()), elm); - self.postRender(); - - return self; - }, - - /** - * Renders the control to the specified element. - * - * @method renderBefore - * @param {Element} elm Element to render to. - * @return {tinymce.ui.Control} Current control instance. - */ - renderTo: function(elm) { - var self = this; - - elm = elm || self.getContainerElm(); - elm.appendChild(DomUtils.createFragment(self.renderHtml())); - self.postRender(); - - return self; - }, - - /** - * Post render method. Called after the control has been rendered to the target. - * - * @method postRender - * @return {tinymce.ui.Control} Current control instance. - */ - postRender: function() { - var self = this, settings = self.settings, elm, box, parent, name, parentEventsRoot; - - // Bind on settings - for (name in settings) { - if (name.indexOf("on") === 0) { - self.on(name.substr(2), settings[name]); - } - } - - if (self._eventsRoot) { - for (parent = self.parent(); !parentEventsRoot && parent; parent = parent.parent()) { - parentEventsRoot = parent._eventsRoot; - } - - if (parentEventsRoot) { - for (name in parentEventsRoot._nativeEvents) { - self._nativeEvents[name] = true; - } - } - } - - self.bindPendingEvents(); - - if (settings.style) { - elm = self.getEl(); - if (elm) { - elm.setAttribute('style', settings.style); - elm.style.cssText = settings.style; - } - } - - if (!self._visible) { - DomUtils.css(self.getEl(), 'display', 'none'); - } - - if (self.settings.border) { - box = self.borderBox(); - DomUtils.css(self.getEl(), { - 'border-top-width': box.top, - 'border-right-width': box.right, - 'border-bottom-width': box.bottom, - 'border-left-width': box.left - }); - } - - // Add instance to lookup - var root = self.getRoot(); - if (!root.controlIdLookup) { - root.controlIdLookup = {}; - } - - root.controlIdLookup[self._id] = self; - - for (var key in self._aria) { - self.aria(key, self._aria[key]); - } - - self.fire('postrender', {}, false); - }, - - /** - * Scrolls the current control into view. - * - * @method scrollIntoView - * @param {String} align Alignment in view top|center|bottom. - * @return {tinymce.ui.Control} Current control instance. - */ - scrollIntoView: function(align) { - function getOffset(elm, rootElm) { - var x, y, parent = elm; - - x = y = 0; - while (parent && parent != rootElm && parent.nodeType) { - x += parent.offsetLeft || 0; - y += parent.offsetTop || 0; - parent = parent.offsetParent; - } - - return {x: x, y: y}; - } - - var elm = this.getEl(), parentElm = elm.parentNode; - var x, y, width, height, parentWidth, parentHeight; - var pos = getOffset(elm, parentElm); - - x = pos.x; - y = pos.y; - width = elm.offsetWidth; - height = elm.offsetHeight; - parentWidth = parentElm.clientWidth; - parentHeight = parentElm.clientHeight; - - if (align == "end") { - x -= parentWidth - width; - y -= parentHeight - height; - } else if (align == "center") { - x -= (parentWidth / 2) - (width / 2); - y -= (parentHeight / 2) - (height / 2); - } - - parentElm.scrollLeft = x; - parentElm.scrollTop = y; - - return this; - }, - - /** - * Binds pending DOM events. - * - * @private - */ - bindPendingEvents: function() { - var self = this, i, l, parents, eventRootCtrl, nativeEvents, name; - - function delegate(e) { - var control = self.getParentCtrl(e.target); - - if (control) { - control.fire(e.type, e); - } - } - - function mouseLeaveHandler() { - var ctrl = eventRootCtrl._lastHoverCtrl; - - if (ctrl) { - ctrl.fire("mouseleave", {target: ctrl.getEl()}); - - ctrl.parents().each(function(ctrl) { - ctrl.fire("mouseleave", {target: ctrl.getEl()}); - }); - - eventRootCtrl._lastHoverCtrl = null; - } - } - - function mouseEnterHandler(e) { - var ctrl = self.getParentCtrl(e.target), lastCtrl = eventRootCtrl._lastHoverCtrl, idx = 0, i, parents, lastParents; - - // Over on a new control - if (ctrl !== lastCtrl) { - eventRootCtrl._lastHoverCtrl = ctrl; - - parents = ctrl.parents().toArray().reverse(); - parents.push(ctrl); - - if (lastCtrl) { - lastParents = lastCtrl.parents().toArray().reverse(); - lastParents.push(lastCtrl); - - for (idx = 0; idx < lastParents.length; idx++) { - if (parents[idx] !== lastParents[idx]) { - break; - } - } - - for (i = lastParents.length - 1; i >= idx; i--) { - lastCtrl = lastParents[i]; - lastCtrl.fire("mouseleave", { - target : lastCtrl.getEl() - }); - } - } - - for (i = idx; i < parents.length; i++) { - ctrl = parents[i]; - ctrl.fire("mouseenter", { - target : ctrl.getEl() - }); - } - } - } - - function fixWheelEvent(e) { - e.preventDefault(); - - if (e.type == "mousewheel") { - e.deltaY = -1 / 40 * e.wheelDelta; - - if (e.wheelDeltaX) { - e.deltaX = -1 / 40 * e.wheelDeltaX; - } - } else { - e.deltaX = 0; - e.deltaY = e.detail; - } - - e = self.fire("wheel", e); - } - - self._rendered = true; - - nativeEvents = self._nativeEvents; - if (nativeEvents) { - // Find event root element if it exists - parents = self.parents().toArray(); - parents.unshift(self); - for (i = 0, l = parents.length; !eventRootCtrl && i < l; i++) { - eventRootCtrl = parents[i]._eventsRoot; - } - - // Event root wasn't found the use the root control - if (!eventRootCtrl) { - eventRootCtrl = parents[parents.length - 1] || self; - } - - // Set the eventsRoot property on children that didn't have it - self._eventsRoot = eventRootCtrl; - for (l = i, i = 0; i < l; i++) { - parents[i]._eventsRoot = eventRootCtrl; - } - - // Bind native event delegates - for (name in nativeEvents) { - if (!nativeEvents) { - return false; - } - - if (name === "wheel" && !hasWheelEventSupport) { - if (hasMouseWheelEventSupport) { - DomUtils.on(self.getEl(), "mousewheel", fixWheelEvent); - } else { - DomUtils.on(self.getEl(), "DOMMouseScroll", fixWheelEvent); - } - - continue; - } - - // Special treatment for mousenter/mouseleave since these doesn't bubble - if (name === "mouseenter" || name === "mouseleave") { - // Fake mousenter/mouseleave - if (!eventRootCtrl._hasMouseEnter) { - DomUtils.on(eventRootCtrl.getEl(), "mouseleave", mouseLeaveHandler); - DomUtils.on(eventRootCtrl.getEl(), "mouseover", mouseEnterHandler); - eventRootCtrl._hasMouseEnter = 1; - } - } else if (!eventRootCtrl[name]) { - DomUtils.on(eventRootCtrl.getEl(), name, delegate); - eventRootCtrl[name] = true; - } - - // Remove the event once it's bound - nativeEvents[name] = false; - } - } - }, - - getRoot: function() { - var ctrl = this, rootControl, parents = []; - - while (ctrl) { - if (ctrl.rootControl) { - rootControl = ctrl.rootControl; - break; - } - - parents.push(ctrl); - rootControl = ctrl; - ctrl = ctrl.parent(); - } - - if (!rootControl) { - rootControl = this; - } - - var i = parents.length; - while (i--) { - parents[i].rootControl = rootControl; - } - - return rootControl; - }, - - /** - * Reflows the current control and it's parents. - * This should be used after you for example append children to the current control so - * that the layout managers know that they need to reposition everything. - * - * @example - * container.append({type: 'button', text: 'My button'}).reflow(); - * - * @method reflow - * @return {tinymce.ui.Control} Current control instance. - */ - reflow: function() { - this.repaint(); - - return this; - } - - /** - * Sets/gets the parent container for the control. - * - * @method parent - * @param {tinymce.ui.Container} parent Optional parent to set. - * @return {tinymce.ui.Control} Parent control or the current control on a set action. - */ - // parent: function(parent) {} -- Generated - - /** - * Sets/gets the text for the control. - * - * @method text - * @param {String} value Value to set to control. - * @return {String/tinymce.ui.Control} Current control on a set operation or current value on a get. - */ - // text: function(value) {} -- Generated - - /** - * Sets/gets the width for the control. - * - * @method width - * @param {Number} value Value to set to control. - * @return {Number/tinymce.ui.Control} Current control on a set operation or current value on a get. - */ - // width: function(value) {} -- Generated - - /** - * Sets/gets the height for the control. - * - * @method height - * @param {Number} value Value to set to control. - * @return {Number/tinymce.ui.Control} Current control on a set operation or current value on a get. - */ - // height: function(value) {} -- Generated - - /** - * Sets/gets the disabled state on the control. - * - * @method disabled - * @param {Boolean} state Value to set to control. - * @return {Boolean/tinymce.ui.Control} Current control on a set operation or current state on a get. - */ - // disabled: function(state) {} -- Generated - - /** - * Sets/gets the active for the control. - * - * @method active - * @param {Boolean} state Value to set to control. - * @return {Boolean/tinymce.ui.Control} Current control on a set operation or current state on a get. - */ - // active: function(state) {} -- Generated - - /** - * Sets/gets the name for the control. - * - * @method name - * @param {String} value Value to set to control. - * @return {String/tinymce.ui.Control} Current control on a set operation or current value on a get. - */ - // name: function(value) {} -- Generated - - /** - * Sets/gets the title for the control. - * - * @method title - * @param {String} value Value to set to control. - * @return {String/tinymce.ui.Control} Current control on a set operation or current value on a get. - */ - // title: function(value) {} -- Generated - }); - - return Control; -}); - -// Included from: js/tinymce/classes/ui/Factory.js - -/** - * Factory.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*global tinymce:true */ - -/** - * This class is a factory for control instances. This enables you - * to create instances of controls without having to require the UI controls directly. - * - * It also allow you to override or add new control types. - * - * @class tinymce.ui.Factory - */ -define("tinymce/ui/Factory", [], function() { - "use strict"; - - var types = {}, namespaceInit; - - return { - /** - * Adds a new control instance type to the factory. - * - * @method add - * @param {String} type Type name for example "button". - * @param {function} typeClass Class type function. - */ - add: function(type, typeClass) { - types[type.toLowerCase()] = typeClass; - }, - - /** - * Returns true/false if the specified type exists or not. - * - * @method has - * @param {String} type Type to look for. - * @return {Boolean} true/false if the control by name exists. - */ - has: function(type) { - return !!types[type.toLowerCase()]; - }, - - /** - * Creates a new control instance based on the settings provided. The instance created will be - * based on the specified type property it can also create whole structures of components out of - * the specified JSON object. - * - * @example - * tinymce.ui.Factory.create({ - * type: 'button', - * text: 'Hello world!' - * }); - * - * @method create - * @param {Object/String} settings Name/Value object with items used to create the type. - * @return {tinymce.ui.Control} Control instance based on the specified type. - */ - create: function(type, settings) { - var ControlType, name, namespace; - - // Build type lookup - if (!namespaceInit) { - namespace = tinymce.ui; - - for (name in namespace) { - types[name.toLowerCase()] = namespace[name]; - } - - namespaceInit = true; - } - - // If string is specified then use it as the type - if (typeof(type) == 'string') { - settings = settings || {}; - settings.type = type; - } else { - settings = type; - type = settings.type; - } - - // Find control type - type = type.toLowerCase(); - ControlType = types[type]; - - // #if debug - - if (!ControlType) { - throw new Error("Could not find control by type: " + type); - } - - // #endif - - ControlType = new ControlType(settings); - ControlType.type = type; // Set the type on the instance, this will be used by the Selector engine - - return ControlType; - } - }; -}); - -// Included from: js/tinymce/classes/ui/KeyboardNavigation.js - -/** - * KeyboardNavigation.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class handles keyboard navigation of controls and elements. - * - * @class tinymce.ui.KeyboardNavigation - */ -define("tinymce/ui/KeyboardNavigation", [ -], function() { - "use strict"; - - /** - * This class handles all keyboard navigation for WAI-ARIA support. Each root container - * gets an instance of this class. - * - * @constructor - */ - return function(settings) { - var root = settings.root, focusedElement, focusedControl; - - focusedElement = document.activeElement; - focusedControl = root.getParentCtrl(focusedElement); - - /** - * Returns the currently focused elements wai aria role of the currently - * focused element or specified element. - * - * @private - * @param {Element} elm Optional element to get role from. - * @return {String} Role of specified element. - */ - function getRole(elm) { - elm = elm || focusedElement; - - return elm && elm.getAttribute('role'); - } - - /** - * Returns the wai role of the parent element of the currently - * focused element or specified element. - * - * @private - * @param {Element} elm Optional element to get parent role from. - * @return {String} Role of the first parent that has a role. - */ - function getParentRole(elm) { - var role, parent = elm || focusedElement; - - while ((parent = parent.parentNode)) { - if ((role = getRole(parent))) { - return role; - } - } - } - - /** - * Returns a wai aria property by name for example aria-selected. - * - * @private - * @param {String} name Name of the aria property to get for example "disabled". - * @return {String} Aria property value. - */ - function getAriaProp(name) { - var elm = focusedElement; - - if (elm) { - return elm.getAttribute('aria-' + name); - } - } - - /** - * Is the element a text input element or not. - * - * @private - * @param {Element} elm Element to check if it's an text input element or not. - * @return {Boolean} True/false if the element is a text element or not. - */ - function isTextInputElement(elm) { - // Notice: since type can be "email" etc we don't check the type - // So all input elements gets treated as text input elements - return elm.tagName == "INPUT" || elm.tagName == "TEXTAREA"; - } - - /** - * Returns true/false if the specified element can be focused or not. - * - * @private - * @param {Element} elm DOM element to check if it can be focused or not. - * @return {Boolean} True/false if the element can have focus. - */ - function canFocus(elm) { - if (isTextInputElement(elm) && !elm.hidden) { - return true; - } - - if (/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell)$/.test(getRole(elm))) { - return true; - } - - return false; - } - - /** - * Returns an array of focusable visible elements within the specified container element. - * - * @private - * @param {Element} elm DOM element to find focusable elements within. - * @return {Array} Array of focusable elements. - */ - function getFocusElements(elm) { - var elements = []; - - function collect(elm) { - if (elm.nodeType != 1 || elm.style.display == 'none') { - return; - } - - if (canFocus(elm)) { - elements.push(elm); - } - - for (var i = 0; i < elm.childNodes.length; i++) { - collect(elm.childNodes[i]); - } - } - - collect(elm || root.getEl()); - - return elements; - } - - /** - * Returns the navigation root control for the specified control. The navigation root - * is the control that the keyboard navigation gets scoped to for example a menubar or toolbar group. - * It will look for parents of the specified target control or the currenty focused control if this option is omitted. - * - * @private - * @param {tinymce.ui.Control} targetControl Optional target control to find root of. - * @return {tinymce.ui.Control} Navigation root control. - */ - function getNavigationRoot(targetControl) { - var navigationRoot, controls; - - targetControl = targetControl || focusedControl; - controls = targetControl.parents().toArray(); - controls.unshift(targetControl); - - for (var i = 0; i < controls.length; i++) { - navigationRoot = controls[i]; - - if (navigationRoot.settings.ariaRoot) { - break; - } - } - - return navigationRoot; - } - - /** - * Focuses the first item in the specified targetControl element or the last aria index if the - * navigation root has the ariaRemember option enabled. - * - * @private - * @param {tinymce.ui.Control} targetControl Target control to focus the first item in. - */ - function focusFirst(targetControl) { - var navigationRoot = getNavigationRoot(targetControl); - var focusElements = getFocusElements(navigationRoot.getEl()); - - if (navigationRoot.settings.ariaRemember && "lastAriaIndex" in navigationRoot) { - moveFocusToIndex(navigationRoot.lastAriaIndex, focusElements); - } else { - moveFocusToIndex(0, focusElements); - } - } - - /** - * Moves the focus to the specified index within the elements list. - * This will scope the index to the size of the element list if it changed. - * - * @private - * @param {Number} idx Specified index to move to. - * @param {Array} elements Array with dom elements to move focus within. - * @return {Number} Input index or a changed index if it was out of range. - */ - function moveFocusToIndex(idx, elements) { - if (idx < 0) { - idx = elements.length - 1; - } else if (idx >= elements.length) { - idx = 0; - } - - if (elements[idx]) { - elements[idx].focus(); - } - - return idx; - } - - /** - * Moves the focus forwards or backwards. - * - * @private - * @param {Number} dir Direction to move in positive means forward, negative means backwards. - * @param {Array} elements Optional array of elements to move within defaults to the current navigation roots elements. - */ - function moveFocus(dir, elements) { - var idx = -1, navigationRoot = getNavigationRoot(); - - elements = elements || getFocusElements(navigationRoot.getEl()); - - for (var i = 0; i < elements.length; i++) { - if (elements[i] === focusedElement) { - idx = i; - } - } - - idx += dir; - navigationRoot.lastAriaIndex = moveFocusToIndex(idx, elements); - } - - /** - * Moves the focus to the left this is called by the left key. - * - * @private - */ - function left() { - var parentRole = getParentRole(); - - if (parentRole == "tablist") { - moveFocus(-1, getFocusElements(focusedElement.parentNode)); - } else if (focusedControl.parent().submenu) { - cancel(); - } else { - moveFocus(-1); - } - } - - /** - * Moves the focus to the right this is called by the right key. - * - * @private - */ - function right() { - var role = getRole(), parentRole = getParentRole(); - - if (parentRole == "tablist") { - moveFocus(1, getFocusElements(focusedElement.parentNode)); - } else if (role == "menuitem" && parentRole == "menu" && getAriaProp('haspopup')) { - enter(); - } else { - moveFocus(1); - } - } - - /** - * Moves the focus to the up this is called by the up key. - * - * @private - */ - function up() { - moveFocus(-1); - } - - /** - * Moves the focus to the up this is called by the down key. - * - * @private - */ - function down() { - var role = getRole(), parentRole = getParentRole(); - - if (role == "menuitem" && parentRole == "menubar") { - enter(); - } else if (role == "button" && getAriaProp('haspopup')) { - enter({key: 'down'}); - } else { - moveFocus(1); - } - } - - /** - * Moves the focus to the next item or previous item depending on shift key. - * - * @private - * @param {DOMEvent} e DOM event object. - */ - function tab(e) { - var parentRole = getParentRole(); - - if (parentRole == "tablist") { - var elm = getFocusElements(focusedControl.getEl('body'))[0]; - - if (elm) { - elm.focus(); - } - } else { - moveFocus(e.shiftKey ? -1 : 1); - } - } - - /** - * Calls the cancel event on the currently focused control. This is normally done using the Esc key. - * - * @private - */ - function cancel() { - focusedControl.fire('cancel'); - } - - /** - * Calls the click event on the currently focused control. This is normally done using the Enter/Space keys. - * - * @private - * @param {Object} aria Optional aria data to pass along with the enter event. - */ - function enter(aria) { - aria = aria || {}; - focusedControl.fire('click', {target: focusedElement, aria: aria}); - } - - root.on('keydown', function(e) { - function handleNonTabEvent(e, handler) { - // Ignore non tab keys for text elements - if (isTextInputElement(focusedElement)) { - return; - } - - if (handler(e) !== false) { - e.preventDefault(); - } - } - - if (e.isDefaultPrevented()) { - return; - } - - switch (e.keyCode) { - case 37: // DOM_VK_LEFT - handleNonTabEvent(e, left); - break; - - case 39: // DOM_VK_RIGHT - handleNonTabEvent(e, right); - break; - - case 38: // DOM_VK_UP - handleNonTabEvent(e, up); - break; - - case 40: // DOM_VK_DOWN - handleNonTabEvent(e, down); - break; - - case 27: // DOM_VK_ESCAPE - handleNonTabEvent(e, cancel); - break; - - case 14: // DOM_VK_ENTER - case 13: // DOM_VK_RETURN - case 32: // DOM_VK_SPACE - handleNonTabEvent(e, enter); - break; - - case 9: // DOM_VK_TAB - if (tab(e) !== false) { - e.preventDefault(); - } - break; - } - }); - - root.on('focusin', function(e) { - focusedElement = e.target; - focusedControl = e.control; - }); - - return { - focusFirst: focusFirst - }; - }; -}); - -// Included from: js/tinymce/classes/ui/Container.js - -/** - * Container.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Container control. This is extended by all controls that can have - * children such as panels etc. You can also use this class directly as an - * generic container instance. The container doesn't have any specific role or style. - * - * @-x-less Container.less - * @class tinymce.ui.Container - * @extends tinymce.ui.Control - */ -define("tinymce/ui/Container", [ - "tinymce/ui/Control", - "tinymce/ui/Collection", - "tinymce/ui/Selector", - "tinymce/ui/Factory", - "tinymce/ui/KeyboardNavigation", - "tinymce/util/Tools", - "tinymce/ui/DomUtils" -], function(Control, Collection, Selector, Factory, KeyboardNavigation, Tools, DomUtils) { - "use strict"; - - var selectorCache = {}; - - return Control.extend({ - layout: '', - innerClass: 'container-inner', - - /** - * Constructs a new control instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - * @setting {Array} items Items to add to container in JSON format or control instances. - * @setting {String} layout Layout manager by name to use. - * @setting {Object} defaults Default settings to apply to all items. - */ - init: function(settings) { - var self = this; - - self._super(settings); - settings = self.settings; - self._fixed = settings.fixed; - self._items = new Collection(); - - if (self.isRtl()) { - self.addClass('rtl'); - } - - self.addClass('container'); - self.addClass('container-body', 'body'); - - if (settings.containerCls) { - self.addClass(settings.containerCls); - } - - self._layout = Factory.create((settings.layout || self.layout) + 'layout'); - - if (self.settings.items) { - self.add(self.settings.items); - } - - // TODO: Fix this! - self._hasBody = true; - }, - - /** - * Returns a collection of child items that the container currently have. - * - * @method items - * @return {tinymce.ui.Collection} Control collection direct child controls. - */ - items: function() { - return this._items; - }, - - /** - * Find child controls by selector. - * - * @method find - * @param {String} selector Selector CSS pattern to find children by. - * @return {tinymce.ui.Collection} Control collection with child controls. - */ - find: function(selector) { - selector = selectorCache[selector] = selectorCache[selector] || new Selector(selector); - - return selector.find(this); - }, - - /** - * Adds one or many items to the current container. This will create instances of - * the object representations if needed. - * - * @method add - * @param {Array/Object/tinymce.ui.Control} items Array or item that will be added to the container. - * @return {tinymce.ui.Collection} Current collection control. - */ - add: function(items) { - var self = this; - - self.items().add(self.create(items)).parent(self); - - return self; - }, - - /** - * Focuses the current container instance. This will look - * for the first control in the container and focus that. - * - * @method focus - * @param {Boolean} keyboard Optional true/false if the focus was a keyboard focus or not. - * @return {tinymce.ui.Collection} Current instance. - */ - focus: function(keyboard) { - var self = this, focusCtrl, keyboardNav, items; - - if (keyboard) { - keyboardNav = self.keyboardNav || self.parents().eq(-1)[0].keyboardNav; - - if (keyboardNav) { - keyboardNav.focusFirst(self); - return; - } - } - - items = self.find('*'); - - // TODO: Figure out a better way to auto focus alert dialog buttons - if (self.statusbar) { - items.add(self.statusbar.items()); - } - - items.each(function(ctrl) { - if (ctrl.settings.autofocus) { - focusCtrl = null; - return false; - } - - if (ctrl.canFocus) { - focusCtrl = focusCtrl || ctrl; - } - }); - - if (focusCtrl) { - focusCtrl.focus(); - } - - return self; - }, - - /** - * Replaces the specified child control with a new control. - * - * @method replace - * @param {tinymce.ui.Control} oldItem Old item to be replaced. - * @param {tinymce.ui.Control} newItem New item to be inserted. - */ - replace: function(oldItem, newItem) { - var ctrlElm, items = this.items(), i = items.length; - - // Replace the item in collection - while (i--) { - if (items[i] === oldItem) { - items[i] = newItem; - break; - } - } - - if (i >= 0) { - // Remove new item from DOM - ctrlElm = newItem.getEl(); - if (ctrlElm) { - ctrlElm.parentNode.removeChild(ctrlElm); - } - - // Remove old item from DOM - ctrlElm = oldItem.getEl(); - if (ctrlElm) { - ctrlElm.parentNode.removeChild(ctrlElm); - } - } - - // Adopt the item - newItem.parent(this); - }, - - /** - * Creates the specified items. If any of the items is plain JSON style objects - * it will convert these into real tinymce.ui.Control instances. - * - * @method create - * @param {Array} items Array of items to convert into control instances. - * @return {Array} Array with control instances. - */ - create: function(items) { - var self = this, settings, ctrlItems = []; - - // Non array structure, then force it into an array - if (!Tools.isArray(items)) { - items = [items]; - } - - // Add default type to each child control - Tools.each(items, function(item) { - if (item) { - // Construct item if needed - if (!(item instanceof Control)) { - // Name only then convert it to an object - if (typeof(item) == "string") { - item = {type: item}; - } - - // Create control instance based on input settings and default settings - settings = Tools.extend({}, self.settings.defaults, item); - item.type = settings.type = settings.type || item.type || self.settings.defaultType || - (settings.defaults ? settings.defaults.type : null); - item = Factory.create(settings); - } - - ctrlItems.push(item); - } - }); - - return ctrlItems; - }, - - /** - * Renders new control instances. - * - * @private - */ - renderNew: function() { - var self = this; - - // Render any new items - self.items().each(function(ctrl, index) { - var containerElm, fragment; - - ctrl.parent(self); - - if (!ctrl._rendered) { - containerElm = self.getEl('body'); - fragment = DomUtils.createFragment(ctrl.renderHtml()); - - // Insert or append the item - if (containerElm.hasChildNodes() && index <= containerElm.childNodes.length - 1) { - containerElm.insertBefore(fragment, containerElm.childNodes[index]); - } else { - containerElm.appendChild(fragment); - } - - ctrl.postRender(); - } - }); - - self._layout.applyClasses(self); - self._lastRect = null; - - return self; - }, - - /** - * Appends new instances to the current container. - * - * @method append - * @param {Array/tinymce.ui.Collection} items Array if controls to append. - * @return {tinymce.ui.Container} Current container instance. - */ - append: function(items) { - return this.add(items).renderNew(); - }, - - /** - * Prepends new instances to the current container. - * - * @method prepend - * @param {Array/tinymce.ui.Collection} items Array if controls to prepend. - * @return {tinymce.ui.Container} Current container instance. - */ - prepend: function(items) { - var self = this; - - self.items().set(self.create(items).concat(self.items().toArray())); - - return self.renderNew(); - }, - - /** - * Inserts an control at a specific index. - * - * @method insert - * @param {Array/tinymce.ui.Collection} items Array if controls to insert. - * @param {Number} index Index to insert controls at. - * @param {Boolean} [before=false] Inserts controls before the index. - */ - insert: function(items, index, before) { - var self = this, curItems, beforeItems, afterItems; - - items = self.create(items); - curItems = self.items(); - - if (!before && index < curItems.length - 1) { - index += 1; - } - - if (index >= 0 && index < curItems.length) { - beforeItems = curItems.slice(0, index).toArray(); - afterItems = curItems.slice(index).toArray(); - curItems.set(beforeItems.concat(items, afterItems)); - } - - return self.renderNew(); - }, - - /** - * Populates the form fields from the specified JSON data object. - * - * Control items in the form that matches the data will have it's value set. - * - * @method fromJSON - * @param {Object} data JSON data object to set control values by. - * @return {tinymce.ui.Container} Current form instance. - */ - fromJSON: function(data) { - var self = this; - - for (var name in data) { - self.find('#' + name).value(data[name]); - } - - return self; - }, - - /** - * Serializes the form into a JSON object by getting all items - * that has a name and a value. - * - * @method toJSON - * @return {Object} JSON object with form data. - */ - toJSON: function() { - var self = this, data = {}; - - self.find('*').each(function(ctrl) { - var name = ctrl.name(), value = ctrl.value(); - - if (name && typeof(value) != "undefined") { - data[name] = value; - } - }); - - return data; - }, - - preRender: function() { - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, layout = self._layout, role = this.settings.role; - - self.preRender(); - layout.preRender(self); - - return ( - '

    ' + - '
    ' + - (self.settings.html || '') + layout.renderHtml(self) + - '
    ' + - '
    ' - ); - }, - - /** - * Post render method. Called after the control has been rendered to the target. - * - * @method postRender - * @return {tinymce.ui.Container} Current combobox instance. - */ - postRender: function() { - var self = this, box; - - self.items().exec('postRender'); - self._super(); - - self._layout.postRender(self); - self._rendered = true; - - if (self.settings.style) { - DomUtils.css(self.getEl(), self.settings.style); - } - - if (self.settings.border) { - box = self.borderBox(); - DomUtils.css(self.getEl(), { - 'border-top-width': box.top, - 'border-right-width': box.right, - 'border-bottom-width': box.bottom, - 'border-left-width': box.left - }); - } - - if (!self.parent()) { - self.keyboardNav = new KeyboardNavigation({ - root: self - }); - } - - return self; - }, - - /** - * Initializes the current controls layout rect. - * This will be executed by the layout managers to determine the - * default minWidth/minHeight etc. - * - * @method initLayoutRect - * @return {Object} Layout rect instance. - */ - initLayoutRect: function() { - var self = this, layoutRect = self._super(); - - // Recalc container size by asking layout manager - self._layout.recalc(self); - - return layoutRect; - }, - - /** - * Recalculates the positions of the controls in the current container. - * This is invoked by the reflow method and shouldn't be called directly. - * - * @method recalc - */ - recalc: function() { - var self = this, rect = self._layoutRect, lastRect = self._lastRect; - - if (!lastRect || lastRect.w != rect.w || lastRect.h != rect.h) { - self._layout.recalc(self); - rect = self.layoutRect(); - self._lastRect = {x: rect.x, y: rect.y, w: rect.w, h: rect.h}; - return true; - } - }, - - /** - * Reflows the current container and it's children and possible parents. - * This should be used after you for example append children to the current control so - * that the layout managers know that they need to reposition everything. - * - * @example - * container.append({type: 'button', text: 'My button'}).reflow(); - * - * @method reflow - * @return {tinymce.ui.Container} Current container instance. - */ - reflow: function() { - var i; - - if (this.visible()) { - Control.repaintControls = []; - Control.repaintControls.map = {}; - - this.recalc(); - i = Control.repaintControls.length; - - while (i--) { - Control.repaintControls[i].repaint(); - } - - // TODO: Fix me! - if (this.settings.layout !== "flow" && this.settings.layout !== "stack") { - this.repaint(); - } - - Control.repaintControls = []; - } - - return this; - } - }); -}); - -// Included from: js/tinymce/classes/ui/DragHelper.js - -/** - * DragHelper.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Drag/drop helper class. - * - * @example - * var dragHelper = new tinymce.ui.DragHelper('mydiv', { - * start: function(evt) { - * }, - * - * drag: function(evt) { - * }, - * - * end: function(evt) { - * } - * }); - * - * @class tinymce.ui.DragHelper - */ -define("tinymce/ui/DragHelper", [ - "tinymce/ui/DomUtils" -], function(DomUtils) { - "use strict"; - - function getDocumentSize() { - var doc = document, documentElement, body, scrollWidth, clientWidth; - var offsetWidth, scrollHeight, clientHeight, offsetHeight, max = Math.max; - - documentElement = doc.documentElement; - body = doc.body; - - scrollWidth = max(documentElement.scrollWidth, body.scrollWidth); - clientWidth = max(documentElement.clientWidth, body.clientWidth); - offsetWidth = max(documentElement.offsetWidth, body.offsetWidth); - - scrollHeight = max(documentElement.scrollHeight, body.scrollHeight); - clientHeight = max(documentElement.clientHeight, body.clientHeight); - offsetHeight = max(documentElement.offsetHeight, body.offsetHeight); - - return { - width: scrollWidth < offsetWidth ? clientWidth : scrollWidth, - height: scrollHeight < offsetHeight ? clientHeight : scrollHeight - }; - } - - return function(id, settings) { - var eventOverlayElm, doc = document, downButton, start, stop, drag, startX, startY; - - settings = settings || {}; - - function getHandleElm() { - return doc.getElementById(settings.handle || id); - } - - start = function(e) { - var docSize = getDocumentSize(), handleElm, cursor; - - e.preventDefault(); - downButton = e.button; - handleElm = getHandleElm(); - startX = e.screenX; - startY = e.screenY; - - // Grab cursor from handle - if (window.getComputedStyle) { - cursor = window.getComputedStyle(handleElm, null).getPropertyValue("cursor"); - } else { - cursor = handleElm.runtimeStyle.cursor; - } - - // Create event overlay and add it to document - eventOverlayElm = doc.createElement('div'); - DomUtils.css(eventOverlayElm, { - position: "absolute", - top: 0, left: 0, - width: docSize.width, - height: docSize.height, - zIndex: 0x7FFFFFFF, - opacity: 0.0001, - background: 'red', - cursor: cursor - }); - - doc.body.appendChild(eventOverlayElm); - - // Bind mouse events - DomUtils.on(doc, 'mousemove', drag); - DomUtils.on(doc, 'mouseup', stop); - - // Begin drag - settings.start(e); - }; - - drag = function(e) { - if (e.button !== downButton) { - return stop(e); - } - - e.deltaX = e.screenX - startX; - e.deltaY = e.screenY - startY; - - e.preventDefault(); - settings.drag(e); - }; - - stop = function(e) { - DomUtils.off(doc, 'mousemove', drag); - DomUtils.off(doc, 'mouseup', stop); - - eventOverlayElm.parentNode.removeChild(eventOverlayElm); - - if (settings.stop) { - settings.stop(e); - } - }; - - /** - * Destroys the drag/drop helper instance. - * - * @method destroy - */ - this.destroy = function() { - DomUtils.off(getHandleElm()); - }; - - DomUtils.on(getHandleElm(), 'mousedown', start); - }; -}); - -// Included from: js/tinymce/classes/ui/Scrollable.js - -/** - * Scrollable.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This mixin makes controls scrollable using custom scrollbars. - * - * @-x-less Scrollable.less - * @mixin tinymce.ui.Scrollable - */ -define("tinymce/ui/Scrollable", [ - "tinymce/ui/DomUtils", - "tinymce/ui/DragHelper" -], function(DomUtils, DragHelper) { - "use strict"; - - return { - init: function() { - var self = this; - self.on('repaint', self.renderScroll); - }, - - renderScroll: function() { - var self = this, margin = 2; - - function repaintScroll() { - var hasScrollH, hasScrollV, bodyElm; - - function repaintAxis(axisName, posName, sizeName, contentSizeName, hasScroll, ax) { - var containerElm, scrollBarElm, scrollThumbElm; - var containerSize, scrollSize, ratio, rect; - var posNameLower, sizeNameLower; - - scrollBarElm = self.getEl('scroll' + axisName); - if (scrollBarElm) { - posNameLower = posName.toLowerCase(); - sizeNameLower = sizeName.toLowerCase(); - - if (self.getEl('absend')) { - DomUtils.css(self.getEl('absend'), posNameLower, self.layoutRect()[contentSizeName] - 1); - } - - if (!hasScroll) { - DomUtils.css(scrollBarElm, 'display', 'none'); - return; - } - - DomUtils.css(scrollBarElm, 'display', 'block'); - containerElm = self.getEl('body'); - scrollThumbElm = self.getEl('scroll' + axisName + "t"); - containerSize = containerElm["client" + sizeName] - (margin * 2); - containerSize -= hasScrollH && hasScrollV ? scrollBarElm["client" + ax] : 0; - scrollSize = containerElm["scroll" + sizeName]; - ratio = containerSize / scrollSize; - - rect = {}; - rect[posNameLower] = containerElm["offset" + posName] + margin; - rect[sizeNameLower] = containerSize; - DomUtils.css(scrollBarElm, rect); - - rect = {}; - rect[posNameLower] = containerElm["scroll" + posName] * ratio; - rect[sizeNameLower] = containerSize * ratio; - DomUtils.css(scrollThumbElm, rect); - } - } - - bodyElm = self.getEl('body'); - hasScrollH = bodyElm.scrollWidth > bodyElm.clientWidth; - hasScrollV = bodyElm.scrollHeight > bodyElm.clientHeight; - - repaintAxis("h", "Left", "Width", "contentW", hasScrollH, "Height"); - repaintAxis("v", "Top", "Height", "contentH", hasScrollV, "Width"); - } - - function addScroll() { - function addScrollAxis(axisName, posName, sizeName, deltaPosName, ax) { - var scrollStart, axisId = self._id + '-scroll' + axisName, prefix = self.classPrefix; - - self.getEl().appendChild(DomUtils.createFragment( - '
    ' + - '
    ' + - '
    ' - )); - - self.draghelper = new DragHelper(axisId + 't', { - start: function() { - scrollStart = self.getEl('body')["scroll" + posName]; - DomUtils.addClass(DomUtils.get(axisId), prefix + 'active'); - }, - - drag: function(e) { - var ratio, hasScrollH, hasScrollV, containerSize, layoutRect = self.layoutRect(); - - hasScrollH = layoutRect.contentW > layoutRect.innerW; - hasScrollV = layoutRect.contentH > layoutRect.innerH; - containerSize = self.getEl('body')["client" + sizeName] - (margin * 2); - containerSize -= hasScrollH && hasScrollV ? self.getEl('scroll' + axisName)["client" + ax] : 0; - - ratio = containerSize / self.getEl('body')["scroll" + sizeName]; - self.getEl('body')["scroll" + posName] = scrollStart + (e["delta" + deltaPosName] / ratio); - }, - - stop: function() { - DomUtils.removeClass(DomUtils.get(axisId), prefix + 'active'); - } - }); -/* - self.on('click', function(e) { - if (e.target.id == self._id + '-scrollv') { - - } - });*/ - } - - self.addClass('scroll'); - - addScrollAxis("v", "Top", "Height", "Y", "Width"); - addScrollAxis("h", "Left", "Width", "X", "Height"); - } - - if (self.settings.autoScroll) { - if (!self._hasScroll) { - self._hasScroll = true; - addScroll(); - - self.on('wheel', function(e) { - var bodyEl = self.getEl('body'); - - bodyEl.scrollLeft += (e.deltaX || 0) * 10; - bodyEl.scrollTop += e.deltaY * 10; - - repaintScroll(); - }); - - DomUtils.on(self.getEl('body'), "scroll", repaintScroll); - } - - repaintScroll(); - } - } - }; -}); - -// Included from: js/tinymce/classes/ui/Panel.js - -/** - * Panel.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a new panel. - * - * @-x-less Panel.less - * @class tinymce.ui.Panel - * @extends tinymce.ui.Container - * @mixes tinymce.ui.Scrollable - */ -define("tinymce/ui/Panel", [ - "tinymce/ui/Container", - "tinymce/ui/Scrollable" -], function(Container, Scrollable) { - "use strict"; - - return Container.extend({ - Defaults: { - layout: 'fit', - containerCls: 'panel' - }, - - Mixins: [Scrollable], - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, layout = self._layout, innerHtml = self.settings.html; - - self.preRender(); - layout.preRender(self); - - if (typeof(innerHtml) == "undefined") { - innerHtml = ( - '
    ' + - layout.renderHtml(self) + - '
    ' - ); - } else { - if (typeof(innerHtml) == 'function') { - innerHtml = innerHtml.call(self); - } - - self._hasBody = false; - } - - return ( - '
    ' + - (self._preBodyHtml || '') + - innerHtml + - '
    ' - ); - } - }); -}); - -// Included from: js/tinymce/classes/ui/Movable.js - -/** - * Movable.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Movable mixin. Makes controls movable absolute and relative to other elements. - * - * @mixin tinymce.ui.Movable - */ -define("tinymce/ui/Movable", [ - "tinymce/ui/DomUtils" -], function(DomUtils) { - "use strict"; - - function calculateRelativePosition(ctrl, targetElm, rel) { - var ctrlElm, pos, x, y, selfW, selfH, targetW, targetH, viewport, size; - - viewport = DomUtils.getViewPort(); - - // Get pos of target - pos = DomUtils.getPos(targetElm); - x = pos.x; - y = pos.y; - - if (ctrl._fixed) { - x -= viewport.x; - y -= viewport.y; - } - - // Get size of self - ctrlElm = ctrl.getEl(); - size = DomUtils.getSize(ctrlElm); - selfW = size.width; - selfH = size.height; - - // Get size of target - size = DomUtils.getSize(targetElm); - targetW = size.width; - targetH = size.height; - - // Parse align string - rel = (rel || '').split(''); - - // Target corners - if (rel[0] === 'b') { - y += targetH; - } - - if (rel[1] === 'r') { - x += targetW; - } - - if (rel[0] === 'c') { - y += Math.round(targetH / 2); - } - - if (rel[1] === 'c') { - x += Math.round(targetW / 2); - } - - // Self corners - if (rel[3] === 'b') { - y -= selfH; - } - - if (rel[4] === 'r') { - x -= selfW; - } - - if (rel[3] === 'c') { - y -= Math.round(selfH / 2); - } - - if (rel[4] === 'c') { - x -= Math.round(selfW / 2); - } - - return { - x: x, - y: y, - w: selfW, - h: selfH - }; - } - - return { - /** - * Tests various positions to get the most suitable one. - * - * @method testMoveRel - * @param {DOMElement} elm Element to position against. - * @param {Array} rels Array with relative positions. - * @return {String} Best suitable relative position. - */ - testMoveRel: function(elm, rels) { - var viewPortRect = DomUtils.getViewPort(); - - for (var i = 0; i < rels.length; i++) { - var pos = calculateRelativePosition(this, elm, rels[i]); - - if (this._fixed) { - if (pos.x > 0 && pos.x + pos.w < viewPortRect.w && pos.y > 0 && pos.y + pos.h < viewPortRect.h) { - return rels[i]; - } - } else { - if (pos.x > viewPortRect.x && pos.x + pos.w < viewPortRect.w + viewPortRect.x && - pos.y > viewPortRect.y && pos.y + pos.h < viewPortRect.h + viewPortRect.y) { - return rels[i]; - } - } - } - - return rels[0]; - }, - - /** - * Move relative to the specified element. - * - * @method moveRel - * @param {Element} elm Element to move relative to. - * @param {String} rel Relative mode. For example: br-tl. - * @return {tinymce.ui.Control} Current control instance. - */ - moveRel: function(elm, rel) { - if (typeof(rel) != 'string') { - rel = this.testMoveRel(elm, rel); - } - - var pos = calculateRelativePosition(this, elm, rel); - return this.moveTo(pos.x, pos.y); - }, - - /** - * Move by a relative x, y values. - * - * @method moveBy - * @param {Number} dx Relative x position. - * @param {Number} dy Relative y position. - * @return {tinymce.ui.Control} Current control instance. - */ - moveBy: function(dx, dy) { - var self = this, rect = self.layoutRect(); - - self.moveTo(rect.x + dx, rect.y + dy); - - return self; - }, - - /** - * Move to absolute position. - * - * @method moveTo - * @param {Number} x Absolute x position. - * @param {Number} y Absolute y position. - * @return {tinymce.ui.Control} Current control instance. - */ - moveTo: function(x, y) { - var self = this; - - // TODO: Move this to some global class - function contrain(value, max, size) { - if (value < 0) { - return 0; - } - - if (value + size > max) { - value = max - size; - return value < 0 ? 0 : value; - } - - return value; - } - - if (self.settings.constrainToViewport) { - var viewPortRect = DomUtils.getViewPort(window); - var layoutRect = self.layoutRect(); - - x = contrain(x, viewPortRect.w + viewPortRect.x, layoutRect.w); - y = contrain(y, viewPortRect.h + viewPortRect.y, layoutRect.h); - } - - if (self._rendered) { - self.layoutRect({x: x, y: y}).repaint(); - } else { - self.settings.x = x; - self.settings.y = y; - } - - self.fire('move', {x: x, y: y}); - - return self; - } - }; -}); - -// Included from: js/tinymce/classes/ui/Resizable.js - -/** - * Resizable.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Resizable mixin. Enables controls to be resized. - * - * @mixin tinymce.ui.Resizable - */ -define("tinymce/ui/Resizable", [ - "tinymce/ui/DomUtils" -], function(DomUtils) { - "use strict"; - - return { - /** - * Resizes the control to contents. - * - * @method resizeToContent - */ - resizeToContent: function() { - this._layoutRect.autoResize = true; - this._lastRect = null; - this.reflow(); - }, - - /** - * Resizes the control to a specific width/height. - * - * @method resizeTo - * @param {Number} w Control width. - * @param {Number} h Control height. - * @return {tinymce.ui.Control} Current control instance. - */ - resizeTo: function(w, h) { - // TODO: Fix hack - if (w <= 1 || h <= 1) { - var rect = DomUtils.getWindowSize(); - - w = w <= 1 ? w * rect.w : w; - h = h <= 1 ? h * rect.h : h; - } - - this._layoutRect.autoResize = false; - return this.layoutRect({minW: w, minH: h, w: w, h: h}).reflow(); - }, - - /** - * Resizes the control to a specific relative width/height. - * - * @method resizeBy - * @param {Number} dw Relative control width. - * @param {Number} dh Relative control height. - * @return {tinymce.ui.Control} Current control instance. - */ - resizeBy: function(dw, dh) { - var self = this, rect = self.layoutRect(); - - return self.resizeTo(rect.w + dw, rect.h + dh); - } - }; -}); - -// Included from: js/tinymce/classes/ui/FloatPanel.js - -/** - * FloatPanel.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class creates a floating panel. - * - * @-x-less FloatPanel.less - * @class tinymce.ui.FloatPanel - * @extends tinymce.ui.Panel - * @mixes tinymce.ui.Movable - * @mixes tinymce.ui.Resizable - */ -define("tinymce/ui/FloatPanel", [ - "tinymce/ui/Panel", - "tinymce/ui/Movable", - "tinymce/ui/Resizable", - "tinymce/ui/DomUtils" -], function(Panel, Movable, Resizable, DomUtils) { - "use strict"; - - var documentClickHandler, documentScrollHandler, visiblePanels = []; - var zOrder = [], hasModal; - - var FloatPanel = Panel.extend({ - Mixins: [Movable, Resizable], - - /** - * Constructs a new control instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - * @setting {Boolean} autohide Automatically hide the panel. - */ - init: function(settings) { - var self = this; - - function reorder() { - var i, zIndex = FloatPanel.zIndex || 0xFFFF, topModal; - - if (zOrder.length) { - for (i = 0; i < zOrder.length; i++) { - if (zOrder[i].modal) { - zIndex++; - topModal = zOrder[i]; - } - - zOrder[i].getEl().style.zIndex = zIndex; - zOrder[i].zIndex = zIndex; - zIndex++; - } - } - - var modalBlockEl = document.getElementById(self.classPrefix + 'modal-block'); - - if (topModal) { - DomUtils.css(modalBlockEl, 'z-index', topModal.zIndex - 1); - } else if (modalBlockEl) { - modalBlockEl.parentNode.removeChild(modalBlockEl); - hasModal = false; - } - - FloatPanel.currentZIndex = zIndex; - } - - function isChildOf(ctrl, parent) { - while (ctrl) { - if (ctrl == parent) { - return true; - } - - ctrl = ctrl.parent(); - } - } - - /** - * Repositions the panel to the top of page if the panel is outside of the visual viewport. It will - * also reposition all child panels of the current panel. - */ - function repositionPanel(panel) { - var scrollY = DomUtils.getViewPort().y; - - function toggleFixedChildPanels(fixed, deltaY) { - var parent; - - for (var i = 0; i < visiblePanels.length; i++) { - if (visiblePanels[i] != panel) { - parent = visiblePanels[i].parent(); - - while (parent && (parent = parent.parent())) { - if (parent == panel) { - visiblePanels[i].fixed(fixed).moveBy(0, deltaY).repaint(); - } - } - } - } - } - - if (panel.settings.autofix) { - if (!panel._fixed) { - panel._autoFixY = panel.layoutRect().y; - - if (panel._autoFixY < scrollY) { - panel.fixed(true).layoutRect({y: 0}).repaint(); - toggleFixedChildPanels(true, scrollY - panel._autoFixY); - } - } else { - if (panel._autoFixY > scrollY) { - panel.fixed(false).layoutRect({y: panel._autoFixY}).repaint(); - toggleFixedChildPanels(false, panel._autoFixY - scrollY); - } - } - } - } - - self._super(settings); - self._eventsRoot = self; - - self.addClass('floatpanel'); - - // Hide floatpanes on click out side the root button - if (settings.autohide) { - if (!documentClickHandler) { - documentClickHandler = function(e) { - // Hide any float panel when a click is out side that float panel and the - // float panels direct parent for example a click on a menu button - var i = visiblePanels.length; - while (i--) { - var panel = visiblePanels[i], clickCtrl = panel.getParentCtrl(e.target); - - if (panel.settings.autohide) { - if (clickCtrl) { - if (isChildOf(clickCtrl, panel) || panel.parent() === clickCtrl) { - continue; - } - } - - e = panel.fire('autohide', {target: e.target}); - if (!e.isDefaultPrevented()) { - panel.hide(); - } - } - } - }; - - DomUtils.on(document, 'click', documentClickHandler); - } - - visiblePanels.push(self); - } - - if (settings.autofix) { - if (!documentScrollHandler) { - documentScrollHandler = function() { - var i; - - i = visiblePanels.length; - while (i--) { - repositionPanel(visiblePanels[i]); - } - }; - - DomUtils.on(window, 'scroll', documentScrollHandler); - } - - self.on('move', function() { - repositionPanel(this); - }); - } - - self.on('postrender show', function(e) { - if (e.control == self) { - var modalBlockEl, prefix = self.classPrefix; - - if (self.modal && !hasModal) { - modalBlockEl = DomUtils.createFragment('
    '); - modalBlockEl = modalBlockEl.firstChild; - - self.getContainerElm().appendChild(modalBlockEl); - - setTimeout(function() { - DomUtils.addClass(modalBlockEl, prefix + 'in'); - DomUtils.addClass(self.getEl(), prefix + 'in'); - }, 0); - - hasModal = true; - } - - zOrder.push(self); - reorder(); - } - }); - - self.on('close hide', function(e) { - if (e.control == self) { - var i = zOrder.length; - - while (i--) { - if (zOrder[i] === self) { - zOrder.splice(i, 1); - } - } - - reorder(); - } - }); - - self.on('show', function() { - self.parents().each(function(ctrl) { - if (ctrl._fixed) { - self.fixed(true); - return false; - } - }); - }); - - if (settings.popover) { - self._preBodyHtml = '
    '; - self.addClass('popover').addClass('bottom').addClass(self.isRtl() ? 'end' : 'start'); - } - }, - - fixed: function(state) { - var self = this; - - if (self._fixed != state) { - if (self._rendered) { - var viewport = DomUtils.getViewPort(); - - if (state) { - self.layoutRect().y -= viewport.y; - } else { - self.layoutRect().y += viewport.y; - } - } - - self.toggleClass('fixed', state); - self._fixed = state; - } - - return self; - }, - - /** - * Shows the current float panel. - * - * @method show - * @return {tinymce.ui.FloatPanel} Current floatpanel instance. - */ - show: function() { - var self = this, i, state = self._super(); - - i = visiblePanels.length; - while (i--) { - if (visiblePanels[i] === self) { - break; - } - } - - if (i === -1) { - visiblePanels.push(self); - } - - return state; - }, - - /** - * Hides the current float panel. - * - * @method hide - * @return {tinymce.ui.FloatPanel} Current floatpanel instance. - */ - hide: function() { - removeVisiblePanel(this); - return this._super(); - }, - - /** - * Hides all visible the float panels. - * - * @method hideAll - */ - hideAll: function() { - FloatPanel.hideAll(); - }, - - /** - * Closes the float panel. This will remove the float panel from page and fire the close event. - * - * @method close - */ - close: function() { - var self = this; - - self.fire('close'); - - return self.remove(); - }, - - /** - * Removes the float panel from page. - * - * @method remove - */ - remove: function() { - removeVisiblePanel(this); - this._super(); - }, - - postRender: function() { - var self = this; - - if (self.settings.bodyRole) { - this.getEl('body').setAttribute('role', self.settings.bodyRole); - } - - return self._super(); - } - }); - - /** - * Hides all visible the float panels. - * - * @static - * @method hideAll - */ - FloatPanel.hideAll = function() { - var i = visiblePanels.length; - - while (i--) { - var panel = visiblePanels[i]; - - if (panel && panel.settings.autohide) { - panel.hide(); - visiblePanels.splice(i, 1); - } - } - }; - - function removeVisiblePanel(panel) { - var i; - - i = visiblePanels.length; - while (i--) { - if (visiblePanels[i] === panel) { - visiblePanels.splice(i, 1); - } - } - - i = zOrder.length; - while (i--) { - if (zOrder[i] === panel) { - zOrder.splice(i, 1); - } - } - } - - return FloatPanel; -}); - -// Included from: js/tinymce/classes/ui/Window.js - -/** - * Window.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a new window. - * - * @-x-less Window.less - * @class tinymce.ui.Window - * @extends tinymce.ui.FloatPanel - */ -define("tinymce/ui/Window", [ - "tinymce/ui/FloatPanel", - "tinymce/ui/Panel", - "tinymce/ui/DomUtils", - "tinymce/ui/DragHelper" -], function(FloatPanel, Panel, DomUtils, DragHelper) { - "use strict"; - - var Window = FloatPanel.extend({ - modal: true, - - Defaults: { - border: 1, - layout: 'flex', - containerCls: 'panel', - role: 'dialog', - callbacks: { - submit: function() { - this.fire('submit', {data: this.toJSON()}); - }, - - close: function() { - this.close(); - } - } - }, - - /** - * Constructs a instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - */ - init: function(settings) { - var self = this; - - self._super(settings); - - if (self.isRtl()) { - self.addClass('rtl'); - } - - self.addClass('window'); - self._fixed = true; - - // Create statusbar - if (settings.buttons) { - self.statusbar = new Panel({ - layout: 'flex', - border: '1 0 0 0', - spacing: 3, - padding: 10, - align: 'center', - pack: self.isRtl() ? 'start' : 'end', - defaults: { - type: 'button' - }, - items: settings.buttons - }); - - self.statusbar.addClass('foot'); - self.statusbar.parent(self); - } - - self.on('click', function(e) { - if (e.target.className.indexOf(self.classPrefix + 'close') != -1) { - self.close(); - } - }); - - self.on('cancel', function() { - self.close(); - }); - - self.aria('describedby', self.describedBy || self._id + '-none'); - self.aria('label', settings.title); - self._fullscreen = false; - }, - - /** - * Recalculates the positions of the controls in the current container. - * This is invoked by the reflow method and shouldn't be called directly. - * - * @method recalc - */ - recalc: function() { - var self = this, statusbar = self.statusbar, layoutRect, width, x, needsRecalc; - - if (self._fullscreen) { - self.layoutRect(DomUtils.getWindowSize()); - self.layoutRect().contentH = self.layoutRect().innerH; - } - - self._super(); - - layoutRect = self.layoutRect(); - - // Resize window based on title width - if (self.settings.title && !self._fullscreen) { - width = layoutRect.headerW; - if (width > layoutRect.w) { - x = layoutRect.x - Math.max(0, width / 2); - self.layoutRect({w: width, x: x}); - needsRecalc = true; - } - } - - // Resize window based on statusbar width - if (statusbar) { - statusbar.layoutRect({w: self.layoutRect().innerW}).recalc(); - - width = statusbar.layoutRect().minW + layoutRect.deltaW; - if (width > layoutRect.w) { - x = layoutRect.x - Math.max(0, width - layoutRect.w); - self.layoutRect({w: width, x: x}); - needsRecalc = true; - } - } - - // Recalc body and disable auto resize - if (needsRecalc) { - self.recalc(); - } - }, - - /** - * Initializes the current controls layout rect. - * This will be executed by the layout managers to determine the - * default minWidth/minHeight etc. - * - * @method initLayoutRect - * @return {Object} Layout rect instance. - */ - initLayoutRect: function() { - var self = this, layoutRect = self._super(), deltaH = 0, headEl; - - // Reserve vertical space for title - if (self.settings.title && !self._fullscreen) { - headEl = self.getEl('head'); - - var size = DomUtils.getSize(headEl); - - layoutRect.headerW = size.width; - layoutRect.headerH = size.height; - - deltaH += layoutRect.headerH; - } - - // Reserve vertical space for statusbar - if (self.statusbar) { - deltaH += self.statusbar.layoutRect().h; - } - - layoutRect.deltaH += deltaH; - layoutRect.minH += deltaH; - //layoutRect.innerH -= deltaH; - layoutRect.h += deltaH; - - var rect = DomUtils.getWindowSize(); - - layoutRect.x = Math.max(0, rect.w / 2 - layoutRect.w / 2); - layoutRect.y = Math.max(0, rect.h / 2 - layoutRect.h / 2); - - return layoutRect; - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, layout = self._layout, id = self._id, prefix = self.classPrefix; - var settings = self.settings, headerHtml = '', footerHtml = '', html = settings.html; - - self.preRender(); - layout.preRender(self); - - if (settings.title) { - headerHtml = ( - '
    ' + - '
    ' + self.encode(settings.title) + '
    ' + - '' + - '
    ' + - '
    ' - ); - } - - if (settings.url) { - html = ''; - } - - if (typeof(html) == "undefined") { - html = layout.renderHtml(self); - } - - if (self.statusbar) { - footerHtml = self.statusbar.renderHtml(); - } - - return ( - '
    ' + - '
    ' + - headerHtml + - '
    ' + - html + - '
    ' + - footerHtml + - '
    ' + - '
    ' - ); - }, - - /** - * Switches the window fullscreen mode. - * - * @method fullscreen - * @param {Boolean} state True/false state. - * @return {tinymce.ui.Window} Current window instance. - */ - fullscreen: function(state) { - var self = this, documentElement = document.documentElement, slowRendering, prefix = self.classPrefix, layoutRect; - - if (state != self._fullscreen) { - DomUtils.on(window, 'resize', function() { - var time; - - if (self._fullscreen) { - // Time the layout time if it's to slow use a timeout to not hog the CPU - if (!slowRendering) { - time = new Date().getTime(); - - var rect = DomUtils.getWindowSize(); - self.moveTo(0, 0).resizeTo(rect.w, rect.h); - - if ((new Date().getTime()) - time > 50) { - slowRendering = true; - } - } else { - if (!self._timer) { - self._timer = setTimeout(function() { - var rect = DomUtils.getWindowSize(); - self.moveTo(0, 0).resizeTo(rect.w, rect.h); - - self._timer = 0; - }, 50); - } - } - } - }); - - layoutRect = self.layoutRect(); - self._fullscreen = state; - - if (!state) { - self._borderBox = self.parseBox(self.settings.border); - self.getEl('head').style.display = ''; - layoutRect.deltaH += layoutRect.headerH; - DomUtils.removeClass(documentElement, prefix + 'fullscreen'); - DomUtils.removeClass(document.body, prefix + 'fullscreen'); - self.removeClass('fullscreen'); - self.moveTo(self._initial.x, self._initial.y).resizeTo(self._initial.w, self._initial.h); - } else { - self._initial = {x: layoutRect.x, y: layoutRect.y, w: layoutRect.w, h: layoutRect.h}; - - self._borderBox = self.parseBox('0'); - self.getEl('head').style.display = 'none'; - layoutRect.deltaH -= layoutRect.headerH + 2; - DomUtils.addClass(documentElement, prefix + 'fullscreen'); - DomUtils.addClass(document.body, prefix + 'fullscreen'); - self.addClass('fullscreen'); - - var rect = DomUtils.getWindowSize(); - self.moveTo(0, 0).resizeTo(rect.w, rect.h); - } - } - - return self.reflow(); - }, - - /** - * Called after the control has been rendered. - * - * @method postRender - */ - postRender: function() { - var self = this, startPos; - - setTimeout(function() { - self.addClass('in'); - }, 0); - - self._super(); - - if (self.statusbar) { - self.statusbar.postRender(); - } - - self.focus(); - - this.dragHelper = new DragHelper(self._id + '-dragh', { - start: function() { - startPos = { - x: self.layoutRect().x, - y: self.layoutRect().y - }; - }, - - drag: function(e) { - self.moveTo(startPos.x + e.deltaX, startPos.y + e.deltaY); - } - }); - - self.on('submit', function(e) { - if (!e.isDefaultPrevented()) { - self.close(); - } - }); - }, - - /** - * Fires a submit event with the serialized form. - * - * @method submit - * @return {Object} Event arguments object. - */ - submit: function() { - return this.fire('submit', {data: this.toJSON()}); - }, - - /** - * Removes the current control from DOM and from UI collections. - * - * @method remove - * @return {tinymce.ui.Control} Current control instance. - */ - remove: function() { - var self = this, prefix = self.classPrefix; - - self.dragHelper.destroy(); - self._super(); - - if (self.statusbar) { - this.statusbar.remove(); - } - - if (self._fullscreen) { - DomUtils.removeClass(document.documentElement, prefix + 'fullscreen'); - DomUtils.removeClass(document.body, prefix + 'fullscreen'); - } - } - }); - - return Window; -}); - -// Included from: js/tinymce/classes/ui/MessageBox.js - -/** - * MessageBox.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class is used to create MessageBoxes like alerts/confirms etc. - * - * @class tinymce.ui.Window - * @extends tinymce.ui.FloatPanel - */ -define("tinymce/ui/MessageBox", [ - "tinymce/ui/Window" -], function(Window) { - "use strict"; - - var MessageBox = Window.extend({ - /** - * Constructs a instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - */ - init: function(settings) { - settings = { - border: 1, - padding: 20, - layout: 'flex', - pack: "center", - align: "center", - containerCls: 'panel', - autoScroll: true, - buttons: {type: "button", text: "Ok", action: "ok"}, - items: { - type: "label", - multiline: true, - maxWidth: 500, - maxHeight: 200 - } - }; - - this._super(settings); - }, - - Statics: { - /** - * Ok buttons constant. - * - * @static - * @final - * @field {Number} OK - */ - OK: 1, - - /** - * Ok/cancel buttons constant. - * - * @static - * @final - * @field {Number} OK_CANCEL - */ - OK_CANCEL: 2, - - /** - * yes/no buttons constant. - * - * @static - * @final - * @field {Number} YES_NO - */ - YES_NO: 3, - - /** - * yes/no/cancel buttons constant. - * - * @static - * @final - * @field {Number} YES_NO_CANCEL - */ - YES_NO_CANCEL: 4, - - /** - * Constructs a new message box and renders it to the body element. - * - * @static - * @method msgBox - * @param {Object} settings Name/value object with settings. - */ - msgBox: function(settings) { - var buttons, callback = settings.callback || function() {}; - - switch (settings.buttons) { - case MessageBox.OK_CANCEL: - buttons = [ - {type: "button", text: "Ok", subtype: "primary", onClick: function(e) { - e.control.parents()[1].close(); - callback(true); - }}, - - {type: "button", text: "Cancel", onClick: function(e) { - e.control.parents()[1].close(); - callback(false); - }} - ]; - break; - - case MessageBox.YES_NO: - buttons = [ - {type: "button", text: "Ok", subtype: "primary", onClick: function(e) { - e.control.parents()[1].close(); - callback(true); - }} - ]; - break; - - case MessageBox.YES_NO_CANCEL: - buttons = [ - {type: "button", text: "Ok", subtype: "primary", onClick: function(e) { - e.control.parents()[1].close(); - }} - ]; - break; - - default: - buttons = [ - {type: "button", text: "Ok", subtype: "primary", onClick: function(e) { - e.control.parents()[1].close(); - callback(true); - }} - ]; - break; - } - - return new Window({ - padding: 20, - x: settings.x, - y: settings.y, - minWidth: 300, - minHeight: 100, - layout: "flex", - pack: "center", - align: "center", - buttons: buttons, - title: settings.title, - role: 'alertdialog', - items: { - type: "label", - multiline: true, - maxWidth: 500, - maxHeight: 200, - text: settings.text - }, - onPostRender: function() { - this.aria('describedby', this.items()[0]._id); - }, - onClose: settings.onClose, - onCancel: function() { - callback(false); - } - }).renderTo(document.body).reflow(); - }, - - /** - * Creates a new alert dialog. - * - * @method alert - * @param {Object} settings Settings for the alert dialog. - * @param {function} [callback] Callback to execute when the user makes a choice. - */ - alert: function(settings, callback) { - if (typeof(settings) == "string") { - settings = {text: settings}; - } - - settings.callback = callback; - return MessageBox.msgBox(settings); - }, - - /** - * Creates a new confirm dialog. - * - * @method confirm - * @param {Object} settings Settings for the confirm dialog. - * @param {function} [callback] Callback to execute when the user makes a choice. - */ - confirm: function(settings, callback) { - if (typeof(settings) == "string") { - settings = {text: settings}; - } - - settings.callback = callback; - settings.buttons = MessageBox.OK_CANCEL; - - return MessageBox.msgBox(settings); - } - } - }); - - return MessageBox; -}); - -// Included from: js/tinymce/classes/WindowManager.js - -/** - * WindowManager.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class handles the creation of native windows and dialogs. This class can be extended to provide for example inline dialogs. - * - * @class tinymce.WindowManager - * @example - * // Opens a new dialog with the file.htm file and the size 320x240 - * // It also adds a custom parameter this can be retrieved by using tinyMCEPopup.getWindowArg inside the dialog. - * tinymce.activeEditor.windowManager.open({ - * url: 'file.htm', - * width: 320, - * height: 240 - * }, { - * custom_param: 1 - * }); - * - * // Displays an alert box using the active editors window manager instance - * tinymce.activeEditor.windowManager.alert('Hello world!'); - * - * // Displays an confirm box and an alert message will be displayed depending on what you choose in the confirm - * tinymce.activeEditor.windowManager.confirm("Do you want to do something", function(s) { - * if (s) - * tinymce.activeEditor.windowManager.alert("Ok"); - * else - * tinymce.activeEditor.windowManager.alert("Cancel"); - * }); - */ -define("tinymce/WindowManager", [ - "tinymce/ui/Window", - "tinymce/ui/MessageBox" -], function(Window, MessageBox) { - return function(editor) { - var self = this, windows = []; - - function getTopMostWindow() { - if (windows.length) { - return windows[windows.length - 1]; - } - } - - self.windows = windows; - - /** - * Opens a new window. - * - * @method open - * @param {Object} args Optional name/value settings collection contains things like width/height/url etc. - * @option {String} title Window title. - * @option {String} file URL of the file to open in the window. - * @option {Number} width Width in pixels. - * @option {Number} height Height in pixels. - * @option {Boolean} resizable Specifies whether the popup window is resizable or not. - * @option {Boolean} maximizable Specifies whether the popup window has a "maximize" button and can get maximized or not. - * @option {String/Boolean} scrollbars Specifies whether the popup window can have scrollbars if required (i.e. content - * larger than the popup size specified). - */ - self.open = function(args, params) { - var win; - - editor.editorManager.activeEditor = editor; - - args.title = args.title || ' '; - - // Handle URL - args.url = args.url || args.file; // Legacy - if (args.url) { - args.width = parseInt(args.width || 320, 10); - args.height = parseInt(args.height || 240, 10); - } - - // Handle body - if (args.body) { - args.items = { - defaults: args.defaults, - type: args.bodyType || 'form', - items: args.body - }; - } - - if (!args.url && !args.buttons) { - args.buttons = [ - {text: 'Ok', subtype: 'primary', onclick: function() { - win.find('form')[0].submit(); - }}, - - {text: 'Cancel', onclick: function() { - win.close(); - }} - ]; - } - - win = new Window(args); - windows.push(win); - - win.on('close', function() { - var i = windows.length; - - while (i--) { - if (windows[i] === win) { - windows.splice(i, 1); - } - } - - editor.focus(); - }); - - // Handle data - if (args.data) { - win.on('postRender', function() { - this.find('*').each(function(ctrl) { - var name = ctrl.name(); - - if (name in args.data) { - ctrl.value(args.data[name]); - } - }); - }); - } - - // store args and parameters - win.features = args || {}; - win.params = params || {}; - - // Takes a snapshot in the FocusManager of the selection before focus is lost to dialog - editor.nodeChanged(); - - return win.renderTo(document.body).reflow(); - }; - - /** - * Creates a alert dialog. Please don't use the blocking behavior of this - * native version use the callback method instead then it can be extended. - * - * @method alert - * @param {String} message Text to display in the new alert dialog. - * @param {function} callback Callback function to be executed after the user has selected ok. - * @param {Object} scope Optional scope to execute the callback in. - * @example - * // Displays an alert box using the active editors window manager instance - * tinymce.activeEditor.windowManager.alert('Hello world!'); - */ - self.alert = function(message, callback, scope) { - MessageBox.alert(message, function() { - if (callback) { - callback.call(scope || this); - } else { - editor.focus(); - } - }); - }; - - /** - * Creates a confirm dialog. Please don't use the blocking behavior of this - * native version use the callback method instead then it can be extended. - * - * @method confirm - * @param {String} messageText to display in the new confirm dialog. - * @param {function} callback Callback function to be executed after the user has selected ok or cancel. - * @param {Object} scope Optional scope to execute the callback in. - * @example - * // Displays an confirm box and an alert message will be displayed depending on what you choose in the confirm - * tinymce.activeEditor.windowManager.confirm("Do you want to do something", function(s) { - * if (s) - * tinymce.activeEditor.windowManager.alert("Ok"); - * else - * tinymce.activeEditor.windowManager.alert("Cancel"); - * }); - */ - self.confirm = function(message, callback, scope) { - MessageBox.confirm(message, function(state) { - callback.call(scope || this, state); - }); - }; - - /** - * Closes the top most window. - * - * @method close - */ - self.close = function() { - if (getTopMostWindow()) { - getTopMostWindow().close(); - } - }; - - /** - * Returns the params of the last window open call. This can be used in iframe based - * dialog to get params passed from the tinymce plugin. - * - * @example - * var dialogArguments = top.tinymce.activeEditor.windowManager.getParams(); - * - * @method getParams - * @return {Object} Name/value object with parameters passed from windowManager.open call. - */ - self.getParams = function() { - return getTopMostWindow() ? getTopMostWindow().params : null; - }; - - /** - * Sets the params of the last opened window. - * - * @method setParams - * @param {Object} params Params object to set for the last opened window. - */ - self.setParams = function(params) { - if (getTopMostWindow()) { - getTopMostWindow().params = params; - } - }; - }; -}); - -// Included from: js/tinymce/classes/util/Quirks.js - -/** - * Quirks.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - * - * @ignore-file - */ - -/** - * This file includes fixes for various browser quirks it's made to make it easy to add/remove browser specific fixes. - * - * @class tinymce.util.Quirks - */ -define("tinymce/util/Quirks", [ - "tinymce/util/VK", - "tinymce/dom/RangeUtils", - "tinymce/html/Node", - "tinymce/html/Entities", - "tinymce/Env", - "tinymce/util/Tools" -], function(VK, RangeUtils, Node, Entities, Env, Tools) { - return function(editor) { - var each = Tools.each; - var BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE, dom = editor.dom, selection = editor.selection, - settings = editor.settings, parser = editor.parser, serializer = editor.serializer; - var isGecko = Env.gecko, isIE = Env.ie, isWebKit = Env.webkit; - - /** - * Executes a command with a specific state this can be to enable/disable browser editing features. - */ - function setEditorCommandState(cmd, state) { - try { - editor.getDoc().execCommand(cmd, false, state); - } catch (ex) { - // Ignore - } - } - - /** - * Returns current IE document mode. - */ - function getDocumentMode() { - var documentMode = editor.getDoc().documentMode; - - return documentMode ? documentMode : 6; - } - - /** - * Returns true/false if the event is prevented or not. - * - * @private - * @param {Event} e Event object. - * @return {Boolean} true/false if the event is prevented or not. - */ - function isDefaultPrevented(e) { - return e.isDefaultPrevented(); - } - - /** - * Fixes a WebKit bug when deleting contents using backspace or delete key. - * WebKit will produce a span element if you delete across two block elements. - * - * Example: - *

    a

    |b

    - * - * Will produce this on backspace: - *

    ab

    - * - * This fixes the backspace to produce: - *

    a|b

    - * - * See bug: https://bugs.webkit.org/show_bug.cgi?id=45784 - * - * This fixes the following delete scenarios: - * 1. Delete by pressing backspace key. - * 2. Delete by pressing delete key. - * 3. Delete by pressing backspace key with ctrl/cmd (Word delete). - * 4. Delete by pressing delete key with ctrl/cmd (Word delete). - * 5. Delete by drag/dropping contents inside the editor. - * 6. Delete by using Cut Ctrl+X/Cmd+X. - * 7. Delete by selecting contents and writing a character.' - * - * This code is a ugly hack since writing full custom delete logic for just this bug - * fix seemed like a huge task. I hope we can remove this before the year 2030. - */ - function cleanupStylesWhenDeleting() { - var doc = editor.getDoc(), urlPrefix = 'data:text/mce-internal,'; - var MutationObserver = window.MutationObserver, olderWebKit; - - // Add mini polyfill for older WebKits - // TODO: Remove this when old Safari versions gets updated - if (!MutationObserver) { - olderWebKit = true; - - MutationObserver = function() { - var records = [], target; - - function nodeInsert(e) { - var target = e.relatedNode || e.target; - records.push({target: target, addedNodes: [target]}); - } - - function attrModified(e) { - var target = e.relatedNode || e.target; - records.push({target: target, attributeName: e.attrName}); - } - - this.observe = function(node) { - target = node; - target.addEventListener('DOMSubtreeModified', nodeInsert, false); - target.addEventListener('DOMNodeInsertedIntoDocument', nodeInsert, false); - target.addEventListener('DOMNodeInserted', nodeInsert, false); - target.addEventListener('DOMAttrModified', attrModified, false); - }; - - this.disconnect = function() { - target.removeEventListener('DOMNodeInserted', nodeInsert); - target.removeEventListener('DOMAttrModified', attrModified); - target.removeEventListener('DOMSubtreeModified', nodeInsert, false); - }; - - this.takeRecords = function() { - return records; - }; - }; - } - - function customDelete(isForward) { - var mutationObserver = new MutationObserver(function() {}); - - Tools.each(editor.getBody().getElementsByTagName('*'), function(elm) { - // Mark existing spans - if (elm.tagName == 'SPAN') { - elm.setAttribute('mce-data-marked', 1); - } - - // Make sure all elements has a data-mce-style attribute - if (!elm.hasAttribute('data-mce-style') && elm.hasAttribute('style')) { - editor.dom.setAttrib(elm, 'style', elm.getAttribute('style')); - } - }); - - // Observe added nodes and style attribute changes - mutationObserver.observe(editor.getDoc(), { - childList: true, - attributes: true, - subtree: true, - attributeFilter: ['style'] - }); - - editor.getDoc().execCommand(isForward ? 'ForwardDelete' : 'Delete', false, null); - - var rng = editor.selection.getRng(); - var caretElement = rng.startContainer.parentNode; - - Tools.each(mutationObserver.takeRecords(), function(record) { - // Restore style attribute to previous value - if (record.attributeName == "style") { - var oldValue = record.target.getAttribute('data-mce-style'); - - if (oldValue) { - record.target.setAttribute("style", oldValue); - } else { - record.target.removeAttribute("style"); - } - } - - // Remove all spans that isn't maked and retain selection - Tools.each(record.addedNodes, function(node) { - if (node.nodeName == "SPAN" && !node.getAttribute('mce-data-marked')) { - var offset, container; - - if (node == caretElement) { - offset = rng.startOffset; - container = node.firstChild; - } - - dom.remove(node, true); - - if (container) { - rng.setStart(container, offset); - rng.setEnd(container, offset); - editor.selection.setRng(rng); - } - } - }); - }); - - mutationObserver.disconnect(); - - // Remove any left over marks - Tools.each(editor.dom.select('span[mce-data-marked]'), function(span) { - span.removeAttribute('mce-data-marked'); - }); - } - - editor.on('keydown', function(e) { - var isForward = e.keyCode == DELETE, isMeta = VK.metaKeyPressed(e); - - if (!isDefaultPrevented(e) && (isForward || e.keyCode == BACKSPACE)) { - var rng = editor.selection.getRng(), container = rng.startContainer, offset = rng.startOffset; - - // Ignore non meta delete in the where there is text before/after the caret - if (!isMeta && rng.collapsed && container.nodeType == 3) { - if (isForward ? offset < container.data.length : offset > 0) { - return; - } - } - - e.preventDefault(); - - if (isMeta) { - editor.selection.getSel().modify("extend", isForward ? "forward" : "backward", "word"); - } - - customDelete(isForward); - } - }); - - editor.on('keypress', function(e) { - if (!isDefaultPrevented(e) && !selection.isCollapsed() && e.charCode && !VK.metaKeyPressed(e)) { - e.preventDefault(); - customDelete(true); - editor.selection.setContent(String.fromCharCode(e.charCode)); - } - }); - - editor.addCommand('Delete', function() { - customDelete(); - }); - - editor.addCommand('ForwardDelete', function() { - customDelete(true); - }); - - // Older WebKits doesn't properly handle the clipboard so we can't add the rest - if (olderWebKit) { - return; - } - - editor.on('dragstart', function(e) { - // Safari doesn't support custom dataTransfer items so we can only use URL and Text - e.dataTransfer.setData('URL', 'data:text/mce-internal,' + escape(editor.selection.getContent())); - }); - - editor.on('drop', function(e) { - if (!isDefaultPrevented(e)) { - var internalContent = e.dataTransfer.getData('URL'); - - if (!internalContent || internalContent.indexOf(urlPrefix) == -1 || !doc.caretRangeFromPoint) { - return; - } - - internalContent = unescape(internalContent.substr(urlPrefix.length)); - if (doc.caretRangeFromPoint) { - e.preventDefault(); - customDelete(); - editor.selection.setRng(doc.caretRangeFromPoint(e.x, e.y)); - editor.insertContent(internalContent); - } - } - }); - - editor.on('cut', function(e) { - if (!isDefaultPrevented(e) && e.clipboardData) { - e.preventDefault(); - e.clipboardData.clearData(); - e.clipboardData.setData('text/html', editor.selection.getContent()); - e.clipboardData.setData('text/plain', editor.selection.getContent({format: 'text'})); - customDelete(true); - } - }); - } - - /** - * Makes sure that the editor body becomes empty when backspace or delete is pressed in empty editors. - * - * For example: - *

    |

    - * - * Or: - *

    |

    - * - * Or: - * [

    ] - */ - function emptyEditorWhenDeleting() { - function serializeRng(rng) { - var body = dom.create("body"); - var contents = rng.cloneContents(); - body.appendChild(contents); - return selection.serializer.serialize(body, {format: 'html'}); - } - - function allContentsSelected(rng) { - if (!rng.setStart) { - if (rng.item) { - return false; - } - - var bodyRng = rng.duplicate(); - bodyRng.moveToElementText(editor.getBody()); - return RangeUtils.compareRanges(rng, bodyRng); - } - - var selection = serializeRng(rng); - - var allRng = dom.createRng(); - allRng.selectNode(editor.getBody()); - - var allSelection = serializeRng(allRng); - return selection === allSelection; - } - - editor.on('keydown', function(e) { - var keyCode = e.keyCode, isCollapsed, body; - - // Empty the editor if it's needed for example backspace at

    |

    - if (!isDefaultPrevented(e) && (keyCode == DELETE || keyCode == BACKSPACE)) { - isCollapsed = editor.selection.isCollapsed(); - body = editor.getBody(); - - // Selection is collapsed but the editor isn't empty - if (isCollapsed && !dom.isEmpty(body)) { - return; - } - - // Selection isn't collapsed but not all the contents is selected - if (!isCollapsed && !allContentsSelected(editor.selection.getRng())) { - return; - } - - // Manually empty the editor - e.preventDefault(); - editor.setContent(''); - - if (body.firstChild && dom.isBlock(body.firstChild)) { - editor.selection.setCursorLocation(body.firstChild, 0); - } else { - editor.selection.setCursorLocation(body, 0); - } - - editor.nodeChanged(); - } - }); - } - - /** - * WebKit doesn't select all the nodes in the body when you press Ctrl+A. - * IE selects more than the contents [

    a

    ] instead of

    [a] see bug #6438 - * This selects the whole body so that backspace/delete logic will delete everything - */ - function selectAll() { - editor.on('keydown', function(e) { - if (!isDefaultPrevented(e) && e.keyCode == 65 && VK.metaKeyPressed(e)) { - e.preventDefault(); - editor.execCommand('SelectAll'); - } - }); - } - - /** - * WebKit has a weird issue where it some times fails to properly convert keypresses to input method keystrokes. - * The IME on Mac doesn't initialize when it doesn't fire a proper focus event. - * - * This seems to happen when the user manages to click the documentElement element then the window doesn't get proper focus until - * you enter a character into the editor. - * - * It also happens when the first focus in made to the body. - * - * See: https://bugs.webkit.org/show_bug.cgi?id=83566 - */ - function inputMethodFocus() { - if (!editor.settings.content_editable) { - // Case 1 IME doesn't initialize if you focus the document - dom.bind(editor.getDoc(), 'focusin', function() { - selection.setRng(selection.getRng()); - }); - - // Case 2 IME doesn't initialize if you click the documentElement it also doesn't properly fire the focusin event - dom.bind(editor.getDoc(), 'mousedown', function(e) { - if (e.target == editor.getDoc().documentElement) { - editor.getBody().focus(); - selection.setRng(selection.getRng()); - } - }); - } - } - - /** - * Backspacing in FireFox/IE from a paragraph into a horizontal rule results in a floating text node because the - * browser just deletes the paragraph - the browser fails to merge the text node with a horizontal rule so it is - * left there. TinyMCE sees a floating text node and wraps it in a paragraph on the key up event (ForceBlocks.js - * addRootBlocks), meaning the action does nothing. With this code, FireFox/IE matche the behaviour of other - * browsers. - * - * It also fixes a bug on Firefox where it's impossible to delete HR elements. - */ - function removeHrOnBackspace() { - editor.on('keydown', function(e) { - if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) { - if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) { - var node = selection.getNode(); - var previousSibling = node.previousSibling; - - if (node.nodeName == 'HR') { - dom.remove(node); - e.preventDefault(); - return; - } - - if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "hr") { - dom.remove(previousSibling); - e.preventDefault(); - } - } - } - }); - } - - /** - * Firefox 3.x has an issue where the body element won't get proper focus if you click out - * side it's rectangle. - */ - function focusBody() { - // Fix for a focus bug in FF 3.x where the body element - // wouldn't get proper focus if the user clicked on the HTML element - if (!window.Range.prototype.getClientRects) { // Detect getClientRects got introduced in FF 4 - editor.on('mousedown', function(e) { - if (!isDefaultPrevented(e) && e.target.nodeName === "HTML") { - var body = editor.getBody(); - - // Blur the body it's focused but not correctly focused - body.blur(); - - // Refocus the body after a little while - setTimeout(function() { - body.focus(); - }, 0); - } - }); - } - } - - /** - * WebKit has a bug where it isn't possible to select image, hr or anchor elements - * by clicking on them so we need to fake that. - */ - function selectControlElements() { - editor.on('click', function(e) { - e = e.target; - - // Workaround for bug, http://bugs.webkit.org/show_bug.cgi?id=12250 - // WebKit can't even do simple things like selecting an image - // Needs tobe the setBaseAndExtend or it will fail to select floated images - if (/^(IMG|HR)$/.test(e.nodeName)) { - selection.getSel().setBaseAndExtent(e, 0, e, 1); - } - - if (e.nodeName == 'A' && dom.hasClass(e, 'mce-item-anchor')) { - selection.select(e); - } - - editor.nodeChanged(); - }); - } - - /** - * Fixes a Gecko bug where the style attribute gets added to the wrong element when deleting between two block elements. - * - * Fixes do backspace/delete on this: - *

    bla[ck

    r]ed

    - * - * Would become: - *

    bla|ed

    - * - * Instead of: - *

    bla|ed

    - */ - function removeStylesWhenDeletingAcrossBlockElements() { - function getAttributeApplyFunction() { - var template = dom.getAttribs(selection.getStart().cloneNode(false)); - - return function() { - var target = selection.getStart(); - - if (target !== editor.getBody()) { - dom.setAttrib(target, "style", null); - - each(template, function(attr) { - target.setAttributeNode(attr.cloneNode(true)); - }); - } - }; - } - - function isSelectionAcrossElements() { - return !selection.isCollapsed() && - dom.getParent(selection.getStart(), dom.isBlock) != dom.getParent(selection.getEnd(), dom.isBlock); - } - - editor.on('keypress', function(e) { - var applyAttributes; - - if (!isDefaultPrevented(e) && (e.keyCode == 8 || e.keyCode == 46) && isSelectionAcrossElements()) { - applyAttributes = getAttributeApplyFunction(); - editor.getDoc().execCommand('delete', false, null); - applyAttributes(); - e.preventDefault(); - return false; - } - }); - - dom.bind(editor.getDoc(), 'cut', function(e) { - var applyAttributes; - - if (!isDefaultPrevented(e) && isSelectionAcrossElements()) { - applyAttributes = getAttributeApplyFunction(); - - setTimeout(function() { - applyAttributes(); - }, 0); - } - }); - } - - /** - * Fire a nodeChanged when the selection is changed on WebKit this fixes selection issues on iOS5. It only fires the nodeChange - * event every 50ms since it would other wise update the UI when you type and it hogs the CPU. - */ - function selectionChangeNodeChanged() { - var lastRng, selectionTimer; - - editor.on('selectionchange', function() { - if (selectionTimer) { - clearTimeout(selectionTimer); - selectionTimer = 0; - } - - selectionTimer = window.setTimeout(function() { - if (editor.removed) { - return; - } - - var rng = selection.getRng(); - - // Compare the ranges to see if it was a real change or not - if (!lastRng || !RangeUtils.compareRanges(rng, lastRng)) { - editor.nodeChanged(); - lastRng = rng; - } - }, 50); - }); - } - - /** - * Screen readers on IE needs to have the role application set on the body. - */ - function ensureBodyHasRoleApplication() { - document.body.setAttribute("role", "application"); - } - - /** - * Backspacing into a table behaves differently depending upon browser type. - * Therefore, disable Backspace when cursor immediately follows a table. - */ - function disableBackspaceIntoATable() { - editor.on('keydown', function(e) { - if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) { - if (selection.isCollapsed() && selection.getRng(true).startOffset === 0) { - var previousSibling = selection.getNode().previousSibling; - if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === "table") { - e.preventDefault(); - return false; - } - } - } - }); - } - - /** - * Old IE versions can't properly render BR elements in PRE tags white in contentEditable mode. So this - * logic adds a \n before the BR so that it will get rendered. - */ - function addNewLinesBeforeBrInPre() { - // IE8+ rendering mode does the right thing with BR in PRE - if (getDocumentMode() > 7) { - return; - } - - // Enable display: none in area and add a specific class that hides all BR elements in PRE to - // avoid the caret from getting stuck at the BR elements while pressing the right arrow key - setEditorCommandState('RespectVisibilityInDesign', true); - editor.contentStyles.push('.mceHideBrInPre pre br {display: none}'); - dom.addClass(editor.getBody(), 'mceHideBrInPre'); - - // Adds a \n before all BR elements in PRE to get them visual - parser.addNodeFilter('pre', function(nodes) { - var i = nodes.length, brNodes, j, brElm, sibling; - - while (i--) { - brNodes = nodes[i].getAll('br'); - j = brNodes.length; - while (j--) { - brElm = brNodes[j]; - - // Add \n before BR in PRE elements on older IE:s so the new lines get rendered - sibling = brElm.prev; - if (sibling && sibling.type === 3 && sibling.value.charAt(sibling.value - 1) != '\n') { - sibling.value += '\n'; - } else { - brElm.parent.insert(new Node('#text', 3), brElm, true).value = '\n'; - } - } - } - }); - - // Removes any \n before BR elements in PRE since other browsers and in contentEditable=false mode they will be visible - serializer.addNodeFilter('pre', function(nodes) { - var i = nodes.length, brNodes, j, brElm, sibling; - - while (i--) { - brNodes = nodes[i].getAll('br'); - j = brNodes.length; - while (j--) { - brElm = brNodes[j]; - sibling = brElm.prev; - if (sibling && sibling.type == 3) { - sibling.value = sibling.value.replace(/\r?\n$/, ''); - } - } - } - }); - } - - /** - * Moves style width/height to attribute width/height when the user resizes an image on IE. - */ - function removePreSerializedStylesWhenSelectingControls() { - dom.bind(editor.getBody(), 'mouseup', function() { - var value, node = selection.getNode(); - - // Moved styles to attributes on IMG eements - if (node.nodeName == 'IMG') { - // Convert style width to width attribute - if ((value = dom.getStyle(node, 'width'))) { - dom.setAttrib(node, 'width', value.replace(/[^0-9%]+/g, '')); - dom.setStyle(node, 'width', ''); - } - - // Convert style height to height attribute - if ((value = dom.getStyle(node, 'height'))) { - dom.setAttrib(node, 'height', value.replace(/[^0-9%]+/g, '')); - dom.setStyle(node, 'height', ''); - } - } - }); - } - - /** - * Removes a blockquote when backspace is pressed at the beginning of it. - * - * For example: - *

    |x

    - * - * Becomes: - *

    |x

    - */ - function removeBlockQuoteOnBackSpace() { - // Add block quote deletion handler - editor.on('keydown', function(e) { - var rng, container, offset, root, parent; - - if (isDefaultPrevented(e) || e.keyCode != VK.BACKSPACE) { - return; - } - - rng = selection.getRng(); - container = rng.startContainer; - offset = rng.startOffset; - root = dom.getRoot(); - parent = container; - - if (!rng.collapsed || offset !== 0) { - return; - } - - while (parent && parent.parentNode && parent.parentNode.firstChild == parent && parent.parentNode != root) { - parent = parent.parentNode; - } - - // Is the cursor at the beginning of a blockquote? - if (parent.tagName === 'BLOCKQUOTE') { - // Remove the blockquote - editor.formatter.toggle('blockquote', null, parent); - - // Move the caret to the beginning of container - rng = dom.createRng(); - rng.setStart(container, 0); - rng.setEnd(container, 0); - selection.setRng(rng); - } - }); - } - - /** - * Sets various Gecko editing options on mouse down and before a execCommand to disable inline table editing that is broken etc. - */ - function setGeckoEditingOptions() { - function setOpts() { - editor._refreshContentEditable(); - - setEditorCommandState("StyleWithCSS", false); - setEditorCommandState("enableInlineTableEditing", false); - - if (!settings.object_resizing) { - setEditorCommandState("enableObjectResizing", false); - } - } - - if (!settings.readonly) { - editor.on('BeforeExecCommand MouseDown', setOpts); - } - } - - /** - * Fixes a gecko link bug, when a link is placed at the end of block elements there is - * no way to move the caret behind the link. This fix adds a bogus br element after the link. - * - * For example this: - *

    x

    - * - * Becomes this: - *

    x

    - */ - function addBrAfterLastLinks() { - function fixLinks() { - each(dom.select('a'), function(node) { - var parentNode = node.parentNode, root = dom.getRoot(); - - if (parentNode.lastChild === node) { - while (parentNode && !dom.isBlock(parentNode)) { - if (parentNode.parentNode.lastChild !== parentNode || parentNode === root) { - return; - } - - parentNode = parentNode.parentNode; - } - - dom.add(parentNode, 'br', {'data-mce-bogus': 1}); - } - }); - } - - editor.on('SetContent ExecCommand', function(e) { - if (e.type == "setcontent" || e.command === 'mceInsertLink') { - fixLinks(); - } - }); - } - - /** - * WebKit will produce DIV elements here and there by default. But since TinyMCE uses paragraphs by - * default we want to change that behavior. - */ - function setDefaultBlockType() { - if (settings.forced_root_block) { - editor.on('init', function() { - setEditorCommandState('DefaultParagraphSeparator', settings.forced_root_block); - }); - } - } - - /** - * Removes ghost selections from images/tables on Gecko. - */ - function removeGhostSelection() { - editor.on('Undo Redo SetContent', function(e) { - if (!e.initial) { - editor.execCommand('mceRepaint'); - } - }); - } - - /** - * Deletes the selected image on IE instead of navigating to previous page. - */ - function deleteControlItemOnBackSpace() { - editor.on('keydown', function(e) { - var rng; - - if (!isDefaultPrevented(e) && e.keyCode == BACKSPACE) { - rng = editor.getDoc().selection.createRange(); - if (rng && rng.item) { - e.preventDefault(); - editor.undoManager.beforeChange(); - dom.remove(rng.item(0)); - editor.undoManager.add(); - } - } - }); - } - - /** - * IE10 doesn't properly render block elements with the right height until you add contents to them. - * This fixes that by adding a padding-right to all empty text block elements. - * See: https://connect.microsoft.com/IE/feedback/details/743881 - */ - function renderEmptyBlocksFix() { - var emptyBlocksCSS; - - // IE10+ - if (getDocumentMode() >= 10) { - emptyBlocksCSS = ''; - each('p div h1 h2 h3 h4 h5 h6'.split(' '), function(name, i) { - emptyBlocksCSS += (i > 0 ? ',' : '') + name + ':empty'; - }); - - editor.contentStyles.push(emptyBlocksCSS + '{padding-right: 1px !important}'); - } - } - - /** - * Old IE versions can't retain contents within noscript elements so this logic will store the contents - * as a attribute and the insert that value as it's raw text when the DOM is serialized. - */ - function keepNoScriptContents() { - if (getDocumentMode() < 9) { - parser.addNodeFilter('noscript', function(nodes) { - var i = nodes.length, node, textNode; - - while (i--) { - node = nodes[i]; - textNode = node.firstChild; - - if (textNode) { - node.attr('data-mce-innertext', textNode.value); - } - } - }); - - serializer.addNodeFilter('noscript', function(nodes) { - var i = nodes.length, node, textNode, value; - - while (i--) { - node = nodes[i]; - textNode = nodes[i].firstChild; - - if (textNode) { - textNode.value = Entities.decode(textNode.value); - } else { - // Old IE can't retain noscript value so an attribute is used to store it - value = node.attributes.map['data-mce-innertext']; - if (value) { - node.attr('data-mce-innertext', null); - textNode = new Node('#text', 3); - textNode.value = value; - textNode.raw = true; - node.append(textNode); - } - } - } - }); - } - } - - /** - * IE has an issue where you can't select/move the caret by clicking outside the body if the document is in standards mode. - */ - function fixCaretSelectionOfDocumentElementOnIe() { - var doc = dom.doc, body = doc.body, started, startRng, htmlElm; - - // Return range from point or null if it failed - function rngFromPoint(x, y) { - var rng = body.createTextRange(); - - try { - rng.moveToPoint(x, y); - } catch (ex) { - // IE sometimes throws and exception, so lets just ignore it - rng = null; - } - - return rng; - } - - // Fires while the selection is changing - function selectionChange(e) { - var pointRng; - - // Check if the button is down or not - if (e.button) { - // Create range from mouse position - pointRng = rngFromPoint(e.x, e.y); - - if (pointRng) { - // Check if pointRange is before/after selection then change the endPoint - if (pointRng.compareEndPoints('StartToStart', startRng) > 0) { - pointRng.setEndPoint('StartToStart', startRng); - } else { - pointRng.setEndPoint('EndToEnd', startRng); - } - - pointRng.select(); - } - } else { - endSelection(); - } - } - - // Removes listeners - function endSelection() { - var rng = doc.selection.createRange(); - - // If the range is collapsed then use the last start range - if (startRng && !rng.item && rng.compareEndPoints('StartToEnd', rng) === 0) { - startRng.select(); - } - - dom.unbind(doc, 'mouseup', endSelection); - dom.unbind(doc, 'mousemove', selectionChange); - startRng = started = 0; - } - - // Make HTML element unselectable since we are going to handle selection by hand - doc.documentElement.unselectable = true; - - // Detect when user selects outside BODY - dom.bind(doc, 'mousedown contextmenu', function(e) { - if (e.target.nodeName === 'HTML') { - if (started) { - endSelection(); - } - - // Detect vertical scrollbar, since IE will fire a mousedown on the scrollbar and have target set as HTML - htmlElm = doc.documentElement; - if (htmlElm.scrollHeight > htmlElm.clientHeight) { - return; - } - - started = 1; - // Setup start position - startRng = rngFromPoint(e.x, e.y); - if (startRng) { - // Listen for selection change events - dom.bind(doc, 'mouseup', endSelection); - dom.bind(doc, 'mousemove', selectionChange); - - dom.getRoot().focus(); - startRng.select(); - } - } - }); - } - - /** - * Fixes selection issues where the caret can be placed between two inline elements like a|b - * this fix will lean the caret right into the closest inline element. - */ - function normalizeSelection() { - // Normalize selection for example a|a becomes a|a except for Ctrl+A since it selects everything - editor.on('keyup focusin mouseup', function(e) { - if (e.keyCode != 65 || !VK.metaKeyPressed(e)) { - selection.normalize(); - } - }, true); - } - - /** - * Forces Gecko to render a broken image icon if it fails to load an image. - */ - function showBrokenImageIcon() { - editor.contentStyles.push( - 'img:-moz-broken {' + - '-moz-force-broken-image-icon:1;' + - 'min-width:24px;' + - 'min-height:24px' + - '}' - ); - } - - /** - * iOS has a bug where it's impossible to type if the document has a touchstart event - * bound and the user touches the document while having the on screen keyboard visible. - * - * The touch event moves the focus to the parent document while having the caret inside the iframe - * this fix moves the focus back into the iframe document. - */ - function restoreFocusOnKeyDown() { - if (!editor.inline) { - editor.on('keydown', function() { - if (document.activeElement == document.body) { - editor.getWin().focus(); - } - }); - } - } - - /** - * IE 11 has an annoying issue where you can't move focus into the editor - * by clicking on the white area HTML element. We used to be able to to fix this with - * the fixCaretSelectionOfDocumentElementOnIe fix. But since M$ removed the selection - * object it's not possible anymore. So we need to hack in a ungly CSS to force the - * body to be at least 150px. If the user clicks the HTML element out side this 150px region - * we simply move the focus into the first paragraph. Not ideal since you loose the - * positioning of the caret but goot enough for most cases. - */ - function bodyHeight() { - if (!editor.inline) { - editor.contentStyles.push('body {min-height: 150px}'); - editor.on('click', function(e) { - if (e.target.nodeName == 'HTML') { - editor.getBody().focus(); - editor.selection.normalize(); - editor.nodeChanged(); - } - }); - } - } - - /** - * Firefox on Mac OS will move the browser back to the previous page if you press CMD+Left arrow. - * You might then loose all your work so we need to block that behavior and replace it with our own. - */ - function blockCmdArrowNavigation() { - if (Env.mac) { - editor.on('keydown', function(e) { - if (VK.metaKeyPressed(e) && (e.keyCode == 37 || e.keyCode == 39)) { - e.preventDefault(); - editor.selection.getSel().modify('move', e.keyCode == 37 ? 'backward' : 'forward', 'word'); - } - }); - } - } - - /** - * Disables the autolinking in IE 9+ this is then re-enabled by the autolink plugin. - */ - function disableAutoUrlDetect() { - setEditorCommandState("AutoUrlDetect", false); - } - - /** - * IE 11 has a fantastic bug where it will produce two trailing BR elements to iframe bodies when - * the iframe is hidden by display: none on a parent container. The DOM is actually out of sync - * with innerHTML in this case. It's like IE adds shadow DOM BR elements that appears on innerHTML - * but not as the lastChild of the body. However is we add a BR element to the body then remove it - * it doesn't seem to add these BR elements makes sence right?! - * - * Example of what happens: text becomes text

    - */ - function doubleTrailingBrElements() { - if (!editor.inline) { - editor.on('focus blur', function() { - var br = editor.dom.create('br'); - editor.getBody().appendChild(br); - br.parentNode.removeChild(br); - }, true); - } - } - - /** - * iOS 7.1 introduced two new bugs: - * 1) It's possible to open links within a contentEditable area by clicking on them. - * 2) If you hold down the finger it will display the link/image touch callout menu. - */ - function tapLinksAndImages() { - editor.on('click', function(e) { - if (e.target.tagName === 'A') { - e.preventDefault(); - } - }); - - editor.contentStyles.push('.mce-content-body {-webkit-touch-callout: none}'); - } - - // All browsers - disableBackspaceIntoATable(); - removeBlockQuoteOnBackSpace(); - emptyEditorWhenDeleting(); - normalizeSelection(); - - // WebKit - if (isWebKit) { - cleanupStylesWhenDeleting(); - inputMethodFocus(); - selectControlElements(); - setDefaultBlockType(); - - // iOS - if (Env.iOS) { - selectionChangeNodeChanged(); - restoreFocusOnKeyDown(); - bodyHeight(); - tapLinksAndImages(); - } else { - selectAll(); - } - } - - // IE - if (isIE && Env.ie < 11) { - removeHrOnBackspace(); - ensureBodyHasRoleApplication(); - addNewLinesBeforeBrInPre(); - removePreSerializedStylesWhenSelectingControls(); - deleteControlItemOnBackSpace(); - renderEmptyBlocksFix(); - keepNoScriptContents(); - fixCaretSelectionOfDocumentElementOnIe(); - } - - if (Env.ie >= 11) { - bodyHeight(); - doubleTrailingBrElements(); - } - - if (Env.ie) { - selectAll(); - disableAutoUrlDetect(); - } - - // Gecko - if (isGecko) { - removeHrOnBackspace(); - focusBody(); - removeStylesWhenDeletingAcrossBlockElements(); - setGeckoEditingOptions(); - addBrAfterLastLinks(); - removeGhostSelection(); - showBrokenImageIcon(); - blockCmdArrowNavigation(); - } - }; -}); - -// Included from: js/tinymce/classes/util/Observable.js - -/** - * Observable.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This mixin will add event binding logic to classes. - * - * @mixin tinymce.util.Observable - */ -define("tinymce/util/Observable", [ - "tinymce/util/Tools" -], function(Tools) { - var bindingsName = "__bindings"; - var nativeEvents = Tools.makeMap( - "focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange" + - " mouseout mouseenter mouseleave keydown keypress keyup contextmenu dragstart dragend dragover draggesture dragdrop drop drag", ' ' - ); - - function returnFalse() { - return false; - } - - function returnTrue() { - return true; - } - - return { - /** - * Fires the specified event by name. - * - * @method fire - * @param {String} name Name of the event to fire. - * @param {tinymce.Event/Object?} args Event arguments. - * @param {Boolean?} bubble True/false if the event is to be bubbled. - * @return {tinymce.Event} Event instance passed in converted into tinymce.Event instance. - * @example - * instance.fire('event', {...}); - */ - fire: function(name, args, bubble) { - var self = this, handlers, i, l, callback, parent; - - if (self.removed) { - return; - } - - name = name.toLowerCase(); - args = args || {}; - args.type = name; - - // Setup target is there isn't one - if (!args.target) { - args.target = self; - } - - // Add event delegation methods if they are missing - if (!args.preventDefault) { - // Add preventDefault method - args.preventDefault = function() { - args.isDefaultPrevented = returnTrue; - }; - - // Add stopPropagation - args.stopPropagation = function() { - args.isPropagationStopped = returnTrue; - }; - - // Add stopImmediatePropagation - args.stopImmediatePropagation = function() { - args.isImmediatePropagationStopped = returnTrue; - }; - - // Add event delegation states - args.isDefaultPrevented = returnFalse; - args.isPropagationStopped = returnFalse; - args.isImmediatePropagationStopped = returnFalse; - } - - //console.log(name, args); - - if (self[bindingsName]) { - handlers = self[bindingsName][name]; - - if (handlers) { - for (i = 0, l = handlers.length; i < l; i++) { - handlers[i] = callback = handlers[i]; - - // Stop immediate propagation if needed - if (args.isImmediatePropagationStopped()) { - break; - } - - // If callback returns false then prevent default and stop all propagation - if (callback.call(self, args) === false) { - args.preventDefault(); - return args; - } - } - } - } - - // Bubble event up to parents - if (bubble !== false && self.parent) { - parent = self.parent(); - while (parent && !args.isPropagationStopped()) { - parent.fire(name, args, false); - parent = parent.parent(); - } - } - - return args; - }, - - /** - * Binds an event listener to a specific event by name. - * - * @method on - * @param {String} name Event name or space separated list of events to bind. - * @param {callback} callback Callback to be executed when the event occurs. - * @param {Boolean} first Optional flag if the event should be prepended. Use this with care. - * @return {Object} Current class instance. - * @example - * instance.on('event', function(e) { - * // Callback logic - * }); - */ - on: function(name, callback, prepend) { - var self = this, bindings, handlers, names, i; - - if (callback === false) { - callback = function() { - return false; - }; - } - - if (callback) { - names = name.toLowerCase().split(' '); - i = names.length; - while (i--) { - name = names[i]; - - bindings = self[bindingsName]; - if (!bindings) { - bindings = self[bindingsName] = {}; - } - - handlers = bindings[name]; - if (!handlers) { - handlers = bindings[name] = []; - if (self.bindNative && nativeEvents[name]) { - self.bindNative(name); - } - } - - if (prepend) { - handlers.unshift(callback); - } else { - handlers.push(callback); - } - } - } - - return self; - }, - - /** - * Unbinds an event listener to a specific event by name. - * - * @method off - * @param {String?} name Name of the event to unbind. - * @param {callback?} callback Callback to unbind. - * @return {Object} Current class instance. - * @example - * // Unbind specific callback - * instance.off('event', handler); - * - * // Unbind all listeners by name - * instance.off('event'); - * - * // Unbind all events - * instance.off(); - */ - off: function(name, callback) { - var self = this, i, bindings = self[bindingsName], handlers, bindingName, names, hi; - - if (bindings) { - if (name) { - names = name.toLowerCase().split(' '); - i = names.length; - while (i--) { - name = names[i]; - handlers = bindings[name]; - - // Unbind all handlers - if (!name) { - for (bindingName in bindings) { - bindings[name].length = 0; - } - - return self; - } - - if (handlers) { - // Unbind all by name - if (!callback) { - handlers.length = 0; - } else { - // Unbind specific ones - hi = handlers.length; - while (hi--) { - if (handlers[hi] === callback) { - handlers.splice(hi, 1); - } - } - } - - if (!handlers.length && self.unbindNative && nativeEvents[name]) { - self.unbindNative(name); - delete bindings[name]; - } - } - } - } else { - if (self.unbindNative) { - for (name in bindings) { - self.unbindNative(name); - } - } - - self[bindingsName] = []; - } - } - - return self; - }, - - hasEventListeners: function(name) { - var bindings = this[bindingsName]; - - name = name.toLowerCase(); - - return !(!bindings || !bindings[name] || bindings[name].length === 0); - } - }; -}); - -// Included from: js/tinymce/classes/Shortcuts.js - -/** - * Shortcuts.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Contains all logic for handling of keyboard shortcuts. - */ -define("tinymce/Shortcuts", [ - "tinymce/util/Tools", - "tinymce/Env" -], function(Tools, Env) { - var each = Tools.each, explode = Tools.explode; - - var keyCodeLookup = { - "f9": 120, - "f10": 121, - "f11": 122 - }; - - return function(editor) { - var self = this, shortcuts = {}; - - editor.on('keyup keypress keydown', function(e) { - if (e.altKey || e.ctrlKey || e.metaKey) { - each(shortcuts, function(shortcut) { - var ctrlKey = Env.mac ? e.metaKey : e.ctrlKey; - - if (shortcut.ctrl != ctrlKey || shortcut.alt != e.altKey || shortcut.shift != e.shiftKey) { - return; - } - - if (e.keyCode == shortcut.keyCode || (e.charCode && e.charCode == shortcut.charCode)) { - e.preventDefault(); - - if (e.type == "keydown") { - shortcut.func.call(shortcut.scope); - } - - return true; - } - }); - } - }); - - /** - * Adds a keyboard shortcut for some command or function. - * - * @method addShortcut - * @param {String} pattern Shortcut pattern. Like for example: ctrl+alt+o. - * @param {String} desc Text description for the command. - * @param {String/Function} cmdFunc Command name string or function to execute when the key is pressed. - * @param {Object} sc Optional scope to execute the function in. - * @return {Boolean} true/false state if the shortcut was added or not. - */ - self.add = function(pattern, desc, cmdFunc, scope) { - var cmd; - - cmd = cmdFunc; - - if (typeof(cmdFunc) === 'string') { - cmdFunc = function() { - editor.execCommand(cmd, false, null); - }; - } else if (Tools.isArray(cmd)) { - cmdFunc = function() { - editor.execCommand(cmd[0], cmd[1], cmd[2]); - }; - } - - each(explode(pattern.toLowerCase()), function(pattern) { - var shortcut = { - func: cmdFunc, - scope: scope || editor, - desc: editor.translate(desc), - alt: false, - ctrl: false, - shift: false - }; - - each(explode(pattern, '+'), function(value) { - switch (value) { - case 'alt': - case 'ctrl': - case 'shift': - shortcut[value] = true; - break; - - default: - shortcut.charCode = value.charCodeAt(0); - shortcut.keyCode = keyCodeLookup[value] || value.toUpperCase().charCodeAt(0); - } - }); - - shortcuts[ - (shortcut.ctrl ? 'ctrl' : '') + ',' + - (shortcut.alt ? 'alt' : '') + ',' + - (shortcut.shift ? 'shift' : '') + ',' + - shortcut.keyCode - ] = shortcut; - }); - - return true; - }; - }; -}); - -// Included from: js/tinymce/classes/Editor.js - -/** - * Editor.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*jshint scripturl:true */ - -/** - * Include the base event class documentation. - * - * @include ../../../tools/docs/tinymce.Event.js - */ - -/** - * This class contains the core logic for a TinyMCE editor. - * - * @class tinymce.Editor - * @mixes tinymce.util.Observable - * @example - * // Add a class to all paragraphs in the editor. - * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'someclass'); - * - * // Gets the current editors selection as text - * tinymce.activeEditor.selection.getContent({format: 'text'}); - * - * // Creates a new editor instance - * var ed = new tinymce.Editor('textareaid', { - * some_setting: 1 - * }, tinymce.EditorManager); - * - * // Select each item the user clicks on - * ed.on('click', function(e) { - * ed.selection.select(e.target); - * }); - * - * ed.render(); - */ -define("tinymce/Editor", [ - "tinymce/dom/DOMUtils", - "tinymce/AddOnManager", - "tinymce/html/Node", - "tinymce/dom/Serializer", - "tinymce/html/Serializer", - "tinymce/dom/Selection", - "tinymce/Formatter", - "tinymce/UndoManager", - "tinymce/EnterKey", - "tinymce/ForceBlocks", - "tinymce/EditorCommands", - "tinymce/util/URI", - "tinymce/dom/ScriptLoader", - "tinymce/dom/EventUtils", - "tinymce/WindowManager", - "tinymce/html/Schema", - "tinymce/html/DomParser", - "tinymce/util/Quirks", - "tinymce/Env", - "tinymce/util/Tools", - "tinymce/util/Observable", - "tinymce/Shortcuts" -], function( - DOMUtils, AddOnManager, Node, DomSerializer, Serializer, - Selection, Formatter, UndoManager, EnterKey, ForceBlocks, EditorCommands, - URI, ScriptLoader, EventUtils, WindowManager, - Schema, DomParser, Quirks, Env, Tools, Observable, Shortcuts -) { - // Shorten these names - var DOM = DOMUtils.DOM, ThemeManager = AddOnManager.ThemeManager, PluginManager = AddOnManager.PluginManager; - var extend = Tools.extend, each = Tools.each, explode = Tools.explode; - var inArray = Tools.inArray, trim = Tools.trim, resolve = Tools.resolve; - var Event = EventUtils.Event; - var isGecko = Env.gecko, ie = Env.ie; - - function getEventTarget(editor, eventName) { - if (eventName == 'selectionchange') { - return editor.getDoc(); - } - - // Need to bind mousedown/mouseup etc to document not body in iframe mode - // Since the user might click on the HTML element not the BODY - if (!editor.inline && /^mouse|click|contextmenu|drop/.test(eventName)) { - return editor.getDoc(); - } - - return editor.getBody(); - } - - /** - * Include documentation for all the events. - * - * @include ../../../tools/docs/tinymce.Editor.js - */ - - /** - * Constructs a editor instance by id. - * - * @constructor - * @method Editor - * @param {String} id Unique id for the editor. - * @param {Object} settings Settings for the editor. - * @param {tinymce.EditorManager} editorManager EditorManager instance. - * @author Moxiecode - */ - function Editor(id, settings, editorManager) { - var self = this, documentBaseUrl, baseUri; - - documentBaseUrl = self.documentBaseUrl = editorManager.documentBaseURL; - baseUri = editorManager.baseURI; - - /** - * Name/value collection with editor settings. - * - * @property settings - * @type Object - * @example - * // Get the value of the theme setting - * tinymce.activeEditor.windowManager.alert("You are using the " + tinymce.activeEditor.settings.theme + " theme"); - */ - self.settings = settings = extend({ - id: id, - theme: 'modern', - delta_width: 0, - delta_height: 0, - popup_css: '', - plugins: '', - document_base_url: documentBaseUrl, - add_form_submit_trigger: true, - submit_patch: true, - add_unload_trigger: true, - convert_urls: true, - relative_urls: true, - remove_script_host: true, - object_resizing: true, - doctype: '', - visual: true, - font_size_style_values: 'xx-small,x-small,small,medium,large,x-large,xx-large', - - // See: http://www.w3.org/TR/CSS2/fonts.html#propdef-font-size - font_size_legacy_values: 'xx-small,small,medium,large,x-large,xx-large,300%', - forced_root_block: 'p', - hidden_input: true, - padd_empty_editor: true, - render_ui: true, - indentation: '30px', - inline_styles: true, - convert_fonts_to_spans: true, - indent: 'simple', - indent_before: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,' + - 'tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist', - indent_after: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,' + - 'tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist', - validate: true, - entity_encoding: 'named', - url_converter: self.convertURL, - url_converter_scope: self, - ie7_compat: true - }, settings); - - AddOnManager.language = settings.language || 'en'; - AddOnManager.languageLoad = settings.language_load; - - AddOnManager.baseURL = editorManager.baseURL; - - /** - * Editor instance id, normally the same as the div/textarea that was replaced. - * - * @property id - * @type String - */ - self.id = settings.id = id; - - /** - * State to force the editor to return false on a isDirty call. - * - * @property isNotDirty - * @type Boolean - * @example - * function ajaxSave() { - * var ed = tinymce.get('elm1'); - * - * // Save contents using some XHR call - * alert(ed.getContent()); - * - * ed.isNotDirty = true; // Force not dirty state - * } - */ - self.isNotDirty = true; - - /** - * Name/Value object containting plugin instances. - * - * @property plugins - * @type Object - * @example - * // Execute a method inside a plugin directly - * tinymce.activeEditor.plugins.someplugin.someMethod(); - */ - self.plugins = {}; - - /** - * URI object to document configured for the TinyMCE instance. - * - * @property documentBaseURI - * @type tinymce.util.URI - * @example - * // Get relative URL from the location of document_base_url - * tinymce.activeEditor.documentBaseURI.toRelative('/somedir/somefile.htm'); - * - * // Get absolute URL from the location of document_base_url - * tinymce.activeEditor.documentBaseURI.toAbsolute('somefile.htm'); - */ - self.documentBaseURI = new URI(settings.document_base_url || documentBaseUrl, { - base_uri: baseUri - }); - - /** - * URI object to current document that holds the TinyMCE editor instance. - * - * @property baseURI - * @type tinymce.util.URI - * @example - * // Get relative URL from the location of the API - * tinymce.activeEditor.baseURI.toRelative('/somedir/somefile.htm'); - * - * // Get absolute URL from the location of the API - * tinymce.activeEditor.baseURI.toAbsolute('somefile.htm'); - */ - self.baseURI = baseUri; - - /** - * Array with CSS files to load into the iframe. - * - * @property contentCSS - * @type Array - */ - self.contentCSS = []; - - /** - * Array of CSS styles to add to head of document when the editor loads. - * - * @property contentStyles - * @type Array - */ - self.contentStyles = []; - - // Creates all events like onClick, onSetContent etc see Editor.Events.js for the actual logic - self.shortcuts = new Shortcuts(self); - - // Internal command handler objects - self.execCommands = {}; - self.queryStateCommands = {}; - self.queryValueCommands = {}; - self.loadedCSS = {}; - - self.suffix = editorManager.suffix; - self.editorManager = editorManager; - self.inline = settings.inline; - - // Call setup - editorManager.fire('SetupEditor', self); - self.execCallback('setup', self); - } - - Editor.prototype = { - /** - * Renderes the editor/adds it to the page. - * - * @method render - */ - render: function() { - var self = this, settings = self.settings, id = self.id, suffix = self.suffix; - - function readyHandler() { - DOM.unbind(window, 'ready', readyHandler); - self.render(); - } - - // Page is not loaded yet, wait for it - if (!Event.domLoaded) { - DOM.bind(window, 'ready', readyHandler); - return; - } - - // Element not found, then skip initialization - if (!self.getElement()) { - return; - } - - // No editable support old iOS versions etc - if (!Env.contentEditable) { - return; - } - - // Hide target element early to prevent content flashing - if (!settings.inline) { - self.orgVisibility = self.getElement().style.visibility; - self.getElement().style.visibility = 'hidden'; - } else { - self.inline = true; - } - - var form = self.getElement().form || DOM.getParent(id, 'form'); - if (form) { - self.formElement = form; - - // Add hidden input for non input elements inside form elements - if (settings.hidden_input && !/TEXTAREA|INPUT/i.test(self.getElement().nodeName)) { - DOM.insertAfter(DOM.create('input', {type: 'hidden', name: id}), id); - self.hasHiddenInput = true; - } - - // Pass submit/reset from form to editor instance - self.formEventDelegate = function(e) { - self.fire(e.type, e); - }; - - DOM.bind(form, 'submit reset', self.formEventDelegate); - - // Reset contents in editor when the form is reset - self.on('reset', function() { - self.setContent(self.startContent, {format: 'raw'}); - }); - - // Check page uses id="submit" or name="submit" for it's submit button - if (settings.submit_patch && !form.submit.nodeType && !form.submit.length && !form._mceOldSubmit) { - form._mceOldSubmit = form.submit; - form.submit = function() { - self.editorManager.triggerSave(); - self.isNotDirty = true; - - return form._mceOldSubmit(form); - }; - } - } - - /** - * Window manager reference, use this to open new windows and dialogs. - * - * @property windowManager - * @type tinymce.WindowManager - * @example - * // Shows an alert message - * tinymce.activeEditor.windowManager.alert('Hello world!'); - * - * // Opens a new dialog with the file.htm file and the size 320x240 - * // It also adds a custom parameter this can be retrieved by using tinyMCEPopup.getWindowArg inside the dialog. - * tinymce.activeEditor.windowManager.open({ - * url: 'file.htm', - * width: 320, - * height: 240 - * }, { - * custom_param: 1 - * }); - */ - self.windowManager = new WindowManager(self); - - if (settings.encoding == 'xml') { - self.on('GetContent', function(e) { - if (e.save) { - e.content = DOM.encode(e.content); - } - }); - } - - if (settings.add_form_submit_trigger) { - self.on('submit', function() { - if (self.initialized) { - self.save(); - } - }); - } - - if (settings.add_unload_trigger) { - self._beforeUnload = function() { - if (self.initialized && !self.destroyed && !self.isHidden()) { - self.save({format: 'raw', no_events: true, set_dirty: false}); - } - }; - - self.editorManager.on('BeforeUnload', self._beforeUnload); - } - - // Load scripts - function loadScripts() { - var scriptLoader = ScriptLoader.ScriptLoader; - - if (settings.language && settings.language != 'en' && !settings.language_url) { - settings.language_url = self.editorManager.baseURL + '/langs/' + settings.language + '.js'; - } - - if (settings.language_url) { - scriptLoader.add(settings.language_url); - } - - if (settings.theme && typeof settings.theme != "function" && - settings.theme.charAt(0) != '-' && !ThemeManager.urls[settings.theme]) { - var themeUrl = settings.theme_url; - - if (themeUrl) { - themeUrl = self.documentBaseURI.toAbsolute(themeUrl); - } else { - themeUrl = 'themes/' + settings.theme + '/theme' + suffix + '.js'; - } - - ThemeManager.load(settings.theme, themeUrl); - } - - if (Tools.isArray(settings.plugins)) { - settings.plugins = settings.plugins.join(' '); - } - - each(settings.external_plugins, function(url, name) { - PluginManager.load(name, url); - settings.plugins += ' ' + name; - }); - - each(settings.plugins.split(/[ ,]/), function(plugin) { - plugin = trim(plugin); - - if (plugin && !PluginManager.urls[plugin]) { - if (plugin.charAt(0) == '-') { - plugin = plugin.substr(1, plugin.length); - - var dependencies = PluginManager.dependencies(plugin); - - each(dependencies, function(dep) { - var defaultSettings = { - prefix:'plugins/', - resource: dep, - suffix:'/plugin' + suffix + '.js' - }; - - dep = PluginManager.createUrl(defaultSettings, dep); - PluginManager.load(dep.resource, dep); - }); - } else { - PluginManager.load(plugin, { - prefix: 'plugins/', - resource: plugin, - suffix: '/plugin' + suffix + '.js' - }); - } - } - }); - - scriptLoader.loadQueue(function() { - if (!self.removed) { - self.init(); - } - }); - } - - loadScripts(); - }, - - /** - * Initializes the editor this will be called automatically when - * all plugins/themes and language packs are loaded by the rendered method. - * This method will setup the iframe and create the theme and plugin instances. - * - * @method init - */ - init: function() { - var self = this, settings = self.settings, elm = self.getElement(); - var w, h, minHeight, n, o, Theme, url, bodyId, bodyClass, re, i, initializedPlugins = []; - - self.rtl = this.editorManager.i18n.rtl; - self.editorManager.add(self); - - settings.aria_label = settings.aria_label || DOM.getAttrib(elm, 'aria-label', self.getLang('aria.rich_text_area')); - - /** - * Reference to the theme instance that was used to generate the UI. - * - * @property theme - * @type tinymce.Theme - * @example - * // Executes a method on the theme directly - * tinymce.activeEditor.theme.someMethod(); - */ - if (settings.theme) { - if (typeof settings.theme != "function") { - settings.theme = settings.theme.replace(/-/, ''); - Theme = ThemeManager.get(settings.theme); - self.theme = new Theme(self, ThemeManager.urls[settings.theme]); - - if (self.theme.init) { - self.theme.init(self, ThemeManager.urls[settings.theme] || self.documentBaseUrl.replace(/\/$/, '')); - } - } else { - self.theme = settings.theme; - } - } - - function initPlugin(plugin) { - var Plugin = PluginManager.get(plugin), pluginUrl, pluginInstance; - - pluginUrl = PluginManager.urls[plugin] || self.documentBaseUrl.replace(/\/$/, ''); - plugin = trim(plugin); - if (Plugin && inArray(initializedPlugins, plugin) === -1) { - each(PluginManager.dependencies(plugin), function(dep){ - initPlugin(dep); - }); - - pluginInstance = new Plugin(self, pluginUrl); - - self.plugins[plugin] = pluginInstance; - - if (pluginInstance.init) { - pluginInstance.init(self, pluginUrl); - initializedPlugins.push(plugin); - } - } - } - - // Create all plugins - each(settings.plugins.replace(/\-/g, '').split(/[ ,]/), initPlugin); - - // Measure box - if (settings.render_ui && self.theme) { - self.orgDisplay = elm.style.display; - - if (typeof settings.theme != "function") { - w = settings.width || elm.style.width || elm.offsetWidth; - h = settings.height || elm.style.height || elm.offsetHeight; - minHeight = settings.min_height || 100; - re = /^[0-9\.]+(|px)$/i; - - if (re.test('' + w)) { - w = Math.max(parseInt(w, 10), 100); - } - - if (re.test('' + h)) { - h = Math.max(parseInt(h, 10), minHeight); - } - - // Render UI - o = self.theme.renderUI({ - targetNode: elm, - width: w, - height: h, - deltaWidth: settings.delta_width, - deltaHeight: settings.delta_height - }); - - // Resize editor - if (!settings.content_editable) { - DOM.setStyles(o.sizeContainer || o.editorContainer, { - wi2dth: w, - // TODO: Fix this - h2eight: h - }); - - h = (o.iframeHeight || h) + (typeof(h) == 'number' ? (o.deltaHeight || 0) : ''); - if (h < minHeight) { - h = minHeight; - } - } - } else { - o = settings.theme(self, elm); - - // Convert element type to id:s - if (o.editorContainer.nodeType) { - o.editorContainer = o.editorContainer.id = o.editorContainer.id || self.id + "_parent"; - } - - // Convert element type to id:s - if (o.iframeContainer.nodeType) { - o.iframeContainer = o.iframeContainer.id = o.iframeContainer.id || self.id + "_iframecontainer"; - } - - // Use specified iframe height or the targets offsetHeight - h = o.iframeHeight || elm.offsetHeight; - } - - self.editorContainer = o.editorContainer; - } - - // Load specified content CSS last - if (settings.content_css) { - each(explode(settings.content_css), function(u) { - self.contentCSS.push(self.documentBaseURI.toAbsolute(u)); - }); - } - - // Load specified content CSS last - if (settings.content_style) { - self.contentStyles.push(settings.content_style); - } - - // Content editable mode ends here - if (settings.content_editable) { - elm = n = o = null; // Fix IE leak - return self.initContentBody(); - } - - self.iframeHTML = settings.doctype + ''; - - // We only need to override paths if we have to - // IE has a bug where it remove site absolute urls to relative ones if this is specified - if (settings.document_base_url != self.documentBaseUrl) { - self.iframeHTML += ''; - } - - // IE8 doesn't support carets behind images setting ie7_compat would force IE8+ to run in IE7 compat mode. - if (!Env.caretAfter && settings.ie7_compat) { - self.iframeHTML += ''; - } - - self.iframeHTML += ''; - - // Load the CSS by injecting them into the HTML this will reduce "flicker" - for (i = 0; i < self.contentCSS.length; i++) { - var cssUrl = self.contentCSS[i]; - self.iframeHTML += ''; - self.loadedCSS[cssUrl] = true; - } - - bodyId = settings.body_id || 'tinymce'; - if (bodyId.indexOf('=') != -1) { - bodyId = self.getParam('body_id', '', 'hash'); - bodyId = bodyId[self.id] || bodyId; - } - - bodyClass = settings.body_class || ''; - if (bodyClass.indexOf('=') != -1) { - bodyClass = self.getParam('body_class', '', 'hash'); - bodyClass = bodyClass[self.id] || ''; - } - - self.iframeHTML += '
    '; - - /*eslint no-script-url:0 */ - var domainRelaxUrl = 'javascript:(function(){' + - 'document.open();document.domain="' + document.domain + '";' + - 'var ed = window.parent.tinymce.get("' + self.id + '");document.write(ed.iframeHTML);' + - 'document.close();ed.initContentBody(true);})()'; - - // Domain relaxing is required since the user has messed around with document.domain - if (document.domain != location.hostname) { - url = domainRelaxUrl; - } - - // Create iframe - // TODO: ACC add the appropriate description on this. - n = DOM.add(o.iframeContainer, 'iframe', { - id: self.id + "_ifr", - src: url || 'javascript:""', // Workaround for HTTPS warning in IE6/7 - frameBorder: '0', - allowTransparency: "true", - title: self.editorManager.translate( - "Rich Text Area. Press ALT-F9 for menu. " + - "Press ALT-F10 for toolbar. Press ALT-0 for help" - ), - style: { - width: '100%', - height: h, - display: 'block' // Important for Gecko to render the iframe correctly - } - }); - - // Try accessing the document this will fail on IE when document.domain is set to the same as location.hostname - // Then we have to force domain relaxing using the domainRelaxUrl approach very ugly!! - if (ie) { - try { - self.getDoc(); - } catch (e) { - n.src = url = domainRelaxUrl; - } - } - - self.contentAreaContainer = o.iframeContainer; - - if (o.editorContainer) { - DOM.get(o.editorContainer).style.display = self.orgDisplay; - } - - DOM.get(self.id).style.display = 'none'; - DOM.setAttrib(self.id, 'aria-hidden', true); - - if (!url) { - self.initContentBody(); - } - - elm = n = o = null; // Cleanup - }, - - /** - * This method get called by the init method ones the iframe is loaded. - * It will fill the iframe with contents, setups DOM and selection objects for the iframe. - * - * @method initContentBody - * @private - */ - initContentBody: function(skipWrite) { - var self = this, settings = self.settings, targetElm = DOM.get(self.id), doc = self.getDoc(), body, contentCssText; - - // Restore visibility on target element - if (!settings.inline) { - self.getElement().style.visibility = self.orgVisibility; - } - - // Setup iframe body - if (!skipWrite && !settings.content_editable) { - doc.open(); - doc.write(self.iframeHTML); - doc.close(); - } - - if (settings.content_editable) { - self.on('remove', function() { - var bodyEl = this.getBody(); - - DOM.removeClass(bodyEl, 'mce-content-body'); - DOM.removeClass(bodyEl, 'mce-edit-focus'); - DOM.setAttrib(bodyEl, 'tabIndex', null); - DOM.setAttrib(bodyEl, 'contentEditable', null); - }); - - DOM.addClass(targetElm, 'mce-content-body'); - targetElm.tabIndex = -1; - self.contentDocument = doc = settings.content_document || document; - self.contentWindow = settings.content_window || window; - self.bodyElement = targetElm; - - // Prevent leak in IE - settings.content_document = settings.content_window = null; - - // TODO: Fix this - settings.root_name = targetElm.nodeName.toLowerCase(); - } - - // It will not steal focus while setting contentEditable - body = self.getBody(); - body.disabled = true; - - if (!settings.readonly) { - if (self.inline && DOM.getStyle(body, 'position', true) == 'static') { - body.style.position = 'relative'; - } - - body.contentEditable = self.getParam('content_editable_state', true); - } - - body.disabled = false; - - /** - * Schema instance, enables you to validate elements and it's children. - * - * @property schema - * @type tinymce.html.Schema - */ - self.schema = new Schema(settings); - - /** - * DOM instance for the editor. - * - * @property dom - * @type tinymce.dom.DOMUtils - * @example - * // Adds a class to all paragraphs within the editor - * tinymce.activeEditor.dom.addClass(tinymce.activeEditor.dom.select('p'), 'someclass'); - */ - self.dom = new DOMUtils(doc, { - keep_values: true, - url_converter: self.convertURL, - url_converter_scope: self, - hex_colors: settings.force_hex_style_colors, - class_filter: settings.class_filter, - update_styles: true, - root_element: settings.content_editable ? self.id : null, - collect: settings.content_editable, - schema: self.schema, - onSetAttrib: function(e) { - self.fire('SetAttrib', e); - } - }); - - /** - * HTML parser will be used when contents is inserted into the editor. - * - * @property parser - * @type tinymce.html.DomParser - */ - self.parser = new DomParser(settings, self.schema); - - // Convert src and href into data-mce-src, data-mce-href and data-mce-style - self.parser.addAttributeFilter('src,href,style', function(nodes, name) { - var i = nodes.length, node, dom = self.dom, value, internalName; - - while (i--) { - node = nodes[i]; - value = node.attr(name); - internalName = 'data-mce-' + name; - - // Add internal attribute if we need to we don't on a refresh of the document - if (!node.attributes.map[internalName]) { - if (name === "style") { - node.attr(internalName, dom.serializeStyle(dom.parseStyle(value), node.name)); - } else { - node.attr(internalName, self.convertURL(value, name, node.name)); - } - } - } - }); - - // Keep scripts from executing - self.parser.addNodeFilter('script', function(nodes) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - node.attr('type', 'mce-' + (node.attr('type') || 'text/javascript')); - } - }); - - self.parser.addNodeFilter('#cdata', function(nodes) { - var i = nodes.length, node; - - while (i--) { - node = nodes[i]; - node.type = 8; - node.name = '#comment'; - node.value = '[CDATA[' + node.value + ']]'; - } - }); - - self.parser.addNodeFilter('p,h1,h2,h3,h4,h5,h6,div', function(nodes) { - var i = nodes.length, node, nonEmptyElements = self.schema.getNonEmptyElements(); - - while (i--) { - node = nodes[i]; - - if (node.isEmpty(nonEmptyElements)) { - node.empty().append(new Node('br', 1)).shortEnded = true; - } - } - }); - - /** - * DOM serializer for the editor. Will be used when contents is extracted from the editor. - * - * @property serializer - * @type tinymce.dom.Serializer - * @example - * // Serializes the first paragraph in the editor into a string - * tinymce.activeEditor.serializer.serialize(tinymce.activeEditor.dom.select('p')[0]); - */ - self.serializer = new DomSerializer(settings, self); - - /** - * Selection instance for the editor. - * - * @property selection - * @type tinymce.dom.Selection - * @example - * // Sets some contents to the current selection in the editor - * tinymce.activeEditor.selection.setContent('Some contents'); - * - * // Gets the current selection - * alert(tinymce.activeEditor.selection.getContent()); - * - * // Selects the first paragraph found - * tinymce.activeEditor.selection.select(tinymce.activeEditor.dom.select('p')[0]); - */ - self.selection = new Selection(self.dom, self.getWin(), self.serializer, self); - - /** - * Formatter instance. - * - * @property formatter - * @type tinymce.Formatter - */ - self.formatter = new Formatter(self); - - /** - * Undo manager instance, responsible for handling undo levels. - * - * @property undoManager - * @type tinymce.UndoManager - * @example - * // Undoes the last modification to the editor - * tinymce.activeEditor.undoManager.undo(); - */ - self.undoManager = new UndoManager(self); - - self.forceBlocks = new ForceBlocks(self); - self.enterKey = new EnterKey(self); - self.editorCommands = new EditorCommands(self); - - self.fire('PreInit'); - - if (!settings.browser_spellcheck && !settings.gecko_spellcheck) { - doc.body.spellcheck = false; // Gecko - DOM.setAttrib(body, "spellcheck", "false"); - } - - self.fire('PostRender'); - - self.quirks = Quirks(self); - - if (settings.directionality) { - body.dir = settings.directionality; - } - - if (settings.nowrap) { - body.style.whiteSpace = "nowrap"; - } - - if (settings.protect) { - self.on('BeforeSetContent', function(e) { - each(settings.protect, function(pattern) { - e.content = e.content.replace(pattern, function(str) { - return ''; - }); - }); - }); - } - - self.on('SetContent', function() { - self.addVisual(self.getBody()); - }); - - // Remove empty contents - if (settings.padd_empty_editor) { - self.on('PostProcess', function(e) { - e.content = e.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
    [\r\n]*)$/, ''); - }); - } - - self.load({initial: true, format: 'html'}); - self.startContent = self.getContent({format: 'raw'}); - - /** - * Is set to true after the editor instance has been initialized - * - * @property initialized - * @type Boolean - * @example - * function isEditorInitialized(editor) { - * return editor && editor.initialized; - * } - */ - self.initialized = true; - - each(self._pendingNativeEvents, function(name) { - self.dom.bind(getEventTarget(self, name), name, function(e) { - self.fire(e.type, e); - }); - }); - - self.fire('init'); - self.focus(true); - self.nodeChanged({initial: true}); - self.execCallback('init_instance_callback', self); - - // Add editor specific CSS styles - if (self.contentStyles.length > 0) { - contentCssText = ''; - - each(self.contentStyles, function(style) { - contentCssText += style + "\r\n"; - }); - - self.dom.addStyle(contentCssText); - } - - // Load specified content CSS last - each(self.contentCSS, function(cssUrl) { - if (!self.loadedCSS[cssUrl]) { - self.dom.loadCSS(cssUrl); - self.loadedCSS[cssUrl] = true; - } - }); - - // Handle auto focus - if (settings.auto_focus) { - setTimeout(function () { - var ed = self.editorManager.get(settings.auto_focus); - - ed.selection.select(ed.getBody(), 1); - ed.selection.collapse(1); - ed.getBody().focus(); - ed.getWin().focus(); - }, 100); - } - - // Clean up references for IE - targetElm = doc = body = null; - }, - - /** - * Focuses/activates the editor. This will set this editor as the activeEditor in the tinymce collection - * it will also place DOM focus inside the editor. - * - * @method focus - * @param {Boolean} skip_focus Skip DOM focus. Just set is as the active editor. - */ - focus: function(skip_focus) { - var oed, self = this, selection = self.selection, contentEditable = self.settings.content_editable, rng; - var controlElm, doc = self.getDoc(), body; - - if (!skip_focus) { - // Get selected control element - rng = selection.getRng(); - if (rng.item) { - controlElm = rng.item(0); - } - - self._refreshContentEditable(); - - // Focus the window iframe - if (!contentEditable) { - // WebKit needs this call to fire focusin event properly see #5948 - // But Opera pre Blink engine will produce an empty selection so skip Opera - if (!Env.opera) { - self.getBody().focus(); - } - - self.getWin().focus(); - } - - // Focus the body as well since it's contentEditable - if (isGecko || contentEditable) { - body = self.getBody(); - - // Check for setActive since it doesn't scroll to the element - if (body.setActive && Env.ie < 11) { - body.setActive(); - } else { - body.focus(); - } - - if (contentEditable) { - selection.normalize(); - } - } - - // Restore selected control element - // This is needed when for example an image is selected within a - // layer a call to focus will then remove the control selection - if (controlElm && controlElm.ownerDocument == doc) { - rng = doc.body.createControlRange(); - rng.addElement(controlElm); - rng.select(); - } - } - - if (self.editorManager.activeEditor != self) { - if ((oed = self.editorManager.activeEditor)) { - oed.fire('deactivate', {relatedTarget: self}); - } - - self.fire('activate', {relatedTarget: oed}); - } - - self.editorManager.activeEditor = self; - }, - - /** - * Executes a legacy callback. This method is useful to call old 2.x option callbacks. - * There new event model is a better way to add callback so this method might be removed in the future. - * - * @method execCallback - * @param {String} name Name of the callback to execute. - * @return {Object} Return value passed from callback function. - */ - execCallback: function(name) { - var self = this, callback = self.settings[name], scope; - - if (!callback) { - return; - } - - // Look through lookup - if (self.callbackLookup && (scope = self.callbackLookup[name])) { - callback = scope.func; - scope = scope.scope; - } - - if (typeof(callback) === 'string') { - scope = callback.replace(/\.\w+$/, ''); - scope = scope ? resolve(scope) : 0; - callback = resolve(callback); - self.callbackLookup = self.callbackLookup || {}; - self.callbackLookup[name] = {func: callback, scope: scope}; - } - - return callback.apply(scope || self, Array.prototype.slice.call(arguments, 1)); - }, - - /** - * Translates the specified string by replacing variables with language pack items it will also check if there is - * a key mathcin the input. - * - * @method translate - * @param {String} text String to translate by the language pack data. - * @return {String} Translated string. - */ - translate: function(text) { - var lang = this.settings.language || 'en', i18n = this.editorManager.i18n; - - if (!text) { - return ''; - } - - return i18n.data[lang + '.' + text] || text.replace(/\{\#([^\}]+)\}/g, function(a, b) { - return i18n.data[lang + '.' + b] || '{#' + b + '}'; - }); - }, - - /** - * Returns a language pack item by name/key. - * - * @method getLang - * @param {String} name Name/key to get from the language pack. - * @param {String} defaultVal Optional default value to retrive. - */ - getLang: function(name, defaultVal) { - return ( - this.editorManager.i18n.data[(this.settings.language || 'en') + '.' + name] || - (defaultVal !== undefined ? defaultVal : '{#' + name + '}') - ); - }, - - /** - * Returns a configuration parameter by name. - * - * @method getParam - * @param {String} name Configruation parameter to retrive. - * @param {String} defaultVal Optional default value to return. - * @param {String} type Optional type parameter. - * @return {String} Configuration parameter value or default value. - * @example - * // Returns a specific config value from the currently active editor - * var someval = tinymce.activeEditor.getParam('myvalue'); - * - * // Returns a specific config value from a specific editor instance by id - * var someval2 = tinymce.get('my_editor').getParam('myvalue'); - */ - getParam: function(name, defaultVal, type) { - var value = name in this.settings ? this.settings[name] : defaultVal, output; - - if (type === 'hash') { - output = {}; - - if (typeof(value) === 'string') { - each(value.indexOf('=') > 0 ? value.split(/[;,](?![^=;,]*(?:[;,]|$))/) : value.split(','), function(value) { - value = value.split('='); - - if (value.length > 1) { - output[trim(value[0])] = trim(value[1]); - } else { - output[trim(value[0])] = trim(value); - } - }); - } else { - output = value; - } - - return output; - } - - return value; - }, - - /** - * Distpaches out a onNodeChange event to all observers. This method should be called when you - * need to update the UI states or element path etc. - * - * @method nodeChanged - */ - nodeChanged: function() { - var self = this, selection = self.selection, node, parents, root; - - // Fix for bug #1896577 it seems that this can not be fired while the editor is loading - if (self.initialized && !self.settings.disable_nodechange && !self.settings.readonly) { - // Get start node - root = self.getBody(); - node = selection.getStart() || root; - node = ie && node.ownerDocument != self.getDoc() ? self.getBody() : node; // Fix for IE initial state - - // Edge case for

    |

    - if (node.nodeName == 'IMG' && selection.isCollapsed()) { - node = node.parentNode; - } - - // Get parents and add them to object - parents = []; - self.dom.getParent(node, function(node) { - if (node === root) { - return true; - } - - parents.push(node); - }); - - self.fire('NodeChange', {element: node, parents: parents}); - } - }, - - /** - * Adds a button that later gets created by the theme in the editors toolbars. - * - * @method addButton - * @param {String} name Button name to add. - * @param {Object} settings Settings object with title, cmd etc. - * @example - * // Adds a custom button to the editor that inserts contents when clicked - * tinymce.init({ - * ... - * - * toolbar: 'example' - * - * setup: function(ed) { - * ed.addButton('example', { - * title: 'My title', - * image: '../js/tinymce/plugins/example/img/example.gif', - * onclick: function() { - * ed.insertContent('Hello world!!'); - * } - * }); - * } - * }); - */ - addButton: function(name, settings) { - var self = this; - - if (settings.cmd) { - settings.onclick = function() { - self.execCommand(settings.cmd); - }; - } - - if (!settings.text && !settings.icon) { - settings.icon = name; - } - - self.buttons = self.buttons || {}; - settings.tooltip = settings.tooltip || settings.title; - self.buttons[name] = settings; - }, - - /** - * Adds a menu item to be used in the menus of the theme. There might be multiple instances - * of this menu item for example it might be used in the main menus of the theme but also in - * the context menu so make sure that it's self contained and supports multiple instances. - * - * @method addMenuItem - * @param {String} name Menu item name to add. - * @param {Object} settings Settings object with title, cmd etc. - * @example - * // Adds a custom menu item to the editor that inserts contents when clicked - * // The context option allows you to add the menu item to an existing default menu - * tinymce.init({ - * ... - * - * setup: function(ed) { - * ed.addMenuItem('example', { - * text: 'My menu item', - * context: 'tools', - * onclick: function() { - * ed.insertContent('Hello world!!'); - * } - * }); - * } - * }); - */ - addMenuItem: function(name, settings) { - var self = this; - - if (settings.cmd) { - settings.onclick = function() { - self.execCommand(settings.cmd); - }; - } - - self.menuItems = self.menuItems || {}; - self.menuItems[name] = settings; - }, - - /** - * Adds a custom command to the editor, you can also override existing commands with this method. - * The command that you add can be executed with execCommand. - * - * @method addCommand - * @param {String} name Command name to add/override. - * @param {addCommandCallback} callback Function to execute when the command occurs. - * @param {Object} scope Optional scope to execute the function in. - * @example - * // Adds a custom command that later can be executed using execCommand - * tinymce.init({ - * ... - * - * setup: function(ed) { - * // Register example command - * ed.addCommand('mycommand', function(ui, v) { - * ed.windowManager.alert('Hello world!! Selection: ' + ed.selection.getContent({format: 'text'})); - * }); - * } - * }); - */ - addCommand: function(name, callback, scope) { - /** - * Callback function that gets called when a command is executed. - * - * @callback addCommandCallback - * @param {Boolean} ui Display UI state true/false. - * @param {Object} value Optional value for command. - * @return {Boolean} True/false state if the command was handled or not. - */ - this.execCommands[name] = {func: callback, scope: scope || this}; - }, - - /** - * Adds a custom query state command to the editor, you can also override existing commands with this method. - * The command that you add can be executed with queryCommandState function. - * - * @method addQueryStateHandler - * @param {String} name Command name to add/override. - * @param {addQueryStateHandlerCallback} callback Function to execute when the command state retrival occurs. - * @param {Object} scope Optional scope to execute the function in. - */ - addQueryStateHandler: function(name, callback, scope) { - /** - * Callback function that gets called when a queryCommandState is executed. - * - * @callback addQueryStateHandlerCallback - * @return {Boolean} True/false state if the command is enabled or not like is it bold. - */ - this.queryStateCommands[name] = {func: callback, scope: scope || this}; - }, - - /** - * Adds a custom query value command to the editor, you can also override existing commands with this method. - * The command that you add can be executed with queryCommandValue function. - * - * @method addQueryValueHandler - * @param {String} name Command name to add/override. - * @param {addQueryValueHandlerCallback} callback Function to execute when the command value retrival occurs. - * @param {Object} scope Optional scope to execute the function in. - */ - addQueryValueHandler: function(name, callback, scope) { - /** - * Callback function that gets called when a queryCommandValue is executed. - * - * @callback addQueryValueHandlerCallback - * @return {Object} Value of the command or undefined. - */ - this.queryValueCommands[name] = {func: callback, scope: scope || this}; - }, - - /** - * Adds a keyboard shortcut for some command or function. - * - * @method addShortcut - * @param {String} pattern Shortcut pattern. Like for example: ctrl+alt+o. - * @param {String} desc Text description for the command. - * @param {String/Function} cmdFunc Command name string or function to execute when the key is pressed. - * @param {Object} sc Optional scope to execute the function in. - * @return {Boolean} true/false state if the shortcut was added or not. - */ - addShortcut: function(pattern, desc, cmdFunc, scope) { - this.shortcuts.add(pattern, desc, cmdFunc, scope); - }, - - /** - * Executes a command on the current instance. These commands can be TinyMCE internal commands prefixed with "mce" or - * they can be build in browser commands such as "Bold". A compleate list of browser commands is available on MSDN or Mozilla.org. - * This function will dispatch the execCommand function on each plugin, theme or the execcommand_callback option if none of these - * return true it will handle the command as a internal browser command. - * - * @method execCommand - * @param {String} cmd Command name to execute, for example mceLink or Bold. - * @param {Boolean} ui True/false state if a UI (dialog) should be presented or not. - * @param {mixed} value Optional command value, this can be anything. - * @param {Object} a Optional arguments object. - */ - execCommand: function(cmd, ui, value, args) { - var self = this, state = 0, cmdItem; - - if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(cmd) && (!args || !args.skip_focus)) { - self.focus(); - } - - args = extend({}, args); - args = self.fire('BeforeExecCommand', {command: cmd, ui: ui, value: value}); - if (args.isDefaultPrevented()) { - return false; - } - - // Registred commands - if ((cmdItem = self.execCommands[cmd])) { - // Fall through on true - if (cmdItem.func.call(cmdItem.scope, ui, value) !== true) { - self.fire('ExecCommand', {command: cmd, ui: ui, value: value}); - return true; - } - } - - // Plugin commands - each(self.plugins, function(p) { - if (p.execCommand && p.execCommand(cmd, ui, value)) { - self.fire('ExecCommand', {command: cmd, ui: ui, value: value}); - state = true; - return false; - } - }); - - if (state) { - return state; - } - - // Theme commands - if (self.theme && self.theme.execCommand && self.theme.execCommand(cmd, ui, value)) { - self.fire('ExecCommand', {command: cmd, ui: ui, value: value}); - return true; - } - - // Editor commands - if (self.editorCommands.execCommand(cmd, ui, value)) { - self.fire('ExecCommand', {command: cmd, ui: ui, value: value}); - return true; - } - - // Browser commands - self.getDoc().execCommand(cmd, ui, value); - self.fire('ExecCommand', {command: cmd, ui: ui, value: value}); - }, - - /** - * Returns a command specific state, for example if bold is enabled or not. - * - * @method queryCommandState - * @param {string} cmd Command to query state from. - * @return {Boolean} Command specific state, for example if bold is enabled or not. - */ - queryCommandState: function(cmd) { - var self = this, queryItem, returnVal; - - // Is hidden then return undefined - if (self._isHidden()) { - return; - } - - // Registred commands - if ((queryItem = self.queryStateCommands[cmd])) { - returnVal = queryItem.func.call(queryItem.scope); - - // Fall though on true - if (returnVal !== true) { - return returnVal; - } - } - - // Editor commands - returnVal = self.editorCommands.queryCommandState(cmd); - if (returnVal !== -1) { - return returnVal; - } - - // Browser commands - try { - return self.getDoc().queryCommandState(cmd); - } catch (ex) { - // Fails sometimes see bug: 1896577 - } - }, - - /** - * Returns a command specific value, for example the current font size. - * - * @method queryCommandValue - * @param {string} cmd Command to query value from. - * @return {Object} Command specific value, for example the current font size. - */ - queryCommandValue: function(cmd) { - var self = this, queryItem, returnVal; - - // Is hidden then return undefined - if (self._isHidden()) { - return; - } - - // Registred commands - if ((queryItem = self.queryValueCommands[cmd])) { - returnVal = queryItem.func.call(queryItem.scope); - - // Fall though on true - if (returnVal !== true) { - return returnVal; - } - } - - // Editor commands - returnVal = self.editorCommands.queryCommandValue(cmd); - if (returnVal !== undefined) { - return returnVal; - } - - // Browser commands - try { - return self.getDoc().queryCommandValue(cmd); - } catch (ex) { - // Fails sometimes see bug: 1896577 - } - }, - - /** - * Shows the editor and hides any textarea/div that the editor is supposed to replace. - * - * @method show - */ - show: function() { - var self = this; - - DOM.show(self.getContainer()); - DOM.hide(self.id); - self.load(); - self.fire('show'); - }, - - /** - * Hides the editor and shows any textarea/div that the editor is supposed to replace. - * - * @method hide - */ - hide: function() { - var self = this, doc = self.getDoc(); - - // Fixed bug where IE has a blinking cursor left from the editor - if (ie && doc && !self.inline) { - doc.execCommand('SelectAll'); - } - - // We must save before we hide so Safari doesn't crash - self.save(); - - // defer the call to hide to prevent an IE9 crash #4921 - DOM.hide(self.getContainer()); - DOM.setStyle(self.id, 'display', self.orgDisplay); - self.fire('hide'); - }, - - /** - * Returns true/false if the editor is hidden or not. - * - * @method isHidden - * @return {Boolean} True/false if the editor is hidden or not. - */ - isHidden: function() { - return !DOM.isHidden(this.id); - }, - - /** - * Sets the progress state, this will display a throbber/progess for the editor. - * This is ideal for asycronous operations like an AJAX save call. - * - * @method setProgressState - * @param {Boolean} state Boolean state if the progress should be shown or hidden. - * @param {Number} time Optional time to wait before the progress gets shown. - * @return {Boolean} Same as the input state. - * @example - * // Show progress for the active editor - * tinymce.activeEditor.setProgressState(true); - * - * // Hide progress for the active editor - * tinymce.activeEditor.setProgressState(false); - * - * // Show progress after 3 seconds - * tinymce.activeEditor.setProgressState(true, 3000); - */ - setProgressState: function(state, time) { - this.fire('ProgressState', {state: state, time: time}); - }, - - /** - * Loads contents from the textarea or div element that got converted into an editor instance. - * This method will move the contents from that textarea or div into the editor by using setContent - * so all events etc that method has will get dispatched as well. - * - * @method load - * @param {Object} args Optional content object, this gets passed around through the whole load process. - * @return {String} HTML string that got set into the editor. - */ - load: function(args) { - var self = this, elm = self.getElement(), html; - - if (elm) { - args = args || {}; - args.load = true; - - html = self.setContent(elm.value !== undefined ? elm.value : elm.innerHTML, args); - args.element = elm; - - if (!args.no_events) { - self.fire('LoadContent', args); - } - - args.element = elm = null; - - return html; - } - }, - - /** - * Saves the contents from a editor out to the textarea or div element that got converted into an editor instance. - * This method will move the HTML contents from the editor into that textarea or div by getContent - * so all events etc that method has will get dispatched as well. - * - * @method save - * @param {Object} args Optional content object, this gets passed around through the whole save process. - * @return {String} HTML string that got set into the textarea/div. - */ - save: function(args) { - var self = this, elm = self.getElement(), html, form; - - if (!elm || !self.initialized) { - return; - } - - args = args || {}; - args.save = true; - - args.element = elm; - html = args.content = self.getContent(args); - - if (!args.no_events) { - self.fire('SaveContent', args); - } - - html = args.content; - - if (!/TEXTAREA|INPUT/i.test(elm.nodeName)) { - // Update DIV element when not in inline mode - if (!self.inline) { - elm.innerHTML = html; - } - - // Update hidden form element - if ((form = DOM.getParent(self.id, 'form'))) { - each(form.elements, function(elm) { - if (elm.name == self.id) { - elm.value = html; - return false; - } - }); - } - } else { - elm.value = html; - } - - args.element = elm = null; - - if (args.set_dirty !== false) { - self.isNotDirty = true; - } - - return html; - }, - - /** - * Sets the specified content to the editor instance, this will cleanup the content before it gets set using - * the different cleanup rules options. - * - * @method setContent - * @param {String} content Content to set to editor, normally HTML contents but can be other formats as well. - * @param {Object} args Optional content object, this gets passed around through the whole set process. - * @return {String} HTML string that got set into the editor. - * @example - * // Sets the HTML contents of the activeEditor editor - * tinymce.activeEditor.setContent('some html'); - * - * // Sets the raw contents of the activeEditor editor - * tinymce.activeEditor.setContent('some html', {format: 'raw'}); - * - * // Sets the content of a specific editor (my_editor in this example) - * tinymce.get('my_editor').setContent(data); - * - * // Sets the bbcode contents of the activeEditor editor if the bbcode plugin was added - * tinymce.activeEditor.setContent('[b]some[/b] html', {format: 'bbcode'}); - */ - setContent: function(content, args) { - var self = this, body = self.getBody(), forcedRootBlockName; - - // Setup args object - args = args || {}; - args.format = args.format || 'html'; - args.set = true; - args.content = content; - - // Do preprocessing - if (!args.no_events) { - self.fire('BeforeSetContent', args); - } - - content = args.content; - - // Padd empty content in Gecko and Safari. Commands will otherwise fail on the content - // It will also be impossible to place the caret in the editor unless there is a BR element present - if (content.length === 0 || /^\s+$/.test(content)) { - forcedRootBlockName = self.settings.forced_root_block; - - // Check if forcedRootBlock is configured and that the block is a valid child of the body - if (forcedRootBlockName && self.schema.isValidChild(body.nodeName.toLowerCase(), forcedRootBlockName.toLowerCase())) { - // Padd with bogus BR elements on modern browsers and IE 7 and 8 since they don't render empty P tags properly - content = ie && ie < 11 ? '' : '
    '; - content = self.dom.createHTML(forcedRootBlockName, self.settings.forced_root_block_attrs, content); - } else if (!ie) { - // We need to add a BR when forced_root_block is disabled on non IE browsers to place the caret - content = '
    '; - } - - body.innerHTML = content; - - self.fire('SetContent', args); - } else { - // Parse and serialize the html - if (args.format !== 'raw') { - content = new Serializer({}, self.schema).serialize( - self.parser.parse(content, {isRootContent: true}) - ); - } - - // Set the new cleaned contents to the editor - args.content = trim(content); - self.dom.setHTML(body, args.content); - - // Do post processing - if (!args.no_events) { - self.fire('SetContent', args); - } - - // Don't normalize selection if the focused element isn't the body in - // content editable mode since it will steal focus otherwise - /*if (!self.settings.content_editable || document.activeElement === self.getBody()) { - self.selection.normalize(); - }*/ - } - - return args.content; - }, - - /** - * Gets the content from the editor instance, this will cleanup the content before it gets returned using - * the different cleanup rules options. - * - * @method getContent - * @param {Object} args Optional content object, this gets passed around through the whole get process. - * @return {String} Cleaned content string, normally HTML contents. - * @example - * // Get the HTML contents of the currently active editor - * console.debug(tinymce.activeEditor.getContent()); - * - * // Get the raw contents of the currently active editor - * tinymce.activeEditor.getContent({format: 'raw'}); - * - * // Get content of a specific editor: - * tinymce.get('content id').getContent() - */ - getContent: function(args) { - var self = this, content, body = self.getBody(); - - // Setup args object - args = args || {}; - args.format = args.format || 'html'; - args.get = true; - args.getInner = true; - - // Do preprocessing - if (!args.no_events) { - self.fire('BeforeGetContent', args); - } - - // Get raw contents or by default the cleaned contents - if (args.format == 'raw') { - content = body.innerHTML; - } else if (args.format == 'text') { - content = body.innerText || body.textContent; - } else { - content = self.serializer.serialize(body, args); - } - - // Trim whitespace in beginning/end of HTML - if (args.format != 'text') { - args.content = trim(content); - } else { - args.content = content; - } - - // Do post processing - if (!args.no_events) { - self.fire('GetContent', args); - } - - return args.content; - }, - - /** - * Inserts content at caret position. - * - * @method insertContent - * @param {String} content Content to insert. - */ - insertContent: function(content) { - this.execCommand('mceInsertContent', false, content); - }, - - /** - * Returns true/false if the editor is dirty or not. It will get dirty if the user has made modifications to the contents. - * - * @method isDirty - * @return {Boolean} True/false if the editor is dirty or not. It will get dirty if the user has made modifications to the contents. - * @example - * if (tinymce.activeEditor.isDirty()) - * alert("You must save your contents."); - */ - isDirty: function() { - return !this.isNotDirty; - }, - - /** - * Returns the editors container element. The container element wrappes in - * all the elements added to the page for the editor. Such as UI, iframe etc. - * - * @method getContainer - * @return {Element} HTML DOM element for the editor container. - */ - getContainer: function() { - var self = this; - - if (!self.container) { - self.container = DOM.get(self.editorContainer || self.id + '_parent'); - } - - return self.container; - }, - - /** - * Returns the editors content area container element. The this element is the one who - * holds the iframe or the editable element. - * - * @method getContentAreaContainer - * @return {Element} HTML DOM element for the editor area container. - */ - getContentAreaContainer: function() { - return this.contentAreaContainer; - }, - - /** - * Returns the target element/textarea that got replaced with a TinyMCE editor instance. - * - * @method getElement - * @return {Element} HTML DOM element for the replaced element. - */ - getElement: function() { - return DOM.get(this.settings.content_element || this.id); - }, - - /** - * Returns the iframes window object. - * - * @method getWin - * @return {Window} Iframe DOM window object. - */ - getWin: function() { - var self = this, elm; - - if (!self.contentWindow) { - elm = DOM.get(self.id + "_ifr"); - - if (elm) { - self.contentWindow = elm.contentWindow; - } - } - - return self.contentWindow; - }, - - /** - * Returns the iframes document object. - * - * @method getDoc - * @return {Document} Iframe DOM document object. - */ - getDoc: function() { - var self = this, win; - - if (!self.contentDocument) { - win = self.getWin(); - - if (win) { - self.contentDocument = win.document; - } - } - - return self.contentDocument; - }, - - /** - * Returns the iframes body element. - * - * @method getBody - * @return {Element} Iframe body element. - */ - getBody: function() { - return this.bodyElement || this.getDoc().body; - }, - - /** - * URL converter function this gets executed each time a user adds an img, a or - * any other element that has a URL in it. This will be called both by the DOM and HTML - * manipulation functions. - * - * @method convertURL - * @param {string} url URL to convert. - * @param {string} name Attribute name src, href etc. - * @param {string/HTMLElement} elm Tag name or HTML DOM element depending on HTML or DOM insert. - * @return {string} Converted URL string. - */ - convertURL: function(url, name, elm) { - var self = this, settings = self.settings; - - // Use callback instead - if (settings.urlconverter_callback) { - return self.execCallback('urlconverter_callback', url, elm, true, name); - } - - // Don't convert link href since thats the CSS files that gets loaded into the editor also skip local file URLs - if (!settings.convert_urls || (elm && elm.nodeName == 'LINK') || url.indexOf('file:') === 0 || url.length === 0) { - return url; - } - - // Convert to relative - if (settings.relative_urls) { - return self.documentBaseURI.toRelative(url); - } - - // Convert to absolute - url = self.documentBaseURI.toAbsolute(url, settings.remove_script_host); - - return url; - }, - - /** - * Adds visual aid for tables, anchors etc so they can be more easily edited inside the editor. - * - * @method addVisual - * @param {Element} elm Optional root element to loop though to find tables etc that needs the visual aid. - */ - addVisual: function(elm) { - var self = this, settings = self.settings, dom = self.dom, cls; - - elm = elm || self.getBody(); - - if (self.hasVisual === undefined) { - self.hasVisual = settings.visual; - } - - each(dom.select('table,a', elm), function(elm) { - var value; - - switch (elm.nodeName) { - case 'TABLE': - cls = settings.visual_table_class || 'mce-item-table'; - value = dom.getAttrib(elm, 'border'); - - if (!value || value == '0') { - if (self.hasVisual) { - dom.addClass(elm, cls); - } else { - dom.removeClass(elm, cls); - } - } - - return; - - case 'A': - if (!dom.getAttrib(elm, 'href', false)) { - value = dom.getAttrib(elm, 'name') || elm.id; - cls = settings.visual_anchor_class || 'mce-item-anchor'; - - if (value) { - if (self.hasVisual) { - dom.addClass(elm, cls); - } else { - dom.removeClass(elm, cls); - } - } - } - - return; - } - }); - - self.fire('VisualAid', {element: elm, hasVisual: self.hasVisual}); - }, - - /** - * Removes the editor from the dom and tinymce collection. - * - * @method remove - */ - remove: function() { - var self = this; - - if (!self.removed) { - self.save(); - self.fire('remove'); - self.off(); - self.removed = 1; // Cancels post remove event execution - - // Remove any hidden input - if (self.hasHiddenInput) { - DOM.remove(self.getElement().nextSibling); - } - - DOM.setStyle(self.id, 'display', self.orgDisplay); - - // Don't clear the window or document if content editable - // is enabled since other instances might still be present - if (!self.settings.content_editable) { - Event.unbind(self.getWin()); - Event.unbind(self.getDoc()); - } - - var elm = self.getContainer(); - Event.unbind(self.getBody()); - Event.unbind(elm); - - self.editorManager.remove(self); - DOM.remove(elm); - self.destroy(); - } - }, - - bindNative: function(name) { - var self = this; - - if (self.settings.readonly) { - return; - } - - if (self.initialized) { - self.dom.bind(getEventTarget(self, name), name, function(e) { - self.fire(name, e); - }); - } else { - if (!self._pendingNativeEvents) { - self._pendingNativeEvents = [name]; - } else { - self._pendingNativeEvents.push(name); - } - } - }, - - unbindNative: function(name) { - var self = this; - - if (self.initialized) { - self.dom.unbind(name); - } - }, - - /** - * Destroys the editor instance by removing all events, element references or other resources - * that could leak memory. This method will be called automatically when the page is unloaded - * but you can also call it directly if you know what you are doing. - * - * @method destroy - * @param {Boolean} automatic Optional state if the destroy is an automatic destroy or user called one. - */ - destroy: function(automatic) { - var self = this, form; - - // One time is enough - if (self.destroyed) { - return; - } - - // If user manually calls destroy and not remove - // Users seems to have logic that calls destroy instead of remove - if (!automatic && !self.removed) { - self.remove(); - return; - } - - // We must unbind on Gecko since it would otherwise produce the pesky "attempt - // to run compile-and-go script on a cleared scope" message - if (automatic && isGecko) { - Event.unbind(self.getDoc()); - Event.unbind(self.getWin()); - Event.unbind(self.getBody()); - } - - if (!automatic) { - self.editorManager.off('beforeunload', self._beforeUnload); - - // Manual destroy - if (self.theme && self.theme.destroy) { - self.theme.destroy(); - } - - // Destroy controls, selection and dom - self.selection.destroy(); - self.dom.destroy(); - } - - form = self.formElement; - if (form) { - if (form._mceOldSubmit) { - form.submit = form._mceOldSubmit; - form._mceOldSubmit = null; - } - - DOM.unbind(form, 'submit reset', self.formEventDelegate); - } - - self.contentAreaContainer = self.formElement = self.container = self.editorContainer = null; - self.settings.content_element = self.bodyElement = self.contentDocument = self.contentWindow = null; - - if (self.selection) { - self.selection = self.selection.win = self.selection.dom = self.selection.dom.doc = null; - } - - self.destroyed = 1; - }, - - // Internal functions - - _refreshContentEditable: function() { - var self = this, body, parent; - - // Check if the editor was hidden and the re-initalize contentEditable mode by removing and adding the body again - if (self._isHidden()) { - body = self.getBody(); - parent = body.parentNode; - - parent.removeChild(body); - parent.appendChild(body); - - body.focus(); - } - }, - - _isHidden: function() { - var sel; - - if (!isGecko) { - return 0; - } - - // Weird, wheres that cursor selection? - sel = this.selection.getSel(); - return (!sel || !sel.rangeCount || sel.rangeCount === 0); - } - }; - - extend(Editor.prototype, Observable); - - return Editor; -}); - -// Included from: js/tinymce/classes/util/I18n.js - -/** - * I18n.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * I18n class that handles translation of TinyMCE UI. - * Uses po style with csharp style parameters. - * - * @class tinymce.util.I18n - */ -define("tinymce/util/I18n", [], function() { - "use strict"; - - var data = {}; - - return { - /** - * Property gets set to true if a RTL language pack was loaded. - * - * @property rtl - * @type Boolean - */ - rtl: false, - - /** - * Adds translations for a specific language code. - * - * @method add - * @param {String} code Language code like sv_SE. - * @param {Array} items Name/value array with English en_US to sv_SE. - */ - add: function(code, items) { - for (var name in items) { - data[name] = items[name]; - } - - this.rtl = this.rtl || data._dir === 'rtl'; - }, - - /** - * Translates the specified text. - * - * It has a few formats: - * I18n.translate("Text"); - * I18n.translate(["Text {0}/{1}", 0, 1]); - * I18n.translate({raw: "Raw string"}); - * - * @method translate - * @param {String/Object/Array} text Text to translate. - * @return {String} String that got translated. - */ - translate: function(text) { - if (typeof(text) == "undefined") { - return text; - } - - if (typeof(text) != "string" && text.raw) { - return text.raw; - } - - if (text.push) { - var values = text.slice(1); - - text = (data[text[0]] || text[0]).replace(/\{([^\}]+)\}/g, function(match1, match2) { - return values[match2]; - }); - } - - return data[text] || text; - }, - - data: data - }; -}); - -// Included from: js/tinymce/classes/FocusManager.js - -/** - * FocusManager.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class manages the focus/blur state of the editor. This class is needed since some - * browsers fire false focus/blur states when the selection is moved to a UI dialog or similar. - * - * This class will fire two events focus and blur on the editor instances that got affected. - * It will also handle the restore of selection when the focus is lost and returned. - * - * @class tinymce.FocusManager - */ -define("tinymce/FocusManager", [ - "tinymce/dom/DOMUtils", - "tinymce/Env" -], function(DOMUtils, Env) { - var selectionChangeHandler, documentFocusInHandler, DOM = DOMUtils.DOM; - - /** - * Constructs a new focus manager instance. - * - * @constructor FocusManager - * @param {tinymce.EditorManager} editorManager Editor manager instance to handle focus for. - */ - function FocusManager(editorManager) { - function getActiveElement() { - try { - return document.activeElement; - } catch (ex) { - // IE sometimes fails to get the activeElement when resizing table - // TODO: Investigate this - return document.body; - } - } - - // We can't store a real range on IE 11 since it gets mutated so we need to use a bookmark object - // TODO: Move this to a separate range utils class since it's it's logic is present in Selection as well. - function createBookmark(rng) { - if (rng && rng.startContainer) { - return { - startContainer: rng.startContainer, - startOffset: rng.startOffset, - endContainer: rng.endContainer, - endOffset: rng.endOffset - }; - } - - return rng; - } - - function bookmarkToRng(editor, bookmark) { - var rng; - - if (bookmark.startContainer) { - rng = editor.getDoc().createRange(); - rng.setStart(bookmark.startContainer, bookmark.startOffset); - rng.setEnd(bookmark.endContainer, bookmark.endOffset); - } else { - rng = bookmark; - } - - return rng; - } - - function isUIElement(elm) { - return !!DOM.getParent(elm, FocusManager.isEditorUIElement); - } - - function isNodeInBodyOfEditor(node, editor) { - var body = editor.getBody(); - - while (node) { - if (node == body) { - return true; - } - - node = node.parentNode; - } - } - - function registerEvents(e) { - var editor = e.editor; - - editor.on('init', function() { - // Gecko/WebKit has ghost selections in iframes and IE only has one selection per browser tab - if (editor.inline || Env.ie) { - // On other browsers take snapshot on nodechange in inline mode since they have Ghost selections for iframes - editor.on('nodechange keyup', function() { - var node = document.activeElement; - - // IE 11 reports active element as iframe not body of iframe - if (node && node.id == editor.id + '_ifr') { - node = editor.getBody(); - } - - if (isNodeInBodyOfEditor(node, editor)) { - editor.lastRng = editor.selection.getRng(); - } - }); - - // Handles the issue with WebKit not retaining selection within inline document - // If the user releases the mouse out side the body since a mouse up event wont occur on the body - if (Env.webkit && !selectionChangeHandler) { - selectionChangeHandler = function() { - var activeEditor = editorManager.activeEditor; - - if (activeEditor && activeEditor.selection) { - var rng = activeEditor.selection.getRng(); - - // Store when it's non collapsed - if (rng && !rng.collapsed) { - editor.lastRng = rng; - } - } - }; - - DOM.bind(document, 'selectionchange', selectionChangeHandler); - } - } - }); - - editor.on('setcontent', function() { - editor.lastRng = null; - }); - - // Remove last selection bookmark on mousedown see #6305 - editor.on('mousedown', function() { - editor.selection.lastFocusBookmark = null; - }); - - editor.on('focusin', function() { - var focusedEditor = editorManager.focusedEditor; - - if (editor.selection.lastFocusBookmark) { - editor.selection.setRng(bookmarkToRng(editor, editor.selection.lastFocusBookmark)); - editor.selection.lastFocusBookmark = null; - } - - if (focusedEditor != editor) { - if (focusedEditor) { - focusedEditor.fire('blur', {focusedEditor: editor}); - } - - editorManager.activeEditor = editor; - editorManager.focusedEditor = editor; - editor.fire('focus', {blurredEditor: focusedEditor}); - editor.focus(true); - } - - editor.lastRng = null; - }); - - editor.on('focusout', function() { - window.setTimeout(function() { - var focusedEditor = editorManager.focusedEditor; - - // Still the same editor the the blur was outside any editor UI - if (!isUIElement(getActiveElement()) && focusedEditor == editor) { - editor.fire('blur', {focusedEditor: null}); - editorManager.focusedEditor = null; - - // Make sure selection is valid could be invalid if the editor is blured and removed before the timeout occurs - if (editor.selection) { - editor.selection.lastFocusBookmark = null; - } - } - }, 0); - }); - - if (!documentFocusInHandler) { - documentFocusInHandler = function(e) { - var activeEditor = editorManager.activeEditor; - - if (activeEditor && e.target.ownerDocument == document) { - // Check to make sure we have a valid selection - if (activeEditor.selection) { - activeEditor.selection.lastFocusBookmark = createBookmark(activeEditor.lastRng); - } - - // Fire a blur event if the element isn't a UI element - if (!isUIElement(e.target) && editorManager.focusedEditor == activeEditor) { - activeEditor.fire('blur', {focusedEditor: null}); - editorManager.focusedEditor = null; - } - } - }; - - // Check if focus is moved to an element outside the active editor by checking if the target node - // isn't within the body of the activeEditor nor a UI element such as a dialog child control - DOM.bind(document, 'focusin', documentFocusInHandler); - } - } - - function unregisterDocumentEvents(e) { - if (editorManager.focusedEditor == e.editor) { - editorManager.focusedEditor = null; - } - - if (!editorManager.activeEditor) { - DOM.unbind(document, 'selectionchange', selectionChangeHandler); - DOM.unbind(document, 'focusin', documentFocusInHandler); - selectionChangeHandler = documentFocusInHandler = null; - } - } - - editorManager.on('AddEditor', registerEvents); - editorManager.on('RemoveEditor', unregisterDocumentEvents); - } - - /** - * Returns true if the specified element is part of the UI for example an button or text input. - * - * @method isEditorUIElement - * @param {Element} elm Element to check if it's part of the UI or not. - * @return {Boolean} True/false state if the element is part of the UI or not. - */ - FocusManager.isEditorUIElement = function(elm) { - // Needs to be converted to string since svg can have focus: #6776 - return elm.className.toString().indexOf('mce-') !== -1; - }; - - return FocusManager; -}); - -// Included from: js/tinymce/classes/EditorManager.js - -/** - * EditorManager.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class used as a factory for manager for tinymce.Editor instances. - * - * @example - * tinymce.EditorManager.init({}); - * - * @class tinymce.EditorManager - * @mixes tinymce.util.Observable - * @static - */ -define("tinymce/EditorManager", [ - "tinymce/Editor", - "tinymce/dom/DOMUtils", - "tinymce/util/URI", - "tinymce/Env", - "tinymce/util/Tools", - "tinymce/util/Observable", - "tinymce/util/I18n", - "tinymce/FocusManager" -], function(Editor, DOMUtils, URI, Env, Tools, Observable, I18n, FocusManager) { - var DOM = DOMUtils.DOM; - var explode = Tools.explode, each = Tools.each, extend = Tools.extend; - var instanceCounter = 0, beforeUnloadDelegate; - - var EditorManager = { - /** - * Major version of TinyMCE build. - * - * @property majorVersion - * @type String - */ - majorVersion : '4', - - /** - * Minor version of TinyMCE build. - * - * @property minorVersion - * @type String - */ - minorVersion : '0.20', - - /** - * Release date of TinyMCE build. - * - * @property releaseDate - * @type String - */ - releaseDate: '2014-03-18', - - /** - * Collection of editor instances. - * - * @property editors - * @type Object - * @example - * for (edId in tinymce.editors) - * tinymce.editors[edId].save(); - */ - editors: [], - - /** - * Collection of language pack data. - * - * @property i18n - * @type Object - */ - i18n: I18n, - - /** - * Currently active editor instance. - * - * @property activeEditor - * @type tinymce.Editor - * @example - * tinyMCE.activeEditor.selection.getContent(); - * tinymce.EditorManager.activeEditor.selection.getContent(); - */ - activeEditor: null, - - setup: function() { - var self = this, baseURL, documentBaseURL, suffix = "", preInit; - - // Get base URL for the current document - documentBaseURL = document.location.href.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, ''); - if (!/[\/\\]$/.test(documentBaseURL)) { - documentBaseURL += '/'; - } - - // If tinymce is defined and has a base use that or use the old tinyMCEPreInit - preInit = window.tinymce || window.tinyMCEPreInit; - if (preInit) { - baseURL = preInit.base || preInit.baseURL; - suffix = preInit.suffix; - } else { - // Get base where the tinymce script is located - var scripts = document.getElementsByTagName('script'); - for (var i = 0; i < scripts.length; i++) { - var src = scripts[i].src; - - // Script types supported: - // tinymce.js tinymce.min.js tinymce.dev.js - // tinymce.jquery.js tinymce.jquery.min.js tinymce.jquery.dev.js - // tinymce.full.js tinymce.full.min.js tinymce.full.dev.js - if (/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(src)) { - if (src.indexOf('.min') != -1) { - suffix = '.min'; - } - - baseURL = src.substring(0, src.lastIndexOf('/')); - break; - } - } - } - - /** - * Base URL where the root directory if TinyMCE is located. - * - * @property baseURL - * @type String - */ - self.baseURL = new URI(documentBaseURL).toAbsolute(baseURL); - - /** - * Document base URL where the current document is located. - * - * @property documentBaseURL - * @type String - */ - self.documentBaseURL = documentBaseURL; - - /** - * Absolute baseURI for the installation path of TinyMCE. - * - * @property baseURI - * @type tinymce.util.URI - */ - self.baseURI = new URI(self.baseURL); - - /** - * Current suffix to add to each plugin/theme that gets loaded for example ".min". - * - * @property suffix - * @type String - */ - self.suffix = suffix; - - self.focusManager = new FocusManager(self); - }, - - /** - * Initializes a set of editors. This method will create editors based on various settings. - * - * @method init - * @param {Object} settings Settings object to be passed to each editor instance. - * @example - * // Initializes a editor using the longer method - * tinymce.EditorManager.init({ - * some_settings : 'some value' - * }); - * - * // Initializes a editor instance using the shorter version - * tinyMCE.init({ - * some_settings : 'some value' - * }); - */ - init: function(settings) { - var self = this, editors = [], editor; - - function createId(elm) { - var id = elm.id; - - // Use element id, or unique name or generate a unique id - if (!id) { - id = elm.name; - - if (id && !DOM.get(id)) { - id = elm.name; - } else { - // Generate unique name - id = DOM.uniqueId(); - } - - elm.setAttribute('id', id); - } - - return id; - } - - function execCallback(se, n, s) { - var f = se[n]; - - if (!f) { - return; - } - - return f.apply(s || this, Array.prototype.slice.call(arguments, 2)); - } - - function hasClass(n, c) { - return c.constructor === RegExp ? c.test(n.className) : DOM.hasClass(n, c); - } - - function readyHandler() { - var l, co; - - DOM.unbind(window, 'ready', readyHandler); - - execCallback(settings, 'onpageload'); - - if (settings.types) { - // Process type specific selector - each(settings.types, function(type) { - each(DOM.select(type.selector), function(elm) { - var editor = new Editor(createId(elm), extend({}, settings, type), self); - editors.push(editor); - editor.render(1); - }); - }); - - return; - } else if (settings.selector) { - // Process global selector - each(DOM.select(settings.selector), function(elm) { - var editor = new Editor(createId(elm), settings, self); - editors.push(editor); - editor.render(1); - }); - - return; - } - - // Fallback to old setting - switch (settings.mode) { - case "exact": - l = settings.elements || ''; - - if(l.length > 0) { - each(explode(l), function(v) { - if (DOM.get(v)) { - editor = new Editor(v, settings, self); - editors.push(editor); - editor.render(true); - } else { - each(document.forms, function(f) { - each(f.elements, function(e) { - if (e.name === v) { - v = 'mce_editor_' + instanceCounter++; - DOM.setAttrib(e, 'id', v); - - editor = new Editor(v, settings, self); - editors.push(editor); - editor.render(1); - } - }); - }); - } - }); - } - break; - - case "textareas": - case "specific_textareas": - each(DOM.select('textarea'), function(elm) { - if (settings.editor_deselector && hasClass(elm, settings.editor_deselector)) { - return; - } - - if (!settings.editor_selector || hasClass(elm, settings.editor_selector)) { - editor = new Editor(createId(elm), settings, self); - editors.push(editor); - editor.render(true); - } - }); - break; - } - - // Call onInit when all editors are initialized - if (settings.oninit) { - l = co = 0; - - each(editors, function(ed) { - co++; - - if (!ed.initialized) { - // Wait for it - ed.on('init', function() { - l++; - - // All done - if (l == co) { - execCallback(settings, 'oninit'); - } - }); - } else { - l++; - } - - // All done - if (l == co) { - execCallback(settings, 'oninit'); - } - }); - } - } - - self.settings = settings; - - DOM.bind(window, 'ready', readyHandler); - }, - - /** - * Returns a editor instance by id. - * - * @method get - * @param {String/Number} id Editor instance id or index to return. - * @return {tinymce.Editor} Editor instance to return. - * @example - * // Adds an onclick event to an editor by id (shorter version) - * tinymce.get('mytextbox').on('click', function(e) { - * ed.windowManager.alert('Hello world!'); - * }); - * - * // Adds an onclick event to an editor by id (longer version) - * tinymce.EditorManager.get('mytextbox').on('click', function(e) { - * ed.windowManager.alert('Hello world!'); - * }); - */ - get: function(id) { - if (id === undefined) { - return this.editors; - } - - return this.editors[id]; - }, - - /** - * Adds an editor instance to the editor collection. This will also set it as the active editor. - * - * @method add - * @param {tinymce.Editor} editor Editor instance to add to the collection. - * @return {tinymce.Editor} The same instance that got passed in. - */ - add: function(editor) { - var self = this, editors = self.editors; - - // Add named and index editor instance - editors[editor.id] = editor; - editors.push(editor); - - self.activeEditor = editor; - - /** - * Fires when an editor is added to the EditorManager collection. - * - * @event AddEditor - * @param {Object} e Event arguments. - */ - self.fire('AddEditor', {editor: editor}); - - if (!beforeUnloadDelegate) { - beforeUnloadDelegate = function() { - self.fire('BeforeUnload'); - }; - - DOM.bind(window, 'beforeunload', beforeUnloadDelegate); - } - - return editor; - }, - - /** - * Creates an editor instance and adds it to the EditorManager collection. - * - * @method createEditor - * @param {String} id Instance id to use for editor. - * @param {Object} settings Editor instance settings. - * @return {tinymce.Editor} Editor instance that got created. - */ - createEditor: function(id, settings) { - return this.add(new Editor(id, settings, this)); - }, - - /** - * Removes a editor or editors form page. - * - * @example - * // Remove all editors bound to divs - * tinymce.remove('div'); - * - * // Remove all editors bound to textareas - * tinymce.remove('textarea'); - * - * // Remove all editors - * tinymce.remove(); - * - * // Remove specific instance by id - * tinymce.remove('#id'); - * - * @method remove - * @param {tinymce.Editor/String/Object} [selector] CSS selector or editor instance to remove. - * @return {tinymce.Editor} The editor that got passed in will be return if it was found otherwise null. - */ - remove: function(selector) { - var self = this, i, editors = self.editors, editor, removedFromList; - - // Remove all editors - if (!selector) { - for (i = editors.length - 1; i >= 0; i--) { - self.remove(editors[i]); - } - - return; - } - - // Remove editors by selector - if (typeof(selector) == "string") { - selector = selector.selector || selector; - - each(DOM.select(selector), function(elm) { - self.remove(editors[elm.id]); - }); - - return; - } - - // Remove specific editor - editor = selector; - - // Not in the collection - if (!editors[editor.id]) { - return null; - } - - delete editors[editor.id]; - - for (i = 0; i < editors.length; i++) { - if (editors[i] == editor) { - editors.splice(i, 1); - removedFromList = true; - break; - } - } - - // Select another editor since the active one was removed - if (self.activeEditor == editor) { - self.activeEditor = editors[0]; - } - - /** - * Fires when an editor is removed from EditorManager collection. - * - * @event RemoveEditor - * @param {Object} e Event arguments. - */ - if (removedFromList) { - self.fire('RemoveEditor', {editor: editor}); - } - - if (!editors.length) { - DOM.unbind(window, 'beforeunload', beforeUnloadDelegate); - } - - editor.remove(); - - return editor; - }, - - /** - * Executes a specific command on the currently active editor. - * - * @method execCommand - * @param {String} c Command to perform for example Bold. - * @param {Boolean} u Optional boolean state if a UI should be presented for the command or not. - * @param {String} v Optional value parameter like for example an URL to a link. - * @return {Boolean} true/false if the command was executed or not. - */ - execCommand: function(cmd, ui, value) { - var self = this, editor = self.get(value); - - // Manager commands - switch (cmd) { - case "mceAddEditor": - if (!self.get(value)) { - new Editor(value, self.settings, self).render(); - } - - return true; - - case "mceRemoveEditor": - if (editor) { - editor.remove(); - } - - return true; - - case 'mceToggleEditor': - if (!editor) { - self.execCommand('mceAddEditor', 0, value); - return true; - } - - if (editor.isHidden()) { - editor.show(); - } else { - editor.hide(); - } - - return true; - } - - // Run command on active editor - if (self.activeEditor) { - return self.activeEditor.execCommand(cmd, ui, value); - } - - return false; - }, - - /** - * Calls the save method on all editor instances in the collection. This can be useful when a form is to be submitted. - * - * @method triggerSave - * @example - * // Saves all contents - * tinyMCE.triggerSave(); - */ - triggerSave: function() { - each(this.editors, function(editor) { - editor.save(); - }); - }, - - /** - * Adds a language pack, this gets called by the loaded language files like en.js. - * - * @method addI18n - * @param {String} code Optional language code. - * @param {Object} items Name/value object with translations. - */ - addI18n: function(code, items) { - I18n.add(code, items); - }, - - /** - * Translates the specified string using the language pack items. - * - * @method translate - * @param {String/Array/Object} text String to translate - * @return {String} Translated string. - */ - translate: function(text) { - return I18n.translate(text); - } - }; - - extend(EditorManager, Observable); - - EditorManager.setup(); - - // Export EditorManager as tinymce/tinymce in global namespace - window.tinymce = window.tinyMCE = EditorManager; - - return EditorManager; -}); - -// Included from: js/tinymce/classes/LegacyInput.js - -/** - * LegacyInput.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("tinymce/LegacyInput", [ - "tinymce/EditorManager", - "tinymce/util/Tools" -], function(EditorManager, Tools) { - var each = Tools.each, explode = Tools.explode; - - EditorManager.on('AddEditor', function(e) { - var editor = e.editor; - - editor.on('preInit', function() { - var filters, fontSizes, dom, settings = editor.settings; - - function replaceWithSpan(node, styles) { - each(styles, function(value, name) { - if (value) { - dom.setStyle(node, name, value); - } - }); - - dom.rename(node, 'span'); - } - - function convert(e) { - dom = editor.dom; - - if (settings.convert_fonts_to_spans) { - each(dom.select('font,u,strike', e.node), function(node) { - filters[node.nodeName.toLowerCase()](dom, node); - }); - } - } - - if (settings.inline_styles) { - fontSizes = explode(settings.font_size_legacy_values); - - filters = { - font: function(dom, node) { - replaceWithSpan(node, { - backgroundColor: node.style.backgroundColor, - color: node.color, - fontFamily: node.face, - fontSize: fontSizes[parseInt(node.size, 10) - 1] - }); - }, - - u: function(dom, node) { - replaceWithSpan(node, { - textDecoration: 'underline' - }); - }, - - strike: function(dom, node) { - replaceWithSpan(node, { - textDecoration: 'line-through' - }); - } - }; - - editor.on('PreProcess SetContent', convert); - } - }); - }); -}); - -// Included from: js/tinymce/classes/util/XHR.js - -/** - * XHR.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class enables you to send XMLHTTPRequests cross browser. - * @class tinymce.util.XHR - * @static - * @example - * // Sends a low level Ajax request - * tinymce.util.XHR.send({ - * url: 'someurl', - * success: function(text) { - * console.debug(text); - * } - * }); - */ -define("tinymce/util/XHR", [], function() { - return { - /** - * Sends a XMLHTTPRequest. - * Consult the Wiki for details on what settings this method takes. - * - * @method send - * @param {Object} settings Object will target URL, callbacks and other info needed to make the request. - */ - send: function(settings) { - var xhr, count = 0; - - function ready() { - if (!settings.async || xhr.readyState == 4 || count++ > 10000) { - if (settings.success && count < 10000 && xhr.status == 200) { - settings.success.call(settings.success_scope, '' + xhr.responseText, xhr, settings); - } else if (settings.error) { - settings.error.call(settings.error_scope, count > 10000 ? 'TIMED_OUT' : 'GENERAL', xhr, settings); - } - - xhr = null; - } else { - setTimeout(ready, 10); - } - } - - // Default settings - settings.scope = settings.scope || this; - settings.success_scope = settings.success_scope || settings.scope; - settings.error_scope = settings.error_scope || settings.scope; - settings.async = settings.async === false ? false : true; - settings.data = settings.data || ''; - - xhr = new XMLHttpRequest(); - - if (xhr) { - if (xhr.overrideMimeType) { - xhr.overrideMimeType(settings.content_type); - } - - xhr.open(settings.type || (settings.data ? 'POST' : 'GET'), settings.url, settings.async); - - if (settings.content_type) { - xhr.setRequestHeader('Content-Type', settings.content_type); - } - - xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); - - xhr.send(settings.data); - - // Syncronous request - if (!settings.async) { - return ready(); - } - - // Wait for response, onReadyStateChange can not be used since it leaks memory in IE - setTimeout(ready, 10); - } - } - }; -}); - -// Included from: js/tinymce/classes/util/JSON.js - -/** - * JSON.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * JSON parser and serializer class. - * - * @class tinymce.util.JSON - * @static - * @example - * // JSON parse a string into an object - * var obj = tinymce.util.JSON.parse(somestring); - * - * // JSON serialize a object into an string - * var str = tinymce.util.JSON.serialize(obj); - */ -define("tinymce/util/JSON", [], function() { - function serialize(o, quote) { - var i, v, t, name; - - quote = quote || '"'; - - if (o === null) { - return 'null'; - } - - t = typeof o; - - if (t == 'string') { - v = '\bb\tt\nn\ff\rr\""\'\'\\\\'; - - return quote + o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g, function(a, b) { - // Make sure single quotes never get encoded inside double quotes for JSON compatibility - if (quote === '"' && a === "'") { - return a; - } - - i = v.indexOf(b); - - if (i + 1) { - return '\\' + v.charAt(i + 1); - } - - a = b.charCodeAt().toString(16); - - return '\\u' + '0000'.substring(a.length) + a; - }) + quote; - } - - if (t == 'object') { - if (o.hasOwnProperty && Object.prototype.toString.call(o) === '[object Array]') { - for (i = 0, v = '['; i < o.length; i++) { - v += (i > 0 ? ',' : '') + serialize(o[i], quote); - } - - return v + ']'; - } - - v = '{'; - - for (name in o) { - if (o.hasOwnProperty(name)) { - v += typeof o[name] != 'function' ? (v.length > 1 ? ',' + quote : quote) + name + - quote + ':' + serialize(o[name], quote) : ''; - } - } - - return v + '}'; - } - - return '' + o; - } - - return { - /** - * Serializes the specified object as a JSON string. - * - * @method serialize - * @param {Object} obj Object to serialize as a JSON string. - * @param {String} quote Optional quote string defaults to ". - * @return {string} JSON string serialized from input. - */ - serialize: serialize, - - /** - * Unserializes/parses the specified JSON string into a object. - * - * @method parse - * @param {string} s JSON String to parse into a JavaScript object. - * @return {Object} Object from input JSON string or undefined if it failed. - */ - parse: function(text) { - try { - // Trick uglify JS - return window[String.fromCharCode(101) + 'val']('(' + text + ')'); - } catch (ex) { - // Ignore - } - } - - /**#@-*/ - }; -}); - -// Included from: js/tinymce/classes/util/JSONRequest.js - -/** - * JSONRequest.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class enables you to use JSON-RPC to call backend methods. - * - * @class tinymce.util.JSONRequest - * @example - * var json = new tinymce.util.JSONRequest({ - * url: 'somebackend.php' - * }); - * - * // Send RPC call 1 - * json.send({ - * method: 'someMethod1', - * params: ['a', 'b'], - * success: function(result) { - * console.dir(result); - * } - * }); - * - * // Send RPC call 2 - * json.send({ - * method: 'someMethod2', - * params: ['a', 'b'], - * success: function(result) { - * console.dir(result); - * } - * }); - */ -define("tinymce/util/JSONRequest", [ - "tinymce/util/JSON", - "tinymce/util/XHR", - "tinymce/util/Tools" -], function(JSON, XHR, Tools) { - var extend = Tools.extend; - - function JSONRequest(settings) { - this.settings = extend({}, settings); - this.count = 0; - } - - /** - * Simple helper function to send a JSON-RPC request without the need to initialize an object. - * Consult the Wiki API documentation for more details on what you can pass to this function. - * - * @method sendRPC - * @static - * @param {Object} o Call object where there are three field id, method and params this object should also contain callbacks etc. - */ - JSONRequest.sendRPC = function(o) { - return new JSONRequest().send(o); - }; - - JSONRequest.prototype = { - /** - * Sends a JSON-RPC call. Consult the Wiki API documentation for more details on what you can pass to this function. - * - * @method send - * @param {Object} args Call object where there are three field id, method and params this object should also contain callbacks etc. - */ - send: function(args) { - var ecb = args.error, scb = args.success; - - args = extend(this.settings, args); - - args.success = function(c, x) { - c = JSON.parse(c); - - if (typeof(c) == 'undefined') { - c = { - error : 'JSON Parse error.' - }; - } - - if (c.error) { - ecb.call(args.error_scope || args.scope, c.error, x); - } else { - scb.call(args.success_scope || args.scope, c.result); - } - }; - - args.error = function(ty, x) { - if (ecb) { - ecb.call(args.error_scope || args.scope, ty, x); - } - }; - - args.data = JSON.serialize({ - id: args.id || 'c' + (this.count++), - method: args.method, - params: args.params - }); - - // JSON content type for Ruby on rails. Bug: #1883287 - args.content_type = 'application/json'; - - XHR.send(args); - } - }; - - return JSONRequest; -}); - -// Included from: js/tinymce/classes/util/JSONP.js - -/** - * JSONP.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("tinymce/util/JSONP", [ - "tinymce/dom/DOMUtils" -], function(DOMUtils) { - return { - callbacks: {}, - count: 0, - - send: function(settings) { - var self = this, dom = DOMUtils.DOM, count = settings.count !== undefined ? settings.count : self.count; - var id = 'tinymce_jsonp_' + count; - - self.callbacks[count] = function(json) { - dom.remove(id); - delete self.callbacks[count]; - - settings.callback(json); - }; - - dom.add(dom.doc.body, 'script', { - id: id, - src: settings.url, - type: 'text/javascript' - }); - - self.count++; - } - }; -}); - -// Included from: js/tinymce/classes/util/LocalStorage.js - -/** - * LocalStorage.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class will simulate LocalStorage on IE 7 and return the native version on modern browsers. - * Storage is done using userData on IE 7 and a special serialization format. The format is designed - * to be as small as possible by making sure that the keys and values doesn't need to be encoded. This - * makes it possible to store for example HTML data. - * - * Storage format for userData: - * ,,,,... - * - * For example this data key1=value1,key2=value2 would be: - * 4,key1,6,value1,4,key2,6,value2 - * - * @class tinymce.util.LocalStorage - * @static - * @version 4.0 - * @example - * tinymce.util.LocalStorage.setItem('key', 'value'); - * var value = tinymce.util.LocalStorage.getItem('key'); - */ -define("tinymce/util/LocalStorage", [], function() { - var LocalStorage, storageElm, items, keys, userDataKey, hasOldIEDataSupport; - - // Check for native support - try { - if (window.localStorage) { - return localStorage; - } - } catch (ex) { - // Ignore - } - - userDataKey = "tinymce"; - storageElm = document.documentElement; - hasOldIEDataSupport = !!storageElm.addBehavior; - - if (hasOldIEDataSupport) { - storageElm.addBehavior('#default#userData'); - } - - /** - * Gets the keys names and updates LocalStorage.length property. Since IE7 doesn't have any getters/setters. - */ - function updateKeys() { - keys = []; - - for (var key in items) { - keys.push(key); - } - - LocalStorage.length = keys.length; - } - - /** - * Loads the userData string and parses it into the items structure. - */ - function load() { - var key, data, value, pos = 0; - - items = {}; - - // localStorage can be disabled on WebKit/Gecko so make a dummy storage - if (!hasOldIEDataSupport) { - return; - } - - function next(end) { - var value, nextPos; - - nextPos = end !== undefined ? pos + end : data.indexOf(',', pos); - if (nextPos === -1 || nextPos > data.length) { - return null; - } - - value = data.substring(pos, nextPos); - pos = nextPos + 1; - - return value; - } - - storageElm.load(userDataKey); - data = storageElm.getAttribute(userDataKey) || ''; - - do { - var offset = next(); - if (offset === null) { - break; - } - - key = next(parseInt(offset, 32) || 0); - if (key !== null) { - offset = next(); - if (offset === null) { - break; - } - - value = next(parseInt(offset, 32) || 0); - - if (key) { - items[key] = value; - } - } - } while (key !== null); - - updateKeys(); - } - - /** - * Saves the items structure into a the userData format. - */ - function save() { - var value, data = ''; - - // localStorage can be disabled on WebKit/Gecko so make a dummy storage - if (!hasOldIEDataSupport) { - return; - } - - for (var key in items) { - value = items[key]; - data += (data ? ',' : '') + key.length.toString(32) + ',' + key + ',' + value.length.toString(32) + ',' + value; - } - - storageElm.setAttribute(userDataKey, data); - - try { - storageElm.save(userDataKey); - } catch (ex) { - // Ignore disk full - } - - updateKeys(); - } - - LocalStorage = { - /** - * Length of the number of items in storage. - * - * @property length - * @type Number - * @return {Number} Number of items in storage. - */ - //length:0, - - /** - * Returns the key name by index. - * - * @method key - * @param {Number} index Index of key to return. - * @return {String} Key value or null if it wasn't found. - */ - key: function(index) { - return keys[index]; - }, - - /** - * Returns the value if the specified key or null if it wasn't found. - * - * @method getItem - * @param {String} key Key of item to retrive. - * @return {String} Value of the specified item or null if it wasn't found. - */ - getItem: function(key) { - return key in items ? items[key] : null; - }, - - /** - * Sets the value of the specified item by it's key. - * - * @method setItem - * @param {String} key Key of the item to set. - * @param {String} value Value of the item to set. - */ - setItem: function(key, value) { - items[key] = "" + value; - save(); - }, - - /** - * Removes the specified item by key. - * - * @method removeItem - * @param {String} key Key of item to remove. - */ - removeItem: function(key) { - delete items[key]; - save(); - }, - - /** - * Removes all items. - * - * @method clear - */ - clear: function() { - items = {}; - save(); - } - }; - - load(); - - return LocalStorage; -}); - -// Included from: js/tinymce/classes/Compat.js - -/** - * Compat.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * TinyMCE core class. - * - * @static - * @class tinymce - * @borrow-members tinymce.EditorManager - * @borrow-members tinymce.util.Tools - */ -define("tinymce/Compat", [ - "tinymce/dom/DOMUtils", - "tinymce/dom/EventUtils", - "tinymce/dom/ScriptLoader", - "tinymce/AddOnManager", - "tinymce/util/Tools", - "tinymce/Env" -], function(DOMUtils, EventUtils, ScriptLoader, AddOnManager, Tools, Env) { - var tinymce = window.tinymce; - - /** - * @property {tinymce.dom.DOMUtils} DOM Global DOM instance. - * @property {tinymce.dom.ScriptLoader} ScriptLoader Global ScriptLoader instance. - * @property {tinymce.AddOnManager} PluginManager Global PluginManager instance. - * @property {tinymce.AddOnManager} ThemeManager Global ThemeManager instance. - */ - tinymce.DOM = DOMUtils.DOM; - tinymce.ScriptLoader = ScriptLoader.ScriptLoader; - tinymce.PluginManager = AddOnManager.PluginManager; - tinymce.ThemeManager = AddOnManager.ThemeManager; - - tinymce.dom = tinymce.dom || {}; - tinymce.dom.Event = EventUtils.Event; - - Tools.each(Tools, function(func, key) { - tinymce[key] = func; - }); - - Tools.each('isOpera isWebKit isIE isGecko isMac'.split(' '), function(name) { - tinymce[name] = Env[name.substr(2).toLowerCase()]; - }); - - return {}; -}); - -// Describe the different namespaces - -/** - * Root level namespace this contains classes directly releated to the TinyMCE editor. - * - * @namespace tinymce - */ - -/** - * Contains classes for handling the browsers DOM. - * - * @namespace tinymce.dom - */ - -/** - * Contains html parser and serializer logic. - * - * @namespace tinymce.html - */ - -/** - * Contains the different UI types such as buttons, listboxes etc. - * - * @namespace tinymce.ui - */ - -/** - * Contains various utility classes such as json parser, cookies etc. - * - * @namespace tinymce.util - */ - -// Included from: js/tinymce/classes/ui/Layout.js - -/** - * Layout.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Base layout manager class. - * - * @class tinymce.ui.Layout - */ -define("tinymce/ui/Layout", [ - "tinymce/util/Class", - "tinymce/util/Tools" -], function(Class, Tools) { - "use strict"; - - return Class.extend({ - Defaults: { - firstControlClass: 'first', - lastControlClass: 'last' - }, - - /** - * Constructs a layout instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - */ - init: function(settings) { - this.settings = Tools.extend({}, this.Defaults, settings); - }, - - /** - * This method gets invoked before the layout renders the controls. - * - * @method preRender - * @param {tinymce.ui.Container} container Container instance to preRender. - */ - preRender: function(container) { - container.addClass(this.settings.containerClass, 'body'); - }, - - /** - * Applies layout classes to the container. - * - * @private - */ - applyClasses: function(container) { - var self = this, settings = self.settings, items, firstClass, lastClass; - - items = container.items().filter(':visible'); - firstClass = settings.firstControlClass; - lastClass = settings.lastControlClass; - - items.each(function(item) { - item.removeClass(firstClass).removeClass(lastClass); - - if (settings.controlClass) { - item.addClass(settings.controlClass); - } - }); - - items.eq(0).addClass(firstClass); - items.eq(-1).addClass(lastClass); - }, - - /** - * Renders the specified container and any layout specific HTML. - * - * @method renderHtml - * @param {tinymce.ui.Container} container Container to render HTML for. - */ - renderHtml: function(container) { - var self = this, settings = self.settings, items, html = ''; - - items = container.items(); - items.eq(0).addClass(settings.firstControlClass); - items.eq(-1).addClass(settings.lastControlClass); - - items.each(function(item) { - if (settings.controlClass) { - item.addClass(settings.controlClass); - } - - html += item.renderHtml(); - }); - - return html; - }, - - /** - * Recalculates the positions of the controls in the specified container. - * - * @method recalc - * @param {tinymce.ui.Container} container Container instance to recalc. - */ - recalc: function() { - }, - - /** - * This method gets invoked after the layout renders the controls. - * - * @method postRender - * @param {tinymce.ui.Container} container Container instance to postRender. - */ - postRender: function() { - } - }); -}); - -// Included from: js/tinymce/classes/ui/AbsoluteLayout.js - -/** - * AbsoluteLayout.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * LayoutManager for absolute positioning. This layout manager is more of - * a base class for other layouts but can be created and used directly. - * - * @-x-less AbsoluteLayout.less - * @class tinymce.ui.AbsoluteLayout - * @extends tinymce.ui.Layout - */ -define("tinymce/ui/AbsoluteLayout", [ - "tinymce/ui/Layout" -], function(Layout) { - "use strict"; - - return Layout.extend({ - Defaults: { - containerClass: 'abs-layout', - controlClass: 'abs-layout-item' - }, - - /** - * Recalculates the positions of the controls in the specified container. - * - * @method recalc - * @param {tinymce.ui.Container} container Container instance to recalc. - */ - recalc: function(container) { - container.items().filter(':visible').each(function(ctrl) { - var settings = ctrl.settings; - - ctrl.layoutRect({ - x: settings.x, - y: settings.y, - w: settings.w, - h: settings.h - }); - - if (ctrl.recalc) { - ctrl.recalc(); - } - }); - }, - - /** - * Renders the specified container and any layout specific HTML. - * - * @method renderHtml - * @param {tinymce.ui.Container} container Container to render HTML for. - */ - renderHtml: function(container) { - return '
    ' + this._super(container); - } - }); -}); - -// Included from: js/tinymce/classes/ui/Tooltip.js - -/** - * Tooltip.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a tooltip instance. - * - * @-x-less ToolTip.less - * @class tinymce.ui.ToolTip - * @extends tinymce.ui.Control - * @mixes tinymce.ui.Movable - */ -define("tinymce/ui/Tooltip", [ - "tinymce/ui/Control", - "tinymce/ui/Movable" -], function(Control, Movable) { - return Control.extend({ - Mixins: [Movable], - - Defaults: { - classes: 'widget tooltip tooltip-n' - }, - - /** - * Sets/gets the current label text. - * - * @method text - * @param {String} [text] New label text. - * @return {String|tinymce.ui.Tooltip} Current text or current label instance. - */ - text: function(value) { - var self = this; - - if (typeof(value) != "undefined") { - self._value = value; - - if (self._rendered) { - self.getEl().lastChild.innerHTML = self.encode(value); - } - - return self; - } - - return self._value; - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, prefix = self.classPrefix; - - return ( - '' - ); - }, - - /** - * Repaints the control after a layout operation. - * - * @method repaint - */ - repaint: function() { - var self = this, style, rect; - - style = self.getEl().style; - rect = self._layoutRect; - - style.left = rect.x + 'px'; - style.top = rect.y + 'px'; - style.zIndex = 0xFFFF + 0xFFFF; - } - }); -}); - -// Included from: js/tinymce/classes/ui/Widget.js - -/** - * Widget.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Widget base class a widget is a control that has a tooltip and some basic states. - * - * @class tinymce.ui.Widget - * @extends tinymce.ui.Control - */ -define("tinymce/ui/Widget", [ - "tinymce/ui/Control", - "tinymce/ui/Tooltip" -], function(Control, Tooltip) { - "use strict"; - - var tooltip; - - var Widget = Control.extend({ - /** - * Constructs a instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - * @setting {String} tooltip Tooltip text to display when hovering. - * @setting {Boolean} autofocus True if the control should be focused when rendered. - * @setting {String} text Text to display inside widget. - */ - init: function(settings) { - var self = this; - - self._super(settings); - self.canFocus = true; - - if (settings.tooltip && Widget.tooltips !== false) { - self.on('mouseenter', function(e) { - var tooltip = self.tooltip().moveTo(-0xFFFF); - - if (e.control == self) { - var rel = tooltip.text(settings.tooltip).show().testMoveRel(self.getEl(), ['bc-tc', 'bc-tl', 'bc-tr']); - - tooltip.toggleClass('tooltip-n', rel == 'bc-tc'); - tooltip.toggleClass('tooltip-nw', rel == 'bc-tl'); - tooltip.toggleClass('tooltip-ne', rel == 'bc-tr'); - - tooltip.moveRel(self.getEl(), rel); - } else { - tooltip.hide(); - } - }); - - self.on('mouseleave mousedown click', function() { - self.tooltip().hide(); - }); - } - - self.aria('label', settings.ariaLabel || settings.tooltip); - }, - - /** - * Returns the current tooltip instance. - * - * @method tooltip - * @return {tinymce.ui.Tooltip} Tooltip instance. - */ - tooltip: function() { - if (!tooltip) { - tooltip = new Tooltip({type: 'tooltip'}); - tooltip.renderTo(); - } - - return tooltip; - }, - - /** - * Sets/gets the active state of the widget. - * - * @method active - * @param {Boolean} [state] State if the control is active. - * @return {Boolean|tinymce.ui.Widget} True/false or current widget instance. - */ - active: function(state) { - var self = this, undef; - - if (state !== undef) { - self.aria('pressed', state); - self.toggleClass('active', state); - } - - return self._super(state); - }, - - /** - * Sets/gets the disabled state of the widget. - * - * @method disabled - * @param {Boolean} [state] State if the control is disabled. - * @return {Boolean|tinymce.ui.Widget} True/false or current widget instance. - */ - disabled: function(state) { - var self = this, undef; - - if (state !== undef) { - self.aria('disabled', state); - self.toggleClass('disabled', state); - } - - return self._super(state); - }, - - /** - * Called after the control has been rendered. - * - * @method postRender - */ - postRender: function() { - var self = this, settings = self.settings; - - self._rendered = true; - - self._super(); - - if (!self.parent() && (settings.width || settings.height)) { - self.initLayoutRect(); - self.repaint(); - } - - if (settings.autofocus) { - self.focus(); - } - }, - - /** - * Removes the current control from DOM and from UI collections. - * - * @method remove - * @return {tinymce.ui.Control} Current control instance. - */ - remove: function() { - this._super(); - - if (tooltip) { - tooltip.remove(); - tooltip = null; - } - } - }); - - return Widget; -}); - -// Included from: js/tinymce/classes/ui/Button.js - -/** - * Button.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class is used to create buttons. You can create them directly or through the Factory. - * - * @example - * // Create and render a button to the body element - * tinymce.ui.Factory.create({ - * type: 'button', - * text: 'My button' - * }).renderTo(document.body); - * - * @-x-less Button.less - * @class tinymce.ui.Button - * @extends tinymce.ui.Widget - */ -define("tinymce/ui/Button", [ - "tinymce/ui/Widget" -], function(Widget) { - "use strict"; - - return Widget.extend({ - Defaults: { - classes: "widget btn", - role: "button" - }, - - /** - * Constructs a new button instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - * @setting {String} size Size of the button small|medium|large. - * @setting {String} image Image to use for icon. - * @setting {String} icon Icon to use for button. - */ - init: function(settings) { - var self = this, size; - - self.on('click mousedown', function(e) { - e.preventDefault(); - }); - - self._super(settings); - size = settings.size; - - if (settings.subtype) { - self.addClass(settings.subtype); - } - - if (size) { - self.addClass('btn-' + size); - } - }, - - /** - * Sets/gets the current button icon. - * - * @method icon - * @param {String} [icon] New icon identifier. - * @return {String|tinymce.ui.MenuButton} Current icon or current MenuButton instance. - */ - icon: function(icon) { - var self = this, prefix = self.classPrefix; - - if (typeof(icon) == 'undefined') { - return self.settings.icon; - } - - self.settings.icon = icon; - icon = icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : ''; - - if (self._rendered) { - var btnElm = self.getEl().firstChild, iconElm = btnElm.getElementsByTagName('i')[0]; - - if (icon) { - if (!iconElm || iconElm != btnElm.firstChild) { - iconElm = document.createElement('i'); - btnElm.insertBefore(iconElm, btnElm.firstChild); - } - - iconElm.className = icon; - } else if (iconElm) { - btnElm.removeChild(iconElm); - } - - self.text(self._text); // Set text again to fix whitespace between icon + text - } - - return self; - }, - - /** - * Repaints the button for example after it's been resizes by a layout engine. - * - * @method repaint - */ - repaint: function() { - var btnStyle = this.getEl().firstChild.style; - - btnStyle.width = btnStyle.height = "100%"; - - this._super(); - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, id = self._id, prefix = self.classPrefix; - var icon = self.settings.icon, image = ''; - - if (self.settings.image) { - icon = 'none'; - image = ' style="background-image: url(\'' + self.settings.image + '\')"'; - } - - icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + icon : ''; - - return ( - '
    ' + - '' + - '
    ' - ); - } - }); -}); - -// Included from: js/tinymce/classes/ui/ButtonGroup.js - -/** - * ButtonGroup.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This control enables you to put multiple buttons into a group. This is - * useful when you want to combine similar toolbar buttons into a group. - * - * @example - * // Create and render a buttongroup with two buttons to the body element - * tinymce.ui.Factory.create({ - * type: 'buttongroup', - * items: [ - * {text: 'Button A'}, - * {text: 'Button B'} - * ] - * }).renderTo(document.body); - * - * @-x-less ButtonGroup.less - * @class tinymce.ui.ButtonGroup - * @extends tinymce.ui.Container - */ -define("tinymce/ui/ButtonGroup", [ - "tinymce/ui/Container" -], function(Container) { - "use strict"; - - return Container.extend({ - Defaults: { - defaultType: 'button', - role: 'group' - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, layout = self._layout; - - self.addClass('btn-group'); - self.preRender(); - layout.preRender(self); - - return ( - '
    ' + - '
    ' + - (self.settings.html || '') + layout.renderHtml(self) + - '
    ' + - '
    ' - ); - } - }); -}); - -// Included from: js/tinymce/classes/ui/Checkbox.js - -/** - * Checkbox.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This control creates a custom checkbox. - * - * @example - * // Create and render a checkbox to the body element - * tinymce.ui.Factory.create({ - * type: 'checkbox', - * checked: true, - * text: 'My checkbox' - * }).renderTo(document.body); - * - * @-x-less Checkbox.less - * @class tinymce.ui.Checkbox - * @extends tinymce.ui.Widget - */ -define("tinymce/ui/Checkbox", [ - "tinymce/ui/Widget" -], function(Widget) { - "use strict"; - - return Widget.extend({ - Defaults: { - classes: "checkbox", - role: "checkbox", - checked: false - }, - - /** - * Constructs a new Checkbox instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - * @setting {Boolean} checked True if the checkbox should be checked by default. - */ - init: function(settings) { - var self = this; - - self._super(settings); - - self.on('click mousedown', function(e) { - e.preventDefault(); - }); - - self.on('click', function(e) { - e.preventDefault(); - - if (!self.disabled()) { - self.checked(!self.checked()); - } - }); - - self.checked(self.settings.checked); - }, - - /** - * Getter/setter function for the checked state. - * - * @method checked - * @param {Boolean} [state] State to be set. - * @return {Boolean|tinymce.ui.Checkbox} True/false or checkbox if it's a set operation. - */ - checked: function(state) { - var self = this; - - if (typeof state != "undefined") { - if (state) { - self.addClass('checked'); - } else { - self.removeClass('checked'); - } - - self._checked = state; - self.aria('checked', state); - - return self; - } - - return self._checked; - }, - - /** - * Getter/setter function for the value state. - * - * @method value - * @param {Boolean} [state] State to be set. - * @return {Boolean|tinymce.ui.Checkbox} True/false or checkbox if it's a set operation. - */ - value: function(state) { - return this.checked(state); - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, id = self._id, prefix = self.classPrefix; - - return ( - '
    ' + - '' + - '' + self.encode(self._text) + '' + - '
    ' - ); - } - }); -}); - -// Included from: js/tinymce/classes/ui/PanelButton.js - -/** - * PanelButton.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a new panel button. - * - * @class tinymce.ui.PanelButton - * @extends tinymce.ui.Button - */ -define("tinymce/ui/PanelButton", [ - "tinymce/ui/Button", - "tinymce/ui/FloatPanel" -], function(Button, FloatPanel) { - "use strict"; - - return Button.extend({ - /** - * Shows the panel for the button. - * - * @method showPanel - */ - showPanel: function() { - var self = this, settings = self.settings; - - self.active(true); - - if (!self.panel) { - var panelSettings = settings.panel; - - // Wrap panel in grid layout if type if specified - // This makes it possible to add forms or other containers directly in the panel option - if (panelSettings.type) { - panelSettings = { - layout: 'grid', - items: panelSettings - }; - } - - panelSettings.role = panelSettings.role || 'dialog'; - panelSettings.popover = true; - panelSettings.autohide = true; - panelSettings.ariaRoot = true; - - self.panel = new FloatPanel(panelSettings).on('hide', function() { - self.active(false); - }).on('cancel', function(e) { - e.stopPropagation(); - self.focus(); - self.hidePanel(); - }).parent(self).renderTo(self.getContainerElm()); - - self.panel.fire('show'); - self.panel.reflow(); - } else { - self.panel.show(); - } - - self.panel.moveRel(self.getEl(), settings.popoverAlign || (self.isRtl() ? ['bc-tr', 'bc-tc'] : ['bc-tl', 'bc-tc'])); - }, - - /** - * Hides the panel for the button. - * - * @method hidePanel - */ - hidePanel: function() { - var self = this; - - if (self.panel) { - self.panel.hide(); - } - }, - - /** - * Called after the control has been rendered. - * - * @method postRender - */ - postRender: function() { - var self = this; - - self.aria('haspopup', true); - - self.on('click', function(e) { - if (e.control === self) { - if (self.panel && self.panel.visible()) { - self.hidePanel(); - } else { - self.showPanel(); - self.panel.focus(!!e.aria); - } - } - }); - - return self._super(); - } - }); -}); - -// Included from: js/tinymce/classes/ui/ColorButton.js - -/** - * ColorButton.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class creates a color button control. This is a split button in which the main - * button has a visual representation of the currently selected color. When clicked - * the caret button displays a color picker, allowing the user to select a new color. - * - * @-x-less ColorButton.less - * @class tinymce.ui.ColorButton - * @extends tinymce.ui.PanelButton - */ -define("tinymce/ui/ColorButton", [ - "tinymce/ui/PanelButton", - "tinymce/dom/DOMUtils" -], function(PanelButton, DomUtils) { - "use strict"; - - var DOM = DomUtils.DOM; - - return PanelButton.extend({ - /** - * Constructs a new ColorButton instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - */ - init: function(settings) { - this._super(settings); - this.addClass('colorbutton'); - }, - - /** - * Getter/setter for the current color. - * - * @method color - * @param {String} [color] Color to set. - * @return {String|tinymce.ui.ColorButton} Current color or current instance. - */ - color: function(color) { - if (color) { - this._color = color; - this.getEl('preview').style.backgroundColor = color; - return this; - } - - return this._color; - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, id = self._id, prefix = self.classPrefix; - var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : ''; - var image = self.settings.image ? ' style="background-image: url(\'' + self.settings.image + '\')"' : ''; - - return ( - '
    ' + - '' + - '' + - '
    ' - ); - }, - - /** - * Called after the control has been rendered. - * - * @method postRender - */ - postRender: function() { - var self = this, onClickHandler = self.settings.onclick; - - self.on('click', function(e) { - if (e.aria && e.aria.key == 'down') { - return; - } - - if (e.control == self && !DOM.getParent(e.target, '.' + self.classPrefix + 'open')) { - e.stopImmediatePropagation(); - onClickHandler.call(self, e); - } - }); - - delete self.settings.onclick; - - return self._super(); - } - - }); -}); - -// Included from: js/tinymce/classes/ui/ComboBox.js - -/** - * ComboBox.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class creates a combobox control. Select box that you select a value from or - * type a value into. - * - * @-x-less ComboBox.less - * @class tinymce.ui.ComboBox - * @extends tinymce.ui.Widget - */ -define("tinymce/ui/ComboBox", [ - "tinymce/ui/Widget", - "tinymce/ui/Factory", - "tinymce/ui/DomUtils" -], function(Widget, Factory, DomUtils) { - "use strict"; - - return Widget.extend({ - /** - * Constructs a new control instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - * @setting {String} placeholder Placeholder text to display. - */ - init: function(settings) { - var self = this; - - self._super(settings); - self.addClass('combobox'); - self.subinput = true; - self.ariaTarget = 'inp'; // TODO: Figure out a better way - - settings = self.settings; - settings.menu = settings.menu || settings.values; - - if (settings.menu) { - settings.icon = 'caret'; - } - - self.on('click', function(e) { - var elm = e.target, root = self.getEl(); - - while (elm && elm != root) { - if (elm.id && elm.id.indexOf('-open') != -1) { - self.fire('action'); - - if (settings.menu) { - self.showMenu(); - - if (e.aria) { - self.menu.items()[0].focus(); - } - } - } - - elm = elm.parentNode; - } - }); - - // TODO: Rework this - self.on('keydown', function(e) { - if (e.target.nodeName == "INPUT" && e.keyCode == 13) { - self.parents().reverse().each(function(ctrl) { - e.preventDefault(); - self.fire('change'); - - if (ctrl.hasEventListeners('submit') && ctrl.toJSON) { - ctrl.fire('submit', {data: ctrl.toJSON()}); - return false; - } - }); - } - }); - - if (settings.placeholder) { - self.addClass('placeholder'); - - self.on('focusin', function() { - if (!self._hasOnChange) { - DomUtils.on(self.getEl('inp'), 'change', function() { - self.fire('change'); - }); - - self._hasOnChange = true; - } - - if (self.hasClass('placeholder')) { - self.getEl('inp').value = ''; - self.removeClass('placeholder'); - } - }); - - self.on('focusout', function() { - if (self.value().length === 0) { - self.getEl('inp').value = settings.placeholder; - self.addClass('placeholder'); - } - }); - } - }, - - showMenu: function() { - var self = this, settings = self.settings, menu; - - if (!self.menu) { - menu = settings.menu || []; - - // Is menu array then auto constuct menu control - if (menu.length) { - menu = { - type: 'menu', - items: menu - }; - } else { - menu.type = menu.type || 'menu'; - } - - self.menu = Factory.create(menu).parent(self).renderTo(self.getContainerElm()); - self.fire('createmenu'); - self.menu.reflow(); - self.menu.on('cancel', function(e) { - if (e.control === self.menu) { - self.focus(); - } - }); - - self.menu.on('show hide', function(e) { - e.control.items().each(function(ctrl) { - ctrl.active(ctrl.value() == self.value()); - }); - }).fire('show'); - - self.menu.on('select', function(e) { - self.value(e.control.value()); - }); - - self.on('focusin', function(e) { - if (e.target.tagName == 'INPUT') { - self.menu.hide(); - } - }); - - self.aria('expanded', true); - } - - self.menu.show(); - self.menu.layoutRect({w: self.layoutRect().w}); - self.menu.moveRel(self.getEl(), self.isRtl() ? ['br-tr', 'tr-br'] : ['bl-tl', 'tl-bl']); - }, - - /** - * Getter/setter function for the control value. - * - * @method value - * @param {String} [value] Value to be set. - * @return {String|tinymce.ui.ComboBox} Value or self if it's a set operation. - */ - value: function(value) { - var self = this; - - if (typeof(value) != "undefined") { - self._value = value; - self.removeClass('placeholder'); - - if (self._rendered) { - self.getEl('inp').value = value; - } - - return self; - } - - if (self._rendered) { - value = self.getEl('inp').value; - - if (value != self.settings.placeholder) { - return value; - } - - return ''; - } - - return self._value; - }, - - /** - * Getter/setter function for the disabled state. - * - * @method value - * @param {Boolean} [state] State to be set. - * @return {Boolean|tinymce.ui.ComboBox} True/false or self if it's a set operation. - */ - disabled: function(state) { - var self = this; - - if (self._rendered && typeof(state) != 'undefined') { - self.getEl('inp').disabled = state; - } - - return self._super(state); - }, - - /** - * Focuses the input area of the control. - * - * @method focus - */ - focus: function() { - this.getEl('inp').focus(); - }, - - /** - * Repaints the control after a layout operation. - * - * @method repaint - */ - repaint: function() { - var self = this, elm = self.getEl(), openElm = self.getEl('open'), rect = self.layoutRect(); - var width, lineHeight; - - if (openElm) { - width = rect.w - DomUtils.getSize(openElm).width - 10; - } else { - width = rect.w - 10; - } - - // Detect old IE 7+8 add lineHeight to align caret vertically in the middle - var doc = document; - if (doc.all && (!doc.documentMode || doc.documentMode <= 8)) { - lineHeight = (self.layoutRect().h - 2) + 'px'; - } - - DomUtils.css(elm.firstChild, { - width: width, - lineHeight: lineHeight - }); - - self._super(); - - return self; - }, - - /** - * Post render method. Called after the control has been rendered to the target. - * - * @method postRender - * @return {tinymce.ui.ComboBox} Current combobox instance. - */ - postRender: function() { - var self = this; - - DomUtils.on(this.getEl('inp'), 'change', function() { - self.fire('change'); - }); - - return self._super(); - }, - - remove: function() { - DomUtils.off(this.getEl('inp')); - this._super(); - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, id = self._id, settings = self.settings, prefix = self.classPrefix; - var value = settings.value || settings.placeholder || ''; - var icon, text, openBtnHtml = '', extraAttrs = ''; - - if ("spellcheck" in settings) { - extraAttrs += ' spellcheck="' + settings.spellcheck + '"'; - } - - if (settings.maxLength) { - extraAttrs += ' maxlength="' + settings.maxLength + '"'; - } - - if (settings.size) { - extraAttrs += ' size="' + settings.size + '"'; - } - - if (settings.subtype) { - extraAttrs += ' type="' + settings.subtype + '"'; - } - - if (self.disabled()) { - extraAttrs += ' disabled="disabled"'; - } - - icon = settings.icon; - if (icon && icon != 'caret') { - icon = prefix + 'ico ' + prefix + 'i-' + settings.icon; - } - - text = self._text; - - if (icon || text) { - openBtnHtml = ( - '
    ' + - '' + - '
    ' - ); - - self.addClass('has-open'); - } - - return ( - '
    ' + - '' + - openBtnHtml + - '
    ' - ); - } - }); -}); - -// Included from: js/tinymce/classes/ui/Path.js - -/** - * Path.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a new path control. - * - * @-x-less Path.less - * @class tinymce.ui.Path - * @extends tinymce.ui.Widget - */ -define("tinymce/ui/Path", [ - "tinymce/ui/Widget" -], function(Widget) { - "use strict"; - - return Widget.extend({ - /** - * Constructs a instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - * @setting {String} delimiter Delimiter to display between items in path. - */ - init: function(settings) { - var self = this; - - if (!settings.delimiter) { - settings.delimiter = '\u00BB'; - } - - self._super(settings); - self.addClass('path'); - self.canFocus = true; - - self.on('click', function(e) { - var index, target = e.target; - - if ((index = target.getAttribute('data-index'))) { - self.fire('select', {value: self.data()[index], index: index}); - } - }); - }, - - /** - * Focuses the current control. - * - * @method focus - * @return {tinymce.ui.Control} Current control instance. - */ - focus: function() { - var self = this; - - self.getEl().firstChild.focus(); - - return self; - }, - - /** - * Sets/gets the data to be used for the path. - * - * @method data - * @param {Array} data Array with items name is rendered to path. - */ - data: function(data) { - var self = this; - - if (typeof(data) !== "undefined") { - self._data = data; - self.update(); - - return self; - } - - return self._data; - }, - - /** - * Updated the path. - * - * @private - */ - update: function() { - this.innerHtml(this._getPathHtml()); - }, - - /** - * Called after the control has been rendered. - * - * @method postRender - */ - postRender: function() { - var self = this; - - self._super(); - - self.data(self.settings.data); - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this; - - return ( - '
    ' + - self._getPathHtml() + - '
    ' - ); - }, - - _getPathHtml: function() { - var self = this, parts = self._data || [], i, l, html = '', prefix = self.classPrefix; - - for (i = 0, l = parts.length; i < l; i++) { - html += ( - (i > 0 ? '' : '') + - '
    ' + parts[i].name + '
    ' - ); - } - - if (!html) { - html = '
     
    '; - } - - return html; - } - }); -}); - -// Included from: js/tinymce/classes/ui/ElementPath.js - -/** - * ElementPath.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This control creates an path for the current selections parent elements in TinyMCE. - * - * @class tinymce.ui.ElementPath - * @extends tinymce.ui.Path - */ -define("tinymce/ui/ElementPath", [ - "tinymce/ui/Path", - "tinymce/EditorManager" -], function(Path, EditorManager) { - return Path.extend({ - /** - * Post render method. Called after the control has been rendered to the target. - * - * @method postRender - * @return {tinymce.ui.ElementPath} Current combobox instance. - */ - postRender: function() { - var self = this, editor = EditorManager.activeEditor; - - function isHidden(elm) { - if (elm.nodeType === 1) { - if (elm.nodeName == "BR" || !!elm.getAttribute('data-mce-bogus')) { - return true; - } - - if (elm.getAttribute('data-mce-type') === 'bookmark') { - return true; - } - } - - return false; - } - - self.on('select', function(e) { - var parents = [], node, body = editor.getBody(); - - editor.focus(); - - node = editor.selection.getStart(); - while (node && node != body) { - if (!isHidden(node)) { - parents.push(node); - } - - node = node.parentNode; - } - - editor.selection.select(parents[parents.length - 1 - e.index]); - editor.nodeChanged(); - }); - - editor.on('nodeChange', function(e) { - var parents = [], selectionParents = e.parents, i = selectionParents.length; - - while (i--) { - if (selectionParents[i].nodeType == 1 && !isHidden(selectionParents[i])) { - var args = editor.fire('ResolveName', { - name: selectionParents[i].nodeName.toLowerCase(), - target: selectionParents[i] - }); - - parents.push({name: args.name}); - } - } - - self.data(parents); - }); - - return self._super(); - } - }); -}); - -// Included from: js/tinymce/classes/ui/FormItem.js - -/** - * FormItem.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class is a container created by the form element with - * a label and control item. - * - * @class tinymce.ui.FormItem - * @extends tinymce.ui.Container - * @setting {String} label Label to display for the form item. - */ -define("tinymce/ui/FormItem", [ - "tinymce/ui/Container" -], function(Container) { - "use strict"; - - return Container.extend({ - Defaults: { - layout: 'flex', - align: 'center', - defaults: { - flex: 1 - } - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, layout = self._layout, prefix = self.classPrefix; - - self.addClass('formitem'); - layout.preRender(self); - - return ( - '
    ' + - (self.settings.title ? ('
    ' + - self.settings.title + '
    ') : '') + - '
    ' + - (self.settings.html || '') + layout.renderHtml(self) + - '
    ' + - '
    ' - ); - } - }); -}); - -// Included from: js/tinymce/classes/ui/Form.js - -/** - * Form.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class creates a form container. A form container has the ability - * to automatically wrap items in tinymce.ui.FormItem instances. - * - * Each FormItem instance is a container for the label and the item. - * - * @example - * tinymce.ui.Factory.create({ - * type: 'form', - * items: [ - * {type: 'textbox', label: 'My text box'} - * ] - * }).renderTo(document.body); - * - * @class tinymce.ui.Form - * @extends tinymce.ui.Container - */ -define("tinymce/ui/Form", [ - "tinymce/ui/Container", - "tinymce/ui/FormItem" -], function(Container, FormItem) { - "use strict"; - - return Container.extend({ - Defaults: { - containerCls: 'form', - layout: 'flex', - direction: 'column', - align: 'stretch', - flex: 1, - padding: 20, - labelGap: 30, - spacing: 10, - callbacks: { - submit: function() { - this.submit(); - } - } - }, - - /** - * This method gets invoked before the control is rendered. - * - * @method preRender - */ - preRender: function() { - var self = this, items = self.items(); - - // Wrap any labeled items in FormItems - items.each(function(ctrl) { - var formItem, label = ctrl.settings.label; - - if (label) { - formItem = new FormItem({ - layout: 'flex', - autoResize: "overflow", - defaults: {flex: 1}, - items: [ - {type: 'label', id: ctrl._id + '-l', text: label, flex: 0, forId: ctrl._id, disabled: ctrl.disabled()} - ] - }); - - formItem.type = 'formitem'; - ctrl.aria('labelledby', ctrl._id + '-l'); - - if (typeof(ctrl.settings.flex) == "undefined") { - ctrl.settings.flex = 1; - } - - self.replace(ctrl, formItem); - formItem.add(ctrl); - } - }); - }, - - /** - * Recalcs label widths. - * - * @private - */ - recalcLabels: function() { - var self = this, maxLabelWidth = 0, labels = [], i, labelGap; - - if (self.settings.labelGapCalc === false) { - return; - } - - self.items().filter('formitem').each(function(item) { - var labelCtrl = item.items()[0], labelWidth = labelCtrl.getEl().clientWidth; - - maxLabelWidth = labelWidth > maxLabelWidth ? labelWidth : maxLabelWidth; - labels.push(labelCtrl); - }); - - labelGap = self.settings.labelGap || 0; - - i = labels.length; - while (i--) { - labels[i].settings.minWidth = maxLabelWidth + labelGap; - } - }, - - /** - * Getter/setter for the visibility state. - * - * @method visible - * @param {Boolean} [state] True/false state to show/hide. - * @return {tinymce.ui.Form|Boolean} True/false state or current control. - */ - visible: function(state) { - var val = this._super(state); - - if (state === true && this._rendered) { - this.recalcLabels(); - } - - return val; - }, - - /** - * Fires a submit event with the serialized form. - * - * @method submit - * @return {Object} Event arguments object. - */ - submit: function() { - return this.fire('submit', {data: this.toJSON()}); - }, - - /** - * Post render method. Called after the control has been rendered to the target. - * - * @method postRender - * @return {tinymce.ui.ComboBox} Current combobox instance. - */ - postRender: function() { - var self = this; - - self._super(); - self.recalcLabels(); - self.fromJSON(self.settings.data); - } - }); -}); - -// Included from: js/tinymce/classes/ui/FieldSet.js - -/** - * FieldSet.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class creates fieldset containers. - * - * @-x-less FieldSet.less - * @class tinymce.ui.FieldSet - * @extends tinymce.ui.Form - */ -define("tinymce/ui/FieldSet", [ - "tinymce/ui/Form" -], function(Form) { - "use strict"; - - return Form.extend({ - Defaults: { - containerCls: 'fieldset', - layout: 'flex', - direction: 'column', - align: 'stretch', - flex: 1, - padding: "25 15 5 15", - labelGap: 30, - spacing: 10, - border: 1 - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, layout = self._layout, prefix = self.classPrefix; - - self.preRender(); - layout.preRender(self); - - return ( - '
    ' + - (self.settings.title ? ('' + - self.settings.title + '') : '') + - '
    ' + - (self.settings.html || '') + layout.renderHtml(self) + - '
    ' + - '
    ' - ); - } - }); -}); - -// Included from: js/tinymce/classes/ui/FilePicker.js - -/** - * FilePicker.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*global tinymce:true */ - -/** - * This class creates a file picker control. - * - * @class tinymce.ui.FilePicker - * @extends tinymce.ui.ComboBox - */ -define("tinymce/ui/FilePicker", [ - "tinymce/ui/ComboBox" -], function(ComboBox) { - "use strict"; - - return ComboBox.extend({ - /** - * Constructs a new control instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - */ - init: function(settings) { - var self = this, editor = tinymce.activeEditor, fileBrowserCallback; - - settings.spellcheck = false; - - fileBrowserCallback = editor.settings.file_browser_callback; - if (fileBrowserCallback) { - settings.icon = 'browse'; - - settings.onaction = function() { - fileBrowserCallback( - self.getEl('inp').id, - self.getEl('inp').value, - settings.filetype, - window - ); - }; - } - - self._super(settings); - } - }); -}); - -// Included from: js/tinymce/classes/ui/FitLayout.js - -/** - * FitLayout.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This layout manager will resize the control to be the size of it's parent container. - * In other words width: 100% and height: 100%. - * - * @-x-less FitLayout.less - * @class tinymce.ui.FitLayout - * @extends tinymce.ui.AbsoluteLayout - */ -define("tinymce/ui/FitLayout", [ - "tinymce/ui/AbsoluteLayout" -], function(AbsoluteLayout) { - "use strict"; - - return AbsoluteLayout.extend({ - /** - * Recalculates the positions of the controls in the specified container. - * - * @method recalc - * @param {tinymce.ui.Container} container Container instance to recalc. - */ - recalc: function(container) { - var contLayoutRect = container.layoutRect(), paddingBox = container.paddingBox(); - - container.items().filter(':visible').each(function(ctrl) { - ctrl.layoutRect({ - x: paddingBox.left, - y: paddingBox.top, - w: contLayoutRect.innerW - paddingBox.right - paddingBox.left, - h: contLayoutRect.innerH - paddingBox.top - paddingBox.bottom - }); - - if (ctrl.recalc) { - ctrl.recalc(); - } - }); - } - }); -}); - -// Included from: js/tinymce/classes/ui/FlexLayout.js - -/** - * FlexLayout.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This layout manager works similar to the CSS flex box. - * - * @setting {String} direction row|row-reverse|column|column-reverse - * @setting {Number} flex A positive-number to flex by. - * @setting {String} align start|end|center|stretch - * @setting {String} pack start|end|justify - * - * @class tinymce.ui.FlexLayout - * @extends tinymce.ui.AbsoluteLayout - */ -define("tinymce/ui/FlexLayout", [ - "tinymce/ui/AbsoluteLayout" -], function(AbsoluteLayout) { - "use strict"; - - return AbsoluteLayout.extend({ - /** - * Recalculates the positions of the controls in the specified container. - * - * @method recalc - * @param {tinymce.ui.Container} container Container instance to recalc. - */ - recalc: function(container) { - // A ton of variables, needs to be in the same scope for performance - var i, l, items, contLayoutRect, contPaddingBox, contSettings, align, pack, spacing, totalFlex, availableSpace, direction; - var ctrl, ctrlLayoutRect, ctrlSettings, flex, maxSizeItems = [], size, maxSize, ratio, rect, pos, maxAlignEndPos; - var sizeName, minSizeName, posName, maxSizeName, beforeName, innerSizeName, deltaSizeName, contentSizeName; - var alignAxisName, alignInnerSizeName, alignSizeName, alignMinSizeName, alignBeforeName, alignAfterName; - var alignDeltaSizeName, alignContentSizeName; - var max = Math.max, min = Math.min; - - // Get container items, properties and settings - items = container.items().filter(':visible'); - contLayoutRect = container.layoutRect(); - contPaddingBox = container._paddingBox; - contSettings = container.settings; - direction = container.isRtl() ? (contSettings.direction || 'row-reversed') : contSettings.direction; - align = contSettings.align; - pack = container.isRtl() ? (contSettings.pack || 'end') : contSettings.pack; - spacing = contSettings.spacing || 0; - - if (direction == "row-reversed" || direction == "column-reverse") { - items = items.set(items.toArray().reverse()); - direction = direction.split('-')[0]; - } - - // Setup axis variable name for row/column direction since the calculations is the same - if (direction == "column") { - posName = "y"; - sizeName = "h"; - minSizeName = "minH"; - maxSizeName = "maxH"; - innerSizeName = "innerH"; - beforeName = 'top'; - deltaSizeName = "deltaH"; - contentSizeName = "contentH"; - - alignBeforeName = "left"; - alignSizeName = "w"; - alignAxisName = "x"; - alignInnerSizeName = "innerW"; - alignMinSizeName = "minW"; - alignAfterName = "right"; - alignDeltaSizeName = "deltaW"; - alignContentSizeName = "contentW"; - } else { - posName = "x"; - sizeName = "w"; - minSizeName = "minW"; - maxSizeName = "maxW"; - innerSizeName = "innerW"; - beforeName = 'left'; - deltaSizeName = "deltaW"; - contentSizeName = "contentW"; - - alignBeforeName = "top"; - alignSizeName = "h"; - alignAxisName = "y"; - alignInnerSizeName = "innerH"; - alignMinSizeName = "minH"; - alignAfterName = "bottom"; - alignDeltaSizeName = "deltaH"; - alignContentSizeName = "contentH"; - } - - // Figure out total flex, availableSpace and collect any max size elements - availableSpace = contLayoutRect[innerSizeName] - contPaddingBox[beforeName] - contPaddingBox[beforeName]; - maxAlignEndPos = totalFlex = 0; - for (i = 0, l = items.length; i < l; i++) { - ctrl = items[i]; - ctrlLayoutRect = ctrl.layoutRect(); - ctrlSettings = ctrl.settings; - flex = ctrlSettings.flex; - availableSpace -= (i < l - 1 ? spacing : 0); - - if (flex > 0) { - totalFlex += flex; - - // Flexed item has a max size then we need to check if we will hit that size - if (ctrlLayoutRect[maxSizeName]) { - maxSizeItems.push(ctrl); - } - - ctrlLayoutRect.flex = flex; - } - - availableSpace -= ctrlLayoutRect[minSizeName]; - - // Calculate the align end position to be used to check for overflow/underflow - size = contPaddingBox[alignBeforeName] + ctrlLayoutRect[alignMinSizeName] + contPaddingBox[alignAfterName]; - if (size > maxAlignEndPos) { - maxAlignEndPos = size; - } - } - - // Calculate minW/minH - rect = {}; - if (availableSpace < 0) { - rect[minSizeName] = contLayoutRect[minSizeName] - availableSpace + contLayoutRect[deltaSizeName]; - } else { - rect[minSizeName] = contLayoutRect[innerSizeName] - availableSpace + contLayoutRect[deltaSizeName]; - } - - rect[alignMinSizeName] = maxAlignEndPos + contLayoutRect[alignDeltaSizeName]; - - rect[contentSizeName] = contLayoutRect[innerSizeName] - availableSpace; - rect[alignContentSizeName] = maxAlignEndPos; - rect.minW = min(rect.minW, contLayoutRect.maxW); - rect.minH = min(rect.minH, contLayoutRect.maxH); - rect.minW = max(rect.minW, contLayoutRect.startMinWidth); - rect.minH = max(rect.minH, contLayoutRect.startMinHeight); - - // Resize container container if minSize was changed - if (contLayoutRect.autoResize && (rect.minW != contLayoutRect.minW || rect.minH != contLayoutRect.minH)) { - rect.w = rect.minW; - rect.h = rect.minH; - - container.layoutRect(rect); - this.recalc(container); - - // Forced recalc for example if items are hidden/shown - if (container._lastRect === null) { - var parentCtrl = container.parent(); - if (parentCtrl) { - parentCtrl._lastRect = null; - parentCtrl.recalc(); - } - } - - return; - } - - // Handle max size elements, check if they will become to wide with current options - ratio = availableSpace / totalFlex; - for (i = 0, l = maxSizeItems.length; i < l; i++) { - ctrl = maxSizeItems[i]; - ctrlLayoutRect = ctrl.layoutRect(); - maxSize = ctrlLayoutRect[maxSizeName]; - size = ctrlLayoutRect[minSizeName] + ctrlLayoutRect.flex * ratio; - - if (size > maxSize) { - availableSpace -= (ctrlLayoutRect[maxSizeName] - ctrlLayoutRect[minSizeName]); - totalFlex -= ctrlLayoutRect.flex; - ctrlLayoutRect.flex = 0; - ctrlLayoutRect.maxFlexSize = maxSize; - } else { - ctrlLayoutRect.maxFlexSize = 0; - } - } - - // Setup new ratio, target layout rect, start position - ratio = availableSpace / totalFlex; - pos = contPaddingBox[beforeName]; - rect = {}; - - // Handle pack setting moves the start position to end, center - if (totalFlex === 0) { - if (pack == "end") { - pos = availableSpace + contPaddingBox[beforeName]; - } else if (pack == "center") { - pos = Math.round( - (contLayoutRect[innerSizeName] / 2) - ((contLayoutRect[innerSizeName] - availableSpace) / 2) - ) + contPaddingBox[beforeName]; - - if (pos < 0) { - pos = contPaddingBox[beforeName]; - } - } else if (pack == "justify") { - pos = contPaddingBox[beforeName]; - spacing = Math.floor(availableSpace / (items.length - 1)); - } - } - - // Default aligning (start) the other ones needs to be calculated while doing the layout - rect[alignAxisName] = contPaddingBox[alignBeforeName]; - - // Start laying out controls - for (i = 0, l = items.length; i < l; i++) { - ctrl = items[i]; - ctrlLayoutRect = ctrl.layoutRect(); - size = ctrlLayoutRect.maxFlexSize || ctrlLayoutRect[minSizeName]; - - // Align the control on the other axis - if (align === "center") { - rect[alignAxisName] = Math.round((contLayoutRect[alignInnerSizeName] / 2) - (ctrlLayoutRect[alignSizeName] / 2)); - } else if (align === "stretch") { - rect[alignSizeName] = max( - ctrlLayoutRect[alignMinSizeName] || 0, - contLayoutRect[alignInnerSizeName] - contPaddingBox[alignBeforeName] - contPaddingBox[alignAfterName] - ); - rect[alignAxisName] = contPaddingBox[alignBeforeName]; - } else if (align === "end") { - rect[alignAxisName] = contLayoutRect[alignInnerSizeName] - ctrlLayoutRect[alignSizeName] - contPaddingBox.top; - } - - // Calculate new size based on flex - if (ctrlLayoutRect.flex > 0) { - size += ctrlLayoutRect.flex * ratio; - } - - rect[sizeName] = size; - rect[posName] = pos; - ctrl.layoutRect(rect); - - // Recalculate containers - if (ctrl.recalc) { - ctrl.recalc(); - } - - // Move x/y position - pos += size + spacing; - } - } - }); -}); - -// Included from: js/tinymce/classes/ui/FlowLayout.js - -/** - * FlowLayout.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This layout manager will place the controls by using the browsers native layout. - * - * @-x-less FlowLayout.less - * @class tinymce.ui.FlowLayout - * @extends tinymce.ui.Layout - */ -define("tinymce/ui/FlowLayout", [ - "tinymce/ui/Layout" -], function(Layout) { - return Layout.extend({ - Defaults: { - containerClass: 'flow-layout', - controlClass: 'flow-layout-item', - endClass : 'break' - }, - - /** - * Recalculates the positions of the controls in the specified container. - * - * @method recalc - * @param {tinymce.ui.Container} container Container instance to recalc. - */ - recalc: function(container) { - container.items().filter(':visible').each(function(ctrl) { - if (ctrl.recalc) { - ctrl.recalc(); - } - }); - } - }); -}); - -// Included from: js/tinymce/classes/ui/FormatControls.js - -/** - * FormatControls.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Internal class containing all TinyMCE specific control types such as - * format listboxes, fontlist boxes, toolbar buttons etc. - * - * @class tinymce.ui.FormatControls - */ -define("tinymce/ui/FormatControls", [ - "tinymce/ui/Control", - "tinymce/ui/Widget", - "tinymce/ui/FloatPanel", - "tinymce/util/Tools", - "tinymce/EditorManager", - "tinymce/Env" -], function(Control, Widget, FloatPanel, Tools, EditorManager, Env) { - var each = Tools.each; - - EditorManager.on('AddEditor', function(e) { - if (e.editor.rtl) { - Control.rtl = true; - } - - registerControls(e.editor); - }); - - Control.translate = function(text) { - return EditorManager.translate(text); - }; - - Widget.tooltips = !Env.iOS; - - function registerControls(editor) { - var formatMenu; - - // Generates a preview for a format - function getPreviewCss(format) { - var name, previewElm, dom = editor.dom; - var previewCss = '', parentFontSize, previewStyles; - - previewStyles = editor.settings.preview_styles; - - // No preview forced - if (previewStyles === false) { - return ''; - } - - // Default preview - if (!previewStyles) { - previewStyles = 'font-family font-size font-weight font-style text-decoration ' + - 'text-transform color background-color border border-radius outline text-shadow'; - } - - // Removes any variables since these can't be previewed - function removeVars(val) { - return val.replace(/%(\w+)/g, ''); - } - - // Create block/inline element to use for preview - format = editor.formatter.get(format); - if (!format) { - return; - } - - format = format[0]; - name = format.block || format.inline || 'span'; - previewElm = dom.create(name); - - // Add format styles to preview element - each(format.styles, function(value, name) { - value = removeVars(value); - - if (value) { - dom.setStyle(previewElm, name, value); - } - }); - - // Add attributes to preview element - each(format.attributes, function(value, name) { - value = removeVars(value); - - if (value) { - dom.setAttrib(previewElm, name, value); - } - }); - - // Add classes to preview element - each(format.classes, function(value) { - value = removeVars(value); - - if (!dom.hasClass(previewElm, value)) { - dom.addClass(previewElm, value); - } - }); - - editor.fire('PreviewFormats'); - - // Add the previewElm outside the visual area - dom.setStyles(previewElm, {position: 'absolute', left: -0xFFFF}); - editor.getBody().appendChild(previewElm); - - // Get parent container font size so we can compute px values out of em/% for older IE:s - parentFontSize = dom.getStyle(editor.getBody(), 'fontSize', true); - parentFontSize = /px$/.test(parentFontSize) ? parseInt(parentFontSize, 10) : 0; - - each(previewStyles.split(' '), function(name) { - var value = dom.getStyle(previewElm, name, true); - - // If background is transparent then check if the body has a background color we can use - if (name == 'background-color' && /transparent|rgba\s*\([^)]+,\s*0\)/.test(value)) { - value = dom.getStyle(editor.getBody(), name, true); - - // Ignore white since it's the default color, not the nicest fix - // TODO: Fix this by detecting runtime style - if (dom.toHex(value).toLowerCase() == '#ffffff') { - return; - } - } - - if (name == 'color') { - // Ignore black since it's the default color, not the nicest fix - // TODO: Fix this by detecting runtime style - if (dom.toHex(value).toLowerCase() == '#000000') { - return; - } - } - - // Old IE won't calculate the font size so we need to do that manually - if (name == 'font-size') { - if (/em|%$/.test(value)) { - if (parentFontSize === 0) { - return; - } - - // Convert font size from em/% to px - value = parseFloat(value, 10) / (/%$/.test(value) ? 100 : 1); - value = (value * parentFontSize) + 'px'; - } - } - - if (name == "border" && value) { - previewCss += 'padding:0 2px;'; - } - - previewCss += name + ':' + value + ';'; - }); - - editor.fire('AfterPreviewFormats'); - - //previewCss += 'line-height:normal'; - - dom.remove(previewElm); - - return previewCss; - } - - function createListBoxChangeHandler(items, formatName) { - return function() { - var self = this; - - editor.on('nodeChange', function(e) { - var formatter = editor.formatter; - var value = null; - - each(e.parents, function(node) { - each(items, function(item) { - if (formatName) { - if (formatter.matchNode(node, formatName, {value: item.value})) { - value = item.value; - } - } else { - if (formatter.matchNode(node, item.value)) { - value = item.value; - } - } - - if (value) { - return false; - } - }); - - if (value) { - return false; - } - }); - - self.value(value); - }); - }; - } - - function createFormats(formats) { - formats = formats.split(';'); - - var i = formats.length; - while (i--) { - formats[i] = formats[i].split('='); - } - - return formats; - } - - function createFormatMenu() { - var count = 0, newFormats = []; - - var defaultStyleFormats = [ - {title: 'Headers', items: [ - {title: 'Header 1', format: 'h1'}, - {title: 'Header 2', format: 'h2'}, - {title: 'Header 3', format: 'h3'}, - {title: 'Header 4', format: 'h4'}, - {title: 'Header 5', format: 'h5'}, - {title: 'Header 6', format: 'h6'} - ]}, - - {title: 'Inline', items: [ - {title: 'Bold', icon: 'bold', format: 'bold'}, - {title: 'Italic', icon: 'italic', format: 'italic'}, - {title: 'Underline', icon: 'underline', format: 'underline'}, - {title: 'Strikethrough', icon: 'strikethrough', format: 'strikethrough'}, - {title: 'Superscript', icon: 'superscript', format: 'superscript'}, - {title: 'Subscript', icon: 'subscript', format: 'subscript'}, - {title: 'Code', icon: 'code', format: 'code'} - ]}, - - {title: 'Blocks', items: [ - {title: 'Paragraph', format: 'p'}, - {title: 'Blockquote', format: 'blockquote'}, - {title: 'Div', format: 'div'}, - {title: 'Pre', format: 'pre'} - ]}, - - {title: 'Alignment', items: [ - {title: 'Left', icon: 'alignleft', format: 'alignleft'}, - {title: 'Center', icon: 'aligncenter', format: 'aligncenter'}, - {title: 'Right', icon: 'alignright', format: 'alignright'}, - {title: 'Justify', icon: 'alignjustify', format: 'alignjustify'} - ]} - ]; - - function createMenu(formats) { - var menu = []; - - if (!formats) { - return; - } - - each(formats, function(format) { - var menuItem = { - text: format.title, - icon: format.icon - }; - - if (format.items) { - menuItem.menu = createMenu(format.items); - } else { - var formatName = format.format || "custom" + count++; - - if (!format.format) { - format.name = formatName; - newFormats.push(format); - } - - menuItem.format = formatName; - } - - menu.push(menuItem); - }); - - return menu; - } - - function createStylesMenu() { - var menu; - - if (editor.settings.style_formats_merge) { - if (editor.settings.style_formats) { - menu = createMenu(defaultStyleFormats.concat(editor.settings.style_formats)); - } else { - menu = createMenu(defaultStyleFormats); - } - } else { - menu = createMenu(editor.settings.style_formats || defaultStyleFormats); - } - - return menu; - } - - editor.on('init', function() { - each(newFormats, function(format) { - editor.formatter.register(format.name, format); - }); - }); - - return { - type: 'menu', - items: createStylesMenu(), - onPostRender: function(e) { - editor.fire('renderFormatsMenu', {control: e.control}); - }, - itemDefaults: { - preview: true, - - textStyle: function() { - if (this.settings.format) { - return getPreviewCss(this.settings.format); - } - }, - - onPostRender: function() { - var self = this, formatName = this.settings.format; - - if (formatName) { - self.parent().on('show', function() { - self.disabled(!editor.formatter.canApply(formatName)); - self.active(editor.formatter.match(formatName)); - }); - } - }, - - onclick: function() { - if (this.settings.format) { - toggleFormat(this.settings.format); - } - } - } - }; - } - - formatMenu = createFormatMenu(); - - // Simple format controls : - each({ - bold: 'Bold', - italic: 'Italic', - underline: 'Underline', - strikethrough: 'Strikethrough', - subscript: 'Subscript', - superscript: 'Superscript' - }, function(text, name) { - editor.addButton(name, { - tooltip: text, - onPostRender: function() { - var self = this; - - // TODO: Fix this - if (editor.formatter) { - editor.formatter.formatChanged(name, function(state) { - self.active(state); - }); - } else { - editor.on('init', function() { - editor.formatter.formatChanged(name, function(state) { - self.active(state); - }); - }); - } - }, - onclick: function() { - toggleFormat(name); - } - }); - }); - - // Simple command controls :[,] - each({ - outdent: ['Decrease indent', 'Outdent'], - indent: ['Increase indent', 'Indent'], - cut: ['Cut', 'Cut'], - copy: ['Copy', 'Copy'], - paste: ['Paste', 'Paste'], - help: ['Help', 'mceHelp'], - selectall: ['Select all', 'SelectAll'], - hr: ['Insert horizontal rule', 'InsertHorizontalRule'], - removeformat: ['Clear formatting', 'RemoveFormat'], - visualaid: ['Visual aids', 'mceToggleVisualAid'], - newdocument: ['New document', 'mceNewDocument'] - }, function(item, name) { - editor.addButton(name, { - tooltip: item[0], - cmd: item[1] - }); - }); - - // Simple command controls with format state - each({ - blockquote: ['Blockquote', 'mceBlockQuote'], - numlist: ['Numbered list', 'InsertOrderedList'], - bullist: ['Bullet list', 'InsertUnorderedList'], - subscript: ['Subscript', 'Subscript'], - superscript: ['Superscript', 'Superscript'], - alignleft: ['Align left', 'JustifyLeft'], - aligncenter: ['Align center', 'JustifyCenter'], - alignright: ['Align right', 'JustifyRight'], - alignjustify: ['Justify', 'JustifyFull'] - }, function(item, name) { - editor.addButton(name, { - tooltip: item[0], - cmd: item[1], - onPostRender: function() { - var self = this; - - // TODO: Fix this - if (editor.formatter) { - editor.formatter.formatChanged(name, function(state) { - self.active(state); - }); - } else { - editor.on('init', function() { - editor.formatter.formatChanged(name, function(state) { - self.active(state); - }); - }); - } - } - }); - }); - - function hasUndo() { - return editor.undoManager ? editor.undoManager.hasUndo() : false; - } - - function hasRedo() { - return editor.undoManager ? editor.undoManager.hasRedo() : false; - } - - function toggleUndoState() { - var self = this; - - self.disabled(!hasUndo()); - editor.on('Undo Redo AddUndo TypingUndo', function() { - self.disabled(!hasUndo()); - }); - } - - function toggleRedoState() { - var self = this; - - self.disabled(!hasRedo()); - editor.on('Undo Redo AddUndo TypingUndo', function() { - self.disabled(!hasRedo()); - }); - } - - function toggleVisualAidState() { - var self = this; - - editor.on('VisualAid', function(e) { - self.active(e.hasVisual); - }); - - self.active(editor.hasVisual); - } - - editor.addButton('undo', { - tooltip: 'Undo', - onPostRender: toggleUndoState, - cmd: 'undo' - }); - - editor.addButton('redo', { - tooltip: 'Redo', - onPostRender: toggleRedoState, - cmd: 'redo' - }); - - editor.addMenuItem('newdocument', { - text: 'New document', - shortcut: 'Ctrl+N', - icon: 'newdocument', - cmd: 'mceNewDocument' - }); - - editor.addMenuItem('undo', { - text: 'Undo', - icon: 'undo', - shortcut: 'Ctrl+Z', - onPostRender: toggleUndoState, - cmd: 'undo' - }); - - editor.addMenuItem('redo', { - text: 'Redo', - icon: 'redo', - shortcut: 'Ctrl+Y', - onPostRender: toggleRedoState, - cmd: 'redo' - }); - - editor.addMenuItem('visualaid', { - text: 'Visual aids', - selectable: true, - onPostRender: toggleVisualAidState, - cmd: 'mceToggleVisualAid' - }); - - each({ - cut: ['Cut', 'Cut', 'Ctrl+X'], - copy: ['Copy', 'Copy', 'Ctrl+C'], - paste: ['Paste', 'Paste', 'Ctrl+V'], - selectall: ['Select all', 'SelectAll', 'Ctrl+A'], - bold: ['Bold', 'Bold', 'Ctrl+B'], - italic: ['Italic', 'Italic', 'Ctrl+I'], - underline: ['Underline', 'Underline'], - strikethrough: ['Strikethrough', 'Strikethrough'], - subscript: ['Subscript', 'Subscript'], - superscript: ['Superscript', 'Superscript'], - removeformat: ['Clear formatting', 'RemoveFormat'] - }, function(item, name) { - editor.addMenuItem(name, { - text: item[0], - icon: name, - shortcut: item[2], - cmd: item[1] - }); - }); - - editor.on('mousedown', function() { - FloatPanel.hideAll(); - }); - - function toggleFormat(fmt) { - if (fmt.control) { - fmt = fmt.control.value(); - } - - if (fmt) { - editor.execCommand('mceToggleFormat', false, fmt); - } - } - - editor.addButton('styleselect', { - type: 'menubutton', - text: 'Formats', - menu: formatMenu - }); - - editor.addButton('formatselect', function() { - var items = [], blocks = createFormats(editor.settings.block_formats || - 'Paragraph=p;' + - 'Address=address;' + - 'Pre=pre;' + - 'Header 1=h1;' + - 'Header 2=h2;' + - 'Header 3=h3;' + - 'Header 4=h4;' + - 'Header 5=h5;' + - 'Header 6=h6' - ); - - each(blocks, function(block) { - items.push({ - text: block[0], - value: block[1], - textStyle: function() { - return getPreviewCss(block[1]); - } - }); - }); - - return { - type: 'listbox', - text: blocks[0][0], - values: items, - fixedWidth: true, - onselect: toggleFormat, - onPostRender: createListBoxChangeHandler(items) - }; - }); - - editor.addButton('fontselect', function() { - var defaultFontsFormats = - 'Andale Mono=andale mono,times;' + - 'Arial=arial,helvetica,sans-serif;' + - 'Arial Black=arial black,avant garde;' + - 'Book Antiqua=book antiqua,palatino;' + - 'Comic Sans MS=comic sans ms,sans-serif;' + - 'Courier New=courier new,courier;' + - 'Georgia=georgia,palatino;' + - 'Helvetica=helvetica;' + - 'Impact=impact,chicago;' + - 'Symbol=symbol;' + - 'Tahoma=tahoma,arial,helvetica,sans-serif;' + - 'Terminal=terminal,monaco;' + - 'Times New Roman=times new roman,times;' + - 'Trebuchet MS=trebuchet ms,geneva;' + - 'Verdana=verdana,geneva;' + - 'Webdings=webdings;' + - 'Wingdings=wingdings,zapf dingbats'; - - var items = [], fonts = createFormats(editor.settings.font_formats || defaultFontsFormats); - - each(fonts, function(font) { - items.push({ - text: {raw: font[0]}, - value: font[1], - textStyle: font[1].indexOf('dings') == -1 ? 'font-family:' + font[1] : '' - }); - }); - - return { - type: 'listbox', - text: 'Font Family', - tooltip: 'Font Family', - values: items, - fixedWidth: true, - onPostRender: createListBoxChangeHandler(items, 'fontname'), - onselect: function(e) { - if (e.control.settings.value) { - editor.execCommand('FontName', false, e.control.settings.value); - } - } - }; - }); - - editor.addButton('fontsizeselect', function() { - var items = [], defaultFontsizeFormats = '8pt 10pt 12pt 14pt 18pt 24pt 36pt'; - var fontsize_formats = editor.settings.fontsize_formats || defaultFontsizeFormats; - - each(fontsize_formats.split(' '), function(item) { - items.push({text: item, value: item}); - }); - - return { - type: 'listbox', - text: 'Font Sizes', - tooltip: 'Font Sizes', - values: items, - fixedWidth: true, - onPostRender: createListBoxChangeHandler(items, 'fontsize'), - onclick: function(e) { - if (e.control.settings.value) { - editor.execCommand('FontSize', false, e.control.settings.value); - } - } - }; - }); - - editor.addMenuItem('formats', { - text: 'Formats', - menu: formatMenu - }); - } -}); - -// Included from: js/tinymce/classes/ui/GridLayout.js - -/** - * GridLayout.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This layout manager places controls in a grid. - * - * @setting {Number} spacing Spacing between controls. - * @setting {Number} spacingH Horizontal spacing between controls. - * @setting {Number} spacingV Vertical spacing between controls. - * @setting {Number} columns Number of columns to use. - * @setting {String/Array} alignH start|end|center|stretch or array of values for each column. - * @setting {String/Array} alignV start|end|center|stretch or array of values for each column. - * @setting {String} pack start|end - * - * @class tinymce.ui.GridLayout - * @extends tinymce.ui.AbsoluteLayout - */ -define("tinymce/ui/GridLayout", [ - "tinymce/ui/AbsoluteLayout" -], function(AbsoluteLayout) { - "use strict"; - - return AbsoluteLayout.extend({ - /** - * Recalculates the positions of the controls in the specified container. - * - * @method recalc - * @param {tinymce.ui.Container} container Container instance to recalc. - */ - recalc: function(container) { - var settings = container.settings, rows, cols, items, contLayoutRect, width, height, rect, - ctrlLayoutRect, ctrl, x, y, posX, posY, ctrlSettings, contPaddingBox, align, spacingH, spacingV, alignH, alignV, maxX, maxY, - colWidths = [], rowHeights = [], ctrlMinWidth, ctrlMinHeight, availableWidth, availableHeight; - - // Get layout settings - settings = container.settings; - items = container.items().filter(':visible'); - contLayoutRect = container.layoutRect(); - cols = settings.columns || Math.ceil(Math.sqrt(items.length)); - rows = Math.ceil(items.length / cols); - spacingH = settings.spacingH || settings.spacing || 0; - spacingV = settings.spacingV || settings.spacing || 0; - alignH = settings.alignH || settings.align; - alignV = settings.alignV || settings.align; - contPaddingBox = container._paddingBox; - - if (alignH && typeof(alignH) == "string") { - alignH = [alignH]; - } - - if (alignV && typeof(alignV) == "string") { - alignV = [alignV]; - } - - // Zero padd columnWidths - for (x = 0; x < cols; x++) { - colWidths.push(0); - } - - // Zero padd rowHeights - for (y = 0; y < rows; y++) { - rowHeights.push(0); - } - - // Calculate columnWidths and rowHeights - for (y = 0; y < rows; y++) { - for (x = 0; x < cols; x++) { - ctrl = items[y * cols + x]; - - // Out of bounds - if (!ctrl) { - break; - } - - ctrlLayoutRect = ctrl.layoutRect(); - ctrlMinWidth = ctrlLayoutRect.minW; - ctrlMinHeight = ctrlLayoutRect.minH; - - colWidths[x] = ctrlMinWidth > colWidths[x] ? ctrlMinWidth : colWidths[x]; - rowHeights[y] = ctrlMinHeight > rowHeights[y] ? ctrlMinHeight : rowHeights[y]; - } - } - - // Calculate maxX - availableWidth = contLayoutRect.innerW - contPaddingBox.left - contPaddingBox.right; - for (maxX = 0, x = 0; x < cols; x++) { - maxX += colWidths[x] + (x > 0 ? spacingH : 0); - availableWidth -= (x > 0 ? spacingH : 0) + colWidths[x]; - } - - // Calculate maxY - availableHeight = contLayoutRect.innerH - contPaddingBox.top - contPaddingBox.bottom; - for (maxY = 0, y = 0; y < rows; y++) { - maxY += rowHeights[y] + (y > 0 ? spacingV : 0); - availableHeight -= (y > 0 ? spacingV : 0) + rowHeights[y]; - } - - maxX += contPaddingBox.left + contPaddingBox.right; - maxY += contPaddingBox.top + contPaddingBox.bottom; - - // Calculate minW/minH - rect = {}; - rect.minW = maxX + (contLayoutRect.w - contLayoutRect.innerW); - rect.minH = maxY + (contLayoutRect.h - contLayoutRect.innerH); - - rect.contentW = rect.minW - contLayoutRect.deltaW; - rect.contentH = rect.minH - contLayoutRect.deltaH; - rect.minW = Math.min(rect.minW, contLayoutRect.maxW); - rect.minH = Math.min(rect.minH, contLayoutRect.maxH); - rect.minW = Math.max(rect.minW, contLayoutRect.startMinWidth); - rect.minH = Math.max(rect.minH, contLayoutRect.startMinHeight); - - // Resize container container if minSize was changed - if (contLayoutRect.autoResize && (rect.minW != contLayoutRect.minW || rect.minH != contLayoutRect.minH)) { - rect.w = rect.minW; - rect.h = rect.minH; - - container.layoutRect(rect); - this.recalc(container); - - // Forced recalc for example if items are hidden/shown - if (container._lastRect === null) { - var parentCtrl = container.parent(); - if (parentCtrl) { - parentCtrl._lastRect = null; - parentCtrl.recalc(); - } - } - - return; - } - - // Update contentW/contentH so absEnd moves correctly - if (contLayoutRect.autoResize) { - rect = container.layoutRect(rect); - rect.contentW = rect.minW - contLayoutRect.deltaW; - rect.contentH = rect.minH - contLayoutRect.deltaH; - } - - var flexV; - - if (settings.packV == 'start') { - flexV = 0; - } else { - flexV = availableHeight > 0 ? Math.floor(availableHeight / rows) : 0; - } - - // Calculate totalFlex - var totalFlex = 0; - var flexWidths = settings.flexWidths; - if (flexWidths) { - for (x = 0; x < flexWidths.length; x++) { - totalFlex += flexWidths[x]; - } - } else { - totalFlex = cols; - } - - // Calculate new column widths based on flex values - var ratio = availableWidth / totalFlex; - for (x = 0; x < cols; x++) { - colWidths[x] += flexWidths ? flexWidths[x] * ratio : ratio; - } - - // Move/resize controls - posY = contPaddingBox.top; - for (y = 0; y < rows; y++) { - posX = contPaddingBox.left; - height = rowHeights[y] + flexV; - - for (x = 0; x < cols; x++) { - ctrl = items[y * cols + x]; - - // No more controls to render then break - if (!ctrl) { - break; - } - - // Get control settings and calculate x, y - ctrlSettings = ctrl.settings; - ctrlLayoutRect = ctrl.layoutRect(); - width = Math.max(colWidths[x], ctrlLayoutRect.startMinWidth); - ctrlLayoutRect.x = posX; - ctrlLayoutRect.y = posY; - - // Align control horizontal - align = ctrlSettings.alignH || (alignH ? (alignH[x] || alignH[0]) : null); - if (align == "center") { - ctrlLayoutRect.x = posX + (width / 2) - (ctrlLayoutRect.w / 2); - } else if (align == "right") { - ctrlLayoutRect.x = posX + width - ctrlLayoutRect.w; - } else if (align == "stretch") { - ctrlLayoutRect.w = width; - } - - // Align control vertical - align = ctrlSettings.alignV || (alignV ? (alignV[x] || alignV[0]) : null); - if (align == "center") { - ctrlLayoutRect.y = posY + (height / 2) - (ctrlLayoutRect.h / 2); - } else if (align == "bottom") { - ctrlLayoutRect.y = posY + height - ctrlLayoutRect.h; - } else if (align == "stretch") { - ctrlLayoutRect.h = height; - } - - ctrl.layoutRect(ctrlLayoutRect); - - posX += width + spacingH; - - if (ctrl.recalc) { - ctrl.recalc(); - } - } - - posY += height + spacingV; - } - } - }); -}); - -// Included from: js/tinymce/classes/ui/Iframe.js - -/** - * Iframe.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*jshint scripturl:true */ - -/** - * This class creates an iframe. - * - * @setting {String} url Url to open in the iframe. - * - * @-x-less Iframe.less - * @class tinymce.ui.Iframe - * @extends tinymce.ui.Widget - */ -define("tinymce/ui/Iframe", [ - "tinymce/ui/Widget" -], function(Widget) { - "use strict"; - - return Widget.extend({ - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this; - - self.addClass('iframe'); - self.canFocus = false; - - return ( - '' - ); - }, - - /** - * Setter for the iframe source. - * - * @method src - * @param {String} src Source URL for iframe. - */ - src: function(src) { - this.getEl().src = src; - }, - - /** - * Inner HTML for the iframe. - * - * @method html - * @param {String} html HTML string to set as HTML inside the iframe. - * @param {function} callback Optional callback to execute when the iframe body is filled with contents. - * @return {tinymce.ui.Iframe} Current iframe control. - */ - html: function(html, callback) { - var self = this, body = this.getEl().contentWindow.document.body; - - // Wait for iframe to initialize IE 10 takes time - if (!body) { - setTimeout(function() { - self.html(html); - }, 0); - } else { - body.innerHTML = html; - - if (callback) { - callback(); - } - } - - return this; - } - }); -}); - -// Included from: js/tinymce/classes/ui/Label.js - -/** - * Label.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This class creates a label element. A label is a simple text control - * that can be bound to other controls. - * - * @-x-less Label.less - * @class tinymce.ui.Label - * @extends tinymce.ui.Widget - */ -define("tinymce/ui/Label", [ - "tinymce/ui/Widget", - "tinymce/ui/DomUtils" -], function(Widget, DomUtils) { - "use strict"; - - return Widget.extend({ - /** - * Constructs a instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - * @param {Boolean} multiline Multiline label. - */ - init: function(settings) { - var self = this; - - self._super(settings); - self.addClass('widget'); - self.addClass('label'); - self.canFocus = false; - - if (settings.multiline) { - self.addClass('autoscroll'); - } - - if (settings.strong) { - self.addClass('strong'); - } - }, - - /** - * Initializes the current controls layout rect. - * This will be executed by the layout managers to determine the - * default minWidth/minHeight etc. - * - * @method initLayoutRect - * @return {Object} Layout rect instance. - */ - initLayoutRect: function() { - var self = this, layoutRect = self._super(); - - if (self.settings.multiline) { - var size = DomUtils.getSize(self.getEl()); - - // Check if the text fits within maxW if not then try word wrapping it - if (size.width > layoutRect.maxW) { - layoutRect.minW = layoutRect.maxW; - self.addClass('multiline'); - } - - self.getEl().style.width = layoutRect.minW + 'px'; - layoutRect.startMinH = layoutRect.h = layoutRect.minH = Math.min(layoutRect.maxH, DomUtils.getSize(self.getEl()).height); - } - - return layoutRect; - }, - - /** - * Repaints the control after a layout operation. - * - * @method repaint - */ - repaint: function() { - var self = this; - - if (!self.settings.multiline) { - self.getEl().style.lineHeight = self.layoutRect().h + 'px'; - } - - return self._super(); - }, - - /** - * Sets/gets the current label text. - * - * @method text - * @param {String} [text] New label text. - * @return {String|tinymce.ui.Label} Current text or current label instance. - */ - text: function(text) { - var self = this; - - if (self._rendered && text) { - this.innerHtml(self.encode(text)); - } - - return self._super(text); - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, forId = self.settings.forId; - - return ( - '' - ); - } - }); -}); - -// Included from: js/tinymce/classes/ui/Toolbar.js - -/** - * Toolbar.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a new toolbar. - * - * @class tinymce.ui.Toolbar - * @extends tinymce.ui.Container - */ -define("tinymce/ui/Toolbar", [ - "tinymce/ui/Container" -], function(Container) { - "use strict"; - - return Container.extend({ - Defaults: { - role: 'toolbar', - layout: 'flow' - }, - - /** - * Constructs a instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - */ - init: function(settings) { - var self = this; - - self._super(settings); - self.addClass('toolbar'); - }, - - /** - * Called after the control has been rendered. - * - * @method postRender - */ - postRender: function() { - var self = this; - - self.items().addClass('toolbar-item'); - - return self._super(); - } - }); -}); - -// Included from: js/tinymce/classes/ui/MenuBar.js - -/** - * MenuBar.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a new menubar. - * - * @-x-less MenuBar.less - * @class tinymce.ui.MenuBar - * @extends tinymce.ui.Container - */ -define("tinymce/ui/MenuBar", [ - "tinymce/ui/Toolbar" -], function(Toolbar) { - "use strict"; - - return Toolbar.extend({ - Defaults: { - role: 'menubar', - containerCls: 'menubar', - ariaRoot: true, - defaults: { - type: 'menubutton' - } - } - }); -}); - -// Included from: js/tinymce/classes/ui/MenuButton.js - -/** - * MenuButton.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a new menu button. - * - * @-x-less MenuButton.less - * @class tinymce.ui.MenuButton - * @extends tinymce.ui.Button - */ -define("tinymce/ui/MenuButton", [ - "tinymce/ui/Button", - "tinymce/ui/Factory", - "tinymce/ui/MenuBar" -], function(Button, Factory, MenuBar) { - "use strict"; - - // TODO: Maybe add as some global function - function isChildOf(node, parent) { - while (node) { - if (parent === node) { - return true; - } - - node = node.parentNode; - } - - return false; - } - - var MenuButton = Button.extend({ - /** - * Constructs a instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - */ - init: function(settings) { - var self = this; - - self._renderOpen = true; - self._super(settings); - - self.addClass('menubtn'); - - if (settings.fixedWidth) { - self.addClass('fixed-width'); - } - - self.aria('haspopup', true); - self.hasPopup = true; - }, - - /** - * Shows the menu for the button. - * - * @method showMenu - */ - showMenu: function() { - var self = this, settings = self.settings, menu; - - if (self.menu && self.menu.visible()) { - return self.hideMenu(); - } - - if (!self.menu) { - menu = settings.menu || []; - - // Is menu array then auto constuct menu control - if (menu.length) { - menu = { - type: 'menu', - items: menu - }; - } else { - menu.type = menu.type || 'menu'; - } - - self.menu = Factory.create(menu).parent(self).renderTo(); - self.fire('createmenu'); - self.menu.reflow(); - self.menu.on('cancel', function(e) { - if (e.control.parent() === self.menu) { - e.stopPropagation(); - self.focus(); - self.hideMenu(); - } - }); - - // Move focus to button when a menu item is selected/clicked - self.menu.on('select', function() { - self.focus(); - }); - - self.menu.on('show hide', function(e) { - if (e.control == self.menu) { - self.activeMenu(e.type == 'show'); - } - - self.aria('expanded', e.type == 'show'); - }).fire('show'); - } - - self.menu.show(); - self.menu.layoutRect({w: self.layoutRect().w}); - self.menu.moveRel(self.getEl(), self.isRtl() ? ['br-tr', 'tr-br'] : ['bl-tl', 'tl-bl']); - }, - - /** - * Hides the menu for the button. - * - * @method hideMenu - */ - hideMenu: function() { - var self = this; - - if (self.menu) { - self.menu.items().each(function(item) { - if (item.hideMenu) { - item.hideMenu(); - } - }); - - self.menu.hide(); - } - }, - - /** - * Sets the active menu state. - * - * @private - */ - activeMenu: function(state) { - this.toggleClass('active', state); - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, id = self._id, prefix = self.classPrefix; - var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : ''; - - self.aria('role', self.parent() instanceof MenuBar ? 'menuitem' : 'button'); - - return ( - '
    ' + - '' + - '
    ' - ); - }, - - /** - * Gets invoked after the control has been rendered. - * - * @method postRender - */ - postRender: function() { - var self = this; - - self.on('click', function(e) { - if (e.control === self && isChildOf(e.target, self.getEl())) { - self.showMenu(); - - if (e.aria) { - self.menu.items()[0].focus(); - } - } - }); - - self.on('mouseenter', function(e) { - var overCtrl = e.control, parent = self.parent(), hasVisibleSiblingMenu; - - if (overCtrl && parent && overCtrl instanceof MenuButton && overCtrl.parent() == parent) { - parent.items().filter('MenuButton').each(function(ctrl) { - if (ctrl.hideMenu && ctrl != overCtrl) { - if (ctrl.menu && ctrl.menu.visible()) { - hasVisibleSiblingMenu = true; - } - - ctrl.hideMenu(); - } - }); - - if (hasVisibleSiblingMenu) { - overCtrl.focus(); // Fix for: #5887 - overCtrl.showMenu(); - } - } - }); - - return self._super(); - }, - - /** - * Sets/gets the current button text. - * - * @method text - * @param {String} [text] New button text. - * @return {String|tinymce.ui.MenuButton} Current text or current MenuButton instance. - */ - text: function(text) { - var self = this, i, children; - - if (self._rendered) { - children = self.getEl('open').getElementsByTagName('span'); - for (i = 0; i < children.length; i++) { - children[i].innerHTML = (self.settings.icon && text ? '\u00a0' : '') + self.encode(text); - } - } - - return this._super(text); - }, - - /** - * Removes the control and it's menus. - * - * @method remove - */ - remove: function() { - this._super(); - - if (this.menu) { - this.menu.remove(); - } - } - }); - - return MenuButton; -}); - -// Included from: js/tinymce/classes/ui/ListBox.js - -/** - * ListBox.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a new list box control. - * - * @-x-less ListBox.less - * @class tinymce.ui.ListBox - * @extends tinymce.ui.MenuButton - */ -define("tinymce/ui/ListBox", [ - "tinymce/ui/MenuButton" -], function(MenuButton) { - "use strict"; - - return MenuButton.extend({ - /** - * Constructs a instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - * @setting {Array} values Array with values to add to list box. - */ - init: function(settings) { - var self = this, values, i, selected, selectedText, lastItemCtrl; - - self._values = values = settings.values; - if (values) { - for (i = 0; i < values.length; i++) { - selected = values[i].selected || settings.value === values[i].value; - - if (selected) { - selectedText = selectedText || values[i].text; - self._value = values[i].value; - break; - } - } - - // Default with first item - if (!selected && values.length > 0) { - selectedText = values[0].text; - self._value = values[0].value; - } - - settings.menu = values; - } - - settings.text = settings.text || selectedText || values[0].text; - - self._super(settings); - self.addClass('listbox'); - - self.on('select', function(e) { - var ctrl = e.control; - - if (lastItemCtrl) { - e.lastControl = lastItemCtrl; - } - - if (settings.multiple) { - ctrl.active(!ctrl.active()); - } else { - self.value(e.control.settings.value); - } - - lastItemCtrl = ctrl; - }); - }, - - /** - * Getter/setter function for the control value. - * - * @method value - * @param {String} [value] Value to be set. - * @return {Boolean/tinymce.ui.ListBox} Value or self if it's a set operation. - */ - value: function(value) { - var self = this, active, selectedText, menu, i; - - function activateByValue(menu, value) { - menu.items().each(function(ctrl) { - active = ctrl.value() === value; - - if (active) { - selectedText = selectedText || ctrl.text(); - } - - ctrl.active(active); - - if (ctrl.menu) { - activateByValue(ctrl.menu, value); - } - }); - } - - if (typeof(value) != "undefined") { - if (self.menu) { - activateByValue(self.menu, value); - } else { - menu = self.settings.menu; - for (i = 0; i < menu.length; i++) { - active = menu[i].value == value; - - if (active) { - selectedText = selectedText || menu[i].text; - } - - menu[i].active = active; - } - } - - self.text(selectedText || this.settings.text); - } - - return self._super(value); - } - }); -}); - -// Included from: js/tinymce/classes/ui/MenuItem.js - -/** - * MenuItem.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a new menu item. - * - * @-x-less MenuItem.less - * @class tinymce.ui.MenuItem - * @extends tinymce.ui.Control - */ -define("tinymce/ui/MenuItem", [ - "tinymce/ui/Widget", - "tinymce/ui/Factory", - "tinymce/Env" -], function(Widget, Factory, Env) { - "use strict"; - - return Widget.extend({ - Defaults: { - border: 0, - role: 'menuitem' - }, - - /** - * Constructs a instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - * @setting {Boolean} selectable Selectable menu. - * @setting {Array} menu Submenu array with items. - * @setting {String} shortcut Shortcut to display for menu item. Example: Ctrl+X - */ - init: function(settings) { - var self = this; - - self.hasPopup = true; - - self._super(settings); - - settings = self.settings; - - self.addClass('menu-item'); - - if (settings.menu) { - self.addClass('menu-item-expand'); - } - - if (settings.preview) { - self.addClass('menu-item-preview'); - } - - if (self._text === '-' || self._text === '|') { - self.addClass('menu-item-sep'); - self.aria('role', 'separator'); - self._text = '-'; - } - - if (settings.selectable) { - self.aria('role', 'menuitemcheckbox'); - self.addClass('menu-item-checkbox'); - settings.icon = 'selected'; - } - - if (!settings.preview && !settings.selectable) { - self.addClass('menu-item-normal'); - } - - self.on('mousedown', function(e) { - e.preventDefault(); - }); - - if (settings.menu) { - self.aria('haspopup', true); - } - }, - - /** - * Returns true/false if the menuitem has sub menu. - * - * @method hasMenus - * @return {Boolean} True/false state if it has submenu. - */ - hasMenus: function() { - return !!this.settings.menu; - }, - - /** - * Shows the menu for the menu item. - * - * @method showMenu - */ - showMenu: function() { - var self = this, settings = self.settings, menu, parent = self.parent(); - - parent.items().each(function(ctrl) { - if (ctrl !== self) { - ctrl.hideMenu(); - } - }); - - if (settings.menu) { - menu = self.menu; - - if (!menu) { - menu = settings.menu; - - // Is menu array then auto constuct menu control - if (menu.length) { - menu = { - type: 'menu', - items: menu - }; - } else { - menu.type = menu.type || 'menu'; - } - - if (parent.settings.itemDefaults) { - menu.itemDefaults = parent.settings.itemDefaults; - } - - menu = self.menu = Factory.create(menu).parent(self).renderTo(); - menu.reflow(); - menu.fire('show'); - menu.on('cancel', function(e) { - e.stopPropagation(); - self.focus(); - menu.hide(); - }); - - menu.on('hide', function(e) { - if (e.control === menu) { - self.removeClass('selected'); - } - }); - - menu.submenu = true; - } else { - menu.show(); - } - - menu._parentMenu = parent; - - menu.addClass('menu-sub'); - - var rel = menu.testMoveRel( - self.getEl(), - self.isRtl() ? ['tl-tr', 'bl-br', 'tr-tl', 'br-bl'] : ['tr-tl', 'br-bl', 'tl-tr', 'bl-br'] - ); - - menu.moveRel(self.getEl(), rel); - menu.rel = rel; - - rel = 'menu-sub-' + rel; - menu.removeClass(menu._lastRel); - menu.addClass(rel); - menu._lastRel = rel; - - self.addClass('selected'); - self.aria('expanded', true); - } - }, - - /** - * Hides the menu for the menu item. - * - * @method hideMenu - */ - hideMenu: function() { - var self = this; - - if (self.menu) { - self.menu.items().each(function(item) { - if (item.hideMenu) { - item.hideMenu(); - } - }); - - self.menu.hide(); - self.aria('expanded', false); - } - - return self; - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, id = self._id, settings = self.settings, prefix = self.classPrefix, text = self.encode(self._text); - var icon = self.settings.icon, image = '', shortcut = settings.shortcut; - - if (icon) { - self.parent().addClass('menu-has-icons'); - } - - if (settings.image) { - icon = 'none'; - image = ' style="background-image: url(\'' + settings.image + '\')"'; - } - - if (shortcut && Env.mac) { - // format shortcut for Mac - shortcut = shortcut.replace(/ctrl\+alt\+/i, '⌥⌘'); // ctrl+cmd - shortcut = shortcut.replace(/ctrl\+/i, '⌘'); // ctrl symbol - shortcut = shortcut.replace(/alt\+/i, '⌥'); // cmd symbol - shortcut = shortcut.replace(/shift\+/i, '⇧'); // shift symbol - } - - icon = prefix + 'ico ' + prefix + 'i-' + (self.settings.icon || 'none'); - - return ( - '
    ' + - (text !== '-' ? ' ' : '') + - (text !== '-' ? '' + text + '' : '') + - (shortcut ? '
    ' + shortcut + '
    ' : '') + - (settings.menu ? '
    ' : '') + - '
    ' - ); - }, - - /** - * Gets invoked after the control has been rendered. - * - * @method postRender - */ - postRender: function() { - var self = this, settings = self.settings; - - var textStyle = settings.textStyle; - if (typeof(textStyle) == "function") { - textStyle = textStyle.call(this); - } - - if (textStyle) { - var textElm = self.getEl('text'); - if (textElm) { - textElm.setAttribute('style', textStyle); - } - } - - self.on('mouseenter click', function(e) { - if (e.control === self) { - if (!settings.menu && e.type === 'click') { - self.fire('select'); - self.parent().hideAll(); - } else { - self.showMenu(); - - if (e.aria) { - self.menu.focus(true); - } - } - } - }); - - self._super(); - - return self; - }, - - active: function(state) { - if (typeof(state) != "undefined") { - this.aria('checked', state); - } - - return this._super(state); - }, - - /** - * Removes the control and it's menus. - * - * @method remove - */ - remove: function() { - this._super(); - - if (this.menu) { - this.menu.remove(); - } - } - }); -}); - -// Included from: js/tinymce/classes/ui/Menu.js - -/** - * Menu.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a new menu. - * - * @-x-less Menu.less - * @class tinymce.ui.Menu - * @extends tinymce.ui.FloatPanel - */ -define("tinymce/ui/Menu", [ - "tinymce/ui/FloatPanel", - "tinymce/ui/MenuItem", - "tinymce/util/Tools" -], function(FloatPanel, MenuItem, Tools) { - "use strict"; - - var Menu = FloatPanel.extend({ - Defaults: { - defaultType: 'menuitem', - border: 1, - layout: 'stack', - role: 'application', - bodyRole: 'menu', - ariaRoot: true - }, - - /** - * Constructs a instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - */ - init: function(settings) { - var self = this; - - settings.autohide = true; - settings.constrainToViewport = true; - - if (settings.itemDefaults) { - var items = settings.items, i = items.length; - - while (i--) { - items[i] = Tools.extend({}, settings.itemDefaults, items[i]); - } - } - - self._super(settings); - self.addClass('menu'); - }, - - /** - * Repaints the control after a layout operation. - * - * @method repaint - */ - repaint: function() { - this.toggleClass('menu-align', true); - - this._super(); - - this.getEl().style.height = ''; - this.getEl('body').style.height = ''; - - return this; - }, - - /** - * Hides/closes the menu. - * - * @method cancel - */ - cancel: function() { - var self = this; - - self.hideAll(); - self.fire('select'); - }, - - /** - * Hide menu and all sub menus. - * - * @method hideAll - */ - hideAll: function() { - var self = this; - - this.find('menuitem').exec('hideMenu'); - - return self._super(); - }, -/* - getContainerElm: function() { - var doc = document, id = this.classPrefix + 'menucontainer'; - - var elm = doc.getElementById(id); - if (!elm) { - elm = doc.createElement('div'); - elm.id = id; - elm.setAttribute('role', 'application'); - elm.className = this.classPrefix + '-reset'; - elm.style.position = 'absolute'; - elm.style.top = elm.style.left = '0'; - elm.style.overflow = 'visible'; - doc.body.appendChild(elm); - } - - return elm; - }, -*/ - /** - * Invoked before the menu is rendered. - * - * @method preRender - */ - preRender: function() { - var self = this; - - self.items().each(function(ctrl) { - var settings = ctrl.settings; - - if (settings.icon || settings.selectable) { - self._hasIcons = true; - return false; - } - }); - - return self._super(); - } - }); - - return Menu; -}); - -// Included from: js/tinymce/classes/ui/Radio.js - -/** - * Radio.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a new radio button. - * - * @-x-less Radio.less - * @class tinymce.ui.Radio - * @extends tinymce.ui.Checkbox - */ -define("tinymce/ui/Radio", [ - "tinymce/ui/Checkbox" -], function(Checkbox) { - "use strict"; - - return Checkbox.extend({ - Defaults: { - classes: "radio", - role: "radio" - } - }); -}); - -// Included from: js/tinymce/classes/ui/ResizeHandle.js - -/** - * ResizeHandle.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Renders a resize handle that fires ResizeStart, Resize and ResizeEnd events. - * - * @-x-less ResizeHandle.less - * @class tinymce.ui.ResizeHandle - * @extends tinymce.ui.Widget - */ -define("tinymce/ui/ResizeHandle", [ - "tinymce/ui/Widget", - "tinymce/ui/DragHelper" -], function(Widget, DragHelper) { - "use strict"; - - return Widget.extend({ - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, prefix = self.classPrefix; - - self.addClass('resizehandle'); - - if (self.settings.direction == "both") { - self.addClass('resizehandle-both'); - } - - self.canFocus = false; - - return ( - '
    ' + - '' + - '
    ' - ); - }, - - /** - * Called after the control has been rendered. - * - * @method postRender - */ - postRender: function() { - var self = this; - - self._super(); - - self.resizeDragHelper = new DragHelper(this._id, { - start: function() { - self.fire('ResizeStart'); - }, - - drag: function(e) { - if (self.settings.direction != "both") { - e.deltaX = 0; - } - - self.fire('Resize', e); - }, - - stop: function() { - self.fire('ResizeEnd'); - } - }); - }, - - remove: function() { - if (this.resizeDragHelper) { - this.resizeDragHelper.destroy(); - } - - return this._super(); - } - }); -}); - -// Included from: js/tinymce/classes/ui/Spacer.js - -/** - * Spacer.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a spacer. This control is used in flex layouts for example. - * - * @-x-less Spacer.less - * @class tinymce.ui.Spacer - * @extends tinymce.ui.Widget - */ -define("tinymce/ui/Spacer", [ - "tinymce/ui/Widget" -], function(Widget) { - "use strict"; - - return Widget.extend({ - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this; - - self.addClass('spacer'); - self.canFocus = false; - - return '
    '; - } - }); -}); - -// Included from: js/tinymce/classes/ui/SplitButton.js - -/** - * SplitButton.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a split button. - * - * @-x-less SplitButton.less - * @class tinymce.ui.SplitButton - * @extends tinymce.ui.Button - */ -define("tinymce/ui/SplitButton", [ - "tinymce/ui/MenuButton", - "tinymce/ui/DomUtils" -], function(MenuButton, DomUtils) { - return MenuButton.extend({ - Defaults: { - classes: "widget btn splitbtn", - role: "button" - }, - - /** - * Repaints the control after a layout operation. - * - * @method repaint - */ - repaint: function() { - var self = this, elm = self.getEl(), rect = self.layoutRect(), mainButtonElm, menuButtonElm; - - self._super(); - - mainButtonElm = elm.firstChild; - menuButtonElm = elm.lastChild; - - DomUtils.css(mainButtonElm, { - width: rect.w - DomUtils.getSize(menuButtonElm).width, - height: rect.h - 2 - }); - - DomUtils.css(menuButtonElm, { - height: rect.h - 2 - }); - - return self; - }, - - /** - * Sets the active menu state. - * - * @private - */ - activeMenu: function(state) { - var self = this; - - DomUtils.toggleClass(self.getEl().lastChild, self.classPrefix + 'active', state); - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, id = self._id, prefix = self.classPrefix; - var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : ''; - - return ( - '
    ' + - '' + - '' + - '
    ' - ); - }, - - /** - * Called after the control has been rendered. - * - * @method postRender - */ - postRender: function() { - var self = this, onClickHandler = self.settings.onclick; - - self.on('click', function(e) { - var node = e.target; - - if (e.control == this) { - // Find clicks that is on the main button - while (node) { - if ((e.aria && e.aria.key != 'down') || (node.nodeName == 'BUTTON' && node.className.indexOf('open') == -1)) { - e.stopImmediatePropagation(); - onClickHandler.call(this, e); - return; - } - - node = node.parentNode; - } - } - }); - - delete self.settings.onclick; - - return self._super(); - } - }); -}); - -// Included from: js/tinymce/classes/ui/StackLayout.js - -/** - * StackLayout.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * This layout uses the browsers layout when the items are blocks. - * - * @-x-less StackLayout.less - * @class tinymce.ui.StackLayout - * @extends tinymce.ui.FlowLayout - */ -define("tinymce/ui/StackLayout", [ - "tinymce/ui/FlowLayout" -], function(FlowLayout) { - "use strict"; - - return FlowLayout.extend({ - Defaults: { - containerClass: 'stack-layout', - controlClass: 'stack-layout-item', - endClass : 'break' - } - }); -}); - -// Included from: js/tinymce/classes/ui/TabPanel.js - -/** - * TabPanel.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a tab panel control. - * - * @-x-less TabPanel.less - * @class tinymce.ui.TabPanel - * @extends tinymce.ui.Panel - * - * @setting {Number} activeTab Active tab index. - */ -define("tinymce/ui/TabPanel", [ - "tinymce/ui/Panel", - "tinymce/ui/DomUtils" -], function(Panel, DomUtils) { - "use strict"; - - return Panel.extend({ - lastIdx: 0, - - Defaults: { - layout: 'absolute', - defaults: { - type: 'panel' - } - }, - - /** - * Activates the specified tab by index. - * - * @method activateTab - * @param {Number} idx Index of the tab to activate. - */ - activateTab: function(idx) { - var activeTabElm; - - if (this.activeTabId) { - activeTabElm = this.getEl(this.activeTabId); - DomUtils.removeClass(activeTabElm, this.classPrefix + 'active'); - activeTabElm.setAttribute('aria-selected', "false"); - } - - this.activeTabId = 't' + idx; - - activeTabElm = this.getEl('t' + idx); - activeTabElm.setAttribute('aria-selected', "true"); - DomUtils.addClass(activeTabElm, this.classPrefix + 'active'); - - if (idx != this.lastIdx) { - this.items()[this.lastIdx].hide(); - this.lastIdx = idx; - } - - this.items()[idx].show().fire('showtab'); - this.reflow(); - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, layout = self._layout, tabsHtml = '', prefix = self.classPrefix; - - self.preRender(); - layout.preRender(self); - - self.items().each(function(ctrl, i) { - var id = self._id + '-t' + i; - - ctrl.aria('role', 'tabpanel'); - ctrl.aria('labelledby', id); - - tabsHtml += ( - '' - ); - }); - - return ( - '
    ' + - '
    ' + - tabsHtml + - '
    ' + - '
    ' + - layout.renderHtml(self) + - '
    ' + - '
    ' - ); - }, - - /** - * Called after the control has been rendered. - * - * @method postRender - */ - postRender: function() { - var self = this; - - self._super(); - - self.settings.activeTab = self.settings.activeTab || 0; - self.activateTab(self.settings.activeTab); - - this.on('click', function(e) { - var targetParent = e.target.parentNode; - - if (e.target.parentNode.id == self._id + '-head') { - var i = targetParent.childNodes.length; - - while (i--) { - if (targetParent.childNodes[i] == e.target) { - self.activateTab(i); - } - } - } - }); - }, - - /** - * Initializes the current controls layout rect. - * This will be executed by the layout managers to determine the - * default minWidth/minHeight etc. - * - * @method initLayoutRect - * @return {Object} Layout rect instance. - */ - initLayoutRect: function() { - var self = this, rect, minW, minH; - - minW = DomUtils.getSize(self.getEl('head')).width; - minW = minW < 0 ? 0 : minW; - minH = 0; - self.items().each(function(item, i) { - minW = Math.max(minW, item.layoutRect().minW); - minH = Math.max(minH, item.layoutRect().minH); - if (self.settings.activeTab != i) { - item.hide(); - } - }); - - self.items().each(function(ctrl) { - ctrl.settings.x = 0; - ctrl.settings.y = 0; - ctrl.settings.w = minW; - ctrl.settings.h = minH; - - ctrl.layoutRect({ - x: 0, - y: 0, - w: minW, - h: minH - }); - }); - - var headH = DomUtils.getSize(self.getEl('head')).height; - - self.settings.minWidth = minW; - self.settings.minHeight = minH + headH; - - rect = self._super(); - rect.deltaH += headH; - rect.innerH = rect.h - rect.deltaH; - - return rect; - } - }); -}); - -// Included from: js/tinymce/classes/ui/TextBox.js - -/** - * TextBox.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Creates a new textbox. - * - * @-x-less TextBox.less - * @class tinymce.ui.TextBox - * @extends tinymce.ui.Widget - */ -define("tinymce/ui/TextBox", [ - "tinymce/ui/Widget", - "tinymce/ui/DomUtils" -], function(Widget, DomUtils) { - "use strict"; - - return Widget.extend({ - /** - * Constructs a instance with the specified settings. - * - * @constructor - * @param {Object} settings Name/value object with settings. - * @setting {Boolean} multiline True if the textbox is a multiline control. - * @setting {Number} maxLength Max length for the textbox. - * @setting {Number} size Size of the textbox in characters. - */ - init: function(settings) { - var self = this; - - self._super(settings); - - self._value = settings.value || ''; - self.addClass('textbox'); - - if (settings.multiline) { - self.addClass('multiline'); - } else { - // TODO: Rework this - self.on('keydown', function(e) { - if (e.keyCode == 13) { - self.parents().reverse().each(function(ctrl) { - e.preventDefault(); - - if (ctrl.hasEventListeners('submit') && ctrl.toJSON) { - ctrl.fire('submit', {data: ctrl.toJSON()}); - return false; - } - }); - } - }); - } - }, - - /** - * Getter/setter function for the disabled state. - * - * @method value - * @param {Boolean} [state] State to be set. - * @return {Boolean|tinymce.ui.ComboBox} True/false or self if it's a set operation. - */ - disabled: function(state) { - var self = this; - - if (self._rendered && typeof(state) != 'undefined') { - self.getEl().disabled = state; - } - - return self._super(state); - }, - - /** - * Getter/setter function for the control value. - * - * @method value - * @param {String} [value] Value to be set. - * @return {String|tinymce.ui.ComboBox} Value or self if it's a set operation. - */ - value: function(value) { - var self = this; - - if (typeof(value) != "undefined") { - self._value = value; - - if (self._rendered) { - self.getEl().value = value; - } - - return self; - } - - if (self._rendered) { - return self.getEl().value; - } - - return self._value; - }, - - /** - * Repaints the control after a layout operation. - * - * @method repaint - */ - repaint: function() { - var self = this, style, rect, borderBox, borderW = 0, borderH = 0, lastRepaintRect; - - style = self.getEl().style; - rect = self._layoutRect; - lastRepaintRect = self._lastRepaintRect || {}; - - // Detect old IE 7+8 add lineHeight to align caret vertically in the middle - var doc = document; - if (!self.settings.multiline && doc.all && (!doc.documentMode || doc.documentMode <= 8)) { - style.lineHeight = (rect.h - borderH) + 'px'; - } - - borderBox = self._borderBox; - borderW = borderBox.left + borderBox.right + 8; - borderH = borderBox.top + borderBox.bottom + (self.settings.multiline ? 8 : 0); - - if (rect.x !== lastRepaintRect.x) { - style.left = rect.x + 'px'; - lastRepaintRect.x = rect.x; - } - - if (rect.y !== lastRepaintRect.y) { - style.top = rect.y + 'px'; - lastRepaintRect.y = rect.y; - } - - if (rect.w !== lastRepaintRect.w) { - style.width = (rect.w - borderW) + 'px'; - lastRepaintRect.w = rect.w; - } - - if (rect.h !== lastRepaintRect.h) { - style.height = (rect.h - borderH) + 'px'; - lastRepaintRect.h = rect.h; - } - - self._lastRepaintRect = lastRepaintRect; - self.fire('repaint', {}, false); - - return self; - }, - - /** - * Renders the control as a HTML string. - * - * @method renderHtml - * @return {String} HTML representing the control. - */ - renderHtml: function() { - var self = this, id = self._id, settings = self.settings, value = self.encode(self._value, false), extraAttrs = ''; - - if ("spellcheck" in settings) { - extraAttrs += ' spellcheck="' + settings.spellcheck + '"'; - } - - if (settings.maxLength) { - extraAttrs += ' maxlength="' + settings.maxLength + '"'; - } - - if (settings.size) { - extraAttrs += ' size="' + settings.size + '"'; - } - - if (settings.subtype) { - extraAttrs += ' type="' + settings.subtype + '"'; - } - - if (self.disabled()) { - extraAttrs += ' disabled="disabled"'; - } - - if (settings.multiline) { - return ( - '' - ); - } - - return ''; - }, - - /** - * Called after the control has been rendered. - * - * @method postRender - */ - postRender: function() { - var self = this; - - DomUtils.on(self.getEl(), 'change', function(e) { - self.fire('change', e); - }); - - return self._super(); - }, - - remove: function() { - DomUtils.off(this.getEl()); - this._super(); - } - }); -}); - -// Included from: js/tinymce/classes/ui/Throbber.js - -/** - * Throbber.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - /** - * This class enables you to display a Throbber for any element. + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ * - * @-x-less Throbber.less - * @class tinymce.ui.Throbber + * Version: 5.5.1 (2020-10-01) */ -define("tinymce/ui/Throbber", [ - "tinymce/ui/DomUtils" -], function(DomUtils) { - "use strict"; - - /** - * Constructs a new throbber. - * - * @constructor - * @param {Element} elm DOM Html element to display throbber in. - */ - return function(elm) { - var self = this, state; - - /** - * Shows the throbber. - * - * @method show - * @param {Number} [time] Time to wait before showing. - * @return {tinymce.ui.Throbber} Current throbber instance. - */ - self.show = function(time) { - self.hide(); - - state = true; - - window.setTimeout(function() { - if (state) { - elm.appendChild(DomUtils.createFragment('
    ')); - } - }, time || 0); - - return self; - }; - - /** - * Hides the throbber. - * - * @method hide - * @return {tinymce.ui.Throbber} Current throbber instance. - */ - self.hide = function() { - var child = elm.lastChild; - - if (child && child.className.indexOf('throbber') != -1) { - child.parentNode.removeChild(child); - } - - state = false; - - return self; - }; - }; -}); - -expose(["tinymce/dom/EventUtils","tinymce/dom/Sizzle","tinymce/dom/DomQuery","tinymce/html/Styles","tinymce/dom/TreeWalker","tinymce/util/Tools","tinymce/dom/Range","tinymce/html/Entities","tinymce/Env","tinymce/dom/StyleSheetLoader","tinymce/dom/DOMUtils","tinymce/dom/ScriptLoader","tinymce/AddOnManager","tinymce/html/Node","tinymce/html/Schema","tinymce/html/SaxParser","tinymce/html/DomParser","tinymce/html/Writer","tinymce/html/Serializer","tinymce/dom/Serializer","tinymce/dom/TridentSelection","tinymce/util/VK","tinymce/dom/ControlSelection","tinymce/dom/RangeUtils","tinymce/dom/Selection","tinymce/Formatter","tinymce/UndoManager","tinymce/EnterKey","tinymce/ForceBlocks","tinymce/EditorCommands","tinymce/util/URI","tinymce/util/Class","tinymce/ui/Selector","tinymce/ui/Collection","tinymce/ui/DomUtils","tinymce/ui/Control","tinymce/ui/Factory","tinymce/ui/KeyboardNavigation","tinymce/ui/Container","tinymce/ui/DragHelper","tinymce/ui/Scrollable","tinymce/ui/Panel","tinymce/ui/Movable","tinymce/ui/Resizable","tinymce/ui/FloatPanel","tinymce/ui/Window","tinymce/ui/MessageBox","tinymce/WindowManager","tinymce/util/Quirks","tinymce/util/Observable","tinymce/Shortcuts","tinymce/Editor","tinymce/util/I18n","tinymce/FocusManager","tinymce/EditorManager","tinymce/LegacyInput","tinymce/util/XHR","tinymce/util/JSON","tinymce/util/JSONRequest","tinymce/util/JSONP","tinymce/util/LocalStorage","tinymce/Compat","tinymce/ui/Layout","tinymce/ui/AbsoluteLayout","tinymce/ui/Tooltip","tinymce/ui/Widget","tinymce/ui/Button","tinymce/ui/ButtonGroup","tinymce/ui/Checkbox","tinymce/ui/PanelButton","tinymce/ui/ColorButton","tinymce/ui/ComboBox","tinymce/ui/Path","tinymce/ui/ElementPath","tinymce/ui/FormItem","tinymce/ui/Form","tinymce/ui/FieldSet","tinymce/ui/FilePicker","tinymce/ui/FitLayout","tinymce/ui/FlexLayout","tinymce/ui/FlowLayout","tinymce/ui/FormatControls","tinymce/ui/GridLayout","tinymce/ui/Iframe","tinymce/ui/Label","tinymce/ui/Toolbar","tinymce/ui/MenuBar","tinymce/ui/MenuButton","tinymce/ui/ListBox","tinymce/ui/MenuItem","tinymce/ui/Menu","tinymce/ui/Radio","tinymce/ui/ResizeHandle","tinymce/ui/Spacer","tinymce/ui/SplitButton","tinymce/ui/StackLayout","tinymce/ui/TabPanel","tinymce/ui/TextBox","tinymce/ui/Throbber"]); -})(this); \ No newline at end of file +(function () { + 'use strict'; + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + if (x === undefined) { + return 'undefined'; + } + var t = typeof x; + if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } + if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } + return t; + }; + var isEquatableType = function (x) { + return [ + 'undefined', + 'boolean', + 'number', + 'string', + 'function', + 'xml', + 'null' + ].indexOf(x) !== -1; + }; + + var sort = function (xs, compareFn) { + var clone = Array.prototype.slice.call(xs); + return clone.sort(compareFn); + }; + + var contramap = function (eqa, f) { + return eq(function (x, y) { + return eqa.eq(f(x), f(y)); + }); + }; + var eq = function (f) { + return { eq: f }; + }; + var tripleEq = eq(function (x, y) { + return x === y; + }); + var eqString = tripleEq; + var eqArray = function (eqa) { + return eq(function (x, y) { + if (x.length !== y.length) { + return false; + } + var len = x.length; + for (var i = 0; i < len; i++) { + if (!eqa.eq(x[i], y[i])) { + return false; + } + } + return true; + }); + }; + var eqSortedArray = function (eqa, compareFn) { + return contramap(eqArray(eqa), function (xs) { + return sort(xs, compareFn); + }); + }; + var eqRecord = function (eqa) { + return eq(function (x, y) { + var kx = Object.keys(x); + var ky = Object.keys(y); + if (!eqSortedArray(eqString).eq(kx, ky)) { + return false; + } + var len = kx.length; + for (var i = 0; i < len; i++) { + var q = kx[i]; + if (!eqa.eq(x[q], y[q])) { + return false; + } + } + return true; + }); + }; + var eqAny = eq(function (x, y) { + if (x === y) { + return true; + } + var tx = typeOf(x); + var ty = typeOf(y); + if (tx !== ty) { + return false; + } + if (isEquatableType(tx)) { + return x === y; + } else if (tx === 'array') { + return eqArray(eqAny).eq(x, y); + } else if (tx === 'object') { + return eqRecord(eqAny).eq(x, y); + } + return false; + }); + + var noop = function () { + }; + var compose = function (fa, fb) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return fa(fb.apply(null, args)); + }; + }; + var compose1 = function (fbc, fab) { + return function (a) { + return fbc(fab(a)); + }; + }; + var constant = function (value) { + return function () { + return value; + }; + }; + var identity = function (x) { + return x; + }; + function curry(fn) { + var initialArgs = []; + for (var _i = 1; _i < arguments.length; _i++) { + initialArgs[_i - 1] = arguments[_i]; + } + return function () { + var restArgs = []; + for (var _i = 0; _i < arguments.length; _i++) { + restArgs[_i] = arguments[_i]; + } + var all = initialArgs.concat(restArgs); + return fn.apply(null, all); + }; + } + var not = function (f) { + return function (t) { + return !f(t); + }; + }; + var die = function (msg) { + return function () { + throw new Error(msg); + }; + }; + var never = constant(false); + var always = constant(true); + + var none = function () { + return NONE; + }; + var NONE = function () { + var eq = function (o) { + return o.isNone(); + }; + var call = function (thunk) { + return thunk(); + }; + var id = function (n) { + return n; + }; + var me = { + fold: function (n, _s) { + return n(); + }, + is: never, + isSome: never, + isNone: always, + getOr: id, + getOrThunk: call, + getOrDie: function (msg) { + throw new Error(msg || 'error: getOrDie called on none.'); + }, + getOrNull: constant(null), + getOrUndefined: constant(undefined), + or: id, + orThunk: call, + map: none, + each: noop, + bind: none, + exists: never, + forall: always, + filter: none, + equals: eq, + equals_: eq, + toArray: function () { + return []; + }, + toString: constant('none()') + }; + return me; + }(); + var some = function (a) { + var constant_a = constant(a); + var self = function () { + return me; + }; + var bind = function (f) { + return f(a); + }; + var me = { + fold: function (n, s) { + return s(a); + }, + is: function (v) { + return a === v; + }, + isSome: always, + isNone: never, + getOr: constant_a, + getOrThunk: constant_a, + getOrDie: constant_a, + getOrNull: constant_a, + getOrUndefined: constant_a, + or: self, + orThunk: self, + map: function (f) { + return some(f(a)); + }, + each: function (f) { + f(a); + }, + bind: bind, + exists: bind, + forall: bind, + filter: function (f) { + return f(a) ? me : NONE; + }, + toArray: function () { + return [a]; + }, + toString: function () { + return 'some(' + a + ')'; + }, + equals: function (o) { + return o.is(a); + }, + equals_: function (o, elementEq) { + return o.fold(never, function (b) { + return elementEq(a, b); + }); + } + }; + return me; + }; + var from = function (value) { + return value === null || value === undefined ? NONE : some(value); + }; + var Optional = { + some: some, + none: none, + from: from + }; + + var typeOf$1 = function (x) { + var t = typeof x; + if (x === null) { + return 'null'; + } else if (t === 'object' && (Array.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'Array')) { + return 'array'; + } else if (t === 'object' && (String.prototype.isPrototypeOf(x) || x.constructor && x.constructor.name === 'String')) { + return 'string'; + } else { + return t; + } + }; + var isType = function (type) { + return function (value) { + return typeOf$1(value) === type; + }; + }; + var isSimpleType = function (type) { + return function (value) { + return typeof value === type; + }; + }; + var eq$1 = function (t) { + return function (a) { + return t === a; + }; + }; + var isString = isType('string'); + var isObject = isType('object'); + var isArray = isType('array'); + var isNull = eq$1(null); + var isBoolean = isSimpleType('boolean'); + var isUndefined = eq$1(undefined); + var isNullable = function (a) { + return a === null || a === undefined; + }; + var isNonNullable = function (a) { + return !isNullable(a); + }; + var isFunction = isSimpleType('function'); + var isNumber = isSimpleType('number'); + + var nativeSlice = Array.prototype.slice; + var nativeIndexOf = Array.prototype.indexOf; + var nativePush = Array.prototype.push; + var rawIndexOf = function (ts, t) { + return nativeIndexOf.call(ts, t); + }; + var indexOf = function (xs, x) { + var r = rawIndexOf(xs, x); + return r === -1 ? Optional.none() : Optional.some(r); + }; + var contains = function (xs, x) { + return rawIndexOf(xs, x) > -1; + }; + var exists = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return true; + } + } + return false; + }; + var map = function (xs, f) { + var len = xs.length; + var r = new Array(len); + for (var i = 0; i < len; i++) { + var x = xs[i]; + r[i] = f(x, i); + } + return r; + }; + var each = function (xs, f) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } + }; + var eachr = function (xs, f) { + for (var i = xs.length - 1; i >= 0; i--) { + var x = xs[i]; + f(x, i); + } + }; + var partition = function (xs, pred) { + var pass = []; + var fail = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + var arr = pred(x, i) ? pass : fail; + arr.push(x); + } + return { + pass: pass, + fail: fail + }; + }; + var filter = function (xs, pred) { + var r = []; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + r.push(x); + } + } + return r; + }; + var foldr = function (xs, f, acc) { + eachr(xs, function (x) { + acc = f(acc, x); + }); + return acc; + }; + var foldl = function (xs, f, acc) { + each(xs, function (x) { + acc = f(acc, x); + }); + return acc; + }; + var findUntil = function (xs, pred, until) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Optional.some(x); + } else if (until(x, i)) { + break; + } + } + return Optional.none(); + }; + var find = function (xs, pred) { + return findUntil(xs, pred, never); + }; + var findIndex = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Optional.some(i); + } + } + return Optional.none(); + }; + var flatten = function (xs) { + var r = []; + for (var i = 0, len = xs.length; i < len; ++i) { + if (!isArray(xs[i])) { + throw new Error('Arr.flatten item ' + i + ' was not an array, input: ' + xs); + } + nativePush.apply(r, xs[i]); + } + return r; + }; + var bind = function (xs, f) { + return flatten(map(xs, f)); + }; + var forall = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; ++i) { + var x = xs[i]; + if (pred(x, i) !== true) { + return false; + } + } + return true; + }; + var reverse = function (xs) { + var r = nativeSlice.call(xs, 0); + r.reverse(); + return r; + }; + var difference = function (a1, a2) { + return filter(a1, function (x) { + return !contains(a2, x); + }); + }; + var mapToObject = function (xs, f) { + var r = {}; + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + r[String(x)] = f(x, i); + } + return r; + }; + var sort$1 = function (xs, comparator) { + var copy = nativeSlice.call(xs, 0); + copy.sort(comparator); + return copy; + }; + var head = function (xs) { + return xs.length === 0 ? Optional.none() : Optional.some(xs[0]); + }; + var last = function (xs) { + return xs.length === 0 ? Optional.none() : Optional.some(xs[xs.length - 1]); + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + var keys = Object.keys; + var hasOwnProperty = Object.hasOwnProperty; + var each$1 = function (obj, f) { + var props = keys(obj); + for (var k = 0, len = props.length; k < len; k++) { + var i = props[k]; + var x = obj[i]; + f(x, i); + } + }; + var map$1 = function (obj, f) { + return tupleMap(obj, function (x, i) { + return { + k: i, + v: f(x, i) + }; + }); + }; + var tupleMap = function (obj, f) { + var r = {}; + each$1(obj, function (x, i) { + var tuple = f(x, i); + r[tuple.k] = tuple.v; + }); + return r; + }; + var objAcc = function (r) { + return function (x, i) { + r[i] = x; + }; + }; + var internalFilter = function (obj, pred, onTrue, onFalse) { + var r = {}; + each$1(obj, function (x, i) { + (pred(x, i) ? onTrue : onFalse)(x, i); + }); + return r; + }; + var bifilter = function (obj, pred) { + var t = {}; + var f = {}; + internalFilter(obj, pred, objAcc(t), objAcc(f)); + return { + t: t, + f: f + }; + }; + var filter$1 = function (obj, pred) { + var t = {}; + internalFilter(obj, pred, objAcc(t), noop); + return t; + }; + var mapToArray = function (obj, f) { + var r = []; + each$1(obj, function (value, name) { + r.push(f(value, name)); + }); + return r; + }; + var values = function (obj) { + return mapToArray(obj, function (v) { + return v; + }); + }; + var get = function (obj, key) { + return has(obj, key) ? Optional.from(obj[key]) : Optional.none(); + }; + var has = function (obj, key) { + return hasOwnProperty.call(obj, key); + }; + var equal = function (a1, a2, eq) { + if (eq === void 0) { + eq = eqAny; + } + return eqRecord(eq).eq(a1, a2); + }; + + var isArray$1 = Array.isArray; + var toArray = function (obj) { + if (!isArray$1(obj)) { + var array = []; + for (var i = 0, l = obj.length; i < l; i++) { + array[i] = obj[i]; + } + return array; + } else { + return obj; + } + }; + var each$2 = function (o, cb, s) { + var n, l; + if (!o) { + return false; + } + s = s || o; + if (o.length !== undefined) { + for (n = 0, l = o.length; n < l; n++) { + if (cb.call(s, o[n], n, o) === false) { + return false; + } + } + } else { + for (n in o) { + if (o.hasOwnProperty(n)) { + if (cb.call(s, o[n], n, o) === false) { + return false; + } + } + } + } + return true; + }; + var map$2 = function (array, callback) { + var out = []; + each$2(array, function (item, index) { + out.push(callback(item, index, array)); + }); + return out; + }; + var filter$2 = function (a, f) { + var o = []; + each$2(a, function (v, index) { + if (!f || f(v, index, a)) { + o.push(v); + } + }); + return o; + }; + var indexOf$1 = function (a, v) { + if (a) { + for (var i = 0, l = a.length; i < l; i++) { + if (a[i] === v) { + return i; + } + } + } + return -1; + }; + var reduce = function (collection, iteratee, accumulator, thisArg) { + var acc = isUndefined(accumulator) ? collection[0] : accumulator; + for (var i = 0; i < collection.length; i++) { + acc = iteratee.call(thisArg, acc, collection[i], i); + } + return acc; + }; + var findIndex$1 = function (array, predicate, thisArg) { + var i, l; + for (i = 0, l = array.length; i < l; i++) { + if (predicate.call(thisArg, array[i], i, array)) { + return i; + } + } + return -1; + }; + var last$1 = function (collection) { + return collection[collection.length - 1]; + }; + + var __assign = function () { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); + }; + function __rest(s, e) { + var t = {}; + for (var p in s) + if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === 'function') + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; + } + function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) + s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; + } + + var cached = function (f) { + var called = false; + var r; + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!called) { + called = true; + r = f.apply(null, args); + } + return r; + }; + }; + + var DeviceType = function (os, browser, userAgent, mediaMatch) { + var isiPad = os.isiOS() && /ipad/i.test(userAgent) === true; + var isiPhone = os.isiOS() && !isiPad; + var isMobile = os.isiOS() || os.isAndroid(); + var isTouch = isMobile || mediaMatch('(pointer:coarse)'); + var isTablet = isiPad || !isiPhone && isMobile && mediaMatch('(min-device-width:768px)'); + var isPhone = isiPhone || isMobile && !isTablet; + var iOSwebview = browser.isSafari() && os.isiOS() && /safari/i.test(userAgent) === false; + var isDesktop = !isPhone && !isTablet && !iOSwebview; + return { + isiPad: constant(isiPad), + isiPhone: constant(isiPhone), + isTablet: constant(isTablet), + isPhone: constant(isPhone), + isTouch: constant(isTouch), + isAndroid: os.isAndroid, + isiOS: os.isiOS, + isWebView: constant(iOSwebview), + isDesktop: constant(isDesktop) + }; + }; + + var firstMatch = function (regexes, s) { + for (var i = 0; i < regexes.length; i++) { + var x = regexes[i]; + if (x.test(s)) { + return x; + } + } + return undefined; + }; + var find$1 = function (regexes, agent) { + var r = firstMatch(regexes, agent); + if (!r) { + return { + major: 0, + minor: 0 + }; + } + var group = function (i) { + return Number(agent.replace(r, '$' + i)); + }; + return nu(group(1), group(2)); + }; + var detect = function (versionRegexes, agent) { + var cleanedAgent = String(agent).toLowerCase(); + if (versionRegexes.length === 0) { + return unknown(); + } + return find$1(versionRegexes, cleanedAgent); + }; + var unknown = function () { + return nu(0, 0); + }; + var nu = function (major, minor) { + return { + major: major, + minor: minor + }; + }; + var Version = { + nu: nu, + detect: detect, + unknown: unknown + }; + + var detect$1 = function (candidates, userAgent) { + var agent = String(userAgent).toLowerCase(); + return find(candidates, function (candidate) { + return candidate.search(agent); + }); + }; + var detectBrowser = function (browsers, userAgent) { + return detect$1(browsers, userAgent).map(function (browser) { + var version = Version.detect(browser.versionRegexes, userAgent); + return { + current: browser.name, + version: version + }; + }); + }; + var detectOs = function (oses, userAgent) { + return detect$1(oses, userAgent).map(function (os) { + var version = Version.detect(os.versionRegexes, userAgent); + return { + current: os.name, + version: version + }; + }); + }; + var UaString = { + detectBrowser: detectBrowser, + detectOs: detectOs + }; + + var checkRange = function (str, substr, start) { + return substr === '' || str.length >= substr.length && str.substr(start, start + substr.length) === substr; + }; + var contains$1 = function (str, substr) { + return str.indexOf(substr) !== -1; + }; + var startsWith = function (str, prefix) { + return checkRange(str, prefix, 0); + }; + var blank = function (r) { + return function (s) { + return s.replace(r, ''); + }; + }; + var trim = blank(/^\s+|\s+$/g); + var lTrim = blank(/^\s+/g); + var rTrim = blank(/\s+$/g); + + var normalVersionRegex = /.*?version\/\ ?([0-9]+)\.([0-9]+).*/; + var checkContains = function (target) { + return function (uastring) { + return contains$1(uastring, target); + }; + }; + var browsers = [ + { + name: 'Edge', + versionRegexes: [/.*?edge\/ ?([0-9]+)\.([0-9]+)$/], + search: function (uastring) { + return contains$1(uastring, 'edge/') && contains$1(uastring, 'chrome') && contains$1(uastring, 'safari') && contains$1(uastring, 'applewebkit'); + } + }, + { + name: 'Chrome', + versionRegexes: [ + /.*?chrome\/([0-9]+)\.([0-9]+).*/, + normalVersionRegex + ], + search: function (uastring) { + return contains$1(uastring, 'chrome') && !contains$1(uastring, 'chromeframe'); + } + }, + { + name: 'IE', + versionRegexes: [ + /.*?msie\ ?([0-9]+)\.([0-9]+).*/, + /.*?rv:([0-9]+)\.([0-9]+).*/ + ], + search: function (uastring) { + return contains$1(uastring, 'msie') || contains$1(uastring, 'trident'); + } + }, + { + name: 'Opera', + versionRegexes: [ + normalVersionRegex, + /.*?opera\/([0-9]+)\.([0-9]+).*/ + ], + search: checkContains('opera') + }, + { + name: 'Firefox', + versionRegexes: [/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/], + search: checkContains('firefox') + }, + { + name: 'Safari', + versionRegexes: [ + normalVersionRegex, + /.*?cpu os ([0-9]+)_([0-9]+).*/ + ], + search: function (uastring) { + return (contains$1(uastring, 'safari') || contains$1(uastring, 'mobile/')) && contains$1(uastring, 'applewebkit'); + } + } + ]; + var oses = [ + { + name: 'Windows', + search: checkContains('win'), + versionRegexes: [/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/] + }, + { + name: 'iOS', + search: function (uastring) { + return contains$1(uastring, 'iphone') || contains$1(uastring, 'ipad'); + }, + versionRegexes: [ + /.*?version\/\ ?([0-9]+)\.([0-9]+).*/, + /.*cpu os ([0-9]+)_([0-9]+).*/, + /.*cpu iphone os ([0-9]+)_([0-9]+).*/ + ] + }, + { + name: 'Android', + search: checkContains('android'), + versionRegexes: [/.*?android\ ?([0-9]+)\.([0-9]+).*/] + }, + { + name: 'OSX', + search: checkContains('mac os x'), + versionRegexes: [/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/] + }, + { + name: 'Linux', + search: checkContains('linux'), + versionRegexes: [] + }, + { + name: 'Solaris', + search: checkContains('sunos'), + versionRegexes: [] + }, + { + name: 'FreeBSD', + search: checkContains('freebsd'), + versionRegexes: [] + }, + { + name: 'ChromeOS', + search: checkContains('cros'), + versionRegexes: [/.*?chrome\/([0-9]+)\.([0-9]+).*/] + } + ]; + var PlatformInfo = { + browsers: constant(browsers), + oses: constant(oses) + }; + + var edge = 'Edge'; + var chrome = 'Chrome'; + var ie = 'IE'; + var opera = 'Opera'; + var firefox = 'Firefox'; + var safari = 'Safari'; + var unknown$1 = function () { + return nu$1({ + current: undefined, + version: Version.unknown() + }); + }; + var nu$1 = function (info) { + var current = info.current; + var version = info.version; + var isBrowser = function (name) { + return function () { + return current === name; + }; + }; + return { + current: current, + version: version, + isEdge: isBrowser(edge), + isChrome: isBrowser(chrome), + isIE: isBrowser(ie), + isOpera: isBrowser(opera), + isFirefox: isBrowser(firefox), + isSafari: isBrowser(safari) + }; + }; + var Browser = { + unknown: unknown$1, + nu: nu$1, + edge: constant(edge), + chrome: constant(chrome), + ie: constant(ie), + opera: constant(opera), + firefox: constant(firefox), + safari: constant(safari) + }; + + var windows = 'Windows'; + var ios = 'iOS'; + var android = 'Android'; + var linux = 'Linux'; + var osx = 'OSX'; + var solaris = 'Solaris'; + var freebsd = 'FreeBSD'; + var chromeos = 'ChromeOS'; + var unknown$2 = function () { + return nu$2({ + current: undefined, + version: Version.unknown() + }); + }; + var nu$2 = function (info) { + var current = info.current; + var version = info.version; + var isOS = function (name) { + return function () { + return current === name; + }; + }; + return { + current: current, + version: version, + isWindows: isOS(windows), + isiOS: isOS(ios), + isAndroid: isOS(android), + isOSX: isOS(osx), + isLinux: isOS(linux), + isSolaris: isOS(solaris), + isFreeBSD: isOS(freebsd), + isChromeOS: isOS(chromeos) + }; + }; + var OperatingSystem = { + unknown: unknown$2, + nu: nu$2, + windows: constant(windows), + ios: constant(ios), + android: constant(android), + linux: constant(linux), + osx: constant(osx), + solaris: constant(solaris), + freebsd: constant(freebsd), + chromeos: constant(chromeos) + }; + + var detect$2 = function (userAgent, mediaMatch) { + var browsers = PlatformInfo.browsers(); + var oses = PlatformInfo.oses(); + var browser = UaString.detectBrowser(browsers, userAgent).fold(Browser.unknown, Browser.nu); + var os = UaString.detectOs(oses, userAgent).fold(OperatingSystem.unknown, OperatingSystem.nu); + var deviceType = DeviceType(os, browser, userAgent, mediaMatch); + return { + browser: browser, + os: os, + deviceType: deviceType + }; + }; + var PlatformDetection = { detect: detect$2 }; + + var mediaMatch = function (query) { + return window.matchMedia(query).matches; + }; + var platform = cached(function () { + return PlatformDetection.detect(navigator.userAgent, mediaMatch); + }); + var detect$3 = function () { + return platform(); + }; + + var userAgent = navigator.userAgent; + var platform$1 = detect$3(); + var browser = platform$1.browser; + var os = platform$1.os; + var deviceType = platform$1.deviceType; + var webkit = /WebKit/.test(userAgent) && !browser.isEdge(); + var fileApi = 'FormData' in window && 'FileReader' in window && 'URL' in window && !!URL.createObjectURL; + var windowsPhone = userAgent.indexOf('Windows Phone') !== -1; + var Env = { + opera: browser.isOpera(), + webkit: webkit, + ie: browser.isIE() || browser.isEdge() ? browser.version.major : false, + gecko: browser.isFirefox(), + mac: os.isOSX() || os.isiOS(), + iOS: deviceType.isiPad() || deviceType.isiPhone(), + android: os.isAndroid(), + contentEditable: true, + transparentSrc: 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7', + caretAfter: true, + range: window.getSelection && 'Range' in window, + documentMode: browser.isIE() ? document.documentMode || 7 : 10, + fileApi: fileApi, + ceFalse: true, + cacheSuffix: null, + container: null, + experimentalShadowDom: false, + canHaveCSP: !browser.isIE(), + desktop: deviceType.isDesktop(), + windowsPhone: windowsPhone, + browser: { + current: browser.current, + version: browser.version, + isChrome: browser.isChrome, + isEdge: browser.isEdge, + isFirefox: browser.isFirefox, + isIE: browser.isIE, + isOpera: browser.isOpera, + isSafari: browser.isSafari + }, + os: { + current: os.current, + version: os.version, + isAndroid: os.isAndroid, + isChromeOS: os.isChromeOS, + isFreeBSD: os.isFreeBSD, + isiOS: os.isiOS, + isLinux: os.isLinux, + isOSX: os.isOSX, + isSolaris: os.isSolaris, + isWindows: os.isWindows + }, + deviceType: { + isDesktop: deviceType.isDesktop, + isiPad: deviceType.isiPad, + isiPhone: deviceType.isiPhone, + isPhone: deviceType.isPhone, + isTablet: deviceType.isTablet, + isTouch: deviceType.isTouch, + isWebView: deviceType.isWebView + } + }; + + var whiteSpaceRegExp = /^\s*|\s*$/g; + var trim$1 = function (str) { + return str === null || str === undefined ? '' : ('' + str).replace(whiteSpaceRegExp, ''); + }; + var is = function (obj, type) { + if (!type) { + return obj !== undefined; + } + if (type === 'array' && isArray$1(obj)) { + return true; + } + return typeof obj === type; + }; + var makeMap = function (items, delim, map) { + var i; + items = items || []; + delim = delim || ','; + if (typeof items === 'string') { + items = items.split(delim); + } + map = map || {}; + i = items.length; + while (i--) { + map[items[i]] = {}; + } + return map; + }; + var hasOwnProperty$1 = function (obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); + }; + var create = function (s, p, root) { + var self = this; + var sp, scn, c, de = 0; + s = /^((static) )?([\w.]+)(:([\w.]+))?/.exec(s); + var cn = s[3].match(/(^|\.)(\w+)$/i)[2]; + var ns = self.createNS(s[3].replace(/\.\w+$/, ''), root); + if (ns[cn]) { + return; + } + if (s[2] === 'static') { + ns[cn] = p; + if (this.onCreate) { + this.onCreate(s[2], s[3], ns[cn]); + } + return; + } + if (!p[cn]) { + p[cn] = function () { + }; + de = 1; + } + ns[cn] = p[cn]; + self.extend(ns[cn].prototype, p); + if (s[5]) { + sp = self.resolve(s[5]).prototype; + scn = s[5].match(/\.(\w+)$/i)[1]; + c = ns[cn]; + if (de) { + ns[cn] = function () { + return sp[scn].apply(this, arguments); + }; + } else { + ns[cn] = function () { + this.parent = sp[scn]; + return c.apply(this, arguments); + }; + } + ns[cn].prototype[cn] = ns[cn]; + self.each(sp, function (f, n) { + ns[cn].prototype[n] = sp[n]; + }); + self.each(p, function (f, n) { + if (sp[n]) { + ns[cn].prototype[n] = function () { + this.parent = sp[n]; + return f.apply(this, arguments); + }; + } else { + if (n !== cn) { + ns[cn].prototype[n] = f; + } + } + }); + } + self.each(p.static, function (f, n) { + ns[cn][n] = f; + }); + }; + var extend = function (obj) { + var exts = []; + for (var _i = 1; _i < arguments.length; _i++) { + exts[_i - 1] = arguments[_i]; + } + for (var i = 0; i < exts.length; i++) { + var ext = exts[i]; + for (var name_1 in ext) { + if (ext.hasOwnProperty(name_1)) { + var value = ext[name_1]; + if (value !== undefined) { + obj[name_1] = value; + } + } + } + } + return obj; + }; + var walk = function (o, f, n, s) { + s = s || this; + if (o) { + if (n) { + o = o[n]; + } + each$2(o, function (o, i) { + if (f.call(s, o, i, n) === false) { + return false; + } + walk(o, f, n, s); + }); + } + }; + var createNS = function (n, o) { + var i, v; + o = o || window; + n = n.split('.'); + for (i = 0; i < n.length; i++) { + v = n[i]; + if (!o[v]) { + o[v] = {}; + } + o = o[v]; + } + return o; + }; + var resolve = function (n, o) { + var i, l; + o = o || window; + n = n.split('.'); + for (i = 0, l = n.length; i < l; i++) { + o = o[n[i]]; + if (!o) { + break; + } + } + return o; + }; + var explode = function (s, d) { + if (!s || is(s, 'array')) { + return s; + } + return map$2(s.split(d || ','), trim$1); + }; + var _addCacheSuffix = function (url) { + var cacheSuffix = Env.cacheSuffix; + if (cacheSuffix) { + url += (url.indexOf('?') === -1 ? '?' : '&') + cacheSuffix; + } + return url; + }; + var Tools = { + trim: trim$1, + isArray: isArray$1, + is: is, + toArray: toArray, + makeMap: makeMap, + each: each$2, + map: map$2, + grep: filter$2, + inArray: indexOf$1, + hasOwn: hasOwnProperty$1, + extend: extend, + create: create, + walk: walk, + createNS: createNS, + resolve: resolve, + explode: explode, + _addCacheSuffix: _addCacheSuffix + }; + + var fromHtml = function (html, scope) { + var doc = scope || document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + console.error('HTML does not have a single root node', html); + throw new Error('HTML must have a single root node'); + } + return fromDom(div.childNodes[0]); + }; + var fromTag = function (tag, scope) { + var doc = scope || document; + var node = doc.createElement(tag); + return fromDom(node); + }; + var fromText = function (text, scope) { + var doc = scope || document; + var node = doc.createTextNode(text); + return fromDom(node); + }; + var fromDom = function (node) { + if (node === null || node === undefined) { + throw new Error('Node cannot be null or undefined'); + } + return { dom: node }; + }; + var fromPoint = function (docElm, x, y) { + return Optional.from(docElm.dom.elementFromPoint(x, y)).map(fromDom); + }; + var SugarElement = { + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint + }; + + var toArray$1 = function (target, f) { + var r = []; + var recurse = function (e) { + r.push(e); + return f(e); + }; + var cur = f(target); + do { + cur = cur.bind(recurse); + } while (cur.isSome()); + return r; + }; + + var compareDocumentPosition = function (a, b, match) { + return (a.compareDocumentPosition(b) & match) !== 0; + }; + var documentPositionContainedBy = function (a, b) { + return compareDocumentPosition(a, b, Node.DOCUMENT_POSITION_CONTAINED_BY); + }; + + var COMMENT = 8; + var DOCUMENT = 9; + var DOCUMENT_FRAGMENT = 11; + var ELEMENT = 1; + var TEXT = 3; + + var is$1 = function (element, selector) { + var dom = element.dom; + if (dom.nodeType !== ELEMENT) { + return false; + } else { + var elem = dom; + if (elem.matches !== undefined) { + return elem.matches(selector); + } else if (elem.msMatchesSelector !== undefined) { + return elem.msMatchesSelector(selector); + } else if (elem.webkitMatchesSelector !== undefined) { + return elem.webkitMatchesSelector(selector); + } else if (elem.mozMatchesSelector !== undefined) { + return elem.mozMatchesSelector(selector); + } else { + throw new Error('Browser lacks native selectors'); + } + } + }; + var bypassSelector = function (dom) { + return dom.nodeType !== ELEMENT && dom.nodeType !== DOCUMENT && dom.nodeType !== DOCUMENT_FRAGMENT || dom.childElementCount === 0; + }; + var all = function (selector, scope) { + var base = scope === undefined ? document : scope.dom; + return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), SugarElement.fromDom); + }; + var one = function (selector, scope) { + var base = scope === undefined ? document : scope.dom; + return bypassSelector(base) ? Optional.none() : Optional.from(base.querySelector(selector)).map(SugarElement.fromDom); + }; + + var eq$2 = function (e1, e2) { + return e1.dom === e2.dom; + }; + var regularContains = function (e1, e2) { + var d1 = e1.dom; + var d2 = e2.dom; + return d1 === d2 ? false : d1.contains(d2); + }; + var ieContains = function (e1, e2) { + return documentPositionContainedBy(e1.dom, e2.dom); + }; + var contains$2 = function (e1, e2) { + return detect$3().browser.isIE() ? ieContains(e1, e2) : regularContains(e1, e2); + }; + + var Global = typeof window !== 'undefined' ? window : Function('return this;')(); + + var name = function (element) { + var r = element.dom.nodeName; + return r.toLowerCase(); + }; + var type = function (element) { + return element.dom.nodeType; + }; + var isType$1 = function (t) { + return function (element) { + return type(element) === t; + }; + }; + var isComment = function (element) { + return type(element) === COMMENT || name(element) === '#comment'; + }; + var isElement = isType$1(ELEMENT); + var isText = isType$1(TEXT); + var isDocument = isType$1(DOCUMENT); + var isDocumentFragment = isType$1(DOCUMENT_FRAGMENT); + + var owner = function (element) { + return SugarElement.fromDom(element.dom.ownerDocument); + }; + var documentOrOwner = function (dos) { + return isDocument(dos) ? dos : owner(dos); + }; + var documentElement = function (element) { + return SugarElement.fromDom(documentOrOwner(element).dom.documentElement); + }; + var defaultView = function (element) { + return SugarElement.fromDom(documentOrOwner(element).dom.defaultView); + }; + var parent = function (element) { + return Optional.from(element.dom.parentNode).map(SugarElement.fromDom); + }; + var parents = function (element, isRoot) { + var stop = isFunction(isRoot) ? isRoot : never; + var dom = element.dom; + var ret = []; + while (dom.parentNode !== null && dom.parentNode !== undefined) { + var rawParent = dom.parentNode; + var p = SugarElement.fromDom(rawParent); + ret.push(p); + if (stop(p) === true) { + break; + } else { + dom = rawParent; + } + } + return ret; + }; + var siblings = function (element) { + var filterSelf = function (elements) { + return filter(elements, function (x) { + return !eq$2(element, x); + }); + }; + return parent(element).map(children).map(filterSelf).getOr([]); + }; + var prevSibling = function (element) { + return Optional.from(element.dom.previousSibling).map(SugarElement.fromDom); + }; + var nextSibling = function (element) { + return Optional.from(element.dom.nextSibling).map(SugarElement.fromDom); + }; + var prevSiblings = function (element) { + return reverse(toArray$1(element, prevSibling)); + }; + var nextSiblings = function (element) { + return toArray$1(element, nextSibling); + }; + var children = function (element) { + return map(element.dom.childNodes, SugarElement.fromDom); + }; + var child = function (element, index) { + var cs = element.dom.childNodes; + return Optional.from(cs[index]).map(SugarElement.fromDom); + }; + var firstChild = function (element) { + return child(element, 0); + }; + var lastChild = function (element) { + return child(element, element.dom.childNodes.length - 1); + }; + var childNodesCount = function (element) { + return element.dom.childNodes.length; + }; + + var getHead = function (doc) { + var b = doc.dom.head; + if (b === null || b === undefined) { + throw new Error('Head is not available yet'); + } + return SugarElement.fromDom(b); + }; + + var isShadowRoot = function (dos) { + return isDocumentFragment(dos); + }; + var supported = isFunction(Element.prototype.attachShadow) && isFunction(Node.prototype.getRootNode); + var isSupported = constant(supported); + var getRootNode = supported ? function (e) { + return SugarElement.fromDom(e.dom.getRootNode()); + } : documentOrOwner; + var getStyleContainer = function (dos) { + return isShadowRoot(dos) ? dos : getHead(documentOrOwner(dos)); + }; + var getShadowRoot = function (e) { + var r = getRootNode(e); + return isShadowRoot(r) ? Optional.some(r) : Optional.none(); + }; + var getShadowHost = function (e) { + return SugarElement.fromDom(e.dom.host); + }; + var getOriginalEventTarget = function (event) { + if (isSupported() && isNonNullable(event.target)) { + var el = SugarElement.fromDom(event.target); + if (isElement(el) && isOpenShadowHost(el)) { + if (event.composed && event.composedPath) { + var composedPath = event.composedPath(); + if (composedPath) { + return head(composedPath); + } + } + } + } + return Optional.from(event.target); + }; + var isOpenShadowHost = function (element) { + return isNonNullable(element.dom.shadowRoot); + }; + + var before = function (marker, element) { + var parent$1 = parent(marker); + parent$1.each(function (v) { + v.dom.insertBefore(element.dom, marker.dom); + }); + }; + var after = function (marker, element) { + var sibling = nextSibling(marker); + sibling.fold(function () { + var parent$1 = parent(marker); + parent$1.each(function (v) { + append(v, element); + }); + }, function (v) { + before(v, element); + }); + }; + var prepend = function (parent, element) { + var firstChild$1 = firstChild(parent); + firstChild$1.fold(function () { + append(parent, element); + }, function (v) { + parent.dom.insertBefore(element.dom, v.dom); + }); + }; + var append = function (parent, element) { + parent.dom.appendChild(element.dom); + }; + var wrap = function (element, wrapper) { + before(element, wrapper); + append(wrapper, element); + }; + + var before$1 = function (marker, elements) { + each(elements, function (x) { + before(marker, x); + }); + }; + var append$1 = function (parent, elements) { + each(elements, function (x) { + append(parent, x); + }); + }; + + var empty = function (element) { + element.dom.textContent = ''; + each(children(element), function (rogue) { + remove(rogue); + }); + }; + var remove = function (element) { + var dom = element.dom; + if (dom.parentNode !== null) { + dom.parentNode.removeChild(dom); + } + }; + var unwrap = function (wrapper) { + var children$1 = children(wrapper); + if (children$1.length > 0) { + before$1(wrapper, children$1); + } + remove(wrapper); + }; + + var inBody = function (element) { + var dom = isText(element) ? element.dom.parentNode : element.dom; + if (dom === undefined || dom === null || dom.ownerDocument === null) { + return false; + } + var doc = dom.ownerDocument; + return getShadowRoot(SugarElement.fromDom(dom)).fold(function () { + return doc.body.contains(dom); + }, compose1(inBody, getShadowHost)); + }; + + var r = function (left, top) { + var translate = function (x, y) { + return r(left + x, top + y); + }; + return { + left: left, + top: top, + translate: translate + }; + }; + var SugarPosition = r; + + var boxPosition = function (dom) { + var box = dom.getBoundingClientRect(); + return SugarPosition(box.left, box.top); + }; + var firstDefinedOrZero = function (a, b) { + if (a !== undefined) { + return a; + } else { + return b !== undefined ? b : 0; + } + }; + var absolute = function (element) { + var doc = element.dom.ownerDocument; + var body = doc.body; + var win = doc.defaultView; + var html = doc.documentElement; + if (body === element.dom) { + return SugarPosition(body.offsetLeft, body.offsetTop); + } + var scrollTop = firstDefinedOrZero(win === null || win === void 0 ? void 0 : win.pageYOffset, html.scrollTop); + var scrollLeft = firstDefinedOrZero(win === null || win === void 0 ? void 0 : win.pageXOffset, html.scrollLeft); + var clientTop = firstDefinedOrZero(html.clientTop, body.clientTop); + var clientLeft = firstDefinedOrZero(html.clientLeft, body.clientLeft); + return viewport(element).translate(scrollLeft - clientLeft, scrollTop - clientTop); + }; + var viewport = function (element) { + var dom = element.dom; + var doc = dom.ownerDocument; + var body = doc.body; + if (body === dom) { + return SugarPosition(body.offsetLeft, body.offsetTop); + } + if (!inBody(element)) { + return SugarPosition(0, 0); + } + return boxPosition(dom); + }; + + var get$1 = function (_DOC) { + var doc = _DOC !== undefined ? _DOC.dom : document; + var x = doc.body.scrollLeft || doc.documentElement.scrollLeft; + var y = doc.body.scrollTop || doc.documentElement.scrollTop; + return SugarPosition(x, y); + }; + var to = function (x, y, _DOC) { + var doc = _DOC !== undefined ? _DOC.dom : document; + var win = doc.defaultView; + if (win) { + win.scrollTo(x, y); + } + }; + var intoView = function (element, alignToTop) { + var isSafari = detect$3().browser.isSafari(); + if (isSafari && isFunction(element.dom.scrollIntoViewIfNeeded)) { + element.dom.scrollIntoViewIfNeeded(false); + } else { + element.dom.scrollIntoView(alignToTop); + } + }; + + var get$2 = function (_win) { + var win = _win === undefined ? window : _win; + return Optional.from(win['visualViewport']); + }; + var bounds = function (x, y, width, height) { + return { + x: x, + y: y, + width: width, + height: height, + right: x + width, + bottom: y + height + }; + }; + var getBounds = function (_win) { + var win = _win === undefined ? window : _win; + var doc = win.document; + var scroll = get$1(SugarElement.fromDom(doc)); + return get$2(win).fold(function () { + var html = win.document.documentElement; + var width = html.clientWidth; + var height = html.clientHeight; + return bounds(scroll.left, scroll.top, width, height); + }, function (visualViewport) { + return bounds(Math.max(visualViewport.pageLeft, scroll.left), Math.max(visualViewport.pageTop, scroll.top), visualViewport.width, visualViewport.height); + }); + }; + + var isNodeType = function (type) { + return function (node) { + return !!node && node.nodeType === type; + }; + }; + var isRestrictedNode = function (node) { + return !!node && !Object.getPrototypeOf(node); + }; + var isElement$1 = isNodeType(1); + var matchNodeNames = function (names) { + var lowercasedNames = names.map(function (s) { + return s.toLowerCase(); + }); + return function (node) { + if (node && node.nodeName) { + var nodeName = node.nodeName.toLowerCase(); + return contains(lowercasedNames, nodeName); + } + return false; + }; + }; + var matchStyleValues = function (name, values) { + var items = values.toLowerCase().split(' '); + return function (node) { + var i, cssValue; + if (isElement$1(node)) { + for (i = 0; i < items.length; i++) { + var computed = node.ownerDocument.defaultView.getComputedStyle(node, null); + cssValue = computed ? computed.getPropertyValue(name) : null; + if (cssValue === items[i]) { + return true; + } + } + } + return false; + }; + }; + var hasAttribute = function (attrName) { + return function (node) { + return isElement$1(node) && node.hasAttribute(attrName); + }; + }; + var hasAttributeValue = function (attrName, attrValue) { + return function (node) { + return isElement$1(node) && node.getAttribute(attrName) === attrValue; + }; + }; + var isBogus = function (node) { + return isElement$1(node) && node.hasAttribute('data-mce-bogus'); + }; + var isBogusAll = function (node) { + return isElement$1(node) && node.getAttribute('data-mce-bogus') === 'all'; + }; + var isTable = function (node) { + return isElement$1(node) && node.tagName === 'TABLE'; + }; + var hasContentEditableState = function (value) { + return function (node) { + if (isElement$1(node)) { + if (node.contentEditable === value) { + return true; + } + if (node.getAttribute('data-mce-contenteditable') === value) { + return true; + } + } + return false; + }; + }; + var isTextareaOrInput = matchNodeNames([ + 'textarea', + 'input' + ]); + var isText$1 = isNodeType(3); + var isComment$1 = isNodeType(8); + var isDocument$1 = isNodeType(9); + var isDocumentFragment$1 = isNodeType(11); + var isBr = matchNodeNames(['br']); + var isImg = matchNodeNames(['img']); + var isContentEditableTrue = hasContentEditableState('true'); + var isContentEditableFalse = hasContentEditableState('false'); + var isTableCell = matchNodeNames([ + 'td', + 'th' + ]); + var isMedia = matchNodeNames([ + 'video', + 'audio', + 'object', + 'embed' + ]); + + var isSupported$1 = function (dom) { + return dom.style !== undefined && isFunction(dom.style.getPropertyValue); + }; + + var rawSet = function (dom, key, value) { + if (isString(value) || isBoolean(value) || isNumber(value)) { + dom.setAttribute(key, value + ''); + } else { + console.error('Invalid call to Attribute.set. Key ', key, ':: Value ', value, ':: Element ', dom); + throw new Error('Attribute value was not simple'); + } + }; + var set = function (element, key, value) { + rawSet(element.dom, key, value); + }; + var setAll = function (element, attrs) { + var dom = element.dom; + each$1(attrs, function (v, k) { + rawSet(dom, k, v); + }); + }; + var get$3 = function (element, key) { + var v = element.dom.getAttribute(key); + return v === null ? undefined : v; + }; + var getOpt = function (element, key) { + return Optional.from(get$3(element, key)); + }; + var has$1 = function (element, key) { + var dom = element.dom; + return dom && dom.hasAttribute ? dom.hasAttribute(key) : false; + }; + var remove$1 = function (element, key) { + element.dom.removeAttribute(key); + }; + var clone = function (element) { + return foldl(element.dom.attributes, function (acc, attr) { + acc[attr.name] = attr.value; + return acc; + }, {}); + }; + + var internalSet = function (dom, property, value) { + if (!isString(value)) { + console.error('Invalid call to CSS.set. Property ', property, ':: Value ', value, ':: Element ', dom); + throw new Error('CSS value must be a string: ' + value); + } + if (isSupported$1(dom)) { + dom.style.setProperty(property, value); + } + }; + var setAll$1 = function (element, css) { + var dom = element.dom; + each$1(css, function (v, k) { + internalSet(dom, k, v); + }); + }; + var get$4 = function (element, property) { + var dom = element.dom; + var styles = window.getComputedStyle(dom); + var r = styles.getPropertyValue(property); + return r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r; + }; + var getUnsafeProperty = function (dom, property) { + return isSupported$1(dom) ? dom.style.getPropertyValue(property) : ''; + }; + var getRaw = function (element, property) { + var dom = element.dom; + var raw = getUnsafeProperty(dom, property); + return Optional.from(raw).filter(function (r) { + return r.length > 0; + }); + }; + var getAllRaw = function (element) { + var css = {}; + var dom = element.dom; + if (isSupported$1(dom)) { + for (var i = 0; i < dom.style.length; i++) { + var ruleName = dom.style.item(i); + css[ruleName] = dom.style[ruleName]; + } + } + return css; + }; + var reflow = function (e) { + return e.dom.offsetWidth; + }; + + var browser$1 = detect$3().browser; + var firstElement = function (nodes) { + return find(nodes, isElement); + }; + var getTableCaptionDeltaY = function (elm) { + if (browser$1.isFirefox() && name(elm) === 'table') { + return firstElement(children(elm)).filter(function (elm) { + return name(elm) === 'caption'; + }).bind(function (caption) { + return firstElement(nextSiblings(caption)).map(function (body) { + var bodyTop = body.dom.offsetTop; + var captionTop = caption.dom.offsetTop; + var captionHeight = caption.dom.offsetHeight; + return bodyTop <= captionTop ? -captionHeight : 0; + }); + }).getOr(0); + } else { + return 0; + } + }; + var hasChild = function (elm, child) { + return elm.children && contains(elm.children, child); + }; + var getPos = function (body, elm, rootElm) { + var x = 0, y = 0, offsetParent; + var doc = body.ownerDocument; + var pos; + rootElm = rootElm ? rootElm : body; + if (elm) { + if (rootElm === body && elm.getBoundingClientRect && get$4(SugarElement.fromDom(body), 'position') === 'static') { + pos = elm.getBoundingClientRect(); + x = pos.left + (doc.documentElement.scrollLeft || body.scrollLeft) - doc.documentElement.clientLeft; + y = pos.top + (doc.documentElement.scrollTop || body.scrollTop) - doc.documentElement.clientTop; + return { + x: x, + y: y + }; + } + offsetParent = elm; + while (offsetParent && offsetParent !== rootElm && offsetParent.nodeType && !hasChild(offsetParent, rootElm)) { + x += offsetParent.offsetLeft || 0; + y += offsetParent.offsetTop || 0; + offsetParent = offsetParent.offsetParent; + } + offsetParent = elm.parentNode; + while (offsetParent && offsetParent !== rootElm && offsetParent.nodeType && !hasChild(offsetParent, rootElm)) { + x -= offsetParent.scrollLeft || 0; + y -= offsetParent.scrollTop || 0; + offsetParent = offsetParent.parentNode; + } + y += getTableCaptionDeltaY(SugarElement.fromDom(elm)); + } + return { + x: x, + y: y + }; + }; + + var exports$1 = {}, module$1 = { exports: exports$1 }; + (function (define, exports, module, require) { + (function (f) { + if (typeof exports === 'object' && typeof module !== 'undefined') { + module.exports = f(); + } else if (typeof define === 'function' && define.amd) { + define([], f); + } else { + var g; + if (typeof window !== 'undefined') { + g = window; + } else if (typeof global !== 'undefined') { + g = global; + } else if (typeof self !== 'undefined') { + g = self; + } else { + g = this; + } + g.EphoxContactWrapper = f(); + } + }(function () { + return function () { + function r(e, n, t) { + function o(i, f) { + if (!n[i]) { + if (!e[i]) { + var c = 'function' == typeof require && require; + if (!f && c) + return c(i, !0); + if (u) + return u(i, !0); + var a = new Error('Cannot find module \'' + i + '\''); + throw a.code = 'MODULE_NOT_FOUND', a; + } + var p = n[i] = { exports: {} }; + e[i][0].call(p.exports, function (r) { + var n = e[i][1][r]; + return o(n || r); + }, p, p.exports, r, e, n, t); + } + return n[i].exports; + } + for (var u = 'function' == typeof require && require, i = 0; i < t.length; i++) + o(t[i]); + return o; + } + return r; + }()({ + 1: [ + function (require, module, exports) { + var process = module.exports = {}; + var cachedSetTimeout; + var cachedClearTimeout; + function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); + } + function defaultClearTimeout() { + throw new Error('clearTimeout has not been defined'); + } + (function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } + }()); + function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + return setTimeout(fun, 0); + } + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + return cachedSetTimeout(fun, 0); + } catch (e) { + try { + return cachedSetTimeout.call(null, fun, 0); + } catch (e) { + return cachedSetTimeout.call(this, fun, 0); + } + } + } + function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + return clearTimeout(marker); + } + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + return cachedClearTimeout(marker); + } catch (e) { + try { + return cachedClearTimeout.call(null, marker); + } catch (e) { + return cachedClearTimeout.call(this, marker); + } + } + } + var queue = []; + var draining = false; + var currentQueue; + var queueIndex = -1; + function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } + } + function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + var len = queue.length; + while (len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); + } + process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } + }; + function Item(fun, array) { + this.fun = fun; + this.array = array; + } + Item.prototype.run = function () { + this.fun.apply(null, this.array); + }; + process.title = 'browser'; + process.browser = true; + process.env = {}; + process.argv = []; + process.version = ''; + process.versions = {}; + function noop() { + } + process.on = noop; + process.addListener = noop; + process.once = noop; + process.off = noop; + process.removeListener = noop; + process.removeAllListeners = noop; + process.emit = noop; + process.prependListener = noop; + process.prependOnceListener = noop; + process.listeners = function (name) { + return []; + }; + process.binding = function (name) { + throw new Error('process.binding is not supported'); + }; + process.cwd = function () { + return '/'; + }; + process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); + }; + process.umask = function () { + return 0; + }; + }, + {} + ], + 2: [ + function (require, module, exports) { + (function (setImmediate) { + (function (root) { + var setTimeoutFunc = setTimeout; + function noop() { + } + function bind(fn, thisArg) { + return function () { + fn.apply(thisArg, arguments); + }; + } + function Promise(fn) { + if (typeof this !== 'object') + throw new TypeError('Promises must be constructed via new'); + if (typeof fn !== 'function') + throw new TypeError('not a function'); + this._state = 0; + this._handled = false; + this._value = undefined; + this._deferreds = []; + doResolve(fn, this); + } + function handle(self, deferred) { + while (self._state === 3) { + self = self._value; + } + if (self._state === 0) { + self._deferreds.push(deferred); + return; + } + self._handled = true; + Promise._immediateFn(function () { + var cb = self._state === 1 ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + (self._state === 1 ? resolve : reject)(deferred.promise, self._value); + return; + } + var ret; + try { + ret = cb(self._value); + } catch (e) { + reject(deferred.promise, e); + return; + } + resolve(deferred.promise, ret); + }); + } + function resolve(self, newValue) { + try { + if (newValue === self) + throw new TypeError('A promise cannot be resolved with itself.'); + if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { + var then = newValue.then; + if (newValue instanceof Promise) { + self._state = 3; + self._value = newValue; + finale(self); + return; + } else if (typeof then === 'function') { + doResolve(bind(then, newValue), self); + return; + } + } + self._state = 1; + self._value = newValue; + finale(self); + } catch (e) { + reject(self, e); + } + } + function reject(self, newValue) { + self._state = 2; + self._value = newValue; + finale(self); + } + function finale(self) { + if (self._state === 2 && self._deferreds.length === 0) { + Promise._immediateFn(function () { + if (!self._handled) { + Promise._unhandledRejectionFn(self._value); + } + }); + } + for (var i = 0, len = self._deferreds.length; i < len; i++) { + handle(self, self._deferreds[i]); + } + self._deferreds = null; + } + function Handler(onFulfilled, onRejected, promise) { + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.promise = promise; + } + function doResolve(fn, self) { + var done = false; + try { + fn(function (value) { + if (done) + return; + done = true; + resolve(self, value); + }, function (reason) { + if (done) + return; + done = true; + reject(self, reason); + }); + } catch (ex) { + if (done) + return; + done = true; + reject(self, ex); + } + } + Promise.prototype['catch'] = function (onRejected) { + return this.then(null, onRejected); + }; + Promise.prototype.then = function (onFulfilled, onRejected) { + var prom = new this.constructor(noop); + handle(this, new Handler(onFulfilled, onRejected, prom)); + return prom; + }; + Promise.all = function (arr) { + var args = Array.prototype.slice.call(arr); + return new Promise(function (resolve, reject) { + if (args.length === 0) + return resolve([]); + var remaining = args.length; + function res(i, val) { + try { + if (val && (typeof val === 'object' || typeof val === 'function')) { + var then = val.then; + if (typeof then === 'function') { + then.call(val, function (val) { + res(i, val); + }, reject); + return; + } + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } catch (ex) { + reject(ex); + } + } + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); + }; + Promise.resolve = function (value) { + if (value && typeof value === 'object' && value.constructor === Promise) { + return value; + } + return new Promise(function (resolve) { + resolve(value); + }); + }; + Promise.reject = function (value) { + return new Promise(function (resolve, reject) { + reject(value); + }); + }; + Promise.race = function (values) { + return new Promise(function (resolve, reject) { + for (var i = 0, len = values.length; i < len; i++) { + values[i].then(resolve, reject); + } + }); + }; + Promise._immediateFn = typeof setImmediate === 'function' ? function (fn) { + setImmediate(fn); + } : function (fn) { + setTimeoutFunc(fn, 0); + }; + Promise._unhandledRejectionFn = function _unhandledRejectionFn(err) { + if (typeof console !== 'undefined' && console) { + console.warn('Possible Unhandled Promise Rejection:', err); + } + }; + Promise._setImmediateFn = function _setImmediateFn(fn) { + Promise._immediateFn = fn; + }; + Promise._setUnhandledRejectionFn = function _setUnhandledRejectionFn(fn) { + Promise._unhandledRejectionFn = fn; + }; + if (typeof module !== 'undefined' && module.exports) { + module.exports = Promise; + } else if (!root.Promise) { + root.Promise = Promise; + } + }(this)); + }.call(this, require('timers').setImmediate)); + }, + { 'timers': 3 } + ], + 3: [ + function (require, module, exports) { + (function (setImmediate, clearImmediate) { + var nextTick = require('process/browser.js').nextTick; + var apply = Function.prototype.apply; + var slice = Array.prototype.slice; + var immediateIds = {}; + var nextImmediateId = 0; + exports.setTimeout = function () { + return new Timeout(apply.call(setTimeout, window, arguments), clearTimeout); + }; + exports.setInterval = function () { + return new Timeout(apply.call(setInterval, window, arguments), clearInterval); + }; + exports.clearTimeout = exports.clearInterval = function (timeout) { + timeout.close(); + }; + function Timeout(id, clearFn) { + this._id = id; + this._clearFn = clearFn; + } + Timeout.prototype.unref = Timeout.prototype.ref = function () { + }; + Timeout.prototype.close = function () { + this._clearFn.call(window, this._id); + }; + exports.enroll = function (item, msecs) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = msecs; + }; + exports.unenroll = function (item) { + clearTimeout(item._idleTimeoutId); + item._idleTimeout = -1; + }; + exports._unrefActive = exports.active = function (item) { + clearTimeout(item._idleTimeoutId); + var msecs = item._idleTimeout; + if (msecs >= 0) { + item._idleTimeoutId = setTimeout(function onTimeout() { + if (item._onTimeout) + item._onTimeout(); + }, msecs); + } + }; + exports.setImmediate = typeof setImmediate === 'function' ? setImmediate : function (fn) { + var id = nextImmediateId++; + var args = arguments.length < 2 ? false : slice.call(arguments, 1); + immediateIds[id] = true; + nextTick(function onNextTick() { + if (immediateIds[id]) { + if (args) { + fn.apply(null, args); + } else { + fn.call(null); + } + exports.clearImmediate(id); + } + }); + return id; + }; + exports.clearImmediate = typeof clearImmediate === 'function' ? clearImmediate : function (id) { + delete immediateIds[id]; + }; + }.call(this, require('timers').setImmediate, require('timers').clearImmediate)); + }, + { + 'process/browser.js': 1, + 'timers': 3 + } + ], + 4: [ + function (require, module, exports) { + var promisePolyfill = require('promise-polyfill'); + var Global = function () { + if (typeof window !== 'undefined') { + return window; + } else { + return Function('return this;')(); + } + }(); + module.exports = { boltExport: Global.Promise || promisePolyfill }; + }, + { 'promise-polyfill': 2 } + ] + }, {}, [4])(4); + })); + }(undefined, exports$1, module$1, undefined)); + var Promise = module$1.exports.boltExport; + + var nu$3 = function (baseFn) { + var data = Optional.none(); + var callbacks = []; + var map = function (f) { + return nu$3(function (nCallback) { + get(function (data) { + nCallback(f(data)); + }); + }); + }; + var get = function (nCallback) { + if (isReady()) { + call(nCallback); + } else { + callbacks.push(nCallback); + } + }; + var set = function (x) { + if (!isReady()) { + data = Optional.some(x); + run(callbacks); + callbacks = []; + } + }; + var isReady = function () { + return data.isSome(); + }; + var run = function (cbs) { + each(cbs, call); + }; + var call = function (cb) { + data.each(function (x) { + setTimeout(function () { + cb(x); + }, 0); + }); + }; + baseFn(set); + return { + get: get, + map: map, + isReady: isReady + }; + }; + var pure = function (a) { + return nu$3(function (callback) { + callback(a); + }); + }; + var LazyValue = { + nu: nu$3, + pure: pure + }; + + var errorReporter = function (err) { + setTimeout(function () { + throw err; + }, 0); + }; + var make = function (run) { + var get = function (callback) { + run().then(callback, errorReporter); + }; + var map = function (fab) { + return make(function () { + return run().then(fab); + }); + }; + var bind = function (aFutureB) { + return make(function () { + return run().then(function (v) { + return aFutureB(v).toPromise(); + }); + }); + }; + var anonBind = function (futureB) { + return make(function () { + return run().then(function () { + return futureB.toPromise(); + }); + }); + }; + var toLazy = function () { + return LazyValue.nu(get); + }; + var toCached = function () { + var cache = null; + return make(function () { + if (cache === null) { + cache = run(); + } + return cache; + }); + }; + var toPromise = run; + return { + map: map, + bind: bind, + anonBind: anonBind, + toLazy: toLazy, + toCached: toCached, + toPromise: toPromise, + get: get + }; + }; + var nu$4 = function (baseFn) { + return make(function () { + return new Promise(baseFn); + }); + }; + var pure$1 = function (a) { + return make(function () { + return Promise.resolve(a); + }); + }; + var Future = { + nu: nu$4, + pure: pure$1 + }; + + var par = function (asyncValues, nu) { + return nu(function (callback) { + var r = []; + var count = 0; + var cb = function (i) { + return function (value) { + r[i] = value; + count++; + if (count >= asyncValues.length) { + callback(r); + } + }; + }; + if (asyncValues.length === 0) { + callback([]); + } else { + each(asyncValues, function (asyncValue, i) { + asyncValue.get(cb(i)); + }); + } + }); + }; + + var par$1 = function (futures) { + return par(futures, Future.nu); + }; + + var value = function (o) { + var is = function (v) { + return o === v; + }; + var or = function (_opt) { + return value(o); + }; + var orThunk = function (_f) { + return value(o); + }; + var map = function (f) { + return value(f(o)); + }; + var mapError = function (_f) { + return value(o); + }; + var each = function (f) { + f(o); + }; + var bind = function (f) { + return f(o); + }; + var fold = function (_, onValue) { + return onValue(o); + }; + var exists = function (f) { + return f(o); + }; + var forall = function (f) { + return f(o); + }; + var toOptional = function () { + return Optional.some(o); + }; + return { + is: is, + isValue: always, + isError: never, + getOr: constant(o), + getOrThunk: constant(o), + getOrDie: constant(o), + or: or, + orThunk: orThunk, + fold: fold, + map: map, + mapError: mapError, + each: each, + bind: bind, + exists: exists, + forall: forall, + toOptional: toOptional + }; + }; + var error = function (message) { + var getOrThunk = function (f) { + return f(); + }; + var getOrDie = function () { + return die(String(message))(); + }; + var or = function (opt) { + return opt; + }; + var orThunk = function (f) { + return f(); + }; + var map = function (_f) { + return error(message); + }; + var mapError = function (f) { + return error(f(message)); + }; + var bind = function (_f) { + return error(message); + }; + var fold = function (onError, _) { + return onError(message); + }; + return { + is: never, + isValue: never, + isError: always, + getOr: identity, + getOrThunk: getOrThunk, + getOrDie: getOrDie, + or: or, + orThunk: orThunk, + fold: fold, + map: map, + mapError: mapError, + each: noop, + bind: bind, + exists: never, + forall: always, + toOptional: Optional.none + }; + }; + var fromOption = function (opt, err) { + return opt.fold(function () { + return error(err); + }, value); + }; + var Result = { + value: value, + error: error, + fromOption: fromOption + }; + + var generate = function (cases) { + if (!isArray(cases)) { + throw new Error('cases must be an array'); + } + if (cases.length === 0) { + throw new Error('there must be at least one case'); + } + var constructors = []; + var adt = {}; + each(cases, function (acase, count) { + var keys$1 = keys(acase); + if (keys$1.length !== 1) { + throw new Error('one and only one name per case'); + } + var key = keys$1[0]; + var value = acase[key]; + if (adt[key] !== undefined) { + throw new Error('duplicate key detected:' + key); + } else if (key === 'cata') { + throw new Error('cannot have a case named cata (sorry)'); + } else if (!isArray(value)) { + throw new Error('case arguments must be an array'); + } + constructors.push(key); + adt[key] = function () { + var argLength = arguments.length; + if (argLength !== value.length) { + throw new Error('Wrong number of arguments to case ' + key + '. Expected ' + value.length + ' (' + value + '), got ' + argLength); + } + var args = new Array(argLength); + for (var i = 0; i < args.length; i++) { + args[i] = arguments[i]; + } + var match = function (branches) { + var branchKeys = keys(branches); + if (constructors.length !== branchKeys.length) { + throw new Error('Wrong number of arguments to match. Expected: ' + constructors.join(',') + '\nActual: ' + branchKeys.join(',')); + } + var allReqd = forall(constructors, function (reqKey) { + return contains(branchKeys, reqKey); + }); + if (!allReqd) { + throw new Error('Not all branches were specified when using match. Specified: ' + branchKeys.join(', ') + '\nRequired: ' + constructors.join(', ')); + } + return branches[key].apply(null, args); + }; + return { + fold: function () { + if (arguments.length !== cases.length) { + throw new Error('Wrong number of arguments to fold. Expected ' + cases.length + ', got ' + arguments.length); + } + var target = arguments[count]; + return target.apply(null, args); + }, + match: match, + log: function (label) { + console.log(label, { + constructors: constructors, + constructor: key, + params: args + }); + } + }; + }; + }); + return adt; + }; + var Adt = { generate: generate }; + + var comparison = Adt.generate([ + { + bothErrors: [ + 'error1', + 'error2' + ] + }, + { + firstError: [ + 'error1', + 'value2' + ] + }, + { + secondError: [ + 'value1', + 'error2' + ] + }, + { + bothValues: [ + 'value1', + 'value2' + ] + } + ]); + var unite = function (result) { + return result.fold(identity, identity); + }; + + function ClosestOrAncestor (is, ancestor, scope, a, isRoot) { + return is(scope, a) ? Optional.some(scope) : isFunction(isRoot) && isRoot(scope) ? Optional.none() : ancestor(scope, a, isRoot); + } + + var ancestor = function (scope, predicate, isRoot) { + var element = scope.dom; + var stop = isFunction(isRoot) ? isRoot : never; + while (element.parentNode) { + element = element.parentNode; + var el = SugarElement.fromDom(element); + if (predicate(el)) { + return Optional.some(el); + } else if (stop(el)) { + break; + } + } + return Optional.none(); + }; + var closest = function (scope, predicate, isRoot) { + var is = function (s, test) { + return test(s); + }; + return ClosestOrAncestor(is, ancestor, scope, predicate, isRoot); + }; + + var ancestor$1 = function (scope, selector, isRoot) { + return ancestor(scope, function (e) { + return is$1(e, selector); + }, isRoot); + }; + var descendant = function (scope, selector) { + return one(selector, scope); + }; + var closest$1 = function (scope, selector, isRoot) { + var is = function (element, selector) { + return is$1(element, selector); + }; + return ClosestOrAncestor(is, ancestor$1, scope, selector, isRoot); + }; + + var promise = function () { + function bind(fn, thisArg) { + return function () { + fn.apply(thisArg, arguments); + }; + } + var isArray = Array.isArray || function (value) { + return Object.prototype.toString.call(value) === '[object Array]'; + }; + var Promise = function (fn) { + if (typeof this !== 'object') { + throw new TypeError('Promises must be constructed via new'); + } + if (typeof fn !== 'function') { + throw new TypeError('not a function'); + } + this._state = null; + this._value = null; + this._deferreds = []; + doResolve(fn, bind(resolve, this), bind(reject, this)); + }; + var asap = Promise.immediateFn || typeof setImmediate === 'function' && setImmediate || function (fn) { + setTimeout(fn, 1); + }; + function handle(deferred) { + var me = this; + if (this._state === null) { + this._deferreds.push(deferred); + return; + } + asap(function () { + var cb = me._state ? deferred.onFulfilled : deferred.onRejected; + if (cb === null) { + (me._state ? deferred.resolve : deferred.reject)(me._value); + return; + } + var ret; + try { + ret = cb(me._value); + } catch (e) { + deferred.reject(e); + return; + } + deferred.resolve(ret); + }); + } + function resolve(newValue) { + try { + if (newValue === this) { + throw new TypeError('A promise cannot be resolved with itself.'); + } + if (newValue && (typeof newValue === 'object' || typeof newValue === 'function')) { + var then = newValue.then; + if (typeof then === 'function') { + doResolve(bind(then, newValue), bind(resolve, this), bind(reject, this)); + return; + } + } + this._state = true; + this._value = newValue; + finale.call(this); + } catch (e) { + reject.call(this, e); + } + } + function reject(newValue) { + this._state = false; + this._value = newValue; + finale.call(this); + } + function finale() { + for (var i = 0, len = this._deferreds.length; i < len; i++) { + handle.call(this, this._deferreds[i]); + } + this._deferreds = null; + } + function Handler(onFulfilled, onRejected, resolve, reject) { + this.onFulfilled = typeof onFulfilled === 'function' ? onFulfilled : null; + this.onRejected = typeof onRejected === 'function' ? onRejected : null; + this.resolve = resolve; + this.reject = reject; + } + function doResolve(fn, onFulfilled, onRejected) { + var done = false; + try { + fn(function (value) { + if (done) { + return; + } + done = true; + onFulfilled(value); + }, function (reason) { + if (done) { + return; + } + done = true; + onRejected(reason); + }); + } catch (ex) { + if (done) { + return; + } + done = true; + onRejected(ex); + } + } + Promise.prototype.catch = function (onRejected) { + return this.then(null, onRejected); + }; + Promise.prototype.then = function (onFulfilled, onRejected) { + var me = this; + return new Promise(function (resolve, reject) { + handle.call(me, new Handler(onFulfilled, onRejected, resolve, reject)); + }); + }; + Promise.all = function () { + var args = Array.prototype.slice.call(arguments.length === 1 && isArray(arguments[0]) ? arguments[0] : arguments); + return new Promise(function (resolve, reject) { + if (args.length === 0) { + return resolve([]); + } + var remaining = args.length; + function res(i, val) { + try { + if (val && (typeof val === 'object' || typeof val === 'function')) { + var then = val.then; + if (typeof then === 'function') { + then.call(val, function (val) { + res(i, val); + }, reject); + return; + } + } + args[i] = val; + if (--remaining === 0) { + resolve(args); + } + } catch (ex) { + reject(ex); + } + } + for (var i = 0; i < args.length; i++) { + res(i, args[i]); + } + }); + }; + Promise.resolve = function (value) { + if (value && typeof value === 'object' && value.constructor === Promise) { + return value; + } + return new Promise(function (resolve) { + resolve(value); + }); + }; + Promise.reject = function (value) { + return new Promise(function (resolve, reject) { + reject(value); + }); + }; + Promise.race = function (values) { + return new Promise(function (resolve, reject) { + for (var i = 0, len = values.length; i < len; i++) { + values[i].then(resolve, reject); + } + }); + }; + return Promise; + }; + var promiseObj = window.Promise ? window.Promise : promise(); + + var requestAnimationFramePromise; + var requestAnimationFrame = function (callback, element) { + var i, requestAnimationFrameFunc = window.requestAnimationFrame; + var vendors = [ + 'ms', + 'moz', + 'webkit' + ]; + var featurefill = function (callback) { + window.setTimeout(callback, 0); + }; + for (i = 0; i < vendors.length && !requestAnimationFrameFunc; i++) { + requestAnimationFrameFunc = window[vendors[i] + 'RequestAnimationFrame']; + } + if (!requestAnimationFrameFunc) { + requestAnimationFrameFunc = featurefill; + } + requestAnimationFrameFunc(callback, element); + }; + var wrappedSetTimeout = function (callback, time) { + if (typeof time !== 'number') { + time = 0; + } + return setTimeout(callback, time); + }; + var wrappedSetInterval = function (callback, time) { + if (typeof time !== 'number') { + time = 1; + } + return setInterval(callback, time); + }; + var wrappedClearTimeout = function (id) { + return clearTimeout(id); + }; + var wrappedClearInterval = function (id) { + return clearInterval(id); + }; + var debounce = function (callback, time) { + var timer; + var func = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + clearTimeout(timer); + timer = wrappedSetTimeout(function () { + callback.apply(this, args); + }, time); + }; + func.stop = function () { + clearTimeout(timer); + }; + return func; + }; + var Delay = { + requestAnimationFrame: function (callback, element) { + if (requestAnimationFramePromise) { + requestAnimationFramePromise.then(callback); + return; + } + requestAnimationFramePromise = new promiseObj(function (resolve) { + if (!element) { + element = document.body; + } + requestAnimationFrame(resolve, element); + }).then(callback); + }, + setTimeout: wrappedSetTimeout, + setInterval: wrappedSetInterval, + setEditorTimeout: function (editor, callback, time) { + return wrappedSetTimeout(function () { + if (!editor.removed) { + callback(); + } + }, time); + }, + setEditorInterval: function (editor, callback, time) { + var timer = wrappedSetInterval(function () { + if (!editor.removed) { + callback(); + } else { + clearInterval(timer); + } + }, time); + return timer; + }, + debounce: debounce, + throttle: debounce, + clearInterval: wrappedClearInterval, + clearTimeout: wrappedClearTimeout + }; + + function StyleSheetLoader(documentOrShadowRoot, settings) { + if (settings === void 0) { + settings = {}; + } + var idCount = 0; + var loadedStates = {}; + var edos = SugarElement.fromDom(documentOrShadowRoot); + var doc = documentOrOwner(edos); + var maxLoadTime = settings.maxLoadTime || 5000; + var _setReferrerPolicy = function (referrerPolicy) { + settings.referrerPolicy = referrerPolicy; + }; + var addStyle = function (element) { + append(getStyleContainer(edos), element); + }; + var removeStyle = function (id) { + var styleContainer = getStyleContainer(edos); + descendant(styleContainer, '#' + id).each(remove); + }; + var getOrCreateState = function (url) { + return get(loadedStates, url).getOrThunk(function () { + return { + id: 'mce-u' + idCount++, + passed: [], + failed: [], + count: 0 + }; + }); + }; + var load = function (url, success, failure) { + var link; + var urlWithSuffix = Tools._addCacheSuffix(url); + var state = getOrCreateState(urlWithSuffix); + loadedStates[urlWithSuffix] = state; + state.count++; + var resolve = function (callbacks, status) { + var i = callbacks.length; + while (i--) { + callbacks[i](); + } + state.status = status; + state.passed = []; + state.failed = []; + if (link) { + link.onload = null; + link.onerror = null; + link = null; + } + }; + var passed = function () { + return resolve(state.passed, 2); + }; + var failed = function () { + return resolve(state.failed, 3); + }; + var wait = function (testCallback, waitCallback) { + if (!testCallback()) { + if (Date.now() - startTime < maxLoadTime) { + Delay.setTimeout(waitCallback); + } else { + failed(); + } + } + }; + var waitForWebKitLinkLoaded = function () { + wait(function () { + var styleSheets = documentOrShadowRoot.styleSheets; + var i = styleSheets.length; + while (i--) { + var styleSheet = styleSheets[i]; + var owner = styleSheet.ownerNode; + if (owner && owner.id === link.id) { + passed(); + return true; + } + } + return false; + }, waitForWebKitLinkLoaded); + }; + if (success) { + state.passed.push(success); + } + if (failure) { + state.failed.push(failure); + } + if (state.status === 1) { + return; + } + if (state.status === 2) { + passed(); + return; + } + if (state.status === 3) { + failed(); + return; + } + state.status = 1; + var linkElem = SugarElement.fromTag('link', doc.dom); + setAll(linkElem, { + rel: 'stylesheet', + type: 'text/css', + id: state.id + }); + var startTime = Date.now(); + if (settings.contentCssCors) { + set(linkElem, 'crossOrigin', 'anonymous'); + } + if (settings.referrerPolicy) { + set(linkElem, 'referrerpolicy', settings.referrerPolicy); + } + link = linkElem.dom; + link.onload = waitForWebKitLinkLoaded; + link.onerror = failed; + addStyle(linkElem); + set(linkElem, 'href', urlWithSuffix); + }; + var loadF = function (url) { + return Future.nu(function (resolve) { + load(url, compose(resolve, constant(Result.value(url))), compose(resolve, constant(Result.error(url)))); + }); + }; + var loadAll = function (urls, success, failure) { + par$1(map(urls, loadF)).get(function (result) { + var parts = partition(result, function (r) { + return r.isValue(); + }); + if (parts.fail.length > 0) { + failure(parts.fail.map(unite)); + } else { + success(parts.pass.map(unite)); + } + }); + }; + var unload = function (url) { + var urlWithSuffix = Tools._addCacheSuffix(url); + get(loadedStates, urlWithSuffix).each(function (state) { + var count = --state.count; + if (count === 0) { + delete loadedStates[urlWithSuffix]; + removeStyle(state.id); + } + }); + }; + var unloadAll = function (urls) { + each(urls, function (url) { + unload(url); + }); + }; + return { + load: load, + loadAll: loadAll, + unload: unload, + unloadAll: unloadAll, + _setReferrerPolicy: _setReferrerPolicy + }; + } + + var create$1 = function () { + var map = new WeakMap(); + var forElement = function (referenceElement, settings) { + var root = getRootNode(referenceElement); + var rootDom = root.dom; + return Optional.from(map.get(rootDom)).getOrThunk(function () { + var sl = StyleSheetLoader(rootDom, settings); + map.set(rootDom, sl); + return sl; + }); + }; + return { forElement: forElement }; + }; + var instance = create$1(); + + var DomTreeWalker = function () { + function DomTreeWalker(startNode, rootNode) { + this.node = startNode; + this.rootNode = rootNode; + this.current = this.current.bind(this); + this.next = this.next.bind(this); + this.prev = this.prev.bind(this); + this.prev2 = this.prev2.bind(this); + } + DomTreeWalker.prototype.current = function () { + return this.node; + }; + DomTreeWalker.prototype.next = function (shallow) { + this.node = this.findSibling(this.node, 'firstChild', 'nextSibling', shallow); + return this.node; + }; + DomTreeWalker.prototype.prev = function (shallow) { + this.node = this.findSibling(this.node, 'lastChild', 'previousSibling', shallow); + return this.node; + }; + DomTreeWalker.prototype.prev2 = function (shallow) { + this.node = this.findPreviousNode(this.node, 'lastChild', 'previousSibling', shallow); + return this.node; + }; + DomTreeWalker.prototype.findSibling = function (node, startName, siblingName, shallow) { + var sibling, parent; + if (node) { + if (!shallow && node[startName]) { + return node[startName]; + } + if (node !== this.rootNode) { + sibling = node[siblingName]; + if (sibling) { + return sibling; + } + for (parent = node.parentNode; parent && parent !== this.rootNode; parent = parent.parentNode) { + sibling = parent[siblingName]; + if (sibling) { + return sibling; + } + } + } + } + }; + DomTreeWalker.prototype.findPreviousNode = function (node, startName, siblingName, shallow) { + var sibling, parent, child; + if (node) { + sibling = node[siblingName]; + if (this.rootNode && sibling === this.rootNode) { + return; + } + if (sibling) { + if (!shallow) { + for (child = sibling[startName]; child; child = child[startName]) { + if (!child[startName]) { + return child; + } + } + } + return sibling; + } + parent = node.parentNode; + if (parent && parent !== this.rootNode) { + return parent; + } + } + }; + return DomTreeWalker; + }(); + + var blocks = [ + 'article', + 'aside', + 'details', + 'div', + 'dt', + 'figcaption', + 'footer', + 'form', + 'fieldset', + 'header', + 'hgroup', + 'html', + 'main', + 'nav', + 'section', + 'summary', + 'body', + 'p', + 'dl', + 'multicol', + 'dd', + 'figure', + 'address', + 'center', + 'blockquote', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'listing', + 'xmp', + 'pre', + 'plaintext', + 'menu', + 'dir', + 'ul', + 'ol', + 'li', + 'hr', + 'table', + 'tbody', + 'thead', + 'tfoot', + 'th', + 'tr', + 'td', + 'caption' + ]; + var tableCells = [ + 'td', + 'th' + ]; + var tableSections = [ + 'thead', + 'tbody', + 'tfoot' + ]; + var textBlocks = [ + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6', + 'p', + 'div', + 'address', + 'pre', + 'form', + 'blockquote', + 'center', + 'dir', + 'fieldset', + 'header', + 'footer', + 'article', + 'section', + 'hgroup', + 'aside', + 'nav', + 'figure' + ]; + var headings = [ + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6' + ]; + var listItems = [ + 'li', + 'dd', + 'dt' + ]; + var lists = [ + 'ul', + 'ol', + 'dl' + ]; + var wsElements = [ + 'pre', + 'script', + 'textarea', + 'style' + ]; + var lazyLookup = function (items) { + var lookup; + return function (node) { + lookup = lookup ? lookup : mapToObject(items, always); + return lookup.hasOwnProperty(name(node)); + }; + }; + var isHeading = lazyLookup(headings); + var isBlock = lazyLookup(blocks); + var isTable$1 = function (node) { + return name(node) === 'table'; + }; + var isInline = function (node) { + return isElement(node) && !isBlock(node); + }; + var isBr$1 = function (node) { + return isElement(node) && name(node) === 'br'; + }; + var isTextBlock = lazyLookup(textBlocks); + var isList = lazyLookup(lists); + var isListItem = lazyLookup(listItems); + var isTableSection = lazyLookup(tableSections); + var isTableCell$1 = lazyLookup(tableCells); + var isWsPreserveElement = lazyLookup(wsElements); + + var ancestor$2 = function (scope, selector, isRoot) { + return ancestor$1(scope, selector, isRoot).isSome(); + }; + + var zeroWidth = '\uFEFF'; + var nbsp = '\xA0'; + var isZwsp = function (char) { + return char === zeroWidth; + }; + var removeZwsp = function (s) { + return s.replace(/\uFEFF/g, ''); + }; + + var ZWSP = zeroWidth; + var isZwsp$1 = isZwsp; + var trim$2 = removeZwsp; + + var isElement$2 = isElement$1; + var isText$2 = isText$1; + var isCaretContainerBlock = function (node) { + if (isText$2(node)) { + node = node.parentNode; + } + return isElement$2(node) && node.hasAttribute('data-mce-caret'); + }; + var isCaretContainerInline = function (node) { + return isText$2(node) && isZwsp$1(node.data); + }; + var isCaretContainer = function (node) { + return isCaretContainerBlock(node) || isCaretContainerInline(node); + }; + var hasContent = function (node) { + return node.firstChild !== node.lastChild || !isBr(node.firstChild); + }; + var insertInline = function (node, before) { + var sibling; + var doc = node.ownerDocument; + var textNode = doc.createTextNode(ZWSP); + var parentNode = node.parentNode; + if (!before) { + sibling = node.nextSibling; + if (isText$2(sibling)) { + if (isCaretContainer(sibling)) { + return sibling; + } + if (startsWithCaretContainer(sibling)) { + sibling.splitText(1); + return sibling; + } + } + if (node.nextSibling) { + parentNode.insertBefore(textNode, node.nextSibling); + } else { + parentNode.appendChild(textNode); + } + } else { + sibling = node.previousSibling; + if (isText$2(sibling)) { + if (isCaretContainer(sibling)) { + return sibling; + } + if (endsWithCaretContainer(sibling)) { + return sibling.splitText(sibling.data.length - 1); + } + } + parentNode.insertBefore(textNode, node); + } + return textNode; + }; + var isBeforeInline = function (pos) { + var container = pos.container(); + if (!isText$1(container)) { + return false; + } + return container.data.charAt(pos.offset()) === ZWSP || pos.isAtStart() && isCaretContainerInline(container.previousSibling); + }; + var isAfterInline = function (pos) { + var container = pos.container(); + if (!isText$1(container)) { + return false; + } + return container.data.charAt(pos.offset() - 1) === ZWSP || pos.isAtEnd() && isCaretContainerInline(container.nextSibling); + }; + var createBogusBr = function () { + var br = document.createElement('br'); + br.setAttribute('data-mce-bogus', '1'); + return br; + }; + var insertBlock = function (blockName, node, before) { + var doc = node.ownerDocument; + var blockNode = doc.createElement(blockName); + blockNode.setAttribute('data-mce-caret', before ? 'before' : 'after'); + blockNode.setAttribute('data-mce-bogus', 'all'); + blockNode.appendChild(createBogusBr()); + var parentNode = node.parentNode; + if (!before) { + if (node.nextSibling) { + parentNode.insertBefore(blockNode, node.nextSibling); + } else { + parentNode.appendChild(blockNode); + } + } else { + parentNode.insertBefore(blockNode, node); + } + return blockNode; + }; + var startsWithCaretContainer = function (node) { + return isText$2(node) && node.data[0] === ZWSP; + }; + var endsWithCaretContainer = function (node) { + return isText$2(node) && node.data[node.data.length - 1] === ZWSP; + }; + var trimBogusBr = function (elm) { + var brs = elm.getElementsByTagName('br'); + var lastBr = brs[brs.length - 1]; + if (isBogus(lastBr)) { + lastBr.parentNode.removeChild(lastBr); + } + }; + var showCaretContainerBlock = function (caretContainer) { + if (caretContainer && caretContainer.hasAttribute('data-mce-caret')) { + trimBogusBr(caretContainer); + caretContainer.removeAttribute('data-mce-caret'); + caretContainer.removeAttribute('data-mce-bogus'); + caretContainer.removeAttribute('style'); + caretContainer.removeAttribute('_moz_abspos'); + return caretContainer; + } + return null; + }; + var isRangeInCaretContainerBlock = function (range) { + return isCaretContainerBlock(range.startContainer); + }; + + var isContentEditableTrue$1 = isContentEditableTrue; + var isContentEditableFalse$1 = isContentEditableFalse; + var isBr$2 = isBr; + var isText$3 = isText$1; + var isInvalidTextElement = matchNodeNames([ + 'script', + 'style', + 'textarea' + ]); + var isAtomicInline = matchNodeNames([ + 'img', + 'input', + 'textarea', + 'hr', + 'iframe', + 'video', + 'audio', + 'object', + 'embed' + ]); + var isTable$2 = matchNodeNames(['table']); + var isCaretContainer$1 = isCaretContainer; + var isCaretCandidate = function (node) { + if (isCaretContainer$1(node)) { + return false; + } + if (isText$3(node)) { + return !isInvalidTextElement(node.parentNode); + } + return isAtomicInline(node) || isBr$2(node) || isTable$2(node) || isNonUiContentEditableFalse(node); + }; + var isUnselectable = function (node) { + return isElement$1(node) && node.getAttribute('unselectable') === 'true'; + }; + var isNonUiContentEditableFalse = function (node) { + return isUnselectable(node) === false && isContentEditableFalse$1(node); + }; + var isInEditable = function (node, root) { + for (node = node.parentNode; node && node !== root; node = node.parentNode) { + if (isNonUiContentEditableFalse(node)) { + return false; + } + if (isContentEditableTrue$1(node)) { + return true; + } + } + return true; + }; + var isAtomicContentEditableFalse = function (node) { + if (!isNonUiContentEditableFalse(node)) { + return false; + } + return foldl(from$1(node.getElementsByTagName('*')), function (result, elm) { + return result || isContentEditableTrue$1(elm); + }, false) !== true; + }; + var isAtomic = function (node) { + return isAtomicInline(node) || isAtomicContentEditableFalse(node); + }; + var isEditableCaretCandidate = function (node, root) { + return isCaretCandidate(node) && isInEditable(node, root); + }; + + var whiteSpaceRegExp$1 = /^[ \t\r\n]*$/; + var isWhitespaceText = function (text) { + return whiteSpaceRegExp$1.test(text); + }; + + var hasWhitespacePreserveParent = function (node, rootNode) { + var rootElement = SugarElement.fromDom(rootNode); + var startNode = SugarElement.fromDom(node); + return ancestor$2(startNode, 'pre,code', curry(eq$2, rootElement)); + }; + var isWhitespace = function (node, rootNode) { + return isText$1(node) && isWhitespaceText(node.data) && hasWhitespacePreserveParent(node, rootNode) === false; + }; + var isNamedAnchor = function (node) { + return isElement$1(node) && node.nodeName === 'A' && !node.hasAttribute('href') && (node.hasAttribute('name') || node.hasAttribute('id')); + }; + var isContent = function (node, rootNode) { + return isCaretCandidate(node) && isWhitespace(node, rootNode) === false || isNamedAnchor(node) || isBookmark(node); + }; + var isBookmark = hasAttribute('data-mce-bookmark'); + var isBogus$1 = hasAttribute('data-mce-bogus'); + var isBogusAll$1 = hasAttributeValue('data-mce-bogus', 'all'); + var isEmptyNode = function (targetNode, skipBogus) { + var node, brCount = 0; + if (isContent(targetNode, targetNode)) { + return false; + } else { + node = targetNode.firstChild; + if (!node) { + return true; + } + var walker = new DomTreeWalker(node, targetNode); + do { + if (skipBogus) { + if (isBogusAll$1(node)) { + node = walker.next(true); + continue; + } + if (isBogus$1(node)) { + node = walker.next(); + continue; + } + } + if (isBr(node)) { + brCount++; + node = walker.next(); + continue; + } + if (isContent(node, targetNode)) { + return false; + } + node = walker.next(); + } while (node); + return brCount <= 1; + } + }; + var isEmpty = function (elm, skipBogus) { + if (skipBogus === void 0) { + skipBogus = true; + } + return isEmptyNode(elm.dom, skipBogus); + }; + + var isSpan = function (node) { + return node.nodeName.toLowerCase() === 'span'; + }; + var isInlineContent = function (node, root) { + return isNonNullable(node) && (isContent(node, root) || isInline(SugarElement.fromDom(node))); + }; + var surroundedByInlineContent = function (node, root) { + var prev = new DomTreeWalker(node, root).prev(false); + var next = new DomTreeWalker(node, root).next(false); + var prevIsInline = isUndefined(prev) || isInlineContent(prev, root); + var nextIsInline = isUndefined(next) || isInlineContent(next, root); + return prevIsInline && nextIsInline; + }; + var isBookmarkNode = function (node) { + return isSpan(node) && node.getAttribute('data-mce-type') === 'bookmark'; + }; + var isKeepTextNode = function (node, root) { + return isText$1(node) && node.data.length > 0 && surroundedByInlineContent(node, root); + }; + var isKeepElement = function (node) { + return isElement$1(node) ? node.childNodes.length > 0 : false; + }; + var isDocument$2 = function (node) { + return isDocumentFragment$1(node) || isDocument$1(node); + }; + var trimNode = function (dom, node, root) { + var rootNode = root || node; + if (isElement$1(node) && isBookmarkNode(node)) { + return node; + } + var children = node.childNodes; + for (var i = children.length - 1; i >= 0; i--) { + trimNode(dom, children[i], rootNode); + } + if (isElement$1(node)) { + var currentChildren = node.childNodes; + if (currentChildren.length === 1 && isBookmarkNode(currentChildren[0])) { + node.parentNode.insertBefore(currentChildren[0], node); + } + } + if (!isDocument$2(node) && !isContent(node, rootNode) && !isKeepElement(node) && !isKeepTextNode(node, rootNode)) { + dom.remove(node); + } + return node; + }; + + var makeMap$1 = Tools.makeMap; + var attrsCharsRegExp = /[&<>\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g; + var textCharsRegExp = /[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g; + var rawCharsRegExp = /[<>&\"\']/g; + var entityRegExp = /&#([a-z0-9]+);?|&([a-z0-9]+);/gi; + var asciiMap = { + 128: '\u20AC', + 130: '\u201A', + 131: '\u0192', + 132: '\u201E', + 133: '\u2026', + 134: '\u2020', + 135: '\u2021', + 136: '\u02c6', + 137: '\u2030', + 138: '\u0160', + 139: '\u2039', + 140: '\u0152', + 142: '\u017d', + 145: '\u2018', + 146: '\u2019', + 147: '\u201C', + 148: '\u201D', + 149: '\u2022', + 150: '\u2013', + 151: '\u2014', + 152: '\u02DC', + 153: '\u2122', + 154: '\u0161', + 155: '\u203A', + 156: '\u0153', + 158: '\u017e', + 159: '\u0178' + }; + var baseEntities = { + '"': '"', + '\'': ''', + '<': '<', + '>': '>', + '&': '&', + '`': '`' + }; + var reverseEntities = { + '<': '<', + '>': '>', + '&': '&', + '"': '"', + ''': '\'' + }; + var nativeDecode = function (text) { + var elm = SugarElement.fromTag('div').dom; + elm.innerHTML = text; + return elm.textContent || elm.innerText || text; + }; + var buildEntitiesLookup = function (items, radix) { + var i, chr, entity; + var lookup = {}; + if (items) { + items = items.split(','); + radix = radix || 10; + for (i = 0; i < items.length; i += 2) { + chr = String.fromCharCode(parseInt(items[i], radix)); + if (!baseEntities[chr]) { + entity = '&' + items[i + 1] + ';'; + lookup[chr] = entity; + lookup[entity] = chr; + } + } + return lookup; + } + }; + var namedEntities = buildEntitiesLookup('50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,' + '5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,' + '5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,' + '5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,' + '68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,' + '6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,' + '6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,' + '75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,' + '7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,' + '7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,' + 'sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,' + 'st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,' + 't9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,' + 'tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,' + 'u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,' + '81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,' + '8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,' + '8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,' + '8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,' + '8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,' + 'nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,' + 'rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,' + 'Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,' + '80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,' + '811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro', 32); + var encodeRaw = function (text, attr) { + return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function (chr) { + return baseEntities[chr] || chr; + }); + }; + var encodeAllRaw = function (text) { + return ('' + text).replace(rawCharsRegExp, function (chr) { + return baseEntities[chr] || chr; + }); + }; + var encodeNumeric = function (text, attr) { + return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function (chr) { + if (chr.length > 1) { + return '&#' + ((chr.charCodeAt(0) - 55296) * 1024 + (chr.charCodeAt(1) - 56320) + 65536) + ';'; + } + return baseEntities[chr] || '&#' + chr.charCodeAt(0) + ';'; + }); + }; + var encodeNamed = function (text, attr, entities) { + entities = entities || namedEntities; + return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function (chr) { + return baseEntities[chr] || entities[chr] || chr; + }); + }; + var getEncodeFunc = function (name, entities) { + var entitiesMap = buildEntitiesLookup(entities) || namedEntities; + var encodeNamedAndNumeric = function (text, attr) { + return text.replace(attr ? attrsCharsRegExp : textCharsRegExp, function (chr) { + if (baseEntities[chr] !== undefined) { + return baseEntities[chr]; + } + if (entitiesMap[chr] !== undefined) { + return entitiesMap[chr]; + } + if (chr.length > 1) { + return '&#' + ((chr.charCodeAt(0) - 55296) * 1024 + (chr.charCodeAt(1) - 56320) + 65536) + ';'; + } + return '&#' + chr.charCodeAt(0) + ';'; + }); + }; + var encodeCustomNamed = function (text, attr) { + return encodeNamed(text, attr, entitiesMap); + }; + var nameMap = makeMap$1(name.replace(/\+/g, ',')); + if (nameMap.named && nameMap.numeric) { + return encodeNamedAndNumeric; + } + if (nameMap.named) { + if (entities) { + return encodeCustomNamed; + } + return encodeNamed; + } + if (nameMap.numeric) { + return encodeNumeric; + } + return encodeRaw; + }; + var decode = function (text) { + return text.replace(entityRegExp, function (all, numeric) { + if (numeric) { + if (numeric.charAt(0).toLowerCase() === 'x') { + numeric = parseInt(numeric.substr(1), 16); + } else { + numeric = parseInt(numeric, 10); + } + if (numeric > 65535) { + numeric -= 65536; + return String.fromCharCode(55296 + (numeric >> 10), 56320 + (numeric & 1023)); + } + return asciiMap[numeric] || String.fromCharCode(numeric); + } + return reverseEntities[all] || namedEntities[all] || nativeDecode(all); + }); + }; + var Entities = { + encodeRaw: encodeRaw, + encodeAllRaw: encodeAllRaw, + encodeNumeric: encodeNumeric, + encodeNamed: encodeNamed, + getEncodeFunc: getEncodeFunc, + decode: decode + }; + + var mapCache = {}, dummyObj = {}; + var makeMap$2 = Tools.makeMap, each$3 = Tools.each, extend$1 = Tools.extend, explode$1 = Tools.explode, inArray = Tools.inArray; + var split = function (items, delim) { + items = Tools.trim(items); + return items ? items.split(delim || ' ') : []; + }; + var compileSchema = function (type) { + var schema = {}; + var globalAttributes, blockContent; + var phrasingContent, flowContent, html4BlockContent, html4PhrasingContent; + var add = function (name, attributes, children) { + var ni, attributesOrder, element; + var arrayToMap = function (array, obj) { + var map = {}; + var i, l; + for (i = 0, l = array.length; i < l; i++) { + map[array[i]] = obj || {}; + } + return map; + }; + children = children || []; + attributes = attributes || ''; + if (typeof children === 'string') { + children = split(children); + } + var names = split(name); + ni = names.length; + while (ni--) { + attributesOrder = split([ + globalAttributes, + attributes + ].join(' ')); + element = { + attributes: arrayToMap(attributesOrder), + attributesOrder: attributesOrder, + children: arrayToMap(children, dummyObj) + }; + schema[names[ni]] = element; + } + }; + var addAttrs = function (name, attributes) { + var ni, schemaItem, i, l; + var names = split(name); + ni = names.length; + var attrs = split(attributes); + while (ni--) { + schemaItem = schema[names[ni]]; + for (i = 0, l = attrs.length; i < l; i++) { + schemaItem.attributes[attrs[i]] = {}; + schemaItem.attributesOrder.push(attrs[i]); + } + } + }; + if (mapCache[type]) { + return mapCache[type]; + } + globalAttributes = 'id accesskey class dir lang style tabindex title role'; + blockContent = 'address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul'; + phrasingContent = 'a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd ' + 'label map noscript object q s samp script select small span strong sub sup ' + 'textarea u var #text #comment'; + if (type !== 'html4') { + globalAttributes += ' contenteditable contextmenu draggable dropzone ' + 'hidden spellcheck translate'; + blockContent += ' article aside details dialog figure main header footer hgroup section nav'; + phrasingContent += ' audio canvas command datalist mark meter output picture ' + 'progress time wbr video ruby bdi keygen'; + } + if (type !== 'html5-strict') { + globalAttributes += ' xml:lang'; + html4PhrasingContent = 'acronym applet basefont big font strike tt'; + phrasingContent = [ + phrasingContent, + html4PhrasingContent + ].join(' '); + each$3(split(html4PhrasingContent), function (name) { + add(name, '', phrasingContent); + }); + html4BlockContent = 'center dir isindex noframes'; + blockContent = [ + blockContent, + html4BlockContent + ].join(' '); + flowContent = [ + blockContent, + phrasingContent + ].join(' '); + each$3(split(html4BlockContent), function (name) { + add(name, '', flowContent); + }); + } + flowContent = flowContent || [ + blockContent, + phrasingContent + ].join(' '); + add('html', 'manifest', 'head body'); + add('head', '', 'base command link meta noscript script style title'); + add('title hr noscript br'); + add('base', 'href target'); + add('link', 'href rel media hreflang type sizes hreflang'); + add('meta', 'name http-equiv content charset'); + add('style', 'media type scoped'); + add('script', 'src async defer type charset'); + add('body', 'onafterprint onbeforeprint onbeforeunload onblur onerror onfocus ' + 'onhashchange onload onmessage onoffline ononline onpagehide onpageshow ' + 'onpopstate onresize onscroll onstorage onunload', flowContent); + add('address dt dd div caption', '', flowContent); + 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); + add('blockquote', 'cite', flowContent); + add('ol', 'reversed start type', 'li'); + add('ul', '', 'li'); + add('li', 'value', flowContent); + add('dl', '', 'dt dd'); + add('a', 'href target rel media hreflang type', phrasingContent); + add('q', 'cite', phrasingContent); + add('ins del', 'cite datetime', flowContent); + add('img', 'src sizes srcset alt usemap ismap width height'); + add('iframe', 'src name width height', flowContent); + add('embed', 'src type width height'); + add('object', 'data type typemustmatch name usemap form width height', [ + flowContent, + 'param' + ].join(' ')); + add('param', 'name value'); + add('map', 'name', [ + flowContent, + 'area' + ].join(' ')); + add('area', 'alt coords shape href target rel media hreflang type'); + add('table', 'border', 'caption colgroup thead tfoot tbody tr' + (type === 'html4' ? ' col' : '')); + add('colgroup', 'span', 'col'); + add('col', 'span'); + add('tbody thead tfoot', '', 'tr'); + add('tr', '', 'td th'); + add('td', 'colspan rowspan headers', flowContent); + add('th', 'colspan rowspan headers scope abbr', flowContent); + add('form', 'accept-charset action autocomplete enctype method name novalidate target', flowContent); + add('fieldset', 'disabled form name', [ + flowContent, + 'legend' + ].join(' ')); + add('label', 'form for', phrasingContent); + add('input', 'accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate ' + 'formtarget height list max maxlength min multiple name pattern readonly required size src step type value width'); + add('button', 'disabled form formaction formenctype formmethod formnovalidate formtarget name type value', type === 'html4' ? flowContent : phrasingContent); + add('select', 'disabled form multiple name required size', 'option optgroup'); + add('optgroup', 'disabled label', 'option'); + add('option', 'disabled label selected value'); + add('textarea', 'cols dirname disabled form maxlength name readonly required rows wrap'); + add('menu', 'type label', [ + flowContent, + 'li' + ].join(' ')); + add('noscript', '', flowContent); + if (type !== 'html4') { + add('wbr'); + add('ruby', '', [ + phrasingContent, + 'rt rp' + ].join(' ')); + add('figcaption', '', flowContent); + add('mark rt rp summary bdi', '', phrasingContent); + add('canvas', 'width height', flowContent); + add('video', 'src crossorigin poster preload autoplay mediagroup loop ' + 'muted controls width height buffered', [ + flowContent, + 'track source' + ].join(' ')); + add('audio', 'src crossorigin preload autoplay mediagroup loop muted controls ' + 'buffered volume', [ + flowContent, + 'track source' + ].join(' ')); + add('picture', '', 'img source'); + add('source', 'src srcset type media sizes'); + add('track', 'kind src srclang label default'); + add('datalist', '', [ + phrasingContent, + 'option' + ].join(' ')); + add('article section nav aside main header footer', '', flowContent); + add('hgroup', '', 'h1 h2 h3 h4 h5 h6'); + add('figure', '', [ + flowContent, + 'figcaption' + ].join(' ')); + add('time', 'datetime', phrasingContent); + add('dialog', 'open', flowContent); + add('command', 'type label icon disabled checked radiogroup command'); + add('output', 'for form name', phrasingContent); + add('progress', 'value max', phrasingContent); + add('meter', 'value min max low high optimum', phrasingContent); + add('details', 'open', [ + flowContent, + 'summary' + ].join(' ')); + add('keygen', 'autofocus challenge disabled form keytype name'); + } + if (type !== 'html5-strict') { + addAttrs('script', 'language xml:space'); + addAttrs('style', 'xml:space'); + addAttrs('object', 'declare classid code codebase codetype archive standby align border hspace vspace'); + addAttrs('embed', 'align name hspace vspace'); + addAttrs('param', 'valuetype type'); + addAttrs('a', 'charset name rev shape coords'); + addAttrs('br', 'clear'); + addAttrs('applet', 'codebase archive code object alt name width height align hspace vspace'); + addAttrs('img', 'name longdesc align border hspace vspace'); + addAttrs('iframe', 'longdesc frameborder marginwidth marginheight scrolling align'); + addAttrs('font basefont', 'size color face'); + addAttrs('input', 'usemap align'); + addAttrs('select'); + addAttrs('textarea'); + addAttrs('h1 h2 h3 h4 h5 h6 div p legend caption', 'align'); + addAttrs('ul', 'type compact'); + addAttrs('li', 'type'); + addAttrs('ol dl menu dir', 'compact'); + addAttrs('pre', 'width xml:space'); + addAttrs('hr', 'align noshade size width'); + addAttrs('isindex', 'prompt'); + addAttrs('table', 'summary width frame rules cellspacing cellpadding align bgcolor'); + addAttrs('col', 'width align char charoff valign'); + addAttrs('colgroup', 'width align char charoff valign'); + addAttrs('thead', 'align char charoff valign'); + addAttrs('tr', 'align char charoff valign bgcolor'); + addAttrs('th', 'axis align char charoff valign nowrap bgcolor width height'); + addAttrs('form', 'accept'); + addAttrs('td', 'abbr axis scope align char charoff valign nowrap bgcolor width height'); + addAttrs('tfoot', 'align char charoff valign'); + addAttrs('tbody', 'align char charoff valign'); + addAttrs('area', 'nohref'); + addAttrs('body', 'background bgcolor text link vlink alink'); + } + if (type !== 'html4') { + addAttrs('input button select textarea', 'autofocus'); + addAttrs('input textarea', 'placeholder'); + addAttrs('a', 'download'); + addAttrs('link script img', 'crossorigin'); + addAttrs('img', 'loading'); + addAttrs('iframe', 'sandbox seamless allowfullscreen loading'); + } + each$3(split('a form meter progress dfn'), function (name) { + if (schema[name]) { + delete schema[name].children[name]; + } + }); + delete schema.caption.children.table; + delete schema.script; + mapCache[type] = schema; + return schema; + }; + var compileElementMap = function (value, mode) { + var styles; + if (value) { + styles = {}; + if (typeof value === 'string') { + value = { '*': value }; + } + each$3(value, function (value, key) { + styles[key] = styles[key.toUpperCase()] = mode === 'map' ? makeMap$2(value, /[, ]/) : explode$1(value, /[, ]/); + }); + } + return styles; + }; + function Schema(settings) { + var elements = {}; + var children = {}; + var patternElements = []; + var customElementsMap = {}, specialElements = {}; + var createLookupTable = function (option, defaultValue, extendWith) { + var value = settings[option]; + if (!value) { + value = mapCache[option]; + if (!value) { + value = makeMap$2(defaultValue, ' ', makeMap$2(defaultValue.toUpperCase(), ' ')); + value = extend$1(value, extendWith); + mapCache[option] = value; + } + } else { + value = makeMap$2(value, /[, ]/, makeMap$2(value.toUpperCase(), /[, ]/)); + } + return value; + }; + settings = settings || {}; + var schemaItems = compileSchema(settings.schema); + if (settings.verify_html === false) { + settings.valid_elements = '*[*]'; + } + var validStyles = compileElementMap(settings.valid_styles); + var invalidStyles = compileElementMap(settings.invalid_styles, 'map'); + var validClasses = compileElementMap(settings.valid_classes, 'map'); + var whiteSpaceElementsMap = createLookupTable('whitespace_elements', 'pre script noscript style textarea video audio iframe object code'); + var selfClosingElementsMap = createLookupTable('self_closing_elements', 'colgroup dd dt li option p td tfoot th thead tr'); + var shortEndedElementsMap = createLookupTable('short_ended_elements', 'area base basefont br col frame hr img input isindex link ' + 'meta param embed source wbr track'); + var boolAttrMap = createLookupTable('boolean_attributes', 'checked compact declare defer disabled ismap multiple nohref noresize ' + 'noshade nowrap readonly selected autoplay loop controls'); + var nonEmptyOrMoveCaretBeforeOnEnter = 'td th iframe video audio object script code'; + var nonEmptyElementsMap = createLookupTable('non_empty_elements', nonEmptyOrMoveCaretBeforeOnEnter + ' pre', shortEndedElementsMap); + var moveCaretBeforeOnEnterElementsMap = createLookupTable('move_caret_before_on_enter_elements', nonEmptyOrMoveCaretBeforeOnEnter + ' table', shortEndedElementsMap); + var textBlockElementsMap = createLookupTable('text_block_elements', 'h1 h2 h3 h4 h5 h6 p div address pre form ' + 'blockquote center dir fieldset header footer article section hgroup aside main nav figure'); + var blockElementsMap = createLookupTable('block_elements', 'hr table tbody thead tfoot ' + 'th tr td li ol ul caption dl dt dd noscript menu isindex option ' + 'datalist select optgroup figcaption details summary', textBlockElementsMap); + var textInlineElementsMap = createLookupTable('text_inline_elements', 'span strong b em i font strike u var cite ' + 'dfn code mark q sup sub samp'); + each$3((settings.special || 'script noscript iframe noframes noembed title style textarea xmp').split(' '), function (name) { + specialElements[name] = new RegExp(']*>', 'gi'); + }); + var patternToRegExp = function (str) { + return new RegExp('^' + str.replace(/([?+*])/g, '.$1') + '$'); + }; + var addValidElements = function (validElements) { + var ei, el, ai, al, matches, element, attr, attrData, elementName, attrName, attrType, attributes, attributesOrder, prefix, outputName, globalAttributes, globalAttributesOrder, value; + var elementRuleRegExp = /^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)])?$/, attrRuleRegExp = /^([!\-])?(\w+[\\:]:\w+|[^=:<]+)?(?:([=:<])(.*))?$/, hasPatternsRegExp = /[*?+]/; + if (validElements) { + var validElementsArr = split(validElements, ','); + if (elements['@']) { + globalAttributes = elements['@'].attributes; + globalAttributesOrder = elements['@'].attributesOrder; + } + for (ei = 0, el = validElementsArr.length; ei < el; ei++) { + matches = elementRuleRegExp.exec(validElementsArr[ei]); + if (matches) { + prefix = matches[1]; + elementName = matches[2]; + outputName = matches[3]; + attrData = matches[5]; + attributes = {}; + attributesOrder = []; + element = { + attributes: attributes, + attributesOrder: attributesOrder + }; + if (prefix === '#') { + element.paddEmpty = true; + } + if (prefix === '-') { + element.removeEmpty = true; + } + if (matches[4] === '!') { + element.removeEmptyAttrs = true; + } + if (globalAttributes) { + each$1(globalAttributes, function (value, key) { + attributes[key] = value; + }); + attributesOrder.push.apply(attributesOrder, globalAttributesOrder); + } + if (attrData) { + attrData = split(attrData, '|'); + for (ai = 0, al = attrData.length; ai < al; ai++) { + matches = attrRuleRegExp.exec(attrData[ai]); + if (matches) { + attr = {}; + attrType = matches[1]; + attrName = matches[2].replace(/[\\:]:/g, ':'); + prefix = matches[3]; + value = matches[4]; + if (attrType === '!') { + element.attributesRequired = element.attributesRequired || []; + element.attributesRequired.push(attrName); + attr.required = true; + } + if (attrType === '-') { + delete attributes[attrName]; + attributesOrder.splice(inArray(attributesOrder, attrName), 1); + continue; + } + if (prefix) { + if (prefix === '=') { + element.attributesDefault = element.attributesDefault || []; + element.attributesDefault.push({ + name: attrName, + value: value + }); + attr.defaultValue = value; + } + if (prefix === ':') { + element.attributesForced = element.attributesForced || []; + element.attributesForced.push({ + name: attrName, + value: value + }); + attr.forcedValue = value; + } + if (prefix === '<') { + attr.validValues = makeMap$2(value, '?'); + } + } + if (hasPatternsRegExp.test(attrName)) { + element.attributePatterns = element.attributePatterns || []; + attr.pattern = patternToRegExp(attrName); + element.attributePatterns.push(attr); + } else { + if (!attributes[attrName]) { + attributesOrder.push(attrName); + } + attributes[attrName] = attr; + } + } + } + } + if (!globalAttributes && elementName === '@') { + globalAttributes = attributes; + globalAttributesOrder = attributesOrder; + } + if (outputName) { + element.outputName = elementName; + elements[outputName] = element; + } + if (hasPatternsRegExp.test(elementName)) { + element.pattern = patternToRegExp(elementName); + patternElements.push(element); + } else { + elements[elementName] = element; + } + } + } + } + }; + var setValidElements = function (validElements) { + elements = {}; + patternElements = []; + addValidElements(validElements); + each$3(schemaItems, function (element, name) { + children[name] = element.children; + }); + }; + var addCustomElements = function (customElements) { + var customElementRegExp = /^(~)?(.+)$/; + if (customElements) { + mapCache.text_block_elements = mapCache.block_elements = null; + each$3(split(customElements, ','), function (rule) { + var matches = customElementRegExp.exec(rule), inline = matches[1] === '~', cloneName = inline ? 'span' : 'div', name = matches[2]; + children[name] = children[cloneName]; + customElementsMap[name] = cloneName; + if (!inline) { + blockElementsMap[name.toUpperCase()] = {}; + blockElementsMap[name] = {}; + } + if (!elements[name]) { + var customRule = elements[cloneName]; + customRule = extend$1({}, customRule); + delete customRule.removeEmptyAttrs; + delete customRule.removeEmpty; + elements[name] = customRule; + } + each$3(children, function (element, elmName) { + if (element[cloneName]) { + children[elmName] = element = extend$1({}, children[elmName]); + element[name] = element[cloneName]; + } + }); + }); + } + }; + var addValidChildren = function (validChildren) { + var childRuleRegExp = /^([+\-]?)([A-Za-z0-9_\-.\u00b7\u00c0-\u00d6\u00d8-\u00f6\u00f8-\u037d\u037f-\u1fff\u200c-\u200d\u203f-\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]+)\[([^\]]+)]$/; + mapCache[settings.schema] = null; + if (validChildren) { + each$3(split(validChildren, ','), function (rule) { + var matches = childRuleRegExp.exec(rule); + var parent, prefix; + if (matches) { + prefix = matches[1]; + if (prefix) { + parent = children[matches[2]]; + } else { + parent = children[matches[2]] = { '#comment': {} }; + } + parent = children[matches[2]]; + each$3(split(matches[3], '|'), function (child) { + if (prefix === '-') { + delete parent[child]; + } else { + parent[child] = {}; + } + }); + } + }); + } + }; + var getElementRule = function (name) { + var element = elements[name], i; + if (element) { + return element; + } + i = patternElements.length; + while (i--) { + element = patternElements[i]; + if (element.pattern.test(name)) { + return element; + } + } + }; + if (!settings.valid_elements) { + each$3(schemaItems, function (element, name) { + elements[name] = { + attributes: element.attributes, + attributesOrder: element.attributesOrder + }; + children[name] = element.children; + }); + if (settings.schema !== 'html5') { + each$3(split('strong/b em/i'), function (item) { + var items = split(item, '/'); + elements[items[1]].outputName = items[0]; + }); + } + each$3(split('ol ul sub sup blockquote span font a table tbody tr strong em b i'), function (name) { + if (elements[name]) { + elements[name].removeEmpty = true; + } + }); + each$3(split('p h1 h2 h3 h4 h5 h6 th td pre div address caption li'), function (name) { + elements[name].paddEmpty = true; + }); + each$3(split('span'), function (name) { + elements[name].removeEmptyAttrs = true; + }); + } else { + setValidElements(settings.valid_elements); + } + addCustomElements(settings.custom_elements); + addValidChildren(settings.valid_children); + addValidElements(settings.extended_valid_elements); + addValidChildren('+ol[ul|ol],+ul[ul|ol]'); + each$3({ + dd: 'dl', + dt: 'dl', + li: 'ul ol', + td: 'tr', + th: 'tr', + tr: 'tbody thead tfoot', + tbody: 'table', + thead: 'table', + tfoot: 'table', + legend: 'fieldset', + area: 'map', + param: 'video audio object' + }, function (parents, item) { + if (elements[item]) { + elements[item].parentsRequired = split(parents); + } + }); + if (settings.invalid_elements) { + each$3(explode$1(settings.invalid_elements), function (item) { + if (elements[item]) { + delete elements[item]; + } + }); + } + if (!getElementRule('span')) { + addValidElements('span[!data-mce-type|*]'); + } + var getValidStyles = function () { + return validStyles; + }; + var getInvalidStyles = function () { + return invalidStyles; + }; + var getValidClasses = function () { + return validClasses; + }; + var getBoolAttrs = function () { + return boolAttrMap; + }; + var getBlockElements = function () { + return blockElementsMap; + }; + var getTextBlockElements = function () { + return textBlockElementsMap; + }; + var getTextInlineElements = function () { + return textInlineElementsMap; + }; + var getShortEndedElements = function () { + return shortEndedElementsMap; + }; + var getSelfClosingElements = function () { + return selfClosingElementsMap; + }; + var getNonEmptyElements = function () { + return nonEmptyElementsMap; + }; + var getMoveCaretBeforeOnEnterElements = function () { + return moveCaretBeforeOnEnterElementsMap; + }; + var getWhiteSpaceElements = function () { + return whiteSpaceElementsMap; + }; + var getSpecialElements = function () { + return specialElements; + }; + var isValidChild = function (name, child) { + var parent = children[name.toLowerCase()]; + return !!(parent && parent[child.toLowerCase()]); + }; + var isValid = function (name, attr) { + var attrPatterns, i; + var rule = getElementRule(name); + if (rule) { + if (attr) { + if (rule.attributes[attr]) { + return true; + } + attrPatterns = rule.attributePatterns; + if (attrPatterns) { + i = attrPatterns.length; + while (i--) { + if (attrPatterns[i].pattern.test(name)) { + return true; + } + } + } + } else { + return true; + } + } + return false; + }; + var getCustomElements = function () { + return customElementsMap; + }; + return { + children: children, + elements: elements, + getValidStyles: getValidStyles, + getValidClasses: getValidClasses, + getBlockElements: getBlockElements, + getInvalidStyles: getInvalidStyles, + getShortEndedElements: getShortEndedElements, + getTextBlockElements: getTextBlockElements, + getTextInlineElements: getTextInlineElements, + getBoolAttrs: getBoolAttrs, + getElementRule: getElementRule, + getSelfClosingElements: getSelfClosingElements, + getNonEmptyElements: getNonEmptyElements, + getMoveCaretBeforeOnEnterElements: getMoveCaretBeforeOnEnterElements, + getWhiteSpaceElements: getWhiteSpaceElements, + getSpecialElements: getSpecialElements, + isValidChild: isValidChild, + isValid: isValid, + getCustomElements: getCustomElements, + addValidElements: addValidElements, + setValidElements: setValidElements, + addCustomElements: addCustomElements, + addValidChildren: addValidChildren + }; + } + + var toHex = function (match, r, g, b) { + var hex = function (val) { + val = parseInt(val, 10).toString(16); + return val.length > 1 ? val : '0' + val; + }; + return '#' + hex(r) + hex(g) + hex(b); + }; + var Styles = function (settings, schema) { + var rgbRegExp = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi; + var urlOrStrRegExp = /(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi; + var styleRegExp = /\s*([^:]+):\s*([^;]+);?/g; + var trimRightRegExp = /\s+$/; + var i; + var encodingLookup = {}; + var validStyles; + var invalidStyles; + var invisibleChar = zeroWidth; + settings = settings || {}; + if (schema) { + validStyles = schema.getValidStyles(); + invalidStyles = schema.getInvalidStyles(); + } + var encodingItems = ('\\" \\\' \\; \\: ; : ' + invisibleChar).split(' '); + for (i = 0; i < encodingItems.length; i++) { + encodingLookup[encodingItems[i]] = invisibleChar + i; + encodingLookup[invisibleChar + i] = encodingItems[i]; + } + return { + toHex: function (color) { + return color.replace(rgbRegExp, toHex); + }, + parse: function (css) { + var styles = {}; + var matches, name, value, isEncoded; + var urlConverter = settings.url_converter; + var urlConverterScope = settings.url_converter_scope || this; + var compress = function (prefix, suffix, noJoin) { + var top = styles[prefix + '-top' + suffix]; + if (!top) { + return; + } + var right = styles[prefix + '-right' + suffix]; + if (!right) { + return; + } + var bottom = styles[prefix + '-bottom' + suffix]; + if (!bottom) { + return; + } + var left = styles[prefix + '-left' + suffix]; + if (!left) { + return; + } + var box = [ + top, + right, + bottom, + left + ]; + i = box.length - 1; + while (i--) { + if (box[i] !== box[i + 1]) { + break; + } + } + if (i > -1 && noJoin) { + return; + } + styles[prefix + suffix] = i === -1 ? box[0] : box.join(' '); + delete styles[prefix + '-top' + suffix]; + delete styles[prefix + '-right' + suffix]; + delete styles[prefix + '-bottom' + suffix]; + delete styles[prefix + '-left' + suffix]; + }; + var canCompress = function (key) { + var value = styles[key], i; + if (!value) { + return; + } + value = value.split(' '); + i = value.length; + while (i--) { + if (value[i] !== value[0]) { + return false; + } + } + styles[key] = value[0]; + return true; + }; + var compress2 = function (target, a, b, c) { + if (!canCompress(a)) { + return; + } + if (!canCompress(b)) { + return; + } + if (!canCompress(c)) { + return; + } + styles[target] = styles[a] + ' ' + styles[b] + ' ' + styles[c]; + delete styles[a]; + delete styles[b]; + delete styles[c]; + }; + var encode = function (str) { + isEncoded = true; + return encodingLookup[str]; + }; + var decode = function (str, keepSlashes) { + if (isEncoded) { + str = str.replace(/\uFEFF[0-9]/g, function (str) { + return encodingLookup[str]; + }); + } + if (!keepSlashes) { + str = str.replace(/\\([\'\";:])/g, '$1'); + } + return str; + }; + var decodeSingleHexSequence = function (escSeq) { + return String.fromCharCode(parseInt(escSeq.slice(1), 16)); + }; + var decodeHexSequences = function (value) { + return value.replace(/\\[0-9a-f]+/gi, decodeSingleHexSequence); + }; + var processUrl = function (match, url, url2, url3, str, str2) { + str = str || str2; + if (str) { + str = decode(str); + return '\'' + str.replace(/\'/g, '\\\'') + '\''; + } + url = decode(url || url2 || url3); + if (!settings.allow_script_urls) { + var scriptUrl = url.replace(/[\s\r\n]+/g, ''); + if (/(java|vb)script:/i.test(scriptUrl)) { + return ''; + } + if (!settings.allow_svg_data_urls && /^data:image\/svg/i.test(scriptUrl)) { + return ''; + } + } + if (urlConverter) { + url = urlConverter.call(urlConverterScope, url, 'style'); + } + return 'url(\'' + url.replace(/\'/g, '\\\'') + '\')'; + }; + if (css) { + css = css.replace(/[\u0000-\u001F]/g, ''); + css = css.replace(/\\[\"\';:\uFEFF]/g, encode).replace(/\"[^\"]+\"|\'[^\']+\'/g, function (str) { + return str.replace(/[;:]/g, encode); + }); + while (matches = styleRegExp.exec(css)) { + styleRegExp.lastIndex = matches.index + matches[0].length; + name = matches[1].replace(trimRightRegExp, '').toLowerCase(); + value = matches[2].replace(trimRightRegExp, ''); + if (name && value) { + name = decodeHexSequences(name); + value = decodeHexSequences(value); + if (name.indexOf(invisibleChar) !== -1 || name.indexOf('"') !== -1) { + continue; + } + if (!settings.allow_script_urls && (name === 'behavior' || /expression\s*\(|\/\*|\*\//.test(value))) { + continue; + } + if (name === 'font-weight' && value === '700') { + value = 'bold'; + } else if (name === 'color' || name === 'background-color') { + value = value.toLowerCase(); + } + value = value.replace(rgbRegExp, toHex); + value = value.replace(urlOrStrRegExp, processUrl); + styles[name] = isEncoded ? decode(value, true) : value; + } + } + compress('border', '', true); + compress('border', '-width'); + compress('border', '-color'); + compress('border', '-style'); + compress('padding', ''); + compress('margin', ''); + compress2('border', 'border-width', 'border-style', 'border-color'); + if (styles.border === 'medium none') { + delete styles.border; + } + if (styles['border-image'] === 'none') { + delete styles['border-image']; + } + } + return styles; + }, + serialize: function (styles, elementName) { + var css = ''; + var serializeStyles = function (name) { + var value; + var styleList = validStyles[name]; + if (styleList) { + for (var i_1 = 0, l = styleList.length; i_1 < l; i_1++) { + name = styleList[i_1]; + value = styles[name]; + if (value) { + css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';'; + } + } + } + }; + var isValid = function (name, elementName) { + var styleMap = invalidStyles['*']; + if (styleMap && styleMap[name]) { + return false; + } + styleMap = invalidStyles[elementName]; + return !(styleMap && styleMap[name]); + }; + if (elementName && validStyles) { + serializeStyles('*'); + serializeStyles(elementName); + } else { + each$1(styles, function (value, name) { + if (value && (!invalidStyles || isValid(name, elementName))) { + css += (css.length > 0 ? ' ' : '') + name + ': ' + value + ';'; + } + }); + } + return css; + } + }; + }; + + var eventExpandoPrefix = 'mce-data-'; + var mouseEventRe = /^(?:mouse|contextmenu)|click/; + var deprecated = { + keyLocation: 1, + layerX: 1, + layerY: 1, + returnValue: 1, + webkitMovementX: 1, + webkitMovementY: 1, + keyIdentifier: 1, + mozPressure: 1 + }; + var hasIsDefaultPrevented = function (event) { + return event.isDefaultPrevented === returnTrue || event.isDefaultPrevented === returnFalse; + }; + var returnFalse = function () { + return false; + }; + var returnTrue = function () { + return true; + }; + var addEvent = function (target, name, callback, capture) { + if (target.addEventListener) { + target.addEventListener(name, callback, capture || false); + } else if (target.attachEvent) { + target.attachEvent('on' + name, callback); + } + }; + var removeEvent = function (target, name, callback, capture) { + if (target.removeEventListener) { + target.removeEventListener(name, callback, capture || false); + } else if (target.detachEvent) { + target.detachEvent('on' + name, callback); + } + }; + var isMouseEvent = function (event) { + return mouseEventRe.test(event.type); + }; + var fix = function (originalEvent, data) { + var name; + var event = data || {}; + for (name in originalEvent) { + if (!deprecated[name]) { + event[name] = originalEvent[name]; + } + } + if (!event.target) { + event.target = event.srcElement || document; + } + if (event.composedPath) { + event.composedPath = function () { + return originalEvent.composedPath(); + }; + } + if (originalEvent && isMouseEvent(originalEvent) && originalEvent.pageX === undefined && originalEvent.clientX !== undefined) { + var eventDoc = event.target.ownerDocument || document; + var doc = eventDoc.documentElement; + var body = eventDoc.body; + event.pageX = originalEvent.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); + event.pageY = originalEvent.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); + } + event.preventDefault = function () { + event.isDefaultPrevented = returnTrue; + if (originalEvent) { + if (originalEvent.preventDefault) { + originalEvent.preventDefault(); + } else { + originalEvent.returnValue = false; + } + } + }; + event.stopPropagation = function () { + event.isPropagationStopped = returnTrue; + if (originalEvent) { + if (originalEvent.stopPropagation) { + originalEvent.stopPropagation(); + } else { + originalEvent.cancelBubble = true; + } + } + }; + event.stopImmediatePropagation = function () { + event.isImmediatePropagationStopped = returnTrue; + event.stopPropagation(); + }; + if (hasIsDefaultPrevented(event) === false) { + event.isDefaultPrevented = returnFalse; + event.isPropagationStopped = returnFalse; + event.isImmediatePropagationStopped = returnFalse; + } + if (typeof event.metaKey === 'undefined') { + event.metaKey = false; + } + return event; + }; + var bindOnReady = function (win, callback, eventUtils) { + var doc = win.document, event = { type: 'ready' }; + if (eventUtils.domLoaded) { + callback(event); + return; + } + var isDocReady = function () { + return doc.readyState === 'complete' || doc.readyState === 'interactive' && doc.body; + }; + var readyHandler = function () { + removeEvent(win, 'DOMContentLoaded', readyHandler); + removeEvent(win, 'load', readyHandler); + if (!eventUtils.domLoaded) { + eventUtils.domLoaded = true; + callback(event); + } + }; + if (isDocReady()) { + readyHandler(); + } else { + addEvent(win, 'DOMContentLoaded', readyHandler); + } + addEvent(win, 'load', readyHandler); + }; + var EventUtils = function () { + function EventUtils() { + this.domLoaded = false; + this.events = {}; + this.count = 1; + this.expando = eventExpandoPrefix + (+new Date()).toString(32); + this.hasMouseEnterLeave = 'onmouseenter' in document.documentElement; + this.hasFocusIn = 'onfocusin' in document.documentElement; + this.count = 1; + } + EventUtils.prototype.bind = function (target, names, callback, scope) { + var self = this; + var id, callbackList, i, name, fakeName, nativeHandler, capture; + var win = window; + var defaultNativeHandler = function (evt) { + self.executeHandlers(fix(evt || win.event), id); + }; + if (!target || target.nodeType === 3 || target.nodeType === 8) { + return; + } + if (!target[self.expando]) { + id = self.count++; + target[self.expando] = id; + self.events[id] = {}; + } else { + id = target[self.expando]; + } + scope = scope || target; + var namesList = names.split(' '); + i = namesList.length; + while (i--) { + name = namesList[i]; + nativeHandler = defaultNativeHandler; + fakeName = capture = false; + if (name === 'DOMContentLoaded') { + name = 'ready'; + } + if (self.domLoaded && name === 'ready' && target.readyState === 'complete') { + callback.call(scope, fix({ type: name })); + continue; + } + if (!self.hasMouseEnterLeave) { + fakeName = self.mouseEnterLeave[name]; + if (fakeName) { + nativeHandler = function (evt) { + var current = evt.currentTarget; + var related = evt.relatedTarget; + if (related && current.contains) { + related = current.contains(related); + } else { + while (related && related !== current) { + related = related.parentNode; + } + } + if (!related) { + evt = fix(evt || win.event); + evt.type = evt.type === 'mouseout' ? 'mouseleave' : 'mouseenter'; + evt.target = current; + self.executeHandlers(evt, id); + } + }; + } + } + if (!self.hasFocusIn && (name === 'focusin' || name === 'focusout')) { + capture = true; + fakeName = name === 'focusin' ? 'focus' : 'blur'; + nativeHandler = function (evt) { + evt = fix(evt || win.event); + evt.type = evt.type === 'focus' ? 'focusin' : 'focusout'; + self.executeHandlers(evt, id); + }; + } + callbackList = self.events[id][name]; + if (!callbackList) { + self.events[id][name] = callbackList = [{ + func: callback, + scope: scope + }]; + callbackList.fakeName = fakeName; + callbackList.capture = capture; + callbackList.nativeHandler = nativeHandler; + if (name === 'ready') { + bindOnReady(target, nativeHandler, self); + } else { + addEvent(target, fakeName || name, nativeHandler, capture); + } + } else { + if (name === 'ready' && self.domLoaded) { + callback(fix({ type: name })); + } else { + callbackList.push({ + func: callback, + scope: scope + }); + } + } + } + target = callbackList = null; + return callback; + }; + EventUtils.prototype.unbind = function (target, names, callback) { + var callbackList, i, ci, name, eventMap; + if (!target || target.nodeType === 3 || target.nodeType === 8) { + return this; + } + var id = target[this.expando]; + if (id) { + eventMap = this.events[id]; + if (names) { + var namesList = names.split(' '); + i = namesList.length; + while (i--) { + name = namesList[i]; + callbackList = eventMap[name]; + if (callbackList) { + if (callback) { + ci = callbackList.length; + while (ci--) { + if (callbackList[ci].func === callback) { + var nativeHandler = callbackList.nativeHandler; + var fakeName = callbackList.fakeName, capture = callbackList.capture; + callbackList = callbackList.slice(0, ci).concat(callbackList.slice(ci + 1)); + callbackList.nativeHandler = nativeHandler; + callbackList.fakeName = fakeName; + callbackList.capture = capture; + eventMap[name] = callbackList; + } + } + } + if (!callback || callbackList.length === 0) { + delete eventMap[name]; + removeEvent(target, callbackList.fakeName || name, callbackList.nativeHandler, callbackList.capture); + } + } + } + } else { + each$1(eventMap, function (callbackList, name) { + removeEvent(target, callbackList.fakeName || name, callbackList.nativeHandler, callbackList.capture); + }); + eventMap = {}; + } + for (name in eventMap) { + if (has(eventMap, name)) { + return this; + } + } + delete this.events[id]; + try { + delete target[this.expando]; + } catch (ex) { + target[this.expando] = null; + } + } + return this; + }; + EventUtils.prototype.fire = function (target, name, args) { + var id; + if (!target || target.nodeType === 3 || target.nodeType === 8) { + return this; + } + var event = fix(null, args); + event.type = name; + event.target = target; + do { + id = target[this.expando]; + if (id) { + this.executeHandlers(event, id); + } + target = target.parentNode || target.ownerDocument || target.defaultView || target.parentWindow; + } while (target && !event.isPropagationStopped()); + return this; + }; + EventUtils.prototype.clean = function (target) { + var i, children; + if (!target || target.nodeType === 3 || target.nodeType === 8) { + return this; + } + if (target[this.expando]) { + this.unbind(target); + } + if (!target.getElementsByTagName) { + target = target.document; + } + if (target && target.getElementsByTagName) { + this.unbind(target); + children = target.getElementsByTagName('*'); + i = children.length; + while (i--) { + target = children[i]; + if (target[this.expando]) { + this.unbind(target); + } + } + } + return this; + }; + EventUtils.prototype.destroy = function () { + this.events = {}; + }; + EventUtils.prototype.cancel = function (e) { + if (e) { + e.preventDefault(); + e.stopImmediatePropagation(); + } + return false; + }; + EventUtils.prototype.executeHandlers = function (evt, id) { + var container = this.events[id]; + var callbackList = container && container[evt.type]; + if (callbackList) { + for (var i = 0, l = callbackList.length; i < l; i++) { + var callback = callbackList[i]; + if (callback && callback.func.call(callback.scope, evt) === false) { + evt.preventDefault(); + } + if (evt.isImmediatePropagationStopped()) { + return; + } + } + } + }; + EventUtils.Event = new EventUtils(); + return EventUtils; + }(); + + var support, Expr, getText, isXML, tokenize, compile, select, outermostContext, sortInput, hasDuplicate, setDocument, document$1, docElem, documentIsHTML, rbuggyQSA, rbuggyMatches, matches, contains$3, expando = 'sizzle' + -new Date(), preferredDoc = window.document, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), sortOrder = function (a, b) { + if (a === b) { + hasDuplicate = true; + } + return 0; + }, strundefined = typeof undefined, MAX_NEGATIVE = 1 << 31, hasOwn = {}.hasOwnProperty, arr = [], pop = arr.pop, push_native = arr.push, push = arr.push, slice = arr.slice, indexOf$2 = arr.indexOf || function (elem) { + var i = 0, len = this.length; + for (; i < len; i++) { + if (this[i] === elem) { + return i; + } + } + return -1; + }, booleans = 'checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped', whitespace = '[\\x20\\t\\r\\n\\f]', identifier = '(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+', attributes = '\\[' + whitespace + '*(' + identifier + ')(?:' + whitespace + '*([*^$|!~]?=)' + whitespace + '*(?:\'((?:\\\\.|[^\\\\\'])*)\'|"((?:\\\\.|[^\\\\"])*)"|(' + identifier + '))|)' + whitespace + '*\\]', pseudos = ':(' + identifier + ')(?:\\((' + '(\'((?:\\\\.|[^\\\\\'])*)\'|"((?:\\\\.|[^\\\\"])*)")|' + '((?:\\\\.|[^\\\\()[\\]]|' + attributes + ')*)|' + '.*' + ')\\)|)', rtrim = new RegExp('^' + whitespace + '+|((?:^|[^\\\\])(?:\\\\.)*)' + whitespace + '+$', 'g'), rcomma = new RegExp('^' + whitespace + '*,' + whitespace + '*'), rcombinators = new RegExp('^' + whitespace + '*([>+~]|' + whitespace + ')' + whitespace + '*'), rattributeQuotes = new RegExp('=' + whitespace + '*([^\\]\'"]*?)' + whitespace + '*\\]', 'g'), rpseudo = new RegExp(pseudos), ridentifier = new RegExp('^' + identifier + '$'), matchExpr = { + ID: new RegExp('^#(' + identifier + ')'), + CLASS: new RegExp('^\\.(' + identifier + ')'), + TAG: new RegExp('^(' + identifier + '|[*])'), + ATTR: new RegExp('^' + attributes), + PSEUDO: new RegExp('^' + pseudos), + CHILD: new RegExp('^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(' + whitespace + '*(even|odd|(([+-]|)(\\d*)n|)' + whitespace + '*(?:([+-]|)' + whitespace + '*(\\d+)|))' + whitespace + '*\\)|)', 'i'), + bool: new RegExp('^(?:' + booleans + ')$', 'i'), + needsContext: new RegExp('^' + whitespace + '*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(' + whitespace + '*((?:-\\d)?\\d*)' + whitespace + '*\\)|)(?=[^-]|$)', 'i') + }, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, rnative = /^[^{]+\{\s*\[native \w/, rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, rescape = /'|\\/g, runescape = new RegExp('\\\\([\\da-f]{1,6}' + whitespace + '?|(' + whitespace + ')|.)', 'ig'), funescape = function (_, escaped, escapedWhitespace) { + var high = '0x' + escaped - 65536; + return high !== high || escapedWhitespace ? escaped : high < 0 ? String.fromCharCode(high + 65536) : String.fromCharCode(high >> 10 | 55296, high & 1023 | 56320); + }; + try { + push.apply(arr = slice.call(preferredDoc.childNodes), preferredDoc.childNodes); + arr[preferredDoc.childNodes.length].nodeType; + } catch (e) { + push = { + apply: arr.length ? function (target, els) { + push_native.apply(target, slice.call(els)); + } : function (target, els) { + var j = target.length, i = 0; + while (target[j++] = els[i++]) { + } + target.length = j - 1; + } + }; + } + var Sizzle = function (selector, context, results, seed) { + var match, elem, m, nodeType, i, groups, old, nid, newContext, newSelector; + if ((context ? context.ownerDocument || context : preferredDoc) !== document$1) { + setDocument(context); + } + context = context || document$1; + results = results || []; + if (!selector || typeof selector !== 'string') { + return results; + } + if ((nodeType = context.nodeType) !== 1 && nodeType !== 9) { + return []; + } + if (documentIsHTML && !seed) { + if (match = rquickExpr.exec(selector)) { + if (m = match[1]) { + if (nodeType === 9) { + elem = context.getElementById(m); + if (elem && elem.parentNode) { + if (elem.id === m) { + results.push(elem); + return results; + } + } else { + return results; + } + } else { + if (context.ownerDocument && (elem = context.ownerDocument.getElementById(m)) && contains$3(context, elem) && elem.id === m) { + results.push(elem); + return results; + } + } + } else if (match[2]) { + push.apply(results, context.getElementsByTagName(selector)); + return results; + } else if ((m = match[3]) && support.getElementsByClassName) { + push.apply(results, context.getElementsByClassName(m)); + return results; + } + } + if (support.qsa && (!rbuggyQSA || !rbuggyQSA.test(selector))) { + nid = old = expando; + newContext = context; + newSelector = nodeType === 9 && selector; + if (nodeType === 1 && context.nodeName.toLowerCase() !== 'object') { + groups = tokenize(selector); + if (old = context.getAttribute('id')) { + nid = old.replace(rescape, '\\$&'); + } else { + context.setAttribute('id', nid); + } + nid = '[id=\'' + nid + '\'] '; + i = groups.length; + while (i--) { + groups[i] = nid + toSelector(groups[i]); + } + newContext = rsibling.test(selector) && testContext(context.parentNode) || context; + newSelector = groups.join(','); + } + if (newSelector) { + try { + push.apply(results, newContext.querySelectorAll(newSelector)); + return results; + } catch (qsaError) { + } finally { + if (!old) { + context.removeAttribute('id'); + } + } + } + } + } + return select(selector.replace(rtrim, '$1'), context, results, seed); + }; + function createCache() { + var keys = []; + function cache(key, value) { + if (keys.push(key + ' ') > Expr.cacheLength) { + delete cache[keys.shift()]; + } + return cache[key + ' '] = value; + } + return cache; + } + function markFunction(fn) { + fn[expando] = true; + return fn; + } + function siblingCheck(a, b) { + var cur = b && a, diff = cur && a.nodeType === 1 && b.nodeType === 1 && (~b.sourceIndex || MAX_NEGATIVE) - (~a.sourceIndex || MAX_NEGATIVE); + if (diff) { + return diff; + } + if (cur) { + while (cur = cur.nextSibling) { + if (cur === b) { + return -1; + } + } + } + return a ? 1 : -1; + } + function createInputPseudo(type) { + return function (elem) { + var name = elem.nodeName.toLowerCase(); + return name === 'input' && elem.type === type; + }; + } + function createButtonPseudo(type) { + return function (elem) { + var name = elem.nodeName.toLowerCase(); + return (name === 'input' || name === 'button') && elem.type === type; + }; + } + function createPositionalPseudo(fn) { + return markFunction(function (argument) { + argument = +argument; + return markFunction(function (seed, matches) { + var j, matchIndexes = fn([], seed.length, argument), i = matchIndexes.length; + while (i--) { + if (seed[j = matchIndexes[i]]) { + seed[j] = !(matches[j] = seed[j]); + } + } + }); + }); + } + function testContext(context) { + return context && typeof context.getElementsByTagName !== strundefined && context; + } + support = Sizzle.support = {}; + isXML = Sizzle.isXML = function (elem) { + var documentElement = elem && (elem.ownerDocument || elem).documentElement; + return documentElement ? documentElement.nodeName !== 'HTML' : false; + }; + setDocument = Sizzle.setDocument = function (node) { + var hasCompare, doc = node ? node.ownerDocument || node : preferredDoc, parent = doc.defaultView; + function getTop(win) { + try { + return win.top; + } catch (ex) { + } + return null; + } + if (doc === document$1 || doc.nodeType !== 9 || !doc.documentElement) { + return document$1; + } + document$1 = doc; + docElem = doc.documentElement; + documentIsHTML = !isXML(doc); + if (parent && parent !== getTop(parent)) { + if (parent.addEventListener) { + parent.addEventListener('unload', function () { + setDocument(); + }, false); + } else if (parent.attachEvent) { + parent.attachEvent('onunload', function () { + setDocument(); + }); + } + } + support.attributes = true; + support.getElementsByTagName = true; + support.getElementsByClassName = rnative.test(doc.getElementsByClassName); + support.getById = true; + Expr.find.ID = function (id, context) { + if (typeof context.getElementById !== strundefined && documentIsHTML) { + var m = context.getElementById(id); + return m && m.parentNode ? [m] : []; + } + }; + Expr.filter.ID = function (id) { + var attrId = id.replace(runescape, funescape); + return function (elem) { + return elem.getAttribute('id') === attrId; + }; + }; + Expr.find.TAG = support.getElementsByTagName ? function (tag, context) { + if (typeof context.getElementsByTagName !== strundefined) { + return context.getElementsByTagName(tag); + } + } : function (tag, context) { + var elem, tmp = [], i = 0, results = context.getElementsByTagName(tag); + if (tag === '*') { + while (elem = results[i++]) { + if (elem.nodeType === 1) { + tmp.push(elem); + } + } + return tmp; + } + return results; + }; + Expr.find.CLASS = support.getElementsByClassName && function (className, context) { + if (documentIsHTML) { + return context.getElementsByClassName(className); + } + }; + rbuggyMatches = []; + rbuggyQSA = []; + support.disconnectedMatch = true; + rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join('|')); + rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join('|')); + hasCompare = rnative.test(docElem.compareDocumentPosition); + contains$3 = hasCompare || rnative.test(docElem.contains) ? function (a, b) { + var adown = a.nodeType === 9 ? a.documentElement : a, bup = b && b.parentNode; + return a === bup || !!(bup && bup.nodeType === 1 && (adown.contains ? adown.contains(bup) : a.compareDocumentPosition && a.compareDocumentPosition(bup) & 16)); + } : function (a, b) { + if (b) { + while (b = b.parentNode) { + if (b === a) { + return true; + } + } + } + return false; + }; + sortOrder = hasCompare ? function (a, b) { + if (a === b) { + hasDuplicate = true; + return 0; + } + var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; + if (compare) { + return compare; + } + compare = (a.ownerDocument || a) === (b.ownerDocument || b) ? a.compareDocumentPosition(b) : 1; + if (compare & 1 || !support.sortDetached && b.compareDocumentPosition(a) === compare) { + if (a === doc || a.ownerDocument === preferredDoc && contains$3(preferredDoc, a)) { + return -1; + } + if (b === doc || b.ownerDocument === preferredDoc && contains$3(preferredDoc, b)) { + return 1; + } + return sortInput ? indexOf$2.call(sortInput, a) - indexOf$2.call(sortInput, b) : 0; + } + return compare & 4 ? -1 : 1; + } : function (a, b) { + if (a === b) { + hasDuplicate = true; + return 0; + } + var cur, i = 0, aup = a.parentNode, bup = b.parentNode, ap = [a], bp = [b]; + if (!aup || !bup) { + return a === doc ? -1 : b === doc ? 1 : aup ? -1 : bup ? 1 : sortInput ? indexOf$2.call(sortInput, a) - indexOf$2.call(sortInput, b) : 0; + } else if (aup === bup) { + return siblingCheck(a, b); + } + cur = a; + while (cur = cur.parentNode) { + ap.unshift(cur); + } + cur = b; + while (cur = cur.parentNode) { + bp.unshift(cur); + } + while (ap[i] === bp[i]) { + i++; + } + return i ? siblingCheck(ap[i], bp[i]) : ap[i] === preferredDoc ? -1 : bp[i] === preferredDoc ? 1 : 0; + }; + return doc; + }; + Sizzle.matches = function (expr, elements) { + return Sizzle(expr, null, null, elements); + }; + Sizzle.matchesSelector = function (elem, expr) { + if ((elem.ownerDocument || elem) !== document$1) { + setDocument(elem); + } + expr = expr.replace(rattributeQuotes, '=\'$1\']'); + if (support.matchesSelector && documentIsHTML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && (!rbuggyQSA || !rbuggyQSA.test(expr))) { + try { + var ret = matches.call(elem, expr); + if (ret || support.disconnectedMatch || elem.document && elem.document.nodeType !== 11) { + return ret; + } + } catch (e) { + } + } + return Sizzle(expr, document$1, null, [elem]).length > 0; + }; + Sizzle.contains = function (context, elem) { + if ((context.ownerDocument || context) !== document$1) { + setDocument(context); + } + return contains$3(context, elem); + }; + Sizzle.attr = function (elem, name) { + if ((elem.ownerDocument || elem) !== document$1) { + setDocument(elem); + } + var fn = Expr.attrHandle[name.toLowerCase()], val = fn && hasOwn.call(Expr.attrHandle, name.toLowerCase()) ? fn(elem, name, !documentIsHTML) : undefined; + return val !== undefined ? val : support.attributes || !documentIsHTML ? elem.getAttribute(name) : (val = elem.getAttributeNode(name)) && val.specified ? val.value : null; + }; + Sizzle.error = function (msg) { + throw new Error('Syntax error, unrecognized expression: ' + msg); + }; + Sizzle.uniqueSort = function (results) { + var elem, duplicates = [], j = 0, i = 0; + hasDuplicate = !support.detectDuplicates; + sortInput = !support.sortStable && results.slice(0); + results.sort(sortOrder); + if (hasDuplicate) { + while (elem = results[i++]) { + if (elem === results[i]) { + j = duplicates.push(i); + } + } + while (j--) { + results.splice(duplicates[j], 1); + } + } + sortInput = null; + return results; + }; + getText = Sizzle.getText = function (elem) { + var node, ret = '', i = 0, nodeType = elem.nodeType; + if (!nodeType) { + while (node = elem[i++]) { + ret += getText(node); + } + } else if (nodeType === 1 || nodeType === 9 || nodeType === 11) { + if (typeof elem.textContent === 'string') { + return elem.textContent; + } else { + for (elem = elem.firstChild; elem; elem = elem.nextSibling) { + ret += getText(elem); + } + } + } else if (nodeType === 3 || nodeType === 4) { + return elem.nodeValue; + } + return ret; + }; + Expr = Sizzle.selectors = { + cacheLength: 50, + createPseudo: markFunction, + match: matchExpr, + attrHandle: {}, + find: {}, + relative: { + '>': { + dir: 'parentNode', + first: true + }, + ' ': { dir: 'parentNode' }, + '+': { + dir: 'previousSibling', + first: true + }, + '~': { dir: 'previousSibling' } + }, + preFilter: { + ATTR: function (match) { + match[1] = match[1].replace(runescape, funescape); + match[3] = (match[3] || match[4] || match[5] || '').replace(runescape, funescape); + if (match[2] === '~=') { + match[3] = ' ' + match[3] + ' '; + } + return match.slice(0, 4); + }, + CHILD: function (match) { + match[1] = match[1].toLowerCase(); + if (match[1].slice(0, 3) === 'nth') { + if (!match[3]) { + Sizzle.error(match[0]); + } + match[4] = +(match[4] ? match[5] + (match[6] || 1) : 2 * (match[3] === 'even' || match[3] === 'odd')); + match[5] = +(match[7] + match[8] || match[3] === 'odd'); + } else if (match[3]) { + Sizzle.error(match[0]); + } + return match; + }, + PSEUDO: function (match) { + var excess, unquoted = !match[6] && match[2]; + if (matchExpr.CHILD.test(match[0])) { + return null; + } + if (match[3]) { + match[2] = match[4] || match[5] || ''; + } else if (unquoted && rpseudo.test(unquoted) && (excess = tokenize(unquoted, true)) && (excess = unquoted.indexOf(')', unquoted.length - excess) - unquoted.length)) { + match[0] = match[0].slice(0, excess); + match[2] = unquoted.slice(0, excess); + } + return match.slice(0, 3); + } + }, + filter: { + TAG: function (nodeNameSelector) { + var nodeName = nodeNameSelector.replace(runescape, funescape).toLowerCase(); + return nodeNameSelector === '*' ? function () { + return true; + } : function (elem) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + CLASS: function (className) { + var pattern = classCache[className + ' ']; + return pattern || (pattern = new RegExp('(^|' + whitespace + ')' + className + '(' + whitespace + '|$)')) && classCache(className, function (elem) { + return pattern.test(typeof elem.className === 'string' && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute('class') || ''); + }); + }, + ATTR: function (name, operator, check) { + return function (elem) { + var result = Sizzle.attr(elem, name); + if (result == null) { + return operator === '!='; + } + if (!operator) { + return true; + } + result += ''; + return operator === '=' ? result === check : operator === '!=' ? result !== check : operator === '^=' ? check && result.indexOf(check) === 0 : operator === '*=' ? check && result.indexOf(check) > -1 : operator === '$=' ? check && result.slice(-check.length) === check : operator === '~=' ? (' ' + result + ' ').indexOf(check) > -1 : operator === '|=' ? result === check || result.slice(0, check.length + 1) === check + '-' : false; + }; + }, + CHILD: function (type, what, argument, first, last) { + var simple = type.slice(0, 3) !== 'nth', forward = type.slice(-4) !== 'last', ofType = what === 'of-type'; + return first === 1 && last === 0 ? function (elem) { + return !!elem.parentNode; + } : function (elem, context, xml) { + var cache, outerCache, node, diff, nodeIndex, start, dir = simple !== forward ? 'nextSibling' : 'previousSibling', parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), useCache = !xml && !ofType; + if (parent) { + if (simple) { + while (dir) { + node = elem; + while (node = node[dir]) { + if (ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) { + return false; + } + } + start = dir = type === 'only' && !start && 'nextSibling'; + } + return true; + } + start = [forward ? parent.firstChild : parent.lastChild]; + if (forward && useCache) { + outerCache = parent[expando] || (parent[expando] = {}); + cache = outerCache[type] || []; + nodeIndex = cache[0] === dirruns && cache[1]; + diff = cache[0] === dirruns && cache[2]; + node = nodeIndex && parent.childNodes[nodeIndex]; + while (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) { + if (node.nodeType === 1 && ++diff && node === elem) { + outerCache[type] = [ + dirruns, + nodeIndex, + diff + ]; + break; + } + } + } else if (useCache && (cache = (elem[expando] || (elem[expando] = {}))[type]) && cache[0] === dirruns) { + diff = cache[1]; + } else { + while (node = ++nodeIndex && node && node[dir] || (diff = nodeIndex = 0) || start.pop()) { + if ((ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1) && ++diff) { + if (useCache) { + (node[expando] || (node[expando] = {}))[type] = [ + dirruns, + diff + ]; + } + if (node === elem) { + break; + } + } + } + } + diff -= last; + return diff === first || diff % first === 0 && diff / first >= 0; + } + }; + }, + PSEUDO: function (pseudo, argument) { + var args, fn = Expr.pseudos[pseudo] || Expr.setFilters[pseudo.toLowerCase()] || Sizzle.error('unsupported pseudo: ' + pseudo); + if (fn[expando]) { + return fn(argument); + } + if (fn.length > 1) { + args = [ + pseudo, + pseudo, + '', + argument + ]; + return Expr.setFilters.hasOwnProperty(pseudo.toLowerCase()) ? markFunction(function (seed, matches) { + var idx, matched = fn(seed, argument), i = matched.length; + while (i--) { + idx = indexOf$2.call(seed, matched[i]); + seed[idx] = !(matches[idx] = matched[i]); + } + }) : function (elem) { + return fn(elem, 0, args); + }; + } + return fn; + } + }, + pseudos: { + not: markFunction(function (selector) { + var input = [], results = [], matcher = compile(selector.replace(rtrim, '$1')); + return matcher[expando] ? markFunction(function (seed, matches, context, xml) { + var elem, unmatched = matcher(seed, null, xml, []), i = seed.length; + while (i--) { + if (elem = unmatched[i]) { + seed[i] = !(matches[i] = elem); + } + } + }) : function (elem, context, xml) { + input[0] = elem; + matcher(input, null, xml, results); + return !results.pop(); + }; + }), + has: markFunction(function (selector) { + return function (elem) { + return Sizzle(selector, elem).length > 0; + }; + }), + contains: markFunction(function (text) { + text = text.replace(runescape, funescape); + return function (elem) { + return (elem.textContent || elem.innerText || getText(elem)).indexOf(text) > -1; + }; + }), + lang: markFunction(function (lang) { + if (!ridentifier.test(lang || '')) { + Sizzle.error('unsupported lang: ' + lang); + } + lang = lang.replace(runescape, funescape).toLowerCase(); + return function (elem) { + var elemLang; + do { + if (elemLang = documentIsHTML ? elem.lang : elem.getAttribute('xml:lang') || elem.getAttribute('lang')) { + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf(lang + '-') === 0; + } + } while ((elem = elem.parentNode) && elem.nodeType === 1); + return false; + }; + }), + target: function (elem) { + var hash = window.location && window.location.hash; + return hash && hash.slice(1) === elem.id; + }, + root: function (elem) { + return elem === docElem; + }, + focus: function (elem) { + return elem === document$1.activeElement && (!document$1.hasFocus || document$1.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); + }, + enabled: function (elem) { + return elem.disabled === false; + }, + disabled: function (elem) { + return elem.disabled === true; + }, + checked: function (elem) { + var nodeName = elem.nodeName.toLowerCase(); + return nodeName === 'input' && !!elem.checked || nodeName === 'option' && !!elem.selected; + }, + selected: function (elem) { + if (elem.parentNode) { + elem.parentNode.selectedIndex; + } + return elem.selected === true; + }, + empty: function (elem) { + for (elem = elem.firstChild; elem; elem = elem.nextSibling) { + if (elem.nodeType < 6) { + return false; + } + } + return true; + }, + parent: function (elem) { + return !Expr.pseudos.empty(elem); + }, + header: function (elem) { + return rheader.test(elem.nodeName); + }, + input: function (elem) { + return rinputs.test(elem.nodeName); + }, + button: function (elem) { + var name = elem.nodeName.toLowerCase(); + return name === 'input' && elem.type === 'button' || name === 'button'; + }, + text: function (elem) { + var attr; + return elem.nodeName.toLowerCase() === 'input' && elem.type === 'text' && ((attr = elem.getAttribute('type')) == null || attr.toLowerCase() === 'text'); + }, + first: createPositionalPseudo(function () { + return [0]; + }), + last: createPositionalPseudo(function (matchIndexes, length) { + return [length - 1]; + }), + eq: createPositionalPseudo(function (matchIndexes, length, argument) { + return [argument < 0 ? argument + length : argument]; + }), + even: createPositionalPseudo(function (matchIndexes, length) { + var i = 0; + for (; i < length; i += 2) { + matchIndexes.push(i); + } + return matchIndexes; + }), + odd: createPositionalPseudo(function (matchIndexes, length) { + var i = 1; + for (; i < length; i += 2) { + matchIndexes.push(i); + } + return matchIndexes; + }), + lt: createPositionalPseudo(function (matchIndexes, length, argument) { + var i = argument < 0 ? argument + length : argument; + for (; --i >= 0;) { + matchIndexes.push(i); + } + return matchIndexes; + }), + gt: createPositionalPseudo(function (matchIndexes, length, argument) { + var i = argument < 0 ? argument + length : argument; + for (; ++i < length;) { + matchIndexes.push(i); + } + return matchIndexes; + }) + } + }; + Expr.pseudos.nth = Expr.pseudos.eq; + each([ + 'radio', + 'checkbox', + 'file', + 'password', + 'image' + ], function (i) { + Expr.pseudos[i] = createInputPseudo(i); + }); + each([ + 'submit', + 'reset' + ], function (i) { + Expr.pseudos[i] = createButtonPseudo(i); + }); + function setFilters() { + } + setFilters.prototype = Expr.filters = Expr.pseudos; + Expr.setFilters = new setFilters(); + tokenize = Sizzle.tokenize = function (selector, parseOnly) { + var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[selector + ' ']; + if (cached) { + return parseOnly ? 0 : cached.slice(0); + } + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + while (soFar) { + if (!matched || (match = rcomma.exec(soFar))) { + if (match) { + soFar = soFar.slice(match[0].length) || soFar; + } + groups.push(tokens = []); + } + matched = false; + if (match = rcombinators.exec(soFar)) { + matched = match.shift(); + tokens.push({ + value: matched, + type: match[0].replace(rtrim, ' ') + }); + soFar = soFar.slice(matched.length); + } + for (type in Expr.filter) { + if (!Expr.filter.hasOwnProperty(type)) { + continue; + } + if ((match = matchExpr[type].exec(soFar)) && (!preFilters[type] || (match = preFilters[type](match)))) { + matched = match.shift(); + tokens.push({ + value: matched, + type: type, + matches: match + }); + soFar = soFar.slice(matched.length); + } + } + if (!matched) { + break; + } + } + return parseOnly ? soFar.length : soFar ? Sizzle.error(selector) : tokenCache(selector, groups).slice(0); + }; + function toSelector(tokens) { + var i = 0, len = tokens.length, selector = ''; + for (; i < len; i++) { + selector += tokens[i].value; + } + return selector; + } + function addCombinator(matcher, combinator, base) { + var dir = combinator.dir, checkNonElements = base && dir === 'parentNode', doneName = done++; + return combinator.first ? function (elem, context, xml) { + while (elem = elem[dir]) { + if (elem.nodeType === 1 || checkNonElements) { + return matcher(elem, context, xml); + } + } + } : function (elem, context, xml) { + var oldCache, outerCache, newCache = [ + dirruns, + doneName + ]; + if (xml) { + while (elem = elem[dir]) { + if (elem.nodeType === 1 || checkNonElements) { + if (matcher(elem, context, xml)) { + return true; + } + } + } + } else { + while (elem = elem[dir]) { + if (elem.nodeType === 1 || checkNonElements) { + outerCache = elem[expando] || (elem[expando] = {}); + if ((oldCache = outerCache[dir]) && oldCache[0] === dirruns && oldCache[1] === doneName) { + return newCache[2] = oldCache[2]; + } else { + outerCache[dir] = newCache; + if (newCache[2] = matcher(elem, context, xml)) { + return true; + } + } + } + } + } + }; + } + function elementMatcher(matchers) { + return matchers.length > 1 ? function (elem, context, xml) { + var i = matchers.length; + while (i--) { + if (!matchers[i](elem, context, xml)) { + return false; + } + } + return true; + } : matchers[0]; + } + function multipleContexts(selector, contexts, results) { + var i = 0, len = contexts.length; + for (; i < len; i++) { + Sizzle(selector, contexts[i], results); + } + return results; + } + function condense(unmatched, map, filter, context, xml) { + var elem, newUnmatched = [], i = 0, len = unmatched.length, mapped = map != null; + for (; i < len; i++) { + if (elem = unmatched[i]) { + if (!filter || filter(elem, context, xml)) { + newUnmatched.push(elem); + if (mapped) { + map.push(i); + } + } + } + } + return newUnmatched; + } + function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) { + if (postFilter && !postFilter[expando]) { + postFilter = setMatcher(postFilter); + } + if (postFinder && !postFinder[expando]) { + postFinder = setMatcher(postFinder, postSelector); + } + return markFunction(function (seed, results, context, xml) { + var temp, i, elem, preMap = [], postMap = [], preexisting = results.length, elems = seed || multipleContexts(selector || '*', context.nodeType ? [context] : context, []), matcherIn = preFilter && (seed || !selector) ? condense(elems, preMap, preFilter, context, xml) : elems, matcherOut = matcher ? postFinder || (seed ? preFilter : preexisting || postFilter) ? [] : results : matcherIn; + if (matcher) { + matcher(matcherIn, matcherOut, context, xml); + } + if (postFilter) { + temp = condense(matcherOut, postMap); + postFilter(temp, [], context, xml); + i = temp.length; + while (i--) { + if (elem = temp[i]) { + matcherOut[postMap[i]] = !(matcherIn[postMap[i]] = elem); + } + } + } + if (seed) { + if (postFinder || preFilter) { + if (postFinder) { + temp = []; + i = matcherOut.length; + while (i--) { + if (elem = matcherOut[i]) { + temp.push(matcherIn[i] = elem); + } + } + postFinder(null, matcherOut = [], temp, xml); + } + i = matcherOut.length; + while (i--) { + if ((elem = matcherOut[i]) && (temp = postFinder ? indexOf$2.call(seed, elem) : preMap[i]) > -1) { + seed[temp] = !(results[temp] = elem); + } + } + } + } else { + matcherOut = condense(matcherOut === results ? matcherOut.splice(preexisting, matcherOut.length) : matcherOut); + if (postFinder) { + postFinder(null, results, matcherOut, xml); + } else { + push.apply(results, matcherOut); + } + } + }); + } + function matcherFromTokens(tokens) { + var checkContext, matcher, j, len = tokens.length, leadingRelative = Expr.relative[tokens[0].type], implicitRelative = leadingRelative || Expr.relative[' '], i = leadingRelative ? 1 : 0, matchContext = addCombinator(function (elem) { + return elem === checkContext; + }, implicitRelative, true), matchAnyContext = addCombinator(function (elem) { + return indexOf$2.call(checkContext, elem) > -1; + }, implicitRelative, true), matchers = [function (elem, context, xml) { + return !leadingRelative && (xml || context !== outermostContext) || ((checkContext = context).nodeType ? matchContext(elem, context, xml) : matchAnyContext(elem, context, xml)); + }]; + for (; i < len; i++) { + if (matcher = Expr.relative[tokens[i].type]) { + matchers = [addCombinator(elementMatcher(matchers), matcher)]; + } else { + matcher = Expr.filter[tokens[i].type].apply(null, tokens[i].matches); + if (matcher[expando]) { + j = ++i; + for (; j < len; j++) { + if (Expr.relative[tokens[j].type]) { + break; + } + } + return setMatcher(i > 1 && elementMatcher(matchers), i > 1 && toSelector(tokens.slice(0, i - 1).concat({ value: tokens[i - 2].type === ' ' ? '*' : '' })).replace(rtrim, '$1'), matcher, i < j && matcherFromTokens(tokens.slice(i, j)), j < len && matcherFromTokens(tokens = tokens.slice(j)), j < len && toSelector(tokens)); + } + matchers.push(matcher); + } + } + return elementMatcher(matchers); + } + function matcherFromGroupMatchers(elementMatchers, setMatchers) { + var bySet = setMatchers.length > 0, byElement = elementMatchers.length > 0, superMatcher = function (seed, context, xml, results, outermost) { + var elem, j, matcher, matchedCount = 0, i = '0', unmatched = seed && [], setMatched = [], contextBackup = outermostContext, elems = seed || byElement && Expr.find.TAG('*', outermost), dirrunsUnique = dirruns += contextBackup == null ? 1 : Math.random() || 0.1, len = elems.length; + if (outermost) { + outermostContext = context !== document$1 && context; + } + for (; i !== len && (elem = elems[i]) != null; i++) { + if (byElement && elem) { + j = 0; + while (matcher = elementMatchers[j++]) { + if (matcher(elem, context, xml)) { + results.push(elem); + break; + } + } + if (outermost) { + dirruns = dirrunsUnique; + } + } + if (bySet) { + if (elem = !matcher && elem) { + matchedCount--; + } + if (seed) { + unmatched.push(elem); + } + } + } + matchedCount += i; + if (bySet && i !== matchedCount) { + j = 0; + while (matcher = setMatchers[j++]) { + matcher(unmatched, setMatched, context, xml); + } + if (seed) { + if (matchedCount > 0) { + while (i--) { + if (!(unmatched[i] || setMatched[i])) { + setMatched[i] = pop.call(results); + } + } + } + setMatched = condense(setMatched); + } + push.apply(results, setMatched); + if (outermost && !seed && setMatched.length > 0 && matchedCount + setMatchers.length > 1) { + Sizzle.uniqueSort(results); + } + } + if (outermost) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + return unmatched; + }; + return bySet ? markFunction(superMatcher) : superMatcher; + } + compile = Sizzle.compile = function (selector, match) { + var i, setMatchers = [], elementMatchers = [], cached = compilerCache[selector + ' ']; + if (!cached) { + if (!match) { + match = tokenize(selector); + } + i = match.length; + while (i--) { + cached = matcherFromTokens(match[i]); + if (cached[expando]) { + setMatchers.push(cached); + } else { + elementMatchers.push(cached); + } + } + cached = compilerCache(selector, matcherFromGroupMatchers(elementMatchers, setMatchers)); + cached.selector = selector; + } + return cached; + }; + select = Sizzle.select = function (selector, context, results, seed) { + var i, tokens, token, type, find, compiled = typeof selector === 'function' && selector, match = !seed && tokenize(selector = compiled.selector || selector); + results = results || []; + if (match.length === 1) { + tokens = match[0] = match[0].slice(0); + if (tokens.length > 2 && (token = tokens[0]).type === 'ID' && support.getById && context.nodeType === 9 && documentIsHTML && Expr.relative[tokens[1].type]) { + context = (Expr.find.ID(token.matches[0].replace(runescape, funescape), context) || [])[0]; + if (!context) { + return results; + } else if (compiled) { + context = context.parentNode; + } + selector = selector.slice(tokens.shift().value.length); + } + i = matchExpr.needsContext.test(selector) ? 0 : tokens.length; + while (i--) { + token = tokens[i]; + if (Expr.relative[type = token.type]) { + break; + } + if (find = Expr.find[type]) { + if (seed = find(token.matches[0].replace(runescape, funescape), rsibling.test(tokens[0].type) && testContext(context.parentNode) || context)) { + tokens.splice(i, 1); + selector = seed.length && toSelector(tokens); + if (!selector) { + push.apply(results, seed); + return results; + } + break; + } + } + } + } + (compiled || compile(selector, match))(seed, context, !documentIsHTML, results, rsibling.test(selector) && testContext(context.parentNode) || context); + return results; + }; + support.sortStable = expando.split('').sort(sortOrder).join('') === expando; + support.detectDuplicates = !!hasDuplicate; + setDocument(); + support.sortDetached = true; + + var doc = document, push$1 = Array.prototype.push, slice$1 = Array.prototype.slice; + var rquickExpr$1 = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/; + var Event = EventUtils.Event; + var skipUniques = Tools.makeMap('children,contents,next,prev'); + var isDefined = function (obj) { + return typeof obj !== 'undefined'; + }; + var isString$1 = function (obj) { + return typeof obj === 'string'; + }; + var isWindow = function (obj) { + return obj && obj === obj.window; + }; + var createFragment = function (html, fragDoc) { + fragDoc = fragDoc || doc; + var container = fragDoc.createElement('div'); + var frag = fragDoc.createDocumentFragment(); + container.innerHTML = html; + var node; + while (node = container.firstChild) { + frag.appendChild(node); + } + return frag; + }; + var domManipulate = function (targetNodes, sourceItem, callback, reverse) { + var i; + if (isString$1(sourceItem)) { + sourceItem = createFragment(sourceItem, getElementDocument(targetNodes[0])); + } else if (sourceItem.length && !sourceItem.nodeType) { + sourceItem = DomQuery.makeArray(sourceItem); + if (reverse) { + for (i = sourceItem.length - 1; i >= 0; i--) { + domManipulate(targetNodes, sourceItem[i], callback, reverse); + } + } else { + for (i = 0; i < sourceItem.length; i++) { + domManipulate(targetNodes, sourceItem[i], callback, reverse); + } + } + return targetNodes; + } + if (sourceItem.nodeType) { + i = targetNodes.length; + while (i--) { + callback.call(targetNodes[i], sourceItem); + } + } + return targetNodes; + }; + var hasClass = function (node, className) { + return node && className && (' ' + node.className + ' ').indexOf(' ' + className + ' ') !== -1; + }; + var wrap$1 = function (elements, wrapper, all) { + var lastParent, newWrapper; + wrapper = DomQuery(wrapper)[0]; + elements.each(function () { + var self = this; + if (!all || lastParent !== self.parentNode) { + lastParent = self.parentNode; + newWrapper = wrapper.cloneNode(false); + self.parentNode.insertBefore(newWrapper, self); + newWrapper.appendChild(self); + } else { + newWrapper.appendChild(self); + } + }); + return elements; + }; + var numericCssMap = Tools.makeMap('fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom', ' '); + var booleanMap = Tools.makeMap('checked compact declare defer disabled ismap multiple nohref noshade nowrap readonly selected', ' '); + var propFix = { + for: 'htmlFor', + class: 'className', + readonly: 'readOnly' + }; + var cssFix = { float: 'cssFloat' }; + var attrHooks = {}, cssHooks = {}; + var DomQueryConstructor = function (selector, context) { + return new DomQuery.fn.init(selector, context); + }; + var inArray$1 = function (item, array) { + var i; + if (array.indexOf) { + return array.indexOf(item); + } + i = array.length; + while (i--) { + if (array[i] === item) { + return i; + } + } + return -1; + }; + var whiteSpaceRegExp$2 = /^\s*|\s*$/g; + var trim$3 = function (str) { + return str === null || str === undefined ? '' : ('' + str).replace(whiteSpaceRegExp$2, ''); + }; + var each$4 = function (obj, callback) { + var length, key, i, value; + if (obj) { + length = obj.length; + if (length === undefined) { + for (key in obj) { + if (obj.hasOwnProperty(key)) { + value = obj[key]; + if (callback.call(value, key, value) === false) { + break; + } + } + } + } else { + for (i = 0; i < length; i++) { + value = obj[i]; + if (callback.call(value, i, value) === false) { + break; + } + } + } + } + return obj; + }; + var grep = function (array, callback) { + var out = []; + each$4(array, function (i, item) { + if (callback(item, i)) { + out.push(item); + } + }); + return out; + }; + var getElementDocument = function (element) { + if (!element) { + return doc; + } + if (element.nodeType === 9) { + return element; + } + return element.ownerDocument; + }; + DomQueryConstructor.fn = DomQueryConstructor.prototype = { + constructor: DomQueryConstructor, + selector: '', + context: null, + length: 0, + init: function (selector, context) { + var self = this; + var match, node; + if (!selector) { + return self; + } + if (selector.nodeType) { + self.context = self[0] = selector; + self.length = 1; + return self; + } + if (context && context.nodeType) { + self.context = context; + } else { + if (context) { + return DomQuery(selector).attr(context); + } + self.context = context = document; + } + if (isString$1(selector)) { + self.selector = selector; + if (selector.charAt(0) === '<' && selector.charAt(selector.length - 1) === '>' && selector.length >= 3) { + match = [ + null, + selector, + null + ]; + } else { + match = rquickExpr$1.exec(selector); + } + if (match) { + if (match[1]) { + node = createFragment(selector, getElementDocument(context)).firstChild; + while (node) { + push$1.call(self, node); + node = node.nextSibling; + } + } else { + node = getElementDocument(context).getElementById(match[2]); + if (!node) { + return self; + } + if (node.id !== match[2]) { + return self.find(selector); + } + self.length = 1; + self[0] = node; + } + } else { + return DomQuery(context).find(selector); + } + } else { + this.add(selector, false); + } + return self; + }, + toArray: function () { + return Tools.toArray(this); + }, + add: function (items, sort) { + var self = this; + var nodes, i; + if (isString$1(items)) { + return self.add(DomQuery(items)); + } + if (sort !== false) { + nodes = DomQuery.unique(self.toArray().concat(DomQuery.makeArray(items))); + self.length = nodes.length; + for (i = 0; i < nodes.length; i++) { + self[i] = nodes[i]; + } + } else { + push$1.apply(self, DomQuery.makeArray(items)); + } + return self; + }, + attr: function (name, value) { + var self = this; + var hook; + if (typeof name === 'object') { + each$4(name, function (name, value) { + self.attr(name, value); + }); + } else if (isDefined(value)) { + this.each(function () { + var hook; + if (this.nodeType === 1) { + hook = attrHooks[name]; + if (hook && hook.set) { + hook.set(this, value); + return; + } + if (value === null) { + this.removeAttribute(name, 2); + } else { + this.setAttribute(name, value, 2); + } + } + }); + } else { + if (self[0] && self[0].nodeType === 1) { + hook = attrHooks[name]; + if (hook && hook.get) { + return hook.get(self[0], name); + } + if (booleanMap[name]) { + return self.prop(name) ? name : undefined; + } + value = self[0].getAttribute(name, 2); + if (value === null) { + value = undefined; + } + } + return value; + } + return self; + }, + removeAttr: function (name) { + return this.attr(name, null); + }, + prop: function (name, value) { + var self = this; + name = propFix[name] || name; + if (typeof name === 'object') { + each$4(name, function (name, value) { + self.prop(name, value); + }); + } else if (isDefined(value)) { + this.each(function () { + if (this.nodeType === 1) { + this[name] = value; + } + }); + } else { + if (self[0] && self[0].nodeType && name in self[0]) { + return self[0][name]; + } + return value; + } + return self; + }, + css: function (name, value) { + var self = this; + var elm, hook; + var camel = function (name) { + return name.replace(/-(\D)/g, function (a, b) { + return b.toUpperCase(); + }); + }; + var dashed = function (name) { + return name.replace(/[A-Z]/g, function (a) { + return '-' + a; + }); + }; + if (typeof name === 'object') { + each$4(name, function (name, value) { + self.css(name, value); + }); + } else { + if (isDefined(value)) { + name = camel(name); + if (typeof value === 'number' && !numericCssMap[name]) { + value = value.toString() + 'px'; + } + self.each(function () { + var style = this.style; + hook = cssHooks[name]; + if (hook && hook.set) { + hook.set(this, value); + return; + } + try { + this.style[cssFix[name] || name] = value; + } catch (ex) { + } + if (value === null || value === '') { + if (style.removeProperty) { + style.removeProperty(dashed(name)); + } else { + style.removeAttribute(name); + } + } + }); + } else { + elm = self[0]; + hook = cssHooks[name]; + if (hook && hook.get) { + return hook.get(elm); + } + if (elm.ownerDocument.defaultView) { + try { + return elm.ownerDocument.defaultView.getComputedStyle(elm, null).getPropertyValue(dashed(name)); + } catch (ex) { + return undefined; + } + } else if (elm.currentStyle) { + return elm.currentStyle[camel(name)]; + } else { + return ''; + } + } + } + return self; + }, + remove: function () { + var self = this; + var node, i = this.length; + while (i--) { + node = self[i]; + Event.clean(node); + if (node.parentNode) { + node.parentNode.removeChild(node); + } + } + return this; + }, + empty: function () { + var self = this; + var node, i = this.length; + while (i--) { + node = self[i]; + while (node.firstChild) { + node.removeChild(node.firstChild); + } + } + return this; + }, + html: function (value) { + var self = this; + var i; + if (isDefined(value)) { + i = self.length; + try { + while (i--) { + self[i].innerHTML = value; + } + } catch (ex) { + DomQuery(self[i]).empty().append(value); + } + return self; + } + return self[0] ? self[0].innerHTML : ''; + }, + text: function (value) { + var self = this; + var i; + if (isDefined(value)) { + i = self.length; + while (i--) { + if ('innerText' in self[i]) { + self[i].innerText = value; + } else { + self[0].textContent = value; + } + } + return self; + } + return self[0] ? self[0].innerText || self[0].textContent : ''; + }, + append: function () { + return domManipulate(this, arguments, function (node) { + if (this.nodeType === 1 || this.host && this.host.nodeType === 1) { + this.appendChild(node); + } + }); + }, + prepend: function () { + return domManipulate(this, arguments, function (node) { + if (this.nodeType === 1 || this.host && this.host.nodeType === 1) { + this.insertBefore(node, this.firstChild); + } + }, true); + }, + before: function () { + var self = this; + if (self[0] && self[0].parentNode) { + return domManipulate(self, arguments, function (node) { + this.parentNode.insertBefore(node, this); + }); + } + return self; + }, + after: function () { + var self = this; + if (self[0] && self[0].parentNode) { + return domManipulate(self, arguments, function (node) { + this.parentNode.insertBefore(node, this.nextSibling); + }, true); + } + return self; + }, + appendTo: function (val) { + DomQuery(val).append(this); + return this; + }, + prependTo: function (val) { + DomQuery(val).prepend(this); + return this; + }, + replaceWith: function (content) { + return this.before(content).remove(); + }, + wrap: function (content) { + return wrap$1(this, content); + }, + wrapAll: function (content) { + return wrap$1(this, content, true); + }, + wrapInner: function (content) { + this.each(function () { + DomQuery(this).contents().wrapAll(content); + }); + return this; + }, + unwrap: function () { + return this.parent().each(function () { + DomQuery(this).replaceWith(this.childNodes); + }); + }, + clone: function () { + var result = []; + this.each(function () { + result.push(this.cloneNode(true)); + }); + return DomQuery(result); + }, + addClass: function (className) { + return this.toggleClass(className, true); + }, + removeClass: function (className) { + return this.toggleClass(className, false); + }, + toggleClass: function (className, state) { + var self = this; + if (typeof className !== 'string') { + return self; + } + if (className.indexOf(' ') !== -1) { + each$4(className.split(' '), function () { + self.toggleClass(this, state); + }); + } else { + self.each(function (index, node) { + var classState = hasClass(node, className); + if (classState !== state) { + var existingClassName = node.className; + if (classState) { + node.className = trim$3((' ' + existingClassName + ' ').replace(' ' + className + ' ', ' ')); + } else { + node.className += existingClassName ? ' ' + className : className; + } + } + }); + } + return self; + }, + hasClass: function (className) { + return hasClass(this[0], className); + }, + each: function (callback) { + return each$4(this, callback); + }, + on: function (name, callback) { + return this.each(function () { + Event.bind(this, name, callback); + }); + }, + off: function (name, callback) { + return this.each(function () { + Event.unbind(this, name, callback); + }); + }, + trigger: function (name) { + return this.each(function () { + if (typeof name === 'object') { + Event.fire(this, name.type, name); + } else { + Event.fire(this, name); + } + }); + }, + show: function () { + return this.css('display', ''); + }, + hide: function () { + return this.css('display', 'none'); + }, + slice: function () { + return new DomQuery(slice$1.apply(this, arguments)); + }, + eq: function (index) { + return index === -1 ? this.slice(index) : this.slice(index, +index + 1); + }, + first: function () { + return this.eq(0); + }, + last: function () { + return this.eq(-1); + }, + find: function (selector) { + var i, l; + var ret = []; + for (i = 0, l = this.length; i < l; i++) { + DomQuery.find(selector, this[i], ret); + } + return DomQuery(ret); + }, + filter: function (selector) { + if (typeof selector === 'function') { + return DomQuery(grep(this.toArray(), function (item, i) { + return selector(i, item); + })); + } + return DomQuery(DomQuery.filter(selector, this.toArray())); + }, + closest: function (selector) { + var result = []; + if (selector instanceof DomQuery) { + selector = selector[0]; + } + this.each(function (i, node) { + while (node) { + if (typeof selector === 'string' && DomQuery(node).is(selector)) { + result.push(node); + break; + } else if (node === selector) { + result.push(node); + break; + } + node = node.parentNode; + } + }); + return DomQuery(result); + }, + offset: function (offset) { + var elm, doc, docElm; + var x = 0, y = 0, pos; + if (!offset) { + elm = this[0]; + if (elm) { + doc = elm.ownerDocument; + docElm = doc.documentElement; + if (elm.getBoundingClientRect) { + pos = elm.getBoundingClientRect(); + x = pos.left + (docElm.scrollLeft || doc.body.scrollLeft) - docElm.clientLeft; + y = pos.top + (docElm.scrollTop || doc.body.scrollTop) - docElm.clientTop; + } + } + return { + left: x, + top: y + }; + } + return this.css(offset); + }, + push: push$1, + sort: Array.prototype.sort, + splice: Array.prototype.splice + }; + Tools.extend(DomQueryConstructor, { + extend: Tools.extend, + makeArray: function (object) { + if (isWindow(object) || object.nodeType) { + return [object]; + } + return Tools.toArray(object); + }, + inArray: inArray$1, + isArray: Tools.isArray, + each: each$4, + trim: trim$3, + grep: grep, + find: Sizzle, + expr: Sizzle.selectors, + unique: Sizzle.uniqueSort, + text: Sizzle.getText, + contains: Sizzle.contains, + filter: function (expr, elems, not) { + var i = elems.length; + if (not) { + expr = ':not(' + expr + ')'; + } + while (i--) { + if (elems[i].nodeType !== 1) { + elems.splice(i, 1); + } + } + if (elems.length === 1) { + elems = DomQuery.find.matchesSelector(elems[0], expr) ? [elems[0]] : []; + } else { + elems = DomQuery.find.matches(expr, elems); + } + return elems; + } + }); + var dir = function (el, prop, until) { + var matched = []; + var cur = el[prop]; + if (typeof until !== 'string' && until instanceof DomQuery) { + until = until[0]; + } + while (cur && cur.nodeType !== 9) { + if (until !== undefined) { + if (cur === until) { + break; + } + if (typeof until === 'string' && DomQuery(cur).is(until)) { + break; + } + } + if (cur.nodeType === 1) { + matched.push(cur); + } + cur = cur[prop]; + } + return matched; + }; + var sibling = function (node, siblingName, nodeType, until) { + var result = []; + if (until instanceof DomQuery) { + until = until[0]; + } + for (; node; node = node[siblingName]) { + if (nodeType && node.nodeType !== nodeType) { + continue; + } + if (until !== undefined) { + if (node === until) { + break; + } + if (typeof until === 'string' && DomQuery(node).is(until)) { + break; + } + } + result.push(node); + } + return result; + }; + var firstSibling = function (node, siblingName, nodeType) { + for (node = node[siblingName]; node; node = node[siblingName]) { + if (node.nodeType === nodeType) { + return node; + } + } + return null; + }; + each$4({ + parent: function (node) { + var parent = node.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function (node) { + return dir(node, 'parentNode'); + }, + next: function (node) { + return firstSibling(node, 'nextSibling', 1); + }, + prev: function (node) { + return firstSibling(node, 'previousSibling', 1); + }, + children: function (node) { + return sibling(node.firstChild, 'nextSibling', 1); + }, + contents: function (node) { + return Tools.toArray((node.nodeName === 'iframe' ? node.contentDocument || node.contentWindow.document : node).childNodes); + } + }, function (name, fn) { + DomQueryConstructor.fn[name] = function (selector) { + var self = this; + var result = []; + self.each(function () { + var nodes = fn.call(result, this, selector, result); + if (nodes) { + if (DomQuery.isArray(nodes)) { + result.push.apply(result, nodes); + } else { + result.push(nodes); + } + } + }); + if (this.length > 1) { + if (!skipUniques[name]) { + result = DomQuery.unique(result); + } + if (name.indexOf('parents') === 0) { + result = result.reverse(); + } + } + var wrappedResult = DomQuery(result); + if (selector) { + return wrappedResult.filter(selector); + } + return wrappedResult; + }; + }); + each$4({ + parentsUntil: function (node, until) { + return dir(node, 'parentNode', until); + }, + nextUntil: function (node, until) { + return sibling(node, 'nextSibling', 1, until).slice(1); + }, + prevUntil: function (node, until) { + return sibling(node, 'previousSibling', 1, until).slice(1); + } + }, function (name, fn) { + DomQueryConstructor.fn[name] = function (selector, filter) { + var self = this; + var result = []; + self.each(function () { + var nodes = fn.call(result, this, selector, result); + if (nodes) { + if (DomQuery.isArray(nodes)) { + result.push.apply(result, nodes); + } else { + result.push(nodes); + } + } + }); + if (this.length > 1) { + result = DomQuery.unique(result); + if (name.indexOf('parents') === 0 || name === 'prevUntil') { + result = result.reverse(); + } + } + var wrappedResult = DomQuery(result); + if (filter) { + return wrappedResult.filter(filter); + } + return wrappedResult; + }; + }); + DomQueryConstructor.fn.is = function (selector) { + return !!selector && this.filter(selector).length > 0; + }; + DomQueryConstructor.fn.init.prototype = DomQueryConstructor.fn; + DomQueryConstructor.overrideDefaults = function (callback) { + var defaults; + var sub = function (selector, context) { + defaults = defaults || callback(); + if (arguments.length === 0) { + selector = defaults.element; + } + if (!context) { + context = defaults.context; + } + return new sub.fn.init(selector, context); + }; + DomQuery.extend(sub, this); + return sub; + }; + DomQueryConstructor.attrHooks = attrHooks; + DomQueryConstructor.cssHooks = cssHooks; + var DomQuery = DomQueryConstructor; + + var each$5 = Tools.each; + var grep$1 = Tools.grep; + var isIE = Env.ie; + var simpleSelectorRe = /^([a-z0-9],?)+$/i; + var setupAttrHooks = function (styles, settings, getContext) { + var keepValues = settings.keep_values; + var keepUrlHook = { + set: function ($elm, value, name) { + if (settings.url_converter) { + value = settings.url_converter.call(settings.url_converter_scope || getContext(), value, name, $elm[0]); + } + $elm.attr('data-mce-' + name, value).attr(name, value); + }, + get: function ($elm, name) { + return $elm.attr('data-mce-' + name) || $elm.attr(name); + } + }; + var attrHooks = { + style: { + set: function ($elm, value) { + if (value !== null && typeof value === 'object') { + $elm.css(value); + return; + } + if (keepValues) { + $elm.attr('data-mce-style', value); + } + if (value !== null && typeof value === 'string') { + $elm.removeAttr('style'); + $elm.css(styles.parse(value)); + } else { + $elm.attr('style', value); + } + }, + get: function ($elm) { + var value = $elm.attr('data-mce-style') || $elm.attr('style'); + value = styles.serialize(styles.parse(value), $elm[0].nodeName); + return value; + } + } + }; + if (keepValues) { + attrHooks.href = attrHooks.src = keepUrlHook; + } + return attrHooks; + }; + var updateInternalStyleAttr = function (styles, $elm) { + var rawValue = $elm.attr('style'); + var value = styles.serialize(styles.parse(rawValue), $elm[0].nodeName); + if (!value) { + value = null; + } + $elm.attr('data-mce-style', value); + }; + var findNodeIndex = function (node, normalized) { + var idx = 0, lastNodeType, nodeType; + if (node) { + for (lastNodeType = node.nodeType, node = node.previousSibling; node; node = node.previousSibling) { + nodeType = node.nodeType; + if (normalized && nodeType === 3) { + if (nodeType === lastNodeType || !node.nodeValue.length) { + continue; + } + } + idx++; + lastNodeType = nodeType; + } + } + return idx; + }; + function DOMUtils(doc, settings) { + var _this = this; + if (settings === void 0) { + settings = {}; + } + var addedStyles = {}; + var win = window; + var files = {}; + var counter = 0; + var stdMode = true; + var boxModel = true; + var styleSheetLoader = instance.forElement(SugarElement.fromDom(doc), { + contentCssCors: settings.contentCssCors, + referrerPolicy: settings.referrerPolicy + }); + var boundEvents = []; + var schema = settings.schema ? settings.schema : Schema({}); + var styles = Styles({ + url_converter: settings.url_converter, + url_converter_scope: settings.url_converter_scope + }, settings.schema); + var events = settings.ownEvents ? new EventUtils() : EventUtils.Event; + var blockElementsMap = schema.getBlockElements(); + var $ = DomQuery.overrideDefaults(function () { + return { + context: doc, + element: self.getRoot() + }; + }); + var isBlock = function (node) { + if (typeof node === 'string') { + return !!blockElementsMap[node]; + } else if (node) { + var type = node.nodeType; + if (type) { + return !!(type === 1 && blockElementsMap[node.nodeName]); + } + } + return false; + }; + var get = function (elm) { + return elm && doc && isString(elm) ? doc.getElementById(elm) : elm; + }; + var $$ = function (elm) { + return $(typeof elm === 'string' ? get(elm) : elm); + }; + var getAttrib = function (elm, name, defaultVal) { + var hook, value; + var $elm = $$(elm); + if ($elm.length) { + hook = attrHooks[name]; + if (hook && hook.get) { + value = hook.get($elm, name); + } else { + value = $elm.attr(name); + } + } + if (typeof value === 'undefined') { + value = defaultVal || ''; + } + return value; + }; + var getAttribs = function (elm) { + var node = get(elm); + if (!node) { + return []; + } + return node.attributes; + }; + var setAttrib = function (elm, name, value) { + if (value === '') { + value = null; + } + var $elm = $$(elm); + var originalValue = $elm.attr(name); + if (!$elm.length) { + return; + } + var hook = attrHooks[name]; + if (hook && hook.set) { + hook.set($elm, value, name); + } else { + $elm.attr(name, value); + } + if (originalValue !== value && settings.onSetAttrib) { + settings.onSetAttrib({ + attrElm: $elm, + attrName: name, + attrValue: value + }); + } + }; + var clone = function (node, deep) { + if (!isIE || node.nodeType !== 1 || deep) { + return node.cloneNode(deep); + } else { + var clone_1 = doc.createElement(node.nodeName); + each$5(getAttribs(node), function (attr) { + setAttrib(clone_1, attr.nodeName, getAttrib(node, attr.nodeName)); + }); + return clone_1; + } + }; + var getRoot = function () { + return settings.root_element || doc.body; + }; + var getViewPort = function (argWin) { + var vp = getBounds(argWin); + return { + x: vp.x, + y: vp.y, + w: vp.width, + h: vp.height + }; + }; + var getPos$1 = function (elm, rootElm) { + return getPos(doc.body, get(elm), rootElm); + }; + var setStyle = function (elm, name, value) { + var $elm = isString(name) ? $$(elm).css(name, value) : $$(elm).css(name); + if (settings.update_styles) { + updateInternalStyleAttr(styles, $elm); + } + }; + var setStyles = function (elm, stylesArg) { + var $elm = $$(elm).css(stylesArg); + if (settings.update_styles) { + updateInternalStyleAttr(styles, $elm); + } + }; + var getStyle = function (elm, name, computed) { + var $elm = $$(elm); + if (computed) { + return $elm.css(name); + } + name = name.replace(/-(\D)/g, function (a, b) { + return b.toUpperCase(); + }); + if (name === 'float') { + name = Env.browser.isIE() ? 'styleFloat' : 'cssFloat'; + } + return $elm[0] && $elm[0].style ? $elm[0].style[name] : undefined; + }; + var getSize = function (elm) { + var w, h; + elm = get(elm); + w = getStyle(elm, 'width'); + h = getStyle(elm, 'height'); + if (w.indexOf('px') === -1) { + w = 0; + } + if (h.indexOf('px') === -1) { + h = 0; + } + return { + w: parseInt(w, 10) || elm.offsetWidth || elm.clientWidth, + h: parseInt(h, 10) || elm.offsetHeight || elm.clientHeight + }; + }; + var getRect = function (elm) { + elm = get(elm); + var pos = getPos$1(elm); + var size = getSize(elm); + return { + x: pos.x, + y: pos.y, + w: size.w, + h: size.h + }; + }; + var is = function (elm, selector) { + var i; + if (!elm) { + return false; + } + if (!Array.isArray(elm)) { + if (selector === '*') { + return elm.nodeType === 1; + } + if (simpleSelectorRe.test(selector)) { + var selectors = selector.toLowerCase().split(/,/); + var elmName = elm.nodeName.toLowerCase(); + for (i = selectors.length - 1; i >= 0; i--) { + if (selectors[i] === elmName) { + return true; + } + } + return false; + } + if (elm.nodeType && elm.nodeType !== 1) { + return false; + } + } + var elms = !Array.isArray(elm) ? [elm] : elm; + return Sizzle(selector, elms[0].ownerDocument || elms[0], null, elms).length > 0; + }; + var getParents = function (elm, selector, root, collect) { + var result = []; + var selectorVal; + var node = get(elm); + collect = collect === undefined; + root = root || (getRoot().nodeName !== 'BODY' ? getRoot().parentNode : null); + if (Tools.is(selector, 'string')) { + selectorVal = selector; + if (selector === '*') { + selector = function (node) { + return node.nodeType === 1; + }; + } else { + selector = function (node) { + return is(node, selectorVal); + }; + } + } + while (node) { + if (node === root || !node.nodeType || node.nodeType === 9) { + break; + } + if (!selector || typeof selector === 'function' && selector(node)) { + if (collect) { + result.push(node); + } else { + return [node]; + } + } + node = node.parentNode; + } + return collect ? result : null; + }; + var getParent = function (node, selector, root) { + var parents = getParents(node, selector, root, false); + return parents && parents.length > 0 ? parents[0] : null; + }; + var _findSib = function (node, selector, name) { + var func = selector; + if (node) { + if (typeof selector === 'string') { + func = function (node) { + return is(node, selector); + }; + } + for (node = node[name]; node; node = node[name]) { + if (typeof func === 'function' && func(node)) { + return node; + } + } + } + return null; + }; + var getNext = function (node, selector) { + return _findSib(node, selector, 'nextSibling'); + }; + var getPrev = function (node, selector) { + return _findSib(node, selector, 'previousSibling'); + }; + var select = function (selector, scope) { + return Sizzle(selector, get(scope) || settings.root_element || doc, []); + }; + var run = function (elm, func, scope) { + var result; + var node = typeof elm === 'string' ? get(elm) : elm; + if (!node) { + return false; + } + if (Tools.isArray(node) && (node.length || node.length === 0)) { + result = []; + each$5(node, function (elm, i) { + if (elm) { + result.push(func.call(scope, typeof elm === 'string' ? get(elm) : elm, i)); + } + }); + return result; + } + var context = scope ? scope : _this; + return func.call(context, node); + }; + var setAttribs = function (elm, attrs) { + $$(elm).each(function (i, node) { + each$5(attrs, function (value, name) { + setAttrib(node, name, value); + }); + }); + }; + var setHTML = function (elm, html) { + var $elm = $$(elm); + if (isIE) { + $elm.each(function (i, target) { + if (target.canHaveHTML === false) { + return; + } + while (target.firstChild) { + target.removeChild(target.firstChild); + } + try { + target.innerHTML = '
    ' + html; + target.removeChild(target.firstChild); + } catch (ex) { + DomQuery('
    ').html('
    ' + html).contents().slice(1).appendTo(target); + } + return html; + }); + } else { + $elm.html(html); + } + }; + var add = function (parentElm, name, attrs, html, create) { + return run(parentElm, function (parentElm) { + var newElm = typeof name === 'string' ? doc.createElement(name) : name; + setAttribs(newElm, attrs); + if (html) { + if (typeof html !== 'string' && html.nodeType) { + newElm.appendChild(html); + } else if (typeof html === 'string') { + setHTML(newElm, html); + } + } + return !create ? parentElm.appendChild(newElm) : newElm; + }); + }; + var create = function (name, attrs, html) { + return add(doc.createElement(name), name, attrs, html, true); + }; + var decode = Entities.decode; + var encode = Entities.encodeAllRaw; + var createHTML = function (name, attrs, html) { + var outHtml = '', key; + outHtml += '<' + name; + for (key in attrs) { + if (attrs.hasOwnProperty(key) && attrs[key] !== null && typeof attrs[key] !== 'undefined') { + outHtml += ' ' + key + '="' + encode(attrs[key]) + '"'; + } + } + if (typeof html !== 'undefined') { + return outHtml + '>' + html + ''; + } + return outHtml + ' />'; + }; + var createFragment = function (html) { + var node; + var container = doc.createElement('div'); + var frag = doc.createDocumentFragment(); + frag.appendChild(container); + if (html) { + container.innerHTML = html; + } + while (node = container.firstChild) { + frag.appendChild(node); + } + frag.removeChild(container); + return frag; + }; + var remove = function (node, keepChildren) { + var $node = $$(node); + if (keepChildren) { + $node.each(function () { + var child; + while (child = this.firstChild) { + if (child.nodeType === 3 && child.data.length === 0) { + this.removeChild(child); + } else { + this.parentNode.insertBefore(child, this); + } + } + }).remove(); + } else { + $node.remove(); + } + return $node.length > 1 ? $node.toArray() : $node[0]; + }; + var removeAllAttribs = function (e) { + return run(e, function (e) { + var i; + var attrs = e.attributes; + for (i = attrs.length - 1; i >= 0; i--) { + e.removeAttributeNode(attrs.item(i)); + } + }); + }; + var parseStyle = function (cssText) { + return styles.parse(cssText); + }; + var serializeStyle = function (stylesArg, name) { + return styles.serialize(stylesArg, name); + }; + var addStyle = function (cssText) { + var head, styleElm; + if (self !== DOMUtils.DOM && doc === document) { + if (addedStyles[cssText]) { + return; + } + addedStyles[cssText] = true; + } + styleElm = doc.getElementById('mceDefaultStyles'); + if (!styleElm) { + styleElm = doc.createElement('style'); + styleElm.id = 'mceDefaultStyles'; + styleElm.type = 'text/css'; + head = doc.getElementsByTagName('head')[0]; + if (head.firstChild) { + head.insertBefore(styleElm, head.firstChild); + } else { + head.appendChild(styleElm); + } + } + if (styleElm.styleSheet) { + styleElm.styleSheet.cssText += cssText; + } else { + styleElm.appendChild(doc.createTextNode(cssText)); + } + }; + var loadCSS = function (urls) { + if (!urls) { + urls = ''; + } + each(urls.split(','), function (url) { + files[url] = true; + styleSheetLoader.load(url, noop); + }); + }; + var toggleClass = function (elm, cls, state) { + $$(elm).toggleClass(cls, state).each(function () { + if (this.className === '') { + DomQuery(this).attr('class', null); + } + }); + }; + var addClass = function (elm, cls) { + $$(elm).addClass(cls); + }; + var removeClass = function (elm, cls) { + toggleClass(elm, cls, false); + }; + var hasClass = function (elm, cls) { + return $$(elm).hasClass(cls); + }; + var show = function (elm) { + $$(elm).show(); + }; + var hide = function (elm) { + $$(elm).hide(); + }; + var isHidden = function (elm) { + return $$(elm).css('display') === 'none'; + }; + var uniqueId = function (prefix) { + return (!prefix ? 'mce_' : prefix) + counter++; + }; + var getOuterHTML = function (elm) { + var node = typeof elm === 'string' ? get(elm) : elm; + return isElement$1(node) ? node.outerHTML : DomQuery('
    ').append(DomQuery(node).clone()).html(); + }; + var setOuterHTML = function (elm, html) { + $$(elm).each(function () { + try { + if ('outerHTML' in this) { + this.outerHTML = html; + return; + } + } catch (ex) { + } + remove(DomQuery(this).html(html), true); + }); + }; + var insertAfter = function (node, reference) { + var referenceNode = get(reference); + return run(node, function (node) { + var parent = referenceNode.parentNode; + var nextSibling = referenceNode.nextSibling; + if (nextSibling) { + parent.insertBefore(node, nextSibling); + } else { + parent.appendChild(node); + } + return node; + }); + }; + var replace = function (newElm, oldElm, keepChildren) { + return run(oldElm, function (oldElm) { + if (Tools.is(oldElm, 'array')) { + newElm = newElm.cloneNode(true); + } + if (keepChildren) { + each$5(grep$1(oldElm.childNodes), function (node) { + newElm.appendChild(node); + }); + } + return oldElm.parentNode.replaceChild(newElm, oldElm); + }); + }; + var rename = function (elm, name) { + var newElm; + if (elm.nodeName !== name.toUpperCase()) { + newElm = create(name); + each$5(getAttribs(elm), function (attrNode) { + setAttrib(newElm, attrNode.nodeName, getAttrib(elm, attrNode.nodeName)); + }); + replace(newElm, elm, true); + } + return newElm || elm; + }; + var findCommonAncestor = function (a, b) { + var ps = a, pe; + while (ps) { + pe = b; + while (pe && ps !== pe) { + pe = pe.parentNode; + } + if (ps === pe) { + break; + } + ps = ps.parentNode; + } + if (!ps && a.ownerDocument) { + return a.ownerDocument.documentElement; + } + return ps; + }; + var toHex = function (rgbVal) { + return styles.toHex(Tools.trim(rgbVal)); + }; + var isNonEmptyElement = function (node) { + if (isElement$1(node)) { + var isNamedAnchor = node.nodeName.toLowerCase() === 'a' && !getAttrib(node, 'href') && getAttrib(node, 'id'); + if (getAttrib(node, 'name') || getAttrib(node, 'data-mce-bookmark') || isNamedAnchor) { + return true; + } + } + return false; + }; + var isEmpty = function (node, elements) { + var type, name, brCount = 0; + if (isNonEmptyElement(node)) { + return false; + } + node = node.firstChild; + if (node) { + var walker = new DomTreeWalker(node, node.parentNode); + var whitespace = schema ? schema.getWhiteSpaceElements() : {}; + elements = elements || (schema ? schema.getNonEmptyElements() : null); + do { + type = node.nodeType; + if (isElement$1(node)) { + var bogusVal = node.getAttribute('data-mce-bogus'); + if (bogusVal) { + node = walker.next(bogusVal === 'all'); + continue; + } + name = node.nodeName.toLowerCase(); + if (elements && elements[name]) { + if (name === 'br') { + brCount++; + node = walker.next(); + continue; + } + return false; + } + if (isNonEmptyElement(node)) { + return false; + } + } + if (type === 8) { + return false; + } + if (type === 3 && !isWhitespaceText(node.nodeValue)) { + return false; + } + if (type === 3 && node.parentNode && whitespace[node.parentNode.nodeName] && isWhitespaceText(node.nodeValue)) { + return false; + } + node = walker.next(); + } while (node); + } + return brCount <= 1; + }; + var createRng = function () { + return doc.createRange(); + }; + var split = function (parentElm, splitElm, replacementElm) { + var range = createRng(); + var beforeFragment; + var afterFragment; + var parentNode; + if (parentElm && splitElm) { + range.setStart(parentElm.parentNode, findNodeIndex(parentElm)); + range.setEnd(splitElm.parentNode, findNodeIndex(splitElm)); + beforeFragment = range.extractContents(); + range = createRng(); + range.setStart(splitElm.parentNode, findNodeIndex(splitElm) + 1); + range.setEnd(parentElm.parentNode, findNodeIndex(parentElm) + 1); + afterFragment = range.extractContents(); + parentNode = parentElm.parentNode; + parentNode.insertBefore(trimNode(self, beforeFragment), parentElm); + if (replacementElm) { + parentNode.insertBefore(replacementElm, parentElm); + } else { + parentNode.insertBefore(splitElm, parentElm); + } + parentNode.insertBefore(trimNode(self, afterFragment), parentElm); + remove(parentElm); + return replacementElm || splitElm; + } + }; + var bind = function (target, name, func, scope) { + if (Tools.isArray(target)) { + var i = target.length; + var rv = []; + while (i--) { + rv[i] = bind(target[i], name, func, scope); + } + return rv; + } + if (settings.collect && (target === doc || target === win)) { + boundEvents.push([ + target, + name, + func, + scope + ]); + } + var output = events.bind(target, name, func, scope || self); + return output; + }; + var unbind = function (target, name, func) { + if (Tools.isArray(target)) { + var i = target.length; + var rv = []; + while (i--) { + rv[i] = unbind(target[i], name, func); + } + return rv; + } else { + if (boundEvents.length > 0 && (target === doc || target === win)) { + var i = boundEvents.length; + while (i--) { + var item = boundEvents[i]; + if (target === item[0] && (!name || name === item[1]) && (!func || func === item[2])) { + events.unbind(item[0], item[1], item[2]); + } + } + } + return events.unbind(target, name, func); + } + }; + var fire = function (target, name, evt) { + return events.fire(target, name, evt); + }; + var getContentEditable = function (node) { + if (node && isElement$1(node)) { + var contentEditable = node.getAttribute('data-mce-contenteditable'); + if (contentEditable && contentEditable !== 'inherit') { + return contentEditable; + } + return node.contentEditable !== 'inherit' ? node.contentEditable : null; + } else { + return null; + } + }; + var getContentEditableParent = function (node) { + var root = getRoot(); + var state = null; + for (; node && node !== root; node = node.parentNode) { + state = getContentEditable(node); + if (state !== null) { + break; + } + } + return state; + }; + var destroy = function () { + if (boundEvents.length > 0) { + var i = boundEvents.length; + while (i--) { + var item = boundEvents[i]; + events.unbind(item[0], item[1], item[2]); + } + } + each$1(files, function (_, url) { + styleSheetLoader.unload(url); + delete files[url]; + }); + if (Sizzle.setDocument) { + Sizzle.setDocument(); + } + }; + var isChildOf = function (node, parent) { + while (node) { + if (parent === node) { + return true; + } + node = node.parentNode; + } + return false; + }; + var dumpRng = function (r) { + return 'startContainer: ' + r.startContainer.nodeName + ', startOffset: ' + r.startOffset + ', endContainer: ' + r.endContainer.nodeName + ', endOffset: ' + r.endOffset; + }; + var self = { + doc: doc, + settings: settings, + win: win, + files: files, + stdMode: stdMode, + boxModel: boxModel, + styleSheetLoader: styleSheetLoader, + boundEvents: boundEvents, + styles: styles, + schema: schema, + events: events, + isBlock: isBlock, + $: $, + $$: $$, + root: null, + clone: clone, + getRoot: getRoot, + getViewPort: getViewPort, + getRect: getRect, + getSize: getSize, + getParent: getParent, + getParents: getParents, + get: get, + getNext: getNext, + getPrev: getPrev, + select: select, + is: is, + add: add, + create: create, + createHTML: createHTML, + createFragment: createFragment, + remove: remove, + setStyle: setStyle, + getStyle: getStyle, + setStyles: setStyles, + removeAllAttribs: removeAllAttribs, + setAttrib: setAttrib, + setAttribs: setAttribs, + getAttrib: getAttrib, + getPos: getPos$1, + parseStyle: parseStyle, + serializeStyle: serializeStyle, + addStyle: addStyle, + loadCSS: loadCSS, + addClass: addClass, + removeClass: removeClass, + hasClass: hasClass, + toggleClass: toggleClass, + show: show, + hide: hide, + isHidden: isHidden, + uniqueId: uniqueId, + setHTML: setHTML, + getOuterHTML: getOuterHTML, + setOuterHTML: setOuterHTML, + decode: decode, + encode: encode, + insertAfter: insertAfter, + replace: replace, + rename: rename, + findCommonAncestor: findCommonAncestor, + toHex: toHex, + run: run, + getAttribs: getAttribs, + isEmpty: isEmpty, + createRng: createRng, + nodeIndex: findNodeIndex, + split: split, + bind: bind, + unbind: unbind, + fire: fire, + getContentEditable: getContentEditable, + getContentEditableParent: getContentEditableParent, + destroy: destroy, + isChildOf: isChildOf, + dumpRng: dumpRng + }; + var attrHooks = setupAttrHooks(styles, settings, function () { + return self; + }); + return self; + } + (function (DOMUtils) { + DOMUtils.DOM = DOMUtils(document); + DOMUtils.nodeIndex = findNodeIndex; + }(DOMUtils || (DOMUtils = {}))); + var DOMUtils$1 = DOMUtils; + + var DOM = DOMUtils$1.DOM; + var each$6 = Tools.each, grep$2 = Tools.grep; + var QUEUED = 0; + var LOADING = 1; + var LOADED = 2; + var FAILED = 3; + var ScriptLoader = function () { + function ScriptLoader(settings) { + if (settings === void 0) { + settings = {}; + } + this.states = {}; + this.queue = []; + this.scriptLoadedCallbacks = {}; + this.queueLoadedCallbacks = []; + this.loading = 0; + this.settings = settings; + } + ScriptLoader.prototype._setReferrerPolicy = function (referrerPolicy) { + this.settings.referrerPolicy = referrerPolicy; + }; + ScriptLoader.prototype.loadScript = function (url, success, failure) { + var dom = DOM; + var elm; + var done = function () { + dom.remove(id); + if (elm) { + elm.onreadystatechange = elm.onload = elm = null; + } + success(); + }; + var error = function () { + if (isFunction(failure)) { + failure(); + } else { + if (typeof console !== 'undefined' && console.log) { + console.log('Failed to load script: ' + url); + } + } + }; + var id = dom.uniqueId(); + elm = document.createElement('script'); + elm.id = id; + elm.type = 'text/javascript'; + elm.src = Tools._addCacheSuffix(url); + if (this.settings.referrerPolicy) { + dom.setAttrib(elm, 'referrerpolicy', this.settings.referrerPolicy); + } + elm.onload = done; + elm.onerror = error; + (document.getElementsByTagName('head')[0] || document.body).appendChild(elm); + }; + ScriptLoader.prototype.isDone = function (url) { + return this.states[url] === LOADED; + }; + ScriptLoader.prototype.markDone = function (url) { + this.states[url] = LOADED; + }; + ScriptLoader.prototype.add = function (url, success, scope, failure) { + var state = this.states[url]; + if (state === undefined) { + this.queue.push(url); + this.states[url] = QUEUED; + } + if (success) { + if (!this.scriptLoadedCallbacks[url]) { + this.scriptLoadedCallbacks[url] = []; + } + this.scriptLoadedCallbacks[url].push({ + success: success, + failure: failure, + scope: scope || this + }); + } + }; + ScriptLoader.prototype.load = function (url, success, scope, failure) { + return this.add(url, success, scope, failure); + }; + ScriptLoader.prototype.remove = function (url) { + delete this.states[url]; + delete this.scriptLoadedCallbacks[url]; + }; + ScriptLoader.prototype.loadQueue = function (success, scope, failure) { + this.loadScripts(this.queue, success, scope, failure); + }; + ScriptLoader.prototype.loadScripts = function (scripts, success, scope, failure) { + var self = this; + var failures = []; + var execCallbacks = function (name, url) { + each$6(self.scriptLoadedCallbacks[url], function (callback) { + if (isFunction(callback[name])) { + callback[name].call(callback.scope); + } + }); + self.scriptLoadedCallbacks[url] = undefined; + }; + self.queueLoadedCallbacks.push({ + success: success, + failure: failure, + scope: scope || this + }); + var loadScripts = function () { + var loadingScripts = grep$2(scripts); + scripts.length = 0; + each$6(loadingScripts, function (url) { + if (self.states[url] === LOADED) { + execCallbacks('success', url); + return; + } + if (self.states[url] === FAILED) { + execCallbacks('failure', url); + return; + } + if (self.states[url] !== LOADING) { + self.states[url] = LOADING; + self.loading++; + self.loadScript(url, function () { + self.states[url] = LOADED; + self.loading--; + execCallbacks('success', url); + loadScripts(); + }, function () { + self.states[url] = FAILED; + self.loading--; + failures.push(url); + execCallbacks('failure', url); + loadScripts(); + }); + } + }); + if (!self.loading) { + var notifyCallbacks = self.queueLoadedCallbacks.slice(0); + self.queueLoadedCallbacks.length = 0; + each$6(notifyCallbacks, function (callback) { + if (failures.length === 0) { + if (isFunction(callback.success)) { + callback.success.call(callback.scope); + } + } else { + if (isFunction(callback.failure)) { + callback.failure.call(callback.scope, failures); + } + } + }); + } + }; + loadScripts(); + }; + ScriptLoader.ScriptLoader = new ScriptLoader(); + return ScriptLoader; + }(); + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + return { + get: get, + set: set + }; + }; + + var isRaw = function (str) { + return isObject(str) && has(str, 'raw'); + }; + var isTokenised = function (str) { + return isArray(str) && str.length > 1; + }; + var data = {}; + var currentCode = Cell('en'); + var getLanguageData = function () { + return get(data, currentCode.get()); + }; + var getData = function () { + return map$1(data, function (value) { + return __assign({}, value); + }); + }; + var setCode = function (newCode) { + if (newCode) { + currentCode.set(newCode); + } + }; + var getCode = function () { + return currentCode.get(); + }; + var add = function (code, items) { + var langData = data[code]; + if (!langData) { + data[code] = langData = {}; + } + each$1(items, function (translation, name) { + langData[name.toLowerCase()] = translation; + }); + }; + var translate = function (text) { + var langData = getLanguageData().getOr({}); + var toString = function (obj) { + if (isFunction(obj)) { + return Object.prototype.toString.call(obj); + } + return !isEmpty(obj) ? '' + obj : ''; + }; + var isEmpty = function (text) { + return text === '' || text === null || text === undefined; + }; + var getLangData = function (text) { + var textstr = toString(text); + return get(langData, textstr.toLowerCase()).map(toString).getOr(textstr); + }; + var removeContext = function (str) { + return str.replace(/{context:\w+}$/, ''); + }; + if (isEmpty(text)) { + return ''; + } + if (isRaw(text)) { + return toString(text.raw); + } + if (isTokenised(text)) { + var values_1 = text.slice(1); + var substitued = getLangData(text[0]).replace(/\{([0-9]+)\}/g, function ($1, $2) { + return has(values_1, $2) ? toString(values_1[$2]) : $1; + }); + return removeContext(substitued); + } + return removeContext(getLangData(text)); + }; + var isRtl = function () { + return getLanguageData().bind(function (items) { + return get(items, '_dir'); + }).exists(function (dir) { + return dir === 'rtl'; + }); + }; + var hasCode = function (code) { + return has(data, code); + }; + var I18n = { + getData: getData, + setCode: setCode, + getCode: getCode, + add: add, + translate: translate, + isRtl: isRtl, + hasCode: hasCode + }; + + function AddOnManager() { + var _this = this; + var items = []; + var urls = {}; + var lookup = {}; + var _listeners = []; + var runListeners = function (name, state) { + var matchedListeners = filter(_listeners, function (listener) { + return listener.name === name && listener.state === state; + }); + each(matchedListeners, function (listener) { + return listener.callback(); + }); + }; + var get = function (name) { + if (lookup[name]) { + return lookup[name].instance; + } + return undefined; + }; + var dependencies = function (name) { + var result; + if (lookup[name]) { + result = lookup[name].dependencies; + } + return result || []; + }; + var requireLangPack = function (name, languages) { + if (AddOnManager.languageLoad !== false) { + waitFor(name, function () { + var language = I18n.getCode(); + var wrappedLanguages = ',' + (languages || '') + ','; + if (!language || languages && wrappedLanguages.indexOf(',' + language + ',') === -1) { + return; + } + ScriptLoader.ScriptLoader.add(urls[name] + '/langs/' + language + '.js'); + }, 'loaded'); + } + }; + var add = function (id, addOn, dependencies) { + var addOnConstructor = addOn; + items.push(addOnConstructor); + lookup[id] = { + instance: addOnConstructor, + dependencies: dependencies + }; + runListeners(id, 'added'); + return addOnConstructor; + }; + var remove = function (name) { + delete urls[name]; + delete lookup[name]; + }; + var createUrl = function (baseUrl, dep) { + if (typeof dep === 'object') { + return dep; + } + return typeof baseUrl === 'string' ? { + prefix: '', + resource: dep, + suffix: '' + } : { + prefix: baseUrl.prefix, + resource: dep, + suffix: baseUrl.suffix + }; + }; + var addComponents = function (pluginName, scripts) { + var pluginUrl = _this.urls[pluginName]; + each(scripts, function (script) { + ScriptLoader.ScriptLoader.add(pluginUrl + '/' + script); + }); + }; + var loadDependencies = function (name, addOnUrl, success, scope) { + var deps = dependencies(name); + each(deps, function (dep) { + var newUrl = createUrl(addOnUrl, dep); + load(newUrl.resource, newUrl, undefined, undefined); + }); + if (success) { + if (scope) { + success.call(scope); + } else { + success.call(ScriptLoader); + } + } + }; + var load = function (name, addOnUrl, success, scope, failure) { + if (urls[name]) { + return; + } + var urlString = typeof addOnUrl === 'string' ? addOnUrl : addOnUrl.prefix + addOnUrl.resource + addOnUrl.suffix; + if (urlString.indexOf('/') !== 0 && urlString.indexOf('://') === -1) { + urlString = AddOnManager.baseURL + '/' + urlString; + } + urls[name] = urlString.substring(0, urlString.lastIndexOf('/')); + var done = function () { + runListeners(name, 'loaded'); + loadDependencies(name, addOnUrl, success, scope); + }; + if (lookup[name]) { + done(); + } else { + ScriptLoader.ScriptLoader.add(urlString, done, scope, failure); + } + }; + var waitFor = function (name, callback, state) { + if (state === void 0) { + state = 'added'; + } + if (has(lookup, name) && state === 'added') { + callback(); + } else if (has(urls, name) && state === 'loaded') { + callback(); + } else { + _listeners.push({ + name: name, + state: state, + callback: callback + }); + } + }; + return { + items: items, + urls: urls, + lookup: lookup, + _listeners: _listeners, + get: get, + dependencies: dependencies, + requireLangPack: requireLangPack, + add: add, + remove: remove, + createUrl: createUrl, + addComponents: addComponents, + load: load, + waitFor: waitFor + }; + } + (function (AddOnManager) { + AddOnManager.PluginManager = AddOnManager(); + AddOnManager.ThemeManager = AddOnManager(); + }(AddOnManager || (AddOnManager = {}))); + var AddOnManager$1 = AddOnManager; + + var first = function (fn, rate) { + var timer = null; + var cancel = function () { + if (timer !== null) { + clearTimeout(timer); + timer = null; + } + }; + var throttle = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (timer === null) { + timer = setTimeout(function () { + fn.apply(null, args); + timer = null; + }, rate); + } + }; + return { + cancel: cancel, + throttle: throttle + }; + }; + var last$2 = function (fn, rate) { + var timer = null; + var cancel = function () { + if (timer !== null) { + clearTimeout(timer); + timer = null; + } + }; + var throttle = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (timer !== null) { + clearTimeout(timer); + } + timer = setTimeout(function () { + fn.apply(null, args); + timer = null; + }, rate); + }; + return { + cancel: cancel, + throttle: throttle + }; + }; + + var read = function (element, attr) { + var value = get$3(element, attr); + return value === undefined || value === '' ? [] : value.split(' '); + }; + var add$1 = function (element, attr, id) { + var old = read(element, attr); + var nu = old.concat([id]); + set(element, attr, nu.join(' ')); + return true; + }; + var remove$2 = function (element, attr, id) { + var nu = filter(read(element, attr), function (v) { + return v !== id; + }); + if (nu.length > 0) { + set(element, attr, nu.join(' ')); + } else { + remove$1(element, attr); + } + return false; + }; + + var supports = function (element) { + return element.dom.classList !== undefined; + }; + var get$5 = function (element) { + return read(element, 'class'); + }; + var add$2 = function (element, clazz) { + return add$1(element, 'class', clazz); + }; + var remove$3 = function (element, clazz) { + return remove$2(element, 'class', clazz); + }; + + var add$3 = function (element, clazz) { + if (supports(element)) { + element.dom.classList.add(clazz); + } else { + add$2(element, clazz); + } + }; + var cleanClass = function (element) { + var classList = supports(element) ? element.dom.classList : get$5(element); + if (classList.length === 0) { + remove$1(element, 'class'); + } + }; + var remove$4 = function (element, clazz) { + if (supports(element)) { + var classList = element.dom.classList; + classList.remove(clazz); + } else { + remove$3(element, clazz); + } + cleanClass(element); + }; + var has$2 = function (element, clazz) { + return supports(element) && element.dom.classList.contains(clazz); + }; + + var descendants = function (scope, predicate) { + var result = []; + each(children(scope), function (x) { + if (predicate(x)) { + result = result.concat([x]); + } + result = result.concat(descendants(x, predicate)); + }); + return result; + }; + + var descendants$1 = function (scope, selector) { + return all(selector, scope); + }; + + var annotation = constant('mce-annotation'); + var dataAnnotation = constant('data-mce-annotation'); + var dataAnnotationId = constant('data-mce-annotation-uid'); + + var identify = function (editor, annotationName) { + var rng = editor.selection.getRng(); + var start = SugarElement.fromDom(rng.startContainer); + var root = SugarElement.fromDom(editor.getBody()); + var selector = annotationName.fold(function () { + return '.' + annotation(); + }, function (an) { + return '[' + dataAnnotation() + '="' + an + '"]'; + }); + var newStart = child(start, rng.startOffset).getOr(start); + var closest = closest$1(newStart, selector, function (n) { + return eq$2(n, root); + }); + var getAttr = function (c, property) { + if (has$1(c, property)) { + return Optional.some(get$3(c, property)); + } else { + return Optional.none(); + } + }; + return closest.bind(function (c) { + return getAttr(c, '' + dataAnnotationId()).bind(function (uid) { + return getAttr(c, '' + dataAnnotation()).map(function (name) { + var elements = findMarkers(editor, uid); + return { + uid: uid, + name: name, + elements: elements + }; + }); + }); + }); + }; + var isAnnotation = function (elem) { + return isElement(elem) && has$2(elem, annotation()); + }; + var findMarkers = function (editor, uid) { + var body = SugarElement.fromDom(editor.getBody()); + return descendants$1(body, '[' + dataAnnotationId() + '="' + uid + '"]'); + }; + var findAll = function (editor, name) { + var body = SugarElement.fromDom(editor.getBody()); + var markers = descendants$1(body, '[' + dataAnnotation() + '="' + name + '"]'); + var directory = {}; + each(markers, function (m) { + var uid = get$3(m, dataAnnotationId()); + var nodesAlready = directory.hasOwnProperty(uid) ? directory[uid] : []; + directory[uid] = nodesAlready.concat([m]); + }); + return directory; + }; + + var setup = function (editor, _registry) { + var changeCallbacks = Cell({}); + var initData = function () { + return { + listeners: [], + previous: Cell(Optional.none()) + }; + }; + var withCallbacks = function (name, f) { + updateCallbacks(name, function (data) { + f(data); + return data; + }); + }; + var updateCallbacks = function (name, f) { + var callbackMap = changeCallbacks.get(); + var data = callbackMap.hasOwnProperty(name) ? callbackMap[name] : initData(); + var outputData = f(data); + callbackMap[name] = outputData; + changeCallbacks.set(callbackMap); + }; + var fireCallbacks = function (name, uid, elements) { + withCallbacks(name, function (data) { + each(data.listeners, function (f) { + return f(true, name, { + uid: uid, + nodes: map(elements, function (elem) { + return elem.dom; + }) + }); + }); + }); + }; + var fireNoAnnotation = function (name) { + withCallbacks(name, function (data) { + each(data.listeners, function (f) { + return f(false, name); + }); + }); + }; + var onNodeChange = last$2(function () { + var callbackMap = changeCallbacks.get(); + var annotations = sort$1(keys(callbackMap)); + each(annotations, function (name) { + updateCallbacks(name, function (data) { + var prev = data.previous.get(); + identify(editor, Optional.some(name)).fold(function () { + if (prev.isSome()) { + fireNoAnnotation(name); + data.previous.set(Optional.none()); + } + }, function (_a) { + var uid = _a.uid, name = _a.name, elements = _a.elements; + if (!prev.is(uid)) { + fireCallbacks(name, uid, elements); + data.previous.set(Optional.some(uid)); + } + }); + return { + previous: data.previous, + listeners: data.listeners + }; + }); + }); + }, 30); + editor.on('remove', function () { + onNodeChange.cancel(); + }); + editor.on('NodeChange', function () { + onNodeChange.throttle(); + }); + var addListener = function (name, f) { + updateCallbacks(name, function (data) { + return { + previous: data.previous, + listeners: data.listeners.concat([f]) + }; + }); + }; + return { addListener: addListener }; + }; + + var setup$1 = function (editor, registry) { + var identifyParserNode = function (span) { + return Optional.from(span.attr(dataAnnotation())).bind(registry.lookup); + }; + editor.on('init', function () { + editor.serializer.addNodeFilter('span', function (spans) { + each(spans, function (span) { + identifyParserNode(span).each(function (settings) { + if (settings.persistent === false) { + span.unwrap(); + } + }); + }); + }); + }); + }; + + var create$2 = function () { + var annotations = {}; + var register = function (name, settings) { + annotations[name] = { + name: name, + settings: settings + }; + }; + var lookup = function (name) { + return annotations.hasOwnProperty(name) ? Optional.from(annotations[name]).map(function (a) { + return a.settings; + }) : Optional.none(); + }; + return { + register: register, + lookup: lookup + }; + }; + + var unique = 0; + var generate$1 = function (prefix) { + var date = new Date(); + var time = date.getTime(); + var random = Math.floor(Math.random() * 1000000000); + unique++; + return prefix + '_' + random + unique + String(time); + }; + + var add$4 = function (element, classes) { + each(classes, function (x) { + add$3(element, x); + }); + }; + + var fromHtml$1 = function (html, scope) { + var doc = scope || document; + var div = doc.createElement('div'); + div.innerHTML = html; + return children(SugarElement.fromDom(div)); + }; + + var get$6 = function (element) { + return element.dom.innerHTML; + }; + var set$1 = function (element, content) { + var owner$1 = owner(element); + var docDom = owner$1.dom; + var fragment = SugarElement.fromDom(docDom.createDocumentFragment()); + var contentElements = fromHtml$1(content, docDom); + append$1(fragment, contentElements); + empty(element); + append(element, fragment); + }; + + var clone$1 = function (original, isDeep) { + return SugarElement.fromDom(original.dom.cloneNode(isDeep)); + }; + var shallow = function (original) { + return clone$1(original, false); + }; + var deep = function (original) { + return clone$1(original, true); + }; + + var TextWalker = function (startNode, rootNode, isBoundary) { + if (isBoundary === void 0) { + isBoundary = never; + } + var walker = new DomTreeWalker(startNode, rootNode); + var walk = function (direction) { + var next; + do { + next = walker[direction](); + } while (next && !isText$1(next) && !isBoundary(next)); + return Optional.from(next).filter(isText$1); + }; + return { + current: function () { + return Optional.from(walker.current()).filter(isText$1); + }, + next: function () { + return walk('next'); + }, + prev: function () { + return walk('prev'); + }, + prev2: function () { + return walk('prev2'); + } + }; + }; + + var TextSeeker = function (dom, isBoundary) { + var isBlockBoundary = isBoundary ? isBoundary : function (node) { + return dom.isBlock(node) || isBr(node) || isContentEditableFalse(node); + }; + var walk = function (node, offset, walker, process) { + if (isText$1(node)) { + var newOffset = process(node, offset, node.data); + if (newOffset !== -1) { + return Optional.some({ + container: node, + offset: newOffset + }); + } + } + return walker().bind(function (next) { + return walk(next.container, next.offset, walker, process); + }); + }; + var backwards = function (node, offset, process, root) { + var walker = TextWalker(node, root, isBlockBoundary); + return walk(node, offset, function () { + return walker.prev().map(function (prev) { + return { + container: prev, + offset: prev.length + }; + }); + }, process).getOrNull(); + }; + var forwards = function (node, offset, process, root) { + var walker = TextWalker(node, root, isBlockBoundary); + return walk(node, offset, function () { + return walker.next().map(function (next) { + return { + container: next, + offset: 0 + }; + }); + }, process).getOrNull(); + }; + return { + backwards: backwards, + forwards: forwards + }; + }; + + var cat = function (arr) { + var r = []; + var push = function (x) { + r.push(x); + }; + for (var i = 0; i < arr.length; i++) { + arr[i].each(push); + } + return r; + }; + var lift2 = function (oa, ob, f) { + return oa.isSome() && ob.isSome() ? Optional.some(f(oa.getOrDie(), ob.getOrDie())) : Optional.none(); + }; + var lift3 = function (oa, ob, oc, f) { + return oa.isSome() && ob.isSome() && oc.isSome() ? Optional.some(f(oa.getOrDie(), ob.getOrDie(), oc.getOrDie())) : Optional.none(); + }; + var someIf = function (b, a) { + return b ? Optional.some(a) : Optional.none(); + }; + + var round = Math.round; + var clone$2 = function (rect) { + if (!rect) { + return { + left: 0, + top: 0, + bottom: 0, + right: 0, + width: 0, + height: 0 + }; + } + return { + left: round(rect.left), + top: round(rect.top), + bottom: round(rect.bottom), + right: round(rect.right), + width: round(rect.width), + height: round(rect.height) + }; + }; + var collapse = function (rect, toStart) { + rect = clone$2(rect); + if (toStart) { + rect.right = rect.left; + } else { + rect.left = rect.left + rect.width; + rect.right = rect.left; + } + rect.width = 0; + return rect; + }; + var isEqual = function (rect1, rect2) { + return rect1.left === rect2.left && rect1.top === rect2.top && rect1.bottom === rect2.bottom && rect1.right === rect2.right; + }; + var isValidOverflow = function (overflowY, rect1, rect2) { + return overflowY >= 0 && overflowY <= Math.min(rect1.height, rect2.height) / 2; + }; + var isAbove = function (rect1, rect2) { + var halfHeight = Math.min(rect2.height / 2, rect1.height / 2); + if (rect1.bottom - halfHeight < rect2.top) { + return true; + } + if (rect1.top > rect2.bottom) { + return false; + } + return isValidOverflow(rect2.top - rect1.bottom, rect1, rect2); + }; + var isBelow = function (rect1, rect2) { + if (rect1.top > rect2.bottom) { + return true; + } + if (rect1.bottom < rect2.top) { + return false; + } + return isValidOverflow(rect2.bottom - rect1.top, rect1, rect2); + }; + var containsXY = function (rect, clientX, clientY) { + return clientX >= rect.left && clientX <= rect.right && clientY >= rect.top && clientY <= rect.bottom; + }; + + var getSelectedNode = function (range) { + var startContainer = range.startContainer, startOffset = range.startOffset; + if (startContainer.hasChildNodes() && range.endOffset === startOffset + 1) { + return startContainer.childNodes[startOffset]; + } + return null; + }; + var getNode = function (container, offset) { + if (container.nodeType === 1 && container.hasChildNodes()) { + if (offset >= container.childNodes.length) { + offset = container.childNodes.length - 1; + } + container = container.childNodes[offset]; + } + return container; + }; + + var extendingChars = new RegExp('[\u0300-\u036f\u0483-\u0487\u0488-\u0489\u0591-\u05bd\u05bf\u05c1-\u05c2\u05c4-\u05c5\u05c7\u0610-\u061a' + '\u064b-\u065f\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7-\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0' + '\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e3-\u0902\u093a\u093c' + '\u0941-\u0948\u094d\u0951-\u0957\u0962-\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2-\u09e3' + '\u0a01-\u0a02\u0a3c\u0a41-\u0a42\u0a47-\u0a48\u0a4b-\u0a4d\u0a51\u0a70-\u0a71\u0a75\u0a81-\u0a82\u0abc' + '\u0ac1-\u0ac5\u0ac7-\u0ac8\u0acd\u0ae2-\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57' + '\u0b62-\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c00\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55-\u0c56' + '\u0c62-\u0c63\u0c81\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc-\u0ccd\u0cd5-\u0cd6\u0ce2-\u0ce3\u0d01\u0d3e\u0d41-\u0d44' + '\u0d4d\u0d57\u0d62-\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9' + '\u0ebb-\u0ebc\u0ec8-\u0ecd\u0f18-\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86-\u0f87\u0f8d-\u0f97' + '\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039-\u103a\u103d-\u103e\u1058-\u1059\u105e-\u1060\u1071-\u1074' + '\u1082\u1085-\u1086\u108d\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17b4-\u17b5' + '\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927-\u1928\u1932\u1939-\u193b\u1a17-\u1a18' + '\u1a1b\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1ab0-\u1abd\u1ABE\u1b00-\u1b03\u1b34' + '\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80-\u1b81\u1ba2-\u1ba5\u1ba8-\u1ba9\u1bab-\u1bad\u1be6\u1be8-\u1be9' + '\u1bed\u1bef-\u1bf1\u1c2c-\u1c33\u1c36-\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1cf4\u1cf8-\u1cf9' + '\u1dc0-\u1df5\u1dfc-\u1dff\u200c-\u200d\u20d0-\u20dc\u20DD-\u20E0\u20e1\u20E2-\u20E4\u20e5-\u20f0\u2cef-\u2cf1' + '\u2d7f\u2de0-\u2dff\u302a-\u302d\u302e-\u302f\u3099-\u309a\ua66f\uA670-\uA672\ua674-\ua67d\ua69e-\ua69f\ua6f0-\ua6f1' + '\ua802\ua806\ua80b\ua825-\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc' + '\ua9e5\uaa29-\uaa2e\uaa31-\uaa32\uaa35-\uaa36\uaa43\uaa4c\uaa7c\uaab0\uaab2-\uaab4\uaab7-\uaab8\uaabe-\uaabf\uaac1' + '\uaaec-\uaaed\uaaf6\uabe5\uabe8\uabed\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\uff9e-\uff9f]'); + var isExtendingChar = function (ch) { + return typeof ch === 'string' && ch.charCodeAt(0) >= 768 && extendingChars.test(ch); + }; + + var or = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return function (x) { + for (var i = 0; i < args.length; i++) { + if (args[i](x)) { + return true; + } + } + return false; + }; + }; + var and = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return function (x) { + for (var i = 0; i < args.length; i++) { + if (!args[i](x)) { + return false; + } + } + return true; + }; + }; + + var isElement$3 = isElement$1; + var isCaretCandidate$1 = isCaretCandidate; + var isBlock$1 = matchStyleValues('display', 'block table'); + var isFloated = matchStyleValues('float', 'left right'); + var isValidElementCaretCandidate = and(isElement$3, isCaretCandidate$1, not(isFloated)); + var isNotPre = not(matchStyleValues('white-space', 'pre pre-line pre-wrap')); + var isText$4 = isText$1; + var isBr$3 = isBr; + var nodeIndex = DOMUtils$1.nodeIndex; + var resolveIndex = getNode; + var createRange = function (doc) { + return 'createRange' in doc ? doc.createRange() : DOMUtils$1.DOM.createRng(); + }; + var isWhiteSpace = function (chr) { + return chr && /[\r\n\t ]/.test(chr); + }; + var isRange = function (rng) { + return !!rng.setStart && !!rng.setEnd; + }; + var isHiddenWhiteSpaceRange = function (range) { + var container = range.startContainer; + var offset = range.startOffset; + var text; + if (isWhiteSpace(range.toString()) && isNotPre(container.parentNode) && isText$1(container)) { + text = container.data; + if (isWhiteSpace(text[offset - 1]) || isWhiteSpace(text[offset + 1])) { + return true; + } + } + return false; + }; + var getBrClientRect = function (brNode) { + var doc = brNode.ownerDocument; + var rng = createRange(doc); + var nbsp$1 = doc.createTextNode(nbsp); + var parentNode = brNode.parentNode; + parentNode.insertBefore(nbsp$1, brNode); + rng.setStart(nbsp$1, 0); + rng.setEnd(nbsp$1, 1); + var clientRect = clone$2(rng.getBoundingClientRect()); + parentNode.removeChild(nbsp$1); + return clientRect; + }; + var getBoundingClientRectWebKitText = function (rng) { + var sc = rng.startContainer; + var ec = rng.endContainer; + var so = rng.startOffset; + var eo = rng.endOffset; + if (sc === ec && isText$1(ec) && so === 0 && eo === 1) { + var newRng = rng.cloneRange(); + newRng.setEndAfter(ec); + return getBoundingClientRect(newRng); + } else { + return null; + } + }; + var isZeroRect = function (r) { + return r.left === 0 && r.right === 0 && r.top === 0 && r.bottom === 0; + }; + var getBoundingClientRect = function (item) { + var clientRect; + var clientRects = item.getClientRects(); + if (clientRects.length > 0) { + clientRect = clone$2(clientRects[0]); + } else { + clientRect = clone$2(item.getBoundingClientRect()); + } + if (!isRange(item) && isBr$3(item) && isZeroRect(clientRect)) { + return getBrClientRect(item); + } + if (isZeroRect(clientRect) && isRange(item)) { + return getBoundingClientRectWebKitText(item); + } + return clientRect; + }; + var collapseAndInflateWidth = function (clientRect, toStart) { + var newClientRect = collapse(clientRect, toStart); + newClientRect.width = 1; + newClientRect.right = newClientRect.left + 1; + return newClientRect; + }; + var getCaretPositionClientRects = function (caretPosition) { + var clientRects = []; + var beforeNode, node; + var addUniqueAndValidRect = function (clientRect) { + if (clientRect.height === 0) { + return; + } + if (clientRects.length > 0) { + if (isEqual(clientRect, clientRects[clientRects.length - 1])) { + return; + } + } + clientRects.push(clientRect); + }; + var addCharacterOffset = function (container, offset) { + var range = createRange(container.ownerDocument); + if (offset < container.data.length) { + if (isExtendingChar(container.data[offset])) { + return clientRects; + } + if (isExtendingChar(container.data[offset - 1])) { + range.setStart(container, offset); + range.setEnd(container, offset + 1); + if (!isHiddenWhiteSpaceRange(range)) { + addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect(range), false)); + return clientRects; + } + } + } + if (offset > 0) { + range.setStart(container, offset - 1); + range.setEnd(container, offset); + if (!isHiddenWhiteSpaceRange(range)) { + addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect(range), false)); + } + } + if (offset < container.data.length) { + range.setStart(container, offset); + range.setEnd(container, offset + 1); + if (!isHiddenWhiteSpaceRange(range)) { + addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect(range), true)); + } + } + }; + if (isText$4(caretPosition.container())) { + addCharacterOffset(caretPosition.container(), caretPosition.offset()); + return clientRects; + } + if (isElement$3(caretPosition.container())) { + if (caretPosition.isAtEnd()) { + node = resolveIndex(caretPosition.container(), caretPosition.offset()); + if (isText$4(node)) { + addCharacterOffset(node, node.data.length); + } + if (isValidElementCaretCandidate(node) && !isBr$3(node)) { + addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect(node), false)); + } + } else { + node = resolveIndex(caretPosition.container(), caretPosition.offset()); + if (isText$4(node)) { + addCharacterOffset(node, 0); + } + if (isValidElementCaretCandidate(node) && caretPosition.isAtEnd()) { + addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect(node), false)); + return clientRects; + } + beforeNode = resolveIndex(caretPosition.container(), caretPosition.offset() - 1); + if (isValidElementCaretCandidate(beforeNode) && !isBr$3(beforeNode)) { + if (isBlock$1(beforeNode) || isBlock$1(node) || !isValidElementCaretCandidate(node)) { + addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect(beforeNode), false)); + } + } + if (isValidElementCaretCandidate(node)) { + addUniqueAndValidRect(collapseAndInflateWidth(getBoundingClientRect(node), true)); + } + } + } + return clientRects; + }; + function CaretPosition(container, offset, clientRects) { + var isAtStart = function () { + if (isText$4(container)) { + return offset === 0; + } + return offset === 0; + }; + var isAtEnd = function () { + if (isText$4(container)) { + return offset >= container.data.length; + } + return offset >= container.childNodes.length; + }; + var toRange = function () { + var range = createRange(container.ownerDocument); + range.setStart(container, offset); + range.setEnd(container, offset); + return range; + }; + var getClientRects = function () { + if (!clientRects) { + clientRects = getCaretPositionClientRects(CaretPosition(container, offset)); + } + return clientRects; + }; + var isVisible = function () { + return getClientRects().length > 0; + }; + var isEqual = function (caretPosition) { + return caretPosition && container === caretPosition.container() && offset === caretPosition.offset(); + }; + var getNode = function (before) { + return resolveIndex(container, before ? offset - 1 : offset); + }; + return { + container: constant(container), + offset: constant(offset), + toRange: toRange, + getClientRects: getClientRects, + isVisible: isVisible, + isAtStart: isAtStart, + isAtEnd: isAtEnd, + isEqual: isEqual, + getNode: getNode + }; + } + (function (CaretPosition) { + CaretPosition.fromRangeStart = function (range) { + return CaretPosition(range.startContainer, range.startOffset); + }; + CaretPosition.fromRangeEnd = function (range) { + return CaretPosition(range.endContainer, range.endOffset); + }; + CaretPosition.after = function (node) { + return CaretPosition(node.parentNode, nodeIndex(node) + 1); + }; + CaretPosition.before = function (node) { + return CaretPosition(node.parentNode, nodeIndex(node)); + }; + CaretPosition.isAbove = function (pos1, pos2) { + return lift2(head(pos2.getClientRects()), last(pos1.getClientRects()), isAbove).getOr(false); + }; + CaretPosition.isBelow = function (pos1, pos2) { + return lift2(last(pos2.getClientRects()), head(pos1.getClientRects()), isBelow).getOr(false); + }; + CaretPosition.isAtStart = function (pos) { + return pos ? pos.isAtStart() : false; + }; + CaretPosition.isAtEnd = function (pos) { + return pos ? pos.isAtEnd() : false; + }; + CaretPosition.isTextPosition = function (pos) { + return pos ? isText$1(pos.container()) : false; + }; + CaretPosition.isElementPosition = function (pos) { + return CaretPosition.isTextPosition(pos) === false; + }; + }(CaretPosition || (CaretPosition = {}))); + var CaretPosition$1 = CaretPosition; + + var trimEmptyTextNode = function (dom, node) { + if (isText$1(node) && node.data.length === 0) { + dom.remove(node); + } + }; + var insertNode = function (dom, rng, node) { + rng.insertNode(node); + trimEmptyTextNode(dom, node.previousSibling); + trimEmptyTextNode(dom, node.nextSibling); + }; + var insertFragment = function (dom, rng, frag) { + var firstChild = Optional.from(frag.firstChild); + var lastChild = Optional.from(frag.lastChild); + rng.insertNode(frag); + firstChild.each(function (child) { + return trimEmptyTextNode(dom, child.previousSibling); + }); + lastChild.each(function (child) { + return trimEmptyTextNode(dom, child.nextSibling); + }); + }; + var rangeInsertNode = function (dom, rng, node) { + if (isDocumentFragment$1(node)) { + insertFragment(dom, rng, node); + } else { + insertNode(dom, rng, node); + } + }; + + var isText$5 = isText$1; + var isBogus$2 = isBogus; + var nodeIndex$1 = DOMUtils$1.nodeIndex; + var normalizedParent = function (node) { + var parentNode = node.parentNode; + if (isBogus$2(parentNode)) { + return normalizedParent(parentNode); + } + return parentNode; + }; + var getChildNodes = function (node) { + if (!node) { + return []; + } + return reduce(node.childNodes, function (result, node) { + if (isBogus$2(node) && node.nodeName !== 'BR') { + result = result.concat(getChildNodes(node)); + } else { + result.push(node); + } + return result; + }, []); + }; + var normalizedTextOffset = function (node, offset) { + while (node = node.previousSibling) { + if (!isText$5(node)) { + break; + } + offset += node.data.length; + } + return offset; + }; + var equal$1 = function (a) { + return function (b) { + return a === b; + }; + }; + var normalizedNodeIndex = function (node) { + var nodes, index; + nodes = getChildNodes(normalizedParent(node)); + index = findIndex$1(nodes, equal$1(node), node); + nodes = nodes.slice(0, index + 1); + var numTextFragments = reduce(nodes, function (result, node, i) { + if (isText$5(node) && isText$5(nodes[i - 1])) { + result++; + } + return result; + }, 0); + nodes = filter$2(nodes, matchNodeNames([node.nodeName])); + index = findIndex$1(nodes, equal$1(node), node); + return index - numTextFragments; + }; + var createPathItem = function (node) { + var name; + if (isText$5(node)) { + name = 'text()'; + } else { + name = node.nodeName.toLowerCase(); + } + return name + '[' + normalizedNodeIndex(node) + ']'; + }; + var parentsUntil = function (root, node, predicate) { + var parents = []; + for (node = node.parentNode; node !== root; node = node.parentNode) { + if (predicate && predicate(node)) { + break; + } + parents.push(node); + } + return parents; + }; + var create$3 = function (root, caretPosition) { + var container, offset, path = [], outputOffset, childNodes, parents; + container = caretPosition.container(); + offset = caretPosition.offset(); + if (isText$5(container)) { + outputOffset = normalizedTextOffset(container, offset); + } else { + childNodes = container.childNodes; + if (offset >= childNodes.length) { + outputOffset = 'after'; + offset = childNodes.length - 1; + } else { + outputOffset = 'before'; + } + container = childNodes[offset]; + } + path.push(createPathItem(container)); + parents = parentsUntil(root, container); + parents = filter$2(parents, not(isBogus)); + path = path.concat(map$2(parents, function (node) { + return createPathItem(node); + })); + return path.reverse().join('/') + ',' + outputOffset; + }; + var resolvePathItem = function (node, name, index) { + var nodes = getChildNodes(node); + nodes = filter$2(nodes, function (node, index) { + return !isText$5(node) || !isText$5(nodes[index - 1]); + }); + nodes = filter$2(nodes, matchNodeNames([name])); + return nodes[index]; + }; + var findTextPosition = function (container, offset) { + var node = container, targetOffset = 0, dataLen; + while (isText$5(node)) { + dataLen = node.data.length; + if (offset >= targetOffset && offset <= targetOffset + dataLen) { + container = node; + offset = offset - targetOffset; + break; + } + if (!isText$5(node.nextSibling)) { + container = node; + offset = dataLen; + break; + } + targetOffset += dataLen; + node = node.nextSibling; + } + if (isText$5(container) && offset > container.data.length) { + offset = container.data.length; + } + return CaretPosition$1(container, offset); + }; + var resolve$1 = function (root, path) { + var offset; + if (!path) { + return null; + } + var parts = path.split(','); + var paths = parts[0].split('/'); + offset = parts.length > 1 ? parts[1] : 'before'; + var container = reduce(paths, function (result, value) { + var match = /([\w\-\(\)]+)\[([0-9]+)\]/.exec(value); + if (!match) { + return null; + } + if (match[1] === 'text()') { + match[1] = '#text'; + } + return resolvePathItem(result, match[1], parseInt(match[2], 10)); + }, root); + if (!container) { + return null; + } + if (!isText$5(container)) { + if (offset === 'after') { + offset = nodeIndex$1(container) + 1; + } else { + offset = nodeIndex$1(container); + } + return CaretPosition$1(container.parentNode, offset); + } + return findTextPosition(container, parseInt(offset, 10)); + }; + + var isContentEditableFalse$2 = isContentEditableFalse; + var getNormalizedTextOffset = function (trim, container, offset) { + var node, trimmedOffset; + trimmedOffset = trim(container.data.slice(0, offset)).length; + for (node = container.previousSibling; node && isText$1(node); node = node.previousSibling) { + trimmedOffset += trim(node.data).length; + } + return trimmedOffset; + }; + var getPoint = function (dom, trim, normalized, rng, start) { + var container = rng[start ? 'startContainer' : 'endContainer']; + var offset = rng[start ? 'startOffset' : 'endOffset']; + var point = []; + var childNodes, after = 0; + var root = dom.getRoot(); + if (isText$1(container)) { + point.push(normalized ? getNormalizedTextOffset(trim, container, offset) : offset); + } else { + childNodes = container.childNodes; + if (offset >= childNodes.length && childNodes.length) { + after = 1; + offset = Math.max(0, childNodes.length - 1); + } + point.push(dom.nodeIndex(childNodes[offset], normalized) + after); + } + for (; container && container !== root; container = container.parentNode) { + point.push(dom.nodeIndex(container, normalized)); + } + return point; + }; + var getLocation = function (trim, selection, normalized, rng) { + var dom = selection.dom, bookmark = {}; + bookmark.start = getPoint(dom, trim, normalized, rng, true); + if (!selection.isCollapsed()) { + bookmark.end = getPoint(dom, trim, normalized, rng, false); + } + return bookmark; + }; + var findIndex$2 = function (dom, name, element) { + var count = 0; + Tools.each(dom.select(name), function (node) { + if (node.getAttribute('data-mce-bogus') === 'all') { + return; + } + if (node === element) { + return false; + } + count++; + }); + return count; + }; + var moveEndPoint = function (rng, start) { + var container, offset, childNodes; + var prefix = start ? 'start' : 'end'; + container = rng[prefix + 'Container']; + offset = rng[prefix + 'Offset']; + if (isElement$1(container) && container.nodeName === 'TR') { + childNodes = container.childNodes; + container = childNodes[Math.min(start ? offset : offset - 1, childNodes.length - 1)]; + if (container) { + offset = start ? 0 : container.childNodes.length; + rng['set' + (start ? 'Start' : 'End')](container, offset); + } + } + }; + var normalizeTableCellSelection = function (rng) { + moveEndPoint(rng, true); + moveEndPoint(rng, false); + return rng; + }; + var findSibling = function (node, offset) { + var sibling; + if (isElement$1(node)) { + node = getNode(node, offset); + if (isContentEditableFalse$2(node)) { + return node; + } + } + if (isCaretContainer(node)) { + if (isText$1(node) && isCaretContainerBlock(node)) { + node = node.parentNode; + } + sibling = node.previousSibling; + if (isContentEditableFalse$2(sibling)) { + return sibling; + } + sibling = node.nextSibling; + if (isContentEditableFalse$2(sibling)) { + return sibling; + } + } + }; + var findAdjacentContentEditableFalseElm = function (rng) { + return findSibling(rng.startContainer, rng.startOffset) || findSibling(rng.endContainer, rng.endOffset); + }; + var getOffsetBookmark = function (trim, normalized, selection) { + var element = selection.getNode(); + var name = element ? element.nodeName : null; + var rng = selection.getRng(); + if (isContentEditableFalse$2(element) || name === 'IMG') { + return { + name: name, + index: findIndex$2(selection.dom, name, element) + }; + } + var sibling = findAdjacentContentEditableFalseElm(rng); + if (sibling) { + name = sibling.tagName; + return { + name: name, + index: findIndex$2(selection.dom, name, sibling) + }; + } + return getLocation(trim, selection, normalized, rng); + }; + var getCaretBookmark = function (selection) { + var rng = selection.getRng(); + return { + start: create$3(selection.dom.getRoot(), CaretPosition$1.fromRangeStart(rng)), + end: create$3(selection.dom.getRoot(), CaretPosition$1.fromRangeEnd(rng)) + }; + }; + var getRangeBookmark = function (selection) { + return { rng: selection.getRng() }; + }; + var createBookmarkSpan = function (dom, id, filled) { + var args = { + 'data-mce-type': 'bookmark', + id: id, + 'style': 'overflow:hidden;line-height:0px' + }; + return filled ? dom.create('span', args, '') : dom.create('span', args); + }; + var getPersistentBookmark = function (selection, filled) { + var dom = selection.dom; + var rng = selection.getRng(); + var id = dom.uniqueId(); + var collapsed = selection.isCollapsed(); + var element = selection.getNode(); + var name = element.nodeName; + if (name === 'IMG') { + return { + name: name, + index: findIndex$2(dom, name, element) + }; + } + var rng2 = normalizeTableCellSelection(rng.cloneRange()); + if (!collapsed) { + rng2.collapse(false); + var endBookmarkNode = createBookmarkSpan(dom, id + '_end', filled); + rangeInsertNode(dom, rng2, endBookmarkNode); + } + rng = normalizeTableCellSelection(rng); + rng.collapse(true); + var startBookmarkNode = createBookmarkSpan(dom, id + '_start', filled); + rangeInsertNode(dom, rng, startBookmarkNode); + selection.moveToBookmark({ + id: id, + keep: true + }); + return { id: id }; + }; + var getBookmark = function (selection, type, normalized) { + if (type === 2) { + return getOffsetBookmark(trim$2, normalized, selection); + } else if (type === 3) { + return getCaretBookmark(selection); + } else if (type) { + return getRangeBookmark(selection); + } else { + return getPersistentBookmark(selection, false); + } + }; + var getUndoBookmark = curry(getOffsetBookmark, identity, true); + + var DOM$1 = DOMUtils$1.DOM; + var defaultPreviewStyles = 'font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow'; + var getBodySetting = function (editor, name, defaultValue) { + var value = editor.getParam(name, defaultValue); + if (value.indexOf('=') !== -1) { + var bodyObj = editor.getParam(name, '', 'hash'); + return bodyObj.hasOwnProperty(editor.id) ? bodyObj[editor.id] : defaultValue; + } else { + return value; + } + }; + var getIframeAttrs = function (editor) { + return editor.getParam('iframe_attrs', {}); + }; + var getDocType = function (editor) { + return editor.getParam('doctype', ''); + }; + var getDocumentBaseUrl = function (editor) { + return editor.getParam('document_base_url', ''); + }; + var getBodyId = function (editor) { + return getBodySetting(editor, 'body_id', 'tinymce'); + }; + var getBodyClass = function (editor) { + return getBodySetting(editor, 'body_class', ''); + }; + var getContentSecurityPolicy = function (editor) { + return editor.getParam('content_security_policy', ''); + }; + var shouldPutBrInPre = function (editor) { + return editor.getParam('br_in_pre', true); + }; + var getForcedRootBlock = function (editor) { + if (editor.getParam('force_p_newlines', false)) { + return 'p'; + } + var block = editor.getParam('forced_root_block', 'p'); + if (block === false) { + return ''; + } else if (block === true) { + return 'p'; + } else { + return block; + } + }; + var getForcedRootBlockAttrs = function (editor) { + return editor.getParam('forced_root_block_attrs', {}); + }; + var getBrNewLineSelector = function (editor) { + return editor.getParam('br_newline_selector', '.mce-toc h2,figcaption,caption'); + }; + var getNoNewLineSelector = function (editor) { + return editor.getParam('no_newline_selector', ''); + }; + var shouldKeepStyles = function (editor) { + return editor.getParam('keep_styles', true); + }; + var shouldEndContainerOnEmptyBlock = function (editor) { + return editor.getParam('end_container_on_empty_block', false); + }; + var getFontStyleValues = function (editor) { + return Tools.explode(editor.getParam('font_size_style_values', 'xx-small,x-small,small,medium,large,x-large,xx-large')); + }; + var getFontSizeClasses = function (editor) { + return Tools.explode(editor.getParam('font_size_classes', '')); + }; + var getImagesDataImgFilter = function (editor) { + return editor.getParam('images_dataimg_filter', always, 'function'); + }; + var isAutomaticUploadsEnabled = function (editor) { + return editor.getParam('automatic_uploads', true, 'boolean'); + }; + var shouldReuseFileName = function (editor) { + return editor.getParam('images_reuse_filename', false, 'boolean'); + }; + var shouldReplaceBlobUris = function (editor) { + return editor.getParam('images_replace_blob_uris', true, 'boolean'); + }; + var getIconPackName = function (editor) { + return editor.getParam('icons', '', 'string'); + }; + var getIconsUrl = function (editor) { + return editor.getParam('icons_url', '', 'string'); + }; + var getImageUploadUrl = function (editor) { + return editor.getParam('images_upload_url', '', 'string'); + }; + var getImageUploadBasePath = function (editor) { + return editor.getParam('images_upload_base_path', '', 'string'); + }; + var getImagesUploadCredentials = function (editor) { + return editor.getParam('images_upload_credentials', false, 'boolean'); + }; + var getImagesUploadHandler = function (editor) { + return editor.getParam('images_upload_handler', null, 'function'); + }; + var shouldUseContentCssCors = function (editor) { + return editor.getParam('content_css_cors', false, 'boolean'); + }; + var getReferrerPolicy = function (editor) { + return editor.getParam('referrer_policy', '', 'string'); + }; + var getLanguageCode = function (editor) { + return editor.getParam('language', 'en', 'string'); + }; + var getLanguageUrl = function (editor) { + return editor.getParam('language_url', '', 'string'); + }; + var shouldIndentUseMargin = function (editor) { + return editor.getParam('indent_use_margin', false); + }; + var getIndentation = function (editor) { + return editor.getParam('indentation', '40px', 'string'); + }; + var getContentCss = function (editor) { + var contentCss = editor.getParam('content_css'); + if (isString(contentCss)) { + return map(contentCss.split(','), trim); + } else if (isArray(contentCss)) { + return contentCss; + } else if (contentCss === false || editor.inline) { + return []; + } else { + return ['default']; + } + }; + var getDirectionality = function (editor) { + return editor.getParam('directionality', I18n.isRtl() ? 'rtl' : undefined); + }; + var getInlineBoundarySelector = function (editor) { + return editor.getParam('inline_boundaries_selector', 'a[href],code,.mce-annotation', 'string'); + }; + var getObjectResizing = function (editor) { + var selector = editor.getParam('object_resizing'); + if (selector === false || Env.iOS) { + return false; + } else { + return isString(selector) ? selector : 'table,img,figure.image,div'; + } + }; + var getResizeImgProportional = function (editor) { + return editor.getParam('resize_img_proportional', true, 'boolean'); + }; + var getPlaceholder = function (editor) { + return editor.getParam('placeholder', DOM$1.getAttrib(editor.getElement(), 'placeholder'), 'string'); + }; + var getEventRoot = function (editor) { + return editor.getParam('event_root'); + }; + var getServiceMessage = function (editor) { + return editor.getParam('service_message'); + }; + var getTheme = function (editor) { + return editor.getParam('theme'); + }; + var shouldValidate = function (editor) { + return editor.getParam('validate'); + }; + var isInlineBoundariesEnabled = function (editor) { + return editor.getParam('inline_boundaries') !== false; + }; + var getFormats = function (editor) { + return editor.getParam('formats'); + }; + var getPreviewStyles = function (editor) { + var style = editor.getParam('preview_styles', defaultPreviewStyles); + if (isString(style)) { + return style; + } else { + return ''; + } + }; + var getCustomUiSelector = function (editor) { + return editor.getParam('custom_ui_selector', '', 'string'); + }; + var getThemeUrl = function (editor) { + return editor.getParam('theme_url'); + }; + var isInline$1 = function (editor) { + return editor.getParam('inline'); + }; + var hasHiddenInput = function (editor) { + return editor.getParam('hidden_input'); + }; + var shouldPatchSubmit = function (editor) { + return editor.getParam('submit_patch'); + }; + var isEncodingXml = function (editor) { + return editor.getParam('encoding') === 'xml'; + }; + var shouldAddFormSubmitTrigger = function (editor) { + return editor.getParam('add_form_submit_trigger'); + }; + var shouldAddUnloadTrigger = function (editor) { + return editor.getParam('add_unload_trigger'); + }; + var hasForcedRootBlock = function (editor) { + return getForcedRootBlock(editor) !== ''; + }; + var getCustomUndoRedoLevels = function (editor) { + return editor.getParam('custom_undo_redo_levels', 0, 'number'); + }; + var shouldDisableNodeChange = function (editor) { + return editor.getParam('disable_nodechange'); + }; + var isReadOnly = function (editor) { + return editor.getParam('readonly'); + }; + var hasContentCssCors = function (editor) { + return editor.getParam('content_css_cors'); + }; + var getPlugins = function (editor) { + return editor.getParam('plugins', '', 'string'); + }; + var getExternalPlugins = function (editor) { + return editor.getParam('external_plugins'); + }; + var shouldBlockUnsupportedDrop = function (editor) { + return editor.getParam('block_unsupported_drop', true, 'boolean'); + }; + + var isElement$4 = isElement$1; + var isText$6 = isText$1; + var removeNode = function (node) { + var parentNode = node.parentNode; + if (parentNode) { + parentNode.removeChild(node); + } + }; + var trimCount = function (text) { + var trimmedText = trim$2(text); + return { + count: text.length - trimmedText.length, + text: trimmedText + }; + }; + var deleteZwspChars = function (caretContainer) { + var idx; + while ((idx = caretContainer.data.lastIndexOf(ZWSP)) !== -1) { + caretContainer.deleteData(idx, 1); + } + }; + var removeUnchanged = function (caretContainer, pos) { + remove$5(caretContainer); + return pos; + }; + var removeTextAndReposition = function (caretContainer, pos) { + var before = trimCount(caretContainer.data.substr(0, pos.offset())); + var after = trimCount(caretContainer.data.substr(pos.offset())); + var text = before.text + after.text; + if (text.length > 0) { + deleteZwspChars(caretContainer); + return CaretPosition$1(caretContainer, pos.offset() - before.count); + } else { + return pos; + } + }; + var removeElementAndReposition = function (caretContainer, pos) { + var parentNode = pos.container(); + var newPosition = indexOf(from$1(parentNode.childNodes), caretContainer).map(function (index) { + return index < pos.offset() ? CaretPosition$1(parentNode, pos.offset() - 1) : pos; + }).getOr(pos); + remove$5(caretContainer); + return newPosition; + }; + var removeTextCaretContainer = function (caretContainer, pos) { + return isText$6(caretContainer) && pos.container() === caretContainer ? removeTextAndReposition(caretContainer, pos) : removeUnchanged(caretContainer, pos); + }; + var removeElementCaretContainer = function (caretContainer, pos) { + return pos.container() === caretContainer.parentNode ? removeElementAndReposition(caretContainer, pos) : removeUnchanged(caretContainer, pos); + }; + var removeAndReposition = function (container, pos) { + return CaretPosition$1.isTextPosition(pos) ? removeTextCaretContainer(container, pos) : removeElementCaretContainer(container, pos); + }; + var remove$5 = function (caretContainerNode) { + if (isElement$4(caretContainerNode) && isCaretContainer(caretContainerNode)) { + if (hasContent(caretContainerNode)) { + caretContainerNode.removeAttribute('data-mce-caret'); + } else { + removeNode(caretContainerNode); + } + } + if (isText$6(caretContainerNode)) { + deleteZwspChars(caretContainerNode); + if (caretContainerNode.data.length === 0) { + removeNode(caretContainerNode); + } + } + }; + + var browser$2 = detect$3().browser; + var isContentEditableFalse$3 = isContentEditableFalse; + var isMedia$1 = isMedia; + var isTableCell$2 = isTableCell; + var inlineFakeCaretSelector = '*[contentEditable=false],video,audio,embed,object'; + var getAbsoluteClientRect = function (root, element, before) { + var clientRect = collapse(element.getBoundingClientRect(), before); + var docElm, scrollX, scrollY, margin, rootRect; + if (root.tagName === 'BODY') { + docElm = root.ownerDocument.documentElement; + scrollX = root.scrollLeft || docElm.scrollLeft; + scrollY = root.scrollTop || docElm.scrollTop; + } else { + rootRect = root.getBoundingClientRect(); + scrollX = root.scrollLeft - rootRect.left; + scrollY = root.scrollTop - rootRect.top; + } + clientRect.left += scrollX; + clientRect.right += scrollX; + clientRect.top += scrollY; + clientRect.bottom += scrollY; + clientRect.width = 1; + margin = element.offsetWidth - element.clientWidth; + if (margin > 0) { + if (before) { + margin *= -1; + } + clientRect.left += margin; + clientRect.right += margin; + } + return clientRect; + }; + var trimInlineCaretContainers = function (root) { + var fakeCaretTargetNodes = descendants$1(SugarElement.fromDom(root), inlineFakeCaretSelector); + for (var i = 0; i < fakeCaretTargetNodes.length; i++) { + var node = fakeCaretTargetNodes[i].dom; + var sibling = node.previousSibling; + if (endsWithCaretContainer(sibling)) { + var data = sibling.data; + if (data.length === 1) { + sibling.parentNode.removeChild(sibling); + } else { + sibling.deleteData(data.length - 1, 1); + } + } + sibling = node.nextSibling; + if (startsWithCaretContainer(sibling)) { + var data = sibling.data; + if (data.length === 1) { + sibling.parentNode.removeChild(sibling); + } else { + sibling.deleteData(0, 1); + } + } + } + }; + var FakeCaret = function (editor, root, isBlock, hasFocus) { + var lastVisualCaret = Cell(Optional.none()); + var cursorInterval, caretContainerNode; + var rootBlock = getForcedRootBlock(editor); + var caretBlock = rootBlock.length > 0 ? rootBlock : 'p'; + var show = function (before, element) { + var clientRect, rng; + hide(); + if (isTableCell$2(element)) { + return null; + } + if (isBlock(element)) { + caretContainerNode = insertBlock(caretBlock, element, before); + clientRect = getAbsoluteClientRect(root, element, before); + DomQuery(caretContainerNode).css('top', clientRect.top); + var caret = DomQuery('
    ').css(clientRect).appendTo(root)[0]; + lastVisualCaret.set(Optional.some({ + caret: caret, + element: element, + before: before + })); + lastVisualCaret.get().each(function (caretState) { + if (before) { + DomQuery(caretState.caret).addClass('mce-visual-caret-before'); + } + }); + startBlink(); + rng = element.ownerDocument.createRange(); + rng.setStart(caretContainerNode, 0); + rng.setEnd(caretContainerNode, 0); + } else { + caretContainerNode = insertInline(element, before); + rng = element.ownerDocument.createRange(); + if (isInlineFakeCaretTarget(caretContainerNode.nextSibling)) { + rng.setStart(caretContainerNode, 0); + rng.setEnd(caretContainerNode, 0); + } else { + rng.setStart(caretContainerNode, 1); + rng.setEnd(caretContainerNode, 1); + } + return rng; + } + return rng; + }; + var hide = function () { + trimInlineCaretContainers(root); + if (caretContainerNode) { + remove$5(caretContainerNode); + caretContainerNode = null; + } + lastVisualCaret.get().each(function (caretState) { + DomQuery(caretState.caret).remove(); + lastVisualCaret.set(Optional.none()); + }); + if (cursorInterval) { + Delay.clearInterval(cursorInterval); + cursorInterval = null; + } + }; + var startBlink = function () { + cursorInterval = Delay.setInterval(function () { + if (hasFocus()) { + DomQuery('div.mce-visual-caret', root).toggleClass('mce-visual-caret-hidden'); + } else { + DomQuery('div.mce-visual-caret', root).addClass('mce-visual-caret-hidden'); + } + }, 500); + }; + var reposition = function () { + lastVisualCaret.get().each(function (caretState) { + var clientRect = getAbsoluteClientRect(root, caretState.element, caretState.before); + DomQuery(caretState.caret).css(__assign({}, clientRect)); + }); + }; + var destroy = function () { + return Delay.clearInterval(cursorInterval); + }; + var getCss = function () { + return '.mce-visual-caret {' + 'position: absolute;' + 'background-color: black;' + 'background-color: currentcolor;' + '}' + '.mce-visual-caret-hidden {' + 'display: none;' + '}' + '*[data-mce-caret] {' + 'position: absolute;' + 'left: -1000px;' + 'right: auto;' + 'top: 0;' + 'margin: 0;' + 'padding: 0;' + '}'; + }; + return { + show: show, + hide: hide, + getCss: getCss, + reposition: reposition, + destroy: destroy + }; + }; + var isFakeCaretTableBrowser = function () { + return browser$2.isIE() || browser$2.isEdge() || browser$2.isFirefox(); + }; + var isInlineFakeCaretTarget = function (node) { + return isContentEditableFalse$3(node) || isMedia$1(node); + }; + var isFakeCaretTarget = function (node) { + return isInlineFakeCaretTarget(node) || isTable(node) && isFakeCaretTableBrowser(); + }; + + var isContentEditableFalse$4 = isContentEditableFalse; + var isMedia$2 = isMedia; + var isBlockLike = matchStyleValues('display', 'block table table-cell table-caption list-item'); + var isCaretContainer$2 = isCaretContainer; + var isCaretContainerBlock$1 = isCaretContainerBlock; + var isElement$5 = isElement$1; + var isCaretCandidate$2 = isCaretCandidate; + var isForwards = function (direction) { + return direction > 0; + }; + var isBackwards = function (direction) { + return direction < 0; + }; + var skipCaretContainers = function (walk, shallow) { + var node; + while (node = walk(shallow)) { + if (!isCaretContainerBlock$1(node)) { + return node; + } + } + return null; + }; + var findNode = function (node, direction, predicateFn, rootNode, shallow) { + var walker = new DomTreeWalker(node, rootNode); + var isCefOrCaretContainer = isContentEditableFalse$4(node) || isCaretContainerBlock$1(node); + if (isBackwards(direction)) { + if (isCefOrCaretContainer) { + node = skipCaretContainers(walker.prev, true); + if (predicateFn(node)) { + return node; + } + } + while (node = skipCaretContainers(walker.prev, shallow)) { + if (predicateFn(node)) { + return node; + } + } + } + if (isForwards(direction)) { + if (isCefOrCaretContainer) { + node = skipCaretContainers(walker.next, true); + if (predicateFn(node)) { + return node; + } + } + while (node = skipCaretContainers(walker.next, shallow)) { + if (predicateFn(node)) { + return node; + } + } + } + return null; + }; + var getParentBlock = function (node, rootNode) { + while (node && node !== rootNode) { + if (isBlockLike(node)) { + return node; + } + node = node.parentNode; + } + return null; + }; + var isInSameBlock = function (caretPosition1, caretPosition2, rootNode) { + return getParentBlock(caretPosition1.container(), rootNode) === getParentBlock(caretPosition2.container(), rootNode); + }; + var getChildNodeAtRelativeOffset = function (relativeOffset, caretPosition) { + if (!caretPosition) { + return null; + } + var container = caretPosition.container(); + var offset = caretPosition.offset(); + if (!isElement$5(container)) { + return null; + } + return container.childNodes[offset + relativeOffset]; + }; + var beforeAfter = function (before, node) { + var range = node.ownerDocument.createRange(); + if (before) { + range.setStartBefore(node); + range.setEndBefore(node); + } else { + range.setStartAfter(node); + range.setEndAfter(node); + } + return range; + }; + var isNodesInSameBlock = function (root, node1, node2) { + return getParentBlock(node1, root) === getParentBlock(node2, root); + }; + var lean = function (left, root, node) { + var sibling, siblingName; + if (left) { + siblingName = 'previousSibling'; + } else { + siblingName = 'nextSibling'; + } + while (node && node !== root) { + sibling = node[siblingName]; + if (isCaretContainer$2(sibling)) { + sibling = sibling[siblingName]; + } + if (isContentEditableFalse$4(sibling) || isMedia$2(sibling)) { + if (isNodesInSameBlock(root, sibling, node)) { + return sibling; + } + break; + } + if (isCaretCandidate$2(sibling)) { + break; + } + node = node.parentNode; + } + return null; + }; + var before$2 = curry(beforeAfter, true); + var after$1 = curry(beforeAfter, false); + var normalizeRange = function (direction, root, range) { + var node, container, location; + var leanLeft = curry(lean, true, root); + var leanRight = curry(lean, false, root); + container = range.startContainer; + var offset = range.startOffset; + if (isCaretContainerBlock(container)) { + if (!isElement$5(container)) { + container = container.parentNode; + } + location = container.getAttribute('data-mce-caret'); + if (location === 'before') { + node = container.nextSibling; + if (isFakeCaretTarget(node)) { + return before$2(node); + } + } + if (location === 'after') { + node = container.previousSibling; + if (isFakeCaretTarget(node)) { + return after$1(node); + } + } + } + if (!range.collapsed) { + return range; + } + if (isText$1(container)) { + if (isCaretContainer$2(container)) { + if (direction === 1) { + node = leanRight(container); + if (node) { + return before$2(node); + } + node = leanLeft(container); + if (node) { + return after$1(node); + } + } + if (direction === -1) { + node = leanLeft(container); + if (node) { + return after$1(node); + } + node = leanRight(container); + if (node) { + return before$2(node); + } + } + return range; + } + if (endsWithCaretContainer(container) && offset >= container.data.length - 1) { + if (direction === 1) { + node = leanRight(container); + if (node) { + return before$2(node); + } + } + return range; + } + if (startsWithCaretContainer(container) && offset <= 1) { + if (direction === -1) { + node = leanLeft(container); + if (node) { + return after$1(node); + } + } + return range; + } + if (offset === container.data.length) { + node = leanRight(container); + if (node) { + return before$2(node); + } + return range; + } + if (offset === 0) { + node = leanLeft(container); + if (node) { + return after$1(node); + } + return range; + } + } + return range; + }; + var getRelativeCefElm = function (forward, caretPosition) { + return Optional.from(getChildNodeAtRelativeOffset(forward ? 0 : -1, caretPosition)).filter(isContentEditableFalse$4); + }; + var getNormalizedRangeEndPoint = function (direction, root, range) { + var normalizedRange = normalizeRange(direction, root, range); + if (direction === -1) { + return CaretPosition.fromRangeStart(normalizedRange); + } + return CaretPosition.fromRangeEnd(normalizedRange); + }; + var getElementFromPosition = function (pos) { + return Optional.from(pos.getNode()).map(SugarElement.fromDom); + }; + var getElementFromPrevPosition = function (pos) { + return Optional.from(pos.getNode(true)).map(SugarElement.fromDom); + }; + var getVisualCaretPosition = function (walkFn, caretPosition) { + while (caretPosition = walkFn(caretPosition)) { + if (caretPosition.isVisible()) { + return caretPosition; + } + } + return caretPosition; + }; + var isMoveInsideSameBlock = function (from, to) { + var inSameBlock = isInSameBlock(from, to); + if (!inSameBlock && isBr(from.getNode())) { + return true; + } + return inSameBlock; + }; + + var HDirection; + (function (HDirection) { + HDirection[HDirection['Backwards'] = -1] = 'Backwards'; + HDirection[HDirection['Forwards'] = 1] = 'Forwards'; + }(HDirection || (HDirection = {}))); + var isContentEditableFalse$5 = isContentEditableFalse; + var isText$7 = isText$1; + var isElement$6 = isElement$1; + var isBr$4 = isBr; + var isCaretCandidate$3 = isCaretCandidate; + var isAtomic$1 = isAtomic; + var isEditableCaretCandidate$1 = isEditableCaretCandidate; + var getParents = function (node, root) { + var parents = []; + while (node && node !== root) { + parents.push(node); + node = node.parentNode; + } + return parents; + }; + var nodeAtIndex = function (container, offset) { + if (container.hasChildNodes() && offset < container.childNodes.length) { + return container.childNodes[offset]; + } + return null; + }; + var getCaretCandidatePosition = function (direction, node) { + if (isForwards(direction)) { + if (isCaretCandidate$3(node.previousSibling) && !isText$7(node.previousSibling)) { + return CaretPosition$1.before(node); + } + if (isText$7(node)) { + return CaretPosition$1(node, 0); + } + } + if (isBackwards(direction)) { + if (isCaretCandidate$3(node.nextSibling) && !isText$7(node.nextSibling)) { + return CaretPosition$1.after(node); + } + if (isText$7(node)) { + return CaretPosition$1(node, node.data.length); + } + } + if (isBackwards(direction)) { + if (isBr$4(node)) { + return CaretPosition$1.before(node); + } + return CaretPosition$1.after(node); + } + return CaretPosition$1.before(node); + }; + var moveForwardFromBr = function (root, nextNode) { + var nextSibling = nextNode.nextSibling; + if (nextSibling && isCaretCandidate$3(nextSibling)) { + if (isText$7(nextSibling)) { + return CaretPosition$1(nextSibling, 0); + } else { + return CaretPosition$1.before(nextSibling); + } + } else { + return findCaretPosition(HDirection.Forwards, CaretPosition$1.after(nextNode), root); + } + }; + var findCaretPosition = function (direction, startPos, root) { + var node, nextNode, innerNode; + var caretPosition; + if (!isElement$6(root) || !startPos) { + return null; + } + if (startPos.isEqual(CaretPosition$1.after(root)) && root.lastChild) { + caretPosition = CaretPosition$1.after(root.lastChild); + if (isBackwards(direction) && isCaretCandidate$3(root.lastChild) && isElement$6(root.lastChild)) { + return isBr$4(root.lastChild) ? CaretPosition$1.before(root.lastChild) : caretPosition; + } + } else { + caretPosition = startPos; + } + var container = caretPosition.container(); + var offset = caretPosition.offset(); + if (isText$7(container)) { + if (isBackwards(direction) && offset > 0) { + return CaretPosition$1(container, --offset); + } + if (isForwards(direction) && offset < container.length) { + return CaretPosition$1(container, ++offset); + } + node = container; + } else { + if (isBackwards(direction) && offset > 0) { + nextNode = nodeAtIndex(container, offset - 1); + if (isCaretCandidate$3(nextNode)) { + if (!isAtomic$1(nextNode)) { + innerNode = findNode(nextNode, direction, isEditableCaretCandidate$1, nextNode); + if (innerNode) { + if (isText$7(innerNode)) { + return CaretPosition$1(innerNode, innerNode.data.length); + } + return CaretPosition$1.after(innerNode); + } + } + if (isText$7(nextNode)) { + return CaretPosition$1(nextNode, nextNode.data.length); + } + return CaretPosition$1.before(nextNode); + } + } + if (isForwards(direction) && offset < container.childNodes.length) { + nextNode = nodeAtIndex(container, offset); + if (isCaretCandidate$3(nextNode)) { + if (isBr$4(nextNode)) { + return moveForwardFromBr(root, nextNode); + } + if (!isAtomic$1(nextNode)) { + innerNode = findNode(nextNode, direction, isEditableCaretCandidate$1, nextNode); + if (innerNode) { + if (isText$7(innerNode)) { + return CaretPosition$1(innerNode, 0); + } + return CaretPosition$1.before(innerNode); + } + } + if (isText$7(nextNode)) { + return CaretPosition$1(nextNode, 0); + } + return CaretPosition$1.after(nextNode); + } + } + node = nextNode ? nextNode : caretPosition.getNode(); + } + if (isForwards(direction) && caretPosition.isAtEnd() || isBackwards(direction) && caretPosition.isAtStart()) { + node = findNode(node, direction, always, root, true); + if (isEditableCaretCandidate$1(node, root)) { + return getCaretCandidatePosition(direction, node); + } + } + nextNode = findNode(node, direction, isEditableCaretCandidate$1, root); + var rootContentEditableFalseElm = last$1(filter(getParents(container, root), isContentEditableFalse$5)); + if (rootContentEditableFalseElm && (!nextNode || !rootContentEditableFalseElm.contains(nextNode))) { + if (isForwards(direction)) { + caretPosition = CaretPosition$1.after(rootContentEditableFalseElm); + } else { + caretPosition = CaretPosition$1.before(rootContentEditableFalseElm); + } + return caretPosition; + } + if (nextNode) { + return getCaretCandidatePosition(direction, nextNode); + } + return null; + }; + var CaretWalker = function (root) { + return { + next: function (caretPosition) { + return findCaretPosition(HDirection.Forwards, caretPosition, root); + }, + prev: function (caretPosition) { + return findCaretPosition(HDirection.Backwards, caretPosition, root); + } + }; + }; + + var walkToPositionIn = function (forward, root, start) { + var position = forward ? CaretPosition$1.before(start) : CaretPosition$1.after(start); + return fromPosition(forward, root, position); + }; + var afterElement = function (node) { + return isBr(node) ? CaretPosition$1.before(node) : CaretPosition$1.after(node); + }; + var isBeforeOrStart = function (position) { + if (CaretPosition$1.isTextPosition(position)) { + return position.offset() === 0; + } else { + return isCaretCandidate(position.getNode()); + } + }; + var isAfterOrEnd = function (position) { + if (CaretPosition$1.isTextPosition(position)) { + var container = position.container(); + return position.offset() === container.data.length; + } else { + return isCaretCandidate(position.getNode(true)); + } + }; + var isBeforeAfterSameElement = function (from, to) { + return !CaretPosition$1.isTextPosition(from) && !CaretPosition$1.isTextPosition(to) && from.getNode() === to.getNode(true); + }; + var isAtBr = function (position) { + return !CaretPosition$1.isTextPosition(position) && isBr(position.getNode()); + }; + var shouldSkipPosition = function (forward, from, to) { + if (forward) { + return !isBeforeAfterSameElement(from, to) && !isAtBr(from) && isAfterOrEnd(from) && isBeforeOrStart(to); + } else { + return !isBeforeAfterSameElement(to, from) && isBeforeOrStart(from) && isAfterOrEnd(to); + } + }; + var fromPosition = function (forward, root, pos) { + var walker = CaretWalker(root); + return Optional.from(forward ? walker.next(pos) : walker.prev(pos)); + }; + var navigate = function (forward, root, from) { + return fromPosition(forward, root, from).bind(function (to) { + if (isInSameBlock(from, to, root) && shouldSkipPosition(forward, from, to)) { + return fromPosition(forward, root, to); + } else { + return Optional.some(to); + } + }); + }; + var navigateIgnore = function (forward, root, from, ignoreFilter) { + return navigate(forward, root, from).bind(function (pos) { + return ignoreFilter(pos) ? navigateIgnore(forward, root, pos, ignoreFilter) : Optional.some(pos); + }); + }; + var positionIn = function (forward, element) { + var startNode = forward ? element.firstChild : element.lastChild; + if (isText$1(startNode)) { + return Optional.some(CaretPosition$1(startNode, forward ? 0 : startNode.data.length)); + } else if (startNode) { + if (isCaretCandidate(startNode)) { + return Optional.some(forward ? CaretPosition$1.before(startNode) : afterElement(startNode)); + } else { + return walkToPositionIn(forward, element, startNode); + } + } else { + return Optional.none(); + } + }; + var nextPosition = curry(fromPosition, true); + var prevPosition = curry(fromPosition, false); + var firstPositionIn = curry(positionIn, true); + var lastPositionIn = curry(positionIn, false); + + var CARET_ID = '_mce_caret'; + var isCaretNode = function (node) { + return isElement$1(node) && node.id === CARET_ID; + }; + var getParentCaretContainer = function (body, node) { + while (node && node !== body) { + if (node.id === CARET_ID) { + return node; + } + node = node.parentNode; + } + return null; + }; + + var isStringPathBookmark = function (bookmark) { + return typeof bookmark.start === 'string'; + }; + var isRangeBookmark = function (bookmark) { + return bookmark.hasOwnProperty('rng'); + }; + var isIdBookmark = function (bookmark) { + return bookmark.hasOwnProperty('id'); + }; + var isIndexBookmark = function (bookmark) { + return bookmark.hasOwnProperty('name'); + }; + var isPathBookmark = function (bookmark) { + return Tools.isArray(bookmark.start); + }; + + var addBogus = function (dom, node) { + if (isElement$1(node) && dom.isBlock(node) && !node.innerHTML && !Env.ie) { + node.innerHTML = '
    '; + } + return node; + }; + var resolveCaretPositionBookmark = function (dom, bookmark) { + var pos; + var rng = dom.createRng(); + pos = resolve$1(dom.getRoot(), bookmark.start); + rng.setStart(pos.container(), pos.offset()); + pos = resolve$1(dom.getRoot(), bookmark.end); + rng.setEnd(pos.container(), pos.offset()); + return rng; + }; + var insertZwsp = function (node, rng) { + var textNode = node.ownerDocument.createTextNode(ZWSP); + node.appendChild(textNode); + rng.setStart(textNode, 0); + rng.setEnd(textNode, 0); + }; + var isEmpty$1 = function (node) { + return node.hasChildNodes() === false; + }; + var tryFindRangePosition = function (node, rng) { + return lastPositionIn(node).fold(function () { + return false; + }, function (pos) { + rng.setStart(pos.container(), pos.offset()); + rng.setEnd(pos.container(), pos.offset()); + return true; + }); + }; + var padEmptyCaretContainer = function (root, node, rng) { + if (isEmpty$1(node) && getParentCaretContainer(root, node)) { + insertZwsp(node, rng); + return true; + } else { + return false; + } + }; + var setEndPoint = function (dom, start, bookmark, rng) { + var point = bookmark[start ? 'start' : 'end']; + var i, node, offset, children; + var root = dom.getRoot(); + if (point) { + offset = point[0]; + for (node = root, i = point.length - 1; i >= 1; i--) { + children = node.childNodes; + if (padEmptyCaretContainer(root, node, rng)) { + return true; + } + if (point[i] > children.length - 1) { + if (padEmptyCaretContainer(root, node, rng)) { + return true; + } + return tryFindRangePosition(node, rng); + } + node = children[point[i]]; + } + if (node.nodeType === 3) { + offset = Math.min(point[0], node.nodeValue.length); + } + if (node.nodeType === 1) { + offset = Math.min(point[0], node.childNodes.length); + } + if (start) { + rng.setStart(node, offset); + } else { + rng.setEnd(node, offset); + } + } + return true; + }; + var isValidTextNode = function (node) { + return isText$1(node) && node.data.length > 0; + }; + var restoreEndPoint = function (dom, suffix, bookmark) { + var marker = dom.get(bookmark.id + '_' + suffix), node, idx, next, prev; + var keep = bookmark.keep; + var container, offset; + if (marker) { + node = marker.parentNode; + if (suffix === 'start') { + if (!keep) { + idx = dom.nodeIndex(marker); + } else { + if (marker.hasChildNodes()) { + node = marker.firstChild; + idx = 1; + } else if (isValidTextNode(marker.nextSibling)) { + node = marker.nextSibling; + idx = 0; + } else if (isValidTextNode(marker.previousSibling)) { + node = marker.previousSibling; + idx = marker.previousSibling.data.length; + } else { + node = marker.parentNode; + idx = dom.nodeIndex(marker) + 1; + } + } + container = node; + offset = idx; + } else { + if (!keep) { + idx = dom.nodeIndex(marker); + } else { + if (marker.hasChildNodes()) { + node = marker.firstChild; + idx = 1; + } else if (isValidTextNode(marker.previousSibling)) { + node = marker.previousSibling; + idx = marker.previousSibling.data.length; + } else { + node = marker.parentNode; + idx = dom.nodeIndex(marker); + } + } + container = node; + offset = idx; + } + if (!keep) { + prev = marker.previousSibling; + next = marker.nextSibling; + Tools.each(Tools.grep(marker.childNodes), function (node) { + if (isText$1(node)) { + node.nodeValue = node.nodeValue.replace(/\uFEFF/g, ''); + } + }); + while (marker = dom.get(bookmark.id + '_' + suffix)) { + dom.remove(marker, true); + } + if (prev && next && prev.nodeType === next.nodeType && isText$1(prev) && !Env.opera) { + idx = prev.nodeValue.length; + prev.appendData(next.nodeValue); + dom.remove(next); + container = prev; + offset = idx; + } + } + return Optional.some(CaretPosition$1(container, offset)); + } else { + return Optional.none(); + } + }; + var resolvePaths = function (dom, bookmark) { + var rng = dom.createRng(); + if (setEndPoint(dom, true, bookmark, rng) && setEndPoint(dom, false, bookmark, rng)) { + return Optional.some(rng); + } else { + return Optional.none(); + } + }; + var resolveId = function (dom, bookmark) { + var startPos = restoreEndPoint(dom, 'start', bookmark); + var endPos = restoreEndPoint(dom, 'end', bookmark); + return lift2(startPos, endPos.or(startPos), function (spos, epos) { + var rng = dom.createRng(); + rng.setStart(addBogus(dom, spos.container()), spos.offset()); + rng.setEnd(addBogus(dom, epos.container()), epos.offset()); + return rng; + }); + }; + var resolveIndex$1 = function (dom, bookmark) { + return Optional.from(dom.select(bookmark.name)[bookmark.index]).map(function (elm) { + var rng = dom.createRng(); + rng.selectNode(elm); + return rng; + }); + }; + var resolve$2 = function (selection, bookmark) { + var dom = selection.dom; + if (bookmark) { + if (isPathBookmark(bookmark)) { + return resolvePaths(dom, bookmark); + } else if (isStringPathBookmark(bookmark)) { + return Optional.some(resolveCaretPositionBookmark(dom, bookmark)); + } else if (isIdBookmark(bookmark)) { + return resolveId(dom, bookmark); + } else if (isIndexBookmark(bookmark)) { + return resolveIndex$1(dom, bookmark); + } else if (isRangeBookmark(bookmark)) { + return Optional.some(bookmark.rng); + } + } + return Optional.none(); + }; + + var getBookmark$1 = function (selection, type, normalized) { + return getBookmark(selection, type, normalized); + }; + var moveToBookmark = function (selection, bookmark) { + resolve$2(selection, bookmark).each(function (rng) { + selection.setRng(rng); + }); + }; + var isBookmarkNode$1 = function (node) { + return isElement$1(node) && node.tagName === 'SPAN' && node.getAttribute('data-mce-type') === 'bookmark'; + }; + + var is$2 = function (expected) { + return function (actual) { + return expected === actual; + }; + }; + var isNbsp = is$2(nbsp); + var isWhiteSpace$1 = function (chr) { + return chr !== '' && ' \f\n\r\t\x0B'.indexOf(chr) !== -1; + }; + var isContent$1 = function (chr) { + return !isWhiteSpace$1(chr) && !isNbsp(chr); + }; + + var isNode = function (node) { + return !!node.nodeType; + }; + var isInlineBlock = function (node) { + return node && /^(IMG)$/.test(node.nodeName); + }; + var moveStart = function (dom, selection, rng) { + var offset = rng.startOffset; + var container = rng.startContainer, walker, node, nodes; + if (rng.startContainer === rng.endContainer) { + if (isInlineBlock(rng.startContainer.childNodes[rng.startOffset])) { + return; + } + } + if (container.nodeType === 1) { + nodes = container.childNodes; + if (offset < nodes.length) { + container = nodes[offset]; + walker = new DomTreeWalker(container, dom.getParent(container, dom.isBlock)); + } else { + container = nodes[nodes.length - 1]; + walker = new DomTreeWalker(container, dom.getParent(container, dom.isBlock)); + walker.next(true); + } + for (node = walker.current(); node; node = walker.next()) { + if (node.nodeType === 3 && !isWhiteSpaceNode(node)) { + rng.setStart(node, 0); + selection.setRng(rng); + return; + } + } + } + }; + var getNonWhiteSpaceSibling = function (node, next, inc) { + if (node) { + var nextName = next ? 'nextSibling' : 'previousSibling'; + for (node = inc ? node : node[nextName]; node; node = node[nextName]) { + if (node.nodeType === 1 || !isWhiteSpaceNode(node)) { + return node; + } + } + } + }; + var isTextBlock$1 = function (editor, name) { + if (isNode(name)) { + name = name.nodeName; + } + return !!editor.schema.getTextBlockElements()[name.toLowerCase()]; + }; + var isValid = function (ed, parent, child) { + return ed.schema.isValidChild(parent, child); + }; + var isWhiteSpaceNode = function (node) { + return node && isText$1(node) && /^([\t \r\n]+|)$/.test(node.nodeValue); + }; + var isEmptyTextNode = function (node) { + return node && isText$1(node) && node.length === 0; + }; + var replaceVars = function (value, vars) { + if (typeof value !== 'string') { + value = value(vars); + } else if (vars) { + value = value.replace(/%(\w+)/g, function (str, name) { + return vars[name] || str; + }); + } + return value; + }; + var isEq = function (str1, str2) { + str1 = str1 || ''; + str2 = str2 || ''; + str1 = '' + (str1.nodeName || str1); + str2 = '' + (str2.nodeName || str2); + return str1.toLowerCase() === str2.toLowerCase(); + }; + var normalizeStyleValue = function (dom, value, name) { + if (name === 'color' || name === 'backgroundColor') { + value = dom.toHex(value); + } + if (name === 'fontWeight' && value === 700) { + value = 'bold'; + } + if (name === 'fontFamily') { + value = value.replace(/[\'\"]/g, '').replace(/,\s+/g, ','); + } + return '' + value; + }; + var getStyle = function (dom, node, name) { + return normalizeStyleValue(dom, dom.getStyle(node, name), name); + }; + var getTextDecoration = function (dom, node) { + var decoration; + dom.getParent(node, function (n) { + decoration = dom.getStyle(n, 'text-decoration'); + return decoration && decoration !== 'none'; + }); + return decoration; + }; + var getParents$1 = function (dom, node, selector) { + return dom.getParents(node, selector, dom.getRoot()); + }; + var isVariableFormatName = function (editor, formatName) { + var hasVariableValues = function (format) { + var isVariableValue = function (val) { + return val.length > 1 && val.charAt(0) === '%'; + }; + return exists([ + 'styles', + 'attributes' + ], function (key) { + return get(format, key).exists(function (field) { + var fieldValues = isArray(field) ? field : values(field); + return exists(fieldValues, isVariableValue); + }); + }); + }; + return exists(editor.formatter.get(formatName), hasVariableValues); + }; + var areSimilarFormats = function (editor, formatName, otherFormatName) { + var validKeys = [ + 'inline', + 'block', + 'selector', + 'attributes', + 'styles', + 'classes' + ]; + var filterObj = function (format) { + return filter$1(format, function (_, key) { + return exists(validKeys, function (validKey) { + return validKey === key; + }); + }); + }; + return exists(editor.formatter.get(formatName), function (fmt1) { + var filteredFmt1 = filterObj(fmt1); + return exists(editor.formatter.get(otherFormatName), function (fmt2) { + var filteredFmt2 = filterObj(fmt2); + return equal(filteredFmt1, filteredFmt2); + }); + }); + }; + + var isBookmarkNode$2 = isBookmarkNode$1; + var getParents$2 = getParents$1; + var isWhiteSpaceNode$1 = isWhiteSpaceNode; + var isTextBlock$2 = isTextBlock$1; + var isBogusBr = function (node) { + return node.nodeName === 'BR' && node.getAttribute('data-mce-bogus') && !node.nextSibling; + }; + var findParentContentEditable = function (dom, node) { + var parent = node; + while (parent) { + if (isElement$1(parent) && dom.getContentEditable(parent)) { + return dom.getContentEditable(parent) === 'false' ? parent : node; + } + parent = parent.parentNode; + } + return node; + }; + var walkText = function (start, node, offset, predicate) { + var str = node.data; + for (var i = offset; start ? i >= 0 : i < str.length; start ? i-- : i++) { + if (predicate(str.charAt(i))) { + return start ? i + 1 : i; + } + } + return -1; + }; + var findSpace = function (start, node, offset) { + return walkText(start, node, offset, function (c) { + return isNbsp(c) || isWhiteSpace$1(c); + }); + }; + var findContent = function (start, node, offset) { + return walkText(start, node, offset, isContent$1); + }; + var findWordEndPoint = function (dom, body, container, offset, start, includeTrailingSpaces) { + var lastTextNode; + var rootNode = dom.getParent(container, dom.isBlock) || body; + var walk = function (container, offset, pred) { + var textSeeker = TextSeeker(dom); + var walker = start ? textSeeker.backwards : textSeeker.forwards; + return Optional.from(walker(container, offset, function (text, textOffset) { + if (isBookmarkNode$2(text.parentNode)) { + return -1; + } else { + lastTextNode = text; + return pred(start, text, textOffset); + } + }, rootNode)); + }; + var spaceResult = walk(container, offset, findSpace); + return spaceResult.bind(function (result) { + return includeTrailingSpaces ? walk(result.container, result.offset + (start ? -1 : 0), findContent) : Optional.some(result); + }).orThunk(function () { + return lastTextNode ? Optional.some({ + container: lastTextNode, + offset: start ? 0 : lastTextNode.length + }) : Optional.none(); + }); + }; + var findSelectorEndPoint = function (dom, format, rng, container, siblingName) { + if (isText$1(container) && container.nodeValue.length === 0 && container[siblingName]) { + container = container[siblingName]; + } + var parents = getParents$2(dom, container); + for (var i = 0; i < parents.length; i++) { + for (var y = 0; y < format.length; y++) { + var curFormat = format[y]; + if ('collapsed' in curFormat && curFormat.collapsed !== rng.collapsed) { + continue; + } + if (dom.is(parents[i], curFormat.selector)) { + return parents[i]; + } + } + } + return container; + }; + var findBlockEndPoint = function (editor, format, container, siblingName) { + var node; + var dom = editor.dom; + var root = dom.getRoot(); + if (!format[0].wrapper) { + node = dom.getParent(container, format[0].block, root); + } + if (!node) { + var scopeRoot = dom.getParent(container, 'LI,TD,TH'); + node = dom.getParent(isText$1(container) ? container.parentNode : container, function (node) { + return node !== root && isTextBlock$2(editor, node); + }, scopeRoot); + } + if (node && format[0].wrapper) { + node = getParents$2(dom, node, 'ul,ol').reverse()[0] || node; + } + if (!node) { + node = container; + while (node[siblingName] && !dom.isBlock(node[siblingName])) { + node = node[siblingName]; + if (isEq(node, 'br')) { + break; + } + } + } + return node || container; + }; + var findParentContainer = function (dom, format, startContainer, startOffset, endContainer, endOffset, start) { + var container, parent, sibling; + container = parent = start ? startContainer : endContainer; + var siblingName = start ? 'previousSibling' : 'nextSibling'; + var root = dom.getRoot(); + if (isText$1(container) && !isWhiteSpaceNode$1(container)) { + if (start ? startOffset > 0 : endOffset < container.nodeValue.length) { + return container; + } + } + while (true) { + if (!format[0].block_expand && dom.isBlock(parent)) { + return parent; + } + for (sibling = parent[siblingName]; sibling; sibling = sibling[siblingName]) { + if (!isBookmarkNode$2(sibling) && !isWhiteSpaceNode$1(sibling) && !isBogusBr(sibling)) { + return parent; + } + } + if (parent === root || parent.parentNode === root) { + container = parent; + break; + } + parent = parent.parentNode; + } + return container; + }; + var expandRng = function (editor, rng, format, includeTrailingSpace) { + if (includeTrailingSpace === void 0) { + includeTrailingSpace = false; + } + var startContainer = rng.startContainer, startOffset = rng.startOffset, endContainer = rng.endContainer, endOffset = rng.endOffset; + var dom = editor.dom; + if (isElement$1(startContainer) && startContainer.hasChildNodes()) { + startContainer = getNode(startContainer, startOffset); + if (isText$1(startContainer)) { + startOffset = 0; + } + } + if (isElement$1(endContainer) && endContainer.hasChildNodes()) { + endContainer = getNode(endContainer, rng.collapsed ? endOffset : endOffset - 1); + if (isText$1(endContainer)) { + endOffset = endContainer.nodeValue.length; + } + } + startContainer = findParentContentEditable(dom, startContainer); + endContainer = findParentContentEditable(dom, endContainer); + if (isBookmarkNode$2(startContainer.parentNode) || isBookmarkNode$2(startContainer)) { + startContainer = isBookmarkNode$2(startContainer) ? startContainer : startContainer.parentNode; + if (rng.collapsed) { + startContainer = startContainer.previousSibling || startContainer; + } else { + startContainer = startContainer.nextSibling || startContainer; + } + if (isText$1(startContainer)) { + startOffset = rng.collapsed ? startContainer.length : 0; + } + } + if (isBookmarkNode$2(endContainer.parentNode) || isBookmarkNode$2(endContainer)) { + endContainer = isBookmarkNode$2(endContainer) ? endContainer : endContainer.parentNode; + if (rng.collapsed) { + endContainer = endContainer.nextSibling || endContainer; + } else { + endContainer = endContainer.previousSibling || endContainer; + } + if (isText$1(endContainer)) { + endOffset = rng.collapsed ? 0 : endContainer.length; + } + } + if (rng.collapsed) { + var startPoint = findWordEndPoint(dom, editor.getBody(), startContainer, startOffset, true, includeTrailingSpace); + startPoint.each(function (_a) { + var container = _a.container, offset = _a.offset; + startContainer = container; + startOffset = offset; + }); + var endPoint = findWordEndPoint(dom, editor.getBody(), endContainer, endOffset, false, includeTrailingSpace); + endPoint.each(function (_a) { + var container = _a.container, offset = _a.offset; + endContainer = container; + endOffset = offset; + }); + } + if (format[0].inline || format[0].block_expand) { + if (!format[0].inline || (!isText$1(startContainer) || startOffset === 0)) { + startContainer = findParentContainer(dom, format, startContainer, startOffset, endContainer, endOffset, true); + } + if (!format[0].inline || (!isText$1(endContainer) || endOffset === endContainer.nodeValue.length)) { + endContainer = findParentContainer(dom, format, startContainer, startOffset, endContainer, endOffset, false); + } + } + if (format[0].selector && format[0].expand !== false && !format[0].inline) { + startContainer = findSelectorEndPoint(dom, format, rng, startContainer, 'previousSibling'); + endContainer = findSelectorEndPoint(dom, format, rng, endContainer, 'nextSibling'); + } + if (format[0].block || format[0].selector) { + startContainer = findBlockEndPoint(editor, format, startContainer, 'previousSibling'); + endContainer = findBlockEndPoint(editor, format, endContainer, 'nextSibling'); + if (format[0].block) { + if (!dom.isBlock(startContainer)) { + startContainer = findParentContainer(dom, format, startContainer, startOffset, endContainer, endOffset, true); + } + if (!dom.isBlock(endContainer)) { + endContainer = findParentContainer(dom, format, startContainer, startOffset, endContainer, endOffset, false); + } + } + } + if (isElement$1(startContainer)) { + startOffset = dom.nodeIndex(startContainer); + startContainer = startContainer.parentNode; + } + if (isElement$1(endContainer)) { + endOffset = dom.nodeIndex(endContainer) + 1; + endContainer = endContainer.parentNode; + } + return { + startContainer: startContainer, + startOffset: startOffset, + endContainer: endContainer, + endOffset: endOffset + }; + }; + + var clampToExistingChildren = function (container, index) { + var childNodes = container.childNodes; + if (index >= childNodes.length) { + index = childNodes.length - 1; + } else if (index < 0) { + index = 0; + } + return childNodes[index] || container; + }; + var getEndChild = function (container, index) { + return clampToExistingChildren(container, index - 1); + }; + var walk$1 = function (dom, rng, callback) { + var startContainer = rng.startContainer; + var startOffset = rng.startOffset; + var endContainer = rng.endContainer; + var endOffset = rng.endOffset; + var exclude = function (nodes) { + var node; + node = nodes[0]; + if (node.nodeType === 3 && node === startContainer && startOffset >= node.nodeValue.length) { + nodes.splice(0, 1); + } + node = nodes[nodes.length - 1]; + if (endOffset === 0 && nodes.length > 0 && node === endContainer && node.nodeType === 3) { + nodes.splice(nodes.length - 1, 1); + } + return nodes; + }; + var collectSiblings = function (node, name, endNode) { + var siblings = []; + for (; node && node !== endNode; node = node[name]) { + siblings.push(node); + } + return siblings; + }; + var findEndPoint = function (node, root) { + do { + if (node.parentNode === root) { + return node; + } + node = node.parentNode; + } while (node); + }; + var walkBoundary = function (startNode, endNode, next) { + var siblingName = next ? 'nextSibling' : 'previousSibling'; + for (var node = startNode, parent_1 = node.parentNode; node && node !== endNode; node = parent_1) { + parent_1 = node.parentNode; + var siblings_1 = collectSiblings(node === startNode ? node : node[siblingName], siblingName); + if (siblings_1.length) { + if (!next) { + siblings_1.reverse(); + } + callback(exclude(siblings_1)); + } + } + }; + if (startContainer.nodeType === 1 && startContainer.hasChildNodes()) { + startContainer = clampToExistingChildren(startContainer, startOffset); + } + if (endContainer.nodeType === 1 && endContainer.hasChildNodes()) { + endContainer = getEndChild(endContainer, endOffset); + } + if (startContainer === endContainer) { + return callback(exclude([startContainer])); + } + var ancestor = dom.findCommonAncestor(startContainer, endContainer); + for (var node = startContainer; node; node = node.parentNode) { + if (node === endContainer) { + return walkBoundary(startContainer, ancestor, true); + } + if (node === ancestor) { + break; + } + } + for (var node = endContainer; node; node = node.parentNode) { + if (node === startContainer) { + return walkBoundary(endContainer, ancestor); + } + if (node === ancestor) { + break; + } + } + var startPoint = findEndPoint(startContainer, ancestor) || startContainer; + var endPoint = findEndPoint(endContainer, ancestor) || endContainer; + walkBoundary(startContainer, startPoint, true); + var siblings = collectSiblings(startPoint === startContainer ? startPoint : startPoint.nextSibling, 'nextSibling', endPoint === endContainer ? endPoint.nextSibling : endPoint); + if (siblings.length) { + callback(exclude(siblings)); + } + walkBoundary(endContainer, endPoint); + }; + + var getRanges = function (selection) { + var ranges = []; + if (selection) { + for (var i = 0; i < selection.rangeCount; i++) { + ranges.push(selection.getRangeAt(i)); + } + } + return ranges; + }; + var getSelectedNodes = function (ranges) { + return bind(ranges, function (range) { + var node = getSelectedNode(range); + return node ? [SugarElement.fromDom(node)] : []; + }); + }; + var hasMultipleRanges = function (selection) { + return getRanges(selection).length > 1; + }; + + var getCellsFromRanges = function (ranges) { + return filter(getSelectedNodes(ranges), isTableCell$1); + }; + var getCellsFromElement = function (elm) { + return descendants$1(elm, 'td[data-mce-selected],th[data-mce-selected]'); + }; + var getCellsFromElementOrRanges = function (ranges, element) { + var selectedCells = getCellsFromElement(element); + return selectedCells.length > 0 ? selectedCells : getCellsFromRanges(ranges); + }; + var getCellsFromEditor = function (editor) { + return getCellsFromElementOrRanges(getRanges(editor.selection.getSel()), SugarElement.fromDom(editor.getBody())); + }; + + var getStartNode = function (rng) { + var sc = rng.startContainer, so = rng.startOffset; + if (isText$1(sc)) { + return so === 0 ? Optional.some(SugarElement.fromDom(sc)) : Optional.none(); + } else { + return Optional.from(sc.childNodes[so]).map(SugarElement.fromDom); + } + }; + var getEndNode = function (rng) { + var ec = rng.endContainer, eo = rng.endOffset; + if (isText$1(ec)) { + return eo === ec.data.length ? Optional.some(SugarElement.fromDom(ec)) : Optional.none(); + } else { + return Optional.from(ec.childNodes[eo - 1]).map(SugarElement.fromDom); + } + }; + var getFirstChildren = function (node) { + return firstChild(node).fold(constant([node]), function (child) { + return [node].concat(getFirstChildren(child)); + }); + }; + var getLastChildren = function (node) { + return lastChild(node).fold(constant([node]), function (child) { + if (name(child) === 'br') { + return prevSibling(child).map(function (sibling) { + return [node].concat(getLastChildren(sibling)); + }).getOr([]); + } else { + return [node].concat(getLastChildren(child)); + } + }); + }; + var hasAllContentsSelected = function (elm, rng) { + return lift2(getStartNode(rng), getEndNode(rng), function (startNode, endNode) { + var start = find(getFirstChildren(elm), curry(eq$2, startNode)); + var end = find(getLastChildren(elm), curry(eq$2, endNode)); + return start.isSome() && end.isSome(); + }).getOr(false); + }; + var moveEndPoint$1 = function (dom, rng, node, start) { + var root = node, walker = new DomTreeWalker(node, root); + var moveCaretBeforeOnEnterElementsMap = filter$1(dom.schema.getMoveCaretBeforeOnEnterElements(), function (_, name) { + return !contains([ + 'td', + 'th', + 'table' + ], name.toLowerCase()); + }); + do { + if (isText$1(node) && Tools.trim(node.nodeValue).length !== 0) { + if (start) { + rng.setStart(node, 0); + } else { + rng.setEnd(node, node.nodeValue.length); + } + return; + } + if (moveCaretBeforeOnEnterElementsMap[node.nodeName]) { + if (start) { + rng.setStartBefore(node); + } else { + if (node.nodeName === 'BR') { + rng.setEndBefore(node); + } else { + rng.setEndAfter(node); + } + } + return; + } + } while (node = start ? walker.next() : walker.prev()); + if (root.nodeName === 'BODY') { + if (start) { + rng.setStart(root, 0); + } else { + rng.setEnd(root, root.childNodes.length); + } + } + }; + var hasAnyRanges = function (editor) { + var sel = editor.selection.getSel(); + return sel && sel.rangeCount > 0; + }; + var runOnRanges = function (editor, executor) { + var fakeSelectionNodes = getCellsFromEditor(editor); + if (fakeSelectionNodes.length > 0) { + each(fakeSelectionNodes, function (elem) { + var node = elem.dom; + var fakeNodeRng = editor.dom.createRng(); + fakeNodeRng.setStartBefore(node); + fakeNodeRng.setEndAfter(node); + executor(fakeNodeRng, true); + }); + } else { + executor(editor.selection.getRng(), false); + } + }; + var preserve = function (selection, fillBookmark, executor) { + var bookmark = getPersistentBookmark(selection, fillBookmark); + executor(bookmark); + selection.moveToBookmark(bookmark); + }; + + function NodeValue (is, name) { + var get = function (element) { + if (!is(element)) { + throw new Error('Can only get ' + name + ' value of a ' + name + ' node'); + } + return getOption(element).getOr(''); + }; + var getOption = function (element) { + return is(element) ? Optional.from(element.dom.nodeValue) : Optional.none(); + }; + var set = function (element, value) { + if (!is(element)) { + throw new Error('Can only set raw ' + name + ' value of a ' + name + ' node'); + } + element.dom.nodeValue = value; + }; + return { + get: get, + getOption: getOption, + set: set + }; + } + + var api = NodeValue(isText, 'text'); + var get$7 = function (element) { + return api.get(element); + }; + + var isZeroWidth = function (elem) { + return isText(elem) && get$7(elem) === ZWSP; + }; + var context = function (editor, elem, wrapName, nodeName) { + return parent(elem).fold(function () { + return 'skipping'; + }, function (parent) { + if (nodeName === 'br' || isZeroWidth(elem)) { + return 'valid'; + } else if (isAnnotation(elem)) { + return 'existing'; + } else if (isCaretNode(elem.dom)) { + return 'caret'; + } else if (!isValid(editor, wrapName, nodeName) || !isValid(editor, name(parent), wrapName)) { + return 'invalid-child'; + } else { + return 'valid'; + } + }); + }; + + var applyWordGrab = function (editor, rng) { + var r = expandRng(editor, rng, [{ inline: true }]); + rng.setStart(r.startContainer, r.startOffset); + rng.setEnd(r.endContainer, r.endOffset); + editor.selection.setRng(rng); + }; + var makeAnnotation = function (eDoc, _a, annotationName, decorate) { + var _b = _a.uid, uid = _b === void 0 ? generate$1('mce-annotation') : _b, data = __rest(_a, ['uid']); + var master = SugarElement.fromTag('span', eDoc); + add$3(master, annotation()); + set(master, '' + dataAnnotationId(), uid); + set(master, '' + dataAnnotation(), annotationName); + var _c = decorate(uid, data), _d = _c.attributes, attributes = _d === void 0 ? {} : _d, _e = _c.classes, classes = _e === void 0 ? [] : _e; + setAll(master, attributes); + add$4(master, classes); + return master; + }; + var annotate = function (editor, rng, annotationName, decorate, data) { + var newWrappers = []; + var master = makeAnnotation(editor.getDoc(), data, annotationName, decorate); + var wrapper = Cell(Optional.none()); + var finishWrapper = function () { + wrapper.set(Optional.none()); + }; + var getOrOpenWrapper = function () { + return wrapper.get().getOrThunk(function () { + var nu = shallow(master); + newWrappers.push(nu); + wrapper.set(Optional.some(nu)); + return nu; + }); + }; + var processElements = function (elems) { + each(elems, processElement); + }; + var processElement = function (elem) { + var ctx = context(editor, elem, 'span', name(elem)); + switch (ctx) { + case 'invalid-child': { + finishWrapper(); + var children$1 = children(elem); + processElements(children$1); + finishWrapper(); + break; + } + case 'valid': { + var w = getOrOpenWrapper(); + wrap(elem, w); + break; + } + } + }; + var processNodes = function (nodes) { + var elems = map(nodes, SugarElement.fromDom); + processElements(elems); + }; + walk$1(editor.dom, rng, function (nodes) { + finishWrapper(); + processNodes(nodes); + }); + return newWrappers; + }; + var annotateWithBookmark = function (editor, name, settings, data) { + editor.undoManager.transact(function () { + var selection = editor.selection; + var initialRng = selection.getRng(); + var hasFakeSelection = getCellsFromEditor(editor).length > 0; + if (initialRng.collapsed && !hasFakeSelection) { + applyWordGrab(editor, initialRng); + } + if (selection.getRng().collapsed && !hasFakeSelection) { + var wrapper = makeAnnotation(editor.getDoc(), data, name, settings.decorate); + set$1(wrapper, nbsp); + selection.getRng().insertNode(wrapper.dom); + selection.select(wrapper.dom); + } else { + preserve(selection, false, function () { + runOnRanges(editor, function (selectionRng) { + annotate(editor, selectionRng, name, settings.decorate, data); + }); + }); + } + }); + }; + + var Annotator = function (editor) { + var registry = create$2(); + setup$1(editor, registry); + var changes = setup(editor); + return { + register: function (name, settings) { + registry.register(name, settings); + }, + annotate: function (name, data) { + registry.lookup(name).each(function (settings) { + annotateWithBookmark(editor, name, settings, data); + }); + }, + annotationChanged: function (name, callback) { + changes.addListener(name, callback); + }, + remove: function (name) { + identify(editor, Optional.some(name)).each(function (_a) { + var elements = _a.elements; + each(elements, unwrap); + }); + }, + getAll: function (name) { + var directory = findAll(editor, name); + return map$1(directory, function (elems) { + return map(elems, function (elem) { + return elem.dom; + }); + }); + } + }; + }; + + function BookmarkManager(selection) { + return { + getBookmark: curry(getBookmark$1, selection), + moveToBookmark: curry(moveToBookmark, selection) + }; + } + (function (BookmarkManager) { + BookmarkManager.isBookmarkNode = isBookmarkNode$1; + }(BookmarkManager || (BookmarkManager = {}))); + var BookmarkManager$1 = BookmarkManager; + + var getContentEditableRoot = function (root, node) { + while (node && node !== root) { + if (isContentEditableTrue(node) || isContentEditableFalse(node)) { + return node; + } + node = node.parentNode; + } + return null; + }; + + var isXYWithinRange = function (clientX, clientY, range) { + if (range.collapsed) { + return false; + } + if (Env.browser.isIE() && range.startOffset === range.endOffset - 1 && range.startContainer === range.endContainer) { + var elm = range.startContainer.childNodes[range.startOffset]; + if (isElement$1(elm)) { + return exists(elm.getClientRects(), function (rect) { + return containsXY(rect, clientX, clientY); + }); + } + } + return exists(range.getClientRects(), function (rect) { + return containsXY(rect, clientX, clientY); + }); + }; + + var firePreProcess = function (editor, args) { + return editor.fire('PreProcess', args); + }; + var firePostProcess = function (editor, args) { + return editor.fire('PostProcess', args); + }; + var fireRemove = function (editor) { + return editor.fire('remove'); + }; + var fireDetach = function (editor) { + return editor.fire('detach'); + }; + var fireSwitchMode = function (editor, mode) { + return editor.fire('SwitchMode', { mode: mode }); + }; + var fireObjectResizeStart = function (editor, target, width, height, origin) { + editor.fire('ObjectResizeStart', { + target: target, + width: width, + height: height, + origin: origin + }); + }; + var fireObjectResized = function (editor, target, width, height, origin) { + editor.fire('ObjectResized', { + target: target, + width: width, + height: height, + origin: origin + }); + }; + var firePreInit = function (editor) { + return editor.fire('PreInit'); + }; + var firePostRender = function (editor) { + return editor.fire('PostRender'); + }; + var fireInit = function (editor) { + return editor.fire('Init'); + }; + var firePlaceholderToggle = function (editor, state) { + return editor.fire('PlaceholderToggle', { state: state }); + }; + var fireError = function (editor, errorType, error) { + return editor.fire(errorType, error); + }; + + var VK = { + BACKSPACE: 8, + DELETE: 46, + DOWN: 40, + ENTER: 13, + LEFT: 37, + RIGHT: 39, + SPACEBAR: 32, + TAB: 9, + UP: 38, + END: 35, + HOME: 36, + modifierPressed: function (e) { + return e.shiftKey || e.ctrlKey || e.altKey || this.metaKeyPressed(e); + }, + metaKeyPressed: function (e) { + return Env.mac ? e.metaKey : e.ctrlKey && !e.altKey; + } + }; + + var isContentEditableFalse$6 = isContentEditableFalse; + var ControlSelection = function (selection, editor) { + var dom = editor.dom, each = Tools.each; + var selectedElm, selectedElmGhost, resizeHelper, selectedHandle; + var startX, startY, selectedElmX, selectedElmY, startW, startH, ratio, resizeStarted; + var width, height; + var editableDoc = editor.getDoc(), rootDocument = document; + var abs = Math.abs, round = Math.round, rootElement = editor.getBody(); + var startScrollWidth, startScrollHeight; + var resizeHandles = { + nw: [ + 0, + 0, + -1, + -1 + ], + ne: [ + 1, + 0, + 1, + -1 + ], + se: [ + 1, + 1, + 1, + 1 + ], + sw: [ + 0, + 1, + -1, + 1 + ] + }; + var isImage = function (elm) { + return elm && (elm.nodeName === 'IMG' || editor.dom.is(elm, 'figure.image')); + }; + var isEventOnImageOutsideRange = function (evt, range) { + if (evt.type === 'longpress' || evt.type.indexOf('touch') === 0) { + var touch = evt.touches[0]; + return isImage(evt.target) && !isXYWithinRange(touch.clientX, touch.clientY, range); + } else { + return isImage(evt.target) && !isXYWithinRange(evt.clientX, evt.clientY, range); + } + }; + var contextMenuSelectImage = function (evt) { + var target = evt.target; + if (isEventOnImageOutsideRange(evt, editor.selection.getRng()) && !evt.isDefaultPrevented()) { + editor.selection.select(target); + } + }; + var getResizeTarget = function (elm) { + return editor.dom.is(elm, 'figure.image') ? elm.querySelector('img') : elm; + }; + var isResizable = function (elm) { + var selector = getObjectResizing(editor); + if (!selector) { + return false; + } + if (elm.getAttribute('data-mce-resize') === 'false') { + return false; + } + if (elm === editor.getBody()) { + return false; + } + return is$1(SugarElement.fromDom(elm), selector); + }; + var setGhostElmSize = function (ghostElm, width, height) { + dom.setStyles(getResizeTarget(ghostElm), { + width: width, + height: height + }); + }; + var resizeGhostElement = function (e) { + var deltaX, deltaY, proportional; + var resizeHelperX, resizeHelperY; + deltaX = e.screenX - startX; + deltaY = e.screenY - startY; + width = deltaX * selectedHandle[2] + startW; + height = deltaY * selectedHandle[3] + startH; + width = width < 5 ? 5 : width; + height = height < 5 ? 5 : height; + if (isImage(selectedElm) && getResizeImgProportional(editor) !== false) { + proportional = !VK.modifierPressed(e); + } else { + proportional = VK.modifierPressed(e); + } + if (proportional) { + if (abs(deltaX) > abs(deltaY)) { + height = round(width * ratio); + width = round(height / ratio); + } else { + width = round(height / ratio); + height = round(width * ratio); + } + } + setGhostElmSize(selectedElmGhost, width, height); + resizeHelperX = selectedHandle.startPos.x + deltaX; + resizeHelperY = selectedHandle.startPos.y + deltaY; + resizeHelperX = resizeHelperX > 0 ? resizeHelperX : 0; + resizeHelperY = resizeHelperY > 0 ? resizeHelperY : 0; + dom.setStyles(resizeHelper, { + left: resizeHelperX, + top: resizeHelperY, + display: 'block' + }); + resizeHelper.innerHTML = width + ' × ' + height; + if (selectedHandle[2] < 0 && selectedElmGhost.clientWidth <= width) { + dom.setStyle(selectedElmGhost, 'left', selectedElmX + (startW - width)); + } + if (selectedHandle[3] < 0 && selectedElmGhost.clientHeight <= height) { + dom.setStyle(selectedElmGhost, 'top', selectedElmY + (startH - height)); + } + deltaX = rootElement.scrollWidth - startScrollWidth; + deltaY = rootElement.scrollHeight - startScrollHeight; + if (deltaX + deltaY !== 0) { + dom.setStyles(resizeHelper, { + left: resizeHelperX - deltaX, + top: resizeHelperY - deltaY + }); + } + if (!resizeStarted) { + fireObjectResizeStart(editor, selectedElm, startW, startH, 'corner-' + selectedHandle.name); + resizeStarted = true; + } + }; + var endGhostResize = function () { + var wasResizeStarted = resizeStarted; + resizeStarted = false; + var setSizeProp = function (name, value) { + if (value) { + if (selectedElm.style[name] || !editor.schema.isValid(selectedElm.nodeName.toLowerCase(), name)) { + dom.setStyle(getResizeTarget(selectedElm), name, value); + } else { + dom.setAttrib(getResizeTarget(selectedElm), name, '' + value); + } + } + }; + if (wasResizeStarted) { + setSizeProp('width', width); + setSizeProp('height', height); + } + dom.unbind(editableDoc, 'mousemove', resizeGhostElement); + dom.unbind(editableDoc, 'mouseup', endGhostResize); + if (rootDocument !== editableDoc) { + dom.unbind(rootDocument, 'mousemove', resizeGhostElement); + dom.unbind(rootDocument, 'mouseup', endGhostResize); + } + dom.remove(selectedElmGhost); + dom.remove(resizeHelper); + showResizeRect(selectedElm); + if (wasResizeStarted) { + fireObjectResized(editor, selectedElm, width, height, 'corner-' + selectedHandle.name); + dom.setAttrib(selectedElm, 'style', dom.getAttrib(selectedElm, 'style')); + } + editor.nodeChanged(); + }; + var showResizeRect = function (targetElm) { + hideResizeRect(); + unbindResizeHandleEvents(); + var position = dom.getPos(targetElm, rootElement); + var selectedElmX = position.x; + var selectedElmY = position.y; + var rect = targetElm.getBoundingClientRect(); + var targetWidth = rect.width || rect.right - rect.left; + var targetHeight = rect.height || rect.bottom - rect.top; + if (selectedElm !== targetElm) { + selectedElm = targetElm; + width = height = 0; + } + var e = editor.fire('ObjectSelected', { target: targetElm }); + if (isResizable(targetElm) && !e.isDefaultPrevented()) { + each(resizeHandles, function (handle, name) { + var handleElm; + var startDrag = function (e) { + startX = e.screenX; + startY = e.screenY; + startW = getResizeTarget(selectedElm).clientWidth; + startH = getResizeTarget(selectedElm).clientHeight; + ratio = startH / startW; + selectedHandle = handle; + selectedHandle.name = name; + selectedHandle.startPos = { + x: targetWidth * handle[0] + selectedElmX, + y: targetHeight * handle[1] + selectedElmY + }; + startScrollWidth = rootElement.scrollWidth; + startScrollHeight = rootElement.scrollHeight; + selectedElmGhost = selectedElm.cloneNode(true); + dom.addClass(selectedElmGhost, 'mce-clonedresizable'); + dom.setAttrib(selectedElmGhost, 'data-mce-bogus', 'all'); + selectedElmGhost.contentEditable = false; + selectedElmGhost.unSelectabe = true; + dom.setStyles(selectedElmGhost, { + left: selectedElmX, + top: selectedElmY, + margin: 0 + }); + setGhostElmSize(selectedElmGhost, targetWidth, targetHeight); + selectedElmGhost.removeAttribute('data-mce-selected'); + rootElement.appendChild(selectedElmGhost); + dom.bind(editableDoc, 'mousemove', resizeGhostElement); + dom.bind(editableDoc, 'mouseup', endGhostResize); + if (rootDocument !== editableDoc) { + dom.bind(rootDocument, 'mousemove', resizeGhostElement); + dom.bind(rootDocument, 'mouseup', endGhostResize); + } + resizeHelper = dom.add(rootElement, 'div', { + 'class': 'mce-resize-helper', + 'data-mce-bogus': 'all' + }, startW + ' × ' + startH); + }; + handleElm = dom.get('mceResizeHandle' + name); + if (handleElm) { + dom.remove(handleElm); + } + handleElm = dom.add(rootElement, 'div', { + 'id': 'mceResizeHandle' + name, + 'data-mce-bogus': 'all', + 'class': 'mce-resizehandle', + 'unselectable': true, + 'style': 'cursor:' + name + '-resize; margin:0; padding:0' + }); + if (Env.ie === 11) { + handleElm.contentEditable = false; + } + dom.bind(handleElm, 'mousedown', function (e) { + e.stopImmediatePropagation(); + e.preventDefault(); + startDrag(e); + }); + handle.elm = handleElm; + dom.setStyles(handleElm, { + left: targetWidth * handle[0] + selectedElmX - handleElm.offsetWidth / 2, + top: targetHeight * handle[1] + selectedElmY - handleElm.offsetHeight / 2 + }); + }); + } else { + hideResizeRect(); + } + selectedElm.setAttribute('data-mce-selected', '1'); + }; + var hideResizeRect = function () { + unbindResizeHandleEvents(); + if (selectedElm) { + selectedElm.removeAttribute('data-mce-selected'); + } + each$1(resizeHandles, function (value, name) { + var handleElm = dom.get('mceResizeHandle' + name); + if (handleElm) { + dom.unbind(handleElm); + dom.remove(handleElm); + } + }); + }; + var updateResizeRect = function (e) { + var startElm, controlElm; + var isChildOrEqual = function (node, parent) { + if (node) { + do { + if (node === parent) { + return true; + } + } while (node = node.parentNode); + } + }; + if (resizeStarted || editor.removed) { + return; + } + each(dom.select('img[data-mce-selected],hr[data-mce-selected]'), function (img) { + img.removeAttribute('data-mce-selected'); + }); + controlElm = e.type === 'mousedown' ? e.target : selection.getNode(); + controlElm = dom.$(controlElm).closest('table,img,figure.image,hr')[0]; + if (isChildOrEqual(controlElm, rootElement)) { + disableGeckoResize(); + startElm = selection.getStart(true); + if (isChildOrEqual(startElm, controlElm) && isChildOrEqual(selection.getEnd(true), controlElm)) { + showResizeRect(controlElm); + return; + } + } + hideResizeRect(); + }; + var isWithinContentEditableFalse = function (elm) { + return isContentEditableFalse$6(getContentEditableRoot(editor.getBody(), elm)); + }; + var unbindResizeHandleEvents = function () { + each$1(resizeHandles, function (handle) { + if (handle.elm) { + dom.unbind(handle.elm); + delete handle.elm; + } + }); + }; + var disableGeckoResize = function () { + try { + editor.getDoc().execCommand('enableObjectResizing', false, 'false'); + } catch (ex) { + } + }; + editor.on('init', function () { + disableGeckoResize(); + if (Env.browser.isIE() || Env.browser.isEdge()) { + editor.on('mousedown click', function (e) { + var target = e.target, nodeName = target.nodeName; + if (!resizeStarted && /^(TABLE|IMG|HR)$/.test(nodeName) && !isWithinContentEditableFalse(target)) { + if (e.button !== 2) { + editor.selection.select(target, nodeName === 'TABLE'); + } + if (e.type === 'mousedown') { + editor.nodeChanged(); + } + } + }); + var handleMSControlSelect_1 = function (e) { + var delayedSelect = function (node) { + Delay.setEditorTimeout(editor, function () { + return editor.selection.select(node); + }); + }; + if (isWithinContentEditableFalse(e.target) || isMedia(e.target)) { + e.preventDefault(); + delayedSelect(e.target); + return; + } + if (/^(TABLE|IMG|HR)$/.test(e.target.nodeName)) { + e.preventDefault(); + if (e.target.tagName === 'IMG') { + delayedSelect(e.target); + } + } + }; + dom.bind(rootElement, 'mscontrolselect', handleMSControlSelect_1); + editor.on('remove', function () { + return dom.unbind(rootElement, 'mscontrolselect', handleMSControlSelect_1); + }); + } + var throttledUpdateResizeRect = Delay.throttle(function (e) { + if (!editor.composing) { + updateResizeRect(e); + } + }); + editor.on('nodechange ResizeEditor ResizeWindow ResizeContent drop FullscreenStateChanged', throttledUpdateResizeRect); + editor.on('keyup compositionend', function (e) { + if (selectedElm && selectedElm.nodeName === 'TABLE') { + throttledUpdateResizeRect(e); + } + }); + editor.on('hide blur', hideResizeRect); + editor.on('contextmenu longpress', contextMenuSelectImage, true); + }); + editor.on('remove', unbindResizeHandleEvents); + var destroy = function () { + selectedElm = selectedElmGhost = null; + }; + return { + isResizable: isResizable, + showResizeRect: showResizeRect, + hideResizeRect: hideResizeRect, + updateResizeRect: updateResizeRect, + destroy: destroy + }; + }; + + var hasCeProperty = function (node) { + return isContentEditableTrue(node) || isContentEditableFalse(node); + }; + var findParent = function (node, rootNode, predicate) { + while (node && node !== rootNode) { + if (predicate(node)) { + return node; + } + node = node.parentNode; + } + return null; + }; + var findClosestIeRange = function (clientX, clientY, doc) { + var rects; + var element = doc.elementFromPoint(clientX, clientY); + var rng = doc.body.createTextRange(); + if (!element || element.tagName === 'HTML') { + element = doc.body; + } + rng.moveToElementText(element); + rects = Tools.toArray(rng.getClientRects()); + rects = rects.sort(function (a, b) { + a = Math.abs(Math.max(a.top - clientY, a.bottom - clientY)); + b = Math.abs(Math.max(b.top - clientY, b.bottom - clientY)); + return a - b; + }); + if (rects.length > 0) { + clientY = (rects[0].bottom + rects[0].top) / 2; + try { + rng.moveToPoint(clientX, clientY); + rng.collapse(true); + return rng; + } catch (ex) { + } + } + return null; + }; + var moveOutOfContentEditableFalse = function (rng, rootNode) { + var parentElement = rng && rng.parentElement ? rng.parentElement() : null; + return isContentEditableFalse(findParent(parentElement, rootNode, hasCeProperty)) ? null : rng; + }; + var fromPoint$1 = function (clientX, clientY, doc) { + var rng, point; + var pointDoc = doc; + if (pointDoc.caretPositionFromPoint) { + point = pointDoc.caretPositionFromPoint(clientX, clientY); + if (point) { + rng = doc.createRange(); + rng.setStart(point.offsetNode, point.offset); + rng.collapse(true); + } + } else if (doc.caretRangeFromPoint) { + rng = doc.caretRangeFromPoint(clientX, clientY); + } else if (pointDoc.body.createTextRange) { + rng = pointDoc.body.createTextRange(); + try { + rng.moveToPoint(clientX, clientY); + rng.collapse(true); + } catch (ex) { + rng = findClosestIeRange(clientX, clientY, doc); + } + return moveOutOfContentEditableFalse(rng, doc.body); + } + return rng; + }; + + var isEq$1 = function (rng1, rng2) { + return rng1 && rng2 && (rng1.startContainer === rng2.startContainer && rng1.startOffset === rng2.startOffset) && (rng1.endContainer === rng2.endContainer && rng1.endOffset === rng2.endOffset); + }; + + var findParent$1 = function (node, rootNode, predicate) { + while (node && node !== rootNode) { + if (predicate(node)) { + return node; + } + node = node.parentNode; + } + return null; + }; + var hasParent = function (node, rootNode, predicate) { + return findParent$1(node, rootNode, predicate) !== null; + }; + var hasParentWithName = function (node, rootNode, name) { + return hasParent(node, rootNode, function (node) { + return node.nodeName === name; + }); + }; + var isTable$3 = function (node) { + return node && node.nodeName === 'TABLE'; + }; + var isTableCell$3 = function (node) { + return node && /^(TD|TH|CAPTION)$/.test(node.nodeName); + }; + var isCeFalseCaretContainer = function (node, rootNode) { + return isCaretContainer(node) && hasParent(node, rootNode, isCaretNode) === false; + }; + var hasBrBeforeAfter = function (dom, node, left) { + var walker = new DomTreeWalker(node, dom.getParent(node.parentNode, dom.isBlock) || dom.getRoot()); + while (node = walker[left ? 'prev' : 'next']()) { + if (isBr(node)) { + return true; + } + } + }; + var isPrevNode = function (node, name) { + return node.previousSibling && node.previousSibling.nodeName === name; + }; + var hasContentEditableFalseParent = function (body, node) { + while (node && node !== body) { + if (isContentEditableFalse(node)) { + return true; + } + node = node.parentNode; + } + return false; + }; + var findTextNodeRelative = function (dom, isAfterNode, collapsed, left, startNode) { + var lastInlineElement; + var body = dom.getRoot(); + var node; + var nonEmptyElementsMap = dom.schema.getNonEmptyElements(); + var parentBlockContainer = dom.getParent(startNode.parentNode, dom.isBlock) || body; + if (left && isBr(startNode) && isAfterNode && dom.isEmpty(parentBlockContainer)) { + return Optional.some(CaretPosition(startNode.parentNode, dom.nodeIndex(startNode))); + } + var walker = new DomTreeWalker(startNode, parentBlockContainer); + while (node = walker[left ? 'prev' : 'next']()) { + if (dom.getContentEditableParent(node) === 'false' || isCeFalseCaretContainer(node, body)) { + return Optional.none(); + } + if (isText$1(node) && node.nodeValue.length > 0) { + if (hasParentWithName(node, body, 'A') === false) { + return Optional.some(CaretPosition(node, left ? node.nodeValue.length : 0)); + } + return Optional.none(); + } + if (dom.isBlock(node) || nonEmptyElementsMap[node.nodeName.toLowerCase()]) { + return Optional.none(); + } + lastInlineElement = node; + } + if (collapsed && lastInlineElement) { + return Optional.some(CaretPosition(lastInlineElement, 0)); + } + return Optional.none(); + }; + var normalizeEndPoint = function (dom, collapsed, start, rng) { + var container, offset; + var body = dom.getRoot(); + var node; + var directionLeft, normalized = false; + container = rng[(start ? 'start' : 'end') + 'Container']; + offset = rng[(start ? 'start' : 'end') + 'Offset']; + var isAfterNode = isElement$1(container) && offset === container.childNodes.length; + var nonEmptyElementsMap = dom.schema.getNonEmptyElements(); + directionLeft = start; + if (isCaretContainer(container)) { + return Optional.none(); + } + if (isElement$1(container) && offset > container.childNodes.length - 1) { + directionLeft = false; + } + if (isDocument$1(container)) { + container = body; + offset = 0; + } + if (container === body) { + if (directionLeft) { + node = container.childNodes[offset > 0 ? offset - 1 : 0]; + if (node) { + if (isCaretContainer(node)) { + return Optional.none(); + } + if (nonEmptyElementsMap[node.nodeName] || isTable$3(node)) { + return Optional.none(); + } + } + } + if (container.hasChildNodes()) { + offset = Math.min(!directionLeft && offset > 0 ? offset - 1 : offset, container.childNodes.length - 1); + container = container.childNodes[offset]; + offset = isText$1(container) && isAfterNode ? container.data.length : 0; + if (!collapsed && container === body.lastChild && isTable$3(container)) { + return Optional.none(); + } + if (hasContentEditableFalseParent(body, container) || isCaretContainer(container)) { + return Optional.none(); + } + if (container.hasChildNodes() && isTable$3(container) === false) { + node = container; + var walker = new DomTreeWalker(container, body); + do { + if (isContentEditableFalse(node) || isCaretContainer(node)) { + normalized = false; + break; + } + if (isText$1(node) && node.nodeValue.length > 0) { + offset = directionLeft ? 0 : node.nodeValue.length; + container = node; + normalized = true; + break; + } + if (nonEmptyElementsMap[node.nodeName.toLowerCase()] && !isTableCell$3(node)) { + offset = dom.nodeIndex(node); + container = node.parentNode; + if (!directionLeft) { + offset++; + } + normalized = true; + break; + } + } while (node = directionLeft ? walker.next() : walker.prev()); + } + } + } + if (collapsed) { + if (isText$1(container) && offset === 0) { + findTextNodeRelative(dom, isAfterNode, collapsed, true, container).each(function (pos) { + container = pos.container(); + offset = pos.offset(); + normalized = true; + }); + } + if (isElement$1(container)) { + node = container.childNodes[offset]; + if (!node) { + node = container.childNodes[offset - 1]; + } + if (node && isBr(node) && !isPrevNode(node, 'A') && !hasBrBeforeAfter(dom, node, false) && !hasBrBeforeAfter(dom, node, true)) { + findTextNodeRelative(dom, isAfterNode, collapsed, true, node).each(function (pos) { + container = pos.container(); + offset = pos.offset(); + normalized = true; + }); + } + } + } + if (directionLeft && !collapsed && isText$1(container) && offset === container.nodeValue.length) { + findTextNodeRelative(dom, isAfterNode, collapsed, false, container).each(function (pos) { + container = pos.container(); + offset = pos.offset(); + normalized = true; + }); + } + return normalized ? Optional.some(CaretPosition(container, offset)) : Optional.none(); + }; + var normalize = function (dom, rng) { + var collapsed = rng.collapsed, normRng = rng.cloneRange(); + var startPos = CaretPosition.fromRangeStart(rng); + normalizeEndPoint(dom, collapsed, true, normRng).each(function (pos) { + if (!collapsed || !CaretPosition.isAbove(startPos, pos)) { + normRng.setStart(pos.container(), pos.offset()); + } + }); + if (!collapsed) { + normalizeEndPoint(dom, collapsed, false, normRng).each(function (pos) { + normRng.setEnd(pos.container(), pos.offset()); + }); + } + if (collapsed) { + normRng.collapse(true); + } + return isEq$1(rng, normRng) ? Optional.none() : Optional.some(normRng); + }; + + var splitText = function (node, offset) { + return node.splitText(offset); + }; + var split$1 = function (rng) { + var startContainer = rng.startContainer, startOffset = rng.startOffset, endContainer = rng.endContainer, endOffset = rng.endOffset; + if (startContainer === endContainer && isText$1(startContainer)) { + if (startOffset > 0 && startOffset < startContainer.nodeValue.length) { + endContainer = splitText(startContainer, startOffset); + startContainer = endContainer.previousSibling; + if (endOffset > startOffset) { + endOffset = endOffset - startOffset; + startContainer = endContainer = splitText(endContainer, endOffset).previousSibling; + endOffset = endContainer.nodeValue.length; + startOffset = 0; + } else { + endOffset = 0; + } + } + } else { + if (isText$1(startContainer) && startOffset > 0 && startOffset < startContainer.nodeValue.length) { + startContainer = splitText(startContainer, startOffset); + startOffset = 0; + } + if (isText$1(endContainer) && endOffset > 0 && endOffset < endContainer.nodeValue.length) { + endContainer = splitText(endContainer, endOffset).previousSibling; + endOffset = endContainer.nodeValue.length; + } + } + return { + startContainer: startContainer, + startOffset: startOffset, + endContainer: endContainer, + endOffset: endOffset + }; + }; + + function RangeUtils(dom) { + var walk = function (rng, callback) { + return walk$1(dom, rng, callback); + }; + var split = split$1; + var normalize$1 = function (rng) { + return normalize(dom, rng).fold(never, function (normalizedRng) { + rng.setStart(normalizedRng.startContainer, normalizedRng.startOffset); + rng.setEnd(normalizedRng.endContainer, normalizedRng.endOffset); + return true; + }); + }; + return { + walk: walk, + split: split, + normalize: normalize$1 + }; + } + (function (RangeUtils) { + RangeUtils.compareRanges = isEq$1; + RangeUtils.getCaretRangeFromPoint = fromPoint$1; + RangeUtils.getSelectedNode = getSelectedNode; + RangeUtils.getNode = getNode; + }(RangeUtils || (RangeUtils = {}))); + var RangeUtils$1 = RangeUtils; + + function Dimension (name, getOffset) { + var set = function (element, h) { + if (!isNumber(h) && !h.match(/^[0-9]+$/)) { + throw new Error(name + '.set accepts only positive integer values. Value was ' + h); + } + var dom = element.dom; + if (isSupported$1(dom)) { + dom.style[name] = h + 'px'; + } + }; + var get = function (element) { + var r = getOffset(element); + if (r <= 0 || r === null) { + var css = get$4(element, name); + return parseFloat(css) || 0; + } + return r; + }; + var getOuter = get; + var aggregate = function (element, properties) { + return foldl(properties, function (acc, property) { + var val = get$4(element, property); + var value = val === undefined ? 0 : parseInt(val, 10); + return isNaN(value) ? acc : acc + value; + }, 0); + }; + var max = function (element, value, properties) { + var cumulativeInclusions = aggregate(element, properties); + var absoluteMax = value > cumulativeInclusions ? value - cumulativeInclusions : 0; + return absoluteMax; + }; + return { + set: set, + get: get, + getOuter: getOuter, + aggregate: aggregate, + max: max + }; + } + + var api$1 = Dimension('height', function (element) { + var dom = element.dom; + return inBody(element) ? dom.getBoundingClientRect().height : dom.offsetHeight; + }); + var get$8 = function (element) { + return api$1.get(element); + }; + + var walkUp = function (navigation, doc) { + var frame = navigation.view(doc); + return frame.fold(constant([]), function (f) { + var parent = navigation.owner(f); + var rest = walkUp(navigation, parent); + return [f].concat(rest); + }); + }; + var pathTo = function (element, navigation) { + var d = navigation.owner(element); + return walkUp(navigation, d); + }; + + var view = function (doc) { + var _a; + var element = doc.dom === document ? Optional.none() : Optional.from((_a = doc.dom.defaultView) === null || _a === void 0 ? void 0 : _a.frameElement); + return element.map(SugarElement.fromDom); + }; + var owner$1 = function (element) { + return documentOrOwner(element); + }; + + var Navigation = /*#__PURE__*/Object.freeze({ + __proto__: null, + view: view, + owner: owner$1 + }); + + var find$2 = function (element) { + var doc = SugarElement.fromDom(document); + var scroll = get$1(doc); + var frames = pathTo(element, Navigation); + var offset = viewport(element); + var r = foldr(frames, function (b, a) { + var loc = viewport(a); + return { + left: b.left + loc.left, + top: b.top + loc.top + }; + }, { + left: 0, + top: 0 + }); + return SugarPosition(r.left + offset.left + scroll.left, r.top + offset.top + scroll.top); + }; + + var excludeFromDescend = function (element) { + return name(element) === 'textarea'; + }; + var fireScrollIntoViewEvent = function (editor, data) { + var scrollEvent = editor.fire('ScrollIntoView', data); + return scrollEvent.isDefaultPrevented(); + }; + var fireAfterScrollIntoViewEvent = function (editor, data) { + editor.fire('AfterScrollIntoView', data); + }; + var descend = function (element, offset) { + var children$1 = children(element); + if (children$1.length === 0 || excludeFromDescend(element)) { + return { + element: element, + offset: offset + }; + } else if (offset < children$1.length && !excludeFromDescend(children$1[offset])) { + return { + element: children$1[offset], + offset: 0 + }; + } else { + var last = children$1[children$1.length - 1]; + if (excludeFromDescend(last)) { + return { + element: element, + offset: offset + }; + } else { + if (name(last) === 'img') { + return { + element: last, + offset: 1 + }; + } else if (isText(last)) { + return { + element: last, + offset: get$7(last).length + }; + } else { + return { + element: last, + offset: children(last).length + }; + } + } + } + }; + var markerInfo = function (element, cleanupFun) { + var pos = absolute(element); + var height = get$8(element); + return { + element: element, + bottom: pos.top + height, + height: height, + pos: pos, + cleanup: cleanupFun + }; + }; + var createMarker = function (element, offset) { + var startPoint = descend(element, offset); + var span = SugarElement.fromHtml('' + ZWSP + ''); + before(startPoint.element, span); + return markerInfo(span, function () { + return remove(span); + }); + }; + var elementMarker = function (element) { + return markerInfo(SugarElement.fromDom(element), noop); + }; + var withMarker = function (editor, f, rng, alignToTop) { + preserveWith(editor, function (_s, _e) { + return applyWithMarker(editor, f, rng, alignToTop); + }, rng); + }; + var withScrollEvents = function (editor, doc, f, marker, alignToTop) { + var data = { + elm: marker.element.dom, + alignToTop: alignToTop + }; + if (fireScrollIntoViewEvent(editor, data)) { + return; + } + var scrollTop = get$1(doc).top; + f(doc, scrollTop, marker, alignToTop); + fireAfterScrollIntoViewEvent(editor, data); + }; + var applyWithMarker = function (editor, f, rng, alignToTop) { + var body = SugarElement.fromDom(editor.getBody()); + var doc = SugarElement.fromDom(editor.getDoc()); + reflow(body); + var marker = createMarker(SugarElement.fromDom(rng.startContainer), rng.startOffset); + withScrollEvents(editor, doc, f, marker, alignToTop); + marker.cleanup(); + }; + var withElement = function (editor, element, f, alignToTop) { + var doc = SugarElement.fromDom(editor.getDoc()); + withScrollEvents(editor, doc, f, elementMarker(element), alignToTop); + }; + var preserveWith = function (editor, f, rng) { + var startElement = rng.startContainer; + var startOffset = rng.startOffset; + var endElement = rng.endContainer; + var endOffset = rng.endOffset; + f(SugarElement.fromDom(startElement), SugarElement.fromDom(endElement)); + var newRng = editor.dom.createRng(); + newRng.setStart(startElement, startOffset); + newRng.setEnd(endElement, endOffset); + editor.selection.setRng(rng); + }; + var scrollToMarker = function (marker, viewHeight, alignToTop, doc) { + var pos = marker.pos; + if (alignToTop) { + to(pos.left, pos.top, doc); + } else { + var y = pos.top - viewHeight + marker.height; + to(pos.left, y, doc); + } + }; + var intoWindowIfNeeded = function (doc, scrollTop, viewHeight, marker, alignToTop) { + var viewportBottom = viewHeight + scrollTop; + var markerTop = marker.pos.top; + var markerBottom = marker.bottom; + var largerThanViewport = markerBottom - markerTop >= viewHeight; + if (markerTop < scrollTop) { + scrollToMarker(marker, viewHeight, alignToTop !== false, doc); + } else if (markerTop > viewportBottom) { + var align = largerThanViewport ? alignToTop !== false : alignToTop === true; + scrollToMarker(marker, viewHeight, align, doc); + } else if (markerBottom > viewportBottom && !largerThanViewport) { + scrollToMarker(marker, viewHeight, alignToTop === true, doc); + } + }; + var intoWindow = function (doc, scrollTop, marker, alignToTop) { + var viewHeight = doc.dom.defaultView.innerHeight; + intoWindowIfNeeded(doc, scrollTop, viewHeight, marker, alignToTop); + }; + var intoFrame = function (doc, scrollTop, marker, alignToTop) { + var frameViewHeight = doc.dom.defaultView.innerHeight; + intoWindowIfNeeded(doc, scrollTop, frameViewHeight, marker, alignToTop); + var op = find$2(marker.element); + var viewportBounds = getBounds(window); + if (op.top < viewportBounds.y) { + intoView(marker.element, alignToTop !== false); + } else if (op.top > viewportBounds.bottom) { + intoView(marker.element, alignToTop === true); + } + }; + var rangeIntoWindow = function (editor, rng, alignToTop) { + return withMarker(editor, intoWindow, rng, alignToTop); + }; + var elementIntoWindow = function (editor, element, alignToTop) { + return withElement(editor, element, intoWindow, alignToTop); + }; + var rangeIntoFrame = function (editor, rng, alignToTop) { + return withMarker(editor, intoFrame, rng, alignToTop); + }; + var elementIntoFrame = function (editor, element, alignToTop) { + return withElement(editor, element, intoFrame, alignToTop); + }; + var scrollElementIntoView = function (editor, element, alignToTop) { + var scroller = editor.inline ? elementIntoWindow : elementIntoFrame; + scroller(editor, element, alignToTop); + }; + var scrollRangeIntoView = function (editor, rng, alignToTop) { + var scroller = editor.inline ? rangeIntoWindow : rangeIntoFrame; + scroller(editor, rng, alignToTop); + }; + + var getDocument = function () { + return SugarElement.fromDom(document); + }; + + var focus = function (element) { + return element.dom.focus(); + }; + var hasFocus = function (element) { + var root = getRootNode(element).dom; + return element.dom === root.activeElement; + }; + var active = function (root) { + if (root === void 0) { + root = getDocument(); + } + return Optional.from(root.dom.activeElement).map(SugarElement.fromDom); + }; + var search = function (element) { + return active(getRootNode(element)).filter(function (e) { + return element.dom.contains(e.dom); + }); + }; + + var create$4 = function (start, soffset, finish, foffset) { + return { + start: start, + soffset: soffset, + finish: finish, + foffset: foffset + }; + }; + var SimRange = { create: create$4 }; + + var adt = Adt.generate([ + { before: ['element'] }, + { + on: [ + 'element', + 'offset' + ] + }, + { after: ['element'] } + ]); + var cata = function (subject, onBefore, onOn, onAfter) { + return subject.fold(onBefore, onOn, onAfter); + }; + var getStart = function (situ) { + return situ.fold(identity, identity, identity); + }; + var before$3 = adt.before; + var on = adt.on; + var after$2 = adt.after; + var Situ = { + before: before$3, + on: on, + after: after$2, + cata: cata, + getStart: getStart + }; + + var adt$1 = Adt.generate([ + { domRange: ['rng'] }, + { + relative: [ + 'startSitu', + 'finishSitu' + ] + }, + { + exact: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + } + ]); + var exactFromRange = function (simRange) { + return adt$1.exact(simRange.start, simRange.soffset, simRange.finish, simRange.foffset); + }; + var getStart$1 = function (selection) { + return selection.match({ + domRange: function (rng) { + return SugarElement.fromDom(rng.startContainer); + }, + relative: function (startSitu, _finishSitu) { + return Situ.getStart(startSitu); + }, + exact: function (start, _soffset, _finish, _foffset) { + return start; + } + }); + }; + var domRange = adt$1.domRange; + var relative = adt$1.relative; + var exact = adt$1.exact; + var getWin = function (selection) { + var start = getStart$1(selection); + return defaultView(start); + }; + var range = SimRange.create; + var SimSelection = { + domRange: domRange, + relative: relative, + exact: exact, + exactFromRange: exactFromRange, + getWin: getWin, + range: range + }; + + var browser$3 = detect$3().browser; + var clamp = function (offset, element) { + var max = isText(element) ? get$7(element).length : children(element).length + 1; + if (offset > max) { + return max; + } else if (offset < 0) { + return 0; + } + return offset; + }; + var normalizeRng = function (rng) { + return SimSelection.range(rng.start, clamp(rng.soffset, rng.start), rng.finish, clamp(rng.foffset, rng.finish)); + }; + var isOrContains = function (root, elm) { + return !isRestrictedNode(elm.dom) && (contains$2(root, elm) || eq$2(root, elm)); + }; + var isRngInRoot = function (root) { + return function (rng) { + return isOrContains(root, rng.start) && isOrContains(root, rng.finish); + }; + }; + var shouldStore = function (editor) { + return editor.inline === true || browser$3.isIE(); + }; + var nativeRangeToSelectionRange = function (r) { + return SimSelection.range(SugarElement.fromDom(r.startContainer), r.startOffset, SugarElement.fromDom(r.endContainer), r.endOffset); + }; + var readRange = function (win) { + var selection = win.getSelection(); + var rng = !selection || selection.rangeCount === 0 ? Optional.none() : Optional.from(selection.getRangeAt(0)); + return rng.map(nativeRangeToSelectionRange); + }; + var getBookmark$2 = function (root) { + var win = defaultView(root); + return readRange(win.dom).filter(isRngInRoot(root)); + }; + var validate = function (root, bookmark) { + return Optional.from(bookmark).filter(isRngInRoot(root)).map(normalizeRng); + }; + var bookmarkToNativeRng = function (bookmark) { + var rng = document.createRange(); + try { + rng.setStart(bookmark.start.dom, bookmark.soffset); + rng.setEnd(bookmark.finish.dom, bookmark.foffset); + return Optional.some(rng); + } catch (_) { + return Optional.none(); + } + }; + var store = function (editor) { + var newBookmark = shouldStore(editor) ? getBookmark$2(SugarElement.fromDom(editor.getBody())) : Optional.none(); + editor.bookmark = newBookmark.isSome() ? newBookmark : editor.bookmark; + }; + var storeNative = function (editor, rng) { + var root = SugarElement.fromDom(editor.getBody()); + var range = shouldStore(editor) ? Optional.from(rng) : Optional.none(); + var newBookmark = range.map(nativeRangeToSelectionRange).filter(isRngInRoot(root)); + editor.bookmark = newBookmark.isSome() ? newBookmark : editor.bookmark; + }; + var getRng = function (editor) { + var bookmark = editor.bookmark ? editor.bookmark : Optional.none(); + return bookmark.bind(function (x) { + return validate(SugarElement.fromDom(editor.getBody()), x); + }).bind(bookmarkToNativeRng); + }; + var restore = function (editor) { + getRng(editor).each(function (rng) { + return editor.selection.setRng(rng); + }); + }; + + var isEditorUIElement = function (elm) { + var className = elm.className.toString(); + return className.indexOf('tox-') !== -1 || className.indexOf('mce-') !== -1; + }; + var FocusManager = { isEditorUIElement: isEditorUIElement }; + + var isManualNodeChange = function (e) { + return e.type === 'nodechange' && e.selectionChange; + }; + var registerPageMouseUp = function (editor, throttledStore) { + var mouseUpPage = function () { + throttledStore.throttle(); + }; + DOMUtils$1.DOM.bind(document, 'mouseup', mouseUpPage); + editor.on('remove', function () { + DOMUtils$1.DOM.unbind(document, 'mouseup', mouseUpPage); + }); + }; + var registerFocusOut = function (editor) { + editor.on('focusout', function () { + store(editor); + }); + }; + var registerMouseUp = function (editor, throttledStore) { + editor.on('mouseup touchend', function (_e) { + throttledStore.throttle(); + }); + }; + var registerEditorEvents = function (editor, throttledStore) { + var browser = detect$3().browser; + if (browser.isIE()) { + registerFocusOut(editor); + } else { + registerMouseUp(editor, throttledStore); + } + editor.on('keyup NodeChange', function (e) { + if (!isManualNodeChange(e)) { + store(editor); + } + }); + }; + var register = function (editor) { + var throttledStore = first(function () { + store(editor); + }, 0); + editor.on('init', function () { + if (editor.inline) { + registerPageMouseUp(editor, throttledStore); + } + registerEditorEvents(editor, throttledStore); + }); + editor.on('remove', function () { + throttledStore.cancel(); + }); + }; + + var documentFocusInHandler; + var DOM$2 = DOMUtils$1.DOM; + var isEditorUIElement$1 = function (elm) { + return FocusManager.isEditorUIElement(elm); + }; + var isEditorContentAreaElement = function (elm) { + var classList = elm.classList; + if (classList !== undefined) { + return classList.contains('tox-edit-area') || classList.contains('tox-edit-area__iframe') || classList.contains('mce-content-body'); + } else { + return false; + } + }; + var isUIElement = function (editor, elm) { + var customSelector = getCustomUiSelector(editor); + var parent = DOM$2.getParent(elm, function (elm) { + return isEditorUIElement$1(elm) || (customSelector ? editor.dom.is(elm, customSelector) : false); + }); + return parent !== null; + }; + var getActiveElement = function (editor) { + try { + var root = getRootNode(SugarElement.fromDom(editor.getElement())); + return active(root).fold(function () { + return document.body; + }, function (x) { + return x.dom; + }); + } catch (ex) { + return document.body; + } + }; + var registerEvents = function (editorManager, e) { + var editor = e.editor; + register(editor); + editor.on('focusin', function () { + var self = this; + var focusedEditor = editorManager.focusedEditor; + if (focusedEditor !== self) { + if (focusedEditor) { + focusedEditor.fire('blur', { focusedEditor: self }); + } + editorManager.setActive(self); + editorManager.focusedEditor = self; + self.fire('focus', { blurredEditor: focusedEditor }); + self.focus(true); + } + }); + editor.on('focusout', function () { + var self = this; + Delay.setEditorTimeout(self, function () { + var focusedEditor = editorManager.focusedEditor; + if (!isUIElement(self, getActiveElement(self)) && focusedEditor === self) { + self.fire('blur', { focusedEditor: null }); + editorManager.focusedEditor = null; + } + }); + }); + if (!documentFocusInHandler) { + documentFocusInHandler = function (e) { + var activeEditor = editorManager.activeEditor; + if (activeEditor) { + getOriginalEventTarget(e).each(function (target) { + if (target.ownerDocument === document) { + if (target !== document.body && !isUIElement(activeEditor, target) && editorManager.focusedEditor === activeEditor) { + activeEditor.fire('blur', { focusedEditor: null }); + editorManager.focusedEditor = null; + } + } + }); + } + }; + DOM$2.bind(document, 'focusin', documentFocusInHandler); + } + }; + var unregisterDocumentEvents = function (editorManager, e) { + if (editorManager.focusedEditor === e.editor) { + editorManager.focusedEditor = null; + } + if (!editorManager.activeEditor) { + DOM$2.unbind(document, 'focusin', documentFocusInHandler); + documentFocusInHandler = null; + } + }; + var setup$2 = function (editorManager) { + editorManager.on('AddEditor', curry(registerEvents, editorManager)); + editorManager.on('RemoveEditor', curry(unregisterDocumentEvents, editorManager)); + }; + + var getContentEditableHost = function (editor, node) { + return editor.dom.getParent(node, function (node) { + return editor.dom.getContentEditable(node) === 'true'; + }); + }; + var getCollapsedNode = function (rng) { + return rng.collapsed ? Optional.from(getNode(rng.startContainer, rng.startOffset)).map(SugarElement.fromDom) : Optional.none(); + }; + var getFocusInElement = function (root, rng) { + return getCollapsedNode(rng).bind(function (node) { + if (isTableSection(node)) { + return Optional.some(node); + } else if (contains$2(root, node) === false) { + return Optional.some(root); + } else { + return Optional.none(); + } + }); + }; + var normalizeSelection = function (editor, rng) { + getFocusInElement(SugarElement.fromDom(editor.getBody()), rng).bind(function (elm) { + return firstPositionIn(elm.dom); + }).fold(function () { + editor.selection.normalize(); + return; + }, function (caretPos) { + return editor.selection.setRng(caretPos.toRange()); + }); + }; + var focusBody = function (body) { + if (body.setActive) { + try { + body.setActive(); + } catch (ex) { + body.focus(); + } + } else { + body.focus(); + } + }; + var hasElementFocus = function (elm) { + return hasFocus(elm) || search(elm).isSome(); + }; + var hasIframeFocus = function (editor) { + return editor.iframeElement && hasFocus(SugarElement.fromDom(editor.iframeElement)); + }; + var hasInlineFocus = function (editor) { + var rawBody = editor.getBody(); + return rawBody && hasElementFocus(SugarElement.fromDom(rawBody)); + }; + var hasUiFocus = function (editor) { + return active().filter(function (elem) { + return !isEditorContentAreaElement(elem.dom) && isUIElement(editor, elem.dom); + }).isSome(); + }; + var hasFocus$1 = function (editor) { + return editor.inline ? hasInlineFocus(editor) : hasIframeFocus(editor); + }; + var hasEditorOrUiFocus = function (editor) { + return hasFocus$1(editor) || hasUiFocus(editor); + }; + var focusEditor = function (editor) { + var selection = editor.selection; + var body = editor.getBody(); + var rng = selection.getRng(); + editor.quirks.refreshContentEditable(); + if (editor.bookmark !== undefined && hasFocus$1(editor) === false) { + getRng(editor).each(function (bookmarkRng) { + editor.selection.setRng(bookmarkRng); + rng = bookmarkRng; + }); + } + var contentEditableHost = getContentEditableHost(editor, selection.getNode()); + if (editor.$.contains(body, contentEditableHost)) { + focusBody(contentEditableHost); + normalizeSelection(editor, rng); + activateEditor(editor); + return; + } + if (!editor.inline) { + if (!Env.opera) { + focusBody(body); + } + editor.getWin().focus(); + } + if (Env.gecko || editor.inline) { + focusBody(body); + normalizeSelection(editor, rng); + } + activateEditor(editor); + }; + var activateEditor = function (editor) { + return editor.editorManager.setActive(editor); + }; + var focus$1 = function (editor, skipFocus) { + if (editor.removed) { + return; + } + skipFocus ? activateEditor(editor) : focusEditor(editor); + }; + + var getEndpointElement = function (root, rng, start, real, resolve) { + var container = start ? rng.startContainer : rng.endContainer; + var offset = start ? rng.startOffset : rng.endOffset; + return Optional.from(container).map(SugarElement.fromDom).map(function (elm) { + return !real || !rng.collapsed ? child(elm, resolve(elm, offset)).getOr(elm) : elm; + }).bind(function (elm) { + return isElement(elm) ? Optional.some(elm) : parent(elm).filter(isElement); + }).map(function (elm) { + return elm.dom; + }).getOr(root); + }; + var getStart$2 = function (root, rng, real) { + return getEndpointElement(root, rng, true, real, function (elm, offset) { + return Math.min(childNodesCount(elm), offset); + }); + }; + var getEnd = function (root, rng, real) { + return getEndpointElement(root, rng, false, real, function (elm, offset) { + return offset > 0 ? offset - 1 : offset; + }); + }; + var skipEmptyTextNodes = function (node, forwards) { + var orig = node; + while (node && isText$1(node) && node.length === 0) { + node = forwards ? node.nextSibling : node.previousSibling; + } + return node || orig; + }; + var getNode$1 = function (root, rng) { + var elm, startContainer, endContainer; + if (!rng) { + return root; + } + startContainer = rng.startContainer; + endContainer = rng.endContainer; + var startOffset = rng.startOffset; + var endOffset = rng.endOffset; + elm = rng.commonAncestorContainer; + if (!rng.collapsed) { + if (startContainer === endContainer) { + if (endOffset - startOffset < 2) { + if (startContainer.hasChildNodes()) { + elm = startContainer.childNodes[startOffset]; + } + } + } + if (startContainer.nodeType === 3 && endContainer.nodeType === 3) { + if (startContainer.length === startOffset) { + startContainer = skipEmptyTextNodes(startContainer.nextSibling, true); + } else { + startContainer = startContainer.parentNode; + } + if (endOffset === 0) { + endContainer = skipEmptyTextNodes(endContainer.previousSibling, false); + } else { + endContainer = endContainer.parentNode; + } + if (startContainer && startContainer === endContainer) { + return startContainer; + } + } + } + if (elm && elm.nodeType === 3) { + return elm.parentNode; + } + return elm; + }; + var getSelectedBlocks = function (dom, rng, startElm, endElm) { + var node; + var selectedBlocks = []; + var root = dom.getRoot(); + startElm = dom.getParent(startElm || getStart$2(root, rng, rng.collapsed), dom.isBlock); + endElm = dom.getParent(endElm || getEnd(root, rng, rng.collapsed), dom.isBlock); + if (startElm && startElm !== root) { + selectedBlocks.push(startElm); + } + if (startElm && endElm && startElm !== endElm) { + node = startElm; + var walker = new DomTreeWalker(startElm, root); + while ((node = walker.next()) && node !== endElm) { + if (dom.isBlock(node)) { + selectedBlocks.push(node); + } + } + } + if (endElm && startElm !== endElm && endElm !== root) { + selectedBlocks.push(endElm); + } + return selectedBlocks; + }; + var select$1 = function (dom, node, content) { + return Optional.from(node).map(function (node) { + var idx = dom.nodeIndex(node); + var rng = dom.createRng(); + rng.setStart(node.parentNode, idx); + rng.setEnd(node.parentNode, idx + 1); + if (content) { + moveEndPoint$1(dom, rng, node, true); + moveEndPoint$1(dom, rng, node, false); + } + return rng; + }); + }; + + var processRanges = function (editor, ranges) { + return map(ranges, function (range) { + var evt = editor.fire('GetSelectionRange', { range: range }); + return evt.range !== range ? evt.range : range; + }); + }; + + var typeLookup = { + '#text': 3, + '#comment': 8, + '#cdata': 4, + '#pi': 7, + '#doctype': 10, + '#document-fragment': 11 + }; + var walk$2 = function (node, root, prev) { + var startName = prev ? 'lastChild' : 'firstChild'; + var siblingName = prev ? 'prev' : 'next'; + if (node[startName]) { + return node[startName]; + } + if (node !== root) { + var sibling = node[siblingName]; + if (sibling) { + return sibling; + } + for (var parent_1 = node.parent; parent_1 && parent_1 !== root; parent_1 = parent_1.parent) { + sibling = parent_1[siblingName]; + if (sibling) { + return sibling; + } + } + } + }; + var isEmptyTextNode$1 = function (node) { + if (!isWhitespaceText(node.value)) { + return false; + } + var parentNode = node.parent; + if (parentNode && (parentNode.name !== 'span' || parentNode.attr('style')) && /^[ ]+$/.test(node.value)) { + return false; + } + return true; + }; + var isNonEmptyElement = function (node) { + var isNamedAnchor = node.name === 'a' && !node.attr('href') && node.attr('id'); + return node.attr('name') || node.attr('id') && !node.firstChild || node.attr('data-mce-bookmark') || isNamedAnchor; + }; + var AstNode = function () { + function AstNode(name, type) { + this.name = name; + this.type = type; + if (type === 1) { + this.attributes = []; + this.attributes.map = {}; + } + } + AstNode.create = function (name, attrs) { + var node = new AstNode(name, typeLookup[name] || 1); + if (attrs) { + each$1(attrs, function (value, attrName) { + node.attr(attrName, value); + }); + } + return node; + }; + AstNode.prototype.replace = function (node) { + var self = this; + if (node.parent) { + node.remove(); + } + self.insert(node, self); + self.remove(); + return self; + }; + AstNode.prototype.attr = function (name, value) { + var self = this; + var attrs; + if (typeof name !== 'string') { + if (name !== undefined && name !== null) { + each$1(name, function (value, key) { + self.attr(key, value); + }); + } + return self; + } + if (attrs = self.attributes) { + if (value !== undefined) { + if (value === null) { + if (name in attrs.map) { + delete attrs.map[name]; + var i = attrs.length; + while (i--) { + if (attrs[i].name === name) { + attrs.splice(i, 1); + return self; + } + } + } + return self; + } + if (name in attrs.map) { + var i = attrs.length; + while (i--) { + if (attrs[i].name === name) { + attrs[i].value = value; + break; + } + } + } else { + attrs.push({ + name: name, + value: value + }); + } + attrs.map[name] = value; + return self; + } + return attrs.map[name]; + } + }; + AstNode.prototype.clone = function () { + var self = this; + var clone = new AstNode(self.name, self.type); + var selfAttrs; + if (selfAttrs = self.attributes) { + var cloneAttrs = []; + cloneAttrs.map = {}; + for (var i = 0, l = selfAttrs.length; i < l; i++) { + var selfAttr = selfAttrs[i]; + if (selfAttr.name !== 'id') { + cloneAttrs[cloneAttrs.length] = { + name: selfAttr.name, + value: selfAttr.value + }; + cloneAttrs.map[selfAttr.name] = selfAttr.value; + } + } + clone.attributes = cloneAttrs; + } + clone.value = self.value; + clone.shortEnded = self.shortEnded; + return clone; + }; + AstNode.prototype.wrap = function (wrapper) { + var self = this; + self.parent.insert(wrapper, self); + wrapper.append(self); + return self; + }; + AstNode.prototype.unwrap = function () { + var self = this; + for (var node = self.firstChild; node;) { + var next = node.next; + self.insert(node, self, true); + node = next; + } + self.remove(); + }; + AstNode.prototype.remove = function () { + var self = this, parent = self.parent, next = self.next, prev = self.prev; + if (parent) { + if (parent.firstChild === self) { + parent.firstChild = next; + if (next) { + next.prev = null; + } + } else { + prev.next = next; + } + if (parent.lastChild === self) { + parent.lastChild = prev; + if (prev) { + prev.next = null; + } + } else { + next.prev = prev; + } + self.parent = self.next = self.prev = null; + } + return self; + }; + AstNode.prototype.append = function (node) { + var self = this; + if (node.parent) { + node.remove(); + } + var last = self.lastChild; + if (last) { + last.next = node; + node.prev = last; + self.lastChild = node; + } else { + self.lastChild = self.firstChild = node; + } + node.parent = self; + return node; + }; + AstNode.prototype.insert = function (node, refNode, before) { + if (node.parent) { + node.remove(); + } + var parent = refNode.parent || this; + if (before) { + if (refNode === parent.firstChild) { + parent.firstChild = node; + } else { + refNode.prev.next = node; + } + node.prev = refNode.prev; + node.next = refNode; + refNode.prev = node; + } else { + if (refNode === parent.lastChild) { + parent.lastChild = node; + } else { + refNode.next.prev = node; + } + node.next = refNode.next; + node.prev = refNode; + refNode.next = node; + } + node.parent = parent; + return node; + }; + AstNode.prototype.getAll = function (name) { + var self = this; + var collection = []; + for (var node = self.firstChild; node; node = walk$2(node, self)) { + if (node.name === name) { + collection.push(node); + } + } + return collection; + }; + AstNode.prototype.empty = function () { + var self = this; + if (self.firstChild) { + var nodes = []; + for (var node = self.firstChild; node; node = walk$2(node, self)) { + nodes.push(node); + } + var i = nodes.length; + while (i--) { + var node = nodes[i]; + node.parent = node.firstChild = node.lastChild = node.next = node.prev = null; + } + } + self.firstChild = self.lastChild = null; + return self; + }; + AstNode.prototype.isEmpty = function (elements, whitespace, predicate) { + if (whitespace === void 0) { + whitespace = {}; + } + var self = this; + var node = self.firstChild; + if (isNonEmptyElement(self)) { + return false; + } + if (node) { + do { + if (node.type === 1) { + if (node.attr('data-mce-bogus')) { + continue; + } + if (elements[node.name]) { + return false; + } + if (isNonEmptyElement(node)) { + return false; + } + } + if (node.type === 8) { + return false; + } + if (node.type === 3 && !isEmptyTextNode$1(node)) { + return false; + } + if (node.type === 3 && node.parent && whitespace[node.parent.name] && isWhitespaceText(node.value)) { + return false; + } + if (predicate && predicate(node)) { + return false; + } + } while (node = walk$2(node, self)); + } + return true; + }; + AstNode.prototype.walk = function (prev) { + return walk$2(this, null, prev); + }; + return AstNode; + }(); + + var makeMap$3 = Tools.makeMap; + var Writer = function (settings) { + var html = []; + settings = settings || {}; + var indent = settings.indent; + var indentBefore = makeMap$3(settings.indent_before || ''); + var indentAfter = makeMap$3(settings.indent_after || ''); + var encode = Entities.getEncodeFunc(settings.entity_encoding || 'raw', settings.entities); + var htmlOutput = settings.element_format === 'html'; + return { + start: function (name, attrs, empty) { + var i, l, attr, value; + if (indent && indentBefore[name] && html.length > 0) { + value = html[html.length - 1]; + if (value.length > 0 && value !== '\n') { + html.push('\n'); + } + } + html.push('<', name); + if (attrs) { + for (i = 0, l = attrs.length; i < l; i++) { + attr = attrs[i]; + html.push(' ', attr.name, '="', encode(attr.value, true), '"'); + } + } + if (!empty || htmlOutput) { + html[html.length] = '>'; + } else { + html[html.length] = ' />'; + } + if (empty && indent && indentAfter[name] && html.length > 0) { + value = html[html.length - 1]; + if (value.length > 0 && value !== '\n') { + html.push('\n'); + } + } + }, + end: function (name) { + var value; + html.push(''); + if (indent && indentAfter[name] && html.length > 0) { + value = html[html.length - 1]; + if (value.length > 0 && value !== '\n') { + html.push('\n'); + } + } + }, + text: function (text, raw) { + if (text.length > 0) { + html[html.length] = raw ? text : encode(text); + } + }, + cdata: function (text) { + html.push(''); + }, + comment: function (text) { + html.push(''); + }, + pi: function (name, text) { + if (text) { + html.push(''); + } else { + html.push(''); + } + if (indent) { + html.push('\n'); + } + }, + doctype: function (text) { + html.push('', indent ? '\n' : ''); + }, + reset: function () { + html.length = 0; + }, + getContent: function () { + return html.join('').replace(/\n$/, ''); + } + }; + }; + + var HtmlSerializer = function (settings, schema) { + if (schema === void 0) { + schema = Schema(); + } + var writer = Writer(settings); + settings = settings || {}; + settings.validate = 'validate' in settings ? settings.validate : true; + var serialize = function (node) { + var validate = settings.validate; + var handlers = { + 3: function (node) { + writer.text(node.value, node.raw); + }, + 8: function (node) { + writer.comment(node.value); + }, + 7: function (node) { + writer.pi(node.name, node.value); + }, + 10: function (node) { + writer.doctype(node.value); + }, + 4: function (node) { + writer.cdata(node.value); + }, + 11: function (node) { + if (node = node.firstChild) { + do { + walk(node); + } while (node = node.next); + } + } + }; + writer.reset(); + var walk = function (node) { + var handler = handlers[node.type]; + var name, isEmpty, attrs, attrName, attrValue, sortedAttrs, i, l, elementRule; + if (!handler) { + name = node.name; + isEmpty = node.shortEnded; + attrs = node.attributes; + if (validate && attrs && attrs.length > 1) { + sortedAttrs = []; + sortedAttrs.map = {}; + elementRule = schema.getElementRule(node.name); + if (elementRule) { + for (i = 0, l = elementRule.attributesOrder.length; i < l; i++) { + attrName = elementRule.attributesOrder[i]; + if (attrName in attrs.map) { + attrValue = attrs.map[attrName]; + sortedAttrs.map[attrName] = attrValue; + sortedAttrs.push({ + name: attrName, + value: attrValue + }); + } + } + for (i = 0, l = attrs.length; i < l; i++) { + attrName = attrs[i].name; + if (!(attrName in sortedAttrs.map)) { + attrValue = attrs.map[attrName]; + sortedAttrs.map[attrName] = attrValue; + sortedAttrs.push({ + name: attrName, + value: attrValue + }); + } + } + attrs = sortedAttrs; + } + } + writer.start(node.name, attrs, isEmpty); + if (!isEmpty) { + if (node = node.firstChild) { + do { + walk(node); + } while (node = node.next); + } + writer.end(name); + } + } else { + handler(node); + } + }; + if (node.type === 1 && !settings.inner) { + walk(node); + } else { + handlers[11](node); + } + return writer.getContent(); + }; + return { serialize: serialize }; + }; + + var extractBase64DataUris = function (html) { + var dataImageUri = /data:[^;]+;base64,([a-z0-9\+\/=]+)/gi; + var chunks = []; + var uris = {}; + var prefix = generate$1('img'); + var matches; + var index = 0; + var count = 0; + while (matches = dataImageUri.exec(html)) { + var uri = matches[0]; + var imageId = prefix + '_' + count++; + uris[imageId] = uri; + if (index < matches.index) { + chunks.push(html.substr(index, matches.index - index)); + } + chunks.push(imageId); + index = matches.index + uri.length; + } + if (index === 0) { + return { + prefix: prefix, + uris: uris, + html: html + }; + } else { + if (index < html.length) { + chunks.push(html.substr(index)); + } + return { + prefix: prefix, + uris: uris, + html: chunks.join('') + }; + } + }; + var restoreDataUris = function (html, result) { + return html.replace(new RegExp(result.prefix + '_[0-9]+', 'g'), function (imageId) { + return get(result.uris, imageId).getOr(imageId); + }); + }; + var parseDataUri = function (uri) { + var matches = /data:([^;]+);base64,([a-z0-9\+\/=]+)/i.exec(uri); + if (matches) { + return Optional.some({ + type: matches[1], + data: decodeURIComponent(matches[2]) + }); + } else { + return Optional.none(); + } + }; + + var isValidPrefixAttrName = function (name) { + return name.indexOf('data-') === 0 || name.indexOf('aria-') === 0; + }; + var isInvalidUri = function (settings, uri) { + if (settings.allow_html_data_urls) { + return false; + } else if (/^data:image\//i.test(uri)) { + return settings.allow_svg_data_urls === false && /^data:image\/svg\+xml/i.test(uri); + } else { + return /^data:/i.test(uri); + } + }; + var findEndTagIndex = function (schema, html, startIndex) { + var count = 1, index, matches; + var shortEndedElements = schema.getShortEndedElements(); + var tokenRegExp = /<([!?\/])?([A-Za-z0-9\-_\:\.]+)((?:\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g; + tokenRegExp.lastIndex = index = startIndex; + while (matches = tokenRegExp.exec(html)) { + index = tokenRegExp.lastIndex; + if (matches[1] === '/') { + count--; + } else if (!matches[1]) { + if (matches[2] in shortEndedElements) { + continue; + } + count++; + } + if (count === 0) { + break; + } + } + return index; + }; + var isConditionalComment = function (html, startIndex) { + return /^\s*\[if [\w\W]+\]>.*/.test(html.substr(startIndex)); + }; + var findCommentEndIndex = function (html, isBogus, startIndex) { + if (startIndex === void 0) { + startIndex = 0; + } + var lcHtml = html.toLowerCase(); + if (lcHtml.indexOf('[if ', startIndex) !== -1 && isConditionalComment(lcHtml, startIndex)) { + var endIfIndex = lcHtml.indexOf('[endif]', startIndex); + return lcHtml.indexOf('>', endIfIndex); + } else { + if (isBogus) { + var endIndex = lcHtml.indexOf('>', startIndex); + return endIndex !== -1 ? endIndex : lcHtml.length; + } else { + var endCommentRegexp = /--!?>/; + endCommentRegexp.lastIndex = startIndex; + var match = endCommentRegexp.exec(html); + return match ? match.index + match[0].length : lcHtml.length; + } + } + }; + var checkBogusAttribute = function (regExp, attrString) { + var matches = regExp.exec(attrString); + if (matches) { + var name_1 = matches[1]; + var value = matches[2]; + return typeof name_1 === 'string' && name_1.toLowerCase() === 'data-mce-bogus' ? value : null; + } else { + return null; + } + }; + function SaxParser(settings, schema) { + if (schema === void 0) { + schema = Schema(); + } + var noop = function () { + }; + settings = settings || {}; + if (settings.fix_self_closing !== false) { + settings.fix_self_closing = true; + } + var comment = settings.comment ? settings.comment : noop; + var cdata = settings.cdata ? settings.cdata : noop; + var text = settings.text ? settings.text : noop; + var start = settings.start ? settings.start : noop; + var end = settings.end ? settings.end : noop; + var pi = settings.pi ? settings.pi : noop; + var doctype = settings.doctype ? settings.doctype : noop; + var parseInternal = function (base64Extract, format) { + if (format === void 0) { + format = 'html'; + } + var html = base64Extract.html; + var matches, index = 0, value, endRegExp; + var stack = []; + var attrList, i, textData, name; + var isInternalElement, isShortEnded; + var elementRule, isValidElement, attr, attribsValue, validAttributesMap, validAttributePatterns; + var attributesRequired, attributesDefault, attributesForced; + var anyAttributesRequired, attrValue, idCount = 0; + var decode = Entities.decode; + var filteredUrlAttrs = Tools.makeMap('src,href,data,background,formaction,poster,xlink:href'); + var scriptUriRegExp = /((java|vb)script|mhtml):/i; + var parsingMode = format === 'html' ? 0 : 1; + var processEndTag = function (name) { + var pos, i; + pos = stack.length; + while (pos--) { + if (stack[pos].name === name) { + break; + } + } + if (pos >= 0) { + for (i = stack.length - 1; i >= pos; i--) { + name = stack[i]; + if (name.valid) { + end(name.name); + } + } + stack.length = pos; + } + }; + var processText = function (value, raw) { + return text(restoreDataUris(value, base64Extract), raw); + }; + var processComment = function (value) { + if (value === '') { + return; + } + if (value.charAt(0) === '>') { + value = ' ' + value; + } + if (!settings.allow_conditional_comments && value.substr(0, 3).toLowerCase() === '[if') { + value = ' ' + value; + } + comment(restoreDataUris(value, base64Extract)); + }; + var processAttr = function (value) { + return get(base64Extract.uris, value).getOr(value); + }; + var processMalformedComment = function (value, startIndex) { + var startTag = value || ''; + var isBogus = !startsWith(startTag, '--'); + var endIndex = findCommentEndIndex(html, isBogus, startIndex); + value = html.substr(startIndex, endIndex - startIndex); + processComment(isBogus ? startTag + value : value); + return endIndex + 1; + }; + var parseAttribute = function (match, name, value, val2, val3) { + var attrRule, i; + var trimRegExp = /[\s\u0000-\u001F]+/g; + name = name.toLowerCase(); + value = processAttr(name in fillAttrsMap ? name : decode(value || val2 || val3 || '')); + if (validate && !isInternalElement && isValidPrefixAttrName(name) === false) { + attrRule = validAttributesMap[name]; + if (!attrRule && validAttributePatterns) { + i = validAttributePatterns.length; + while (i--) { + attrRule = validAttributePatterns[i]; + if (attrRule.pattern.test(name)) { + break; + } + } + if (i === -1) { + attrRule = null; + } + } + if (!attrRule) { + return; + } + if (attrRule.validValues && !(value in attrRule.validValues)) { + return; + } + } + if (filteredUrlAttrs[name] && !settings.allow_script_urls) { + var uri = value.replace(trimRegExp, ''); + try { + uri = decodeURIComponent(uri); + } catch (ex) { + uri = unescape(uri); + } + if (scriptUriRegExp.test(uri)) { + return; + } + if (isInvalidUri(settings, uri)) { + return; + } + } + if (isInternalElement && (name in filteredUrlAttrs || name.indexOf('on') === 0)) { + return; + } + attrList.map[name] = value; + attrList.push({ + name: name, + value: value + }); + }; + var tokenRegExp = new RegExp('<(?:' + '(?:!--([\\w\\W]*?)--!?>)|' + '(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|' + '(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|' + '(?:!(--)?)|' + '(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|' + '(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|' + '(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^"\'>]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\\/|\\s+)>)' + ')', 'g'); + var attrRegExp = /([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g; + var shortEndedElements = schema.getShortEndedElements(); + var selfClosing = settings.self_closing_elements || schema.getSelfClosingElements(); + var fillAttrsMap = schema.getBoolAttrs(); + var validate = settings.validate; + var removeInternalElements = settings.remove_internals; + var fixSelfClosing = settings.fix_self_closing; + var specialElements = schema.getSpecialElements(); + var processHtml = html + '>'; + while (matches = tokenRegExp.exec(processHtml)) { + var matchText = matches[0]; + if (index < matches.index) { + processText(decode(html.substr(index, matches.index - index))); + } + if (value = matches[7]) { + value = value.toLowerCase(); + if (value.charAt(0) === ':') { + value = value.substr(1); + } + processEndTag(value); + } else if (value = matches[8]) { + if (matches.index + matchText.length > html.length) { + processText(decode(html.substr(matches.index))); + index = matches.index + matchText.length; + continue; + } + value = value.toLowerCase(); + if (value.charAt(0) === ':') { + value = value.substr(1); + } + isShortEnded = value in shortEndedElements; + if (fixSelfClosing && selfClosing[value] && stack.length > 0 && stack[stack.length - 1].name === value) { + processEndTag(value); + } + var bogusValue = checkBogusAttribute(attrRegExp, matches[9]); + if (bogusValue !== null) { + if (bogusValue === 'all') { + index = findEndTagIndex(schema, html, tokenRegExp.lastIndex); + tokenRegExp.lastIndex = index; + continue; + } + isValidElement = false; + } + if (!validate || (elementRule = schema.getElementRule(value))) { + isValidElement = true; + if (validate) { + validAttributesMap = elementRule.attributes; + validAttributePatterns = elementRule.attributePatterns; + } + if (attribsValue = matches[9]) { + isInternalElement = attribsValue.indexOf('data-mce-type') !== -1; + if (isInternalElement && removeInternalElements) { + isValidElement = false; + } + attrList = []; + attrList.map = {}; + attribsValue.replace(attrRegExp, parseAttribute); + } else { + attrList = []; + attrList.map = {}; + } + if (validate && !isInternalElement) { + attributesRequired = elementRule.attributesRequired; + attributesDefault = elementRule.attributesDefault; + attributesForced = elementRule.attributesForced; + anyAttributesRequired = elementRule.removeEmptyAttrs; + if (anyAttributesRequired && !attrList.length) { + isValidElement = false; + } + if (attributesForced) { + i = attributesForced.length; + while (i--) { + attr = attributesForced[i]; + name = attr.name; + attrValue = attr.value; + if (attrValue === '{$uid}') { + attrValue = 'mce_' + idCount++; + } + attrList.map[name] = attrValue; + attrList.push({ + name: name, + value: attrValue + }); + } + } + if (attributesDefault) { + i = attributesDefault.length; + while (i--) { + attr = attributesDefault[i]; + name = attr.name; + if (!(name in attrList.map)) { + attrValue = attr.value; + if (attrValue === '{$uid}') { + attrValue = 'mce_' + idCount++; + } + attrList.map[name] = attrValue; + attrList.push({ + name: name, + value: attrValue + }); + } + } + } + if (attributesRequired) { + i = attributesRequired.length; + while (i--) { + if (attributesRequired[i] in attrList.map) { + break; + } + } + if (i === -1) { + isValidElement = false; + } + } + if (attr = attrList.map['data-mce-bogus']) { + if (attr === 'all') { + index = findEndTagIndex(schema, html, tokenRegExp.lastIndex); + tokenRegExp.lastIndex = index; + continue; + } + isValidElement = false; + } + } + if (isValidElement) { + start(value, attrList, isShortEnded); + } + } else { + isValidElement = false; + } + if (endRegExp = specialElements[value]) { + endRegExp.lastIndex = index = matches.index + matchText.length; + if (matches = endRegExp.exec(html)) { + if (isValidElement) { + textData = html.substr(index, matches.index - index); + } + index = matches.index + matches[0].length; + } else { + textData = html.substr(index); + index = html.length; + } + if (isValidElement) { + if (textData.length > 0) { + processText(textData, true); + } + end(value); + } + tokenRegExp.lastIndex = index; + continue; + } + if (!isShortEnded) { + if (!attribsValue || attribsValue.indexOf('/') !== attribsValue.length - 1) { + stack.push({ + name: value, + valid: isValidElement + }); + } else if (isValidElement) { + end(value); + } + } + } else if (value = matches[1]) { + processComment(value); + } else if (value = matches[2]) { + var isValidCdataSection = parsingMode === 1 || settings.preserve_cdata || stack.length > 0 && schema.isValidChild(stack[stack.length - 1].name, '#cdata'); + if (isValidCdataSection) { + cdata(value); + } else { + index = processMalformedComment('', matches.index + 2); + tokenRegExp.lastIndex = index; + continue; + } + } else if (value = matches[3]) { + doctype(value); + } else if ((value = matches[4]) || matchText === '= 0; i--) { + value = stack[i]; + if (value.valid) { + end(value.name); + } + } + }; + var parse = function (html, format) { + if (format === void 0) { + format = 'html'; + } + parseInternal(extractBase64DataUris(html), format); + }; + return { parse: parse }; + } + (function (SaxParser) { + SaxParser.findEndTag = findEndTagIndex; + }(SaxParser || (SaxParser = {}))); + var SaxParser$1 = SaxParser; + + var trimHtml = function (tempAttrs, html) { + var trimContentRegExp = new RegExp(['\\s?(' + tempAttrs.join('|') + ')="[^"]+"'].join('|'), 'gi'); + return html.replace(trimContentRegExp, ''); + }; + var trimInternal = function (serializer, html) { + var content = html; + var bogusAllRegExp = /<(\w+) [^>]*data-mce-bogus="all"[^>]*>/g; + var endTagIndex, index, matchLength, matches; + var schema = serializer.schema; + content = trimHtml(serializer.getTempAttrs(), content); + var shortEndedElements = schema.getShortEndedElements(); + while (matches = bogusAllRegExp.exec(content)) { + index = bogusAllRegExp.lastIndex; + matchLength = matches[0].length; + if (shortEndedElements[matches[1]]) { + endTagIndex = index; + } else { + endTagIndex = SaxParser$1.findEndTag(schema, content, index); + } + content = content.substring(0, index - matchLength) + content.substring(endTagIndex); + bogusAllRegExp.lastIndex = index - matchLength; + } + return trim$2(content); + }; + var trimExternal = trimInternal; + + var trimEmptyContents = function (editor, html) { + var blockName = getForcedRootBlock(editor); + var emptyRegExp = new RegExp('^(<' + blockName + '[^>]*>( | |\\s|\xA0|
    |)<\\/' + blockName + '>[\r\n]*|
    [\r\n]*)$'); + return html.replace(emptyRegExp, ''); + }; + var getContentFromBody = function (editor, args, format, body) { + var content; + args.format = format; + args.get = true; + args.getInner = true; + if (!args.no_events) { + editor.fire('BeforeGetContent', args); + } + if (args.format === 'raw') { + content = Tools.trim(trimExternal(editor.serializer, body.innerHTML)); + } else if (args.format === 'text') { + content = trim$2(body.innerText || body.textContent); + } else if (args.format === 'tree') { + return editor.serializer.serialize(body, args); + } else { + content = trimEmptyContents(editor, editor.serializer.serialize(body, args)); + } + if (args.format !== 'text' && !isWsPreserveElement(SugarElement.fromDom(body))) { + args.content = Tools.trim(content); + } else { + args.content = content; + } + if (!args.no_events) { + editor.fire('GetContent', args); + } + return args.content; + }; + var getContentInternal = function (editor, args, format) { + return Optional.from(editor.getBody()).fold(constant(args.format === 'tree' ? new AstNode('body', 11) : ''), function (body) { + return getContentFromBody(editor, args, format, body); + }); + }; + + var each$7 = Tools.each; + var ElementUtils = function (dom) { + this.compare = function (node1, node2) { + if (node1.nodeName !== node2.nodeName) { + return false; + } + var getAttribs = function (node) { + var attribs = {}; + each$7(dom.getAttribs(node), function (attr) { + var name = attr.nodeName.toLowerCase(); + if (name.indexOf('_') !== 0 && name !== 'style' && name.indexOf('data-') !== 0) { + attribs[name] = dom.getAttrib(node, name); + } + }); + return attribs; + }; + var compareObjects = function (obj1, obj2) { + var value, name; + for (name in obj1) { + if (obj1.hasOwnProperty(name)) { + value = obj2[name]; + if (typeof value === 'undefined') { + return false; + } + if (obj1[name] !== value) { + return false; + } + delete obj2[name]; + } + } + for (name in obj2) { + if (obj2.hasOwnProperty(name)) { + return false; + } + } + return true; + }; + if (!compareObjects(getAttribs(node1), getAttribs(node2))) { + return false; + } + if (!compareObjects(dom.parseStyle(dom.getAttrib(node1, 'style')), dom.parseStyle(dom.getAttrib(node2, 'style')))) { + return false; + } + return !isBookmarkNode$1(node1) && !isBookmarkNode$1(node2); + }; + }; + + var isChar = function (forward, predicate, pos) { + return Optional.from(pos.container()).filter(isText$1).exists(function (text) { + var delta = forward ? 0 : -1; + return predicate(text.data.charAt(pos.offset() + delta)); + }); + }; + var isBeforeSpace = curry(isChar, true, isWhiteSpace$1); + var isAfterSpace = curry(isChar, false, isWhiteSpace$1); + var isEmptyText = function (pos) { + var container = pos.container(); + return isText$1(container) && (container.data.length === 0 || isZwsp$1(container.data) && BookmarkManager$1.isBookmarkNode(container.parentNode)); + }; + var matchesElementPosition = function (before, predicate) { + return function (pos) { + return Optional.from(getChildNodeAtRelativeOffset(before ? 0 : -1, pos)).filter(predicate).isSome(); + }; + }; + var isImageBlock = function (node) { + return isImg(node) && get$4(SugarElement.fromDom(node), 'display') === 'block'; + }; + var isCefNode = function (node) { + return isContentEditableFalse(node) && !isBogusAll(node); + }; + var isBeforeImageBlock = matchesElementPosition(true, isImageBlock); + var isAfterImageBlock = matchesElementPosition(false, isImageBlock); + var isBeforeMedia = matchesElementPosition(true, isMedia); + var isAfterMedia = matchesElementPosition(false, isMedia); + var isBeforeTable = matchesElementPosition(true, isTable); + var isAfterTable = matchesElementPosition(false, isTable); + var isBeforeContentEditableFalse = matchesElementPosition(true, isCefNode); + var isAfterContentEditableFalse = matchesElementPosition(false, isCefNode); + + var getLastChildren$1 = function (elm) { + var children = []; + var rawNode = elm.dom; + while (rawNode) { + children.push(SugarElement.fromDom(rawNode)); + rawNode = rawNode.lastChild; + } + return children; + }; + var removeTrailingBr = function (elm) { + var allBrs = descendants$1(elm, 'br'); + var brs = filter(getLastChildren$1(elm).slice(-1), isBr$1); + if (allBrs.length === brs.length) { + each(brs, remove); + } + }; + var fillWithPaddingBr = function (elm) { + empty(elm); + append(elm, SugarElement.fromHtml('
    ')); + }; + var trimBlockTrailingBr = function (elm) { + lastChild(elm).each(function (lastChild) { + prevSibling(lastChild).each(function (lastChildPrevSibling) { + if (isBlock(elm) && isBr$1(lastChild) && isBlock(lastChildPrevSibling)) { + remove(lastChild); + } + }); + }); + }; + + var dropLast = function (xs) { + return xs.slice(0, -1); + }; + var parentsUntil$1 = function (start, root, predicate) { + if (contains$2(root, start)) { + return dropLast(parents(start, function (elm) { + return predicate(elm) || eq$2(elm, root); + })); + } else { + return []; + } + }; + var parents$1 = function (start, root) { + return parentsUntil$1(start, root, never); + }; + var parentsAndSelf = function (start, root) { + return [start].concat(parents$1(start, root)); + }; + + var navigateIgnoreEmptyTextNodes = function (forward, root, from) { + return navigateIgnore(forward, root, from, isEmptyText); + }; + var getClosestBlock = function (root, pos) { + return find(parentsAndSelf(SugarElement.fromDom(pos.container()), root), isBlock); + }; + var isAtBeforeAfterBlockBoundary = function (forward, root, pos) { + return navigateIgnoreEmptyTextNodes(forward, root.dom, pos).forall(function (newPos) { + return getClosestBlock(root, pos).fold(function () { + return isInSameBlock(newPos, pos, root.dom) === false; + }, function (fromBlock) { + return isInSameBlock(newPos, pos, root.dom) === false && contains$2(fromBlock, SugarElement.fromDom(newPos.container())); + }); + }); + }; + var isAtBlockBoundary = function (forward, root, pos) { + return getClosestBlock(root, pos).fold(function () { + return navigateIgnoreEmptyTextNodes(forward, root.dom, pos).forall(function (newPos) { + return isInSameBlock(newPos, pos, root.dom) === false; + }); + }, function (parent) { + return navigateIgnoreEmptyTextNodes(forward, parent.dom, pos).isNone(); + }); + }; + var isAtStartOfBlock = curry(isAtBlockBoundary, false); + var isAtEndOfBlock = curry(isAtBlockBoundary, true); + var isBeforeBlock = curry(isAtBeforeAfterBlockBoundary, false); + var isAfterBlock = curry(isAtBeforeAfterBlockBoundary, true); + + var isBr$5 = function (pos) { + return getElementFromPosition(pos).exists(isBr$1); + }; + var findBr = function (forward, root, pos) { + var parentBlocks = filter(parentsAndSelf(SugarElement.fromDom(pos.container()), root), isBlock); + var scope = head(parentBlocks).getOr(root); + return fromPosition(forward, scope.dom, pos).filter(isBr$5); + }; + var isBeforeBr = function (root, pos) { + return getElementFromPosition(pos).exists(isBr$1) || findBr(true, root, pos).isSome(); + }; + var isAfterBr = function (root, pos) { + return getElementFromPrevPosition(pos).exists(isBr$1) || findBr(false, root, pos).isSome(); + }; + var findPreviousBr = curry(findBr, false); + var findNextBr = curry(findBr, true); + + var isInMiddleOfText = function (pos) { + return CaretPosition.isTextPosition(pos) && !pos.isAtStart() && !pos.isAtEnd(); + }; + var getClosestBlock$1 = function (root, pos) { + var parentBlocks = filter(parentsAndSelf(SugarElement.fromDom(pos.container()), root), isBlock); + return head(parentBlocks).getOr(root); + }; + var hasSpaceBefore = function (root, pos) { + if (isInMiddleOfText(pos)) { + return isAfterSpace(pos); + } else { + return isAfterSpace(pos) || prevPosition(getClosestBlock$1(root, pos).dom, pos).exists(isAfterSpace); + } + }; + var hasSpaceAfter = function (root, pos) { + if (isInMiddleOfText(pos)) { + return isBeforeSpace(pos); + } else { + return isBeforeSpace(pos) || nextPosition(getClosestBlock$1(root, pos).dom, pos).exists(isBeforeSpace); + } + }; + var isPreValue = function (value) { + return contains([ + 'pre', + 'pre-wrap' + ], value); + }; + var isInPre = function (pos) { + return getElementFromPosition(pos).bind(function (elm) { + return closest(elm, isElement); + }).exists(function (elm) { + return isPreValue(get$4(elm, 'white-space')); + }); + }; + var isAtBeginningOfBody = function (root, pos) { + return prevPosition(root.dom, pos).isNone(); + }; + var isAtEndOfBody = function (root, pos) { + return nextPosition(root.dom, pos).isNone(); + }; + var isAtLineBoundary = function (root, pos) { + return isAtBeginningOfBody(root, pos) || isAtEndOfBody(root, pos) || isAtStartOfBlock(root, pos) || isAtEndOfBlock(root, pos) || isAfterBr(root, pos) || isBeforeBr(root, pos); + }; + var needsToHaveNbsp = function (root, pos) { + if (isInPre(pos)) { + return false; + } else { + return isAtLineBoundary(root, pos) || hasSpaceBefore(root, pos) || hasSpaceAfter(root, pos); + } + }; + var needsToBeNbspLeft = function (root, pos) { + if (isInPre(pos)) { + return false; + } else { + return isAtStartOfBlock(root, pos) || isBeforeBlock(root, pos) || isAfterBr(root, pos) || hasSpaceBefore(root, pos); + } + }; + var leanRight = function (pos) { + var container = pos.container(); + var offset = pos.offset(); + if (isText$1(container) && offset < container.data.length) { + return CaretPosition(container, offset + 1); + } else { + return pos; + } + }; + var needsToBeNbspRight = function (root, pos) { + if (isInPre(pos)) { + return false; + } else { + return isAtEndOfBlock(root, pos) || isAfterBlock(root, pos) || isBeforeBr(root, pos) || hasSpaceAfter(root, pos); + } + }; + var needsToBeNbsp = function (root, pos) { + return needsToBeNbspLeft(root, pos) || needsToBeNbspRight(root, leanRight(pos)); + }; + var isNbspAt = function (text, offset) { + return isNbsp(text.charAt(offset)); + }; + var hasNbsp = function (pos) { + var container = pos.container(); + return isText$1(container) && contains$1(container.data, nbsp); + }; + var normalizeNbspMiddle = function (text) { + var chars = text.split(''); + return map(chars, function (chr, i) { + if (isNbsp(chr) && i > 0 && i < chars.length - 1 && isContent$1(chars[i - 1]) && isContent$1(chars[i + 1])) { + return ' '; + } else { + return chr; + } + }).join(''); + }; + var normalizeNbspAtStart = function (root, node) { + var text = node.data; + var firstPos = CaretPosition(node, 0); + if (isNbspAt(text, 0) && !needsToBeNbsp(root, firstPos)) { + node.data = ' ' + text.slice(1); + return true; + } else { + return false; + } + }; + var normalizeNbspInMiddleOfTextNode = function (node) { + var text = node.data; + var newText = normalizeNbspMiddle(text); + if (newText !== text) { + node.data = newText; + return true; + } else { + return false; + } + }; + var normalizeNbspAtEnd = function (root, node) { + var text = node.data; + var lastPos = CaretPosition(node, text.length - 1); + if (isNbspAt(text, text.length - 1) && !needsToBeNbsp(root, lastPos)) { + node.data = text.slice(0, -1) + ' '; + return true; + } else { + return false; + } + }; + var normalizeNbsps = function (root, pos) { + return Optional.some(pos).filter(hasNbsp).bind(function (pos) { + var container = pos.container(); + var normalized = normalizeNbspAtStart(root, container) || normalizeNbspInMiddleOfTextNode(container) || normalizeNbspAtEnd(root, container); + return normalized ? Optional.some(pos) : Optional.none(); + }); + }; + var normalizeNbspsInEditor = function (editor) { + var root = SugarElement.fromDom(editor.getBody()); + if (editor.selection.isCollapsed()) { + normalizeNbsps(root, CaretPosition.fromRangeStart(editor.selection.getRng())).each(function (pos) { + editor.selection.setRng(pos.toRange()); + }); + } + }; + + var normalizeContent = function (content, isStartOfContent, isEndOfContent) { + var result = foldl(content, function (acc, c) { + if (isWhiteSpace$1(c) || isNbsp(c)) { + if (acc.previousCharIsSpace || acc.str === '' && isStartOfContent || acc.str.length === content.length - 1 && isEndOfContent) { + return { + previousCharIsSpace: false, + str: acc.str + nbsp + }; + } else { + return { + previousCharIsSpace: true, + str: acc.str + ' ' + }; + } + } else { + return { + previousCharIsSpace: false, + str: acc.str + c + }; + } + }, { + previousCharIsSpace: false, + str: '' + }); + return result.str; + }; + var normalize$1 = function (node, offset, count) { + if (count === 0) { + return; + } + var elm = SugarElement.fromDom(node); + var root = ancestor(elm, isBlock).getOr(elm); + var whitespace = node.data.slice(offset, offset + count); + var isEndOfContent = offset + count >= node.data.length && needsToBeNbspRight(root, CaretPosition$1(node, node.data.length)); + var isStartOfContent = offset === 0 && needsToBeNbspLeft(root, CaretPosition$1(node, 0)); + node.replaceData(offset, count, normalizeContent(whitespace, isStartOfContent, isEndOfContent)); + }; + var normalizeWhitespaceAfter = function (node, offset) { + var content = node.data.slice(offset); + var whitespaceCount = content.length - lTrim(content).length; + return normalize$1(node, offset, whitespaceCount); + }; + var normalizeWhitespaceBefore = function (node, offset) { + var content = node.data.slice(0, offset); + var whitespaceCount = content.length - rTrim(content).length; + return normalize$1(node, offset - whitespaceCount, whitespaceCount); + }; + var mergeTextNodes = function (prevNode, nextNode, normalizeWhitespace, mergeToPrev) { + if (mergeToPrev === void 0) { + mergeToPrev = true; + } + var whitespaceOffset = rTrim(prevNode.data).length; + var newNode = mergeToPrev ? prevNode : nextNode; + var removeNode = mergeToPrev ? nextNode : prevNode; + if (mergeToPrev) { + newNode.appendData(removeNode.data); + } else { + newNode.insertData(0, removeNode.data); + } + remove(SugarElement.fromDom(removeNode)); + if (normalizeWhitespace) { + normalizeWhitespaceAfter(newNode, whitespaceOffset); + } + return newNode; + }; + + var needsReposition = function (pos, elm) { + var container = pos.container(); + var offset = pos.offset(); + return CaretPosition$1.isTextPosition(pos) === false && container === elm.parentNode && offset > CaretPosition$1.before(elm).offset(); + }; + var reposition = function (elm, pos) { + return needsReposition(pos, elm) ? CaretPosition$1(pos.container(), pos.offset() - 1) : pos; + }; + var beforeOrStartOf = function (node) { + return isText$1(node) ? CaretPosition$1(node, 0) : CaretPosition$1.before(node); + }; + var afterOrEndOf = function (node) { + return isText$1(node) ? CaretPosition$1(node, node.data.length) : CaretPosition$1.after(node); + }; + var getPreviousSiblingCaretPosition = function (elm) { + if (isCaretCandidate(elm.previousSibling)) { + return Optional.some(afterOrEndOf(elm.previousSibling)); + } else { + return elm.previousSibling ? lastPositionIn(elm.previousSibling) : Optional.none(); + } + }; + var getNextSiblingCaretPosition = function (elm) { + if (isCaretCandidate(elm.nextSibling)) { + return Optional.some(beforeOrStartOf(elm.nextSibling)); + } else { + return elm.nextSibling ? firstPositionIn(elm.nextSibling) : Optional.none(); + } + }; + var findCaretPositionBackwardsFromElm = function (rootElement, elm) { + var startPosition = CaretPosition$1.before(elm.previousSibling ? elm.previousSibling : elm.parentNode); + return prevPosition(rootElement, startPosition).fold(function () { + return nextPosition(rootElement, CaretPosition$1.after(elm)); + }, Optional.some); + }; + var findCaretPositionForwardsFromElm = function (rootElement, elm) { + return nextPosition(rootElement, CaretPosition$1.after(elm)).fold(function () { + return prevPosition(rootElement, CaretPosition$1.before(elm)); + }, Optional.some); + }; + var findCaretPositionBackwards = function (rootElement, elm) { + return getPreviousSiblingCaretPosition(elm).orThunk(function () { + return getNextSiblingCaretPosition(elm); + }).orThunk(function () { + return findCaretPositionBackwardsFromElm(rootElement, elm); + }); + }; + var findCaretPositionForward = function (rootElement, elm) { + return getNextSiblingCaretPosition(elm).orThunk(function () { + return getPreviousSiblingCaretPosition(elm); + }).orThunk(function () { + return findCaretPositionForwardsFromElm(rootElement, elm); + }); + }; + var findCaretPosition$1 = function (forward, rootElement, elm) { + return forward ? findCaretPositionForward(rootElement, elm) : findCaretPositionBackwards(rootElement, elm); + }; + var findCaretPosOutsideElmAfterDelete = function (forward, rootElement, elm) { + return findCaretPosition$1(forward, rootElement, elm).map(curry(reposition, elm)); + }; + var setSelection = function (editor, forward, pos) { + pos.fold(function () { + editor.focus(); + }, function (pos) { + editor.selection.setRng(pos.toRange(), forward); + }); + }; + var eqRawNode = function (rawNode) { + return function (elm) { + return elm.dom === rawNode; + }; + }; + var isBlock$2 = function (editor, elm) { + return elm && has(editor.schema.getBlockElements(), name(elm)); + }; + var paddEmptyBlock = function (elm) { + if (isEmpty(elm)) { + var br = SugarElement.fromHtml('
    '); + empty(elm); + append(elm, br); + return Optional.some(CaretPosition$1.before(br.dom)); + } else { + return Optional.none(); + } + }; + var deleteNormalized = function (elm, afterDeletePosOpt, normalizeWhitespace) { + var prevTextOpt = prevSibling(elm).filter(isText); + var nextTextOpt = nextSibling(elm).filter(isText); + remove(elm); + return lift3(prevTextOpt, nextTextOpt, afterDeletePosOpt, function (prev, next, pos) { + var prevNode = prev.dom, nextNode = next.dom; + var offset = prevNode.data.length; + mergeTextNodes(prevNode, nextNode, normalizeWhitespace); + return pos.container() === nextNode ? CaretPosition$1(prevNode, offset) : pos; + }).orThunk(function () { + if (normalizeWhitespace) { + prevTextOpt.each(function (elm) { + return normalizeWhitespaceBefore(elm.dom, elm.dom.length); + }); + nextTextOpt.each(function (elm) { + return normalizeWhitespaceAfter(elm.dom, 0); + }); + } + return afterDeletePosOpt; + }); + }; + var isInlineElement = function (editor, element) { + return has(editor.schema.getTextInlineElements(), name(element)); + }; + var deleteElement = function (editor, forward, elm, moveCaret) { + if (moveCaret === void 0) { + moveCaret = true; + } + var afterDeletePos = findCaretPosOutsideElmAfterDelete(forward, editor.getBody(), elm.dom); + var parentBlock = ancestor(elm, curry(isBlock$2, editor), eqRawNode(editor.getBody())); + var normalizedAfterDeletePos = deleteNormalized(elm, afterDeletePos, isInlineElement(editor, elm)); + if (editor.dom.isEmpty(editor.getBody())) { + editor.setContent(''); + editor.selection.setCursorLocation(); + } else { + parentBlock.bind(paddEmptyBlock).fold(function () { + if (moveCaret) { + setSelection(editor, forward, normalizedAfterDeletePos); + } + }, function (paddPos) { + if (moveCaret) { + setSelection(editor, forward, Optional.some(paddPos)); + } + }); + } + }; + + var tableCellRng = function (start, end) { + return { + start: start, + end: end + }; + }; + var tableSelection = function (rng, table, cells) { + return { + rng: rng, + table: table, + cells: cells + }; + }; + var deleteAction = Adt.generate([ + { removeTable: ['element'] }, + { emptyCells: ['cells'] }, + { + deleteCellSelection: [ + 'rng', + 'cell' + ] + } + ]); + var isRootFromElement = function (root) { + return function (cur) { + return eq$2(root, cur); + }; + }; + var getClosestCell = function (container, isRoot) { + return closest$1(SugarElement.fromDom(container), 'td,th', isRoot); + }; + var getClosestTable = function (cell, isRoot) { + return ancestor$1(cell, 'table', isRoot); + }; + var isExpandedCellRng = function (cellRng) { + return !eq$2(cellRng.start, cellRng.end); + }; + var getTableFromCellRng = function (cellRng, isRoot) { + return getClosestTable(cellRng.start, isRoot).bind(function (startParentTable) { + return getClosestTable(cellRng.end, isRoot).bind(function (endParentTable) { + return someIf(eq$2(startParentTable, endParentTable), startParentTable); + }); + }); + }; + var isSingleCellTable = function (cellRng, isRoot) { + return !isExpandedCellRng(cellRng) && getTableFromCellRng(cellRng, isRoot).exists(function (table) { + var rows = table.dom.rows; + return rows.length === 1 && rows[0].cells.length === 1; + }); + }; + var getTableCells = function (table) { + return descendants$1(table, 'td,th'); + }; + var getCellRng = function (rng, isRoot) { + var startCell = getClosestCell(rng.startContainer, isRoot); + var endCell = getClosestCell(rng.endContainer, isRoot); + return lift2(startCell, endCell, tableCellRng); + }; + var getCellRangeFromStartTable = function (cellRng, isRoot) { + return getClosestTable(cellRng.start, isRoot).bind(function (table) { + return last(getTableCells(table)).map(function (endCell) { + return tableCellRng(cellRng.start, endCell); + }); + }); + }; + var partialSelection = function (isRoot, rng) { + var startCell = getClosestCell(rng.startContainer, isRoot); + var endCell = getClosestCell(rng.endContainer, isRoot); + return rng.collapsed ? Optional.none() : lift2(startCell, endCell, tableCellRng).fold(function () { + return startCell.fold(function () { + return endCell.bind(function (endCell) { + return getClosestTable(endCell, isRoot).bind(function (table) { + return head(getTableCells(table)).map(function (startCell) { + return tableCellRng(startCell, endCell); + }); + }); + }); + }, function (startCell) { + return getClosestTable(startCell, isRoot).bind(function (table) { + return last(getTableCells(table)).map(function (endCell) { + return tableCellRng(startCell, endCell); + }); + }); + }); + }, function (cellRng) { + return isWithinSameTable(isRoot, cellRng) ? Optional.none() : getCellRangeFromStartTable(cellRng, isRoot); + }); + }; + var isWithinSameTable = function (isRoot, cellRng) { + return getTableFromCellRng(cellRng, isRoot).isSome(); + }; + var getTableSelectionFromCellRng = function (cellRng, isRoot) { + return getTableFromCellRng(cellRng, isRoot).map(function (table) { + return tableSelection(cellRng, table, getTableCells(table)); + }); + }; + var getTableSelection = function (optCellRng, rng, isRoot) { + return optCellRng.filter(function (cellRng) { + return isExpandedCellRng(cellRng) && isWithinSameTable(isRoot, cellRng); + }).orThunk(function () { + return partialSelection(isRoot, rng); + }).bind(function (cRng) { + return getTableSelectionFromCellRng(cRng, isRoot); + }); + }; + var getCellIndex = function (cells, cell) { + return findIndex(cells, function (x) { + return eq$2(x, cell); + }); + }; + var getSelectedCells = function (tableSelection) { + return lift2(getCellIndex(tableSelection.cells, tableSelection.rng.start), getCellIndex(tableSelection.cells, tableSelection.rng.end), function (startIndex, endIndex) { + return tableSelection.cells.slice(startIndex, endIndex + 1); + }); + }; + var isSingleCellTableContentSelected = function (optCellRng, rng, isRoot) { + return optCellRng.filter(function (cellRng) { + return isSingleCellTable(cellRng, isRoot) && hasAllContentsSelected(cellRng.start, rng); + }).map(function (cellRng) { + return cellRng.start; + }); + }; + var getAction = function (tableSelection) { + return getSelectedCells(tableSelection).map(function (selected) { + var cells = tableSelection.cells; + return selected.length === cells.length ? deleteAction.removeTable(tableSelection.table) : deleteAction.emptyCells(selected); + }); + }; + var getActionFromRange = function (root, rng) { + var isRoot = isRootFromElement(root); + var optCellRng = getCellRng(rng, isRoot); + return isSingleCellTableContentSelected(optCellRng, rng, isRoot).map(function (cell) { + return deleteAction.deleteCellSelection(rng, cell); + }).orThunk(function () { + return getTableSelection(optCellRng, rng, isRoot).bind(getAction); + }); + }; + + var freefallRtl = function (root) { + var child = isComment(root) ? prevSibling(root) : lastChild(root); + return child.bind(freefallRtl).orThunk(function () { + return Optional.some(root); + }); + }; + var emptyCells = function (editor, cells) { + each(cells, fillWithPaddingBr); + editor.selection.setCursorLocation(cells[0].dom, 0); + return true; + }; + var deleteCellContents = function (editor, rng, cell) { + rng.deleteContents(); + var lastNode = freefallRtl(cell).getOr(cell); + var lastBlock = SugarElement.fromDom(editor.dom.getParent(lastNode.dom, editor.dom.isBlock)); + if (isEmpty(lastBlock)) { + fillWithPaddingBr(lastBlock); + editor.selection.setCursorLocation(lastBlock.dom, 0); + } + if (!eq$2(cell, lastBlock)) { + var additionalCleanupNodes = parent(lastBlock).is(cell) ? [] : siblings(lastBlock); + each(additionalCleanupNodes.concat(children(cell)), function (node) { + if (!eq$2(node, lastBlock) && !contains$2(node, lastBlock)) { + remove(node); + } + }); + } + return true; + }; + var deleteTableElement = function (editor, table) { + deleteElement(editor, false, table); + return true; + }; + var deleteCellRange = function (editor, rootElm, rng) { + return getActionFromRange(rootElm, rng).map(function (action) { + return action.fold(curry(deleteTableElement, editor), curry(emptyCells, editor), curry(deleteCellContents, editor)); + }); + }; + var deleteCaptionRange = function (editor, caption) { + return emptyElement(editor, caption); + }; + var deleteTableRange = function (editor, rootElm, rng, startElm) { + return getParentCaption(rootElm, startElm).fold(function () { + return deleteCellRange(editor, rootElm, rng); + }, function (caption) { + return deleteCaptionRange(editor, caption); + }).getOr(false); + }; + var deleteRange = function (editor, startElm) { + var rootNode = SugarElement.fromDom(editor.getBody()); + var rng = editor.selection.getRng(); + var selectedCells = getCellsFromEditor(editor); + return selectedCells.length !== 0 ? emptyCells(editor, selectedCells) : deleteTableRange(editor, rootNode, rng, startElm); + }; + var getParentCell = function (rootElm, elm) { + return find(parentsAndSelf(elm, rootElm), isTableCell$1); + }; + var getParentCaption = function (rootElm, elm) { + return find(parentsAndSelf(elm, rootElm), function (elm) { + return name(elm) === 'caption'; + }); + }; + var deleteBetweenCells = function (editor, rootElm, forward, fromCell, from) { + return navigate(forward, editor.getBody(), from).bind(function (to) { + return getParentCell(rootElm, SugarElement.fromDom(to.getNode())).map(function (toCell) { + return eq$2(toCell, fromCell) === false; + }); + }); + }; + var emptyElement = function (editor, elm) { + fillWithPaddingBr(elm); + editor.selection.setCursorLocation(elm.dom, 0); + return Optional.some(true); + }; + var isDeleteOfLastCharPos = function (fromCaption, forward, from, to) { + return firstPositionIn(fromCaption.dom).bind(function (first) { + return lastPositionIn(fromCaption.dom).map(function (last) { + return forward ? from.isEqual(first) && to.isEqual(last) : from.isEqual(last) && to.isEqual(first); + }); + }).getOr(true); + }; + var emptyCaretCaption = function (editor, elm) { + return emptyElement(editor, elm); + }; + var validateCaretCaption = function (rootElm, fromCaption, to) { + return getParentCaption(rootElm, SugarElement.fromDom(to.getNode())).map(function (toCaption) { + return eq$2(toCaption, fromCaption) === false; + }); + }; + var deleteCaretInsideCaption = function (editor, rootElm, forward, fromCaption, from) { + return navigate(forward, editor.getBody(), from).bind(function (to) { + return isDeleteOfLastCharPos(fromCaption, forward, from, to) ? emptyCaretCaption(editor, fromCaption) : validateCaretCaption(rootElm, fromCaption, to); + }).or(Optional.some(true)); + }; + var deleteCaretCells = function (editor, forward, rootElm, startElm) { + var from = CaretPosition$1.fromRangeStart(editor.selection.getRng()); + return getParentCell(rootElm, startElm).bind(function (fromCell) { + return isEmpty(fromCell) ? emptyElement(editor, fromCell) : deleteBetweenCells(editor, rootElm, forward, fromCell, from); + }).getOr(false); + }; + var deleteCaretCaption = function (editor, forward, rootElm, fromCaption) { + var from = CaretPosition$1.fromRangeStart(editor.selection.getRng()); + return isEmpty(fromCaption) ? emptyElement(editor, fromCaption) : deleteCaretInsideCaption(editor, rootElm, forward, fromCaption, from); + }; + var isNearTable = function (forward, pos) { + return forward ? isBeforeTable(pos) : isAfterTable(pos); + }; + var isBeforeOrAfterTable = function (editor, forward) { + var fromPos = CaretPosition$1.fromRangeStart(editor.selection.getRng()); + return isNearTable(forward, fromPos) || fromPosition(forward, editor.getBody(), fromPos).exists(function (pos) { + return isNearTable(forward, pos); + }); + }; + var deleteCaret = function (editor, forward, startElm) { + var rootElm = SugarElement.fromDom(editor.getBody()); + return getParentCaption(rootElm, startElm).fold(function () { + return deleteCaretCells(editor, forward, rootElm, startElm) || isBeforeOrAfterTable(editor, forward); + }, function (fromCaption) { + return deleteCaretCaption(editor, forward, rootElm, fromCaption).getOr(false); + }); + }; + var backspaceDelete = function (editor, forward) { + var startElm = SugarElement.fromDom(editor.selection.getStart(true)); + var cells = getCellsFromEditor(editor); + return editor.selection.isCollapsed() && cells.length === 0 ? deleteCaret(editor, forward, startElm) : deleteRange(editor, startElm); + }; + + var createRange$1 = function (sc, so, ec, eo) { + var rng = document.createRange(); + rng.setStart(sc, so); + rng.setEnd(ec, eo); + return rng; + }; + var normalizeBlockSelectionRange = function (rng) { + var startPos = CaretPosition$1.fromRangeStart(rng); + var endPos = CaretPosition$1.fromRangeEnd(rng); + var rootNode = rng.commonAncestorContainer; + return fromPosition(false, rootNode, endPos).map(function (newEndPos) { + if (!isInSameBlock(startPos, endPos, rootNode) && isInSameBlock(startPos, newEndPos, rootNode)) { + return createRange$1(startPos.container(), startPos.offset(), newEndPos.container(), newEndPos.offset()); + } else { + return rng; + } + }).getOr(rng); + }; + var normalize$2 = function (rng) { + return rng.collapsed ? rng : normalizeBlockSelectionRange(rng); + }; + + var hasOnlyOneChild = function (node) { + return node.firstChild && node.firstChild === node.lastChild; + }; + var isPaddingNode = function (node) { + return node.name === 'br' || node.value === nbsp; + }; + var isPaddedEmptyBlock = function (schema, node) { + var blockElements = schema.getBlockElements(); + return blockElements[node.name] && hasOnlyOneChild(node) && isPaddingNode(node.firstChild); + }; + var isEmptyFragmentElement = function (schema, node) { + var nonEmptyElements = schema.getNonEmptyElements(); + return node && (node.isEmpty(nonEmptyElements) || isPaddedEmptyBlock(schema, node)); + }; + var isListFragment = function (schema, fragment) { + var firstChild = fragment.firstChild; + var lastChild = fragment.lastChild; + if (firstChild && firstChild.name === 'meta') { + firstChild = firstChild.next; + } + if (lastChild && lastChild.attr('id') === 'mce_marker') { + lastChild = lastChild.prev; + } + if (isEmptyFragmentElement(schema, lastChild)) { + lastChild = lastChild.prev; + } + if (!firstChild || firstChild !== lastChild) { + return false; + } + return firstChild.name === 'ul' || firstChild.name === 'ol'; + }; + var cleanupDomFragment = function (domFragment) { + var firstChild = domFragment.firstChild; + var lastChild = domFragment.lastChild; + if (firstChild && firstChild.nodeName === 'META') { + firstChild.parentNode.removeChild(firstChild); + } + if (lastChild && lastChild.id === 'mce_marker') { + lastChild.parentNode.removeChild(lastChild); + } + return domFragment; + }; + var toDomFragment = function (dom, serializer, fragment) { + var html = serializer.serialize(fragment); + var domFragment = dom.createFragment(html); + return cleanupDomFragment(domFragment); + }; + var listItems$1 = function (elm) { + return Tools.grep(elm.childNodes, function (child) { + return child.nodeName === 'LI'; + }); + }; + var isPadding = function (node) { + return node.data === nbsp || isBr(node); + }; + var isListItemPadded = function (node) { + return node && node.firstChild && node.firstChild === node.lastChild && isPadding(node.firstChild); + }; + var isEmptyOrPadded = function (elm) { + return !elm.firstChild || isListItemPadded(elm); + }; + var trimListItems = function (elms) { + return elms.length > 0 && isEmptyOrPadded(elms[elms.length - 1]) ? elms.slice(0, -1) : elms; + }; + var getParentLi = function (dom, node) { + var parentBlock = dom.getParent(node, dom.isBlock); + return parentBlock && parentBlock.nodeName === 'LI' ? parentBlock : null; + }; + var isParentBlockLi = function (dom, node) { + return !!getParentLi(dom, node); + }; + var getSplit = function (parentNode, rng) { + var beforeRng = rng.cloneRange(); + var afterRng = rng.cloneRange(); + beforeRng.setStartBefore(parentNode); + afterRng.setEndAfter(parentNode); + return [ + beforeRng.cloneContents(), + afterRng.cloneContents() + ]; + }; + var findFirstIn = function (node, rootNode) { + var caretPos = CaretPosition$1.before(node); + var caretWalker = CaretWalker(rootNode); + var newCaretPos = caretWalker.next(caretPos); + return newCaretPos ? newCaretPos.toRange() : null; + }; + var findLastOf = function (node, rootNode) { + var caretPos = CaretPosition$1.after(node); + var caretWalker = CaretWalker(rootNode); + var newCaretPos = caretWalker.prev(caretPos); + return newCaretPos ? newCaretPos.toRange() : null; + }; + var insertMiddle = function (target, elms, rootNode, rng) { + var parts = getSplit(target, rng); + var parentElm = target.parentNode; + parentElm.insertBefore(parts[0], target); + Tools.each(elms, function (li) { + parentElm.insertBefore(li, target); + }); + parentElm.insertBefore(parts[1], target); + parentElm.removeChild(target); + return findLastOf(elms[elms.length - 1], rootNode); + }; + var insertBefore = function (target, elms, rootNode) { + var parentElm = target.parentNode; + Tools.each(elms, function (elm) { + parentElm.insertBefore(elm, target); + }); + return findFirstIn(target, rootNode); + }; + var insertAfter = function (target, elms, rootNode, dom) { + dom.insertAfter(elms.reverse(), target); + return findLastOf(elms[0], rootNode); + }; + var insertAtCaret = function (serializer, dom, rng, fragment) { + var domFragment = toDomFragment(dom, serializer, fragment); + var liTarget = getParentLi(dom, rng.startContainer); + var liElms = trimListItems(listItems$1(domFragment.firstChild)); + var BEGINNING = 1, END = 2; + var rootNode = dom.getRoot(); + var isAt = function (location) { + var caretPos = CaretPosition$1.fromRangeStart(rng); + var caretWalker = CaretWalker(dom.getRoot()); + var newPos = location === BEGINNING ? caretWalker.prev(caretPos) : caretWalker.next(caretPos); + return newPos ? getParentLi(dom, newPos.getNode()) !== liTarget : true; + }; + if (isAt(BEGINNING)) { + return insertBefore(liTarget, liElms, rootNode); + } else if (isAt(END)) { + return insertAfter(liTarget, liElms, rootNode, dom); + } + return insertMiddle(liTarget, liElms, rootNode, rng); + }; + + var trimOrPadLeftRight = function (dom, rng, html) { + var root = SugarElement.fromDom(dom.getRoot()); + if (needsToBeNbspLeft(root, CaretPosition$1.fromRangeStart(rng))) { + html = html.replace(/^ /, ' '); + } else { + html = html.replace(/^ /, ' '); + } + if (needsToBeNbspRight(root, CaretPosition$1.fromRangeEnd(rng))) { + html = html.replace(/( | )()?$/, ' '); + } else { + html = html.replace(/ ()?$/, ' '); + } + return html; + }; + + var isTableCell$4 = isTableCell; + var isTableCellContentSelected = function (dom, rng, cell) { + if (cell !== null) { + var endCell = dom.getParent(rng.endContainer, isTableCell$4); + return cell === endCell && hasAllContentsSelected(SugarElement.fromDom(cell), rng); + } else { + return false; + } + }; + var validInsertion = function (editor, value, parentNode) { + if (parentNode.getAttribute('data-mce-bogus') === 'all') { + parentNode.parentNode.insertBefore(editor.dom.createFragment(value), parentNode); + } else { + var node = parentNode.firstChild; + var node2 = parentNode.lastChild; + if (!node || node === node2 && node.nodeName === 'BR') { + editor.dom.setHTML(parentNode, value); + } else { + editor.selection.setContent(value); + } + } + }; + var trimBrsFromTableCell = function (dom, elm) { + Optional.from(dom.getParent(elm, 'td,th')).map(SugarElement.fromDom).each(trimBlockTrailingBr); + }; + var reduceInlineTextElements = function (editor, merge) { + var textInlineElements = editor.schema.getTextInlineElements(); + var dom = editor.dom; + if (merge) { + var root_1 = editor.getBody(), elementUtils_1 = new ElementUtils(dom); + Tools.each(dom.select('*[data-mce-fragment]'), function (node) { + for (var testNode = node.parentNode; testNode && testNode !== root_1; testNode = testNode.parentNode) { + if (textInlineElements[node.nodeName.toLowerCase()] && elementUtils_1.compare(testNode, node)) { + dom.remove(node, true); + } + } + }); + } + }; + var markFragmentElements = function (fragment) { + var node = fragment; + while (node = node.walk()) { + if (node.type === 1) { + node.attr('data-mce-fragment', '1'); + } + } + }; + var unmarkFragmentElements = function (elm) { + Tools.each(elm.getElementsByTagName('*'), function (elm) { + elm.removeAttribute('data-mce-fragment'); + }); + }; + var isPartOfFragment = function (node) { + return !!node.getAttribute('data-mce-fragment'); + }; + var canHaveChildren = function (editor, node) { + return node && !editor.schema.getShortEndedElements()[node.nodeName]; + }; + var moveSelectionToMarker = function (editor, marker) { + var nextRng; + var dom = editor.dom, selection = editor.selection; + var node2; + var getContentEditableFalseParent = function (node) { + var root = editor.getBody(); + for (; node && node !== root; node = node.parentNode) { + if (dom.getContentEditable(node) === 'false') { + return node; + } + } + return null; + }; + if (!marker) { + return; + } + selection.scrollIntoView(marker); + var parentEditableFalseElm = getContentEditableFalseParent(marker); + if (parentEditableFalseElm) { + dom.remove(marker); + selection.select(parentEditableFalseElm); + return; + } + var rng = dom.createRng(); + var node = marker.previousSibling; + if (node && node.nodeType === 3) { + rng.setStart(node, node.nodeValue.length); + if (!Env.ie) { + node2 = marker.nextSibling; + if (node2 && node2.nodeType === 3) { + node.appendData(node2.data); + node2.parentNode.removeChild(node2); + } + } + } else { + rng.setStartBefore(marker); + rng.setEndBefore(marker); + } + var findNextCaretRng = function (rng) { + var caretPos = CaretPosition$1.fromRangeStart(rng); + var caretWalker = CaretWalker(editor.getBody()); + caretPos = caretWalker.next(caretPos); + if (caretPos) { + return caretPos.toRange(); + } + }; + var parentBlock = dom.getParent(marker, dom.isBlock); + dom.remove(marker); + if (parentBlock && dom.isEmpty(parentBlock)) { + editor.$(parentBlock).empty(); + rng.setStart(parentBlock, 0); + rng.setEnd(parentBlock, 0); + if (!isTableCell$4(parentBlock) && !isPartOfFragment(parentBlock) && (nextRng = findNextCaretRng(rng))) { + rng = nextRng; + dom.remove(parentBlock); + } else { + dom.add(parentBlock, dom.create('br', { 'data-mce-bogus': '1' })); + } + } + selection.setRng(rng); + }; + var deleteSelectedContent = function (editor) { + var dom = editor.dom; + var rng = normalize$2(editor.selection.getRng()); + editor.selection.setRng(rng); + var startCell = dom.getParent(rng.startContainer, isTableCell$4); + if (isTableCellContentSelected(dom, rng, startCell)) { + deleteCellContents(editor, rng, SugarElement.fromDom(startCell)); + } else { + editor.getDoc().execCommand('Delete', false, null); + } + }; + var insertHtmlAtCaret = function (editor, value, details) { + var parentNode, rootNode, args; + var marker, rng, node; + var selection = editor.selection, dom = editor.dom; + if (/^ | $/.test(value)) { + value = trimOrPadLeftRight(dom, selection.getRng(), value); + } + var parser = editor.parser; + var merge = details.merge; + var serializer = HtmlSerializer({ validate: shouldValidate(editor) }, editor.schema); + var bookmarkHtml = ''; + args = { + content: value, + format: 'html', + selection: true, + paste: details.paste + }; + args = editor.fire('BeforeSetContent', args); + if (args.isDefaultPrevented()) { + editor.fire('SetContent', { + content: args.content, + format: 'html', + selection: true, + paste: details.paste + }); + return; + } + value = args.content; + if (value.indexOf('{$caret}') === -1) { + value += '{$caret}'; + } + value = value.replace(/\{\$caret\}/, bookmarkHtml); + rng = selection.getRng(); + var caretElement = rng.startContainer || (rng.parentElement ? rng.parentElement() : null); + var body = editor.getBody(); + if (caretElement === body && selection.isCollapsed()) { + if (dom.isBlock(body.firstChild) && canHaveChildren(editor, body.firstChild) && dom.isEmpty(body.firstChild)) { + rng = dom.createRng(); + rng.setStart(body.firstChild, 0); + rng.setEnd(body.firstChild, 0); + selection.setRng(rng); + } + } + if (!selection.isCollapsed()) { + deleteSelectedContent(editor); + } + parentNode = selection.getNode(); + var parserArgs = { + context: parentNode.nodeName.toLowerCase(), + data: details.data, + insert: true + }; + var fragment = parser.parse(value, parserArgs); + if (details.paste === true && isListFragment(editor.schema, fragment) && isParentBlockLi(dom, parentNode)) { + rng = insertAtCaret(serializer, dom, selection.getRng(), fragment); + selection.setRng(rng); + editor.fire('SetContent', args); + return; + } + markFragmentElements(fragment); + node = fragment.lastChild; + if (node.attr('id') === 'mce_marker') { + marker = node; + for (node = node.prev; node; node = node.walk(true)) { + if (node.type === 3 || !dom.isBlock(node.name)) { + if (editor.schema.isValidChild(node.parent.name, 'span')) { + node.parent.insert(marker, node, node.name === 'br'); + } + break; + } + } + } + editor._selectionOverrides.showBlockCaretContainer(parentNode); + if (!parserArgs.invalid) { + value = serializer.serialize(fragment); + validInsertion(editor, value, parentNode); + } else { + editor.selection.setContent(bookmarkHtml); + parentNode = selection.getNode(); + rootNode = editor.getBody(); + if (parentNode.nodeType === 9) { + parentNode = node = rootNode; + } else { + node = parentNode; + } + while (node !== rootNode) { + parentNode = node; + node = node.parentNode; + } + value = parentNode === rootNode ? rootNode.innerHTML : dom.getOuterHTML(parentNode); + value = serializer.serialize(parser.parse(value.replace(//i, function () { + return serializer.serialize(fragment); + }))); + if (parentNode === rootNode) { + dom.setHTML(rootNode, value); + } else { + dom.setOuterHTML(parentNode, value); + } + } + reduceInlineTextElements(editor, merge); + moveSelectionToMarker(editor, dom.get('mce_marker')); + unmarkFragmentElements(editor.getBody()); + trimBrsFromTableCell(dom, selection.getStart()); + editor.fire('SetContent', args); + editor.addVisual(); + }; + + var traverse = function (node, fn) { + fn(node); + if (node.firstChild) { + traverse(node.firstChild, fn); + } + if (node.next) { + traverse(node.next, fn); + } + }; + var findMatchingNodes = function (nodeFilters, attributeFilters, node) { + var nodeMatches = {}; + var attrMatches = {}; + var matches = []; + if (node.firstChild) { + traverse(node.firstChild, function (node) { + each(nodeFilters, function (filter) { + if (filter.name === node.name) { + if (nodeMatches[filter.name]) { + nodeMatches[filter.name].nodes.push(node); + } else { + nodeMatches[filter.name] = { + filter: filter, + nodes: [node] + }; + } + } + }); + each(attributeFilters, function (filter) { + if (typeof node.attr(filter.name) === 'string') { + if (attrMatches[filter.name]) { + attrMatches[filter.name].nodes.push(node); + } else { + attrMatches[filter.name] = { + filter: filter, + nodes: [node] + }; + } + } + }); + }); + } + for (var name_1 in nodeMatches) { + if (nodeMatches.hasOwnProperty(name_1)) { + matches.push(nodeMatches[name_1]); + } + } + for (var name_2 in attrMatches) { + if (attrMatches.hasOwnProperty(name_2)) { + matches.push(attrMatches[name_2]); + } + } + return matches; + }; + var filter$3 = function (nodeFilters, attributeFilters, node) { + var matches = findMatchingNodes(nodeFilters, attributeFilters, node); + each(matches, function (match) { + each(match.filter.callbacks, function (callback) { + callback(match.nodes, match.filter.name, {}); + }); + }); + }; + + var defaultFormat = 'html'; + var isTreeNode = function (content) { + return content instanceof AstNode; + }; + var moveSelection = function (editor) { + if (hasFocus$1(editor)) { + firstPositionIn(editor.getBody()).each(function (pos) { + var node = pos.getNode(); + var caretPos = isTable(node) ? firstPositionIn(node).getOr(pos) : pos; + editor.selection.setRng(caretPos.toRange()); + }); + } + }; + var setEditorHtml = function (editor, html) { + editor.dom.setHTML(editor.getBody(), html); + moveSelection(editor); + }; + var setContentString = function (editor, body, content, args) { + var forcedRootBlockName, padd; + if (content.length === 0 || /^\s+$/.test(content)) { + padd = '
    '; + if (body.nodeName === 'TABLE') { + content = '' + padd + ''; + } else if (/^(UL|OL)$/.test(body.nodeName)) { + content = '
  • ' + padd + '
  • '; + } + forcedRootBlockName = getForcedRootBlock(editor); + if (forcedRootBlockName && editor.schema.isValidChild(body.nodeName.toLowerCase(), forcedRootBlockName.toLowerCase())) { + content = padd; + content = editor.dom.createHTML(forcedRootBlockName, getForcedRootBlockAttrs(editor), content); + } else if (!content) { + content = '
    '; + } + setEditorHtml(editor, content); + editor.fire('SetContent', args); + } else { + if (args.format !== 'raw') { + content = HtmlSerializer({ validate: editor.validate }, editor.schema).serialize(editor.parser.parse(content, { + isRootContent: true, + insert: true + })); + } + args.content = isWsPreserveElement(SugarElement.fromDom(body)) ? content : Tools.trim(content); + setEditorHtml(editor, args.content); + if (!args.no_events) { + editor.fire('SetContent', args); + } + } + return args.content; + }; + var setContentTree = function (editor, body, content, args) { + filter$3(editor.parser.getNodeFilters(), editor.parser.getAttributeFilters(), content); + var html = HtmlSerializer({ validate: editor.validate }, editor.schema).serialize(content); + args.content = isWsPreserveElement(SugarElement.fromDom(body)) ? html : Tools.trim(html); + setEditorHtml(editor, args.content); + if (!args.no_events) { + editor.fire('SetContent', args); + } + return content; + }; + var setContentInternal = function (editor, content, args) { + args.format = args.format ? args.format : defaultFormat; + args.set = true; + args.content = isTreeNode(content) ? '' : content; + if (!isTreeNode(content) && !args.no_events) { + editor.fire('BeforeSetContent', args); + content = args.content; + } + return Optional.from(editor.getBody()).fold(constant(content), function (body) { + return isTreeNode(content) ? setContentTree(editor, body, content, args) : setContentString(editor, body, content, args); + }); + }; + + var isEq$2 = isEq; + var matchesUnInheritedFormatSelector = function (ed, node, name) { + var formatList = ed.formatter.get(name); + if (formatList) { + for (var i = 0; i < formatList.length; i++) { + if (formatList[i].inherit === false && ed.dom.is(node, formatList[i].selector)) { + return true; + } + } + } + return false; + }; + var matchParents = function (editor, node, name, vars) { + var root = editor.dom.getRoot(); + if (node === root) { + return false; + } + node = editor.dom.getParent(node, function (node) { + if (matchesUnInheritedFormatSelector(editor, node, name)) { + return true; + } + return node.parentNode === root || !!matchNode(editor, node, name, vars, true); + }); + return matchNode(editor, node, name, vars); + }; + var matchName = function (dom, node, format) { + if (isEq$2(node, format.inline)) { + return true; + } + if (isEq$2(node, format.block)) { + return true; + } + if (format.selector) { + return node.nodeType === 1 && dom.is(node, format.selector); + } + }; + var matchItems = function (dom, node, format, itemName, similar, vars) { + var key, value; + var items = format[itemName]; + var i; + if (format.onmatch) { + return format.onmatch(node, format, itemName); + } + if (items) { + if (typeof items.length === 'undefined') { + for (key in items) { + if (items.hasOwnProperty(key)) { + if (itemName === 'attributes') { + value = dom.getAttrib(node, key); + } else { + value = getStyle(dom, node, key); + } + if (similar && !value && !format.exact) { + return; + } + if ((!similar || format.exact) && !isEq$2(value, normalizeStyleValue(dom, replaceVars(items[key], vars), key))) { + return; + } + } + } + } else { + for (i = 0; i < items.length; i++) { + if (itemName === 'attributes' ? dom.getAttrib(node, items[i]) : getStyle(dom, node, items[i])) { + return format; + } + } + } + } + return format; + }; + var matchNode = function (ed, node, name, vars, similar) { + var formatList = ed.formatter.get(name); + var format, i, x, classes; + var dom = ed.dom; + if (formatList && node) { + for (i = 0; i < formatList.length; i++) { + format = formatList[i]; + if (matchName(ed.dom, node, format) && matchItems(dom, node, format, 'attributes', similar, vars) && matchItems(dom, node, format, 'styles', similar, vars)) { + if (classes = format.classes) { + for (x = 0; x < classes.length; x++) { + if (!ed.dom.hasClass(node, classes[x])) { + return; + } + } + } + return format; + } + } + } + }; + var match = function (editor, name, vars, node) { + if (node) { + return matchParents(editor, node, name, vars); + } + node = editor.selection.getNode(); + if (matchParents(editor, node, name, vars)) { + return true; + } + var startNode = editor.selection.getStart(); + if (startNode !== node) { + if (matchParents(editor, startNode, name, vars)) { + return true; + } + } + return false; + }; + var matchAll = function (editor, names, vars) { + var matchedFormatNames = []; + var checkedMap = {}; + var startElement = editor.selection.getStart(); + editor.dom.getParent(startElement, function (node) { + for (var i = 0; i < names.length; i++) { + var name_1 = names[i]; + if (!checkedMap[name_1] && matchNode(editor, node, name_1, vars)) { + checkedMap[name_1] = true; + matchedFormatNames.push(name_1); + } + } + }, editor.dom.getRoot()); + return matchedFormatNames; + }; + var canApply = function (editor, name) { + var formatList = editor.formatter.get(name); + var startNode, parents, i, x, selector; + var dom = editor.dom; + if (formatList) { + startNode = editor.selection.getStart(); + parents = getParents$1(dom, startNode); + for (x = formatList.length - 1; x >= 0; x--) { + selector = formatList[x].selector; + if (!selector || formatList[x].defaultBlock) { + return true; + } + for (i = parents.length - 1; i >= 0; i--) { + if (dom.is(parents[i], selector)) { + return true; + } + } + } + } + return false; + }; + var matchAllOnNode = function (editor, node, formatNames) { + return foldl(formatNames, function (acc, name) { + var matchSimilar = isVariableFormatName(editor, name); + if (editor.formatter.matchNode(node, name, {}, matchSimilar)) { + return acc.concat([name]); + } else { + return acc; + } + }, []); + }; + + var ZWSP$1 = ZWSP, CARET_ID$1 = '_mce_caret'; + var importNode = function (ownerDocument, node) { + return ownerDocument.importNode(node, true); + }; + var getEmptyCaretContainers = function (node) { + var nodes = []; + while (node) { + if (node.nodeType === 3 && node.nodeValue !== ZWSP$1 || node.childNodes.length > 1) { + return []; + } + if (node.nodeType === 1) { + nodes.push(node); + } + node = node.firstChild; + } + return nodes; + }; + var isCaretContainerEmpty = function (node) { + return getEmptyCaretContainers(node).length > 0; + }; + var findFirstTextNode = function (node) { + if (node) { + var walker = new DomTreeWalker(node, node); + for (node = walker.current(); node; node = walker.next()) { + if (isText$1(node)) { + return node; + } + } + } + return null; + }; + var createCaretContainer = function (fill) { + var caretContainer = SugarElement.fromTag('span'); + setAll(caretContainer, { + 'id': CARET_ID$1, + 'data-mce-bogus': '1', + 'data-mce-type': 'format-caret' + }); + if (fill) { + append(caretContainer, SugarElement.fromText(ZWSP$1)); + } + return caretContainer; + }; + var trimZwspFromCaretContainer = function (caretContainerNode) { + var textNode = findFirstTextNode(caretContainerNode); + if (textNode && textNode.nodeValue.charAt(0) === ZWSP$1) { + textNode.deleteData(0, 1); + } + return textNode; + }; + var removeCaretContainerNode = function (editor, node, moveCaret) { + if (moveCaret === void 0) { + moveCaret = true; + } + var dom = editor.dom, selection = editor.selection; + if (isCaretContainerEmpty(node)) { + deleteElement(editor, false, SugarElement.fromDom(node), moveCaret); + } else { + var rng = selection.getRng(); + var block = dom.getParent(node, dom.isBlock); + var startContainer = rng.startContainer; + var startOffset = rng.startOffset; + var endContainer = rng.endContainer; + var endOffset = rng.endOffset; + var textNode = trimZwspFromCaretContainer(node); + dom.remove(node, true); + if (startContainer === textNode && startOffset > 0) { + rng.setStart(textNode, startOffset - 1); + } + if (endContainer === textNode && endOffset > 0) { + rng.setEnd(textNode, endOffset - 1); + } + if (block && dom.isEmpty(block)) { + fillWithPaddingBr(SugarElement.fromDom(block)); + } + selection.setRng(rng); + } + }; + var removeCaretContainer = function (editor, node, moveCaret) { + if (moveCaret === void 0) { + moveCaret = true; + } + var dom = editor.dom, selection = editor.selection; + if (!node) { + node = getParentCaretContainer(editor.getBody(), selection.getStart()); + if (!node) { + while (node = dom.get(CARET_ID$1)) { + removeCaretContainerNode(editor, node, false); + } + } + } else { + removeCaretContainerNode(editor, node, moveCaret); + } + }; + var insertCaretContainerNode = function (editor, caretContainer, formatNode) { + var dom = editor.dom, block = dom.getParent(formatNode, curry(isTextBlock$1, editor)); + if (block && dom.isEmpty(block)) { + formatNode.parentNode.replaceChild(caretContainer, formatNode); + } else { + removeTrailingBr(SugarElement.fromDom(formatNode)); + if (dom.isEmpty(formatNode)) { + formatNode.parentNode.replaceChild(caretContainer, formatNode); + } else { + dom.insertAfter(caretContainer, formatNode); + } + } + }; + var appendNode = function (parentNode, node) { + parentNode.appendChild(node); + return node; + }; + var insertFormatNodesIntoCaretContainer = function (formatNodes, caretContainer) { + var innerMostFormatNode = foldr(formatNodes, function (parentNode, formatNode) { + return appendNode(parentNode, formatNode.cloneNode(false)); + }, caretContainer); + return appendNode(innerMostFormatNode, innerMostFormatNode.ownerDocument.createTextNode(ZWSP$1)); + }; + var cleanFormatNode = function (editor, caretContainer, formatNode, name, vars, similar) { + var formatter = editor.formatter; + var dom = editor.dom; + var validFormats = filter(keys(formatter.get()), function (formatName) { + return formatName !== name && !contains$1(formatName, 'removeformat'); + }); + var matchedFormats = matchAllOnNode(editor, formatNode, validFormats); + var uniqueFormats = filter(matchedFormats, function (fmtName) { + return !areSimilarFormats(editor, fmtName, name); + }); + if (uniqueFormats.length > 0) { + var clonedFormatNode = formatNode.cloneNode(false); + dom.add(caretContainer, clonedFormatNode); + formatter.remove(name, vars, clonedFormatNode, similar); + dom.remove(clonedFormatNode); + return Optional.some(clonedFormatNode); + } else { + return Optional.none(); + } + }; + var applyCaretFormat = function (editor, name, vars) { + var caretContainer, textNode; + var selection = editor.selection; + var selectionRng = selection.getRng(); + var offset = selectionRng.startOffset; + var container = selectionRng.startContainer; + var text = container.nodeValue; + caretContainer = getParentCaretContainer(editor.getBody(), selection.getStart()); + if (caretContainer) { + textNode = findFirstTextNode(caretContainer); + } + var wordcharRegex = /[^\s\u00a0\u00ad\u200b\ufeff]/; + if (text && offset > 0 && offset < text.length && wordcharRegex.test(text.charAt(offset)) && wordcharRegex.test(text.charAt(offset - 1))) { + var bookmark = selection.getBookmark(); + selectionRng.collapse(true); + var rng = expandRng(editor, selectionRng, editor.formatter.get(name)); + rng = split$1(rng); + editor.formatter.apply(name, vars, rng); + selection.moveToBookmark(bookmark); + } else { + if (!caretContainer || textNode.nodeValue !== ZWSP$1) { + caretContainer = importNode(editor.getDoc(), createCaretContainer(true).dom); + textNode = caretContainer.firstChild; + selectionRng.insertNode(caretContainer); + offset = 1; + editor.formatter.apply(name, vars, caretContainer); + } else { + editor.formatter.apply(name, vars, caretContainer); + } + selection.setCursorLocation(textNode, offset); + } + }; + var removeCaretFormat = function (editor, name, vars, similar) { + var dom = editor.dom; + var selection = editor.selection; + var hasContentAfter, node, formatNode; + var parents = []; + var rng = selection.getRng(); + var container = rng.startContainer; + var offset = rng.startOffset; + node = container; + if (container.nodeType === 3) { + if (offset !== container.nodeValue.length) { + hasContentAfter = true; + } + node = node.parentNode; + } + while (node) { + if (matchNode(editor, node, name, vars, similar)) { + formatNode = node; + break; + } + if (node.nextSibling) { + hasContentAfter = true; + } + parents.push(node); + node = node.parentNode; + } + if (!formatNode) { + return; + } + if (hasContentAfter) { + var bookmark = selection.getBookmark(); + rng.collapse(true); + var expandedRng = expandRng(editor, rng, editor.formatter.get(name), true); + expandedRng = split$1(expandedRng); + editor.formatter.remove(name, vars, expandedRng, similar); + selection.moveToBookmark(bookmark); + } else { + var caretContainer = getParentCaretContainer(editor.getBody(), formatNode); + var newCaretContainer = createCaretContainer(false).dom; + insertCaretContainerNode(editor, newCaretContainer, caretContainer !== null ? caretContainer : formatNode); + var cleanedFormatNode = cleanFormatNode(editor, newCaretContainer, formatNode, name, vars, similar); + var caretTextNode = insertFormatNodesIntoCaretContainer(parents.concat(cleanedFormatNode.toArray()), newCaretContainer); + removeCaretContainerNode(editor, caretContainer, false); + selection.setCursorLocation(caretTextNode, 1); + if (dom.isEmpty(formatNode)) { + dom.remove(formatNode); + } + } + }; + var disableCaretContainer = function (editor, keyCode) { + var selection = editor.selection, body = editor.getBody(); + removeCaretContainer(editor, null, false); + if ((keyCode === 8 || keyCode === 46) && selection.isCollapsed() && selection.getStart().innerHTML === ZWSP$1) { + removeCaretContainer(editor, getParentCaretContainer(body, selection.getStart())); + } + if (keyCode === 37 || keyCode === 39) { + removeCaretContainer(editor, getParentCaretContainer(body, selection.getStart())); + } + }; + var setup$3 = function (editor) { + editor.on('mouseup keydown', function (e) { + disableCaretContainer(editor, e.keyCode); + }); + }; + var replaceWithCaretFormat = function (targetNode, formatNodes) { + var caretContainer = createCaretContainer(false); + var innerMost = insertFormatNodesIntoCaretContainer(formatNodes, caretContainer.dom); + before(SugarElement.fromDom(targetNode), caretContainer); + remove(SugarElement.fromDom(targetNode)); + return CaretPosition$1(innerMost, 0); + }; + var isFormatElement = function (editor, element) { + var inlineElements = editor.schema.getTextInlineElements(); + return inlineElements.hasOwnProperty(name(element)) && !isCaretNode(element.dom) && !isBogus(element.dom); + }; + var isEmptyCaretFormatElement = function (element) { + return isCaretNode(element.dom) && isCaretContainerEmpty(element.dom); + }; + + var postProcessHooks = {}; + var filter$4 = filter$2; + var each$8 = each$2; + var addPostProcessHook = function (name, hook) { + var hooks = postProcessHooks[name]; + if (!hooks) { + postProcessHooks[name] = []; + } + postProcessHooks[name].push(hook); + }; + var postProcess = function (name, editor) { + each$8(postProcessHooks[name], function (hook) { + hook(editor); + }); + }; + addPostProcessHook('pre', function (editor) { + var rng = editor.selection.getRng(); + var blocks; + var hasPreSibling = function (pre) { + return isPre(pre.previousSibling) && indexOf$1(blocks, pre.previousSibling) !== -1; + }; + var joinPre = function (pre1, pre2) { + DomQuery(pre2).remove(); + DomQuery(pre1).append('

    ').append(pre2.childNodes); + }; + var isPre = matchNodeNames(['pre']); + if (!rng.collapsed) { + blocks = editor.selection.getSelectedBlocks(); + each$8(filter$4(filter$4(blocks, isPre), hasPreSibling), function (pre) { + joinPre(pre.previousSibling, pre); + }); + } + }); + + var each$9 = Tools.each; + var isElementNode = function (node) { + return isElement$1(node) && !isBookmarkNode$1(node) && !isCaretNode(node) && !isBogus(node); + }; + var findElementSibling = function (node, siblingName) { + var sibling; + for (sibling = node; sibling; sibling = sibling[siblingName]) { + if (isText$1(sibling) && sibling.nodeValue.length !== 0) { + return node; + } + if (isElement$1(sibling) && !isBookmarkNode$1(sibling)) { + return sibling; + } + } + return node; + }; + var mergeSiblingsNodes = function (dom, prev, next) { + var sibling, tmpSibling; + var elementUtils = new ElementUtils(dom); + if (prev && next) { + prev = findElementSibling(prev, 'previousSibling'); + next = findElementSibling(next, 'nextSibling'); + if (elementUtils.compare(prev, next)) { + for (sibling = prev.nextSibling; sibling && sibling !== next;) { + tmpSibling = sibling; + sibling = sibling.nextSibling; + prev.appendChild(tmpSibling); + } + dom.remove(next); + Tools.each(Tools.grep(next.childNodes), function (node) { + prev.appendChild(node); + }); + return prev; + } + } + return next; + }; + var mergeSiblings = function (dom, format, vars, node) { + if (node && format.merge_siblings !== false) { + var newNode = mergeSiblingsNodes(dom, getNonWhiteSpaceSibling(node), node); + mergeSiblingsNodes(dom, newNode, getNonWhiteSpaceSibling(newNode, true)); + } + }; + var clearChildStyles = function (dom, format, node) { + if (format.clear_child_styles) { + var selector = format.links ? '*:not(a)' : '*'; + each$9(dom.select(selector, node), function (node) { + if (isElementNode(node)) { + each$9(format.styles, function (value, name) { + dom.setStyle(node, name, ''); + }); + } + }); + } + }; + var processChildElements = function (node, filter, process) { + each$9(node.childNodes, function (node) { + if (isElementNode(node)) { + if (filter(node)) { + process(node); + } + if (node.hasChildNodes()) { + processChildElements(node, filter, process); + } + } + }); + }; + var unwrapEmptySpan = function (dom, node) { + if (node.nodeName === 'SPAN' && dom.getAttribs(node).length === 0) { + dom.remove(node, true); + } + }; + var hasStyle = function (dom, name) { + return function (node) { + return !!(node && getStyle(dom, node, name)); + }; + }; + var applyStyle = function (dom, name, value) { + return function (node) { + dom.setStyle(node, name, value); + if (node.getAttribute('style') === '') { + node.removeAttribute('style'); + } + unwrapEmptySpan(dom, node); + }; + }; + + var removeResult = Adt.generate([ + { keep: [] }, + { rename: ['name'] }, + { removed: [] } + ]); + var MCE_ATTR_RE = /^(src|href|style)$/; + var each$a = Tools.each; + var isEq$3 = isEq; + var isTableCellOrRow = function (node) { + return /^(TR|TH|TD)$/.test(node.nodeName); + }; + var isChildOfInlineParent = function (dom, node, parent) { + return dom.isChildOf(node, parent) && node !== parent && !dom.isBlock(parent); + }; + var getContainer = function (ed, rng, start) { + var container, offset; + container = rng[start ? 'startContainer' : 'endContainer']; + offset = rng[start ? 'startOffset' : 'endOffset']; + if (isElement$1(container)) { + var lastIdx = container.childNodes.length - 1; + if (!start && offset) { + offset--; + } + container = container.childNodes[offset > lastIdx ? lastIdx : offset]; + } + if (isText$1(container) && start && offset >= container.nodeValue.length) { + container = new DomTreeWalker(container, ed.getBody()).next() || container; + } + if (isText$1(container) && !start && offset === 0) { + container = new DomTreeWalker(container, ed.getBody()).prev() || container; + } + return container; + }; + var normalizeTableSelection = function (node, start) { + var prop = start ? 'firstChild' : 'lastChild'; + if (isTableCellOrRow(node) && node[prop]) { + var childNode = node[prop]; + if (node.nodeName === 'TR') { + return childNode[prop] || childNode; + } else { + return childNode; + } + } + return node; + }; + var wrap$2 = function (dom, node, name, attrs) { + var wrapper = dom.create(name, attrs); + node.parentNode.insertBefore(wrapper, node); + wrapper.appendChild(node); + return wrapper; + }; + var wrapWithSiblings = function (dom, node, next, name, attrs) { + var start = SugarElement.fromDom(node); + var wrapper = SugarElement.fromDom(dom.create(name, attrs)); + var siblings = next ? nextSiblings(start) : prevSiblings(start); + append$1(wrapper, siblings); + if (next) { + before(start, wrapper); + prepend(wrapper, start); + } else { + after(start, wrapper); + append(wrapper, start); + } + return wrapper.dom; + }; + var matchName$1 = function (dom, node, format) { + if (isEq$3(node, format.inline)) { + return true; + } + if (isEq$3(node, format.block)) { + return true; + } + if (format.selector) { + return isElement$1(node) && dom.is(node, format.selector); + } + }; + var isColorFormatAndAnchor = function (node, format) { + return format.links && node.nodeName === 'A'; + }; + var find$3 = function (dom, node, next, inc) { + node = getNonWhiteSpaceSibling(node, next, inc); + return !node || (node.nodeName === 'BR' || dom.isBlock(node)); + }; + var removeNode$1 = function (ed, node, format) { + var parentNode = node.parentNode; + var rootBlockElm; + var dom = ed.dom, forcedRootBlock = getForcedRootBlock(ed); + if (format.block) { + if (!forcedRootBlock) { + if (dom.isBlock(node) && !dom.isBlock(parentNode)) { + if (!find$3(dom, node, false) && !find$3(dom, node.firstChild, true, true)) { + node.insertBefore(dom.create('br'), node.firstChild); + } + if (!find$3(dom, node, true) && !find$3(dom, node.lastChild, false, true)) { + node.appendChild(dom.create('br')); + } + } + } else { + if (parentNode === dom.getRoot()) { + if (!format.list_block || !isEq$3(node, format.list_block)) { + each(from$1(node.childNodes), function (node) { + if (isValid(ed, forcedRootBlock, node.nodeName.toLowerCase())) { + if (!rootBlockElm) { + rootBlockElm = wrap$2(dom, node, forcedRootBlock); + dom.setAttribs(rootBlockElm, ed.settings.forced_root_block_attrs); + } else { + rootBlockElm.appendChild(node); + } + } else { + rootBlockElm = 0; + } + }); + } + } + } + } + if (format.selector && format.inline && !isEq$3(format.inline, node)) { + return; + } + dom.remove(node, true); + }; + var removeFormatInternal = function (ed, format, vars, node, compareNode) { + var stylesModified; + var dom = ed.dom; + if (!matchName$1(dom, node, format) && !isColorFormatAndAnchor(node, format)) { + return removeResult.keep(); + } + var elm = node; + if (format.inline && format.remove === 'all' && isArray(format.preserve_attributes)) { + var attrsToPreserve = filter(dom.getAttribs(elm), function (attr) { + return contains(format.preserve_attributes, attr.name.toLowerCase()); + }); + dom.removeAllAttribs(elm); + each(attrsToPreserve, function (attr) { + return dom.setAttrib(elm, attr.name, attr.value); + }); + if (attrsToPreserve.length > 0) { + return removeResult.rename('span'); + } + } + if (format.remove !== 'all') { + each$a(format.styles, function (value, name) { + value = normalizeStyleValue(dom, replaceVars(value, vars), name + ''); + if (isNumber(name)) { + name = value; + compareNode = null; + } + if (format.remove_similar || (!compareNode || isEq$3(getStyle(dom, compareNode, name), value))) { + dom.setStyle(elm, name, ''); + } + stylesModified = true; + }); + if (stylesModified && dom.getAttrib(elm, 'style') === '') { + elm.removeAttribute('style'); + elm.removeAttribute('data-mce-style'); + } + each$a(format.attributes, function (value, name) { + var valueOut; + value = replaceVars(value, vars); + if (isNumber(name)) { + name = value; + compareNode = null; + } + if (format.remove_similar || (!compareNode || isEq$3(dom.getAttrib(compareNode, name), value))) { + if (name === 'class') { + value = dom.getAttrib(elm, name); + if (value) { + valueOut = ''; + each(value.split(/\s+/), function (cls) { + if (/mce\-\w+/.test(cls)) { + valueOut += (valueOut ? ' ' : '') + cls; + } + }); + if (valueOut) { + dom.setAttrib(elm, name, valueOut); + return; + } + } + } + if (name === 'class') { + elm.removeAttribute('className'); + } + if (MCE_ATTR_RE.test(name)) { + elm.removeAttribute('data-mce-' + name); + } + elm.removeAttribute(name); + } + }); + each$a(format.classes, function (value) { + value = replaceVars(value, vars); + if (!compareNode || dom.hasClass(compareNode, value)) { + dom.removeClass(elm, value); + } + }); + var attrs = dom.getAttribs(elm); + for (var i = 0; i < attrs.length; i++) { + var attrName = attrs[i].nodeName; + if (attrName.indexOf('_') !== 0 && attrName.indexOf('data-') !== 0) { + return removeResult.keep(); + } + } + } + if (format.remove !== 'none') { + removeNode$1(ed, elm, format); + return removeResult.removed(); + } + return removeResult.keep(); + }; + var removeFormat = function (ed, format, vars, node, compareNode) { + return removeFormatInternal(ed, format, vars, node, compareNode).fold(never, function (newName) { + ed.dom.rename(node, newName); + return true; + }, always); + }; + var findFormatRoot = function (editor, container, name, vars, similar) { + var formatRoot; + each(getParents$1(editor.dom, container.parentNode).reverse(), function (parent) { + if (!formatRoot && parent.id !== '_start' && parent.id !== '_end') { + var format = matchNode(editor, parent, name, vars, similar); + if (format && format.split !== false) { + formatRoot = parent; + } + } + }); + return formatRoot; + }; + var removeFormatFromClone = function (editor, format, vars, clone) { + return removeFormatInternal(editor, format, vars, clone, clone).fold(constant(clone), function (newName) { + var fragment = editor.dom.createFragment(); + fragment.appendChild(clone); + return editor.dom.rename(clone, newName); + }, constant(null)); + }; + var wrapAndSplit = function (editor, formatList, formatRoot, container, target, split, format, vars) { + var clone, lastClone, firstClone; + var dom = editor.dom; + if (formatRoot) { + var formatRootParent = formatRoot.parentNode; + for (var parent_1 = container.parentNode; parent_1 && parent_1 !== formatRootParent; parent_1 = parent_1.parentNode) { + clone = dom.clone(parent_1, false); + for (var i = 0; i < formatList.length; i++) { + clone = removeFormatFromClone(editor, formatList[i], vars, clone); + if (clone === null) { + break; + } + } + if (clone) { + if (lastClone) { + clone.appendChild(lastClone); + } + if (!firstClone) { + firstClone = clone; + } + lastClone = clone; + } + } + if (split && (!format.mixed || !dom.isBlock(formatRoot))) { + container = dom.split(formatRoot, container); + } + if (lastClone) { + target.parentNode.insertBefore(lastClone, target); + firstClone.appendChild(target); + if (format.inline) { + mergeSiblings(dom, format, vars, lastClone); + } + } + } + return container; + }; + var remove$6 = function (ed, name, vars, node, similar) { + var formatList = ed.formatter.get(name); + var format = formatList[0]; + var contentEditable = true; + var dom = ed.dom; + var selection = ed.selection; + var splitToFormatRoot = function (container) { + var formatRoot = findFormatRoot(ed, container, name, vars, similar); + return wrapAndSplit(ed, formatList, formatRoot, container, container, true, format, vars); + }; + var isRemoveBookmarkNode = function (node) { + return isBookmarkNode$1(node) && isElement$1(node) && (node.id === '_start' || node.id === '_end'); + }; + var process = function (node) { + var lastContentEditable, hasContentEditableState; + if (isElement$1(node) && dom.getContentEditable(node)) { + lastContentEditable = contentEditable; + contentEditable = dom.getContentEditable(node) === 'true'; + hasContentEditableState = true; + } + var children = from$1(node.childNodes); + if (contentEditable && !hasContentEditableState) { + for (var i = 0; i < formatList.length; i++) { + if (removeFormat(ed, formatList[i], vars, node, node)) { + break; + } + } + } + if (format.deep) { + if (children.length) { + for (var i = 0; i < children.length; i++) { + process(children[i]); + } + if (hasContentEditableState) { + contentEditable = lastContentEditable; + } + } + } + }; + var unwrap = function (start) { + var node = dom.get(start ? '_start' : '_end'); + var out = node[start ? 'firstChild' : 'lastChild']; + if (isRemoveBookmarkNode(out)) { + out = out[start ? 'firstChild' : 'lastChild']; + } + if (isText$1(out) && out.data.length === 0) { + out = start ? node.previousSibling || node.nextSibling : node.nextSibling || node.previousSibling; + } + dom.remove(node, true); + return out; + }; + var removeRngStyle = function (rng) { + var startContainer, endContainer; + var expandedRng = expandRng(ed, rng, formatList, true); + if (format.split) { + expandedRng = split$1(expandedRng); + startContainer = getContainer(ed, expandedRng, true); + endContainer = getContainer(ed, expandedRng); + if (startContainer !== endContainer) { + startContainer = normalizeTableSelection(startContainer, true); + endContainer = normalizeTableSelection(endContainer, false); + if (isChildOfInlineParent(dom, startContainer, endContainer)) { + var marker = Optional.from(startContainer.firstChild).getOr(startContainer); + splitToFormatRoot(wrapWithSiblings(dom, marker, true, 'span', { + 'id': '_start', + 'data-mce-type': 'bookmark' + })); + unwrap(true); + return; + } + if (isChildOfInlineParent(dom, endContainer, startContainer)) { + var marker = Optional.from(endContainer.lastChild).getOr(endContainer); + splitToFormatRoot(wrapWithSiblings(dom, marker, false, 'span', { + 'id': '_end', + 'data-mce-type': 'bookmark' + })); + unwrap(false); + return; + } + startContainer = wrap$2(dom, startContainer, 'span', { + 'id': '_start', + 'data-mce-type': 'bookmark' + }); + endContainer = wrap$2(dom, endContainer, 'span', { + 'id': '_end', + 'data-mce-type': 'bookmark' + }); + var newRng = dom.createRng(); + newRng.setStartAfter(startContainer); + newRng.setEndBefore(endContainer); + walk$1(dom, newRng, function (nodes) { + each(nodes, function (n) { + if (!isBookmarkNode$1(n) && !isBookmarkNode$1(n.parentNode)) { + splitToFormatRoot(n); + } + }); + }); + splitToFormatRoot(startContainer); + splitToFormatRoot(endContainer); + startContainer = unwrap(true); + endContainer = unwrap(); + } else { + startContainer = endContainer = splitToFormatRoot(startContainer); + } + expandedRng.startContainer = startContainer.parentNode ? startContainer.parentNode : startContainer; + expandedRng.startOffset = dom.nodeIndex(startContainer); + expandedRng.endContainer = endContainer.parentNode ? endContainer.parentNode : endContainer; + expandedRng.endOffset = dom.nodeIndex(endContainer) + 1; + } + walk$1(dom, expandedRng, function (nodes) { + each(nodes, function (node) { + process(node); + var textDecorations = [ + 'underline', + 'line-through', + 'overline' + ]; + each(textDecorations, function (decoration) { + if (isElement$1(node) && ed.dom.getStyle(node, 'text-decoration') === decoration && node.parentNode && getTextDecoration(dom, node.parentNode) === decoration) { + removeFormat(ed, { + deep: false, + exact: true, + inline: 'span', + styles: { textDecoration: decoration } + }, null, node); + } + }); + }); + }); + }; + if (node) { + if (isNode(node)) { + var rng = dom.createRng(); + rng.setStartBefore(node); + rng.setEndAfter(node); + removeRngStyle(rng); + } else { + removeRngStyle(node); + } + return; + } + if (dom.getContentEditable(selection.getNode()) === 'false') { + node = selection.getNode(); + for (var i = 0; i < formatList.length; i++) { + if (formatList[i].ceFalseOverride) { + if (removeFormat(ed, formatList[i], vars, node, node)) { + break; + } + } + } + return; + } + if (!selection.isCollapsed() || !format.inline || getCellsFromEditor(ed).length) { + preserve(selection, true, function () { + runOnRanges(ed, removeRngStyle); + }); + if (format.inline && match(ed, name, vars, selection.getStart())) { + moveStart(dom, selection, selection.getRng()); + } + ed.nodeChanged(); + } else { + removeCaretFormat(ed, name, vars, similar); + } + }; + + var each$b = Tools.each; + var mergeTextDecorationsAndColor = function (dom, format, vars, node) { + var processTextDecorationsAndColor = function (n) { + if (n.nodeType === 1 && n.parentNode && n.parentNode.nodeType === 1) { + var textDecoration = getTextDecoration(dom, n.parentNode); + if (dom.getStyle(n, 'color') && textDecoration) { + dom.setStyle(n, 'text-decoration', textDecoration); + } else if (dom.getStyle(n, 'text-decoration') === textDecoration) { + dom.setStyle(n, 'text-decoration', null); + } + } + }; + if (format.styles && (format.styles.color || format.styles.textDecoration)) { + Tools.walk(node, processTextDecorationsAndColor, 'childNodes'); + processTextDecorationsAndColor(node); + } + }; + var mergeBackgroundColorAndFontSize = function (dom, format, vars, node) { + if (format.styles && format.styles.backgroundColor) { + processChildElements(node, hasStyle(dom, 'fontSize'), applyStyle(dom, 'backgroundColor', replaceVars(format.styles.backgroundColor, vars))); + } + }; + var mergeSubSup = function (dom, format, vars, node) { + if (format.inline === 'sub' || format.inline === 'sup') { + processChildElements(node, hasStyle(dom, 'fontSize'), applyStyle(dom, 'fontSize', '')); + dom.remove(dom.select(format.inline === 'sup' ? 'sub' : 'sup', node), true); + } + }; + var mergeWithChildren = function (editor, formatList, vars, node) { + each$b(formatList, function (format) { + each$b(editor.dom.select(format.inline, node), function (child) { + if (!isElementNode(child)) { + return; + } + removeFormat(editor, format, vars, child, format.exact ? child : null); + }); + clearChildStyles(editor.dom, format, node); + }); + }; + var mergeWithParents = function (editor, format, name, vars, node) { + if (matchNode(editor, node.parentNode, name, vars)) { + if (removeFormat(editor, format, vars, node)) { + return; + } + } + if (format.merge_with_parents) { + editor.dom.getParent(node.parentNode, function (parent) { + if (matchNode(editor, parent, name, vars)) { + removeFormat(editor, format, vars, node); + return true; + } + }); + } + }; + + var each$c = Tools.each; + var isElementNode$1 = function (node) { + return node && node.nodeType === 1 && !isBookmarkNode$1(node) && !isCaretNode(node) && !isBogus(node); + }; + var applyFormat = function (ed, name, vars, node) { + var formatList = ed.formatter.get(name); + var format = formatList[0]; + var rng; + var isCollapsed = !node && ed.selection.isCollapsed(); + var dom = ed.dom, selection = ed.selection; + var setElementFormat = function (elm, fmt) { + fmt = fmt || format; + if (elm) { + if (fmt.onformat) { + fmt.onformat(elm, fmt, vars, node); + } + each$c(fmt.styles, function (value, name) { + dom.setStyle(elm, name, replaceVars(value, vars)); + }); + if (fmt.styles) { + var styleVal = dom.getAttrib(elm, 'style'); + if (styleVal) { + dom.setAttrib(elm, 'data-mce-style', styleVal); + } + } + each$c(fmt.attributes, function (value, name) { + dom.setAttrib(elm, name, replaceVars(value, vars)); + }); + each$c(fmt.classes, function (value) { + value = replaceVars(value, vars); + if (!dom.hasClass(elm, value)) { + dom.addClass(elm, value); + } + }); + } + }; + var applyNodeStyle = function (formatList, node) { + var found = false; + if (!format.selector) { + return false; + } + each$c(formatList, function (format) { + if ('collapsed' in format && format.collapsed !== isCollapsed) { + return; + } + if (dom.is(node, format.selector) && !isCaretNode(node)) { + setElementFormat(node, format); + found = true; + return false; + } + }); + return found; + }; + var applyRngStyle = function (dom, rng, bookmark, nodeSpecific) { + var newWrappers = []; + var contentEditable = true; + var wrapName = format.inline || format.block; + var wrapElm = dom.create(wrapName); + setElementFormat(wrapElm); + walk$1(dom, rng, function (nodes) { + var currentWrapElm; + var process = function (node) { + var hasContentEditableState = false; + var lastContentEditable = contentEditable; + var nodeName = node.nodeName.toLowerCase(); + var parentName = node.parentNode.nodeName.toLowerCase(); + if (isElement$1(node) && dom.getContentEditable(node)) { + lastContentEditable = contentEditable; + contentEditable = dom.getContentEditable(node) === 'true'; + hasContentEditableState = true; + } + if (isEq(nodeName, 'br')) { + currentWrapElm = 0; + if (format.block) { + dom.remove(node); + } + return; + } + if (format.wrapper && matchNode(ed, node, name, vars)) { + currentWrapElm = 0; + return; + } + if (contentEditable && !hasContentEditableState && format.block && !format.wrapper && isTextBlock$1(ed, nodeName) && isValid(ed, parentName, wrapName)) { + var elm = dom.rename(node, wrapName); + setElementFormat(elm); + newWrappers.push(elm); + currentWrapElm = 0; + return; + } + if (format.selector) { + var found = applyNodeStyle(formatList, node); + if (!format.inline || found) { + currentWrapElm = 0; + return; + } + } + if (contentEditable && !hasContentEditableState && isValid(ed, wrapName, nodeName) && isValid(ed, parentName, wrapName) && !(!nodeSpecific && node.nodeType === 3 && node.nodeValue.length === 1 && node.nodeValue.charCodeAt(0) === 65279) && !isCaretNode(node) && (!format.inline || !dom.isBlock(node))) { + if (!currentWrapElm) { + currentWrapElm = dom.clone(wrapElm, false); + node.parentNode.insertBefore(currentWrapElm, node); + newWrappers.push(currentWrapElm); + } + currentWrapElm.appendChild(node); + } else { + currentWrapElm = 0; + each$c(Tools.grep(node.childNodes), process); + if (hasContentEditableState) { + contentEditable = lastContentEditable; + } + currentWrapElm = 0; + } + }; + each$c(nodes, process); + }); + if (format.links === true) { + each$c(newWrappers, function (node) { + var process = function (node) { + if (node.nodeName === 'A') { + setElementFormat(node, format); + } + each$c(Tools.grep(node.childNodes), process); + }; + process(node); + }); + } + each$c(newWrappers, function (node) { + var getChildCount = function (node) { + var count = 0; + each$c(node.childNodes, function (node) { + if (!isEmptyTextNode(node) && !isBookmarkNode$1(node)) { + count++; + } + }); + return count; + }; + var getChildElementNode = function (root) { + var child = false; + each$c(root.childNodes, function (node) { + if (isElementNode$1(node)) { + child = node; + return false; + } + }); + return child; + }; + var mergeStyles = function (node) { + var clone; + var child = getChildElementNode(node); + if (child && !isBookmarkNode$1(child) && matchName(dom, child, format)) { + clone = dom.clone(child, false); + setElementFormat(clone); + dom.replace(clone, node, true); + dom.remove(child, true); + } + return clone || node; + }; + var childCount = getChildCount(node); + if ((newWrappers.length > 1 || !dom.isBlock(node)) && childCount === 0) { + dom.remove(node, true); + return; + } + if (format.inline || format.wrapper) { + if (!format.exact && childCount === 1) { + node = mergeStyles(node); + } + mergeWithChildren(ed, formatList, vars, node); + mergeWithParents(ed, format, name, vars, node); + mergeBackgroundColorAndFontSize(dom, format, vars, node); + mergeTextDecorationsAndColor(dom, format, vars, node); + mergeSubSup(dom, format, vars, node); + mergeSiblings(dom, format, vars, node); + } + }); + }; + if (dom.getContentEditable(selection.getNode()) === 'false') { + node = selection.getNode(); + for (var i = 0, l = formatList.length; i < l; i++) { + if (formatList[i].ceFalseOverride && dom.is(node, formatList[i].selector)) { + setElementFormat(node, formatList[i]); + return; + } + } + return; + } + if (format) { + if (node) { + if (isNode(node)) { + if (!applyNodeStyle(formatList, node)) { + rng = dom.createRng(); + rng.setStartBefore(node); + rng.setEndAfter(node); + applyRngStyle(dom, expandRng(ed, rng, formatList), null, true); + } + } else { + applyRngStyle(dom, node, null, true); + } + } else { + if (!isCollapsed || !format.inline || getCellsFromEditor(ed).length) { + var curSelNode = selection.getNode(); + if (!ed.settings.forced_root_block && formatList[0].defaultBlock && !dom.getParent(curSelNode, dom.isBlock)) { + applyFormat(ed, formatList[0].defaultBlock); + } + selection.setRng(normalize$2(selection.getRng())); + preserve(selection, true, function (bookmark) { + runOnRanges(ed, function (selectionRng, fake) { + var expandedRng = fake ? selectionRng : expandRng(ed, selectionRng, formatList); + applyRngStyle(dom, expandedRng); + }); + }); + moveStart(dom, selection, selection.getRng()); + ed.nodeChanged(); + } else { + applyCaretFormat(ed, name, vars); + } + } + postProcess(name, ed); + } + }; + + var toggle = function (editor, name, vars, node) { + var fmt = editor.formatter.get(name); + if (match(editor, name, vars, node) && (!('toggle' in fmt[0]) || fmt[0].toggle)) { + remove$6(editor, name, vars, node); + } else { + applyFormat(editor, name, vars, node); + } + }; + + var fromElements = function (elements, scope) { + var doc = scope || document; + var fragment = doc.createDocumentFragment(); + each(elements, function (element) { + fragment.appendChild(element.dom); + }); + return SugarElement.fromDom(fragment); + }; + + var tableModel = function (element, width, rows) { + return { + element: element, + width: width, + rows: rows + }; + }; + var tableRow = function (element, cells) { + return { + element: element, + cells: cells + }; + }; + var cellPosition = function (x, y) { + return { + x: x, + y: y + }; + }; + var getSpan = function (td, key) { + var value = parseInt(get$3(td, key), 10); + return isNaN(value) ? 1 : value; + }; + var fillout = function (table, x, y, tr, td) { + var rowspan = getSpan(td, 'rowspan'); + var colspan = getSpan(td, 'colspan'); + var rows = table.rows; + for (var y2 = y; y2 < y + rowspan; y2++) { + if (!rows[y2]) { + rows[y2] = tableRow(deep(tr), []); + } + for (var x2 = x; x2 < x + colspan; x2++) { + var cells = rows[y2].cells; + cells[x2] = y2 === y && x2 === x ? td : shallow(td); + } + } + }; + var cellExists = function (table, x, y) { + var rows = table.rows; + var cells = rows[y] ? rows[y].cells : []; + return !!cells[x]; + }; + var skipCellsX = function (table, x, y) { + while (cellExists(table, x, y)) { + x++; + } + return x; + }; + var getWidth = function (rows) { + return foldl(rows, function (acc, row) { + return row.cells.length > acc ? row.cells.length : acc; + }, 0); + }; + var findElementPos = function (table, element) { + var rows = table.rows; + for (var y = 0; y < rows.length; y++) { + var cells = rows[y].cells; + for (var x = 0; x < cells.length; x++) { + if (eq$2(cells[x], element)) { + return Optional.some(cellPosition(x, y)); + } + } + } + return Optional.none(); + }; + var extractRows = function (table, sx, sy, ex, ey) { + var newRows = []; + var rows = table.rows; + for (var y = sy; y <= ey; y++) { + var cells = rows[y].cells; + var slice = sx < ex ? cells.slice(sx, ex + 1) : cells.slice(ex, sx + 1); + newRows.push(tableRow(rows[y].element, slice)); + } + return newRows; + }; + var subTable = function (table, startPos, endPos) { + var sx = startPos.x, sy = startPos.y; + var ex = endPos.x, ey = endPos.y; + var newRows = sy < ey ? extractRows(table, sx, sy, ex, ey) : extractRows(table, sx, ey, ex, sy); + return tableModel(table.element, getWidth(newRows), newRows); + }; + var createDomTable = function (table, rows) { + var tableElement = shallow(table.element); + var tableBody = SugarElement.fromTag('tbody'); + append$1(tableBody, rows); + append(tableElement, tableBody); + return tableElement; + }; + var modelRowsToDomRows = function (table) { + return map(table.rows, function (row) { + var cells = map(row.cells, function (cell) { + var td = deep(cell); + remove$1(td, 'colspan'); + remove$1(td, 'rowspan'); + return td; + }); + var tr = shallow(row.element); + append$1(tr, cells); + return tr; + }); + }; + var fromDom$1 = function (tableElm) { + var table = tableModel(shallow(tableElm), 0, []); + each(descendants$1(tableElm, 'tr'), function (tr, y) { + each(descendants$1(tr, 'td,th'), function (td, x) { + fillout(table, skipCellsX(table, x, y), y, tr, td); + }); + }); + return tableModel(table.element, getWidth(table.rows), table.rows); + }; + var toDom = function (table) { + return createDomTable(table, modelRowsToDomRows(table)); + }; + var subsection = function (table, startElement, endElement) { + return findElementPos(table, startElement).bind(function (startPos) { + return findElementPos(table, endElement).map(function (endPos) { + return subTable(table, startPos, endPos); + }); + }); + }; + + var findParentListContainer = function (parents) { + return find(parents, function (elm) { + return name(elm) === 'ul' || name(elm) === 'ol'; + }); + }; + var getFullySelectedListWrappers = function (parents, rng) { + return find(parents, function (elm) { + return name(elm) === 'li' && hasAllContentsSelected(elm, rng); + }).fold(constant([]), function (_li) { + return findParentListContainer(parents).map(function (listCont) { + var listElm = SugarElement.fromTag(name(listCont)); + var listStyles = filter$1(getAllRaw(listCont), function (_style, name) { + return startsWith(name, 'list-style'); + }); + setAll$1(listElm, listStyles); + return [ + SugarElement.fromTag('li'), + listElm + ]; + }).getOr([]); + }); + }; + var wrap$3 = function (innerElm, elms) { + var wrapped = foldl(elms, function (acc, elm) { + append(elm, acc); + return elm; + }, innerElm); + return elms.length > 0 ? fromElements([wrapped]) : wrapped; + }; + var directListWrappers = function (commonAnchorContainer) { + if (isListItem(commonAnchorContainer)) { + return parent(commonAnchorContainer).filter(isList).fold(constant([]), function (listElm) { + return [ + commonAnchorContainer, + listElm + ]; + }); + } else { + return isList(commonAnchorContainer) ? [commonAnchorContainer] : []; + } + }; + var getWrapElements = function (rootNode, rng) { + var commonAnchorContainer = SugarElement.fromDom(rng.commonAncestorContainer); + var parents = parentsAndSelf(commonAnchorContainer, rootNode); + var wrapElements = filter(parents, function (elm) { + return isInline(elm) || isHeading(elm); + }); + var listWrappers = getFullySelectedListWrappers(parents, rng); + var allWrappers = wrapElements.concat(listWrappers.length ? listWrappers : directListWrappers(commonAnchorContainer)); + return map(allWrappers, shallow); + }; + var emptyFragment = function () { + return fromElements([]); + }; + var getFragmentFromRange = function (rootNode, rng) { + return wrap$3(SugarElement.fromDom(rng.cloneContents()), getWrapElements(rootNode, rng)); + }; + var getParentTable = function (rootElm, cell) { + return ancestor$1(cell, 'table', curry(eq$2, rootElm)); + }; + var getTableFragment = function (rootNode, selectedTableCells) { + return getParentTable(rootNode, selectedTableCells[0]).bind(function (tableElm) { + var firstCell = selectedTableCells[0]; + var lastCell = selectedTableCells[selectedTableCells.length - 1]; + var fullTableModel = fromDom$1(tableElm); + return subsection(fullTableModel, firstCell, lastCell).map(function (sectionedTableModel) { + return fromElements([toDom(sectionedTableModel)]); + }); + }).getOrThunk(emptyFragment); + }; + var getSelectionFragment = function (rootNode, ranges) { + return ranges.length > 0 && ranges[0].collapsed ? emptyFragment() : getFragmentFromRange(rootNode, ranges[0]); + }; + var read$1 = function (rootNode, ranges) { + var selectedCells = getCellsFromElementOrRanges(ranges, rootNode); + return selectedCells.length > 0 ? getTableFragment(rootNode, selectedCells) : getSelectionFragment(rootNode, ranges); + }; + + var trimLeadingCollapsibleText = function (text) { + return text.replace(/^[ \f\n\r\t\v]+/, ''); + }; + var isCollapsibleWhitespace = function (text, index) { + return index >= 0 && index < text.length && isWhiteSpace$1(text.charAt(index)); + }; + var getInnerText = function (bin) { + var text = trim$2(bin.innerText); + return Env.browser.isIE() ? trimLeadingCollapsibleText(text) : text; + }; + var getTextContent = function (editor) { + return Optional.from(editor.selection.getRng()).map(function (rng) { + var bin = editor.dom.add(editor.getBody(), 'div', { + 'data-mce-bogus': 'all', + 'style': 'overflow: hidden; opacity: 0;' + }, rng.cloneContents()); + var text = getInnerText(bin); + var nonRenderedText = trim$2(bin.textContent); + editor.dom.remove(bin); + if (isCollapsibleWhitespace(nonRenderedText, 0) || isCollapsibleWhitespace(nonRenderedText, nonRenderedText.length - 1)) { + var parentBlock = editor.dom.getParent(rng.commonAncestorContainer, editor.dom.isBlock); + var parentBlockText = getInnerText(parentBlock); + var textIndex = parentBlockText.indexOf(text); + if (textIndex !== -1) { + var hasProceedingSpace = isCollapsibleWhitespace(parentBlockText, textIndex - 1); + var hasTrailingSpace = isCollapsibleWhitespace(parentBlockText, textIndex + text.length); + return (hasProceedingSpace ? ' ' : '') + text + (hasTrailingSpace ? ' ' : ''); + } else { + return text; + } + } else { + return text; + } + }).getOr(''); + }; + var getSerializedContent = function (editor, args) { + var rng = editor.selection.getRng(), tmpElm = editor.dom.create('body'); + var sel = editor.selection.getSel(); + var ranges = processRanges(editor, getRanges(sel)); + var fragment = args.contextual ? read$1(SugarElement.fromDom(editor.getBody()), ranges).dom : rng.cloneContents(); + if (fragment) { + tmpElm.appendChild(fragment); + } + return editor.selection.serializer.serialize(tmpElm, args); + }; + var getSelectedContentInternal = function (editor, format, args) { + if (args === void 0) { + args = {}; + } + args.get = true; + args.format = format; + args.selection = true; + args = editor.fire('BeforeGetContent', args); + if (args.isDefaultPrevented()) { + editor.fire('GetContent', args); + return args.content; + } + if (args.format === 'text') { + return getTextContent(editor); + } else { + args.getInner = true; + var content = getSerializedContent(editor, args); + if (args.format === 'tree') { + return content; + } else { + args.content = editor.selection.isCollapsed() ? '' : content; + editor.fire('GetContent', args); + return args.content; + } + } + }; + + var KEEP = 0, INSERT = 1, DELETE = 2; + var diff = function (left, right) { + var size = left.length + right.length + 2; + var vDown = new Array(size); + var vUp = new Array(size); + var snake = function (start, end, diag) { + return { + start: start, + end: end, + diag: diag + }; + }; + var buildScript = function (start1, end1, start2, end2, script) { + var middle = getMiddleSnake(start1, end1, start2, end2); + if (middle === null || middle.start === end1 && middle.diag === end1 - end2 || middle.end === start1 && middle.diag === start1 - start2) { + var i = start1; + var j = start2; + while (i < end1 || j < end2) { + if (i < end1 && j < end2 && left[i] === right[j]) { + script.push([ + KEEP, + left[i] + ]); + ++i; + ++j; + } else { + if (end1 - start1 > end2 - start2) { + script.push([ + DELETE, + left[i] + ]); + ++i; + } else { + script.push([ + INSERT, + right[j] + ]); + ++j; + } + } + } + } else { + buildScript(start1, middle.start, start2, middle.start - middle.diag, script); + for (var i2 = middle.start; i2 < middle.end; ++i2) { + script.push([ + KEEP, + left[i2] + ]); + } + buildScript(middle.end, end1, middle.end - middle.diag, end2, script); + } + }; + var buildSnake = function (start, diag, end1, end2) { + var end = start; + while (end - diag < end2 && end < end1 && left[end] === right[end - diag]) { + ++end; + } + return snake(start, end, diag); + }; + var getMiddleSnake = function (start1, end1, start2, end2) { + var m = end1 - start1; + var n = end2 - start2; + if (m === 0 || n === 0) { + return null; + } + var delta = m - n; + var sum = n + m; + var offset = (sum % 2 === 0 ? sum : sum + 1) / 2; + vDown[1 + offset] = start1; + vUp[1 + offset] = end1 + 1; + var d, k, i, x, y; + for (d = 0; d <= offset; ++d) { + for (k = -d; k <= d; k += 2) { + i = k + offset; + if (k === -d || k !== d && vDown[i - 1] < vDown[i + 1]) { + vDown[i] = vDown[i + 1]; + } else { + vDown[i] = vDown[i - 1] + 1; + } + x = vDown[i]; + y = x - start1 + start2 - k; + while (x < end1 && y < end2 && left[x] === right[y]) { + vDown[i] = ++x; + ++y; + } + if (delta % 2 !== 0 && delta - d <= k && k <= delta + d) { + if (vUp[i - delta] <= vDown[i]) { + return buildSnake(vUp[i - delta], k + start1 - start2, end1, end2); + } + } + } + for (k = delta - d; k <= delta + d; k += 2) { + i = k + offset - delta; + if (k === delta - d || k !== delta + d && vUp[i + 1] <= vUp[i - 1]) { + vUp[i] = vUp[i + 1] - 1; + } else { + vUp[i] = vUp[i - 1]; + } + x = vUp[i] - 1; + y = x - start1 + start2 - k; + while (x >= start1 && y >= start2 && left[x] === right[y]) { + vUp[i] = x--; + y--; + } + if (delta % 2 === 0 && -d <= k && k <= d) { + if (vUp[i] <= vDown[i + delta]) { + return buildSnake(vUp[i], k + start1 - start2, end1, end2); + } + } + } + } + }; + var script = []; + buildScript(0, left.length, 0, right.length, script); + return script; + }; + + var getOuterHtml = function (elm) { + if (isElement$1(elm)) { + return elm.outerHTML; + } else if (isText$1(elm)) { + return Entities.encodeRaw(elm.data, false); + } else if (isComment$1(elm)) { + return ''; + } + return ''; + }; + var createFragment$1 = function (html) { + var node; + var container = document.createElement('div'); + var frag = document.createDocumentFragment(); + if (html) { + container.innerHTML = html; + } + while (node = container.firstChild) { + frag.appendChild(node); + } + return frag; + }; + var insertAt = function (elm, html, index) { + var fragment = createFragment$1(html); + if (elm.hasChildNodes() && index < elm.childNodes.length) { + var target = elm.childNodes[index]; + target.parentNode.insertBefore(fragment, target); + } else { + elm.appendChild(fragment); + } + }; + var removeAt = function (elm, index) { + if (elm.hasChildNodes() && index < elm.childNodes.length) { + var target = elm.childNodes[index]; + target.parentNode.removeChild(target); + } + }; + var applyDiff = function (diff, elm) { + var index = 0; + each(diff, function (action) { + if (action[0] === KEEP) { + index++; + } else if (action[0] === INSERT) { + insertAt(elm, action[1], index); + index++; + } else if (action[0] === DELETE) { + removeAt(elm, index); + } + }); + }; + var read$2 = function (elm) { + return filter(map(from$1(elm.childNodes), getOuterHtml), function (item) { + return item.length > 0; + }); + }; + var write = function (fragments, elm) { + var currentFragments = map(from$1(elm.childNodes), getOuterHtml); + applyDiff(diff(currentFragments, fragments), elm); + return elm; + }; + + var undoLevelDocument = Cell(Optional.none()); + var lazyTempDocument = function () { + return undoLevelDocument.get().getOrThunk(function () { + var doc = document.implementation.createHTMLDocument('undo'); + undoLevelDocument.set(Optional.some(doc)); + return doc; + }); + }; + var hasIframes = function (html) { + return html.indexOf('') !== -1; + }; + var createFragmentedLevel = function (fragments) { + return { + type: 'fragmented', + fragments: fragments, + content: '', + bookmark: null, + beforeBookmark: null + }; + }; + var createCompleteLevel = function (content) { + return { + type: 'complete', + fragments: null, + content: content, + bookmark: null, + beforeBookmark: null + }; + }; + var createFromEditor = function (editor) { + var fragments = read$2(editor.getBody()); + var trimmedFragments = bind(fragments, function (html) { + var trimmed = trimInternal(editor.serializer, html); + return trimmed.length > 0 ? [trimmed] : []; + }); + var content = trimmedFragments.join(''); + return hasIframes(content) ? createFragmentedLevel(trimmedFragments) : createCompleteLevel(content); + }; + var applyToEditor = function (editor, level, before) { + if (level.type === 'fragmented') { + write(level.fragments, editor.getBody()); + } else { + editor.setContent(level.content, { format: 'raw' }); + } + editor.selection.moveToBookmark(before ? level.beforeBookmark : level.bookmark); + }; + var getLevelContent = function (level) { + return level.type === 'fragmented' ? level.fragments.join('') : level.content; + }; + var getCleanLevelContent = function (level) { + var elm = SugarElement.fromTag('body', lazyTempDocument()); + set$1(elm, getLevelContent(level)); + each(descendants$1(elm, '*[data-mce-bogus]'), unwrap); + return get$6(elm); + }; + var hasEqualContent = function (level1, level2) { + return getLevelContent(level1) === getLevelContent(level2); + }; + var hasEqualCleanedContent = function (level1, level2) { + return getCleanLevelContent(level1) === getCleanLevelContent(level2); + }; + var isEq$4 = function (level1, level2) { + if (!level1 || !level2) { + return false; + } else if (hasEqualContent(level1, level2)) { + return true; + } else { + return hasEqualCleanedContent(level1, level2); + } + }; + + var isUnlocked = function (locks) { + return locks.get() === 0; + }; + + var setTyping = function (undoManager, typing, locks) { + if (isUnlocked(locks)) { + undoManager.typing = typing; + } + }; + var endTyping = function (undoManager, locks) { + if (undoManager.typing) { + setTyping(undoManager, false, locks); + undoManager.add(); + } + }; + var endTypingLevelIgnoreLocks = function (undoManager) { + if (undoManager.typing) { + undoManager.typing = false; + undoManager.add(); + } + }; + + var beforeChange = function (editor, locks, beforeBookmark) { + if (isUnlocked(locks)) { + beforeBookmark.set(Optional.some(getUndoBookmark(editor.selection))); + } + }; + var addUndoLevel = function (editor, undoManager, index, locks, beforeBookmark, level, event) { + var currentLevel = createFromEditor(editor); + level = level || {}; + level = Tools.extend(level, currentLevel); + if (isUnlocked(locks) === false || editor.removed) { + return null; + } + var lastLevel = undoManager.data[index.get()]; + if (editor.fire('BeforeAddUndo', { + level: level, + lastLevel: lastLevel, + originalEvent: event + }).isDefaultPrevented()) { + return null; + } + if (lastLevel && isEq$4(lastLevel, level)) { + return null; + } + if (undoManager.data[index.get()]) { + beforeBookmark.get().each(function (bm) { + undoManager.data[index.get()].beforeBookmark = bm; + }); + } + var customUndoRedoLevels = getCustomUndoRedoLevels(editor); + if (customUndoRedoLevels) { + if (undoManager.data.length > customUndoRedoLevels) { + for (var i = 0; i < undoManager.data.length - 1; i++) { + undoManager.data[i] = undoManager.data[i + 1]; + } + undoManager.data.length--; + index.set(undoManager.data.length); + } + } + level.bookmark = getUndoBookmark(editor.selection); + if (index.get() < undoManager.data.length - 1) { + undoManager.data.length = index.get() + 1; + } + undoManager.data.push(level); + index.set(undoManager.data.length - 1); + var args = { + level: level, + lastLevel: lastLevel, + originalEvent: event + }; + if (index.get() > 0) { + editor.setDirty(true); + editor.fire('AddUndo', args); + editor.fire('change', args); + } else { + editor.fire('AddUndo', args); + } + return level; + }; + var clear = function (editor, undoManager, index) { + undoManager.data = []; + index.set(0); + undoManager.typing = false; + editor.fire('ClearUndos'); + }; + var extra = function (editor, undoManager, index, callback1, callback2) { + if (undoManager.transact(callback1)) { + var bookmark = undoManager.data[index.get()].bookmark; + var lastLevel = undoManager.data[index.get() - 1]; + applyToEditor(editor, lastLevel, true); + if (undoManager.transact(callback2)) { + undoManager.data[index.get() - 1].beforeBookmark = bookmark; + } + } + }; + var redo = function (editor, index, data) { + var level; + if (index.get() < data.length - 1) { + index.set(index.get() + 1); + level = data[index.get()]; + applyToEditor(editor, level, false); + editor.setDirty(true); + editor.fire('Redo', { level: level }); + } + return level; + }; + var undo = function (editor, undoManager, locks, index) { + var level; + if (undoManager.typing) { + undoManager.add(); + undoManager.typing = false; + setTyping(undoManager, false, locks); + } + if (index.get() > 0) { + index.set(index.get() - 1); + level = undoManager.data[index.get()]; + applyToEditor(editor, level, true); + editor.setDirty(true); + editor.fire('Undo', { level: level }); + } + return level; + }; + var reset = function (undoManager) { + undoManager.clear(); + undoManager.add(); + }; + var hasUndo = function (editor, undoManager, index) { + return index.get() > 0 || undoManager.typing && undoManager.data[0] && !isEq$4(createFromEditor(editor), undoManager.data[0]); + }; + var hasRedo = function (undoManager, index) { + return index.get() < undoManager.data.length - 1 && !undoManager.typing; + }; + var transact = function (undoManager, locks, callback) { + endTyping(undoManager, locks); + undoManager.beforeChange(); + undoManager.ignore(callback); + return undoManager.add(); + }; + var ignore = function (locks, callback) { + try { + locks.set(locks.get() + 1); + callback(); + } finally { + locks.set(locks.get() - 1); + } + }; + + var isTreeNode$1 = function (content) { + return content instanceof AstNode; + }; + var runSerializerFiltersOnFragment = function (editor, fragment) { + filter$3(editor.serializer.getNodeFilters(), editor.serializer.getAttributeFilters(), fragment); + }; + var getInsertContext = function (editor) { + return Optional.from(editor.selection.getStart(true)).map(function (elm) { + return elm.nodeName.toLowerCase(); + }); + }; + var createDummyUndoLevel = function () { + return { + type: 'complete', + fragments: [], + content: '', + bookmark: null, + beforeBookmark: null + }; + }; + var makePlainAdaptor = function (editor) { + return { + undoManager: { + beforeChange: function (locks, beforeBookmark) { + return beforeChange(editor, locks, beforeBookmark); + }, + addUndoLevel: function (undoManager, index, locks, beforeBookmark, level, event) { + return addUndoLevel(editor, undoManager, index, locks, beforeBookmark, level, event); + }, + undo: function (undoManager, locks, index) { + return undo(editor, undoManager, locks, index); + }, + redo: function (index, data) { + return redo(editor, index, data); + }, + clear: function (undoManager, index) { + return clear(editor, undoManager, index); + }, + reset: function (undoManager) { + return reset(undoManager); + }, + hasUndo: function (undoManager, index) { + return hasUndo(editor, undoManager, index); + }, + hasRedo: function (undoManager, index) { + return hasRedo(undoManager, index); + }, + transact: function (undoManager, locks, callback) { + return transact(undoManager, locks, callback); + }, + ignore: function (locks, callback) { + return ignore(locks, callback); + }, + extra: function (undoManager, index, callback1, callback2) { + return extra(editor, undoManager, index, callback1, callback2); + } + }, + formatter: { + apply: function (name, vars, node) { + return applyFormat(editor, name, vars, node); + }, + remove: function (name, vars, node, similar) { + return remove$6(editor, name, vars, node, similar); + }, + toggle: function (name, vars, node) { + return toggle(editor, name, vars, node); + } + }, + editor: { + getContent: function (args, format) { + return getContentInternal(editor, args, format); + }, + setContent: function (content, args) { + return setContentInternal(editor, content, args); + }, + insertContent: function (value, details) { + return insertHtmlAtCaret(editor, value, details); + } + }, + selection: { + getContent: function (format, args) { + return getSelectedContentInternal(editor, format, args); + } + }, + raw: { + getModel: function () { + return Optional.none(); + } + } + }; + }; + var makeRtcAdaptor = function (tinymceEditor, rtcEditor) { + var defaultVars = function (vars) { + return isObject(vars) ? vars : {}; + }; + var unsupported = die('Unimplemented feature for rtc'); + var ignore = noop; + return { + undoManager: { + beforeChange: ignore, + addUndoLevel: unsupported, + undo: function () { + rtcEditor.undo(); + return createDummyUndoLevel(); + }, + redo: function () { + rtcEditor.redo(); + return createDummyUndoLevel(); + }, + clear: unsupported, + reset: unsupported, + hasUndo: function () { + return rtcEditor.hasUndo(); + }, + hasRedo: function () { + return rtcEditor.hasRedo(); + }, + transact: function (_undoManager, _locks, fn) { + rtcEditor.transact(fn); + return createDummyUndoLevel(); + }, + ignore: unsupported, + extra: unsupported + }, + formatter: { + apply: function (name, vars, _node) { + return rtcEditor.applyFormat(name, defaultVars(vars)); + }, + remove: function (name, vars, _node, _similar) { + return rtcEditor.removeFormat(name, defaultVars(vars)); + }, + toggle: function (name, vars, _node) { + return rtcEditor.toggleFormat(name, defaultVars(vars)); + } + }, + editor: { + getContent: function (args, format) { + if (format === 'html' || format === 'tree') { + var fragment = rtcEditor.getContent(); + var serializer = HtmlSerializer({ inner: true }); + runSerializerFiltersOnFragment(tinymceEditor, fragment); + return format === 'tree' ? fragment : serializer.serialize(fragment); + } else { + return makePlainAdaptor(tinymceEditor).editor.getContent(args, format); + } + }, + setContent: function (content, _args) { + var fragment = isTreeNode$1(content) ? content : tinymceEditor.parser.parse(content, { + isRootContent: true, + insert: true + }); + rtcEditor.setContent(fragment); + return content; + }, + insertContent: function (value, _details) { + var contextArgs = getInsertContext(tinymceEditor).fold(function () { + return {}; + }, function (context) { + return { context: context }; + }); + var fragment = isTreeNode$1(value) ? value : tinymceEditor.parser.parse(value, __assign(__assign({}, contextArgs), { insert: true })); + rtcEditor.insertContent(fragment); + } + }, + selection: { + getContent: function (format, args) { + if (format === 'html' || format === 'tree') { + var fragment = rtcEditor.getSelectedContent(); + var serializer = HtmlSerializer({}); + runSerializerFiltersOnFragment(tinymceEditor, fragment); + return format === 'tree' ? fragment : serializer.serialize(fragment); + } else { + return makePlainAdaptor(tinymceEditor).selection.getContent(format, args); + } + } + }, + raw: { + getModel: function () { + return Optional.some(rtcEditor.getRawModel()); + } + } + }; + }; + var isRtc = function (editor) { + return has(editor.plugins, 'rtc'); + }; + var setup$4 = function (editor) { + var editorCast = editor; + return get(editor.plugins, 'rtc').fold(function () { + editorCast.rtcInstance = makePlainAdaptor(editor); + return Optional.none(); + }, function (rtc) { + return Optional.some(rtc.setup().then(function (rtcEditor) { + editorCast.rtcInstance = makeRtcAdaptor(editor, rtcEditor); + return rtcEditor.isRemote; + })); + }); + }; + var getRtcInstanceWithFallback = function (editor) { + return editor.rtcInstance ? editor.rtcInstance : makePlainAdaptor(editor); + }; + var getRtcInstanceWithError = function (editor) { + var rtcInstance = editor.rtcInstance; + if (!rtcInstance) { + throw new Error('Failed to get RTC instance not yet initialized.'); + } else { + return rtcInstance; + } + }; + var beforeChange$1 = function (editor, locks, beforeBookmark) { + getRtcInstanceWithError(editor).undoManager.beforeChange(locks, beforeBookmark); + }; + var addUndoLevel$1 = function (editor, undoManager, index, locks, beforeBookmark, level, event) { + return getRtcInstanceWithError(editor).undoManager.addUndoLevel(undoManager, index, locks, beforeBookmark, level, event); + }; + var undo$1 = function (editor, undoManager, locks, index) { + return getRtcInstanceWithError(editor).undoManager.undo(undoManager, locks, index); + }; + var redo$1 = function (editor, index, data) { + return getRtcInstanceWithError(editor).undoManager.redo(index, data); + }; + var clear$1 = function (editor, undoManager, index) { + getRtcInstanceWithError(editor).undoManager.clear(undoManager, index); + }; + var reset$1 = function (editor, undoManager) { + getRtcInstanceWithError(editor).undoManager.reset(undoManager); + }; + var hasUndo$1 = function (editor, undoManager, index) { + return getRtcInstanceWithError(editor).undoManager.hasUndo(undoManager, index); + }; + var hasRedo$1 = function (editor, undoManager, index) { + return getRtcInstanceWithError(editor).undoManager.hasRedo(undoManager, index); + }; + var transact$1 = function (editor, undoManager, locks, callback) { + return getRtcInstanceWithError(editor).undoManager.transact(undoManager, locks, callback); + }; + var ignore$1 = function (editor, locks, callback) { + getRtcInstanceWithError(editor).undoManager.ignore(locks, callback); + }; + var extra$1 = function (editor, undoManager, index, callback1, callback2) { + getRtcInstanceWithError(editor).undoManager.extra(undoManager, index, callback1, callback2); + }; + var applyFormat$1 = function (editor, name, vars, node) { + getRtcInstanceWithError(editor).formatter.apply(name, vars, node); + }; + var removeFormat$1 = function (editor, name, vars, node, similar) { + getRtcInstanceWithError(editor).formatter.remove(name, vars, node, similar); + }; + var toggleFormat = function (editor, name, vars, node) { + getRtcInstanceWithError(editor).formatter.toggle(name, vars, node); + }; + var getContent = function (editor, args, format) { + return getRtcInstanceWithFallback(editor).editor.getContent(args, format); + }; + var setContent = function (editor, content, args) { + return getRtcInstanceWithFallback(editor).editor.setContent(content, args); + }; + var insertContent = function (editor, value, details) { + return getRtcInstanceWithFallback(editor).editor.insertContent(value, details); + }; + var getSelectedContent = function (editor, format, args) { + return getRtcInstanceWithError(editor).selection.getContent(format, args); + }; + + var getContent$1 = function (editor, args) { + if (args === void 0) { + args = {}; + } + var format = args.format ? args.format : 'html'; + return getSelectedContent(editor, format, args); + }; + + var removeEmpty = function (text) { + if (text.dom.length === 0) { + remove(text); + return Optional.none(); + } else { + return Optional.some(text); + } + }; + var walkPastBookmark = function (node, start) { + return node.filter(function (elm) { + return BookmarkManager$1.isBookmarkNode(elm.dom); + }).bind(start ? nextSibling : prevSibling); + }; + var merge = function (outer, inner, rng, start) { + var outerElm = outer.dom; + var innerElm = inner.dom; + var oldLength = start ? outerElm.length : innerElm.length; + if (start) { + mergeTextNodes(outerElm, innerElm, false, !start); + rng.setStart(innerElm, oldLength); + } else { + mergeTextNodes(innerElm, outerElm, false, !start); + rng.setEnd(innerElm, oldLength); + } + }; + var normalizeTextIfRequired = function (inner, start) { + parent(inner).each(function (root) { + var text = inner.dom; + if (start && needsToBeNbspLeft(root, CaretPosition$1(text, 0))) { + normalizeWhitespaceAfter(text, 0); + } else if (!start && needsToBeNbspRight(root, CaretPosition$1(text, text.length))) { + normalizeWhitespaceBefore(text, text.length); + } + }); + }; + var mergeAndNormalizeText = function (outerNode, innerNode, rng, start) { + outerNode.bind(function (outer) { + var normalizer = start ? normalizeWhitespaceBefore : normalizeWhitespaceAfter; + normalizer(outer.dom, start ? outer.dom.length : 0); + return innerNode.filter(isText).map(function (inner) { + return merge(outer, inner, rng, start); + }); + }).orThunk(function () { + var innerTextNode = walkPastBookmark(innerNode, start).or(innerNode).filter(isText); + return innerTextNode.map(function (inner) { + return normalizeTextIfRequired(inner, start); + }); + }); + }; + var rngSetContent = function (rng, fragment) { + var firstChild = Optional.from(fragment.firstChild).map(SugarElement.fromDom); + var lastChild = Optional.from(fragment.lastChild).map(SugarElement.fromDom); + rng.deleteContents(); + rng.insertNode(fragment); + var prevText = firstChild.bind(prevSibling).filter(isText).bind(removeEmpty); + var nextText = lastChild.bind(nextSibling).filter(isText).bind(removeEmpty); + mergeAndNormalizeText(prevText, firstChild, rng, true); + mergeAndNormalizeText(nextText, lastChild, rng, false); + rng.collapse(false); + }; + var setupArgs = function (args, content) { + return __assign(__assign({ format: 'html' }, args), { + set: true, + selection: true, + content: content + }); + }; + var cleanContent = function (editor, args) { + if (args.format !== 'raw') { + var rng = editor.selection.getRng(); + var contextBlock = editor.dom.getParent(rng.commonAncestorContainer, editor.dom.isBlock); + var contextArgs = contextBlock ? { context: contextBlock.nodeName.toLowerCase() } : {}; + var node = editor.parser.parse(args.content, __assign(__assign({ + isRootContent: true, + forced_root_block: false + }, contextArgs), args)); + return HtmlSerializer({ validate: editor.validate }, editor.schema).serialize(node); + } else { + return args.content; + } + }; + var setContent$1 = function (editor, content, args) { + if (args === void 0) { + args = {}; + } + var contentArgs = setupArgs(args, content); + if (!contentArgs.no_events) { + contentArgs = editor.fire('BeforeSetContent', contentArgs); + if (contentArgs.isDefaultPrevented()) { + editor.fire('SetContent', contentArgs); + return; + } + } + args.content = cleanContent(editor, contentArgs); + var rng = editor.selection.getRng(); + rngSetContent(rng, rng.createContextualFragment(args.content)); + editor.selection.setRng(rng); + scrollRangeIntoView(editor, rng); + if (!contentArgs.no_events) { + editor.fire('SetContent', contentArgs); + } + }; + + var deleteFromCallbackMap = function (callbackMap, selector, callback) { + if (callbackMap && callbackMap.hasOwnProperty(selector)) { + var newCallbacks = filter(callbackMap[selector], function (cb) { + return cb !== callback; + }); + if (newCallbacks.length === 0) { + delete callbackMap[selector]; + } else { + callbackMap[selector] = newCallbacks; + } + } + }; + function SelectorChanged (dom, editor) { + var selectorChangedData; + var currentSelectors; + return { + selectorChangedWithUnbind: function (selector, callback) { + if (!selectorChangedData) { + selectorChangedData = {}; + currentSelectors = {}; + editor.on('NodeChange', function (e) { + var node = e.element, parents = dom.getParents(node, null, dom.getRoot()), matchedSelectors = {}; + Tools.each(selectorChangedData, function (callbacks, selector) { + Tools.each(parents, function (node) { + if (dom.is(node, selector)) { + if (!currentSelectors[selector]) { + Tools.each(callbacks, function (callback) { + callback(true, { + node: node, + selector: selector, + parents: parents + }); + }); + currentSelectors[selector] = callbacks; + } + matchedSelectors[selector] = callbacks; + return false; + } + }); + }); + Tools.each(currentSelectors, function (callbacks, selector) { + if (!matchedSelectors[selector]) { + delete currentSelectors[selector]; + Tools.each(callbacks, function (callback) { + callback(false, { + node: node, + selector: selector, + parents: parents + }); + }); + } + }); + }); + } + if (!selectorChangedData[selector]) { + selectorChangedData[selector] = []; + } + selectorChangedData[selector].push(callback); + return { + unbind: function () { + deleteFromCallbackMap(selectorChangedData, selector, callback); + deleteFromCallbackMap(currentSelectors, selector, callback); + } + }; + } + }; + } + + var isNativeIeSelection = function (rng) { + return !!rng.select; + }; + var isAttachedToDom = function (node) { + return !!(node && node.ownerDocument) && contains$2(SugarElement.fromDom(node.ownerDocument), SugarElement.fromDom(node)); + }; + var isValidRange = function (rng) { + if (!rng) { + return false; + } else if (isNativeIeSelection(rng)) { + return true; + } else { + return isAttachedToDom(rng.startContainer) && isAttachedToDom(rng.endContainer); + } + }; + var EditorSelection = function (dom, win, serializer, editor) { + var selectedRange; + var explicitRange; + var selectorChangedWithUnbind = SelectorChanged(dom, editor).selectorChangedWithUnbind; + var setCursorLocation = function (node, offset) { + var rng = dom.createRng(); + if (!node) { + moveEndPoint$1(dom, rng, editor.getBody(), true); + setRng(rng); + } else { + rng.setStart(node, offset); + rng.setEnd(node, offset); + setRng(rng); + collapse(false); + } + }; + var getContent = function (args) { + return getContent$1(editor, args); + }; + var setContent = function (content, args) { + return setContent$1(editor, content, args); + }; + var getStart = function (real) { + return getStart$2(editor.getBody(), getRng$1(), real); + }; + var getEnd$1 = function (real) { + return getEnd(editor.getBody(), getRng$1(), real); + }; + var getBookmark = function (type, normalized) { + return bookmarkManager.getBookmark(type, normalized); + }; + var moveToBookmark = function (bookmark) { + return bookmarkManager.moveToBookmark(bookmark); + }; + var select = function (node, content) { + select$1(dom, node, content).each(setRng); + return node; + }; + var isCollapsed = function () { + var rng = getRng$1(), sel = getSel(); + if (!rng || rng.item) { + return false; + } + if (rng.compareEndPoints) { + return rng.compareEndPoints('StartToEnd', rng) === 0; + } + return !sel || rng.collapsed; + }; + var collapse = function (toStart) { + var rng = getRng$1(); + rng.collapse(!!toStart); + setRng(rng); + }; + var getSel = function () { + return win.getSelection ? win.getSelection() : win.document.selection; + }; + var getRng$1 = function () { + var selection, rng, elm; + var tryCompareBoundaryPoints = function (how, sourceRange, destinationRange) { + try { + return sourceRange.compareBoundaryPoints(how, destinationRange); + } catch (ex) { + return -1; + } + }; + if (!win) { + return null; + } + var doc = win.document; + if (typeof doc === 'undefined' || doc === null) { + return null; + } + if (editor.bookmark !== undefined && hasFocus$1(editor) === false) { + var bookmark = getRng(editor); + if (bookmark.isSome()) { + return bookmark.map(function (r) { + return processRanges(editor, [r])[0]; + }).getOr(doc.createRange()); + } + } + try { + if ((selection = getSel()) && !isRestrictedNode(selection.anchorNode)) { + if (selection.rangeCount > 0) { + rng = selection.getRangeAt(0); + } else { + rng = selection.createRange ? selection.createRange() : doc.createRange(); + } + rng = processRanges(editor, [rng])[0]; + } + } catch (ex) { + } + if (!rng) { + rng = doc.createRange ? doc.createRange() : doc.body.createTextRange(); + } + if (rng.setStart && rng.startContainer.nodeType === 9 && rng.collapsed) { + elm = dom.getRoot(); + rng.setStart(elm, 0); + rng.setEnd(elm, 0); + } + if (selectedRange && explicitRange) { + if (tryCompareBoundaryPoints(rng.START_TO_START, rng, selectedRange) === 0 && tryCompareBoundaryPoints(rng.END_TO_END, rng, selectedRange) === 0) { + rng = explicitRange; + } else { + selectedRange = null; + explicitRange = null; + } + } + return rng; + }; + var setRng = function (rng, forward) { + var node; + if (!isValidRange(rng)) { + return; + } + var ieRange = isNativeIeSelection(rng) ? rng : null; + if (ieRange) { + explicitRange = null; + try { + ieRange.select(); + } catch (ex) { + } + return; + } + var sel = getSel(); + var evt = editor.fire('SetSelectionRange', { + range: rng, + forward: forward + }); + rng = evt.range; + if (sel) { + explicitRange = rng; + try { + sel.removeAllRanges(); + sel.addRange(rng); + } catch (ex) { + } + if (forward === false && sel.extend) { + sel.collapse(rng.endContainer, rng.endOffset); + sel.extend(rng.startContainer, rng.startOffset); + } + selectedRange = sel.rangeCount > 0 ? sel.getRangeAt(0) : null; + } + if (!rng.collapsed && rng.startContainer === rng.endContainer && sel.setBaseAndExtent && !Env.ie) { + if (rng.endOffset - rng.startOffset < 2) { + if (rng.startContainer.hasChildNodes()) { + node = rng.startContainer.childNodes[rng.startOffset]; + if (node && node.tagName === 'IMG') { + sel.setBaseAndExtent(rng.startContainer, rng.startOffset, rng.endContainer, rng.endOffset); + if (sel.anchorNode !== rng.startContainer || sel.focusNode !== rng.endContainer) { + sel.setBaseAndExtent(node, 0, node, 1); + } + } + } + } + } + editor.fire('AfterSetSelectionRange', { + range: rng, + forward: forward + }); + }; + var setNode = function (elm) { + setContent(dom.getOuterHTML(elm)); + return elm; + }; + var getNode = function () { + return getNode$1(editor.getBody(), getRng$1()); + }; + var getSelectedBlocks$1 = function (startElm, endElm) { + return getSelectedBlocks(dom, getRng$1(), startElm, endElm); + }; + var isForward = function () { + var sel = getSel(); + var anchorNode = sel === null || sel === void 0 ? void 0 : sel.anchorNode; + var focusNode = sel === null || sel === void 0 ? void 0 : sel.focusNode; + if (!sel || !anchorNode || !focusNode || isRestrictedNode(anchorNode) || isRestrictedNode(focusNode)) { + return true; + } + var anchorRange = dom.createRng(); + anchorRange.setStart(anchorNode, sel.anchorOffset); + anchorRange.collapse(true); + var focusRange = dom.createRng(); + focusRange.setStart(focusNode, sel.focusOffset); + focusRange.collapse(true); + return anchorRange.compareBoundaryPoints(anchorRange.START_TO_START, focusRange) <= 0; + }; + var normalize$1 = function () { + var rng = getRng$1(); + var sel = getSel(); + if (!hasMultipleRanges(sel) && hasAnyRanges(editor)) { + var normRng = normalize(dom, rng); + normRng.each(function (normRng) { + setRng(normRng, isForward()); + }); + return normRng.getOr(rng); + } + return rng; + }; + var selectorChanged = function (selector, callback) { + selectorChangedWithUnbind(selector, callback); + return exports; + }; + var getScrollContainer = function () { + var scrollContainer; + var node = dom.getRoot(); + while (node && node.nodeName !== 'BODY') { + if (node.scrollHeight > node.clientHeight) { + scrollContainer = node; + break; + } + node = node.parentNode; + } + return scrollContainer; + }; + var scrollIntoView = function (elm, alignToTop) { + return scrollElementIntoView(editor, elm, alignToTop); + }; + var placeCaretAt = function (clientX, clientY) { + return setRng(fromPoint$1(clientX, clientY, editor.getDoc())); + }; + var getBoundingClientRect = function () { + var rng = getRng$1(); + return rng.collapsed ? CaretPosition$1.fromRangeStart(rng).getClientRects()[0] : rng.getBoundingClientRect(); + }; + var destroy = function () { + win = selectedRange = explicitRange = null; + controlSelection.destroy(); + }; + var exports = { + bookmarkManager: null, + controlSelection: null, + dom: dom, + win: win, + serializer: serializer, + editor: editor, + collapse: collapse, + setCursorLocation: setCursorLocation, + getContent: getContent, + setContent: setContent, + getBookmark: getBookmark, + moveToBookmark: moveToBookmark, + select: select, + isCollapsed: isCollapsed, + isForward: isForward, + setNode: setNode, + getNode: getNode, + getSel: getSel, + setRng: setRng, + getRng: getRng$1, + getStart: getStart, + getEnd: getEnd$1, + getSelectedBlocks: getSelectedBlocks$1, + normalize: normalize$1, + selectorChanged: selectorChanged, + selectorChangedWithUnbind: selectorChangedWithUnbind, + getScrollContainer: getScrollContainer, + scrollIntoView: scrollIntoView, + placeCaretAt: placeCaretAt, + getBoundingClientRect: getBoundingClientRect, + destroy: destroy + }; + var bookmarkManager = BookmarkManager$1(exports); + var controlSelection = ControlSelection(exports, editor); + exports.bookmarkManager = bookmarkManager; + exports.controlSelection = controlSelection; + return exports; + }; + + var removeAttrs = function (node, names) { + each(names, function (name) { + node.attr(name, null); + }); + }; + var addFontToSpansFilter = function (domParser, styles, fontSizes) { + domParser.addNodeFilter('font', function (nodes) { + each(nodes, function (node) { + var props = styles.parse(node.attr('style')); + var color = node.attr('color'); + var face = node.attr('face'); + var size = node.attr('size'); + if (color) { + props.color = color; + } + if (face) { + props['font-family'] = face; + } + if (size) { + props['font-size'] = fontSizes[parseInt(node.attr('size'), 10) - 1]; + } + node.name = 'span'; + node.attr('style', styles.serialize(props)); + removeAttrs(node, [ + 'color', + 'face', + 'size' + ]); + }); + }); + }; + var addStrikeToSpanFilter = function (domParser, styles) { + domParser.addNodeFilter('strike', function (nodes) { + each(nodes, function (node) { + var props = styles.parse(node.attr('style')); + props['text-decoration'] = 'line-through'; + node.name = 'span'; + node.attr('style', styles.serialize(props)); + }); + }); + }; + var addFilters = function (domParser, settings) { + var styles = Styles(); + if (settings.convert_fonts_to_spans) { + addFontToSpansFilter(domParser, styles, Tools.explode(settings.font_size_legacy_values)); + } + addStrikeToSpanFilter(domParser, styles); + }; + var register$1 = function (domParser, settings) { + if (settings.inline_styles) { + addFilters(domParser, settings); + } + }; + + var blobUriToBlob = function (url) { + return new promiseObj(function (resolve, reject) { + var rejectWithError = function () { + reject('Cannot convert ' + url + ' to Blob. Resource might not exist or is inaccessible.'); + }; + try { + var xhr = new XMLHttpRequest(); + xhr.open('GET', url, true); + xhr.responseType = 'blob'; + xhr.onload = function () { + if (this.status === 200) { + resolve(this.response); + } else { + rejectWithError(); + } + }; + xhr.onerror = rejectWithError; + xhr.send(); + } catch (ex) { + rejectWithError(); + } + }); + }; + var parseDataUri$1 = function (uri) { + var type; + var uriParts = decodeURIComponent(uri).split(','); + var matches = /data:([^;]+)/.exec(uriParts[0]); + if (matches) { + type = matches[1]; + } + return { + type: type, + data: uriParts[1] + }; + }; + var buildBlob = function (type, data) { + var str; + try { + str = atob(data); + } catch (e) { + return Optional.none(); + } + var arr = new Uint8Array(str.length); + for (var i = 0; i < arr.length; i++) { + arr[i] = str.charCodeAt(i); + } + return Optional.some(new Blob([arr], { type: type })); + }; + var dataUriToBlob = function (uri) { + return new promiseObj(function (resolve) { + var _a = parseDataUri$1(uri), type = _a.type, data = _a.data; + buildBlob(type, data).fold(function () { + return resolve(new Blob([])); + }, resolve); + }); + }; + var uriToBlob = function (url) { + if (url.indexOf('blob:') === 0) { + return blobUriToBlob(url); + } + if (url.indexOf('data:') === 0) { + return dataUriToBlob(url); + } + return null; + }; + var blobToDataUri = function (blob) { + return new promiseObj(function (resolve) { + var reader = new FileReader(); + reader.onloadend = function () { + resolve(reader.result); + }; + reader.readAsDataURL(blob); + }); + }; + + var count = 0; + var uniqueId = function (prefix) { + return (prefix || 'blobid') + count++; + }; + var imageToBlobInfo = function (blobCache, img, resolve, reject) { + var base64, blobInfo; + if (img.src.indexOf('blob:') === 0) { + blobInfo = blobCache.getByUri(img.src); + if (blobInfo) { + resolve({ + image: img, + blobInfo: blobInfo + }); + } else { + uriToBlob(img.src).then(function (blob) { + blobToDataUri(blob).then(function (dataUri) { + base64 = parseDataUri$1(dataUri).data; + blobInfo = blobCache.create(uniqueId(), blob, base64); + blobCache.add(blobInfo); + resolve({ + image: img, + blobInfo: blobInfo + }); + }); + }, function (err) { + reject(err); + }); + } + return; + } + var _a = parseDataUri$1(img.src), data = _a.data, type = _a.type; + base64 = data; + blobInfo = blobCache.getByData(base64, type); + if (blobInfo) { + resolve({ + image: img, + blobInfo: blobInfo + }); + } else { + uriToBlob(img.src).then(function (blob) { + blobInfo = blobCache.create(uniqueId(), blob, base64); + blobCache.add(blobInfo); + resolve({ + image: img, + blobInfo: blobInfo + }); + }, function (err) { + reject(err); + }); + } + }; + var getAllImages = function (elm) { + return elm ? from$1(elm.getElementsByTagName('img')) : []; + }; + function ImageScanner(uploadStatus, blobCache) { + var cachedPromises = {}; + var findAll = function (elm, predicate) { + if (!predicate) { + predicate = always; + } + var images = filter(getAllImages(elm), function (img) { + var src = img.src; + if (!Env.fileApi) { + return false; + } + if (img.hasAttribute('data-mce-bogus')) { + return false; + } + if (img.hasAttribute('data-mce-placeholder')) { + return false; + } + if (!src || src === Env.transparentSrc) { + return false; + } + if (src.indexOf('blob:') === 0) { + return !uploadStatus.isUploaded(src) && predicate(img); + } + if (src.indexOf('data:') === 0) { + return predicate(img); + } + return false; + }); + var promises = map(images, function (img) { + if (cachedPromises[img.src] !== undefined) { + return new promiseObj(function (resolve) { + cachedPromises[img.src].then(function (imageInfo) { + if (typeof imageInfo === 'string') { + return imageInfo; + } + resolve({ + image: img, + blobInfo: imageInfo.blobInfo + }); + }); + }); + } + var newPromise = new promiseObj(function (resolve, reject) { + imageToBlobInfo(blobCache, img, resolve, reject); + }).then(function (result) { + delete cachedPromises[result.image.src]; + return result; + }).catch(function (error) { + delete cachedPromises[img.src]; + return error; + }); + cachedPromises[img.src] = newPromise; + return newPromise; + }); + return promiseObj.all(promises); + }; + return { findAll: findAll }; + } + + var paddEmptyNode = function (settings, args, blockElements, node) { + var brPreferred = settings.padd_empty_with_br || args.insert; + if (brPreferred && blockElements[node.name]) { + node.empty().append(new AstNode('br', 1)).shortEnded = true; + } else { + node.empty().append(new AstNode('#text', 3)).value = nbsp; + } + }; + var isPaddedWithNbsp = function (node) { + return hasOnlyChild(node, '#text') && node.firstChild.value === nbsp; + }; + var hasOnlyChild = function (node, name) { + return node && node.firstChild && node.firstChild === node.lastChild && node.firstChild.name === name; + }; + var isPadded = function (schema, node) { + var rule = schema.getElementRule(node.name); + return rule && rule.paddEmpty; + }; + var isEmpty$2 = function (schema, nonEmptyElements, whitespaceElements, node) { + return node.isEmpty(nonEmptyElements, whitespaceElements, function (node) { + return isPadded(schema, node); + }); + }; + var isLineBreakNode = function (node, blockElements) { + return node && (blockElements[node.name] || node.name === 'br'); + }; + + var isBogusImage = function (img) { + return img.attr('data-mce-bogus'); + }; + var isInternalImageSource = function (img) { + return img.attr('src') === Env.transparentSrc || img.attr('data-mce-placeholder'); + }; + var isValidDataImg = function (img, settings) { + if (settings.images_dataimg_filter) { + var imgElem_1 = new Image(); + imgElem_1.src = img.attr('src'); + each$1(img.attributes.map, function (value, key) { + imgElem_1.setAttribute(key, value); + }); + return settings.images_dataimg_filter(imgElem_1); + } else { + return true; + } + }; + var registerBase64ImageFilter = function (parser, settings) { + var blobCache = settings.blob_cache; + var processImage = function (img) { + var inputSrc = img.attr('src'); + if (isInternalImageSource(img) || isBogusImage(img)) { + return; + } + parseDataUri(inputSrc).filter(function () { + return isValidDataImg(img, settings); + }).bind(function (_a) { + var type = _a.type, data = _a.data; + return Optional.from(blobCache.getByData(data, type)).orThunk(function () { + return buildBlob(type, data).map(function (blob) { + var blobInfo = blobCache.create(uniqueId(), blob, data); + blobCache.add(blobInfo); + return blobInfo; + }); + }); + }).each(function (blobInfo) { + img.attr('src', blobInfo.blobUri()); + }); + }; + if (blobCache) { + parser.addAttributeFilter('src', function (nodes) { + return each(nodes, processImage); + }); + } + }; + var register$2 = function (parser, settings) { + var schema = parser.schema; + if (settings.remove_trailing_brs) { + parser.addNodeFilter('br', function (nodes, _, args) { + var i; + var l = nodes.length; + var node; + var blockElements = Tools.extend({}, schema.getBlockElements()); + var nonEmptyElements = schema.getNonEmptyElements(); + var parent, lastParent, prev, prevName; + var whiteSpaceElements = schema.getWhiteSpaceElements(); + var elementRule, textNode; + blockElements.body = 1; + for (i = 0; i < l; i++) { + node = nodes[i]; + parent = node.parent; + if (blockElements[node.parent.name] && node === parent.lastChild) { + prev = node.prev; + while (prev) { + prevName = prev.name; + if (prevName !== 'span' || prev.attr('data-mce-type') !== 'bookmark') { + if (prevName === 'br') { + node = null; + } + break; + } + prev = prev.prev; + } + if (node) { + node.remove(); + if (isEmpty$2(schema, nonEmptyElements, whiteSpaceElements, parent)) { + elementRule = schema.getElementRule(parent.name); + if (elementRule) { + if (elementRule.removeEmpty) { + parent.remove(); + } else if (elementRule.paddEmpty) { + paddEmptyNode(settings, args, blockElements, parent); + } + } + } + } + } else { + lastParent = node; + while (parent && parent.firstChild === lastParent && parent.lastChild === lastParent) { + lastParent = parent; + if (blockElements[parent.name]) { + break; + } + parent = parent.parent; + } + if (lastParent === parent && settings.padd_empty_with_br !== true) { + textNode = new AstNode('#text', 3); + textNode.value = nbsp; + node.replace(textNode); + } + } + } + }); + } + parser.addAttributeFilter('href', function (nodes) { + var i = nodes.length; + var appendRel = function (rel) { + var parts = rel.split(' ').filter(function (p) { + return p.length > 0; + }); + return parts.concat(['noopener']).sort().join(' '); + }; + var addNoOpener = function (rel) { + var newRel = rel ? Tools.trim(rel) : ''; + if (!/\b(noopener)\b/g.test(newRel)) { + return appendRel(newRel); + } else { + return newRel; + } + }; + if (!settings.allow_unsafe_link_target) { + while (i--) { + var node = nodes[i]; + if (node.name === 'a' && node.attr('target') === '_blank') { + node.attr('rel', addNoOpener(node.attr('rel'))); + } + } + } + }); + if (!settings.allow_html_in_named_anchor) { + parser.addAttributeFilter('id,name', function (nodes) { + var i = nodes.length, sibling, prevSibling, parent, node; + while (i--) { + node = nodes[i]; + if (node.name === 'a' && node.firstChild && !node.attr('href')) { + parent = node.parent; + sibling = node.lastChild; + do { + prevSibling = sibling.prev; + parent.insert(sibling, node); + sibling = prevSibling; + } while (sibling); + } + } + }); + } + if (settings.fix_list_elements) { + parser.addNodeFilter('ul,ol', function (nodes) { + var i = nodes.length, node, parentNode; + while (i--) { + node = nodes[i]; + parentNode = node.parent; + if (parentNode.name === 'ul' || parentNode.name === 'ol') { + if (node.prev && node.prev.name === 'li') { + node.prev.append(node); + } else { + var li = new AstNode('li', 1); + li.attr('style', 'list-style-type: none'); + node.wrap(li); + } + } + } + }); + } + if (settings.validate && schema.getValidClasses()) { + parser.addAttributeFilter('class', function (nodes) { + var i = nodes.length, node, classList, ci, className, classValue; + var validClasses = schema.getValidClasses(); + var validClassesMap, valid; + while (i--) { + node = nodes[i]; + classList = node.attr('class').split(' '); + classValue = ''; + for (ci = 0; ci < classList.length; ci++) { + className = classList[ci]; + valid = false; + validClassesMap = validClasses['*']; + if (validClassesMap && validClassesMap[className]) { + valid = true; + } + validClassesMap = validClasses[node.name]; + if (!valid && validClassesMap && validClassesMap[className]) { + valid = true; + } + if (valid) { + if (classValue) { + classValue += ' '; + } + classValue += className; + } + } + if (!classValue.length) { + classValue = null; + } + node.attr('class', classValue); + } + }); + } + registerBase64ImageFilter(parser, settings); + }; + + var makeMap$4 = Tools.makeMap, each$d = Tools.each, explode$2 = Tools.explode, extend$2 = Tools.extend; + var DomParser = function (settings, schema) { + if (schema === void 0) { + schema = Schema(); + } + var nodeFilters = {}; + var attributeFilters = []; + var matchedNodes = {}; + var matchedAttributes = {}; + settings = settings || {}; + settings.validate = 'validate' in settings ? settings.validate : true; + settings.root_name = settings.root_name || 'body'; + var fixInvalidChildren = function (nodes) { + var ni, node, parent, parents, newParent, currentNode, tempNode, childNode, i; + var sibling, nextNode; + var nonSplitableElements = makeMap$4('tr,td,th,tbody,thead,tfoot,table'); + var nonEmptyElements = schema.getNonEmptyElements(); + var whitespaceElements = schema.getWhiteSpaceElements(); + var textBlockElements = schema.getTextBlockElements(); + var specialElements = schema.getSpecialElements(); + for (ni = 0; ni < nodes.length; ni++) { + node = nodes[ni]; + if (!node.parent || node.fixed) { + continue; + } + if (textBlockElements[node.name] && node.parent.name === 'li') { + sibling = node.next; + while (sibling) { + if (textBlockElements[sibling.name]) { + sibling.name = 'li'; + sibling.fixed = true; + node.parent.insert(sibling, node.parent); + } else { + break; + } + sibling = sibling.next; + } + node.unwrap(node); + continue; + } + parents = [node]; + for (parent = node.parent; parent && !schema.isValidChild(parent.name, node.name) && !nonSplitableElements[parent.name]; parent = parent.parent) { + parents.push(parent); + } + if (parent && parents.length > 1) { + parents.reverse(); + newParent = currentNode = filterNode(parents[0].clone()); + for (i = 0; i < parents.length - 1; i++) { + if (schema.isValidChild(currentNode.name, parents[i].name)) { + tempNode = filterNode(parents[i].clone()); + currentNode.append(tempNode); + } else { + tempNode = currentNode; + } + for (childNode = parents[i].firstChild; childNode && childNode !== parents[i + 1];) { + nextNode = childNode.next; + tempNode.append(childNode); + childNode = nextNode; + } + currentNode = tempNode; + } + if (!isEmpty$2(schema, nonEmptyElements, whitespaceElements, newParent)) { + parent.insert(newParent, parents[0], true); + parent.insert(node, newParent); + } else { + parent.insert(node, parents[0], true); + } + parent = parents[0]; + if (isEmpty$2(schema, nonEmptyElements, whitespaceElements, parent) || hasOnlyChild(parent, 'br')) { + parent.empty().remove(); + } + } else if (node.parent) { + if (node.name === 'li') { + sibling = node.prev; + if (sibling && (sibling.name === 'ul' || sibling.name === 'ol')) { + sibling.append(node); + continue; + } + sibling = node.next; + if (sibling && (sibling.name === 'ul' || sibling.name === 'ol')) { + sibling.insert(node, sibling.firstChild, true); + continue; + } + node.wrap(filterNode(new AstNode('ul', 1))); + continue; + } + if (schema.isValidChild(node.parent.name, 'div') && schema.isValidChild('div', node.name)) { + node.wrap(filterNode(new AstNode('div', 1))); + } else { + if (specialElements[node.name]) { + node.empty().remove(); + } else { + node.unwrap(); + } + } + } + } + }; + var filterNode = function (node) { + var i, name, list; + name = node.name; + if (name in nodeFilters) { + list = matchedNodes[name]; + if (list) { + list.push(node); + } else { + matchedNodes[name] = [node]; + } + } + i = attributeFilters.length; + while (i--) { + name = attributeFilters[i].name; + if (name in node.attributes.map) { + list = matchedAttributes[name]; + if (list) { + list.push(node); + } else { + matchedAttributes[name] = [node]; + } + } + } + return node; + }; + var addNodeFilter = function (name, callback) { + each$d(explode$2(name), function (name) { + var list = nodeFilters[name]; + if (!list) { + nodeFilters[name] = list = []; + } + list.push(callback); + }); + }; + var getNodeFilters = function () { + var out = []; + for (var name_1 in nodeFilters) { + if (nodeFilters.hasOwnProperty(name_1)) { + out.push({ + name: name_1, + callbacks: nodeFilters[name_1] + }); + } + } + return out; + }; + var addAttributeFilter = function (name, callback) { + each$d(explode$2(name), function (name) { + var i; + for (i = 0; i < attributeFilters.length; i++) { + if (attributeFilters[i].name === name) { + attributeFilters[i].callbacks.push(callback); + return; + } + } + attributeFilters.push({ + name: name, + callbacks: [callback] + }); + }); + }; + var getAttributeFilters = function () { + return [].concat(attributeFilters); + }; + var parse = function (html, args) { + var nodes, i, l, fi, fl, list, name; + var invalidChildren = []; + var isInWhiteSpacePreservedElement; + var node; + var getRootBlockName = function (name) { + if (name === false) { + return ''; + } else if (name === true) { + return 'p'; + } else { + return name; + } + }; + args = args || {}; + matchedNodes = {}; + matchedAttributes = {}; + var blockElements = extend$2(makeMap$4('script,style,head,html,body,title,meta,param'), schema.getBlockElements()); + var nonEmptyElements = schema.getNonEmptyElements(); + var children = schema.children; + var validate = settings.validate; + var forcedRootBlockName = 'forced_root_block' in args ? args.forced_root_block : settings.forced_root_block; + var rootBlockName = getRootBlockName(forcedRootBlockName); + var whiteSpaceElements = schema.getWhiteSpaceElements(); + var startWhiteSpaceRegExp = /^[ \t\r\n]+/; + var endWhiteSpaceRegExp = /[ \t\r\n]+$/; + var allWhiteSpaceRegExp = /[ \t\r\n]+/g; + var isAllWhiteSpaceRegExp = /^[ \t\r\n]+$/; + isInWhiteSpacePreservedElement = whiteSpaceElements.hasOwnProperty(args.context) || whiteSpaceElements.hasOwnProperty(settings.root_name); + var addRootBlocks = function () { + var node = rootNode.firstChild, next, rootBlockNode; + var trim = function (rootBlockNode) { + if (rootBlockNode) { + node = rootBlockNode.firstChild; + if (node && node.type === 3) { + node.value = node.value.replace(startWhiteSpaceRegExp, ''); + } + node = rootBlockNode.lastChild; + if (node && node.type === 3) { + node.value = node.value.replace(endWhiteSpaceRegExp, ''); + } + } + }; + if (!schema.isValidChild(rootNode.name, rootBlockName.toLowerCase())) { + return; + } + while (node) { + next = node.next; + if (node.type === 3 || node.type === 1 && node.name !== 'p' && !blockElements[node.name] && !node.attr('data-mce-type')) { + if (!rootBlockNode) { + rootBlockNode = createNode(rootBlockName, 1); + rootBlockNode.attr(settings.forced_root_block_attrs); + rootNode.insert(rootBlockNode, node); + rootBlockNode.append(node); + } else { + rootBlockNode.append(node); + } + } else { + trim(rootBlockNode); + rootBlockNode = null; + } + node = next; + } + trim(rootBlockNode); + }; + var createNode = function (name, type) { + var node = new AstNode(name, type); + var list; + if (name in nodeFilters) { + list = matchedNodes[name]; + if (list) { + list.push(node); + } else { + matchedNodes[name] = [node]; + } + } + return node; + }; + var removeWhitespaceBefore = function (node) { + var textNode, textNodeNext, textVal, sibling; + var blockElements = schema.getBlockElements(); + for (textNode = node.prev; textNode && textNode.type === 3;) { + textVal = textNode.value.replace(endWhiteSpaceRegExp, ''); + if (textVal.length > 0) { + textNode.value = textVal; + return; + } + textNodeNext = textNode.next; + if (textNodeNext) { + if (textNodeNext.type === 3 && textNodeNext.value.length) { + textNode = textNode.prev; + continue; + } + if (!blockElements[textNodeNext.name] && textNodeNext.name !== 'script' && textNodeNext.name !== 'style') { + textNode = textNode.prev; + continue; + } + } + sibling = textNode.prev; + textNode.remove(); + textNode = sibling; + } + }; + var cloneAndExcludeBlocks = function (input) { + var name; + var output = {}; + for (name in input) { + if (name !== 'li' && name !== 'p') { + output[name] = input[name]; + } + } + return output; + }; + var parser = SaxParser$1({ + validate: validate, + allow_html_data_urls: settings.allow_html_data_urls, + allow_script_urls: settings.allow_script_urls, + allow_conditional_comments: settings.allow_conditional_comments, + preserve_cdata: settings.preserve_cdata, + self_closing_elements: cloneAndExcludeBlocks(schema.getSelfClosingElements()), + cdata: function (text) { + node.append(createNode('#cdata', 4)).value = text; + }, + text: function (text, raw) { + var textNode; + if (!isInWhiteSpacePreservedElement) { + text = text.replace(allWhiteSpaceRegExp, ' '); + if (isLineBreakNode(node.lastChild, blockElements)) { + text = text.replace(startWhiteSpaceRegExp, ''); + } + } + if (text.length !== 0) { + textNode = createNode('#text', 3); + textNode.raw = !!raw; + node.append(textNode).value = text; + } + }, + comment: function (text) { + node.append(createNode('#comment', 8)).value = text; + }, + pi: function (name, text) { + node.append(createNode(name, 7)).value = text; + removeWhitespaceBefore(node); + }, + doctype: function (text) { + var newNode = node.append(createNode('#doctype', 10)); + newNode.value = text; + removeWhitespaceBefore(node); + }, + start: function (name, attrs, empty) { + var newNode, attrFiltersLen, attrName, parent; + var elementRule = validate ? schema.getElementRule(name) : {}; + if (elementRule) { + newNode = createNode(elementRule.outputName || name, 1); + newNode.attributes = attrs; + newNode.shortEnded = empty; + node.append(newNode); + parent = children[node.name]; + if (parent && children[newNode.name] && !parent[newNode.name]) { + invalidChildren.push(newNode); + } + attrFiltersLen = attributeFilters.length; + while (attrFiltersLen--) { + attrName = attributeFilters[attrFiltersLen].name; + if (attrName in attrs.map) { + list = matchedAttributes[attrName]; + if (list) { + list.push(newNode); + } else { + matchedAttributes[attrName] = [newNode]; + } + } + } + if (blockElements[name]) { + removeWhitespaceBefore(newNode); + } + if (!empty) { + node = newNode; + } + if (!isInWhiteSpacePreservedElement && whiteSpaceElements[name]) { + isInWhiteSpacePreservedElement = true; + } + } + }, + end: function (name) { + var textNode, text, sibling, tempNode; + var elementRule = validate ? schema.getElementRule(name) : {}; + if (elementRule) { + if (blockElements[name]) { + if (!isInWhiteSpacePreservedElement) { + textNode = node.firstChild; + if (textNode && textNode.type === 3) { + text = textNode.value.replace(startWhiteSpaceRegExp, ''); + if (text.length > 0) { + textNode.value = text; + textNode = textNode.next; + } else { + sibling = textNode.next; + textNode.remove(); + textNode = sibling; + while (textNode && textNode.type === 3) { + text = textNode.value; + sibling = textNode.next; + if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) { + textNode.remove(); + textNode = sibling; + } + textNode = sibling; + } + } + } + textNode = node.lastChild; + if (textNode && textNode.type === 3) { + text = textNode.value.replace(endWhiteSpaceRegExp, ''); + if (text.length > 0) { + textNode.value = text; + textNode = textNode.prev; + } else { + sibling = textNode.prev; + textNode.remove(); + textNode = sibling; + while (textNode && textNode.type === 3) { + text = textNode.value; + sibling = textNode.prev; + if (text.length === 0 || isAllWhiteSpaceRegExp.test(text)) { + textNode.remove(); + textNode = sibling; + } + textNode = sibling; + } + } + } + } + } + if (isInWhiteSpacePreservedElement && whiteSpaceElements[name]) { + isInWhiteSpacePreservedElement = false; + } + if (elementRule.removeEmpty && isEmpty$2(schema, nonEmptyElements, whiteSpaceElements, node)) { + tempNode = node.parent; + if (blockElements[node.name]) { + node.empty().remove(); + } else { + node.unwrap(); + } + node = tempNode; + return; + } + if (elementRule.paddEmpty && (isPaddedWithNbsp(node) || isEmpty$2(schema, nonEmptyElements, whiteSpaceElements, node))) { + paddEmptyNode(settings, args, blockElements, node); + } + node = node.parent; + } + } + }, schema); + var rootNode = node = new AstNode(args.context || settings.root_name, 11); + parser.parse(html, args.format); + if (validate && invalidChildren.length) { + if (!args.context) { + fixInvalidChildren(invalidChildren); + } else { + args.invalid = true; + } + } + if (rootBlockName && (rootNode.name === 'body' || args.isRootContent)) { + addRootBlocks(); + } + if (!args.invalid) { + for (name in matchedNodes) { + if (!matchedNodes.hasOwnProperty(name)) { + continue; + } + list = nodeFilters[name]; + nodes = matchedNodes[name]; + fi = nodes.length; + while (fi--) { + if (!nodes[fi].parent) { + nodes.splice(fi, 1); + } + } + for (i = 0, l = list.length; i < l; i++) { + list[i](nodes, name, args); + } + } + for (i = 0, l = attributeFilters.length; i < l; i++) { + list = attributeFilters[i]; + if (list.name in matchedAttributes) { + nodes = matchedAttributes[list.name]; + fi = nodes.length; + while (fi--) { + if (!nodes[fi].parent) { + nodes.splice(fi, 1); + } + } + for (fi = 0, fl = list.callbacks.length; fi < fl; fi++) { + list.callbacks[fi](nodes, list.name, args); + } + } + } + } + return rootNode; + }; + var exports = { + schema: schema, + addAttributeFilter: addAttributeFilter, + getAttributeFilters: getAttributeFilters, + addNodeFilter: addNodeFilter, + getNodeFilters: getNodeFilters, + filterNode: filterNode, + parse: parse + }; + register$2(exports, settings); + register$1(exports, settings); + return exports; + }; + + var register$3 = function (htmlParser, settings, dom) { + htmlParser.addAttributeFilter('data-mce-tabindex', function (nodes, name) { + var i = nodes.length, node; + while (i--) { + node = nodes[i]; + node.attr('tabindex', node.attr('data-mce-tabindex')); + node.attr(name, null); + } + }); + htmlParser.addAttributeFilter('src,href,style', function (nodes, name) { + var i = nodes.length, node, value; + var internalName = 'data-mce-' + name; + var urlConverter = settings.url_converter; + var urlConverterScope = settings.url_converter_scope; + while (i--) { + node = nodes[i]; + value = node.attr(internalName); + if (value !== undefined) { + node.attr(name, value.length > 0 ? value : null); + node.attr(internalName, null); + } else { + value = node.attr(name); + if (name === 'style') { + value = dom.serializeStyle(dom.parseStyle(value), node.name); + } else if (urlConverter) { + value = urlConverter.call(urlConverterScope, value, name, node.name); + } + node.attr(name, value.length > 0 ? value : null); + } + } + }); + htmlParser.addAttributeFilter('class', function (nodes) { + var i = nodes.length, node, value; + while (i--) { + node = nodes[i]; + value = node.attr('class'); + if (value) { + value = node.attr('class').replace(/(?:^|\s)mce-item-\w+(?!\S)/g, ''); + node.attr('class', value.length > 0 ? value : null); + } + } + }); + htmlParser.addAttributeFilter('data-mce-type', function (nodes, name, args) { + var i = nodes.length, node; + while (i--) { + node = nodes[i]; + if (node.attr('data-mce-type') === 'bookmark' && !args.cleanup) { + var hasChildren = Optional.from(node.firstChild).exists(function (firstChild) { + return !isZwsp$1(firstChild.value); + }); + if (hasChildren) { + node.unwrap(); + } else { + node.remove(); + } + } + } + }); + htmlParser.addNodeFilter('noscript', function (nodes) { + var i = nodes.length, node; + while (i--) { + node = nodes[i].firstChild; + if (node) { + node.value = Entities.decode(node.value); + } + } + }); + htmlParser.addNodeFilter('script,style', function (nodes, name) { + var i = nodes.length, node, value, type; + var trim = function (value) { + return value.replace(/()/g, '\n').replace(/^[\r\n]*|[\r\n]*$/g, '').replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g, ''); + }; + while (i--) { + node = nodes[i]; + value = node.firstChild ? node.firstChild.value : ''; + if (name === 'script') { + type = node.attr('type'); + if (type) { + node.attr('type', type === 'mce-no/type' ? null : type.replace(/^mce\-/, '')); + } + if (settings.element_format === 'xhtml' && value.length > 0) { + node.firstChild.value = '// '; + } + } else { + if (settings.element_format === 'xhtml' && value.length > 0) { + node.firstChild.value = ''; + } + } + } + }); + htmlParser.addNodeFilter('#comment', function (nodes) { + var i = nodes.length, node; + while (i--) { + node = nodes[i]; + if (settings.preserve_cdata && node.value.indexOf('[CDATA[') === 0) { + node.name = '#cdata'; + node.type = 4; + node.value = dom.decode(node.value.replace(/^\[CDATA\[|\]\]$/g, '')); + } else if (node.value.indexOf('mce:protected ') === 0) { + node.name = '#text'; + node.type = 3; + node.raw = true; + node.value = unescape(node.value).substr(14); + } + } + }); + htmlParser.addNodeFilter('xml:namespace,input', function (nodes, name) { + var i = nodes.length, node; + while (i--) { + node = nodes[i]; + if (node.type === 7) { + node.remove(); + } else if (node.type === 1) { + if (name === 'input' && !node.attr('type')) { + node.attr('type', 'text'); + } + } + } + }); + htmlParser.addAttributeFilter('data-mce-type', function (nodes) { + each(nodes, function (node) { + if (node.attr('data-mce-type') === 'format-caret') { + if (node.isEmpty(htmlParser.schema.getNonEmptyElements())) { + node.remove(); + } else { + node.unwrap(); + } + } + }); + }); + htmlParser.addAttributeFilter('data-mce-src,data-mce-href,data-mce-style,' + 'data-mce-selected,data-mce-expando,' + 'data-mce-type,data-mce-resize,data-mce-placeholder', function (nodes, name) { + var i = nodes.length; + while (i--) { + nodes[i].attr(name, null); + } + }); + }; + var trimTrailingBr = function (rootNode) { + var isBr = function (node) { + return node && node.name === 'br'; + }; + var brNode1 = rootNode.lastChild; + if (isBr(brNode1)) { + var brNode2 = brNode1.prev; + if (isBr(brNode2)) { + brNode1.remove(); + brNode2.remove(); + } + } + }; + + var preProcess = function (editor, node, args) { + var doc, oldDoc; + var dom = editor.dom; + node = node.cloneNode(true); + var impl = document.implementation; + if (impl.createHTMLDocument) { + doc = impl.createHTMLDocument(''); + Tools.each(node.nodeName === 'BODY' ? node.childNodes : [node], function (node) { + doc.body.appendChild(doc.importNode(node, true)); + }); + if (node.nodeName !== 'BODY') { + node = doc.body.firstChild; + } else { + node = doc.body; + } + oldDoc = dom.doc; + dom.doc = doc; + } + firePreProcess(editor, __assign(__assign({}, args), { node: node })); + if (oldDoc) { + dom.doc = oldDoc; + } + return node; + }; + var shouldFireEvent = function (editor, args) { + return editor && editor.hasEventListeners('PreProcess') && !args.no_events; + }; + var process = function (editor, node, args) { + return shouldFireEvent(editor, args) ? preProcess(editor, node, args) : node; + }; + + var addTempAttr = function (htmlParser, tempAttrs, name) { + if (Tools.inArray(tempAttrs, name) === -1) { + htmlParser.addAttributeFilter(name, function (nodes, name) { + var i = nodes.length; + while (i--) { + nodes[i].attr(name, null); + } + }); + tempAttrs.push(name); + } + }; + var postProcess$1 = function (editor, args, content) { + if (!args.no_events && editor) { + var outArgs = firePostProcess(editor, __assign(__assign({}, args), { content: content })); + return outArgs.content; + } else { + return content; + } + }; + var getHtmlFromNode = function (dom, node, args) { + var html = trim$2(args.getInner ? node.innerHTML : dom.getOuterHTML(node)); + return args.selection || isWsPreserveElement(SugarElement.fromDom(node)) ? html : Tools.trim(html); + }; + var parseHtml = function (htmlParser, html, args) { + var parserArgs = args.selection ? __assign({ forced_root_block: false }, args) : args; + var rootNode = htmlParser.parse(html, parserArgs); + trimTrailingBr(rootNode); + return rootNode; + }; + var serializeNode = function (settings, schema, node) { + var htmlSerializer = HtmlSerializer(settings, schema); + return htmlSerializer.serialize(node); + }; + var toHtml = function (editor, settings, schema, rootNode, args) { + var content = serializeNode(settings, schema, rootNode); + return postProcess$1(editor, args, content); + }; + var DomSerializerImpl = function (settings, editor) { + var tempAttrs = ['data-mce-selected']; + var dom = editor && editor.dom ? editor.dom : DOMUtils$1.DOM; + var schema = editor && editor.schema ? editor.schema : Schema(settings); + settings.entity_encoding = settings.entity_encoding || 'named'; + settings.remove_trailing_brs = 'remove_trailing_brs' in settings ? settings.remove_trailing_brs : true; + var htmlParser = DomParser(settings, schema); + register$3(htmlParser, settings, dom); + var serialize = function (node, parserArgs) { + if (parserArgs === void 0) { + parserArgs = {}; + } + var args = __assign({ format: 'html' }, parserArgs); + var targetNode = process(editor, node, args); + var html = getHtmlFromNode(dom, targetNode, args); + var rootNode = parseHtml(htmlParser, html, args); + return args.format === 'tree' ? rootNode : toHtml(editor, settings, schema, rootNode, args); + }; + return { + schema: schema, + addNodeFilter: htmlParser.addNodeFilter, + addAttributeFilter: htmlParser.addAttributeFilter, + serialize: serialize, + addRules: function (rules) { + schema.addValidElements(rules); + }, + setRules: function (rules) { + schema.setValidElements(rules); + }, + addTempAttr: curry(addTempAttr, htmlParser, tempAttrs), + getTempAttrs: function () { + return tempAttrs; + }, + getNodeFilters: htmlParser.getNodeFilters, + getAttributeFilters: htmlParser.getAttributeFilters + }; + }; + + var DomSerializer = function (settings, editor) { + var domSerializer = DomSerializerImpl(settings, editor); + return { + schema: domSerializer.schema, + addNodeFilter: domSerializer.addNodeFilter, + addAttributeFilter: domSerializer.addAttributeFilter, + serialize: domSerializer.serialize, + addRules: domSerializer.addRules, + setRules: domSerializer.setRules, + addTempAttr: domSerializer.addTempAttr, + getTempAttrs: domSerializer.getTempAttrs, + getNodeFilters: domSerializer.getNodeFilters, + getAttributeFilters: domSerializer.getAttributeFilters + }; + }; + + var defaultFormat$1 = 'html'; + var getContent$2 = function (editor, args) { + if (args === void 0) { + args = {}; + } + var format = args.format ? args.format : defaultFormat$1; + return getContent(editor, args, format); + }; + + var setContent$2 = function (editor, content, args) { + if (args === void 0) { + args = {}; + } + return setContent(editor, content, args); + }; + + var DOM$3 = DOMUtils$1.DOM; + var restoreOriginalStyles = function (editor) { + DOM$3.setStyle(editor.id, 'display', editor.orgDisplay); + }; + var safeDestroy = function (x) { + return Optional.from(x).each(function (x) { + return x.destroy(); + }); + }; + var clearDomReferences = function (editor) { + editor.contentAreaContainer = editor.formElement = editor.container = editor.editorContainer = null; + editor.bodyElement = editor.contentDocument = editor.contentWindow = null; + editor.iframeElement = editor.targetElm = null; + if (editor.selection) { + editor.selection = editor.selection.win = editor.selection.dom = editor.selection.dom.doc = null; + } + }; + var restoreForm = function (editor) { + var form = editor.formElement; + if (form) { + if (form._mceOldSubmit) { + form.submit = form._mceOldSubmit; + form._mceOldSubmit = null; + } + DOM$3.unbind(form, 'submit reset', editor.formEventDelegate); + } + }; + var remove$7 = function (editor) { + if (!editor.removed) { + var _selectionOverrides = editor._selectionOverrides, editorUpload = editor.editorUpload; + var body = editor.getBody(); + var element = editor.getElement(); + if (body) { + editor.save({ is_removing: true }); + } + editor.removed = true; + editor.unbindAllNativeEvents(); + if (editor.hasHiddenInput && element) { + DOM$3.remove(element.nextSibling); + } + fireRemove(editor); + editor.editorManager.remove(editor); + if (!editor.inline && body) { + restoreOriginalStyles(editor); + } + fireDetach(editor); + DOM$3.remove(editor.getContainer()); + safeDestroy(_selectionOverrides); + safeDestroy(editorUpload); + editor.destroy(); + } + }; + var destroy = function (editor, automatic) { + var selection = editor.selection, dom = editor.dom; + if (editor.destroyed) { + return; + } + if (!automatic && !editor.removed) { + editor.remove(); + return; + } + if (!automatic) { + editor.editorManager.off('beforeunload', editor._beforeUnload); + if (editor.theme && editor.theme.destroy) { + editor.theme.destroy(); + } + safeDestroy(selection); + safeDestroy(dom); + } + restoreForm(editor); + clearDomReferences(editor); + editor.destroyed = true; + }; + + var hasOwnProperty$2 = Object.prototype.hasOwnProperty; + var deep$1 = function (old, nu) { + var bothObjects = isObject(old) && isObject(nu); + return bothObjects ? deepMerge(old, nu) : nu; + }; + var baseMerge = function (merger) { + return function () { + var objects = new Array(arguments.length); + for (var i = 0; i < objects.length; i++) { + objects[i] = arguments[i]; + } + if (objects.length === 0) { + throw new Error('Can\'t merge zero objects'); + } + var ret = {}; + for (var j = 0; j < objects.length; j++) { + var curObject = objects[j]; + for (var key in curObject) { + if (hasOwnProperty$2.call(curObject, key)) { + ret[key] = merger(ret[key], curObject[key]); + } + } + } + return ret; + }; + }; + var deepMerge = baseMerge(deep$1); + + var sectionResult = function (sections, settings) { + return { + sections: constant(sections), + settings: constant(settings) + }; + }; + var deviceDetection = detect$3().deviceType; + var isTouch = deviceDetection.isTouch(); + var isPhone = deviceDetection.isPhone(); + var isTablet = deviceDetection.isTablet(); + var legacyMobilePlugins = [ + 'lists', + 'autolink', + 'autosave' + ]; + var defaultTouchSettings = { + table_grid: false, + object_resizing: false, + resize: false + }; + var normalizePlugins = function (plugins) { + var pluginNames = isArray(plugins) ? plugins.join(' ') : plugins; + var trimmedPlugins = map(isString(pluginNames) ? pluginNames.split(' ') : [], trim); + return filter(trimmedPlugins, function (item) { + return item.length > 0; + }); + }; + var filterLegacyMobilePlugins = function (plugins) { + return filter(plugins, curry(contains, legacyMobilePlugins)); + }; + var extractSections = function (keys, settings) { + var result = bifilter(settings, function (value, key) { + return contains(keys, key); + }); + return sectionResult(result.t, result.f); + }; + var getSection = function (sectionResult, name, defaults) { + if (defaults === void 0) { + defaults = {}; + } + var sections = sectionResult.sections(); + var sectionSettings = sections.hasOwnProperty(name) ? sections[name] : {}; + return Tools.extend({}, defaults, sectionSettings); + }; + var hasSection = function (sectionResult, name) { + return sectionResult.sections().hasOwnProperty(name); + }; + var isSectionTheme = function (sectionResult, name, theme) { + var section = sectionResult.sections(); + return hasSection(sectionResult, name) && section[name].theme === theme; + }; + var getSectionConfig = function (sectionResult, name) { + return hasSection(sectionResult, name) ? sectionResult.sections()[name] : {}; + }; + var getToolbarMode = function (settings, defaultVal) { + return get(settings, 'toolbar_mode').orThunk(function () { + return get(settings, 'toolbar_drawer').map(function (val) { + return val === false ? 'wrap' : val; + }); + }).getOr(defaultVal); + }; + var getDefaultSettings = function (settings, id, documentBaseUrl, isTouch, editor) { + var baseDefaults = { + id: id, + theme: 'silver', + toolbar_mode: getToolbarMode(settings, 'floating'), + plugins: '', + document_base_url: documentBaseUrl, + add_form_submit_trigger: true, + submit_patch: true, + add_unload_trigger: true, + convert_urls: true, + relative_urls: true, + remove_script_host: true, + object_resizing: true, + doctype: '', + visual: true, + font_size_legacy_values: 'xx-small,small,medium,large,x-large,xx-large,300%', + forced_root_block: 'p', + hidden_input: true, + inline_styles: true, + convert_fonts_to_spans: true, + indent: true, + indent_before: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,' + 'tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist', + indent_after: 'p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,' + 'tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist', + entity_encoding: 'named', + url_converter: editor.convertURL, + url_converter_scope: editor + }; + return __assign(__assign({}, baseDefaults), isTouch ? defaultTouchSettings : {}); + }; + var getDefaultMobileSettings = function (mobileSettings, isPhone) { + var defaultMobileSettings = { + resize: false, + toolbar_mode: getToolbarMode(mobileSettings, 'scrolling'), + toolbar_sticky: false + }; + var defaultPhoneSettings = { menubar: false }; + return __assign(__assign(__assign({}, defaultTouchSettings), defaultMobileSettings), isPhone ? defaultPhoneSettings : {}); + }; + var getExternalPlugins$1 = function (overrideSettings, settings) { + var userDefinedExternalPlugins = settings.external_plugins ? settings.external_plugins : {}; + if (overrideSettings && overrideSettings.external_plugins) { + return Tools.extend({}, overrideSettings.external_plugins, userDefinedExternalPlugins); + } else { + return userDefinedExternalPlugins; + } + }; + var combinePlugins = function (forcedPlugins, plugins) { + return [].concat(normalizePlugins(forcedPlugins)).concat(normalizePlugins(plugins)); + }; + var processPlugins = function (isMobileDevice, sectionResult, defaultOverrideSettings, settings) { + var forcedPlugins = normalizePlugins(defaultOverrideSettings.forced_plugins); + var desktopPlugins = normalizePlugins(settings.plugins); + var mobileConfig = getSectionConfig(sectionResult, 'mobile'); + var mobilePlugins = mobileConfig.plugins ? normalizePlugins(mobileConfig.plugins) : desktopPlugins; + var platformPlugins = isMobileDevice && isSectionTheme(sectionResult, 'mobile', 'mobile') ? filterLegacyMobilePlugins(mobilePlugins) : isMobileDevice && hasSection(sectionResult, 'mobile') ? mobilePlugins : desktopPlugins; + var combinedPlugins = combinePlugins(forcedPlugins, platformPlugins); + return Tools.extend(settings, { plugins: combinedPlugins.join(' ') }); + }; + var isOnMobile = function (isMobileDevice, sectionResult) { + return isMobileDevice && hasSection(sectionResult, 'mobile'); + }; + var combineSettings = function (isMobileDevice, isPhone, defaultSettings, defaultOverrideSettings, settings) { + var defaultDeviceSettings = isMobileDevice ? { mobile: getDefaultMobileSettings(settings.mobile || {}, isPhone) } : {}; + var sectionResult = extractSections(['mobile'], deepMerge(defaultDeviceSettings, settings)); + var extendedSettings = Tools.extend(defaultSettings, defaultOverrideSettings, sectionResult.settings(), isOnMobile(isMobileDevice, sectionResult) ? getSection(sectionResult, 'mobile') : {}, { + validate: true, + external_plugins: getExternalPlugins$1(defaultOverrideSettings, sectionResult.settings()) + }); + return processPlugins(isMobileDevice, sectionResult, defaultOverrideSettings, extendedSettings); + }; + var getEditorSettings = function (editor, id, documentBaseUrl, defaultOverrideSettings, settings) { + var defaultSettings = getDefaultSettings(settings, id, documentBaseUrl, isTouch, editor); + return combineSettings(isPhone || isTablet, isPhone, defaultSettings, defaultOverrideSettings, settings); + }; + var getFiltered = function (predicate, editor, name) { + return Optional.from(editor.settings[name]).filter(predicate); + }; + var getParamObject = function (value) { + var output = {}; + if (typeof value === 'string') { + each(value.indexOf('=') > 0 ? value.split(/[;,](?![^=;,]*(?:[;,]|$))/) : value.split(','), function (val) { + var arr = val.split('='); + if (arr.length > 1) { + output[Tools.trim(arr[0])] = Tools.trim(arr[1]); + } else { + output[Tools.trim(arr[0])] = Tools.trim(arr[0]); + } + }); + } else { + output = value; + } + return output; + }; + var isArrayOf = function (p) { + return function (a) { + return isArray(a) && forall(a, p); + }; + }; + var getParam = function (editor, name, defaultVal, type) { + var value = name in editor.settings ? editor.settings[name] : defaultVal; + if (type === 'hash') { + return getParamObject(value); + } else if (type === 'string') { + return getFiltered(isString, editor, name).getOr(defaultVal); + } else if (type === 'number') { + return getFiltered(isNumber, editor, name).getOr(defaultVal); + } else if (type === 'boolean') { + return getFiltered(isBoolean, editor, name).getOr(defaultVal); + } else if (type === 'object') { + return getFiltered(isObject, editor, name).getOr(defaultVal); + } else if (type === 'array') { + return getFiltered(isArray, editor, name).getOr(defaultVal); + } else if (type === 'string[]') { + return getFiltered(isArrayOf(isString), editor, name).getOr(defaultVal); + } else if (type === 'function') { + return getFiltered(isFunction, editor, name).getOr(defaultVal); + } else { + return value; + } + }; + + var CreateIconManager = function () { + var lookup = {}; + var add = function (id, iconPack) { + lookup[id] = iconPack; + }; + var get = function (id) { + if (lookup[id]) { + return lookup[id]; + } + return { icons: {} }; + }; + var has$1 = function (id) { + return has(lookup, id); + }; + return { + add: add, + get: get, + has: has$1 + }; + }; + var IconManager = CreateIconManager(); + + var getProp = function (propName, elm) { + var rawElm = elm.dom; + return rawElm[propName]; + }; + var getComputedSizeProp = function (propName, elm) { + return parseInt(get$4(elm, propName), 10); + }; + var getClientWidth = curry(getProp, 'clientWidth'); + var getClientHeight = curry(getProp, 'clientHeight'); + var getMarginTop = curry(getComputedSizeProp, 'margin-top'); + var getMarginLeft = curry(getComputedSizeProp, 'margin-left'); + var getBoundingClientRect$1 = function (elm) { + return elm.dom.getBoundingClientRect(); + }; + var isInsideElementContentArea = function (bodyElm, clientX, clientY) { + var clientWidth = getClientWidth(bodyElm); + var clientHeight = getClientHeight(bodyElm); + return clientX >= 0 && clientY >= 0 && clientX <= clientWidth && clientY <= clientHeight; + }; + var transpose = function (inline, elm, clientX, clientY) { + var clientRect = getBoundingClientRect$1(elm); + var deltaX = inline ? clientRect.left + elm.dom.clientLeft + getMarginLeft(elm) : 0; + var deltaY = inline ? clientRect.top + elm.dom.clientTop + getMarginTop(elm) : 0; + var x = clientX - deltaX; + var y = clientY - deltaY; + return { + x: x, + y: y + }; + }; + var isXYInContentArea = function (editor, clientX, clientY) { + var bodyElm = SugarElement.fromDom(editor.getBody()); + var targetElm = editor.inline ? bodyElm : documentElement(bodyElm); + var transposedPoint = transpose(editor.inline, targetElm, clientX, clientY); + return isInsideElementContentArea(targetElm, transposedPoint.x, transposedPoint.y); + }; + var fromDomSafe = function (node) { + return Optional.from(node).map(SugarElement.fromDom); + }; + var isEditorAttachedToDom = function (editor) { + var rawContainer = editor.inline ? editor.getBody() : editor.getContentAreaContainer(); + return fromDomSafe(rawContainer).map(inBody).getOr(false); + }; + + function NotificationManagerImpl() { + var unimplemented = function () { + throw new Error('Theme did not provide a NotificationManager implementation.'); + }; + return { + open: unimplemented, + close: unimplemented, + reposition: unimplemented, + getArgs: unimplemented + }; + } + + function NotificationManager(editor) { + var notifications = []; + var getImplementation = function () { + var theme = editor.theme; + return theme && theme.getNotificationManagerImpl ? theme.getNotificationManagerImpl() : NotificationManagerImpl(); + }; + var getTopNotification = function () { + return Optional.from(notifications[0]); + }; + var isEqual = function (a, b) { + return a.type === b.type && a.text === b.text && !a.progressBar && !a.timeout && !b.progressBar && !b.timeout; + }; + var reposition = function () { + if (notifications.length > 0) { + getImplementation().reposition(notifications); + } + }; + var addNotification = function (notification) { + notifications.push(notification); + }; + var closeNotification = function (notification) { + findIndex(notifications, function (otherNotification) { + return otherNotification === notification; + }).each(function (index) { + notifications.splice(index, 1); + }); + }; + var open = function (spec) { + if (editor.removed || !isEditorAttachedToDom(editor)) { + return; + } + return find(notifications, function (notification) { + return isEqual(getImplementation().getArgs(notification), spec); + }).getOrThunk(function () { + editor.editorManager.setActive(editor); + var notification = getImplementation().open(spec, function () { + closeNotification(notification); + reposition(); + getTopNotification().fold(function () { + return editor.focus(); + }, function (top) { + return focus(SugarElement.fromDom(top.getEl())); + }); + }); + addNotification(notification); + reposition(); + return notification; + }); + }; + var close = function () { + getTopNotification().each(function (notification) { + getImplementation().close(notification); + closeNotification(notification); + reposition(); + }); + }; + var getNotifications = function () { + return notifications; + }; + var registerEvents = function (editor) { + editor.on('SkinLoaded', function () { + var serviceMessage = getServiceMessage(editor); + if (serviceMessage) { + open({ + text: serviceMessage, + type: 'warning', + timeout: 0 + }); + } + }); + editor.on('ResizeEditor ResizeWindow NodeChange', function () { + Delay.requestAnimationFrame(reposition); + }); + editor.on('remove', function () { + each(notifications.slice(), function (notification) { + getImplementation().close(notification); + }); + }); + }; + registerEvents(editor); + return { + open: open, + close: close, + getNotifications: getNotifications + }; + } + + var PluginManager = AddOnManager$1.PluginManager; + + var ThemeManager = AddOnManager$1.ThemeManager; + + function WindowManagerImpl () { + var unimplemented = function () { + throw new Error('Theme did not provide a WindowManager implementation.'); + }; + return { + open: unimplemented, + openUrl: unimplemented, + alert: unimplemented, + confirm: unimplemented, + close: unimplemented, + getParams: unimplemented, + setParams: unimplemented + }; + } + + var WindowManager = function (editor) { + var dialogs = []; + var getImplementation = function () { + var theme = editor.theme; + return theme && theme.getWindowManagerImpl ? theme.getWindowManagerImpl() : WindowManagerImpl(); + }; + var funcBind = function (scope, f) { + return function () { + return f ? f.apply(scope, arguments) : undefined; + }; + }; + var fireOpenEvent = function (dialog) { + editor.fire('OpenWindow', { dialog: dialog }); + }; + var fireCloseEvent = function (dialog) { + editor.fire('CloseWindow', { dialog: dialog }); + }; + var addDialog = function (dialog) { + dialogs.push(dialog); + fireOpenEvent(dialog); + }; + var closeDialog = function (dialog) { + fireCloseEvent(dialog); + dialogs = filter(dialogs, function (otherDialog) { + return otherDialog !== dialog; + }); + if (dialogs.length === 0) { + editor.focus(); + } + }; + var getTopDialog = function () { + return Optional.from(dialogs[dialogs.length - 1]); + }; + var storeSelectionAndOpenDialog = function (openDialog) { + editor.editorManager.setActive(editor); + store(editor); + var dialog = openDialog(); + addDialog(dialog); + return dialog; + }; + var open = function (args, params) { + return storeSelectionAndOpenDialog(function () { + return getImplementation().open(args, params, closeDialog); + }); + }; + var openUrl = function (args) { + return storeSelectionAndOpenDialog(function () { + return getImplementation().openUrl(args, closeDialog); + }); + }; + var alert = function (message, callback, scope) { + getImplementation().alert(message, funcBind(scope ? scope : this, callback)); + }; + var confirm = function (message, callback, scope) { + getImplementation().confirm(message, funcBind(scope ? scope : this, callback)); + }; + var close = function () { + getTopDialog().each(function (dialog) { + getImplementation().close(dialog); + closeDialog(dialog); + }); + }; + editor.on('remove', function () { + each(dialogs, function (dialog) { + getImplementation().close(dialog); + }); + }); + return { + open: open, + openUrl: openUrl, + alert: alert, + confirm: confirm, + close: close + }; + }; + + var displayNotification = function (editor, message) { + editor.notificationManager.open({ + type: 'error', + text: message + }); + }; + var displayError = function (editor, message) { + if (editor._skinLoaded) { + displayNotification(editor, message); + } else { + editor.on('SkinLoaded', function () { + displayNotification(editor, message); + }); + } + }; + var uploadError = function (editor, message) { + displayError(editor, I18n.translate([ + 'Failed to upload image: {0}', + message + ])); + }; + var logError = function (editor, errorType, msg) { + fireError(editor, errorType, { message: msg }); + console.error(msg); + }; + var createLoadError = function (type, url, name) { + return name ? 'Failed to load ' + type + ': ' + name + ' from url ' + url : 'Failed to load ' + type + ' url: ' + url; + }; + var pluginLoadError = function (editor, url, name) { + logError(editor, 'PluginLoadError', createLoadError('plugin', url, name)); + }; + var iconsLoadError = function (editor, url, name) { + logError(editor, 'IconsLoadError', createLoadError('icons', url, name)); + }; + var languageLoadError = function (editor, url, name) { + logError(editor, 'LanguageLoadError', createLoadError('language', url, name)); + }; + var pluginInitError = function (editor, name, err) { + var message = I18n.translate([ + 'Failed to initialize plugin: {0}', + name + ]); + initError(message, err); + displayError(editor, message); + }; + var initError = function (message) { + var x = []; + for (var _i = 1; _i < arguments.length; _i++) { + x[_i - 1] = arguments[_i]; + } + var console = window.console; + if (console) { + if (console.error) { + console.error.apply(console, __spreadArrays([message], x)); + } else { + console.log.apply(console, __spreadArrays([message], x)); + } + } + }; + + var isContentCssSkinName = function (url) { + return /^[a-z0-9\-]+$/i.test(url); + }; + var getContentCssUrls = function (editor) { + var contentCss = getContentCss(editor); + var skinUrl = editor.editorManager.baseURL + '/skins/content'; + var suffix = editor.editorManager.suffix; + var contentCssFile = 'content' + suffix + '.css'; + var inline = editor.inline === true; + return map(contentCss, function (url) { + if (isContentCssSkinName(url) && !inline) { + return skinUrl + '/' + url + '/' + contentCssFile; + } else { + return editor.documentBaseURI.toAbsolute(url); + } + }); + }; + var appendContentCssFromSettings = function (editor) { + editor.contentCSS = editor.contentCSS.concat(getContentCssUrls(editor)); + }; + + function Uploader(uploadStatus, settings) { + var pendingPromises = {}; + var pathJoin = function (path1, path2) { + if (path1) { + return path1.replace(/\/$/, '') + '/' + path2.replace(/^\//, ''); + } + return path2; + }; + var defaultHandler = function (blobInfo, success, failure, progress) { + var xhr = new XMLHttpRequest(); + xhr.open('POST', settings.url); + xhr.withCredentials = settings.credentials; + xhr.upload.onprogress = function (e) { + progress(e.loaded / e.total * 100); + }; + xhr.onerror = function () { + failure('Image upload failed due to a XHR Transport error. Code: ' + xhr.status); + }; + xhr.onload = function () { + if (xhr.status < 200 || xhr.status >= 300) { + failure('HTTP Error: ' + xhr.status); + return; + } + var json = JSON.parse(xhr.responseText); + if (!json || typeof json.location !== 'string') { + failure('Invalid JSON: ' + xhr.responseText); + return; + } + success(pathJoin(settings.basePath, json.location)); + }; + var formData = new FormData(); + formData.append('file', blobInfo.blob(), blobInfo.filename()); + xhr.send(formData); + }; + var noUpload = function () { + return new promiseObj(function (resolve) { + resolve([]); + }); + }; + var handlerSuccess = function (blobInfo, url) { + return { + url: url, + blobInfo: blobInfo, + status: true + }; + }; + var handlerFailure = function (blobInfo, message, options) { + return { + url: '', + blobInfo: blobInfo, + status: false, + error: { + message: message, + options: options + } + }; + }; + var resolvePending = function (blobUri, result) { + Tools.each(pendingPromises[blobUri], function (resolve) { + resolve(result); + }); + delete pendingPromises[blobUri]; + }; + var uploadBlobInfo = function (blobInfo, handler, openNotification) { + uploadStatus.markPending(blobInfo.blobUri()); + return new promiseObj(function (resolve) { + var notification, progress; + var noop = function () { + }; + try { + var closeNotification_1 = function () { + if (notification) { + notification.close(); + progress = noop; + } + }; + var success = function (url) { + closeNotification_1(); + uploadStatus.markUploaded(blobInfo.blobUri(), url); + resolvePending(blobInfo.blobUri(), handlerSuccess(blobInfo, url)); + resolve(handlerSuccess(blobInfo, url)); + }; + var failure = function (error, options) { + var failureOptions = options ? options : {}; + closeNotification_1(); + uploadStatus.removeFailed(blobInfo.blobUri()); + resolvePending(blobInfo.blobUri(), handlerFailure(blobInfo, error, failureOptions)); + resolve(handlerFailure(blobInfo, error, failureOptions)); + }; + progress = function (percent) { + if (percent < 0 || percent > 100) { + return; + } + if (!notification) { + notification = openNotification(); + } + notification.progressBar.value(percent); + }; + handler(blobInfo, success, failure, progress); + } catch (ex) { + resolve(handlerFailure(blobInfo, ex.message, {})); + } + }); + }; + var isDefaultHandler = function (handler) { + return handler === defaultHandler; + }; + var pendingUploadBlobInfo = function (blobInfo) { + var blobUri = blobInfo.blobUri(); + return new promiseObj(function (resolve) { + pendingPromises[blobUri] = pendingPromises[blobUri] || []; + pendingPromises[blobUri].push(resolve); + }); + }; + var uploadBlobs = function (blobInfos, openNotification) { + blobInfos = Tools.grep(blobInfos, function (blobInfo) { + return !uploadStatus.isUploaded(blobInfo.blobUri()); + }); + return promiseObj.all(Tools.map(blobInfos, function (blobInfo) { + return uploadStatus.isPending(blobInfo.blobUri()) ? pendingUploadBlobInfo(blobInfo) : uploadBlobInfo(blobInfo, settings.handler, openNotification); + })); + }; + var upload = function (blobInfos, openNotification) { + return !settings.url && isDefaultHandler(settings.handler) ? noUpload() : uploadBlobs(blobInfos, openNotification); + }; + if (isFunction(settings.handler) === false) { + settings.handler = defaultHandler; + } + return { upload: upload }; + } + + function UploadStatus () { + var PENDING = 1, UPLOADED = 2; + var blobUriStatuses = {}; + var createStatus = function (status, resultUri) { + return { + status: status, + resultUri: resultUri + }; + }; + var hasBlobUri = function (blobUri) { + return blobUri in blobUriStatuses; + }; + var getResultUri = function (blobUri) { + var result = blobUriStatuses[blobUri]; + return result ? result.resultUri : null; + }; + var isPending = function (blobUri) { + return hasBlobUri(blobUri) ? blobUriStatuses[blobUri].status === PENDING : false; + }; + var isUploaded = function (blobUri) { + return hasBlobUri(blobUri) ? blobUriStatuses[blobUri].status === UPLOADED : false; + }; + var markPending = function (blobUri) { + blobUriStatuses[blobUri] = createStatus(PENDING, null); + }; + var markUploaded = function (blobUri, resultUri) { + blobUriStatuses[blobUri] = createStatus(UPLOADED, resultUri); + }; + var removeFailed = function (blobUri) { + delete blobUriStatuses[blobUri]; + }; + var destroy = function () { + blobUriStatuses = {}; + }; + return { + hasBlobUri: hasBlobUri, + getResultUri: getResultUri, + isPending: isPending, + isUploaded: isUploaded, + markPending: markPending, + markUploaded: markUploaded, + removeFailed: removeFailed, + destroy: destroy + }; + } + + var count$1 = 0; + var seed = function () { + var rnd = function () { + return Math.round(Math.random() * 4294967295).toString(36); + }; + var now = new Date().getTime(); + return 's' + now.toString(36) + rnd() + rnd() + rnd(); + }; + var uuid = function (prefix) { + return prefix + count$1++ + seed(); + }; + + var BlobCache = function () { + var cache = []; + var mimeToExt = function (mime) { + var mimes = { + 'image/jpeg': 'jpg', + 'image/jpg': 'jpg', + 'image/gif': 'gif', + 'image/png': 'png' + }; + return mimes[mime.toLowerCase()] || 'dat'; + }; + var create = function (o, blob, base64, filename) { + if (isString(o)) { + var id = o; + return toBlobInfo({ + id: id, + name: filename, + blob: blob, + base64: base64 + }); + } else if (isObject(o)) { + return toBlobInfo(o); + } else { + throw new Error('Unknown input type'); + } + }; + var toBlobInfo = function (o) { + if (!o.blob || !o.base64) { + throw new Error('blob and base64 representations of the image are required for BlobInfo to be created'); + } + var id = o.id || uuid('blobid'); + var name = o.name || id; + return { + id: constant(id), + name: constant(name), + filename: constant(name + '.' + mimeToExt(o.blob.type)), + blob: constant(o.blob), + base64: constant(o.base64), + blobUri: constant(o.blobUri || URL.createObjectURL(o.blob)), + uri: constant(o.uri) + }; + }; + var add = function (blobInfo) { + if (!get(blobInfo.id())) { + cache.push(blobInfo); + } + }; + var findFirst = function (predicate) { + return find(cache, predicate).getOrUndefined(); + }; + var get = function (id) { + return findFirst(function (cachedBlobInfo) { + return cachedBlobInfo.id() === id; + }); + }; + var getByUri = function (blobUri) { + return findFirst(function (blobInfo) { + return blobInfo.blobUri() === blobUri; + }); + }; + var getByData = function (base64, type) { + return findFirst(function (blobInfo) { + return blobInfo.base64() === base64 && blobInfo.blob().type === type; + }); + }; + var removeByUri = function (blobUri) { + cache = filter(cache, function (blobInfo) { + if (blobInfo.blobUri() === blobUri) { + URL.revokeObjectURL(blobInfo.blobUri()); + return false; + } + return true; + }); + }; + var destroy = function () { + each(cache, function (cachedBlobInfo) { + URL.revokeObjectURL(cachedBlobInfo.blobUri()); + }); + cache = []; + }; + return { + create: create, + add: add, + get: get, + getByUri: getByUri, + getByData: getByData, + findFirst: findFirst, + removeByUri: removeByUri, + destroy: destroy + }; + }; + + var EditorUpload = function (editor) { + var blobCache = BlobCache(); + var uploader, imageScanner; + var uploadStatus = UploadStatus(); + var urlFilters = []; + var aliveGuard = function (callback) { + return function (result) { + if (editor.selection) { + return callback(result); + } + return []; + }; + }; + var cacheInvalidator = function (url) { + return url + (url.indexOf('?') === -1 ? '?' : '&') + new Date().getTime(); + }; + var replaceString = function (content, search, replace) { + var index = 0; + do { + index = content.indexOf(search, index); + if (index !== -1) { + content = content.substring(0, index) + replace + content.substr(index + search.length); + index += replace.length - search.length + 1; + } + } while (index !== -1); + return content; + }; + var replaceImageUrl = function (content, targetUrl, replacementUrl) { + var replacementString = 'src="' + replacementUrl + '"' + (replacementUrl === Env.transparentSrc ? ' data-mce-placeholder="1"' : ''); + content = replaceString(content, 'src="' + targetUrl + '"', replacementString); + content = replaceString(content, 'data-mce-src="' + targetUrl + '"', 'data-mce-src="' + replacementUrl + '"'); + return content; + }; + var replaceUrlInUndoStack = function (targetUrl, replacementUrl) { + each(editor.undoManager.data, function (level) { + if (level.type === 'fragmented') { + level.fragments = map(level.fragments, function (fragment) { + return replaceImageUrl(fragment, targetUrl, replacementUrl); + }); + } else { + level.content = replaceImageUrl(level.content, targetUrl, replacementUrl); + } + }); + }; + var openNotification = function () { + return editor.notificationManager.open({ + text: editor.translate('Image uploading...'), + type: 'info', + timeout: -1, + progressBar: true + }); + }; + var replaceImageUriInView = function (image, resultUri) { + var src = editor.convertURL(resultUri, 'src'); + replaceUrlInUndoStack(image.src, resultUri); + editor.$(image).attr({ + 'src': shouldReuseFileName(editor) ? cacheInvalidator(resultUri) : resultUri, + 'data-mce-src': src + }); + }; + var uploadImages = function (callback) { + if (!uploader) { + uploader = Uploader(uploadStatus, { + url: getImageUploadUrl(editor), + basePath: getImageUploadBasePath(editor), + credentials: getImagesUploadCredentials(editor), + handler: getImagesUploadHandler(editor) + }); + } + return scanForImages().then(aliveGuard(function (imageInfos) { + var blobInfos = map(imageInfos, function (imageInfo) { + return imageInfo.blobInfo; + }); + return uploader.upload(blobInfos, openNotification).then(aliveGuard(function (result) { + var imagesToRemove = []; + var filteredResult = map(result, function (uploadInfo, index) { + var blobInfo = imageInfos[index].blobInfo; + var image = imageInfos[index].image; + if (uploadInfo.status && shouldReplaceBlobUris(editor)) { + blobCache.removeByUri(image.src); + replaceImageUriInView(image, uploadInfo.url); + } else if (uploadInfo.error) { + if (uploadInfo.error.options.remove) { + replaceUrlInUndoStack(image.getAttribute('src'), Env.transparentSrc); + imagesToRemove.push(image); + } + uploadError(editor, uploadInfo.error.message); + } + return { + element: image, + status: uploadInfo.status, + uploadUri: uploadInfo.url, + blobInfo: blobInfo + }; + }); + if (imagesToRemove.length > 0) { + if (isRtc(editor)) { + console.error('Removing images on failed uploads is currently unsupported for RTC'); + } else { + editor.undoManager.transact(function () { + each(imagesToRemove, function (element) { + editor.dom.remove(element); + blobCache.removeByUri(element.src); + }); + }); + } + } + if (callback) { + callback(filteredResult); + } + return filteredResult; + })); + })); + }; + var uploadImagesAuto = function (callback) { + if (isAutomaticUploadsEnabled(editor)) { + return uploadImages(callback); + } + }; + var isValidDataUriImage = function (imgElm) { + if (forall(urlFilters, function (filter) { + return filter(imgElm); + }) === false) { + return false; + } + if (imgElm.getAttribute('src').indexOf('data:') === 0) { + var dataImgFilter = getImagesDataImgFilter(editor); + return dataImgFilter(imgElm); + } + return true; + }; + var addFilter = function (filter) { + urlFilters.push(filter); + }; + var scanForImages = function () { + if (!imageScanner) { + imageScanner = ImageScanner(uploadStatus, blobCache); + } + return imageScanner.findAll(editor.getBody(), isValidDataUriImage).then(aliveGuard(function (result) { + result = filter(result, function (resultItem) { + if (typeof resultItem === 'string') { + displayError(editor, resultItem); + return false; + } + return true; + }); + each(result, function (resultItem) { + replaceUrlInUndoStack(resultItem.image.src, resultItem.blobInfo.blobUri()); + resultItem.image.src = resultItem.blobInfo.blobUri(); + resultItem.image.removeAttribute('data-mce-src'); + }); + return result; + })); + }; + var destroy = function () { + blobCache.destroy(); + uploadStatus.destroy(); + imageScanner = uploader = null; + }; + var replaceBlobUris = function (content) { + return content.replace(/src="(blob:[^"]+)"/g, function (match, blobUri) { + var resultUri = uploadStatus.getResultUri(blobUri); + if (resultUri) { + return 'src="' + resultUri + '"'; + } + var blobInfo = blobCache.getByUri(blobUri); + if (!blobInfo) { + blobInfo = foldl(editor.editorManager.get(), function (result, editor) { + return result || editor.editorUpload && editor.editorUpload.blobCache.getByUri(blobUri); + }, null); + } + if (blobInfo) { + var blob = blobInfo.blob(); + return 'src="data:' + blob.type + ';base64,' + blobInfo.base64() + '"'; + } + return match; + }); + }; + editor.on('SetContent', function () { + if (isAutomaticUploadsEnabled(editor)) { + uploadImagesAuto(); + } else { + scanForImages(); + } + }); + editor.on('RawSaveContent', function (e) { + e.content = replaceBlobUris(e.content); + }); + editor.on('GetContent', function (e) { + if (e.source_view || e.format === 'raw') { + return; + } + e.content = replaceBlobUris(e.content); + }); + editor.on('PostRender', function () { + editor.parser.addNodeFilter('img', function (images) { + each(images, function (img) { + var src = img.attr('src'); + if (blobCache.getByUri(src)) { + return; + } + var resultUri = uploadStatus.getResultUri(src); + if (resultUri) { + img.attr('src', resultUri); + } + }); + }); + }); + return { + blobCache: blobCache, + addFilter: addFilter, + uploadImages: uploadImages, + uploadImagesAuto: uploadImagesAuto, + scanForImages: scanForImages, + destroy: destroy + }; + }; + + var setup$5 = function (registeredFormatListeners, editor) { + var currentFormats = Cell({}); + registeredFormatListeners.set({}); + editor.on('NodeChange', function (e) { + updateAndFireChangeCallbacks(editor, e.element, currentFormats, registeredFormatListeners.get()); + }); + }; + var updateAndFireChangeCallbacks = function (editor, elm, currentFormats, formatChangeData) { + var formatsList = keys(currentFormats.get()); + var newFormats = {}; + var matchedFormats = {}; + var parents = filter(getParents$1(editor.dom, elm), function (node) { + return node.nodeType === 1 && !node.getAttribute('data-mce-bogus'); + }); + each$1(formatChangeData, function (data, format) { + Tools.each(parents, function (node) { + if (editor.formatter.matchNode(node, format, {}, data.similar)) { + if (formatsList.indexOf(format) === -1) { + each(data.callbacks, function (callback) { + callback(true, { + node: node, + format: format, + parents: parents + }); + }); + newFormats[format] = data.callbacks; + } + matchedFormats[format] = data.callbacks; + return false; + } + if (matchesUnInheritedFormatSelector(editor, node, format)) { + return false; + } + }); + }); + var remainingFormats = filterRemainingFormats(currentFormats.get(), matchedFormats, elm, parents); + currentFormats.set(__assign(__assign({}, newFormats), remainingFormats)); + }; + var filterRemainingFormats = function (currentFormats, matchedFormats, elm, parents) { + return bifilter(currentFormats, function (callbacks, format) { + if (!has(matchedFormats, format)) { + each(callbacks, function (callback) { + callback(false, { + node: elm, + format: format, + parents: parents + }); + }); + return false; + } else { + return true; + } + }).t; + }; + var addListeners = function (registeredFormatListeners, formats, callback, similar) { + var formatChangeItems = registeredFormatListeners.get(); + each(formats.split(','), function (format) { + if (!formatChangeItems[format]) { + formatChangeItems[format] = { + similar: similar, + callbacks: [] + }; + } + formatChangeItems[format].callbacks.push(callback); + }); + registeredFormatListeners.set(formatChangeItems); + }; + var removeListeners = function (registeredFormatListeners, formats, callback) { + var formatChangeItems = registeredFormatListeners.get(); + each(formats.split(','), function (format) { + formatChangeItems[format].callbacks = filter(formatChangeItems[format].callbacks, function (c) { + return c !== callback; + }); + if (formatChangeItems[format].callbacks.length === 0) { + delete formatChangeItems[format]; + } + }); + registeredFormatListeners.set(formatChangeItems); + }; + var formatChanged = function (editor, registeredFormatListeners, formats, callback, similar) { + if (registeredFormatListeners.get() === null) { + setup$5(registeredFormatListeners, editor); + } + addListeners(registeredFormatListeners, formats, callback, similar); + return { + unbind: function () { + return removeListeners(registeredFormatListeners, formats, callback); + } + }; + }; + + var get$9 = function (dom) { + var formats = { + valigntop: [{ + selector: 'td,th', + styles: { verticalAlign: 'top' } + }], + valignmiddle: [{ + selector: 'td,th', + styles: { verticalAlign: 'middle' } + }], + valignbottom: [{ + selector: 'td,th', + styles: { verticalAlign: 'bottom' } + }], + alignleft: [ + { + selector: 'figure.image', + collapsed: false, + classes: 'align-left', + ceFalseOverride: true, + preview: 'font-family font-size' + }, + { + selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li', + styles: { textAlign: 'left' }, + inherit: false, + preview: false, + defaultBlock: 'div' + }, + { + selector: 'img,table', + collapsed: false, + styles: { float: 'left' }, + preview: 'font-family font-size' + } + ], + aligncenter: [ + { + selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li', + styles: { textAlign: 'center' }, + inherit: false, + preview: 'font-family font-size', + defaultBlock: 'div' + }, + { + selector: 'figure.image', + collapsed: false, + classes: 'align-center', + ceFalseOverride: true, + preview: 'font-family font-size' + }, + { + selector: 'img', + collapsed: false, + styles: { + display: 'block', + marginLeft: 'auto', + marginRight: 'auto' + }, + preview: false + }, + { + selector: 'table', + collapsed: false, + styles: { + marginLeft: 'auto', + marginRight: 'auto' + }, + preview: 'font-family font-size' + } + ], + alignright: [ + { + selector: 'figure.image', + collapsed: false, + classes: 'align-right', + ceFalseOverride: true, + preview: 'font-family font-size' + }, + { + selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li', + styles: { textAlign: 'right' }, + inherit: false, + preview: 'font-family font-size', + defaultBlock: 'div' + }, + { + selector: 'img,table', + collapsed: false, + styles: { float: 'right' }, + preview: 'font-family font-size' + } + ], + alignjustify: [{ + selector: 'figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li', + styles: { textAlign: 'justify' }, + inherit: false, + defaultBlock: 'div', + preview: 'font-family font-size' + }], + bold: [ + { + inline: 'strong', + remove: 'all', + preserve_attributes: [ + 'class', + 'style' + ] + }, + { + inline: 'span', + styles: { fontWeight: 'bold' } + }, + { + inline: 'b', + remove: 'all', + preserve_attributes: [ + 'class', + 'style' + ] + } + ], + italic: [ + { + inline: 'em', + remove: 'all', + preserve_attributes: [ + 'class', + 'style' + ] + }, + { + inline: 'span', + styles: { fontStyle: 'italic' } + }, + { + inline: 'i', + remove: 'all', + preserve_attributes: [ + 'class', + 'style' + ] + } + ], + underline: [ + { + inline: 'span', + styles: { textDecoration: 'underline' }, + exact: true + }, + { + inline: 'u', + remove: 'all', + preserve_attributes: [ + 'class', + 'style' + ] + } + ], + strikethrough: [ + { + inline: 'span', + styles: { textDecoration: 'line-through' }, + exact: true + }, + { + inline: 'strike', + remove: 'all', + preserve_attributes: [ + 'class', + 'style' + ] + } + ], + forecolor: { + inline: 'span', + styles: { color: '%value' }, + links: true, + remove_similar: true, + clear_child_styles: true + }, + hilitecolor: { + inline: 'span', + styles: { backgroundColor: '%value' }, + links: true, + remove_similar: true, + clear_child_styles: true + }, + fontname: { + inline: 'span', + toggle: false, + styles: { fontFamily: '%value' }, + clear_child_styles: true + }, + fontsize: { + inline: 'span', + toggle: false, + styles: { fontSize: '%value' }, + clear_child_styles: true + }, + lineheight: { + selector: 'h1,h2,h3,h4,h5,h6,p,li,td,th,div', + defaultBlock: 'p', + styles: { lineHeight: '%value' } + }, + fontsize_class: { + inline: 'span', + attributes: { class: '%value' } + }, + blockquote: { + block: 'blockquote', + wrapper: true, + remove: 'all' + }, + subscript: { inline: 'sub' }, + superscript: { inline: 'sup' }, + code: { inline: 'code' }, + link: { + inline: 'a', + selector: 'a', + remove: 'all', + split: true, + deep: true, + onmatch: function (node, _fmt, _itemName) { + return isElement$1(node) && node.hasAttribute('href'); + }, + onformat: function (elm, _fmt, vars) { + Tools.each(vars, function (value, key) { + dom.setAttrib(elm, key, value); + }); + } + }, + removeformat: [ + { + selector: 'b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q,del,ins', + remove: 'all', + split: true, + expand: false, + block_expand: true, + deep: true + }, + { + selector: 'span', + attributes: [ + 'style', + 'class' + ], + remove: 'empty', + split: true, + expand: false, + deep: true + }, + { + selector: '*', + attributes: [ + 'style', + 'class' + ], + split: false, + expand: false, + deep: true + } + ] + }; + Tools.each('p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp'.split(/\s/), function (name) { + formats[name] = { + block: name, + remove: 'all' + }; + }); + return formats; + }; + + function FormatRegistry(editor) { + var formats = {}; + var get = function (name) { + return name ? formats[name] : formats; + }; + var has$1 = function (name) { + return has(formats, name); + }; + var register = function (name, format) { + if (name) { + if (typeof name !== 'string') { + Tools.each(name, function (format, name) { + register(name, format); + }); + } else { + if (!isArray(format)) { + format = [format]; + } + Tools.each(format, function (format) { + if (typeof format.deep === 'undefined') { + format.deep = !format.selector; + } + if (typeof format.split === 'undefined') { + format.split = !format.selector || format.inline; + } + if (typeof format.remove === 'undefined' && format.selector && !format.inline) { + format.remove = 'none'; + } + if (format.selector && format.inline) { + format.mixed = true; + format.block_expand = true; + } + if (typeof format.classes === 'string') { + format.classes = format.classes.split(/\s+/); + } + }); + formats[name] = format; + } + } + }; + var unregister = function (name) { + if (name && formats[name]) { + delete formats[name]; + } + return formats; + }; + register(get$9(editor.dom)); + register(getFormats(editor)); + return { + get: get, + has: has$1, + register: register, + unregister: unregister + }; + } + + var each$e = Tools.each; + var dom = DOMUtils$1.DOM; + var parsedSelectorToHtml = function (ancestry, editor) { + var elm, item, fragment; + var schema = editor && editor.schema || Schema({}); + var decorate = function (elm, item) { + if (item.classes.length) { + dom.addClass(elm, item.classes.join(' ')); + } + dom.setAttribs(elm, item.attrs); + }; + var createElement = function (sItem) { + item = typeof sItem === 'string' ? { + name: sItem, + classes: [], + attrs: {} + } : sItem; + var elm = dom.create(item.name); + decorate(elm, item); + return elm; + }; + var getRequiredParent = function (elm, candidate) { + var name = typeof elm !== 'string' ? elm.nodeName.toLowerCase() : elm; + var elmRule = schema.getElementRule(name); + var parentsRequired = elmRule && elmRule.parentsRequired; + if (parentsRequired && parentsRequired.length) { + return candidate && Tools.inArray(parentsRequired, candidate) !== -1 ? candidate : parentsRequired[0]; + } else { + return false; + } + }; + var wrapInHtml = function (elm, ancestry, siblings) { + var parent, parentCandidate; + var ancestor = ancestry.length > 0 && ancestry[0]; + var ancestorName = ancestor && ancestor.name; + var parentRequired = getRequiredParent(elm, ancestorName); + if (parentRequired) { + if (ancestorName === parentRequired) { + parentCandidate = ancestry[0]; + ancestry = ancestry.slice(1); + } else { + parentCandidate = parentRequired; + } + } else if (ancestor) { + parentCandidate = ancestry[0]; + ancestry = ancestry.slice(1); + } else if (!siblings) { + return elm; + } + if (parentCandidate) { + parent = createElement(parentCandidate); + parent.appendChild(elm); + } + if (siblings) { + if (!parent) { + parent = dom.create('div'); + parent.appendChild(elm); + } + Tools.each(siblings, function (sibling) { + var siblingElm = createElement(sibling); + parent.insertBefore(siblingElm, elm); + }); + } + return wrapInHtml(parent, ancestry, parentCandidate && parentCandidate.siblings); + }; + if (ancestry && ancestry.length) { + item = ancestry[0]; + elm = createElement(item); + fragment = dom.create('div'); + fragment.appendChild(wrapInHtml(elm, ancestry.slice(1), item.siblings)); + return fragment; + } else { + return ''; + } + }; + var parseSelectorItem = function (item) { + var tagName; + var obj = { + classes: [], + attrs: {} + }; + item = obj.selector = Tools.trim(item); + if (item !== '*') { + tagName = item.replace(/(?:([#\.]|::?)([\w\-]+)|(\[)([^\]]+)\]?)/g, function ($0, $1, $2, $3, $4) { + switch ($1) { + case '#': + obj.attrs.id = $2; + break; + case '.': + obj.classes.push($2); + break; + case ':': + if (Tools.inArray('checked disabled enabled read-only required'.split(' '), $2) !== -1) { + obj.attrs[$2] = $2; + } + break; + } + if ($3 === '[') { + var m = $4.match(/([\w\-]+)(?:\=\"([^\"]+))?/); + if (m) { + obj.attrs[m[1]] = m[2]; + } + } + return ''; + }); + } + obj.name = tagName || 'div'; + return obj; + }; + var parseSelector = function (selector) { + if (!selector || typeof selector !== 'string') { + return []; + } + selector = selector.split(/\s*,\s*/)[0]; + selector = selector.replace(/\s*(~\+|~|\+|>)\s*/g, '$1'); + return Tools.map(selector.split(/(?:>|\s+(?![^\[\]]+\]))/), function (item) { + var siblings = Tools.map(item.split(/(?:~\+|~|\+)/), parseSelectorItem); + var obj = siblings.pop(); + if (siblings.length) { + obj.siblings = siblings; + } + return obj; + }).reverse(); + }; + var getCssText = function (editor, format) { + var name, previewFrag; + var previewCss = '', parentFontSize; + var previewStyles = getPreviewStyles(editor); + if (previewStyles === '') { + return ''; + } + var removeVars = function (val) { + return val.replace(/%(\w+)/g, ''); + }; + if (typeof format === 'string') { + format = editor.formatter.get(format); + if (!format) { + return; + } + format = format[0]; + } + if ('preview' in format) { + var previewOpt = get(format, 'preview'); + if (previewOpt.is(false)) { + return ''; + } else { + previewStyles = previewOpt.getOr(previewStyles); + } + } + name = format.block || format.inline || 'span'; + var items = parseSelector(format.selector); + if (items.length) { + if (!items[0].name) { + items[0].name = name; + } + name = format.selector; + previewFrag = parsedSelectorToHtml(items, editor); + } else { + previewFrag = parsedSelectorToHtml([name], editor); + } + var previewElm = dom.select(name, previewFrag)[0] || previewFrag.firstChild; + each$e(format.styles, function (value, name) { + var newValue = removeVars(value); + if (newValue) { + dom.setStyle(previewElm, name, newValue); + } + }); + each$e(format.attributes, function (value, name) { + var newValue = removeVars(value); + if (newValue) { + dom.setAttrib(previewElm, name, newValue); + } + }); + each$e(format.classes, function (value) { + var newValue = removeVars(value); + if (!dom.hasClass(previewElm, newValue)) { + dom.addClass(previewElm, newValue); + } + }); + editor.fire('PreviewFormats'); + dom.setStyles(previewFrag, { + position: 'absolute', + left: -65535 + }); + editor.getBody().appendChild(previewFrag); + parentFontSize = dom.getStyle(editor.getBody(), 'fontSize', true); + parentFontSize = /px$/.test(parentFontSize) ? parseInt(parentFontSize, 10) : 0; + each$e(previewStyles.split(' '), function (name) { + var value = dom.getStyle(previewElm, name, true); + if (name === 'background-color' && /transparent|rgba\s*\([^)]+,\s*0\)/.test(value)) { + value = dom.getStyle(editor.getBody(), name, true); + if (dom.toHex(value).toLowerCase() === '#ffffff') { + return; + } + } + if (name === 'color') { + if (dom.toHex(value).toLowerCase() === '#000000') { + return; + } + } + if (name === 'font-size') { + if (/em|%$/.test(value)) { + if (parentFontSize === 0) { + return; + } + var numValue = parseFloat(value) / (/%$/.test(value) ? 100 : 1); + value = numValue * parentFontSize + 'px'; + } + } + if (name === 'border' && value) { + previewCss += 'padding:0 2px;'; + } + previewCss += name + ':' + value + ';'; + }); + editor.fire('AfterPreviewFormats'); + dom.remove(previewFrag); + return previewCss; + }; + + var setup$6 = function (editor) { + editor.addShortcut('meta+b', '', 'Bold'); + editor.addShortcut('meta+i', '', 'Italic'); + editor.addShortcut('meta+u', '', 'Underline'); + for (var i = 1; i <= 6; i++) { + editor.addShortcut('access+' + i, '', [ + 'FormatBlock', + false, + 'h' + i + ]); + } + editor.addShortcut('access+7', '', [ + 'FormatBlock', + false, + 'p' + ]); + editor.addShortcut('access+8', '', [ + 'FormatBlock', + false, + 'div' + ]); + editor.addShortcut('access+9', '', [ + 'FormatBlock', + false, + 'address' + ]); + }; + + var Formatter = function (editor) { + var formats = FormatRegistry(editor); + var formatChangeState = Cell(null); + setup$6(editor); + setup$3(editor); + return { + get: formats.get, + has: formats.has, + register: formats.register, + unregister: formats.unregister, + apply: function (name, vars, node) { + applyFormat$1(editor, name, vars, node); + }, + remove: function (name, vars, node, similar) { + removeFormat$1(editor, name, vars, node, similar); + }, + toggle: function (name, vars, node) { + toggleFormat(editor, name, vars, node); + }, + match: curry(match, editor), + matchAll: curry(matchAll, editor), + matchNode: curry(matchNode, editor), + canApply: curry(canApply, editor), + formatChanged: curry(formatChanged, editor, formatChangeState), + getCssText: curry(getCssText, editor) + }; + }; + + var registerEvents$1 = function (editor, undoManager, locks) { + var isFirstTypedCharacter = Cell(false); + var addNonTypingUndoLevel = function (e) { + setTyping(undoManager, false, locks); + undoManager.add({}, e); + }; + editor.on('init', function () { + undoManager.add(); + }); + editor.on('BeforeExecCommand', function (e) { + var cmd = e.command.toLowerCase(); + if (cmd !== 'undo' && cmd !== 'redo' && cmd !== 'mcerepaint') { + endTyping(undoManager, locks); + undoManager.beforeChange(); + } + }); + editor.on('ExecCommand', function (e) { + var cmd = e.command.toLowerCase(); + if (cmd !== 'undo' && cmd !== 'redo' && cmd !== 'mcerepaint') { + addNonTypingUndoLevel(e); + } + }); + editor.on('ObjectResizeStart cut', function () { + undoManager.beforeChange(); + }); + editor.on('SaveContent ObjectResized blur', addNonTypingUndoLevel); + editor.on('dragend', addNonTypingUndoLevel); + editor.on('keyup', function (e) { + var keyCode = e.keyCode; + if (e.isDefaultPrevented()) { + return; + } + if (keyCode >= 33 && keyCode <= 36 || keyCode >= 37 && keyCode <= 40 || keyCode === 45 || e.ctrlKey) { + addNonTypingUndoLevel(); + editor.nodeChanged(); + } + if (keyCode === 46 || keyCode === 8) { + editor.nodeChanged(); + } + if (isFirstTypedCharacter.get() && undoManager.typing && isEq$4(createFromEditor(editor), undoManager.data[0]) === false) { + if (editor.isDirty() === false) { + editor.setDirty(true); + editor.fire('change', { + level: undoManager.data[0], + lastLevel: null + }); + } + editor.fire('TypingUndo'); + isFirstTypedCharacter.set(false); + editor.nodeChanged(); + } + }); + editor.on('keydown', function (e) { + var keyCode = e.keyCode; + if (e.isDefaultPrevented()) { + return; + } + if (keyCode >= 33 && keyCode <= 36 || keyCode >= 37 && keyCode <= 40 || keyCode === 45) { + if (undoManager.typing) { + addNonTypingUndoLevel(e); + } + return; + } + var modKey = e.ctrlKey && !e.altKey || e.metaKey; + if ((keyCode < 16 || keyCode > 20) && keyCode !== 224 && keyCode !== 91 && !undoManager.typing && !modKey) { + undoManager.beforeChange(); + setTyping(undoManager, true, locks); + undoManager.add({}, e); + isFirstTypedCharacter.set(true); + } + }); + editor.on('mousedown', function (e) { + if (undoManager.typing) { + addNonTypingUndoLevel(e); + } + }); + var isInsertReplacementText = function (event) { + return event.inputType === 'insertReplacementText'; + }; + var isInsertTextDataNull = function (event) { + return event.inputType === 'insertText' && event.data === null; + }; + var isInsertFromPasteOrDrop = function (event) { + return event.inputType === 'insertFromPaste' || event.inputType === 'insertFromDrop'; + }; + editor.on('input', function (e) { + if (e.inputType && (isInsertReplacementText(e) || isInsertTextDataNull(e) || isInsertFromPasteOrDrop(e))) { + addNonTypingUndoLevel(e); + } + }); + editor.on('AddUndo Undo Redo ClearUndos', function (e) { + if (!e.isDefaultPrevented()) { + editor.nodeChanged(); + } + }); + }; + var addKeyboardShortcuts = function (editor) { + editor.addShortcut('meta+z', '', 'Undo'); + editor.addShortcut('meta+y,meta+shift+z', '', 'Redo'); + }; + + var UndoManager = function (editor) { + var beforeBookmark = Cell(Optional.none()); + var locks = Cell(0); + var index = Cell(0); + var undoManager = { + data: [], + typing: false, + beforeChange: function () { + beforeChange$1(editor, locks, beforeBookmark); + }, + add: function (level, event) { + return addUndoLevel$1(editor, undoManager, index, locks, beforeBookmark, level, event); + }, + undo: function () { + return undo$1(editor, undoManager, locks, index); + }, + redo: function () { + return redo$1(editor, index, undoManager.data); + }, + clear: function () { + clear$1(editor, undoManager, index); + }, + reset: function () { + reset$1(editor, undoManager); + }, + hasUndo: function () { + return hasUndo$1(editor, undoManager, index); + }, + hasRedo: function () { + return hasRedo$1(editor, undoManager, index); + }, + transact: function (callback) { + return transact$1(editor, undoManager, locks, callback); + }, + ignore: function (callback) { + ignore$1(editor, locks, callback); + }, + extra: function (callback1, callback2) { + extra$1(editor, undoManager, index, callback1, callback2); + } + }; + if (!isRtc(editor)) { + registerEvents$1(editor, undoManager, locks); + } + addKeyboardShortcuts(editor); + return undoManager; + }; + + var nonTypingKeycodes = [ + 9, + 27, + VK.HOME, + VK.END, + 19, + 20, + 44, + 144, + 145, + 33, + 34, + 45, + 16, + 17, + 18, + 91, + 92, + 93, + VK.DOWN, + VK.UP, + VK.LEFT, + VK.RIGHT + ].concat(Env.browser.isFirefox() ? [224] : []); + var placeholderAttr = 'data-mce-placeholder'; + var isKeyboardEvent = function (e) { + return e.type === 'keydown' || e.type === 'keyup'; + }; + var isDeleteEvent = function (e) { + var keyCode = e.keyCode; + return keyCode === VK.BACKSPACE || keyCode === VK.DELETE; + }; + var isNonTypingKeyboardEvent = function (e) { + if (isKeyboardEvent(e)) { + var keyCode = e.keyCode; + return !isDeleteEvent(e) && (VK.metaKeyPressed(e) || e.altKey || keyCode >= 112 && keyCode <= 123 || contains(nonTypingKeycodes, keyCode)); + } else { + return false; + } + }; + var isTypingKeyboardEvent = function (e) { + return isKeyboardEvent(e) && !(isDeleteEvent(e) || e.type === 'keyup' && e.keyCode === 229); + }; + var isVisuallyEmpty = function (dom, rootElm, forcedRootBlock) { + if (isEmpty(SugarElement.fromDom(rootElm), false)) { + var isForcedRootBlockFalse = forcedRootBlock === ''; + var firstElement = rootElm.firstElementChild; + if (!firstElement) { + return true; + } else if (dom.getStyle(rootElm.firstElementChild, 'padding-left') || dom.getStyle(rootElm.firstElementChild, 'padding-right')) { + return false; + } else { + return isForcedRootBlockFalse ? !dom.isBlock(firstElement) : forcedRootBlock === firstElement.nodeName.toLowerCase(); + } + } else { + return false; + } + }; + var setup$7 = function (editor) { + var dom = editor.dom; + var rootBlock = getForcedRootBlock(editor); + var placeholder = getPlaceholder(editor); + var updatePlaceholder = function (e, initial) { + if (isNonTypingKeyboardEvent(e)) { + return; + } + var body = editor.getBody(); + var showPlaceholder = isTypingKeyboardEvent(e) ? false : isVisuallyEmpty(dom, body, rootBlock); + var isPlaceholderShown = dom.getAttrib(body, placeholderAttr) !== ''; + if (isPlaceholderShown !== showPlaceholder || initial) { + dom.setAttrib(body, placeholderAttr, showPlaceholder ? placeholder : null); + dom.setAttrib(body, 'aria-placeholder', showPlaceholder ? placeholder : null); + firePlaceholderToggle(editor, showPlaceholder); + editor.on(showPlaceholder ? 'keydown' : 'keyup', updatePlaceholder); + editor.off(showPlaceholder ? 'keyup' : 'keydown', updatePlaceholder); + } + }; + if (placeholder) { + editor.on('init', function (e) { + updatePlaceholder(e, true); + editor.on('change SetContent ExecCommand', updatePlaceholder); + editor.on('paste', function (e) { + return Delay.setEditorTimeout(editor, function () { + return updatePlaceholder(e); + }); + }); + }); + } + }; + + var strongRtl = /[\u0591-\u07FF\uFB1D-\uFDFF\uFE70-\uFEFC]/; + var hasStrongRtl = function (text) { + return strongRtl.test(text); + }; + + var isInlineTarget = function (editor, elm) { + return is$1(SugarElement.fromDom(elm), getInlineBoundarySelector(editor)); + }; + var isRtl$1 = function (element) { + return DOMUtils$1.DOM.getStyle(element, 'direction', true) === 'rtl' || hasStrongRtl(element.textContent); + }; + var findInlineParents = function (isInlineTarget, rootNode, pos) { + return filter(DOMUtils$1.DOM.getParents(pos.container(), '*', rootNode), isInlineTarget); + }; + var findRootInline = function (isInlineTarget, rootNode, pos) { + var parents = findInlineParents(isInlineTarget, rootNode, pos); + return Optional.from(parents[parents.length - 1]); + }; + var hasSameParentBlock = function (rootNode, node1, node2) { + var block1 = getParentBlock(node1, rootNode); + var block2 = getParentBlock(node2, rootNode); + return block1 && block1 === block2; + }; + var isAtZwsp = function (pos) { + return isBeforeInline(pos) || isAfterInline(pos); + }; + var normalizePosition = function (forward, pos) { + if (!pos) { + return pos; + } + var container = pos.container(), offset = pos.offset(); + if (forward) { + if (isCaretContainerInline(container)) { + if (isText$1(container.nextSibling)) { + return CaretPosition$1(container.nextSibling, 0); + } else { + return CaretPosition$1.after(container); + } + } else { + return isBeforeInline(pos) ? CaretPosition$1(container, offset + 1) : pos; + } + } else { + if (isCaretContainerInline(container)) { + if (isText$1(container.previousSibling)) { + return CaretPosition$1(container.previousSibling, container.previousSibling.data.length); + } else { + return CaretPosition$1.before(container); + } + } else { + return isAfterInline(pos) ? CaretPosition$1(container, offset - 1) : pos; + } + } + }; + var normalizeForwards = curry(normalizePosition, true); + var normalizeBackwards = curry(normalizePosition, false); + + var isBeforeRoot = function (rootNode) { + return function (elm) { + return eq$2(rootNode, SugarElement.fromDom(elm.dom.parentNode)); + }; + }; + var getParentBlock$1 = function (rootNode, elm) { + return contains$2(rootNode, elm) ? closest(elm, function (element) { + return isTextBlock(element) || isListItem(element); + }, isBeforeRoot(rootNode)) : Optional.none(); + }; + var placeCaretInEmptyBody = function (editor) { + var body = editor.getBody(); + var node = body.firstChild && editor.dom.isBlock(body.firstChild) ? body.firstChild : body; + editor.selection.setCursorLocation(node, 0); + }; + var paddEmptyBody = function (editor) { + if (editor.dom.isEmpty(editor.getBody())) { + editor.setContent(''); + placeCaretInEmptyBody(editor); + } + }; + var willDeleteLastPositionInElement = function (forward, fromPos, elm) { + return lift2(firstPositionIn(elm), lastPositionIn(elm), function (firstPos, lastPos) { + var normalizedFirstPos = normalizePosition(true, firstPos); + var normalizedLastPos = normalizePosition(false, lastPos); + var normalizedFromPos = normalizePosition(false, fromPos); + if (forward) { + return nextPosition(elm, normalizedFromPos).exists(function (nextPos) { + return nextPos.isEqual(normalizedLastPos) && fromPos.isEqual(normalizedFirstPos); + }); + } else { + return prevPosition(elm, normalizedFromPos).exists(function (prevPos) { + return prevPos.isEqual(normalizedFirstPos) && fromPos.isEqual(normalizedLastPos); + }); + } + }).getOr(true); + }; + + var blockPosition = function (block, position) { + return { + block: block, + position: position + }; + }; + var blockBoundary = function (from, to) { + return { + from: from, + to: to + }; + }; + var getBlockPosition = function (rootNode, pos) { + var rootElm = SugarElement.fromDom(rootNode); + var containerElm = SugarElement.fromDom(pos.container()); + return getParentBlock$1(rootElm, containerElm).map(function (block) { + return blockPosition(block, pos); + }); + }; + var isDifferentBlocks = function (blockBoundary) { + return eq$2(blockBoundary.from.block, blockBoundary.to.block) === false; + }; + var hasSameParent = function (blockBoundary) { + return parent(blockBoundary.from.block).bind(function (parent1) { + return parent(blockBoundary.to.block).filter(function (parent2) { + return eq$2(parent1, parent2); + }); + }).isSome(); + }; + var isEditable = function (blockBoundary) { + return isContentEditableFalse(blockBoundary.from.block.dom) === false && isContentEditableFalse(blockBoundary.to.block.dom) === false; + }; + var skipLastBr = function (rootNode, forward, blockPosition) { + if (isBr(blockPosition.position.getNode()) && isEmpty(blockPosition.block) === false) { + return positionIn(false, blockPosition.block.dom).bind(function (lastPositionInBlock) { + if (lastPositionInBlock.isEqual(blockPosition.position)) { + return fromPosition(forward, rootNode, lastPositionInBlock).bind(function (to) { + return getBlockPosition(rootNode, to); + }); + } else { + return Optional.some(blockPosition); + } + }).getOr(blockPosition); + } else { + return blockPosition; + } + }; + var readFromRange = function (rootNode, forward, rng) { + var fromBlockPos = getBlockPosition(rootNode, CaretPosition$1.fromRangeStart(rng)); + var toBlockPos = fromBlockPos.bind(function (blockPos) { + return fromPosition(forward, rootNode, blockPos.position).bind(function (to) { + return getBlockPosition(rootNode, to).map(function (blockPos) { + return skipLastBr(rootNode, forward, blockPos); + }); + }); + }); + return lift2(fromBlockPos, toBlockPos, blockBoundary).filter(function (blockBoundary) { + return isDifferentBlocks(blockBoundary) && hasSameParent(blockBoundary) && isEditable(blockBoundary); + }); + }; + var read$3 = function (rootNode, forward, rng) { + return rng.collapsed ? readFromRange(rootNode, forward, rng) : Optional.none(); + }; + + var getChildrenUntilBlockBoundary = function (block) { + var children$1 = children(block); + return findIndex(children$1, isBlock).fold(function () { + return children$1; + }, function (index) { + return children$1.slice(0, index); + }); + }; + var extractChildren = function (block) { + var children = getChildrenUntilBlockBoundary(block); + each(children, remove); + return children; + }; + var removeEmptyRoot = function (rootNode, block) { + var parents = parentsAndSelf(block, rootNode); + return find(parents.reverse(), function (element) { + return isEmpty(element); + }).each(remove); + }; + var isEmptyBefore = function (el) { + return filter(prevSiblings(el), function (el) { + return !isEmpty(el); + }).length === 0; + }; + var nestedBlockMerge = function (rootNode, fromBlock, toBlock, insertionPoint) { + if (isEmpty(toBlock)) { + fillWithPaddingBr(toBlock); + return firstPositionIn(toBlock.dom); + } + if (isEmptyBefore(insertionPoint) && isEmpty(fromBlock)) { + before(insertionPoint, SugarElement.fromTag('br')); + } + var position = prevPosition(toBlock.dom, CaretPosition$1.before(insertionPoint.dom)); + each(extractChildren(fromBlock), function (child) { + before(insertionPoint, child); + }); + removeEmptyRoot(rootNode, fromBlock); + return position; + }; + var sidelongBlockMerge = function (rootNode, fromBlock, toBlock) { + if (isEmpty(toBlock)) { + remove(toBlock); + if (isEmpty(fromBlock)) { + fillWithPaddingBr(fromBlock); + } + return firstPositionIn(fromBlock.dom); + } + var position = lastPositionIn(toBlock.dom); + each(extractChildren(fromBlock), function (child) { + append(toBlock, child); + }); + removeEmptyRoot(rootNode, fromBlock); + return position; + }; + var findInsertionPoint = function (toBlock, block) { + var parentsAndSelf$1 = parentsAndSelf(block, toBlock); + return Optional.from(parentsAndSelf$1[parentsAndSelf$1.length - 1]); + }; + var getInsertionPoint = function (fromBlock, toBlock) { + return contains$2(toBlock, fromBlock) ? findInsertionPoint(toBlock, fromBlock) : Optional.none(); + }; + var trimBr = function (first, block) { + positionIn(first, block.dom).map(function (position) { + return position.getNode(); + }).map(SugarElement.fromDom).filter(isBr$1).each(remove); + }; + var mergeBlockInto = function (rootNode, fromBlock, toBlock) { + trimBr(true, fromBlock); + trimBr(false, toBlock); + return getInsertionPoint(fromBlock, toBlock).fold(curry(sidelongBlockMerge, rootNode, fromBlock, toBlock), curry(nestedBlockMerge, rootNode, fromBlock, toBlock)); + }; + var mergeBlocks = function (rootNode, forward, block1, block2) { + return forward ? mergeBlockInto(rootNode, block2, block1) : mergeBlockInto(rootNode, block1, block2); + }; + + var backspaceDelete$1 = function (editor, forward) { + var rootNode = SugarElement.fromDom(editor.getBody()); + var position = read$3(rootNode.dom, forward, editor.selection.getRng()).bind(function (blockBoundary) { + return mergeBlocks(rootNode, forward, blockBoundary.from.block, blockBoundary.to.block); + }); + position.each(function (pos) { + editor.selection.setRng(pos.toRange()); + }); + return position.isSome(); + }; + + var deleteRangeMergeBlocks = function (rootNode, selection) { + var rng = selection.getRng(); + return lift2(getParentBlock$1(rootNode, SugarElement.fromDom(rng.startContainer)), getParentBlock$1(rootNode, SugarElement.fromDom(rng.endContainer)), function (block1, block2) { + if (eq$2(block1, block2) === false) { + rng.deleteContents(); + mergeBlocks(rootNode, true, block1, block2).each(function (pos) { + selection.setRng(pos.toRange()); + }); + return true; + } else { + return false; + } + }).getOr(false); + }; + var isRawNodeInTable = function (root, rawNode) { + var node = SugarElement.fromDom(rawNode); + var isRoot = curry(eq$2, root); + return ancestor(node, isTableCell$1, isRoot).isSome(); + }; + var isSelectionInTable = function (root, rng) { + return isRawNodeInTable(root, rng.startContainer) || isRawNodeInTable(root, rng.endContainer); + }; + var isEverythingSelected = function (root, rng) { + var noPrevious = prevPosition(root.dom, CaretPosition$1.fromRangeStart(rng)).isNone(); + var noNext = nextPosition(root.dom, CaretPosition$1.fromRangeEnd(rng)).isNone(); + return !isSelectionInTable(root, rng) && noPrevious && noNext; + }; + var emptyEditor = function (editor) { + editor.setContent(''); + editor.selection.setCursorLocation(); + return true; + }; + var deleteRange$1 = function (editor) { + var rootNode = SugarElement.fromDom(editor.getBody()); + var rng = editor.selection.getRng(); + return isEverythingSelected(rootNode, rng) ? emptyEditor(editor) : deleteRangeMergeBlocks(rootNode, editor.selection); + }; + var backspaceDelete$2 = function (editor, _forward) { + return editor.selection.isCollapsed() ? false : deleteRange$1(editor); + }; + + var isContentEditableTrue$2 = isContentEditableTrue; + var isContentEditableFalse$7 = isContentEditableFalse; + var showCaret = function (direction, editor, node, before, scrollIntoView) { + return Optional.from(editor._selectionOverrides.showCaret(direction, node, before, scrollIntoView)); + }; + var getNodeRange = function (node) { + var rng = node.ownerDocument.createRange(); + rng.selectNode(node); + return rng; + }; + var selectNode = function (editor, node) { + var e = editor.fire('BeforeObjectSelected', { target: node }); + if (e.isDefaultPrevented()) { + return Optional.none(); + } + return Optional.some(getNodeRange(node)); + }; + var renderCaretAtRange = function (editor, range, scrollIntoView) { + var normalizedRange = normalizeRange(1, editor.getBody(), range); + var caretPosition = CaretPosition$1.fromRangeStart(normalizedRange); + var caretPositionNode = caretPosition.getNode(); + if (isInlineFakeCaretTarget(caretPositionNode)) { + return showCaret(1, editor, caretPositionNode, !caretPosition.isAtEnd(), false); + } + var caretPositionBeforeNode = caretPosition.getNode(true); + if (isInlineFakeCaretTarget(caretPositionBeforeNode)) { + return showCaret(1, editor, caretPositionBeforeNode, false, false); + } + var ceRoot = editor.dom.getParent(caretPosition.getNode(), function (node) { + return isContentEditableFalse$7(node) || isContentEditableTrue$2(node); + }); + if (isInlineFakeCaretTarget(ceRoot)) { + return showCaret(1, editor, ceRoot, false, scrollIntoView); + } + return Optional.none(); + }; + var renderRangeCaret = function (editor, range, scrollIntoView) { + return range.collapsed ? renderCaretAtRange(editor, range, scrollIntoView).getOr(range) : range; + }; + + var isBeforeBoundary = function (pos) { + return isBeforeContentEditableFalse(pos) || isBeforeMedia(pos); + }; + var isAfterBoundary = function (pos) { + return isAfterContentEditableFalse(pos) || isAfterMedia(pos); + }; + var trimEmptyTextNode$1 = function (dom, node) { + if (isText$1(node) && node.data.length === 0) { + dom.remove(node); + } + }; + var deleteContentAndShowCaret = function (editor, range, node, direction, forward, peekCaretPosition) { + showCaret(direction, editor, peekCaretPosition.getNode(!forward), forward, true).each(function (caretRange) { + if (range.collapsed) { + var deleteRange = range.cloneRange(); + if (forward) { + deleteRange.setEnd(caretRange.startContainer, caretRange.startOffset); + } else { + deleteRange.setStart(caretRange.endContainer, caretRange.endOffset); + } + deleteRange.deleteContents(); + } else { + range.deleteContents(); + } + editor.selection.setRng(caretRange); + }); + trimEmptyTextNode$1(editor.dom, node); + return true; + }; + var deleteBoundaryText = function (editor, forward) { + var range = editor.selection.getRng(); + if (!isText$1(range.commonAncestorContainer)) { + return false; + } + var direction = forward ? HDirection.Forwards : HDirection.Backwards; + var caretWalker = CaretWalker(editor.getBody()); + var getNextPosFn = curry(getVisualCaretPosition, forward ? caretWalker.next : caretWalker.prev); + var isBeforeFn = forward ? isBeforeBoundary : isAfterBoundary; + var caretPosition = getNormalizedRangeEndPoint(direction, editor.getBody(), range); + var nextCaretPosition = normalizePosition(forward, getNextPosFn(caretPosition)); + if (!nextCaretPosition || !isMoveInsideSameBlock(caretPosition, nextCaretPosition)) { + return false; + } else if (isBeforeFn(nextCaretPosition)) { + return deleteContentAndShowCaret(editor, range, caretPosition.getNode(), direction, forward, nextCaretPosition); + } + var peekCaretPosition = getNextPosFn(nextCaretPosition); + if (peekCaretPosition && isBeforeFn(peekCaretPosition)) { + if (isMoveInsideSameBlock(nextCaretPosition, peekCaretPosition)) { + return deleteContentAndShowCaret(editor, range, caretPosition.getNode(), direction, forward, peekCaretPosition); + } + } + return false; + }; + var backspaceDelete$3 = function (editor, forward) { + return deleteBoundaryText(editor, forward); + }; + + var isCompoundElement = function (node) { + return isTableCell$1(SugarElement.fromDom(node)) || isListItem(SugarElement.fromDom(node)); + }; + var DeleteAction = Adt.generate([ + { remove: ['element'] }, + { moveToElement: ['element'] }, + { moveToPosition: ['position'] } + ]); + var isAtContentEditableBlockCaret = function (forward, from) { + var elm = from.getNode(forward === false); + var caretLocation = forward ? 'after' : 'before'; + return isElement$1(elm) && elm.getAttribute('data-mce-caret') === caretLocation; + }; + var isDeleteFromCefDifferentBlocks = function (root, forward, from, to) { + var inSameBlock = function (elm) { + return isInline(SugarElement.fromDom(elm)) && !isInSameBlock(from, to, root); + }; + return getRelativeCefElm(!forward, from).fold(function () { + return getRelativeCefElm(forward, to).fold(never, inSameBlock); + }, inSameBlock); + }; + var deleteEmptyBlockOrMoveToCef = function (root, forward, from, to) { + var toCefElm = to.getNode(forward === false); + return getParentBlock$1(SugarElement.fromDom(root), SugarElement.fromDom(from.getNode())).map(function (blockElm) { + return isEmpty(blockElm) ? DeleteAction.remove(blockElm.dom) : DeleteAction.moveToElement(toCefElm); + }).orThunk(function () { + return Optional.some(DeleteAction.moveToElement(toCefElm)); + }); + }; + var findCefPosition = function (root, forward, from) { + return fromPosition(forward, root, from).bind(function (to) { + if (isCompoundElement(to.getNode())) { + return Optional.none(); + } else if (isDeleteFromCefDifferentBlocks(root, forward, from, to)) { + return Optional.none(); + } else if (forward && isContentEditableFalse(to.getNode())) { + return deleteEmptyBlockOrMoveToCef(root, forward, from, to); + } else if (forward === false && isContentEditableFalse(to.getNode(true))) { + return deleteEmptyBlockOrMoveToCef(root, forward, from, to); + } else if (forward && isAfterContentEditableFalse(from)) { + return Optional.some(DeleteAction.moveToPosition(to)); + } else if (forward === false && isBeforeContentEditableFalse(from)) { + return Optional.some(DeleteAction.moveToPosition(to)); + } else { + return Optional.none(); + } + }); + }; + var getContentEditableBlockAction = function (forward, elm) { + if (forward && isContentEditableFalse(elm.nextSibling)) { + return Optional.some(DeleteAction.moveToElement(elm.nextSibling)); + } else if (forward === false && isContentEditableFalse(elm.previousSibling)) { + return Optional.some(DeleteAction.moveToElement(elm.previousSibling)); + } else { + return Optional.none(); + } + }; + var skipMoveToActionFromInlineCefToContent = function (root, from, deleteAction) { + return deleteAction.fold(function (elm) { + return Optional.some(DeleteAction.remove(elm)); + }, function (elm) { + return Optional.some(DeleteAction.moveToElement(elm)); + }, function (to) { + if (isInSameBlock(from, to, root)) { + return Optional.none(); + } else { + return Optional.some(DeleteAction.moveToPosition(to)); + } + }); + }; + var getContentEditableAction = function (root, forward, from) { + if (isAtContentEditableBlockCaret(forward, from)) { + return getContentEditableBlockAction(forward, from.getNode(forward === false)).fold(function () { + return findCefPosition(root, forward, from); + }, Optional.some); + } else { + return findCefPosition(root, forward, from).bind(function (deleteAction) { + return skipMoveToActionFromInlineCefToContent(root, from, deleteAction); + }); + } + }; + var read$4 = function (root, forward, rng) { + var normalizedRange = normalizeRange(forward ? 1 : -1, root, rng); + var from = CaretPosition$1.fromRangeStart(normalizedRange); + var rootElement = SugarElement.fromDom(root); + if (forward === false && isAfterContentEditableFalse(from)) { + return Optional.some(DeleteAction.remove(from.getNode(true))); + } else if (forward && isBeforeContentEditableFalse(from)) { + return Optional.some(DeleteAction.remove(from.getNode())); + } else if (forward === false && isBeforeContentEditableFalse(from) && isAfterBr(rootElement, from)) { + return findPreviousBr(rootElement, from).map(function (br) { + return DeleteAction.remove(br.getNode()); + }); + } else if (forward && isAfterContentEditableFalse(from) && isBeforeBr(rootElement, from)) { + return findNextBr(rootElement, from).map(function (br) { + return DeleteAction.remove(br.getNode()); + }); + } else { + return getContentEditableAction(root, forward, from); + } + }; + + var deleteElement$1 = function (editor, forward) { + return function (element) { + editor._selectionOverrides.hideFakeCaret(); + deleteElement(editor, forward, SugarElement.fromDom(element)); + return true; + }; + }; + var moveToElement = function (editor, forward) { + return function (element) { + var pos = forward ? CaretPosition$1.before(element) : CaretPosition$1.after(element); + editor.selection.setRng(pos.toRange()); + return true; + }; + }; + var moveToPosition = function (editor) { + return function (pos) { + editor.selection.setRng(pos.toRange()); + return true; + }; + }; + var getAncestorCe = function (editor, node) { + return Optional.from(getContentEditableRoot(editor.getBody(), node)); + }; + var backspaceDeleteCaret = function (editor, forward) { + var selectedNode = editor.selection.getNode(); + return getAncestorCe(editor, selectedNode).filter(isContentEditableFalse).fold(function () { + return read$4(editor.getBody(), forward, editor.selection.getRng()).exists(function (deleteAction) { + return deleteAction.fold(deleteElement$1(editor, forward), moveToElement(editor, forward), moveToPosition(editor)); + }); + }, always); + }; + var deleteOffscreenSelection = function (rootElement) { + each(descendants$1(rootElement, '.mce-offscreen-selection'), remove); + }; + var backspaceDeleteRange = function (editor, forward) { + var selectedNode = editor.selection.getNode(); + if (isContentEditableFalse(selectedNode)) { + var hasCefAncestor = getAncestorCe(editor, selectedNode.parentNode).filter(isContentEditableFalse); + return hasCefAncestor.fold(function () { + deleteOffscreenSelection(SugarElement.fromDom(editor.getBody())); + deleteElement(editor, forward, SugarElement.fromDom(editor.selection.getNode())); + paddEmptyBody(editor); + return true; + }, function () { + return true; + }); + } + return false; + }; + var paddEmptyElement = function (editor) { + var dom = editor.dom, selection = editor.selection; + var ceRoot = getContentEditableRoot(editor.getBody(), selection.getNode()); + if (isContentEditableTrue(ceRoot) && dom.isBlock(ceRoot) && dom.isEmpty(ceRoot)) { + var br = dom.create('br', { 'data-mce-bogus': '1' }); + dom.setHTML(ceRoot, ''); + ceRoot.appendChild(br); + selection.setRng(CaretPosition$1.before(br).toRange()); + } + return true; + }; + var backspaceDelete$4 = function (editor, forward) { + if (editor.selection.isCollapsed()) { + return backspaceDeleteCaret(editor, forward); + } else { + return backspaceDeleteRange(editor, forward); + } + }; + + var deleteCaret$1 = function (editor, forward) { + var fromPos = CaretPosition$1.fromRangeStart(editor.selection.getRng()); + return fromPosition(forward, editor.getBody(), fromPos).filter(function (pos) { + return forward ? isBeforeImageBlock(pos) : isAfterImageBlock(pos); + }).bind(function (pos) { + return Optional.from(getChildNodeAtRelativeOffset(forward ? 0 : -1, pos)); + }).exists(function (elm) { + editor.selection.select(elm); + return true; + }); + }; + var backspaceDelete$5 = function (editor, forward) { + return editor.selection.isCollapsed() ? deleteCaret$1(editor, forward) : false; + }; + + var isText$8 = isText$1; + var startsWithCaretContainer$1 = function (node) { + return isText$8(node) && node.data[0] === ZWSP; + }; + var endsWithCaretContainer$1 = function (node) { + return isText$8(node) && node.data[node.data.length - 1] === ZWSP; + }; + var createZwsp = function (node) { + return node.ownerDocument.createTextNode(ZWSP); + }; + var insertBefore$1 = function (node) { + if (isText$8(node.previousSibling)) { + if (endsWithCaretContainer$1(node.previousSibling)) { + return node.previousSibling; + } else { + node.previousSibling.appendData(ZWSP); + return node.previousSibling; + } + } else if (isText$8(node)) { + if (startsWithCaretContainer$1(node)) { + return node; + } else { + node.insertData(0, ZWSP); + return node; + } + } else { + var newNode = createZwsp(node); + node.parentNode.insertBefore(newNode, node); + return newNode; + } + }; + var insertAfter$1 = function (node) { + if (isText$8(node.nextSibling)) { + if (startsWithCaretContainer$1(node.nextSibling)) { + return node.nextSibling; + } else { + node.nextSibling.insertData(0, ZWSP); + return node.nextSibling; + } + } else if (isText$8(node)) { + if (endsWithCaretContainer$1(node)) { + return node; + } else { + node.appendData(ZWSP); + return node; + } + } else { + var newNode = createZwsp(node); + if (node.nextSibling) { + node.parentNode.insertBefore(newNode, node.nextSibling); + } else { + node.parentNode.appendChild(newNode); + } + return newNode; + } + }; + var insertInline$1 = function (before, node) { + return before ? insertBefore$1(node) : insertAfter$1(node); + }; + var insertInlineBefore = curry(insertInline$1, true); + var insertInlineAfter = curry(insertInline$1, false); + + var insertInlinePos = function (pos, before) { + if (isText$1(pos.container())) { + return insertInline$1(before, pos.container()); + } else { + return insertInline$1(before, pos.getNode()); + } + }; + var isPosCaretContainer = function (pos, caret) { + var caretNode = caret.get(); + return caretNode && pos.container() === caretNode && isCaretContainerInline(caretNode); + }; + var renderCaret = function (caret, location) { + return location.fold(function (element) { + remove$5(caret.get()); + var text = insertInlineBefore(element); + caret.set(text); + return Optional.some(CaretPosition$1(text, text.length - 1)); + }, function (element) { + return firstPositionIn(element).map(function (pos) { + if (!isPosCaretContainer(pos, caret)) { + remove$5(caret.get()); + var text = insertInlinePos(pos, true); + caret.set(text); + return CaretPosition$1(text, 1); + } else { + return CaretPosition$1(caret.get(), 1); + } + }); + }, function (element) { + return lastPositionIn(element).map(function (pos) { + if (!isPosCaretContainer(pos, caret)) { + remove$5(caret.get()); + var text = insertInlinePos(pos, false); + caret.set(text); + return CaretPosition$1(text, text.length - 1); + } else { + return CaretPosition$1(caret.get(), caret.get().length - 1); + } + }); + }, function (element) { + remove$5(caret.get()); + var text = insertInlineAfter(element); + caret.set(text); + return Optional.some(CaretPosition$1(text, 1)); + }); + }; + + var evaluateUntil = function (fns, args) { + for (var i = 0; i < fns.length; i++) { + var result = fns[i].apply(null, args); + if (result.isSome()) { + return result; + } + } + return Optional.none(); + }; + + var Location = Adt.generate([ + { before: ['element'] }, + { start: ['element'] }, + { end: ['element'] }, + { after: ['element'] } + ]); + var rescope = function (rootNode, node) { + var parentBlock = getParentBlock(node, rootNode); + return parentBlock ? parentBlock : rootNode; + }; + var before$4 = function (isInlineTarget, rootNode, pos) { + var nPos = normalizeForwards(pos); + var scope = rescope(rootNode, nPos.container()); + return findRootInline(isInlineTarget, scope, nPos).fold(function () { + return nextPosition(scope, nPos).bind(curry(findRootInline, isInlineTarget, scope)).map(function (inline) { + return Location.before(inline); + }); + }, Optional.none); + }; + var isNotInsideFormatCaretContainer = function (rootNode, elm) { + return getParentCaretContainer(rootNode, elm) === null; + }; + var findInsideRootInline = function (isInlineTarget, rootNode, pos) { + return findRootInline(isInlineTarget, rootNode, pos).filter(curry(isNotInsideFormatCaretContainer, rootNode)); + }; + var start = function (isInlineTarget, rootNode, pos) { + var nPos = normalizeBackwards(pos); + return findInsideRootInline(isInlineTarget, rootNode, nPos).bind(function (inline) { + var prevPos = prevPosition(inline, nPos); + return prevPos.isNone() ? Optional.some(Location.start(inline)) : Optional.none(); + }); + }; + var end = function (isInlineTarget, rootNode, pos) { + var nPos = normalizeForwards(pos); + return findInsideRootInline(isInlineTarget, rootNode, nPos).bind(function (inline) { + var nextPos = nextPosition(inline, nPos); + return nextPos.isNone() ? Optional.some(Location.end(inline)) : Optional.none(); + }); + }; + var after$3 = function (isInlineTarget, rootNode, pos) { + var nPos = normalizeBackwards(pos); + var scope = rescope(rootNode, nPos.container()); + return findRootInline(isInlineTarget, scope, nPos).fold(function () { + return prevPosition(scope, nPos).bind(curry(findRootInline, isInlineTarget, scope)).map(function (inline) { + return Location.after(inline); + }); + }, Optional.none); + }; + var isValidLocation = function (location) { + return isRtl$1(getElement(location)) === false; + }; + var readLocation = function (isInlineTarget, rootNode, pos) { + var location = evaluateUntil([ + before$4, + start, + end, + after$3 + ], [ + isInlineTarget, + rootNode, + pos + ]); + return location.filter(isValidLocation); + }; + var getElement = function (location) { + return location.fold(identity, identity, identity, identity); + }; + var getName = function (location) { + return location.fold(constant('before'), constant('start'), constant('end'), constant('after')); + }; + var outside = function (location) { + return location.fold(Location.before, Location.before, Location.after, Location.after); + }; + var inside = function (location) { + return location.fold(Location.start, Location.start, Location.end, Location.end); + }; + var isEq$5 = function (location1, location2) { + return getName(location1) === getName(location2) && getElement(location1) === getElement(location2); + }; + var betweenInlines = function (forward, isInlineTarget, rootNode, from, to, location) { + return lift2(findRootInline(isInlineTarget, rootNode, from), findRootInline(isInlineTarget, rootNode, to), function (fromInline, toInline) { + if (fromInline !== toInline && hasSameParentBlock(rootNode, fromInline, toInline)) { + return Location.after(forward ? fromInline : toInline); + } else { + return location; + } + }).getOr(location); + }; + var skipNoMovement = function (fromLocation, toLocation) { + return fromLocation.fold(always, function (fromLocation) { + return !isEq$5(fromLocation, toLocation); + }); + }; + var findLocationTraverse = function (forward, isInlineTarget, rootNode, fromLocation, pos) { + var from = normalizePosition(forward, pos); + var to = fromPosition(forward, rootNode, from).map(curry(normalizePosition, forward)); + var location = to.fold(function () { + return fromLocation.map(outside); + }, function (to) { + return readLocation(isInlineTarget, rootNode, to).map(curry(betweenInlines, forward, isInlineTarget, rootNode, from, to)).filter(curry(skipNoMovement, fromLocation)); + }); + return location.filter(isValidLocation); + }; + var findLocationSimple = function (forward, location) { + if (forward) { + return location.fold(compose(Optional.some, Location.start), Optional.none, compose(Optional.some, Location.after), Optional.none); + } else { + return location.fold(Optional.none, compose(Optional.some, Location.before), Optional.none, compose(Optional.some, Location.end)); + } + }; + var findLocation = function (forward, isInlineTarget, rootNode, pos) { + var from = normalizePosition(forward, pos); + var fromLocation = readLocation(isInlineTarget, rootNode, from); + return readLocation(isInlineTarget, rootNode, from).bind(curry(findLocationSimple, forward)).orThunk(function () { + return findLocationTraverse(forward, isInlineTarget, rootNode, fromLocation, pos); + }); + }; + var prevLocation = curry(findLocation, false); + var nextLocation = curry(findLocation, true); + + var hasSelectionModifyApi = function (editor) { + return isFunction(editor.selection.getSel().modify); + }; + var moveRel = function (forward, selection, pos) { + var delta = forward ? 1 : -1; + selection.setRng(CaretPosition$1(pos.container(), pos.offset() + delta).toRange()); + selection.getSel().modify('move', forward ? 'forward' : 'backward', 'word'); + return true; + }; + var moveByWord = function (forward, editor) { + var rng = editor.selection.getRng(); + var pos = forward ? CaretPosition$1.fromRangeEnd(rng) : CaretPosition$1.fromRangeStart(rng); + if (!hasSelectionModifyApi(editor)) { + return false; + } else if (forward && isBeforeInline(pos)) { + return moveRel(true, editor.selection, pos); + } else if (!forward && isAfterInline(pos)) { + return moveRel(false, editor.selection, pos); + } else { + return false; + } + }; + + var setCaretPosition = function (editor, pos) { + var rng = editor.dom.createRng(); + rng.setStart(pos.container(), pos.offset()); + rng.setEnd(pos.container(), pos.offset()); + editor.selection.setRng(rng); + }; + var setSelected = function (state, elm) { + if (state) { + elm.setAttribute('data-mce-selected', 'inline-boundary'); + } else { + elm.removeAttribute('data-mce-selected'); + } + }; + var renderCaretLocation = function (editor, caret, location) { + return renderCaret(caret, location).map(function (pos) { + setCaretPosition(editor, pos); + return location; + }); + }; + var findLocation$1 = function (editor, caret, forward) { + var rootNode = editor.getBody(); + var from = CaretPosition$1.fromRangeStart(editor.selection.getRng()); + var isInlineTarget$1 = curry(isInlineTarget, editor); + var location = findLocation(forward, isInlineTarget$1, rootNode, from); + return location.bind(function (location) { + return renderCaretLocation(editor, caret, location); + }); + }; + var toggleInlines = function (isInlineTarget, dom, elms) { + var inlineBoundaries = map(descendants$1(SugarElement.fromDom(dom.getRoot()), '*[data-mce-selected="inline-boundary"]'), function (e) { + return e.dom; + }); + var selectedInlines = filter(inlineBoundaries, isInlineTarget); + var targetInlines = filter(elms, isInlineTarget); + each(difference(selectedInlines, targetInlines), curry(setSelected, false)); + each(difference(targetInlines, selectedInlines), curry(setSelected, true)); + }; + var safeRemoveCaretContainer = function (editor, caret) { + if (editor.selection.isCollapsed() && editor.composing !== true && caret.get()) { + var pos = CaretPosition$1.fromRangeStart(editor.selection.getRng()); + if (CaretPosition$1.isTextPosition(pos) && isAtZwsp(pos) === false) { + setCaretPosition(editor, removeAndReposition(caret.get(), pos)); + caret.set(null); + } + } + }; + var renderInsideInlineCaret = function (isInlineTarget, editor, caret, elms) { + if (editor.selection.isCollapsed()) { + var inlines = filter(elms, isInlineTarget); + each(inlines, function (_inline) { + var pos = CaretPosition$1.fromRangeStart(editor.selection.getRng()); + readLocation(isInlineTarget, editor.getBody(), pos).bind(function (location) { + return renderCaretLocation(editor, caret, location); + }); + }); + } + }; + var move = function (editor, caret, forward) { + return isInlineBoundariesEnabled(editor) ? findLocation$1(editor, caret, forward).isSome() : false; + }; + var moveWord = function (forward, editor, _caret) { + return isInlineBoundariesEnabled(editor) ? moveByWord(forward, editor) : false; + }; + var setupSelectedState = function (editor) { + var caret = Cell(null); + var isInlineTarget$1 = curry(isInlineTarget, editor); + editor.on('NodeChange', function (e) { + if (isInlineBoundariesEnabled(editor) && !(Env.browser.isIE() && e.initial)) { + toggleInlines(isInlineTarget$1, editor.dom, e.parents); + safeRemoveCaretContainer(editor, caret); + renderInsideInlineCaret(isInlineTarget$1, editor, caret, e.parents); + } + }); + return caret; + }; + var moveNextWord = curry(moveWord, true); + var movePrevWord = curry(moveWord, false); + + var rangeFromPositions = function (from, to) { + var range = document.createRange(); + range.setStart(from.container(), from.offset()); + range.setEnd(to.container(), to.offset()); + return range; + }; + var hasOnlyTwoOrLessPositionsLeft = function (elm) { + return lift2(firstPositionIn(elm), lastPositionIn(elm), function (firstPos, lastPos) { + var normalizedFirstPos = normalizePosition(true, firstPos); + var normalizedLastPos = normalizePosition(false, lastPos); + return nextPosition(elm, normalizedFirstPos).forall(function (pos) { + return pos.isEqual(normalizedLastPos); + }); + }).getOr(true); + }; + var setCaretLocation = function (editor, caret) { + return function (location) { + return renderCaret(caret, location).exists(function (pos) { + setCaretPosition(editor, pos); + return true; + }); + }; + }; + var deleteFromTo = function (editor, caret, from, to) { + var rootNode = editor.getBody(); + var isInlineTarget$1 = curry(isInlineTarget, editor); + editor.undoManager.ignore(function () { + editor.selection.setRng(rangeFromPositions(from, to)); + editor.execCommand('Delete'); + readLocation(isInlineTarget$1, rootNode, CaretPosition$1.fromRangeStart(editor.selection.getRng())).map(inside).map(setCaretLocation(editor, caret)); + }); + editor.nodeChanged(); + }; + var rescope$1 = function (rootNode, node) { + var parentBlock = getParentBlock(node, rootNode); + return parentBlock ? parentBlock : rootNode; + }; + var backspaceDeleteCollapsed = function (editor, caret, forward, from) { + var rootNode = rescope$1(editor.getBody(), from.container()); + var isInlineTarget$1 = curry(isInlineTarget, editor); + var fromLocation = readLocation(isInlineTarget$1, rootNode, from); + return fromLocation.bind(function (location) { + if (forward) { + return location.fold(constant(Optional.some(inside(location))), Optional.none, constant(Optional.some(outside(location))), Optional.none); + } else { + return location.fold(Optional.none, constant(Optional.some(outside(location))), Optional.none, constant(Optional.some(inside(location)))); + } + }).map(setCaretLocation(editor, caret)).getOrThunk(function () { + var toPosition = navigate(forward, rootNode, from); + var toLocation = toPosition.bind(function (pos) { + return readLocation(isInlineTarget$1, rootNode, pos); + }); + return lift2(fromLocation, toLocation, function () { + return findRootInline(isInlineTarget$1, rootNode, from).exists(function (elm) { + if (hasOnlyTwoOrLessPositionsLeft(elm)) { + deleteElement(editor, forward, SugarElement.fromDom(elm)); + return true; + } else { + return false; + } + }); + }).orThunk(function () { + return toLocation.bind(function (_) { + return toPosition.map(function (to) { + if (forward) { + deleteFromTo(editor, caret, from, to); + } else { + deleteFromTo(editor, caret, to, from); + } + return true; + }); + }); + }).getOr(false); + }); + }; + var backspaceDelete$6 = function (editor, caret, forward) { + if (editor.selection.isCollapsed() && isInlineBoundariesEnabled(editor)) { + var from = CaretPosition$1.fromRangeStart(editor.selection.getRng()); + return backspaceDeleteCollapsed(editor, caret, forward, from); + } + return false; + }; + + var getParentInlines = function (rootElm, startElm) { + var parents = parentsAndSelf(startElm, rootElm); + return findIndex(parents, isBlock).fold(constant(parents), function (index) { + return parents.slice(0, index); + }); + }; + var hasOnlyOneChild$1 = function (elm) { + return children(elm).length === 1; + }; + var deleteLastPosition = function (forward, editor, target, parentInlines) { + var isFormatElement$1 = curry(isFormatElement, editor); + var formatNodes = map(filter(parentInlines, isFormatElement$1), function (elm) { + return elm.dom; + }); + if (formatNodes.length === 0) { + deleteElement(editor, forward, target); + } else { + var pos = replaceWithCaretFormat(target.dom, formatNodes); + editor.selection.setRng(pos.toRange()); + } + }; + var deleteCaret$2 = function (editor, forward) { + var rootElm = SugarElement.fromDom(editor.getBody()); + var startElm = SugarElement.fromDom(editor.selection.getStart()); + var parentInlines = filter(getParentInlines(rootElm, startElm), hasOnlyOneChild$1); + return last(parentInlines).exists(function (target) { + var fromPos = CaretPosition$1.fromRangeStart(editor.selection.getRng()); + if (willDeleteLastPositionInElement(forward, fromPos, target.dom) && !isEmptyCaretFormatElement(target)) { + deleteLastPosition(forward, editor, target, parentInlines); + return true; + } else { + return false; + } + }); + }; + var backspaceDelete$7 = function (editor, forward) { + return editor.selection.isCollapsed() ? deleteCaret$2(editor, forward) : false; + }; + + var deleteElement$2 = function (editor, forward, element) { + editor._selectionOverrides.hideFakeCaret(); + deleteElement(editor, forward, SugarElement.fromDom(element)); + return true; + }; + var deleteCaret$3 = function (editor, forward) { + var isNearMedia = forward ? isBeforeMedia : isAfterMedia; + var direction = forward ? HDirection.Forwards : HDirection.Backwards; + var fromPos = getNormalizedRangeEndPoint(direction, editor.getBody(), editor.selection.getRng()); + if (isNearMedia(fromPos)) { + return deleteElement$2(editor, forward, fromPos.getNode(!forward)); + } else { + return Optional.from(normalizePosition(forward, fromPos)).filter(function (pos) { + return isNearMedia(pos) && isMoveInsideSameBlock(fromPos, pos); + }).exists(function (pos) { + return deleteElement$2(editor, forward, pos.getNode(!forward)); + }); + } + }; + var deleteRange$2 = function (editor, forward) { + var selectedNode = editor.selection.getNode(); + return isMedia(selectedNode) ? deleteElement$2(editor, forward, selectedNode) : false; + }; + var backspaceDelete$8 = function (editor, forward) { + return editor.selection.isCollapsed() ? deleteCaret$3(editor, forward) : deleteRange$2(editor, forward); + }; + + var isEditable$1 = function (target) { + return closest(target, function (elm) { + return isContentEditableTrue(elm.dom) || isContentEditableFalse(elm.dom); + }).exists(function (elm) { + return isContentEditableTrue(elm.dom); + }); + }; + var parseIndentValue = function (value) { + var number = parseInt(value, 10); + return isNaN(number) ? 0 : number; + }; + var getIndentStyleName = function (useMargin, element) { + var indentStyleName = useMargin || isTable$1(element) ? 'margin' : 'padding'; + var suffix = get$4(element, 'direction') === 'rtl' ? '-right' : '-left'; + return indentStyleName + suffix; + }; + var indentElement = function (dom, command, useMargin, value, unit, element) { + var indentStyleName = getIndentStyleName(useMargin, SugarElement.fromDom(element)); + if (command === 'outdent') { + var styleValue = Math.max(0, parseIndentValue(element.style[indentStyleName]) - value); + dom.setStyle(element, indentStyleName, styleValue ? styleValue + unit : ''); + } else { + var styleValue = parseIndentValue(element.style[indentStyleName]) + value + unit; + dom.setStyle(element, indentStyleName, styleValue); + } + }; + var validateBlocks = function (editor, blocks) { + return forall(blocks, function (block) { + var indentStyleName = getIndentStyleName(shouldIndentUseMargin(editor), block); + var intentValue = getRaw(block, indentStyleName).map(parseIndentValue).getOr(0); + var contentEditable = editor.dom.getContentEditable(block.dom); + return contentEditable !== 'false' && intentValue > 0; + }); + }; + var canOutdent = function (editor) { + var blocks = getBlocksToIndent(editor); + return !editor.mode.isReadOnly() && (blocks.length > 1 || validateBlocks(editor, blocks)); + }; + var isListComponent = function (el) { + return isList(el) || isListItem(el); + }; + var parentIsListComponent = function (el) { + return parent(el).map(isListComponent).getOr(false); + }; + var getBlocksToIndent = function (editor) { + return filter(map(editor.selection.getSelectedBlocks(), SugarElement.fromDom), function (el) { + return !isListComponent(el) && !parentIsListComponent(el) && isEditable$1(el); + }); + }; + var handle = function (editor, command) { + var dom = editor.dom, selection = editor.selection, formatter = editor.formatter; + var indentation = getIndentation(editor); + var indentUnit = /[a-z%]+$/i.exec(indentation)[0]; + var indentValue = parseInt(indentation, 10); + var useMargin = shouldIndentUseMargin(editor); + var forcedRootBlock = getForcedRootBlock(editor); + if (!editor.queryCommandState('InsertUnorderedList') && !editor.queryCommandState('InsertOrderedList')) { + if (forcedRootBlock === '' && !dom.getParent(selection.getNode(), dom.isBlock)) { + formatter.apply('div'); + } + } + each(getBlocksToIndent(editor), function (block) { + indentElement(dom, command, useMargin, indentValue, indentUnit, block.dom); + }); + }; + + var backspaceDelete$9 = function (editor, _forward) { + if (editor.selection.isCollapsed() && canOutdent(editor)) { + var dom = editor.dom; + var rng = editor.selection.getRng(); + var pos = CaretPosition$1.fromRangeStart(rng); + var block = dom.getParent(rng.startContainer, dom.isBlock); + if (block !== null && isAtStartOfBlock(SugarElement.fromDom(block), pos)) { + handle(editor, 'outdent'); + return true; + } + } + return false; + }; + + var nativeCommand = function (editor, command) { + editor.getDoc().execCommand(command, false, null); + }; + var deleteCommand = function (editor, caret) { + if (backspaceDelete$9(editor)) { + return; + } else if (backspaceDelete$4(editor, false)) { + return; + } else if (backspaceDelete$3(editor, false)) { + return; + } else if (backspaceDelete$6(editor, caret, false)) { + return; + } else if (backspaceDelete$1(editor, false)) { + return; + } else if (backspaceDelete(editor)) { + return; + } else if (backspaceDelete$5(editor, false)) { + return; + } else if (backspaceDelete$8(editor, false)) { + return; + } else if (backspaceDelete$2(editor)) { + return; + } else if (backspaceDelete$7(editor, false)) { + return; + } else { + nativeCommand(editor, 'Delete'); + paddEmptyBody(editor); + } + }; + var forwardDeleteCommand = function (editor, caret) { + if (backspaceDelete$4(editor, true)) { + return; + } else if (backspaceDelete$3(editor, true)) { + return; + } else if (backspaceDelete$6(editor, caret, true)) { + return; + } else if (backspaceDelete$1(editor, true)) { + return; + } else if (backspaceDelete(editor)) { + return; + } else if (backspaceDelete$5(editor, true)) { + return; + } else if (backspaceDelete$8(editor, true)) { + return; + } else if (backspaceDelete$2(editor)) { + return; + } else if (backspaceDelete$7(editor, true)) { + return; + } else { + nativeCommand(editor, 'ForwardDelete'); + } + }; + var setup$8 = function (editor, caret) { + editor.addCommand('delete', function () { + deleteCommand(editor, caret); + }); + editor.addCommand('forwardDelete', function () { + forwardDeleteCommand(editor, caret); + }); + }; + + var SIGNIFICANT_MOVE = 5; + var LONGPRESS_DELAY = 400; + var getTouch = function (event) { + if (event.touches === undefined || event.touches.length !== 1) { + return Optional.none(); + } + return Optional.some(event.touches[0]); + }; + var isFarEnough = function (touch, data) { + var distX = Math.abs(touch.clientX - data.x); + var distY = Math.abs(touch.clientY - data.y); + return distX > SIGNIFICANT_MOVE || distY > SIGNIFICANT_MOVE; + }; + var setup$9 = function (editor) { + var startData = Cell(Optional.none()); + var longpressFired = Cell(false); + var debounceLongpress = last$2(function (e) { + editor.fire('longpress', __assign(__assign({}, e), { type: 'longpress' })); + longpressFired.set(true); + }, LONGPRESS_DELAY); + editor.on('touchstart', function (e) { + getTouch(e).each(function (touch) { + debounceLongpress.cancel(); + var data = { + x: touch.clientX, + y: touch.clientY, + target: e.target + }; + debounceLongpress.throttle(e); + longpressFired.set(false); + startData.set(Optional.some(data)); + }); + }, true); + editor.on('touchmove', function (e) { + debounceLongpress.cancel(); + getTouch(e).each(function (touch) { + startData.get().each(function (data) { + if (isFarEnough(touch, data)) { + startData.set(Optional.none()); + longpressFired.set(false); + editor.fire('longpresscancel'); + } + }); + }); + }, true); + editor.on('touchend touchcancel', function (e) { + debounceLongpress.cancel(); + if (e.type === 'touchcancel') { + return; + } + startData.get().filter(function (data) { + return data.target.isEqualNode(e.target); + }).each(function () { + if (longpressFired.get()) { + e.preventDefault(); + } else { + editor.fire('tap', __assign(__assign({}, e), { type: 'tap' })); + } + }); + }, true); + }; + + var isBlockElement = function (blockElements, node) { + return blockElements.hasOwnProperty(node.nodeName); + }; + var isValidTarget = function (blockElements, node) { + if (isText$1(node)) { + return true; + } else if (isElement$1(node)) { + return !isBlockElement(blockElements, node) && !isBookmarkNode$1(node); + } else { + return false; + } + }; + var hasBlockParent = function (blockElements, root, node) { + return exists(parents$1(SugarElement.fromDom(node), SugarElement.fromDom(root)), function (elm) { + return isBlockElement(blockElements, elm.dom); + }); + }; + var shouldRemoveTextNode = function (blockElements, node) { + if (isText$1(node)) { + if (node.nodeValue.length === 0) { + return true; + } else if (/^\s+$/.test(node.nodeValue) && (!node.nextSibling || isBlockElement(blockElements, node.nextSibling))) { + return true; + } + } + return false; + }; + var addRootBlocks = function (editor) { + var dom = editor.dom, selection = editor.selection; + var schema = editor.schema, blockElements = schema.getBlockElements(); + var node = selection.getStart(); + var rootNode = editor.getBody(); + var rootBlockNode, tempNode, wrapped; + var forcedRootBlock = getForcedRootBlock(editor); + if (!node || !isElement$1(node) || !forcedRootBlock) { + return; + } + var rootNodeName = rootNode.nodeName.toLowerCase(); + if (!schema.isValidChild(rootNodeName, forcedRootBlock.toLowerCase()) || hasBlockParent(blockElements, rootNode, node)) { + return; + } + var rng = selection.getRng(); + var startContainer = rng.startContainer; + var startOffset = rng.startOffset; + var endContainer = rng.endContainer; + var endOffset = rng.endOffset; + var restoreSelection = hasFocus$1(editor); + node = rootNode.firstChild; + while (node) { + if (isValidTarget(blockElements, node)) { + if (shouldRemoveTextNode(blockElements, node)) { + tempNode = node; + node = node.nextSibling; + dom.remove(tempNode); + continue; + } + if (!rootBlockNode) { + rootBlockNode = dom.create(forcedRootBlock, getForcedRootBlockAttrs(editor)); + node.parentNode.insertBefore(rootBlockNode, node); + wrapped = true; + } + tempNode = node; + node = node.nextSibling; + rootBlockNode.appendChild(tempNode); + } else { + rootBlockNode = null; + node = node.nextSibling; + } + } + if (wrapped && restoreSelection) { + rng.setStart(startContainer, startOffset); + rng.setEnd(endContainer, endOffset); + selection.setRng(rng); + editor.nodeChanged(); + } + }; + var setup$a = function (editor) { + if (getForcedRootBlock(editor)) { + editor.on('NodeChange', curry(addRootBlocks, editor)); + } + }; + + var findBlockCaretContainer = function (editor) { + return descendant(SugarElement.fromDom(editor.getBody()), '*[data-mce-caret]').fold(constant(null), function (elm) { + return elm.dom; + }); + }; + var removeIeControlRect = function (editor) { + editor.selection.setRng(editor.selection.getRng()); + }; + var showBlockCaretContainer = function (editor, blockCaretContainer) { + if (blockCaretContainer.hasAttribute('data-mce-caret')) { + showCaretContainerBlock(blockCaretContainer); + removeIeControlRect(editor); + editor.selection.scrollIntoView(blockCaretContainer); + } + }; + var handleBlockContainer = function (editor, e) { + var blockCaretContainer = findBlockCaretContainer(editor); + if (!blockCaretContainer) { + return; + } + if (e.type === 'compositionstart') { + e.preventDefault(); + e.stopPropagation(); + showBlockCaretContainer(editor, blockCaretContainer); + return; + } + if (hasContent(blockCaretContainer)) { + showBlockCaretContainer(editor, blockCaretContainer); + editor.undoManager.add(); + } + }; + var setup$b = function (editor) { + editor.on('keyup compositionstart', curry(handleBlockContainer, editor)); + }; + + var BreakType; + (function (BreakType) { + BreakType[BreakType['Br'] = 0] = 'Br'; + BreakType[BreakType['Block'] = 1] = 'Block'; + BreakType[BreakType['Wrap'] = 2] = 'Wrap'; + BreakType[BreakType['Eol'] = 3] = 'Eol'; + }(BreakType || (BreakType = {}))); + var flip = function (direction, positions) { + return direction === HDirection.Backwards ? reverse(positions) : positions; + }; + var walk$3 = function (direction, caretWalker, pos) { + return direction === HDirection.Forwards ? caretWalker.next(pos) : caretWalker.prev(pos); + }; + var getBreakType = function (scope, direction, currentPos, nextPos) { + if (isBr(nextPos.getNode(direction === HDirection.Forwards))) { + return BreakType.Br; + } else if (isInSameBlock(currentPos, nextPos) === false) { + return BreakType.Block; + } else { + return BreakType.Wrap; + } + }; + var getPositionsUntil = function (predicate, direction, scope, start) { + var caretWalker = CaretWalker(scope); + var currentPos = start, nextPos; + var positions = []; + while (currentPos) { + nextPos = walk$3(direction, caretWalker, currentPos); + if (!nextPos) { + break; + } + if (isBr(nextPos.getNode(false))) { + if (direction === HDirection.Forwards) { + return { + positions: flip(direction, positions).concat([nextPos]), + breakType: BreakType.Br, + breakAt: Optional.some(nextPos) + }; + } else { + return { + positions: flip(direction, positions), + breakType: BreakType.Br, + breakAt: Optional.some(nextPos) + }; + } + } + if (!nextPos.isVisible()) { + currentPos = nextPos; + continue; + } + if (predicate(currentPos, nextPos)) { + var breakType = getBreakType(scope, direction, currentPos, nextPos); + return { + positions: flip(direction, positions), + breakType: breakType, + breakAt: Optional.some(nextPos) + }; + } + positions.push(nextPos); + currentPos = nextPos; + } + return { + positions: flip(direction, positions), + breakType: BreakType.Eol, + breakAt: Optional.none() + }; + }; + var getAdjacentLinePositions = function (direction, getPositionsUntilBreak, scope, start) { + return getPositionsUntilBreak(scope, start).breakAt.map(function (pos) { + var positions = getPositionsUntilBreak(scope, pos).positions; + return direction === HDirection.Backwards ? positions.concat(pos) : [pos].concat(positions); + }).getOr([]); + }; + var findClosestHorizontalPositionFromPoint = function (positions, x) { + return foldl(positions, function (acc, newPos) { + return acc.fold(function () { + return Optional.some(newPos); + }, function (lastPos) { + return lift2(head(lastPos.getClientRects()), head(newPos.getClientRects()), function (lastRect, newRect) { + var lastDist = Math.abs(x - lastRect.left); + var newDist = Math.abs(x - newRect.left); + return newDist <= lastDist ? newPos : lastPos; + }).or(acc); + }); + }, Optional.none()); + }; + var findClosestHorizontalPosition = function (positions, pos) { + return head(pos.getClientRects()).bind(function (targetRect) { + return findClosestHorizontalPositionFromPoint(positions, targetRect.left); + }); + }; + var getPositionsUntilPreviousLine = curry(getPositionsUntil, CaretPosition.isAbove, -1); + var getPositionsUntilNextLine = curry(getPositionsUntil, CaretPosition.isBelow, 1); + var isAtFirstLine = function (scope, pos) { + return getPositionsUntilPreviousLine(scope, pos).breakAt.isNone(); + }; + var isAtLastLine = function (scope, pos) { + return getPositionsUntilNextLine(scope, pos).breakAt.isNone(); + }; + var getPositionsAbove = curry(getAdjacentLinePositions, -1, getPositionsUntilPreviousLine); + var getPositionsBelow = curry(getAdjacentLinePositions, 1, getPositionsUntilNextLine); + var getFirstLinePositions = function (scope) { + return firstPositionIn(scope).map(function (pos) { + return [pos].concat(getPositionsUntilNextLine(scope, pos).positions); + }).getOr([]); + }; + var getLastLinePositions = function (scope) { + return lastPositionIn(scope).map(function (pos) { + return getPositionsUntilPreviousLine(scope, pos).positions.concat(pos); + }).getOr([]); + }; + + var getNodeClientRects = function (node) { + var toArrayWithNode = function (clientRects) { + return map(clientRects, function (clientRect) { + clientRect = clone$2(clientRect); + clientRect.node = node; + return clientRect; + }); + }; + if (isElement$1(node)) { + return toArrayWithNode(node.getClientRects()); + } + if (isText$1(node)) { + var rng = node.ownerDocument.createRange(); + rng.setStart(node, 0); + rng.setEnd(node, node.data.length); + return toArrayWithNode(rng.getClientRects()); + } + }; + var getClientRects = function (nodes) { + return bind(nodes, getNodeClientRects); + }; + + var VDirection; + (function (VDirection) { + VDirection[VDirection['Up'] = -1] = 'Up'; + VDirection[VDirection['Down'] = 1] = 'Down'; + }(VDirection || (VDirection = {}))); + var findUntil$1 = function (direction, root, predicateFn, node) { + while (node = findNode(node, direction, isEditableCaretCandidate, root)) { + if (predicateFn(node)) { + return; + } + } + }; + var walkUntil = function (direction, isAboveFn, isBeflowFn, root, predicateFn, caretPosition) { + var line = 0; + var result = []; + var add = function (node) { + var i, clientRect, clientRects; + clientRects = getClientRects([node]); + if (direction === -1) { + clientRects = clientRects.reverse(); + } + for (i = 0; i < clientRects.length; i++) { + clientRect = clientRects[i]; + if (isBeflowFn(clientRect, targetClientRect)) { + continue; + } + if (result.length > 0 && isAboveFn(clientRect, last$1(result))) { + line++; + } + clientRect.line = line; + if (predicateFn(clientRect)) { + return true; + } + result.push(clientRect); + } + }; + var targetClientRect = last$1(caretPosition.getClientRects()); + if (!targetClientRect) { + return result; + } + var node = caretPosition.getNode(); + add(node); + findUntil$1(direction, root, add, node); + return result; + }; + var aboveLineNumber = function (lineNumber, clientRect) { + return clientRect.line > lineNumber; + }; + var isLineNumber = function (lineNumber, clientRect) { + return clientRect.line === lineNumber; + }; + var upUntil = curry(walkUntil, VDirection.Up, isAbove, isBelow); + var downUntil = curry(walkUntil, VDirection.Down, isBelow, isAbove); + var positionsUntil = function (direction, root, predicateFn, node) { + var caretWalker = CaretWalker(root); + var walkFn, isBelowFn, isAboveFn, caretPosition; + var result = []; + var line = 0, clientRect; + var getClientRect = function (caretPosition) { + if (direction === 1) { + return last$1(caretPosition.getClientRects()); + } + return last$1(caretPosition.getClientRects()); + }; + if (direction === 1) { + walkFn = caretWalker.next; + isBelowFn = isBelow; + isAboveFn = isAbove; + caretPosition = CaretPosition$1.after(node); + } else { + walkFn = caretWalker.prev; + isBelowFn = isAbove; + isAboveFn = isBelow; + caretPosition = CaretPosition$1.before(node); + } + var targetClientRect = getClientRect(caretPosition); + do { + if (!caretPosition.isVisible()) { + continue; + } + clientRect = getClientRect(caretPosition); + if (isAboveFn(clientRect, targetClientRect)) { + continue; + } + if (result.length > 0 && isBelowFn(clientRect, last$1(result))) { + line++; + } + clientRect = clone$2(clientRect); + clientRect.position = caretPosition; + clientRect.line = line; + if (predicateFn(clientRect)) { + return result; + } + result.push(clientRect); + } while (caretPosition = walkFn(caretPosition)); + return result; + }; + var isAboveLine = function (lineNumber) { + return function (clientRect) { + return aboveLineNumber(lineNumber, clientRect); + }; + }; + var isLine = function (lineNumber) { + return function (clientRect) { + return isLineNumber(lineNumber, clientRect); + }; + }; + + var isContentEditableFalse$8 = isContentEditableFalse; + var findNode$1 = findNode; + var distanceToRectLeft = function (clientRect, clientX) { + return Math.abs(clientRect.left - clientX); + }; + var distanceToRectRight = function (clientRect, clientX) { + return Math.abs(clientRect.right - clientX); + }; + var isInsideX = function (clientX, clientRect) { + return clientX >= clientRect.left && clientX <= clientRect.right; + }; + var isInsideY = function (clientY, clientRect) { + return clientY >= clientRect.top && clientY <= clientRect.bottom; + }; + var findClosestClientRect = function (clientRects, clientX) { + return reduce(clientRects, function (oldClientRect, clientRect) { + var oldDistance = Math.min(distanceToRectLeft(oldClientRect, clientX), distanceToRectRight(oldClientRect, clientX)); + var newDistance = Math.min(distanceToRectLeft(clientRect, clientX), distanceToRectRight(clientRect, clientX)); + if (isInsideX(clientX, clientRect)) { + return clientRect; + } + if (isInsideX(clientX, oldClientRect)) { + return oldClientRect; + } + if (newDistance === oldDistance && isContentEditableFalse$8(clientRect.node)) { + return clientRect; + } + if (newDistance < oldDistance) { + return clientRect; + } + return oldClientRect; + }); + }; + var walkUntil$1 = function (direction, root, predicateFn, startNode, includeChildren) { + var node = findNode$1(startNode, direction, isEditableCaretCandidate, root, !includeChildren); + do { + if (!node || predicateFn(node)) { + return; + } + } while (node = findNode$1(node, direction, isEditableCaretCandidate, root)); + }; + var findLineNodeRects = function (root, targetNodeRect, includeChildren) { + if (includeChildren === void 0) { + includeChildren = true; + } + var clientRects = []; + var collect = function (checkPosFn, node) { + var lineRects = filter(getClientRects([node]), function (clientRect) { + return !checkPosFn(clientRect, targetNodeRect); + }); + clientRects = clientRects.concat(lineRects); + return lineRects.length === 0; + }; + clientRects.push(targetNodeRect); + walkUntil$1(VDirection.Up, root, curry(collect, isAbove), targetNodeRect.node, includeChildren); + walkUntil$1(VDirection.Down, root, curry(collect, isBelow), targetNodeRect.node, includeChildren); + return clientRects; + }; + var getFakeCaretTargets = function (root) { + return filter(from$1(root.getElementsByTagName('*')), isFakeCaretTarget); + }; + var caretInfo = function (clientRect, clientX) { + return { + node: clientRect.node, + before: distanceToRectLeft(clientRect, clientX) < distanceToRectRight(clientRect, clientX) + }; + }; + var closestFakeCaret = function (root, clientX, clientY) { + var fakeTargetNodeRects = getClientRects(getFakeCaretTargets(root)); + var targetNodeRects = filter(fakeTargetNodeRects, curry(isInsideY, clientY)); + var closestNodeRect = findClosestClientRect(targetNodeRects, clientX); + if (closestNodeRect) { + var includeChildren = !isTable(closestNodeRect.node) && !isMedia(closestNodeRect.node); + closestNodeRect = findClosestClientRect(findLineNodeRects(root, closestNodeRect, includeChildren), clientX); + if (closestNodeRect && isFakeCaretTarget(closestNodeRect.node)) { + return caretInfo(closestNodeRect, clientX); + } + } + return null; + }; + + var moveToRange = function (editor, rng) { + editor.selection.setRng(rng); + scrollRangeIntoView(editor, editor.selection.getRng()); + }; + var renderRangeCaretOpt = function (editor, range, scrollIntoView) { + return Optional.some(renderRangeCaret(editor, range, scrollIntoView)); + }; + var moveHorizontally = function (editor, direction, range, isBefore, isAfter, isElement) { + var forwards = direction === HDirection.Forwards; + var caretWalker = CaretWalker(editor.getBody()); + var getNextPosFn = curry(getVisualCaretPosition, forwards ? caretWalker.next : caretWalker.prev); + var isBeforeFn = forwards ? isBefore : isAfter; + if (!range.collapsed) { + var node = getSelectedNode(range); + if (isElement(node)) { + return showCaret(direction, editor, node, direction === HDirection.Backwards, false); + } + } + var caretPosition = getNormalizedRangeEndPoint(direction, editor.getBody(), range); + if (isBeforeFn(caretPosition)) { + return selectNode(editor, caretPosition.getNode(!forwards)); + } + var nextCaretPosition = normalizePosition(forwards, getNextPosFn(caretPosition)); + var rangeIsInContainerBlock = isRangeInCaretContainerBlock(range); + if (!nextCaretPosition) { + return rangeIsInContainerBlock ? Optional.some(range) : Optional.none(); + } + if (isBeforeFn(nextCaretPosition)) { + return showCaret(direction, editor, nextCaretPosition.getNode(!forwards), forwards, false); + } + var peekCaretPosition = getNextPosFn(nextCaretPosition); + if (peekCaretPosition && isBeforeFn(peekCaretPosition)) { + if (isMoveInsideSameBlock(nextCaretPosition, peekCaretPosition)) { + return showCaret(direction, editor, peekCaretPosition.getNode(!forwards), forwards, false); + } + } + if (rangeIsInContainerBlock) { + return renderRangeCaretOpt(editor, nextCaretPosition.toRange(), false); + } + return Optional.none(); + }; + var moveVertically = function (editor, direction, range, isBefore, isAfter, isElement) { + var caretPosition = getNormalizedRangeEndPoint(direction, editor.getBody(), range); + var caretClientRect = last$1(caretPosition.getClientRects()); + var forwards = direction === VDirection.Down; + if (!caretClientRect) { + return Optional.none(); + } + var walkerFn = forwards ? downUntil : upUntil; + var linePositions = walkerFn(editor.getBody(), isAboveLine(1), caretPosition); + var nextLinePositions = filter(linePositions, isLine(1)); + var clientX = caretClientRect.left; + var nextLineRect = findClosestClientRect(nextLinePositions, clientX); + if (nextLineRect && isElement(nextLineRect.node)) { + var dist1 = Math.abs(clientX - nextLineRect.left); + var dist2 = Math.abs(clientX - nextLineRect.right); + return showCaret(direction, editor, nextLineRect.node, dist1 < dist2, false); + } + var currentNode; + if (isBefore(caretPosition)) { + currentNode = caretPosition.getNode(); + } else if (isAfter(caretPosition)) { + currentNode = caretPosition.getNode(true); + } else { + currentNode = getSelectedNode(range); + } + if (currentNode) { + var caretPositions = positionsUntil(direction, editor.getBody(), isAboveLine(1), currentNode); + var closestNextLineRect = findClosestClientRect(filter(caretPositions, isLine(1)), clientX); + if (closestNextLineRect) { + return renderRangeCaretOpt(editor, closestNextLineRect.position.toRange(), false); + } + closestNextLineRect = last$1(filter(caretPositions, isLine(0))); + if (closestNextLineRect) { + return renderRangeCaretOpt(editor, closestNextLineRect.position.toRange(), false); + } + } + if (nextLinePositions.length === 0) { + return getLineEndPoint(editor, forwards).filter(forwards ? isAfter : isBefore).map(function (pos) { + return renderRangeCaret(editor, pos.toRange(), false); + }); + } + return Optional.none(); + }; + var getLineEndPoint = function (editor, forward) { + var rng = editor.selection.getRng(); + var body = editor.getBody(); + if (forward) { + var from = CaretPosition$1.fromRangeEnd(rng); + var result = getPositionsUntilNextLine(body, from); + return last(result.positions); + } else { + var from = CaretPosition$1.fromRangeStart(rng); + var result = getPositionsUntilPreviousLine(body, from); + return head(result.positions); + } + }; + var moveToLineEndPoint = function (editor, forward, isElementPosition) { + return getLineEndPoint(editor, forward).filter(isElementPosition).exists(function (pos) { + editor.selection.setRng(pos.toRange()); + return true; + }); + }; + + var isContentEditableFalse$9 = isContentEditableFalse; + var moveToCeFalseHorizontally = function (direction, editor, range) { + return moveHorizontally(editor, direction, range, isBeforeContentEditableFalse, isAfterContentEditableFalse, isContentEditableFalse$9); + }; + var moveToCeFalseVertically = function (direction, editor, range) { + var isBefore = function (caretPosition) { + return isBeforeContentEditableFalse(caretPosition) || isBeforeTable(caretPosition); + }; + var isAfter = function (caretPosition) { + return isAfterContentEditableFalse(caretPosition) || isAfterTable(caretPosition); + }; + return moveVertically(editor, direction, range, isBefore, isAfter, isContentEditableFalse$9); + }; + var createTextBlock = function (editor) { + var textBlock = editor.dom.create(getForcedRootBlock(editor)); + if (!Env.ie || Env.ie >= 11) { + textBlock.innerHTML = '
    '; + } + return textBlock; + }; + var exitPreBlock = function (editor, direction, range) { + var caretWalker = CaretWalker(editor.getBody()); + var getVisualCaretPosition$1 = curry(getVisualCaretPosition, direction === 1 ? caretWalker.next : caretWalker.prev); + if (range.collapsed && hasForcedRootBlock(editor)) { + var pre = editor.dom.getParent(range.startContainer, 'PRE'); + if (!pre) { + return; + } + var caretPos = getVisualCaretPosition$1(CaretPosition$1.fromRangeStart(range)); + if (!caretPos) { + var newBlock = createTextBlock(editor); + if (direction === 1) { + editor.$(pre).after(newBlock); + } else { + editor.$(pre).before(newBlock); + } + editor.selection.select(newBlock, true); + editor.selection.collapse(); + } + } + }; + var getHorizontalRange = function (editor, forward) { + var direction = forward ? HDirection.Forwards : HDirection.Backwards; + var range = editor.selection.getRng(); + return moveToCeFalseHorizontally(direction, editor, range).orThunk(function () { + exitPreBlock(editor, direction, range); + return Optional.none(); + }); + }; + var getVerticalRange = function (editor, down) { + var direction = down ? 1 : -1; + var range = editor.selection.getRng(); + return moveToCeFalseVertically(direction, editor, range).orThunk(function () { + exitPreBlock(editor, direction, range); + return Optional.none(); + }); + }; + var moveH = function (editor, forward) { + return getHorizontalRange(editor, forward).exists(function (newRange) { + moveToRange(editor, newRange); + return true; + }); + }; + var moveV = function (editor, down) { + return getVerticalRange(editor, down).exists(function (newRange) { + moveToRange(editor, newRange); + return true; + }); + }; + var moveToLineEndPoint$1 = function (editor, forward) { + var isCefPosition = forward ? isAfterContentEditableFalse : isBeforeContentEditableFalse; + return moveToLineEndPoint(editor, forward, isCefPosition); + }; + + var isTarget = function (node) { + return contains(['figcaption'], name(node)); + }; + var rangeBefore = function (target) { + var rng = document.createRange(); + rng.setStartBefore(target.dom); + rng.setEndBefore(target.dom); + return rng; + }; + var insertElement = function (root, elm, forward) { + if (forward) { + append(root, elm); + } else { + prepend(root, elm); + } + }; + var insertBr = function (root, forward) { + var br = SugarElement.fromTag('br'); + insertElement(root, br, forward); + return rangeBefore(br); + }; + var insertBlock$1 = function (root, forward, blockName, attrs) { + var block = SugarElement.fromTag(blockName); + var br = SugarElement.fromTag('br'); + setAll(block, attrs); + append(block, br); + insertElement(root, block, forward); + return rangeBefore(br); + }; + var insertEmptyLine = function (root, rootBlockName, attrs, forward) { + if (rootBlockName === '') { + return insertBr(root, forward); + } else { + return insertBlock$1(root, forward, rootBlockName, attrs); + } + }; + var getClosestTargetBlock = function (pos, root) { + var isRoot = curry(eq$2, root); + return closest(SugarElement.fromDom(pos.container()), isBlock, isRoot).filter(isTarget); + }; + var isAtFirstOrLastLine = function (root, forward, pos) { + return forward ? isAtLastLine(root.dom, pos) : isAtFirstLine(root.dom, pos); + }; + var moveCaretToNewEmptyLine = function (editor, forward) { + var root = SugarElement.fromDom(editor.getBody()); + var pos = CaretPosition$1.fromRangeStart(editor.selection.getRng()); + var rootBlock = getForcedRootBlock(editor); + var rootBlockAttrs = getForcedRootBlockAttrs(editor); + return getClosestTargetBlock(pos, root).exists(function () { + if (isAtFirstOrLastLine(root, forward, pos)) { + var rng = insertEmptyLine(root, rootBlock, rootBlockAttrs, forward); + editor.selection.setRng(rng); + return true; + } else { + return false; + } + }); + }; + var moveV$1 = function (editor, forward) { + if (editor.selection.isCollapsed()) { + return moveCaretToNewEmptyLine(editor, forward); + } else { + return false; + } + }; + + var defaultPatterns = function (patterns) { + return map(patterns, function (pattern) { + return __assign({ + shiftKey: false, + altKey: false, + ctrlKey: false, + metaKey: false, + keyCode: 0, + action: noop + }, pattern); + }); + }; + var matchesEvent = function (pattern, evt) { + return evt.keyCode === pattern.keyCode && evt.shiftKey === pattern.shiftKey && evt.altKey === pattern.altKey && evt.ctrlKey === pattern.ctrlKey && evt.metaKey === pattern.metaKey; + }; + var match$1 = function (patterns, evt) { + return bind(defaultPatterns(patterns), function (pattern) { + return matchesEvent(pattern, evt) ? [pattern] : []; + }); + }; + var action = function (f) { + var x = []; + for (var _i = 1; _i < arguments.length; _i++) { + x[_i - 1] = arguments[_i]; + } + return function () { + return f.apply(null, x); + }; + }; + var execute = function (patterns, evt) { + return find(match$1(patterns, evt), function (pattern) { + return pattern.action(); + }); + }; + + var moveH$1 = function (editor, forward) { + var direction = forward ? HDirection.Forwards : HDirection.Backwards; + var range = editor.selection.getRng(); + return moveHorizontally(editor, direction, range, isBeforeMedia, isAfterMedia, isMedia).exists(function (newRange) { + moveToRange(editor, newRange); + return true; + }); + }; + var moveV$2 = function (editor, down) { + var direction = down ? 1 : -1; + var range = editor.selection.getRng(); + return moveVertically(editor, direction, range, isBeforeMedia, isAfterMedia, isMedia).exists(function (newRange) { + moveToRange(editor, newRange); + return true; + }); + }; + var moveToLineEndPoint$2 = function (editor, forward) { + var isNearMedia = forward ? isAfterMedia : isBeforeMedia; + return moveToLineEndPoint(editor, forward, isNearMedia); + }; + + var deflate = function (rect, delta) { + return { + left: rect.left - delta, + top: rect.top - delta, + right: rect.right + delta * 2, + bottom: rect.bottom + delta * 2, + width: rect.width + delta, + height: rect.height + delta + }; + }; + var getCorners = function (getYAxisValue, tds) { + return bind(tds, function (td) { + var rect = deflate(clone$2(td.getBoundingClientRect()), -1); + return [ + { + x: rect.left, + y: getYAxisValue(rect), + cell: td + }, + { + x: rect.right, + y: getYAxisValue(rect), + cell: td + } + ]; + }); + }; + var findClosestCorner = function (corners, x, y) { + return foldl(corners, function (acc, newCorner) { + return acc.fold(function () { + return Optional.some(newCorner); + }, function (oldCorner) { + var oldDist = Math.sqrt(Math.abs(oldCorner.x - x) + Math.abs(oldCorner.y - y)); + var newDist = Math.sqrt(Math.abs(newCorner.x - x) + Math.abs(newCorner.y - y)); + return Optional.some(newDist < oldDist ? newCorner : oldCorner); + }); + }, Optional.none()); + }; + var getClosestCell$1 = function (getYAxisValue, isTargetCorner, table, x, y) { + var cells = descendants$1(SugarElement.fromDom(table), 'td,th,caption').map(function (e) { + return e.dom; + }); + var corners = filter(getCorners(getYAxisValue, cells), function (corner) { + return isTargetCorner(corner, y); + }); + return findClosestCorner(corners, x, y).map(function (corner) { + return corner.cell; + }); + }; + var getBottomValue = function (rect) { + return rect.bottom; + }; + var getTopValue = function (rect) { + return rect.top; + }; + var isAbove$1 = function (corner, y) { + return corner.y < y; + }; + var isBelow$1 = function (corner, y) { + return corner.y > y; + }; + var getClosestCellAbove = curry(getClosestCell$1, getBottomValue, isAbove$1); + var getClosestCellBelow = curry(getClosestCell$1, getTopValue, isBelow$1); + var findClosestPositionInAboveCell = function (table, pos) { + return head(pos.getClientRects()).bind(function (rect) { + return getClosestCellAbove(table, rect.left, rect.top); + }).bind(function (cell) { + return findClosestHorizontalPosition(getLastLinePositions(cell), pos); + }); + }; + var findClosestPositionInBelowCell = function (table, pos) { + return last(pos.getClientRects()).bind(function (rect) { + return getClosestCellBelow(table, rect.left, rect.top); + }).bind(function (cell) { + return findClosestHorizontalPosition(getFirstLinePositions(cell), pos); + }); + }; + + var hasNextBreak = function (getPositionsUntil, scope, lineInfo) { + return lineInfo.breakAt.exists(function (breakPos) { + return getPositionsUntil(scope, breakPos).breakAt.isSome(); + }); + }; + var startsWithWrapBreak = function (lineInfo) { + return lineInfo.breakType === BreakType.Wrap && lineInfo.positions.length === 0; + }; + var startsWithBrBreak = function (lineInfo) { + return lineInfo.breakType === BreakType.Br && lineInfo.positions.length === 1; + }; + var isAtTableCellLine = function (getPositionsUntil, scope, pos) { + var lineInfo = getPositionsUntil(scope, pos); + if (startsWithWrapBreak(lineInfo) || !isBr(pos.getNode()) && startsWithBrBreak(lineInfo)) { + return !hasNextBreak(getPositionsUntil, scope, lineInfo); + } else { + return lineInfo.breakAt.isNone(); + } + }; + var isAtFirstTableCellLine = curry(isAtTableCellLine, getPositionsUntilPreviousLine); + var isAtLastTableCellLine = curry(isAtTableCellLine, getPositionsUntilNextLine); + var isCaretAtStartOrEndOfTable = function (forward, rng, table) { + var caretPos = CaretPosition$1.fromRangeStart(rng); + return positionIn(!forward, table).exists(function (pos) { + return pos.isEqual(caretPos); + }); + }; + var navigateHorizontally = function (editor, forward, table, _td) { + var rng = editor.selection.getRng(); + var direction = forward ? 1 : -1; + if (isFakeCaretTableBrowser() && isCaretAtStartOrEndOfTable(forward, rng, table)) { + showCaret(direction, editor, table, !forward, false).each(function (newRng) { + moveToRange(editor, newRng); + }); + return true; + } + return false; + }; + var getClosestAbovePosition = function (root, table, start) { + return findClosestPositionInAboveCell(table, start).orThunk(function () { + return head(start.getClientRects()).bind(function (rect) { + return findClosestHorizontalPositionFromPoint(getPositionsAbove(root, CaretPosition$1.before(table)), rect.left); + }); + }).getOr(CaretPosition$1.before(table)); + }; + var getClosestBelowPosition = function (root, table, start) { + return findClosestPositionInBelowCell(table, start).orThunk(function () { + return head(start.getClientRects()).bind(function (rect) { + return findClosestHorizontalPositionFromPoint(getPositionsBelow(root, CaretPosition$1.after(table)), rect.left); + }); + }).getOr(CaretPosition$1.after(table)); + }; + var getTable = function (previous, pos) { + var node = pos.getNode(previous); + return isElement$1(node) && node.nodeName === 'TABLE' ? Optional.some(node) : Optional.none(); + }; + var renderBlock = function (down, editor, table, pos) { + var forcedRootBlock = getForcedRootBlock(editor); + if (forcedRootBlock) { + editor.undoManager.transact(function () { + var element = SugarElement.fromTag(forcedRootBlock); + setAll(element, getForcedRootBlockAttrs(editor)); + append(element, SugarElement.fromTag('br')); + if (down) { + after(SugarElement.fromDom(table), element); + } else { + before(SugarElement.fromDom(table), element); + } + var rng = editor.dom.createRng(); + rng.setStart(element.dom, 0); + rng.setEnd(element.dom, 0); + moveToRange(editor, rng); + }); + } else { + moveToRange(editor, pos.toRange()); + } + }; + var moveCaret = function (editor, down, pos) { + var table = down ? getTable(true, pos) : getTable(false, pos); + var last = down === false; + table.fold(function () { + return moveToRange(editor, pos.toRange()); + }, function (table) { + return positionIn(last, editor.getBody()).filter(function (lastPos) { + return lastPos.isEqual(pos); + }).fold(function () { + return moveToRange(editor, pos.toRange()); + }, function (_) { + return renderBlock(down, editor, table, pos); + }); + }); + }; + var navigateVertically = function (editor, down, table, td) { + var rng = editor.selection.getRng(); + var pos = CaretPosition$1.fromRangeStart(rng); + var root = editor.getBody(); + if (!down && isAtFirstTableCellLine(td, pos)) { + var newPos = getClosestAbovePosition(root, table, pos); + moveCaret(editor, down, newPos); + return true; + } else if (down && isAtLastTableCellLine(td, pos)) { + var newPos = getClosestBelowPosition(root, table, pos); + moveCaret(editor, down, newPos); + return true; + } else { + return false; + } + }; + var move$1 = function (editor, forward, mover) { + return Optional.from(editor.dom.getParent(editor.selection.getNode(), 'td,th')).bind(function (td) { + return Optional.from(editor.dom.getParent(td, 'table')).map(function (table) { + return mover(editor, forward, table, td); + }); + }).getOr(false); + }; + var moveH$2 = function (editor, forward) { + return move$1(editor, forward, navigateHorizontally); + }; + var moveV$3 = function (editor, forward) { + return move$1(editor, forward, navigateVertically); + }; + + var executeKeydownOverride = function (editor, caret, evt) { + var os = detect$3().os; + execute([ + { + keyCode: VK.RIGHT, + action: action(moveH, editor, true) + }, + { + keyCode: VK.LEFT, + action: action(moveH, editor, false) + }, + { + keyCode: VK.UP, + action: action(moveV, editor, false) + }, + { + keyCode: VK.DOWN, + action: action(moveV, editor, true) + }, + { + keyCode: VK.RIGHT, + action: action(moveH$2, editor, true) + }, + { + keyCode: VK.LEFT, + action: action(moveH$2, editor, false) + }, + { + keyCode: VK.UP, + action: action(moveV$3, editor, false) + }, + { + keyCode: VK.DOWN, + action: action(moveV$3, editor, true) + }, + { + keyCode: VK.RIGHT, + action: action(moveH$1, editor, true) + }, + { + keyCode: VK.LEFT, + action: action(moveH$1, editor, false) + }, + { + keyCode: VK.UP, + action: action(moveV$2, editor, false) + }, + { + keyCode: VK.DOWN, + action: action(moveV$2, editor, true) + }, + { + keyCode: VK.RIGHT, + action: action(move, editor, caret, true) + }, + { + keyCode: VK.LEFT, + action: action(move, editor, caret, false) + }, + { + keyCode: VK.RIGHT, + ctrlKey: !os.isOSX(), + altKey: os.isOSX(), + action: action(moveNextWord, editor, caret) + }, + { + keyCode: VK.LEFT, + ctrlKey: !os.isOSX(), + altKey: os.isOSX(), + action: action(movePrevWord, editor, caret) + }, + { + keyCode: VK.UP, + action: action(moveV$1, editor, false) + }, + { + keyCode: VK.DOWN, + action: action(moveV$1, editor, true) + } + ], evt).each(function (_) { + evt.preventDefault(); + }); + }; + var setup$c = function (editor, caret) { + editor.on('keydown', function (evt) { + if (evt.isDefaultPrevented() === false) { + executeKeydownOverride(editor, caret, evt); + } + }); + }; + + var executeKeydownOverride$1 = function (editor, caret, evt) { + execute([ + { + keyCode: VK.BACKSPACE, + action: action(backspaceDelete$9, editor, false) + }, + { + keyCode: VK.BACKSPACE, + action: action(backspaceDelete$4, editor, false) + }, + { + keyCode: VK.DELETE, + action: action(backspaceDelete$4, editor, true) + }, + { + keyCode: VK.BACKSPACE, + action: action(backspaceDelete$3, editor, false) + }, + { + keyCode: VK.DELETE, + action: action(backspaceDelete$3, editor, true) + }, + { + keyCode: VK.BACKSPACE, + action: action(backspaceDelete$6, editor, caret, false) + }, + { + keyCode: VK.DELETE, + action: action(backspaceDelete$6, editor, caret, true) + }, + { + keyCode: VK.BACKSPACE, + action: action(backspaceDelete, editor, false) + }, + { + keyCode: VK.DELETE, + action: action(backspaceDelete, editor, true) + }, + { + keyCode: VK.BACKSPACE, + action: action(backspaceDelete$5, editor, false) + }, + { + keyCode: VK.DELETE, + action: action(backspaceDelete$5, editor, true) + }, + { + keyCode: VK.BACKSPACE, + action: action(backspaceDelete$8, editor, false) + }, + { + keyCode: VK.DELETE, + action: action(backspaceDelete$8, editor, true) + }, + { + keyCode: VK.BACKSPACE, + action: action(backspaceDelete$2, editor, false) + }, + { + keyCode: VK.DELETE, + action: action(backspaceDelete$2, editor, true) + }, + { + keyCode: VK.BACKSPACE, + action: action(backspaceDelete$1, editor, false) + }, + { + keyCode: VK.DELETE, + action: action(backspaceDelete$1, editor, true) + }, + { + keyCode: VK.BACKSPACE, + action: action(backspaceDelete$7, editor, false) + }, + { + keyCode: VK.DELETE, + action: action(backspaceDelete$7, editor, true) + } + ], evt).each(function (_) { + evt.preventDefault(); + }); + }; + var executeKeyupOverride = function (editor, evt) { + execute([ + { + keyCode: VK.BACKSPACE, + action: action(paddEmptyElement, editor) + }, + { + keyCode: VK.DELETE, + action: action(paddEmptyElement, editor) + } + ], evt); + }; + var setup$d = function (editor, caret) { + editor.on('keydown', function (evt) { + if (evt.isDefaultPrevented() === false) { + executeKeydownOverride$1(editor, caret, evt); + } + }); + editor.on('keyup', function (evt) { + if (evt.isDefaultPrevented() === false) { + executeKeyupOverride(editor, evt); + } + }); + }; + + var firstNonWhiteSpaceNodeSibling = function (node) { + while (node) { + if (node.nodeType === 1 || node.nodeType === 3 && node.data && /[\r\n\s]/.test(node.data)) { + return node; + } + node = node.nextSibling; + } + }; + var moveToCaretPosition = function (editor, root) { + var node, lastNode = root; + var dom = editor.dom; + var moveCaretBeforeOnEnterElementsMap = editor.schema.getMoveCaretBeforeOnEnterElements(); + if (!root) { + return; + } + if (/^(LI|DT|DD)$/.test(root.nodeName)) { + var firstChild = firstNonWhiteSpaceNodeSibling(root.firstChild); + if (firstChild && /^(UL|OL|DL)$/.test(firstChild.nodeName)) { + root.insertBefore(dom.doc.createTextNode(nbsp), root.firstChild); + } + } + var rng = dom.createRng(); + root.normalize(); + if (root.hasChildNodes()) { + var walker = new DomTreeWalker(root, root); + while (node = walker.current()) { + if (isText$1(node)) { + rng.setStart(node, 0); + rng.setEnd(node, 0); + break; + } + if (moveCaretBeforeOnEnterElementsMap[node.nodeName.toLowerCase()]) { + rng.setStartBefore(node); + rng.setEndBefore(node); + break; + } + lastNode = node; + node = walker.next(); + } + if (!node) { + rng.setStart(lastNode, 0); + rng.setEnd(lastNode, 0); + } + } else { + if (isBr(root)) { + if (root.nextSibling && dom.isBlock(root.nextSibling)) { + rng.setStartBefore(root); + rng.setEndBefore(root); + } else { + rng.setStartAfter(root); + rng.setEndAfter(root); + } + } else { + rng.setStart(root, 0); + rng.setEnd(root, 0); + } + } + editor.selection.setRng(rng); + scrollRangeIntoView(editor, rng); + }; + var getEditableRoot = function (dom, node) { + var root = dom.getRoot(); + var parent, editableRoot; + parent = node; + while (parent !== root && dom.getContentEditable(parent) !== 'false') { + if (dom.getContentEditable(parent) === 'true') { + editableRoot = parent; + } + parent = parent.parentNode; + } + return parent !== root ? editableRoot : root; + }; + var getParentBlock$2 = function (editor) { + return Optional.from(editor.dom.getParent(editor.selection.getStart(true), editor.dom.isBlock)); + }; + var getParentBlockName = function (editor) { + return getParentBlock$2(editor).fold(constant(''), function (parentBlock) { + return parentBlock.nodeName.toUpperCase(); + }); + }; + var isListItemParentBlock = function (editor) { + return getParentBlock$2(editor).filter(function (elm) { + return isListItem(SugarElement.fromDom(elm)); + }).isSome(); + }; + + var hasFirstChild = function (elm, name) { + return elm.firstChild && elm.firstChild.nodeName === name; + }; + var hasParent$1 = function (elm, parentName) { + return elm && elm.parentNode && elm.parentNode.nodeName === parentName; + }; + var isListBlock = function (elm) { + return elm && /^(OL|UL|LI)$/.test(elm.nodeName); + }; + var isNestedList = function (elm) { + return isListBlock(elm) && isListBlock(elm.parentNode); + }; + var getContainerBlock = function (containerBlock) { + var containerBlockParent = containerBlock.parentNode; + if (/^(LI|DT|DD)$/.test(containerBlockParent.nodeName)) { + return containerBlockParent; + } + return containerBlock; + }; + var isFirstOrLastLi = function (containerBlock, parentBlock, first) { + var node = containerBlock[first ? 'firstChild' : 'lastChild']; + while (node) { + if (isElement$1(node)) { + break; + } + node = node[first ? 'nextSibling' : 'previousSibling']; + } + return node === parentBlock; + }; + var insert = function (editor, createNewBlock, containerBlock, parentBlock, newBlockName) { + var dom = editor.dom; + var rng = editor.selection.getRng(); + if (containerBlock === editor.getBody()) { + return; + } + if (isNestedList(containerBlock)) { + newBlockName = 'LI'; + } + var newBlock = newBlockName ? createNewBlock(newBlockName) : dom.create('BR'); + if (isFirstOrLastLi(containerBlock, parentBlock, true) && isFirstOrLastLi(containerBlock, parentBlock, false)) { + if (hasParent$1(containerBlock, 'LI')) { + dom.insertAfter(newBlock, getContainerBlock(containerBlock)); + } else { + dom.replace(newBlock, containerBlock); + } + } else if (isFirstOrLastLi(containerBlock, parentBlock, true)) { + if (hasParent$1(containerBlock, 'LI')) { + dom.insertAfter(newBlock, getContainerBlock(containerBlock)); + newBlock.appendChild(dom.doc.createTextNode(' ')); + newBlock.appendChild(containerBlock); + } else { + containerBlock.parentNode.insertBefore(newBlock, containerBlock); + } + } else if (isFirstOrLastLi(containerBlock, parentBlock, false)) { + dom.insertAfter(newBlock, getContainerBlock(containerBlock)); + } else { + containerBlock = getContainerBlock(containerBlock); + var tmpRng = rng.cloneRange(); + tmpRng.setStartAfter(parentBlock); + tmpRng.setEndAfter(containerBlock); + var fragment = tmpRng.extractContents(); + if (newBlockName === 'LI' && hasFirstChild(fragment, 'LI')) { + newBlock = fragment.firstChild; + dom.insertAfter(fragment, containerBlock); + } else { + dom.insertAfter(fragment, containerBlock); + dom.insertAfter(newBlock, containerBlock); + } + } + dom.remove(parentBlock); + moveToCaretPosition(editor, newBlock); + }; + + var trimZwsp = function (fragment) { + each(descendants(SugarElement.fromDom(fragment), isText), function (text) { + var rawNode = text.dom; + rawNode.nodeValue = trim$2(rawNode.nodeValue); + }); + }; + var isEmptyAnchor = function (dom, elm) { + return elm && elm.nodeName === 'A' && dom.isEmpty(elm); + }; + var isTableCell$5 = function (node) { + return node && /^(TD|TH|CAPTION)$/.test(node.nodeName); + }; + var emptyBlock = function (elm) { + elm.innerHTML = '
    '; + }; + var containerAndSiblingName = function (container, nodeName) { + return container.nodeName === nodeName || container.previousSibling && container.previousSibling.nodeName === nodeName; + }; + var canSplitBlock = function (dom, node) { + return node && dom.isBlock(node) && !/^(TD|TH|CAPTION|FORM)$/.test(node.nodeName) && !/^(fixed|absolute)/i.test(node.style.position) && dom.getContentEditable(node) !== 'true'; + }; + var trimInlineElementsOnLeftSideOfBlock = function (dom, nonEmptyElementsMap, block) { + var node = block; + var firstChilds = []; + var i; + if (!node) { + return; + } + while (node = node.firstChild) { + if (dom.isBlock(node)) { + return; + } + if (isElement$1(node) && !nonEmptyElementsMap[node.nodeName.toLowerCase()]) { + firstChilds.push(node); + } + } + i = firstChilds.length; + while (i--) { + node = firstChilds[i]; + if (!node.hasChildNodes() || node.firstChild === node.lastChild && node.firstChild.nodeValue === '') { + dom.remove(node); + } else { + if (isEmptyAnchor(dom, node)) { + dom.remove(node); + } + } + } + }; + var normalizeZwspOffset = function (start, container, offset) { + if (isText$1(container) === false) { + return offset; + } else if (start) { + return offset === 1 && container.data.charAt(offset - 1) === ZWSP ? 0 : offset; + } else { + return offset === container.data.length - 1 && container.data.charAt(offset) === ZWSP ? container.data.length : offset; + } + }; + var includeZwspInRange = function (rng) { + var newRng = rng.cloneRange(); + newRng.setStart(rng.startContainer, normalizeZwspOffset(true, rng.startContainer, rng.startOffset)); + newRng.setEnd(rng.endContainer, normalizeZwspOffset(false, rng.endContainer, rng.endOffset)); + return newRng; + }; + var trimLeadingLineBreaks = function (node) { + do { + if (isText$1(node)) { + node.nodeValue = node.nodeValue.replace(/^[\r\n]+/, ''); + } + node = node.firstChild; + } while (node); + }; + var getEditableRoot$1 = function (dom, node) { + var root = dom.getRoot(); + var parent, editableRoot; + parent = node; + while (parent !== root && dom.getContentEditable(parent) !== 'false') { + if (dom.getContentEditable(parent) === 'true') { + editableRoot = parent; + } + parent = parent.parentNode; + } + return parent !== root ? editableRoot : root; + }; + var applyAttributes = function (editor, node, forcedRootBlockAttrs) { + var dom = editor.dom; + Optional.from(forcedRootBlockAttrs.style).map(dom.parseStyle).each(function (attrStyles) { + var currentStyles = getAllRaw(SugarElement.fromDom(node)); + var newStyles = __assign(__assign({}, currentStyles), attrStyles); + dom.setStyles(node, newStyles); + }); + var attrClassesOpt = Optional.from(forcedRootBlockAttrs.class).map(function (attrClasses) { + return attrClasses.split(/\s+/); + }); + var currentClassesOpt = Optional.from(node.className).map(function (currentClasses) { + return filter(currentClasses.split(/\s+/), function (clazz) { + return clazz !== ''; + }); + }); + lift2(attrClassesOpt, currentClassesOpt, function (attrClasses, currentClasses) { + var filteredClasses = filter(currentClasses, function (clazz) { + return !contains(attrClasses, clazz); + }); + var newClasses = __spreadArrays(attrClasses, filteredClasses); + dom.setAttrib(node, 'class', newClasses.join(' ')); + }); + var appliedAttrs = [ + 'style', + 'class' + ]; + var remainingAttrs = filter$1(forcedRootBlockAttrs, function (_, attrs) { + return !contains(appliedAttrs, attrs); + }); + dom.setAttribs(node, remainingAttrs); + }; + var setForcedBlockAttrs = function (editor, node) { + var forcedRootBlockName = getForcedRootBlock(editor); + if (forcedRootBlockName && forcedRootBlockName.toLowerCase() === node.tagName.toLowerCase()) { + var forcedRootBlockAttrs = getForcedRootBlockAttrs(editor); + applyAttributes(editor, node, forcedRootBlockAttrs); + } + }; + var wrapSelfAndSiblingsInDefaultBlock = function (editor, newBlockName, rng, container, offset) { + var newBlock, parentBlock, startNode, node, next, rootBlockName; + var blockName = newBlockName || 'P'; + var dom = editor.dom, editableRoot = getEditableRoot$1(dom, container); + parentBlock = dom.getParent(container, dom.isBlock); + if (!parentBlock || !canSplitBlock(dom, parentBlock)) { + parentBlock = parentBlock || editableRoot; + if (parentBlock === editor.getBody() || isTableCell$5(parentBlock)) { + rootBlockName = parentBlock.nodeName.toLowerCase(); + } else { + rootBlockName = parentBlock.parentNode.nodeName.toLowerCase(); + } + if (!parentBlock.hasChildNodes()) { + newBlock = dom.create(blockName); + setForcedBlockAttrs(editor, newBlock); + parentBlock.appendChild(newBlock); + rng.setStart(newBlock, 0); + rng.setEnd(newBlock, 0); + return newBlock; + } + node = container; + while (node.parentNode !== parentBlock) { + node = node.parentNode; + } + while (node && !dom.isBlock(node)) { + startNode = node; + node = node.previousSibling; + } + if (startNode && editor.schema.isValidChild(rootBlockName, blockName.toLowerCase())) { + newBlock = dom.create(blockName); + setForcedBlockAttrs(editor, newBlock); + startNode.parentNode.insertBefore(newBlock, startNode); + node = startNode; + while (node && !dom.isBlock(node)) { + next = node.nextSibling; + newBlock.appendChild(node); + node = next; + } + rng.setStart(container, offset); + rng.setEnd(container, offset); + } + } + return container; + }; + var addBrToBlockIfNeeded = function (dom, block) { + block.normalize(); + var lastChild = block.lastChild; + if (!lastChild || /^(left|right)$/gi.test(dom.getStyle(lastChild, 'float', true))) { + dom.add(block, 'br'); + } + }; + var insert$1 = function (editor, evt) { + var tmpRng, container, offset, parentBlock; + var newBlock, fragment, containerBlock, parentBlockName, newBlockName, isAfterLastNodeInContainer; + var dom = editor.dom; + var schema = editor.schema, nonEmptyElementsMap = schema.getNonEmptyElements(); + var rng = editor.selection.getRng(); + var createNewBlock = function (name) { + var node = container, block, clonedNode, caretNode; + var textInlineElements = schema.getTextInlineElements(); + if (name || parentBlockName === 'TABLE' || parentBlockName === 'HR') { + block = dom.create(name || newBlockName); + } else { + block = parentBlock.cloneNode(false); + } + caretNode = block; + if (shouldKeepStyles(editor) === false) { + dom.setAttrib(block, 'style', null); + dom.setAttrib(block, 'class', null); + } else { + do { + if (textInlineElements[node.nodeName]) { + if (isCaretNode(node) || isBookmarkNode$1(node)) { + continue; + } + clonedNode = node.cloneNode(false); + dom.setAttrib(clonedNode, 'id', ''); + if (block.hasChildNodes()) { + clonedNode.appendChild(block.firstChild); + block.appendChild(clonedNode); + } else { + caretNode = clonedNode; + block.appendChild(clonedNode); + } + } + } while ((node = node.parentNode) && node !== editableRoot); + } + setForcedBlockAttrs(editor, block); + emptyBlock(caretNode); + return block; + }; + var isCaretAtStartOrEndOfBlock = function (start) { + var node, name; + var normalizedOffset = normalizeZwspOffset(start, container, offset); + if (isText$1(container) && (start ? normalizedOffset > 0 : normalizedOffset < container.nodeValue.length)) { + return false; + } + if (container.parentNode === parentBlock && isAfterLastNodeInContainer && !start) { + return true; + } + if (start && isElement$1(container) && container === parentBlock.firstChild) { + return true; + } + if (containerAndSiblingName(container, 'TABLE') || containerAndSiblingName(container, 'HR')) { + return isAfterLastNodeInContainer && !start || !isAfterLastNodeInContainer && start; + } + var walker = new DomTreeWalker(container, parentBlock); + if (isText$1(container)) { + if (start && normalizedOffset === 0) { + walker.prev(); + } else if (!start && normalizedOffset === container.nodeValue.length) { + walker.next(); + } + } + while (node = walker.current()) { + if (isElement$1(node)) { + if (!node.getAttribute('data-mce-bogus')) { + name = node.nodeName.toLowerCase(); + if (nonEmptyElementsMap[name] && name !== 'br') { + return false; + } + } + } else if (isText$1(node) && !isWhitespaceText(node.nodeValue)) { + return false; + } + if (start) { + walker.prev(); + } else { + walker.next(); + } + } + return true; + }; + var insertNewBlockAfter = function () { + if (/^(H[1-6]|PRE|FIGURE)$/.test(parentBlockName) && containerBlockName !== 'HGROUP') { + newBlock = createNewBlock(newBlockName); + } else { + newBlock = createNewBlock(); + } + if (shouldEndContainerOnEmptyBlock(editor) && canSplitBlock(dom, containerBlock) && dom.isEmpty(parentBlock)) { + newBlock = dom.split(containerBlock, parentBlock); + } else { + dom.insertAfter(newBlock, parentBlock); + } + moveToCaretPosition(editor, newBlock); + }; + normalize(dom, rng).each(function (normRng) { + rng.setStart(normRng.startContainer, normRng.startOffset); + rng.setEnd(normRng.endContainer, normRng.endOffset); + }); + container = rng.startContainer; + offset = rng.startOffset; + newBlockName = getForcedRootBlock(editor); + var shiftKey = !!(evt && evt.shiftKey); + var ctrlKey = !!(evt && evt.ctrlKey); + if (isElement$1(container) && container.hasChildNodes()) { + isAfterLastNodeInContainer = offset > container.childNodes.length - 1; + container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container; + if (isAfterLastNodeInContainer && isText$1(container)) { + offset = container.nodeValue.length; + } else { + offset = 0; + } + } + var editableRoot = getEditableRoot$1(dom, container); + if (!editableRoot) { + return; + } + if (newBlockName && !shiftKey || !newBlockName && shiftKey) { + container = wrapSelfAndSiblingsInDefaultBlock(editor, newBlockName, rng, container, offset); + } + parentBlock = dom.getParent(container, dom.isBlock); + containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null; + parentBlockName = parentBlock ? parentBlock.nodeName.toUpperCase() : ''; + var containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : ''; + if (containerBlockName === 'LI' && !ctrlKey) { + parentBlock = containerBlock; + containerBlock = containerBlock.parentNode; + parentBlockName = containerBlockName; + } + if (/^(LI|DT|DD)$/.test(parentBlockName)) { + if (dom.isEmpty(parentBlock)) { + insert(editor, createNewBlock, containerBlock, parentBlock, newBlockName); + return; + } + } + if (newBlockName && parentBlock === editor.getBody()) { + return; + } + newBlockName = newBlockName || 'P'; + if (isCaretContainerBlock(parentBlock)) { + newBlock = showCaretContainerBlock(parentBlock); + if (dom.isEmpty(parentBlock)) { + emptyBlock(parentBlock); + } + setForcedBlockAttrs(editor, newBlock); + moveToCaretPosition(editor, newBlock); + } else if (isCaretAtStartOrEndOfBlock()) { + insertNewBlockAfter(); + } else if (isCaretAtStartOrEndOfBlock(true)) { + newBlock = parentBlock.parentNode.insertBefore(createNewBlock(), parentBlock); + moveToCaretPosition(editor, containerAndSiblingName(parentBlock, 'HR') ? newBlock : parentBlock); + } else { + tmpRng = includeZwspInRange(rng).cloneRange(); + tmpRng.setEndAfter(parentBlock); + fragment = tmpRng.extractContents(); + trimZwsp(fragment); + trimLeadingLineBreaks(fragment); + newBlock = fragment.firstChild; + dom.insertAfter(fragment, parentBlock); + trimInlineElementsOnLeftSideOfBlock(dom, nonEmptyElementsMap, newBlock); + addBrToBlockIfNeeded(dom, parentBlock); + if (dom.isEmpty(parentBlock)) { + emptyBlock(parentBlock); + } + newBlock.normalize(); + if (dom.isEmpty(newBlock)) { + dom.remove(newBlock); + insertNewBlockAfter(); + } else { + setForcedBlockAttrs(editor, newBlock); + moveToCaretPosition(editor, newBlock); + } + } + dom.setAttrib(newBlock, 'id', ''); + editor.fire('NewBlock', { newBlock: newBlock }); + }; + + var hasRightSideContent = function (schema, container, parentBlock) { + var walker = new DomTreeWalker(container, parentBlock); + var node; + var nonEmptyElementsMap = schema.getNonEmptyElements(); + while (node = walker.next()) { + if (nonEmptyElementsMap[node.nodeName.toLowerCase()] || node.length > 0) { + return true; + } + } + }; + var scrollToBr = function (dom, selection, brElm) { + var marker = dom.create('span', {}, ' '); + brElm.parentNode.insertBefore(marker, brElm); + selection.scrollIntoView(marker); + dom.remove(marker); + }; + var moveSelectionToBr = function (dom, selection, brElm, extraBr) { + var rng = dom.createRng(); + if (!extraBr) { + rng.setStartAfter(brElm); + rng.setEndAfter(brElm); + } else { + rng.setStartBefore(brElm); + rng.setEndBefore(brElm); + } + selection.setRng(rng); + }; + var insertBrAtCaret = function (editor, evt) { + var selection = editor.selection; + var dom = editor.dom; + var rng = selection.getRng(); + var brElm; + var extraBr; + normalize(dom, rng).each(function (normRng) { + rng.setStart(normRng.startContainer, normRng.startOffset); + rng.setEnd(normRng.endContainer, normRng.endOffset); + }); + var offset = rng.startOffset; + var container = rng.startContainer; + if (container.nodeType === 1 && container.hasChildNodes()) { + var isAfterLastNodeInContainer = offset > container.childNodes.length - 1; + container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container; + if (isAfterLastNodeInContainer && container.nodeType === 3) { + offset = container.nodeValue.length; + } else { + offset = 0; + } + } + var parentBlock = dom.getParent(container, dom.isBlock); + var containerBlock = parentBlock ? dom.getParent(parentBlock.parentNode, dom.isBlock) : null; + var containerBlockName = containerBlock ? containerBlock.nodeName.toUpperCase() : ''; + var isControlKey = !!(evt && evt.ctrlKey); + if (containerBlockName === 'LI' && !isControlKey) { + parentBlock = containerBlock; + } + if (container && container.nodeType === 3 && offset >= container.nodeValue.length) { + if (!hasRightSideContent(editor.schema, container, parentBlock)) { + brElm = dom.create('br'); + rng.insertNode(brElm); + rng.setStartAfter(brElm); + rng.setEndAfter(brElm); + extraBr = true; + } + } + brElm = dom.create('br'); + rangeInsertNode(dom, rng, brElm); + scrollToBr(dom, selection, brElm); + moveSelectionToBr(dom, selection, brElm, extraBr); + editor.undoManager.add(); + }; + var insertBrBefore = function (editor, inline) { + var br = SugarElement.fromTag('br'); + before(SugarElement.fromDom(inline), br); + editor.undoManager.add(); + }; + var insertBrAfter = function (editor, inline) { + if (!hasBrAfter(editor.getBody(), inline)) { + after(SugarElement.fromDom(inline), SugarElement.fromTag('br')); + } + var br = SugarElement.fromTag('br'); + after(SugarElement.fromDom(inline), br); + scrollToBr(editor.dom, editor.selection, br.dom); + moveSelectionToBr(editor.dom, editor.selection, br.dom, false); + editor.undoManager.add(); + }; + var isBeforeBr$1 = function (pos) { + return isBr(pos.getNode()); + }; + var hasBrAfter = function (rootNode, startNode) { + if (isBeforeBr$1(CaretPosition$1.after(startNode))) { + return true; + } else { + return nextPosition(rootNode, CaretPosition$1.after(startNode)).map(function (pos) { + return isBr(pos.getNode()); + }).getOr(false); + } + }; + var isAnchorLink = function (elm) { + return elm && elm.nodeName === 'A' && 'href' in elm; + }; + var isInsideAnchor = function (location) { + return location.fold(never, isAnchorLink, isAnchorLink, never); + }; + var readInlineAnchorLocation = function (editor) { + var isInlineTarget$1 = curry(isInlineTarget, editor); + var position = CaretPosition$1.fromRangeStart(editor.selection.getRng()); + return readLocation(isInlineTarget$1, editor.getBody(), position).filter(isInsideAnchor); + }; + var insertBrOutsideAnchor = function (editor, location) { + location.fold(noop, curry(insertBrBefore, editor), curry(insertBrAfter, editor), noop); + }; + var insert$2 = function (editor, evt) { + var anchorLocation = readInlineAnchorLocation(editor); + if (anchorLocation.isSome()) { + anchorLocation.each(curry(insertBrOutsideAnchor, editor)); + } else { + insertBrAtCaret(editor, evt); + } + }; + + var matchesSelector = function (editor, selector) { + return getParentBlock$2(editor).filter(function (parentBlock) { + return selector.length > 0 && is$1(SugarElement.fromDom(parentBlock), selector); + }).isSome(); + }; + var shouldInsertBr = function (editor) { + return matchesSelector(editor, getBrNewLineSelector(editor)); + }; + var shouldBlockNewLine = function (editor) { + return matchesSelector(editor, getNoNewLineSelector(editor)); + }; + + var newLineAction = Adt.generate([ + { br: [] }, + { block: [] }, + { none: [] } + ]); + var shouldBlockNewLine$1 = function (editor, _shiftKey) { + return shouldBlockNewLine(editor); + }; + var isBrMode = function (requiredState) { + return function (editor, _shiftKey) { + var brMode = getForcedRootBlock(editor) === ''; + return brMode === requiredState; + }; + }; + var inListBlock = function (requiredState) { + return function (editor, _shiftKey) { + return isListItemParentBlock(editor) === requiredState; + }; + }; + var inBlock = function (blockName, requiredState) { + return function (editor, _shiftKey) { + var state = getParentBlockName(editor) === blockName.toUpperCase(); + return state === requiredState; + }; + }; + var inPreBlock = function (requiredState) { + return inBlock('pre', requiredState); + }; + var inSummaryBlock = function () { + return inBlock('summary', true); + }; + var shouldPutBrInPre$1 = function (requiredState) { + return function (editor, _shiftKey) { + return shouldPutBrInPre(editor) === requiredState; + }; + }; + var inBrContext = function (editor, _shiftKey) { + return shouldInsertBr(editor); + }; + var hasShiftKey = function (_editor, shiftKey) { + return shiftKey; + }; + var canInsertIntoEditableRoot = function (editor) { + var forcedRootBlock = getForcedRootBlock(editor); + var rootEditable = getEditableRoot(editor.dom, editor.selection.getStart()); + return rootEditable && editor.schema.isValidChild(rootEditable.nodeName, forcedRootBlock ? forcedRootBlock : 'P'); + }; + var match$2 = function (predicates, action) { + return function (editor, shiftKey) { + var isMatch = foldl(predicates, function (res, p) { + return res && p(editor, shiftKey); + }, true); + return isMatch ? Optional.some(action) : Optional.none(); + }; + }; + var getAction$1 = function (editor, evt) { + return evaluateUntil([ + match$2([shouldBlockNewLine$1], newLineAction.none()), + match$2([inSummaryBlock()], newLineAction.br()), + match$2([ + inPreBlock(true), + shouldPutBrInPre$1(false), + hasShiftKey + ], newLineAction.br()), + match$2([ + inPreBlock(true), + shouldPutBrInPre$1(false) + ], newLineAction.block()), + match$2([ + inPreBlock(true), + shouldPutBrInPre$1(true), + hasShiftKey + ], newLineAction.block()), + match$2([ + inPreBlock(true), + shouldPutBrInPre$1(true) + ], newLineAction.br()), + match$2([ + inListBlock(true), + hasShiftKey + ], newLineAction.br()), + match$2([inListBlock(true)], newLineAction.block()), + match$2([ + isBrMode(true), + hasShiftKey, + canInsertIntoEditableRoot + ], newLineAction.block()), + match$2([isBrMode(true)], newLineAction.br()), + match$2([inBrContext], newLineAction.br()), + match$2([ + isBrMode(false), + hasShiftKey + ], newLineAction.br()), + match$2([canInsertIntoEditableRoot], newLineAction.block()) + ], [ + editor, + !!(evt && evt.shiftKey) + ]).getOr(newLineAction.none()); + }; + + var insert$3 = function (editor, evt) { + getAction$1(editor, evt).fold(function () { + insert$2(editor, evt); + }, function () { + insert$1(editor, evt); + }, noop); + }; + + var handleEnterKeyEvent = function (editor, event) { + if (event.isDefaultPrevented()) { + return; + } + event.preventDefault(); + endTypingLevelIgnoreLocks(editor.undoManager); + editor.undoManager.transact(function () { + if (editor.selection.isCollapsed() === false) { + editor.execCommand('Delete'); + } + insert$3(editor, event); + }); + }; + var setup$e = function (editor) { + editor.on('keydown', function (event) { + if (event.keyCode === VK.ENTER) { + handleEnterKeyEvent(editor, event); + } + }); + }; + + var executeKeydownOverride$2 = function (editor, evt) { + execute([ + { + keyCode: VK.END, + action: action(moveToLineEndPoint$1, editor, true) + }, + { + keyCode: VK.HOME, + action: action(moveToLineEndPoint$1, editor, false) + }, + { + keyCode: VK.END, + action: action(moveToLineEndPoint$2, editor, true) + }, + { + keyCode: VK.HOME, + action: action(moveToLineEndPoint$2, editor, false) + } + ], evt).each(function (_) { + evt.preventDefault(); + }); + }; + var setup$f = function (editor) { + editor.on('keydown', function (evt) { + if (evt.isDefaultPrevented() === false) { + executeKeydownOverride$2(editor, evt); + } + }); + }; + + var browser$4 = detect$3().browser; + var setupIeInput = function (editor) { + var keypressThrotter = first(function () { + if (!editor.composing) { + normalizeNbspsInEditor(editor); + } + }, 0); + if (browser$4.isIE()) { + editor.on('keypress', function (_e) { + keypressThrotter.throttle(); + }); + editor.on('remove', function (_e) { + keypressThrotter.cancel(); + }); + } + }; + var setup$g = function (editor) { + setupIeInput(editor); + editor.on('input', function (e) { + if (e.isComposing === false) { + normalizeNbspsInEditor(editor); + } + }); + }; + + var insertTextAtPosition = function (text, pos) { + var container = pos.container(); + var offset = pos.offset(); + if (isText$1(container)) { + container.insertData(offset, text); + return Optional.some(CaretPosition(container, offset + text.length)); + } else { + return getElementFromPosition(pos).map(function (elm) { + var textNode = SugarElement.fromText(text); + if (pos.isAtEnd()) { + after(elm, textNode); + } else { + before(elm, textNode); + } + return CaretPosition(textNode.dom, text.length); + }); + } + }; + var insertNbspAtPosition = curry(insertTextAtPosition, nbsp); + var insertSpaceAtPosition = curry(insertTextAtPosition, ' '); + + var locationToCaretPosition = function (root) { + return function (location) { + return location.fold(function (element) { + return prevPosition(root.dom, CaretPosition$1.before(element)); + }, function (element) { + return firstPositionIn(element); + }, function (element) { + return lastPositionIn(element); + }, function (element) { + return nextPosition(root.dom, CaretPosition$1.after(element)); + }); + }; + }; + var insertInlineBoundarySpaceOrNbsp = function (root, pos) { + return function (checkPos) { + return needsToHaveNbsp(root, checkPos) ? insertNbspAtPosition(pos) : insertSpaceAtPosition(pos); + }; + }; + var setSelection$1 = function (editor) { + return function (pos) { + editor.selection.setRng(pos.toRange()); + editor.nodeChanged(); + return true; + }; + }; + var insertSpaceOrNbspAtSelection = function (editor) { + var pos = CaretPosition$1.fromRangeStart(editor.selection.getRng()); + var root = SugarElement.fromDom(editor.getBody()); + if (editor.selection.isCollapsed()) { + var isInlineTarget$1 = curry(isInlineTarget, editor); + var caretPosition = CaretPosition$1.fromRangeStart(editor.selection.getRng()); + return readLocation(isInlineTarget$1, editor.getBody(), caretPosition).bind(locationToCaretPosition(root)).bind(insertInlineBoundarySpaceOrNbsp(root, pos)).exists(setSelection$1(editor)); + } else { + return false; + } + }; + + var executeKeydownOverride$3 = function (editor, evt) { + execute([{ + keyCode: VK.SPACEBAR, + action: action(insertSpaceOrNbspAtSelection, editor) + }], evt).each(function (_) { + evt.preventDefault(); + }); + }; + var setup$h = function (editor) { + editor.on('keydown', function (evt) { + if (evt.isDefaultPrevented() === false) { + executeKeydownOverride$3(editor, evt); + } + }); + }; + + var registerKeyboardOverrides = function (editor) { + var caret = setupSelectedState(editor); + setup$b(editor); + setup$c(editor, caret); + setup$d(editor, caret); + setup$e(editor); + setup$h(editor); + setup$g(editor); + setup$f(editor); + return caret; + }; + var setup$i = function (editor) { + if (!isRtc(editor)) { + return registerKeyboardOverrides(editor); + } else { + return Cell(null); + } + }; + + var NodeChange = function () { + function NodeChange(editor) { + this.lastPath = []; + this.editor = editor; + var lastRng; + var self = this; + if (!('onselectionchange' in editor.getDoc())) { + editor.on('NodeChange click mouseup keyup focus', function (e) { + var nativeRng = editor.selection.getRng(); + var fakeRng = { + startContainer: nativeRng.startContainer, + startOffset: nativeRng.startOffset, + endContainer: nativeRng.endContainer, + endOffset: nativeRng.endOffset + }; + if (e.type === 'nodechange' || !isEq$1(fakeRng, lastRng)) { + editor.fire('SelectionChange'); + } + lastRng = fakeRng; + }); + } + editor.on('contextmenu', function () { + editor.fire('SelectionChange'); + }); + editor.on('SelectionChange', function () { + var startElm = editor.selection.getStart(true); + if (!startElm || !Env.range && editor.selection.isCollapsed()) { + return; + } + if (hasAnyRanges(editor) && !self.isSameElementPath(startElm) && editor.dom.isChildOf(startElm, editor.getBody())) { + editor.nodeChanged({ selectionChange: true }); + } + }); + editor.on('mouseup', function (e) { + if (!e.isDefaultPrevented() && hasAnyRanges(editor)) { + if (editor.selection.getNode().nodeName === 'IMG') { + Delay.setEditorTimeout(editor, function () { + editor.nodeChanged(); + }); + } else { + editor.nodeChanged(); + } + } + }); + } + NodeChange.prototype.nodeChanged = function (args) { + var selection = this.editor.selection; + var node, parents, root; + if (this.editor.initialized && selection && !shouldDisableNodeChange(this.editor) && !this.editor.mode.isReadOnly()) { + root = this.editor.getBody(); + node = selection.getStart(true) || root; + if (node.ownerDocument !== this.editor.getDoc() || !this.editor.dom.isChildOf(node, root)) { + node = root; + } + parents = []; + this.editor.dom.getParent(node, function (node) { + if (node === root) { + return true; + } + parents.push(node); + }); + args = args || {}; + args.element = node; + args.parents = parents; + this.editor.fire('NodeChange', args); + } + }; + NodeChange.prototype.isSameElementPath = function (startElm) { + var i; + var currentPath = this.editor.$(startElm).parentsUntil(this.editor.getBody()).add(startElm); + if (currentPath.length === this.lastPath.length) { + for (i = currentPath.length; i >= 0; i--) { + if (currentPath[i] !== this.lastPath[i]) { + break; + } + } + if (i === -1) { + this.lastPath = currentPath; + return true; + } + } + this.lastPath = currentPath; + return false; + }; + return NodeChange; + }(); + + var preventSummaryToggle = function (editor) { + editor.on('click', function (e) { + if (editor.dom.getParent(e.target, 'details')) { + e.preventDefault(); + } + }); + }; + var filterDetails = function (editor) { + editor.parser.addNodeFilter('details', function (elms) { + each(elms, function (details) { + details.attr('data-mce-open', details.attr('open')); + details.attr('open', 'open'); + }); + }); + editor.serializer.addNodeFilter('details', function (elms) { + each(elms, function (details) { + var open = details.attr('data-mce-open'); + details.attr('open', isString(open) ? open : null); + details.attr('data-mce-open', null); + }); + }); + }; + var setup$j = function (editor) { + preventSummaryToggle(editor); + filterDetails(editor); + }; + + var isTextBlockNode = function (node) { + return isElement$1(node) && isTextBlock(SugarElement.fromDom(node)); + }; + var normalizeSelection$1 = function (editor) { + var rng = editor.selection.getRng(); + var startPos = CaretPosition.fromRangeStart(rng); + var endPos = CaretPosition.fromRangeEnd(rng); + if (CaretPosition.isElementPosition(startPos)) { + var container = startPos.container(); + if (isTextBlockNode(container)) { + firstPositionIn(container).each(function (pos) { + return rng.setStart(pos.container(), pos.offset()); + }); + } + } + if (CaretPosition.isElementPosition(endPos)) { + var container = startPos.container(); + if (isTextBlockNode(container)) { + lastPositionIn(container).each(function (pos) { + return rng.setEnd(pos.container(), pos.offset()); + }); + } + } + editor.selection.setRng(normalize$2(rng)); + }; + var setup$k = function (editor) { + editor.on('click', function (e) { + if (e.detail >= 3) { + normalizeSelection$1(editor); + } + }); + }; + + var value$1 = function () { + var subject = Cell(Optional.none()); + var clear = function () { + return subject.set(Optional.none()); + }; + var set = function (s) { + return subject.set(Optional.some(s)); + }; + var isSet = function () { + return subject.get().isSome(); + }; + var on = function (f) { + return subject.get().each(f); + }; + return { + clear: clear, + set: set, + isSet: isSet, + on: on + }; + }; + + var getAbsolutePosition = function (elm) { + var clientRect = elm.getBoundingClientRect(); + var doc = elm.ownerDocument; + var docElem = doc.documentElement; + var win = doc.defaultView; + return { + top: clientRect.top + win.pageYOffset - docElem.clientTop, + left: clientRect.left + win.pageXOffset - docElem.clientLeft + }; + }; + var getBodyPosition = function (editor) { + return editor.inline ? getAbsolutePosition(editor.getBody()) : { + left: 0, + top: 0 + }; + }; + var getScrollPosition = function (editor) { + var body = editor.getBody(); + return editor.inline ? { + left: body.scrollLeft, + top: body.scrollTop + } : { + left: 0, + top: 0 + }; + }; + var getBodyScroll = function (editor) { + var body = editor.getBody(), docElm = editor.getDoc().documentElement; + var inlineScroll = { + left: body.scrollLeft, + top: body.scrollTop + }; + var iframeScroll = { + left: body.scrollLeft || docElm.scrollLeft, + top: body.scrollTop || docElm.scrollTop + }; + return editor.inline ? inlineScroll : iframeScroll; + }; + var getMousePosition = function (editor, event) { + if (event.target.ownerDocument !== editor.getDoc()) { + var iframePosition = getAbsolutePosition(editor.getContentAreaContainer()); + var scrollPosition = getBodyScroll(editor); + return { + left: event.pageX - iframePosition.left + scrollPosition.left, + top: event.pageY - iframePosition.top + scrollPosition.top + }; + } + return { + left: event.pageX, + top: event.pageY + }; + }; + var calculatePosition = function (bodyPosition, scrollPosition, mousePosition) { + return { + pageX: mousePosition.left - bodyPosition.left + scrollPosition.left, + pageY: mousePosition.top - bodyPosition.top + scrollPosition.top + }; + }; + var calc = function (editor, event) { + return calculatePosition(getBodyPosition(editor), getScrollPosition(editor), getMousePosition(editor, event)); + }; + + var isContentEditableFalse$a = isContentEditableFalse, isContentEditableTrue$3 = isContentEditableTrue; + var isDraggable = function (rootElm, elm) { + return isContentEditableFalse$a(elm) && elm !== rootElm; + }; + var isValidDropTarget = function (editor, targetElement, dragElement) { + if (targetElement === dragElement || editor.dom.isChildOf(targetElement, dragElement)) { + return false; + } + return !isContentEditableFalse$a(targetElement); + }; + var cloneElement = function (elm) { + var cloneElm = elm.cloneNode(true); + cloneElm.removeAttribute('data-mce-selected'); + return cloneElm; + }; + var createGhost = function (editor, elm, width, height) { + var dom = editor.dom; + var clonedElm = elm.cloneNode(true); + dom.setStyles(clonedElm, { + width: width, + height: height + }); + dom.setAttrib(clonedElm, 'data-mce-selected', null); + var ghostElm = dom.create('div', { + 'class': 'mce-drag-container', + 'data-mce-bogus': 'all', + 'unselectable': 'on', + 'contenteditable': 'false' + }); + dom.setStyles(ghostElm, { + position: 'absolute', + opacity: 0.5, + overflow: 'hidden', + border: 0, + padding: 0, + margin: 0, + width: width, + height: height + }); + dom.setStyles(clonedElm, { + margin: 0, + boxSizing: 'border-box' + }); + ghostElm.appendChild(clonedElm); + return ghostElm; + }; + var appendGhostToBody = function (ghostElm, bodyElm) { + if (ghostElm.parentNode !== bodyElm) { + bodyElm.appendChild(ghostElm); + } + }; + var moveGhost = function (ghostElm, position, width, height, maxX, maxY) { + var overflowX = 0, overflowY = 0; + ghostElm.style.left = position.pageX + 'px'; + ghostElm.style.top = position.pageY + 'px'; + if (position.pageX + width > maxX) { + overflowX = position.pageX + width - maxX; + } + if (position.pageY + height > maxY) { + overflowY = position.pageY + height - maxY; + } + ghostElm.style.width = width - overflowX + 'px'; + ghostElm.style.height = height - overflowY + 'px'; + }; + var removeElement = function (elm) { + if (elm && elm.parentNode) { + elm.parentNode.removeChild(elm); + } + }; + var isLeftMouseButtonPressed = function (e) { + return e.button === 0; + }; + var applyRelPos = function (state, position) { + return { + pageX: position.pageX - state.relX, + pageY: position.pageY + 5 + }; + }; + var start$1 = function (state, editor) { + return function (e) { + if (isLeftMouseButtonPressed(e)) { + var ceElm = find(editor.dom.getParents(e.target), or(isContentEditableFalse$a, isContentEditableTrue$3)).getOr(null); + if (isDraggable(editor.getBody(), ceElm)) { + var elmPos = editor.dom.getPos(ceElm); + var bodyElm = editor.getBody(); + var docElm = editor.getDoc().documentElement; + state.set({ + element: ceElm, + dragging: false, + screenX: e.screenX, + screenY: e.screenY, + maxX: (editor.inline ? bodyElm.scrollWidth : docElm.offsetWidth) - 2, + maxY: (editor.inline ? bodyElm.scrollHeight : docElm.offsetHeight) - 2, + relX: e.pageX - elmPos.x, + relY: e.pageY - elmPos.y, + width: ceElm.offsetWidth, + height: ceElm.offsetHeight, + ghost: createGhost(editor, ceElm, ceElm.offsetWidth, ceElm.offsetHeight) + }); + } + } + }; + }; + var move$2 = function (state, editor) { + var throttledPlaceCaretAt = Delay.throttle(function (clientX, clientY) { + editor._selectionOverrides.hideFakeCaret(); + editor.selection.placeCaretAt(clientX, clientY); + }, 0); + return function (e) { + return state.on(function (state) { + var movement = Math.max(Math.abs(e.screenX - state.screenX), Math.abs(e.screenY - state.screenY)); + if (!state.dragging && movement > 10) { + var args = editor.fire('dragstart', { target: state.element }); + if (args.isDefaultPrevented()) { + return; + } + state.dragging = true; + editor.focus(); + } + if (state.dragging) { + var targetPos = applyRelPos(state, calc(editor, e)); + appendGhostToBody(state.ghost, editor.getBody()); + moveGhost(state.ghost, targetPos, state.width, state.height, state.maxX, state.maxY); + throttledPlaceCaretAt(e.clientX, e.clientY); + } + }); + }; + }; + var getRawTarget = function (selection) { + var rng = selection.getSel().getRangeAt(0); + var startContainer = rng.startContainer; + return startContainer.nodeType === 3 ? startContainer.parentNode : startContainer; + }; + var drop = function (state, editor) { + return function (e) { + state.on(function (state) { + if (state.dragging) { + if (isValidDropTarget(editor, getRawTarget(editor.selection), state.element)) { + var targetClone_1 = cloneElement(state.element); + var args = editor.fire('drop', { + clientX: e.clientX, + clientY: e.clientY + }); + if (!args.isDefaultPrevented()) { + editor.undoManager.transact(function () { + removeElement(state.element); + editor.insertContent(editor.dom.getOuterHTML(targetClone_1)); + editor._selectionOverrides.hideFakeCaret(); + }); + } + } + } + }); + removeDragState(state); + }; + }; + var stop = function (state, editor) { + return function () { + state.on(function (state) { + if (state.dragging) { + editor.fire('dragend'); + } + }); + removeDragState(state); + }; + }; + var removeDragState = function (state) { + state.on(function (state) { + removeElement(state.ghost); + }); + state.clear(); + }; + var bindFakeDragEvents = function (editor) { + var state = value$1(); + var pageDom = DOMUtils$1.DOM; + var rootDocument = document; + var dragStartHandler = start$1(state, editor); + var dragHandler = move$2(state, editor); + var dropHandler = drop(state, editor); + var dragEndHandler = stop(state, editor); + editor.on('mousedown', dragStartHandler); + editor.on('mousemove', dragHandler); + editor.on('mouseup', dropHandler); + pageDom.bind(rootDocument, 'mousemove', dragHandler); + pageDom.bind(rootDocument, 'mouseup', dragEndHandler); + editor.on('remove', function () { + pageDom.unbind(rootDocument, 'mousemove', dragHandler); + pageDom.unbind(rootDocument, 'mouseup', dragEndHandler); + }); + }; + var blockIeDrop = function (editor) { + editor.on('drop', function (e) { + var realTarget = typeof e.clientX !== 'undefined' ? editor.getDoc().elementFromPoint(e.clientX, e.clientY) : null; + if (isContentEditableFalse$a(realTarget) || editor.dom.getContentEditableParent(realTarget) === 'false') { + e.preventDefault(); + } + }); + }; + var blockUnsupportedFileDrop = function (editor) { + var preventFileDrop = function (e) { + if (!e.defaultPrevented) { + var dataTransfer = e.dataTransfer; + if (dataTransfer && (contains(dataTransfer.types, 'Files') || dataTransfer.files.length > 0)) { + e.preventDefault(); + if (e.type === 'drop') { + displayError(editor, 'Dropped file type is not supported'); + } + } + } + }; + var preventFileDropIfUIElement = function (e) { + if (isUIElement(editor, e.target)) { + preventFileDrop(e); + } + }; + var setup = function () { + var pageDom = DOMUtils$1.DOM; + var dom = editor.dom; + var doc = document; + var editorRoot = editor.inline ? editor.getBody() : editor.getDoc(); + var eventNames = [ + 'drop', + 'dragover' + ]; + each(eventNames, function (name) { + pageDom.bind(doc, name, preventFileDropIfUIElement); + dom.bind(editorRoot, name, preventFileDrop); + }); + editor.on('remove', function () { + each(eventNames, function (name) { + pageDom.unbind(doc, name, preventFileDropIfUIElement); + dom.unbind(editorRoot, name, preventFileDrop); + }); + }); + }; + editor.on('init', function () { + Delay.setEditorTimeout(editor, setup, 0); + }); + }; + var init = function (editor) { + bindFakeDragEvents(editor); + blockIeDrop(editor); + if (shouldBlockUnsupportedDrop(editor)) { + blockUnsupportedFileDrop(editor); + } + }; + + var setup$l = function (editor) { + var renderFocusCaret = first(function () { + if (!editor.removed && editor.getBody().contains(document.activeElement)) { + var rng = editor.selection.getRng(); + if (rng.collapsed) { + var caretRange = renderRangeCaret(editor, rng, false); + editor.selection.setRng(caretRange); + } + } + }, 0); + editor.on('focus', function () { + renderFocusCaret.throttle(); + }); + editor.on('blur', function () { + renderFocusCaret.cancel(); + }); + }; + + var setup$m = function (editor) { + editor.on('init', function () { + editor.on('focusin', function (e) { + var target = e.target; + if (isMedia(target)) { + var ceRoot = getContentEditableRoot(editor.getBody(), target); + var node = isContentEditableFalse(ceRoot) ? ceRoot : target; + if (editor.selection.getNode() !== node) { + selectNode(editor, node).each(function (rng) { + return editor.selection.setRng(rng); + }); + } + } + }); + }); + }; + + var isContentEditableTrue$4 = isContentEditableTrue; + var isContentEditableFalse$b = isContentEditableFalse; + var getContentEditableRoot$1 = function (editor, node) { + return getContentEditableRoot(editor.getBody(), node); + }; + var SelectionOverrides = function (editor) { + var selection = editor.selection, dom = editor.dom; + var isBlock = dom.isBlock; + var rootNode = editor.getBody(); + var fakeCaret = FakeCaret(editor, rootNode, isBlock, function () { + return hasFocus$1(editor); + }); + var realSelectionId = 'sel-' + dom.uniqueId(); + var elementSelectionAttr = 'data-mce-selected'; + var selectedElement; + var isFakeSelectionElement = function (node) { + return dom.hasClass(node, 'mce-offscreen-selection'); + }; + var isFakeSelectionTargetElement = function (node) { + return isContentEditableFalse$b(node) || isMedia(node); + }; + var isNearFakeSelectionElement = function (pos) { + return isBeforeContentEditableFalse(pos) || isAfterContentEditableFalse(pos) || isBeforeMedia(pos) || isAfterMedia(pos); + }; + var getRealSelectionElement = function () { + var container = dom.get(realSelectionId); + return container ? container.getElementsByTagName('*')[0] : container; + }; + var setRange = function (range) { + if (range) { + selection.setRng(range); + } + }; + var getRange = selection.getRng; + var showCaret = function (direction, node, before, scrollIntoView) { + if (scrollIntoView === void 0) { + scrollIntoView = true; + } + var e = editor.fire('ShowCaret', { + target: node, + direction: direction, + before: before + }); + if (e.isDefaultPrevented()) { + return null; + } + if (scrollIntoView) { + selection.scrollIntoView(node, direction === -1); + } + return fakeCaret.show(before, node); + }; + var showBlockCaretContainer = function (blockCaretContainer) { + if (blockCaretContainer.hasAttribute('data-mce-caret')) { + showCaretContainerBlock(blockCaretContainer); + setRange(getRange()); + selection.scrollIntoView(blockCaretContainer); + } + }; + var registerEvents = function () { + editor.on('mouseup', function (e) { + var range = getRange(); + if (range.collapsed && isXYInContentArea(editor, e.clientX, e.clientY)) { + renderCaretAtRange(editor, range, false).each(setRange); + } + }); + editor.on('click', function (e) { + var contentEditableRoot = getContentEditableRoot$1(editor, e.target); + if (contentEditableRoot) { + if (isContentEditableFalse$b(contentEditableRoot)) { + e.preventDefault(); + editor.focus(); + } + if (isContentEditableTrue$4(contentEditableRoot)) { + if (dom.isChildOf(contentEditableRoot, selection.getNode())) { + removeElementSelection(); + } + } + } + }); + editor.on('blur NewBlock', removeElementSelection); + editor.on('ResizeWindow FullscreenStateChanged', fakeCaret.reposition); + var hasNormalCaretPosition = function (elm) { + var caretWalker = CaretWalker(elm); + if (!elm.firstChild) { + return false; + } + var startPos = CaretPosition$1.before(elm.firstChild); + var newPos = caretWalker.next(startPos); + return newPos && !isNearFakeSelectionElement(newPos); + }; + var isInSameBlock = function (node1, node2) { + var block1 = dom.getParent(node1, isBlock); + var block2 = dom.getParent(node2, isBlock); + return block1 === block2; + }; + var hasBetterMouseTarget = function (targetNode, caretNode) { + var targetBlock = dom.getParent(targetNode, isBlock); + var caretBlock = dom.getParent(caretNode, isBlock); + if (targetBlock && targetNode !== caretBlock && dom.isChildOf(targetBlock, caretBlock) && isContentEditableFalse$b(getContentEditableRoot$1(editor, targetBlock)) === false) { + return true; + } + return targetBlock && !isInSameBlock(targetBlock, caretBlock) && hasNormalCaretPosition(targetBlock); + }; + editor.on('tap', function (e) { + var targetElm = e.target; + var contentEditableRoot = getContentEditableRoot$1(editor, targetElm); + if (isContentEditableFalse$b(contentEditableRoot)) { + e.preventDefault(); + selectNode(editor, contentEditableRoot).each(setElementSelection); + } else if (isFakeSelectionTargetElement(targetElm)) { + selectNode(editor, targetElm).each(setElementSelection); + } + }, true); + editor.on('mousedown', function (e) { + var targetElm = e.target; + if (targetElm !== rootNode && targetElm.nodeName !== 'HTML' && !dom.isChildOf(targetElm, rootNode)) { + return; + } + if (isXYInContentArea(editor, e.clientX, e.clientY) === false) { + return; + } + var contentEditableRoot = getContentEditableRoot$1(editor, targetElm); + if (contentEditableRoot) { + if (isContentEditableFalse$b(contentEditableRoot)) { + e.preventDefault(); + selectNode(editor, contentEditableRoot).each(setElementSelection); + } else { + removeElementSelection(); + if (!(isContentEditableTrue$4(contentEditableRoot) && e.shiftKey) && !isXYWithinRange(e.clientX, e.clientY, selection.getRng())) { + hideFakeCaret(); + selection.placeCaretAt(e.clientX, e.clientY); + } + } + } else if (isFakeSelectionTargetElement(targetElm)) { + selectNode(editor, targetElm).each(setElementSelection); + } else if (isFakeCaretTarget(targetElm) === false) { + removeElementSelection(); + hideFakeCaret(); + var fakeCaretInfo = closestFakeCaret(rootNode, e.clientX, e.clientY); + if (fakeCaretInfo) { + if (!hasBetterMouseTarget(targetElm, fakeCaretInfo.node)) { + e.preventDefault(); + var range = showCaret(1, fakeCaretInfo.node, fakeCaretInfo.before, false); + editor.getBody().focus(); + setRange(range); + } + } + } + }); + editor.on('keypress', function (e) { + if (VK.modifierPressed(e)) { + return; + } + if (isContentEditableFalse$b(selection.getNode())) { + e.preventDefault(); + } + }); + editor.on('GetSelectionRange', function (e) { + var rng = e.range; + if (selectedElement) { + if (!selectedElement.parentNode) { + selectedElement = null; + return; + } + rng = rng.cloneRange(); + rng.selectNode(selectedElement); + e.range = rng; + } + }); + editor.on('SetSelectionRange', function (e) { + e.range = normalizeShortEndedElementSelection(e.range); + var rng = setElementSelection(e.range, e.forward); + if (rng) { + e.range = rng; + } + }); + var isPasteBin = function (node) { + return node.id === 'mcepastebin'; + }; + editor.on('AfterSetSelectionRange', function (e) { + var rng = e.range; + var parentNode = rng.startContainer.parentNode; + if (!isRangeInCaretContainer(rng) && !isPasteBin(parentNode)) { + hideFakeCaret(); + } + if (!isFakeSelectionElement(parentNode)) { + removeElementSelection(); + } + }); + editor.on('copy', function (e) { + var clipboardData = e.clipboardData; + if (!e.isDefaultPrevented() && e.clipboardData && !Env.ie) { + var realSelectionElement = getRealSelectionElement(); + if (realSelectionElement) { + e.preventDefault(); + clipboardData.clearData(); + clipboardData.setData('text/html', realSelectionElement.outerHTML); + clipboardData.setData('text/plain', realSelectionElement.outerText || realSelectionElement.innerText); + } + } + }); + init(editor); + setup$l(editor); + setup$m(editor); + }; + var isWithinCaretContainer = function (node) { + return isCaretContainer(node) || startsWithCaretContainer(node) || endsWithCaretContainer(node); + }; + var isRangeInCaretContainer = function (rng) { + return isWithinCaretContainer(rng.startContainer) || isWithinCaretContainer(rng.endContainer); + }; + var normalizeShortEndedElementSelection = function (rng) { + var shortEndedElements = editor.schema.getShortEndedElements(); + var newRng = dom.createRng(); + var startContainer = rng.startContainer; + var startOffset = rng.startOffset; + var endContainer = rng.endContainer; + var endOffset = rng.endOffset; + if (has(shortEndedElements, startContainer.nodeName.toLowerCase())) { + if (startOffset === 0) { + newRng.setStartBefore(startContainer); + } else { + newRng.setStartAfter(startContainer); + } + } else { + newRng.setStart(startContainer, startOffset); + } + if (has(shortEndedElements, endContainer.nodeName.toLowerCase())) { + if (endOffset === 0) { + newRng.setEndBefore(endContainer); + } else { + newRng.setEndAfter(endContainer); + } + } else { + newRng.setEnd(endContainer, endOffset); + } + return newRng; + }; + var setupOffscreenSelection = function (node, targetClone, origTargetClone) { + var $ = editor.$; + var $realSelectionContainer = descendant(SugarElement.fromDom(editor.getBody()), '#' + realSelectionId).fold(function () { + return $([]); + }, function (elm) { + return $([elm.dom]); + }); + if ($realSelectionContainer.length === 0) { + $realSelectionContainer = $('
    ').attr('id', realSelectionId); + $realSelectionContainer.appendTo(editor.getBody()); + } + var newRange = dom.createRng(); + if (targetClone === origTargetClone && Env.ie) { + $realSelectionContainer.empty().append('

    \xA0

    ').append(targetClone); + newRange.setStartAfter($realSelectionContainer[0].firstChild.firstChild); + newRange.setEndAfter(targetClone); + } else { + $realSelectionContainer.empty().append(nbsp).append(targetClone).append(nbsp); + newRange.setStart($realSelectionContainer[0].firstChild, 1); + newRange.setEnd($realSelectionContainer[0].lastChild, 0); + } + $realSelectionContainer.css({ top: dom.getPos(node, editor.getBody()).y }); + $realSelectionContainer[0].focus(); + var sel = selection.getSel(); + sel.removeAllRanges(); + sel.addRange(newRange); + return newRange; + }; + var selectElement = function (elm) { + var targetClone = elm.cloneNode(true); + var e = editor.fire('ObjectSelected', { + target: elm, + targetClone: targetClone + }); + if (e.isDefaultPrevented()) { + return null; + } + var range = setupOffscreenSelection(elm, e.targetClone, targetClone); + var nodeElm = SugarElement.fromDom(elm); + each(descendants$1(SugarElement.fromDom(editor.getBody()), '*[data-mce-selected]'), function (elm) { + if (!eq$2(nodeElm, elm)) { + remove$1(elm, elementSelectionAttr); + } + }); + if (!dom.getAttrib(elm, elementSelectionAttr)) { + elm.setAttribute(elementSelectionAttr, '1'); + } + selectedElement = elm; + hideFakeCaret(); + return range; + }; + var setElementSelection = function (range, forward) { + if (!range) { + return null; + } + if (range.collapsed) { + if (!isRangeInCaretContainer(range)) { + var dir = forward ? 1 : -1; + var caretPosition = getNormalizedRangeEndPoint(dir, rootNode, range); + var beforeNode = caretPosition.getNode(!forward); + if (isFakeCaretTarget(beforeNode)) { + return showCaret(dir, beforeNode, forward ? !caretPosition.isAtEnd() : false, false); + } + var afterNode = caretPosition.getNode(forward); + if (isFakeCaretTarget(afterNode)) { + return showCaret(dir, afterNode, forward ? false : !caretPosition.isAtEnd(), false); + } + } + return null; + } + var startContainer = range.startContainer; + var startOffset = range.startOffset; + var endOffset = range.endOffset; + if (startContainer.nodeType === 3 && startOffset === 0 && isContentEditableFalse$b(startContainer.parentNode)) { + startContainer = startContainer.parentNode; + startOffset = dom.nodeIndex(startContainer); + startContainer = startContainer.parentNode; + } + if (startContainer.nodeType !== 1) { + return null; + } + if (endOffset === startOffset + 1 && startContainer === range.endContainer) { + var node = startContainer.childNodes[startOffset]; + if (isFakeSelectionTargetElement(node)) { + return selectElement(node); + } + } + return null; + }; + var removeElementSelection = function () { + if (selectedElement) { + selectedElement.removeAttribute(elementSelectionAttr); + } + descendant(SugarElement.fromDom(editor.getBody()), '#' + realSelectionId).each(remove); + selectedElement = null; + }; + var destroy = function () { + fakeCaret.destroy(); + selectedElement = null; + }; + var hideFakeCaret = function () { + fakeCaret.hide(); + }; + if (Env.ceFalse) { + registerEvents(); + } + return { + showCaret: showCaret, + showBlockCaretContainer: showBlockCaretContainer, + hideFakeCaret: hideFakeCaret, + destroy: destroy + }; + }; + + var Quirks = function (editor) { + var each = Tools.each; + var BACKSPACE = VK.BACKSPACE, DELETE = VK.DELETE, dom = editor.dom, selection = editor.selection, parser = editor.parser; + var isGecko = Env.gecko, isIE = Env.ie, isWebKit = Env.webkit; + var mceInternalUrlPrefix = 'data:text/mce-internal,'; + var mceInternalDataType = isIE ? 'Text' : 'URL'; + var setEditorCommandState = function (cmd, state) { + try { + editor.getDoc().execCommand(cmd, false, state); + } catch (ex) { + } + }; + var isDefaultPrevented = function (e) { + return e.isDefaultPrevented(); + }; + var setMceInternalContent = function (e) { + var selectionHtml, internalContent; + if (e.dataTransfer) { + if (editor.selection.isCollapsed() && e.target.tagName === 'IMG') { + selection.select(e.target); + } + selectionHtml = editor.selection.getContent(); + if (selectionHtml.length > 0) { + internalContent = mceInternalUrlPrefix + escape(editor.id) + ',' + escape(selectionHtml); + e.dataTransfer.setData(mceInternalDataType, internalContent); + } + } + }; + var getMceInternalContent = function (e) { + var internalContent; + if (e.dataTransfer) { + internalContent = e.dataTransfer.getData(mceInternalDataType); + if (internalContent && internalContent.indexOf(mceInternalUrlPrefix) >= 0) { + internalContent = internalContent.substr(mceInternalUrlPrefix.length).split(','); + return { + id: unescape(internalContent[0]), + html: unescape(internalContent[1]) + }; + } + } + return null; + }; + var insertClipboardContents = function (content, internal) { + if (editor.queryCommandSupported('mceInsertClipboardContent')) { + editor.execCommand('mceInsertClipboardContent', false, { + content: content, + internal: internal + }); + } else { + editor.execCommand('mceInsertContent', false, content); + } + }; + var emptyEditorWhenDeleting = function () { + var serializeRng = function (rng) { + var body = dom.create('body'); + var contents = rng.cloneContents(); + body.appendChild(contents); + return selection.serializer.serialize(body, { format: 'html' }); + }; + var allContentsSelected = function (rng) { + var selection = serializeRng(rng); + var allRng = dom.createRng(); + allRng.selectNode(editor.getBody()); + var allSelection = serializeRng(allRng); + return selection === allSelection; + }; + editor.on('keydown', function (e) { + var keyCode = e.keyCode; + var isCollapsed, body; + if (!isDefaultPrevented(e) && (keyCode === DELETE || keyCode === BACKSPACE)) { + isCollapsed = editor.selection.isCollapsed(); + body = editor.getBody(); + if (isCollapsed && !dom.isEmpty(body)) { + return; + } + if (!isCollapsed && !allContentsSelected(editor.selection.getRng())) { + return; + } + e.preventDefault(); + editor.setContent(''); + if (body.firstChild && dom.isBlock(body.firstChild)) { + editor.selection.setCursorLocation(body.firstChild, 0); + } else { + editor.selection.setCursorLocation(body, 0); + } + editor.nodeChanged(); + } + }); + }; + var selectAll = function () { + editor.shortcuts.add('meta+a', null, 'SelectAll'); + }; + var inputMethodFocus = function () { + if (!editor.inline) { + dom.bind(editor.getDoc(), 'mousedown mouseup', function (e) { + var rng; + if (e.target === editor.getDoc().documentElement) { + rng = selection.getRng(); + editor.getBody().focus(); + if (e.type === 'mousedown') { + if (isCaretContainer(rng.startContainer)) { + return; + } + selection.placeCaretAt(e.clientX, e.clientY); + } else { + selection.setRng(rng); + } + } + }); + } + }; + var removeHrOnBackspace = function () { + editor.on('keydown', function (e) { + if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) { + if (!editor.getBody().getElementsByTagName('hr').length) { + return; + } + if (selection.isCollapsed() && selection.getRng().startOffset === 0) { + var node = selection.getNode(); + var previousSibling = node.previousSibling; + if (node.nodeName === 'HR') { + dom.remove(node); + e.preventDefault(); + return; + } + if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === 'hr') { + dom.remove(previousSibling); + e.preventDefault(); + } + } + } + }); + }; + var focusBody = function () { + if (!Range.prototype.getClientRects) { + editor.on('mousedown', function (e) { + if (!isDefaultPrevented(e) && e.target.nodeName === 'HTML') { + var body_1 = editor.getBody(); + body_1.blur(); + Delay.setEditorTimeout(editor, function () { + body_1.focus(); + }); + } + }); + } + }; + var selectControlElements = function () { + editor.on('click', function (e) { + var target = e.target; + if (/^(IMG|HR)$/.test(target.nodeName) && dom.getContentEditableParent(target) !== 'false') { + e.preventDefault(); + editor.selection.select(target); + editor.nodeChanged(); + } + if (target.nodeName === 'A' && dom.hasClass(target, 'mce-item-anchor')) { + e.preventDefault(); + selection.select(target); + } + }); + }; + var removeStylesWhenDeletingAcrossBlockElements = function () { + var getAttributeApplyFunction = function () { + var template = dom.getAttribs(selection.getStart().cloneNode(false)); + return function () { + var target = selection.getStart(); + if (target !== editor.getBody()) { + dom.setAttrib(target, 'style', null); + each(template, function (attr) { + target.setAttributeNode(attr.cloneNode(true)); + }); + } + }; + }; + var isSelectionAcrossElements = function () { + return !selection.isCollapsed() && dom.getParent(selection.getStart(), dom.isBlock) !== dom.getParent(selection.getEnd(), dom.isBlock); + }; + editor.on('keypress', function (e) { + var applyAttributes; + if (!isDefaultPrevented(e) && (e.keyCode === 8 || e.keyCode === 46) && isSelectionAcrossElements()) { + applyAttributes = getAttributeApplyFunction(); + editor.getDoc().execCommand('delete', false, null); + applyAttributes(); + e.preventDefault(); + return false; + } + }); + dom.bind(editor.getDoc(), 'cut', function (e) { + var applyAttributes; + if (!isDefaultPrevented(e) && isSelectionAcrossElements()) { + applyAttributes = getAttributeApplyFunction(); + Delay.setEditorTimeout(editor, function () { + applyAttributes(); + }); + } + }); + }; + var disableBackspaceIntoATable = function () { + editor.on('keydown', function (e) { + if (!isDefaultPrevented(e) && e.keyCode === BACKSPACE) { + if (selection.isCollapsed() && selection.getRng().startOffset === 0) { + var previousSibling = selection.getNode().previousSibling; + if (previousSibling && previousSibling.nodeName && previousSibling.nodeName.toLowerCase() === 'table') { + e.preventDefault(); + return false; + } + } + } + }); + }; + var removeBlockQuoteOnBackSpace = function () { + editor.on('keydown', function (e) { + var rng, parent; + if (isDefaultPrevented(e) || e.keyCode !== VK.BACKSPACE) { + return; + } + rng = selection.getRng(); + var container = rng.startContainer; + var offset = rng.startOffset; + var root = dom.getRoot(); + parent = container; + if (!rng.collapsed || offset !== 0) { + return; + } + while (parent && parent.parentNode && parent.parentNode.firstChild === parent && parent.parentNode !== root) { + parent = parent.parentNode; + } + if (parent.tagName === 'BLOCKQUOTE') { + editor.formatter.toggle('blockquote', null, parent); + rng = dom.createRng(); + rng.setStart(container, 0); + rng.setEnd(container, 0); + selection.setRng(rng); + } + }); + }; + var setGeckoEditingOptions = function () { + var setOpts = function () { + setEditorCommandState('StyleWithCSS', false); + setEditorCommandState('enableInlineTableEditing', false); + if (!getObjectResizing(editor)) { + setEditorCommandState('enableObjectResizing', false); + } + }; + if (!isReadOnly(editor)) { + editor.on('BeforeExecCommand mousedown', setOpts); + } + }; + var addBrAfterLastLinks = function () { + var fixLinks = function () { + each(dom.select('a'), function (node) { + var parentNode = node.parentNode; + var root = dom.getRoot(); + if (parentNode.lastChild === node) { + while (parentNode && !dom.isBlock(parentNode)) { + if (parentNode.parentNode.lastChild !== parentNode || parentNode === root) { + return; + } + parentNode = parentNode.parentNode; + } + dom.add(parentNode, 'br', { 'data-mce-bogus': 1 }); + } + }); + }; + editor.on('SetContent ExecCommand', function (e) { + if (e.type === 'setcontent' || e.command === 'mceInsertLink') { + fixLinks(); + } + }); + }; + var setDefaultBlockType = function () { + if (getForcedRootBlock(editor)) { + editor.on('init', function () { + setEditorCommandState('DefaultParagraphSeparator', getForcedRootBlock(editor)); + }); + } + }; + var normalizeSelection = function () { + editor.on('keyup focusin mouseup', function (e) { + if (!VK.modifierPressed(e)) { + selection.normalize(); + } + }, true); + }; + var showBrokenImageIcon = function () { + editor.contentStyles.push('img:-moz-broken {' + '-moz-force-broken-image-icon:1;' + 'min-width:24px;' + 'min-height:24px' + '}'); + }; + var restoreFocusOnKeyDown = function () { + if (!editor.inline) { + editor.on('keydown', function () { + if (document.activeElement === document.body) { + editor.getWin().focus(); + } + }); + } + }; + var bodyHeight = function () { + if (!editor.inline) { + editor.contentStyles.push('body {min-height: 150px}'); + editor.on('click', function (e) { + var rng; + if (e.target.nodeName === 'HTML') { + if (Env.ie > 11) { + editor.getBody().focus(); + return; + } + rng = editor.selection.getRng(); + editor.getBody().focus(); + editor.selection.setRng(rng); + editor.selection.normalize(); + editor.nodeChanged(); + } + }); + } + }; + var blockCmdArrowNavigation = function () { + if (Env.mac) { + editor.on('keydown', function (e) { + if (VK.metaKeyPressed(e) && !e.shiftKey && (e.keyCode === 37 || e.keyCode === 39)) { + e.preventDefault(); + var selection_1 = editor.selection.getSel(); + selection_1.modify('move', e.keyCode === 37 ? 'backward' : 'forward', 'lineboundary'); + } + }); + } + }; + var disableAutoUrlDetect = function () { + setEditorCommandState('AutoUrlDetect', false); + }; + var tapLinksAndImages = function () { + editor.on('click', function (e) { + var elm = e.target; + do { + if (elm.tagName === 'A') { + e.preventDefault(); + return; + } + } while (elm = elm.parentNode); + }); + editor.contentStyles.push('.mce-content-body {-webkit-touch-callout: none}'); + }; + var blockFormSubmitInsideEditor = function () { + editor.on('init', function () { + editor.dom.bind(editor.getBody(), 'submit', function (e) { + e.preventDefault(); + }); + }); + }; + var removeAppleInterchangeBrs = function () { + parser.addNodeFilter('br', function (nodes) { + var i = nodes.length; + while (i--) { + if (nodes[i].attr('class') === 'Apple-interchange-newline') { + nodes[i].remove(); + } + } + }); + }; + var ieInternalDragAndDrop = function () { + editor.on('dragstart', function (e) { + setMceInternalContent(e); + }); + editor.on('drop', function (e) { + if (!isDefaultPrevented(e)) { + var internalContent = getMceInternalContent(e); + if (internalContent && internalContent.id !== editor.id) { + e.preventDefault(); + var rng = fromPoint$1(e.x, e.y, editor.getDoc()); + selection.setRng(rng); + insertClipboardContents(internalContent.html, true); + } + } + }); + }; + var refreshContentEditable = function () { + }; + var isHidden = function () { + if (!isGecko || editor.removed) { + return false; + } + var sel = editor.selection.getSel(); + return !sel || !sel.rangeCount || sel.rangeCount === 0; + }; + removeBlockQuoteOnBackSpace(); + emptyEditorWhenDeleting(); + if (!Env.windowsPhone) { + normalizeSelection(); + } + if (isWebKit) { + inputMethodFocus(); + selectControlElements(); + setDefaultBlockType(); + blockFormSubmitInsideEditor(); + disableBackspaceIntoATable(); + removeAppleInterchangeBrs(); + if (Env.iOS) { + restoreFocusOnKeyDown(); + bodyHeight(); + tapLinksAndImages(); + } else { + selectAll(); + } + } + if (Env.ie >= 11) { + bodyHeight(); + disableBackspaceIntoATable(); + } + if (Env.ie) { + selectAll(); + disableAutoUrlDetect(); + ieInternalDragAndDrop(); + } + if (isGecko) { + removeHrOnBackspace(); + focusBody(); + removeStylesWhenDeletingAcrossBlockElements(); + setGeckoEditingOptions(); + addBrAfterLastLinks(); + showBrokenImageIcon(); + blockCmdArrowNavigation(); + disableBackspaceIntoATable(); + } + return { + refreshContentEditable: refreshContentEditable, + isHidden: isHidden + }; + }; + + var DOM$4 = DOMUtils$1.DOM; + var appendStyle = function (editor, text) { + var body = SugarElement.fromDom(editor.getBody()); + var container = getStyleContainer(getRootNode(body)); + var style = SugarElement.fromTag('style'); + set(style, 'type', 'text/css'); + append(style, SugarElement.fromText(text)); + append(container, style); + editor.on('remove', function () { + remove(style); + }); + }; + var getRootName = function (editor) { + return editor.inline ? editor.getElement().nodeName.toLowerCase() : undefined; + }; + var removeUndefined = function (obj) { + return filter$1(obj, function (v) { + return isUndefined(v) === false; + }); + }; + var mkParserSettings = function (editor) { + var settings = editor.settings; + var blobCache = editor.editorUpload.blobCache; + return removeUndefined({ + allow_conditional_comments: settings.allow_conditional_comments, + allow_html_data_urls: settings.allow_html_data_urls, + allow_html_in_named_anchor: settings.allow_html_in_named_anchor, + allow_script_urls: settings.allow_script_urls, + allow_unsafe_link_target: settings.allow_unsafe_link_target, + convert_fonts_to_spans: settings.convert_fonts_to_spans, + fix_list_elements: settings.fix_list_elements, + font_size_legacy_values: settings.font_size_legacy_values, + forced_root_block: settings.forced_root_block, + forced_root_block_attrs: settings.forced_root_block_attrs, + padd_empty_with_br: settings.padd_empty_with_br, + preserve_cdata: settings.preserve_cdata, + remove_trailing_brs: settings.remove_trailing_brs, + inline_styles: settings.inline_styles, + root_name: getRootName(editor), + validate: true, + blob_cache: blobCache, + images_dataimg_filter: settings.images_dataimg_filter + }); + }; + var mkSerializerSettings = function (editor) { + var settings = editor.settings; + return __assign(__assign({}, mkParserSettings(editor)), removeUndefined({ + url_converter: settings.url_converter, + url_converter_scope: settings.url_converter_scope, + element_format: settings.element_format, + entities: settings.entities, + entity_encoding: settings.entity_encoding, + indent: settings.indent, + indent_after: settings.indent_after, + indent_before: settings.indent_before, + block_elements: settings.block_elements, + boolean_attributes: settings.boolean_attributes, + custom_elements: settings.custom_elements, + extended_valid_elements: settings.extended_valid_elements, + invalid_elements: settings.invalid_elements, + invalid_styles: settings.invalid_styles, + move_caret_before_on_enter_elements: settings.move_caret_before_on_enter_elements, + non_empty_elements: settings.non_empty_elements, + schema: settings.schema, + self_closing_elements: settings.self_closing_elements, + short_ended_elements: settings.short_ended_elements, + special: settings.special, + text_block_elements: settings.text_block_elements, + text_inline_elements: settings.text_inline_elements, + valid_children: settings.valid_children, + valid_classes: settings.valid_classes, + valid_elements: settings.valid_elements, + valid_styles: settings.valid_styles, + verify_html: settings.verify_html, + whitespace_elements: settings.whitespace_elements + })); + }; + var createParser = function (editor) { + var parser = DomParser(mkParserSettings(editor), editor.schema); + parser.addAttributeFilter('src,href,style,tabindex', function (nodes, name) { + var i = nodes.length, node, value; + var dom = editor.dom; + var internalName = 'data-mce-' + name; + while (i--) { + node = nodes[i]; + value = node.attr(name); + if (value && !node.attr(internalName)) { + if (value.indexOf('data:') === 0 || value.indexOf('blob:') === 0) { + continue; + } + if (name === 'style') { + value = dom.serializeStyle(dom.parseStyle(value), node.name); + if (!value.length) { + value = null; + } + node.attr(internalName, value); + node.attr(name, value); + } else if (name === 'tabindex') { + node.attr(internalName, value); + node.attr(name, null); + } else { + node.attr(internalName, editor.convertURL(value, name, node.name)); + } + } + } + }); + parser.addNodeFilter('script', function (nodes) { + var i = nodes.length; + while (i--) { + var node = nodes[i]; + var type = node.attr('type') || 'no/type'; + if (type.indexOf('mce-') !== 0) { + node.attr('type', 'mce-' + type); + } + } + }); + if (editor.settings.preserve_cdata) { + parser.addNodeFilter('#cdata', function (nodes) { + var i = nodes.length; + while (i--) { + var node = nodes[i]; + node.type = 8; + node.name = '#comment'; + node.value = '[CDATA[' + editor.dom.encode(node.value) + ']]'; + } + }); + } + parser.addNodeFilter('p,h1,h2,h3,h4,h5,h6,div', function (nodes) { + var i = nodes.length; + var nonEmptyElements = editor.schema.getNonEmptyElements(); + while (i--) { + var node = nodes[i]; + if (node.isEmpty(nonEmptyElements) && node.getAll('br').length === 0) { + node.append(new AstNode('br', 1)).shortEnded = true; + } + } + }); + return parser; + }; + var autoFocus = function (editor) { + if (editor.settings.auto_focus) { + Delay.setEditorTimeout(editor, function () { + var focusEditor; + if (editor.settings.auto_focus === true) { + focusEditor = editor; + } else { + focusEditor = editor.editorManager.get(editor.settings.auto_focus); + } + if (!focusEditor.destroyed) { + focusEditor.focus(); + } + }, 100); + } + }; + var moveSelectionToFirstCaretPosition = function (editor) { + var root = editor.dom.getRoot(); + if (!editor.inline && (!hasAnyRanges(editor) || editor.selection.getStart(true) === root)) { + firstPositionIn(root).each(function (pos) { + var node = pos.getNode(); + var caretPos = isTable(node) ? firstPositionIn(node).getOr(pos) : pos; + if (Env.browser.isIE()) { + storeNative(editor, caretPos.toRange()); + } else { + editor.selection.setRng(caretPos.toRange()); + } + }); + } + }; + var initEditor = function (editor) { + editor.bindPendingEventDelegates(); + editor.initialized = true; + fireInit(editor); + editor.focus(true); + moveSelectionToFirstCaretPosition(editor); + editor.nodeChanged({ initial: true }); + editor.execCallback('init_instance_callback', editor); + autoFocus(editor); + }; + var getStyleSheetLoader = function (editor) { + return editor.inline ? editor.ui.styleSheetLoader : editor.dom.styleSheetLoader; + }; + var loadContentCss = function (editor, css) { + var styleSheetLoader = getStyleSheetLoader(editor); + var loaded = function () { + editor.on('remove', function () { + return styleSheetLoader.unloadAll(css); + }); + initEditor(editor); + }; + styleSheetLoader.loadAll(css, loaded, loaded); + }; + var preInit = function (editor, rtcMode) { + var settings = editor.settings, doc = editor.getDoc(), body = editor.getBody(); + if (!settings.browser_spellcheck && !settings.gecko_spellcheck) { + doc.body.spellcheck = false; + DOM$4.setAttrib(body, 'spellcheck', 'false'); + } + editor.quirks = Quirks(editor); + firePostRender(editor); + var directionality = getDirectionality(editor); + if (directionality !== undefined) { + body.dir = directionality; + } + if (settings.protect) { + editor.on('BeforeSetContent', function (e) { + Tools.each(settings.protect, function (pattern) { + e.content = e.content.replace(pattern, function (str) { + return ''; + }); + }); + }); + } + editor.on('SetContent', function () { + editor.addVisual(editor.getBody()); + }); + if (rtcMode === false) { + editor.load({ + initial: true, + format: 'html' + }); + } + editor.startContent = editor.getContent({ format: 'raw' }); + editor.on('compositionstart compositionend', function (e) { + editor.composing = e.type === 'compositionstart'; + }); + if (editor.contentStyles.length > 0) { + var contentCssText_1 = ''; + Tools.each(editor.contentStyles, function (style) { + contentCssText_1 += style + '\r\n'; + }); + editor.dom.addStyle(contentCssText_1); + } + loadContentCss(editor, editor.contentCSS); + if (settings.content_style) { + appendStyle(editor, settings.content_style); + } + }; + var initContentBody = function (editor, skipWrite) { + var settings = editor.settings; + var targetElm = editor.getElement(); + var doc = editor.getDoc(); + if (!settings.inline) { + editor.getElement().style.visibility = editor.orgVisibility; + } + if (!skipWrite && !editor.inline) { + doc.open(); + doc.write(editor.iframeHTML); + doc.close(); + } + if (editor.inline) { + DOM$4.addClass(targetElm, 'mce-content-body'); + editor.contentDocument = doc = document; + editor.contentWindow = window; + editor.bodyElement = targetElm; + editor.contentAreaContainer = targetElm; + } + var body = editor.getBody(); + body.disabled = true; + editor.readonly = !!settings.readonly; + if (!editor.readonly) { + if (editor.inline && DOM$4.getStyle(body, 'position', true) === 'static') { + body.style.position = 'relative'; + } + body.contentEditable = editor.getParam('content_editable_state', true); + } + body.disabled = false; + editor.editorUpload = EditorUpload(editor); + editor.schema = Schema(settings); + editor.dom = DOMUtils$1(doc, { + keep_values: true, + url_converter: editor.convertURL, + url_converter_scope: editor, + hex_colors: settings.force_hex_style_colors, + update_styles: true, + root_element: editor.inline ? editor.getBody() : null, + collect: function () { + return editor.inline; + }, + schema: editor.schema, + contentCssCors: shouldUseContentCssCors(editor), + referrerPolicy: getReferrerPolicy(editor), + onSetAttrib: function (e) { + editor.fire('SetAttrib', e); + } + }); + editor.parser = createParser(editor); + editor.serializer = DomSerializer(mkSerializerSettings(editor), editor); + editor.selection = EditorSelection(editor.dom, editor.getWin(), editor.serializer, editor); + editor.annotator = Annotator(editor); + editor.formatter = Formatter(editor); + editor.undoManager = UndoManager(editor); + editor._nodeChangeDispatcher = new NodeChange(editor); + editor._selectionOverrides = SelectionOverrides(editor); + setup$9(editor); + setup$j(editor); + if (!isRtc(editor)) { + setup$k(editor); + } + var caret = setup$i(editor); + setup$8(editor, caret); + setup$a(editor); + setup$7(editor); + firePreInit(editor); + setup$4(editor).fold(function () { + preInit(editor, false); + }, function (loadingRtc) { + editor.setProgressState(true); + loadingRtc.then(function (rtcMode) { + editor.setProgressState(false); + preInit(editor, rtcMode); + }); + }); + }; + + var DOM$5 = DOMUtils$1.DOM; + var relaxDomain = function (editor, ifr) { + if (document.domain !== window.location.hostname && Env.browser.isIE()) { + var bodyUuid = uuid('mce'); + editor[bodyUuid] = function () { + initContentBody(editor); + }; + var domainRelaxUrl = 'javascript:(function(){' + 'document.open();document.domain="' + document.domain + '";' + 'var ed = window.parent.tinymce.get("' + editor.id + '");document.write(ed.iframeHTML);' + 'document.close();ed.' + bodyUuid + '(true);})()'; + DOM$5.setAttrib(ifr, 'src', domainRelaxUrl); + return true; + } + return false; + }; + var createIframeElement = function (id, title, height, customAttrs) { + var iframe = SugarElement.fromTag('iframe'); + setAll(iframe, customAttrs); + setAll(iframe, { + id: id + '_ifr', + frameBorder: '0', + allowTransparency: 'true', + title: title + }); + add$3(iframe, 'tox-edit-area__iframe'); + return iframe; + }; + var getIframeHtml = function (editor) { + var iframeHTML = getDocType(editor) + ''; + if (getDocumentBaseUrl(editor) !== editor.documentBaseUrl) { + iframeHTML += ''; + } + iframeHTML += ''; + var bodyId = getBodyId(editor); + var bodyClass = getBodyClass(editor); + if (getContentSecurityPolicy(editor)) { + iframeHTML += ''; + } + iframeHTML += '
    '; + return iframeHTML; + }; + var createIframe = function (editor, o) { + var title = editor.editorManager.translate('Rich Text Area. Press ALT-0 for help.'); + var ifr = createIframeElement(editor.id, title, o.height, getIframeAttrs(editor)).dom; + ifr.onload = function () { + ifr.onload = null; + editor.fire('load'); + }; + var isDomainRelaxed = relaxDomain(editor, ifr); + editor.contentAreaContainer = o.iframeContainer; + editor.iframeElement = ifr; + editor.iframeHTML = getIframeHtml(editor); + DOM$5.add(o.iframeContainer, ifr); + return isDomainRelaxed; + }; + var init$1 = function (editor, boxInfo) { + var isDomainRelaxed = createIframe(editor, boxInfo); + if (boxInfo.editorContainer) { + DOM$5.get(boxInfo.editorContainer).style.display = editor.orgDisplay; + editor.hidden = DOM$5.isHidden(boxInfo.editorContainer); + } + editor.getElement().style.display = 'none'; + DOM$5.setAttrib(editor.id, 'aria-hidden', 'true'); + if (!isDomainRelaxed) { + initContentBody(editor); + } + }; + + var DOM$6 = DOMUtils$1.DOM; + var initPlugin = function (editor, initializedPlugins, plugin) { + var Plugin = PluginManager.get(plugin); + var pluginUrl = PluginManager.urls[plugin] || editor.documentBaseUrl.replace(/\/$/, ''); + plugin = Tools.trim(plugin); + if (Plugin && Tools.inArray(initializedPlugins, plugin) === -1) { + Tools.each(PluginManager.dependencies(plugin), function (dep) { + initPlugin(editor, initializedPlugins, dep); + }); + if (editor.plugins[plugin]) { + return; + } + try { + var pluginInstance = new Plugin(editor, pluginUrl, editor.$); + editor.plugins[plugin] = pluginInstance; + if (pluginInstance.init) { + pluginInstance.init(editor, pluginUrl); + initializedPlugins.push(plugin); + } + } catch (e) { + pluginInitError(editor, plugin, e); + } + } + }; + var trimLegacyPrefix = function (name) { + return name.replace(/^\-/, ''); + }; + var initPlugins = function (editor) { + var initializedPlugins = []; + Tools.each(getPlugins(editor).split(/[ ,]/), function (name) { + initPlugin(editor, initializedPlugins, trimLegacyPrefix(name)); + }); + }; + var initIcons = function (editor) { + var iconPackName = Tools.trim(getIconPackName(editor)); + var currentIcons = editor.ui.registry.getAll().icons; + var loadIcons = __assign(__assign({}, IconManager.get('default').icons), IconManager.get(iconPackName).icons); + each$1(loadIcons, function (svgData, icon) { + if (!has(currentIcons, icon)) { + editor.ui.registry.addIcon(icon, svgData); + } + }); + }; + var initTheme = function (editor) { + var theme = getTheme(editor); + if (isString(theme)) { + editor.settings.theme = trimLegacyPrefix(theme); + var Theme = ThemeManager.get(theme); + editor.theme = new Theme(editor, ThemeManager.urls[theme]); + if (editor.theme.init) { + editor.theme.init(editor, ThemeManager.urls[theme] || editor.documentBaseUrl.replace(/\/$/, ''), editor.$); + } + } else { + editor.theme = {}; + } + }; + var renderFromLoadedTheme = function (editor) { + return editor.theme.renderUI(); + }; + var renderFromThemeFunc = function (editor) { + var elm = editor.getElement(); + var theme = getTheme(editor); + var info = theme(editor, elm); + if (info.editorContainer.nodeType) { + info.editorContainer.id = info.editorContainer.id || editor.id + '_parent'; + } + if (info.iframeContainer && info.iframeContainer.nodeType) { + info.iframeContainer.id = info.iframeContainer.id || editor.id + '_iframecontainer'; + } + info.height = info.iframeHeight ? info.iframeHeight : elm.offsetHeight; + return info; + }; + var createThemeFalseResult = function (element) { + return { + editorContainer: element, + iframeContainer: element, + api: {} + }; + }; + var renderThemeFalseIframe = function (targetElement) { + var iframeContainer = DOM$6.create('div'); + DOM$6.insertAfter(iframeContainer, targetElement); + return createThemeFalseResult(iframeContainer); + }; + var renderThemeFalse = function (editor) { + var targetElement = editor.getElement(); + return editor.inline ? createThemeFalseResult(null) : renderThemeFalseIframe(targetElement); + }; + var renderThemeUi = function (editor) { + var elm = editor.getElement(); + editor.orgDisplay = elm.style.display; + if (isString(getTheme(editor))) { + return renderFromLoadedTheme(editor); + } else if (isFunction(getTheme(editor))) { + return renderFromThemeFunc(editor); + } else { + return renderThemeFalse(editor); + } + }; + var init$2 = function (editor) { + editor.fire('ScriptsLoaded'); + initIcons(editor); + initTheme(editor); + initPlugins(editor); + var renderInfo = renderThemeUi(editor); + editor.ui = __assign(__assign({}, editor.ui), renderInfo.api); + var boxInfo = { + editorContainer: renderInfo.editorContainer, + iframeContainer: renderInfo.iframeContainer + }; + editor.editorContainer = boxInfo.editorContainer ? boxInfo.editorContainer : null; + appendContentCssFromSettings(editor); + if (editor.inline) { + return initContentBody(editor); + } else { + return init$1(editor, boxInfo); + } + }; + + var DOM$7 = DOMUtils$1.DOM; + var hasSkipLoadPrefix = function (name) { + return name.charAt(0) === '-'; + }; + var loadLanguage = function (scriptLoader, editor) { + var languageCode = getLanguageCode(editor); + var languageUrl = getLanguageUrl(editor); + if (I18n.hasCode(languageCode) === false && languageCode !== 'en') { + var url_1 = languageUrl !== '' ? languageUrl : editor.editorManager.baseURL + '/langs/' + languageCode + '.js'; + scriptLoader.add(url_1, noop, undefined, function () { + languageLoadError(editor, url_1, languageCode); + }); + } + }; + var loadTheme = function (scriptLoader, editor, suffix, callback) { + var theme = getTheme(editor); + if (isString(theme)) { + if (!hasSkipLoadPrefix(theme) && !ThemeManager.urls.hasOwnProperty(theme)) { + var themeUrl = getThemeUrl(editor); + if (themeUrl) { + ThemeManager.load(theme, editor.documentBaseURI.toAbsolute(themeUrl)); + } else { + ThemeManager.load(theme, 'themes/' + theme + '/theme' + suffix + '.js'); + } + } + scriptLoader.loadQueue(function () { + ThemeManager.waitFor(theme, callback); + }); + } else { + callback(); + } + }; + var getIconsUrlMetaFromUrl = function (editor) { + return Optional.from(getIconsUrl(editor)).filter(function (url) { + return url.length > 0; + }).map(function (url) { + return { + url: url, + name: Optional.none() + }; + }); + }; + var getIconsUrlMetaFromName = function (editor, name, suffix) { + return Optional.from(name).filter(function (name) { + return name.length > 0 && !IconManager.has(name); + }).map(function (name) { + return { + url: editor.editorManager.baseURL + '/icons/' + name + '/icons' + suffix + '.js', + name: Optional.some(name) + }; + }); + }; + var loadIcons = function (scriptLoader, editor, suffix) { + var defaultIconsUrl = getIconsUrlMetaFromName(editor, 'default', suffix); + var customIconsUrl = getIconsUrlMetaFromUrl(editor).orThunk(function () { + return getIconsUrlMetaFromName(editor, getIconPackName(editor), ''); + }); + each(cat([ + defaultIconsUrl, + customIconsUrl + ]), function (urlMeta) { + scriptLoader.add(urlMeta.url, noop, undefined, function () { + iconsLoadError(editor, urlMeta.url, urlMeta.name.getOrUndefined()); + }); + }); + }; + var loadPlugins = function (editor, suffix) { + Tools.each(getExternalPlugins(editor), function (url, name) { + PluginManager.load(name, url, noop, undefined, function () { + pluginLoadError(editor, url, name); + }); + editor.settings.plugins += ' ' + name; + }); + Tools.each(getPlugins(editor).split(/[ ,]/), function (plugin) { + plugin = Tools.trim(plugin); + if (plugin && !PluginManager.urls[plugin]) { + if (hasSkipLoadPrefix(plugin)) { + plugin = plugin.substr(1, plugin.length); + var dependencies = PluginManager.dependencies(plugin); + Tools.each(dependencies, function (depPlugin) { + var defaultSettings = { + prefix: 'plugins/', + resource: depPlugin, + suffix: '/plugin' + suffix + '.js' + }; + var dep = PluginManager.createUrl(defaultSettings, depPlugin); + PluginManager.load(dep.resource, dep, noop, undefined, function () { + pluginLoadError(editor, dep.prefix + dep.resource + dep.suffix, dep.resource); + }); + }); + } else { + var url_2 = { + prefix: 'plugins/', + resource: plugin, + suffix: '/plugin' + suffix + '.js' + }; + PluginManager.load(plugin, url_2, noop, undefined, function () { + pluginLoadError(editor, url_2.prefix + url_2.resource + url_2.suffix, plugin); + }); + } + } + }); + }; + var loadScripts = function (editor, suffix) { + var scriptLoader = ScriptLoader.ScriptLoader; + loadTheme(scriptLoader, editor, suffix, function () { + loadLanguage(scriptLoader, editor); + loadIcons(scriptLoader, editor, suffix); + loadPlugins(editor, suffix); + scriptLoader.loadQueue(function () { + if (!editor.removed) { + init$2(editor); + } + }, editor, function () { + if (!editor.removed) { + init$2(editor); + } + }); + }); + }; + var getStyleSheetLoader$1 = function (element, editor) { + return instance.forElement(element, { + contentCssCors: hasContentCssCors(editor), + referrerPolicy: getReferrerPolicy(editor) + }); + }; + var render = function (editor) { + var id = editor.id; + I18n.setCode(getLanguageCode(editor)); + var readyHandler = function () { + DOM$7.unbind(window, 'ready', readyHandler); + editor.render(); + }; + if (!EventUtils.Event.domLoaded) { + DOM$7.bind(window, 'ready', readyHandler); + return; + } + if (!editor.getElement()) { + return; + } + if (!Env.contentEditable) { + return; + } + var element = SugarElement.fromDom(editor.getElement()); + var snapshot = clone(element); + editor.on('remove', function () { + eachr(element.dom.attributes, function (attr) { + return remove$1(element, attr.name); + }); + setAll(element, snapshot); + }); + editor.ui.styleSheetLoader = getStyleSheetLoader$1(element, editor); + if (!isInline$1(editor)) { + editor.orgVisibility = editor.getElement().style.visibility; + editor.getElement().style.visibility = 'hidden'; + } else { + editor.inline = true; + } + var form = editor.getElement().form || DOM$7.getParent(id, 'form'); + if (form) { + editor.formElement = form; + if (hasHiddenInput(editor) && !isTextareaOrInput(editor.getElement())) { + DOM$7.insertAfter(DOM$7.create('input', { + type: 'hidden', + name: id + }), id); + editor.hasHiddenInput = true; + } + editor.formEventDelegate = function (e) { + editor.fire(e.type, e); + }; + DOM$7.bind(form, 'submit reset', editor.formEventDelegate); + editor.on('reset', function () { + editor.resetContent(); + }); + if (shouldPatchSubmit(editor) && !form.submit.nodeType && !form.submit.length && !form._mceOldSubmit) { + form._mceOldSubmit = form.submit; + form.submit = function () { + editor.editorManager.triggerSave(); + editor.setDirty(false); + return form._mceOldSubmit(form); + }; + } + } + editor.windowManager = WindowManager(editor); + editor.notificationManager = NotificationManager(editor); + if (isEncodingXml(editor)) { + editor.on('GetContent', function (e) { + if (e.save) { + e.content = DOM$7.encode(e.content); + } + }); + } + if (shouldAddFormSubmitTrigger(editor)) { + editor.on('submit', function () { + if (editor.initialized) { + editor.save(); + } + }); + } + if (shouldAddUnloadTrigger(editor)) { + editor._beforeUnload = function () { + if (editor.initialized && !editor.destroyed && !editor.isHidden()) { + editor.save({ + format: 'raw', + no_events: true, + set_dirty: false + }); + } + }; + editor.editorManager.on('BeforeUnload', editor._beforeUnload); + } + editor.editorManager.add(editor); + loadScripts(editor, editor.suffix); + }; + + var ensureIsRoot = function (isRoot) { + return isFunction(isRoot) ? isRoot : never; + }; + var ancestor$3 = function (scope, transform, isRoot) { + var element = scope.dom; + var stop = ensureIsRoot(isRoot); + while (element.parentNode) { + element = element.parentNode; + var el = SugarElement.fromDom(element); + var transformed = transform(el); + if (transformed.isSome()) { + return transformed; + } else if (stop(el)) { + break; + } + } + return Optional.none(); + }; + var closest$2 = function (scope, transform, isRoot) { + var current = transform(scope); + var stop = ensureIsRoot(isRoot); + return current.orThunk(function () { + return stop(scope) ? Optional.none() : ancestor$3(scope, transform, stop); + }); + }; + + var legacyPropNames = { + 'font-size': 'size', + 'font-family': 'face' + }; + var getSpecifiedFontProp = function (propName, rootElm, elm) { + var getProperty = function (elm) { + return getRaw(elm, propName).orThunk(function () { + if (name(elm) === 'font') { + return get(legacyPropNames, propName).bind(function (legacyPropName) { + return getOpt(elm, legacyPropName); + }); + } else { + return Optional.none(); + } + }); + }; + var isRoot = function (elm) { + return eq$2(SugarElement.fromDom(rootElm), elm); + }; + return closest$2(SugarElement.fromDom(elm), function (elm) { + return getProperty(elm); + }, isRoot); + }; + var normalizeFontFamily = function (fontFamily) { + return fontFamily.replace(/[\'\"\\]/g, '').replace(/,\s+/g, ','); + }; + var getComputedFontProp = function (propName, elm) { + return Optional.from(DOMUtils$1.DOM.getStyle(elm, propName, true)); + }; + var getFontProp = function (propName) { + return function (rootElm, elm) { + return Optional.from(elm).map(SugarElement.fromDom).filter(isElement).bind(function (element) { + return getSpecifiedFontProp(propName, rootElm, element.dom).or(getComputedFontProp(propName, element.dom)); + }).getOr(''); + }; + }; + var getFontSize = getFontProp('font-size'); + var getFontFamily = compose(normalizeFontFamily, getFontProp('font-family')); + + var findFirstCaretElement = function (editor) { + return firstPositionIn(editor.getBody()).map(function (caret) { + var container = caret.container(); + return isText$1(container) ? container.parentNode : container; + }); + }; + var getCaretElement = function (editor) { + return Optional.from(editor.selection.getRng()).bind(function (rng) { + var root = editor.getBody(); + var atStartOfNode = rng.startContainer === root && rng.startOffset === 0; + return atStartOfNode ? Optional.none() : Optional.from(editor.selection.getStart(true)); + }); + }; + var mapRange = function (editor, mapper) { + return getCaretElement(editor).orThunk(curry(findFirstCaretElement, editor)).map(SugarElement.fromDom).filter(isElement).map(mapper); + }; + + var fromFontSizeNumber = function (editor, value) { + if (/^[0-9.]+$/.test(value)) { + var fontSizeNumber = parseInt(value, 10); + if (fontSizeNumber >= 1 && fontSizeNumber <= 7) { + var fontSizes = getFontStyleValues(editor); + var fontClasses = getFontSizeClasses(editor); + if (fontClasses) { + return fontClasses[fontSizeNumber - 1] || value; + } else { + return fontSizes[fontSizeNumber - 1] || value; + } + } else { + return value; + } + } else { + return value; + } + }; + var normalizeFontNames = function (font) { + var fonts = font.split(/\s*,\s*/); + return map(fonts, function (font) { + if (font.indexOf(' ') !== -1 && !(startsWith(font, '"') || startsWith(font, '\''))) { + return '\'' + font + '\''; + } else { + return font; + } + }).join(','); + }; + var fontNameAction = function (editor, value) { + var font = fromFontSizeNumber(editor, value); + editor.formatter.toggle('fontname', { value: normalizeFontNames(font) }); + editor.nodeChanged(); + }; + var fontNameQuery = function (editor) { + return mapRange(editor, function (elm) { + return getFontFamily(editor.getBody(), elm.dom); + }).getOr(''); + }; + var fontSizeAction = function (editor, value) { + editor.formatter.toggle('fontsize', { value: fromFontSizeNumber(editor, value) }); + editor.nodeChanged(); + }; + var fontSizeQuery = function (editor) { + return mapRange(editor, function (elm) { + return getFontSize(editor.getBody(), elm.dom); + }).getOr(''); + }; + + var lineHeightQuery = function (editor) { + return mapRange(editor, function (elm) { + var root = SugarElement.fromDom(editor.getBody()); + var specifiedStyle = closest$2(elm, function (elm) { + return getRaw(elm, 'line-height'); + }, curry(eq$2, root)); + var computedStyle = function () { + var lineHeight = parseFloat(get$4(elm, 'line-height')); + var fontSize = parseFloat(get$4(elm, 'font-size')); + return String(lineHeight / fontSize); + }; + return specifiedStyle.getOrThunk(computedStyle); + }).getOr(''); + }; + var lineHeightAction = function (editor, lineHeight) { + editor.undoManager.transact(function () { + editor.formatter.toggle('lineheight', { value: String(lineHeight) }); + editor.nodeChanged(); + }); + }; + + var processValue = function (value) { + var details; + if (typeof value !== 'string') { + details = Tools.extend({ + paste: value.paste, + data: { paste: value.paste } + }, value); + return { + content: value.content, + details: details + }; + } + return { + content: value, + details: {} + }; + }; + var insertAtCaret$1 = function (editor, value) { + var result = processValue(value); + insertContent(editor, result.content, result.details); + }; + + var each$f = Tools.each; + var map$3 = Tools.map, inArray$2 = Tools.inArray; + var EditorCommands = function () { + function EditorCommands(editor) { + this.commands = { + state: {}, + exec: {}, + value: {} + }; + this.editor = editor; + this.setupCommands(editor); + } + EditorCommands.prototype.execCommand = function (command, ui, value, args) { + var func, state = false; + var self = this; + if (self.editor.removed) { + return; + } + if (!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(command) && (!args || !args.skip_focus)) { + self.editor.focus(); + } else { + restore(self.editor); + } + args = self.editor.fire('BeforeExecCommand', { + command: command, + ui: ui, + value: value + }); + if (args.isDefaultPrevented()) { + return false; + } + var customCommand = command.toLowerCase(); + if (func = self.commands.exec[customCommand]) { + func(customCommand, ui, value); + self.editor.fire('ExecCommand', { + command: command, + ui: ui, + value: value + }); + return true; + } + each$f(this.editor.plugins, function (p) { + if (p.execCommand && p.execCommand(command, ui, value)) { + self.editor.fire('ExecCommand', { + command: command, + ui: ui, + value: value + }); + state = true; + return false; + } + }); + if (state) { + return state; + } + if (self.editor.theme && self.editor.theme.execCommand && self.editor.theme.execCommand(command, ui, value)) { + self.editor.fire('ExecCommand', { + command: command, + ui: ui, + value: value + }); + return true; + } + try { + state = self.editor.getDoc().execCommand(command, ui, value); + } catch (ex) { + } + if (state) { + self.editor.fire('ExecCommand', { + command: command, + ui: ui, + value: value + }); + return true; + } + return false; + }; + EditorCommands.prototype.queryCommandState = function (command) { + var func; + if (this.editor.quirks.isHidden() || this.editor.removed) { + return; + } + command = command.toLowerCase(); + if (func = this.commands.state[command]) { + return func(command); + } + try { + return this.editor.getDoc().queryCommandState(command); + } catch (ex) { + } + return false; + }; + EditorCommands.prototype.queryCommandValue = function (command) { + var func; + if (this.editor.quirks.isHidden() || this.editor.removed) { + return; + } + command = command.toLowerCase(); + if (func = this.commands.value[command]) { + return func(command); + } + try { + return this.editor.getDoc().queryCommandValue(command); + } catch (ex) { + } + }; + EditorCommands.prototype.addCommands = function (commandList, type) { + if (type === void 0) { + type = 'exec'; + } + var self = this; + each$f(commandList, function (callback, command) { + each$f(command.toLowerCase().split(','), function (command) { + self.commands[type][command] = callback; + }); + }); + }; + EditorCommands.prototype.addCommand = function (command, callback, scope) { + var _this = this; + command = command.toLowerCase(); + this.commands.exec[command] = function (command, ui, value, args) { + return callback.call(scope || _this.editor, ui, value, args); + }; + }; + EditorCommands.prototype.queryCommandSupported = function (command) { + command = command.toLowerCase(); + if (this.commands.exec[command]) { + return true; + } + try { + return this.editor.getDoc().queryCommandSupported(command); + } catch (ex) { + } + return false; + }; + EditorCommands.prototype.addQueryStateHandler = function (command, callback, scope) { + var _this = this; + command = command.toLowerCase(); + this.commands.state[command] = function () { + return callback.call(scope || _this.editor); + }; + }; + EditorCommands.prototype.addQueryValueHandler = function (command, callback, scope) { + var _this = this; + command = command.toLowerCase(); + this.commands.value[command] = function () { + return callback.call(scope || _this.editor); + }; + }; + EditorCommands.prototype.hasCustomCommand = function (command) { + command = command.toLowerCase(); + return !!this.commands.exec[command]; + }; + EditorCommands.prototype.execNativeCommand = function (command, ui, value) { + if (ui === undefined) { + ui = false; + } + if (value === undefined) { + value = null; + } + return this.editor.getDoc().execCommand(command, ui, value); + }; + EditorCommands.prototype.isFormatMatch = function (name) { + return this.editor.formatter.match(name); + }; + EditorCommands.prototype.toggleFormat = function (name, value) { + this.editor.formatter.toggle(name, value ? { value: value } : undefined); + this.editor.nodeChanged(); + }; + EditorCommands.prototype.storeSelection = function (type) { + this.selectionBookmark = this.editor.selection.getBookmark(type); + }; + EditorCommands.prototype.restoreSelection = function () { + this.editor.selection.moveToBookmark(this.selectionBookmark); + }; + EditorCommands.prototype.setupCommands = function (editor) { + var self = this; + this.addCommands({ + 'mceResetDesignMode,mceBeginUndoLevel': function () { + }, + 'mceEndUndoLevel,mceAddUndoLevel': function () { + editor.undoManager.add(); + }, + 'Cut,Copy,Paste': function (command) { + var doc = editor.getDoc(); + var failed; + try { + self.execNativeCommand(command); + } catch (ex) { + failed = true; + } + if (command === 'paste' && !doc.queryCommandEnabled(command)) { + failed = true; + } + if (failed || !doc.queryCommandSupported(command)) { + var msg = editor.translate('Your browser doesn\'t support direct access to the clipboard. ' + 'Please use the Ctrl+X/C/V keyboard shortcuts instead.'); + if (Env.mac) { + msg = msg.replace(/Ctrl\+/g, '\u2318+'); + } + editor.notificationManager.open({ + text: msg, + type: 'error' + }); + } + }, + 'unlink': function () { + if (editor.selection.isCollapsed()) { + var elm = editor.dom.getParent(editor.selection.getStart(), 'a'); + if (elm) { + editor.dom.remove(elm, true); + } + return; + } + editor.formatter.remove('link'); + }, + 'JustifyLeft,JustifyCenter,JustifyRight,JustifyFull,JustifyNone': function (command) { + var align = command.substring(7); + if (align === 'full') { + align = 'justify'; + } + each$f('left,center,right,justify'.split(','), function (name) { + if (align !== name) { + editor.formatter.remove('align' + name); + } + }); + if (align !== 'none') { + self.toggleFormat('align' + align); + } + }, + 'InsertUnorderedList,InsertOrderedList': function (command) { + var listParent; + self.execNativeCommand(command); + var listElm = editor.dom.getParent(editor.selection.getNode(), 'ol,ul'); + if (listElm) { + listParent = listElm.parentNode; + if (/^(H[1-6]|P|ADDRESS|PRE)$/.test(listParent.nodeName)) { + self.storeSelection(); + editor.dom.split(listParent, listElm); + self.restoreSelection(); + } + } + }, + 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function (command) { + self.toggleFormat(command); + }, + 'ForeColor,HiliteColor': function (command, ui, value) { + self.toggleFormat(command, value); + }, + 'FontName': function (command, ui, value) { + fontNameAction(editor, value); + }, + 'FontSize': function (command, ui, value) { + fontSizeAction(editor, value); + }, + 'LineHeight': function (command, ui, value) { + lineHeightAction(editor, value); + }, + 'RemoveFormat': function (command) { + editor.formatter.remove(command); + }, + 'mceBlockQuote': function () { + self.toggleFormat('blockquote'); + }, + 'FormatBlock': function (command, ui, value) { + return self.toggleFormat(value || 'p'); + }, + 'mceCleanup': function () { + var bookmark = editor.selection.getBookmark(); + editor.setContent(editor.getContent()); + editor.selection.moveToBookmark(bookmark); + }, + 'mceRemoveNode': function (command, ui, value) { + var node = value || editor.selection.getNode(); + if (node !== editor.getBody()) { + self.storeSelection(); + editor.dom.remove(node, true); + self.restoreSelection(); + } + }, + 'mceSelectNodeDepth': function (command, ui, value) { + var counter = 0; + editor.dom.getParent(editor.selection.getNode(), function (node) { + if (node.nodeType === 1 && counter++ === value) { + editor.selection.select(node); + return false; + } + }, editor.getBody()); + }, + 'mceSelectNode': function (command, ui, value) { + editor.selection.select(value); + }, + 'mceInsertContent': function (command, ui, value) { + insertAtCaret$1(editor, value); + }, + 'mceInsertRawHTML': function (command, ui, value) { + editor.selection.setContent('tiny_mce_marker'); + var content = editor.getContent(); + editor.setContent(content.replace(/tiny_mce_marker/g, function () { + return value; + })); + }, + 'mceInsertNewLine': function (command, ui, value) { + insert$3(editor, value); + }, + 'mceToggleFormat': function (command, ui, value) { + self.toggleFormat(value); + }, + 'mceSetContent': function (command, ui, value) { + editor.setContent(value); + }, + 'Indent,Outdent': function (command) { + handle(editor, command); + }, + 'mceRepaint': function () { + }, + 'InsertHorizontalRule': function () { + editor.execCommand('mceInsertContent', false, '
    '); + }, + 'mceToggleVisualAid': function () { + editor.hasVisual = !editor.hasVisual; + editor.addVisual(); + }, + 'mceReplaceContent': function (command, ui, value) { + editor.execCommand('mceInsertContent', false, value.replace(/\{\$selection\}/g, editor.selection.getContent({ format: 'text' }))); + }, + 'mceInsertLink': function (command, ui, value) { + if (typeof value === 'string') { + value = { href: value }; + } + var anchor = editor.dom.getParent(editor.selection.getNode(), 'a'); + value.href = value.href.replace(/ /g, '%20'); + if (!anchor || !value.href) { + editor.formatter.remove('link'); + } + if (value.href) { + editor.formatter.apply('link', value, anchor); + } + }, + 'selectAll': function () { + var editingHost = editor.dom.getParent(editor.selection.getStart(), isContentEditableTrue); + if (editingHost) { + var rng = editor.dom.createRng(); + rng.selectNodeContents(editingHost); + editor.selection.setRng(rng); + } + }, + 'mceNewDocument': function () { + editor.setContent(''); + }, + 'InsertLineBreak': function (command, ui, value) { + insert$2(editor, value); + return true; + } + }); + var alignStates = function (name) { + return function () { + var selection = editor.selection; + var nodes = selection.isCollapsed() ? [editor.dom.getParent(selection.getNode(), editor.dom.isBlock)] : selection.getSelectedBlocks(); + var matches = map$3(nodes, function (node) { + return !!editor.formatter.matchNode(node, name); + }); + return inArray$2(matches, true) !== -1; + }; + }; + self.addCommands({ + 'JustifyLeft': alignStates('alignleft'), + 'JustifyCenter': alignStates('aligncenter'), + 'JustifyRight': alignStates('alignright'), + 'JustifyFull': alignStates('alignjustify'), + 'Bold,Italic,Underline,Strikethrough,Superscript,Subscript': function (command) { + return self.isFormatMatch(command); + }, + 'mceBlockQuote': function () { + return self.isFormatMatch('blockquote'); + }, + 'Outdent': function () { + return canOutdent(editor); + }, + 'InsertUnorderedList,InsertOrderedList': function (command) { + var list = editor.dom.getParent(editor.selection.getNode(), 'ul,ol'); + return list && (command === 'insertunorderedlist' && list.tagName === 'UL' || command === 'insertorderedlist' && list.tagName === 'OL'); + } + }, 'state'); + self.addCommands({ + Undo: function () { + editor.undoManager.undo(); + }, + Redo: function () { + editor.undoManager.redo(); + } + }); + self.addQueryValueHandler('FontName', function () { + return fontNameQuery(editor); + }, this); + self.addQueryValueHandler('FontSize', function () { + return fontSizeQuery(editor); + }, this); + self.addQueryValueHandler('LineHeight', function () { + return lineHeightQuery(editor); + }, this); + }; + return EditorCommands; + }(); + + var internalContentEditableAttr = 'data-mce-contenteditable'; + var toggleClass = function (elm, cls, state) { + if (has$2(elm, cls) && state === false) { + remove$4(elm, cls); + } else if (state) { + add$3(elm, cls); + } + }; + var setEditorCommandState = function (editor, cmd, state) { + try { + editor.getDoc().execCommand(cmd, false, String(state)); + } catch (ex) { + } + }; + var setContentEditable = function (elm, state) { + elm.dom.contentEditable = state ? 'true' : 'false'; + }; + var switchOffContentEditableTrue = function (elm) { + each(descendants$1(elm, '*[contenteditable="true"]'), function (elm) { + set(elm, internalContentEditableAttr, 'true'); + setContentEditable(elm, false); + }); + }; + var switchOnContentEditableTrue = function (elm) { + each(descendants$1(elm, '*[' + internalContentEditableAttr + '="true"]'), function (elm) { + remove$1(elm, internalContentEditableAttr); + setContentEditable(elm, true); + }); + }; + var removeFakeSelection = function (editor) { + Optional.from(editor.selection.getNode()).each(function (elm) { + elm.removeAttribute('data-mce-selected'); + }); + }; + var restoreFakeSelection = function (editor) { + editor.selection.setRng(editor.selection.getRng()); + }; + var toggleReadOnly = function (editor, state) { + var body = SugarElement.fromDom(editor.getBody()); + toggleClass(body, 'mce-content-readonly', state); + if (state) { + editor.selection.controlSelection.hideResizeRect(); + editor._selectionOverrides.hideFakeCaret(); + removeFakeSelection(editor); + editor.readonly = true; + setContentEditable(body, false); + switchOffContentEditableTrue(body); + } else { + editor.readonly = false; + setContentEditable(body, true); + switchOnContentEditableTrue(body); + setEditorCommandState(editor, 'StyleWithCSS', false); + setEditorCommandState(editor, 'enableInlineTableEditing', false); + setEditorCommandState(editor, 'enableObjectResizing', false); + if (hasEditorOrUiFocus(editor)) { + editor.focus(); + } + restoreFakeSelection(editor); + editor.nodeChanged(); + } + }; + var isReadOnly$1 = function (editor) { + return editor.readonly; + }; + var registerFilters = function (editor) { + editor.parser.addAttributeFilter('contenteditable', function (nodes) { + if (isReadOnly$1(editor)) { + each(nodes, function (node) { + node.attr(internalContentEditableAttr, node.attr('contenteditable')); + node.attr('contenteditable', 'false'); + }); + } + }); + editor.serializer.addAttributeFilter(internalContentEditableAttr, function (nodes) { + if (isReadOnly$1(editor)) { + each(nodes, function (node) { + node.attr('contenteditable', node.attr(internalContentEditableAttr)); + }); + } + }); + editor.serializer.addTempAttr(internalContentEditableAttr); + }; + var registerReadOnlyContentFilters = function (editor) { + if (editor.serializer) { + registerFilters(editor); + } else { + editor.on('PreInit', function () { + registerFilters(editor); + }); + } + }; + var isClickEvent = function (e) { + return e.type === 'click'; + }; + var isInAnchor = function (editor, target) { + return editor.dom.getParent(target, 'a') !== null; + }; + var preventReadOnlyEvents = function (editor, e) { + var target = e.target; + if (isClickEvent(e) && !VK.metaKeyPressed(e) && isInAnchor(editor, target)) { + e.preventDefault(); + } + }; + var registerReadOnlySelectionBlockers = function (editor) { + editor.on('ShowCaret', function (e) { + if (isReadOnly$1(editor)) { + e.preventDefault(); + } + }); + editor.on('ObjectSelected', function (e) { + if (isReadOnly$1(editor)) { + e.preventDefault(); + } + }); + }; + + var nativeEvents = Tools.makeMap('focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange ' + 'mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover ' + 'draggesture dragdrop drop drag submit ' + 'compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel', ' '); + var EventDispatcher = function () { + function EventDispatcher(settings) { + this.bindings = {}; + this.settings = settings || {}; + this.scope = this.settings.scope || this; + this.toggleEvent = this.settings.toggleEvent || never; + } + EventDispatcher.isNative = function (name) { + return !!nativeEvents[name.toLowerCase()]; + }; + EventDispatcher.prototype.fire = function (nameIn, argsIn) { + var name = nameIn.toLowerCase(); + var args = argsIn || {}; + args.type = name; + if (!args.target) { + args.target = this.scope; + } + if (!args.preventDefault) { + args.preventDefault = function () { + args.isDefaultPrevented = always; + }; + args.stopPropagation = function () { + args.isPropagationStopped = always; + }; + args.stopImmediatePropagation = function () { + args.isImmediatePropagationStopped = always; + }; + args.isDefaultPrevented = never; + args.isPropagationStopped = never; + args.isImmediatePropagationStopped = never; + } + if (this.settings.beforeFire) { + this.settings.beforeFire(args); + } + var handlers = this.bindings[name]; + if (handlers) { + for (var i = 0, l = handlers.length; i < l; i++) { + var callback = handlers[i]; + if (callback.once) { + this.off(name, callback.func); + } + if (args.isImmediatePropagationStopped()) { + args.stopPropagation(); + return args; + } + if (callback.func.call(this.scope, args) === false) { + args.preventDefault(); + return args; + } + } + } + return args; + }; + EventDispatcher.prototype.on = function (name, callback, prepend, extra) { + if (callback === false) { + callback = never; + } + if (callback) { + var wrappedCallback = { func: callback }; + if (extra) { + Tools.extend(wrappedCallback, extra); + } + var names = name.toLowerCase().split(' '); + var i = names.length; + while (i--) { + var currentName = names[i]; + var handlers = this.bindings[currentName]; + if (!handlers) { + handlers = this.bindings[currentName] = []; + this.toggleEvent(currentName, true); + } + if (prepend) { + handlers.unshift(wrappedCallback); + } else { + handlers.push(wrappedCallback); + } + } + } + return this; + }; + EventDispatcher.prototype.off = function (name, callback) { + var _this = this; + if (name) { + var names = name.toLowerCase().split(' '); + var i = names.length; + while (i--) { + var currentName = names[i]; + var handlers = this.bindings[currentName]; + if (!currentName) { + each$1(this.bindings, function (_value, bindingName) { + _this.toggleEvent(bindingName, false); + delete _this.bindings[bindingName]; + }); + return this; + } + if (handlers) { + if (!callback) { + handlers.length = 0; + } else { + var hi = handlers.length; + while (hi--) { + if (handlers[hi].func === callback) { + handlers = handlers.slice(0, hi).concat(handlers.slice(hi + 1)); + this.bindings[currentName] = handlers; + } + } + } + if (!handlers.length) { + this.toggleEvent(name, false); + delete this.bindings[currentName]; + } + } + } + } else { + each$1(this.bindings, function (_value, name) { + _this.toggleEvent(name, false); + }); + this.bindings = {}; + } + return this; + }; + EventDispatcher.prototype.once = function (name, callback, prepend) { + return this.on(name, callback, prepend, { once: true }); + }; + EventDispatcher.prototype.has = function (name) { + name = name.toLowerCase(); + return !(!this.bindings[name] || this.bindings[name].length === 0); + }; + return EventDispatcher; + }(); + + var getEventDispatcher = function (obj) { + if (!obj._eventDispatcher) { + obj._eventDispatcher = new EventDispatcher({ + scope: obj, + toggleEvent: function (name, state) { + if (EventDispatcher.isNative(name) && obj.toggleNativeEvent) { + obj.toggleNativeEvent(name, state); + } + } + }); + } + return obj._eventDispatcher; + }; + var Observable = { + fire: function (name, args, bubble) { + var self = this; + if (self.removed && name !== 'remove' && name !== 'detach') { + return args; + } + var dispatcherArgs = getEventDispatcher(self).fire(name, args); + if (bubble !== false && self.parent) { + var parent_1 = self.parent(); + while (parent_1 && !dispatcherArgs.isPropagationStopped()) { + parent_1.fire(name, dispatcherArgs, false); + parent_1 = parent_1.parent(); + } + } + return dispatcherArgs; + }, + on: function (name, callback, prepend) { + return getEventDispatcher(this).on(name, callback, prepend); + }, + off: function (name, callback) { + return getEventDispatcher(this).off(name, callback); + }, + once: function (name, callback) { + return getEventDispatcher(this).once(name, callback); + }, + hasEventListeners: function (name) { + return getEventDispatcher(this).has(name); + } + }; + + var DOM$8 = DOMUtils$1.DOM; + var customEventRootDelegates; + var getEventTarget = function (editor, eventName) { + if (eventName === 'selectionchange') { + return editor.getDoc(); + } + if (!editor.inline && /^mouse|touch|click|contextmenu|drop|dragover|dragend/.test(eventName)) { + return editor.getDoc().documentElement; + } + var eventRoot = getEventRoot(editor); + if (eventRoot) { + if (!editor.eventRoot) { + editor.eventRoot = DOM$8.select(eventRoot)[0]; + } + return editor.eventRoot; + } + return editor.getBody(); + }; + var isListening = function (editor) { + return !editor.hidden && !isReadOnly$1(editor); + }; + var fireEvent = function (editor, eventName, e) { + if (isListening(editor)) { + editor.fire(eventName, e); + } else if (isReadOnly$1(editor)) { + preventReadOnlyEvents(editor, e); + } + }; + var bindEventDelegate = function (editor, eventName) { + var delegate; + if (!editor.delegates) { + editor.delegates = {}; + } + if (editor.delegates[eventName] || editor.removed) { + return; + } + var eventRootElm = getEventTarget(editor, eventName); + if (getEventRoot(editor)) { + if (!customEventRootDelegates) { + customEventRootDelegates = {}; + editor.editorManager.on('removeEditor', function () { + if (!editor.editorManager.activeEditor) { + if (customEventRootDelegates) { + each$1(customEventRootDelegates, function (_value, name) { + editor.dom.unbind(getEventTarget(editor, name)); + }); + customEventRootDelegates = null; + } + } + }); + } + if (customEventRootDelegates[eventName]) { + return; + } + delegate = function (e) { + var target = e.target; + var editors = editor.editorManager.get(); + var i = editors.length; + while (i--) { + var body = editors[i].getBody(); + if (body === target || DOM$8.isChildOf(target, body)) { + fireEvent(editors[i], eventName, e); + } + } + }; + customEventRootDelegates[eventName] = delegate; + DOM$8.bind(eventRootElm, eventName, delegate); + } else { + delegate = function (e) { + fireEvent(editor, eventName, e); + }; + DOM$8.bind(eventRootElm, eventName, delegate); + editor.delegates[eventName] = delegate; + } + }; + var EditorObservable = __assign(__assign({}, Observable), { + bindPendingEventDelegates: function () { + var self = this; + Tools.each(self._pendingNativeEvents, function (name) { + bindEventDelegate(self, name); + }); + }, + toggleNativeEvent: function (name, state) { + var self = this; + if (name === 'focus' || name === 'blur') { + return; + } + if (state) { + if (self.initialized) { + bindEventDelegate(self, name); + } else { + if (!self._pendingNativeEvents) { + self._pendingNativeEvents = [name]; + } else { + self._pendingNativeEvents.push(name); + } + } + } else if (self.initialized) { + self.dom.unbind(getEventTarget(self, name), name, self.delegates[name]); + delete self.delegates[name]; + } + }, + unbindAllNativeEvents: function () { + var self = this; + var body = self.getBody(); + var dom = self.dom; + if (self.delegates) { + each$1(self.delegates, function (value, name) { + self.dom.unbind(getEventTarget(self, name), name, value); + }); + delete self.delegates; + } + if (!self.inline && body && dom) { + body.onload = null; + dom.unbind(self.getWin()); + dom.unbind(self.getDoc()); + } + if (dom) { + dom.unbind(body); + dom.unbind(self.getContainer()); + } + } + }); + + var defaultModes = [ + 'design', + 'readonly' + ]; + var switchToMode = function (editor, activeMode, availableModes, mode) { + var oldMode = availableModes[activeMode.get()]; + var newMode = availableModes[mode]; + try { + newMode.activate(); + } catch (e) { + console.error('problem while activating editor mode ' + mode + ':', e); + return; + } + oldMode.deactivate(); + if (oldMode.editorReadOnly !== newMode.editorReadOnly) { + toggleReadOnly(editor, newMode.editorReadOnly); + } + activeMode.set(mode); + fireSwitchMode(editor, mode); + }; + var setMode = function (editor, availableModes, activeMode, mode) { + if (mode === activeMode.get()) { + return; + } else if (!has(availableModes, mode)) { + throw new Error('Editor mode \'' + mode + '\' is invalid'); + } + if (editor.initialized) { + switchToMode(editor, activeMode, availableModes, mode); + } else { + editor.on('init', function () { + return switchToMode(editor, activeMode, availableModes, mode); + }); + } + }; + var registerMode = function (availableModes, mode, api) { + var _a; + if (contains(defaultModes, mode)) { + throw new Error('Cannot override default mode ' + mode); + } + return __assign(__assign({}, availableModes), (_a = {}, _a[mode] = __assign(__assign({}, api), { + deactivate: function () { + try { + api.deactivate(); + } catch (e) { + console.error('problem while deactivating editor mode ' + mode + ':', e); + } + } + }), _a)); + }; + + var create$5 = function (editor) { + var activeMode = Cell('design'); + var availableModes = Cell({ + design: { + activate: noop, + deactivate: noop, + editorReadOnly: false + }, + readonly: { + activate: noop, + deactivate: noop, + editorReadOnly: true + } + }); + registerReadOnlyContentFilters(editor); + registerReadOnlySelectionBlockers(editor); + return { + isReadOnly: function () { + return isReadOnly$1(editor); + }, + set: function (mode) { + return setMode(editor, availableModes.get(), activeMode, mode); + }, + get: function () { + return activeMode.get(); + }, + register: function (mode, api) { + availableModes.set(registerMode(availableModes.get(), mode, api)); + } + }; + }; + + var each$g = Tools.each, explode$3 = Tools.explode; + var keyCodeLookup = { + f1: 112, + f2: 113, + f3: 114, + f4: 115, + f5: 116, + f6: 117, + f7: 118, + f8: 119, + f9: 120, + f10: 121, + f11: 122, + f12: 123 + }; + var modifierNames = Tools.makeMap('alt,ctrl,shift,meta,access'); + var Shortcuts = function () { + function Shortcuts(editor) { + this.shortcuts = {}; + this.pendingPatterns = []; + this.editor = editor; + var self = this; + editor.on('keyup keypress keydown', function (e) { + if ((self.hasModifier(e) || self.isFunctionKey(e)) && !e.isDefaultPrevented()) { + each$g(self.shortcuts, function (shortcut) { + if (self.matchShortcut(e, shortcut)) { + self.pendingPatterns = shortcut.subpatterns.slice(0); + if (e.type === 'keydown') { + self.executeShortcutAction(shortcut); + } + return true; + } + }); + if (self.matchShortcut(e, self.pendingPatterns[0])) { + if (self.pendingPatterns.length === 1) { + if (e.type === 'keydown') { + self.executeShortcutAction(self.pendingPatterns[0]); + } + } + self.pendingPatterns.shift(); + } + } + }); + } + Shortcuts.prototype.add = function (pattern, desc, cmdFunc, scope) { + var self = this; + var func = self.normalizeCommandFunc(cmdFunc); + each$g(explode$3(Tools.trim(pattern)), function (pattern) { + var shortcut = self.createShortcut(pattern, desc, func, scope); + self.shortcuts[shortcut.id] = shortcut; + }); + return true; + }; + Shortcuts.prototype.remove = function (pattern) { + var shortcut = this.createShortcut(pattern); + if (this.shortcuts[shortcut.id]) { + delete this.shortcuts[shortcut.id]; + return true; + } + return false; + }; + Shortcuts.prototype.normalizeCommandFunc = function (cmdFunc) { + var self = this; + var cmd = cmdFunc; + if (typeof cmd === 'string') { + return function () { + self.editor.execCommand(cmd, false, null); + }; + } else if (Tools.isArray(cmd)) { + return function () { + self.editor.execCommand(cmd[0], cmd[1], cmd[2]); + }; + } else { + return cmd; + } + }; + Shortcuts.prototype.parseShortcut = function (pattern) { + var key; + var shortcut = {}; + each$g(explode$3(pattern.toLowerCase(), '+'), function (value) { + if (value in modifierNames) { + shortcut[value] = true; + } else { + if (/^[0-9]{2,}$/.test(value)) { + shortcut.keyCode = parseInt(value, 10); + } else { + shortcut.charCode = value.charCodeAt(0); + shortcut.keyCode = keyCodeLookup[value] || value.toUpperCase().charCodeAt(0); + } + } + }); + var id = [shortcut.keyCode]; + for (key in modifierNames) { + if (shortcut[key]) { + id.push(key); + } else { + shortcut[key] = false; + } + } + shortcut.id = id.join(','); + if (shortcut.access) { + shortcut.alt = true; + if (Env.mac) { + shortcut.ctrl = true; + } else { + shortcut.shift = true; + } + } + if (shortcut.meta) { + if (Env.mac) { + shortcut.meta = true; + } else { + shortcut.ctrl = true; + shortcut.meta = false; + } + } + return shortcut; + }; + Shortcuts.prototype.createShortcut = function (pattern, desc, cmdFunc, scope) { + var shortcuts = Tools.map(explode$3(pattern, '>'), this.parseShortcut); + shortcuts[shortcuts.length - 1] = Tools.extend(shortcuts[shortcuts.length - 1], { + func: cmdFunc, + scope: scope || this.editor + }); + return Tools.extend(shortcuts[0], { + desc: this.editor.translate(desc), + subpatterns: shortcuts.slice(1) + }); + }; + Shortcuts.prototype.hasModifier = function (e) { + return e.altKey || e.ctrlKey || e.metaKey; + }; + Shortcuts.prototype.isFunctionKey = function (e) { + return e.type === 'keydown' && e.keyCode >= 112 && e.keyCode <= 123; + }; + Shortcuts.prototype.matchShortcut = function (e, shortcut) { + if (!shortcut) { + return false; + } + if (shortcut.ctrl !== e.ctrlKey || shortcut.meta !== e.metaKey) { + return false; + } + if (shortcut.alt !== e.altKey || shortcut.shift !== e.shiftKey) { + return false; + } + if (e.keyCode === shortcut.keyCode || e.charCode && e.charCode === shortcut.charCode) { + e.preventDefault(); + return true; + } + return false; + }; + Shortcuts.prototype.executeShortcutAction = function (shortcut) { + return shortcut.func ? shortcut.func.call(shortcut.scope) : null; + }; + return Shortcuts; + }(); + + var create$6 = function () { + var buttons = {}; + var menuItems = {}; + var popups = {}; + var icons = {}; + var contextMenus = {}; + var contextToolbars = {}; + var sidebars = {}; + var add = function (collection, type) { + return function (name, spec) { + return collection[name.toLowerCase()] = __assign(__assign({}, spec), { type: type }); + }; + }; + var addIcon = function (name, svgData) { + return icons[name.toLowerCase()] = svgData; + }; + return { + addButton: add(buttons, 'button'), + addGroupToolbarButton: add(buttons, 'grouptoolbarbutton'), + addToggleButton: add(buttons, 'togglebutton'), + addMenuButton: add(buttons, 'menubutton'), + addSplitButton: add(buttons, 'splitbutton'), + addMenuItem: add(menuItems, 'menuitem'), + addNestedMenuItem: add(menuItems, 'nestedmenuitem'), + addToggleMenuItem: add(menuItems, 'togglemenuitem'), + addAutocompleter: add(popups, 'autocompleter'), + addContextMenu: add(contextMenus, 'contextmenu'), + addContextToolbar: add(contextToolbars, 'contexttoolbar'), + addContextForm: add(contextToolbars, 'contextform'), + addSidebar: add(sidebars, 'sidebar'), + addIcon: addIcon, + getAll: function () { + return { + buttons: buttons, + menuItems: menuItems, + icons: icons, + popups: popups, + contextMenus: contextMenus, + contextToolbars: contextToolbars, + sidebars: sidebars + }; + } + }; + }; + + var registry = function () { + var bridge = create$6(); + return { + addAutocompleter: bridge.addAutocompleter, + addButton: bridge.addButton, + addContextForm: bridge.addContextForm, + addContextMenu: bridge.addContextMenu, + addContextToolbar: bridge.addContextToolbar, + addIcon: bridge.addIcon, + addMenuButton: bridge.addMenuButton, + addMenuItem: bridge.addMenuItem, + addNestedMenuItem: bridge.addNestedMenuItem, + addSidebar: bridge.addSidebar, + addSplitButton: bridge.addSplitButton, + addToggleButton: bridge.addToggleButton, + addGroupToolbarButton: bridge.addGroupToolbarButton, + addToggleMenuItem: bridge.addToggleMenuItem, + getAll: bridge.getAll + }; + }; + + var each$h = Tools.each, trim$4 = Tools.trim; + var queryParts = 'source protocol authority userInfo user password host port relative path directory file query anchor'.split(' '); + var DEFAULT_PORTS = { + ftp: 21, + http: 80, + https: 443, + mailto: 25 + }; + var URI = function () { + function URI(url, settings) { + url = trim$4(url); + this.settings = settings || {}; + var baseUri = this.settings.base_uri; + var self = this; + if (/^([\w\-]+):([^\/]{2})/i.test(url) || /^\s*#/.test(url)) { + self.source = url; + return; + } + var isProtocolRelative = url.indexOf('//') === 0; + if (url.indexOf('/') === 0 && !isProtocolRelative) { + url = (baseUri ? baseUri.protocol || 'http' : 'http') + '://mce_host' + url; + } + if (!/^[\w\-]*:?\/\//.test(url)) { + var baseUrl = this.settings.base_uri ? this.settings.base_uri.path : new URI(document.location.href).directory; + if (this.settings.base_uri && this.settings.base_uri.protocol == '') { + url = '//mce_host' + self.toAbsPath(baseUrl, url); + } else { + var match = /([^#?]*)([#?]?.*)/.exec(url); + url = (baseUri && baseUri.protocol || 'http') + '://mce_host' + self.toAbsPath(baseUrl, match[1]) + match[2]; + } + } + url = url.replace(/@@/g, '(mce_at)'); + var urlMatch = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(url); + each$h(queryParts, function (v, i) { + var part = urlMatch[i]; + if (part) { + part = part.replace(/\(mce_at\)/g, '@@'); + } + self[v] = part; + }); + if (baseUri) { + if (!self.protocol) { + self.protocol = baseUri.protocol; + } + if (!self.userInfo) { + self.userInfo = baseUri.userInfo; + } + if (!self.port && self.host === 'mce_host') { + self.port = baseUri.port; + } + if (!self.host || self.host === 'mce_host') { + self.host = baseUri.host; + } + self.source = ''; + } + if (isProtocolRelative) { + self.protocol = ''; + } + } + URI.parseDataUri = function (uri) { + var type; + var uriComponents = decodeURIComponent(uri).split(','); + var matches = /data:([^;]+)/.exec(uriComponents[0]); + if (matches) { + type = matches[1]; + } + return { + type: type, + data: uriComponents[1] + }; + }; + URI.getDocumentBaseUrl = function (loc) { + var baseUrl; + if (loc.protocol.indexOf('http') !== 0 && loc.protocol !== 'file:') { + baseUrl = loc.href; + } else { + baseUrl = loc.protocol + '//' + loc.host + loc.pathname; + } + if (/^[^:]+:\/\/\/?[^\/]+\//.test(baseUrl)) { + baseUrl = baseUrl.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, ''); + if (!/[\/\\]$/.test(baseUrl)) { + baseUrl += '/'; + } + } + return baseUrl; + }; + URI.prototype.setPath = function (path) { + var pathMatch = /^(.*?)\/?(\w+)?$/.exec(path); + this.path = pathMatch[0]; + this.directory = pathMatch[1]; + this.file = pathMatch[2]; + this.source = ''; + this.getURI(); + }; + URI.prototype.toRelative = function (uri) { + var output; + if (uri === './') { + return uri; + } + var relativeUri = new URI(uri, { base_uri: this }); + if (relativeUri.host !== 'mce_host' && this.host !== relativeUri.host && relativeUri.host || this.port !== relativeUri.port || this.protocol !== relativeUri.protocol && relativeUri.protocol !== '') { + return relativeUri.getURI(); + } + var tu = this.getURI(), uu = relativeUri.getURI(); + if (tu === uu || tu.charAt(tu.length - 1) === '/' && tu.substr(0, tu.length - 1) === uu) { + return tu; + } + output = this.toRelPath(this.path, relativeUri.path); + if (relativeUri.query) { + output += '?' + relativeUri.query; + } + if (relativeUri.anchor) { + output += '#' + relativeUri.anchor; + } + return output; + }; + URI.prototype.toAbsolute = function (uri, noHost) { + var absoluteUri = new URI(uri, { base_uri: this }); + return absoluteUri.getURI(noHost && this.isSameOrigin(absoluteUri)); + }; + URI.prototype.isSameOrigin = function (uri) { + if (this.host == uri.host && this.protocol == uri.protocol) { + if (this.port == uri.port) { + return true; + } + var defaultPort = DEFAULT_PORTS[this.protocol]; + if (defaultPort && (this.port || defaultPort) == (uri.port || defaultPort)) { + return true; + } + } + return false; + }; + URI.prototype.toRelPath = function (base, path) { + var breakPoint = 0, out = '', i, l; + var normalizedBase = base.substring(0, base.lastIndexOf('/')).split('/'); + var items = path.split('/'); + if (normalizedBase.length >= items.length) { + for (i = 0, l = normalizedBase.length; i < l; i++) { + if (i >= items.length || normalizedBase[i] !== items[i]) { + breakPoint = i + 1; + break; + } + } + } + if (normalizedBase.length < items.length) { + for (i = 0, l = items.length; i < l; i++) { + if (i >= normalizedBase.length || normalizedBase[i] !== items[i]) { + breakPoint = i + 1; + break; + } + } + } + if (breakPoint === 1) { + return path; + } + for (i = 0, l = normalizedBase.length - (breakPoint - 1); i < l; i++) { + out += '../'; + } + for (i = breakPoint - 1, l = items.length; i < l; i++) { + if (i !== breakPoint - 1) { + out += '/' + items[i]; + } else { + out += items[i]; + } + } + return out; + }; + URI.prototype.toAbsPath = function (base, path) { + var i, nb = 0, o = [], outPath; + var tr = /\/$/.test(path) ? '/' : ''; + var normalizedBase = base.split('/'); + var normalizedPath = path.split('/'); + each$h(normalizedBase, function (k) { + if (k) { + o.push(k); + } + }); + normalizedBase = o; + for (i = normalizedPath.length - 1, o = []; i >= 0; i--) { + if (normalizedPath[i].length === 0 || normalizedPath[i] === '.') { + continue; + } + if (normalizedPath[i] === '..') { + nb++; + continue; + } + if (nb > 0) { + nb--; + continue; + } + o.push(normalizedPath[i]); + } + i = normalizedBase.length - nb; + if (i <= 0) { + outPath = reverse(o).join('/'); + } else { + outPath = normalizedBase.slice(0, i).join('/') + '/' + reverse(o).join('/'); + } + if (outPath.indexOf('/') !== 0) { + outPath = '/' + outPath; + } + if (tr && outPath.lastIndexOf('/') !== outPath.length - 1) { + outPath += tr; + } + return outPath; + }; + URI.prototype.getURI = function (noProtoHost) { + if (noProtoHost === void 0) { + noProtoHost = false; + } + var s; + if (!this.source || noProtoHost) { + s = ''; + if (!noProtoHost) { + if (this.protocol) { + s += this.protocol + '://'; + } else { + s += '//'; + } + if (this.userInfo) { + s += this.userInfo + '@'; + } + if (this.host) { + s += this.host; + } + if (this.port) { + s += ':' + this.port; + } + } + if (this.path) { + s += this.path; + } + if (this.query) { + s += '?' + this.query; + } + if (this.anchor) { + s += '#' + this.anchor; + } + this.source = s; + } + return this.source; + }; + return URI; + }(); + + var DOM$9 = DOMUtils$1.DOM; + var extend$3 = Tools.extend, each$i = Tools.each; + var resolve$3 = Tools.resolve; + var ie$1 = Env.ie; + var Editor = function () { + function Editor(id, settings, editorManager) { + var _this = this; + this.plugins = {}; + this.contentCSS = []; + this.contentStyles = []; + this.loadedCSS = {}; + this.isNotDirty = false; + this.editorManager = editorManager; + this.documentBaseUrl = editorManager.documentBaseURL; + extend$3(this, EditorObservable); + this.settings = getEditorSettings(this, id, this.documentBaseUrl, editorManager.defaultSettings, settings); + if (this.settings.suffix) { + editorManager.suffix = this.settings.suffix; + } + this.suffix = editorManager.suffix; + if (this.settings.base_url) { + editorManager._setBaseUrl(this.settings.base_url); + } + this.baseUri = editorManager.baseURI; + if (this.settings.referrer_policy) { + ScriptLoader.ScriptLoader._setReferrerPolicy(this.settings.referrer_policy); + DOMUtils$1.DOM.styleSheetLoader._setReferrerPolicy(this.settings.referrer_policy); + } + AddOnManager$1.languageLoad = this.settings.language_load; + AddOnManager$1.baseURL = editorManager.baseURL; + this.id = id; + this.setDirty(false); + this.documentBaseURI = new URI(this.settings.document_base_url, { base_uri: this.baseUri }); + this.baseURI = this.baseUri; + this.inline = !!this.settings.inline; + this.shortcuts = new Shortcuts(this); + this.editorCommands = new EditorCommands(this); + if (this.settings.cache_suffix) { + Env.cacheSuffix = this.settings.cache_suffix.replace(/^[\?\&]+/, ''); + } + this.ui = { + registry: registry(), + styleSheetLoader: undefined, + show: noop, + hide: noop + }; + var self = this; + var modeInstance = create$5(self); + this.mode = modeInstance; + this.setMode = modeInstance.set; + editorManager.fire('SetupEditor', { editor: this }); + this.execCallback('setup', this); + this.$ = DomQuery.overrideDefaults(function () { + return { + context: _this.inline ? _this.getBody() : _this.getDoc(), + element: _this.getBody() + }; + }); + } + Editor.prototype.render = function () { + render(this); + }; + Editor.prototype.focus = function (skipFocus) { + focus$1(this, skipFocus); + }; + Editor.prototype.hasFocus = function () { + return hasFocus$1(this); + }; + Editor.prototype.execCallback = function (name) { + var x = []; + for (var _i = 1; _i < arguments.length; _i++) { + x[_i - 1] = arguments[_i]; + } + var self = this; + var callback = self.settings[name], scope; + if (!callback) { + return; + } + if (self.callbackLookup && (scope = self.callbackLookup[name])) { + callback = scope.func; + scope = scope.scope; + } + if (typeof callback === 'string') { + scope = callback.replace(/\.\w+$/, ''); + scope = scope ? resolve$3(scope) : 0; + callback = resolve$3(callback); + self.callbackLookup = self.callbackLookup || {}; + self.callbackLookup[name] = { + func: callback, + scope: scope + }; + } + return callback.apply(scope || self, x); + }; + Editor.prototype.translate = function (text) { + return I18n.translate(text); + }; + Editor.prototype.getParam = function (name, defaultVal, type) { + return getParam(this, name, defaultVal, type); + }; + Editor.prototype.hasPlugin = function (name, loaded) { + var hasPlugin = contains(getPlugins(this).split(/[ ,]/), name); + if (hasPlugin) { + return loaded ? PluginManager.get(name) !== undefined : true; + } else { + return false; + } + }; + Editor.prototype.nodeChanged = function (args) { + this._nodeChangeDispatcher.nodeChanged(args); + }; + Editor.prototype.addCommand = function (name, callback, scope) { + this.editorCommands.addCommand(name, callback, scope); + }; + Editor.prototype.addQueryStateHandler = function (name, callback, scope) { + this.editorCommands.addQueryStateHandler(name, callback, scope); + }; + Editor.prototype.addQueryValueHandler = function (name, callback, scope) { + this.editorCommands.addQueryValueHandler(name, callback, scope); + }; + Editor.prototype.addShortcut = function (pattern, desc, cmdFunc, scope) { + this.shortcuts.add(pattern, desc, cmdFunc, scope); + }; + Editor.prototype.execCommand = function (cmd, ui, value, args) { + return this.editorCommands.execCommand(cmd, ui, value, args); + }; + Editor.prototype.queryCommandState = function (cmd) { + return this.editorCommands.queryCommandState(cmd); + }; + Editor.prototype.queryCommandValue = function (cmd) { + return this.editorCommands.queryCommandValue(cmd); + }; + Editor.prototype.queryCommandSupported = function (cmd) { + return this.editorCommands.queryCommandSupported(cmd); + }; + Editor.prototype.show = function () { + var self = this; + if (self.hidden) { + self.hidden = false; + if (self.inline) { + self.getBody().contentEditable = 'true'; + } else { + DOM$9.show(self.getContainer()); + DOM$9.hide(self.id); + } + self.load(); + self.fire('show'); + } + }; + Editor.prototype.hide = function () { + var self = this, doc = self.getDoc(); + if (!self.hidden) { + if (ie$1 && doc && !self.inline) { + doc.execCommand('SelectAll'); + } + self.save(); + if (self.inline) { + self.getBody().contentEditable = 'false'; + if (self === self.editorManager.focusedEditor) { + self.editorManager.focusedEditor = null; + } + } else { + DOM$9.hide(self.getContainer()); + DOM$9.setStyle(self.id, 'display', self.orgDisplay); + } + self.hidden = true; + self.fire('hide'); + } + }; + Editor.prototype.isHidden = function () { + return !!this.hidden; + }; + Editor.prototype.setProgressState = function (state, time) { + this.fire('ProgressState', { + state: state, + time: time + }); + }; + Editor.prototype.load = function (args) { + var self = this; + var elm = self.getElement(), html; + if (self.removed) { + return ''; + } + if (elm) { + args = args || {}; + args.load = true; + var value = isTextareaOrInput(elm) ? elm.value : elm.innerHTML; + html = self.setContent(value, args); + args.element = elm; + if (!args.no_events) { + self.fire('LoadContent', args); + } + args.element = elm = null; + return html; + } + }; + Editor.prototype.save = function (args) { + var self = this; + var elm = self.getElement(), html, form; + if (!elm || !self.initialized || self.removed) { + return; + } + args = args || {}; + args.save = true; + args.element = elm; + html = args.content = self.getContent(args); + if (!args.no_events) { + self.fire('SaveContent', args); + } + if (args.format === 'raw') { + self.fire('RawSaveContent', args); + } + html = args.content; + if (!isTextareaOrInput(elm)) { + if (args.is_removing || !self.inline) { + elm.innerHTML = html; + } + if (form = DOM$9.getParent(self.id, 'form')) { + each$i(form.elements, function (elm) { + if (elm.name === self.id) { + elm.value = html; + return false; + } + }); + } + } else { + elm.value = html; + } + args.element = elm = null; + if (args.set_dirty !== false) { + self.setDirty(false); + } + return html; + }; + Editor.prototype.setContent = function (content, args) { + return setContent$2(this, content, args); + }; + Editor.prototype.getContent = function (args) { + return getContent$2(this, args); + }; + Editor.prototype.insertContent = function (content, args) { + if (args) { + content = extend$3({ content: content }, args); + } + this.execCommand('mceInsertContent', false, content); + }; + Editor.prototype.resetContent = function (initialContent) { + if (initialContent === undefined) { + setContent$2(this, this.startContent, { format: 'raw' }); + } else { + setContent$2(this, initialContent); + } + this.undoManager.reset(); + this.setDirty(false); + this.nodeChanged(); + }; + Editor.prototype.isDirty = function () { + return !this.isNotDirty; + }; + Editor.prototype.setDirty = function (state) { + var oldState = !this.isNotDirty; + this.isNotDirty = !state; + if (state && state !== oldState) { + this.fire('dirty'); + } + }; + Editor.prototype.getContainer = function () { + var self = this; + if (!self.container) { + self.container = DOM$9.get(self.editorContainer || self.id + '_parent'); + } + return self.container; + }; + Editor.prototype.getContentAreaContainer = function () { + return this.contentAreaContainer; + }; + Editor.prototype.getElement = function () { + if (!this.targetElm) { + this.targetElm = DOM$9.get(this.id); + } + return this.targetElm; + }; + Editor.prototype.getWin = function () { + var self = this; + var elm; + if (!self.contentWindow) { + elm = self.iframeElement; + if (elm) { + self.contentWindow = elm.contentWindow; + } + } + return self.contentWindow; + }; + Editor.prototype.getDoc = function () { + var self = this; + var win; + if (!self.contentDocument) { + win = self.getWin(); + if (win) { + self.contentDocument = win.document; + } + } + return self.contentDocument; + }; + Editor.prototype.getBody = function () { + var doc = this.getDoc(); + return this.bodyElement || (doc ? doc.body : null); + }; + Editor.prototype.convertURL = function (url, name, elm) { + var self = this, settings = self.settings; + if (settings.urlconverter_callback) { + return self.execCallback('urlconverter_callback', url, elm, true, name); + } + if (!settings.convert_urls || elm && elm.nodeName === 'LINK' || url.indexOf('file:') === 0 || url.length === 0) { + return url; + } + if (settings.relative_urls) { + return self.documentBaseURI.toRelative(url); + } + url = self.documentBaseURI.toAbsolute(url, settings.remove_script_host); + return url; + }; + Editor.prototype.addVisual = function (elm) { + var self = this; + var settings = self.settings; + var dom = self.dom; + var cls; + elm = elm || self.getBody(); + if (self.hasVisual === undefined) { + self.hasVisual = settings.visual; + } + each$i(dom.select('table,a', elm), function (elm) { + var value; + switch (elm.nodeName) { + case 'TABLE': + cls = settings.visual_table_class || 'mce-item-table'; + value = dom.getAttrib(elm, 'border'); + if ((!value || value === '0') && self.hasVisual) { + dom.addClass(elm, cls); + } else { + dom.removeClass(elm, cls); + } + return; + case 'A': + if (!dom.getAttrib(elm, 'href')) { + value = dom.getAttrib(elm, 'name') || elm.id; + cls = settings.visual_anchor_class || 'mce-item-anchor'; + if (value && self.hasVisual) { + dom.addClass(elm, cls); + } else { + dom.removeClass(elm, cls); + } + } + return; + } + }); + self.fire('VisualAid', { + element: elm, + hasVisual: self.hasVisual + }); + }; + Editor.prototype.remove = function () { + remove$7(this); + }; + Editor.prototype.destroy = function (automatic) { + destroy(this, automatic); + }; + Editor.prototype.uploadImages = function (callback) { + return this.editorUpload.uploadImages(callback); + }; + Editor.prototype._scanForImages = function () { + return this.editorUpload.scanForImages(); + }; + Editor.prototype.addButton = function () { + throw new Error('editor.addButton has been removed in tinymce 5x, use editor.ui.registry.addButton or editor.ui.registry.addToggleButton or editor.ui.registry.addSplitButton instead'); + }; + Editor.prototype.addSidebar = function () { + throw new Error('editor.addSidebar has been removed in tinymce 5x, use editor.ui.registry.addSidebar instead'); + }; + Editor.prototype.addMenuItem = function () { + throw new Error('editor.addMenuItem has been removed in tinymce 5x, use editor.ui.registry.addMenuItem instead'); + }; + Editor.prototype.addContextToolbar = function () { + throw new Error('editor.addContextToolbar has been removed in tinymce 5x, use editor.ui.registry.addContextToolbar instead'); + }; + return Editor; + }(); + + var DOM$a = DOMUtils$1.DOM; + var explode$4 = Tools.explode, each$j = Tools.each, extend$4 = Tools.extend; + var instanceCounter = 0, boundGlobalEvents = false; + var beforeUnloadDelegate; + var legacyEditors = []; + var editors = []; + var isValidLegacyKey = function (id) { + return id !== 'length'; + }; + var globalEventDelegate = function (e) { + var type = e.type; + each$j(EditorManager.get(), function (editor) { + switch (type) { + case 'scroll': + editor.fire('ScrollWindow', e); + break; + case 'resize': + editor.fire('ResizeWindow', e); + break; + } + }); + }; + var toggleGlobalEvents = function (state) { + if (state !== boundGlobalEvents) { + if (state) { + DomQuery(window).on('resize scroll', globalEventDelegate); + } else { + DomQuery(window).off('resize scroll', globalEventDelegate); + } + boundGlobalEvents = state; + } + }; + var removeEditorFromList = function (targetEditor) { + var oldEditors = editors; + delete legacyEditors[targetEditor.id]; + for (var i = 0; i < legacyEditors.length; i++) { + if (legacyEditors[i] === targetEditor) { + legacyEditors.splice(i, 1); + break; + } + } + editors = filter(editors, function (editor) { + return targetEditor !== editor; + }); + if (EditorManager.activeEditor === targetEditor) { + EditorManager.activeEditor = editors.length > 0 ? editors[0] : null; + } + if (EditorManager.focusedEditor === targetEditor) { + EditorManager.focusedEditor = null; + } + return oldEditors.length !== editors.length; + }; + var purgeDestroyedEditor = function (editor) { + if (editor && editor.initialized && !(editor.getContainer() || editor.getBody()).parentNode) { + removeEditorFromList(editor); + editor.unbindAllNativeEvents(); + editor.destroy(true); + editor.removed = true; + editor = null; + } + return editor; + }; + var isQuirksMode = document.compatMode !== 'CSS1Compat'; + var EditorManager = __assign(__assign({}, Observable), { + baseURI: null, + baseURL: null, + defaultSettings: {}, + documentBaseURL: null, + suffix: null, + $: DomQuery, + majorVersion: '5', + minorVersion: '5.1', + releaseDate: '2020-10-01', + editors: legacyEditors, + i18n: I18n, + activeEditor: null, + focusedEditor: null, + settings: {}, + setup: function () { + var self = this; + var baseURL, documentBaseURL, suffix = ''; + documentBaseURL = URI.getDocumentBaseUrl(document.location); + if (/^[^:]+:\/\/\/?[^\/]+\//.test(documentBaseURL)) { + documentBaseURL = documentBaseURL.replace(/[\?#].*$/, '').replace(/[\/\\][^\/]+$/, ''); + if (!/[\/\\]$/.test(documentBaseURL)) { + documentBaseURL += '/'; + } + } + var preInit = window.tinymce || window.tinyMCEPreInit; + if (preInit) { + baseURL = preInit.base || preInit.baseURL; + suffix = preInit.suffix; + } else { + var scripts = document.getElementsByTagName('script'); + for (var i = 0; i < scripts.length; i++) { + var src = scripts[i].src || ''; + if (src === '') { + continue; + } + var srcScript = src.substring(src.lastIndexOf('/')); + if (/tinymce(\.full|\.jquery|)(\.min|\.dev|)\.js/.test(src)) { + if (srcScript.indexOf('.min') !== -1) { + suffix = '.min'; + } + baseURL = src.substring(0, src.lastIndexOf('/')); + break; + } + } + if (!baseURL && document.currentScript) { + var src = document.currentScript.src; + if (src.indexOf('.min') !== -1) { + suffix = '.min'; + } + baseURL = src.substring(0, src.lastIndexOf('/')); + } + } + self.baseURL = new URI(documentBaseURL).toAbsolute(baseURL); + self.documentBaseURL = documentBaseURL; + self.baseURI = new URI(self.baseURL); + self.suffix = suffix; + setup$2(self); + }, + overrideDefaults: function (defaultSettings) { + var baseUrl = defaultSettings.base_url; + if (baseUrl) { + this._setBaseUrl(baseUrl); + } + var suffix = defaultSettings.suffix; + if (defaultSettings.suffix) { + this.suffix = suffix; + } + this.defaultSettings = defaultSettings; + var pluginBaseUrls = defaultSettings.plugin_base_urls; + if (pluginBaseUrls !== undefined) { + each$1(pluginBaseUrls, function (pluginBaseUrl, pluginName) { + AddOnManager$1.PluginManager.urls[pluginName] = pluginBaseUrl; + }); + } + }, + init: function (settings) { + var self = this; + var result; + var invalidInlineTargets = Tools.makeMap('area base basefont br col frame hr img input isindex link meta param embed source wbr track ' + 'colgroup option table tbody tfoot thead tr th td script noscript style textarea video audio iframe object menu', ' '); + var isInvalidInlineTarget = function (settings, elm) { + return settings.inline && elm.tagName.toLowerCase() in invalidInlineTargets; + }; + var createId = function (elm) { + var id = elm.id; + if (!id) { + id = get(elm, 'name').filter(function (name) { + return !DOM$a.get(name); + }).getOrThunk(DOM$a.uniqueId); + elm.setAttribute('id', id); + } + return id; + }; + var execCallback = function (name) { + var callback = settings[name]; + if (!callback) { + return; + } + return callback.apply(self, Array.prototype.slice.call(arguments, 2)); + }; + var hasClass = function (elm, className) { + return className.constructor === RegExp ? className.test(elm.className) : DOM$a.hasClass(elm, className); + }; + var findTargets = function (settings) { + var targets = []; + if (Env.browser.isIE() && Env.browser.version.major < 11) { + initError('TinyMCE does not support the browser you are using. For a list of supported' + ' browsers please see: https://www.tinymce.com/docs/get-started/system-requirements/'); + return []; + } else if (isQuirksMode) { + initError('Failed to initialize the editor as the document is not in standards mode. ' + 'TinyMCE requires standards mode.'); + return []; + } + if (settings.types) { + each$j(settings.types, function (type) { + targets = targets.concat(DOM$a.select(type.selector)); + }); + return targets; + } else if (settings.selector) { + return DOM$a.select(settings.selector); + } else if (settings.target) { + return [settings.target]; + } + switch (settings.mode) { + case 'exact': + var l = settings.elements || ''; + if (l.length > 0) { + each$j(explode$4(l), function (id) { + var elm = DOM$a.get(id); + if (elm) { + targets.push(elm); + } else { + each$j(document.forms, function (f) { + each$j(f.elements, function (e) { + if (e.name === id) { + id = 'mce_editor_' + instanceCounter++; + DOM$a.setAttrib(e, 'id', id); + targets.push(e); + } + }); + }); + } + }); + } + break; + case 'textareas': + case 'specific_textareas': + each$j(DOM$a.select('textarea'), function (elm) { + if (settings.editor_deselector && hasClass(elm, settings.editor_deselector)) { + return; + } + if (!settings.editor_selector || hasClass(elm, settings.editor_selector)) { + targets.push(elm); + } + }); + break; + } + return targets; + }; + var provideResults = function (editors) { + result = editors; + }; + var initEditors = function () { + var initCount = 0; + var editors = []; + var targets; + var createEditor = function (id, settings, targetElm) { + var editor = new Editor(id, settings, self); + editors.push(editor); + editor.on('init', function () { + if (++initCount === targets.length) { + provideResults(editors); + } + }); + editor.targetElm = editor.targetElm || targetElm; + editor.render(); + }; + DOM$a.unbind(window, 'ready', initEditors); + execCallback('onpageload'); + targets = DomQuery.unique(findTargets(settings)); + if (settings.types) { + each$j(settings.types, function (type) { + Tools.each(targets, function (elm) { + if (DOM$a.is(elm, type.selector)) { + createEditor(createId(elm), extend$4({}, settings, type), elm); + return false; + } + return true; + }); + }); + return; + } + Tools.each(targets, function (elm) { + purgeDestroyedEditor(self.get(elm.id)); + }); + targets = Tools.grep(targets, function (elm) { + return !self.get(elm.id); + }); + if (targets.length === 0) { + provideResults([]); + } else { + each$j(targets, function (elm) { + if (isInvalidInlineTarget(settings, elm)) { + initError('Could not initialize inline editor on invalid inline target element', elm); + } else { + createEditor(createId(elm), settings, elm); + } + }); + } + }; + self.settings = settings; + DOM$a.bind(window, 'ready', initEditors); + return new promiseObj(function (resolve) { + if (result) { + resolve(result); + } else { + provideResults = function (editors) { + resolve(editors); + }; + } + }); + }, + get: function (id) { + if (arguments.length === 0) { + return editors.slice(0); + } else if (isString(id)) { + return find(editors, function (editor) { + return editor.id === id; + }).getOr(null); + } else if (isNumber(id)) { + return editors[id] ? editors[id] : null; + } else { + return null; + } + }, + add: function (editor) { + var self = this; + var existingEditor = legacyEditors[editor.id]; + if (existingEditor === editor) { + return editor; + } + if (self.get(editor.id) === null) { + if (isValidLegacyKey(editor.id)) { + legacyEditors[editor.id] = editor; + } + legacyEditors.push(editor); + editors.push(editor); + } + toggleGlobalEvents(true); + self.activeEditor = editor; + self.fire('AddEditor', { editor: editor }); + if (!beforeUnloadDelegate) { + beforeUnloadDelegate = function (e) { + var event = self.fire('BeforeUnload'); + if (event.returnValue) { + e.preventDefault(); + e.returnValue = event.returnValue; + return event.returnValue; + } + }; + window.addEventListener('beforeunload', beforeUnloadDelegate); + } + return editor; + }, + createEditor: function (id, settings) { + return this.add(new Editor(id, settings, this)); + }, + remove: function (selector) { + var self = this; + var i, editor; + if (!selector) { + for (i = editors.length - 1; i >= 0; i--) { + self.remove(editors[i]); + } + return; + } + if (isString(selector)) { + each$j(DOM$a.select(selector), function (elm) { + editor = self.get(elm.id); + if (editor) { + self.remove(editor); + } + }); + return; + } + editor = selector; + if (isNull(self.get(editor.id))) { + return null; + } + if (removeEditorFromList(editor)) { + self.fire('RemoveEditor', { editor: editor }); + } + if (editors.length === 0) { + window.removeEventListener('beforeunload', beforeUnloadDelegate); + } + editor.remove(); + toggleGlobalEvents(editors.length > 0); + return editor; + }, + execCommand: function (cmd, ui, value) { + var self = this, editor = self.get(value); + switch (cmd) { + case 'mceAddEditor': + if (!self.get(value)) { + new Editor(value, self.settings, self).render(); + } + return true; + case 'mceRemoveEditor': + if (editor) { + editor.remove(); + } + return true; + case 'mceToggleEditor': + if (!editor) { + self.execCommand('mceAddEditor', 0, value); + return true; + } + if (editor.isHidden()) { + editor.show(); + } else { + editor.hide(); + } + return true; + } + if (self.activeEditor) { + return self.activeEditor.execCommand(cmd, ui, value); + } + return false; + }, + triggerSave: function () { + each$j(editors, function (editor) { + editor.save(); + }); + }, + addI18n: function (code, items) { + I18n.add(code, items); + }, + translate: function (text) { + return I18n.translate(text); + }, + setActive: function (editor) { + var activeEditor = this.activeEditor; + if (this.activeEditor !== editor) { + if (activeEditor) { + activeEditor.fire('deactivate', { relatedTarget: editor }); + } + editor.fire('activate', { relatedTarget: activeEditor }); + } + this.activeEditor = editor; + }, + _setBaseUrl: function (baseUrl) { + this.baseURL = new URI(this.documentBaseURL).toAbsolute(baseUrl.replace(/\/+$/, '')); + this.baseURI = new URI(this.baseURL); + } + }); + EditorManager.setup(); + + var min = Math.min, max = Math.max, round$1 = Math.round; + var relativePosition = function (rect, targetRect, rel) { + var x = targetRect.x; + var y = targetRect.y; + var w = rect.w; + var h = rect.h; + var targetW = targetRect.w; + var targetH = targetRect.h; + var relChars = (rel || '').split(''); + if (relChars[0] === 'b') { + y += targetH; + } + if (relChars[1] === 'r') { + x += targetW; + } + if (relChars[0] === 'c') { + y += round$1(targetH / 2); + } + if (relChars[1] === 'c') { + x += round$1(targetW / 2); + } + if (relChars[3] === 'b') { + y -= h; + } + if (relChars[4] === 'r') { + x -= w; + } + if (relChars[3] === 'c') { + y -= round$1(h / 2); + } + if (relChars[4] === 'c') { + x -= round$1(w / 2); + } + return create$7(x, y, w, h); + }; + var findBestRelativePosition = function (rect, targetRect, constrainRect, rels) { + var pos, i; + for (i = 0; i < rels.length; i++) { + pos = relativePosition(rect, targetRect, rels[i]); + if (pos.x >= constrainRect.x && pos.x + pos.w <= constrainRect.w + constrainRect.x && pos.y >= constrainRect.y && pos.y + pos.h <= constrainRect.h + constrainRect.y) { + return rels[i]; + } + } + return null; + }; + var inflate = function (rect, w, h) { + return create$7(rect.x - w, rect.y - h, rect.w + w * 2, rect.h + h * 2); + }; + var intersect = function (rect, cropRect) { + var x1 = max(rect.x, cropRect.x); + var y1 = max(rect.y, cropRect.y); + var x2 = min(rect.x + rect.w, cropRect.x + cropRect.w); + var y2 = min(rect.y + rect.h, cropRect.y + cropRect.h); + if (x2 - x1 < 0 || y2 - y1 < 0) { + return null; + } + return create$7(x1, y1, x2 - x1, y2 - y1); + }; + var clamp$1 = function (rect, clampRect, fixedSize) { + var x1 = rect.x; + var y1 = rect.y; + var x2 = rect.x + rect.w; + var y2 = rect.y + rect.h; + var cx2 = clampRect.x + clampRect.w; + var cy2 = clampRect.y + clampRect.h; + var underflowX1 = max(0, clampRect.x - x1); + var underflowY1 = max(0, clampRect.y - y1); + var overflowX2 = max(0, x2 - cx2); + var overflowY2 = max(0, y2 - cy2); + x1 += underflowX1; + y1 += underflowY1; + if (fixedSize) { + x2 += underflowX1; + y2 += underflowY1; + x1 -= overflowX2; + y1 -= overflowY2; + } + x2 -= overflowX2; + y2 -= overflowY2; + return create$7(x1, y1, x2 - x1, y2 - y1); + }; + var create$7 = function (x, y, w, h) { + return { + x: x, + y: y, + w: w, + h: h + }; + }; + var fromClientRect = function (clientRect) { + return create$7(clientRect.left, clientRect.top, clientRect.width, clientRect.height); + }; + var Rect = { + inflate: inflate, + relativePosition: relativePosition, + findBestRelativePosition: findBestRelativePosition, + intersect: intersect, + clamp: clamp$1, + create: create$7, + fromClientRect: fromClientRect + }; + + var awaiter = function (resolveCb, rejectCb, timeout) { + if (timeout === void 0) { + timeout = 1000; + } + var done = false; + var timer = null; + var complete = function (completer) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!done) { + done = true; + if (timer !== null) { + clearTimeout(timer); + timer = null; + } + completer.apply(null, args); + } + }; + }; + var resolve = complete(resolveCb); + var reject = complete(rejectCb); + var start = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (!done && timer === null) { + timer = setTimeout(function () { + return reject.apply(null, args); + }, timeout); + } + }; + return { + start: start, + resolve: resolve, + reject: reject + }; + }; + var create$8 = function () { + var tasks = {}; + var resultFns = {}; + var load = function (id, url) { + var loadErrMsg = 'Script at URL "' + url + '" failed to load'; + var runErrMsg = 'Script at URL "' + url + '" did not call `tinymce.Resource.add(\'' + id + '\', data)` within 1 second'; + if (tasks[id] !== undefined) { + return tasks[id]; + } else { + var task = new promiseObj(function (resolve, reject) { + var waiter = awaiter(resolve, reject); + resultFns[id] = waiter.resolve; + ScriptLoader.ScriptLoader.loadScript(url, function () { + return waiter.start(runErrMsg); + }, function () { + return waiter.reject(loadErrMsg); + }); + }); + tasks[id] = task; + return task; + } + }; + var add = function (id, data) { + if (resultFns[id] !== undefined) { + resultFns[id](data); + delete resultFns[id]; + } + tasks[id] = promiseObj.resolve(data); + }; + return { + load: load, + add: add + }; + }; + var Resource = create$8(); + + var each$k = Tools.each, extend$5 = Tools.extend; + var extendClass, initializing; + var Class = function () { + }; + Class.extend = extendClass = function (props) { + var self = this; + var _super = self.prototype; + var Class = function () { + var i, mixins, mixin; + var self = this; + if (!initializing) { + if (self.init) { + self.init.apply(self, arguments); + } + mixins = self.Mixins; + if (mixins) { + i = mixins.length; + while (i--) { + mixin = mixins[i]; + if (mixin.init) { + mixin.init.apply(self, arguments); + } + } + } + } + }; + var dummy = function () { + return this; + }; + var createMethod = function (name, fn) { + return function () { + var self = this; + var tmp = self._super; + self._super = _super[name]; + var ret = fn.apply(self, arguments); + self._super = tmp; + return ret; + }; + }; + initializing = true; + var prototype = new self(); + initializing = false; + if (props.Mixins) { + each$k(props.Mixins, function (mixin) { + for (var name_1 in mixin) { + if (name_1 !== 'init') { + props[name_1] = mixin[name_1]; + } + } + }); + if (_super.Mixins) { + props.Mixins = _super.Mixins.concat(props.Mixins); + } + } + if (props.Methods) { + each$k(props.Methods.split(','), function (name) { + props[name] = dummy; + }); + } + if (props.Properties) { + each$k(props.Properties.split(','), function (name) { + var fieldName = '_' + name; + props[name] = function (value) { + var self = this; + if (value !== undefined) { + self[fieldName] = value; + return self; + } + return self[fieldName]; + }; + }); + } + if (props.Statics) { + each$k(props.Statics, function (func, name) { + Class[name] = func; + }); + } + if (props.Defaults && _super.Defaults) { + props.Defaults = extend$5({}, _super.Defaults, props.Defaults); + } + each$1(props, function (member, name) { + if (typeof member === 'function' && _super[name]) { + prototype[name] = createMethod(name, member); + } else { + prototype[name] = member; + } + }); + Class.prototype = prototype; + Class.constructor = Class; + Class.extend = extendClass; + return Class; + }; + + var min$1 = Math.min, max$1 = Math.max, round$2 = Math.round; + var Color = function (value) { + var self = {}; + var r = 0, g = 0, b = 0; + var rgb2hsv = function (r, g, b) { + var h, s, v; + h = 0; + s = 0; + v = 0; + r = r / 255; + g = g / 255; + b = b / 255; + var minRGB = min$1(r, min$1(g, b)); + var maxRGB = max$1(r, max$1(g, b)); + if (minRGB === maxRGB) { + v = minRGB; + return { + h: 0, + s: 0, + v: v * 100 + }; + } + var d = r === minRGB ? g - b : b === minRGB ? r - g : b - r; + h = r === minRGB ? 3 : b === minRGB ? 1 : 5; + h = 60 * (h - d / (maxRGB - minRGB)); + s = (maxRGB - minRGB) / maxRGB; + v = maxRGB; + return { + h: round$2(h), + s: round$2(s * 100), + v: round$2(v * 100) + }; + }; + var hsvToRgb = function (hue, saturation, brightness) { + hue = (parseInt(hue, 10) || 0) % 360; + saturation = parseInt(saturation, 10) / 100; + brightness = parseInt(brightness, 10) / 100; + saturation = max$1(0, min$1(saturation, 1)); + brightness = max$1(0, min$1(brightness, 1)); + if (saturation === 0) { + r = g = b = round$2(255 * brightness); + return; + } + var side = hue / 60; + var chroma = brightness * saturation; + var x = chroma * (1 - Math.abs(side % 2 - 1)); + var match = brightness - chroma; + switch (Math.floor(side)) { + case 0: + r = chroma; + g = x; + b = 0; + break; + case 1: + r = x; + g = chroma; + b = 0; + break; + case 2: + r = 0; + g = chroma; + b = x; + break; + case 3: + r = 0; + g = x; + b = chroma; + break; + case 4: + r = x; + g = 0; + b = chroma; + break; + case 5: + r = chroma; + g = 0; + b = x; + break; + default: + r = g = b = 0; + } + r = round$2(255 * (r + match)); + g = round$2(255 * (g + match)); + b = round$2(255 * (b + match)); + }; + var toHex = function () { + var hex = function (val) { + val = parseInt(val, 10).toString(16); + return val.length > 1 ? val : '0' + val; + }; + return '#' + hex(r) + hex(g) + hex(b); + }; + var toRgb = function () { + return { + r: r, + g: g, + b: b + }; + }; + var toHsv = function () { + return rgb2hsv(r, g, b); + }; + var parse = function (value) { + var matches; + if (typeof value === 'object') { + if ('r' in value) { + r = value.r; + g = value.g; + b = value.b; + } else if ('v' in value) { + hsvToRgb(value.h, value.s, value.v); + } + } else { + if (matches = /rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)[^\)]*\)/gi.exec(value)) { + r = parseInt(matches[1], 10); + g = parseInt(matches[2], 10); + b = parseInt(matches[3], 10); + } else if (matches = /#([0-F]{2})([0-F]{2})([0-F]{2})/gi.exec(value)) { + r = parseInt(matches[1], 16); + g = parseInt(matches[2], 16); + b = parseInt(matches[3], 16); + } else if (matches = /#([0-F])([0-F])([0-F])/gi.exec(value)) { + r = parseInt(matches[1] + matches[1], 16); + g = parseInt(matches[2] + matches[2], 16); + b = parseInt(matches[3] + matches[3], 16); + } + } + r = r < 0 ? 0 : r > 255 ? 255 : r; + g = g < 0 ? 0 : g > 255 ? 255 : g; + b = b < 0 ? 0 : b > 255 ? 255 : b; + return self; + }; + if (value) { + parse(value); + } + self.toRgb = toRgb; + self.toHsv = toHsv; + self.toHex = toHex; + self.parse = parse; + return self; + }; + + var serialize = function (obj) { + var data = JSON.stringify(obj); + if (!isString(data)) { + return data; + } + return data.replace(/[\u0080-\uFFFF]/g, function (match) { + var hexCode = match.charCodeAt(0).toString(16); + return '\\u' + '0000'.substring(hexCode.length) + hexCode; + }); + }; + var JSONUtils = { + serialize: serialize, + parse: function (text) { + try { + return JSON.parse(text); + } catch (ex) { + } + } + }; + + var JSONP = { + callbacks: {}, + count: 0, + send: function (settings) { + var self = this, dom = DOMUtils$1.DOM, count = settings.count !== undefined ? settings.count : self.count; + var id = 'tinymce_jsonp_' + count; + self.callbacks[count] = function (json) { + dom.remove(id); + delete self.callbacks[count]; + settings.callback(json); + }; + dom.add(dom.doc.body, 'script', { + id: id, + src: settings.url, + type: 'text/javascript' + }); + self.count++; + } + }; + + var XHR = __assign(__assign({}, Observable), { + send: function (settings) { + var xhr, count = 0; + var ready = function () { + if (!settings.async || xhr.readyState === 4 || count++ > 10000) { + if (settings.success && count < 10000 && xhr.status === 200) { + settings.success.call(settings.success_scope, '' + xhr.responseText, xhr, settings); + } else if (settings.error) { + settings.error.call(settings.error_scope, count > 10000 ? 'TIMED_OUT' : 'GENERAL', xhr, settings); + } + xhr = null; + } else { + Delay.setTimeout(ready, 10); + } + }; + settings.scope = settings.scope || this; + settings.success_scope = settings.success_scope || settings.scope; + settings.error_scope = settings.error_scope || settings.scope; + settings.async = settings.async !== false; + settings.data = settings.data || ''; + XHR.fire('beforeInitialize', { settings: settings }); + xhr = new XMLHttpRequest(); + if (xhr.overrideMimeType) { + xhr.overrideMimeType(settings.content_type); + } + xhr.open(settings.type || (settings.data ? 'POST' : 'GET'), settings.url, settings.async); + if (settings.crossDomain) { + xhr.withCredentials = true; + } + if (settings.content_type) { + xhr.setRequestHeader('Content-Type', settings.content_type); + } + if (settings.requestheaders) { + Tools.each(settings.requestheaders, function (header) { + xhr.setRequestHeader(header.key, header.value); + }); + } + xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + xhr = XHR.fire('beforeSend', { + xhr: xhr, + settings: settings + }).xhr; + xhr.send(settings.data); + if (!settings.async) { + return ready(); + } + Delay.setTimeout(ready, 10); + } + }); + + var extend$6 = Tools.extend; + var JSONRequest = function () { + function JSONRequest(settings) { + this.settings = extend$6({}, settings); + this.count = 0; + } + JSONRequest.sendRPC = function (o) { + return new JSONRequest().send(o); + }; + JSONRequest.prototype.send = function (args) { + var ecb = args.error, scb = args.success; + var xhrArgs = extend$6(this.settings, args); + xhrArgs.success = function (c, x) { + c = JSONUtils.parse(c); + if (typeof c === 'undefined') { + c = { error: 'JSON Parse error.' }; + } + if (c.error) { + ecb.call(xhrArgs.error_scope || xhrArgs.scope, c.error, x); + } else { + scb.call(xhrArgs.success_scope || xhrArgs.scope, c.result); + } + }; + xhrArgs.error = function (ty, x) { + if (ecb) { + ecb.call(xhrArgs.error_scope || xhrArgs.scope, ty, x); + } + }; + xhrArgs.data = JSONUtils.serialize({ + id: args.id || 'c' + this.count++, + method: args.method, + params: args.params + }); + xhrArgs.content_type = 'application/json'; + XHR.send(xhrArgs); + }; + return JSONRequest; + }(); + + var create$9 = function () { + return function () { + var data = {}; + var keys = []; + var storage = { + getItem: function (key) { + var item = data[key]; + return item ? item : null; + }, + setItem: function (key, value) { + keys.push(key); + data[key] = String(value); + }, + key: function (index) { + return keys[index]; + }, + removeItem: function (key) { + keys = keys.filter(function (k) { + return k === key; + }); + delete data[key]; + }, + clear: function () { + keys = []; + data = {}; + }, + length: 0 + }; + Object.defineProperty(storage, 'length', { + get: function () { + return keys.length; + }, + configurable: false, + enumerable: false + }); + return storage; + }(); + }; + + var localStorage; + try { + var test = '__storage_test__'; + localStorage = window.localStorage; + localStorage.setItem(test, test); + localStorage.removeItem(test); + } catch (e) { + localStorage = create$9(); + } + var LocalStorage = localStorage; + + var publicApi = { + geom: { Rect: Rect }, + util: { + Promise: promiseObj, + Delay: Delay, + Tools: Tools, + VK: VK, + URI: URI, + Class: Class, + EventDispatcher: EventDispatcher, + Observable: Observable, + I18n: I18n, + XHR: XHR, + JSON: JSONUtils, + JSONRequest: JSONRequest, + JSONP: JSONP, + LocalStorage: LocalStorage, + Color: Color + }, + dom: { + EventUtils: EventUtils, + Sizzle: Sizzle, + DomQuery: DomQuery, + TreeWalker: DomTreeWalker, + TextSeeker: TextSeeker, + DOMUtils: DOMUtils$1, + ScriptLoader: ScriptLoader, + RangeUtils: RangeUtils$1, + Serializer: DomSerializer, + StyleSheetLoader: StyleSheetLoader, + ControlSelection: ControlSelection, + BookmarkManager: BookmarkManager$1, + Selection: EditorSelection, + Event: EventUtils.Event + }, + html: { + Styles: Styles, + Entities: Entities, + Node: AstNode, + Schema: Schema, + SaxParser: SaxParser$1, + DomParser: DomParser, + Writer: Writer, + Serializer: HtmlSerializer + }, + Env: Env, + AddOnManager: AddOnManager$1, + Annotator: Annotator, + Formatter: Formatter, + UndoManager: UndoManager, + EditorCommands: EditorCommands, + WindowManager: WindowManager, + NotificationManager: NotificationManager, + EditorObservable: EditorObservable, + Shortcuts: Shortcuts, + Editor: Editor, + FocusManager: FocusManager, + EditorManager: EditorManager, + DOM: DOMUtils$1.DOM, + ScriptLoader: ScriptLoader.ScriptLoader, + PluginManager: PluginManager, + ThemeManager: ThemeManager, + IconManager: IconManager, + Resource: Resource, + trim: Tools.trim, + isArray: Tools.isArray, + is: Tools.is, + toArray: Tools.toArray, + makeMap: Tools.makeMap, + each: Tools.each, + map: Tools.map, + grep: Tools.grep, + inArray: Tools.inArray, + extend: Tools.extend, + create: Tools.create, + walk: Tools.walk, + createNS: Tools.createNS, + resolve: Tools.resolve, + explode: Tools.explode, + _addCacheSuffix: Tools._addCacheSuffix, + isOpera: Env.opera, + isWebKit: Env.webkit, + isIE: Env.ie, + isGecko: Env.gecko, + isMac: Env.mac + }; + var tinymce = Tools.extend(EditorManager, publicApi); + + var exportToModuleLoaders = function (tinymce) { + if (typeof module === 'object') { + try { + module.exports = tinymce; + } catch (_) { + } + } + }; + var exportToWindowGlobal = function (tinymce) { + window.tinymce = tinymce; + window.tinyMCE = tinymce; + }; + exportToWindowGlobal(tinymce); + exportToModuleLoaders(tinymce); + +}()); diff --git a/common/static/js/vendor/tinymce/js/tinymce/tinymce.min.js b/common/static/js/vendor/tinymce/js/tinymce/tinymce.min.js index 7ae335411716..67bc924eb742 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/tinymce.min.js +++ b/common/static/js/vendor/tinymce/js/tinymce/tinymce.min.js @@ -1,10 +1,9 @@ -// 4.0.20 (2014-03-18) -!function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;ir;r++)if(o=n[r],o&&o.func.call(o.scope,e)===!1&&e.preventDefault(),e.isImmediatePropagationStopped())return}var a=this,s={},l,c,u,d,f;c=o+(+new Date).toString(32),d="onmouseenter"in document.documentElement,u="onfocusin"in document.documentElement,f={mouseenter:"mouseover",mouseleave:"mouseout"},l=1,a.domLoaded=!1,a.events=s,a.bind=function(t,o,p,m){function h(e){i(n(e||_.event),g)}var g,v,y,b,C,x,w,_=window;if(t&&3!==t.nodeType&&8!==t.nodeType){for(t[c]?g=t[c]:(g=l++,t[c]=g,s[g]={}),m=m||t,o=o.split(" "),y=o.length;y--;)b=o[y],x=h,C=w=!1,"DOMContentLoaded"===b&&(b="ready"),a.domLoaded&&"ready"===b&&"complete"==t.readyState?p.call(m,n({type:b})):(d||(C=f[b],C&&(x=function(e){var t,r;if(t=e.currentTarget,r=e.relatedTarget,r&&t.contains)r=t.contains(r);else for(;r&&r!==t;)r=r.parentNode;r||(e=n(e||_.event),e.type="mouseout"===e.type?"mouseleave":"mouseenter",e.target=t,i(e,g))})),u||"focusin"!==b&&"focusout"!==b||(w=!0,C="focusin"===b?"focus":"blur",x=function(e){e=n(e||_.event),e.type="focus"===e.type?"focusin":"focusout",i(e,g)}),v=s[g][b],v?"ready"===b&&a.domLoaded?p({type:b}):v.push({func:p,scope:m}):(s[g][b]=v=[{func:p,scope:m}],v.fakeName=C,v.capture=w,v.nativeHandler=x,"ready"===b?r(t,x,a):e(t,C||b,x,w)));return t=v=0,p}},a.unbind=function(e,n,r){var i,o,l,u,d,f;if(!e||3===e.nodeType||8===e.nodeType)return a;if(i=e[c]){if(f=s[i],n){for(n=n.split(" "),l=n.length;l--;)if(d=n[l],o=f[d]){if(r)for(u=o.length;u--;)if(o[u].func===r){var p=o.nativeHandler,m=o.fakeName,h=o.capture;o=o.slice(0,u).concat(o.slice(u+1)),o.nativeHandler=p,o.fakeName=m,o.capture=h,f[d]=o}r&&0!==o.length||(delete f[d],t(e,o.fakeName||d,o.nativeHandler,o.capture))}}else{for(d in f)o=f[d],t(e,o.fakeName||d,o.nativeHandler,o.capture);f={}}for(d in f)return a;delete s[i];try{delete e[c]}catch(g){e[c]=null}}return a},a.fire=function(e,t,r){var o;if(!e||3===e.nodeType||8===e.nodeType)return a;r=n(null,r),r.type=t,r.target=e;do o=e[c],o&&i(r,o),e=e.parentNode||e.ownerDocument||e.defaultView||e.parentWindow;while(e&&!r.isPropagationStopped());return a},a.clean=function(e){var t,n,r=a.unbind;if(!e||3===e.nodeType||8===e.nodeType)return a;if(e[c]&&r(e),e.getElementsByTagName||(e=e.document),e&&e.getElementsByTagName)for(r(e),n=e.getElementsByTagName("*"),t=n.length;t--;)e=n[t],e[c]&&r(e);return a},a.destroy=function(){s={}},a.cancel=function(e){return e&&(e.preventDefault(),e.stopImmediatePropagation()),!1}}var o="mce-data-",a=/^(?:mouse|contextmenu)|click/,s={keyLocation:1,layerX:1,layerY:1,returnValue:1};return i.Event=new i,i.Event.bind(window,"ready",function(){}),i}),r(c,[],function(){function e(e){return ht.test(e+"")}function n(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>_.cacheLength&&delete e[t.shift()],e[n]=r,r}}function r(e){return e[I]=!0,e}function i(e){var t=B.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t=null}}function o(e,t,n,r){var i,o,a,s,l,c,f,p,m,h;if((t?t.ownerDocument||t:F)!==B&&A(t),t=t||B,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(D&&!r){if(i=gt.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&O(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return Z.apply(n,t.getElementsByTagName(e)),n;if((a=i[3])&&z.getElementsByClassName&&t.getElementsByClassName)return Z.apply(n,t.getElementsByClassName(a)),n}if(z.qsa&&!M.test(e)){if(f=!0,p=I,m=t,h=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){for(c=u(e),(f=t.getAttribute("id"))?p=f.replace(bt,"\\$&"):t.setAttribute("id",p),p="[id='"+p+"'] ",l=c.length;l--;)c[l]=p+d(c[l]);m=mt.test(e)&&t.parentNode||t,h=c.join(",")}if(h)try{return Z.apply(n,m.querySelectorAll(h)),n}catch(g){}finally{f||t.removeAttribute("id")}}}return b(e.replace(lt,"$1"),t,n,r)}function a(e,t){var n=t&&e,r=n&&(~t.sourceIndex||G)-(~e.sourceIndex||G);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function l(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function c(e){return r(function(t){return t=+t,r(function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}function u(e,t){var n,r,i,a,s,l,c,u=q[e+" "];if(u)return t?0:u.slice(0);for(s=e,l=[],c=_.preFilter;s;){(!n||(r=ct.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=ut.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(lt," ")}),s=s.slice(n.length));for(a in _.filter)!(r=pt[a].exec(s))||c[a]&&!(r=c[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?o.error(e):q(e,l).slice(0)}function d(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function f(e,t,n){var r=t.dir,i=n&&"parentNode"===r,o=V++;return t.first?function(t,n,o){for(;t=t[r];)if(1===t.nodeType||i)return e(t,n,o)}:function(t,n,a){var s,l,c,u=W+" "+o;if(a){for(;t=t[r];)if((1===t.nodeType||i)&&e(t,n,a))return!0}else for(;t=t[r];)if(1===t.nodeType||i)if(c=t[I]||(t[I]={}),(l=c[r])&&l[0]===u){if((s=l[1])===!0||s===w)return s===!0}else if(l=c[r]=[u],l[1]=e(t,n,a)||w,l[1]===!0)return!0}}function p(e){return e.length>1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function m(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),c&&t.push(s));return a}function h(e,t,n,i,o,a){return i&&!i[I]&&(i=h(i)),o&&!o[I]&&(o=h(o,a)),r(function(r,a,s,l){var c,u,d,f=[],p=[],h=a.length,g=r||y(t||"*",s.nodeType?[s]:s,[]),v=!e||!r&&t?g:m(g,f,e,s,l),b=n?o||(r?e:h||i)?[]:a:v;if(n&&n(v,b,s,l),i)for(c=m(b,p),i(c,[],s,l),u=c.length;u--;)(d=c[u])&&(b[p[u]]=!(v[p[u]]=d));if(r){if(o||e){if(o){for(c=[],u=b.length;u--;)(d=b[u])&&c.push(v[u]=d);o(null,b=[],c,l)}for(u=b.length;u--;)(d=b[u])&&(c=o?tt.call(r,d):f[u])>-1&&(r[c]=!(a[c]=d))}}else b=m(b===a?b.splice(h,b.length):b),o?o(null,a,b,l):Z.apply(a,b)})}function g(e){for(var t,n,r,i=e.length,o=_.relative[e[0].type],a=o||_.relative[" "],s=o?1:0,l=f(function(e){return e===t},a,!0),c=f(function(e){return tt.call(t,e)>-1},a,!0),u=[function(e,n,r){return!o&&(r||n!==k)||((t=n).nodeType?l(e,n,r):c(e,n,r))}];i>s;s++)if(n=_.relative[e[s].type])u=[f(p(u),n)];else{if(n=_.filter[e[s].type].apply(null,e[s].matches),n[I]){for(r=++s;i>r&&!_.relative[e[r].type];r++);return h(s>1&&p(u),s>1&&d(e.slice(0,s-1)).replace(lt,"$1"),n,r>s&&g(e.slice(s,r)),i>r&&g(e=e.slice(r)),i>r&&d(e))}u.push(n)}return p(u)}function v(e,t){var n=0,i=t.length>0,a=e.length>0,s=function(r,s,l,c,u){var d,f,p,h=[],g=0,v="0",y=r&&[],b=null!=u,C=k,x=r||a&&_.find.TAG("*",u&&s.parentNode||s),N=W+=null==C?1:Math.random()||.1;for(b&&(k=s!==B&&s,w=n);null!=(d=x[v]);v++){if(a&&d){for(f=0;p=e[f++];)if(p(d,s,l)){c.push(d);break}b&&(W=N,w=++n)}i&&((d=!p&&d)&&g--,r&&y.push(d))}if(g+=v,i&&v!==g){for(f=0;p=t[f++];)p(y,h,s,l);if(r){if(g>0)for(;v--;)y[v]||h[v]||(h[v]=J.call(c));h=m(h)}Z.apply(c,h),b&&!r&&h.length>0&&g+t.length>1&&o.uniqueSort(c)}return b&&(W=N,k=C),y};return i?r(s):s}function y(e,t,n){for(var r=0,i=t.length;i>r;r++)o(e,t[r],n);return n}function b(e,t,n,r){var i,o,a,s,l,c=u(e);if(!r&&1===c.length){if(o=c[0]=c[0].slice(0),o.length>2&&"ID"===(a=o[0]).type&&9===t.nodeType&&D&&_.relative[o[1].type]){if(t=(_.find.ID(a.matches[0].replace(xt,wt),t)||[])[0],!t)return n;e=e.slice(o.shift().value.length)}for(i=pt.needsContext.test(e)?0:o.length;i--&&(a=o[i],!_.relative[s=a.type]);)if((l=_.find[s])&&(r=l(a.matches[0].replace(xt,wt),mt.test(o[0].type)&&t.parentNode||t))){if(o.splice(i,1),e=r.length&&d(o),!e)return Z.apply(n,r),n;break}}return S(e,c)(r,t,!D,n,mt.test(e)),n}function C(){}var x,w,_,N,E,S,k,T,R,A,B,L,D,M,H,P,O,I="sizzle"+-new Date,F=window.document,z={},W=0,V=0,U=n(),q=n(),$=n(),j=!1,K=function(){return 0},Y=typeof t,G=1<<31,X=[],J=X.pop,Q=X.push,Z=X.push,et=X.slice,tt=X.indexOf||function(e){for(var t=0,n=this.length;n>t;t++)if(this[t]===e)return t;return-1},nt="[\\x20\\t\\r\\n\\f]",rt="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",it=rt.replace("w","w#"),ot="([*^$|!~]?=)",at="\\["+nt+"*("+rt+")"+nt+"*(?:"+ot+nt+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+it+")|)|)"+nt+"*\\]",st=":("+rt+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+at.replace(3,8)+")*)|.*)\\)|)",lt=new RegExp("^"+nt+"+|((?:^|[^\\\\])(?:\\\\.)*)"+nt+"+$","g"),ct=new RegExp("^"+nt+"*,"+nt+"*"),ut=new RegExp("^"+nt+"*([\\x20\\t\\r\\n\\f>+~])"+nt+"*"),dt=new RegExp(st),ft=new RegExp("^"+it+"$"),pt={ID:new RegExp("^#("+rt+")"),CLASS:new RegExp("^\\.("+rt+")"),NAME:new RegExp("^\\[name=['\"]?("+rt+")['\"]?\\]"),TAG:new RegExp("^("+rt.replace("w","w*")+")"),ATTR:new RegExp("^"+at),PSEUDO:new RegExp("^"+st),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+nt+"*(even|odd|(([+-]|)(\\d*)n|)"+nt+"*(?:([+-]|)"+nt+"*(\\d+)|))"+nt+"*\\)|)","i"),needsContext:new RegExp("^"+nt+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+nt+"*((?:-\\d)?\\d*)"+nt+"*\\)|)(?=[^-]|$)","i")},mt=/[\x20\t\r\n\f]*[+~]/,ht=/^[^{]+\{\s*\[native code/,gt=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,vt=/^(?:input|select|textarea|button)$/i,yt=/^h\d$/i,bt=/'|\\/g,Ct=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,xt=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,wt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)};try{Z.apply(X=et.call(F.childNodes),F.childNodes),X[F.childNodes.length].nodeType}catch(_t){Z={apply:X.length?function(e,t){Q.apply(e,et.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}E=o.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},A=o.setDocument=function(n){var r=n?n.ownerDocument||n:F;return r!==B&&9===r.nodeType&&r.documentElement?(B=r,L=r.documentElement,D=!E(r),z.getElementsByTagName=i(function(e){return e.appendChild(r.createComment("")),!e.getElementsByTagName("*").length}),z.attributes=i(function(e){e.innerHTML="";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),z.getElementsByClassName=i(function(e){return e.innerHTML="",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),z.getByName=i(function(e){e.id=I+0,e.appendChild(B.createElement("a")).setAttribute("name",I),e.appendChild(B.createElement("i")).setAttribute("name",I),L.appendChild(e);var t=r.getElementsByName&&r.getElementsByName(I).length===2+r.getElementsByName(I+0).length;return L.removeChild(e),t}),z.sortDetached=i(function(e){return e.compareDocumentPosition&&1&e.compareDocumentPosition(B.createElement("div"))}),_.attrHandle=i(function(e){return e.innerHTML="",e.firstChild&&typeof e.firstChild.getAttribute!==Y&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},z.getByName?(_.find.ID=function(e,t){if(typeof t.getElementById!==Y&&D){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},_.filter.ID=function(e){var t=e.replace(xt,wt);return function(e){return e.getAttribute("id")===t}}):(_.find.ID=function(e,n){if(typeof n.getElementById!==Y&&D){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==Y&&r.getAttributeNode("id").value===e?[r]:t:[]}},_.filter.ID=function(e){var t=e.replace(xt,wt);return function(e){var n=typeof e.getAttributeNode!==Y&&e.getAttributeNode("id");return n&&n.value===t}}),_.find.TAG=z.getElementsByTagName?function(e,t){return typeof t.getElementsByTagName!==Y?t.getElementsByTagName(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){for(;n=o[i++];)1===n.nodeType&&r.push(n);return r}return o},_.find.NAME=z.getByName&&function(e,t){return typeof t.getElementsByName!==Y?t.getElementsByName(name):void 0},_.find.CLASS=z.getElementsByClassName&&function(e,t){return typeof t.getElementsByClassName!==Y&&D?t.getElementsByClassName(e):void 0},H=[],M=[":focus"],(z.qsa=e(r.querySelectorAll))&&(i(function(e){e.innerHTML="",e.querySelectorAll("[selected]").length||M.push("\\["+nt+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||M.push(":checked")}),i(function(e){e.innerHTML="",e.querySelectorAll("[i^='']").length&&M.push("[*^$]="+nt+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||M.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),M.push(",.*:")})),(z.matchesSelector=e(P=L.matchesSelector||L.mozMatchesSelector||L.webkitMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&i(function(e){z.disconnectedMatch=P.call(e,"div"),P.call(e,"[s!='']:x"),H.push("!=",st)}),M=new RegExp(M.join("|")),H=H.length&&new RegExp(H.join("|")),O=e(L.contains)||L.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},K=L.compareDocumentPosition?function(e,t){if(e===t)return j=!0,0;var n=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return n?1&n||T&&t.compareDocumentPosition(e)===n?e===r||O(F,e)?-1:t===r||O(F,t)?1:R?tt.call(R,e)-tt.call(R,t):0:4&n?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var n,i=0,o=e.parentNode,s=t.parentNode,l=[e],c=[t];if(e===t)return j=!0,0;if(!o||!s)return e===r?-1:t===r?1:o?-1:s?1:0;if(o===s)return a(e,t);for(n=e;n=n.parentNode;)l.unshift(n);for(n=t;n=n.parentNode;)c.unshift(n);for(;l[i]===c[i];)i++;return i?a(l[i],c[i]):l[i]===F?-1:c[i]===F?1:0},B):B},o.matches=function(e,t){return o(e,null,null,t)},o.matchesSelector=function(e,t){if((e.ownerDocument||e)!==B&&A(e),t=t.replace(Ct,"='$1']"),z.matchesSelector&&D&&(!H||!H.test(t))&&!M.test(t))try{var n=P.call(e,t);if(n||z.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return o(t,B,null,[e]).length>0},o.contains=function(e,t){return(e.ownerDocument||e)!==B&&A(e),O(e,t)},o.attr=function(e,t){var n;return(e.ownerDocument||e)!==B&&A(e),D&&(t=t.toLowerCase()),(n=_.attrHandle[t])?n(e):!D||z.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},o.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},o.uniqueSort=function(e){var t,n=[],r=0,i=0;if(j=!z.detectDuplicates,T=!z.sortDetached,R=!z.sortStable&&e.slice(0),e.sort(K),j){for(;t=e[i++];)t===e[i]&&(r=n.push(i));for(;r--;)e.splice(n[r],1)}return e},N=o.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=N(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=N(t);return n},_=o.selectors={cacheLength:50,createPseudo:r,match:pt,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(xt,wt),e[3]=(e[4]||e[5]||"").replace(xt,wt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||o.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&o.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return pt.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&dt.test(n)&&(t=u(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(xt,wt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=U[e+" "];return t||(t=new RegExp("(^|"+nt+")"+e+"("+nt+"|$)"))&&U(e,function(e){return t.test(e.className||typeof e.getAttribute!==Y&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=o.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,d,f,p,m,h=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),y=!l&&!s;if(g){if(o){for(;h;){for(d=t;d=d[h];)if(s?d.nodeName.toLowerCase()===v:1===d.nodeType)return!1;m=h="only"===e&&!m&&"nextSibling"}return!0}if(m=[a?g.firstChild:g.lastChild],a&&y){for(u=g[I]||(g[I]={}),c=u[e]||[],p=c[0]===W&&c[1],f=c[0]===W&&c[2],d=p&&g.childNodes[p];d=++p&&d&&d[h]||(f=p=0)||m.pop();)if(1===d.nodeType&&++f&&d===t){u[e]=[W,p,f];break}}else if(y&&(c=(t[I]||(t[I]={}))[e])&&c[0]===W)f=c[1];else for(;(d=++p&&d&&d[h]||(f=p=0)||m.pop())&&((s?d.nodeName.toLowerCase()!==v:1!==d.nodeType)||!++f||(y&&((d[I]||(d[I]={}))[e]=[W,f]),d!==t)););return f-=i,f===r||f%r===0&&f/r>=0}}},PSEUDO:function(e,t){var n,i=_.pseudos[e]||_.setFilters[e.toLowerCase()]||o.error("unsupported pseudo: "+e);return i[I]?i(t):i.length>1?(n=[e,e,"",t],_.setFilters.hasOwnProperty(e.toLowerCase())?r(function(e,n){for(var r,o=i(e,t),a=o.length;a--;)r=tt.call(e,o[a]),e[r]=!(n[r]=o[a])}):function(e){return i(e,0,n)}):i}},pseudos:{not:r(function(e){var t=[],n=[],i=S(e.replace(lt,"$1"));return i[I]?r(function(e,t,n,r){for(var o,a=i(e,null,r,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,r,o){return t[0]=e,i(t,null,o,n),!n.pop()}}),has:r(function(e){return function(t){return o(e,t).length>0}}),contains:r(function(e){return function(t){return(t.textContent||t.innerText||N(t)).indexOf(e)>-1}}),lang:r(function(e){return ft.test(e||"")||o.error("unsupported lang: "+e),e=e.replace(xt,wt).toLowerCase(),function(t){var n;do if(n=D?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(e){var t=window.location&&window.location.hash;return t&&t.slice(1)===e.id},root:function(e){return e===L},focus:function(e){return e===B.activeElement&&(!B.hasFocus||B.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!_.pseudos.empty(e)},header:function(e){return yt.test(e.nodeName)},input:function(e){return vt.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:c(function(){return[0]}),last:c(function(e,t){return[t-1]}),eq:c(function(e,t,n){return[0>n?n+t:n]}),even:c(function(e,t){for(var n=0;t>n;n+=2)e.push(n);return e}),odd:c(function(e,t){for(var n=1;t>n;n+=2)e.push(n);return e}),lt:c(function(e,t,n){for(var r=0>n?n+t:n;--r>=0;)e.push(r);return e}),gt:c(function(e,t,n){for(var r=0>n?n+t:n;++rn;n++)t[n]=e[n];return t}function f(e,t){var n;if(t.indexOf)return t.indexOf(e);for(n=t.length;n--;)if(t[n]===e)return n;return-1}function p(e){return null===e||e===t?"":(""+e).replace(N,"")}function m(e,t){var n,r,i,o,a;if(e)if(n=e.length,n===o){for(r in e)if(e.hasOwnProperty(r)&&(a=e[r],t.call(a,a,r)===!1))break}else for(i=0;n>i&&(a=e[i],t.call(a,a,r)!==!1);i++);return e}function h(e,n,r){for(var i=[],o=e[n];o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!c(o).is(r));)1===o.nodeType&&i.push(o),o=o[n];return i}function g(e,t,n,r){for(var i=[];e;e=e[n])r&&e.nodeType!==r||e===t||i.push(e);return i}var v=document,y=Array.prototype.push,b=Array.prototype.slice,C=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,x=e.Event,w=l("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"),_=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},N=/^\s*|\s*$/g;return c.fn=c.prototype={constructor:c,selector:"",length:0,init:function(e,t){var n=this,r,a;if(!e)return n;if(e.nodeType)return n.context=n[0]=e,n.length=1,n;if(i(e)){if(r="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:C.exec(e),!r)return c(t||document).find(e);if(r[1])for(a=o(e).firstChild;a;)this.add(a),a=a.nextSibling;else{if(a=v.getElementById(r[2]),a.id!==r[2])return n.find(e);n.length=1,n[0]=a}}else this.add(e);return n},toArray:function(){return d(this)},add:function(e){var t=this;return _(e)?y.apply(t,e):e instanceof c?t.add(e.toArray()):y.call(t,e),t},attr:function(e,n){var i=this;if("object"==typeof e)m(e,function(e,t){i.attr(t,e)});else{if(!r(n))return i[0]&&1===i[0].nodeType?i[0].getAttribute(e):t;this.each(function(){1===this.nodeType&&this.setAttribute(e,n)})}return i},css:function(e,n){var i=this;if("object"==typeof e)m(e,function(e,t){i.css(t,e)});else{if(e=e.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),!r(n))return i[0]?i[0].style[e]:t;"number"!=typeof n||w[e]||(n+="px"),i.each(function(){var t=this.style;"opacity"===e&&this.runtimeStyle&&"undefined"==typeof this.runtimeStyle.opacity&&(t.filter=""===n?"":"alpha(opacity="+100*n+")");try{t[e]=n}catch(r){}})}return i},remove:function(){for(var e=this,t,n=this.length;n--;)t=e[n],x.clean(t),t.parentNode&&t.parentNode.removeChild(t);return this},empty:function(){for(var e=this,t,n=this.length;n--;)for(t=e[n];t.firstChild;)t.removeChild(t.firstChild);return this},html:function(e){var t=this,n;if(r(e)){for(n=t.length;n--;)t[n].innerHTML=e;return t}return t[0]?t[0].innerHTML:""},text:function(e){var t=this,n;if(r(e)){for(n=t.length;n--;)t[n].innerText=t[0].textContent=e;return t}return t[0]?t[0].innerText||t[0].textContent:""},append:function(){return a(this,arguments,function(e){1===this.nodeType&&this.appendChild(e)})},prepend:function(){return a(this,arguments,function(e){1===this.nodeType&&this.insertBefore(e,this.firstChild)})},before:function(){var e=this;return e[0]&&e[0].parentNode?a(e,arguments,function(e){this.parentNode.insertBefore(e,this.nextSibling)}):e},after:function(){var e=this;return e[0]&&e[0].parentNode?a(e,arguments,function(e){this.parentNode.insertBefore(e,this)}):e},appendTo:function(e){return c(e).append(this),this},addClass:function(e){return this.toggleClass(e,!0)},removeClass:function(e){return this.toggleClass(e,!1)},toggleClass:function(e,t){var n=this;return-1!==e.indexOf(" ")?m(e.split(" "),function(){n.toggleClass(this,t)}):n.each(function(n){var r;s(n,e)!==t&&(r=n.className,t?n.className+=r?" "+e:e:n.className=p((" "+r+" ").replace(" "+e+" "," ")))}),n},hasClass:function(e){return s(this[0],e)},each:function(e){return m(this,e)},on:function(e,t){return this.each(function(){x.bind(this,e,t)})},off:function(e,t){return this.each(function(){x.unbind(this,e,t)})},show:function(){return this.css("display","")},hide:function(){return this.css("display","none")},slice:function(){return new c(b.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},replaceWith:function(e){var t=this;return t[0]&&t[0].parentNode.replaceChild(c(e)[0],t[0]),t},wrap:function(e){return e=c(e)[0],this.each(function(){var t=this,n=e.cloneNode(!1);t.parentNode.insertBefore(n,t),n.appendChild(t)})},unwrap:function(){return this.each(function(){for(var e=this,t=e.firstChild,n;t;)n=t,t=t.nextSibling,e.parentNode.insertBefore(n,e)})},clone:function(){var e=[];return this.each(function(){e.push(this.cloneNode(!0))}),c(e)},find:function(e){var t,n,r=[];for(t=0,n=this.length;n>t;t++)c.find(e,this[t],r);return c(r)},push:y,sort:[].sort,splice:[].splice},u(c,{extend:u,toArray:d,inArray:f,isArray:_,each:m,trim:p,makeMap:l,find:n,expr:n.selectors,unique:n.uniqueSort,text:n.getText,isXMLDoc:n.isXML,contains:n.contains,filter:function(e,t,n){return n&&(e=":not("+e+")"),t=1===t.length?c.find.matchesSelector(t[0],e)?[t[0]]:[]:c.find.matches(e,t)}}),m({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return h(e,"parentNode")},parentsUntil:function(e,t){return h(e,"parentNode",t)},next:function(e){return g(e,"nextSibling",1)},prev:function(e){return g(e,"previousSibling",1)},nextNodes:function(e){return g(e,"nextSibling")},prevNodes:function(e){return g(e,"previousSibling")},children:function(e){return g(e.firstChild,"nextSibling",1)},contents:function(e){return d(("iframe"===e.nodeName?e.contentDocument||e.contentWindow.document:e).childNodes)}},function(e,t){c.fn[e]=function(n){var r=this,i;if(r.length>1)throw new Error("DomQuery only supports traverse functions on a single node.");return r[0]&&(i=t(r[0],n)),i=c(i),n&&"parentsUntil"!==e?i.filter(n):i}}),c.fn.filter=function(e){return c.filter(e)},c.fn.is=function(e){return!!e&&this.filter(e).length>0},c.fn.init.prototype=c.fn,c}),r(d,[],function(){return function(e,t){function n(e,t,n,r){function i(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}return"#"+i(t)+i(n)+i(r)}var r=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,i=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,o=/\s*([^:]+):\s*([^;]+);?/g,a=/\s+$/,s,l,c={},u,d="\ufeff"; -for(e=e||{},u=("\\\" \\' \\; \\: ; : "+d).split(" "),l=0;l-1&&n||(h[e+t]=-1==l?s[0]:s.join(" "),delete h[e+"-top"+t],delete h[e+"-right"+t],delete h[e+"-bottom"+t],delete h[e+"-left"+t])}}function u(e){var t=h[e],n;if(t){for(t=t.split(" "),n=t.length;n--;)if(t[n]!==t[0])return!1;return h[e]=t[0],!0}}function d(e,t,n,r){u(t)&&u(n)&&u(r)&&(h[e]=h[t]+" "+h[n]+" "+h[r],delete h[t],delete h[n],delete h[r])}function f(e){return b=!0,c[e]}function p(e,t){return b&&(e=e.replace(/\uFEFF[0-9]/g,function(e){return c[e]})),t||(e=e.replace(/\\([\'\";:])/g,"$1")),e}function m(t,n,r,i,o,a){return(o=o||a)?(o=p(o),"'"+o.replace(/\'/g,"\\'")+"'"):(n=p(n||r||i),!e.allow_script_urls&&/(java|vb)script:/i.test(n.replace(/[\s\r\n]+/,""))?"":(C&&(n=C.call(x,n,"style")),"url('"+n.replace(/\'/g,"\\'")+"')"))}var h={},g,v,y,b,C=e.url_converter,x=e.url_converter_scope||this;if(t){for(t=t.replace(/[\u0000-\u001F]/g,""),t=t.replace(/\\[\"\';:\uFEFF]/g,f).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(e){return e.replace(/[;:]/g,f)});g=o.exec(t);){if(v=g[1].replace(a,"").toLowerCase(),y=g[2].replace(a,""),v&&y.length>0){if(!e.allow_script_urls&&("behavior"==v||/expression\s*\(/.test(y)))continue;"font-weight"===v&&"700"===y?y="bold":("color"===v||"background-color"===v)&&(y=y.toLowerCase()),y=y.replace(r,n),y=y.replace(i,m),h[v]=b?p(y,!0):y}o.lastIndex=g.index+g[0].length}s("border","",!0),s("border","-width"),s("border","-color"),s("border","-style"),s("padding",""),s("margin",""),d("border","border-width","border-style","border-color"),"medium none"===h.border&&delete h.border,"none"===h["border-image"]&&delete h["border-image"]}return h},serialize:function(e,n){function r(n){var r,o,a,l;if(r=t.styles[n])for(o=0,a=r.length;a>o;o++)n=r[o],l=e[n],l!==s&&l.length>0&&(i+=(i.length>0?" ":"")+n+": "+l+";")}var i="",o,a;if(n&&t&&t.styles)r("*"),r(n);else for(o in e)a=e[o],a!==s&&a.length>0&&(i+=(i.length>0?" ":"")+o+": "+a+";");return i}}}}),r(f,[],function(){return function(e,t){function n(e,n,r,i){var o,a;if(e){if(!i&&e[n])return e[n];if(e!=t){if(o=e[r])return o;for(a=e.parentNode;a&&a!=t;a=a.parentNode)if(o=a[r])return o}}}var r=e;this.current=function(){return r},this.next=function(e){return r=n(r,"firstChild","nextSibling",e)},this.prev=function(e){return r=n(r,"lastChild","previousSibling",e)}}}),r(p,[],function(){function e(e){return null===e||e===t?"":(""+e).replace(h,"")}function n(e,n){return n?"array"==n&&g(e)?!0:typeof e==n:e!==t}function r(e){var t=[],n,r;for(n=0,r=e.length;r>n;n++)t[n]=e[n];return t}function i(e,t,n){var r;for(e=e||[],t=t||",","string"==typeof e&&(e=e.split(t)),n=n||{},r=e.length;r--;)n[e[r]]={};return n}function o(e,n,r){var i,o;if(!e)return 0;if(r=r||e,e.length!==t){for(i=0,o=e.length;o>i;i++)if(n.call(r,e[i],i,e)===!1)return 0}else for(i in e)if(e.hasOwnProperty(i)&&n.call(r,e[i],i,e)===!1)return 0;return 1}function a(e,t){var n=[];return o(e,function(e){n.push(t(e))}),n}function s(e,t){var n=[];return o(e,function(e){(!t||t(e))&&n.push(e)}),n}function l(e,t,n){var r=this,i,o,a,s,l,c=0;if(e=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(e),a=e[3].match(/(^|\.)(\w+)$/i)[2],o=r.createNS(e[3].replace(/\.\w+$/,""),n),!o[a]){if("static"==e[2])return o[a]=t,void(this.onCreate&&this.onCreate(e[2],e[3],o[a]));t[a]||(t[a]=function(){},c=1),o[a]=t[a],r.extend(o[a].prototype,t),e[5]&&(i=r.resolve(e[5]).prototype,s=e[5].match(/\.(\w+)$/i)[1],l=o[a],o[a]=c?function(){return i[s].apply(this,arguments)}:function(){return this.parent=i[s],l.apply(this,arguments)},o[a].prototype[a]=o[a],r.each(i,function(e,t){o[a].prototype[t]=i[t]}),r.each(t,function(e,t){i[t]?o[a].prototype[t]=function(){return this.parent=i[t],e.apply(this,arguments)}:t!=a&&(o[a].prototype[t]=e)})),r.each(t["static"],function(e,t){o[a][t]=e})}}function c(e,t){var n,r;if(e)for(n=0,r=e.length;r>n;n++)if(e[n]===t)return n;return-1}function u(e,n){var r,i,o,a=arguments,s;for(r=1,i=a.length;i>r;r++){n=a[r];for(o in n)n.hasOwnProperty(o)&&(s=n[o],s!==t&&(e[o]=s))}return e}function d(e,t,n,r){r=r||this,e&&(n&&(e=e[n]),o(e,function(e,i){return t.call(r,e,i,n)===!1?!1:void d(e,t,n,r)}))}function f(e,t){var n,r;for(t=t||window,e=e.split("."),n=0;nn&&(t=t[e[n]],t);n++);return t}function m(t,r){return!t||n(t,"array")?t:a(t.split(r||","),e)}var h=/^\s*|\s*$/g,g=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};return{trim:e,isArray:g,is:n,toArray:r,makeMap:i,each:o,map:a,grep:s,inArray:c,extend:u,create:l,walk:d,createNS:f,resolve:p,explode:m}}),r(m,[p],function(e){function t(n){function r(){return H.createDocumentFragment()}function i(e,t){_(F,e,t)}function o(e,t){_(z,e,t)}function a(e){i(e.parentNode,j(e))}function s(e){i(e.parentNode,j(e)+1)}function l(e){o(e.parentNode,j(e))}function c(e){o(e.parentNode,j(e)+1)}function u(e){e?(M[U]=M[V],M[q]=M[W]):(M[V]=M[U],M[W]=M[q]),M.collapsed=F}function d(e){a(e),c(e)}function f(e){i(e,0),o(e,1===e.nodeType?e.childNodes.length:e.nodeValue.length)}function p(e,t){var n=M[V],r=M[W],i=M[U],o=M[q],a=t.startContainer,s=t.startOffset,l=t.endContainer,c=t.endOffset;return 0===e?w(n,r,a,s):1===e?w(i,o,a,s):2===e?w(i,o,l,c):3===e?w(n,r,l,c):void 0}function m(){N(I)}function h(){return N(P)}function g(){return N(O)}function v(e){var t=this[V],r=this[W],i,o;3!==t.nodeType&&4!==t.nodeType||!t.nodeValue?(t.childNodes.length>0&&(o=t.childNodes[r]),o?t.insertBefore(e,o):3==t.nodeType?n.insertAfter(e,t):t.appendChild(e)):r?r>=t.nodeValue.length?n.insertAfter(e,t):(i=t.splitText(r),t.parentNode.insertBefore(e,i)):t.parentNode.insertBefore(e,t)}function y(e){var t=M.extractContents();M.insertNode(e),e.appendChild(t),M.selectNode(e)}function b(){return $(new t(n),{startContainer:M[V],startOffset:M[W],endContainer:M[U],endOffset:M[q],collapsed:M.collapsed,commonAncestorContainer:M.commonAncestorContainer})}function C(e,t){var n;if(3==e.nodeType)return e;if(0>t)return e;for(n=e.firstChild;n&&t>0;)--t,n=n.nextSibling;return n?n:e}function x(){return M[V]==M[U]&&M[W]==M[q]}function w(e,t,r,i){var o,a,s,l,c,u;if(e==r)return t==i?0:i>t?-1:1;for(o=r;o&&o.parentNode!=e;)o=o.parentNode;if(o){for(a=0,s=e.firstChild;s!=o&&t>a;)a++,s=s.nextSibling;return a>=t?-1:1}for(o=e;o&&o.parentNode!=r;)o=o.parentNode;if(o){for(a=0,s=r.firstChild;s!=o&&i>a;)a++,s=s.nextSibling;return i>a?-1:1}for(l=n.findCommonAncestor(e,r),c=e;c&&c.parentNode!=l;)c=c.parentNode;for(c||(c=l),u=r;u&&u.parentNode!=l;)u=u.parentNode;if(u||(u=l),c==u)return 0;for(s=l.firstChild;s;){if(s==c)return-1;if(s==u)return 1;s=s.nextSibling}}function _(e,t,r){var i,o;for(e?(M[V]=t,M[W]=r):(M[U]=t,M[q]=r),i=M[U];i.parentNode;)i=i.parentNode;for(o=M[V];o.parentNode;)o=o.parentNode;o==i?w(M[V],M[W],M[U],M[q])>0&&M.collapse(e):M.collapse(e),M.collapsed=x(),M.commonAncestorContainer=n.findCommonAncestor(M[V],M[U])}function N(e){var t,n=0,r=0,i,o,a,s,l,c;if(M[V]==M[U])return E(e);for(t=M[U],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[V])return S(t,e);++n}for(t=M[V],i=t.parentNode;i;t=i,i=i.parentNode){if(i==M[U])return k(t,e);++r}for(o=r-n,a=M[V];o>0;)a=a.parentNode,o--;for(s=M[U];0>o;)s=s.parentNode,o++;for(l=a.parentNode,c=s.parentNode;l!=c;l=l.parentNode,c=c.parentNode)a=l,s=c;return T(a,s,e)}function E(e){var t,n,i,o,a,s,l,c,u;if(e!=I&&(t=r()),M[W]==M[q])return t;if(3==M[V].nodeType){if(n=M[V].nodeValue,i=n.substring(M[W],M[q]),e!=O&&(o=M[V],c=M[W],u=M[q]-M[W],0===c&&u>=o.nodeValue.length-1?o.parentNode.removeChild(o):o.deleteData(c,u),M.collapse(F)),e==I)return;return i.length>0&&t.appendChild(H.createTextNode(i)),t}for(o=C(M[V],M[W]),a=M[q]-M[W];o&&a>0;)s=o.nextSibling,l=L(o,e),t&&t.appendChild(l),--a,o=s;return e!=O&&M.collapse(F),t}function S(e,t){var n,i,o,a,s,l;if(t!=I&&(n=r()),i=R(e,t),n&&n.appendChild(i),o=j(e),a=o-M[W],0>=a)return t!=O&&(M.setEndBefore(e),M.collapse(z)),n;for(i=e.previousSibling;a>0;)s=i.previousSibling,l=L(i,t),n&&n.insertBefore(l,n.firstChild),--a,i=s;return t!=O&&(M.setEndBefore(e),M.collapse(z)),n}function k(e,t){var n,i,o,a,s,l;for(t!=I&&(n=r()),o=A(e,t),n&&n.appendChild(o),i=j(e),++i,a=M[q]-i,o=e.nextSibling;o&&a>0;)s=o.nextSibling,l=L(o,t),n&&n.appendChild(l),--a,o=s;return t!=O&&(M.setStartAfter(e),M.collapse(F)),n}function T(e,t,n){var i,o,a,s,l,c,u;for(n!=I&&(o=r()),i=A(e,n),o&&o.appendChild(i),a=j(e),s=j(t),++a,l=s-a,c=e.nextSibling;l>0;)u=c.nextSibling,i=L(c,n),o&&o.appendChild(i),c=u,--l;return i=R(t,n),o&&o.appendChild(i),n!=O&&(M.setStartAfter(e),M.collapse(F)),o}function R(e,t){var n=C(M[U],M[q]-1),r,i,o,a,s,l=n!=M[U];if(n==e)return B(n,l,z,t);for(r=n.parentNode,i=B(r,z,z,t);r;){for(;n;)o=n.previousSibling,a=B(n,l,z,t),t!=I&&i.insertBefore(a,i.firstChild),l=F,n=o;if(r==e)return i;n=r.previousSibling,r=r.parentNode,s=B(r,z,z,t),t!=I&&s.appendChild(i),i=s}}function A(e,t){var n=C(M[V],M[W]),r=n!=M[V],i,o,a,s,l;if(n==e)return B(n,r,F,t);for(i=n.parentNode,o=B(i,z,F,t);i;){for(;n;)a=n.nextSibling,s=B(n,r,F,t),t!=I&&o.appendChild(s),r=F,n=a;if(i==e)return o;n=i.nextSibling,i=i.parentNode,l=B(i,z,F,t),t!=I&&l.appendChild(o),o=l}}function B(e,t,r,i){var o,a,s,l,c;if(t)return L(e,i);if(3==e.nodeType){if(o=e.nodeValue,r?(l=M[W],a=o.substring(l),s=o.substring(0,l)):(l=M[q],a=o.substring(0,l),s=o.substring(l)),i!=O&&(e.nodeValue=s),i==I)return;return c=n.clone(e,z),c.nodeValue=a,c}if(i!=I)return n.clone(e,z)}function L(e,t){return t!=I?t==O?n.clone(e,F):e:void e.parentNode.removeChild(e)}function D(){return n.create("body",null,g()).outerText}var M=this,H=n.doc,P=0,O=1,I=2,F=!0,z=!1,W="startOffset",V="startContainer",U="endContainer",q="endOffset",$=e.extend,j=n.nodeIndex;return $(M,{startContainer:H,startOffset:0,endContainer:H,endOffset:0,collapsed:F,commonAncestorContainer:H,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:i,setEnd:o,setStartBefore:a,setStartAfter:s,setEndBefore:l,setEndAfter:c,collapse:u,selectNode:d,selectNodeContents:f,compareBoundaryPoints:p,deleteContents:m,extractContents:h,cloneContents:g,insertNode:v,surroundContents:y,cloneRange:b,toStringIE:D}),M}return t.prototype.toString=function(){return this.toStringIE()},t}),r(h,[p],function(e){function t(e){var t;return t=document.createElement("div"),t.innerHTML=e,t.textContent||t.innerText||e}function n(e,t){var n,r,i,a={};if(e){for(e=e.split(","),t=t||10,n=0;n\"\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,l=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,c=/[<>&\"\']/g,u=/&(#x|#)?([\w]+);/g,d={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"};o={'"':""","'":"'","<":"<",">":">","&":"&"},a={"<":"<",">":">","&":"&",""":'"',"'":"'"},i=n("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);var f={encodeRaw:function(e,t){return e.replace(t?s:l,function(e){return o[e]||e})},encodeAllRaw:function(e){return(""+e).replace(c,function(e){return o[e]||e})},encodeNumeric:function(e,t){return e.replace(t?s:l,function(e){return e.length>1?"&#"+(1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536)+";":o[e]||"&#"+e.charCodeAt(0)+";"})},encodeNamed:function(e,t,n){return n=n||i,e.replace(t?s:l,function(e){return o[e]||n[e]||e})},getEncodeFunc:function(e,t){function a(e,n){return e.replace(n?s:l,function(e){return o[e]||t[e]||"&#"+e.charCodeAt(0)+";"||e})}function c(e,n){return f.encodeNamed(e,n,t)}return t=n(t)||i,e=r(e.replace(/\+/g,",")),e.named&&e.numeric?a:e.named?t?c:f.encodeNamed:e.numeric?f.encodeNumeric:f.encodeRaw},decode:function(e){return e.replace(u,function(e,n,r){return n?(r=parseInt(r,2===n.length?16:10),r>65535?(r-=65536,String.fromCharCode(55296+(r>>10),56320+(1023&r))):d[r]||String.fromCharCode(r)):a[e]||i[e]||t(e)})}};return f}),r(g,[],function(){var e=navigator,t=e.userAgent,n,r,i,o,a,s,l;n=window.opera&&window.opera.buildNumber,r=/WebKit/.test(t),i=!r&&!n&&/MSIE/gi.test(t)&&/Explorer/gi.test(e.appName),i=i&&/MSIE (\w+)\./.exec(t)[1],o=-1==t.indexOf("Trident/")||-1==t.indexOf("rv:")&&-1==e.appName.indexOf("Netscape")?!1:11,i=i||o,a=!r&&!o&&/Gecko/.test(t),s=-1!=t.indexOf("Mac"),l=/(iPad|iPhone)/.test(t);var c=!l||t.match(/AppleWebKit\/(\d*)/)[1]>=534;return{opera:n,webkit:r,ie:i,gecko:a,mac:s,iOS:l,contentEditable:c,transparentSrc:"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",caretAfter:8!=i,range:window.getSelection&&"Range"in window,documentMode:i?document.documentMode||7:10}}),r(v,[],function(){return function(e,t){function n(t){e.getElementsByTagName("head")[0].appendChild(t)}function r(t,r,s){function l(){for(var e=v.passed,t=e.length;t--;)e[t]();v.status=2,v.passed=[],v.failed=[]}function c(){for(var e=v.failed,t=e.length;t--;)e[t]();v.status=3,v.passed=[],v.failed=[]}function u(){var e=navigator.userAgent.match(/WebKit\/(\d*)/);return!!(e&&e[1]<536)}function d(e,t){e()||((new Date).getTime()-g0)return h=e.createElement("style"),h.textContent='@import "'+t+'"',p(),void n(h);f()}n(m),m.href=t}}var i=0,o={},a;t=t||{},a=t.maxLoadTime||5e3,this.load=r}}),r(y,[c,d,l,f,m,h,g,p,v],function(e,n,r,i,o,a,s,l,c){function u(e,t){var i=this,o;i.doc=e,i.win=window,i.files={},i.counter=0,i.stdMode=!v||e.documentMode>=8,i.boxModel=!v||"CSS1Compat"==e.compatMode||i.stdMode,i.hasOuterHTML="outerHTML"in e.createElement("a"),i.styleSheetLoader=new c(e),this.boundEvents=[],i.settings=t=h({keep_values:!1,hex_colors:1},t),i.schema=t.schema,i.styles=new n({url_converter:t.url_converter,url_converter_scope:t.url_converter_scope},t.schema),i.fixDoc(e),i.events=t.ownEvents?new r(t.proxy):r.Event,o=t.schema?t.schema.getBlockElements():{},i.isBlock=function(e){if(!e)return!1;var t=e.nodeType;return t?!(1!==t||!o[e.nodeName]):!!o[e]}}var d=l.each,f=l.is,p=l.grep,m=l.trim,h=l.extend,g=s.webkit,v=s.ie,y=/^([a-z0-9],?)+$/i,b=/^[ \t\r\n]*$/,C=l.makeMap("fillOpacity fontWeight lineHeight opacity orphans widows zIndex zoom"," ");return u.prototype={root:null,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},fixDoc:function(e){var t=this.settings,n;if(v&&t.schema){"abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video".replace(/\w+/g,function(t){e.createElement(t)});for(n in t.schema.getCustomElements())e.createElement(n)}},clone:function(e,t){var n=this,r,i;return!v||1!==e.nodeType||t?e.cloneNode(t):(i=n.doc,t?r.firstChild:(r=i.createElement(e.nodeName),d(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),r))},getRoot:function(){var e=this;return e.get(e.settings.root_element)||e.doc.body},getViewPort:function(e){var t,n;return e=e?e:this.win,t=e.document,n=this.boxModel?t.documentElement:t.body,{x:e.pageXOffset||n.scrollLeft,y:e.pageYOffset||n.scrollTop,w:e.innerWidth||n.clientWidth,h:e.innerHeight||n.clientHeight}},getRect:function(e){var t=this,n,r;return e=t.get(e),n=t.getPos(e),r=t.getSize(e),{x:n.x,y:n.y,w:r.w,h:r.h}},getSize:function(e){var t=this,n,r;return e=t.get(e),n=t.getStyle(e,"width"),r=t.getStyle(e,"height"),-1===n.indexOf("px")&&(n=0),-1===r.indexOf("px")&&(r=0),{w:parseInt(n,10)||e.offsetWidth||e.clientWidth,h:parseInt(r,10)||e.offsetHeight||e.clientHeight}},getParent:function(e,t,n){return this.getParents(e,t,n,!1)},getParents:function(e,n,r,i){var o=this,a,s=[];for(e=o.get(e),i=i===t,r=r||("BODY"!=o.getRoot().nodeName?o.getRoot().parentNode:null),f(n,"string")&&(a=n,n="*"===n?function(e){return 1==e.nodeType}:function(e){return o.is(e,a)});e&&e!=r&&e.nodeType&&9!==e.nodeType;){if(!n||n(e)){if(!i)return e;s.push(e)}e=e.parentNode}return i?s:null},get:function(e){var t;return e&&this.doc&&"string"==typeof e&&(t=e,e=this.doc.getElementById(e),e&&e.id!==t)?this.doc.getElementsByName(t)[1]:e},getNext:function(e,t){return this._findSib(e,t,"nextSibling")},getPrev:function(e,t){return this._findSib(e,t,"previousSibling")},select:function(t,n){var r=this;return e(t,r.get(n)||r.get(r.settings.root_element)||r.doc,[])},is:function(n,r){var i;if(n.length===t){if("*"===r)return 1==n.nodeType;if(y.test(r)){for(r=r.toLowerCase().split(/,/),n=n.nodeName.toLowerCase(),i=r.length-1;i>=0;i--)if(r[i]==n)return!0;return!1}}if(n.nodeType&&1!=n.nodeType)return!1;var o=n.nodeType?[n]:n;return e(r,o[0].ownerDocument||o[0],null,o).length>0},add:function(e,t,n,r,i){var o=this;return this.run(e,function(e){var a;return a=f(t,"string")?o.doc.createElement(t):t,o.setAttribs(a,n),r&&(r.nodeType?a.appendChild(r):o.setHTML(a,r)),i?a:e.appendChild(a)})},create:function(e,t,n){return this.add(this.doc.createElement(e),e,t,n,1)},createHTML:function(e,t,n){var r="",i;r+="<"+e;for(i in t)t.hasOwnProperty(i)&&null!==t[i]&&(r+=" "+i+'="'+this.encode(t[i])+'"');return"undefined"!=typeof n?r+">"+n+"":r+" />"},createFragment:function(e){var t,n,r=this.doc,i;for(i=r.createElement("div"),t=r.createDocumentFragment(),e&&(i.innerHTML=e);n=i.firstChild;)t.appendChild(n);return t},remove:function(e,t){return this.run(e,function(e){var n,r=e.parentNode;if(!r)return null;if(t)for(;n=e.firstChild;)!v||3!==n.nodeType||n.nodeValue?r.insertBefore(n,e):e.removeChild(n);return r.removeChild(e)})},setStyle:function(e,t,n){return this.run(e,function(e){var r=this,i,o;if(t)if("string"==typeof t){i=e.style,t=t.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"number"!=typeof n||C[t]||(n+="px"),"opacity"===t&&e.runtimeStyle&&"undefined"==typeof e.runtimeStyle.opacity&&(i.filter=""===n?"":"alpha(opacity="+100*n+")"),"float"==t&&(t="cssFloat"in e.style?"cssFloat":"styleFloat");try{i[t]=n}catch(a){}r.settings.update_styles&&e.removeAttribute("data-mce-style")}else for(o in t)r.setStyle(e,o,t[o])})},getStyle:function(e,n,r){if(e=this.get(e)){if(this.doc.defaultView&&r){n=n.replace(/[A-Z]/g,function(e){return"-"+e});try{return this.doc.defaultView.getComputedStyle(e,null).getPropertyValue(n)}catch(i){return null}}return n=n.replace(/-(\D)/g,function(e,t){return t.toUpperCase()}),"float"==n&&(n=v?"styleFloat":"cssFloat"),e.currentStyle&&r?e.currentStyle[n]:e.style?e.style[n]:t}},setStyles:function(e,t){this.setStyle(e,t)},css:function(e,t,n){this.setStyle(e,t,n)},removeAllAttribs:function(e){return this.run(e,function(e){var t,n=e.attributes;for(t=n.length-1;t>=0;t--)e.removeAttributeNode(n.item(t))})},setAttrib:function(e,t,n){var r=this;if(e&&t)return this.run(e,function(e){var i=r.settings,o=e.getAttribute(t);if(null!==n)switch(t){case"style":if(!f(n,"string"))return void d(n,function(t,n){r.setStyle(e,n,t)});i.keep_values&&(n?e.setAttribute("data-mce-style",n,2):e.removeAttribute("data-mce-style",2)),e.style.cssText=n;break;case"class":e.className=n||"";break;case"src":case"href":i.keep_values&&(i.url_converter&&(n=i.url_converter.call(i.url_converter_scope||r,n,t,e)),r.setAttrib(e,"data-mce-"+t,n,2));break;case"shape":e.setAttribute("data-mce-style",n)}f(n)&&null!==n&&0!==n.length?e.setAttribute(t,""+n,2):e.removeAttribute(t,2),o!=n&&i.onSetAttrib&&i.onSetAttrib({attrElm:e,attrName:t,attrValue:n})})},setAttribs:function(e,t){var n=this;return this.run(e,function(e){d(t,function(t,r){n.setAttrib(e,r,t)})})},getAttrib:function(e,t,n){var r,i=this,o;if(e=i.get(e),!e||1!==e.nodeType)return n===o?!1:n;if(f(n)||(n=""),/^(src|href|style|coords|shape)$/.test(t)&&(r=e.getAttribute("data-mce-"+t)))return r;if(v&&i.props[t]&&(r=e[i.props[t]],r=r&&r.nodeValue?r.nodeValue:r),r||(r=e.getAttribute(t,2)),/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(t))return e[i.props[t]]===!0&&""===r?t:r?t:"";if("FORM"===e.nodeName&&e.getAttributeNode(t))return e.getAttributeNode(t).nodeValue;if("style"===t&&(r=r||e.style.cssText,r&&(r=i.serializeStyle(i.parseStyle(r),e.nodeName),i.settings.keep_values&&e.setAttribute("data-mce-style",r))),g&&"class"===t&&r&&(r=r.replace(/(apple|webkit)\-[a-z\-]+/gi,"")),v)switch(t){case"rowspan":case"colspan":1===r&&(r="");break;case"size":("+0"===r||20===r||0===r)&&(r="");break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":0===r&&(r="");break;case"hspace":-1===r&&(r="");break;case"maxlength":case"tabindex":(32768===r||2147483647===r||"32768"===r)&&(r="");break;case"multiple":case"compact":case"noshade":case"nowrap":return 65535===r?t:n;case"shape":r=r.toLowerCase();break;default:0===t.indexOf("on")&&r&&(r=(""+r).replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1"))}return r!==o&&null!==r&&""!==r?""+r:n},getPos:function(e,t){var n=this,r=0,i=0,o,a=n.doc,s;if(e=n.get(e),t=t||a.body,e){if(t===a.body&&e.getBoundingClientRect)return s=e.getBoundingClientRect(),t=n.boxModel?a.documentElement:a.body,r=s.left+(a.documentElement.scrollLeft||a.body.scrollLeft)-t.clientLeft,i=s.top+(a.documentElement.scrollTop||a.body.scrollTop)-t.clientTop,{x:r,y:i};for(o=e;o&&o!=t&&o.nodeType;)r+=o.offsetLeft||0,i+=o.offsetTop||0,o=o.offsetParent;for(o=e.parentNode;o&&o!=t&&o.nodeType;)r-=o.scrollLeft||0,i-=o.scrollTop||0,o=o.parentNode}return{x:r,y:i}},parseStyle:function(e){return this.styles.parse(e)},serializeStyle:function(e,t){return this.styles.serialize(e,t)},addStyle:function(e){var t=this,n=t.doc,r,i;if(t!==u.DOM&&n===document){var o=u.DOM.addedStyles;if(o=o||[],o[e])return;o[e]=!0,u.DOM.addedStyles=o}i=n.getElementById("mceDefaultStyles"),i||(i=n.createElement("style"),i.id="mceDefaultStyles",i.type="text/css",r=n.getElementsByTagName("head")[0],r.firstChild?r.insertBefore(i,r.firstChild):r.appendChild(i)),i.styleSheet?i.styleSheet.cssText+=e:i.appendChild(n.createTextNode(e))},loadCSS:function(e){var t=this,n=t.doc,r;return t!==u.DOM&&n===document?void u.DOM.loadCSS(e):(e||(e=""),r=n.getElementsByTagName("head")[0],void d(e.split(","),function(e){var i;t.files[e]||(t.files[e]=!0,i=t.create("link",{rel:"stylesheet",href:e}),v&&n.documentMode&&n.recalc&&(i.onload=function(){n.recalc&&n.recalc(),i.onload=null}),r.appendChild(i))}))},addClass:function(e,t){return this.run(e,function(e){var n;return t?this.hasClass(e,t)?e.className:(n=this.removeClass(e,t),e.className=n=(""!==n?n+" ":"")+t,n):0})},removeClass:function(e,t){var n=this,r;return n.run(e,function(e){var i;return n.hasClass(e,t)?(r||(r=new RegExp("(^|\\s+)"+t+"(\\s+|$)","g")),i=e.className.replace(r," "),i=m(" "!=i?i:""),e.className=i,i||(e.removeAttribute("class"),e.removeAttribute("className")),i):e.className})},hasClass:function(e,t){return e=this.get(e),e&&t?-1!==(" "+e.className+" ").indexOf(" "+t+" "):!1},toggleClass:function(e,n,r){r=r===t?!this.hasClass(e,n):r,this.hasClass(e,n)!==r&&(r?this.addClass(e,n):this.removeClass(e,n))},show:function(e){return this.setStyle(e,"display","block")},hide:function(e){return this.setStyle(e,"display","none")},isHidden:function(e){return e=this.get(e),!e||"none"==e.style.display||"none"==this.getStyle(e,"display")},uniqueId:function(e){return(e?e:"mce_")+this.counter++},setHTML:function(e,t){var n=this;return n.run(e,function(e){if(v){for(;e.firstChild;)e.removeChild(e.firstChild);try{e.innerHTML="
    "+t,e.removeChild(e.firstChild)}catch(r){var i=n.create("div");i.innerHTML="
    "+t,d(p(i.childNodes),function(t,n){n&&e.canHaveHTML&&e.appendChild(t)})}}else e.innerHTML=t;return t})},getOuterHTML:function(e){var t,n=this;return(e=n.get(e))?1===e.nodeType&&n.hasOuterHTML?e.outerHTML:(t=(e.ownerDocument||n.doc).createElement("body"),t.appendChild(e.cloneNode(!0)),t.innerHTML):null},setOuterHTML:function(e,t,n){var r=this;return r.run(e,function(e){function i(){var i,o;for(o=n.createElement("body"),o.innerHTML=t,i=o.lastChild;i;)r.insertAfter(i.cloneNode(!0),e),i=i.previousSibling;r.remove(e)}if(1==e.nodeType)if(n=n||e.ownerDocument||r.doc,v)try{1==e.nodeType&&r.hasOuterHTML?e.outerHTML=t:i()}catch(o){i()}else i()})},decode:a.decode,encode:a.encodeAllRaw,insertAfter:function(e,t){return t=this.get(t),this.run(e,function(e){var n,r;return n=t.parentNode,r=t.nextSibling,r?n.insertBefore(e,r):n.appendChild(e),e})},replace:function(e,t,n){var r=this;return r.run(t,function(t){return f(t,"array")&&(e=e.cloneNode(!0)),n&&d(p(t.childNodes),function(t){e.appendChild(t)}),t.parentNode.replaceChild(e,t)})},rename:function(e,t){var n=this,r;return e.nodeName!=t.toUpperCase()&&(r=n.create(t),d(n.getAttribs(e),function(t){n.setAttrib(r,t.nodeName,n.getAttrib(e,t.nodeName))}),n.replace(r,e,1)),r||e},findCommonAncestor:function(e,t){for(var n=e,r;n;){for(r=t;r&&n!=r;)r=r.parentNode;if(n==r)break;n=n.parentNode}return!n&&e.ownerDocument?e.ownerDocument.documentElement:n},toHex:function(e){return this.styles.toHex(l.trim(e))},run:function(e,t,n){var r=this,i;return"string"==typeof e&&(e=r.get(e)),e?(n=n||this,e.nodeType||!e.length&&0!==e.length?t.call(n,e):(i=[],d(e,function(e,o){e&&("string"==typeof e&&(e=r.get(e)),i.push(t.call(n,e,o)))}),i)):!1},getAttribs:function(e){var t;if(e=this.get(e),!e)return[];if(v){if(t=[],"OBJECT"==e.nodeName)return e.attributes;"OPTION"===e.nodeName&&this.getAttrib(e,"selected")&&t.push({specified:1,nodeName:"selected"});var n=/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi;return e.cloneNode(!1).outerHTML.replace(n,"").replace(/[\w:\-]+/gi,function(e){t.push({specified:1,nodeName:e})}),t}return e.attributes},isEmpty:function(e,t){var n=this,r,o,a,s,l,c=0;if(e=e.firstChild){s=new i(e,e.parentNode),t=t||n.schema?n.schema.getNonEmptyElements():null;do{if(a=e.nodeType,1===a){if(e.getAttribute("data-mce-bogus"))continue;if(l=e.nodeName.toLowerCase(),t&&t[l]){if("br"===l){c++;continue}return!1}for(o=n.getAttribs(e),r=e.attributes.length;r--;)if(l=e.attributes[r].nodeName,"name"===l||"data-mce-bookmark"===l)return!1}if(8==a)return!1;if(3===a&&!b.test(e.nodeValue))return!1}while(e=s.next())}return 1>=c},createRng:function(){var e=this.doc;return e.createRange?e.createRange():new o(this)},nodeIndex:function(e,t){var n=0,r,i;if(e)for(r=e.nodeType,e=e.previousSibling;e;e=e.previousSibling)i=e.nodeType,(!t||3!=i||i!=r&&e.nodeValue.length)&&(n++,r=i);return n},split:function(e,t,n){function r(e){function t(e){var t=e.previousSibling&&"SPAN"==e.previousSibling.nodeName,n=e.nextSibling&&"SPAN"==e.nextSibling.nodeName;return t&&n}var n,o=e.childNodes,a=e.nodeType;if(1!=a||"bookmark"!=e.getAttribute("data-mce-type")){for(n=o.length-1;n>=0;n--)r(o[n]);if(9!=a){if(3==a&&e.nodeValue.length>0){var s=m(e.nodeValue).length;if(!i.isBlock(e.parentNode)||s>0||0===s&&t(e))return}else if(1==a&&(o=e.childNodes,1==o.length&&o[0]&&1==o[0].nodeType&&"bookmark"==o[0].getAttribute("data-mce-type")&&e.parentNode.insertBefore(o[0],e),o.length||/^(br|hr|input|img)$/i.test(e.nodeName)))return;i.remove(e)}return e}}var i=this,o=i.createRng(),a,s,l;return e&&t?(o.setStart(e.parentNode,i.nodeIndex(e)),o.setEnd(t.parentNode,i.nodeIndex(t)),a=o.extractContents(),o=i.createRng(),o.setStart(t.parentNode,i.nodeIndex(t)+1),o.setEnd(e.parentNode,i.nodeIndex(e)+1),s=o.extractContents(),l=e.parentNode,l.insertBefore(r(a),e),n?l.replaceChild(n,t):l.insertBefore(t,e),l.insertBefore(r(s),e),i.remove(e),n||t):void 0},bind:function(e,t,n,r){var i=this;if(l.isArray(e)){for(var o=e.length;o--;)e[o]=i.bind(e[o],t,n,r);return e}return!i.settings.collect||e!==i.doc&&e!==i.win||i.boundEvents.push([e,t,n,r]),i.events.bind(e,t,n,r||i)},unbind:function(e,t,n){var r=this,i;if(l.isArray(e)){for(i=e.length;i--;)e[i]=r.unbind(e[i],t,n);return e}if(r.boundEvents&&(e===r.doc||e===r.win))for(i=r.boundEvents.length;i--;){var o=r.boundEvents[i];e!=o[0]||t&&t!=o[1]||n&&n!=o[2]||this.events.unbind(o[0],o[1],o[2])}return this.events.unbind(e,t,n)},fire:function(e,t,n){return this.events.fire(e,t,n)},getContentEditable:function(e){var t;return 1!=e.nodeType?null:(t=e.getAttribute("data-mce-contenteditable"),t&&"inherit"!==t?t:"inherit"!==e.contentEditable?e.contentEditable:null)},destroy:function(){var t=this;if(t.boundEvents){for(var n=t.boundEvents.length;n--;){var r=t.boundEvents[n];this.events.unbind(r[0],r[1],r[2])}t.boundEvents=null}e.setDocument&&e.setDocument(),t.win=t.doc=t.root=t.events=t.frag=null},dumpRng:function(e){return"startContainer: "+e.startContainer.nodeName+", startOffset: "+e.startOffset+", endContainer: "+e.endContainer.nodeName+", endOffset: "+e.endOffset},_findSib:function(e,t,n){var r=this,i=t;if(e)for("string"==typeof i&&(i=function(e){return r.is(e,t)}),e=e[n];e;e=e[n])if(i(e))return e;return null}},u.DOM=new u(document),u}),r(b,[y,p],function(e,t){function n(){function e(e,t){function n(){o.remove(s),a&&(a.onreadystatechange=a.onload=a=null),t() -}function i(){"undefined"!=typeof console&&console.log&&console.log("Failed to load: "+e)}var o=r,a,s;s=o.uniqueId(),a=document.createElement("script"),a.id=s,a.type="text/javascript",a.src=e,"onreadystatechange"in a?a.onreadystatechange=function(){/loaded|complete/.test(a.readyState)&&n()}:a.onload=n,a.onerror=i,(document.getElementsByTagName("head")[0]||document.body).appendChild(a)}var t=0,n=1,a=2,s={},l=[],c={},u=[],d=0,f;this.isDone=function(e){return s[e]==a},this.markDone=function(e){s[e]=a},this.add=this.load=function(e,n,r){var i=s[e];i==f&&(l.push(e),s[e]=t),n&&(c[e]||(c[e]=[]),c[e].push({func:n,scope:r||this}))},this.loadQueue=function(e,t){this.loadScripts(l,e,t)},this.loadScripts=function(t,r,l){function p(e){i(c[e],function(e){e.func.call(e.scope)}),c[e]=f}var m;u.push({func:r,scope:l||this}),(m=function(){var r=o(t);t.length=0,i(r,function(t){return s[t]==a?void p(t):void(s[t]!=n&&(s[t]=n,d++,e(t,function(){s[t]=a,d--,p(t),m()})))}),d||(i(u,function(e){e.func.call(e.scope)}),u.length=0)})()}}var r=e.DOM,i=t.each,o=t.grep;return n.ScriptLoader=new n,n}),r(C,[b,p],function(e,n){function r(){var e=this;e.items=[],e.urls={},e.lookup={}}var i=n.each;return r.prototype={get:function(e){return this.lookup[e]?this.lookup[e].instance:t},dependencies:function(e){var t;return this.lookup[e]&&(t=this.lookup[e].dependencies),t||[]},requireLangPack:function(t,n){if(r.language&&r.languageLoad!==!1){if(n&&new RegExp("([, ]|\\b)"+r.language+"([, ]|\\b)").test(n)===!1)return;e.ScriptLoader.add(this.urls[t]+"/langs/"+r.language+".js")}},add:function(e,t,n){return this.items.push(t),this.lookup[e]={instance:t,dependencies:n},t},createUrl:function(e,t){return"object"==typeof t?t:{prefix:e.prefix,resource:t,suffix:e.suffix}},addComponents:function(t,n){var r=this.urls[t];i(n,function(t){e.ScriptLoader.add(r+"/"+t)})},load:function(n,o,a,s){function l(){var r=c.dependencies(n);i(r,function(e){var n=c.createUrl(o,e);c.load(n.resource,n,t,t)}),a&&a.call(s?s:e)}var c=this,u=o;c.urls[n]||("object"==typeof o&&(u=o.prefix+o.resource+o.suffix),0!==u.indexOf("/")&&-1==u.indexOf("://")&&(u=r.baseURL+"/"+u),c.urls[n]=u.substring(0,u.lastIndexOf("/")),c.lookup[n]?l():e.ScriptLoader.add(u,l,s))}},r.PluginManager=new r,r.ThemeManager=new r,r}),r(x,[],function(){function e(e,t,n){var r,i,o=n?"lastChild":"firstChild",a=n?"prev":"next";if(e[o])return e[o];if(e!==t){if(r=e[a])return r;for(i=e.parent;i&&i!==t;i=i.parent)if(r=i[a])return r}}function t(e,t){this.name=e,this.type=t,1===t&&(this.attributes=[],this.attributes.map={})}var n=/^[ \t\r\n]*$/,r={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};return t.prototype={replace:function(e){var t=this;return e.parent&&e.remove(),t.insert(e,t),t.remove(),t},attr:function(e,t){var n=this,r,i,o;if("string"!=typeof e){for(i in e)n.attr(i,e[i]);return n}if(r=n.attributes){if(t!==o){if(null===t){if(e in r.map)for(delete r.map[e],i=r.length;i--;)if(r[i].name===e)return r=r.splice(i,1),n;return n}if(e in r.map){for(i=r.length;i--;)if(r[i].name===e){r[i].value=t;break}}else r.push({name:e,value:t});return r.map[e]=t,n}return r.map[e]}},clone:function(){var e=this,n=new t(e.name,e.type),r,i,o,a,s;if(o=e.attributes){for(s=[],s.map={},r=0,i=o.length;i>r;r++)a=o[r],"id"!==a.name&&(s[s.length]={name:a.name,value:a.value},s.map[a.name]=a.value);n.attributes=s}return n.value=e.value,n.shortEnded=e.shortEnded,n},wrap:function(e){var t=this;return t.parent.insert(e,t),e.append(t),t},unwrap:function(){var e=this,t,n;for(t=e.firstChild;t;)n=t.next,e.insert(t,e,!0),t=n;e.remove()},remove:function(){var e=this,t=e.parent,n=e.next,r=e.prev;return t&&(t.firstChild===e?(t.firstChild=n,n&&(n.prev=null)):r.next=n,t.lastChild===e?(t.lastChild=r,r&&(r.next=null)):n.prev=r,e.parent=e.next=e.prev=null),e},append:function(e){var t=this,n;return e.parent&&e.remove(),n=t.lastChild,n?(n.next=e,e.prev=n,t.lastChild=e):t.lastChild=t.firstChild=e,e.parent=t,e},insert:function(e,t,n){var r;return e.parent&&e.remove(),r=t.parent||this,n?(t===r.firstChild?r.firstChild=e:t.prev.next=e,e.prev=t.prev,e.next=t,t.prev=e):(t===r.lastChild?r.lastChild=e:t.next.prev=e,e.next=t.next,e.prev=t,t.next=e),e.parent=r,e},getAll:function(t){var n=this,r,i=[];for(r=n.firstChild;r;r=e(r,n))r.name===t&&i.push(r);return i},empty:function(){var t=this,n,r,i;if(t.firstChild){for(n=[],i=t.firstChild;i;i=e(i,t))n.push(i);for(r=n.length;r--;)i=n[r],i.parent=i.firstChild=i.lastChild=i.next=i.prev=null}return t.firstChild=t.lastChild=null,t},isEmpty:function(t){var r=this,i=r.firstChild,o,a;if(i)do{if(1===i.type){if(i.attributes.map["data-mce-bogus"])continue;if(t[i.name])return!1;for(o=i.attributes.length;o--;)if(a=i.attributes[o].name,"name"===a||0===a.indexOf("data-mce-"))return!1}if(8===i.type)return!1;if(3===i.type&&!n.test(i.value))return!1}while(i=e(i,r));return!0},walk:function(t){return e(this,null,t)}},t.create=function(e,n){var i,o;if(i=new t(e,r[e]||1),n)for(o in n)i.attr(o,n[o]);return i},t}),r(w,[p],function(e){function t(e,t){return e?e.split(t||" "):[]}function n(e){function n(e,n,r){function i(e){var t={},n,r;for(n=0,r=e.length;r>n;n++)t[e[n]]={};return t}var o,l,c,u=arguments;for(r=r||[],n=n||"","string"==typeof r&&(r=t(r)),l=3;lo;o++)i.attributes[n[o]]={},i.attributesOrder.push(n[o])}var a={},s,l,c,u,d,f;return r[e]?r[e]:(s=t("id accesskey class dir lang style tabindex title"),l=t("address blockquote div dl fieldset form h1 h2 h3 h4 h5 h6 hr menu ol p pre table ul"),c=t("a abbr b bdo br button cite code del dfn em embed i iframe img input ins kbd label map noscript object q s samp script select small span strong sub sup textarea u var #text #comment"),"html4"!=e&&(s.push.apply(s,t("contenteditable contextmenu draggable dropzone hidden spellcheck translate")),l.push.apply(l,t("article aside details dialog figure header footer hgroup section nav")),c.push.apply(c,t("audio canvas command datalist mark meter output progress time wbr video ruby bdi keygen"))),"html5-strict"!=e&&(s.push("xml:lang"),f=t("acronym applet basefont big font strike tt"),c.push.apply(c,f),o(f,function(e){n(e,"",c)}),d=t("center dir isindex noframes"),l.push.apply(l,d),u=[].concat(l,c),o(d,function(e){n(e,"",u)})),u=u||[].concat(l,c),n("html","manifest","head body"),n("head","","base command link meta noscript script style title"),n("title hr noscript br"),n("base","href target"),n("link","href rel media hreflang type sizes hreflang"),n("meta","name http-equiv content charset"),n("style","media type scoped"),n("script","src async defer type charset"),n("body","onafterprint onbeforeprint onbeforeunload onblur onerror onfocus onhashchange onload onmessage onoffline ononline onpagehide onpageshow onpopstate onresize onscroll onstorage onunload",u),n("address dt dd div caption","",u),n("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","",c),n("blockquote","cite",u),n("ol","reversed start type","li"),n("ul","","li"),n("li","value",u),n("dl","","dt dd"),n("a","href target rel media hreflang type",c),n("q","cite",c),n("ins del","cite datetime",u),n("img","src alt usemap ismap width height"),n("iframe","src name width height",u),n("embed","src type width height"),n("object","data type typemustmatch name usemap form width height",u,"param"),n("param","name value"),n("map","name",u,"area"),n("area","alt coords shape href target rel media hreflang type"),n("table","border","caption colgroup thead tfoot tbody tr"+("html4"==e?" col":"")),n("colgroup","span","col"),n("col","span"),n("tbody thead tfoot","","tr"),n("tr","","td th"),n("td","colspan rowspan headers",u),n("th","colspan rowspan headers scope abbr",u),n("form","accept-charset action autocomplete enctype method name novalidate target",u),n("fieldset","disabled form name",u,"legend"),n("label","form for",c),n("input","accept alt autocomplete checked dirname disabled form formaction formenctype formmethod formnovalidate formtarget height list max maxlength min multiple name pattern readonly required size src step type value width"),n("button","disabled form formaction formenctype formmethod formnovalidate formtarget name type value","html4"==e?u:c),n("select","disabled form multiple name required size","option optgroup"),n("optgroup","disabled label","option"),n("option","disabled label selected value"),n("textarea","cols dirname disabled form maxlength name readonly required rows wrap"),n("menu","type label",u,"li"),n("noscript","",u),"html4"!=e&&(n("wbr"),n("ruby","",c,"rt rp"),n("figcaption","",u),n("mark rt rp summary bdi","",c),n("canvas","width height",u),n("video","src crossorigin poster preload autoplay mediagroup loop muted controls width height",u,"track source"),n("audio","src crossorigin preload autoplay mediagroup loop muted controls",u,"track source"),n("source","src type media"),n("track","kind src srclang label default"),n("datalist","",c,"option"),n("article section nav aside header footer","",u),n("hgroup","","h1 h2 h3 h4 h5 h6"),n("figure","",u,"figcaption"),n("time","datetime",c),n("dialog","open",u),n("command","type label icon disabled checked radiogroup command"),n("output","for form name",c),n("progress","value max",c),n("meter","value min max low high optimum",c),n("details","open",u,"summary"),n("keygen","autofocus challenge disabled form keytype name")),"html5-strict"!=e&&(i("script","language xml:space"),i("style","xml:space"),i("object","declare classid codebase codetype archive standby align border hspace vspace"),i("param","valuetype type"),i("a","charset name rev shape coords"),i("br","clear"),i("applet","codebase archive code object alt name width height align hspace vspace"),i("img","name longdesc align border hspace vspace"),i("iframe","longdesc frameborder marginwidth marginheight scrolling align"),i("font basefont","size color face"),i("input","usemap align"),i("select","onchange"),i("textarea"),i("h1 h2 h3 h4 h5 h6 div p legend caption","align"),i("ul","type compact"),i("li","type"),i("ol dl menu dir","compact"),i("pre","width xml:space"),i("hr","align noshade size width"),i("isindex","prompt"),i("table","summary width frame rules cellspacing cellpadding align bgcolor"),i("col","width align char charoff valign"),i("colgroup","width align char charoff valign"),i("thead","align char charoff valign"),i("tr","align char charoff valign bgcolor"),i("th","axis align char charoff valign nowrap bgcolor width height"),i("form","accept"),i("td","abbr axis scope align char charoff valign nowrap bgcolor width height"),i("tfoot","align char charoff valign"),i("tbody","align char charoff valign"),i("area","nohref"),i("body","background bgcolor text link vlink alink")),"html4"!=e&&(i("input button select textarea","autofocus"),i("input textarea","placeholder"),i("a","download"),i("link script img","crossorigin"),i("iframe","srcdoc sandbox seamless allowfullscreen")),o(t("a form meter progress dfn"),function(e){a[e]&&delete a[e].children[e]}),delete a.caption.children.table,r[e]=a,a)}var r={},i=e.makeMap,o=e.each,a=e.extend,s=e.explode,l=e.inArray;return function(e){function c(t,n,o){var s=e[t];return s?s=i(s,",",i(s.toUpperCase()," ")):(s=r[t],s||(s=i(n," ",i(n.toUpperCase()," ")),s=a(s,o),r[t]=s)),s}function u(e){return new RegExp("^"+e.replace(/([?+*])/g,".$1")+"$")}function d(e){var n,r,o,a,s,c,d,f,p,m,h,g,y,C,x,w,_,N,E,S=/^([#+\-])?([^\[!\/]+)(?:\/([^\[!]+))?(?:(!?)\[([^\]]+)\])?$/,k=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,T=/[*?+]/;if(e)for(e=t(e,","),v["@"]&&(w=v["@"].attributes,_=v["@"].attributesOrder),n=0,r=e.length;r>n;n++)if(s=S.exec(e[n])){if(C=s[1],p=s[2],x=s[3],f=s[5],g={},y=[],c={attributes:g,attributesOrder:y},"#"===C&&(c.paddEmpty=!0),"-"===C&&(c.removeEmpty=!0),"!"===s[4]&&(c.removeEmptyAttrs=!0),w){for(N in w)g[N]=w[N];y.push.apply(y,_)}if(f)for(f=t(f,"|"),o=0,a=f.length;a>o;o++)if(s=k.exec(f[o])){if(d={},h=s[1],m=s[2].replace(/::/g,":"),C=s[3],E=s[4],"!"===h&&(c.attributesRequired=c.attributesRequired||[],c.attributesRequired.push(m),d.required=!0),"-"===h){delete g[m],y.splice(l(y,m),1);continue}C&&("="===C&&(c.attributesDefault=c.attributesDefault||[],c.attributesDefault.push({name:m,value:E}),d.defaultValue=E),":"===C&&(c.attributesForced=c.attributesForced||[],c.attributesForced.push({name:m,value:E}),d.forcedValue=E),"<"===C&&(d.validValues=i(E,"?"))),T.test(m)?(c.attributePatterns=c.attributePatterns||[],d.pattern=u(m),c.attributePatterns.push(d)):(g[m]||y.push(m),g[m]=d)}w||"@"!=p||(w=g,_=y),x&&(c.outputName=p,v[x]=c),T.test(p)?(c.pattern=u(p),b.push(c)):v[p]=c}}function f(e){v={},b=[],d(e),o(x,function(e,t){y[t]=e.children})}function p(e){var n=/^(~)?(.+)$/;e&&(r.text_block_elements=r.block_elements=null,o(t(e,","),function(e){var t=n.exec(e),r="~"===t[1],i=r?"span":"div",s=t[2];if(y[s]=y[i],R[s]=i,r||(S[s.toUpperCase()]={},S[s]={}),!v[s]){var l=v[i];l=a({},l),delete l.removeEmptyAttrs,delete l.removeEmpty,v[s]=l}o(y,function(e,t){e[i]&&(y[t]=e=a({},y[t]),e[s]=e[i])})}))}function m(e){var n=/^([+\-]?)(\w+)\[([^\]]+)\]$/;e&&o(t(e,","),function(e){var r=n.exec(e),i,s;r&&(s=r[1],i=s?y[r[2]]:y[r[2]]={"#comment":{}},i=y[r[2]],o(t(r[3],"|"),function(e){"-"===s?(y[r[2]]=i=a({},y[r[2]]),delete i[e]):i[e]={}}))})}function h(e){var t=v[e],n;if(t)return t;for(n=b.length;n--;)if(t=b[n],t.pattern.test(e))return t}var g=this,v={},y={},b=[],C,x,w,_,N,E,S,k,T,R={},A={};e=e||{},x=n(e.schema),e.verify_html===!1&&(e.valid_elements="*[*]"),e.valid_styles&&(C={},o(e.valid_styles,function(e,t){C[t]=s(e)})),w=c("whitespace_elements","pre script noscript style textarea video audio iframe object"),_=c("self_closing_elements","colgroup dd dt li option p td tfoot th thead tr"),N=c("short_ended_elements","area base basefont br col frame hr img input isindex link meta param embed source wbr track"),E=c("boolean_attributes","checked compact declare defer disabled ismap multiple nohref noresize noshade nowrap readonly selected autoplay loop controls"),k=c("non_empty_elements","td th iframe video audio object script",N),T=c("text_block_elements","h1 h2 h3 h4 h5 h6 p div address pre form blockquote center dir fieldset header footer article section hgroup aside nav figure"),S=c("block_elements","hr table tbody thead tfoot th tr td li ol ul caption dl dt dd noscript menu isindex option datalist select optgroup",T),o((e.special||"script noscript style textarea").split(" "),function(e){A[e]=new RegExp("]*>","gi")}),e.valid_elements?f(e.valid_elements):(o(x,function(e,t){v[t]={attributes:e.attributes,attributesOrder:e.attributesOrder},y[t]=e.children}),"html5"!=e.schema&&o(t("strong/b em/i"),function(e){e=t(e,"/"),v[e[1]].outputName=e[0]}),v.img.attributesDefault=[{name:"alt",value:""}],o(t("ol ul sub sup blockquote span font a table tbody tr strong em b i"),function(e){v[e]&&(v[e].removeEmpty=!0)}),o(t("p h1 h2 h3 h4 h5 h6 th td pre div address caption"),function(e){v[e].paddEmpty=!0}),o(t("span"),function(e){v[e].removeEmptyAttrs=!0})),p(e.custom_elements),m(e.valid_children),d(e.extended_valid_elements),m("+ol[ul|ol],+ul[ul|ol]"),e.invalid_elements&&o(s(e.invalid_elements),function(e){v[e]&&delete v[e]}),h("span")||d("span[!data-mce-type|*]"),g.children=y,g.styles=C,g.getBoolAttrs=function(){return E},g.getBlockElements=function(){return S},g.getTextBlockElements=function(){return T},g.getShortEndedElements=function(){return N},g.getSelfClosingElements=function(){return _},g.getNonEmptyElements=function(){return k},g.getWhiteSpaceElements=function(){return w},g.getSpecialElements=function(){return A},g.isValidChild=function(e,t){var n=y[e];return!(!n||!n[t])},g.isValid=function(e,t){var n,r,i=h(e);if(i){if(!t)return!0;if(i.attributes[t])return!0;if(n=i.attributePatterns)for(r=n.length;r--;)if(n[r].pattern.test(e))return!0}return!1},g.getElementRule=h,g.getCustomElements=function(){return R},g.addValidElements=d,g.setValidElements=f,g.addCustomElements=p,g.addValidChildren=m,g.elements=v}}),r(_,[w,h,p],function(e,t,n){var r=n.each;return function(i,o){function a(){}var s=this;i=i||{},s.schema=o=o||new e,i.fix_self_closing!==!1&&(i.fix_self_closing=!0),r("comment cdata text start end pi doctype".split(" "),function(e){e&&(s[e]=i[e]||a)}),s.parse=function(e){function r(e){var t,n;for(t=f.length;t--&&f[t].name!==e;);if(t>=0){for(n=f.length-1;n>=t;n--)e=f[n],e.valid&&s.end(e.name);f.length=t}}function a(e,t,n,r,o){var a,s,l=/[\s\u0000-\u001F]+/g;if(t=t.toLowerCase(),n=t in C?t:F(n||r||o||""),w&&!v&&0!==t.indexOf("data-")){if(a=k[t],!a&&T){for(s=T.length;s--&&(a=T[s],!a.pattern.test(t)););-1===s&&(a=null)}if(!a)return;if(a.validValues&&!(n in a.validValues))return}if(W[t]&&!i.allow_script_urls){var c=n.replace(l,"");try{if(c=decodeURIComponent(c),V.test(c))return}catch(u){if(c=unescape(c),V.test(c))return}}p.map[t]=n,p.push({name:t,value:n})}var s=this,l,c=0,u,d,f=[],p,m,h,g,v,y,b,C,x,w,_,N,E,S,k,T,R,A,B,L,D,M,H,P,O,I=0,F=t.decode,z,W=n.makeMap("src,href"),V=/(java|vb)script:/i;for(M=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([A-Za-z0-9\\-\\:\\.]+)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),H=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,b=o.getShortEndedElements(),D=i.self_closing_elements||o.getSelfClosingElements(),C=o.getBoolAttrs(),w=i.validate,y=i.remove_internals,z=i.fix_self_closing,P=o.getSpecialElements();l=M.exec(e);){if(c0&&f[f.length-1].name===u&&r(u),!w||(_=o.getElementRule(u))){if(N=!0,w&&(k=_.attributes,T=_.attributePatterns),(S=l[8])?(v=-1!==S.indexOf("data-mce-type"),v&&y&&(N=!1),p=[],p.map={},S.replace(H,a)):(p=[],p.map={}),w&&!v){if(R=_.attributesRequired,A=_.attributesDefault,B=_.attributesForced,L=_.removeEmptyAttrs,L&&!p.length&&(N=!1),B)for(m=B.length;m--;)E=B[m],g=E.name,O=E.value,"{$uid}"===O&&(O="mce_"+I++),p.map[g]=O,p.push({name:g,value:O});if(A)for(m=A.length;m--;)E=A[m],g=E.name,g in p.map||(O=E.value,"{$uid}"===O&&(O="mce_"+I++),p.map[g]=O,p.push({name:g,value:O}));if(R){for(m=R.length;m--&&!(R[m]in p.map););-1===m&&(N=!1)}p.map["data-mce-bogus"]&&(N=!1)}N&&s.start(u,p,x)}else N=!1;if(d=P[u]){d.lastIndex=c=l.index+l[0].length,(l=d.exec(e))?(N&&(h=e.substr(c,l.index-c)),c=l.index+l[0].length):(h=e.substr(c),c=e.length),N&&(h.length>0&&s.text(h,!0),s.end(u)),M.lastIndex=c;continue}x||(S&&S.indexOf("/")==S.length-1?N&&s.end(u):f.push({name:u,valid:N}))}else(u=l[1])?(">"===u.charAt(0)&&(u=" "+u),i.allow_conditional_comments||"[if"!==u.substr(0,3)||(u=" "+u),s.comment(u)):(u=l[2])?s.cdata(u):(u=l[3])?s.doctype(u):(u=l[4])&&s.pi(u,l[5]);c=l.index+l[0].length}for(c=0;m--)u=f[m],u.valid&&s.end(u.name)}}}),r(N,[x,w,_,p],function(e,t,n,r){var i=r.makeMap,o=r.each,a=r.explode,s=r.extend;return function(r,l){function c(t){var n,r,o,a,s,c,d,f,p,m,h,g,v,y;for(h=i("tr,td,th,tbody,thead,tfoot,table"),m=l.getNonEmptyElements(),g=l.getTextBlockElements(),n=0;n1){for(a.reverse(),s=c=u.filterNode(a[0].clone()),p=0;p0?(t.value=n,t=t.prev):(r=t.prev,t.remove(),t=r)}function g(e){var t,n={};for(t in e)"li"!==t&&"p"!=t&&(n[t]=e[t]);return n}var v,y,b,C,x,w,_,N,E,S,k,T,R,A=[],B,L,D,M,H,P,O,I;if(o=o||{},p={},m={},T=s(i("script,style,head,html,body,title,meta,param"),l.getBlockElements()),O=l.getNonEmptyElements(),P=l.children,k=r.validate,I="forced_root_block"in o?o.forced_root_block:r.forced_root_block,H=l.getWhiteSpaceElements(),R=/^[ \t\r\n]+/,L=/[ \t\r\n]+$/,D=/[ \t\r\n]+/g,M=/^[ \t\r\n]+$/,v=new n({validate:k,allow_script_urls:r.allow_script_urls,allow_conditional_comments:r.allow_conditional_comments,self_closing_elements:g(l.getSelfClosingElements()),cdata:function(e){b.append(u("#cdata",4)).value=e},text:function(e,t){var n;B||(e=e.replace(D," "),b.lastChild&&T[b.lastChild.name]&&(e=e.replace(R,""))),0!==e.length&&(n=u("#text",3),n.raw=!!t,b.append(n).value=e)},comment:function(e){b.append(u("#comment",8)).value=e},pi:function(e,t){b.append(u(e,7)).value=t,h(b)},doctype:function(e){var t;t=b.append(u("#doctype",10)),t.value=e,h(b)},start:function(e,t,n){var r,i,o,a,s;if(o=k?l.getElementRule(e):{}){for(r=u(o.outputName||e,1),r.attributes=t,r.shortEnded=n,b.append(r),s=P[b.name],s&&P[r.name]&&!s[r.name]&&A.push(r),i=f.length;i--;)a=f[i].name,a in t.map&&(E=m[a],E?E.push(r):m[a]=[r]);T[e]&&h(r),n||(b=r),!B&&H[e]&&(B=!0)}},end:function(t){var n,r,i,o,a;if(r=k?l.getElementRule(t):{}){if(T[t]&&!B){if(n=b.firstChild,n&&3===n.type)if(i=n.value.replace(R,""),i.length>0)n.value=i,n=n.next;else for(o=n.next,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.next,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o;if(n=b.lastChild,n&&3===n.type)if(i=n.value.replace(L,""),i.length>0)n.value=i,n=n.prev;else for(o=n.prev,n.remove(),n=o;n&&3===n.type;)i=n.value,o=n.prev,(0===i.length||M.test(i))&&(n.remove(),n=o),n=o}if(B&&H[t]&&(B=!1),(r.removeEmpty||r.paddEmpty)&&b.isEmpty(O))if(r.paddEmpty)b.empty().append(new e("#text","3")).value="\xa0";else if(!b.attributes.map.name&&!b.attributes.map.id)return a=b.parent,b.empty().remove(),void(b=a);b=b.parent}}},l),y=b=new e(o.context||r.root_name,11),v.parse(t),k&&A.length&&(o.context?o.invalid=!0:c(A)),I&&("body"==y.name||o.isRootContent)&&a(),!o.invalid){for(S in p){for(E=d[S],C=p[S],_=C.length;_--;)C[_].parent||C.splice(_,1);for(x=0,w=E.length;w>x;x++)E[x](C,S,o)}for(x=0,w=f.length;w>x;x++)if(E=f[x],E.name in m){for(C=m[E.name],_=C.length;_--;)C[_].parent||C.splice(_,1);for(_=0,N=E.callbacks.length;N>_;_++)E.callbacks[_](C,E.name,o)}}return y},r.remove_trailing_brs&&u.addNodeFilter("br",function(t){var n,r=t.length,i,o=s({},l.getBlockElements()),a=l.getNonEmptyElements(),c,u,d,f,p,m;for(o.body=1,n=0;r>n;n++)if(i=t[n],c=i.parent,o[i.parent.name]&&i===c.lastChild){for(d=i.prev;d;){if(f=d.name,"span"!==f||"bookmark"!==d.attr("data-mce-type")){if("br"!==f)break;if("br"===f){i=null;break}}d=d.prev}i&&(i.remove(),c.isEmpty(a)&&(p=l.getElementRule(c.name),p&&(p.removeEmpty?c.remove():p.paddEmpty&&(c.empty().append(new e("#text",3)).value="\xa0"))))}else{for(u=i;c&&c.firstChild===u&&c.lastChild===u&&(u=c,!o[c.name]);)c=c.parent;u===c&&(m=new e("#text",3),m.value="\xa0",i.replace(m))}}),r.allow_html_in_named_anchor||u.addAttributeFilter("id,name",function(e){for(var t=e.length,n,r,i,o;t--;)if(o=e[t],"a"===o.name&&o.firstChild&&!o.attr("href")){i=o.parent,n=o.lastChild;do r=n.prev,i.insert(n,o),n=r;while(n)}})}}),r(E,[h,p],function(e,t){var n=t.makeMap;return function(t){var r=[],i,o,a,s,l;return t=t||{},i=t.indent,o=n(t.indent_before||""),a=n(t.indent_after||""),s=e.getEncodeFunc(t.entity_encoding||"raw",t.entities),l="html"==t.element_format,{start:function(e,t,n){var c,u,d,f;if(i&&o[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n")),r.push("<",e),t)for(c=0,u=t.length;u>c;c++)d=t[c],r.push(" ",d.name,'="',s(d.value,!0),'"');r[r.length]=!n||l?">":" />",n&&i&&a[e]&&r.length>0&&(f=r[r.length-1],f.length>0&&"\n"!==f&&r.push("\n"))},end:function(e){var t;r.push(""),i&&a[e]&&r.length>0&&(t=r[r.length-1],t.length>0&&"\n"!==t&&r.push("\n"))},text:function(e,t){e.length>0&&(r[r.length]=t?e:s(e))},cdata:function(e){r.push("")},comment:function(e){r.push("")},pi:function(e,t){t?r.push(""):r.push(""),i&&r.push("\n")},doctype:function(e){r.push("",i?"\n":"")},reset:function(){r.length=0},getContent:function(){return r.join("").replace(/\n$/,"")}}}}),r(S,[E,w],function(e,t){return function(n,r){var i=this,o=new e(n);n=n||{},n.validate="validate"in n?n.validate:!0,i.schema=r=r||new t,i.writer=o,i.serialize=function(e){function t(e){var n=i[e.type],s,l,c,u,d,f,p,m,h;if(n)n(e);else{if(s=e.name,l=e.shortEnded,c=e.attributes,a&&c&&c.length>1){for(f=[],f.map={},h=r.getElementRule(e.name),p=0,m=h.attributesOrder.length;m>p;p++)u=h.attributesOrder[p],u in c.map&&(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));for(p=0,m=c.length;m>p;p++)u=c[p].name,u in f.map||(d=c.map[u],f.map[u]=d,f.push({name:u,value:d}));c=f}if(o.start(e.name,c,l),!l){if(e=e.firstChild)do t(e);while(e=e.next);o.end(s)}}}var i,a;return a=n.validate,i={3:function(e){o.text(e.value,e.raw)},8:function(e){o.comment(e.value)},7:function(e){o.pi(e.name,e.value)},10:function(e){o.doctype(e.value)},4:function(e){o.cdata(e.value)},11:function(e){if(e=e.firstChild)do t(e);while(e=e.next)}},o.reset(),1!=e.type||n.inner?i[11](e):t(e),o.getContent()}}}),r(k,[y,N,h,S,x,w,g,p],function(e,t,n,r,i,o,a,s){var l=s.each,c=s.trim,u=e.DOM;return function(e,i){var s,d,f;return i&&(s=i.dom,d=i.schema),s=s||u,d=d||new o(e),e.entity_encoding=e.entity_encoding||"named",e.remove_trailing_brs="remove_trailing_brs"in e?e.remove_trailing_brs:!0,f=new t(e,d),f.addAttributeFilter("src,href,style",function(t,n){for(var r=t.length,i,o,a="data-mce-"+n,l=e.url_converter,c=e.url_converter_scope,u;r--;)i=t[r],o=i.attributes.map[a],o!==u?(i.attr(n,o.length>0?o:null),i.attr(a,null)):(o=i.attributes.map[n],"style"===n?o=s.serializeStyle(s.parseStyle(o),i.name):l&&(o=l.call(c,o,n,i.name)),i.attr(n,o.length>0?o:null))}),f.addAttributeFilter("class",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.attr("class").replace(/(?:^|\s)mce-item-\w+(?!\S)/g,""),n.attr("class",r.length>0?r:null)}),f.addAttributeFilter("data-mce-type",function(e,t,n){for(var r=e.length,i;r--;)i=e[r],"bookmark"!==i.attributes.map["data-mce-type"]||n.cleanup||i.remove()}),f.addAttributeFilter("data-mce-expando",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),f.addNodeFilter("noscript",function(e){for(var t=e.length,r;t--;)r=e[t].firstChild,r&&(r.value=n.decode(r.value))}),f.addNodeFilter("script,style",function(e,t){function n(e){return e.replace(/()/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")}for(var r=e.length,i,o;r--;)if(i=e[r],o=i.firstChild?i.firstChild.value:"","script"===t){var a=(i.attr("type")||"text/javascript").replace(/^mce\-/,"");i.attr("type","text/javascript"===a?null:a),o.length>0&&(i.firstChild.value="// ")}else o.length>0&&(i.firstChild.value="")}),f.addNodeFilter("#comment",function(e){for(var t=e.length,n;t--;)n=e[t],0===n.value.indexOf("[CDATA[")?(n.name="#cdata",n.type=4,n.value=n.value.replace(/^\[CDATA\[|\]\]$/g,"")):0===n.value.indexOf("mce:protected ")&&(n.name="#text",n.type=3,n.raw=!0,n.value=unescape(n.value).substr(14))}),f.addNodeFilter("xml:namespace,input",function(e,t){for(var n=e.length,r;n--;)r=e[n],7===r.type?r.remove():1===r.type&&("input"!==t||"type"in r.attributes.map||r.attr("type","text"))}),e.fix_list_elements&&f.addNodeFilter("ul,ol",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.parent,("ul"===r.name||"ol"===r.name)&&n.prev&&"li"===n.prev.name&&n.prev.append(n)}),f.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style,data-mce-selected",function(e,t){for(var n=e.length;n--;)e[n].attr(t,null)}),{schema:d,addNodeFilter:f.addNodeFilter,addAttributeFilter:f.addAttributeFilter,serialize:function(t,n){var i=this,o,u,p,m,h;return a.ie&&s.select("script,style,select,map").length>0?(h=t.innerHTML,t=t.cloneNode(!1),s.setHTML(t,h)):t=t.cloneNode(!0),o=t.ownerDocument.implementation,o.createHTMLDocument&&(u=o.createHTMLDocument(""),l("BODY"==t.nodeName?t.childNodes:[t],function(e){u.body.appendChild(u.importNode(e,!0))}),t="BODY"!=t.nodeName?u.body.firstChild:u.body,p=s.doc,s.doc=u),n=n||{},n.format=n.format||"html",n.selection&&(n.forced_root_block=""),n.no_events||(n.node=t,i.onPreProcess(n)),m=new r(e,d),n.content=m.serialize(f.parse(c(n.getInner?t.innerHTML:s.getOuterHTML(t)),n)),n.cleanup||(n.content=n.content.replace(/\uFEFF/g,"")),n.no_events||i.onPostProcess(n),p&&(s.doc=p),n.node=null,n.content},addRules:function(e){d.addValidElements(e)},setRules:function(e){d.setValidElements(e)},onPreProcess:function(e){i&&i.fire("PreProcess",e)},onPostProcess:function(e){i&&i.fire("PostProcess",e)}}}}),r(T,[],function(){function e(e){function t(t,n){var r,i=0,o,a,s,l,c,u,d=-1,f;if(r=t.duplicate(),r.collapse(n),f=r.parentElement(),f.ownerDocument===e.dom.doc){for(;"false"===f.contentEditable;)f=f.parentNode;if(!f.hasChildNodes())return{node:f,inside:1};for(s=f.children,o=s.length-1;o>=i;)if(u=Math.floor((i+o)/2),l=s[u],r.moveToElementText(l),d=r.compareEndPoints(n?"StartToStart":"EndToEnd",t),d>0)o=u-1;else{if(!(0>d))return{node:l};i=u+1}if(0>d)for(l?r.collapse(!1):(r.moveToElementText(f),r.collapse(!0),l=f,a=!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",1)&&f==r.parentElement();)c++;else for(r.collapse(!0),c=0;0!==r.compareEndPoints(n?"StartToStart":"StartToEnd",t)&&0!==r.move("character",-1)&&f==r.parentElement();)c++;return{node:l,position:d,offset:c,inside:a}}}function n(){function n(e){var n=t(o,e),r,i,s=0,l,c,u;if(r=n.node,i=n.offset,n.inside&&!r.hasChildNodes())return void a[e?"setStart":"setEnd"](r,0);if(i===c)return void a[e?"setStartBefore":"setEndAfter"](r);if(n.position<0){if(l=n.inside?r.firstChild:r.nextSibling,!l)return void a[e?"setStartAfter":"setEndAfter"](r);if(!i)return void(3==l.nodeType?a[e?"setStart":"setEnd"](l,0):a[e?"setStartBefore":"setEndBefore"](l)); -for(;l;){if(u=l.nodeValue,s+=u.length,s>=i){r=l,s-=i,s=u.length-s;break}l=l.nextSibling}}else{if(l=r.previousSibling,!l)return a[e?"setStartBefore":"setEndBefore"](r);if(!i)return void(3==r.nodeType?a[e?"setStart":"setEnd"](l,r.nodeValue.length):a[e?"setStartAfter":"setEndAfter"](l));for(;l;){if(s+=l.nodeValue.length,s>=i){r=l,s-=i;break}l=l.previousSibling}}a[e?"setStart":"setEnd"](r,s)}var o=e.getRng(),a=i.createRng(),s,l,c,u,d;if(s=o.item?o.item(0):o.parentElement(),s.ownerDocument!=i.doc)return a;if(l=e.isCollapsed(),o.item)return a.setStart(s.parentNode,i.nodeIndex(s)),a.setEnd(a.startContainer,a.startOffset+1),a;try{n(!0),l||n()}catch(f){if(-2147024809!=f.number)throw f;d=r.getBookmark(2),c=o.duplicate(),c.collapse(!0),s=c.parentElement(),l||(c=o.duplicate(),c.collapse(!1),u=c.parentElement(),u.innerHTML=u.innerHTML),s.innerHTML=s.innerHTML,r.moveToBookmark(d),o=e.getRng(),n(!0),l||n()}return a}var r=this,i=e.dom,o=!1;this.getBookmark=function(n){function r(e){var t,n,r,o,a=[];for(t=e.parentNode,n=i.getRoot().parentNode;t!=n&&9!==t.nodeType;){for(r=t.children,o=r.length;o--;)if(e===r[o]){a.push(o);break}e=t,t=t.parentNode}return a}function o(e){var n;return n=t(a,e),n?{position:n.position,offset:n.offset,indexes:r(n.node),inside:n.inside}:void 0}var a=e.getRng(),s={};return 2===n&&(a.item?s.start={ctrl:!0,indexes:r(a.item(0))}:(s.start=o(!0),e.isCollapsed()||(s.end=o()))),s},this.moveToBookmark=function(e){function t(e){var t,n,r,o;for(t=i.getRoot(),n=e.length-1;n>=0;n--)o=t.children,r=e[n],r<=o.length-1&&(t=o[r]);return t}function n(n){var i=e[n?"start":"end"],a,s,l,c;i&&(a=i.position>0,s=o.createTextRange(),s.moveToElementText(t(i.indexes)),c=i.offset,c!==l?(s.collapse(i.inside||a),s.moveStart("character",a?-c:c)):s.collapse(n),r.setEndPoint(n?"StartToStart":"EndToStart",s),n&&r.collapse(!0))}var r,o=i.doc.body;e.start&&(e.start.ctrl?(r=o.createControlRange(),r.addElement(t(e.start.indexes)),r.select()):(r=o.createTextRange(),n(!0),n(),r.select()))},this.addRange=function(t){function n(e){var t,n,a,d,m;a=i.create("a"),t=e?s:c,n=e?l:u,d=r.duplicate(),(t==f||t==f.documentElement)&&(t=p,n=0),3==t.nodeType?(t.parentNode.insertBefore(a,t),d.moveToElementText(a),d.moveStart("character",n),i.remove(a),r.setEndPoint(e?"StartToStart":"EndToEnd",d)):(m=t.childNodes,m.length?(n>=m.length?i.insertAfter(a,m[m.length-1]):t.insertBefore(a,m[n]),d.moveToElementText(a)):t.canHaveHTML&&(t.innerHTML="",a=t.firstChild,d.moveToElementText(a),d.collapse(o)),r.setEndPoint(e?"StartToStart":"EndToEnd",d),i.remove(a))}var r,a,s,l,c,u,d,f=e.dom.doc,p=f.body,m,h;if(s=t.startContainer,l=t.startOffset,c=t.endContainer,u=t.endOffset,r=p.createTextRange(),s==c&&1==s.nodeType){if(l==u&&!s.hasChildNodes()){if(s.canHaveHTML)return d=s.previousSibling,d&&!d.hasChildNodes()&&i.isBlock(d)?d.innerHTML="":d=null,s.innerHTML="",r.moveToElementText(s.lastChild),r.select(),i.doc.selection.clear(),s.innerHTML="",void(d&&(d.innerHTML=""));l=i.nodeIndex(s),s=s.parentNode}if(l==u-1)try{if(h=s.childNodes[l],a=p.createControlRange(),a.addElement(h),a.select(),m=e.getRng(),m.item&&h===m.item(0))return}catch(g){}}n(!0),n(),r.select()},this.getRangeAt=n}return e}),r(R,[g],function(e){return{BACKSPACE:8,DELETE:46,DOWN:40,ENTER:13,LEFT:37,RIGHT:39,SPACEBAR:32,TAB:9,UP:38,modifierPressed:function(e){return e.shiftKey||e.ctrlKey||e.altKey},metaKeyPressed:function(t){return(e.mac?t.metaKey:t.ctrlKey)&&!t.altKey}}}),r(A,[R,p,g],function(e,t,n){return function(r,i){function o(e){var t=i.settings.object_resizing;return t===!1||n.iOS?!1:("string"!=typeof t&&(t="table,img,div"),"false"===e.getAttribute("data-mce-resize")?!1:i.dom.is(e,t))}function a(t){var n,r;n=t.screenX-k,r=t.screenY-T,H=n*E[2]+B,P=r*E[3]+L,H=5>H?5:H,P=5>P?5:P,(e.modifierPressed(t)||"IMG"==w.nodeName&&E[2]*E[3]!==0)&&(H=Math.round(P/D),P=Math.round(H*D)),C.setStyles(_,{width:H,height:P}),E[2]<0&&_.clientWidth<=H&&C.setStyle(_,"left",R+(B-H)),E[3]<0&&_.clientHeight<=P&&C.setStyle(_,"top",A+(L-P)),M||(i.fire("ObjectResizeStart",{target:w,width:B,height:L}),M=!0)}function s(){function e(e,t){t&&(w.style[e]||!i.schema.isValid(w.nodeName.toLowerCase(),e)?C.setStyle(w,e,t):C.setAttrib(w,e,t))}M=!1,e("width",H),e("height",P),C.unbind(O,"mousemove",a),C.unbind(O,"mouseup",s),I!=O&&(C.unbind(I,"mousemove",a),C.unbind(I,"mouseup",s)),C.remove(_),F&&"TABLE"!=w.nodeName||l(w),i.fire("ObjectResized",{target:w,width:H,height:P}),i.nodeChanged()}function l(e,t,r){var l,u,d,f,p,m=i.getBody();g(),l=C.getPos(e,m),R=l.x,A=l.y,p=e.getBoundingClientRect(),u=p.width||p.right-p.left,d=p.height||p.bottom-p.top,w!=e&&(h(),w=e,H=P=0),f=i.fire("ObjectSelected",{target:e}),o(e)&&!f.isDefaultPrevented()?x(N,function(e,o){function l(t){k=t.screenX,T=t.screenY,B=w.clientWidth,L=w.clientHeight,D=L/B,E=e,_=w.cloneNode(!0),C.addClass(_,"mce-clonedresizable"),_.contentEditable=!1,_.unSelectabe=!0,C.setStyles(_,{left:R,top:A,margin:0}),_.removeAttribute("data-mce-selected"),i.getBody().appendChild(_),C.bind(O,"mousemove",a),C.bind(O,"mouseup",s),I!=O&&(C.bind(I,"mousemove",a),C.bind(I,"mouseup",s))}var c,f;return t?void(o==t&&l(r)):(c=C.get("mceResizeHandle"+o),c?C.show(c):(f=i.getBody(),c=C.add(f,"div",{id:"mceResizeHandle"+o,"data-mce-bogus":!0,"class":"mce-resizehandle",unselectable:!0,style:"cursor:"+o+"-resize; margin:0; padding:0"}),n.ie&&(c.contentEditable=!1)),e.elm||(C.bind(c,"mousedown",function(e){e.stopImmediatePropagation(),e.preventDefault(),l(e)}),e.elm=c),void C.setStyles(c,{left:u*e[0]+R-c.offsetWidth/2,top:d*e[1]+A-c.offsetHeight/2}))}):c(),w.setAttribute("data-mce-selected","1")}function c(){var e,t;g(),w&&w.removeAttribute("data-mce-selected");for(e in N)t=C.get("mceResizeHandle"+e),t&&(C.unbind(t),C.remove(t))}function u(e){function t(e,t){if(e)do if(e===t)return!0;while(e=e.parentNode)}var n;return x(C.select("img[data-mce-selected],hr[data-mce-selected]"),function(e){e.removeAttribute("data-mce-selected")}),n="mousedown"==e.type?e.target:r.getNode(),n=C.getParent(n,F?"table":"table,img,hr"),t(n,i.getBody())&&(v(),t(r.getStart(),n)&&t(r.getEnd(),n)&&(!F||n!=r.getStart()&&"IMG"!==r.getStart().nodeName))?void l(n):void c()}function d(e,t,n){e&&e.attachEvent&&e.attachEvent("on"+t,n)}function f(e,t,n){e&&e.detachEvent&&e.detachEvent("on"+t,n)}function p(e){var t=e.srcElement,n,r,o,a,s,c,u;n=t.getBoundingClientRect(),c=S.clientX-n.left,u=S.clientY-n.top;for(r in N)if(o=N[r],a=t.offsetWidth*o[0],s=t.offsetHeight*o[1],Math.abs(a-c)<8&&Math.abs(s-u)<8){E=o;break}M=!0,i.getDoc().selection.empty(),l(t,r,S)}function m(e){var t=e.srcElement;if(t!=w){if(h(),0===t.id.indexOf("mceResizeHandle"))return void(e.returnValue=!1);("IMG"==t.nodeName||"TABLE"==t.nodeName)&&(c(),w=t,d(t,"resizestart",p))}}function h(){f(w,"resizestart",p)}function g(){for(var e in N){var t=N[e];t.elm&&(C.unbind(t.elm),delete t.elm)}}function v(){try{i.getDoc().execCommand("enableObjectResizing",!1,!1)}catch(e){}}function y(e){var t;if(F){t=O.body.createControlRange();try{return t.addElement(e),t.select(),!0}catch(n){}}}function b(){w=_=null,F&&(h(),f(i.getBody(),"controlselect",m))}var C=i.dom,x=t.each,w,_,N,E,S,k,T,R,A,B,L,D,M,H,P,O=i.getDoc(),I=document,F=n.ie&&n.ie<11;N={n:[.5,0,0,-1],e:[1,.5,1,0],s:[.5,1,0,1],w:[0,.5,-1,0],nw:[0,0,-1,-1],ne:[1,0,1,-1],se:[1,1,1,1],sw:[0,1,-1,1]};var z=".mce-content-body";return i.contentStyles.push(z+" div.mce-resizehandle {position: absolute;border: 1px solid black;background: #FFF;width: 5px;height: 5px;z-index: 10000}"+z+" .mce-resizehandle:hover {background: #000}"+z+" img[data-mce-selected], hr[data-mce-selected] {outline: 1px solid black;resize: none}"+z+" .mce-clonedresizable {position: absolute;"+(n.gecko?"":"outline: 1px dashed black;")+"opacity: .5;filter: alpha(opacity=50);z-index: 10000}"),i.on("init",function(){F?(i.on("ObjectResized",function(e){"TABLE"!=e.target.nodeName&&(c(),y(e.target))}),d(i.getBody(),"controlselect",m),i.on("mousedown",function(e){S=e})):(v(),n.ie>=11&&(i.on("mouseup",function(e){var t=e.target.nodeName;/^(TABLE|IMG|HR)$/.test(t)&&(i.selection.select(e.target,"TABLE"==t),i.nodeChanged())}),i.dom.bind(i.getBody(),"mscontrolselect",function(e){/^(TABLE|IMG|HR)$/.test(e.target.nodeName)&&(e.preventDefault(),"IMG"==e.target.tagName&&window.setTimeout(function(){i.selection.select(e.target)},0))}))),i.on("nodechange mousedown mouseup ResizeEditor",u),i.on("keydown keyup",function(e){w&&"TABLE"==w.nodeName&&u(e)})}),i.on("remove",g),{isResizable:o,showResizeRect:l,hideResizeRect:c,updateResizeRect:u,controlSelect:y,destroy:b}}}),r(B,[p,f],function(e,t){function n(e){this.walk=function(t,n){function i(e){var t;return t=e[0],3===t.nodeType&&t===l&&c>=t.nodeValue.length&&e.splice(0,1),t=e[e.length-1],0===d&&e.length>0&&t===u&&3===t.nodeType&&e.splice(e.length-1,1),e}function o(e,t,n){for(var r=[];e&&e!=n;e=e[t])r.push(e);return r}function a(e,t){do{if(e.parentNode==t)return e;e=e.parentNode}while(e)}function s(e,t,r){var a=r?"nextSibling":"previousSibling";for(h=e,g=h.parentNode;h&&h!=t;h=g)g=h.parentNode,v=o(h==e?h:h[a],a),v.length&&(r||v.reverse(),n(i(v)))}var l=t.startContainer,c=t.startOffset,u=t.endContainer,d=t.endOffset,f,p,m,h,g,v,y;if(y=e.select("td.mce-item-selected,th.mce-item-selected"),y.length>0)return void r(y,function(e){n([e])});if(1==l.nodeType&&l.hasChildNodes()&&(l=l.childNodes[c]),1==u.nodeType&&u.hasChildNodes()&&(u=u.childNodes[Math.min(d-1,u.childNodes.length-1)]),l==u)return n(i([l]));for(f=e.findCommonAncestor(l,u),h=l;h;h=h.parentNode){if(h===u)return s(l,f,!0);if(h===f)break}for(h=u;h;h=h.parentNode){if(h===l)return s(u,f);if(h===f)break}p=a(l,f)||l,m=a(u,f)||u,s(l,p,!0),v=o(p==l?p:p.nextSibling,"nextSibling",m==u?m.nextSibling:m),v.length&&n(i(v)),s(u,m)},this.split=function(e){function t(e,t){return e.splitText(t)}var n=e.startContainer,r=e.startOffset,i=e.endContainer,o=e.endOffset;return n==i&&3==n.nodeType?r>0&&rr?(o-=r,n=i=t(i,o).previousSibling,o=i.nodeValue.length,r=0):o=0):(3==n.nodeType&&r>0&&r0&&o0)return c=p,u=n?p.nodeValue.length:0,void(i=!0);if(e.isBlock(p)||m[p.nodeName.toLowerCase()])return;s=p}o&&s&&(c=s,i=!0,u=0)}var c,u,d,f=e.getRoot(),p,m,h,g,v;if(c=n[(r?"start":"end")+"Container"],u=n[(r?"start":"end")+"Offset"],v=1==c.nodeType&&u===c.childNodes.length,m=e.schema.getNonEmptyElements(),g=r,1==c.nodeType&&u>c.childNodes.length-1&&(g=!1),9===c.nodeType&&(c=e.getRoot(),u=0),c===f){if(g&&(p=c.childNodes[u>0?u-1:0],p&&(h=p.nodeName.toLowerCase(),m[p.nodeName]||"TABLE"==p.nodeName)))return;if(c.hasChildNodes()&&(u=Math.min(!g&&u>0?u-1:u,c.childNodes.length-1),c=c.childNodes[u],u=0,c.hasChildNodes()&&!/TABLE/.test(c.nodeName))){p=c,d=new t(c,f);do{if(3===p.nodeType&&p.nodeValue.length>0){u=g?0:p.nodeValue.length,c=p,i=!0;break}if(m[p.nodeName.toLowerCase()]){u=e.nodeIndex(p),c=p.parentNode,"IMG"!=p.nodeName||g||u++,i=!0;break}}while(p=g?d.next():d.prev())}}o&&(3===c.nodeType&&0===u&&l(!0),1===c.nodeType&&(p=c.childNodes[u],p||(p=c.childNodes[u-1]),!p||"BR"!==p.nodeName||s(p,"A")||a(p)||a(p,!0)||l(!0,p))),g&&!o&&3===c.nodeType&&u===c.nodeValue.length&&l(!1),i&&n["set"+(r?"Start":"End")](c,u)}var i,o;return o=n.collapsed,r(!0),o||r(),i&&o&&n.collapse(!0),i}}var r=e.each;return n.compareRanges=function(e,t){if(e&&t){if(!e.item&&!e.duplicate)return e.startContainer==t.startContainer&&e.startOffset==t.startOffset;if(e.item&&t.item&&e.item(0)===t.item(0))return!0;if(e.isEqual&&t.isEqual&&t.isEqual(e))return!0}return!1},n}),r(L,[f,T,A,B,g,p],function(e,n,r,i,o,a){function s(e,t,i,o){var a=this;a.dom=e,a.win=t,a.serializer=i,a.editor=o,a.controlSelection=new r(a,o),a.win.getSelection||(a.tridentSel=new n(a))}var l=a.each,c=a.grep,u=a.trim,d=o.ie,f=o.opera;return s.prototype={setCursorLocation:function(e,t){var n=this,r=n.dom.createRng();e?(r.setStart(e,t),r.setEnd(e,t),n.setRng(r),n.collapse(!1)):(n._moveEndPoint(r,n.editor.getBody(),!0),n.setRng(r))},getContent:function(e){var n=this,r=n.getRng(),i=n.dom.create("body"),o=n.getSel(),a,s,l;return e=e||{},a=s="",e.get=!0,e.format=e.format||"html",e.selection=!0,n.editor.fire("BeforeGetContent",e),"text"==e.format?n.isCollapsed()?"":r.text||(o.toString?o.toString():""):(r.cloneContents?(l=r.cloneContents(),l&&i.appendChild(l)):r.item!==t||r.htmlText!==t?(i.innerHTML="
    "+(r.item?r.item(0).outerHTML:r.htmlText),i.removeChild(i.firstChild)):i.innerHTML=r.toString(),/^\s/.test(i.innerHTML)&&(a=" "),/\s+$/.test(i.innerHTML)&&(s=" "),e.getInner=!0,e.content=n.isCollapsed()?"":a+n.serializer.serialize(i,e)+s,n.editor.fire("GetContent",e),e.content)},setContent:function(e,t){var n=this,r=n.getRng(),i,o=n.win.document,a,s;if(t=t||{format:"html"},t.set=!0,t.selection=!0,e=t.content=e,t.no_events||n.editor.fire("BeforeSetContent",t),e=t.content,r.insertNode){e+='_',r.startContainer==o&&r.endContainer==o?o.body.innerHTML=e:(r.deleteContents(),0===o.body.childNodes.length?o.body.innerHTML=e:r.createContextualFragment?r.insertNode(r.createContextualFragment(e)):(a=o.createDocumentFragment(),s=o.createElement("div"),a.appendChild(s),s.outerHTML=e,r.insertNode(a))),i=n.dom.get("__caret"),r=o.createRange(),r.setStartBefore(i),r.setEndBefore(i),n.setRng(r),n.dom.remove("__caret");try{n.setRng(r)}catch(l){}}else r.item&&(o.execCommand("Delete",!1,null),r=n.getRng()),/^\s+/.test(e)?(r.pasteHTML('_'+e),n.dom.remove("__mce_tmp")):r.pasteHTML(e);t.no_events||n.editor.fire("SetContent",t)},getStart:function(){var e=this,t=e.getRng(),n,r,i,o;if(t.duplicate||t.item){if(t.item)return t.item(0);for(i=t.duplicate(),i.collapse(1),n=i.parentElement(),n.ownerDocument!==e.dom.doc&&(n=e.dom.getRoot()),r=o=t.parentElement();o=o.parentNode;)if(o==n){n=r;break}return n}return n=t.startContainer,1==n.nodeType&&n.hasChildNodes()&&(n=n.childNodes[Math.min(n.childNodes.length-1,t.startOffset)]),n&&3==n.nodeType?n.parentNode:n},getEnd:function(){var e=this,t=e.getRng(),n,r;return t.duplicate||t.item?t.item?t.item(0):(t=t.duplicate(),t.collapse(0),n=t.parentElement(),n.ownerDocument!==e.dom.doc&&(n=e.dom.getRoot()),n&&"BODY"==n.nodeName?n.lastChild||n:n):(n=t.endContainer,r=t.endOffset,1==n.nodeType&&n.hasChildNodes()&&(n=n.childNodes[r>0?r-1:r]),n&&3==n.nodeType?n.parentNode:n)},getBookmark:function(e,t){function n(e,t){var n=0;return l(a.select(e),function(e,r){e==t&&(n=r)}),n}function r(e){function t(t){var n,r,i,o=t?"start":"end";n=e[o+"Container"],r=e[o+"Offset"],1==n.nodeType&&"TR"==n.nodeName&&(i=n.childNodes,n=i[Math.min(t?r:r-1,i.length-1)],n&&(r=t?0:n.childNodes.length,e["set"+(t?"Start":"End")](n,r)))}return t(!0),t(),e}function i(){function e(e,n){var i=e[n?"startContainer":"endContainer"],a=e[n?"startOffset":"endOffset"],s=[],l,c,u=0;if(3==i.nodeType){if(t)for(l=i.previousSibling;l&&3==l.nodeType;l=l.previousSibling)a+=l.nodeValue.length;s.push(a)}else c=i.childNodes,a>=c.length&&c.length&&(u=1,a=Math.max(0,c.length-1)),s.push(o.dom.nodeIndex(c[a],t)+u);for(;i&&i!=r;i=i.parentNode)s.push(o.dom.nodeIndex(i,t));return s}var n=o.getRng(!0),r=a.getRoot(),i={};return i.start=e(n,!0),o.isCollapsed()||(i.end=e(n)),i}var o=this,a=o.dom,s,c,u,d,f,p,m="",h;if(2==e)return p=o.getNode(),f=p?p.nodeName:null,"IMG"==f?{name:f,index:n(f,p)}:o.tridentSel?o.tridentSel.getBookmark(e):i();if(e)return{rng:o.getRng()};if(s=o.getRng(),u=a.uniqueId(),d=o.isCollapsed(),h="overflow:hidden;line-height:0px",s.duplicate||s.item){if(s.item)return p=s.item(0),f=p.nodeName,{name:f,index:n(f,p)};c=s.duplicate();try{s.collapse(),s.pasteHTML(''+m+""),d||(c.collapse(!1),s.moveToElementText(c.parentElement()),0===s.compareEndPoints("StartToEnd",c)&&c.move("character",-1),c.pasteHTML(''+m+""))}catch(g){return null}}else{if(p=o.getNode(),f=p.nodeName,"IMG"==f)return{name:f,index:n(f,p)};c=r(s.cloneRange()),d||(c.collapse(!1),c.insertNode(a.create("span",{"data-mce-type":"bookmark",id:u+"_end",style:h},m))),s=r(s),s.collapse(!0),s.insertNode(a.create("span",{"data-mce-type":"bookmark",id:u+"_start",style:h},m))}return o.moveToBookmark({id:u,keep:1}),{id:u}},moveToBookmark:function(e){function t(t){var n=e[t?"start":"end"],r,i,o,l;if(n){for(o=n[0],i=s,r=n.length-1;r>=1;r--){if(l=i.childNodes,n[r]>l.length-1)return;i=l[n[r]]}3===i.nodeType&&(o=Math.min(n[0],i.nodeValue.length)),1===i.nodeType&&(o=Math.min(n[0],i.childNodes.length)),t?a.setStart(i,o):a.setEnd(i,o)}return!0}function n(t){var n=o.get(e.id+"_"+t),r,i,a,s,d=e.keep;if(n&&(r=n.parentNode,"start"==t?(d?(r=n.firstChild,i=1):i=o.nodeIndex(n),u=p=r,m=h=i):(d?(r=n.firstChild,i=1):i=o.nodeIndex(n),p=r,h=i),!d)){for(s=n.previousSibling,a=n.nextSibling,l(c(n.childNodes),function(e){3==e.nodeType&&(e.nodeValue=e.nodeValue.replace(/\uFEFF/g,""))});n=o.get(e.id+"_"+t);)o.remove(n,1);s&&a&&s.nodeType==a.nodeType&&3==s.nodeType&&!f&&(i=s.nodeValue.length,s.appendData(a.nodeValue),o.remove(a),"start"==t?(u=p=s,m=h=i):(p=s,h=i))}}function r(e){return!o.isBlock(e)||e.innerHTML||d||(e.innerHTML='
    '),e}var i=this,o=i.dom,a,s,u,p,m,h;if(e)if(e.start){if(a=o.createRng(),s=o.getRoot(),i.tridentSel)return i.tridentSel.moveToBookmark(e);t(!0)&&t()&&i.setRng(a)}else e.id?(n("start"),n("end"),u&&(a=o.createRng(),a.setStart(r(u),m),a.setEnd(r(p),h),i.setRng(a))):e.name?i.select(o.select(e.name)[e.index]):e.rng&&i.setRng(e.rng)},select:function(e,t){var n=this,r=n.dom,i=r.createRng(),o;if(n.lastFocusBookmark=null,e){if(!t&&n.controlSelection.controlSelect(e))return;o=r.nodeIndex(e),i.setStart(e.parentNode,o),i.setEnd(e.parentNode,o+1),t&&(n._moveEndPoint(i,e,!0),n._moveEndPoint(i,e)),n.setRng(i)}return e},isCollapsed:function(){var e=this,t=e.getRng(),n=e.getSel();return!t||t.item?!1:t.compareEndPoints?0===t.compareEndPoints("StartToEnd",t):!n||t.collapsed},collapse:function(e){var t=this,n=t.getRng(),r;n.item&&(r=n.item(0),n=t.win.document.body.createTextRange(),n.moveToElementText(r)),n.collapse(!!e),t.setRng(n)},getSel:function(){var e=this.win;return e.getSelection?e.getSelection():e.document.selection},getRng:function(e){function t(e,t,n){try{return t.compareBoundaryPoints(e,n)}catch(r){return-1}}var n=this,r,i,o,a=n.win.document,s;if(!e&&n.lastFocusBookmark){var l=n.lastFocusBookmark;return l.startContainer?(i=a.createRange(),i.setStart(l.startContainer,l.startOffset),i.setEnd(l.endContainer,l.endOffset)):i=l,i}if(e&&n.tridentSel)return n.tridentSel.getRangeAt(0);try{(r=n.getSel())&&(i=r.rangeCount>0?r.getRangeAt(0):r.createRange?r.createRange():a.createRange())}catch(c){}if(d&&i&&i.setStart&&a.selection){try{s=a.selection.createRange()}catch(c){}s&&s.item&&(o=s.item(0),i=a.createRange(),i.setStartBefore(o),i.setEndAfter(o))}return i||(i=a.createRange?a.createRange():a.body.createTextRange()),i.setStart&&9===i.startContainer.nodeType&&i.collapsed&&(o=n.dom.getRoot(),i.setStart(o,0),i.setEnd(o,0)),n.selectedRange&&n.explicitRange&&(0===t(i.START_TO_START,i,n.selectedRange)&&0===t(i.END_TO_END,i,n.selectedRange)?i=n.explicitRange:(n.selectedRange=null,n.explicitRange=null)),i},setRng:function(e,t){var n=this,r;if(e.select)try{e.select()}catch(i){}else if(n.tridentSel){if(e.cloneRange)try{return void n.tridentSel.addRange(e)}catch(i){}}else if(r=n.getSel()){n.explicitRange=e;try{r.removeAllRanges(),r.addRange(e)}catch(i){}t===!1&&r.extend&&(r.collapse(e.endContainer,e.endOffset),r.extend(e.startContainer,e.startOffset)),n.selectedRange=r.rangeCount>0?r.getRangeAt(0):null}},setNode:function(e){var t=this;return t.setContent(t.dom.getOuterHTML(e)),e},getNode:function(){function e(e,t){for(var n=e;e&&3===e.nodeType&&0===e.length;)e=t?e.nextSibling:e.previousSibling;return e||n}var t=this,n=t.getRng(),r,i=n.startContainer,o=n.endContainer,a=n.startOffset,s=n.endOffset,l=t.dom.getRoot();return n?n.setStart?(r=n.commonAncestorContainer,!n.collapsed&&(i==o&&2>s-a&&i.hasChildNodes()&&(r=i.childNodes[a]),3===i.nodeType&&3===o.nodeType&&(i=i.length===a?e(i.nextSibling,!0):i.parentNode,o=0===s?e(o.previousSibling,!1):o.parentNode,i&&i===o))?i:r&&3==r.nodeType?r.parentNode:r):(r=n.item?n.item(0):n.parentElement(),r.ownerDocument!==t.win.document&&(r=l),r):l},getSelectedBlocks:function(t,n){var r=this,i=r.dom,o,a,s=[];if(a=i.getRoot(),t=i.getParent(t||r.getStart(),i.isBlock),n=i.getParent(n||r.getEnd(),i.isBlock),t&&t!=a&&s.push(t),t&&n&&t!=n){o=t;for(var l=new e(t,a);(o=l.next())&&o!=n;)i.isBlock(o)&&s.push(o)}return n&&t!=n&&n!=a&&s.push(n),s},isForward:function(){var e=this.dom,t=this.getSel(),n,r;return t&&t.anchorNode&&t.focusNode?(n=e.createRng(),n.setStart(t.anchorNode,t.anchorOffset),n.collapse(!0),r=e.createRng(),r.setStart(t.focusNode,t.focusOffset),r.collapse(!0),n.compareBoundaryPoints(n.START_TO_START,r)<=0):!0},normalize:function(){var e=this,t=e.getRng();return!d&&new i(e.dom).normalize(t)&&e.setRng(t,e.isForward()),t},selectorChanged:function(e,t){var n=this,r;return n.selectorChangedData||(n.selectorChangedData={},r={},n.editor.on("NodeChange",function(e){var t=e.element,i=n.dom,o=i.getParents(t,null,i.getRoot()),a={};l(n.selectorChangedData,function(e,t){l(o,function(n){return i.is(n,t)?(r[t]||(l(e,function(e){e(!0,{node:n,selector:t,parents:o})}),r[t]=e),a[t]=e,!1):void 0})}),l(r,function(e,n){a[n]||(delete r[n],l(e,function(e){e(!1,{node:t,selector:n,parents:o})}))})})),n.selectorChangedData[e]||(n.selectorChangedData[e]=[]),n.selectorChangedData[e].push(t),n},getScrollContainer:function(){for(var e,t=this.dom.getRoot();t&&"BODY"!=t.nodeName;){if(t.scrollHeight>t.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e){function t(e){for(var t=0,n=0,r=e;r&&r.nodeType;)t+=r.offsetLeft||0,n+=r.offsetTop||0,r=r.offsetParent;return{x:t,y:n}}var n,r,i=this,o=i.dom,a=o.getRoot(),s,l;if("BODY"!=a.nodeName){var c=i.getScrollContainer();if(c)return n=t(e).y-t(c).y,l=c.clientHeight,s=c.scrollTop,void((s>n||n+25>s+l)&&(c.scrollTop=s>n?n:n-l+25))}r=o.getViewPort(i.editor.getWin()),n=o.getPos(e).y,s=r.y,l=r.h,(ns+l)&&i.editor.getWin().scrollTo(0,s>n?n:n-l+25)},_moveEndPoint:function(t,n,r){var i=n,a=new e(n,i),s=this.dom.schema.getNonEmptyElements();do{if(3==n.nodeType&&0!==u(n.nodeValue).length)return void(r?t.setStart(n,0):t.setEnd(n,n.nodeValue.length));if(s[n.nodeName])return void(r?t.setStartBefore(n):"BR"==n.nodeName?t.setEndBefore(n):t.setEndAfter(n));if(o.ie&&o.ie<11&&this.dom.isBlock(n)&&this.dom.isEmpty(n))return void(r?t.setStart(n,0):t.setEnd(n,0))}while(n=r?a.next():a.prev());"BODY"==i.nodeName&&(r?t.setStart(i,0):t.setEnd(i,i.childNodes.length))},destroy:function(){this.win=null,this.controlSelection.destroy()}},s}),r(D,[f,B,p],function(e,t,n){return function(r){function i(e){return e.nodeType&&(e=e.nodeName),!!r.schema.getTextBlockElements()[e.toLowerCase()]}function o(e,t){return I.getParents(e,t,I.getRoot())}function a(e){return 1===e.nodeType&&"_mce_caret"===e.id}function s(){u({alignleft:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"left"},defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"left"}}],aligncenter:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"center"},defaultBlock:"div"},{selector:"img",collapsed:!1,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:!1,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"right"},defaultBlock:"div"},{selector:"img,table",collapsed:!1,styles:{"float":"right"}}],alignjustify:[{selector:"figure,p,h1,h2,h3,h4,h5,h6,td,th,tr,div,ul,ol,li",styles:{textAlign:"justify"},defaultBlock:"div"}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:!0},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:!0},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},wrap_links:!1},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},wrap_links:!1},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},code:{inline:"code"},link:{inline:"a",selector:"a",remove:"all",split:!0,deep:!0,onmatch:function(){return!0},onformat:function(e,t,n){et(n,function(t,n){I.setAttrib(e,n,t)})}},removeformat:[{selector:"b,strong,em,i,font,u,strike,sub,sup,dfn,code,samp,kbd,var,cite,mark,q",remove:"all",split:!0,expand:!1,block_expand:!0,deep:!0},{selector:"span",attributes:["style","class"],remove:"empty",split:!0,expand:!1,deep:!0},{selector:"*",attributes:["style","class"],split:!1,expand:!1,deep:!0}]}),et("p h1 h2 h3 h4 h5 h6 div address pre div dt dd samp".split(/\s/),function(e){u(e,{block:e,remove:"all"})}),u(r.settings.formats)}function l(){r.addShortcut("ctrl+b","bold_desc","Bold"),r.addShortcut("ctrl+i","italic_desc","Italic"),r.addShortcut("ctrl+u","underline_desc","Underline");for(var e=1;6>=e;e++)r.addShortcut("ctrl+"+e,"",["FormatBlock",!1,"h"+e]);r.addShortcut("ctrl+7","",["FormatBlock",!1,"p"]),r.addShortcut("ctrl+8","",["FormatBlock",!1,"div"]),r.addShortcut("ctrl+9","",["FormatBlock",!1,"address"])}function c(e){return e?O[e]:O}function u(e,t){e&&("string"!=typeof e?et(e,function(e,t){u(t,e)}):(t=t.length?t:[t],et(t,function(e){e.deep===X&&(e.deep=!e.selector),e.split===X&&(e.split=!e.selector||e.inline),e.remove===X&&e.selector&&!e.inline&&(e.remove="none"),e.selector&&e.inline&&(e.mixed=!0,e.block_expand=!0),"string"==typeof e.classes&&(e.classes=e.classes.split(/\s+/))}),O[e]=t))}function d(e){var t;return r.dom.getParent(e,function(e){return t=r.dom.getStyle(e,"text-decoration"),t&&"none"!==t}),t}function f(e){var t;1===e.nodeType&&e.parentNode&&1===e.parentNode.nodeType&&(t=d(e.parentNode),r.dom.getStyle(e,"color")&&t?r.dom.setStyle(e,"text-decoration",t):r.dom.getStyle(e,"textdecoration")===t&&r.dom.setStyle(e,"text-decoration",null))}function p(t,n,o){function s(e,t){t=t||h,e&&(t.onformat&&t.onformat(e,t,n,o),et(t.styles,function(t,r){I.setStyle(e,r,E(t,n))}),et(t.attributes,function(t,r){I.setAttrib(e,r,E(t,n))}),et(t.classes,function(t){t=E(t,n),I.hasClass(e,t)||I.addClass(e,t)}))}function l(){function t(t,n){var r=new e(n);for(o=r.current();o;o=r.prev())if(o.childNodes.length>1||o==t||"BR"==o.tagName)return o}var n=r.selection.getRng(),i=n.startContainer,a=n.endContainer;if(i!=a&&0===n.endOffset){var s=t(i,a),l=3==s.nodeType?s.length:s.childNodes.length;n.setEnd(s,l)}return n}function u(e,t,n,r,i){var o=[],a=-1,s,l=-1,c=-1,u;return et(e.childNodes,function(e,t){return"UL"===e.nodeName||"OL"===e.nodeName?(a=t,s=e,!1):void 0}),et(e.childNodes,function(e,n){"SPAN"===e.nodeName&&"bookmark"==I.getAttrib(e,"data-mce-type")&&(e.id==t.id+"_start"?l=n:e.id==t.id+"_end"&&(c=n))}),0>=a||a>l&&c>a?(et(tt(e.childNodes),i),0):(u=I.clone(n,K),et(tt(e.childNodes),function(e,t){(a>l&&a>t||l>a&&t>a)&&(o.push(e),e.parentNode.removeChild(e))}),a>l?e.insertBefore(u,s):l>a&&e.insertBefore(u,s.nextSibling),r.push(u),et(o,function(e){u.appendChild(e)}),u)}function d(e,r,o){var l=[],c,d,f=!0;c=h.inline||h.block,d=I.create(c),s(d),z.walk(e,function(e){function p(e){var y,C,x,_,N;return N=f,y=e.nodeName.toLowerCase(),C=e.parentNode.nodeName.toLowerCase(),1===e.nodeType&&J(e)&&(N=f,f="true"===J(e),_=!0),w(y,"br")?(v=0,void(h.block&&I.remove(e))):h.wrapper&&g(e,t,n)?void(v=0):f&&!_&&h.block&&!h.wrapper&&i(y)&&W(C,c)?(e=I.rename(e,c),s(e),l.push(e),void(v=0)):h.selector&&(et(m,function(t){"collapsed"in t&&t.collapsed!==b||I.is(e,t.selector)&&!a(e)&&(s(e,t),x=!0)}),!h.inline||x)?void(v=0):void(!f||_||!W(c,y)||!W(C,c)||!o&&3===e.nodeType&&1===e.nodeValue.length&&65279===e.nodeValue.charCodeAt(0)||a(e)||h.inline&&V(e)?"li"==y&&r?v=u(e,r,d,l,p):(v=0,et(tt(e.childNodes),p),_&&(f=N),v=0):(v||(v=I.clone(d,K),e.parentNode.insertBefore(v,e),l.push(v)),v.appendChild(e)))}var v;et(e,p)}),h.wrap_links===!1&&et(l,function(e){function t(e){var n,r,i;if("A"===e.nodeName){for(r=I.clone(d,K),l.push(r),i=tt(e.childNodes),n=0;n1||!V(e))&&0===o)return void I.remove(e,1);if(h.inline||h.wrapper){if(h.exact||1!==o||(e=i(e)),et(m,function(t){et(I.select(t.inline,e),function(e){var r;if(!L(e)){if(t.wrap_links===!1){r=e.parentNode;do if("A"===r.nodeName)return;while(r=r.parentNode)}R(t,n,e,t.exact?e:null)}})}),g(e.parentNode,t,n))return I.remove(e,1),e=0,Y;h.merge_with_parents&&I.getParent(e.parentNode,function(r){return g(r,t,n)?(I.remove(e,1),e=0,Y):void 0}),e&&h.merge_siblings!==!1&&(e=D(B(e),e),e=D(e,B(e,Y)))}})}var m=c(t),h=m[0],v,y,b=!o&&F.isCollapsed();if(h)if(o)o.nodeType?(y=I.createRng(),y.setStartBefore(o),y.setEndAfter(o),d(T(y,m),null,!0)):d(o,null,!0);else if(b&&h.inline&&!I.select("td.mce-item-selected,th.mce-item-selected").length)H("apply",t,n);else{var C=r.selection.getNode();U||!m[0].defaultBlock||I.getParent(C,I.isBlock)||p(m[0].defaultBlock),r.selection.setRng(l()),v=F.getBookmark(),d(T(F.getRng(Y),m),v),h.styles&&(h.styles.color||h.styles.textDecoration)&&(nt(C,f,"childNodes"),f(C)),F.moveToBookmark(v),P(F.getRng(Y)),r.nodeChanged()}}function m(e,t,n){function i(e){var n,r,o,a,s;if(1===e.nodeType&&J(e)&&(a=b,b="true"===J(e),s=!0),n=tt(e.childNodes),b&&!s)for(r=0,o=p.length;o>r&&!R(p[r],t,e,e);r++);if(m.deep&&n.length){for(r=0,o=n.length;o>r;r++)i(n[r]);s&&(b=a)}}function a(n){var r;return et(o(n.parentNode).reverse(),function(n){var i;r||"_start"==n.id||"_end"==n.id||(i=g(n,e,t),i&&i.split!==!1&&(r=n))}),r}function s(e,n,r,i){var o,a,s,l,c,u;if(e){for(u=e.parentNode,o=n.parentNode;o&&o!=u;o=o.parentNode){for(a=I.clone(o,K),c=0;c=0;a--){if(s=t[a].selector,!s||t[a].defaultBlock)return Y;for(i=r.length-1;i>=0;i--)if(I.is(r[i],s))return Y}return K}function C(e,t,n){var i;return G||(G={},i={},r.on("NodeChange",function(e){var t=o(e.element),n={};et(G,function(e,r){et(t,function(o){return g(o,r,{},e.similar)?(i[r]||(et(e,function(e){e(!0,{node:o,format:r,parents:t})}),i[r]=e),n[r]=e,!1):void 0})}),et(i,function(r,o){n[o]||(delete i[o],et(r,function(n){n(!1,{node:e.element,format:o,parents:t})}))})})),et(e.split(","),function(e){G[e]||(G[e]=[],G[e].similar=n),G[e].push(t)}),this}function x(e,t){return w(e,t.inline)?Y:w(e,t.block)?Y:t.selector?1==e.nodeType&&I.is(e,t.selector):void 0}function w(e,t){return e=e||"",t=t||"",e=""+(e.nodeName||e),t=""+(t.nodeName||t),e.toLowerCase()==t.toLowerCase()}function _(e,t){return N(I.getStyle(e,t),t)}function N(e,t){return("color"==t||"backgroundColor"==t)&&(e=I.toHex(e)),"fontWeight"==t&&700==e&&(e="bold"),"fontFamily"==t&&(e=e.replace(/[\'\"]/g,"").replace(/,\s+/g,",")),""+e}function E(e,t){return"string"!=typeof e?e=e(t):t&&(e=e.replace(/%(\w+)/g,function(e,n){return t[n]||e})),e}function S(e){return e&&3===e.nodeType&&/^([\t \r\n]+|)$/.test(e.nodeValue)}function k(e,t,n){var r=I.create(t,n);return e.parentNode.insertBefore(r,e),r.appendChild(e),r}function T(t,n,a){function s(e){function t(e){return"BR"==e.nodeName&&e.getAttribute("data-mce-bogus")&&!e.nextSibling}var r,i,o,a,s;if(r=i=e?g:y,a=e?"previousSibling":"nextSibling",s=I.getRoot(),3==r.nodeType&&!S(r)&&(e?v>0:br?n:r,-1===n||a||n++):(n=o.indexOf(" ",t),r=o.indexOf("\xa0",t),n=-1!==n&&(-1===r||r>n)?n:r),n}var s,l,c,u;if(3===t.nodeType){if(c=o(t,n),-1!==c)return{container:t,offset:c};u=t}for(s=new e(t,I.getParent(t,V)||r.getBody());l=s[i?"prev":"next"]();)if(3===l.nodeType){if(u=l,c=o(l),-1!==c)return{container:l,offset:c}}else if(V(l))break;return u?(n=i?0:u.length,{container:u,offset:n}):void 0}function d(e,r){var i,a,s,l;for(3==e.nodeType&&0===e.nodeValue.length&&e[r]&&(e=e[r]),i=o(e),a=0;ap?p:v],3==g.nodeType&&(v=0)),1==y.nodeType&&y.hasChildNodes()&&(p=y.childNodes.length-1,y=y.childNodes[b>p?p:b-1],3==y.nodeType&&(b=y.nodeValue.length)),g=c(g),y=c(y),(L(g.parentNode)||L(g))&&(g=L(g)?g:g.parentNode,g=g.nextSibling||g,3==g.nodeType&&(v=0)),(L(y.parentNode)||L(y))&&(y=L(y)?y:y.parentNode,y=y.previousSibling||y,3==y.nodeType&&(b=y.length)),n[0].inline&&(t.collapsed&&(h=u(g,v,!0),h&&(g=h.container,v=h.offset),h=u(y,b),h&&(y=h.container,b=h.offset)),m=l(y,b),m.node)){for(;m.node&&0===m.offset&&m.node.previousSibling;)m=l(m.node.previousSibling);m.node&&m.offset>0&&3===m.node.nodeType&&" "===m.node.nodeValue.charAt(m.offset-1)&&m.offset>1&&(y=m.node,y.splitText(m.offset-1))}return(n[0].inline||n[0].block_expand)&&(n[0].inline&&3==g.nodeType&&0!==v||(g=s(!0)),n[0].inline&&3==y.nodeType&&b!==y.nodeValue.length||(y=s())),n[0].selector&&n[0].expand!==K&&!n[0].inline&&(g=d(g,"previousSibling"),y=d(y,"nextSibling")),(n[0].block||n[0].selector)&&(g=f(g,"previousSibling"),y=f(y,"nextSibling"),n[0].block&&(V(g)||(g=s(!0)),V(y)||(y=s()))),1==g.nodeType&&(v=q(g),g=g.parentNode),1==y.nodeType&&(b=q(y)+1,y=y.parentNode),{startContainer:g,startOffset:v,endContainer:y,endOffset:b}}function R(e,t,n,r){var i,o,a;if(!x(n,e))return K;if("all"!=e.remove)for(et(e.styles,function(e,i){e=N(E(e,t),i),"number"==typeof i&&(i=e,r=0),(!r||w(_(r,i),e))&&I.setStyle(n,i,""),a=1}),a&&""===I.getAttrib(n,"style")&&(n.removeAttribute("style"),n.removeAttribute("data-mce-style")),et(e.attributes,function(e,i){var o;if(e=E(e,t),"number"==typeof i&&(i=e,r=0),!r||w(I.getAttrib(r,i),e)){if("class"==i&&(e=I.getAttrib(n,i),e&&(o="",et(e.split(/\s+/),function(e){/mce\w+/.test(e)&&(o+=(o?" ":"")+e)}),o)))return void I.setAttrib(n,i,o);"class"==i&&n.removeAttribute("className"),j.test(i)&&n.removeAttribute("data-mce-"+i),n.removeAttribute(i)}}),et(e.classes,function(e){e=E(e,t),(!r||I.hasClass(r,e))&&I.removeClass(n,e)}),o=I.getAttribs(n),i=0;ia?a:o]),3===i.nodeType&&n&&o>=i.nodeValue.length&&(i=new e(i,r.getBody()).next()||i),3!==i.nodeType||n||0!==o||(i=new e(i,r.getBody()).prev()||i),i}function H(t,n,o){function a(e){var t=I.create("span",{id:y,"data-mce-bogus":!0,style:b?"color:red":""});return e&&t.appendChild(r.getDoc().createTextNode($)),t}function s(e,t){for(;e;){if(3===e.nodeType&&e.nodeValue!==$||e.childNodes.length>1)return!1;t&&1===e.nodeType&&t.push(e),e=e.firstChild}return!0}function l(e){for(;e;){if(e.id===y)return e;e=e.parentNode}}function u(t){var n;if(t)for(n=new e(t,t),t=n.current();t;t=n.next())if(3===t.nodeType)return t}function d(e,t){var n,r;if(e)r=F.getRng(!0),s(e)?(t!==!1&&(r.setStartBefore(e),r.setEndBefore(e)),I.remove(e)):(n=u(e),n.nodeValue.charAt(0)===$&&(n=n.deleteData(0,1)),I.remove(e,1)),F.setRng(r);else if(e=l(F.getStart()),!e)for(;e=I.get(y);)d(e,!1)}function f(){var e,t,r,i,s,d,f;e=F.getRng(!0),i=e.startOffset,d=e.startContainer,f=d.nodeValue,t=l(F.getStart()),t&&(r=u(t)),f&&i>0&&i=0;p--)u.appendChild(I.clone(f[p],!1)),u=u.firstChild;u.appendChild(I.doc.createTextNode($)),u=u.firstChild;var v=I.getParent(d,i);v&&I.isEmpty(v)?d.parentNode.replaceChild(h,d):I.insertAfter(h,d),F.setCursorLocation(u,1),I.isEmpty(d)&&I.remove(d)}}function v(){var e;e=l(F.getStart()),e&&!I.isEmpty(e)&&nt(e,function(e){1!=e.nodeType||e.id===y||I.isEmpty(e)||I.setAttrib(e,"data-mce-bogus",null)},"childNodes")}var y="_mce_caret",b=r.settings.caret_debug;r._hasCaretEvents||(Z=function(){var e=[],t;if(s(l(F.getStart()),e))for(t=e.length;t--;)I.setAttrib(e[t],"data-mce-bogus","1")},Q=function(e){var t=e.keyCode;d(),(8==t||37==t||39==t)&&d(l(F.getStart())),v()},r.on("SetContent",function(e){e.selection&&v()}),r._hasCaretEvents=!0),"apply"==t?f():h()}function P(t){var n=t.startContainer,r=t.startOffset,i,o,a,s,l;if(3==n.nodeType&&r>=n.nodeValue.length&&(r=q(n),n=n.parentNode,i=!0),1==n.nodeType)for(s=n.childNodes,n=s[Math.min(r,s.length-1)],o=new e(n,I.getParent(n,I.isBlock)),(r>s.length-1||i)&&o.next(),a=o.current();a;a=o.next())if(3==a.nodeType&&!S(a))return l=I.create("a",null,$),a.parentNode.insertBefore(l,a),t.setStart(a,0),F.setRng(t),void I.remove(l)}var O={},I=r.dom,F=r.selection,z=new t(I),W=r.schema.isValidChild,V=I.isBlock,U=r.settings.forced_root_block,q=I.nodeIndex,$="\ufeff",j=/^(src|href|style)$/,K=!1,Y=!0,G,X,J=I.getContentEditable,Q,Z,et=n.each,tt=n.grep,nt=n.walk,rt=n.extend;rt(this,{get:c,register:u,apply:p,remove:m,toggle:h,match:v,matchAll:y,matchNode:g,canApply:b,formatChanged:C}),s(),l(),r.on("BeforeGetContent",function(){Z&&Z()}),r.on("mouseup keydown",function(e){Q&&Q(e)})}}),r(M,[g,p],function(e,t){var n=t.trim,r;return r=new RegExp(["]+data-mce-bogus[^>]+>[\u200b\ufeff]+<\\/span>","]+data-mce-bogus[^>]+><\\/div>",'\\s?data-mce-selected="[^"]+"'].join("|"),"gi"),function(t){function i(){return n(t.getContent({format:"raw",no_events:1}).replace(r,""))}function o(e){a.typing=!1,a.add({},e)}var a=this,s=0,l=[],c,u,d;return t.on("init",function(){a.add()}),t.on("BeforeExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&a.beforeChange()}),t.on("ExecCommand",function(e){var t=e.command;"Undo"!=t&&"Redo"!=t&&"mceRepaint"!=t&&o(e)}),t.on("ObjectResizeStart",function(){a.beforeChange()}),t.on("SaveContent ObjectResized blur",o),t.dom.bind(t.dom.getRoot(),"dragend",o),t.on("KeyUp",function(n){var r=n.keyCode;(r>=33&&36>=r||r>=37&&40>=r||45==r||13==r||n.ctrlKey)&&(o(),t.nodeChanged()),(46==r||8==r||e.mac&&(91==r||93==r))&&t.nodeChanged(),u&&a.typing&&(t.isDirty()||(t.isNotDirty=!l[0]||i()==l[0].content,t.isNotDirty||t.fire("change",{level:l[0],lastLevel:null})),t.fire("TypingUndo"),u=!1,t.nodeChanged())}),t.on("KeyDown",function(e){var t=e.keyCode;return t>=33&&36>=t||t>=37&&40>=t||45==t?void(a.typing&&o(e)):void((16>t||t>20)&&224!=t&&91!=t&&!a.typing&&(a.beforeChange(),a.typing=!0,a.add({},e),u=!0))}),t.on("MouseDown",function(e){a.typing&&o(e)}),t.addShortcut("ctrl+z","","Undo"),t.addShortcut("ctrl+y,ctrl+shift+z","","Redo"),t.on("AddUndo Undo Redo ClearUndos MouseUp",function(e){e.isDefaultPrevented()||t.nodeChanged()}),a={data:l,typing:!1,beforeChange:function(){d||(c=t.selection.getBookmark(2,!0))},add:function(e,n){var r,o=t.settings,a;if(e=e||{},e.content=i(),d||t.removed)return null;if(t.fire("BeforeAddUndo",{level:e,originalEvent:n}).isDefaultPrevented())return null;if(a=l[s],a&&a.content==e.content)return null;if(l[s]&&(l[s].beforeBookmark=c),o.custom_undo_redo_levels&&l.length>o.custom_undo_redo_levels){for(r=0;r0&&(t.isNotDirty=!1,t.fire("change",u)),e},undo:function(){var e;return a.typing&&(a.add(),a.typing=!1),s>0&&(e=l[--s],0===s&&(t.isNotDirty=!0),t.setContent(e.content,{format:"raw"}),t.selection.moveToBookmark(e.beforeBookmark),t.fire("undo",{level:e})),e},redo:function(){var e;return s0||a.typing&&l[0]&&i()!=l[0].content},hasRedo:function(){return sL)&&(u=a.create("br"),t.parentNode.insertBefore(u,t)),l.setStartBefore(t),l.setEndBefore(t)):(l.setStartAfter(t),l.setEndAfter(t)):(l.setStart(t,0),l.setEnd(t,0));s.setRng(l),a.remove(u),s.scrollIntoView(t)}function g(e){var t=l.forced_root_block;t&&t.toLowerCase()===e.tagName.toLowerCase()&&a.setAttribs(e,l.forced_root_block_attrs)}function v(e){var t=R,n,i,o;if(e||"TABLE"==O?(n=a.create(e||F),g(n)):n=B.cloneNode(!1),o=n,l.keep_styles!==!1)do if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U|VAR|CITE|DFN|CODE|MARK|Q|SUP|SUB|SAMP)$/.test(t.nodeName)){if("_mce_caret"==t.id)continue;i=t.cloneNode(!1),a.setAttrib(i,"id",""),n.hasChildNodes()?(i.appendChild(n.firstChild),n.appendChild(i)):(o=i,n.appendChild(i))}while(t=t.parentNode);return r||(o.innerHTML='
    '),n}function y(t){var n,r,i;if(3==R.nodeType&&(t?A>0:A0)return!0}function w(){var e,t,n;R&&3==R.nodeType&&A>=R.nodeValue.length&&(r||x()||(e=a.create("br"),S.insertNode(e),S.setStartAfter(e),S.setEndAfter(e),t=!0)),e=a.create("br"),S.insertNode(e),r&&"PRE"==O&&(!L||8>L)&&e.parentNode.insertBefore(a.doc.createTextNode("\r"),e),n=a.create("span",{}," "),e.parentNode.insertBefore(n,e),s.scrollIntoView(n),a.remove(n),t?(S.setStartBefore(e),S.setEndBefore(e)):(S.setStartAfter(e),S.setEndAfter(e)),s.setRng(S),c.add()}function _(e){do 3===e.nodeType&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;while(e)}function N(e){var t=a.getRoot(),n,r;for(n=e;n!==t&&"false"!==a.getContentEditable(n);)"true"===a.getContentEditable(n)&&(r=n),n=n.parentNode;return n!==t?r:t}function E(e){var t;r||(e.normalize(),t=e.lastChild,(!t||/^(left|right)$/gi.test(a.getStyle(t,"float",!0)))&&a.add(e,"br"))}var S,k,T,R,A,B,L,D,M,H,P,O,I,F,z;if(S=s.getRng(!0),!o.isDefaultPrevented()){if(!S.collapsed)return void i.execCommand("Delete");if(new t(a).normalize(S),R=S.startContainer,A=S.startOffset,F=(l.force_p_newlines?"p":"")||l.forced_root_block,F=F?F.toUpperCase():"",L=a.doc.documentMode,D=o.shiftKey,1==R.nodeType&&R.hasChildNodes()&&(z=A>R.childNodes.length-1,R=R.childNodes[Math.min(A,R.childNodes.length-1)]||R,A=z&&3==R.nodeType?R.nodeValue.length:0),T=N(R)){if(c.beforeChange(),!a.isBlock(T)&&T!=a.getRoot())return void((!F||D)&&w());if((F&&!D||!F&&D)&&(R=b(R,A)),B=a.getParent(R,a.isBlock),P=B?a.getParent(B.parentNode,a.isBlock):null,O=B?B.nodeName.toUpperCase():"",I=P?P.nodeName.toUpperCase():"","LI"!=I||o.ctrlKey||(B=P,O=I),"LI"==O){if(!F&&D)return void w();if(a.isEmpty(B))return void C()}if("PRE"==O&&l.br_in_pre!==!1){if(!D)return void w()}else if(!F&&!D&&"LI"!=O||F&&D)return void w();F&&B===i.getBody()||(F=F||"P",y()?(M=/^(H[1-6]|PRE|FIGURE)$/.test(O)&&"HGROUP"!=I?v(F):v(),l.end_container_on_empty_block&&f(P)&&a.isEmpty(B)?M=a.split(P,B):a.insertAfter(M,B),h(M)):y(!0)?(M=B.parentNode.insertBefore(v(),B),p(M),h(B)):(k=S.cloneRange(),k.setEndAfter(B),H=k.extractContents(),_(H),M=H.firstChild,a.insertAfter(H,B),m(M),E(B),h(M)),a.setAttrib(M,"id",""),i.fire("NewBlock",{newBlock:M}),c.add())}}}var a=i.dom,s=i.selection,l=i.settings,c=i.undoManager,u=i.schema,d=u.getNonEmptyElements();i.on("keydown",function(e){13==e.keyCode&&o(e)!==!1&&e.preventDefault()})}}),r(P,[],function(){return function(e){function t(){var t=i.getStart(),s=e.getBody(),l,c,u,d,f,p,m,h=-16777215,g,v,y,b,C;if(C=n.forced_root_block,t&&1===t.nodeType&&C){for(;t&&t!=s;){if(a[t.nodeName])return;t=t.parentNode}if(l=i.getRng(),l.setStart){c=l.startContainer,u=l.startOffset,d=l.endContainer,f=l.endOffset;try{v=e.getDoc().activeElement===s}catch(x){}}else l.item&&(t=l.item(0),l=e.getDoc().body.createTextRange(),l.moveToElementText(t)),v=l.parentElement().ownerDocument===e.getDoc(),y=l.duplicate(),y.collapse(!0),u=-1*y.move("character",h),y.collapsed||(y=l.duplicate(),y.collapse(!1),f=-1*y.move("character",h)-u);for(t=s.firstChild,b=s.nodeName.toLowerCase();t;)if((3===t.nodeType||1==t.nodeType&&!a[t.nodeName])&&o.isValidChild(b,C.toLowerCase())){if(3===t.nodeType&&0===t.nodeValue.length){m=t,t=t.nextSibling,r.remove(m);continue}p||(p=r.create(C,e.settings.forced_root_block_attrs),t.parentNode.insertBefore(p,t),g=!0),m=t,t=t.nextSibling,p.appendChild(m)}else p=null,t=t.nextSibling;if(g&&v){if(l.setStart)l.setStart(c,u),l.setEnd(d,f),i.setRng(l);else try{l=e.getDoc().body.createTextRange(),l.moveToElementText(s),l.collapse(!0),l.moveStart("character",u),f>0&&l.moveEnd("character",f),l.select()}catch(x){}e.nodeChanged()}}}var n=e.settings,r=e.dom,i=e.selection,o=e.schema,a=o.getBlockElements();n.forced_root_block&&e.on("NodeChange",t)}}),r(O,[S,g,p],function(e,n,r){var i=r.each,o=r.extend,a=r.map,s=r.inArray,l=r.explode,c=n.gecko,u=n.ie,d=!0,f=!1;return function(r){function p(e,t,n){var r;return e=e.toLowerCase(),(r=N.exec[e])?(r(e,t,n),d):f}function m(e){var t;return e=e.toLowerCase(),(t=N.state[e])?t(e):-1}function h(e){var t;return e=e.toLowerCase(),(t=N.value[e])?t(e):f}function g(e,t){t=t||"exec",i(e,function(e,n){i(n.toLowerCase().split(","),function(n){N[t][n]=e})})}function v(e,n,i){return n===t&&(n=f),i===t&&(i=null),r.getDoc().execCommand(e,n,i)}function y(e){return S.match(e)}function b(e,n){S.toggle(e,n?{value:n}:t),r.nodeChanged()}function C(e){k=_.getBookmark(e)}function x(){_.moveToBookmark(k)}var w=r.dom,_=r.selection,N={state:{},exec:{},value:{}},E=r.settings,S=r.formatter,k;o(this,{execCommand:p,queryCommandState:m,queryCommandValue:h,addCommands:g}),g({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){r.undoManager.add()},"Cut,Copy,Paste":function(e){var t=r.getDoc(),i;try{v(e)}catch(o){i=d}if(i||!t.queryCommandSupported(e)){var a=r.translate("Your browser doesn't support direct access to the clipboard. Please use the Ctrl+X/C/V keyboard shortcuts instead.");n.mac&&(a=a.replace(/Ctrl\+/g,"\u2318+")),r.windowManager.alert(a)}},unlink:function(){if(_.isCollapsed()){var e=_.getNode();return void("A"==e.tagName&&r.dom.remove(e,!0))}S.remove("link")},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t=e.substring(7);"full"==t&&(t="justify"),i("left,center,right,justify".split(","),function(e){t!=e&&S.remove("align"+e)}),b("align"+t),p("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(e){var t,n;v(e),t=w.getParent(_.getNode(),"ol,ul"),t&&(n=t.parentNode,/^(H[1-6]|P|ADDRESS|PRE)$/.test(n.nodeName)&&(C(),w.split(n,t),x()))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){b(e)},"ForeColor,HiliteColor,FontName":function(e,t,n){b(e,n)},FontSize:function(e,t,n){var r,i;n>=1&&7>=n&&(i=l(E.font_size_style_values),r=l(E.font_size_classes),n=r?r[n-1]||n:i[n-1]||n),b(e,n)},RemoveFormat:function(e){S.remove(e)},mceBlockQuote:function(){b("blockquote")},FormatBlock:function(e,t,n){return b(n||"p")},mceCleanup:function(){var e=_.getBookmark();r.setContent(r.getContent({cleanup:d}),{cleanup:d}),_.moveToBookmark(e)},mceRemoveNode:function(e,t,n){var i=n||_.getNode();i!=r.getBody()&&(C(),r.dom.remove(i,d),x())},mceSelectNodeDepth:function(e,t,n){var i=0;w.getParent(_.getNode(),function(e){return 1==e.nodeType&&i++==n?(_.select(e),f):void 0},r.getBody())},mceSelectNode:function(e,t,n){_.select(n)},mceInsertContent:function(t,n,i){function o(e){function t(e){return r[e]&&3==r[e].nodeType}var n,r,i;return n=_.getRng(!0),r=n.startContainer,i=n.startOffset,3==r.nodeType&&(i>0?e=e.replace(/^ /," "):t("previousSibling")||(e=e.replace(/^ /," ")),i|)$/," "):t("nextSibling")||(e=e.replace(/( | )(
    |)$/," "))),e}var a,s,l,c,d,f,p,m,h,g,v;/^ | $/.test(i)&&(i=o(i)),a=r.parser,s=new e({},r.schema),v='ÈB;',f={content:i,format:"html",selection:!0},r.fire("BeforeSetContent",f),i=f.content,-1==i.indexOf("{$caret}")&&(i+="{$caret}"),i=i.replace(/\{\$caret\}/,v),m=_.getRng();var y=m.startContainer||(m.parentElement?m.parentElement():null),b=r.getBody();y===b&&_.isCollapsed()&&w.isBlock(b.firstChild)&&w.isEmpty(b.firstChild)&&(m=w.createRng(),m.setStart(b.firstChild,0),m.setEnd(b.firstChild,0),_.setRng(m)),_.isCollapsed()||r.getDoc().execCommand("Delete",!1,null),l=_.getNode();var C={context:l.nodeName.toLowerCase()};if(d=a.parse(i,C),h=d.lastChild,"mce_marker"==h.attr("id"))for(p=h,h=h.prev;h;h=h.walk(!0))if(3==h.type||!w.isBlock(h.name)){h.parent.insert(p,h,"br"===h.name);break}if(C.invalid){for(_.setContent(v),l=_.getNode(),c=r.getBody(),9==l.nodeType?l=h=c:h=l;h!==c;)l=h,h=h.parentNode;i=l==c?c.innerHTML:w.getOuterHTML(l),i=s.serialize(a.parse(i.replace(//i,function(){return s.serialize(d)}))),l==c?w.setHTML(c,i):w.setOuterHTML(l,i)}else i=s.serialize(d),h=l.firstChild,g=l.lastChild,!h||h===g&&"BR"===h.nodeName?w.setHTML(l,i):_.setContent(i);p=w.get("mce_marker"),_.scrollIntoView(p),m=w.createRng(),h=p.previousSibling,h&&3==h.nodeType?(m.setStart(h,h.nodeValue.length),u||(g=p.nextSibling,g&&3==g.nodeType&&(h.appendData(g.data),g.parentNode.removeChild(g)))):(m.setStartBefore(p),m.setEndBefore(p)),w.remove(p),_.setRng(m),r.fire("SetContent",f),r.addVisual()},mceInsertRawHTML:function(e,t,n){_.setContent("tiny_mce_marker"),r.setContent(r.getContent().replace(/tiny_mce_marker/g,function(){return n}))},mceToggleFormat:function(e,t,n){b(n)},mceSetContent:function(e,t,n){r.setContent(n)},"Indent,Outdent":function(e){var t,n,o;t=E.indentation,n=/[a-z%]+$/i.exec(t),t=parseInt(t,10),m("InsertUnorderedList")||m("InsertOrderedList")?v(e):(E.forced_root_block||w.getParent(_.getNode(),w.isBlock)||S.apply("div"),i(_.getSelectedBlocks(),function(i){if("LI"!=i.nodeName){var a=r.getParam("indent_use_margin",!1)?"margin":"padding";a+="rtl"==w.getStyle(i,"direction",!0)?"Right":"Left","outdent"==e?(o=Math.max(0,parseInt(i.style[a]||0,10)-t),w.setStyle(i,a,o?o+n:"")):(o=parseInt(i.style[a]||0,10)+t+n,w.setStyle(i,a,o))}}))},mceRepaint:function(){if(c)try{C(d),_.getSel()&&_.getSel().selectAllChildren(r.getBody()),_.collapse(d),x()}catch(e){}},InsertHorizontalRule:function(){r.execCommand("mceInsertContent",!1,"
    ")},mceToggleVisualAid:function(){r.hasVisual=!r.hasVisual,r.addVisual()},mceReplaceContent:function(e,t,n){r.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,_.getContent({format:"text"})))},mceInsertLink:function(e,t,n){var r;"string"==typeof n&&(n={href:n}),r=w.getParent(_.getNode(),"a"),n.href=n.href.replace(" ","%20"),r&&n.href||S.remove("link"),n.href&&S.apply("link",n,r)},selectAll:function(){var e=w.getRoot(),t;_.getRng().setStart?(t=w.createRng(),t.setStart(e,0),t.setEnd(e,e.childNodes.length),_.setRng(t)):(t=_.getRng(),t.item||(t.moveToElementText(e),t.select()))},"delete":function(){v("Delete");var e=r.getBody();w.isEmpty(e)&&(r.setContent(""),e.firstChild&&w.isBlock(e.firstChild)?r.selection.setCursorLocation(e.firstChild,0):r.selection.setCursorLocation(e,0))},mceNewDocument:function(){r.setContent("")}}),g({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(e){var t="align"+e.substring(7),n=_.isCollapsed()?[w.getParent(_.getNode(),w.isBlock)]:_.getSelectedBlocks(),r=a(n,function(e){return!!S.matchNode(e,t)});return-1!==s(r,d)},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return y(e)},mceBlockQuote:function(){return y("blockquote")},Outdent:function(){var e;if(E.inline_styles){if((e=w.getParent(_.getStart(),w.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return d;if((e=w.getParent(_.getEnd(),w.isBlock))&&parseInt(e.style.paddingLeft,10)>0)return d}return m("InsertUnorderedList")||m("InsertOrderedList")||!E.inline_styles&&!!w.getParent(_.getNode(),"BLOCKQUOTE")},"InsertUnorderedList,InsertOrderedList":function(e){var t=w.getParent(_.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),g({"FontSize,FontName":function(e){var t=0,n;return(n=w.getParent(_.getNode(),"span"))&&(t="fontsize"==e?n.style.fontSize:n.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()),t}},"value"),g({Undo:function(){r.undoManager.undo()},Redo:function(){r.undoManager.redo()}})}}),r(I,[p],function(e){function t(e,i){var o=this,a,s;if(e=r(e),i=o.settings=i||{},/^([\w\-]+):([^\/]{2})/i.test(e)||/^\s*#/.test(e))return void(o.source=e);var l=0===e.indexOf("//");0!==e.indexOf("/")||l||(e=(i.base_uri?i.base_uri.protocol||"http":"http")+"://mce_host"+e),/^[\w\-]*:?\/\//.test(e)||(s=i.base_uri?i.base_uri.path:new t(location.href).directory,e=""===i.base_uri.protocol?"//mce_host"+o.toAbsPath(s,e):(i.base_uri&&i.base_uri.protocol||"http")+"://mce_host"+o.toAbsPath(s,e)),e=e.replace(/@@/g,"(mce_at)"),e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@\/]*):?([^:@\/]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e),n(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(t,n){var r=e[n];r&&(r=r.replace(/\(mce_at\)/g,"@@")),o[t]=r}),a=i.base_uri,a&&(o.protocol||(o.protocol=a.protocol),o.userInfo||(o.userInfo=a.userInfo),o.port||"mce_host"!==o.host||(o.port=a.port),o.host&&"mce_host"!==o.host||(o.host=a.host),o.source=""),l&&(o.protocol="")}var n=e.each,r=e.trim;return t.prototype={setPath:function(e){var t=this;e=/^(.*?)\/?(\w+)?$/.exec(e),t.path=e[0],t.directory=e[1],t.file=e[2],t.source="",t.getURI()},toRelative:function(e){var n=this,r;if("./"===e)return e;if(e=new t(e,{base_uri:n}),"mce_host"!=e.host&&n.host!=e.host&&e.host||n.port!=e.port||n.protocol!=e.protocol&&""!==e.protocol)return e.getURI();var i=n.getURI(),o=e.getURI();return i==o||"/"==i.charAt(i.length-1)&&i.substr(0,i.length-1)==o?i:(r=n.toRelPath(n.path,e.path),e.query&&(r+="?"+e.query),e.anchor&&(r+="#"+e.anchor),r)},toAbsolute:function(e,n){return e=new t(e,{base_uri:this}),e.getURI(this.host==e.host&&this.protocol==e.protocol?n:0)},toRelPath:function(e,t){var n,r=0,i="",o,a;if(e=e.substring(0,e.lastIndexOf("/")),e=e.split("/"),n=t.split("/"),e.length>=n.length)for(o=0,a=e.length;a>o;o++)if(o>=n.length||e[o]!=n[o]){r=o+1;break}if(e.lengtho;o++)if(o>=e.length||e[o]!=n[o]){r=o+1;break}if(1===r)return t;for(o=0,a=e.length-(r-1);a>o;o++)i+="../";for(o=r-1,a=n.length;a>o;o++)i+=o!=r-1?"/"+n[o]:n[o]; -return i},toAbsPath:function(e,t){var r,i=0,o=[],a,s;for(a=/\/$/.test(t)?"/":"",e=e.split("/"),t=t.split("/"),n(e,function(e){e&&o.push(e)}),e=o,r=t.length-1,o=[];r>=0;r--)0!==t[r].length&&"."!==t[r]&&(".."!==t[r]?i>0?i--:o.push(t[r]):i++);return r=e.length-i,s=0>=r?o.reverse().join("/"):e.slice(0,r).join("/")+"/"+o.reverse().join("/"),0!==s.indexOf("/")&&(s="/"+s),a&&s.lastIndexOf("/")!==s.length-1&&(s+=a),s},getURI:function(e){var t,n=this;return(!n.source||e)&&(t="",e||(t+=n.protocol?n.protocol+"://":"//",n.userInfo&&(t+=n.userInfo+"@"),n.host&&(t+=n.host),n.port&&(t+=":"+n.port)),n.path&&(t+=n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),n.source=t),n.source}},t}),r(F,[p],function(e){function t(){}var n=e.each,r=e.extend,i,o;return t.extend=i=function(e){function t(){var e,t,n,r=this;if(!o&&(r.init&&r.init.apply(r,arguments),t=r.Mixins))for(e=t.length;e--;)n=t[e],n.init&&n.init.apply(r,arguments)}function a(){return this}function s(e,t){return function(){var n=this,r=n._super,i;return n._super=c[e],i=t.apply(n,arguments),n._super=r,i}}var l=this,c=l.prototype,u,d,f;o=!0,u=new l,o=!1,e.Mixins&&(n(e.Mixins,function(t){t=t;for(var n in t)"init"!==n&&(e[n]=t[n])}),c.Mixins&&(e.Mixins=c.Mixins.concat(e.Mixins))),e.Methods&&n(e.Methods.split(","),function(t){e[t]=a}),e.Properties&&n(e.Properties.split(","),function(t){var n="_"+t;e[t]=function(e){var t=this,r;return e!==r?(t[n]=e,t):t[n]}}),e.Statics&&n(e.Statics,function(e,n){t[n]=e}),e.Defaults&&c.Defaults&&(e.Defaults=r({},c.Defaults,e.Defaults));for(d in e)f=e[d],u[d]="function"==typeof f&&c[d]?s(d,f):f;return t.prototype=u,t.constructor=t,t.extend=i,t},t}),r(z,[F],function(e){function t(e){for(var t=[],n=e.length,r;n--;)r=e[n],r.__checked||(t.push(r),r.__checked=1);for(n=t.length;n--;)delete t[n].__checked;return t}var n=/^([\w\\*]+)?(?:#([\w\\]+))?(?:\.([\w\\\.]+))?(?:\[\@?([\w\\]+)([\^\$\*!~]?=)([\w\\]+)\])?(?:\:(.+))?/i,r=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,i=/^\s*|\s*$/g,o,a=e.extend({init:function(e){function t(e){return e?(e=e.toLowerCase(),function(t){return"*"===e||t.type===e}):void 0}function o(e){return e?function(t){return t._name===e}:void 0}function a(e){return e?(e=e.split("."),function(t){for(var n=e.length;n--;)if(!t.hasClass(e[n]))return!1;return!0}):void 0}function s(e,t,n){return e?function(r){var i=r[e]?r[e]():"";return t?"="===t?i===n:"*="===t?i.indexOf(n)>=0:"~="===t?(" "+i+" ").indexOf(" "+n+" ")>=0:"!="===t?i!=n:"^="===t?0===i.indexOf(n):"$="===t?i.substr(i.length-n.length)===n:!1:!!n}:void 0}function l(e){var t;return e?(e=/(?:not\((.+)\))|(.+)/i.exec(e),e[1]?(t=u(e[1],[]),function(e){return!d(e,t)}):(e=e[2],function(t,n,r){return"first"===e?0===n:"last"===e?n===r-1:"even"===e?n%2===0:"odd"===e?n%2===1:t[e]?t[e]():!1})):void 0}function c(e,r,c){function u(e){e&&r.push(e)}var d;return d=n.exec(e.replace(i,"")),u(t(d[1])),u(o(d[2])),u(a(d[3])),u(s(d[4],d[5],d[6])),u(l(d[7])),r.psuedo=!!d[7],r.direct=c,r}function u(e,t){var n=[],i,o,a;do if(r.exec(""),o=r.exec(e),o&&(e=o[3],n.push(o[1]),o[2])){i=o[3];break}while(o);for(i&&u(i,t),e=[],a=0;a"!=n[a]&&e.push(c(n[a],[],">"===n[a-1]));return t.push(e),t}var d=this.match;this._selectors=u(e,[])},match:function(e,t){var n,r,i,o,a,s,l,c,u,d,f,p,m;for(t=t||this._selectors,n=0,r=t.length;r>n;n++){for(a=t[n],o=a.length,m=e,p=0,i=o-1;i>=0;i--)for(c=a[i];m;){if(c.psuedo)for(f=m.parent().items(),u=d=f.length;u--&&f[u]!==m;);for(s=0,l=c.length;l>s;s++)if(!c[s](m,u,d)){s=l+1;break}if(s===l){p++;break}if(i===o-1)break;m=m.parent()}if(p===o)return!0}return!1},find:function(e){function n(e,t,i){var o,a,s,l,c,u=t[i];for(o=0,a=e.length;a>o;o++){for(c=e[o],s=0,l=u.length;l>s;s++)if(!u[s](c,o,a)){s=l+1;break}if(s===l)i==t.length-1?r.push(c):c.items&&n(c.items(),t,i+1);else if(u.direct)return;c.items&&n(c.items(),t,i)}}var r=[],i,s,l=this._selectors;if(e.items){for(i=0,s=l.length;s>i;i++)n(e.items(),l[i],0);s>1&&(r=t(r))}return o||(o=a.Collection),new o(r)}});return a}),r(W,[p,z,F],function(e,t,n){var r,i,o=Array.prototype.push,a=Array.prototype.slice;return i={length:0,init:function(e){e&&this.add(e)},add:function(t){var n=this;return e.isArray(t)?o.apply(n,t):t instanceof r?n.add(t.toArray()):o.call(n,t),n},set:function(e){var t=this,n=t.length,r;for(t.length=0,t.add(e),r=t.length;n>r;r++)delete t[r];return t},filter:function(e){var n=this,i,o,a=[],s,l;for("string"==typeof e?(e=new t(e),l=function(t){return e.match(t)}):l=e,i=0,o=n.length;o>i;i++)s=n[i],l(s)&&a.push(s);return new r(a)},slice:function(){return new r(a.apply(this,arguments))},eq:function(e){return-1===e?this.slice(e):this.slice(e,+e+1)},each:function(t){return e.each(this,t),this},toArray:function(){return e.toArray(this)},indexOf:function(e){for(var t=this,n=t.length;n--&&t[n]!==e;);return n},reverse:function(){return new r(e.toArray(this).reverse())},hasClass:function(e){return this[0]?this[0].hasClass(e):!1},prop:function(e,t){var n=this,r,i;return t!==r?(n.each(function(n){n[e]&&n[e](t)}),n):(i=n[0],i&&i[e]?i[e]():void 0)},exec:function(t){var n=this,r=e.toArray(arguments).slice(1);return n.each(function(e){e[t]&&e[t].apply(e,r)}),n},remove:function(){for(var e=this.length;e--;)this[e].remove();return this}},e.each("fire on off show hide addClass removeClass append prepend before after reflow".split(" "),function(t){i[t]=function(){var n=e.toArray(arguments);return this.each(function(e){t in e&&e[t].apply(e,n)}),this}}),e.each("text name disabled active selected checked visible parent value data".split(" "),function(e){i[e]=function(t){return this.prop(e,t)}}),r=n.extend(i),t.Collection=r,r}),r(V,[p,y],function(e,t){return{id:function(){return t.DOM.uniqueId()},createFragment:function(e){return t.DOM.createFragment(e)},getWindowSize:function(){return t.DOM.getViewPort()},getSize:function(e){var t,n;if(e.getBoundingClientRect){var r=e.getBoundingClientRect();t=Math.max(r.width||r.right-r.left,e.offsetWidth),n=Math.max(r.height||r.bottom-r.bottom,e.offsetHeight)}else t=e.offsetWidth,n=e.offsetHeight;return{width:t,height:n}},getPos:function(e,n){return t.DOM.getPos(e,n)},getViewPort:function(e){return t.DOM.getViewPort(e)},get:function(e){return document.getElementById(e)},addClass:function(e,n){return t.DOM.addClass(e,n)},removeClass:function(e,n){return t.DOM.removeClass(e,n)},hasClass:function(e,n){return t.DOM.hasClass(e,n)},toggleClass:function(e,n,r){return t.DOM.toggleClass(e,n,r)},css:function(e,n,r){return t.DOM.setStyle(e,n,r)},on:function(e,n,r,i){return t.DOM.bind(e,n,r,i)},off:function(e,n,r){return t.DOM.unbind(e,n,r)},fire:function(e,n,r){return t.DOM.fire(e,n,r)},innerHtml:function(e,n){t.DOM.setHTML(e,n)}}}),r(U,[F,p,W,V],function(e,t,n,r){var i=t.makeMap("focusin focusout scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave wheel keydown keypress keyup contextmenu"," "),o={},a="onmousewheel"in document,s=!1,l=e.extend({Statics:{elementIdCache:o},isRtl:function(){return l.rtl},classPrefix:"mce-",init:function(e){var n=this,i,o;if(n.settings=e=t.extend({},n.Defaults,e),n._id=e.id||r.id(),n._text=n._name="",n._width=n._height=0,n._aria={role:e.role},i=e.classes)for(i=i.split(" "),i.map={},o=i.length;o--;)i.map[i[o]]=!0;n._classes=i||[],n.visible(!0),t.each("title text width height name classes visible disabled active value".split(" "),function(t){var r=e[t],i;r!==i?n[t](r):n["_"+t]===i&&(n["_"+t]=!1)}),n.on("click",function(){return n.disabled()?!1:void 0}),e.classes&&t.each(e.classes.split(" "),function(e){n.addClass(e)}),n.settings=e,n._borderBox=n.parseBox(e.border),n._paddingBox=n.parseBox(e.padding),n._marginBox=n.parseBox(e.margin),e.hidden&&n.hide()},Properties:"parent,title,text,width,height,disabled,active,name,value",Methods:"renderHtml",getContainerElm:function(){return document.body},getParentCtrl:function(e){for(var t,n=this.getRoot().controlIdLookup;e&&n&&!(t=n[e.id]);)e=e.parentNode;return t},parseBox:function(e){var t,n=10;if(e)return"number"==typeof e?(e=e||0,{top:e,left:e,bottom:e,right:e}):(e=e.split(" "),t=e.length,1===t?e[1]=e[2]=e[3]=e[0]:2===t?(e[2]=e[0],e[3]=e[1]):3===t&&(e[3]=e[1]),{top:parseInt(e[0],n)||0,right:parseInt(e[1],n)||0,bottom:parseInt(e[2],n)||0,left:parseInt(e[3],n)||0})},borderBox:function(){return this._borderBox},paddingBox:function(){return this._paddingBox},marginBox:function(){return this._marginBox},measureBox:function(e,t){function n(t){var n=document.defaultView;return n?(t=t.replace(/[A-Z]/g,function(e){return"-"+e}),n.getComputedStyle(e,null).getPropertyValue(t)):e.currentStyle[t]}function r(e){var t=parseFloat(n(e),10);return isNaN(t)?0:t}return{top:r(t+"TopWidth"),right:r(t+"RightWidth"),bottom:r(t+"BottomWidth"),left:r(t+"LeftWidth")}},initLayoutRect:function(){var e=this,t=e.settings,n,i,o=e.getEl(),a,s,l,c,u,d,f,p;n=e._borderBox=e._borderBox||e.measureBox(o,"border"),e._paddingBox=e._paddingBox||e.measureBox(o,"padding"),e._marginBox=e._marginBox||e.measureBox(o,"margin"),p=r.getSize(o),d=t.minWidth,f=t.minHeight,l=d||p.width,c=f||p.height,a=t.width,s=t.height,u=t.autoResize,u="undefined"!=typeof u?u:!a&&!s,a=a||l,s=s||c;var m=n.left+n.right,h=n.top+n.bottom,g=t.maxWidth||65535,v=t.maxHeight||65535;return e._layoutRect=i={x:t.x||0,y:t.y||0,w:a,h:s,deltaW:m,deltaH:h,contentW:a-m,contentH:s-h,innerW:a-m,innerH:s-h,startMinWidth:d||0,startMinHeight:f||0,minW:Math.min(l,g),minH:Math.min(c,v),maxW:g,maxH:v,autoResize:u,scrollW:0},e._lastLayoutRect={},i},layoutRect:function(e){var t=this,n=t._layoutRect,r,i,o,a,s,c;return n||(n=t.initLayoutRect()),e?(o=n.deltaW,a=n.deltaH,e.x!==s&&(n.x=e.x),e.y!==s&&(n.y=e.y),e.minW!==s&&(n.minW=e.minW),e.minH!==s&&(n.minH=e.minH),i=e.w,i!==s&&(i=in.maxW?n.maxW:i,n.w=i,n.innerW=i-o),i=e.h,i!==s&&(i=in.maxH?n.maxH:i,n.h=i,n.innerH=i-a),i=e.innerW,i!==s&&(i=in.maxW-o?n.maxW-o:i,n.innerW=i,n.w=i+o),i=e.innerH,i!==s&&(i=in.maxH-a?n.maxH-a:i,n.innerH=i,n.h=i+a),e.contentW!==s&&(n.contentW=e.contentW),e.contentH!==s&&(n.contentH=e.contentH),r=t._lastLayoutRect,(r.x!==n.x||r.y!==n.y||r.w!==n.w||r.h!==n.h)&&(c=l.repaintControls,c&&c.map&&!c.map[t._id]&&(c.push(t),c.map[t._id]=!0),r.x=n.x,r.y=n.y,r.w=n.w,r.h=n.h),t):n},repaint:function(){var e=this,t,n,r,i,o=0,a=0,s,l;l=document.createRange?function(e){return e}:Math.round,t=e.getEl().style,r=e._layoutRect,s=e._lastRepaintRect||{},i=e._borderBox,o=i.left+i.right,a=i.top+i.bottom,r.x!==s.x&&(t.left=l(r.x)+"px",s.x=r.x),r.y!==s.y&&(t.top=l(r.y)+"px",s.y=r.y),r.w!==s.w&&(t.width=l(r.w-o)+"px",s.w=r.w),r.h!==s.h&&(t.height=l(r.h-a)+"px",s.h=r.h),e._hasBody&&r.innerW!==s.innerW&&(n=e.getEl("body").style,n.width=l(r.innerW)+"px",s.innerW=r.innerW),e._hasBody&&r.innerH!==s.innerH&&(n=n||e.getEl("body").style,n.height=l(r.innerH)+"px",s.innerH=r.innerH),e._lastRepaintRect=s,e.fire("repaint",{},!1)},on:function(e,t){function n(e){var t,n;return function(i){return t||r.parents().each(function(r){var i=r.settings.callbacks;return i&&(t=i[e])?(n=r,!1):void 0}),t.call(n,i)}}var r=this,o,a,s,l;if(t)for("string"==typeof t&&(t=n(t)),s=e.toLowerCase().split(" "),l=s.length;l--;)e=s[l],o=r._bindings,o||(o=r._bindings={}),a=o[e],a||(a=o[e]=[]),a.push(t),i[e]&&(r._nativeEvents?r._nativeEvents[e]=!0:r._nativeEvents={name:!0},r._rendered&&r.bindPendingEvents());return r},off:function(e,t){var n=this,r,i=n._bindings,o,a,s,l;if(i)if(e)for(s=e.toLowerCase().split(" "),r=s.length;r--;){if(e=s[r],o=i[e],!e){for(a in i)i[a].length=0;return n}if(o)if(t)for(l=o.length;l--;)o[l]===t&&o.splice(l,1);else o.length=0}else n._bindings=[];return n},fire:function(e,t,n){function r(){return!1}function i(){return!0}var o=this,a,s,l,c;if(e=e.toLowerCase(),t=t||{},t.type||(t.type=e),t.control||(t.control=o),t.preventDefault||(t.preventDefault=function(){t.isDefaultPrevented=i},t.stopPropagation=function(){t.isPropagationStopped=i},t.stopImmediatePropagation=function(){t.isImmediatePropagationStopped=i},t.isDefaultPrevented=r,t.isPropagationStopped=r,t.isImmediatePropagationStopped=r),o._bindings&&(l=o._bindings[e]))for(a=0,s=l.length;s>a&&(t.isImmediatePropagationStopped()||l[a].call(o,t)!==!1);a++);if(n!==!1)for(c=o.parent();c&&!t.isPropagationStopped();)c.fire(e,t,!1),c=c.parent();return t},hasEventListeners:function(e){return e in this._bindings},parents:function(e){var t=this,r,i=new n;for(r=t.parent();r;r=r.parent())i.add(r);return e&&(i=i.filter(e)),i},next:function(){var e=this.parent().items();return e[e.indexOf(this)+1]},prev:function(){var e=this.parent().items();return e[e.indexOf(this)-1]},findCommonAncestor:function(e,t){for(var n;e;){for(n=t;n&&e!=n;)n=n.parent();if(e==n)break;e=e.parent()}return e},hasClass:function(e,t){var n=this._classes[t||"control"];return e=this.classPrefix+e,n&&!!n.map[e]},addClass:function(e,t){var n=this,r,i;return e=this.classPrefix+e,r=n._classes[t||"control"],r||(r=[],r.map={},n._classes[t||"control"]=r),r.map[e]||(r.map[e]=e,r.push(e),n._rendered&&(i=n.getEl(t),i&&(i.className=r.join(" ")))),n},removeClass:function(e,t){var n=this,r,i,o;if(e=this.classPrefix+e,r=n._classes[t||"control"],r&&r.map[e])for(delete r.map[e],i=r.length;i--;)r[i]===e&&r.splice(i,1);return n._rendered&&(o=n.getEl(t),o&&(o.className=r.join(" "))),n},toggleClass:function(e,t,n){var r=this;return t?r.addClass(e,n):r.removeClass(e,n),r},classes:function(e){var t=this._classes[e||"control"];return t?t.join(" "):""},innerHtml:function(e){return r.innerHtml(this.getEl(),e),this},getEl:function(e,t){var n,i=e?this._id+"-"+e:this._id;return n=o[i]=(t===!0?null:o[i])||r.get(i)},visible:function(e){var t=this,n;return"undefined"!=typeof e?(t._visible!==e&&(t._rendered&&(t.getEl().style.display=e?"":"none"),t._visible=e,n=t.parent(),n&&(n._lastRect=null),t.fire(e?"show":"hide")),t):t._visible},show:function(){return this.visible(!0)},hide:function(){return this.visible(!1)},focus:function(){try{this.getEl().focus()}catch(e){}return this},blur:function(){return this.getEl().blur(),this},aria:function(e,t){var n=this,r=n.getEl(n.ariaTarget);return"undefined"==typeof t?n._aria[e]:(n._aria[e]=t,n._rendered&&r.setAttribute("role"==e?e:"aria-"+e,t),n)},encode:function(e,t){return t!==!1&&l.translate&&(e=l.translate(e)),(e||"").replace(/[&<>"]/g,function(e){return"&#"+e.charCodeAt(0)+";"})},before:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t),!0),t},after:function(e){var t=this,n=t.parent();return n&&n.insert(e,n.items().indexOf(t)),t},remove:function(){var e=this,t=e.getEl(),n=e.parent(),i,a;if(e.items){var s=e.items().toArray();for(a=s.length;a--;)s[a].remove()}n&&n.items&&(i=[],n.items().each(function(t){t!==e&&i.push(t)}),n.items().set(i),n._lastRect=null),e._eventsRoot&&e._eventsRoot==e&&r.off(t);var l=e.getRoot().controlIdLookup;if(l&&delete l[e._id],delete o[e._id],t&&t.parentNode){var c=t.getElementsByTagName("*");for(a=c.length;a--;)delete o[c[a].id];t.parentNode.removeChild(t)}return e._rendered=!1,e},renderBefore:function(e){var t=this;return e.parentNode.insertBefore(r.createFragment(t.renderHtml()),e),t.postRender(),t},renderTo:function(e){var t=this;return e=e||t.getContainerElm(),e.appendChild(r.createFragment(t.renderHtml())),t.postRender(),t},postRender:function(){var e=this,t=e.settings,n,i,o,a,s;for(a in t)0===a.indexOf("on")&&e.on(a.substr(2),t[a]);if(e._eventsRoot){for(o=e.parent();!s&&o;o=o.parent())s=o._eventsRoot;if(s)for(a in s._nativeEvents)e._nativeEvents[a]=!0}e.bindPendingEvents(),t.style&&(n=e.getEl(),n&&(n.setAttribute("style",t.style),n.style.cssText=t.style)),e._visible||r.css(e.getEl(),"display","none"),e.settings.border&&(i=e.borderBox(),r.css(e.getEl(),{"border-top-width":i.top,"border-right-width":i.right,"border-bottom-width":i.bottom,"border-left-width":i.left}));var l=e.getRoot();l.controlIdLookup||(l.controlIdLookup={}),l.controlIdLookup[e._id]=e;for(var c in e._aria)e.aria(c,e._aria[c]);e.fire("postrender",{},!1)},scrollIntoView:function(e){function t(e,t){var n,r,i=e;for(n=r=0;i&&i!=t&&i.nodeType;)n+=i.offsetLeft||0,r+=i.offsetTop||0,i=i.offsetParent;return{x:n,y:r}}var n=this.getEl(),r=n.parentNode,i,o,a,s,l,c,u=t(n,r);return i=u.x,o=u.y,a=n.offsetWidth,s=n.offsetHeight,l=r.clientWidth,c=r.clientHeight,"end"==e?(i-=l-a,o-=c-s):"center"==e&&(i-=l/2-a/2,o-=c/2-s/2),r.scrollLeft=i,r.scrollTop=o,this},bindPendingEvents:function(){function e(e){var t=o.getParentCtrl(e.target);t&&t.fire(e.type,e)}function t(){var e=d._lastHoverCtrl;e&&(e.fire("mouseleave",{target:e.getEl()}),e.parents().each(function(e){e.fire("mouseleave",{target:e.getEl()})}),d._lastHoverCtrl=null)}function n(e){var t=o.getParentCtrl(e.target),n=d._lastHoverCtrl,r=0,i,a,s;if(t!==n){if(d._lastHoverCtrl=t,a=t.parents().toArray().reverse(),a.push(t),n){for(s=n.parents().toArray().reverse(),s.push(n),r=0;r=r;i--)n=s[i],n.fire("mouseleave",{target:n.getEl()})}for(i=r;il;l++)d=u[l]._eventsRoot;for(d||(d=u[u.length-1]||o),o._eventsRoot=d,c=l,l=0;c>l;l++)u[l]._eventsRoot=d;for(p in f){if(!f)return!1;"wheel"!==p||s?("mouseenter"===p||"mouseleave"===p?d._hasMouseEnter||(r.on(d.getEl(),"mouseleave",t),r.on(d.getEl(),"mouseover",n),d._hasMouseEnter=1):d[p]||(r.on(d.getEl(),p,e),d[p]=!0),f[p]=!1):a?r.on(o.getEl(),"mousewheel",i):r.on(o.getEl(),"DOMMouseScroll",i)}}},getRoot:function(){for(var e=this,t,n=[];e;){if(e.rootControl){t=e.rootControl;break}n.push(e),t=e,e=e.parent()}t||(t=this);for(var r=n.length;r--;)n[r].rootControl=t;return t},reflow:function(){return this.repaint(),this}});return l}),r(q,[],function(){var e={},t;return{add:function(t,n){e[t.toLowerCase()]=n},has:function(t){return!!e[t.toLowerCase()]},create:function(n,r){var i,o,a;if(!t){a=tinymce.ui;for(o in a)e[o.toLowerCase()]=a[o];t=!0}if("string"==typeof n?(r=r||{},r.type=n):(r=n,n=r.type),n=n.toLowerCase(),i=e[n],!i)throw new Error("Could not find control by type: "+n);return i=new i(r),i.type=n,i}}}),r($,[],function(){return function(e){function t(e){return e=e||b,e&&e.getAttribute("role")}function n(e){for(var n,r=e||b;r=r.parentNode;)if(n=t(r))return n}function r(e){var t=b;return t?t.getAttribute("aria-"+e):void 0}function i(e){return"INPUT"==e.tagName||"TEXTAREA"==e.tagName}function o(e){return i(e)&&!e.hidden?!0:/^(button|menuitem|checkbox|tab|menuitemcheckbox|option|gridcell)$/.test(t(e))?!0:!1}function a(e){function t(e){if(1==e.nodeType&&"none"!=e.style.display){o(e)&&n.push(e);for(var r=0;re?e=t.length-1:e>=t.length&&(e=0),t[e]&&t[e].focus(),e}function u(e,t){var n=-1,r=s();t=t||a(r.getEl());for(var i=0;i=0&&(n=t.getEl(),n&&n.parentNode.removeChild(n),n=e.getEl(),n&&n.parentNode.removeChild(n)),t.parent(this)},create:function(t){var n=this,i,a=[];return o.isArray(t)||(t=[t]),o.each(t,function(t){t&&(t instanceof e||("string"==typeof t&&(t={type:t}),i=o.extend({},n.settings.defaults,t),t.type=i.type=i.type||t.type||n.settings.defaultType||(i.defaults?i.defaults.type:null),t=r.create(i)),a.push(t))}),a},renderNew:function(){var e=this;return e.items().each(function(t,n){var r,i;t.parent(e),t._rendered||(r=e.getEl("body"),i=a.createFragment(t.renderHtml()),r.hasChildNodes()&&n<=r.childNodes.length-1?r.insertBefore(i,r.childNodes[n]):r.appendChild(i),t.postRender())}),e._layout.applyClasses(e),e._lastRect=null,e},append:function(e){return this.add(e).renderNew()},prepend:function(e){var t=this;return t.items().set(t.create(e).concat(t.items().toArray())),t.renderNew()},insert:function(e,t,n){var r=this,i,o,a;return e=r.create(e),i=r.items(),!n&&t=0&&t
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "},postRender:function(){var e=this,t;return e.items().exec("postRender"),e._super(),e._layout.postRender(e),e._rendered=!0,e.settings.style&&a.css(e.getEl(),e.settings.style),e.settings.border&&(t=e.borderBox(),a.css(e.getEl(),{"border-top-width":t.top,"border-right-width":t.right,"border-bottom-width":t.bottom,"border-left-width":t.left})),e.parent()||(e.keyboardNav=new i({root:e})),e},initLayoutRect:function(){var e=this,t=e._super();return e._layout.recalc(e),t},recalc:function(){var e=this,t=e._layoutRect,n=e._lastRect;return n&&n.w==t.w&&n.h==t.h?void 0:(e._layout.recalc(e),t=e.layoutRect(),e._lastRect={x:t.x,y:t.y,w:t.w,h:t.h},!0)},reflow:function(){var t;if(this.visible()){for(e.repaintControls=[],e.repaintControls.map={},this.recalc(),t=e.repaintControls.length;t--;)e.repaintControls[t].repaint();"flow"!==this.settings.layout&&"stack"!==this.settings.layout&&this.repaint(),e.repaintControls=[]}return this}})}),r(K,[V],function(e){function t(){var e=document,t,n,r,i,o,a,s,l,c=Math.max;return t=e.documentElement,n=e.body,r=c(t.scrollWidth,n.scrollWidth),i=c(t.clientWidth,n.clientWidth),o=c(t.offsetWidth,n.offsetWidth),a=c(t.scrollHeight,n.scrollHeight),s=c(t.clientHeight,n.clientHeight),l=c(t.offsetHeight,n.offsetHeight),{width:o>r?i:r,height:l>a?s:a}}return function(n,r){function i(){return a.getElementById(r.handle||n)}var o,a=document,s,l,c,u,d,f;r=r||{},l=function(n){var l=t(),p,m;n.preventDefault(),s=n.button,p=i(),d=n.screenX,f=n.screenY,m=window.getComputedStyle?window.getComputedStyle(p,null).getPropertyValue("cursor"):p.runtimeStyle.cursor,o=a.createElement("div"),e.css(o,{position:"absolute",top:0,left:0,width:l.width,height:l.height,zIndex:2147483647,opacity:1e-4,background:"red",cursor:m}),a.body.appendChild(o),e.on(a,"mousemove",u),e.on(a,"mouseup",c),r.start(n)},u=function(e){return e.button!==s?c(e):(e.deltaX=e.screenX-d,e.deltaY=e.screenY-f,e.preventDefault(),void r.drag(e))},c=function(t){e.off(a,"mousemove",u),e.off(a,"mouseup",c),o.parentNode.removeChild(o),r.stop&&r.stop(t)},this.destroy=function(){e.off(i())},e.on(i(),"mousedown",l)}}),r(Y,[V,K],function(e,t){return{init:function(){var e=this;e.on("repaint",e.renderScroll)},renderScroll:function(){function n(){function t(t,a,s,l,c,u){var d,f,p,m,h,g,v,y,b;if(f=i.getEl("scroll"+t)){if(y=a.toLowerCase(),b=s.toLowerCase(),i.getEl("absend")&&e.css(i.getEl("absend"),y,i.layoutRect()[l]-1),!c)return void e.css(f,"display","none");e.css(f,"display","block"),d=i.getEl("body"),p=i.getEl("scroll"+t+"t"),m=d["client"+s]-2*o,m-=n&&r?f["client"+u]:0,h=d["scroll"+s],g=m/h,v={},v[y]=d["offset"+a]+o,v[b]=m,e.css(f,v),v={},v[y]=d["scroll"+a]*g,v[b]=m*g,e.css(p,v)}}var n,r,a;a=i.getEl("body"),n=a.scrollWidth>a.clientWidth,r=a.scrollHeight>a.clientHeight,t("h","Left","Width","contentW",n,"Height"),t("v","Top","Height","contentH",r,"Width")}function r(){function n(n,r,a,s,l){var c,u=i._id+"-scroll"+n,d=i.classPrefix;i.getEl().appendChild(e.createFragment('
    ')),i.draghelper=new t(u+"t",{start:function(){c=i.getEl("body")["scroll"+r],e.addClass(e.get(u),d+"active")},drag:function(e){var t,u,d,f,p=i.layoutRect();u=p.contentW>p.innerW,d=p.contentH>p.innerH,f=i.getEl("body")["client"+a]-2*o,f-=u&&d?i.getEl("scroll"+n)["client"+l]:0,t=f/i.getEl("body")["scroll"+a],i.getEl("body")["scroll"+r]=c+e["delta"+s]/t},stop:function(){e.removeClass(e.get(u),d+"active")}})}i.addClass("scroll"),n("v","Top","Height","Y","Width"),n("h","Left","Width","X","Height")}var i=this,o=2;i.settings.autoScroll&&(i._hasScroll||(i._hasScroll=!0,r(),i.on("wheel",function(e){var t=i.getEl("body");t.scrollLeft+=10*(e.deltaX||0),t.scrollTop+=10*e.deltaY,n()}),e.on(i.getEl("body"),"scroll",n)),n())}}}),r(G,[j,Y],function(e,t){return e.extend({Defaults:{layout:"fit",containerCls:"panel"},Mixins:[t],renderHtml:function(){var e=this,t=e._layout,n=e.settings.html;return e.preRender(),t.preRender(e),"undefined"==typeof n?n='
    '+t.renderHtml(e)+"
    ":("function"==typeof n&&(n=n.call(e)),e._hasBody=!1),'
    '+(e._preBodyHtml||"")+n+"
    "}})}),r(X,[V],function(e){function t(t,n,r){var i,o,a,s,l,c,u,d,f,p;return f=e.getViewPort(),o=e.getPos(n),a=o.x,s=o.y,t._fixed&&(a-=f.x,s-=f.y),i=t.getEl(),p=e.getSize(i),l=p.width,c=p.height,p=e.getSize(n),u=p.width,d=p.height,r=(r||"").split(""),"b"===r[0]&&(s+=d),"r"===r[1]&&(a+=u),"c"===r[0]&&(s+=Math.round(d/2)),"c"===r[1]&&(a+=Math.round(u/2)),"b"===r[3]&&(s-=c),"r"===r[4]&&(a-=l),"c"===r[3]&&(s-=Math.round(c/2)),"c"===r[4]&&(a-=Math.round(l/2)),{x:a,y:s,w:l,h:c}}return{testMoveRel:function(n,r){for(var i=e.getViewPort(),o=0;o0&&a.x+a.w0&&a.y+a.hi.x&&a.x+a.wi.y&&a.y+a.he?0:e+n>t?(e=t-n,0>e?0:e):e}var i=this;if(i.settings.constrainToViewport){var o=e.getViewPort(window),a=i.layoutRect();t=r(t,o.w+o.x,a.w),n=r(n,o.h+o.y,a.h)}return i._rendered?i.layoutRect({x:t,y:n}).repaint():(i.settings.x=t,i.settings.y=n),i.fire("move",{x:t,y:n}),i}}}),r(J,[V],function(e){return{resizeToContent:function(){this._layoutRect.autoResize=!0,this._lastRect=null,this.reflow()},resizeTo:function(t,n){if(1>=t||1>=n){var r=e.getWindowSize();t=1>=t?t*r.w:t,n=1>=n?n*r.h:n}return this._layoutRect.autoResize=!1,this.layoutRect({minW:t,minH:n,w:t,h:n}).reflow()},resizeBy:function(e,t){var n=this,r=n.layoutRect();return n.resizeTo(r.w+e,r.h+t)}}}),r(Q,[G,X,J,V],function(e,t,n,r){function i(e){var t;for(t=s.length;t--;)s[t]===e&&s.splice(t,1);for(t=l.length;t--;)l[t]===e&&l.splice(t,1)}var o,a,s=[],l=[],c,u=e.extend({Mixins:[t,n],init:function(e){function t(){var e,t=u.zIndex||65535,n;if(l.length)for(e=0;en&&(e.fixed(!1).layoutRect({y:e._autoFixY}).repaint(),t(!1,e._autoFixY-n)):(e._autoFixY=e.layoutRect().y,e._autoFixY'),n=n.firstChild,d.getContainerElm().appendChild(n),setTimeout(function(){r.addClass(n,i+"in"),r.addClass(d.getEl(),i+"in")},0),c=!0),l.push(d),t()}}),d.on("close hide",function(e){if(e.control==d){for(var n=l.length;n--;)l[n]===d&&l.splice(n,1);t()}}),d.on("show",function(){d.parents().each(function(e){return e._fixed?(d.fixed(!0),!1):void 0})}),e.popover&&(d._preBodyHtml='
    ',d.addClass("popover").addClass("bottom").addClass(d.isRtl()?"end":"start"))},fixed:function(e){var t=this;if(t._fixed!=e){if(t._rendered){var n=r.getViewPort();e?t.layoutRect().y-=n.y:t.layoutRect().y+=n.y}t.toggleClass("fixed",e),t._fixed=e}return t},show:function(){var e=this,t,n=e._super();for(t=s.length;t--&&s[t]!==e;);return-1===t&&s.push(e),n},hide:function(){return i(this),this._super()},hideAll:function(){u.hideAll()},close:function(){var e=this;return e.fire("close"),e.remove()},remove:function(){i(this),this._super()},postRender:function(){var e=this;return e.settings.bodyRole&&this.getEl("body").setAttribute("role",e.settings.bodyRole),e._super()}});return u.hideAll=function(){for(var e=s.length;e--;){var t=s[e];t&&t.settings.autohide&&(t.hide(),s.splice(e,1))}},u}),r(Z,[Q,G,V,K],function(e,t,n,r){var i=e.extend({modal:!0,Defaults:{border:1,layout:"flex",containerCls:"panel",role:"dialog",callbacks:{submit:function(){this.fire("submit",{data:this.toJSON()})},close:function(){this.close()}}},init:function(e){var n=this;n._super(e),n.isRtl()&&n.addClass("rtl"),n.addClass("window"),n._fixed=!0,e.buttons&&(n.statusbar=new t({layout:"flex",border:"1 0 0 0",spacing:3,padding:10,align:"center",pack:n.isRtl()?"start":"end",defaults:{type:"button"},items:e.buttons}),n.statusbar.addClass("foot"),n.statusbar.parent(n)),n.on("click",function(e){-1!=e.target.className.indexOf(n.classPrefix+"close")&&n.close() -}),n.on("cancel",function(){n.close()}),n.aria("describedby",n.describedBy||n._id+"-none"),n.aria("label",e.title),n._fullscreen=!1},recalc:function(){var e=this,t=e.statusbar,r,i,o,a;e._fullscreen&&(e.layoutRect(n.getWindowSize()),e.layoutRect().contentH=e.layoutRect().innerH),e._super(),r=e.layoutRect(),e.settings.title&&!e._fullscreen&&(i=r.headerW,i>r.w&&(o=r.x-Math.max(0,i/2),e.layoutRect({w:i,x:o}),a=!0)),t&&(t.layoutRect({w:e.layoutRect().innerW}).recalc(),i=t.layoutRect().minW+r.deltaW,i>r.w&&(o=r.x-Math.max(0,i-r.w),e.layoutRect({w:i,x:o}),a=!0)),a&&e.recalc()},initLayoutRect:function(){var e=this,t=e._super(),r=0,i;if(e.settings.title&&!e._fullscreen){i=e.getEl("head");var o=n.getSize(i);t.headerW=o.width,t.headerH=o.height,r+=t.headerH}e.statusbar&&(r+=e.statusbar.layoutRect().h),t.deltaH+=r,t.minH+=r,t.h+=r;var a=n.getWindowSize();return t.x=Math.max(0,a.w/2-t.w/2),t.y=Math.max(0,a.h/2-t.h/2),t},renderHtml:function(){var e=this,t=e._layout,n=e._id,r=e.classPrefix,i=e.settings,o="",a="",s=i.html;return e.preRender(),t.preRender(e),i.title&&(o='
    '+e.encode(i.title)+'
    '),i.url&&(s=''),"undefined"==typeof s&&(s=t.renderHtml(e)),e.statusbar&&(a=e.statusbar.renderHtml()),'
    '+o+'
    '+s+"
    "+a+"
    "},fullscreen:function(e){var t=this,r=document.documentElement,i,o=t.classPrefix,a;if(e!=t._fullscreen)if(n.on(window,"resize",function(){var e;if(t._fullscreen)if(i)t._timer||(t._timer=setTimeout(function(){var e=n.getWindowSize();t.moveTo(0,0).resizeTo(e.w,e.h),t._timer=0},50));else{e=(new Date).getTime();var r=n.getWindowSize();t.moveTo(0,0).resizeTo(r.w,r.h),(new Date).getTime()-e>50&&(i=!0)}}),a=t.layoutRect(),t._fullscreen=e,e){t._initial={x:a.x,y:a.y,w:a.w,h:a.h},t._borderBox=t.parseBox("0"),t.getEl("head").style.display="none",a.deltaH-=a.headerH+2,n.addClass(r,o+"fullscreen"),n.addClass(document.body,o+"fullscreen"),t.addClass("fullscreen");var s=n.getWindowSize();t.moveTo(0,0).resizeTo(s.w,s.h)}else t._borderBox=t.parseBox(t.settings.border),t.getEl("head").style.display="",a.deltaH+=a.headerH,n.removeClass(r,o+"fullscreen"),n.removeClass(document.body,o+"fullscreen"),t.removeClass("fullscreen"),t.moveTo(t._initial.x,t._initial.y).resizeTo(t._initial.w,t._initial.h);return t.reflow()},postRender:function(){var e=this,t;setTimeout(function(){e.addClass("in")},0),e._super(),e.statusbar&&e.statusbar.postRender(),e.focus(),this.dragHelper=new r(e._id+"-dragh",{start:function(){t={x:e.layoutRect().x,y:e.layoutRect().y}},drag:function(n){e.moveTo(t.x+n.deltaX,t.y+n.deltaY)}}),e.on("submit",function(t){t.isDefaultPrevented()||e.close()})},submit:function(){return this.fire("submit",{data:this.toJSON()})},remove:function(){var e=this,t=e.classPrefix;e.dragHelper.destroy(),e._super(),e.statusbar&&this.statusbar.remove(),e._fullscreen&&(n.removeClass(document.documentElement,t+"fullscreen"),n.removeClass(document.body,t+"fullscreen"))}});return i}),r(et,[Z],function(e){var t=e.extend({init:function(e){e={border:1,padding:20,layout:"flex",pack:"center",align:"center",containerCls:"panel",autoScroll:!0,buttons:{type:"button",text:"Ok",action:"ok"},items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200}},this._super(e)},Statics:{OK:1,OK_CANCEL:2,YES_NO:3,YES_NO_CANCEL:4,msgBox:function(n){var r,i=n.callback||function(){};switch(n.buttons){case t.OK_CANCEL:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}},{type:"button",text:"Cancel",onClick:function(e){e.control.parents()[1].close(),i(!1)}}];break;case t.YES_NO:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}}];break;case t.YES_NO_CANCEL:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close()}}];break;default:r=[{type:"button",text:"Ok",subtype:"primary",onClick:function(e){e.control.parents()[1].close(),i(!0)}}]}return new e({padding:20,x:n.x,y:n.y,minWidth:300,minHeight:100,layout:"flex",pack:"center",align:"center",buttons:r,title:n.title,role:"alertdialog",items:{type:"label",multiline:!0,maxWidth:500,maxHeight:200,text:n.text},onPostRender:function(){this.aria("describedby",this.items()[0]._id)},onClose:n.onClose,onCancel:function(){i(!1)}}).renderTo(document.body).reflow()},alert:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,t.msgBox(e)},confirm:function(e,n){return"string"==typeof e&&(e={text:e}),e.callback=n,e.buttons=t.OK_CANCEL,t.msgBox(e)}}});return t}),r(tt,[Z,et],function(e,t){return function(n){function r(){return o.length?o[o.length-1]:void 0}var i=this,o=[];i.windows=o,i.open=function(t,r){var i;return n.editorManager.activeEditor=n,t.title=t.title||" ",t.url=t.url||t.file,t.url&&(t.width=parseInt(t.width||320,10),t.height=parseInt(t.height||240,10)),t.body&&(t.items={defaults:t.defaults,type:t.bodyType||"form",items:t.body}),t.url||t.buttons||(t.buttons=[{text:"Ok",subtype:"primary",onclick:function(){i.find("form")[0].submit()}},{text:"Cancel",onclick:function(){i.close()}}]),i=new e(t),o.push(i),i.on("close",function(){for(var e=o.length;e--;)o[e]===i&&o.splice(e,1);n.focus()}),t.data&&i.on("postRender",function(){this.find("*").each(function(e){var n=e.name();n in t.data&&e.value(t.data[n])})}),i.features=t||{},i.params=r||{},n.nodeChanged(),i.renderTo(document.body).reflow()},i.alert=function(e,r,i){t.alert(e,function(){r?r.call(i||this):n.focus()})},i.confirm=function(e,n,r){t.confirm(e,function(e){n.call(r||this,e)})},i.close=function(){r()&&r().close()},i.getParams=function(){return r()?r().params:null},i.setParams=function(e){r()&&(r().params=e)}}}),r(nt,[R,B,x,h,g,p],function(e,t,n,r,i,o){return function(a){function s(e,t){try{a.getDoc().execCommand(e,!1,t)}catch(n){}}function l(){var e=a.getDoc().documentMode;return e?e:6}function c(e){return e.isDefaultPrevented()}function u(){function t(e){var t=new i(function(){});o.each(a.getBody().getElementsByTagName("*"),function(e){"SPAN"==e.tagName&&e.setAttribute("mce-data-marked",1),!e.hasAttribute("data-mce-style")&&e.hasAttribute("style")&&a.dom.setAttrib(e,"style",e.getAttribute("style"))}),t.observe(a.getDoc(),{childList:!0,attributes:!0,subtree:!0,attributeFilter:["style"]}),a.getDoc().execCommand(e?"ForwardDelete":"Delete",!1,null);var n=a.selection.getRng(),r=n.startContainer.parentNode;o.each(t.takeRecords(),function(e){if("style"==e.attributeName){var t=e.target.getAttribute("data-mce-style");t?e.target.setAttribute("style",t):e.target.removeAttribute("style")}o.each(e.addedNodes,function(e){if("SPAN"==e.nodeName&&!e.getAttribute("mce-data-marked")){var t,i;e==r&&(t=n.startOffset,i=e.firstChild),U.remove(e,!0),i&&(n.setStart(i,t),n.setEnd(i,t),a.selection.setRng(n))}})}),t.disconnect(),o.each(a.dom.select("span[mce-data-marked]"),function(e){e.removeAttribute("mce-data-marked")})}var n=a.getDoc(),r="data:text/mce-internal,",i=window.MutationObserver,s;i||(s=!0,i=function(){function e(e){var t=e.relatedNode||e.target;n.push({target:t,addedNodes:[t]})}function t(e){var t=e.relatedNode||e.target;n.push({target:t,attributeName:e.attrName})}var n=[],r;this.observe=function(n){r=n,r.addEventListener("DOMSubtreeModified",e,!1),r.addEventListener("DOMNodeInsertedIntoDocument",e,!1),r.addEventListener("DOMNodeInserted",e,!1),r.addEventListener("DOMAttrModified",t,!1)},this.disconnect=function(){r.removeEventListener("DOMNodeInserted",e),r.removeEventListener("DOMAttrModified",t),r.removeEventListener("DOMSubtreeModified",e,!1)},this.takeRecords=function(){return n}}),a.on("keydown",function(n){var r=n.keyCode==V,i=e.metaKeyPressed(n);if(!c(n)&&(r||n.keyCode==W)){var o=a.selection.getRng(),s=o.startContainer,l=o.startOffset;if(!i&&o.collapsed&&3==s.nodeType&&(r?l0))return;n.preventDefault(),i&&a.selection.getSel().modify("extend",r?"forward":"backward","word"),t(r)}}),a.on("keypress",function(n){c(n)||q.isCollapsed()||!n.charCode||e.metaKeyPressed(n)||(n.preventDefault(),t(!0),a.selection.setContent(String.fromCharCode(n.charCode)))}),a.addCommand("Delete",function(){t()}),a.addCommand("ForwardDelete",function(){t(!0)}),s||(a.on("dragstart",function(e){e.dataTransfer.setData("URL","data:text/mce-internal,"+escape(a.selection.getContent()))}),a.on("drop",function(e){if(!c(e)){var i=e.dataTransfer.getData("URL");if(!i||-1==i.indexOf(r)||!n.caretRangeFromPoint)return;i=unescape(i.substr(r.length)),n.caretRangeFromPoint&&(e.preventDefault(),t(),a.selection.setRng(n.caretRangeFromPoint(e.x,e.y)),a.insertContent(i))}}),a.on("cut",function(e){!c(e)&&e.clipboardData&&(e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/html",a.selection.getContent()),e.clipboardData.setData("text/plain",a.selection.getContent({format:"text"})),t(!0))}))}function d(){function e(e){var t=U.create("body"),n=e.cloneContents();return t.appendChild(n),q.serializer.serialize(t,{format:"html"})}function n(n){if(!n.setStart){if(n.item)return!1;var r=n.duplicate();return r.moveToElementText(a.getBody()),t.compareRanges(n,r)}var i=e(n),o=U.createRng();o.selectNode(a.getBody());var s=e(o);return i===s}a.on("keydown",function(e){var t=e.keyCode,r,i;if(!c(e)&&(t==V||t==W)){if(r=a.selection.isCollapsed(),i=a.getBody(),r&&!U.isEmpty(i))return;if(!r&&!n(a.selection.getRng()))return;e.preventDefault(),a.setContent(""),i.firstChild&&U.isBlock(i.firstChild)?a.selection.setCursorLocation(i.firstChild,0):a.selection.setCursorLocation(i,0),a.nodeChanged()}})}function f(){a.on("keydown",function(t){!c(t)&&65==t.keyCode&&e.metaKeyPressed(t)&&(t.preventDefault(),a.execCommand("SelectAll"))})}function p(){a.settings.content_editable||(U.bind(a.getDoc(),"focusin",function(){q.setRng(q.getRng())}),U.bind(a.getDoc(),"mousedown",function(e){e.target==a.getDoc().documentElement&&(a.getBody().focus(),q.setRng(q.getRng()))}))}function m(){a.on("keydown",function(e){if(!c(e)&&e.keyCode===W&&q.isCollapsed()&&0===q.getRng(!0).startOffset){var t=q.getNode(),n=t.previousSibling;if("HR"==t.nodeName)return U.remove(t),void e.preventDefault();n&&n.nodeName&&"hr"===n.nodeName.toLowerCase()&&(U.remove(n),e.preventDefault())}})}function h(){window.Range.prototype.getClientRects||a.on("mousedown",function(e){if(!c(e)&&"HTML"===e.target.nodeName){var t=a.getBody();t.blur(),setTimeout(function(){t.focus()},0)}})}function g(){a.on("click",function(e){e=e.target,/^(IMG|HR)$/.test(e.nodeName)&&q.getSel().setBaseAndExtent(e,0,e,1),"A"==e.nodeName&&U.hasClass(e,"mce-item-anchor")&&q.select(e),a.nodeChanged()})}function v(){function e(){var e=U.getAttribs(q.getStart().cloneNode(!1));return function(){var t=q.getStart();t!==a.getBody()&&(U.setAttrib(t,"style",null),z(e,function(e){t.setAttributeNode(e.cloneNode(!0))}))}}function t(){return!q.isCollapsed()&&U.getParent(q.getStart(),U.isBlock)!=U.getParent(q.getEnd(),U.isBlock)}a.on("keypress",function(n){var r;return c(n)||8!=n.keyCode&&46!=n.keyCode||!t()?void 0:(r=e(),a.getDoc().execCommand("delete",!1,null),r(),n.preventDefault(),!1)}),U.bind(a.getDoc(),"cut",function(n){var r;!c(n)&&t()&&(r=e(),setTimeout(function(){r()},0))})}function y(){var e,n;a.on("selectionchange",function(){n&&(clearTimeout(n),n=0),n=window.setTimeout(function(){if(!a.removed){var n=q.getRng();e&&t.compareRanges(n,e)||(a.nodeChanged(),e=n)}},50)})}function b(){document.body.setAttribute("role","application")}function C(){a.on("keydown",function(e){if(!c(e)&&e.keyCode===W&&q.isCollapsed()&&0===q.getRng(!0).startOffset){var t=q.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})}function x(){l()>7||(s("RespectVisibilityInDesign",!0),a.contentStyles.push(".mceHideBrInPre pre br {display: none}"),U.addClass(a.getBody(),"mceHideBrInPre"),j.addNodeFilter("pre",function(e){for(var t=e.length,r,i,o,a;t--;)for(r=e[t].getAll("br"),i=r.length;i--;)o=r[i],a=o.prev,a&&3===a.type&&"\n"!=a.value.charAt(a.value-1)?a.value+="\n":o.parent.insert(new n("#text",3),o,!0).value="\n"}),K.addNodeFilter("pre",function(e){for(var t=e.length,n,r,i,o;t--;)for(n=e[t].getAll("br"),r=n.length;r--;)i=n[r],o=i.prev,o&&3==o.type&&(o.value=o.value.replace(/\r?\n$/,""))}))}function w(){U.bind(a.getBody(),"mouseup",function(){var e,t=q.getNode();"IMG"==t.nodeName&&((e=U.getStyle(t,"width"))&&(U.setAttrib(t,"width",e.replace(/[^0-9%]+/g,"")),U.setStyle(t,"width","")),(e=U.getStyle(t,"height"))&&(U.setAttrib(t,"height",e.replace(/[^0-9%]+/g,"")),U.setStyle(t,"height","")))})}function _(){a.on("keydown",function(t){var n,r,i,o,s;if(!c(t)&&t.keyCode==e.BACKSPACE&&(n=q.getRng(),r=n.startContainer,i=n.startOffset,o=U.getRoot(),s=r,n.collapsed&&0===i)){for(;s&&s.parentNode&&s.parentNode.firstChild==s&&s.parentNode!=o;)s=s.parentNode;"BLOCKQUOTE"===s.tagName&&(a.formatter.toggle("blockquote",null,s),n=U.createRng(),n.setStart(r,0),n.setEnd(r,0),q.setRng(n))}})}function N(){function e(){a._refreshContentEditable(),s("StyleWithCSS",!1),s("enableInlineTableEditing",!1),$.object_resizing||s("enableObjectResizing",!1)}$.readonly||a.on("BeforeExecCommand MouseDown",e)}function E(){function e(){z(U.select("a"),function(e){var t=e.parentNode,n=U.getRoot();if(t.lastChild===e){for(;t&&!U.isBlock(t);){if(t.parentNode.lastChild!==t||t===n)return;t=t.parentNode}U.add(t,"br",{"data-mce-bogus":1})}})}a.on("SetContent ExecCommand",function(t){("setcontent"==t.type||"mceInsertLink"===t.command)&&e()})}function S(){$.forced_root_block&&a.on("init",function(){s("DefaultParagraphSeparator",$.forced_root_block)})}function k(){a.on("Undo Redo SetContent",function(e){e.initial||a.execCommand("mceRepaint")})}function T(){a.on("keydown",function(e){var t;c(e)||e.keyCode!=W||(t=a.getDoc().selection.createRange(),t&&t.item&&(e.preventDefault(),a.undoManager.beforeChange(),U.remove(t.item(0)),a.undoManager.add()))})}function R(){var e;l()>=10&&(e="",z("p div h1 h2 h3 h4 h5 h6".split(" "),function(t,n){e+=(n>0?",":"")+t+":empty"}),a.contentStyles.push(e+"{padding-right: 1px !important}"))}function A(){l()<9&&(j.addNodeFilter("noscript",function(e){for(var t=e.length,n,r;t--;)n=e[t],r=n.firstChild,r&&n.attr("data-mce-innertext",r.value)}),K.addNodeFilter("noscript",function(e){for(var t=e.length,i,o,a;t--;)i=e[t],o=e[t].firstChild,o?o.value=r.decode(o.value):(a=i.attributes.map["data-mce-innertext"],a&&(i.attr("data-mce-innertext",null),o=new n("#text",3),o.value=a,o.raw=!0,i.append(o)))}))}function B(){function e(e,t){var n=i.createTextRange();try{n.moveToPoint(e,t)}catch(r){n=null}return n}function t(t){var r;t.button?(r=e(t.x,t.y),r&&(r.compareEndPoints("StartToStart",a)>0?r.setEndPoint("StartToStart",a):r.setEndPoint("EndToEnd",a),r.select())):n()}function n(){var e=r.selection.createRange();a&&!e.item&&0===e.compareEndPoints("StartToEnd",e)&&a.select(),U.unbind(r,"mouseup",n),U.unbind(r,"mousemove",t),a=o=0}var r=U.doc,i=r.body,o,a,s;r.documentElement.unselectable=!0,U.bind(r,"mousedown contextmenu",function(i){if("HTML"===i.target.nodeName){if(o&&n(),s=r.documentElement,s.scrollHeight>s.clientHeight)return;o=1,a=e(i.x,i.y),a&&(U.bind(r,"mouseup",n),U.bind(r,"mousemove",t),U.getRoot().focus(),a.select())}})}function L(){a.on("keyup focusin mouseup",function(t){65==t.keyCode&&e.metaKeyPressed(t)||q.normalize()},!0)}function D(){a.contentStyles.push("img:-moz-broken {-moz-force-broken-image-icon:1;min-width:24px;min-height:24px}")}function M(){a.inline||a.on("keydown",function(){document.activeElement==document.body&&a.getWin().focus()})}function H(){a.inline||(a.contentStyles.push("body {min-height: 150px}"),a.on("click",function(e){"HTML"==e.target.nodeName&&(a.getBody().focus(),a.selection.normalize(),a.nodeChanged())}))}function P(){i.mac&&a.on("keydown",function(t){!e.metaKeyPressed(t)||37!=t.keyCode&&39!=t.keyCode||(t.preventDefault(),a.selection.getSel().modify("move",37==t.keyCode?"backward":"forward","word"))})}function O(){s("AutoUrlDetect",!1)}function I(){a.inline||a.on("focus blur",function(){var e=a.dom.create("br");a.getBody().appendChild(e),e.parentNode.removeChild(e)},!0)}function F(){a.on("click",function(e){"A"===e.target.tagName&&e.preventDefault()}),a.contentStyles.push(".mce-content-body {-webkit-touch-callout: none}")}var z=o.each,W=e.BACKSPACE,V=e.DELETE,U=a.dom,q=a.selection,$=a.settings,j=a.parser,K=a.serializer,Y=i.gecko,G=i.ie,X=i.webkit;C(),_(),d(),L(),X&&(u(),p(),g(),S(),i.iOS?(y(),M(),H(),F()):f()),G&&i.ie<11&&(m(),b(),x(),w(),T(),R(),A(),B()),i.ie>=11&&(H(),I()),i.ie&&(f(),O()),Y&&(m(),h(),v(),N(),E(),k(),D(),P())}}),r(rt,[p],function(e){function t(){return!1}function n(){return!0}var r="__bindings",i=e.makeMap("focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave keydown keypress keyup contextmenu dragstart dragend dragover draggesture dragdrop drop drag"," ");return{fire:function(e,i,o){var a=this,s,l,c,u,d;if(!a.removed){if(e=e.toLowerCase(),i=i||{},i.type=e,i.target||(i.target=a),i.preventDefault||(i.preventDefault=function(){i.isDefaultPrevented=n},i.stopPropagation=function(){i.isPropagationStopped=n},i.stopImmediatePropagation=function(){i.isImmediatePropagationStopped=n},i.isDefaultPrevented=t,i.isPropagationStopped=t,i.isImmediatePropagationStopped=t),a[r]&&(s=a[r][e]))for(l=0,c=s.length;c>l&&(s[l]=u=s[l],!i.isImmediatePropagationStopped());l++)if(u.call(a,i)===!1)return i.preventDefault(),i;if(o!==!1&&a.parent)for(d=a.parent();d&&!i.isPropagationStopped();)d.fire(e,i,!1),d=d.parent();return i}},on:function(e,t,n){var o=this,a,s,l,c;if(t===!1&&(t=function(){return!1}),t)for(l=e.toLowerCase().split(" "),c=l.length;c--;)e=l[c],a=o[r],a||(a=o[r]={}),s=a[e],s||(s=a[e]=[],o.bindNative&&i[e]&&o.bindNative(e)),n?s.unshift(t):s.push(t);return o},off:function(e,t){var n=this,o,a=n[r],s,l,c,u;if(a)if(e)for(c=e.toLowerCase().split(" "),o=c.length;o--;){if(e=c[o],s=a[e],!e){for(l in a)a[e].length=0;return n}if(s){if(t)for(u=s.length;u--;)s[u]===t&&s.splice(u,1);else s.length=0;!s.length&&n.unbindNative&&i[e]&&(n.unbindNative(e),delete a[e])}}else{if(n.unbindNative)for(e in a)n.unbindNative(e);n[r]=[]}return n},hasEventListeners:function(e){var t=this[r];return e=e.toLowerCase(),!(!t||!t[e]||0===t[e].length)}}}),r(it,[p,g],function(e,t){var n=e.each,r=e.explode,i={f9:120,f10:121,f11:122};return function(o){var a=this,s={};o.on("keyup keypress keydown",function(e){(e.altKey||e.ctrlKey||e.metaKey)&&n(s,function(n){var r=t.mac?e.metaKey:e.ctrlKey;if(n.ctrl==r&&n.alt==e.altKey&&n.shift==e.shiftKey)return e.keyCode==n.keyCode||e.charCode&&e.charCode==n.charCode?(e.preventDefault(),"keydown"==e.type&&n.func.call(n.scope),!0):void 0})}),a.add=function(t,a,l,c){var u;return u=l,"string"==typeof l?l=function(){o.execCommand(u,!1,null)}:e.isArray(u)&&(l=function(){o.execCommand(u[0],u[1],u[2])}),n(r(t.toLowerCase()),function(e){var t={func:l,scope:c||o,desc:o.translate(a),alt:!1,ctrl:!1,shift:!1};n(r(e,"+"),function(e){switch(e){case"alt":case"ctrl":case"shift":t[e]=!0;break;default:t.charCode=e.charCodeAt(0),t.keyCode=i[e]||e.toUpperCase().charCodeAt(0)}}),s[(t.ctrl?"ctrl":"")+","+(t.alt?"alt":"")+","+(t.shift?"shift":"")+","+t.keyCode]=t}),!0}}}),r(ot,[y,C,x,k,S,L,D,M,H,P,O,I,b,l,tt,w,N,nt,g,p,rt,it],function(e,n,r,i,o,a,s,l,c,u,d,f,p,m,h,g,v,y,b,C,x,w){function _(e,t){return"selectionchange"==t?e.getDoc():!e.inline&&/^mouse|click|contextmenu|drop/.test(t)?e.getDoc():e.getBody()}function N(e,t,r){var i=this,o,a;o=i.documentBaseUrl=r.documentBaseURL,a=r.baseURI,i.settings=t=T({id:e,theme:"modern",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:o,add_form_submit_trigger:!0,submit_patch:!0,add_unload_trigger:!0,convert_urls:!0,relative_urls:!0,remove_script_host:!0,object_resizing:!0,doctype:"",visual:!0,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,padd_empty_editor:!0,render_ui:!0,indentation:"30px",inline_styles:!0,convert_fonts_to_spans:!0,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr,section,article,hgroup,aside,figure,option,optgroup,datalist",validate:!0,entity_encoding:"named",url_converter:i.convertURL,url_converter_scope:i,ie7_compat:!0},t),n.language=t.language||"en",n.languageLoad=t.language_load,n.baseURL=r.baseURL,i.id=t.id=e,i.isNotDirty=!0,i.plugins={},i.documentBaseURI=new f(t.document_base_url||o,{base_uri:a}),i.baseURI=a,i.contentCSS=[],i.contentStyles=[],i.shortcuts=new w(i),i.execCommands={},i.queryStateCommands={},i.queryValueCommands={},i.loadedCSS={},i.suffix=r.suffix,i.editorManager=r,i.inline=t.inline,r.fire("SetupEditor",i),i.execCallback("setup",i)}var E=e.DOM,S=n.ThemeManager,k=n.PluginManager,T=C.extend,R=C.each,A=C.explode,B=C.inArray,L=C.trim,D=C.resolve,M=m.Event,H=b.gecko,P=b.ie;return N.prototype={render:function(){function e(){E.unbind(window,"ready",e),n.render()}function t(){var e=p.ScriptLoader;if(r.language&&"en"!=r.language&&!r.language_url&&(r.language_url=n.editorManager.baseURL+"/langs/"+r.language+".js"),r.language_url&&e.add(r.language_url),r.theme&&"function"!=typeof r.theme&&"-"!=r.theme.charAt(0)&&!S.urls[r.theme]){var t=r.theme_url;t=t?n.documentBaseURI.toAbsolute(t):"themes/"+r.theme+"/theme"+o+".js",S.load(r.theme,t)}C.isArray(r.plugins)&&(r.plugins=r.plugins.join(" ")),R(r.external_plugins,function(e,t){k.load(t,e),r.plugins+=" "+t}),R(r.plugins.split(/[ ,]/),function(e){if(e=L(e),e&&!k.urls[e])if("-"==e.charAt(0)){e=e.substr(1,e.length);var t=k.dependencies(e);R(t,function(e){var t={prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"};e=k.createUrl(t,e),k.load(e.resource,e)})}else k.load(e,{prefix:"plugins/",resource:e,suffix:"/plugin"+o+".js"})}),e.loadQueue(function(){n.removed||n.init()})}var n=this,r=n.settings,i=n.id,o=n.suffix;if(!M.domLoaded)return void E.bind(window,"ready",e);if(n.getElement()&&b.contentEditable){r.inline?n.inline=!0:(n.orgVisibility=n.getElement().style.visibility,n.getElement().style.visibility="hidden");var a=n.getElement().form||E.getParent(i,"form");a&&(n.formElement=a,r.hidden_input&&!/TEXTAREA|INPUT/i.test(n.getElement().nodeName)&&(E.insertAfter(E.create("input",{type:"hidden",name:i}),i),n.hasHiddenInput=!0),n.formEventDelegate=function(e){n.fire(e.type,e)},E.bind(a,"submit reset",n.formEventDelegate),n.on("reset",function(){n.setContent(n.startContent,{format:"raw"})}),!r.submit_patch||a.submit.nodeType||a.submit.length||a._mceOldSubmit||(a._mceOldSubmit=a.submit,a.submit=function(){return n.editorManager.triggerSave(),n.isNotDirty=!0,a._mceOldSubmit(a)})),n.windowManager=new h(n),"xml"==r.encoding&&n.on("GetContent",function(e){e.save&&(e.content=E.encode(e.content))}),r.add_form_submit_trigger&&n.on("submit",function(){n.initialized&&n.save()}),r.add_unload_trigger&&(n._beforeUnload=function(){!n.initialized||n.destroyed||n.isHidden()||n.save({format:"raw",no_events:!0,set_dirty:!1})},n.editorManager.on("BeforeUnload",n._beforeUnload)),t()}},init:function(){function e(n){var r=k.get(n),i,o;i=k.urls[n]||t.documentBaseUrl.replace(/\/$/,""),n=L(n),r&&-1===B(h,n)&&(R(k.dependencies(n),function(t){e(t)}),o=new r(t,i),t.plugins[n]=o,o.init&&(o.init(t,i),h.push(n)))}var t=this,n=t.settings,r=t.getElement(),i,o,a,s,l,c,u,d,f,p,m,h=[];if(t.rtl=this.editorManager.i18n.rtl,t.editorManager.add(t),n.aria_label=n.aria_label||E.getAttrib(r,"aria-label",t.getLang("aria.rich_text_area")),n.theme&&("function"!=typeof n.theme?(n.theme=n.theme.replace(/-/,""),c=S.get(n.theme),t.theme=new c(t,S.urls[n.theme]),t.theme.init&&t.theme.init(t,S.urls[n.theme]||t.documentBaseUrl.replace(/\/$/,""))):t.theme=n.theme),R(n.plugins.replace(/\-/g,"").split(/[ ,]/),e),n.render_ui&&t.theme&&(t.orgDisplay=r.style.display,"function"!=typeof n.theme?(i=n.width||r.style.width||r.offsetWidth,o=n.height||r.style.height||r.offsetHeight,a=n.min_height||100,p=/^[0-9\.]+(|px)$/i,p.test(""+i)&&(i=Math.max(parseInt(i,10),100)),p.test(""+o)&&(o=Math.max(parseInt(o,10),a)),l=t.theme.renderUI({targetNode:r,width:i,height:o,deltaWidth:n.delta_width,deltaHeight:n.delta_height}),n.content_editable||(E.setStyles(l.sizeContainer||l.editorContainer,{wi2dth:i,h2eight:o}),o=(l.iframeHeight||o)+("number"==typeof o?l.deltaHeight||0:""),a>o&&(o=a))):(l=n.theme(t,r),l.editorContainer.nodeType&&(l.editorContainer=l.editorContainer.id=l.editorContainer.id||t.id+"_parent"),l.iframeContainer.nodeType&&(l.iframeContainer=l.iframeContainer.id=l.iframeContainer.id||t.id+"_iframecontainer"),o=l.iframeHeight||r.offsetHeight),t.editorContainer=l.editorContainer),n.content_css&&R(A(n.content_css),function(e){t.contentCSS.push(t.documentBaseURI.toAbsolute(e))}),n.content_style&&t.contentStyles.push(n.content_style),n.content_editable)return r=s=l=null,t.initContentBody();for(t.iframeHTML=n.doctype+"",n.document_base_url!=t.documentBaseUrl&&(t.iframeHTML+=''),!b.caretAfter&&n.ie7_compat&&(t.iframeHTML+=''),t.iframeHTML+='',m=0;m',t.loadedCSS[g]=!0}d=n.body_id||"tinymce",-1!=d.indexOf("=")&&(d=t.getParam("body_id","","hash"),d=d[t.id]||d),f=n.body_class||"",-1!=f.indexOf("=")&&(f=t.getParam("body_class","","hash"),f=f[t.id]||""),t.iframeHTML+='
    ";var v='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+t.id+'");document.write(ed.iframeHTML);document.close();ed.initContentBody(true);})()';if(document.domain!=location.hostname&&(u=v),s=E.add(l.iframeContainer,"iframe",{id:t.id+"_ifr",src:u||'javascript:""',frameBorder:"0",allowTransparency:"true",title:t.editorManager.translate("Rich Text Area. Press ALT-F9 for menu. Press ALT-F10 for toolbar. Press ALT-0 for help"),style:{width:"100%",height:o,display:"block"}}),P)try{t.getDoc()}catch(y){s.src=u=v}t.contentAreaContainer=l.iframeContainer,l.editorContainer&&(E.get(l.editorContainer).style.display=t.orgDisplay),E.get(t.id).style.display="none",E.setAttrib(t.id,"aria-hidden",!0),u||t.initContentBody(),r=s=l=null},initContentBody:function(t){var n=this,o=n.settings,f=E.get(n.id),p=n.getDoc(),m,h;o.inline||(n.getElement().style.visibility=n.orgVisibility),t||o.content_editable||(p.open(),p.write(n.iframeHTML),p.close()),o.content_editable&&(n.on("remove",function(){var e=this.getBody();E.removeClass(e,"mce-content-body"),E.removeClass(e,"mce-edit-focus"),E.setAttrib(e,"tabIndex",null),E.setAttrib(e,"contentEditable",null)}),E.addClass(f,"mce-content-body"),f.tabIndex=-1,n.contentDocument=p=o.content_document||document,n.contentWindow=o.content_window||window,n.bodyElement=f,o.content_document=o.content_window=null,o.root_name=f.nodeName.toLowerCase()),m=n.getBody(),m.disabled=!0,o.readonly||(n.inline&&"static"==E.getStyle(m,"position",!0)&&(m.style.position="relative"),m.contentEditable=n.getParam("content_editable_state",!0)),m.disabled=!1,n.schema=new g(o),n.dom=new e(p,{keep_values:!0,url_converter:n.convertURL,url_converter_scope:n,hex_colors:o.force_hex_style_colors,class_filter:o.class_filter,update_styles:!0,root_element:o.content_editable?n.id:null,collect:o.content_editable,schema:n.schema,onSetAttrib:function(e){n.fire("SetAttrib",e)}}),n.parser=new v(o,n.schema),n.parser.addAttributeFilter("src,href,style",function(e,t){for(var r=e.length,i,o=n.dom,a,s;r--;)i=e[r],a=i.attr(t),s="data-mce-"+t,i.attributes.map[s]||("style"===t?i.attr(s,o.serializeStyle(o.parseStyle(a),i.name)):i.attr(s,n.convertURL(a,t,i.name)))}),n.parser.addNodeFilter("script",function(e){for(var t=e.length,n;t--;)n=e[t],n.attr("type","mce-"+(n.attr("type")||"text/javascript"))}),n.parser.addNodeFilter("#cdata",function(e){for(var t=e.length,n;t--;)n=e[t],n.type=8,n.name="#comment",n.value="[CDATA["+n.value+"]]"}),n.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(e){for(var t=e.length,i,o=n.schema.getNonEmptyElements();t--;)i=e[t],i.isEmpty(o)&&(i.empty().append(new r("br",1)).shortEnded=!0)}),n.serializer=new i(o,n),n.selection=new a(n.dom,n.getWin(),n.serializer,n),n.formatter=new s(n),n.undoManager=new l(n),n.forceBlocks=new u(n),n.enterKey=new c(n),n.editorCommands=new d(n),n.fire("PreInit"),o.browser_spellcheck||o.gecko_spellcheck||(p.body.spellcheck=!1,E.setAttrib(m,"spellcheck","false")),n.fire("PostRender"),n.quirks=y(n),o.directionality&&(m.dir=o.directionality),o.nowrap&&(m.style.whiteSpace="nowrap"),o.protect&&n.on("BeforeSetContent",function(e){R(o.protect,function(t){e.content=e.content.replace(t,function(e){return""})})}),n.on("SetContent",function(){n.addVisual(n.getBody())}),o.padd_empty_editor&&n.on("PostProcess",function(e){e.content=e.content.replace(/^(]*>( | |\s|\u00a0|)<\/p>[\r\n]*|
    [\r\n]*)$/,"")}),n.load({initial:!0,format:"html"}),n.startContent=n.getContent({format:"raw"}),n.initialized=!0,R(n._pendingNativeEvents,function(e){n.dom.bind(_(n,e),e,function(e){n.fire(e.type,e)})}),n.fire("init"),n.focus(!0),n.nodeChanged({initial:!0}),n.execCallback("init_instance_callback",n),n.contentStyles.length>0&&(h="",R(n.contentStyles,function(e){h+=e+"\r\n"}),n.dom.addStyle(h)),R(n.contentCSS,function(e){n.loadedCSS[e]||(n.dom.loadCSS(e),n.loadedCSS[e]=!0)}),o.auto_focus&&setTimeout(function(){var e=n.editorManager.get(o.auto_focus);e.selection.select(e.getBody(),1),e.selection.collapse(1),e.getBody().focus(),e.getWin().focus()},100),f=p=m=null},focus:function(e){var t,n=this,r=n.selection,i=n.settings.content_editable,o,a,s=n.getDoc(),l;e||(o=r.getRng(),o.item&&(a=o.item(0)),n._refreshContentEditable(),i||(b.opera||n.getBody().focus(),n.getWin().focus()),(H||i)&&(l=n.getBody(),l.setActive&&b.ie<11?l.setActive():l.focus(),i&&r.normalize()),a&&a.ownerDocument==s&&(o=s.body.createControlRange(),o.addElement(a),o.select())),n.editorManager.activeEditor!=n&&((t=n.editorManager.activeEditor)&&t.fire("deactivate",{relatedTarget:n}),n.fire("activate",{relatedTarget:t})),n.editorManager.activeEditor=n},execCallback:function(e){var t=this,n=t.settings[e],r;if(n)return t.callbackLookup&&(r=t.callbackLookup[e])&&(n=r.func,r=r.scope),"string"==typeof n&&(r=n.replace(/\.\w+$/,""),r=r?D(r):0,n=D(n),t.callbackLookup=t.callbackLookup||{},t.callbackLookup[e]={func:n,scope:r}),n.apply(r||t,Array.prototype.slice.call(arguments,1))},translate:function(e){var t=this.settings.language||"en",n=this.editorManager.i18n;return e?n.data[t+"."+e]||e.replace(/\{\#([^\}]+)\}/g,function(e,r){return n.data[t+"."+r]||"{#"+r+"}"}):""},getLang:function(e,n){return this.editorManager.i18n.data[(this.settings.language||"en")+"."+e]||(n!==t?n:"{#"+e+"}")},getParam:function(e,t,n){var r=e in this.settings?this.settings[e]:t,i;return"hash"===n?(i={},"string"==typeof r?R(r.split(r.indexOf("=")>0?/[;,](?![^=;,]*(?:[;,]|$))/:","),function(e){e=e.split("="),i[L(e[0])]=L(e.length>1?e[1]:e)}):i=r,i):r},nodeChanged:function(){var e=this,t=e.selection,n,r,i;!e.initialized||e.settings.disable_nodechange||e.settings.readonly||(i=e.getBody(),n=t.getStart()||i,n=P&&n.ownerDocument!=e.getDoc()?e.getBody():n,"IMG"==n.nodeName&&t.isCollapsed()&&(n=n.parentNode),r=[],e.dom.getParent(n,function(e){return e===i?!0:void r.push(e) -}),e.fire("NodeChange",{element:n,parents:r}))},addButton:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),t.text||t.icon||(t.icon=e),n.buttons=n.buttons||{},t.tooltip=t.tooltip||t.title,n.buttons[e]=t},addMenuItem:function(e,t){var n=this;t.cmd&&(t.onclick=function(){n.execCommand(t.cmd)}),n.menuItems=n.menuItems||{},n.menuItems[e]=t},addCommand:function(e,t,n){this.execCommands[e]={func:t,scope:n||this}},addQueryStateHandler:function(e,t,n){this.queryStateCommands[e]={func:t,scope:n||this}},addQueryValueHandler:function(e,t,n){this.queryValueCommands[e]={func:t,scope:n||this}},addShortcut:function(e,t,n,r){this.shortcuts.add(e,t,n,r)},execCommand:function(e,t,n,r){var i=this,o=0,a;return/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint)$/.test(e)||r&&r.skip_focus||i.focus(),r=T({},r),r=i.fire("BeforeExecCommand",{command:e,ui:t,value:n}),r.isDefaultPrevented()?!1:(a=i.execCommands[e])&&a.func.call(a.scope,t,n)!==!0?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):(R(i.plugins,function(r){return r.execCommand&&r.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),o=!0,!1):void 0}),o?o:i.theme&&i.theme.execCommand&&i.theme.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):i.editorCommands.execCommand(e,t,n)?(i.fire("ExecCommand",{command:e,ui:t,value:n}),!0):(i.getDoc().execCommand(e,t,n),void i.fire("ExecCommand",{command:e,ui:t,value:n})))},queryCommandState:function(e){var t=this,n,r;if(!t._isHidden()){if((n=t.queryStateCommands[e])&&(r=n.func.call(n.scope),r!==!0))return r;if(r=t.editorCommands.queryCommandState(e),-1!==r)return r;try{return t.getDoc().queryCommandState(e)}catch(i){}}},queryCommandValue:function(e){var n=this,r,i;if(!n._isHidden()){if((r=n.queryValueCommands[e])&&(i=r.func.call(r.scope),i!==!0))return i;if(i=n.editorCommands.queryCommandValue(e),i!==t)return i;try{return n.getDoc().queryCommandValue(e)}catch(o){}}},show:function(){var e=this;E.show(e.getContainer()),E.hide(e.id),e.load(),e.fire("show")},hide:function(){var e=this,t=e.getDoc();P&&t&&!e.inline&&t.execCommand("SelectAll"),e.save(),E.hide(e.getContainer()),E.setStyle(e.id,"display",e.orgDisplay),e.fire("hide")},isHidden:function(){return!E.isHidden(this.id)},setProgressState:function(e,t){this.fire("ProgressState",{state:e,time:t})},load:function(e){var n=this,r=n.getElement(),i;return r?(e=e||{},e.load=!0,i=n.setContent(r.value!==t?r.value:r.innerHTML,e),e.element=r,e.no_events||n.fire("LoadContent",e),e.element=r=null,i):void 0},save:function(e){var t=this,n=t.getElement(),r,i;if(n&&t.initialized)return e=e||{},e.save=!0,e.element=n,r=e.content=t.getContent(e),e.no_events||t.fire("SaveContent",e),r=e.content,/TEXTAREA|INPUT/i.test(n.nodeName)?n.value=r:(t.inline||(n.innerHTML=r),(i=E.getParent(t.id,"form"))&&R(i.elements,function(e){return e.name==t.id?(e.value=r,!1):void 0})),e.element=n=null,e.set_dirty!==!1&&(t.isNotDirty=!0),r},setContent:function(e,t){var n=this,r=n.getBody(),i;return t=t||{},t.format=t.format||"html",t.set=!0,t.content=e,t.no_events||n.fire("BeforeSetContent",t),e=t.content,0===e.length||/^\s+$/.test(e)?(i=n.settings.forced_root_block,i&&n.schema.isValidChild(r.nodeName.toLowerCase(),i.toLowerCase())?(e=P&&11>P?"":'
    ',e=n.dom.createHTML(i,n.settings.forced_root_block_attrs,e)):P||(e='
    '),r.innerHTML=e,n.fire("SetContent",t)):("raw"!==t.format&&(e=new o({},n.schema).serialize(n.parser.parse(e,{isRootContent:!0}))),t.content=L(e),n.dom.setHTML(r,t.content),t.no_events||n.fire("SetContent",t)),t.content},getContent:function(e){var t=this,n,r=t.getBody();return e=e||{},e.format=e.format||"html",e.get=!0,e.getInner=!0,e.no_events||t.fire("BeforeGetContent",e),n="raw"==e.format?r.innerHTML:"text"==e.format?r.innerText||r.textContent:t.serializer.serialize(r,e),e.content="text"!=e.format?L(n):n,e.no_events||t.fire("GetContent",e),e.content},insertContent:function(e){this.execCommand("mceInsertContent",!1,e)},isDirty:function(){return!this.isNotDirty},getContainer:function(){var e=this;return e.container||(e.container=E.get(e.editorContainer||e.id+"_parent")),e.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return E.get(this.settings.content_element||this.id)},getWin:function(){var e=this,t;return e.contentWindow||(t=E.get(e.id+"_ifr"),t&&(e.contentWindow=t.contentWindow)),e.contentWindow},getDoc:function(){var e=this,t;return e.contentDocument||(t=e.getWin(),t&&(e.contentDocument=t.document)),e.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(e,t,n){var r=this,i=r.settings;return i.urlconverter_callback?r.execCallback("urlconverter_callback",e,n,!0,t):!i.convert_urls||n&&"LINK"==n.nodeName||0===e.indexOf("file:")||0===e.length?e:i.relative_urls?r.documentBaseURI.toRelative(e):e=r.documentBaseURI.toAbsolute(e,i.remove_script_host)},addVisual:function(e){var n=this,r=n.settings,i=n.dom,o;e=e||n.getBody(),n.hasVisual===t&&(n.hasVisual=r.visual),R(i.select("table,a",e),function(e){var t;switch(e.nodeName){case"TABLE":return o=r.visual_table_class||"mce-item-table",t=i.getAttrib(e,"border"),void(t&&"0"!=t||(n.hasVisual?i.addClass(e,o):i.removeClass(e,o)));case"A":return void(i.getAttrib(e,"href",!1)||(t=i.getAttrib(e,"name")||e.id,o=r.visual_anchor_class||"mce-item-anchor",t&&(n.hasVisual?i.addClass(e,o):i.removeClass(e,o))))}}),n.fire("VisualAid",{element:e,hasVisual:n.hasVisual})},remove:function(){var e=this;if(!e.removed){e.save(),e.fire("remove"),e.off(),e.removed=1,e.hasHiddenInput&&E.remove(e.getElement().nextSibling),E.setStyle(e.id,"display",e.orgDisplay),e.settings.content_editable||(M.unbind(e.getWin()),M.unbind(e.getDoc()));var t=e.getContainer();M.unbind(e.getBody()),M.unbind(t),e.editorManager.remove(e),E.remove(t),e.destroy()}},bindNative:function(e){var t=this;t.settings.readonly||(t.initialized?t.dom.bind(_(t,e),e,function(n){t.fire(e,n)}):t._pendingNativeEvents?t._pendingNativeEvents.push(e):t._pendingNativeEvents=[e])},unbindNative:function(e){var t=this;t.initialized&&t.dom.unbind(e)},destroy:function(e){var t=this,n;if(!t.destroyed){if(!e&&!t.removed)return void t.remove();e&&H&&(M.unbind(t.getDoc()),M.unbind(t.getWin()),M.unbind(t.getBody())),e||(t.editorManager.off("beforeunload",t._beforeUnload),t.theme&&t.theme.destroy&&t.theme.destroy(),t.selection.destroy(),t.dom.destroy()),n=t.formElement,n&&(n._mceOldSubmit&&(n.submit=n._mceOldSubmit,n._mceOldSubmit=null),E.unbind(n,"submit reset",t.formEventDelegate)),t.contentAreaContainer=t.formElement=t.container=t.editorContainer=null,t.settings.content_element=t.bodyElement=t.contentDocument=t.contentWindow=null,t.selection&&(t.selection=t.selection.win=t.selection.dom=t.selection.dom.doc=null),t.destroyed=1}},_refreshContentEditable:function(){var e=this,t,n;e._isHidden()&&(t=e.getBody(),n=t.parentNode,n.removeChild(t),n.appendChild(t),t.focus())},_isHidden:function(){var e;return H?(e=this.selection.getSel(),!e||!e.rangeCount||0===e.rangeCount):0}},T(N.prototype,x),N}),r(at,[],function(){var e={};return{rtl:!1,add:function(t,n){for(var r in n)e[r]=n[r];this.rtl=this.rtl||"rtl"===e._dir},translate:function(t){if("undefined"==typeof t)return t;if("string"!=typeof t&&t.raw)return t.raw;if(t.push){var n=t.slice(1);t=(e[t[0]]||t[0]).replace(/\{([^\}]+)\}/g,function(e,t){return n[t]})}return e[t]||t},data:e}}),r(st,[y,g],function(e,t){function n(e){function a(){try{return document.activeElement}catch(e){return document.body}}function s(e){return e&&e.startContainer?{startContainer:e.startContainer,startOffset:e.startOffset,endContainer:e.endContainer,endOffset:e.endOffset}:e}function l(e,t){var n;return t.startContainer?(n=e.getDoc().createRange(),n.setStart(t.startContainer,t.startOffset),n.setEnd(t.endContainer,t.endOffset)):n=t,n}function c(e){return!!o.getParent(e,n.isEditorUIElement)}function u(e,t){for(var n=t.getBody();e;){if(e==n)return!0;e=e.parentNode}}function d(n){var d=n.editor;d.on("init",function(){(d.inline||t.ie)&&(d.on("nodechange keyup",function(){var e=document.activeElement;e&&e.id==d.id+"_ifr"&&(e=d.getBody()),u(e,d)&&(d.lastRng=d.selection.getRng())}),t.webkit&&!r&&(r=function(){var t=e.activeEditor;if(t&&t.selection){var n=t.selection.getRng();n&&!n.collapsed&&(d.lastRng=n)}},o.bind(document,"selectionchange",r)))}),d.on("setcontent",function(){d.lastRng=null}),d.on("mousedown",function(){d.selection.lastFocusBookmark=null}),d.on("focusin",function(){var t=e.focusedEditor;d.selection.lastFocusBookmark&&(d.selection.setRng(l(d,d.selection.lastFocusBookmark)),d.selection.lastFocusBookmark=null),t!=d&&(t&&t.fire("blur",{focusedEditor:d}),e.activeEditor=d,e.focusedEditor=d,d.fire("focus",{blurredEditor:t}),d.focus(!0)),d.lastRng=null}),d.on("focusout",function(){window.setTimeout(function(){var t=e.focusedEditor;c(a())||t!=d||(d.fire("blur",{focusedEditor:null}),e.focusedEditor=null,d.selection&&(d.selection.lastFocusBookmark=null))},0)}),i||(i=function(t){var n=e.activeEditor;n&&t.target.ownerDocument==document&&(n.selection&&(n.selection.lastFocusBookmark=s(n.lastRng)),c(t.target)||e.focusedEditor!=n||(n.fire("blur",{focusedEditor:null}),e.focusedEditor=null))},o.bind(document,"focusin",i))}function f(t){e.focusedEditor==t.editor&&(e.focusedEditor=null),e.activeEditor||(o.unbind(document,"selectionchange",r),o.unbind(document,"focusin",i),r=i=null)}e.on("AddEditor",d),e.on("RemoveEditor",f)}var r,i,o=e.DOM;return n.isEditorUIElement=function(e){return-1!==e.className.toString().indexOf("mce-")},n}),r(lt,[ot,y,I,g,p,rt,at,st],function(e,n,r,i,o,a,s,l){var c=n.DOM,u=o.explode,d=o.each,f=o.extend,p=0,m,h={majorVersion:"4",minorVersion:"0.20",releaseDate:"2014-03-18",editors:[],i18n:s,activeEditor:null,setup:function(){var e=this,t,n,i="",o;if(n=document.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(n)||(n+="/"),o=window.tinymce||window.tinyMCEPreInit)t=o.base||o.baseURL,i=o.suffix;else for(var a=document.getElementsByTagName("script"),s=0;s0&&d(u(m),function(n){c.get(n)?(l=new e(n,t,a),s.push(l),l.render(!0)):d(document.forms,function(r){d(r.elements,function(r){r.name===n&&(n="mce_editor_"+p++,c.setAttrib(r,"id",n),l=new e(n,t,a),s.push(l),l.render(1))})})});break;case"textareas":case"specific_textareas":d(c.select("textarea"),function(r){t.editor_deselector&&i(r,t.editor_deselector)||(!t.editor_selector||i(r,t.editor_selector))&&(l=new e(n(r),t,a),s.push(l),l.render(!0))})}t.oninit&&(m=h=0,d(s,function(e){h++,e.initialized?m++:e.on("init",function(){m++,m==h&&r(t,"oninit")}),m==h&&r(t,"oninit")}))}var a=this,s=[],l;a.settings=t,c.bind(window,"ready",o)},get:function(e){return e===t?this.editors:this.editors[e]},add:function(e){var t=this,n=t.editors;return n[e.id]=e,n.push(e),t.activeEditor=e,t.fire("AddEditor",{editor:e}),m||(m=function(){t.fire("BeforeUnload")},c.bind(window,"beforeunload",m)),e},createEditor:function(t,n){return this.add(new e(t,n,this))},remove:function(e){var t=this,n,r=t.editors,i,o;{if(e){if("string"==typeof e)return e=e.selector||e,void d(c.select(e),function(e){t.remove(r[e.id])});if(i=e,!r[i.id])return null;for(delete r[i.id],n=0;n=0;n--)t.remove(r[n])}},execCommand:function(t,n,r){var i=this,o=i.get(r);switch(t){case"mceAddEditor":return i.get(r)||new e(r,i.settings,i).render(),!0;case"mceRemoveEditor":return o&&o.remove(),!0;case"mceToggleEditor":return o?(o.isHidden()?o.show():o.hide(),!0):(i.execCommand("mceAddEditor",0,r),!0)}return i.activeEditor?i.activeEditor.execCommand(t,n,r):!1},triggerSave:function(){d(this.editors,function(e){e.save()})},addI18n:function(e,t){s.add(e,t)},translate:function(e){return s.translate(e)}};return f(h,a),h.setup(),window.tinymce=window.tinyMCE=h,h}),r(ct,[lt,p],function(e,t){var n=t.each,r=t.explode;e.on("AddEditor",function(e){var t=e.editor;t.on("preInit",function(){function e(e,t){n(t,function(t,n){t&&s.setStyle(e,n,t)}),s.rename(e,"span")}function i(e){s=t.dom,l.convert_fonts_to_spans&&n(s.select("font,u,strike",e.node),function(e){o[e.nodeName.toLowerCase()](s,e)})}var o,a,s,l=t.settings;l.inline_styles&&(a=r(l.font_size_legacy_values),o={font:function(t,n){e(n,{backgroundColor:n.style.backgroundColor,color:n.color,fontFamily:n.face,fontSize:a[parseInt(n.size,10)-1]})},u:function(t,n){e(n,{textDecoration:"underline"})},strike:function(t,n){e(n,{textDecoration:"line-through"})}},t.on("PreProcess SetContent",i))})})}),r(ut,[],function(){return{send:function(e){function t(){!e.async||4==n.readyState||r++>1e4?(e.success&&1e4>r&&200==n.status?e.success.call(e.success_scope,""+n.responseText,n,e):e.error&&e.error.call(e.error_scope,r>1e4?"TIMED_OUT":"GENERAL",n,e),n=null):setTimeout(t,10)}var n,r=0;if(e.scope=e.scope||this,e.success_scope=e.success_scope||e.scope,e.error_scope=e.error_scope||e.scope,e.async=e.async===!1?!1:!0,e.data=e.data||"",n=new XMLHttpRequest){if(n.overrideMimeType&&n.overrideMimeType(e.content_type),n.open(e.type||(e.data?"POST":"GET"),e.url,e.async),e.content_type&&n.setRequestHeader("Content-Type",e.content_type),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.send(e.data),!e.async)return t();setTimeout(t,10)}}}}),r(dt,[],function(){function e(t,n){var r,i,o,a;if(n=n||'"',null===t)return"null";if(o=typeof t,"string"==o)return i="\bb t\nn\ff\rr\"\"''\\\\",n+t.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(e,t){return'"'===n&&"'"===e?e:(r=i.indexOf(t),r+1?"\\"+i.charAt(r+1):(e=t.charCodeAt().toString(16),"\\u"+"0000".substring(e.length)+e))})+n;if("object"==o){if(t.hasOwnProperty&&"[object Array]"===Object.prototype.toString.call(t)){for(r=0,i="[";r0?",":"")+e(t[r],n);return i+"]"}i="{";for(a in t)t.hasOwnProperty(a)&&(i+="function"!=typeof t[a]?(i.length>1?","+n:n)+a+n+":"+e(t[a],n):"");return i+"}"}return""+t}return{serialize:e,parse:function(e){try{return window[String.fromCharCode(101)+"val"]("("+e+")")}catch(t){}}}}),r(ft,[dt,ut,p],function(e,t,n){function r(e){this.settings=i({},e),this.count=0}var i=n.extend;return r.sendRPC=function(e){return(new r).send(e)},r.prototype={send:function(n){var r=n.error,o=n.success;n=i(this.settings,n),n.success=function(t,i){t=e.parse(t),"undefined"==typeof t&&(t={error:"JSON Parse error."}),t.error?r.call(n.error_scope||n.scope,t.error,i):o.call(n.success_scope||n.scope,t.result)},n.error=function(e,t){r&&r.call(n.error_scope||n.scope,e,t)},n.data=e.serialize({id:n.id||"c"+this.count++,method:n.method,params:n.params}),n.content_type="application/json",t.send(n)}},r}),r(pt,[y],function(e){return{callbacks:{},count:0,send:function(n){var r=this,i=e.DOM,o=n.count!==t?n.count:r.count,a="tinymce_jsonp_"+o;r.callbacks[o]=function(e){i.remove(a),delete r.callbacks[o],n.callback(e)},i.add(i.doc.body,"script",{id:a,src:n.url,type:"text/javascript"}),r.count++}}}),r(mt,[],function(){function e(){s=[];for(var e in a)s.push(e);i.length=s.length}function n(){function n(e){var n,r;return r=e!==t?u+e:i.indexOf(",",u),-1===r||r>i.length?null:(n=i.substring(u,r),u=r+1,n)}var r,i,s,u=0;if(a={},c){o.load(l),i=o.getAttribute(l)||"";do{var d=n();if(null===d)break;if(r=n(parseInt(d,32)||0),null!==r){if(d=n(),null===d)break;s=n(parseInt(d,32)||0),r&&(a[r]=s)}}while(null!==r);e()}}function r(){var t,n="";if(c){for(var r in a)t=a[r],n+=(n?",":"")+r.length.toString(32)+","+r+","+t.length.toString(32)+","+t;o.setAttribute(l,n);try{o.save(l)}catch(i){}e()}}var i,o,a,s,l,c;try{if(window.localStorage)return localStorage}catch(u){}return l="tinymce",o=document.documentElement,c=!!o.addBehavior,c&&o.addBehavior("#default#userData"),i={key:function(e){return s[e]},getItem:function(e){return e in a?a[e]:null},setItem:function(e,t){a[e]=""+t,r()},removeItem:function(e){delete a[e],r()},clear:function(){a={},r()}},n(),i}),r(ht,[y,l,b,C,p,g],function(e,t,n,r,i,o){var a=window.tinymce;return a.DOM=e.DOM,a.ScriptLoader=n.ScriptLoader,a.PluginManager=r.PluginManager,a.ThemeManager=r.ThemeManager,a.dom=a.dom||{},a.dom.Event=t.Event,i.each(i,function(e,t){a[t]=e}),i.each("isOpera isWebKit isIE isGecko isMac".split(" "),function(e){a[e]=o[e.substr(2).toLowerCase()]}),{}}),r(gt,[F,p],function(e,t){return e.extend({Defaults:{firstControlClass:"first",lastControlClass:"last"},init:function(e){this.settings=t.extend({},this.Defaults,e)},preRender:function(e){e.addClass(this.settings.containerClass,"body")},applyClasses:function(e){var t=this,n=t.settings,r,i,o;r=e.items().filter(":visible"),i=n.firstControlClass,o=n.lastControlClass,r.each(function(e){e.removeClass(i).removeClass(o),n.controlClass&&e.addClass(n.controlClass)}),r.eq(0).addClass(i),r.eq(-1).addClass(o)},renderHtml:function(e){var t=this,n=t.settings,r,i="";return r=e.items(),r.eq(0).addClass(n.firstControlClass),r.eq(-1).addClass(n.lastControlClass),r.each(function(e){n.controlClass&&e.addClass(n.controlClass),i+=e.renderHtml()}),i},recalc:function(){},postRender:function(){}})}),r(vt,[gt],function(e){return e.extend({Defaults:{containerClass:"abs-layout",controlClass:"abs-layout-item"},recalc:function(e){e.items().filter(":visible").each(function(e){var t=e.settings;e.layoutRect({x:t.x,y:t.y,w:t.w,h:t.h}),e.recalc&&e.recalc()})},renderHtml:function(e){return'
    '+this._super(e)}})}),r(yt,[U,X],function(e,t){return e.extend({Mixins:[t],Defaults:{classes:"widget tooltip tooltip-n"},text:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t._rendered&&(t.getEl().lastChild.innerHTML=t.encode(e)),t):t._value},renderHtml:function(){var e=this,t=e.classPrefix;return'"},repaint:function(){var e=this,t,n;t=e.getEl().style,n=e._layoutRect,t.left=n.x+"px",t.top=n.y+"px",t.zIndex=131070}})}),r(bt,[U,yt],function(e,t){var n,r=e.extend({init:function(e){var t=this;t._super(e),t.canFocus=!0,e.tooltip&&r.tooltips!==!1&&(t.on("mouseenter",function(n){var r=t.tooltip().moveTo(-65535);if(n.control==t){var i=r.text(e.tooltip).show().testMoveRel(t.getEl(),["bc-tc","bc-tl","bc-tr"]);r.toggleClass("tooltip-n","bc-tc"==i),r.toggleClass("tooltip-nw","bc-tl"==i),r.toggleClass("tooltip-ne","bc-tr"==i),r.moveRel(t.getEl(),i)}else r.hide()}),t.on("mouseleave mousedown click",function(){t.tooltip().hide()})),t.aria("label",e.ariaLabel||e.tooltip)},tooltip:function(){return n||(n=new t({type:"tooltip"}),n.renderTo()),n},active:function(e){var t=this,n;return e!==n&&(t.aria("pressed",e),t.toggleClass("active",e)),t._super(e)},disabled:function(e){var t=this,n;return e!==n&&(t.aria("disabled",e),t.toggleClass("disabled",e)),t._super(e)},postRender:function(){var e=this,t=e.settings;e._rendered=!0,e._super(),e.parent()||!t.width&&!t.height||(e.initLayoutRect(),e.repaint()),t.autofocus&&e.focus()},remove:function(){this._super(),n&&(n.remove(),n=null)}});return r}),r(Ct,[bt],function(e){return e.extend({Defaults:{classes:"widget btn",role:"button"},init:function(e){var t=this,n;t.on("click mousedown",function(e){e.preventDefault()}),t._super(e),n=e.size,e.subtype&&t.addClass(e.subtype),n&&t.addClass("btn-"+n)},icon:function(e){var t=this,n=t.classPrefix;if("undefined"==typeof e)return t.settings.icon;if(t.settings.icon=e,e=e?n+"ico "+n+"i-"+t.settings.icon:"",t._rendered){var r=t.getEl().firstChild,i=r.getElementsByTagName("i")[0];e?(i&&i==r.firstChild||(i=document.createElement("i"),r.insertBefore(i,r.firstChild)),i.className=e):i&&r.removeChild(i),t.text(t._text)}return t},repaint:function(){var e=this.getEl().firstChild.style;e.width=e.height="100%",this._super()},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon,i="";return e.settings.image&&(r="none",i=" style=\"background-image: url('"+e.settings.image+"')\""),r=e.settings.icon?n+"ico "+n+"i-"+r:"",'
    "}})}),r(xt,[j],function(e){return e.extend({Defaults:{defaultType:"button",role:"group"},renderHtml:function(){var e=this,t=e._layout;return e.addClass("btn-group"),e.preRender(),t.preRender(e),'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(wt,[bt],function(e){return e.extend({Defaults:{classes:"checkbox",role:"checkbox",checked:!1},init:function(e){var t=this;t._super(e),t.on("click mousedown",function(e){e.preventDefault()}),t.on("click",function(e){e.preventDefault(),t.disabled()||t.checked(!t.checked())}),t.checked(t.settings.checked)},checked:function(e){var t=this;return"undefined"!=typeof e?(e?t.addClass("checked"):t.removeClass("checked"),t._checked=e,t.aria("checked",e),t):t._checked},value:function(e){return this.checked(e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix;return'
    '+e.encode(e._text)+"
    "}})}),r(_t,[Ct,Q],function(e,t){return e.extend({showPanel:function(){var e=this,n=e.settings;if(e.active(!0),e.panel)e.panel.show();else{var r=n.panel;r.type&&(r={layout:"grid",items:r}),r.role=r.role||"dialog",r.popover=!0,r.autohide=!0,r.ariaRoot=!0,e.panel=new t(r).on("hide",function(){e.active(!1)}).on("cancel",function(t){t.stopPropagation(),e.focus(),e.hidePanel()}).parent(e).renderTo(e.getContainerElm()),e.panel.fire("show"),e.panel.reflow()}e.panel.moveRel(e.getEl(),n.popoverAlign||(e.isRtl()?["bc-tr","bc-tc"]:["bc-tl","bc-tc"]))},hidePanel:function(){var e=this;e.panel&&e.panel.hide()},postRender:function(){var e=this;return e.aria("haspopup",!0),e.on("click",function(t){t.control===e&&(e.panel&&e.panel.visible()?e.hidePanel():(e.showPanel(),e.panel.focus(!!t.aria)))}),e._super()}})}),r(Nt,[_t,y],function(e,t){var n=t.DOM;return e.extend({init:function(e){this._super(e),this.addClass("colorbutton")},color:function(e){return e?(this._color=e,this.getEl("preview").style.backgroundColor=e,this):this._color},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"",i=e.settings.image?" style=\"background-image: url('"+e.settings.image+"')\"":"";return'
    '},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(r){r.aria&&"down"==r.aria.key||r.control!=e||n.getParent(r.target,"."+e.classPrefix+"open")||(r.stopImmediatePropagation(),t.call(e,r))}),delete e.settings.onclick,e._super()}})}),r(Et,[bt,q,V],function(e,t,n){return e.extend({init:function(e){var t=this;t._super(e),t.addClass("combobox"),t.subinput=!0,t.ariaTarget="inp",e=t.settings,e.menu=e.menu||e.values,e.menu&&(e.icon="caret"),t.on("click",function(n){for(var r=n.target,i=t.getEl();r&&r!=i;)r.id&&-1!=r.id.indexOf("-open")&&(t.fire("action"),e.menu&&(t.showMenu(),n.aria&&t.menu.items()[0].focus())),r=r.parentNode}),t.on("keydown",function(e){"INPUT"==e.target.nodeName&&13==e.keyCode&&t.parents().reverse().each(function(n){return e.preventDefault(),t.fire("change"),n.hasEventListeners("submit")&&n.toJSON?(n.fire("submit",{data:n.toJSON()}),!1):void 0})}),e.placeholder&&(t.addClass("placeholder"),t.on("focusin",function(){t._hasOnChange||(n.on(t.getEl("inp"),"change",function(){t.fire("change")}),t._hasOnChange=!0),t.hasClass("placeholder")&&(t.getEl("inp").value="",t.removeClass("placeholder"))}),t.on("focusout",function(){0===t.value().length&&(t.getEl("inp").value=e.placeholder,t.addClass("placeholder"))}))},showMenu:function(){var e=this,n=e.settings,r;e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(e.getContainerElm()),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control===e.menu&&e.focus()}),e.menu.on("show hide",function(t){t.control.items().each(function(t){t.active(t.value()==e.value())})}).fire("show"),e.menu.on("select",function(t){e.value(t.control.value())}),e.on("focusin",function(t){"INPUT"==t.target.tagName&&e.menu.hide()}),e.aria("expanded",!0)),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"])},value:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t.removeClass("placeholder"),t._rendered&&(t.getEl("inp").value=e),t):t._rendered?(e=t.getEl("inp").value,e!=t.settings.placeholder?e:""):t._value},disabled:function(e){var t=this;return t._rendered&&"undefined"!=typeof e&&(t.getEl("inp").disabled=e),t._super(e)},focus:function(){this.getEl("inp").focus()},repaint:function(){var e=this,t=e.getEl(),r=e.getEl("open"),i=e.layoutRect(),o,a;o=r?i.w-n.getSize(r).width-10:i.w-10;var s=document;return s.all&&(!s.documentMode||s.documentMode<=8)&&(a=e.layoutRect().h-2+"px"),n.css(t.firstChild,{width:o,lineHeight:a}),e._super(),e},postRender:function(){var e=this;return n.on(this.getEl("inp"),"change",function(){e.fire("change")}),e._super()},remove:function(){n.off(this.getEl("inp")),this._super()},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.classPrefix,i=n.value||n.placeholder||"",o,a,s="",l="";return"spellcheck"in n&&(l+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(l+=' maxlength="'+n.maxLength+'"'),n.size&&(l+=' size="'+n.size+'"'),n.subtype&&(l+=' type="'+n.subtype+'"'),e.disabled()&&(l+=' disabled="disabled"'),o=n.icon,o&&"caret"!=o&&(o=r+"ico "+r+"i-"+n.icon),a=e._text,(o||a)&&(s='
    ",e.addClass("has-open")),'
    "+s+"
    "}})}),r(St,[bt],function(e){return e.extend({init:function(e){var t=this;e.delimiter||(e.delimiter="\xbb"),t._super(e),t.addClass("path"),t.canFocus=!0,t.on("click",function(e){var n,r=e.target;(n=r.getAttribute("data-index"))&&t.fire("select",{value:t.data()[n],index:n})})},focus:function(){var e=this;return e.getEl().firstChild.focus(),e},data:function(e){var t=this;return"undefined"!=typeof e?(t._data=e,t.update(),t):t._data},update:function(){this.innerHtml(this._getPathHtml())},postRender:function(){var e=this;e._super(),e.data(e.settings.data)},renderHtml:function(){var e=this;return'
    '+e._getPathHtml()+"
    "},_getPathHtml:function(){var e=this,t=e._data||[],n,r,i="",o=e.classPrefix;for(n=0,r=t.length;r>n;n++)i+=(n>0?'":"")+'
    '+t[n].name+"
    ";return i||(i='
     
    '),i}})}),r(kt,[St,lt],function(e,t){return e.extend({postRender:function(){function e(e){if(1===e.nodeType){if("BR"==e.nodeName||e.getAttribute("data-mce-bogus"))return!0;if("bookmark"===e.getAttribute("data-mce-type"))return!0}return!1}var n=this,r=t.activeEditor;return n.on("select",function(t){var n=[],i,o=r.getBody();for(r.focus(),i=r.selection.getStart();i&&i!=o;)e(i)||n.push(i),i=i.parentNode;r.selection.select(n[n.length-1-t.index]),r.nodeChanged()}),r.on("nodeChange",function(t){for(var i=[],o=t.parents,a=o.length;a--;)if(1==o[a].nodeType&&!e(o[a])){var s=r.fire("ResolveName",{name:o[a].nodeName.toLowerCase(),target:o[a]});i.push({name:s.name})}n.data(i)}),n._super()}})}),r(Tt,[j],function(e){return e.extend({Defaults:{layout:"flex",align:"center",defaults:{flex:1}},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.addClass("formitem"),t.preRender(e),'
    '+(e.settings.title?'
    '+e.settings.title+"
    ":"")+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(Rt,[j,Tt],function(e,t){return e.extend({Defaults:{containerCls:"form",layout:"flex",direction:"column",align:"stretch",flex:1,padding:20,labelGap:30,spacing:10,callbacks:{submit:function(){this.submit()}}},preRender:function(){var e=this,n=e.items();n.each(function(n){var r,i=n.settings.label;i&&(r=new t({layout:"flex",autoResize:"overflow",defaults:{flex:1},items:[{type:"label",id:n._id+"-l",text:i,flex:0,forId:n._id,disabled:n.disabled()}]}),r.type="formitem",n.aria("labelledby",n._id+"-l"),"undefined"==typeof n.settings.flex&&(n.settings.flex=1),e.replace(n,r),r.add(n))})},recalcLabels:function(){var e=this,t=0,n=[],r,i;if(e.settings.labelGapCalc!==!1)for(e.items().filter("formitem").each(function(e){var r=e.items()[0],i=r.getEl().clientWidth;t=i>t?i:t,n.push(r)}),i=e.settings.labelGap||0,r=n.length;r--;)n[r].settings.minWidth=t+i},visible:function(e){var t=this._super(e);return e===!0&&this._rendered&&this.recalcLabels(),t},submit:function(){return this.fire("submit",{data:this.toJSON()})},postRender:function(){var e=this;e._super(),e.recalcLabels(),e.fromJSON(e.settings.data)}})}),r(At,[Rt],function(e){return e.extend({Defaults:{containerCls:"fieldset",layout:"flex",direction:"column",align:"stretch",flex:1,padding:"25 15 5 15",labelGap:30,spacing:10,border:1},renderHtml:function(){var e=this,t=e._layout,n=e.classPrefix;return e.preRender(),t.preRender(e),'
    '+(e.settings.title?''+e.settings.title+"":"")+'
    '+(e.settings.html||"")+t.renderHtml(e)+"
    "}})}),r(Bt,[Et],function(e){return e.extend({init:function(e){var t=this,n=tinymce.activeEditor,r;e.spellcheck=!1,r=n.settings.file_browser_callback,r&&(e.icon="browse",e.onaction=function(){r(t.getEl("inp").id,t.getEl("inp").value,e.filetype,window)}),t._super(e)}})}),r(Lt,[vt],function(e){return e.extend({recalc:function(e){var t=e.layoutRect(),n=e.paddingBox();e.items().filter(":visible").each(function(e){e.layoutRect({x:n.left,y:n.top,w:t.innerW-n.right-n.left,h:t.innerH-n.top-n.bottom}),e.recalc&&e.recalc() -})}})}),r(Dt,[vt],function(e){return e.extend({recalc:function(e){var t,n,r,i,o,a,s,l,c,u,d,f,p,m,h,g,v=[],y,b,C,x,w,_,N,E,S,k,T,R,A,B,L,D,M,H,P,O,I,F,z=Math.max,W=Math.min;for(r=e.items().filter(":visible"),i=e.layoutRect(),o=e._paddingBox,a=e.settings,f=e.isRtl()?a.direction||"row-reversed":a.direction,s=a.align,l=e.isRtl()?a.pack||"end":a.pack,c=a.spacing||0,("row-reversed"==f||"column-reverse"==f)&&(r=r.set(r.toArray().reverse()),f=f.split("-")[0]),"column"==f?(S="y",N="h",E="minH",k="maxH",R="innerH",T="top",A="deltaH",B="contentH",P="left",M="w",L="x",D="innerW",H="minW",O="right",I="deltaW",F="contentW"):(S="x",N="w",E="minW",k="maxW",R="innerW",T="left",A="deltaW",B="contentW",P="top",M="h",L="y",D="innerH",H="minH",O="bottom",I="deltaH",F="contentH"),d=i[R]-o[T]-o[T],_=u=0,t=0,n=r.length;n>t;t++)p=r[t],m=p.layoutRect(),h=p.settings,g=h.flex,d-=n-1>t?c:0,g>0&&(u+=g,m[k]&&v.push(p),m.flex=g),d-=m[E],y=o[P]+m[H]+o[O],y>_&&(_=y);if(x={},x[E]=0>d?i[E]-d+i[A]:i[R]-d+i[A],x[H]=_+i[I],x[B]=i[R]-d,x[F]=_,x.minW=W(x.minW,i.maxW),x.minH=W(x.minH,i.maxH),x.minW=z(x.minW,i.startMinWidth),x.minH=z(x.minH,i.startMinHeight),!i.autoResize||x.minW==i.minW&&x.minH==i.minH){for(C=d/u,t=0,n=v.length;n>t;t++)p=v[t],m=p.layoutRect(),b=m[k],y=m[E]+m.flex*C,y>b?(d-=m[k]-m[E],u-=m.flex,m.flex=0,m.maxFlexSize=b):m.maxFlexSize=0;for(C=d/u,w=o[T],x={},0===u&&("end"==l?w=d+o[T]:"center"==l?(w=Math.round(i[R]/2-(i[R]-d)/2)+o[T],0>w&&(w=o[T])):"justify"==l&&(w=o[T],c=Math.floor(d/(r.length-1)))),x[L]=o[P],t=0,n=r.length;n>t;t++)p=r[t],m=p.layoutRect(),y=m.maxFlexSize||m[E],"center"===s?x[L]=Math.round(i[D]/2-m[M]/2):"stretch"===s?(x[M]=z(m[H]||0,i[D]-o[P]-o[O]),x[L]=o[P]):"end"===s&&(x[L]=i[D]-m[M]-o.top),m.flex>0&&(y+=m.flex*C),x[N]=y,x[S]=w,p.layoutRect(x),p.recalc&&p.recalc(),w+=y+c}else if(x.w=x.minW,x.h=x.minH,e.layoutRect(x),this.recalc(e),null===e._lastRect){var V=e.parent();V&&(V._lastRect=null,V.recalc())}}})}),r(Mt,[gt],function(e){return e.extend({Defaults:{containerClass:"flow-layout",controlClass:"flow-layout-item",endClass:"break"},recalc:function(e){e.items().filter(":visible").each(function(e){e.recalc&&e.recalc()})}})}),r(Ht,[U,bt,Q,p,lt,g],function(e,t,n,r,i,o){function a(e){function t(t){function n(e){return e.replace(/%(\w+)/g,"")}var r,i,o=e.dom,a="",l,c;return c=e.settings.preview_styles,c===!1?"":(c||(c="font-family font-size font-weight font-style text-decoration text-transform color background-color border border-radius outline text-shadow"),(t=e.formatter.get(t))?(t=t[0],r=t.block||t.inline||"span",i=o.create(r),s(t.styles,function(e,t){e=n(e),e&&o.setStyle(i,t,e)}),s(t.attributes,function(e,t){e=n(e),e&&o.setAttrib(i,t,e)}),s(t.classes,function(e){e=n(e),o.hasClass(i,e)||o.addClass(i,e)}),e.fire("PreviewFormats"),o.setStyles(i,{position:"absolute",left:-65535}),e.getBody().appendChild(i),l=o.getStyle(e.getBody(),"fontSize",!0),l=/px$/.test(l)?parseInt(l,10):0,s(c.split(" "),function(t){var n=o.getStyle(i,t,!0);if(!("background-color"==t&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(n)&&(n=o.getStyle(e.getBody(),t,!0),"#ffffff"==o.toHex(n).toLowerCase())||"color"==t&&"#000000"==o.toHex(n).toLowerCase())){if("font-size"==t&&/em|%$/.test(n)){if(0===l)return;n=parseFloat(n,10)/(/%$/.test(n)?100:1),n=n*l+"px"}"border"==t&&n&&(a+="padding:0 2px;"),a+=t+":"+n+";"}}),e.fire("AfterPreviewFormats"),o.remove(i),a):void 0)}function r(t,n){return function(){var r=this;e.on("nodeChange",function(i){var o=e.formatter,a=null;s(i.parents,function(e){return s(t,function(t){return n?o.matchNode(e,n,{value:t.value})&&(a=t.value):o.matchNode(e,t.value)&&(a=t.value),a?!1:void 0}),a?!1:void 0}),r.value(a)})}}function i(e){e=e.split(";");for(var t=e.length;t--;)e[t]=e[t].split("=");return e}function o(){function n(e){var t=[];if(e)return s(e,function(e){var r={text:e.title,icon:e.icon};if(e.items)r.menu=n(e.items);else{var a=e.format||"custom"+i++;e.format||(e.name=a,o.push(e)),r.format=a}t.push(r)}),t}function r(){var t;return t=n(e.settings.style_formats_merge?e.settings.style_formats?a.concat(e.settings.style_formats):a:e.settings.style_formats||a)}var i=0,o=[],a=[{title:"Headers",items:[{title:"Header 1",format:"h1"},{title:"Header 2",format:"h2"},{title:"Header 3",format:"h3"},{title:"Header 4",format:"h4"},{title:"Header 5",format:"h5"},{title:"Header 6",format:"h6"}]},{title:"Inline",items:[{title:"Bold",icon:"bold",format:"bold"},{title:"Italic",icon:"italic",format:"italic"},{title:"Underline",icon:"underline",format:"underline"},{title:"Strikethrough",icon:"strikethrough",format:"strikethrough"},{title:"Superscript",icon:"superscript",format:"superscript"},{title:"Subscript",icon:"subscript",format:"subscript"},{title:"Code",icon:"code",format:"code"}]},{title:"Blocks",items:[{title:"Paragraph",format:"p"},{title:"Blockquote",format:"blockquote"},{title:"Div",format:"div"},{title:"Pre",format:"pre"}]},{title:"Alignment",items:[{title:"Left",icon:"alignleft",format:"alignleft"},{title:"Center",icon:"aligncenter",format:"aligncenter"},{title:"Right",icon:"alignright",format:"alignright"},{title:"Justify",icon:"alignjustify",format:"alignjustify"}]}];return e.on("init",function(){s(o,function(t){e.formatter.register(t.name,t)})}),{type:"menu",items:r(),onPostRender:function(t){e.fire("renderFormatsMenu",{control:t.control})},itemDefaults:{preview:!0,textStyle:function(){return this.settings.format?t(this.settings.format):void 0},onPostRender:function(){var t=this,n=this.settings.format;n&&t.parent().on("show",function(){t.disabled(!e.formatter.canApply(n)),t.active(e.formatter.match(n))})},onclick:function(){this.settings.format&&f(this.settings.format)}}}}function a(){return e.undoManager?e.undoManager.hasUndo():!1}function l(){return e.undoManager?e.undoManager.hasRedo():!1}function c(){var t=this;t.disabled(!a()),e.on("Undo Redo AddUndo TypingUndo",function(){t.disabled(!a())})}function u(){var t=this;t.disabled(!l()),e.on("Undo Redo AddUndo TypingUndo",function(){t.disabled(!l())})}function d(){var t=this;e.on("VisualAid",function(e){t.active(e.hasVisual)}),t.active(e.hasVisual)}function f(t){t.control&&(t=t.control.value()),t&&e.execCommand("mceToggleFormat",!1,t)}var p;p=o(),s({bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript"},function(t,n){e.addButton(n,{tooltip:t,onPostRender:function(){var t=this;e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})},onclick:function(){f(n)}})}),s({outdent:["Decrease indent","Outdent"],indent:["Increase indent","Indent"],cut:["Cut","Cut"],copy:["Copy","Copy"],paste:["Paste","Paste"],help:["Help","mceHelp"],selectall:["Select all","SelectAll"],hr:["Insert horizontal rule","InsertHorizontalRule"],removeformat:["Clear formatting","RemoveFormat"],visualaid:["Visual aids","mceToggleVisualAid"],newdocument:["New document","mceNewDocument"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1]})}),s({blockquote:["Blockquote","mceBlockQuote"],numlist:["Numbered list","InsertOrderedList"],bullist:["Bullet list","InsertUnorderedList"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],alignleft:["Align left","JustifyLeft"],aligncenter:["Align center","JustifyCenter"],alignright:["Align right","JustifyRight"],alignjustify:["Justify","JustifyFull"]},function(t,n){e.addButton(n,{tooltip:t[0],cmd:t[1],onPostRender:function(){var t=this;e.formatter?e.formatter.formatChanged(n,function(e){t.active(e)}):e.on("init",function(){e.formatter.formatChanged(n,function(e){t.active(e)})})}})}),e.addButton("undo",{tooltip:"Undo",onPostRender:c,cmd:"undo"}),e.addButton("redo",{tooltip:"Redo",onPostRender:u,cmd:"redo"}),e.addMenuItem("newdocument",{text:"New document",shortcut:"Ctrl+N",icon:"newdocument",cmd:"mceNewDocument"}),e.addMenuItem("undo",{text:"Undo",icon:"undo",shortcut:"Ctrl+Z",onPostRender:c,cmd:"undo"}),e.addMenuItem("redo",{text:"Redo",icon:"redo",shortcut:"Ctrl+Y",onPostRender:u,cmd:"redo"}),e.addMenuItem("visualaid",{text:"Visual aids",selectable:!0,onPostRender:d,cmd:"mceToggleVisualAid"}),s({cut:["Cut","Cut","Ctrl+X"],copy:["Copy","Copy","Ctrl+C"],paste:["Paste","Paste","Ctrl+V"],selectall:["Select all","SelectAll","Ctrl+A"],bold:["Bold","Bold","Ctrl+B"],italic:["Italic","Italic","Ctrl+I"],underline:["Underline","Underline"],strikethrough:["Strikethrough","Strikethrough"],subscript:["Subscript","Subscript"],superscript:["Superscript","Superscript"],removeformat:["Clear formatting","RemoveFormat"]},function(t,n){e.addMenuItem(n,{text:t[0],icon:n,shortcut:t[2],cmd:t[1]})}),e.on("mousedown",function(){n.hideAll()}),e.addButton("styleselect",{type:"menubutton",text:"Formats",menu:p}),e.addButton("formatselect",function(){var n=[],o=i(e.settings.block_formats||"Paragraph=p;Address=address;Pre=pre;Header 1=h1;Header 2=h2;Header 3=h3;Header 4=h4;Header 5=h5;Header 6=h6");return s(o,function(e){n.push({text:e[0],value:e[1],textStyle:function(){return t(e[1])}})}),{type:"listbox",text:o[0][0],values:n,fixedWidth:!0,onselect:f,onPostRender:r(n)}}),e.addButton("fontselect",function(){var t="Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",n=[],o=i(e.settings.font_formats||t);return s(o,function(e){n.push({text:{raw:e[0]},value:e[1],textStyle:-1==e[1].indexOf("dings")?"font-family:"+e[1]:""})}),{type:"listbox",text:"Font Family",tooltip:"Font Family",values:n,fixedWidth:!0,onPostRender:r(n,"fontname"),onselect:function(t){t.control.settings.value&&e.execCommand("FontName",!1,t.control.settings.value)}}}),e.addButton("fontsizeselect",function(){var t=[],n="8pt 10pt 12pt 14pt 18pt 24pt 36pt",i=e.settings.fontsize_formats||n;return s(i.split(" "),function(e){t.push({text:e,value:e})}),{type:"listbox",text:"Font Sizes",tooltip:"Font Sizes",values:t,fixedWidth:!0,onPostRender:r(t,"fontsize"),onclick:function(t){t.control.settings.value&&e.execCommand("FontSize",!1,t.control.settings.value)}}}),e.addMenuItem("formats",{text:"Formats",menu:p})}var s=r.each;i.on("AddEditor",function(t){t.editor.rtl&&(e.rtl=!0),a(t.editor)}),e.translate=function(e){return i.translate(e)},t.tooltips=!o.iOS}),r(Pt,[vt],function(e){return e.extend({recalc:function(e){var t=e.settings,n,r,i,o,a,s,l,c,u,d,f,p,m,h,g,v,y,b,C,x,w,_,N=[],E=[],S,k,T,R;for(t=e.settings,i=e.items().filter(":visible"),o=e.layoutRect(),r=t.columns||Math.ceil(Math.sqrt(i.length)),n=Math.ceil(i.length/r),y=t.spacingH||t.spacing||0,b=t.spacingV||t.spacing||0,C=t.alignH||t.align,x=t.alignV||t.align,g=e._paddingBox,C&&"string"==typeof C&&(C=[C]),x&&"string"==typeof x&&(x=[x]),d=0;r>d;d++)N.push(0);for(f=0;n>f;f++)E.push(0);for(f=0;n>f;f++)for(d=0;r>d&&(u=i[f*r+d],u);d++)c=u.layoutRect(),S=c.minW,k=c.minH,N[d]=S>N[d]?S:N[d],E[f]=k>E[f]?k:E[f];for(T=o.innerW-g.left-g.right,w=0,d=0;r>d;d++)w+=N[d]+(d>0?y:0),T-=(d>0?y:0)+N[d];for(R=o.innerH-g.top-g.bottom,_=0,f=0;n>f;f++)_+=E[f]+(f>0?b:0),R-=(f>0?b:0)+E[f];if(w+=g.left+g.right,_+=g.top+g.bottom,l={},l.minW=w+(o.w-o.innerW),l.minH=_+(o.h-o.innerH),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH,l.minW=Math.min(l.minW,o.maxW),l.minH=Math.min(l.minH,o.maxH),l.minW=Math.max(l.minW,o.startMinWidth),l.minH=Math.max(l.minH,o.startMinHeight),!o.autoResize||l.minW==o.minW&&l.minH==o.minH){o.autoResize&&(l=e.layoutRect(l),l.contentW=l.minW-o.deltaW,l.contentH=l.minH-o.deltaH);var A;A="start"==t.packV?0:R>0?Math.floor(R/n):0;var B=0,L=t.flexWidths;if(L)for(d=0;dd;d++)N[d]+=L?L[d]*D:D;for(m=g.top,f=0;n>f;f++){for(p=g.left,s=E[f]+A,d=0;r>d&&(u=i[f*r+d],u);d++)h=u.settings,c=u.layoutRect(),a=Math.max(N[d],c.startMinWidth),c.x=p,c.y=m,v=h.alignH||(C?C[d]||C[0]:null),"center"==v?c.x=p+a/2-c.w/2:"right"==v?c.x=p+a-c.w:"stretch"==v&&(c.w=a),v=h.alignV||(x?x[d]||x[0]:null),"center"==v?c.y=m+s/2-c.h/2:"bottom"==v?c.y=m+s-c.h:"stretch"==v&&(c.h=s),u.layoutRect(c),p+=a+y,u.recalc&&u.recalc();m+=s+b}}else if(l.w=l.minW,l.h=l.minH,e.layoutRect(l),this.recalc(e),null===e._lastRect){var M=e.parent();M&&(M._lastRect=null,M.recalc())}}})}),r(Ot,[bt],function(e){return e.extend({renderHtml:function(){var e=this;return e.addClass("iframe"),e.canFocus=!1,''},src:function(e){this.getEl().src=e},html:function(e,t){var n=this,r=this.getEl().contentWindow.document.body;return r?(r.innerHTML=e,t&&t()):setTimeout(function(){n.html(e)},0),this}})}),r(It,[bt,V],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t.addClass("widget"),t.addClass("label"),t.canFocus=!1,e.multiline&&t.addClass("autoscroll"),e.strong&&t.addClass("strong")},initLayoutRect:function(){var e=this,n=e._super();if(e.settings.multiline){var r=t.getSize(e.getEl());r.width>n.maxW&&(n.minW=n.maxW,e.addClass("multiline")),e.getEl().style.width=n.minW+"px",n.startMinH=n.h=n.minH=Math.min(n.maxH,t.getSize(e.getEl()).height)}return n},repaint:function(){var e=this;return e.settings.multiline||(e.getEl().style.lineHeight=e.layoutRect().h+"px"),e._super()},text:function(e){var t=this;return t._rendered&&e&&this.innerHtml(t.encode(e)),t._super(e)},renderHtml:function(){var e=this,t=e.settings.forId;return'"}})}),r(Ft,[j],function(e){return e.extend({Defaults:{role:"toolbar",layout:"flow"},init:function(e){var t=this;t._super(e),t.addClass("toolbar")},postRender:function(){var e=this;return e.items().addClass("toolbar-item"),e._super()}})}),r(zt,[Ft],function(e){return e.extend({Defaults:{role:"menubar",containerCls:"menubar",ariaRoot:!0,defaults:{type:"menubutton"}}})}),r(Wt,[Ct,q,zt],function(e,t,n){function r(e,t){for(;e;){if(t===e)return!0;e=e.parentNode}return!1}var i=e.extend({init:function(e){var t=this;t._renderOpen=!0,t._super(e),t.addClass("menubtn"),e.fixedWidth&&t.addClass("fixed-width"),t.aria("haspopup",!0),t.hasPopup=!0},showMenu:function(){var e=this,n=e.settings,r;return e.menu&&e.menu.visible()?e.hideMenu():(e.menu||(r=n.menu||[],r.length?r={type:"menu",items:r}:r.type=r.type||"menu",e.menu=t.create(r).parent(e).renderTo(),e.fire("createmenu"),e.menu.reflow(),e.menu.on("cancel",function(t){t.control.parent()===e.menu&&(t.stopPropagation(),e.focus(),e.hideMenu())}),e.menu.on("select",function(){e.focus()}),e.menu.on("show hide",function(t){t.control==e.menu&&e.activeMenu("show"==t.type),e.aria("expanded","show"==t.type)}).fire("show")),e.menu.show(),e.menu.layoutRect({w:e.layoutRect().w}),void e.menu.moveRel(e.getEl(),e.isRtl()?["br-tr","tr-br"]:["bl-tl","tl-bl"]))},hideMenu:function(){var e=this;e.menu&&(e.menu.items().each(function(e){e.hideMenu&&e.hideMenu()}),e.menu.hide())},activeMenu:function(e){this.toggleClass("active",e)},renderHtml:function(){var e=this,t=e._id,r=e.classPrefix,i=e.settings.icon?r+"ico "+r+"i-"+e.settings.icon:"";return e.aria("role",e.parent()instanceof n?"menuitem":"button"),'
    '},postRender:function(){var e=this;return e.on("click",function(t){t.control===e&&r(t.target,e.getEl())&&(e.showMenu(),t.aria&&e.menu.items()[0].focus())}),e.on("mouseenter",function(t){var n=t.control,r=e.parent(),o;n&&r&&n instanceof i&&n.parent()==r&&(r.items().filter("MenuButton").each(function(e){e.hideMenu&&e!=n&&(e.menu&&e.menu.visible()&&(o=!0),e.hideMenu())}),o&&(n.focus(),n.showMenu()))}),e._super()},text:function(e){var t=this,n,r;if(t._rendered)for(r=t.getEl("open").getElementsByTagName("span"),n=0;n0&&(o=n[0].text,t._value=n[0].value),e.menu=n}e.text=e.text||o||n[0].text,t._super(e),t.addClass("listbox"),t.on("select",function(n){var r=n.control;a&&(n.lastControl=a),e.multiple?r.active(!r.active()):t.value(n.control.settings.value),a=r})},value:function(e){function t(e,n){e.items().each(function(e){r=e.value()===n,r&&(i=i||e.text()),e.active(r),e.menu&&t(e.menu,n)})}var n=this,r,i,o,a;if("undefined"!=typeof e){if(n.menu)t(n.menu,e);else for(o=n.settings.menu,a=0;a'+("-"!==o?' ":"")+("-"!==o?''+o+"":"")+(l?'
    '+l+"
    ":"")+(r.menu?'
    ':"")+""},postRender:function(){var e=this,t=e.settings,n=t.textStyle;if("function"==typeof n&&(n=n.call(this)),n){var r=e.getEl("text");r&&r.setAttribute("style",n)}return e.on("mouseenter click",function(n){n.control===e&&(t.menu||"click"!==n.type?(e.showMenu(),n.aria&&e.menu.focus(!0)):(e.fire("select"),e.parent().hideAll()))}),e._super(),e},active:function(e){return"undefined"!=typeof e&&this.aria("checked",e),this._super(e)},remove:function(){this._super(),this.menu&&this.menu.remove()}})}),r(qt,[Q,Ut,p],function(e,t,n){var r=e.extend({Defaults:{defaultType:"menuitem",border:1,layout:"stack",role:"application",bodyRole:"menu",ariaRoot:!0},init:function(e){var t=this;if(e.autohide=!0,e.constrainToViewport=!0,e.itemDefaults)for(var r=e.items,i=r.length;i--;)r[i]=n.extend({},e.itemDefaults,r[i]);t._super(e),t.addClass("menu")},repaint:function(){return this.toggleClass("menu-align",!0),this._super(),this.getEl().style.height="",this.getEl("body").style.height="",this},cancel:function(){var e=this;e.hideAll(),e.fire("select")},hideAll:function(){var e=this;return this.find("menuitem").exec("hideMenu"),e._super()},preRender:function(){var e=this;return e.items().each(function(t){var n=t.settings;return n.icon||n.selectable?(e._hasIcons=!0,!1):void 0}),e._super()}});return r}),r($t,[wt],function(e){return e.extend({Defaults:{classes:"radio",role:"radio"}})}),r(jt,[bt,K],function(e,t){return e.extend({renderHtml:function(){var e=this,t=e.classPrefix;return e.addClass("resizehandle"),"both"==e.settings.direction&&e.addClass("resizehandle-both"),e.canFocus=!1,'
    '},postRender:function(){var e=this;e._super(),e.resizeDragHelper=new t(this._id,{start:function(){e.fire("ResizeStart")},drag:function(t){"both"!=e.settings.direction&&(t.deltaX=0),e.fire("Resize",t)},stop:function(){e.fire("ResizeEnd")}})},remove:function(){return this.resizeDragHelper&&this.resizeDragHelper.destroy(),this._super()}})}),r(Kt,[bt],function(e){return e.extend({renderHtml:function(){var e=this;return e.addClass("spacer"),e.canFocus=!1,'
    '}})}),r(Yt,[Wt,V],function(e,t){return e.extend({Defaults:{classes:"widget btn splitbtn",role:"button"},repaint:function(){var e=this,n=e.getEl(),r=e.layoutRect(),i,o;return e._super(),i=n.firstChild,o=n.lastChild,t.css(i,{width:r.w-t.getSize(o).width,height:r.h-2}),t.css(o,{height:r.h-2}),e},activeMenu:function(e){var n=this;t.toggleClass(n.getEl().lastChild,n.classPrefix+"active",e)},renderHtml:function(){var e=this,t=e._id,n=e.classPrefix,r=e.settings.icon?n+"ico "+n+"i-"+e.settings.icon:"";return'
    '},postRender:function(){var e=this,t=e.settings.onclick;return e.on("click",function(e){var n=e.target;if(e.control==this)for(;n;){if(e.aria&&"down"!=e.aria.key||"BUTTON"==n.nodeName&&-1==n.className.indexOf("open"))return e.stopImmediatePropagation(),void t.call(this,e);n=n.parentNode}}),delete e.settings.onclick,e._super()}})}),r(Gt,[Mt],function(e){return e.extend({Defaults:{containerClass:"stack-layout",controlClass:"stack-layout-item",endClass:"break"}})}),r(Xt,[G,V],function(e,t){return e.extend({lastIdx:0,Defaults:{layout:"absolute",defaults:{type:"panel"}},activateTab:function(e){var n;this.activeTabId&&(n=this.getEl(this.activeTabId),t.removeClass(n,this.classPrefix+"active"),n.setAttribute("aria-selected","false")),this.activeTabId="t"+e,n=this.getEl("t"+e),n.setAttribute("aria-selected","true"),t.addClass(n,this.classPrefix+"active"),e!=this.lastIdx&&(this.items()[this.lastIdx].hide(),this.lastIdx=e),this.items()[e].show().fire("showtab"),this.reflow()},renderHtml:function(){var e=this,t=e._layout,n="",r=e.classPrefix;return e.preRender(),t.preRender(e),e.items().each(function(t,i){var o=e._id+"-t"+i;t.aria("role","tabpanel"),t.aria("labelledby",o),n+='"}),'
    '+n+'
    '+t.renderHtml(e)+"
    "},postRender:function(){var e=this;e._super(),e.settings.activeTab=e.settings.activeTab||0,e.activateTab(e.settings.activeTab),this.on("click",function(t){var n=t.target.parentNode;if(t.target.parentNode.id==e._id+"-head")for(var r=n.childNodes.length;r--;)n.childNodes[r]==t.target&&e.activateTab(r)})},initLayoutRect:function(){var e=this,n,r,i;r=t.getSize(e.getEl("head")).width,r=0>r?0:r,i=0,e.items().each(function(t,n){r=Math.max(r,t.layoutRect().minW),i=Math.max(i,t.layoutRect().minH),e.settings.activeTab!=n&&t.hide()}),e.items().each(function(e){e.settings.x=0,e.settings.y=0,e.settings.w=r,e.settings.h=i,e.layoutRect({x:0,y:0,w:r,h:i})});var o=t.getSize(e.getEl("head")).height;return e.settings.minWidth=r,e.settings.minHeight=i+o,n=e._super(),n.deltaH+=o,n.innerH=n.h-n.deltaH,n}})}),r(Jt,[bt,V],function(e,t){return e.extend({init:function(e){var t=this;t._super(e),t._value=e.value||"",t.addClass("textbox"),e.multiline?t.addClass("multiline"):t.on("keydown",function(e){13==e.keyCode&&t.parents().reverse().each(function(t){return e.preventDefault(),t.hasEventListeners("submit")&&t.toJSON?(t.fire("submit",{data:t.toJSON()}),!1):void 0})})},disabled:function(e){var t=this;return t._rendered&&"undefined"!=typeof e&&(t.getEl().disabled=e),t._super(e)},value:function(e){var t=this;return"undefined"!=typeof e?(t._value=e,t._rendered&&(t.getEl().value=e),t):t._rendered?t.getEl().value:t._value},repaint:function(){var e=this,t,n,r,i=0,o=0,a;t=e.getEl().style,n=e._layoutRect,a=e._lastRepaintRect||{};var s=document;return!e.settings.multiline&&s.all&&(!s.documentMode||s.documentMode<=8)&&(t.lineHeight=n.h-o+"px"),r=e._borderBox,i=r.left+r.right+8,o=r.top+r.bottom+(e.settings.multiline?8:0),n.x!==a.x&&(t.left=n.x+"px",a.x=n.x),n.y!==a.y&&(t.top=n.y+"px",a.y=n.y),n.w!==a.w&&(t.width=n.w-i+"px",a.w=n.w),n.h!==a.h&&(t.height=n.h-o+"px",a.h=n.h),e._lastRepaintRect=a,e.fire("repaint",{},!1),e},renderHtml:function(){var e=this,t=e._id,n=e.settings,r=e.encode(e._value,!1),i="";return"spellcheck"in n&&(i+=' spellcheck="'+n.spellcheck+'"'),n.maxLength&&(i+=' maxlength="'+n.maxLength+'"'),n.size&&(i+=' size="'+n.size+'"'),n.subtype&&(i+=' type="'+n.subtype+'"'),e.disabled()&&(i+=' disabled="disabled"'),n.multiline?'":'"},postRender:function(){var e=this;return t.on(e.getEl(),"change",function(t){e.fire("change",t)}),e._super()},remove:function(){t.off(this.getEl()),this._super()}})}),r(Qt,[V],function(e){return function(t){var n=this,r;n.show=function(i){return n.hide(),r=!0,window.setTimeout(function(){r&&t.appendChild(e.createFragment('
    '))},i||0),n},n.hide=function(){var e=t.lastChild;return e&&-1!=e.className.indexOf("throbber")&&e.parentNode.removeChild(e),r=!1,n}}}),a([l,c,u,d,f,p,m,h,g,v,y,b,C,x,w,_,N,E,S,k,T,R,A,B,L,D,M,H,P,O,I,F,z,W,V,U,q,$,j,K,Y,G,X,J,Q,Z,et,tt,nt,rt,it,ot,at,st,lt,ct,ut,dt,ft,pt,mt,ht,gt,vt,yt,bt,Ct,xt,wt,_t,Nt,Et,St,kt,Tt,Rt,At,Bt,Lt,Dt,Mt,Ht,Pt,Ot,It,Ft,zt,Wt,Vt,Ut,qt,$t,jt,Kt,Yt,Gt,Xt,Jt,Qt])}(this); \ No newline at end of file +/** + * Copyright (c) Tiny Technologies, Inc. All rights reserved. + * Licensed under the LGPL or a commercial license. + * For LGPL see License.txt in the project root for license information. + * For commercial licenses see https://www.tiny.cloud/ + * + * Version: 5.5.1 (2020-10-01) + */ +!function(){"use strict";var r=function(e){if(null===e)return"null";if(e===undefined)return"undefined";var t=typeof e;return"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t},t=function(e){return{eq:e}},s=t(function(e,t){return e===t}),i=function(o){return t(function(e,t){if(e.length!==t.length)return!1;for(var n=e.length,r=0;r=r.length&&n.substr(o,o+r.length)===r;var n,r,o},ze=function(t){return function(e){return e.replace(t,"")}},je=ze(/^\s+|\s+$/g),He=ze(/^\s+/g),Ve=ze(/\s+$/g),qe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,$e=function(t){return function(e){return Fe(e,t)}},We=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Fe(e,"edge/")&&Fe(e,"chrome")&&Fe(e,"safari")&&Fe(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,qe],search:function(e){return Fe(e,"chrome")&&!Fe(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Fe(e,"msie")||Fe(e,"trident")}},{name:"Opera",versionRegexes:[qe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:$e("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:$e("firefox")},{name:"Safari",versionRegexes:[qe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Fe(e,"safari")||Fe(e,"mobile/"))&&Fe(e,"applewebkit")}}],Ke=[{name:"Windows",search:$e("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Fe(e,"iphone")||Fe(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:$e("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:$e("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:$e("linux"),versionRegexes:[]},{name:"Solaris",search:$e("sunos"),versionRegexes:[]},{name:"FreeBSD",search:$e("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:$e("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Xe={browsers:N(We),oses:N(Ke)},Ye="Firefox",Ge=function(e){var t=e.current,n=e.version,r=function(e){return function(){return t===e}};return{current:t,version:n,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r(Ye),isSafari:r("Safari")}},Je={unknown:function(){return Ge({current:undefined,version:Pe.unknown()})},nu:Ge,edge:N("Edge"),chrome:N("Chrome"),ie:N("IE"),opera:N("Opera"),firefox:N(Ye),safari:N("Safari")},Qe="Windows",Ze="Android",et="Solaris",tt="FreeBSD",nt="ChromeOS",rt=function(e){var t=e.current,n=e.version,r=function(e){return function(){return t===e}};return{current:t,version:n,isWindows:r(Qe),isiOS:r("iOS"),isAndroid:r(Ze),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r(et),isFreeBSD:r(tt),isChromeOS:r(nt)}},ot={unknown:function(){return rt({current:undefined,version:Pe.unknown()})},nu:rt,windows:N(Qe),ios:N("iOS"),android:N(Ze),linux:N("Linux"),osx:N("OSX"),solaris:N(et),freebsd:N(tt),chromeos:N(nt)},it=function(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,p=Xe.browsers(),g=Xe.oses(),h=Ie(p,e).fold(Je.unknown,Je.nu),v=Me(g,e).fold(ot.unknown,ot.nu);return{browser:h,os:v,deviceType:(r=h,o=e,i=t,a=(n=v).isiOS()&&!0===/ipad/i.test(o),u=n.isiOS()&&!a,s=n.isiOS()||n.isAndroid(),c=s||i("(pointer:coarse)"),l=a||!u&&s&&i("(min-device-width:768px)"),f=u||s&&!l,d=r.isSafari()&&n.isiOS()&&!1===/safari/i.test(o),m=!f&&!l&&!d,{isiPad:N(a),isiPhone:N(u),isTablet:N(l),isPhone:N(f),isTouch:N(c),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:N(d),isDesktop:N(m)})}},at=function(e){return window.matchMedia(e).matches},ut=(ke=!(Ne=function(){return it(navigator.userAgent,at)}),function(){for(var e=[],t=0;t=a.length&&r(o)}))})})},dr=function(n){return{is:function(e){return n===e},isValue:k,isError:p,getOr:N(n),getOrThunk:N(n),getOrDie:N(n),or:function(e){return dr(n)},orThunk:function(e){return dr(n)},fold:function(e,t){return t(n)},map:function(e){return dr(e(n))},mapError:function(e){return dr(n)},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOptional:function(){return U.some(n)}}},mr=function(n){return{is:p,isValue:p,isError:k,getOr:o,getOrThunk:function(e){return e()},getOrDie:function(){return m(String(n))()},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return mr(n)},mapError:function(e){return mr(e(n))},each:V,bind:function(e){return mr(n)},exists:p,forall:k,toOptional:U.none}},pr={value:dr,error:mr,fromOption:function(e,t){return e.fold(function(){return mr(t)},dr)}},gr=function(a){if(!S(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};return $(a,function(e,r){var t=ne(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!S(i))throw new Error("case arguments must be an array");u.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Wo=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ko=/[<>&\"\']/g,Xo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Yo={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"},Go={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},Jo={"<":"<",">":">","&":"&",""":'"',"'":"'"},Qo=function(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n>10),56320+(1023&t))):Yo[t]||String.fromCharCode(t):Jo[e]||Zo[e]||(n=e,(r=Nt.fromTag("div").dom).innerHTML=n,r.textContent||r.innerText||n);var n,r})}},oi={},ii={},ai=xt.makeMap,ui=xt.each,si=xt.extend,ci=xt.explode,li=xt.inArray,fi=function(e,t){return(e=xt.trim(e))?e.split(t||" "):[]},di=function(e){var s,t,n,r,o,i,c={},a=function(e,t,n){var r,o,i=function(e,t){for(var n={},r=0,o=e.length;r
    ');return rn(n.element,r),xd(r,function(){return ln(r)})},Nd=function(n,r,o,i){Rd(n,function(e,t){return kd(n,r,o,i)},o)},Ed=function(e,t,n,r,o){var i,a,u={elm:r.element.dom,alignToTop:o};i=u,e.fire("ScrollIntoView",i).isDefaultPrevented()||(n(t,vn(t).top,r,o),a=u,e.fire("AfterScrollIntoView",a))},kd=function(e,t,n,r){var o=Nt.fromDom(e.getBody()),i=Nt.fromDom(e.getDoc());o.dom.offsetWidth;var a=Sd(Nt.fromDom(n.startContainer),n.startOffset);Ed(e,i,t,a,r),a.cleanup()},_d=function(e,t,n,r){var o,i=Nt.fromDom(e.getDoc());Ed(e,i,n,(o=t,xd(Nt.fromDom(o),V)),r)},Rd=function(e,t,n){var r=n.startContainer,o=n.startOffset,i=n.endContainer,a=n.endOffset;t(Nt.fromDom(r),Nt.fromDom(i));var u=e.dom.createRng();u.setStart(r,o),u.setEnd(i,a),e.selection.setRng(n)},Td=function(e,t,n,r){var o,i=e.pos;n?yn(i.left,i.top,r):(o=i.top-t+e.height,yn(i.left,o,r))},Ad=function(e,t,n,r,o){var i=n+t,a=r.pos.top,u=r.bottom,s=n<=u-a;aa.bottom&&bn(n.element,!0===r)},Bd=function(e,t,n){return Nd(e,Dd,t,n)},Pd=function(e,t,n){return _d(e,t,Dd,n)},Ld=function(e,t,n){return Nd(e,Od,t,n)},Id=function(e,t,n){return _d(e,t,Od,n)},Md=function(e,t,n){(e.inline?Bd:Ld)(e,t,n)},Fd=function(e){var t=Zt(e).dom;return e.dom===t.activeElement},Ud=function(e){return void 0===e&&(e=Nt.fromDom(document)),U.from(e.dom.activeElement).map(Nt.fromDom)},zd=function(e,t,n,r){return{start:e,soffset:t,finish:n,foffset:r}},jd=gr([{before:["element"]},{on:["element","offset"]},{after:["element"]}]),Hd=(jd.before,jd.on,jd.after,function(e){return e.fold(o,o,o)}),Vd=gr([{domRange:["rng"]},{relative:["startSitu","finishSitu"]},{exact:["start","soffset","finish","foffset"]}]),qd={domRange:Vd.domRange,relative:Vd.relative,exact:Vd.exact,exactFromRange:function(e){return Vd.exact(e.start,e.soffset,e.finish,e.foffset)},getWin:function(e){var t=e.match({domRange:function(e){return Nt.fromDom(e.startContainer)},relative:function(e,t){return Hd(e)},exact:function(e,t,n,r){return e}});return zt(t)},range:zd},$d=st().browser,Wd=function(e,t){var n=Lt(t)?Uf(t).length:Wt(t).length+1;return n":" />",n&&s&&l[e]&&0"),s&&l[e]&&0")},comment:function(e){u.push("\x3c!--",e,"--\x3e")},pi:function(e,t){t?u.push(""):u.push(""),s&&u.push("\n")},doctype:function(e){u.push("",s?"\n":"")},reset:function(){u.length=0},getContent:function(){return u.join("").replace(/\n$/,"")}}},Tm=function(t,p){void 0===p&&(p=pi());var g=Rm(t);(t=t||{}).validate=!("validate"in t)||t.validate;return{serialize:function(e){var f=t.validate,d={3:function(e){g.text(e.value,e.raw)},8:function(e){g.comment(e.value)},7:function(e){g.pi(e.name,e.value)},10:function(e){g.doctype(e.value)},4:function(e){g.cdata(e.value)},11:function(e){if(e=e.firstChild)for(;m(e),e=e.next;);}};g.reset();var m=function(e){var t,n,r,o,i,a,u,s,c,l=d[e.type];if(l)l(e);else{if(t=e.name,n=e.shortEnded,r=e.attributes,f&&r&&1]+(?:(?:"[^"]*")|(?:\'[^\']*\')|[^>]*))*|\/|\s+)>/g;for(u.lastIndex=r=n;o=u.exec(t);){if(r=u.lastIndex,"/"===o[1])i--;else if(!o[1]){if(o[2]in a)continue;i++}if(0===i)break}return r};function Om(W,K){void 0===K&&(K=pi());var e=function(){};!1!==(W=W||{}).fix_self_closing&&(W.fix_self_closing=!0);var X=W.comment?W.comment:e,Y=W.cdata?W.cdata:e,G=W.text?W.text:e,J=W.start?W.start:e,Q=W.end?W.end:e,Z=W.pi?W.pi:e,ee=W.doctype?W.doctype:e,n=function(m,e){void 0===e&&(e="html");for(var t,n,r,p,o,i,a,g,u,s,c,l,f,h,v,d,y,b,C,w=m.html,x=0,S=[],N=0,E=ri.decode,k=xt.makeMap("src,href,data,background,formaction,poster,xlink:href"),_=/((java|vb)script|mhtml):/i,R="html"===e?0:1,T=function(e){for(var t,n=S.length;n--&&S[n].name!==e;);if(0<=n){for(t=S.length-1;n<=t;t--)(e=S[t]).valid&&Q(e.name);S.length=n}},A=function(e,t){return G(Am(e,m),t)},D=function(e){""!==e&&(">"===e.charAt(0)&&(e=" "+e),W.allow_conditional_comments||"[if"!==e.substr(0,3).toLowerCase()||(e=" "+e),X(Am(e,m)))},O=function(e,t){var n=e||"",r=!Ue(n,"--"),o=function(e,t,n){void 0===n&&(n=0);var r=e.toLowerCase();if(-1!==r.indexOf("[if ",n)&&(u=n,/^\s*\[if [\w\W]+\]>.*/.test(r.substr(u)))){var o=r.indexOf("[endif]",n);return r.indexOf(">",o)}if(t){var i=r.indexOf(">",n);return-1!==i?i:r.length}var a=/--!?>/;a.lastIndex=n;var u,s=a.exec(e);return s?s.index+s[0].length:r.length}(w,r,t);return e=w.substr(t,o-t),D(r?n+e:e),o+1},B=function(e,t,n,r,o){var i,a,u,s,c,l;if(t=t.toLowerCase(),u=t in F?t:E(n||r||o||""),n=de(m.uris,u).getOr(u),U&&!g&&!1==(0===(s=t).indexOf("data-")||0===s.indexOf("aria-"))){if(!(i=h[t])&&v){for(a=v.length;a--&&!(i=v[a]).pattern.test(t););-1===a&&(i=null)}if(!i)return;if(i.validValues&&!(n in i.validValues))return}if(k[t]&&!W.allow_script_urls){var f=n.replace(/[\s\u0000-\u001F]+/g,"");try{f=decodeURIComponent(f)}catch(d){f=unescape(f)}if(_.test(f))return;if(l=f,!(c=W).allow_html_data_urls&&(/^data:image\//i.test(l)?!1===c.allow_svg_data_urls&&/^data:image\/svg\+xml/i.test(l):/^data:/i.test(l)))return}g&&(t in k||0===t.indexOf("on"))||(p.map[t]=n,p.push({name:t,value:n}))},P=new RegExp("<(?:(?:!--([\\w\\W]*?)--!?>)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:![Dd][Oo][Cc][Tt][Yy][Pp][Ee]([\\w\\W]*?)>)|(?:!(--)?)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)>)|(?:([A-Za-z][A-Za-z0-9\\-_\\:\\.]*)((?:\\s+[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*|\\/|\\s+)>))","g"),L=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:[^\"])*)\")|(?:\'((?:[^\'])*)\')|([^>\s]+)))?/g,I=K.getShortEndedElements(),M=W.self_closing_elements||K.getSelfClosingElements(),F=K.getBoolAttrs(),U=W.validate,z=W.remove_internals,j=W.fix_self_closing,H=K.getSpecialElements(),V=w+">";t=P.exec(V);){var q=t[0];if(xw.length){A(E(w.substr(t.index))),x=t.index+q.length;continue}":"===(n=n.toLowerCase()).charAt(0)&&(n=n.substr(1)),u=n in I,j&&M[n]&&0]*data-mce-bogus="all"[^>]*>/g,f=e.schema;a=e.getTempAttrs(),u=c,s=new RegExp(["\\s?("+a.join("|")+')="[^"]+"'].join("|"),"gi"),c=u.replace(s,"");for(var d=f.getShortEndedElements();i=l.exec(c);)r=l.lastIndex,o=i[0].length,n=d[i[1]]?r:Lm.findEndTag(f,c,r),c=c.substring(0,r-o)+c.substring(n),l.lastIndex=r-o;return uo(c)},Mm=Im,Fm=function(e,t,n,r){var o,i,a,u,s;if(t.format=n,t.get=!0,t.getInner=!0,t.no_events||e.fire("BeforeGetContent",t),"raw"===t.format)o=xt.trim(Mm(e.serializer,r.innerHTML));else if("text"===t.format)o=uo(r.innerText||r.textContent);else{if("tree"===t.format)return e.serializer.serialize(r,t);a=(i=e).serializer.serialize(r,t),u=fc(i),s=new RegExp("^(<"+u+"[^>]*>( | |\\s|\xa0|
    |)<\\/"+u+">[\r\n]*|
    [\r\n]*)$"),o=a.replace(s,"")}return"text"===t.format||no(Nt.fromDom(r))?t.content=o:t.content=xt.trim(o),t.no_events||e.fire("GetContent",t),t.content},Um=xt.each,zm=function(o){this.compare=function(e,t){if(e.nodeName!==t.nodeName)return!1;var n=function(n){var r={};return Um(o.getAttribs(n),function(e){var t=e.nodeName.toLowerCase();0!==t.indexOf("_")&&"style"!==t&&0!==t.indexOf("data-")&&(r[t]=o.getAttrib(n,t))}),r},r=function(e,t){var n,r;for(r in e)if(e.hasOwnProperty(r)){if(void 0===(n=t[r]))return!1;if(e[r]!==n)return!1;delete t[r]}for(r in t)if(t.hasOwnProperty(r))return!1;return!0};return!!r(n(e),n(t))&&(!!r(o.parseStyle(o.getAttrib(e,"style")),o.parseStyle(o.getAttrib(t,"style")))&&(!$l(e)&&!$l(t)))}},jm=function(n,r,o){return U.from(o.container()).filter(On).exists(function(e){var t=n?0:-1;return r(e.data.charAt(o.offset()+t))})},Hm=E(jm,!0,Kl),Vm=E(jm,!1,Kl),qm=function(e){var t=e.container();return On(t)&&(0===t.data.length||ao(t.data)&&Kf.isBookmarkNode(t.parentNode))},$m=function(t,n){return function(e){return U.from(Zc(t?0:-1,e)).filter(n).isSome()}},Wm=function(e){return Mn(e)&&"block"===Yn(Nt.fromDom(e),"display")},Km=function(e){return Un(e)&&!(Nn(t=e)&&"all"===t.getAttribute("data-mce-bogus"));var t},Xm=$m(!0,Wm),Ym=$m(!1,Wm),Gm=$m(!0,jn),Jm=$m(!1,jn),Qm=$m(!0,Tn),Zm=$m(!1,Tn),ep=$m(!0,Km),tp=$m(!1,Km),np=function(e){var t=qu(e,"br"),n=j(function(e){for(var t=[],n=e.dom;n;)t.push(Nt.fromDom(n)),n=n.lastChild;return t}(e).slice(-1),Gr);t.length===n.length&&$(n,ln)},rp=function(e){cn(e),un(e,Nt.fromHtml('
    '))},op=function(n){Yt(n).each(function(t){Ht(t).each(function(e){Xr(n)&&Gr(t)&&Xr(e)&&ln(t)})})},ip=function(e,t,n){return At(t,e)?function(e,t){for(var n=A(t)?t:p,r=e.dom,o=[];null!==r.parentNode&&r.parentNode!==undefined;){var i=r.parentNode,a=Nt.fromDom(i);if(o.push(a),!0===n(a))break;r=i}return o}(e,function(e){return n(e)||Rt(e,t)}).slice(0,-1):[]},ap=function(e,t){return ip(e,t,p)},up=function(e,t){return[e].concat(ap(e,t))},sp=function(e,t,n){return Rl(e,t,n,qm)},cp=function(e,t){return K(up(Nt.fromDom(t.container()),e),Xr)},lp=function(e,n,r){return sp(e,n.dom,r).forall(function(t){return cp(n,r).fold(function(){return!1===Qc(t,r,n.dom)},function(e){return!1===Qc(t,r,n.dom)&&At(e,Nt.fromDom(t.container()))})})},fp=function(t,n,r){return cp(n,r).fold(function(){return sp(t,n.dom,r).forall(function(e){return!1===Qc(e,r,n.dom)})},function(e){return sp(t,e.dom,r).isNone()})},dp=E(fp,!1),mp=E(fp,!0),pp=E(lp,!1),gp=E(lp,!0),hp=function(e){return ul(e).exists(Gr)},vp=function(e,t,n){var r=j(up(Nt.fromDom(n.container()),t),Xr),o=Z(r).getOr(t);return kl(e,o.dom,n).filter(hp)},yp=function(e,t){return ul(t).exists(Gr)||vp(!0,e,t).isSome()},bp=function(e,t){return n=t,U.from(n.getNode(!0)).map(Nt.fromDom).exists(Gr)||vp(!1,e,t).isSome();var n},Cp=E(vp,!1),wp=E(vp,!0),xp=function(e){return Is.isTextPosition(e)&&!e.isAtStart()&&!e.isAtEnd()},Sp=function(e,t){var n=j(up(Nt.fromDom(t.container()),e),Xr);return Z(n).getOr(e)},Np=function(e,t){return xp(t)?Vm(t):Vm(t)||Dl(Sp(e,t).dom,t).exists(Vm)},Ep=function(e,t){return xp(t)?Hm(t):Hm(t)||Al(Sp(e,t).dom,t).exists(Hm)},kp=function(e){return ul(e).bind(function(e){return Sr(e,Pt)}).exists(function(e){return t=Yn(e,"white-space"),I(["pre","pre-wrap"],t);var t})},_p=function(e,t){return r=t,Dl(e.dom,r).isNone()||(n=t,Al(e.dom,n).isNone())||dp(e,t)||mp(e,t)||bp(e,t)||yp(e,t);var n,r},Rp=function(e,t){return!kp(t)&&(dp(e,t)||pp(e,t)||bp(e,t)||Np(e,t))},Tp=function(e,t){return!kp(t)&&(mp(e,t)||gp(e,t)||yp(e,t)||Ep(e,t))},Ap=function(e,t){return Rp(e,t)||Tp(e,(r=(n=t).container(),o=n.offset(),On(r)&&o=e.data.length&&Tp(o,Us(e,e.data.length)),u=0===t&&Rp(o,Us(e,0)),e.replaceData(t,n,(c=u,l=a,W(s=i,function(e,t){return Kl(t)||Wl(t)?e.previousCharIsSpace||""===e.str&&c||e.str.length===s.length-1&&l?{previousCharIsSpace:!1,str:e.str+oo}:{previousCharIsSpace:!0,str:e.str+" "}:{previousCharIsSpace:!1,str:e.str+t}},{previousCharIsSpace:!1,str:""}).str)))},Mp=function(e,t){var n=e.data.slice(t),r=n.length-He(n).length;return Ip(e,t,r)},Fp=function(e,t){var n=e.data.slice(0,t),r=n.length-Ve(n).length;return Ip(e,t-r,r)},Up=function(e,t,n,r){void 0===r&&(r=!0);var o=Ve(e.data).length,i=r?e:t,a=r?t:e;return r?i.appendData(a.data):i.insertData(0,a.data),ln(Nt.fromDom(a)),n&&Mp(i,o),i},zp=function(e,t){return r=e,o=(n=t).container(),i=n.offset(),!1===Us.isTextPosition(n)&&o===r.parentNode&&i>Us.before(r).offset()?Us(t.container(),t.offset()-1):t;var n,r,o,i},jp=function(e){return To(e.previousSibling)?U.some((t=e.previousSibling,On(t)?Us(t,t.data.length):Us.after(t))):e.previousSibling?Bl(e.previousSibling):U.none();var t},Hp=function(e){return To(e.nextSibling)?U.some((t=e.nextSibling,On(t)?Us(t,0):Us.before(t))):e.nextSibling?Ol(e.nextSibling):U.none();var t},Vp=function(r,o){return jp(o).orThunk(function(){return Hp(o)}).orThunk(function(){return e=r,t=o,n=Us.before(t.previousSibling?t.previousSibling:t.parentNode),Dl(e,n).fold(function(){return Al(e,Us.after(t))},U.some);var e,t,n})},qp=function(n,r){return Hp(r).orThunk(function(){return jp(r)}).orThunk(function(){return t=r,Al(e=n,Us.after(t)).fold(function(){return Dl(e,Us.before(t))},U.some);var e,t})},$p=function(e,t,n){return(e?qp:Vp)(t,n).map(E(zp,n))},Wp=function(t,n,e){e.fold(function(){t.focus()},function(e){t.selection.setRng(e.toRange(),n)})},Kp=function(e,t){return t&&me(e.schema.getBlockElements(),Dt(t))},Xp=function(e){if(Uo(e)){var t=Nt.fromHtml('
    ');return cn(e),un(e,t),U.some(Us.before(t.dom))}return U.none()},Yp=function(e,t,a){var n,r,o,i,u=Ht(e).filter(Lt),s=Vt(e).filter(Lt);return ln(e),r=s,o=t,i=function(e,t,n){var r=e.dom,o=t.dom,i=r.data.length;return Up(r,o,a),n.container()===o?Us(r,i):n},((n=u).isSome()&&r.isSome()&&o.isSome()?U.some(i(n.getOrDie(),r.getOrDie(),o.getOrDie())):U.none()).orThunk(function(){return a&&(u.each(function(e){return Fp(e.dom,e.dom.length)}),s.each(function(e){return Mp(e.dom,0)})),t})},Gp=function(t,n,e,r){void 0===r&&(r=!0);var o,i,a=$p(n,t.getBody(),e.dom),u=xr(e,E(Kp,t),(o=t.getBody(),function(e){return e.dom===o})),s=Yp(e,a,(i=e,me(t.schema.getTextInlineElements(),Dt(i))));t.dom.isEmpty(t.getBody())?(t.setContent(""),t.selection.setCursorLocation()):u.bind(Xp).fold(function(){r&&Wp(t,n,s)},function(e){r&&Wp(t,n,U.some(e))})},Jp=function(e,t){return{start:e,end:t}},Qp=gr([{removeTable:["element"]},{emptyCells:["cells"]},{deleteCellSelection:["rng","cell"]}]),Zp=function(e,t){return kr(Nt.fromDom(e),"td,th",t)},eg=function(e,t){return Nr(e,"table",t)},tg=function(e){return!Rt(e.start,e.end)},ng=function(e,t){return eg(e.start,t).bind(function(r){return eg(e.end,t).bind(function(e){return t=Rt(r,e),n=r,t?U.some(n):U.none();var t,n})})},rg=function(e){return qu(e,"td,th")},og=function(r,e){var t=Zp(e.startContainer,r),n=Zp(e.endContainer,r);return e.collapsed?U.none():as(t,n,Jp).fold(function(){return t.fold(function(){return n.bind(function(t){return eg(t,r).bind(function(e){return Z(rg(e)).map(function(e){return Jp(e,t)})})})},function(t){return eg(t,r).bind(function(e){return ee(rg(e)).map(function(e){return Jp(t,e)})})})},function(e){return ig(r,e)?U.none():(n=r,eg((t=e).start,n).bind(function(e){return ee(rg(e)).map(function(e){return Jp(t.start,e)})}));var t,n})},ig=function(e,t){return ng(t,e).isSome()},ag=function(e,t,n){return e.filter(function(e){return tg(e)&&ig(n,e)}).orThunk(function(){return og(n,t)}).bind(function(e){return ng(t=e,n).map(function(e){return{rng:t,table:e,cells:rg(e)}});var t})},ug=function(e,t){return X(e,function(e){return Rt(e,t)})},sg=function(e,r,o){return e.filter(function(e){return n=o,!tg(t=e)&&ng(t,n).exists(function(e){var t=e.dom.rows;return 1===t.length&&1===t[0].cells.length})&&Af(e.start,r);var t,n}).map(function(e){return e.start})},cg=function(n){return as(ug((r=n).cells,r.rng.start),ug(r.cells,r.rng.end),function(e,t){return r.cells.slice(e,t+1)}).map(function(e){var t=n.cells;return e.length===t.length?Qp.removeTable(n.table):Qp.emptyCells(e)});var r},lg=function(e,t){var n,r,o,i,a,u=(n=e,function(e){return Rt(n,e)}),s=(o=u,i=Zp((r=t).startContainer,o),a=Zp(r.endContainer,o),as(i,a,Jp));return sg(s,t,u).map(function(e){return Qp.deleteCellSelection(t,e)}).orThunk(function(){return ag(s,t,u).bind(cg)})},fg=function(e){var t;return(8===Ot(t=e)||"#comment"===Dt(t)?Ht:Yt)(e).bind(fg).orThunk(function(){return U.some(e)})},dg=function(e,t){return $(t,rp),e.selection.setCursorLocation(t[0].dom,0),!0},mg=function(e,t,n){t.deleteContents();var r,o,i=fg(n).getOr(n),a=Nt.fromDom(e.dom.getParent(i.dom,e.dom.isBlock));return Uo(a)&&(rp(a),e.selection.setCursorLocation(a.dom,0)),Rt(n,a)||(r=jt(a).is(n)?[]:jt(o=a).map(Wt).map(function(e){return j(e,function(e){return!Rt(o,e)})}).getOr([]),$(r.concat(Wt(n)),function(e){Rt(e,a)||At(e,a)||ln(e)})),!0},pg=function(e,t){return Gp(e,!1,t),!0},gg=function(n,e,r,t){return vg(e,t).fold(function(){return t=n,lg(e,r).map(function(e){return e.fold(E(pg,t),E(dg,t),E(mg,t))});var t},function(e){return yg(n,e)}).getOr(!1)},hg=function(e,t){return K(up(t,e),to)},vg=function(e,t){return K(up(t,e),function(e){return"caption"===Dt(e)})},yg=function(e,t){return rp(t),e.selection.setCursorLocation(t.dom,0),U.some(!0)},bg=function(u,s,c,l,f){return _l(c,u.getBody(),f).bind(function(e){return o=c,i=f,a=e,Ol((r=l).dom).bind(function(t){return Bl(r.dom).map(function(e){return o?i.isEqual(t)&&a.isEqual(e):i.isEqual(e)&&a.isEqual(t)})}).getOr(!0)?yg(u,l):(t=l,n=e,vg(s,Nt.fromDom(n.getNode())).map(function(e){return!1===Rt(e,t)}));var t,n,r,o,i,a}).or(U.some(!0))},Cg=function(o,i,a,e){var u=Us.fromRangeStart(o.selection.getRng());return hg(a,e).bind(function(e){return Uo(e)?yg(o,e):(t=a,n=e,r=u,_l(i,o.getBody(),r).bind(function(e){return hg(t,Nt.fromDom(e.getNode())).map(function(e){return!1===Rt(e,n)})}));var t,n,r}).getOr(!1)},wg=function(e,t){return(e?Qm:Zm)(t)},xg=function(a,u,r){var s=Nt.fromDom(a.getBody());return vg(s,r).fold(function(){return Cg(a,u,s,r)||(e=a,t=u,n=Us.fromRangeStart(e.selection.getRng()),wg(t,n)||kl(t,e.getBody(),n).exists(function(e){return wg(t,e)}));var e,t,n},function(e){return t=a,n=u,r=s,o=e,i=Us.fromRangeStart(t.selection.getRng()),(Uo(o)?yg(t,o):bg(t,r,n,o,i)).getOr(!1);var t,n,r,o,i})},Sg=function(e,t){var n,r,o,i,a,u=Nt.fromDom(e.selection.getStart(!0)),s=_f(e);return e.selection.isCollapsed()&&0===s.length?xg(e,t,u):(n=e,r=u,o=Nt.fromDom(n.getBody()),i=n.selection.getRng(),0!==(a=_f(n)).length?dg(n,a):gg(n,o,i,r))},Ng=function(a){var u=Us.fromRangeStart(a),s=Us.fromRangeEnd(a),c=a.commonAncestorContainer;return kl(!1,c,s).map(function(e){return!Qc(u,s,c)&&Qc(u,e,c)?(t=u.container(),n=u.offset(),r=e.container(),o=e.offset(),(i=document.createRange()).setStart(t,n),i.setEnd(r,o),i):a;var t,n,r,o,i}).getOr(a)},Eg=function(e){return e.collapsed?e:Ng(e)},kg=function(e,t){var n,r;return e.getBlockElements()[t.name]&&((r=t).firstChild&&r.firstChild===r.lastChild)&&("br"===(n=t.firstChild).name||n.value===oo)},_g=function(e,t){var n,r,o,i=t.firstChild,a=t.lastChild;return i&&"meta"===i.name&&(i=i.next),a&&"mce_marker"===a.attr("id")&&(a=a.prev),r=a,o=(n=e).getNonEmptyElements(),r&&(r.isEmpty(o)||kg(n,r))&&(a=a.prev),!(!i||i!==a)&&("ul"===i.name||"ol"===i.name)},Rg=function(e){return e&&e.firstChild&&e.firstChild===e.lastChild&&((t=e.firstChild).data===oo||In(t));var t},Tg=function(e){return 0)?$/," "):l.replace(/ ()?$/," "));var p=e.parser,g=n.merge,h=Tm({validate:e.getParam("validate")},e.schema),v='',y={content:t,format:"html",selection:!0,paste:n.paste};if((y=e.fire("BeforeSetContent",y)).isDefaultPrevented())e.fire("SetContent",{content:y.content,format:"html",selection:!0,paste:n.paste});else{-1===(t=y.content).indexOf("{$caret}")&&(t+="{$caret}"),t=t.replace(/\{\$caret\}/,v);var b,C,w=(a=d.getRng()).startContainer||(a.parentElement?a.parentElement():null),x=e.getBody();w===x&&d.isCollapsed()&&m.isBlock(x.firstChild)&&(b=e,(C=x.firstChild)&&!b.schema.getShortEndedElements()[C.nodeName])&&m.isEmpty(x.firstChild)&&((a=m.createRng()).setStart(x.firstChild,0),a.setEnd(x.firstChild,0),d.setRng(a)),d.isCollapsed()||Lg(e);var S,N,E,k,_,R,T,A,D,O,B,P,L,I,M={context:(r=d.getNode()).nodeName.toLowerCase(),data:n.data,insert:!0},F=p.parse(t,M);if(!0===n.paste&&_g(e.schema,F)&&Ag(m,r))return a=Bg(h,m,d.getRng(),F),d.setRng(a),void e.fire("SetContent",y);if(!function(e){for(var t=e;t=t.walk();)1===t.type&&t.attr("data-mce-fragment","1")}(F),"mce_marker"===(u=F.lastChild).attr("id"))for(u=(i=u).prev;u;u=u.walk(!0))if(3===u.type||!m.isBlock(u.name)){e.schema.isValidChild(u.parent.name,"span")&&u.parent.insert(i,u,"br"===u.name);break}if(e._selectionOverrides.showBlockCaretContainer(r),M.invalid){for(e.selection.setContent(v),r=d.getNode(),o=e.getBody(),9===r.nodeType?r=u=o:u=r;u!==o;)u=(r=u).parentNode;t=r===o?o.innerHTML:m.getOuterHTML(r),t=h.serialize(p.parse(t.replace(//i,function(){return h.serialize(F)}))),r===o?m.setHTML(o,t):m.setOuterHTML(r,t)}else t=h.serialize(F),S=e,N=t,"all"===(E=r).getAttribute("data-mce-bogus")?E.parentNode.insertBefore(S.dom.createFragment(N),E):(k=E.firstChild,_=E.lastChild,!k||k===_&&"BR"===k.nodeName?S.dom.setHTML(E,N):S.selection.setContent(N));T=g,O=(R=e).schema.getTextInlineElements(),B=R.dom,T&&(A=R.getBody(),D=new zm(B),xt.each(B.select("*[data-mce-fragment]"),function(e){for(var t=e.parentNode;t&&t!==A;t=t.parentNode)O[e.nodeName.toLowerCase()]&&D.compare(t,e)&&B.remove(e,!0)})),function(n,e){var t,r,o=n.dom,i=n.selection;if(e){i.scrollIntoView(e);var a=function(e){for(var t=n.getBody();e&&e!==t;e=e.parentNode)if("false"===o.getContentEditable(e))return e;return null}(e);if(a)return o.remove(e),i.select(a);var u=o.createRng(),s=e.previousSibling;s&&3===s.nodeType?(u.setStart(s,s.nodeValue.length),vt.ie||(r=e.nextSibling)&&3===r.nodeType&&(s.appendData(r.data),r.parentNode.removeChild(r))):(u.setStartBefore(e),u.setEndBefore(e));var c=o.getParent(e,o.isBlock);o.remove(e),c&&o.isEmpty(c)&&(n.$(c).empty(),u.setStart(c,0),u.setEnd(c,0),Pg(c)||c.getAttribute("data-mce-fragment")||!(t=function(e){var t=Us.fromRangeStart(e);if(t=wl(n.getBody()).next(t))return t.toRange()}(u))?o.add(c,o.create("br",{"data-mce-bogus":"1"})):(u=t,o.remove(c))),i.setRng(u)}}(e,m.get("mce_marker")),P=e.getBody(),xt.each(P.getElementsByTagName("*"),function(e){e.removeAttribute("data-mce-fragment")}),L=m,I=d.getStart(),U.from(L.getParent(I,"td,th")).map(Nt.fromDom).each(op),e.fire("SetContent",y),e.addVisual()}},Mg=function(e,t){t(e),e.firstChild&&Mg(e.firstChild,t),e.next&&Mg(e.next,t)},Fg=function(e,t,n){var r=function(e,n,t){var r={},o={},i=[];for(var a in t.firstChild&&Mg(t.firstChild,function(t){$(e,function(e){e.name===t.name&&(r[e.name]?r[e.name].nodes.push(t):r[e.name]={filter:e,nodes:[t]})}),$(n,function(e){"string"==typeof t.attr(e.name)&&(o[e.name]?o[e.name].nodes.push(t):o[e.name]={filter:e,nodes:[t]})})}),r)r.hasOwnProperty(a)&&i.push(r[a]);for(var u in o)o.hasOwnProperty(u)&&i.push(o[u]);return i}(e,t,n);$(r,function(t){$(t.filter.callbacks,function(e){e(t.nodes,t.filter.name,{})})})},Ug=function(e){return e instanceof Em},zg=function(e,t){var r;e.dom.setHTML(e.getBody(),t),pm(r=e)&&Ol(r.getBody()).each(function(e){var t=e.getNode(),n=Tn(t)?Ol(t).getOr(e):e;r.selection.setRng(n.toRange())})},jg=function(u,s,c){return c.format=c.format?c.format:"html",c.set=!0,c.content=Ug(s)?"":s,Ug(s)||c.no_events||(u.fire("BeforeSetContent",c),s=c.content),U.from(u.getBody()).fold(N(s),function(e){return Ug(s)?function(e,t,n,r){Fg(e.parser.getNodeFilters(),e.parser.getAttributeFilters(),n);var o=Tm({validate:e.validate},e.schema).serialize(n);return r.content=no(Nt.fromDom(t))?o:xt.trim(o),zg(e,r.content),r.no_events||e.fire("SetContent",r),n}(u,e,s,c):(t=u,n=e,o=c,0===(r=s).length||/^\s+$/.test(r)?(a='
    ',"TABLE"===n.nodeName?r=""+a+"":/^(UL|OL)$/.test(n.nodeName)&&(r="
  • "+a+"
  • "),r=(i=fc(t))&&t.schema.isValidChild(n.nodeName.toLowerCase(),i.toLowerCase())?(r=a,t.dom.createHTML(i,dc(t),r)):r||'
    ',zg(t,r),t.fire("SetContent",o)):("raw"!==o.format&&(r=Tm({validate:t.validate},t.schema).serialize(t.parser.parse(r,{isRootContent:!0,insert:!0}))),o.content=no(Nt.fromDom(n))?r:xt.trim(r),zg(t,o.content),o.no_events||t.fire("SetContent",o)),o.content);var t,n,r,o,i,a})},Hg=nf,Vg=function(e,t,n){var r=e.formatter.get(n);if(r)for(var o=0;o
    ").append(n.childNodes)}))},lh[Bm="pre"]||(lh[Bm]=[]),lh[Bm].push(Pm);var mh=xt.each,ph=function(e){return Nn(e)&&!$l(e)&&!Ll(e)&&!Rn(e)},gh=function(e,t){for(var n=e;n;n=n[t]){if(On(n)&&0!==n.nodeValue.length)return e;if(Nn(n)&&!$l(n))return n}return e},hh=function(e,t,n){var r,o,i=new zm(e);if(t&&n&&(t=gh(t,"previousSibling"),n=gh(n,"nextSibling"),i.compare(t,n))){for(r=t.nextSibling;r&&r!==n;)r=(o=r).nextSibling,t.appendChild(o);return e.remove(n),xt.each(xt.grep(n.childNodes),function(e){t.appendChild(e)}),t}return n},vh=function(e,t,n,r){var o;r&&!1!==t.merge_siblings&&(o=hh(e,Jl(r),r),hh(e,o,Jl(o,!0)))},yh=function(e,t,n){mh(e.childNodes,function(e){ph(e)&&(t(e)&&n(e),e.hasChildNodes()&&yh(e,t,n))})},bh=function(t,n){return function(e){return!(!e||!of(t,e,n))}},Ch=function(r,o,i){return function(e){var t,n;r.setStyle(e,o,i),""===e.getAttribute("style")&&e.removeAttribute("style"),t=r,"SPAN"===(n=e).nodeName&&0===t.getAttribs(n).length&&t.remove(n,!0)}},wh=gr([{keep:[]},{rename:["name"]},{removed:[]}]),xh=/^(src|href|style)$/,Sh=xt.each,Nh=nf,Eh=function(e,t,n){return e.isChildOf(t,n)&&t!==n&&!e.isBlock(n)},kh=function(e,t,n){var r,o=t[n?"startContainer":"endContainer"],i=t[n?"startOffset":"endOffset"];return Nn(o)&&(r=o.childNodes.length-1,!n&&i&&i--,o=o.childNodes[r=o.nodeValue.length&&(o=new Hr(o,e.getBody()).next()||o),On(o)&&!n&&0===i&&(o=new Hr(o,e.getBody()).prev()||o),o},_h=function(e,t){var n=t?"firstChild":"lastChild";if(/^(TR|TH|TD)$/.test(e.nodeName)&&e[n]){var r=e[n];return"TR"===e.nodeName&&r[n]||r}return e},Rh=function(e,t,n,r){var o=e.create(n,r);return t.parentNode.insertBefore(o,t),o.appendChild(t),o},Th=function(e,t,n,r,o){var i=Nt.fromDom(t),a=Nt.fromDom(e.create(r,o)),u=(n?$t:qt)(i);return sn(a,u),n?(rn(i,a),an(a,i)):(on(i,a),un(a,i)),a.dom},Ah=function(e,t,n,r){return!(t=Jl(t,n,r))||"BR"===t.nodeName||e.isBlock(t)},Dh=function(e,r,o,t,i){var n,a,u,s,c,l=e.dom;if(u=l,!(Nh(s=t,(c=r).inline)||Nh(s,c.block)||c.selector&&(Nn(s)&&u.is(s,c.selector))||(a=t,r.links&&"A"===a.nodeName)))return wh.keep();var f,d,m,p,g,h,v,y=t;if(r.inline&&"all"===r.remove&&S(r.preserve_attributes)){var b=j(l.getAttribs(y),function(e){return I(r.preserve_attributes,e.name.toLowerCase())});if(l.removeAllAttribs(y),$(b,function(e){return l.setAttrib(y,e.name,e.value)}),0e?t.cells.length:e},0)},qh=function(e,t){for(var n=e.rows,r=0;r")?{type:"fragmented",fragments:r,content:"",bookmark:null,beforeBookmark:null}:{type:"complete",fragments:null,content:o,bookmark:null,beforeBookmark:null}},lv=function(e,t,n){"fragmented"===t.type?uv(t.fragments,e.getBody()):e.setContent(t.content,{format:"raw"}),e.selection.moveToBookmark(n?t.beforeBookmark:t.bookmark)},fv=function(e){return"fragmented"===e.type?e.fragments.join(""):e.content},dv=function(e){var t=Nt.fromTag("body",sv.get().getOrThunk(function(){var e=document.implementation.createHTMLDocument("undo");return sv.set(U.some(e)),e}));return es(t,fv(e)),$(qu(t,"*[data-mce-bogus]"),fn),t.dom.innerHTML},mv=function(e,t){return!(!e||!t)&&(r=t,fv(e)===fv(r)||(n=t,dv(e)===dv(n)));var n,r},pv=function(e){return 0===e.get()},gv=function(e,t,n){pv(n)&&(e.typing=t)},hv=function(e,t){e.typing&&(gv(e,!1,t),e.add())},vv=function(e){return e instanceof Em},yv=function(e,t){Fg(e.serializer.getNodeFilters(),e.serializer.getAttributeFilters(),t)},bv=function(){return{type:"complete",fragments:[],content:"",bookmark:null,beforeBookmark:null}},Cv=function(f){return{undoManager:{beforeChange:function(e,t){return n=f,r=t,void(pv(e)&&r.set(U.some(uc(n.selection))));var n,r},addUndoLevel:function(e,t,n,r,o,i){return function(e,t,n,r,o,i,a){var u=cv(e);if(i=i||{},i=xt.extend(i,u),!1===pv(r)||e.removed)return null;var s=t.data[n.get()];if(e.fire("BeforeAddUndo",{level:i,lastLevel:s,originalEvent:a}).isDefaultPrevented())return null;if(s&&mv(s,i))return null;t.data[n.get()]&&o.get().each(function(e){t.data[n.get()].beforeBookmark=e});var c=e.getParam("custom_undo_redo_levels",0,"number");if(c&&t.data.length>c){for(var l=0;lt.clientHeight){e=t;break}t=t.parentNode}return e},scrollIntoView:function(e,t){return r=e,o=t,void((n=c).inline?Pd:Id)(n,r,o);var n,r,o},placeCaretAt:function(e,t){return g(ed(e,t,c.getDoc()))},getBoundingClientRect:function(){var e=p();return e.collapsed?Us.fromRangeStart(e).getClientRects()[0]:e.getBoundingClientRect()},destroy:function(){s=l=f=null,b.destroy()}},y=Kf(v),b=Qf(v,c);return v.bookmarkManager=y,v.controlSelection=b,v},Bv=function(e,a,u){e.addNodeFilter("font",function(e){$(e,function(e){var t,n=a.parse(e.attr("style")),r=e.attr("color"),o=e.attr("face"),i=e.attr("size");r&&(n.color=r),o&&(n["font-family"]=o),i&&(n["font-size"]=u[parseInt(e.attr("size"),10)-1]),e.name="span",e.attr("style",a.serialize(n)),t=e,$(["color","face","size"],function(e){t.attr(e,null)})})})},Pv=function(e,t){var n,r=hi();t.convert_fonts_to_spans&&Bv(e,r,xt.explode(t.font_size_legacy_values)),n=r,e.addNodeFilter("strike",function(e){$(e,function(e){var t=n.parse(e.attr("style"));t["text-decoration"]="line-through",e.name="span",e.attr("style",n.serialize(t))})})},Lv=function(e){var t,n=decodeURIComponent(e).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(t=r[1]),{type:t,data:n[1]}},Iv=function(e,t){var n;try{n=atob(t)}catch(pk){return U.none()}for(var r=new Uint8Array(n.length),o=0;o)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(()?|\s*\/\/\s*\]\]>(-->)?|\/\/\s*(-->)?|\]\]>|\/\*\s*-->\s*\*\/|\s*-->\s*)\s*$/g,"")};i--;)r=(n=e[i]).firstChild?n.firstChild.value:"","script"===t?((o=n.attr("type"))&&n.attr("type","mce-no/type"===o?null:o.replace(/^mce\-/,"")),"xhtml"===s.element_format&&0")):"xhtml"===s.element_format&&0",visual:!0,font_size_legacy_values:"xx-small,small,medium,large,x-large,xx-large,300%",forced_root_block:"p",hidden_input:!0,inline_styles:!0,convert_fonts_to_spans:!0,indent:!0,indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,th,ul,ol,li,dl,dt,dd,area,table,thead,tfoot,tbody,tr,section,summary,article,hgroup,aside,figure,figcaption,option,optgroup,datalist",entity_encoding:"named",url_converter:u.convertURL,url_converter_scope:u},xe(xe({},s),a?yy:{}));return Ny(gy||hy,gy,c,r,o)},ky=function(e,t,n){return U.from(t.settings[n]).filter(e)},_y=function(e,t,n,r){var o,i,a,u=t in e.settings?e.settings[t]:n;return"hash"===r?(a={},"string"==typeof(i=u)?$(0)\s*/g,"$1"),xt.map(c.split(/(?:>|\s+(?![^\[\]]+\]))/),function(e){var t=xt.map(e.split(/(?:~\+|~|\+)/),ub),n=t.pop();return t.length&&(n.siblings=t),n}).reverse()):[],f=l.length?(l[0].name||(l[0].name=t),t=e.selector,ab(l,n)):ab([t],n),d=ib.select(t,f)[0]||f.firstChild;return ob(e.styles,function(e,t){var n=u(e);n&&ib.setStyle(d,t,n)}),ob(e.attributes,function(e,t){var n=u(e);n&&ib.setAttrib(d,t,n)}),ob(e.classes,function(e){var t=u(e);ib.hasClass(d,t)||ib.addClass(d,t)}),n.fire("PreviewFormats"),ib.setStyles(f,{position:"absolute",left:-65535}),n.getBody().appendChild(f),r=ib.getStyle(n.getBody(),"fontSize",!0),r=/px$/.test(r)?parseInt(r,10):0,ob(a.split(" "),function(e){var t=ib.getStyle(d,e,!0);if(!("background-color"===e&&/transparent|rgba\s*\([^)]+,\s*0\)/.test(t)&&(t=ib.getStyle(n.getBody(),e,!0),"#ffffff"===ib.toHex(t).toLowerCase())||"color"===e&&"#000000"===ib.toHex(t).toLowerCase())){if("font-size"===e&&/em|%$/.test(t)){if(0===r)return;t=parseFloat(t)/(/%$/.test(t)?100:1)*r+"px"}"border"===e&&t&&(i+="padding:0 2px;"),i+=e+":"+t+";"}}),n.fire("AfterPreviewFormats"),ib.remove(f),i},cb=function(s){var e=tb(s),t=ku(null);return function(e){e.addShortcut("meta+b","","Bold"),e.addShortcut("meta+i","","Italic"),e.addShortcut("meta+u","","Underline");for(var t=1;t<=6;t++)e.addShortcut("access+"+t,"",["FormatBlock",!1,"h"+t]);e.addShortcut("access+7","",["FormatBlock",!1,"p"]),e.addShortcut("access+8","",["FormatBlock",!1,"div"]),e.addShortcut("access+9","",["FormatBlock",!1,"address"])}(s),sh(s),{get:e.get,has:e.has,register:e.register,unregister:e.unregister,apply:function(e,t,n){var r,o,i;r=e,o=t,i=n,Nv(s).formatter.apply(r,o,i)},remove:function(e,t,n,r){var o,i,a,u;o=e,i=t,a=n,u=r,Nv(s).formatter.remove(o,i,a,u)},toggle:function(e,t,n){var r,o,i;r=e,o=t,i=n,Nv(s).formatter.toggle(r,o,i)},match:E(Xg,s),matchAll:E(Yg,s),matchNode:E(Kg,s),canApply:E(Gg,s),formatChanged:E(eb,s,t),getCssText:E(sb,s)}},lb=function(n,r,o){var i=ku(!1),a=function(e){gv(r,!1,o),r.add({},e)};n.on("init",function(){r.add()}),n.on("BeforeExecCommand",function(e){var t=e.command.toLowerCase();"undo"!==t&&"redo"!==t&&"mcerepaint"!==t&&(hv(r,o),r.beforeChange())}),n.on("ExecCommand",function(e){var t=e.command.toLowerCase();"undo"!==t&&"redo"!==t&&"mcerepaint"!==t&&a(e)}),n.on("ObjectResizeStart cut",function(){r.beforeChange()}),n.on("SaveContent ObjectResized blur",a),n.on("dragend",a),n.on("keyup",function(e){var t=e.keyCode;e.isDefaultPrevented()||((33<=t&&t<=36||37<=t&&t<=40||45===t||e.ctrlKey)&&(a(),n.nodeChanged()),46!==t&&8!==t||n.nodeChanged(),i.get()&&r.typing&&!1===mv(cv(n),r.data[0])&&(!1===n.isDirty()&&(n.setDirty(!0),n.fire("change",{level:r.data[0],lastLevel:null})),n.fire("TypingUndo"),i.set(!1),n.nodeChanged()))}),n.on("keydown",function(e){var t,n=e.keyCode;e.isDefaultPrevented()||(33<=n&&n<=36||37<=n&&n<=40||45===n?r.typing&&a(e):(t=e.ctrlKey&&!e.altKey||e.metaKey,!(n<16||20t;var t}},Iw=function(n){return function(e){return t=n,e.line===t;var t}},Mw=Un,Fw=Gc,Uw=function(e,t){return Math.abs(e.left-t)},zw=function(e,t){return Math.abs(e.right-t)},jw=function(e,t){return e>=t.left&&e<=t.right},Hw=function(e,t){return e>=t.top&&e<=t.bottom},Vw=function(e,o){return be(e,function(e,t){var n=Math.min(Uw(e,o),zw(e,o)),r=Math.min(Uw(t,o),zw(t,o));return jw(o,t)||!jw(o,e)&&(r===n&&Mw(t.node)||r'),u=o,1===t?e.$(s).after(u):e.$(s).before(u),e.selection.select(u,!0),e.selection.collapse())}},ex=function(e,t){var n=t?Ms.Forwards:Ms.Backwards,r=e.selection.getRng();return Xw(e,n,r,ep,tp,Qw).orThunk(function(){return Zw(e,n,r),U.none()})},tx=function(e,t){var n=t?1:-1,r=e.selection.getRng();return Yw(e,n,r,function(e){return ep(e)||Qm(e)},function(e){return tp(e)||Zm(e)},Qw).orThunk(function(){return Zw(e,n,r),U.none()})},nx=function(t,e){return ex(t,e).exists(function(e){return Ww(t,e),!0})},rx=function(t,e){return tx(t,e).exists(function(e){return Ww(t,e),!0})},ox=function(e,t){return Jw(e,t,t?tp:ep)},ix=function(e){return I(["figcaption"],Dt(e))},ax=function(e){var t=document.createRange();return t.setStartBefore(e.dom),t.setEndBefore(e.dom),t},ux=function(e,t,n){(n?un:an)(e,t)},sx=function(e,t,n,r){return""===t?(l=e,f=r,d=Nt.fromTag("br"),ux(l,d,f),ax(d)):(o=e,i=r,a=t,u=n,s=Nt.fromTag(a),c=Nt.fromTag("br"),$n(s,u),un(s,c),ux(o,s,i),ax(c));var o,i,a,u,s,c,l,f,d},cx=function(e,t,n){return t?(o=e.dom,_w(o,n).breakAt.isNone()):(r=e.dom,kw(r,n).breakAt.isNone());var r,o},lx=function(t,n){var e,r,o=Nt.fromDom(t.getBody()),i=Us.fromRangeStart(t.selection.getRng()),a=fc(t),u=dc(t);return e=i,r=E(Rt,o),Sr(Nt.fromDom(e.container()),Xr,r).filter(ix).exists(function(){if(cx(o,n,i)){var e=sx(o,a,u,n);return t.selection.setRng(e),!0}return!1})},fx=function(e,t){return!!e.selection.isCollapsed()&&lx(e,t)},dx=function(e,r){return Y(F(e,function(e){return xe({shiftKey:!1,altKey:!1,ctrlKey:!1,metaKey:!1,keyCode:0,action:V},e)}),function(e){return t=e,(n=r).keyCode===t.keyCode&&n.shiftKey===t.shiftKey&&n.altKey===t.altKey&&n.ctrlKey===t.ctrlKey&&n.metaKey===t.metaKey?[e]:[];var t,n})},mx=function(e){for(var t=[],n=1;nt}),xx=function(t,n){return Z(n.getClientRects()).bind(function(e){return Cx(t,e.left,e.top)}).bind(function(e){return Ew(Bl(t=e).map(function(e){return kw(t,e).positions.concat(e)}).getOr([]),n);var t})},Sx=function(t,n){return ee(n.getClientRects()).bind(function(e){return wx(t,e.left,e.top)}).bind(function(e){return Ew(Ol(t=e).map(function(e){return[e].concat(_w(t,e).positions)}).getOr([]),n);var t})},Nx=function(e,t,n){var r,o,i,a,u=e(t,n);return(a=u).breakType===nb.Wrap&&0===a.positions.length||!In(n.getNode())&&((i=u).breakType===nb.Br&&1===i.positions.length)?(r=e,o=t,!u.breakAt.exists(function(e){return r(o,e).breakAt.isSome()})):u.breakAt.isNone()},Ex=E(Nx,kw),kx=E(Nx,_w),_x=function(t,e,n,r){var o,i,a,u,s=t.selection.getRng(),c=e?1:-1;return!(!Uc()||(o=e,i=s,a=n,u=Us.fromRangeStart(i),!Tl(!o,a).exists(function(e){return e.isEqual(u)})))&&(qb(c,t,n,!e,!1).each(function(e){Ww(t,e)}),!0)},Rx=function(e,t){var n=t.getNode(e);return Nn(n)&&"TABLE"===n.nodeName?U.some(n):U.none()},Tx=function(u,s,c){var e=Rx(!!s,c),t=!1===s;e.fold(function(){return Ww(u,c.toRange())},function(a){return Tl(t,u.getBody()).filter(function(e){return e.isEqual(c)}).fold(function(){return Ww(u,c.toRange())},function(e){return n=s,o=a,t=c,void((i=fc(r=u))?r.undoManager.transact(function(){var e=Nt.fromTag(i);$n(e,dc(r)),un(e,Nt.fromTag("br")),(n?on:rn)(Nt.fromDom(o),e);var t=r.dom.createRng();t.setStart(e.dom,0),t.setEnd(e.dom,0),Ww(r,t)}):Ww(r,t.toRange()));var n,r,o,t,i})})},Ax=function(e,t,n,r){var o,i,a,u,s,c,l=e.selection.getRng(),f=Us.fromRangeStart(l),d=e.getBody();if(!t&&Ex(r,f)){var m=(u=d,xx(s=n,c=f).orThunk(function(){return Z(c.getClientRects()).bind(function(e){return Nw(Rw(u,Us.before(s)),e.left)})}).getOr(Us.before(s)));return Tx(e,t,m),!0}if(t&&kx(r,f)){m=(o=d,Sx(i=n,a=f).orThunk(function(){return Z(a.getClientRects()).bind(function(e){return Nw(Tw(o,Us.after(i)),e.left)})}).getOr(Us.after(i)));return Tx(e,t,m),!0}return!1},Dx=function(n,r,o){return U.from(n.dom.getParent(n.selection.getNode(),"td,th")).bind(function(t){return U.from(n.dom.getParent(t,"table")).map(function(e){return o(n,r,e,t)})}).getOr(!1)},Ox=function(e,t){return Dx(e,t,_x)},Bx=function(e,t){return Dx(e,t,Ax)},Px=function(i,a){i.on("keydown",function(e){var t,n,r,o;!1===e.isDefaultPrevented()&&(t=i,n=a,r=e,o=st().os,px([{keyCode:Gf.RIGHT,action:mx(nx,t,!0)},{keyCode:Gf.LEFT,action:mx(nx,t,!1)},{keyCode:Gf.UP,action:mx(rx,t,!1)},{keyCode:Gf.DOWN,action:mx(rx,t,!0)},{keyCode:Gf.RIGHT,action:mx(Ox,t,!0)},{keyCode:Gf.LEFT,action:mx(Ox,t,!1)},{keyCode:Gf.UP,action:mx(Bx,t,!1)},{keyCode:Gf.DOWN,action:mx(Bx,t,!0)},{keyCode:Gf.RIGHT,action:mx(gx,t,!0)},{keyCode:Gf.LEFT,action:mx(gx,t,!1)},{keyCode:Gf.UP,action:mx(hx,t,!1)},{keyCode:Gf.DOWN,action:mx(hx,t,!0)},{keyCode:Gf.RIGHT,action:mx(VC,t,n,!0)},{keyCode:Gf.LEFT,action:mx(VC,t,n,!1)},{keyCode:Gf.RIGHT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:mx(WC,t,n)},{keyCode:Gf.LEFT,ctrlKey:!o.isOSX(),altKey:o.isOSX(),action:mx(KC,t,n)},{keyCode:Gf.UP,action:mx(fx,t,!1)},{keyCode:Gf.DOWN,action:mx(fx,t,!0)}],r).each(function(e){r.preventDefault()}))})},Lx=function(o,i){o.on("keydown",function(e){var t,n,r;!1===e.isDefaultPrevented()&&(t=o,n=i,r=e,px([{keyCode:Gf.BACKSPACE,action:mx(lw,t,!1)},{keyCode:Gf.BACKSPACE,action:mx(aC,t,!1)},{keyCode:Gf.DELETE,action:mx(aC,t,!0)},{keyCode:Gf.BACKSPACE,action:mx(Jb,t,!1)},{keyCode:Gf.DELETE,action:mx(Jb,t,!0)},{keyCode:Gf.BACKSPACE,action:mx(JC,t,n,!1)},{keyCode:Gf.DELETE,action:mx(JC,t,n,!0)},{keyCode:Gf.BACKSPACE,action:mx(Sg,t,!1)},{keyCode:Gf.DELETE,action:mx(Sg,t,!0)},{keyCode:Gf.BACKSPACE,action:mx(uC,t,!1)},{keyCode:Gf.DELETE,action:mx(uC,t,!0)},{keyCode:Gf.BACKSPACE,action:mx(rw,t,!1)},{keyCode:Gf.DELETE,action:mx(rw,t,!0)},{keyCode:Gf.BACKSPACE,action:mx(jb,t,!1)},{keyCode:Gf.DELETE,action:mx(jb,t,!0)},{keyCode:Gf.BACKSPACE,action:mx(Mb,t,!1)},{keyCode:Gf.DELETE,action:mx(Mb,t,!0)},{keyCode:Gf.BACKSPACE,action:mx(tw,t,!1)},{keyCode:Gf.DELETE,action:mx(tw,t,!0)}],r).each(function(e){r.preventDefault()}))}),o.on("keyup",function(e){var t,n;!1===e.isDefaultPrevented()&&(t=o,n=e,px([{keyCode:Gf.BACKSPACE,action:mx(iC,t)},{keyCode:Gf.DELETE,action:mx(iC,t)}],n))})},Ix=function(e,t){var n,r,o=t,i=e.dom,a=e.schema.getMoveCaretBeforeOnEnterElements();if(t){!/^(LI|DT|DD)$/.test(t.nodeName)||(r=function(e){for(;e;){if(1===e.nodeType||3===e.nodeType&&e.data&&/[\r\n\s]/.test(e.data))return e;e=e.nextSibling}}(t.firstChild))&&/^(UL|OL|DL)$/.test(r.nodeName)&&t.insertBefore(i.doc.createTextNode(oo),t.firstChild);var u=i.createRng();if(t.normalize(),t.hasChildNodes()){for(var s=new Hr(t,t);n=s.current();){if(On(n)){u.setStart(n,0),u.setEnd(n,0);break}if(a[n.nodeName.toLowerCase()]){u.setStartBefore(n),u.setEndBefore(n);break}o=n,n=s.next()}n||(u.setStart(o,0),u.setEnd(o,0))}else In(t)?t.nextSibling&&i.isBlock(t.nextSibling)?(u.setStartBefore(t),u.setEndBefore(t)):(u.setStartAfter(t),u.setEndAfter(t)):(u.setStart(t,0),u.setEnd(t,0));e.selection.setRng(u),Md(e,u)}},Mx=function(e){return U.from(e.dom.getParent(e.selection.getStart(!0),e.dom.isBlock))},Fx=function(e,t){return e&&e.parentNode&&e.parentNode.nodeName===t},Ux=function(e){return e&&/^(OL|UL|LI)$/.test(e.nodeName)},zx=function(e){var t=e.parentNode;return/^(LI|DT|DD)$/.test(t.nodeName)?t:e},jx=function(e,t,n){for(var r=e[n?"firstChild":"lastChild"];r&&!Nn(r);)r=r[n?"nextSibling":"previousSibling"];return r===t},Hx=function(e,t,n,r,o){var i,a,u,s,c,l,f=e.dom,d=e.selection.getRng();n!==e.getBody()&&(Ux(i=n)&&Ux(i.parentNode)&&(o="LI"),a=o?t(o):f.create("BR"),jx(n,r,!0)&&jx(n,r,!1)?Fx(n,"LI")?f.insertAfter(a,zx(n)):f.replace(a,n):jx(n,r,!0)?Fx(n,"LI")?(f.insertAfter(a,zx(n)),a.appendChild(f.doc.createTextNode(" ")),a.appendChild(n)):n.parentNode.insertBefore(a,n):jx(n,r,!1)?f.insertAfter(a,zx(n)):(n=zx(n),(u=d.cloneRange()).setStartAfter(r),u.setEndAfter(n),s=u.extractContents(),"LI"===o&&(l="LI",(c=s).firstChild&&c.firstChild.nodeName===l)?(a=s.firstChild,f.insertAfter(s,n)):(f.insertAfter(s,n),f.insertAfter(a,n))),f.remove(r),Ix(e,a))},Vx=function(e){e.innerHTML='
    '},qx=function(e,t){return e.nodeName===t||e.previousSibling&&e.previousSibling.nodeName===t},$x=function(e,t){return t&&e.isBlock(t)&&!/^(TD|TH|CAPTION|FORM)$/.test(t.nodeName)&&!/^(fixed|absolute)/i.test(t.style.position)&&"true"!==e.getContentEditable(t)},Wx=function(e,t,n){return!1===On(t)?n:e?1===n&&t.data.charAt(n-1)===io?0:n:n===t.data.length-1&&t.data.charAt(n)===io?t.data.length:n},Kx=function(e,t){for(var n,r=e.getRoot(),o=t;o!==r&&"false"!==e.getContentEditable(o);)"true"===e.getContentEditable(o)&&(n=o),o=o.parentNode;return o!==r?n:r},Xx=function(e,t){var n=fc(e);n&&n.toLowerCase()===t.tagName.toLowerCase()&&function(e,o,t){var i=e.dom;U.from(t.style).map(i.parseStyle).each(function(e){var t=Qn(Nt.fromDom(o)),n=xe(xe({},t),e);i.setStyles(o,n)});var n=U.from(t["class"]).map(function(e){return e.split(/\s+/)}),r=U.from(o.className).map(function(e){return j(e.split(/\s+/),function(e){return""!==e})});as(n,r,function(t,e){var n=j(e,function(e){return!I(t,e)}),r=Se(t,n);i.setAttrib(o,"class",r.join(" "))});var a=["style","class"],u=le(t,function(e,t){return!I(a,t)});i.setAttribs(o,u)}(e,t,dc(e))},Yx=function(a,e){var t,u,i,s,n,r,o,c,l,f=a.dom,d=a.schema,m=d.getNonEmptyElements(),p=a.selection.getRng(),g=function(e){var t,n=u,r=d.getTextInlineElements(),o=e||"TABLE"===c||"HR"===c?f.create(e||N):s.cloneNode(!1),i=o;if(!1===a.getParam("keep_styles",!0))f.setAttrib(o,"style",null),f.setAttrib(o,"class",null);else do{if(r[n.nodeName]){if(Ll(n)||$l(n))continue;t=n.cloneNode(!1),f.setAttrib(t,"id",""),o.hasChildNodes()?t.appendChild(o.firstChild):i=t,o.appendChild(t)}}while((n=n.parentNode)&&n!==E);return Xx(a,o),Vx(i),o},h=function(e){var t,n,r=Wx(e,u,i);if(On(u)&&(e?0u.childNodes.length-1,u=u.childNodes[Math.min(i,u.childNodes.length-1)]||u,i=l&&On(u)?u.nodeValue.length:0);var C,w,x,S,N,E=Kx(f,u);E&&((N&&!y||!N&&y)&&(u=function(e,t,n,r,o){var i,a,u,s,c,l,f=t||"P",d=e.dom,m=Kx(d,r),p=d.getParent(r,d.isBlock);if(!p||!$x(d,p)){if(c=(p=p||m)===e.getBody()||(l=p)&&/^(TD|TH|CAPTION)$/.test(l.nodeName)?p.nodeName.toLowerCase():p.parentNode.nodeName.toLowerCase(),!p.hasChildNodes())return i=d.create(f),Xx(e,i),p.appendChild(i),n.setStart(i,0),n.setEnd(i,0),i;for(u=r;u.parentNode!==p;)u=u.parentNode;for(;u&&!d.isBlock(u);)u=(a=u).previousSibling;if(a&&e.schema.isValidChild(c,f.toLowerCase())){for(i=d.create(f),Xx(e,i),a.parentNode.insertBefore(i,a),u=a;u&&!d.isBlock(u);)s=u.nextSibling,i.appendChild(u),u=s;n.setStart(r,o),n.setEnd(r,o)}}return r}(a,N,p,u,i)),s=f.getParent(u,f.isBlock),o=s?f.getParent(s.parentNode,f.isBlock):null,c=s?s.nodeName.toUpperCase():"","LI"!==(C=o?o.nodeName.toUpperCase():"")||b||(o=(s=o).parentNode,c=C),/^(LI|DT|DD)$/.test(c)&&f.isEmpty(s)?Hx(a,g,o,s,N):N&&s===a.getBody()||(N=N||"P",lo(s)?(n=Co(s),f.isEmpty(s)&&Vx(s),Xx(a,n),Ix(a,n)):h()?v():h(!0)?(n=s.parentNode.insertBefore(g(),s),Ix(a,qx(s,"HR")?n:s)):((S=(x=p).cloneRange()).setStart(x.startContainer,Wx(!0,x.startContainer,x.startOffset)),S.setEnd(x.endContainer,Wx(!1,x.endContainer,x.endOffset)),(t=S.cloneRange()).setEndAfter(s),r=t.extractContents(),w=r,$(Vu(Nt.fromDom(w),Lt),function(e){var t=e.dom;t.nodeValue=uo(t.nodeValue)}),function(e){for(;On(e)&&(e.nodeValue=e.nodeValue.replace(/^[\r\n]+/,"")),e=e.firstChild;);}(r),n=r.firstChild,f.insertAfter(r,s),function(e,t,n){var r,o,i,a=n,u=[];if(a){for(;a=a.firstChild;){if(e.isBlock(a))return;Nn(a)&&!t[a.nodeName.toLowerCase()]&&u.push(a)}for(r=u.length;r--;)!(a=u[r]).hasChildNodes()||a.firstChild===a.lastChild&&""===a.firstChild.nodeValue?e.remove(a):(o=e,(i=a)&&"A"===i.nodeName&&o.isEmpty(i)&&e.remove(a))}}(f,m,n),function(e,t){t.normalize();var n=t.lastChild;n&&!/^(left|right)$/gi.test(e.getStyle(n,"float",!0))||e.add(t,"br")}(f,s),f.isEmpty(s)&&Vx(s),n.normalize(),f.isEmpty(n)?(f.remove(n),v()):(Xx(a,n),Ix(a,n))),f.setAttrib(n,"id",""),a.fire("NewBlock",{newBlock:n})))},Gx=function(e,t,n){var r=e.create("span",{}," ");n.parentNode.insertBefore(r,n),t.scrollIntoView(r),e.remove(r)},Jx=function(e,t,n,r){var o=e.createRng();r?(o.setStartBefore(n),o.setEndBefore(n)):(o.setStartAfter(n),o.setEndAfter(n)),t.setRng(o)},Qx=function(e,t){var n,r,o=e.selection,i=e.dom,a=o.getRng();ud(i,a).each(function(e){a.setStart(e.startContainer,e.startOffset),a.setEnd(e.endContainer,e.endOffset)});var u,s=a.startOffset,c=a.startContainer;1===c.nodeType&&c.hasChildNodes()&&(u=s>c.childNodes.length-1,c=c.childNodes[Math.min(s,c.childNodes.length-1)]||c,s=u&&3===c.nodeType?c.nodeValue.length:0);var l=i.getParent(c,i.isBlock),f=l?i.getParent(l.parentNode,i.isBlock):null,d=f?f.nodeName.toUpperCase():"",m=!(!t||!t.ctrlKey);"LI"!==d||m||(l=f),c&&3===c.nodeType&&s>=c.nodeValue.length&&!function(e,t,n){for(var r,o=new Hr(t,n),i=e.getNonEmptyElements();r=o.next();)if(i[r.nodeName.toLowerCase()]||0a&&(s=r.pageX+o-a),r.pageY+i>u&&(c=r.pageY+i-u),n.style.width=o-s+"px",n.style.height=i-c+"px",v(g.clientX,g.clientY))})}},VS=function(e,l){return function(c){e.on(function(e){var t,n,r,o,i,a,u,s;e.dragging&&(u=(o=l).selection,s=u.getSel().getRangeAt(0).startContainer,i=3===s.nodeType?s.parentNode:s,a=e.element,i===a||o.dom.isChildOf(i,a)||FS(i)||(n=e.element,(r=n.cloneNode(!0)).removeAttribute("data-mce-selected"),t=r,l.fire("drop",{clientX:c.clientX,clientY:c.clientY}).isDefaultPrevented()||l.undoManager.transact(function(){zS(e.element),l.insertContent(l.dom.getOuterHTML(t)),l._selectionOverrides.hideFakeCaret()})))}),qS(e)}},qS=function(e){e.on(function(e){zS(e.ghost)}),e.clear()},$S=function(e){var t,n,r,o=(t=ku(U.none()),{clear:function(){return t.set(U.none())},set:function(e){return t.set(U.some(e))},isSet:function(){return t.get().isSome()},on:function(e){return t.get().each(e)}}),i=bu.DOM,a=document,u=jS(o,e),s=HS(o,e),c=VS(o,e),l=(n=o,function(){n.on(function(e){e.dragging&&r.fire("dragend")}),qS(n)});(r=e).on("mousedown",u),e.on("mousemove",s),e.on("mouseup",c),i.bind(a,"mousemove",s),i.bind(a,"mouseup",l),e.on("remove",function(){i.unbind(a,"mousemove",s),i.unbind(a,"mouseup",l)})},WS=function(e){var n,i,a,u,t;$S(e),(n=e).on("drop",function(e){var t="undefined"!=typeof e.clientX?n.getDoc().elementFromPoint(e.clientX,e.clientY):null;!FS(t)&&"false"!==n.dom.getContentEditableParent(t)||e.preventDefault()}),e.getParam("block_unsupported_drop",!0,"boolean")&&(a=function(e){var t;e.defaultPrevented||(t=e.dataTransfer)&&(I(t.types,"Files")||0').attr("id",p)).appendTo(u.getBody());var i=l.createRng();t===n&&vt.ie?(o.empty().append('

    \xa0

    ').append(t),i.setStartAfter(o[0].firstChild.firstChild),i.setEndAfter(t)):(o.empty().append(oo).append(t).append(oo),i.setStart(o[0].firstChild,1),i.setEnd(o[0].lastChild,0)),o.css({top:l.getPos(e,u.getBody()).y}),o[0].focus();var a=c.getSel();return a.removeAllRanges(),a.addRange(i),i}(e,n.targetClone,t),o=Nt.fromDom(e);return $(qu(Nt.fromDom(u.getBody()),"*[data-mce-selected]"),function(e){Rt(o,e)||Kn(e,i)}),l.getAttrib(e,i)||e.setAttribute(i,"1"),s=e,S(),r},w=function(e,t){if(!e)return null;if(e.collapsed){if(!y(e)){var n=t?1:-1,r=al(n,d,e),o=r.getNode(!t);if(jc(o))return v(n,o,!!t&&!r.isAtEnd(),!1);var i=r.getNode(t);if(jc(i))return v(n,i,!t&&!r.isAtEnd(),!1)}return null}var a=e.startContainer,u=e.startOffset,s=e.endOffset;if(3===a.nodeType&&0===u&&XS(a.parentNode)&&(a=a.parentNode,u=l.nodeIndex(a),a=a.parentNode),1!==a.nodeType)return null;if(s===u+1&&a===e.endContainer){var c=a.childNodes[u];if(g(c))return C(c)}return null},x=function(){s&&s.removeAttribute(i),Er(Nt.fromDom(u.getBody()),"#"+p).each(ln),s=null},S=function(){m.hide()};return vt.ceFalse&&function(){u.on("mouseup",function(e){var t=r();t.collapsed&&Ly(u,e.clientX,e.clientY)&&Wb(u,t,!1).each(h)}),u.on("click",function(e){var t=YS(u,e.target);t&&(XS(t)&&(e.preventDefault(),u.focus()),KS(t)&&l.isChildOf(t,c.getNode())&&x())}),u.on("blur NewBlock",x),u.on("ResizeWindow FullscreenStateChanged",m.reposition);var a=function(e){var t=wl(e);if(!e.firstChild)return!1;var n,r=Us.before(e.firstChild),o=t.next(r);return o&&!(ep(n=o)||tp(n)||Gm(n)||Jm(n))},i=function(e,t){var n,r,o=l.getParent(e,f),i=l.getParent(t,f);return!(!o||e===i||!l.isChildOf(o,i)||!1!==XS(YS(u,o)))||o&&(n=o,r=i,!(l.getParent(n,f)===l.getParent(r,f)))&&a(o)};u.on("tap",function(e){var t=e.target,n=YS(u,t);XS(n)?(e.preventDefault(),$b(u,n).each(w)):g(t)&&$b(u,t).each(w)},!0),u.on("mousedown",function(e){var t,n,r,o=e.target;o!==d&&"HTML"!==o.nodeName&&!l.isChildOf(o,d)||!1===Ly(u,e.clientX,e.clientY)||((t=YS(u,o))?XS(t)?(e.preventDefault(),$b(u,t).each(w)):(x(),KS(t)&&e.shiftKey||Yf(e.clientX,e.clientY,c.getRng())||(S(),c.placeCaretAt(e.clientX,e.clientY))):g(o)?$b(u,o).each(w):!1===jc(o)&&(x(),S(),(n=$w(d,e.clientX,e.clientY))&&(i(o,n.node)||(e.preventDefault(),r=v(1,n.node,n.before,!1),u.getBody().focus(),h(r)))))}),u.on("keypress",function(e){Gf.modifierPressed(e)||XS(c.getNode())&&e.preventDefault()}),u.on("GetSelectionRange",function(e){var t=e.range;if(s){if(!s.parentNode)return void(s=null);(t=t.cloneRange()).selectNode(s),e.range=t}}),u.on("SetSelectionRange",function(e){e.range=b(e.range);var t=w(e.range,e.forward);t&&(e.range=t)});var n,e,o;u.on("AfterSetSelectionRange",function(e){var t,n=e.range,r=n.startContainer.parentNode;y(n)||"mcepastebin"===r.id||S(),t=r,l.hasClass(t,"mce-offscreen-selection")||x()}),u.on("copy",function(e){var t,n,r=e.clipboardData;e.isDefaultPrevented()||!e.clipboardData||vt.ie||(t=(n=l.get(p))?n.getElementsByTagName("*")[0]:n)&&(e.preventDefault(),r.clearData(),r.setData("text/html",t.outerHTML),r.setData("text/plain",t.outerText||t.innerText))}),WS(u),e=Pu(function(){var e,t;n.removed||!n.getBody().contains(document.activeElement)||(e=n.selection.getRng()).collapsed&&(t=Kb(n,e,!1),n.selection.setRng(t))},0),(n=u).on("focus",function(){e.throttle()}),n.on("blur",function(){e.cancel()}),(o=u).on("init",function(){o.on("focusin",function(e){var t,n,r=e.target;jn(r)&&(t=Xf(o.getBody(),r),n=Un(t)?t:r,o.selection.getNode()!==n&&$b(o,n).each(function(e){return o.selection.setRng(e)}))})})}(),{showCaret:v,showBlockCaretContainer:function(e){e.hasAttribute("data-mce-caret")&&(Co(e),h(r()),c.scrollIntoView(e))},hideFakeCaret:S,destroy:function(){m.destroy(),s=null}}},JS=function(u){var s,n,r,o=xt.each,c=Gf.BACKSPACE,l=Gf.DELETE,f=u.dom,d=u.selection,e=u.parser,t=vt.gecko,i=vt.ie,a=vt.webkit,m="data:text/mce-internal,",p=i?"Text":"URL",g=function(e,t){try{u.getDoc().execCommand(e,!1,t)}catch(n){}},h=function(e){return e.isDefaultPrevented()},v=function(){u.shortcuts.add("meta+a",null,"SelectAll")},y=function(){u.on("keydown",function(e){if(!h(e)&&e.keyCode===c&&d.isCollapsed()&&0===d.getRng().startOffset){var t=d.getNode().previousSibling;if(t&&t.nodeName&&"table"===t.nodeName.toLowerCase())return e.preventDefault(),!1}})},b=function(){u.inline||(u.contentStyles.push("body {min-height: 150px}"),u.on("click",function(e){var t;if("HTML"===e.target.nodeName){if(11")+"";e.getParam("document_base_url","")!==e.documentBaseUrl&&(t+=''),t+='';var n=cc(e,"body_id","tinymce"),r=cc(e,"body_class","");return lc(e)&&(t+=''),t+='
    '},uN=function(e,t){var n,r,o,i,a=e.editorManager.translate("Rich Text Area. Press ALT-0 for help."),u=(n=e.id,r=a,t.height,o=e.getParam("iframe_attrs",{}),i=Nt.fromTag("iframe"),$n(i,o),$n(i,{id:n+"_ifr",frameBorder:"0",allowTransparency:"true",title:r}),zu(i,"tox-edit-area__iframe"),i.dom);u.onload=function(){u.onload=null,e.fire("load")};var s=function(e,t){if(document.domain!==window.location.hostname&&vt.browser.isIE()){var n=Gy("mce");e[n]=function(){oN(e)};var r='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinymce.get("'+e.id+'");document.write(ed.iframeHTML);document.close();ed.'+n+"(true);})()";return iN.setAttrib(t,"src",r),!0}return!1}(e,u);return e.contentAreaContainer=t.iframeContainer,e.iframeElement=u,e.iframeHTML=aN(e),iN.add(t.iframeContainer,u),s},sN=bu.DOM,cN=function(t,n,e){var r=Fy.get(e),o=Fy.urls[e]||t.documentBaseUrl.replace(/\/$/,"");if(e=xt.trim(e),r&&-1===xt.inArray(n,e)){if(xt.each(Fy.dependencies(e),function(e){cN(t,n,e)}),t.plugins[e])return;try{var i=new r(t,o,t.$);(t.plugins[e]=i).init&&(i.init(t,o),n.push(e))}catch(pk){!function(e,t,n){var r=Au.translate(["Failed to initialize plugin: {0}",t]);Wy(r,n),Hy(e,r)}(t,e,pk)}}},lN=function(e){return e.replace(/^\-/,"")},fN=function(e){return{editorContainer:e,iframeContainer:e,api:{}}},dN=function(e){var t,n,r=e.getElement();return e.inline?fN(null):(t=r,n=sN.create("div"),sN.insertAfter(n,t),fN(n))},mN=function(e){var t,n,r,o=e.getElement();return e.orgDisplay=o.style.display,q(Cc(e))?e.theme.renderUI():A(Cc(e))?(n=(t=e).getElement(),(r=Cc(t)(t,n)).editorContainer.nodeType&&(r.editorContainer.id=r.editorContainer.id||t.id+"_parent"),r.iframeContainer&&r.iframeContainer.nodeType&&(r.iframeContainer.id=r.iframeContainer.id||t.id+"_iframecontainer"),r.height=r.iframeHeight?r.iframeHeight:n.offsetHeight,r):dN(e)},pN=function(e){var n,t,r,o,i,a,u,s,c;e.fire("ScriptsLoaded"),n=e,t=xt.trim(pc(n)),r=n.ui.registry.getAll().icons,o=xe(xe({},Ry.get("default").icons),Ry.get(t).icons),oe(o,function(e,t){me(r,t)||n.ui.registry.addIcon(t,e)}),u=Cc(i=e),q(u)?(i.settings.theme=lN(u),a=Uy.get(u),i.theme=new a(i,Uy.urls[u]),i.theme.init&&i.theme.init(i,Uy.urls[u]||i.documentBaseUrl.replace(/\/$/,""),i.$)):i.theme={},s=e,c=[],xt.each(xc(s).split(/[ ,]/),function(e){cN(s,c,lN(e))});var l=mN(e);e.ui=xe(xe({},e.ui),l.api);var f,d,m,p,g={editorContainer:l.editorContainer,iframeContainer:l.iframeContainer};return e.editorContainer=g.editorContainer?g.editorContainer:null,(f=e).contentCSS=f.contentCSS.concat(Ky(f)),e.inline?oN(e):(p=uN(d=e,m=g),m.editorContainer&&(iN.get(m.editorContainer).style.display=d.orgDisplay,d.hidden=iN.isHidden(m.editorContainer)),d.getElement().style.display="none",iN.setAttrib(d.id,"aria-hidden","true"),void(p||oN(d)))},gN=bu.DOM,hN=function(e){return"-"===e.charAt(0)},vN=function(e,t){var n,r=hc(t),o=t.getParam("language_url","","string");!1===Au.hasCode(r)&&"en"!==r&&(n=""!==o?o:t.editorManager.baseURL+"/langs/"+r+".js",e.add(n,V,undefined,function(){Vy(t,"LanguageLoadError",qy("language",n,r))}))},yN=function(t,e,n){return U.from(e).filter(function(e){return 0")},mceToggleVisualAid:function(){i.hasVisual=!i.hasVisual,i.addVisual()},mceReplaceContent:function(e,t,n){i.execCommand("mceInsertContent",!1,n.replace(/\{\$selection\}/g,i.selection.getContent({format:"text"})))},mceInsertLink:function(e,t,n){"string"==typeof n&&(n={href:n});var r=i.dom.getParent(i.selection.getNode(),"a");n.href=n.href.replace(/ /g,"%20"),r&&n.href||i.formatter.remove("link"),n.href&&i.formatter.apply("link",n,r)},selectAll:function(){var e,t=i.dom.getParent(i.selection.getStart(),Fn);t&&((e=i.dom.createRng()).selectNodeContents(t),i.selection.setRng(e))},mceNewDocument:function(){i.setContent("")},InsertLineBreak:function(e,t,n){return iS(i,n),!0}});var e=function(r){return function(){var e=i.selection,t=e.isCollapsed()?[i.dom.getParent(e.getNode(),i.dom.isBlock)]:e.getSelectedBlocks(),n=LN(t,function(e){return!!i.formatter.matchNode(e,r)});return-1!==IN(n,!0)}};a.addCommands({JustifyLeft:e("alignleft"),JustifyCenter:e("aligncenter"),JustifyRight:e("alignright"),JustifyFull:e("alignjustify"),"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(e){return a.isFormatMatch(e)},mceBlockQuote:function(){return a.isFormatMatch("blockquote")},Outdent:function(){return aw(i)},"InsertUnorderedList,InsertOrderedList":function(e){var t=i.dom.getParent(i.selection.getNode(),"ul,ol");return t&&("insertunorderedlist"===e&&"UL"===t.tagName||"insertorderedlist"===e&&"OL"===t.tagName)}},"state"),a.addCommands({Undo:function(){i.undoManager.undo()},Redo:function(){i.undoManager.redo()}}),a.addQueryValueHandler("FontName",function(){return AN(t=i,function(e){return RN(t.getBody(),e.dom)}).getOr("");var t},this),a.addQueryValueHandler("FontSize",function(){return AN(t=i,function(e){return _N(t.getBody(),e.dom)}).getOr("");var t},this),a.addQueryValueHandler("LineHeight",function(){return AN(t=i,function(n){var e=Nt.fromDom(t.getBody());return SN(n,function(e){return Jn(e,"line-height")},E(Rt,e)).getOrThunk(function(){var e=parseFloat(Yn(n,"line-height")),t=parseFloat(Yn(n,"font-size"));return String(e/t)})}).getOr("");var t},this)},FN);function FN(e){this.commands={state:{},exec:{},value:{}},this.editor=e,this.setupCommands(e)}var UN="data-mce-contenteditable",zN=function(e,t,n){var r,o;Hu(e,t)&&!1===n?(o=t,Mu(r=e)?r.dom.classList.remove(o):Uu(r,o),ju(r)):n&&zu(e,t)},jN=function(e,t,n){try{e.getDoc().execCommand(t,!1,String(n))}catch(r){}},HN=function(e,t){e.dom.contentEditable=t?"true":"false"},VN=function(e,t){var n,r,o,i=Nt.fromDom(e.getBody());zN(i,"mce-content-readonly",t),t?(e.selection.controlSelection.hideResizeRect(),e._selectionOverrides.hideFakeCaret(),o=e,U.from(o.selection.getNode()).each(function(e){e.removeAttribute("data-mce-selected")}),e.readonly=!0,HN(i,!1),$(qu(i,'*[contenteditable="true"]'),function(e){qn(e,UN,"true"),HN(e,!1)})):(e.readonly=!1,HN(i,!0),$(qu(i,"*["+UN+'="true"]'),function(e){Kn(e,UN),HN(e,!0)}),jN(e,"StyleWithCSS",!1),jN(e,"enableInlineTableEditing",!1),jN(e,"enableObjectResizing",!1),(pm(r=e)||mm(r))&&e.focus(),(n=e).selection.setRng(n.selection.getRng()),e.nodeChanged())},qN=function(e){return e.readonly},$N=function(t){t.parser.addAttributeFilter("contenteditable",function(e){qN(t)&&$(e,function(e){e.attr(UN,e.attr("contenteditable")),e.attr("contenteditable","false")})}),t.serializer.addAttributeFilter(UN,function(e){qN(t)&&$(e,function(e){e.attr("contenteditable",e.attr(UN))})}),t.serializer.addTempAttr(UN)},WN=xt.makeMap("focus blur focusin focusout click dblclick mousedown mouseup mousemove mouseover beforepaste paste cut copy selectionchange mouseout mouseenter mouseleave wheel keydown keypress keyup input beforeinput contextmenu dragstart dragend dragover draggesture dragdrop drop drag submit compositionstart compositionend compositionupdate touchstart touchmove touchend touchcancel"," "),KN=(XN.isNative=function(e){return!!WN[e.toLowerCase()]},XN.prototype.fire=function(e,t){var n=e.toLowerCase(),r=t||{};r.type=n,r.target||(r.target=this.scope),r.preventDefault||(r.preventDefault=function(){r.isDefaultPrevented=k},r.stopPropagation=function(){r.isPropagationStopped=k},r.stopImmediatePropagation=function(){r.isImmediatePropagationStopped=k},r.isDefaultPrevented=p,r.isPropagationStopped=p,r.isImmediatePropagationStopped=p),this.settings.beforeFire&&this.settings.beforeFire(r);var o=this.bindings[n];if(o)for(var i=0,a=o.length;i"),this.parseShortcut);return o[o.length-1]=xt.extend(o[o.length-1],{func:n,scope:r||this.editor}),xt.extend(o[0],{desc:this.editor.translate(t),subpatterns:o.slice(1)})},fE.prototype.hasModifier=function(e){return e.altKey||e.ctrlKey||e.metaKey},fE.prototype.isFunctionKey=function(e){return"keydown"===e.type&&112<=e.keyCode&&e.keyCode<=123},fE.prototype.matchShortcut=function(e,t){return!!t&&t.ctrl===e.ctrlKey&&t.meta===e.metaKey&&t.alt===e.altKey&&t.shift===e.shiftKey&&!!(e.keyCode===t.keyCode||e.charCode&&e.charCode===t.charCode)&&(e.preventDefault(),!0)},fE.prototype.executeShortcutAction=function(e){return e.func?e.func.call(e.scope):null},fE);function fE(e){this.shortcuts={},this.pendingPatterns=[],this.editor=e;var n=this;e.on("keyup keypress keydown",function(t){!n.hasModifier(t)&&!n.isFunctionKey(t)||t.isDefaultPrevented()||(aE(n.shortcuts,function(e){if(n.matchShortcut(t,e))return n.pendingPatterns=e.subpatterns.slice(0),"keydown"===t.type&&n.executeShortcutAction(e),!0}),n.matchShortcut(t,n.pendingPatterns[0])&&(1===n.pendingPatterns.length&&"keydown"===t.type&&n.executeShortcutAction(n.pendingPatterns[0]),n.pendingPatterns.shift()))})}var dE=function(){var e,t,n,r,o,i,a,u,s=(t={},n={},r={},o={},i={},a={},{addButton:(u=function(n,r){return function(e,t){return n[e.toLowerCase()]=xe(xe({},t),{type:r})}})(e={},"button"),addGroupToolbarButton:u(e,"grouptoolbarbutton"),addToggleButton:u(e,"togglebutton"),addMenuButton:u(e,"menubutton"),addSplitButton:u(e,"splitbutton"),addMenuItem:u(t,"menuitem"),addNestedMenuItem:u(t,"nestedmenuitem"),addToggleMenuItem:u(t,"togglemenuitem"),addAutocompleter:u(n,"autocompleter"),addContextMenu:u(o,"contextmenu"),addContextToolbar:u(i,"contexttoolbar"),addContextForm:u(i,"contextform"),addSidebar:u(a,"sidebar"),addIcon:function(e,t){return r[e.toLowerCase()]=t},getAll:function(){return{buttons:e,menuItems:t,icons:r,popups:n,contextMenus:o,contextToolbars:i,sidebars:a}}});return{addAutocompleter:s.addAutocompleter,addButton:s.addButton,addContextForm:s.addContextForm,addContextMenu:s.addContextMenu,addContextToolbar:s.addContextToolbar,addIcon:s.addIcon,addMenuButton:s.addMenuButton,addMenuItem:s.addMenuItem,addNestedMenuItem:s.addNestedMenuItem,addSidebar:s.addSidebar,addSplitButton:s.addSplitButton,addToggleButton:s.addToggleButton,addGroupToolbarButton:s.addGroupToolbarButton,addToggleMenuItem:s.addToggleMenuItem,getAll:s.getAll}},mE=xt.each,pE=xt.trim,gE="source protocol authority userInfo user password host port relative path directory file query anchor".split(" "),hE={ftp:21,http:80,https:443,mailto:25},vE=(yE.parseDataUri=function(e){var t,n=decodeURIComponent(e).split(","),r=/data:([^;]+)/.exec(n[0]);return r&&(t=r[1]),{type:t,data:n[1]}},yE.getDocumentBaseUrl=function(e){var t=0!==e.protocol.indexOf("http")&&"file:"!==e.protocol?e.href:e.protocol+"//"+e.host+e.pathname;return/^[^:]+:\/\/\/?[^\/]+\//.test(t)&&(t=t.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,""),/[\/\\]$/.test(t)||(t+="/")),t},yE.prototype.setPath=function(e){var t=/^(.*?)\/?(\w+)?$/.exec(e);this.path=t[0],this.directory=t[1],this.file=t[2],this.source="",this.getURI()},yE.prototype.toRelative=function(e){var t;if("./"===e)return e;var n=new yE(e,{base_uri:this});if("mce_host"!==n.host&&this.host!==n.host&&n.host||this.port!==n.port||this.protocol!==n.protocol&&""!==n.protocol)return n.getURI();var r=this.getURI(),o=n.getURI();return r===o||"/"===r.charAt(r.length-1)&&r.substr(0,r.length-1)===o?r:(t=this.toRelPath(this.path,n.path),n.query&&(t+="?"+n.query),n.anchor&&(t+="#"+n.anchor),t)},yE.prototype.toAbsolute=function(e,t){var n=new yE(e,{base_uri:this});return n.getURI(t&&this.isSameOrigin(n))},yE.prototype.isSameOrigin=function(e){if(this.host==e.host&&this.protocol==e.protocol){if(this.port==e.port)return!0;var t=hE[this.protocol];if(t&&(this.port||t)==(e.port||t))return!0}return!1},yE.prototype.toRelPath=function(e,t){var n,r,o=0,i="",a=e.substring(0,e.lastIndexOf("/")).split("/"),u=t.split("/");if(a.length>=u.length)for(n=0,r=a.length;n=u.length||a[n]!==u[n]){o=n+1;break}if(a.length=a.length||a[n]!==u[n]){o=n+1;break}if(1===o)return t;for(n=0,r=a.length-(o-1);n=n.x&&o.x+o.w<=n.w+n.x&&o.y>=n.y&&o.y+o.h<=n.h+n.y)return r[i];return null},intersect:function(e,t){var n=$E(e.x,t.x),r=$E(e.y,t.y),o=qE(e.x+e.w,t.x+t.w),i=qE(e.y+e.h,t.y+t.h);return o-n<0||i-r<0?null:XE(n,r,o-n,i-r)},clamp:function(e,t,n){var r=e.x,o=e.y,i=e.x+e.w,a=e.y+e.h,u=t.x+t.w,s=t.y+t.h,c=$E(0,t.x-r),l=$E(0,t.y-o),f=$E(0,i-u),d=$E(0,a-s);return r+=c,o+=l,n&&(i+=c,a+=l,r-=f,o-=d),XE(r,o,(i-=f)-r,(a-=d)-o)},create:XE,fromClientRect:function(e){return XE(e.left,e.top,e.width,e.height)}},GE=(zE={},jE={},{load:function(r,o){var i='Script at URL "'+o+'" failed to load',a='Script at URL "'+o+"\" did not call `tinymce.Resource.add('"+r+"', data)` within 1 second";if(zE[r]!==undefined)return zE[r];var e=new _r(function(e,t){var n=function(e,t,n){void 0===n&&(n=1e3);var r=!1,o=null,i=function(n){return function(){for(var e=[],t=0;t visualEditorStub); - const { data } = this.descriptor.save(); - expect(data).toEqual('from visual editor'); + + // It takes a while for the TinyMCE V5.x to initialize, so let's wait until the + // starting_content becomes available before we test the save() method. + // Save referece to `this` on self to pass `descriptor` to `waintUntil` closure + var self = this; + jasmine.waitUntil(function() { + return !!self.descriptor.starting_content; + }, 10000).then(function() { + const { data } = self.descriptor.save(); + expect(data).toEqual('from visual editor'); + }).always(done); }); - it('Returns data from Raw Editor if text has not changed', function() { + it('Returns data from Raw Editor if text has not changed', function(done) { const visualEditorStub = - {getContent() { return '

    original visual text

    '; }}; + {getContent() { return 'original visual text' }}; spyOn(this.descriptor, 'getVisualEditor').and.callFake(() => visualEditorStub); - const { data } = this.descriptor.save(); - expect(data).toEqual('raw text'); + + var self = this; + jasmine.waitUntil(function() { + return !!self.descriptor.starting_content; + }, 10000).then(function() { + const { data } = self.descriptor.save(); + expect(data).toEqual('raw text'); + }).always(done); }); - it('Performs link rewriting for static assets when saving', function() { + it('Performs link rewriting for static assets when saving', function(done) { const visualEditorStub = {getContent() { return 'from visual editor with /c4x/foo/bar/asset/image.jpg'; }}; spyOn(this.descriptor, 'getVisualEditor').and.callFake(() => visualEditorStub); - const { data } = this.descriptor.save(); - expect(data).toEqual('from visual editor with /static/image.jpg'); + + var self = this; + jasmine.waitUntil(function() { + return !!self.descriptor.starting_content; + }, 10000).then(function() { + const { data } = self.descriptor.save(); + expect(data).toEqual('from visual editor with /static/image.jpg'); + }).always(done); + }); it('When showing visual editor links are rewritten to c4x format', function() { const visualEditorStub = { diff --git a/xmodule/js/src/html/edit.js b/xmodule/js/src/html/edit.js index 33accebc07c3..80bbb2a0c25b 100644 --- a/xmodule/js/src/html/edit.js +++ b/xmodule/js/src/html/edit.js @@ -99,8 +99,7 @@ var tinyMceConfig = { script_url: baseUrl + "js/vendor/tinymce/js/tinymce/tinymce.full.min.js", font_formats: _getFonts(), - theme: "modern", - skin: 'studio-tmce4', + theme: "silver", schema: "html5", entity_encoding: "raw", @@ -125,9 +124,12 @@ Disable visual aid on borderless table. */ visual: false, - plugins: "textcolor, link, image, codemirror", + plugins: "textcolor,link,image,codemirror", codemirror: { - path: baseUrl + "js/vendor" + path: baseUrl + "js/vendor", + disableFilesMerge: true, + jsFiles: ["codemirror-compressed.js"], + cssFiles: ["CodeMirror/codemirror.css"] }, image_advtab: true, @@ -149,7 +151,7 @@ heading6: gettext("Heading 6") }), width: '100%', - height: '400px', + height: '435px', menubar: false, statusbar: false, @@ -1233,25 +1235,25 @@ } HTMLEditingDescriptor.prototype.setupTinyMCE = function(ed) { - ed.addButton('wrapAsCode', { + ed.ui.registry.addButton('wrapAsCode', { /* Translators: this is a toolbar button tooltip from the raw HTML editor displayed in the browser when a user needs to edit HTML */ - title: gettext('Code block'), + tooltip: gettext('Code block'), image: baseUrl + "images/ico-tinymce-code.png", - onclick: function() { + onAction: function() { return ed.formatter.toggle('code'); } }); - ed.addButton('insertImage', { + ed.ui.registry.addButton('insertImage', { /* Translators: this is a toolbar button tooltip from the raw HTML editor displayed in the browser when a user needs to edit HTML */ - title: gettext('Insert/Edit Image'), + tooltip: gettext('Insert/Edit Image'), icon: 'image', - onclick: this.openImageModal + onAction: this.openImageModal }); this.visualEditor = ed; this.imageModal = $('#edit-image-modal #modalWrapper'); @@ -1266,7 +1268,7 @@ ed.on('EditLink', this.editLink); ed.on('ShowCodeEditor', this.showCodeEditor); ed.on('SaveCodeEditor', this.saveCodeEditor); - $(".action-cancel").on('click', this.cancelButton) + $(".action-cancel").on('click', this.cancelButton); this.imageModal.on('closeModal', this.closeImageModal); return this.imageModal.on('submitForm', this.editImageSubmit); @@ -1386,7 +1388,7 @@ haven't dirtied the Editor. Store the raw content so we can compare it later. */ this.starting_content = visualEditor.getContent({ - format: "raw", + format: "text", no_events: 1 }); return visualEditor.focus(); @@ -1406,7 +1408,7 @@ if (this.editor_choice === 'visual') { visualEditor = this.getVisualEditor(); raw_content = visualEditor.getContent({ - format: "raw", + format: "text", no_events: 1 }); if (this.starting_content !== raw_content) { From 9f0037c532e1ba24f577eb477f5ed4e2bca918b0 Mon Sep 17 00:00:00 2001 From: DubeySandeep Date: Sat, 30 Apr 2022 04:03:59 +0530 Subject: [PATCH 02/14] feat: adds new skin studio-tmce5 similar to studio-tmce4 --- cms/envs/common.py | 4 +- .../maintenance/_announcement_edit.html | 4 +- common/static/images/ico-tinymce-code.png | Bin 217 -> 0 bytes .../js/tinymce/plugins/codemirror/source.html | 17 +- .../js/tinymce/skins/content/dark/content.css | 72 - .../skins/content/dark/content.min.css | 8 - .../skins/content/dark/content.min.css.map | 1 - .../tinymce/skins/content/default/content.css | 67 - .../skins/content/default/content.min.css | 8 - .../skins/content/default/content.min.css.map | 1 - .../skins/content/document/content.css | 72 - .../skins/content/document/content.min.css | 8 - .../content/document/content.min.css.map | 1 - .../skins/content/studio-tmce5/content.css | 49 + .../content/studio-tmce5/content.min.css | 7 + .../tinymce/skins/content/writer/content.css | 68 - .../skins/content/writer/content.min.css | 8 - .../skins/content/writer/content.min.css.map | 1 - .../tinymce/js/tinymce/skins/skintool.json | 39 + .../tinymce/skins/ui/oxide-dark/content.css | 710 ---- .../ui/oxide-dark/content.inline.min.css | 8 - .../ui/oxide-dark/content.inline.min.css.map | 1 - .../skins/ui/oxide-dark/content.min.css | 8 - .../skins/ui/oxide-dark/content.min.css.map | 1 - .../ui/oxide-dark/content.mobile.min.css | 8 - .../ui/oxide-dark/content.mobile.min.css.map | 1 - .../js/tinymce/skins/ui/oxide-dark/skin.css | 2972 ----------------- .../tinymce/skins/ui/oxide-dark/skin.min.css | 8 - .../skins/ui/oxide-dark/skin.min.css.map | 1 - .../skins/ui/oxide-dark/skin.mobile.css | 673 ---- .../ui/oxide-dark/skin.mobile.min.css.map | 1 - .../js/tinymce/skins/ui/oxide/content.css | 728 ---- .../skins/ui/oxide/content.inline.min.css | 8 - .../skins/ui/oxide/content.inline.min.css.map | 1 - .../js/tinymce/skins/ui/oxide/content.min.css | 8 - .../skins/ui/oxide/content.min.css.map | 1 - .../tinymce/skins/ui/oxide/content.mobile.css | 29 - .../skins/ui/oxide/content.mobile.min.css | 8 - .../skins/ui/oxide/content.mobile.min.css.map | 1 - .../skins/ui/oxide/fonts/tinymce-mobile.woff | Bin 4624 -> 0 bytes .../js/tinymce/skins/ui/oxide/skin.min.css | 8 - .../tinymce/skins/ui/oxide/skin.min.css.map | 1 - .../skins/ui/oxide/skin.mobile.min.css | 8 - .../skins/ui/oxide/skin.mobile.min.css.map | 1 - .../ui/studio-tmce4/content.inline.min.css | 1 - .../skins/ui/studio-tmce4/content.min.css | 2 - .../ui/studio-tmce4/fonts/icomoon-small.eot | Bin 8344 -> 0 bytes .../ui/studio-tmce4/fonts/icomoon-small.svg | 175 - .../ui/studio-tmce4/fonts/icomoon-small.ttf | Bin 8160 -> 0 bytes .../ui/studio-tmce4/fonts/icomoon-small.woff | Bin 8336 -> 0 bytes .../skins/ui/studio-tmce4/fonts/icomoon.eot | Bin 8268 -> 0 bytes .../skins/ui/studio-tmce4/fonts/icomoon.svg | 153 - .../skins/ui/studio-tmce4/fonts/icomoon.ttf | Bin 8104 -> 0 bytes .../skins/ui/studio-tmce4/fonts/icomoon.woff | Bin 8400 -> 0 bytes .../skins/ui/studio-tmce4/fonts/readme.md | 1 - .../skins/ui/studio-tmce4/img/anchor.gif | Bin 53 -> 0 bytes .../skins/ui/studio-tmce4/img/loader.gif | Bin 2569 -> 0 bytes .../skins/ui/studio-tmce4/img/object.gif | Bin 152 -> 0 bytes .../skins/ui/studio-tmce4/img/trans.gif | Bin 43 -> 0 bytes .../skins/ui/studio-tmce4/img/wline.gif | Bin 46 -> 0 bytes .../skins/ui/studio-tmce4/skin.ie7.min.css | 1 - .../tinymce/skins/ui/studio-tmce4/skin.json | 51 - .../skins/ui/studio-tmce4/skin.min.css | 1 - .../content.css} | 53 +- .../content.inline.css | 47 +- .../ui/studio-tmce5/content.inline.min.css | 7 + .../skins/ui/studio-tmce5/content.min.css | 7 + .../content.mobile.css | 10 +- .../ui/studio-tmce5/content.mobile.min.css | 7 + .../fonts/tinymce-mobile.woff | Bin .../skins/ui/{oxide => studio-tmce5}/skin.css | 317 +- .../skins/ui/studio-tmce5/skin.min.css | 7 + .../{oxide => studio-tmce5}/skin.mobile.css | 14 +- .../skin.mobile.min.css | 13 +- lms/envs/common.py | 4 +- xmodule/js/src/html/edit.js | 14 +- 76 files changed, 398 insertions(+), 6116 deletions(-) delete mode 100644 common/static/images/ico-tinymce-code.png delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/dark/content.css delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/dark/content.min.css delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/dark/content.min.css.map delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/default/content.css delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/default/content.min.css delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/default/content.min.css.map delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/document/content.css delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/document/content.min.css delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/document/content.min.css.map create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/studio-tmce5/content.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/studio-tmce5/content.min.css delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/writer/content.css delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/writer/content.min.css delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/content/writer/content.min.css.map create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/skintool.json delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.css delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.min.css delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.min.css.map delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.min.css delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.min.css.map delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.mobile.min.css delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.mobile.min.css.map delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.css delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.min.css delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.min.css.map delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.mobile.css delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.mobile.min.css.map delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.css delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.inline.min.css delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.inline.min.css.map delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.min.css delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.min.css.map delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.mobile.css delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.mobile.min.css delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.mobile.min.css.map delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.min.css delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.min.css.map delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.mobile.min.css delete mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.mobile.min.css.map delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/content.inline.min.css delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/content.min.css delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon-small.eot delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon-small.svg delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon-small.ttf delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon-small.woff delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon.eot delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon.svg delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon.ttf delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon.woff delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/readme.md delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/img/anchor.gif delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/img/loader.gif delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/img/object.gif delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/img/trans.gif delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/img/wline.gif delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/skin.ie7.min.css delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/skin.json delete mode 100755 common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/skin.min.css rename common/static/js/vendor/tinymce/js/tinymce/skins/ui/{oxide-dark/content.inline.css => studio-tmce5/content.css} (95%) rename common/static/js/vendor/tinymce/js/tinymce/skins/ui/{oxide => studio-tmce5}/content.inline.css (95%) create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/content.inline.min.css create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/content.min.css rename common/static/js/vendor/tinymce/js/tinymce/skins/ui/{oxide-dark => studio-tmce5}/content.mobile.css (66%) create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/content.mobile.min.css rename common/static/js/vendor/tinymce/js/tinymce/skins/ui/{oxide-dark => studio-tmce5}/fonts/tinymce-mobile.woff (100%) rename common/static/js/vendor/tinymce/js/tinymce/skins/ui/{oxide => studio-tmce5}/skin.css (91%) create mode 100644 common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/skin.min.css rename common/static/js/vendor/tinymce/js/tinymce/skins/ui/{oxide => studio-tmce5}/skin.mobile.css (98%) rename common/static/js/vendor/tinymce/js/tinymce/skins/ui/{oxide-dark => studio-tmce5}/skin.mobile.min.css (77%) diff --git a/cms/envs/common.py b/cms/envs/common.py index 21d655500a2c..0640d74b8b01 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -1295,14 +1295,14 @@ 'style-vendor-tinymce-content': { 'source_filenames': [ 'css/tinymce-studio-content-fonts.css', - 'js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/content.min.css', + 'js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/content.min.css', 'css/tinymce-studio-content.css' ], 'output_filename': 'css/cms-style-vendor-tinymce-content.css', }, 'style-vendor-tinymce-skin': { 'source_filenames': [ - 'js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/skin.min.css' + 'js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/skin.min.css' ], 'output_filename': 'css/cms-style-vendor-tinymce-skin.css', }, diff --git a/cms/templates/maintenance/_announcement_edit.html b/cms/templates/maintenance/_announcement_edit.html index f920db46b0f0..a9bee1c6fce2 100644 --- a/cms/templates/maintenance/_announcement_edit.html +++ b/cms/templates/maintenance/_announcement_edit.html @@ -36,13 +36,15 @@

    diff --git a/common/static/images/ico-tinymce-code.png b/common/static/images/ico-tinymce-code.png deleted file mode 100644 index e311c583af2b539acf799000af27137dc6a3338e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 217 zcmeAS@N?(olHy`uVBq!ia0vp^A|TAc1|)ksWqE0@4dkN;Vu>_=(R&k|Xqwe9J}C#vdL<@*Tzk3l}n|wVe(K;w?EK8rH(= zq9LMi)FGfkxqGp;7sDg&4IdaK`;H%AS11kG#W1~*eL_y2gE@=;6PW{#omv*U?E1ju zAs>2pLf^)ofIp04eF^!=zZ4kL6t)(hVm`#C6mzjbU0=W9ly=Xwb{>Ww0%ooYmmTT= Px|PAx)z4*}Q$iB}*%eI3 diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/source.html b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/source.html index 4b855988a60f..89e6932ce0cd 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/source.html +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/source.html @@ -143,15 +143,16 @@ return; } + // Disabled by EDX. // Create legend for keyboard shortcuts for find & replace: - var head = parent.document.querySelectorAll((tinymce.majorVersion < 5) ? '.mce-foot': '.tox-dialog__footer')[0], - div = parent.document.createElement('div'), - td1 = '', - td2 = ''; - div.innerHTML = '' + td1 + (isMac ? '⌘-F' : 'Ctrl-F') + td2 + tinymce.translate('Start search') + '' + td1 + (isMac ? '⌘-G' : 'Ctrl-G') + '' + td2 + tinymce.translate('Find next') + '' + td1 + (isMac ? '⌘-Alt-F' : 'Shift-Ctrl-F') + '' + td2 + tinymce.translate('Find previous') + '' + '' + td1 + (isMac ? '⌘-Alt-F' : 'Shift-Ctrl-F') + '' + td2 + tinymce.translate('Replace') + '' + td1 + (isMac ? 'Shift-⌘-Alt-F' : 'Shift-Ctrl-R') +'' + td2 + tinymce.translate('Replace all') + '
    '; - div.style.position = 'absolute'; - div.style.left = div.style.bottom = '5px'; - head.appendChild(div); + // var head = parent.document.querySelectorAll((tinymce.majorVersion < 5) ? '.mce-foot': '.tox-dialog__footer')[0], + // div = parent.document.createElement('div'), + // td1 = '', + // td2 = ''; + // div.innerHTML = '' + td1 + (isMac ? '⌘-F' : 'Ctrl-F') + td2 + tinymce.translate('Start search') + '' + td1 + (isMac ? '⌘-G' : 'Ctrl-G') + '' + td2 + tinymce.translate('Find next') + '' + td1 + (isMac ? '⌘-Alt-F' : 'Shift-Ctrl-F') + '' + td2 + tinymce.translate('Find previous') + '' + '' + td1 + (isMac ? '⌘-Alt-F' : 'Shift-Ctrl-F') + '' + td2 + tinymce.translate('Replace') + '' + td1 + (isMac ? 'Shift-⌘-Alt-F' : 'Shift-Ctrl-R') +'' + td2 + tinymce.translate('Replace all') + '
    '; + // div.style.position = 'absolute'; + // div.style.left = div.style.bottom = '5px'; + // head.appendChild(div); // Set CodeMirror cursor and bookmark to same position as cursor was in TinyMCE: var html = editor.getContent({source_view: true}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/content/dark/content.css b/common/static/js/vendor/tinymce/js/tinymce/skins/content/dark/content.css deleted file mode 100644 index bae7923fb047..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/content/dark/content.css +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ -body { - background-color: #2f3742; - color: #dfe0e4; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; - line-height: 1.4; - margin: 1rem; -} -a { - color: #4099ff; -} -table { - border-collapse: collapse; -} -/* Apply a default padding if legacy cellpadding attribute is missing */ -table:not([cellpadding]) th, -table:not([cellpadding]) td { - padding: 0.4rem; -} -/* Set default table styles if a table has a positive border attribute - and no inline css */ -table[border]:not([border="0"]):not([style*="border-width"]) th, -table[border]:not([border="0"]):not([style*="border-width"]) td { - border-width: 1px; -} -/* Set default table styles if a table has a positive border attribute - and no inline css */ -table[border]:not([border="0"]):not([style*="border-style"]) th, -table[border]:not([border="0"]):not([style*="border-style"]) td { - border-style: solid; -} -/* Set default table styles if a table has a positive border attribute - and no inline css */ -table[border]:not([border="0"]):not([style*="border-color"]) th, -table[border]:not([border="0"]):not([style*="border-color"]) td { - border-color: #6d737b; -} -figure { - display: table; - margin: 1rem auto; -} -figure figcaption { - color: #8a8f97; - display: block; - margin-top: 0.25rem; - text-align: center; -} -hr { - border-color: #6d737b; - border-style: solid; - border-width: 1px 0 0 0; -} -code { - background-color: #6d737b; - border-radius: 3px; - padding: 0.1rem 0.2rem; -} -.mce-content-body:not([dir=rtl]) blockquote { - border-left: 2px solid #6d737b; - margin-left: 1.5rem; - padding-left: 1rem; -} -.mce-content-body[dir=rtl] blockquote { - border-right: 2px solid #6d737b; - margin-right: 1.5rem; - padding-right: 1rem; -} diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/content/dark/content.min.css b/common/static/js/vendor/tinymce/js/tinymce/skins/content/dark/content.min.css deleted file mode 100644 index 7171347feedf..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/content/dark/content.min.css +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ -body{background-color:#2f3742;color:#dfe0e4;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}a{color:#4099ff}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#6d737b}figure{display:table;margin:1rem auto}figure figcaption{color:#8a8f97;display:block;margin-top:.25rem;text-align:center}hr{border-color:#6d737b;border-style:solid;border-width:1px 0 0 0}code{background-color:#6d737b;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #6d737b;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #6d737b;margin-right:1.5rem;padding-right:1rem} -/*# sourceMappingURL=content.min.css.map */ diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/content/dark/content.min.css.map b/common/static/js/vendor/tinymce/js/tinymce/skins/content/dark/content.min.css.map deleted file mode 100644 index 00ec44438bc5..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/content/dark/content.min.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["content/dark/content.css"],"names":[],"mappings":";;;;;;AAMA,KACE,iBAAkB,QAClB,MAAO,QACP,YAAa,aAAa,CAAE,kBAAkB,CAAE,UAAU,CAAE,MAAM,CAAE,MAAM,CAAE,MAAM,CAAE,SAAS,CAAE,WAAW,CAAE,gBAAgB,CAAE,WAC9H,YAAa,IACb,OAAQ,KAEV,EACE,MAAO,QAET,MACE,gBAAiB,SAInB,4BADA,4BAEE,QAAS,MAKX,8DADA,8DAEE,aAAc,IAKhB,8DADA,8DAEE,aAAc,MAKhB,8DADA,8DAEE,aAAc,QAEhB,OACE,QAAS,MACT,OAAQ,KAAK,KAEf,kBACE,MAAO,QACP,QAAS,MACT,WAAY,OACZ,WAAY,OAEd,GACE,aAAc,QACd,aAAc,MACd,aAAc,IAAI,EAAE,EAAE,EAExB,KACE,iBAAkB,QAClB,cAAe,IACf,QAAS,MAAO,MAElB,4CACE,YAAa,IAAI,MAAM,QACvB,YAAa,OACb,aAAc,KAEhB,sCACE,aAAc,IAAI,MAAM,QACxB,aAAc,OACd,cAAe","file":"content.min.css","sourcesContent":["/**\n * Copyright (c) Tiny Technologies, Inc. All rights reserved.\n * Licensed under the LGPL or a commercial license.\n * For LGPL see License.txt in the project root for license information.\n * For commercial licenses see https://www.tiny.cloud/\n */\nbody {\n background-color: #2f3742;\n color: #dfe0e4;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n line-height: 1.4;\n margin: 1rem;\n}\na {\n color: #4099ff;\n}\ntable {\n border-collapse: collapse;\n}\n/* Apply a default padding if legacy cellpadding attribute is missing */\ntable:not([cellpadding]) th,\ntable:not([cellpadding]) td {\n padding: 0.4rem;\n}\n/* Set default table styles if a table has a positive border attribute\n and no inline css */\ntable[border]:not([border=\"0\"]):not([style*=\"border-width\"]) th,\ntable[border]:not([border=\"0\"]):not([style*=\"border-width\"]) td {\n border-width: 1px;\n}\n/* Set default table styles if a table has a positive border attribute\n and no inline css */\ntable[border]:not([border=\"0\"]):not([style*=\"border-style\"]) th,\ntable[border]:not([border=\"0\"]):not([style*=\"border-style\"]) td {\n border-style: solid;\n}\n/* Set default table styles if a table has a positive border attribute\n and no inline css */\ntable[border]:not([border=\"0\"]):not([style*=\"border-color\"]) th,\ntable[border]:not([border=\"0\"]):not([style*=\"border-color\"]) td {\n border-color: #6d737b;\n}\nfigure {\n display: table;\n margin: 1rem auto;\n}\nfigure figcaption {\n color: #8a8f97;\n display: block;\n margin-top: 0.25rem;\n text-align: center;\n}\nhr {\n border-color: #6d737b;\n border-style: solid;\n border-width: 1px 0 0 0;\n}\ncode {\n background-color: #6d737b;\n border-radius: 3px;\n padding: 0.1rem 0.2rem;\n}\n.mce-content-body:not([dir=rtl]) blockquote {\n border-left: 2px solid #6d737b;\n margin-left: 1.5rem;\n padding-left: 1rem;\n}\n.mce-content-body[dir=rtl] blockquote {\n border-right: 2px solid #6d737b;\n margin-right: 1.5rem;\n padding-right: 1rem;\n}\n"]} \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/content/default/content.css b/common/static/js/vendor/tinymce/js/tinymce/skins/content/default/content.css deleted file mode 100644 index dd6a5c1ca9e0..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/content/default/content.css +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ -body { - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; - line-height: 1.4; - margin: 1rem; -} -table { - border-collapse: collapse; -} -/* Apply a default padding if legacy cellpadding attribute is missing */ -table:not([cellpadding]) th, -table:not([cellpadding]) td { - padding: 0.4rem; -} -/* Set default table styles if a table has a positive border attribute - and no inline css */ -table[border]:not([border="0"]):not([style*="border-width"]) th, -table[border]:not([border="0"]):not([style*="border-width"]) td { - border-width: 1px; -} -/* Set default table styles if a table has a positive border attribute - and no inline css */ -table[border]:not([border="0"]):not([style*="border-style"]) th, -table[border]:not([border="0"]):not([style*="border-style"]) td { - border-style: solid; -} -/* Set default table styles if a table has a positive border attribute - and no inline css */ -table[border]:not([border="0"]):not([style*="border-color"]) th, -table[border]:not([border="0"]):not([style*="border-color"]) td { - border-color: #ccc; -} -figure { - display: table; - margin: 1rem auto; -} -figure figcaption { - color: #999; - display: block; - margin-top: 0.25rem; - text-align: center; -} -hr { - border-color: #ccc; - border-style: solid; - border-width: 1px 0 0 0; -} -code { - background-color: #e8e8e8; - border-radius: 3px; - padding: 0.1rem 0.2rem; -} -.mce-content-body:not([dir=rtl]) blockquote { - border-left: 2px solid #ccc; - margin-left: 1.5rem; - padding-left: 1rem; -} -.mce-content-body[dir=rtl] blockquote { - border-right: 2px solid #ccc; - margin-right: 1.5rem; - padding-right: 1rem; -} diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/content/default/content.min.css b/common/static/js/vendor/tinymce/js/tinymce/skins/content/default/content.min.css deleted file mode 100644 index 966b4e9e2cbc..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/content/default/content.min.css +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ -body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#ccc}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem} -/*# sourceMappingURL=content.min.css.map */ diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/content/default/content.min.css.map b/common/static/js/vendor/tinymce/js/tinymce/skins/content/default/content.min.css.map deleted file mode 100644 index 9ce0b8c2bd4e..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/content/default/content.min.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["content/default/content.css"],"names":[],"mappings":";;;;;;AAMA,KACE,YAAa,aAAa,CAAE,kBAAkB,CAAE,UAAU,CAAE,MAAM,CAAE,MAAM,CAAE,MAAM,CAAE,SAAS,CAAE,WAAW,CAAE,gBAAgB,CAAE,WAC9H,YAAa,IACb,OAAQ,KAEV,MACE,gBAAiB,SAInB,4BADA,4BAEE,QAAS,MAKX,8DADA,8DAEE,aAAc,IAKhB,8DADA,8DAEE,aAAc,MAKhB,8DADA,8DAEE,aAAc,KAEhB,OACE,QAAS,MACT,OAAQ,KAAK,KAEf,kBACE,MAAO,KACP,QAAS,MACT,WAAY,OACZ,WAAY,OAEd,GACE,aAAc,KACd,aAAc,MACd,aAAc,IAAI,EAAE,EAAE,EAExB,KACE,iBAAkB,QAClB,cAAe,IACf,QAAS,MAAO,MAElB,4CACE,YAAa,IAAI,MAAM,KACvB,YAAa,OACb,aAAc,KAEhB,sCACE,aAAc,IAAI,MAAM,KACxB,aAAc,OACd,cAAe","file":"content.min.css","sourcesContent":["/**\n * Copyright (c) Tiny Technologies, Inc. All rights reserved.\n * Licensed under the LGPL or a commercial license.\n * For LGPL see License.txt in the project root for license information.\n * For commercial licenses see https://www.tiny.cloud/\n */\nbody {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n line-height: 1.4;\n margin: 1rem;\n}\ntable {\n border-collapse: collapse;\n}\n/* Apply a default padding if legacy cellpadding attribute is missing */\ntable:not([cellpadding]) th,\ntable:not([cellpadding]) td {\n padding: 0.4rem;\n}\n/* Set default table styles if a table has a positive border attribute\n and no inline css */\ntable[border]:not([border=\"0\"]):not([style*=\"border-width\"]) th,\ntable[border]:not([border=\"0\"]):not([style*=\"border-width\"]) td {\n border-width: 1px;\n}\n/* Set default table styles if a table has a positive border attribute\n and no inline css */\ntable[border]:not([border=\"0\"]):not([style*=\"border-style\"]) th,\ntable[border]:not([border=\"0\"]):not([style*=\"border-style\"]) td {\n border-style: solid;\n}\n/* Set default table styles if a table has a positive border attribute\n and no inline css */\ntable[border]:not([border=\"0\"]):not([style*=\"border-color\"]) th,\ntable[border]:not([border=\"0\"]):not([style*=\"border-color\"]) td {\n border-color: #ccc;\n}\nfigure {\n display: table;\n margin: 1rem auto;\n}\nfigure figcaption {\n color: #999;\n display: block;\n margin-top: 0.25rem;\n text-align: center;\n}\nhr {\n border-color: #ccc;\n border-style: solid;\n border-width: 1px 0 0 0;\n}\ncode {\n background-color: #e8e8e8;\n border-radius: 3px;\n padding: 0.1rem 0.2rem;\n}\n.mce-content-body:not([dir=rtl]) blockquote {\n border-left: 2px solid #ccc;\n margin-left: 1.5rem;\n padding-left: 1rem;\n}\n.mce-content-body[dir=rtl] blockquote {\n border-right: 2px solid #ccc;\n margin-right: 1.5rem;\n padding-right: 1rem;\n}\n"]} \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/content/document/content.css b/common/static/js/vendor/tinymce/js/tinymce/skins/content/document/content.css deleted file mode 100644 index 75f637a1318e..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/content/document/content.css +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ -@media screen { - html { - background: #f4f4f4; - min-height: 100%; - } -} -body { - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; -} -@media screen { - body { - background-color: #fff; - box-shadow: 0 0 4px rgba(0, 0, 0, 0.15); - box-sizing: border-box; - margin: 1rem auto 0; - max-width: 820px; - min-height: calc(100vh - 1rem); - padding: 4rem 6rem 6rem 6rem; - } -} -table { - border-collapse: collapse; -} -/* Apply a default padding if legacy cellpadding attribute is missing */ -table:not([cellpadding]) th, -table:not([cellpadding]) td { - padding: 0.4rem; -} -/* Set default table styles if a table has a positive border attribute - and no inline css */ -table[border]:not([border="0"]):not([style*="border-width"]) th, -table[border]:not([border="0"]):not([style*="border-width"]) td { - border-width: 1px; -} -/* Set default table styles if a table has a positive border attribute - and no inline css */ -table[border]:not([border="0"]):not([style*="border-style"]) th, -table[border]:not([border="0"]):not([style*="border-style"]) td { - border-style: solid; -} -/* Set default table styles if a table has a positive border attribute - and no inline css */ -table[border]:not([border="0"]):not([style*="border-color"]) th, -table[border]:not([border="0"]):not([style*="border-color"]) td { - border-color: #ccc; -} -figure figcaption { - color: #999; - margin-top: 0.25rem; - text-align: center; -} -hr { - border-color: #ccc; - border-style: solid; - border-width: 1px 0 0 0; -} -.mce-content-body:not([dir=rtl]) blockquote { - border-left: 2px solid #ccc; - margin-left: 1.5rem; - padding-left: 1rem; -} -.mce-content-body[dir=rtl] blockquote { - border-right: 2px solid #ccc; - margin-right: 1.5rem; - padding-right: 1rem; -} diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/content/document/content.min.css b/common/static/js/vendor/tinymce/js/tinymce/skins/content/document/content.min.css deleted file mode 100644 index 141f40a1dd13..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/content/document/content.min.css +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ -@media screen{html{background:#f4f4f4;min-height:100%}}body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif}@media screen{body{background-color:#fff;box-shadow:0 0 4px rgba(0,0,0,.15);box-sizing:border-box;margin:1rem auto 0;max-width:820px;min-height:calc(100vh - 1rem);padding:4rem 6rem 6rem 6rem}}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#ccc}figure figcaption{color:#999;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem} -/*# sourceMappingURL=content.min.css.map */ diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/content/document/content.min.css.map b/common/static/js/vendor/tinymce/js/tinymce/skins/content/document/content.min.css.map deleted file mode 100644 index 770fa5bba577..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/content/document/content.min.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["content/document/content.css"],"names":[],"mappings":";;;;;;AAMA,cACE,KACE,WAAY,QACZ,WAAY,MAGhB,KACE,YAAa,aAAa,CAAE,kBAAkB,CAAE,UAAU,CAAE,MAAM,CAAE,MAAM,CAAE,MAAM,CAAE,SAAS,CAAE,WAAW,CAAE,gBAAgB,CAAE,WAEhI,cACE,KACE,iBAAkB,KAClB,WAAY,EAAE,EAAE,IAAI,gBACpB,WAAY,WACZ,OAAQ,KAAK,KAAK,EAClB,UAAW,MACX,WAAY,mBACZ,QAAS,KAAK,KAAK,KAAK,MAG5B,MACE,gBAAiB,SAInB,4BADA,4BAEE,QAAS,MAKX,8DADA,8DAEE,aAAc,IAKhB,8DADA,8DAEE,aAAc,MAKhB,8DADA,8DAEE,aAAc,KAEhB,kBACE,MAAO,KACP,WAAY,OACZ,WAAY,OAEd,GACE,aAAc,KACd,aAAc,MACd,aAAc,IAAI,EAAE,EAAE,EAExB,4CACE,YAAa,IAAI,MAAM,KACvB,YAAa,OACb,aAAc,KAEhB,sCACE,aAAc,IAAI,MAAM,KACxB,aAAc,OACd,cAAe","file":"content.min.css","sourcesContent":["/**\n * Copyright (c) Tiny Technologies, Inc. All rights reserved.\n * Licensed under the LGPL or a commercial license.\n * For LGPL see License.txt in the project root for license information.\n * For commercial licenses see https://www.tiny.cloud/\n */\n@media screen {\n html {\n background: #f4f4f4;\n min-height: 100%;\n }\n}\nbody {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n}\n@media screen {\n body {\n background-color: #fff;\n box-shadow: 0 0 4px rgba(0, 0, 0, 0.15);\n box-sizing: border-box;\n margin: 1rem auto 0;\n max-width: 820px;\n min-height: calc(100vh - 1rem);\n padding: 4rem 6rem 6rem 6rem;\n }\n}\ntable {\n border-collapse: collapse;\n}\n/* Apply a default padding if legacy cellpadding attribute is missing */\ntable:not([cellpadding]) th,\ntable:not([cellpadding]) td {\n padding: 0.4rem;\n}\n/* Set default table styles if a table has a positive border attribute\n and no inline css */\ntable[border]:not([border=\"0\"]):not([style*=\"border-width\"]) th,\ntable[border]:not([border=\"0\"]):not([style*=\"border-width\"]) td {\n border-width: 1px;\n}\n/* Set default table styles if a table has a positive border attribute\n and no inline css */\ntable[border]:not([border=\"0\"]):not([style*=\"border-style\"]) th,\ntable[border]:not([border=\"0\"]):not([style*=\"border-style\"]) td {\n border-style: solid;\n}\n/* Set default table styles if a table has a positive border attribute\n and no inline css */\ntable[border]:not([border=\"0\"]):not([style*=\"border-color\"]) th,\ntable[border]:not([border=\"0\"]):not([style*=\"border-color\"]) td {\n border-color: #ccc;\n}\nfigure figcaption {\n color: #999;\n margin-top: 0.25rem;\n text-align: center;\n}\nhr {\n border-color: #ccc;\n border-style: solid;\n border-width: 1px 0 0 0;\n}\n.mce-content-body:not([dir=rtl]) blockquote {\n border-left: 2px solid #ccc;\n margin-left: 1.5rem;\n padding-left: 1rem;\n}\n.mce-content-body[dir=rtl] blockquote {\n border-right: 2px solid #ccc;\n margin-right: 1.5rem;\n padding-right: 1rem;\n}\n"]} \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/content/studio-tmce5/content.css b/common/static/js/vendor/tinymce/js/tinymce/skins/content/studio-tmce5/content.css new file mode 100644 index 000000000000..652296cf0995 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/skins/content/studio-tmce5/content.css @@ -0,0 +1,49 @@ +/** +* Copyright (c) Tiny Technologies, Inc. All rights reserved. +* Licensed under the LGPL or a commercial license. +* For LGPL see License.txt in the project root for license information. +* For commercial licenses see https://www.tiny.cloud/ +*/ +body { + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; + line-height: 1.4; + margin: 1rem; +} +table { + border-collapse: collapse; +} +table th, +table td { + border: 1px solid #ccc; + padding: 0.4rem; +} +figure { + display: table; + margin: 1rem auto; +} +figure figcaption { + color: #999; + display: block; + margin-top: 0.25rem; + text-align: center; +} +hr { + border-color: #ccc; + border-style: solid; + border-width: 1px 0 0 0; +} +code { + background-color: #e8e8e8; + border-radius: 3px; + padding: 0.1rem 0.2rem; +} +.mce-content-body:not([dir=rtl]) blockquote { + border-left: 2px solid #ccc; + margin-left: 1.5rem; + padding-left: 1rem; +} +.mce-content-body[dir=rtl] blockquote { + border-right: 2px solid #ccc; + margin-right: 1.5rem; + padding-right: 1rem; +} diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/content/studio-tmce5/content.min.css b/common/static/js/vendor/tinymce/js/tinymce/skins/content/studio-tmce5/content.min.css new file mode 100644 index 000000000000..6434d6ac771f --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/skins/content/studio-tmce5/content.min.css @@ -0,0 +1,7 @@ +/** +* Copyright (c) Tiny Technologies, Inc. All rights reserved. +* Licensed under the LGPL or a commercial license. +* For LGPL see License.txt in the project root for license information. +* For commercial licenses see https://www.tiny.cloud/ +*/ +body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem}table{border-collapse:collapse}table td,table th{border:1px solid #ccc;padding:.4rem}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem} \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/content/writer/content.css b/common/static/js/vendor/tinymce/js/tinymce/skins/content/writer/content.css deleted file mode 100644 index ceee359938e6..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/content/writer/content.css +++ /dev/null @@ -1,68 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ -body { - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif; - line-height: 1.4; - margin: 1rem auto; - max-width: 900px; -} -table { - border-collapse: collapse; -} -/* Apply a default padding if legacy cellpadding attribute is missing */ -table:not([cellpadding]) th, -table:not([cellpadding]) td { - padding: 0.4rem; -} -/* Set default table styles if a table has a positive border attribute - and no inline css */ -table[border]:not([border="0"]):not([style*="border-width"]) th, -table[border]:not([border="0"]):not([style*="border-width"]) td { - border-width: 1px; -} -/* Set default table styles if a table has a positive border attribute - and no inline css */ -table[border]:not([border="0"]):not([style*="border-style"]) th, -table[border]:not([border="0"]):not([style*="border-style"]) td { - border-style: solid; -} -/* Set default table styles if a table has a positive border attribute - and no inline css */ -table[border]:not([border="0"]):not([style*="border-color"]) th, -table[border]:not([border="0"]):not([style*="border-color"]) td { - border-color: #ccc; -} -figure { - display: table; - margin: 1rem auto; -} -figure figcaption { - color: #999; - display: block; - margin-top: 0.25rem; - text-align: center; -} -hr { - border-color: #ccc; - border-style: solid; - border-width: 1px 0 0 0; -} -code { - background-color: #e8e8e8; - border-radius: 3px; - padding: 0.1rem 0.2rem; -} -.mce-content-body:not([dir=rtl]) blockquote { - border-left: 2px solid #ccc; - margin-left: 1.5rem; - padding-left: 1rem; -} -.mce-content-body[dir=rtl] blockquote { - border-right: 2px solid #ccc; - margin-right: 1.5rem; - padding-right: 1rem; -} diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/content/writer/content.min.css b/common/static/js/vendor/tinymce/js/tinymce/skins/content/writer/content.min.css deleted file mode 100644 index 0d6b3eca3b4c..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/content/writer/content.min.css +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ -body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,Oxygen,Ubuntu,Cantarell,'Open Sans','Helvetica Neue',sans-serif;line-height:1.4;margin:1rem auto;max-width:900px}table{border-collapse:collapse}table:not([cellpadding]) td,table:not([cellpadding]) th{padding:.4rem}table[border]:not([border="0"]):not([style*=border-width]) td,table[border]:not([border="0"]):not([style*=border-width]) th{border-width:1px}table[border]:not([border="0"]):not([style*=border-style]) td,table[border]:not([border="0"]):not([style*=border-style]) th{border-style:solid}table[border]:not([border="0"]):not([style*=border-color]) td,table[border]:not([border="0"]):not([style*=border-color]) th{border-color:#ccc}figure{display:table;margin:1rem auto}figure figcaption{color:#999;display:block;margin-top:.25rem;text-align:center}hr{border-color:#ccc;border-style:solid;border-width:1px 0 0 0}code{background-color:#e8e8e8;border-radius:3px;padding:.1rem .2rem}.mce-content-body:not([dir=rtl]) blockquote{border-left:2px solid #ccc;margin-left:1.5rem;padding-left:1rem}.mce-content-body[dir=rtl] blockquote{border-right:2px solid #ccc;margin-right:1.5rem;padding-right:1rem} -/*# sourceMappingURL=content.min.css.map */ diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/content/writer/content.min.css.map b/common/static/js/vendor/tinymce/js/tinymce/skins/content/writer/content.min.css.map deleted file mode 100644 index e7ee02877b4b..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/content/writer/content.min.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["content/writer/content.css"],"names":[],"mappings":";;;;;;AAMA,KACE,YAAa,aAAa,CAAE,kBAAkB,CAAE,UAAU,CAAE,MAAM,CAAE,MAAM,CAAE,MAAM,CAAE,SAAS,CAAE,WAAW,CAAE,gBAAgB,CAAE,WAC9H,YAAa,IACb,OAAQ,KAAK,KACb,UAAW,MAEb,MACE,gBAAiB,SAInB,4BADA,4BAEE,QAAS,MAKX,8DADA,8DAEE,aAAc,IAKhB,8DADA,8DAEE,aAAc,MAKhB,8DADA,8DAEE,aAAc,KAEhB,OACE,QAAS,MACT,OAAQ,KAAK,KAEf,kBACE,MAAO,KACP,QAAS,MACT,WAAY,OACZ,WAAY,OAEd,GACE,aAAc,KACd,aAAc,MACd,aAAc,IAAI,EAAE,EAAE,EAExB,KACE,iBAAkB,QAClB,cAAe,IACf,QAAS,MAAO,MAElB,4CACE,YAAa,IAAI,MAAM,KACvB,YAAa,OACb,aAAc,KAEhB,sCACE,aAAc,IAAI,MAAM,KACxB,aAAc,OACd,cAAe","file":"content.min.css","sourcesContent":["/**\n * Copyright (c) Tiny Technologies, Inc. All rights reserved.\n * Licensed under the LGPL or a commercial license.\n * For LGPL see License.txt in the project root for license information.\n * For commercial licenses see https://www.tiny.cloud/\n */\nbody {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n line-height: 1.4;\n margin: 1rem auto;\n max-width: 900px;\n}\ntable {\n border-collapse: collapse;\n}\n/* Apply a default padding if legacy cellpadding attribute is missing */\ntable:not([cellpadding]) th,\ntable:not([cellpadding]) td {\n padding: 0.4rem;\n}\n/* Set default table styles if a table has a positive border attribute\n and no inline css */\ntable[border]:not([border=\"0\"]):not([style*=\"border-width\"]) th,\ntable[border]:not([border=\"0\"]):not([style*=\"border-width\"]) td {\n border-width: 1px;\n}\n/* Set default table styles if a table has a positive border attribute\n and no inline css */\ntable[border]:not([border=\"0\"]):not([style*=\"border-style\"]) th,\ntable[border]:not([border=\"0\"]):not([style*=\"border-style\"]) td {\n border-style: solid;\n}\n/* Set default table styles if a table has a positive border attribute\n and no inline css */\ntable[border]:not([border=\"0\"]):not([style*=\"border-color\"]) th,\ntable[border]:not([border=\"0\"]):not([style*=\"border-color\"]) td {\n border-color: #ccc;\n}\nfigure {\n display: table;\n margin: 1rem auto;\n}\nfigure figcaption {\n color: #999;\n display: block;\n margin-top: 0.25rem;\n text-align: center;\n}\nhr {\n border-color: #ccc;\n border-style: solid;\n border-width: 1px 0 0 0;\n}\ncode {\n background-color: #e8e8e8;\n border-radius: 3px;\n padding: 0.1rem 0.2rem;\n}\n.mce-content-body:not([dir=rtl]) blockquote {\n border-left: 2px solid #ccc;\n margin-left: 1.5rem;\n padding-left: 1rem;\n}\n.mce-content-body[dir=rtl] blockquote {\n border-right: 2px solid #ccc;\n margin-right: 1.5rem;\n padding-right: 1rem;\n}\n"]} \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/skintool.json b/common/static/js/vendor/tinymce/js/tinymce/skins/skintool.json new file mode 100644 index 000000000000..feace05c1af8 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/skins/skintool.json @@ -0,0 +1,39 @@ +{ + "backgroundColor": "#ffffff", + "skinName": "studio-tmce5", + "contentCss": "body {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;\n line-height: 1.4;\n margin: 1rem;\n}\n\ntable {\n border-collapse: collapse;\n}\n\ntable th,\ntable td {\n border: 1px solid #ccc;\n padding: .4rem;\n}\n\nfigure {\n display: table;\n margin: 1rem auto;\n}\n\nfigure figcaption {\n color: #999;\n display: block;\n margin-top: .25rem;\n text-align: center;\n}\n\nhr {\n border-color: #ccc;\n border-style: solid;\n border-width: 1px 0 0 0;\n}\n\ncode {\n background-color: #e8e8e8;\n border-radius: 3px;\n padding: .1rem .2rem;\n}\n\n.mce-content-body:not([dir=rtl]) {\n blockquote {\n border-left: 2px solid #ccc;\n margin-left: 1.5rem;\n padding-left: 1rem;\n }\n}\n\n// RTL\n.mce-content-body[dir=rtl] {\n blockquote {\n border-right: 2px solid #ccc;\n margin-right: 1.5rem;\n padding-right: 1rem;\n }\n}\n", + "initConfig": "tinymce.init({\n plugins: [\n \"a11ychecker advcode casechange formatpainter\",\n \"linkchecker autolink lists checklist\",\n \"media mediaembed pageembed permanentpen\",\n \"powerpaste table advtable tinymcespellchecker\"\n ],\n toolbar: \"formatselect fontselect bold italic strikethrough forecolor backcolor formatpainter alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | link insertfile image | removeformat | code | addcomment | checklist | casechange\",\n height: 360\n});", + "lessVariablesMap": { + "@background-color": "#fff", + "@toolbar-background-color": "rgba(240, 240, 240, 1)", + "@menubar-background-color": "rgba(240, 240, 240, 1)", + "@border-color": "rgba(158, 158, 158, 1)", + "@color-black": "#222f3e", + "@color-white": "#fff", + "@color-tint": "#207ab7", + "@color-error": "#c00", + "@color-success": "#78AB46", + "@base-value": "14px", + "@control-border-radius": "3px", + "@panel-border-radius": "3px", + "@tinymce-border-radius": "0px", + "@font-stack": "-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Oxygen-Sans,Ubuntu,Cantarell,\"Helvetica Neue\",sans-serif", + "@font-weight-normal": "normal", + "@font-weight-bold": "bold", + "@toolbar-button-icon-color": "rgba(98, 107, 115, 1)", + "@toolbar-button-text-color": "rgba(98, 107, 115, 1)", + "@toolbar-button-hover-background-color": "rgba(193, 202, 213, 1)", + "@toolbar-button-hover-icon-color": "@toolbar-button-icon-color", + "@toolbar-button-hover-text-color": "@toolbar-button-icon-color", + "@toolbar-button-focus-background-color": "rgba(193, 202, 213, 1)", + "@toolbar-button-focus-icon-color": "rgba(98, 107, 115, 1)", + "@toolbar-button-focus-text-color": "rgba(98, 107, 115, 1)", + "@toolbar-button-active-background-color": "rgba(178, 190, 202, 1)", + "@toolbar-button-enabled-background-color": "rgba(178, 190, 202, 1)", + "@toolbar-button-active-icon-color": "@toolbar-button-hover-icon-color", + "@toolbar-button-active-text-color": "@toolbar-button-hover-icon-color", + "@toolbar-button-enabled-icon-color": "@toolbar-button-hover-icon-color", + "@toolbar-button-enabled-text-color": "@toolbar-button-hover-icon-color" + }, + "lessVariables": "@background-color: #fff;\n@toolbar-background-color: rgba(240, 240, 240, 1);\n@menubar-background-color: rgba(240, 240, 240, 1);\n@border-color: rgba(158, 158, 158, 1);\n@color-black: #222f3e;\n@color-white: #fff;\n@color-tint: #207ab7;\n@color-error: #c00;\n@color-success: #78AB46;\n@base-value: 14px;\n@control-border-radius: 3px;\n@panel-border-radius: 3px;\n@tinymce-border-radius: 0px;\n@font-stack: -apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,Oxygen-Sans,Ubuntu,Cantarell,\"Helvetica Neue\",sans-serif;\n@font-weight-normal: normal;\n@font-weight-bold: bold;\n@toolbar-button-icon-color: rgba(98, 107, 115, 1);\n@toolbar-button-text-color: rgba(98, 107, 115, 1);\n@toolbar-button-hover-background-color: rgba(193, 202, 213, 1);\n@toolbar-button-hover-icon-color: @toolbar-button-icon-color;\n@toolbar-button-hover-text-color: @toolbar-button-icon-color;\n@toolbar-button-focus-background-color: rgba(193, 202, 213, 1);\n@toolbar-button-focus-icon-color: rgba(98, 107, 115, 1);\n@toolbar-button-focus-text-color: rgba(98, 107, 115, 1);\n@toolbar-button-active-background-color: rgba(178, 190, 202, 1);\n@toolbar-button-enabled-background-color: rgba(178, 190, 202, 1);\n@toolbar-button-active-icon-color: @toolbar-button-hover-icon-color;\n@toolbar-button-active-text-color: @toolbar-button-hover-icon-color;\n@toolbar-button-enabled-icon-color: @toolbar-button-hover-icon-color;\n@toolbar-button-enabled-text-color: @toolbar-button-hover-icon-color;\n" +} \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.css deleted file mode 100644 index a9f7befd54c4..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.css +++ /dev/null @@ -1,710 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ -.mce-content-body .mce-item-anchor { - background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%20fill%3D%22%23cccccc%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; - cursor: default; - display: inline-block; - height: 12px !important; - padding: 0 2px; - -webkit-user-modify: read-only; - -moz-user-modify: read-only; - -webkit-user-select: all; - -moz-user-select: all; - -ms-user-select: all; - user-select: all; - width: 8px !important; -} -.mce-content-body .mce-item-anchor[data-mce-selected] { - outline-offset: 1px; -} -.tox-comments-visible .tox-comment { - background-color: #fff0b7; -} -.tox-comments-visible .tox-comment--active { - background-color: #ffe168; -} -.tox-checklist > li:not(.tox-checklist--hidden) { - list-style: none; - margin: 0.25em 0; -} -.tox-checklist > li:not(.tox-checklist--hidden)::before { - content: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%236d737b%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); - cursor: pointer; - height: 1em; - margin-left: -1.5em; - margin-top: 0.125em; - position: absolute; - width: 1em; -} -.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before { - content: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); -} -[dir=rtl] .tox-checklist > li:not(.tox-checklist--hidden)::before { - margin-left: 0; - margin-right: -1.5em; -} -/* stylelint-disable */ -/* http://prismjs.com/ */ -/** - * Dracula Theme originally by Zeno Rocha [@zenorocha] - * https://draculatheme.com/ - * - * Ported for PrismJS by Albert Vallverdu [@byverdu] - */ -code[class*="language-"], -pre[class*="language-"] { - color: #f8f8f2; - background: none; - text-shadow: 0 1px rgba(0, 0, 0, 0.3); - font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; - text-align: left; - white-space: pre; - word-spacing: normal; - word-break: normal; - word-wrap: normal; - line-height: 1.5; - -moz-tab-size: 4; - tab-size: 4; - -webkit-hyphens: none; - -ms-hyphens: none; - hyphens: none; -} -/* Code blocks */ -pre[class*="language-"] { - padding: 1em; - margin: 0.5em 0; - overflow: auto; - border-radius: 0.3em; -} -:not(pre) > code[class*="language-"], -pre[class*="language-"] { - background: #282a36; -} -/* Inline code */ -:not(pre) > code[class*="language-"] { - padding: 0.1em; - border-radius: 0.3em; - white-space: normal; -} -.token.comment, -.token.prolog, -.token.doctype, -.token.cdata { - color: #6272a4; -} -.token.punctuation { - color: #f8f8f2; -} -.namespace { - opacity: 0.7; -} -.token.property, -.token.tag, -.token.constant, -.token.symbol, -.token.deleted { - color: #ff79c6; -} -.token.boolean, -.token.number { - color: #bd93f9; -} -.token.selector, -.token.attr-name, -.token.string, -.token.char, -.token.builtin, -.token.inserted { - color: #50fa7b; -} -.token.operator, -.token.entity, -.token.url, -.language-css .token.string, -.style .token.string, -.token.variable { - color: #f8f8f2; -} -.token.atrule, -.token.attr-value, -.token.function, -.token.class-name { - color: #f1fa8c; -} -.token.keyword { - color: #8be9fd; -} -.token.regex, -.token.important { - color: #ffb86c; -} -.token.important, -.token.bold { - font-weight: bold; -} -.token.italic { - font-style: italic; -} -.token.entity { - cursor: help; -} -/* stylelint-enable */ -.mce-content-body { - overflow-wrap: break-word; - word-wrap: break-word; -} -.mce-content-body .mce-visual-caret { - background-color: black; - background-color: currentColor; - position: absolute; -} -.mce-content-body .mce-visual-caret-hidden { - display: none; -} -.mce-content-body *[data-mce-caret] { - left: -1000px; - margin: 0; - padding: 0; - position: absolute; - right: auto; - top: 0; -} -.mce-content-body .mce-offscreen-selection { - left: -2000000px; - max-width: 1000000px; - position: absolute; -} -.mce-content-body *[contentEditable=false] { - cursor: default; -} -.mce-content-body *[contentEditable=true] { - cursor: text; -} -.tox-cursor-format-painter { - cursor: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"), default; -} -.mce-content-body figure.align-left { - float: left; -} -.mce-content-body figure.align-right { - float: right; -} -.mce-content-body figure.image.align-center { - display: table; - margin-left: auto; - margin-right: auto; -} -.mce-preview-object { - border: 1px solid gray; - display: inline-block; - line-height: 0; - margin: 0 2px 0 2px; - position: relative; -} -.mce-preview-object .mce-shim { - background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; -} -.mce-preview-object[data-mce-selected="2"] .mce-shim { - display: none; -} -.mce-object { - background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%20fill%3D%22%23cccccc%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; - border: 1px dashed #aaa; -} -.mce-pagebreak { - border: 1px dashed #aaa; - cursor: default; - display: block; - height: 5px; - margin-top: 15px; - page-break-before: always; - width: 100%; -} -@media print { - .mce-pagebreak { - border: 0; - } -} -.tiny-pageembed .mce-shim { - background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; -} -.tiny-pageembed[data-mce-selected="2"] .mce-shim { - display: none; -} -.tiny-pageembed { - display: inline-block; - position: relative; -} -.tiny-pageembed--21by9, -.tiny-pageembed--16by9, -.tiny-pageembed--4by3, -.tiny-pageembed--1by1 { - display: block; - overflow: hidden; - padding: 0; - position: relative; - width: 100%; -} -.tiny-pageembed--21by9 { - padding-top: 42.857143%; -} -.tiny-pageembed--16by9 { - padding-top: 56.25%; -} -.tiny-pageembed--4by3 { - padding-top: 75%; -} -.tiny-pageembed--1by1 { - padding-top: 100%; -} -.tiny-pageembed--21by9 iframe, -.tiny-pageembed--16by9 iframe, -.tiny-pageembed--4by3 iframe, -.tiny-pageembed--1by1 iframe { - border: 0; - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; -} -.mce-content-body[data-mce-placeholder] { - position: relative; -} -.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before { - color: rgba(34, 47, 62, 0.7); - content: attr(data-mce-placeholder); - position: absolute; -} -.mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before { - left: 1px; -} -.mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before { - right: 1px; -} -.mce-content-body div.mce-resizehandle { - background-color: #4099ff; - border-color: #4099ff; - border-style: solid; - border-width: 1px; - box-sizing: border-box; - height: 10px; - position: absolute; - width: 10px; - z-index: 10000; -} -.mce-content-body div.mce-resizehandle:hover { - background-color: #4099ff; -} -.mce-content-body div.mce-resizehandle:nth-of-type(1) { - cursor: nwse-resize; -} -.mce-content-body div.mce-resizehandle:nth-of-type(2) { - cursor: nesw-resize; -} -.mce-content-body div.mce-resizehandle:nth-of-type(3) { - cursor: nwse-resize; -} -.mce-content-body div.mce-resizehandle:nth-of-type(4) { - cursor: nesw-resize; -} -.mce-content-body .mce-clonedresizable { - opacity: 0.5; - outline: 1px dashed black; - position: absolute; - z-index: 10000; -} -.mce-content-body .mce-clonedresizable.mce-resizetable-columns th, -.mce-content-body .mce-clonedresizable.mce-resizetable-columns td { - border: 0; -} -.mce-content-body .mce-resize-helper { - background: #555; - background: rgba(0, 0, 0, 0.75); - border: 1px; - border-radius: 3px; - color: white; - display: none; - font-family: sans-serif; - font-size: 12px; - line-height: 14px; - margin: 5px 10px; - padding: 5px; - position: absolute; - white-space: nowrap; - z-index: 10001; -} -.tox-rtc-user-selection { - position: relative; -} -.tox-rtc-user-cursor { - bottom: 0; - cursor: default; - position: absolute; - top: 0; - width: 2px; -} -.tox-rtc-user-cursor::before { - background-color: inherit; - border-radius: 50%; - content: ''; - display: block; - height: 8px; - position: absolute; - right: -3px; - top: -3px; - width: 8px; -} -.tox-rtc-user-cursor:hover::after { - background-color: inherit; - border-radius: 100px; - box-sizing: border-box; - color: #fff; - content: attr(data-user); - display: block; - font-size: 12px; - font-weight: bold; - left: -5px; - min-height: 8px; - min-width: 8px; - padding: 0 12px; - position: absolute; - top: -11px; - white-space: nowrap; - z-index: 1000; -} -.tox-rtc-user-selection--1 .tox-rtc-user-cursor { - background-color: #2dc26b; -} -.tox-rtc-user-selection--2 .tox-rtc-user-cursor { - background-color: #e03e2d; -} -.tox-rtc-user-selection--3 .tox-rtc-user-cursor { - background-color: #f1c40f; -} -.tox-rtc-user-selection--4 .tox-rtc-user-cursor { - background-color: #3598db; -} -.tox-rtc-user-selection--5 .tox-rtc-user-cursor { - background-color: #b96ad9; -} -.tox-rtc-user-selection--6 .tox-rtc-user-cursor { - background-color: #e67e23; -} -.tox-rtc-user-selection--7 .tox-rtc-user-cursor { - background-color: #aaa69d; -} -.tox-rtc-user-selection--8 .tox-rtc-user-cursor { - background-color: #f368e0; -} -.tox-rtc-remote-image { - background: #eaeaea url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2236%22%20height%3D%2212%22%20viewBox%3D%220%200%2036%2012%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Ccircle%20cx%3D%226%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2218%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.33s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2230%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.66s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A") no-repeat center center; - border: 1px solid #ccc; - min-height: 240px; - min-width: 320px; -} -.mce-match-marker { - background: #aaa; - color: #fff; -} -.mce-match-marker-selected { - background: #39f; - color: #fff; -} -.mce-match-marker-selected::-moz-selection { - background: #39f; - color: #fff; -} -.mce-match-marker-selected::selection { - background: #39f; - color: #fff; -} -.mce-content-body img[data-mce-selected], -.mce-content-body video[data-mce-selected], -.mce-content-body audio[data-mce-selected], -.mce-content-body object[data-mce-selected], -.mce-content-body embed[data-mce-selected], -.mce-content-body table[data-mce-selected] { - outline: 3px solid #4099ff; -} -.mce-content-body hr[data-mce-selected] { - outline: 3px solid #4099ff; - outline-offset: 1px; -} -.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus { - outline: 3px solid #4099ff; -} -.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover { - outline: 3px solid #4099ff; -} -.mce-content-body *[contentEditable=false][data-mce-selected] { - cursor: not-allowed; - outline: 3px solid #4099ff; -} -.mce-content-body.mce-content-readonly *[contentEditable=true]:focus, -.mce-content-body.mce-content-readonly *[contentEditable=true]:hover { - outline: none; -} -.mce-content-body *[data-mce-selected="inline-boundary"] { - background-color: #4099ff; -} -.mce-content-body .mce-edit-focus { - outline: 3px solid #4099ff; -} -.mce-content-body td[data-mce-selected], -.mce-content-body th[data-mce-selected] { - position: relative; -} -.mce-content-body td[data-mce-selected]::-moz-selection, -.mce-content-body th[data-mce-selected]::-moz-selection { - background: none; -} -.mce-content-body td[data-mce-selected]::selection, -.mce-content-body th[data-mce-selected]::selection { - background: none; -} -.mce-content-body td[data-mce-selected] *, -.mce-content-body th[data-mce-selected] * { - outline: none; - -webkit-touch-callout: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.mce-content-body td[data-mce-selected]::after, -.mce-content-body th[data-mce-selected]::after { - background-color: rgba(180, 215, 255, 0.35); - border: 1px solid transparent; - bottom: -1px; - content: ''; - left: -1px; - mix-blend-mode: lighten; - position: absolute; - right: -1px; - top: -1px; -} -@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { - .mce-content-body td[data-mce-selected]::after, - .mce-content-body th[data-mce-selected]::after { - border-color: rgba(0, 84, 180, 0.35); - } -} -.mce-content-body img::-moz-selection { - background: none; -} -.mce-content-body img::selection { - background: none; -} -.ephox-snooker-resizer-bar { - background-color: #4099ff; - opacity: 0; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.ephox-snooker-resizer-cols { - cursor: col-resize; -} -.ephox-snooker-resizer-rows { - cursor: row-resize; -} -.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging { - opacity: 1; -} -.mce-spellchecker-word { - background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); - background-position: 0 calc(100% + 1px); - background-repeat: repeat-x; - background-size: auto 6px; - cursor: default; - height: 2rem; -} -.mce-spellchecker-grammar { - background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); - background-position: 0 calc(100% + 1px); - background-repeat: repeat-x; - background-size: auto 6px; - cursor: default; -} -.mce-toc { - border: 1px solid gray; -} -.mce-toc h2 { - margin: 4px; -} -.mce-toc li { - list-style-type: none; -} -table[style*="border-width: 0px"], -.mce-item-table:not([border]), -.mce-item-table[border="0"], -table[style*="border-width: 0px"] td, -.mce-item-table:not([border]) td, -.mce-item-table[border="0"] td, -table[style*="border-width: 0px"] th, -.mce-item-table:not([border]) th, -.mce-item-table[border="0"] th, -table[style*="border-width: 0px"] caption, -.mce-item-table:not([border]) caption, -.mce-item-table[border="0"] caption { - border: 1px dashed #bbb; -} -.mce-visualblocks p, -.mce-visualblocks h1, -.mce-visualblocks h2, -.mce-visualblocks h3, -.mce-visualblocks h4, -.mce-visualblocks h5, -.mce-visualblocks h6, -.mce-visualblocks div:not([data-mce-bogus]), -.mce-visualblocks section, -.mce-visualblocks article, -.mce-visualblocks blockquote, -.mce-visualblocks address, -.mce-visualblocks pre, -.mce-visualblocks figure, -.mce-visualblocks figcaption, -.mce-visualblocks hgroup, -.mce-visualblocks aside, -.mce-visualblocks ul, -.mce-visualblocks ol, -.mce-visualblocks dl { - background-repeat: no-repeat; - border: 1px dashed #bbb; - margin-left: 3px; - padding-top: 10px; -} -.mce-visualblocks p { - background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7); -} -.mce-visualblocks h1 { - background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==); -} -.mce-visualblocks h2 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==); -} -.mce-visualblocks h3 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7); -} -.mce-visualblocks h4 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==); -} -.mce-visualblocks h5 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==); -} -.mce-visualblocks h6 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==); -} -.mce-visualblocks div:not([data-mce-bogus]) { - background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7); -} -.mce-visualblocks section { - background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=); -} -.mce-visualblocks article { - background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7); -} -.mce-visualblocks blockquote { - background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7); -} -.mce-visualblocks address { - background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=); -} -.mce-visualblocks pre { - background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==); -} -.mce-visualblocks figure { - background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7); -} -.mce-visualblocks figcaption { - border: 1px dashed #bbb; -} -.mce-visualblocks hgroup { - background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7); -} -.mce-visualblocks aside { - background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=); -} -.mce-visualblocks ul { - background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==); -} -.mce-visualblocks ol { - background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==); -} -.mce-visualblocks dl { - background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==); -} -.mce-visualblocks:not([dir=rtl]) p, -.mce-visualblocks:not([dir=rtl]) h1, -.mce-visualblocks:not([dir=rtl]) h2, -.mce-visualblocks:not([dir=rtl]) h3, -.mce-visualblocks:not([dir=rtl]) h4, -.mce-visualblocks:not([dir=rtl]) h5, -.mce-visualblocks:not([dir=rtl]) h6, -.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]), -.mce-visualblocks:not([dir=rtl]) section, -.mce-visualblocks:not([dir=rtl]) article, -.mce-visualblocks:not([dir=rtl]) blockquote, -.mce-visualblocks:not([dir=rtl]) address, -.mce-visualblocks:not([dir=rtl]) pre, -.mce-visualblocks:not([dir=rtl]) figure, -.mce-visualblocks:not([dir=rtl]) figcaption, -.mce-visualblocks:not([dir=rtl]) hgroup, -.mce-visualblocks:not([dir=rtl]) aside, -.mce-visualblocks:not([dir=rtl]) ul, -.mce-visualblocks:not([dir=rtl]) ol, -.mce-visualblocks:not([dir=rtl]) dl { - margin-left: 3px; -} -.mce-visualblocks[dir=rtl] p, -.mce-visualblocks[dir=rtl] h1, -.mce-visualblocks[dir=rtl] h2, -.mce-visualblocks[dir=rtl] h3, -.mce-visualblocks[dir=rtl] h4, -.mce-visualblocks[dir=rtl] h5, -.mce-visualblocks[dir=rtl] h6, -.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]), -.mce-visualblocks[dir=rtl] section, -.mce-visualblocks[dir=rtl] article, -.mce-visualblocks[dir=rtl] blockquote, -.mce-visualblocks[dir=rtl] address, -.mce-visualblocks[dir=rtl] pre, -.mce-visualblocks[dir=rtl] figure, -.mce-visualblocks[dir=rtl] figcaption, -.mce-visualblocks[dir=rtl] hgroup, -.mce-visualblocks[dir=rtl] aside, -.mce-visualblocks[dir=rtl] ul, -.mce-visualblocks[dir=rtl] ol, -.mce-visualblocks[dir=rtl] dl { - background-position-x: right; - margin-right: 3px; -} -.mce-nbsp, -.mce-shy { - background: #aaa; -} -.mce-shy::after { - content: '-'; -} -body { - font-family: sans-serif; -} -table { - border-collapse: collapse; -} diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.min.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.min.css deleted file mode 100644 index b483a47ea9c7..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.min.css +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ -.mce-content-body .mce-item-anchor{background:transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;cursor:default;display:inline-block;height:12px!important;padding:0 2px;-webkit-user-modify:read-only;-moz-user-modify:read-only;-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all;width:8px!important}.mce-content-body .mce-item-anchor[data-mce-selected]{outline-offset:1px}.tox-comments-visible .tox-comment{background-color:#fff0b7}.tox-comments-visible .tox-comment--active{background-color:#ffe168}.tox-checklist>li:not(.tox-checklist--hidden){list-style:none;margin:.25em 0}.tox-checklist>li:not(.tox-checklist--hidden)::before{content:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A");cursor:pointer;height:1em;margin-left:-1.5em;margin-top:.125em;position:absolute;width:1em}.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before{content:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A")}[dir=rtl] .tox-checklist>li:not(.tox-checklist--hidden)::before{margin-left:0;margin-right:-1.5em}code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;tab-size:4;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.mce-content-body{overflow-wrap:break-word;word-wrap:break-word}.mce-content-body .mce-visual-caret{background-color:#000;background-color:currentColor;position:absolute}.mce-content-body .mce-visual-caret-hidden{display:none}.mce-content-body [data-mce-caret]{left:-1000px;margin:0;padding:0;position:absolute;right:auto;top:0}.mce-content-body .mce-offscreen-selection{left:-2000000px;max-width:1000000px;position:absolute}.mce-content-body [contentEditable=false]{cursor:default}.mce-content-body [contentEditable=true]{cursor:text}.tox-cursor-format-painter{cursor:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"),default}.mce-content-body figure.align-left{float:left}.mce-content-body figure.align-right{float:right}.mce-content-body figure.image.align-center{display:table;margin-left:auto;margin-right:auto}.mce-preview-object{border:1px solid gray;display:inline-block;line-height:0;margin:0 2px 0 2px;position:relative}.mce-preview-object .mce-shim{background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);height:100%;left:0;position:absolute;top:0;width:100%}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-object{background:transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;border:1px dashed #aaa}.mce-pagebreak{border:1px dashed #aaa;cursor:default;display:block;height:5px;margin-top:15px;page-break-before:always;width:100%}@media print{.mce-pagebreak{border:0}}.tiny-pageembed .mce-shim{background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);height:100%;left:0;position:absolute;top:0;width:100%}.tiny-pageembed[data-mce-selected="2"] .mce-shim{display:none}.tiny-pageembed{display:inline-block;position:relative}.tiny-pageembed--16by9,.tiny-pageembed--1by1,.tiny-pageembed--21by9,.tiny-pageembed--4by3{display:block;overflow:hidden;padding:0;position:relative;width:100%}.tiny-pageembed--21by9{padding-top:42.857143%}.tiny-pageembed--16by9{padding-top:56.25%}.tiny-pageembed--4by3{padding-top:75%}.tiny-pageembed--1by1{padding-top:100%}.tiny-pageembed--16by9 iframe,.tiny-pageembed--1by1 iframe,.tiny-pageembed--21by9 iframe,.tiny-pageembed--4by3 iframe{border:0;height:100%;left:0;position:absolute;top:0;width:100%}.mce-content-body[data-mce-placeholder]{position:relative}.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before{color:rgba(34,47,62,.7);content:attr(data-mce-placeholder);position:absolute}.mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before{left:1px}.mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before{right:1px}.mce-content-body div.mce-resizehandle{background-color:#4099ff;border-color:#4099ff;border-style:solid;border-width:1px;box-sizing:border-box;height:10px;position:absolute;width:10px;z-index:10000}.mce-content-body div.mce-resizehandle:hover{background-color:#4099ff}.mce-content-body div.mce-resizehandle:nth-of-type(1){cursor:nwse-resize}.mce-content-body div.mce-resizehandle:nth-of-type(2){cursor:nesw-resize}.mce-content-body div.mce-resizehandle:nth-of-type(3){cursor:nwse-resize}.mce-content-body div.mce-resizehandle:nth-of-type(4){cursor:nesw-resize}.mce-content-body .mce-clonedresizable{opacity:.5;outline:1px dashed #000;position:absolute;z-index:10000}.mce-content-body .mce-clonedresizable.mce-resizetable-columns td,.mce-content-body .mce-clonedresizable.mce-resizetable-columns th{border:0}.mce-content-body .mce-resize-helper{background:#555;background:rgba(0,0,0,.75);border:1px;border-radius:3px;color:#fff;display:none;font-family:sans-serif;font-size:12px;line-height:14px;margin:5px 10px;padding:5px;position:absolute;white-space:nowrap;z-index:10001}.tox-rtc-user-selection{position:relative}.tox-rtc-user-cursor{bottom:0;cursor:default;position:absolute;top:0;width:2px}.tox-rtc-user-cursor::before{background-color:inherit;border-radius:50%;content:'';display:block;height:8px;position:absolute;right:-3px;top:-3px;width:8px}.tox-rtc-user-cursor:hover::after{background-color:inherit;border-radius:100px;box-sizing:border-box;color:#fff;content:attr(data-user);display:block;font-size:12px;font-weight:700;left:-5px;min-height:8px;min-width:8px;padding:0 12px;position:absolute;top:-11px;white-space:nowrap;z-index:1000}.tox-rtc-user-selection--1 .tox-rtc-user-cursor{background-color:#2dc26b}.tox-rtc-user-selection--2 .tox-rtc-user-cursor{background-color:#e03e2d}.tox-rtc-user-selection--3 .tox-rtc-user-cursor{background-color:#f1c40f}.tox-rtc-user-selection--4 .tox-rtc-user-cursor{background-color:#3598db}.tox-rtc-user-selection--5 .tox-rtc-user-cursor{background-color:#b96ad9}.tox-rtc-user-selection--6 .tox-rtc-user-cursor{background-color:#e67e23}.tox-rtc-user-selection--7 .tox-rtc-user-cursor{background-color:#aaa69d}.tox-rtc-user-selection--8 .tox-rtc-user-cursor{background-color:#f368e0}.tox-rtc-remote-image{background:#eaeaea url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2236%22%20height%3D%2212%22%20viewBox%3D%220%200%2036%2012%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Ccircle%20cx%3D%226%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2218%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.33s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2230%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.66s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A") no-repeat center center;border:1px solid #ccc;min-height:240px;min-width:320px}.mce-match-marker{background:#aaa;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-match-marker-selected::-moz-selection{background:#39f;color:#fff}.mce-match-marker-selected::selection{background:#39f;color:#fff}.mce-content-body audio[data-mce-selected],.mce-content-body embed[data-mce-selected],.mce-content-body img[data-mce-selected],.mce-content-body object[data-mce-selected],.mce-content-body table[data-mce-selected],.mce-content-body video[data-mce-selected]{outline:3px solid #b4d7ff}.mce-content-body hr[data-mce-selected]{outline:3px solid #b4d7ff;outline-offset:1px}.mce-content-body [contentEditable=false] [contentEditable=true]:focus{outline:3px solid #b4d7ff}.mce-content-body [contentEditable=false] [contentEditable=true]:hover{outline:3px solid #b4d7ff}.mce-content-body [contentEditable=false][data-mce-selected]{cursor:not-allowed;outline:3px solid #b4d7ff}.mce-content-body.mce-content-readonly [contentEditable=true]:focus,.mce-content-body.mce-content-readonly [contentEditable=true]:hover{outline:0}.mce-content-body [data-mce-selected=inline-boundary]{background-color:#b4d7ff}.mce-content-body .mce-edit-focus{outline:3px solid #b4d7ff}.mce-content-body td[data-mce-selected],.mce-content-body th[data-mce-selected]{position:relative}.mce-content-body td[data-mce-selected]::-moz-selection,.mce-content-body th[data-mce-selected]::-moz-selection{background:0 0}.mce-content-body td[data-mce-selected]::selection,.mce-content-body th[data-mce-selected]::selection{background:0 0}.mce-content-body td[data-mce-selected] *,.mce-content-body th[data-mce-selected] *{outline:0;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mce-content-body td[data-mce-selected]::after,.mce-content-body th[data-mce-selected]::after{background-color:rgba(180,215,255,.35);border:1px solid rgba(180,215,255,.35);bottom:-1px;content:'';left:-1px;mix-blend-mode:multiply;position:absolute;right:-1px;top:-1px}@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){.mce-content-body td[data-mce-selected]::after,.mce-content-body th[data-mce-selected]::after{border-color:rgba(0,84,180,.35)}}.mce-content-body img::-moz-selection{background:0 0}.mce-content-body img::selection{background:0 0}.ephox-snooker-resizer-bar{background-color:#b4d7ff;opacity:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ephox-snooker-resizer-cols{cursor:col-resize}.ephox-snooker-resizer-rows{cursor:row-resize}.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity:1}.mce-spellchecker-word{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position:0 calc(100% + 1px);background-repeat:repeat-x;background-size:auto 6px;cursor:default;height:2rem}.mce-spellchecker-grammar{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position:0 calc(100% + 1px);background-repeat:repeat-x;background-size:auto 6px;cursor:default}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-item-table:not([border]),.mce-item-table:not([border]) caption,.mce-item-table:not([border]) td,.mce-item-table:not([border]) th,.mce-item-table[border="0"],.mce-item-table[border="0"] caption,.mce-item-table[border="0"] td,.mce-item-table[border="0"] th,table[style*="border-width: 0px"],table[style*="border-width: 0px"] caption,table[style*="border-width: 0px"] td,table[style*="border-width: 0px"] th{border:1px dashed #bbb}.mce-visualblocks address,.mce-visualblocks article,.mce-visualblocks aside,.mce-visualblocks blockquote,.mce-visualblocks div:not([data-mce-bogus]),.mce-visualblocks dl,.mce-visualblocks figcaption,.mce-visualblocks figure,.mce-visualblocks h1,.mce-visualblocks h2,.mce-visualblocks h3,.mce-visualblocks h4,.mce-visualblocks h5,.mce-visualblocks h6,.mce-visualblocks hgroup,.mce-visualblocks ol,.mce-visualblocks p,.mce-visualblocks pre,.mce-visualblocks section,.mce-visualblocks ul{background-repeat:no-repeat;border:1px dashed #bbb;margin-left:3px;padding-top:10px}.mce-visualblocks p{background-image:url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7)}.mce-visualblocks h1{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==)}.mce-visualblocks h2{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==)}.mce-visualblocks h3{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7)}.mce-visualblocks h4{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==)}.mce-visualblocks h5{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==)}.mce-visualblocks h6{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==)}.mce-visualblocks div:not([data-mce-bogus]){background-image:url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7)}.mce-visualblocks section{background-image:url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=)}.mce-visualblocks article{background-image:url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7)}.mce-visualblocks blockquote{background-image:url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7)}.mce-visualblocks address{background-image:url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=)}.mce-visualblocks pre{background-image:url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==)}.mce-visualblocks figure{background-image:url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7)}.mce-visualblocks figcaption{border:1px dashed #bbb}.mce-visualblocks hgroup{background-image:url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7)}.mce-visualblocks aside{background-image:url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=)}.mce-visualblocks ul{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==)}.mce-visualblocks ol{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==)}.mce-visualblocks dl{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==)}.mce-visualblocks:not([dir=rtl]) address,.mce-visualblocks:not([dir=rtl]) article,.mce-visualblocks:not([dir=rtl]) aside,.mce-visualblocks:not([dir=rtl]) blockquote,.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]),.mce-visualblocks:not([dir=rtl]) dl,.mce-visualblocks:not([dir=rtl]) figcaption,.mce-visualblocks:not([dir=rtl]) figure,.mce-visualblocks:not([dir=rtl]) h1,.mce-visualblocks:not([dir=rtl]) h2,.mce-visualblocks:not([dir=rtl]) h3,.mce-visualblocks:not([dir=rtl]) h4,.mce-visualblocks:not([dir=rtl]) h5,.mce-visualblocks:not([dir=rtl]) h6,.mce-visualblocks:not([dir=rtl]) hgroup,.mce-visualblocks:not([dir=rtl]) ol,.mce-visualblocks:not([dir=rtl]) p,.mce-visualblocks:not([dir=rtl]) pre,.mce-visualblocks:not([dir=rtl]) section,.mce-visualblocks:not([dir=rtl]) ul{margin-left:3px}.mce-visualblocks[dir=rtl] address,.mce-visualblocks[dir=rtl] article,.mce-visualblocks[dir=rtl] aside,.mce-visualblocks[dir=rtl] blockquote,.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]),.mce-visualblocks[dir=rtl] dl,.mce-visualblocks[dir=rtl] figcaption,.mce-visualblocks[dir=rtl] figure,.mce-visualblocks[dir=rtl] h1,.mce-visualblocks[dir=rtl] h2,.mce-visualblocks[dir=rtl] h3,.mce-visualblocks[dir=rtl] h4,.mce-visualblocks[dir=rtl] h5,.mce-visualblocks[dir=rtl] h6,.mce-visualblocks[dir=rtl] hgroup,.mce-visualblocks[dir=rtl] ol,.mce-visualblocks[dir=rtl] p,.mce-visualblocks[dir=rtl] pre,.mce-visualblocks[dir=rtl] section,.mce-visualblocks[dir=rtl] ul{background-position-x:right;margin-right:3px}.mce-nbsp,.mce-shy{background:#aaa}.mce-shy::after{content:'-'} -/*# sourceMappingURL=content.inline.min.css.map */ diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.min.css.map b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.min.css.map deleted file mode 100644 index 4655f9b5bb1e..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.min.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["ui/dark/content.inline.css"],"names":[],"mappings":";;;;;;AAMA,mCACE,WAAY,YAAY,sNAAsN,UAAU,OACxP,OAAQ,QACR,QAAS,aACT,OAAQ,eACR,QAAS,EAAE,IACX,oBAAqB,UACrB,iBAAkB,UAClB,oBAAqB,IACrB,iBAAkB,IAClB,gBAAiB,IACb,YAAa,IACjB,MAAO,cAET,sDACE,eAAgB,IAElB,mCACE,iBAAkB,QAEpB,2CACE,iBAAkB,QAEpB,8CACE,WAAY,KACZ,OAAQ,MAAO,EAEjB,sDACE,QAAS,gdACT,OAAQ,QACR,OAAQ,IACR,YAAa,OACb,WAAY,OACZ,SAAU,SACV,MAAO,IAET,6EACE,QAAS,shCAEX,gEACE,YAAa,EACb,aAAc,OAShB,uBACA,sBACE,MAAO,KACP,WAAY,IACZ,YAAa,EAAE,IAAI,KACnB,YAAa,QAAQ,CAAE,MAAM,CAAE,aAAa,CAAE,aAAa,CAAE,UAC7D,UAAW,IACX,WAAY,KACZ,YAAa,IACb,aAAc,OACd,WAAY,OACZ,UAAW,OACX,YAAa,IACb,cAAe,EACf,SAAU,EACV,gBAAiB,KACjB,YAAa,KACb,QAAS,KAKX,wCADA,uCADA,uCADA,sCAIE,YAAa,KACb,WAAY,QAKd,mCADA,kCADA,kCADA,iCAIE,YAAa,KACb,WAAY,QAEd,aACE,uBACA,sBACE,YAAa,MAIjB,sBACE,QAAS,IACT,OAAQ,KAAM,EACd,SAAU,KAEZ,iCACA,sBACE,WAAY,QAGd,iCACE,QAAS,KACT,cAAe,KACf,YAAa,OAKf,aAHA,eAEA,eADA,cAGE,MAAO,QAET,mBACE,MAAO,KAET,WACE,QAAS,GAIX,eAEA,gBAEA,eAHA,cAHA,gBAKA,cAJA,WAME,MAAO,KAGT,iBAGA,eADA,YAEA,gBALA,gBAEA,cAIE,MAAO,KAKT,4BACA,qBAHA,cADA,gBAEA,WAGE,MAAO,QACP,WAAY,mBAEd,cACA,kBACA,eACE,MAAO,KAGT,kBADA,gBAEE,MAAO,QAGT,iBADA,aAEA,gBACE,MAAO,KAGT,YADA,iBAEE,YAAa,IAEf,cACE,WAAY,OAEd,cACE,OAAQ,KAGV,kBACE,cAAe,WACf,UAAW,WAEb,oCACE,iBAAkB,KAClB,iBAAkB,aAClB,SAAU,SAEZ,2CACE,QAAS,KAEX,mCACE,KAAM,QACN,OAAQ,EACR,QAAS,EACT,SAAU,SACV,MAAO,KACP,IAAK,EAEP,2CACE,KAAM,WACN,UAAW,UACX,SAAU,SAEZ,0CACE,OAAQ,QAEV,yCACE,OAAQ,KAEV,2BACE,OAAQ,qkCAAqkC,CAAE,QAEjlC,oCACE,MAAO,KAET,qCACE,MAAO,MAET,4CACE,QAAS,MACT,YAAa,KACb,aAAc,KAEhB,oBACE,OAAQ,IAAI,MAAM,KAClB,QAAS,aACT,YAAa,EACb,OAAQ,EAAE,IAAI,EAAE,IAChB,SAAU,SAEZ,8BACE,WAAY,oFACZ,OAAQ,KACR,KAAM,EACN,SAAU,SACV,IAAK,EACL,MAAO,KAET,qDACE,QAAS,KAEX,YACE,WAAY,YAAY,0bAA0b,UAAU,OAC5d,OAAQ,IAAI,OAAO,KAErB,eACE,OAAQ,IAAI,OAAO,KACnB,OAAQ,QACR,QAAS,MACT,OAAQ,IACR,WAAY,KACZ,kBAAmB,OACnB,MAAO,KAET,aACE,eACE,OAAQ,GAGZ,0BACE,WAAY,oFACZ,OAAQ,KACR,KAAM,EACN,SAAU,SACV,IAAK,EACL,MAAO,KAET,iDACE,QAAS,KAEX,gBACE,QAAS,aACT,SAAU,SAGZ,uBAEA,sBAHA,uBAEA,sBAEE,QAAS,MACT,SAAU,OACV,QAAS,EACT,SAAU,SACV,MAAO,KAET,uBACE,YAAa,WAEf,uBACE,YAAa,OAEf,sBACE,YAAa,IAEf,sBACE,YAAa,KAGf,8BAEA,6BAHA,8BAEA,6BAEE,OAAQ,EACR,OAAQ,KACR,KAAM,EACN,SAAU,SACV,IAAK,EACL,MAAO,KAET,wCACE,SAAU,SAEZ,uEACE,MAAO,kBACP,QAAS,2BACT,SAAU,SAEZ,sFACE,KAAM,IAER,gFACE,MAAO,IAET,uCACE,iBAAkB,QAClB,aAAc,QACd,aAAc,MACd,aAAc,IACd,WAAY,WACZ,OAAQ,KACR,SAAU,SACV,MAAO,KACP,QAAS,MAEX,6CACE,iBAAkB,QAEpB,sDACE,OAAQ,YAEV,sDACE,OAAQ,YAEV,sDACE,OAAQ,YAEV,sDACE,OAAQ,YAEV,uCACE,QAAS,GACT,QAAS,IAAI,OAAO,KACpB,SAAU,SACV,QAAS,MAGX,kEADA,kEAEE,OAAQ,EAEV,qCACE,WAAY,KACZ,WAAY,gBACZ,OAAQ,IACR,cAAe,IACf,MAAO,KACP,QAAS,KACT,YAAa,WACb,UAAW,KACX,YAAa,KACb,OAAQ,IAAI,KACZ,QAAS,IACT,SAAU,SACV,YAAa,OACb,QAAS,MAEX,wBACE,SAAU,SAEZ,qBACE,OAAQ,EACR,OAAQ,QACR,SAAU,SACV,IAAK,EACL,MAAO,IAET,6BACE,iBAAkB,QAClB,cAAe,IACf,QAAS,GACT,QAAS,MACT,OAAQ,IACR,SAAU,SACV,MAAO,KACP,IAAK,KACL,MAAO,IAET,kCACE,iBAAkB,QAClB,cAAe,MACf,WAAY,WACZ,MAAO,KACP,QAAS,gBACT,QAAS,MACT,UAAW,KACX,YAAa,IACb,KAAM,KACN,WAAY,IACZ,UAAW,IACX,QAAS,EAAE,KACX,SAAU,SACV,IAAK,MACL,YAAa,OACb,QAAS,KAEX,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,sBACE,WAAY,QAAQ,ymCAAymC,UAAU,OAAO,OAC9oC,OAAQ,IAAI,MAAM,KAClB,WAAY,MACZ,UAAW,MAEb,kBACE,WAAY,KACZ,MAAO,KAET,2BACE,WAAY,KACZ,MAAO,KAET,2CACE,WAAY,KACZ,MAAO,KAET,sCACE,WAAY,KACZ,MAAO,KAIT,2CAEA,2CAJA,yCAGA,4CAEA,2CAJA,2CAKE,QAAS,IAAI,MAAM,QAErB,wCACE,QAAS,IAAI,MAAM,QACnB,eAAgB,IAElB,uEACE,QAAS,IAAI,MAAM,QAErB,uEACE,QAAS,IAAI,MAAM,QAErB,6DACE,OAAQ,YACR,QAAS,IAAI,MAAM,QAErB,oEACA,oEACE,QAAS,EAEX,sDACE,iBAAkB,QAEpB,kCACE,QAAS,IAAI,MAAM,QAErB,wCACA,wCACE,SAAU,SAEZ,wDACA,wDACE,WAAY,IAEd,mDACA,mDACE,WAAY,IAEd,0CACA,0CACE,QAAS,EACT,sBAAuB,KACvB,oBAAqB,KAClB,iBAAkB,KACjB,gBAAiB,KACb,YAAa,KAEvB,+CACA,+CACE,iBAAkB,sBAClB,OAAQ,IAAI,MAAM,sBAClB,OAAQ,KACR,QAAS,GACT,KAAM,KACN,eAAgB,SAChB,SAAU,SACV,MAAO,KACP,IAAK,KAEP,6CAA+C,yBAC7C,+CACA,+CACE,aAAc,oBAGlB,sCACE,WAAY,IAEd,iCACE,WAAY,IAEd,2BACE,iBAAkB,QAClB,QAAS,EACT,oBAAqB,KACrB,iBAAkB,KAClB,gBAAiB,KACjB,YAAa,KAEf,4BACE,OAAQ,WAEV,4BACE,OAAQ,WAEV,8DACE,QAAS,EAEX,uBACE,iBAAkB,oRAClB,oBAAqB,EAAE,iBACvB,kBAAmB,SACnB,gBAAiB,KAAK,IACtB,OAAQ,QACR,OAAQ,KAEV,0BACE,iBAAkB,2PAClB,oBAAqB,EAAE,iBACvB,kBAAmB,SACnB,gBAAiB,KAAK,IACtB,OAAQ,QAEV,SACE,OAAQ,IAAI,MAAM,KAEpB,YACE,OAAQ,IAEV,YACE,gBAAiB,KAGnB,8BASA,sCANA,iCAGA,iCALA,4BASA,oCANA,+BAGA,+BARA,kCASA,0CANA,qCAGA,qCAME,OAAQ,IAAI,OAAO,KAarB,0BAFA,0BAOA,wBANA,6BAHA,4CAYA,qBALA,6BADA,yBAZA,qBACA,qBACA,qBACA,qBACA,qBACA,qBASA,yBAGA,qBAlBA,oBAYA,sBAJA,0BASA,qBAGE,kBAAmB,UACnB,OAAQ,IAAI,OAAO,KACnB,YAAa,IACb,YAAa,KAEf,oBACE,iBAAkB,gHAEpB,qBACE,iBAAkB,oHAEpB,qBACE,iBAAkB,wHAEpB,qBACE,iBAAkB,oHAEpB,qBACE,iBAAkB,wHAEpB,qBACE,iBAAkB,wHAEpB,qBACE,iBAAkB,wHAEpB,4CACE,iBAAkB,4HAEpB,0BACE,iBAAkB,gKAEpB,0BACE,iBAAkB,gKAEpB,6BACE,iBAAkB,4LAEpB,0BACE,iBAAkB,wKAEpB,sBACE,iBAAkB,oIAEpB,yBACE,iBAAkB,wJAEpB,6BACE,OAAQ,IAAI,OAAO,KAErB,yBACE,iBAAkB,4JAEpB,wBACE,iBAAkB,gJAEpB,qBACE,iBAAkB,oHAEpB,qBACE,iBAAkB,oHAEpB,qBACE,iBAAkB,oHAapB,yCAFA,yCAOA,uCANA,4CAHA,2DAYA,oCALA,4CADA,wCAZA,oCACA,oCACA,oCACA,oCACA,oCACA,oCASA,wCAGA,oCAlBA,mCAYA,qCAJA,yCASA,oCAGE,YAAa,IAaf,mCAFA,mCAOA,iCANA,sCAHA,qDAYA,8BALA,sCADA,kCAZA,8BACA,8BACA,8BACA,8BACA,8BACA,8BASA,kCAGA,8BAlBA,6BAYA,+BAJA,mCASA,8BAGE,sBAAuB,MACvB,aAAc,IAEhB,UACA,SACE,WAAY,KAEd,gBACE,QAAS","file":"content.inline.min.css","sourcesContent":["/**\n * Copyright (c) Tiny Technologies, Inc. All rights reserved.\n * Licensed under the LGPL or a commercial license.\n * For LGPL see License.txt in the project root for license information.\n * For commercial licenses see https://www.tiny.cloud/\n */\n.mce-content-body .mce-item-anchor {\n background: transparent url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A\") no-repeat center;\n cursor: default;\n display: inline-block;\n height: 12px !important;\n padding: 0 2px;\n -webkit-user-modify: read-only;\n -moz-user-modify: read-only;\n -webkit-user-select: all;\n -moz-user-select: all;\n -ms-user-select: all;\n user-select: all;\n width: 8px !important;\n}\n.mce-content-body .mce-item-anchor[data-mce-selected] {\n outline-offset: 1px;\n}\n.tox-comments-visible .tox-comment {\n background-color: #fff0b7;\n}\n.tox-comments-visible .tox-comment--active {\n background-color: #ffe168;\n}\n.tox-checklist > li:not(.tox-checklist--hidden) {\n list-style: none;\n margin: 0.25em 0;\n}\n.tox-checklist > li:not(.tox-checklist--hidden)::before {\n content: url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A\");\n cursor: pointer;\n height: 1em;\n margin-left: -1.5em;\n margin-top: 0.125em;\n position: absolute;\n width: 1em;\n}\n.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before {\n content: url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A\");\n}\n[dir=rtl] .tox-checklist > li:not(.tox-checklist--hidden)::before {\n margin-left: 0;\n margin-right: -1.5em;\n}\n/* stylelint-disable */\n/* http://prismjs.com/ */\n/**\n * prism.js default theme for JavaScript, CSS and HTML\n * Based on dabblet (http://dabblet.com)\n * @author Lea Verou\n */\ncode[class*=\"language-\"],\npre[class*=\"language-\"] {\n color: black;\n background: none;\n text-shadow: 0 1px white;\n font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;\n font-size: 1em;\n text-align: left;\n white-space: pre;\n word-spacing: normal;\n word-break: normal;\n word-wrap: normal;\n line-height: 1.5;\n -moz-tab-size: 4;\n tab-size: 4;\n -webkit-hyphens: none;\n -ms-hyphens: none;\n hyphens: none;\n}\npre[class*=\"language-\"]::-moz-selection,\npre[class*=\"language-\"] ::-moz-selection,\ncode[class*=\"language-\"]::-moz-selection,\ncode[class*=\"language-\"] ::-moz-selection {\n text-shadow: none;\n background: #b3d4fc;\n}\npre[class*=\"language-\"]::selection,\npre[class*=\"language-\"] ::selection,\ncode[class*=\"language-\"]::selection,\ncode[class*=\"language-\"] ::selection {\n text-shadow: none;\n background: #b3d4fc;\n}\n@media print {\n code[class*=\"language-\"],\n pre[class*=\"language-\"] {\n text-shadow: none;\n }\n}\n/* Code blocks */\npre[class*=\"language-\"] {\n padding: 1em;\n margin: 0.5em 0;\n overflow: auto;\n}\n:not(pre) > code[class*=\"language-\"],\npre[class*=\"language-\"] {\n background: #f5f2f0;\n}\n/* Inline code */\n:not(pre) > code[class*=\"language-\"] {\n padding: 0.1em;\n border-radius: 0.3em;\n white-space: normal;\n}\n.token.comment,\n.token.prolog,\n.token.doctype,\n.token.cdata {\n color: slategray;\n}\n.token.punctuation {\n color: #999;\n}\n.namespace {\n opacity: 0.7;\n}\n.token.property,\n.token.tag,\n.token.boolean,\n.token.number,\n.token.constant,\n.token.symbol,\n.token.deleted {\n color: #905;\n}\n.token.selector,\n.token.attr-name,\n.token.string,\n.token.char,\n.token.builtin,\n.token.inserted {\n color: #690;\n}\n.token.operator,\n.token.entity,\n.token.url,\n.language-css .token.string,\n.style .token.string {\n color: #9a6e3a;\n background: hsla(0, 0%, 100%, 0.5);\n}\n.token.atrule,\n.token.attr-value,\n.token.keyword {\n color: #07a;\n}\n.token.function,\n.token.class-name {\n color: #DD4A68;\n}\n.token.regex,\n.token.important,\n.token.variable {\n color: #e90;\n}\n.token.important,\n.token.bold {\n font-weight: bold;\n}\n.token.italic {\n font-style: italic;\n}\n.token.entity {\n cursor: help;\n}\n/* stylelint-enable */\n.mce-content-body {\n overflow-wrap: break-word;\n word-wrap: break-word;\n}\n.mce-content-body .mce-visual-caret {\n background-color: black;\n background-color: currentColor;\n position: absolute;\n}\n.mce-content-body .mce-visual-caret-hidden {\n display: none;\n}\n.mce-content-body *[data-mce-caret] {\n left: -1000px;\n margin: 0;\n padding: 0;\n position: absolute;\n right: auto;\n top: 0;\n}\n.mce-content-body .mce-offscreen-selection {\n left: -2000000px;\n max-width: 1000000px;\n position: absolute;\n}\n.mce-content-body *[contentEditable=false] {\n cursor: default;\n}\n.mce-content-body *[contentEditable=true] {\n cursor: text;\n}\n.tox-cursor-format-painter {\n cursor: url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A\"), default;\n}\n.mce-content-body figure.align-left {\n float: left;\n}\n.mce-content-body figure.align-right {\n float: right;\n}\n.mce-content-body figure.image.align-center {\n display: table;\n margin-left: auto;\n margin-right: auto;\n}\n.mce-preview-object {\n border: 1px solid gray;\n display: inline-block;\n line-height: 0;\n margin: 0 2px 0 2px;\n position: relative;\n}\n.mce-preview-object .mce-shim {\n background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n}\n.mce-preview-object[data-mce-selected=\"2\"] .mce-shim {\n display: none;\n}\n.mce-object {\n background: transparent url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A\") no-repeat center;\n border: 1px dashed #aaa;\n}\n.mce-pagebreak {\n border: 1px dashed #aaa;\n cursor: default;\n display: block;\n height: 5px;\n margin-top: 15px;\n page-break-before: always;\n width: 100%;\n}\n@media print {\n .mce-pagebreak {\n border: 0;\n }\n}\n.tiny-pageembed .mce-shim {\n background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n}\n.tiny-pageembed[data-mce-selected=\"2\"] .mce-shim {\n display: none;\n}\n.tiny-pageembed {\n display: inline-block;\n position: relative;\n}\n.tiny-pageembed--21by9,\n.tiny-pageembed--16by9,\n.tiny-pageembed--4by3,\n.tiny-pageembed--1by1 {\n display: block;\n overflow: hidden;\n padding: 0;\n position: relative;\n width: 100%;\n}\n.tiny-pageembed--21by9 {\n padding-top: 42.857143%;\n}\n.tiny-pageembed--16by9 {\n padding-top: 56.25%;\n}\n.tiny-pageembed--4by3 {\n padding-top: 75%;\n}\n.tiny-pageembed--1by1 {\n padding-top: 100%;\n}\n.tiny-pageembed--21by9 iframe,\n.tiny-pageembed--16by9 iframe,\n.tiny-pageembed--4by3 iframe,\n.tiny-pageembed--1by1 iframe {\n border: 0;\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n}\n.mce-content-body[data-mce-placeholder] {\n position: relative;\n}\n.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before {\n color: rgba(34, 47, 62, 0.7);\n content: attr(data-mce-placeholder);\n position: absolute;\n}\n.mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before {\n left: 1px;\n}\n.mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before {\n right: 1px;\n}\n.mce-content-body div.mce-resizehandle {\n background-color: #4099ff;\n border-color: #4099ff;\n border-style: solid;\n border-width: 1px;\n box-sizing: border-box;\n height: 10px;\n position: absolute;\n width: 10px;\n z-index: 10000;\n}\n.mce-content-body div.mce-resizehandle:hover {\n background-color: #4099ff;\n}\n.mce-content-body div.mce-resizehandle:nth-of-type(1) {\n cursor: nwse-resize;\n}\n.mce-content-body div.mce-resizehandle:nth-of-type(2) {\n cursor: nesw-resize;\n}\n.mce-content-body div.mce-resizehandle:nth-of-type(3) {\n cursor: nwse-resize;\n}\n.mce-content-body div.mce-resizehandle:nth-of-type(4) {\n cursor: nesw-resize;\n}\n.mce-content-body .mce-clonedresizable {\n opacity: 0.5;\n outline: 1px dashed black;\n position: absolute;\n z-index: 10000;\n}\n.mce-content-body .mce-clonedresizable.mce-resizetable-columns th,\n.mce-content-body .mce-clonedresizable.mce-resizetable-columns td {\n border: 0;\n}\n.mce-content-body .mce-resize-helper {\n background: #555;\n background: rgba(0, 0, 0, 0.75);\n border: 1px;\n border-radius: 3px;\n color: white;\n display: none;\n font-family: sans-serif;\n font-size: 12px;\n line-height: 14px;\n margin: 5px 10px;\n padding: 5px;\n position: absolute;\n white-space: nowrap;\n z-index: 10001;\n}\n.tox-rtc-user-selection {\n position: relative;\n}\n.tox-rtc-user-cursor {\n bottom: 0;\n cursor: default;\n position: absolute;\n top: 0;\n width: 2px;\n}\n.tox-rtc-user-cursor::before {\n background-color: inherit;\n border-radius: 50%;\n content: '';\n display: block;\n height: 8px;\n position: absolute;\n right: -3px;\n top: -3px;\n width: 8px;\n}\n.tox-rtc-user-cursor:hover::after {\n background-color: inherit;\n border-radius: 100px;\n box-sizing: border-box;\n color: #fff;\n content: attr(data-user);\n display: block;\n font-size: 12px;\n font-weight: bold;\n left: -5px;\n min-height: 8px;\n min-width: 8px;\n padding: 0 12px;\n position: absolute;\n top: -11px;\n white-space: nowrap;\n z-index: 1000;\n}\n.tox-rtc-user-selection--1 .tox-rtc-user-cursor {\n background-color: #2dc26b;\n}\n.tox-rtc-user-selection--2 .tox-rtc-user-cursor {\n background-color: #e03e2d;\n}\n.tox-rtc-user-selection--3 .tox-rtc-user-cursor {\n background-color: #f1c40f;\n}\n.tox-rtc-user-selection--4 .tox-rtc-user-cursor {\n background-color: #3598db;\n}\n.tox-rtc-user-selection--5 .tox-rtc-user-cursor {\n background-color: #b96ad9;\n}\n.tox-rtc-user-selection--6 .tox-rtc-user-cursor {\n background-color: #e67e23;\n}\n.tox-rtc-user-selection--7 .tox-rtc-user-cursor {\n background-color: #aaa69d;\n}\n.tox-rtc-user-selection--8 .tox-rtc-user-cursor {\n background-color: #f368e0;\n}\n.tox-rtc-remote-image {\n background: #eaeaea url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2236%22%20height%3D%2212%22%20viewBox%3D%220%200%2036%2012%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Ccircle%20cx%3D%226%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2218%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.33s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2230%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.66s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A\") no-repeat center center;\n border: 1px solid #ccc;\n min-height: 240px;\n min-width: 320px;\n}\n.mce-match-marker {\n background: #aaa;\n color: #fff;\n}\n.mce-match-marker-selected {\n background: #39f;\n color: #fff;\n}\n.mce-match-marker-selected::-moz-selection {\n background: #39f;\n color: #fff;\n}\n.mce-match-marker-selected::selection {\n background: #39f;\n color: #fff;\n}\n.mce-content-body img[data-mce-selected],\n.mce-content-body video[data-mce-selected],\n.mce-content-body audio[data-mce-selected],\n.mce-content-body object[data-mce-selected],\n.mce-content-body embed[data-mce-selected],\n.mce-content-body table[data-mce-selected] {\n outline: 3px solid #b4d7ff;\n}\n.mce-content-body hr[data-mce-selected] {\n outline: 3px solid #b4d7ff;\n outline-offset: 1px;\n}\n.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus {\n outline: 3px solid #b4d7ff;\n}\n.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover {\n outline: 3px solid #b4d7ff;\n}\n.mce-content-body *[contentEditable=false][data-mce-selected] {\n cursor: not-allowed;\n outline: 3px solid #b4d7ff;\n}\n.mce-content-body.mce-content-readonly *[contentEditable=true]:focus,\n.mce-content-body.mce-content-readonly *[contentEditable=true]:hover {\n outline: none;\n}\n.mce-content-body *[data-mce-selected=\"inline-boundary\"] {\n background-color: #b4d7ff;\n}\n.mce-content-body .mce-edit-focus {\n outline: 3px solid #b4d7ff;\n}\n.mce-content-body td[data-mce-selected],\n.mce-content-body th[data-mce-selected] {\n position: relative;\n}\n.mce-content-body td[data-mce-selected]::-moz-selection,\n.mce-content-body th[data-mce-selected]::-moz-selection {\n background: none;\n}\n.mce-content-body td[data-mce-selected]::selection,\n.mce-content-body th[data-mce-selected]::selection {\n background: none;\n}\n.mce-content-body td[data-mce-selected] *,\n.mce-content-body th[data-mce-selected] * {\n outline: none;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.mce-content-body td[data-mce-selected]::after,\n.mce-content-body th[data-mce-selected]::after {\n background-color: rgba(180, 215, 255, 0.35);\n border: 1px solid rgba(180, 215, 255, 0.35);\n bottom: -1px;\n content: '';\n left: -1px;\n mix-blend-mode: multiply;\n position: absolute;\n right: -1px;\n top: -1px;\n}\n@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n .mce-content-body td[data-mce-selected]::after,\n .mce-content-body th[data-mce-selected]::after {\n border-color: rgba(0, 84, 180, 0.35);\n }\n}\n.mce-content-body img::-moz-selection {\n background: none;\n}\n.mce-content-body img::selection {\n background: none;\n}\n.ephox-snooker-resizer-bar {\n background-color: #b4d7ff;\n opacity: 0;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.ephox-snooker-resizer-cols {\n cursor: col-resize;\n}\n.ephox-snooker-resizer-rows {\n cursor: row-resize;\n}\n.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging {\n opacity: 1;\n}\n.mce-spellchecker-word {\n background-image: url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A\");\n background-position: 0 calc(100% + 1px);\n background-repeat: repeat-x;\n background-size: auto 6px;\n cursor: default;\n height: 2rem;\n}\n.mce-spellchecker-grammar {\n background-image: url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A\");\n background-position: 0 calc(100% + 1px);\n background-repeat: repeat-x;\n background-size: auto 6px;\n cursor: default;\n}\n.mce-toc {\n border: 1px solid gray;\n}\n.mce-toc h2 {\n margin: 4px;\n}\n.mce-toc li {\n list-style-type: none;\n}\ntable[style*=\"border-width: 0px\"],\n.mce-item-table:not([border]),\n.mce-item-table[border=\"0\"],\ntable[style*=\"border-width: 0px\"] td,\n.mce-item-table:not([border]) td,\n.mce-item-table[border=\"0\"] td,\ntable[style*=\"border-width: 0px\"] th,\n.mce-item-table:not([border]) th,\n.mce-item-table[border=\"0\"] th,\ntable[style*=\"border-width: 0px\"] caption,\n.mce-item-table:not([border]) caption,\n.mce-item-table[border=\"0\"] caption {\n border: 1px dashed #bbb;\n}\n.mce-visualblocks p,\n.mce-visualblocks h1,\n.mce-visualblocks h2,\n.mce-visualblocks h3,\n.mce-visualblocks h4,\n.mce-visualblocks h5,\n.mce-visualblocks h6,\n.mce-visualblocks div:not([data-mce-bogus]),\n.mce-visualblocks section,\n.mce-visualblocks article,\n.mce-visualblocks blockquote,\n.mce-visualblocks address,\n.mce-visualblocks pre,\n.mce-visualblocks figure,\n.mce-visualblocks figcaption,\n.mce-visualblocks hgroup,\n.mce-visualblocks aside,\n.mce-visualblocks ul,\n.mce-visualblocks ol,\n.mce-visualblocks dl {\n background-repeat: no-repeat;\n border: 1px dashed #bbb;\n margin-left: 3px;\n padding-top: 10px;\n}\n.mce-visualblocks p {\n background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7);\n}\n.mce-visualblocks h1 {\n background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==);\n}\n.mce-visualblocks h2 {\n background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==);\n}\n.mce-visualblocks h3 {\n background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7);\n}\n.mce-visualblocks h4 {\n background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==);\n}\n.mce-visualblocks h5 {\n background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==);\n}\n.mce-visualblocks h6 {\n background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==);\n}\n.mce-visualblocks div:not([data-mce-bogus]) {\n background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7);\n}\n.mce-visualblocks section {\n background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=);\n}\n.mce-visualblocks article {\n background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7);\n}\n.mce-visualblocks blockquote {\n background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7);\n}\n.mce-visualblocks address {\n background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=);\n}\n.mce-visualblocks pre {\n background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==);\n}\n.mce-visualblocks figure {\n background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7);\n}\n.mce-visualblocks figcaption {\n border: 1px dashed #bbb;\n}\n.mce-visualblocks hgroup {\n background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7);\n}\n.mce-visualblocks aside {\n background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=);\n}\n.mce-visualblocks ul {\n background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==);\n}\n.mce-visualblocks ol {\n background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==);\n}\n.mce-visualblocks dl {\n background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==);\n}\n.mce-visualblocks:not([dir=rtl]) p,\n.mce-visualblocks:not([dir=rtl]) h1,\n.mce-visualblocks:not([dir=rtl]) h2,\n.mce-visualblocks:not([dir=rtl]) h3,\n.mce-visualblocks:not([dir=rtl]) h4,\n.mce-visualblocks:not([dir=rtl]) h5,\n.mce-visualblocks:not([dir=rtl]) h6,\n.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]),\n.mce-visualblocks:not([dir=rtl]) section,\n.mce-visualblocks:not([dir=rtl]) article,\n.mce-visualblocks:not([dir=rtl]) blockquote,\n.mce-visualblocks:not([dir=rtl]) address,\n.mce-visualblocks:not([dir=rtl]) pre,\n.mce-visualblocks:not([dir=rtl]) figure,\n.mce-visualblocks:not([dir=rtl]) figcaption,\n.mce-visualblocks:not([dir=rtl]) hgroup,\n.mce-visualblocks:not([dir=rtl]) aside,\n.mce-visualblocks:not([dir=rtl]) ul,\n.mce-visualblocks:not([dir=rtl]) ol,\n.mce-visualblocks:not([dir=rtl]) dl {\n margin-left: 3px;\n}\n.mce-visualblocks[dir=rtl] p,\n.mce-visualblocks[dir=rtl] h1,\n.mce-visualblocks[dir=rtl] h2,\n.mce-visualblocks[dir=rtl] h3,\n.mce-visualblocks[dir=rtl] h4,\n.mce-visualblocks[dir=rtl] h5,\n.mce-visualblocks[dir=rtl] h6,\n.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]),\n.mce-visualblocks[dir=rtl] section,\n.mce-visualblocks[dir=rtl] article,\n.mce-visualblocks[dir=rtl] blockquote,\n.mce-visualblocks[dir=rtl] address,\n.mce-visualblocks[dir=rtl] pre,\n.mce-visualblocks[dir=rtl] figure,\n.mce-visualblocks[dir=rtl] figcaption,\n.mce-visualblocks[dir=rtl] hgroup,\n.mce-visualblocks[dir=rtl] aside,\n.mce-visualblocks[dir=rtl] ul,\n.mce-visualblocks[dir=rtl] ol,\n.mce-visualblocks[dir=rtl] dl {\n background-position-x: right;\n margin-right: 3px;\n}\n.mce-nbsp,\n.mce-shy {\n background: #aaa;\n}\n.mce-shy::after {\n content: '-';\n}\n"]} \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.min.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.min.css deleted file mode 100644 index 69f70ddb1467..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.min.css +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ -.mce-content-body .mce-item-anchor{background:transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%20fill%3D%22%23cccccc%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;cursor:default;display:inline-block;height:12px!important;padding:0 2px;-webkit-user-modify:read-only;-moz-user-modify:read-only;-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all;width:8px!important}.mce-content-body .mce-item-anchor[data-mce-selected]{outline-offset:1px}.tox-comments-visible .tox-comment{background-color:#fff0b7}.tox-comments-visible .tox-comment--active{background-color:#ffe168}.tox-checklist>li:not(.tox-checklist--hidden){list-style:none;margin:.25em 0}.tox-checklist>li:not(.tox-checklist--hidden)::before{content:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%236d737b%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A");cursor:pointer;height:1em;margin-left:-1.5em;margin-top:.125em;position:absolute;width:1em}.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before{content:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A")}[dir=rtl] .tox-checklist>li:not(.tox-checklist--hidden)::before{margin-left:0;margin-right:-1.5em}code[class*=language-],pre[class*=language-]{color:#f8f8f2;background:0 0;text-shadow:0 1px rgba(0,0,0,.3);font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;tab-size:4;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto;border-radius:.3em}:not(pre)>code[class*=language-],pre[class*=language-]{background:#282a36}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#6272a4}.token.punctuation{color:#f8f8f2}.namespace{opacity:.7}.token.constant,.token.deleted,.token.property,.token.symbol,.token.tag{color:#ff79c6}.token.boolean,.token.number{color:#bd93f9}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#50fa7b}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url,.token.variable{color:#f8f8f2}.token.atrule,.token.attr-value,.token.class-name,.token.function{color:#f1fa8c}.token.keyword{color:#8be9fd}.token.important,.token.regex{color:#ffb86c}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.mce-content-body{overflow-wrap:break-word;word-wrap:break-word}.mce-content-body .mce-visual-caret{background-color:#000;background-color:currentColor;position:absolute}.mce-content-body .mce-visual-caret-hidden{display:none}.mce-content-body [data-mce-caret]{left:-1000px;margin:0;padding:0;position:absolute;right:auto;top:0}.mce-content-body .mce-offscreen-selection{left:-2000000px;max-width:1000000px;position:absolute}.mce-content-body [contentEditable=false]{cursor:default}.mce-content-body [contentEditable=true]{cursor:text}.tox-cursor-format-painter{cursor:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"),default}.mce-content-body figure.align-left{float:left}.mce-content-body figure.align-right{float:right}.mce-content-body figure.image.align-center{display:table;margin-left:auto;margin-right:auto}.mce-preview-object{border:1px solid gray;display:inline-block;line-height:0;margin:0 2px 0 2px;position:relative}.mce-preview-object .mce-shim{background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);height:100%;left:0;position:absolute;top:0;width:100%}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-object{background:transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%20fill%3D%22%23cccccc%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;border:1px dashed #aaa}.mce-pagebreak{border:1px dashed #aaa;cursor:default;display:block;height:5px;margin-top:15px;page-break-before:always;width:100%}@media print{.mce-pagebreak{border:0}}.tiny-pageembed .mce-shim{background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);height:100%;left:0;position:absolute;top:0;width:100%}.tiny-pageembed[data-mce-selected="2"] .mce-shim{display:none}.tiny-pageembed{display:inline-block;position:relative}.tiny-pageembed--16by9,.tiny-pageembed--1by1,.tiny-pageembed--21by9,.tiny-pageembed--4by3{display:block;overflow:hidden;padding:0;position:relative;width:100%}.tiny-pageembed--21by9{padding-top:42.857143%}.tiny-pageembed--16by9{padding-top:56.25%}.tiny-pageembed--4by3{padding-top:75%}.tiny-pageembed--1by1{padding-top:100%}.tiny-pageembed--16by9 iframe,.tiny-pageembed--1by1 iframe,.tiny-pageembed--21by9 iframe,.tiny-pageembed--4by3 iframe{border:0;height:100%;left:0;position:absolute;top:0;width:100%}.mce-content-body[data-mce-placeholder]{position:relative}.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before{color:rgba(34,47,62,.7);content:attr(data-mce-placeholder);position:absolute}.mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before{left:1px}.mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before{right:1px}.mce-content-body div.mce-resizehandle{background-color:#4099ff;border-color:#4099ff;border-style:solid;border-width:1px;box-sizing:border-box;height:10px;position:absolute;width:10px;z-index:10000}.mce-content-body div.mce-resizehandle:hover{background-color:#4099ff}.mce-content-body div.mce-resizehandle:nth-of-type(1){cursor:nwse-resize}.mce-content-body div.mce-resizehandle:nth-of-type(2){cursor:nesw-resize}.mce-content-body div.mce-resizehandle:nth-of-type(3){cursor:nwse-resize}.mce-content-body div.mce-resizehandle:nth-of-type(4){cursor:nesw-resize}.mce-content-body .mce-clonedresizable{opacity:.5;outline:1px dashed #000;position:absolute;z-index:10000}.mce-content-body .mce-clonedresizable.mce-resizetable-columns td,.mce-content-body .mce-clonedresizable.mce-resizetable-columns th{border:0}.mce-content-body .mce-resize-helper{background:#555;background:rgba(0,0,0,.75);border:1px;border-radius:3px;color:#fff;display:none;font-family:sans-serif;font-size:12px;line-height:14px;margin:5px 10px;padding:5px;position:absolute;white-space:nowrap;z-index:10001}.tox-rtc-user-selection{position:relative}.tox-rtc-user-cursor{bottom:0;cursor:default;position:absolute;top:0;width:2px}.tox-rtc-user-cursor::before{background-color:inherit;border-radius:50%;content:'';display:block;height:8px;position:absolute;right:-3px;top:-3px;width:8px}.tox-rtc-user-cursor:hover::after{background-color:inherit;border-radius:100px;box-sizing:border-box;color:#fff;content:attr(data-user);display:block;font-size:12px;font-weight:700;left:-5px;min-height:8px;min-width:8px;padding:0 12px;position:absolute;top:-11px;white-space:nowrap;z-index:1000}.tox-rtc-user-selection--1 .tox-rtc-user-cursor{background-color:#2dc26b}.tox-rtc-user-selection--2 .tox-rtc-user-cursor{background-color:#e03e2d}.tox-rtc-user-selection--3 .tox-rtc-user-cursor{background-color:#f1c40f}.tox-rtc-user-selection--4 .tox-rtc-user-cursor{background-color:#3598db}.tox-rtc-user-selection--5 .tox-rtc-user-cursor{background-color:#b96ad9}.tox-rtc-user-selection--6 .tox-rtc-user-cursor{background-color:#e67e23}.tox-rtc-user-selection--7 .tox-rtc-user-cursor{background-color:#aaa69d}.tox-rtc-user-selection--8 .tox-rtc-user-cursor{background-color:#f368e0}.tox-rtc-remote-image{background:#eaeaea url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2236%22%20height%3D%2212%22%20viewBox%3D%220%200%2036%2012%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Ccircle%20cx%3D%226%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2218%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.33s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2230%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.66s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A") no-repeat center center;border:1px solid #ccc;min-height:240px;min-width:320px}.mce-match-marker{background:#aaa;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-match-marker-selected::-moz-selection{background:#39f;color:#fff}.mce-match-marker-selected::selection{background:#39f;color:#fff}.mce-content-body audio[data-mce-selected],.mce-content-body embed[data-mce-selected],.mce-content-body img[data-mce-selected],.mce-content-body object[data-mce-selected],.mce-content-body table[data-mce-selected],.mce-content-body video[data-mce-selected]{outline:3px solid #4099ff}.mce-content-body hr[data-mce-selected]{outline:3px solid #4099ff;outline-offset:1px}.mce-content-body [contentEditable=false] [contentEditable=true]:focus{outline:3px solid #4099ff}.mce-content-body [contentEditable=false] [contentEditable=true]:hover{outline:3px solid #4099ff}.mce-content-body [contentEditable=false][data-mce-selected]{cursor:not-allowed;outline:3px solid #4099ff}.mce-content-body.mce-content-readonly [contentEditable=true]:focus,.mce-content-body.mce-content-readonly [contentEditable=true]:hover{outline:0}.mce-content-body [data-mce-selected=inline-boundary]{background-color:#4099ff}.mce-content-body .mce-edit-focus{outline:3px solid #4099ff}.mce-content-body td[data-mce-selected],.mce-content-body th[data-mce-selected]{position:relative}.mce-content-body td[data-mce-selected]::-moz-selection,.mce-content-body th[data-mce-selected]::-moz-selection{background:0 0}.mce-content-body td[data-mce-selected]::selection,.mce-content-body th[data-mce-selected]::selection{background:0 0}.mce-content-body td[data-mce-selected] *,.mce-content-body th[data-mce-selected] *{outline:0;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mce-content-body td[data-mce-selected]::after,.mce-content-body th[data-mce-selected]::after{background-color:rgba(180,215,255,.35);border:1px solid transparent;bottom:-1px;content:'';left:-1px;mix-blend-mode:lighten;position:absolute;right:-1px;top:-1px}@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){.mce-content-body td[data-mce-selected]::after,.mce-content-body th[data-mce-selected]::after{border-color:rgba(0,84,180,.35)}}.mce-content-body img::-moz-selection{background:0 0}.mce-content-body img::selection{background:0 0}.ephox-snooker-resizer-bar{background-color:#4099ff;opacity:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ephox-snooker-resizer-cols{cursor:col-resize}.ephox-snooker-resizer-rows{cursor:row-resize}.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity:1}.mce-spellchecker-word{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position:0 calc(100% + 1px);background-repeat:repeat-x;background-size:auto 6px;cursor:default;height:2rem}.mce-spellchecker-grammar{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position:0 calc(100% + 1px);background-repeat:repeat-x;background-size:auto 6px;cursor:default}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-item-table:not([border]),.mce-item-table:not([border]) caption,.mce-item-table:not([border]) td,.mce-item-table:not([border]) th,.mce-item-table[border="0"],.mce-item-table[border="0"] caption,.mce-item-table[border="0"] td,.mce-item-table[border="0"] th,table[style*="border-width: 0px"],table[style*="border-width: 0px"] caption,table[style*="border-width: 0px"] td,table[style*="border-width: 0px"] th{border:1px dashed #bbb}.mce-visualblocks address,.mce-visualblocks article,.mce-visualblocks aside,.mce-visualblocks blockquote,.mce-visualblocks div:not([data-mce-bogus]),.mce-visualblocks dl,.mce-visualblocks figcaption,.mce-visualblocks figure,.mce-visualblocks h1,.mce-visualblocks h2,.mce-visualblocks h3,.mce-visualblocks h4,.mce-visualblocks h5,.mce-visualblocks h6,.mce-visualblocks hgroup,.mce-visualblocks ol,.mce-visualblocks p,.mce-visualblocks pre,.mce-visualblocks section,.mce-visualblocks ul{background-repeat:no-repeat;border:1px dashed #bbb;margin-left:3px;padding-top:10px}.mce-visualblocks p{background-image:url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7)}.mce-visualblocks h1{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==)}.mce-visualblocks h2{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==)}.mce-visualblocks h3{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7)}.mce-visualblocks h4{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==)}.mce-visualblocks h5{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==)}.mce-visualblocks h6{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==)}.mce-visualblocks div:not([data-mce-bogus]){background-image:url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7)}.mce-visualblocks section{background-image:url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=)}.mce-visualblocks article{background-image:url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7)}.mce-visualblocks blockquote{background-image:url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7)}.mce-visualblocks address{background-image:url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=)}.mce-visualblocks pre{background-image:url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==)}.mce-visualblocks figure{background-image:url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7)}.mce-visualblocks figcaption{border:1px dashed #bbb}.mce-visualblocks hgroup{background-image:url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7)}.mce-visualblocks aside{background-image:url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=)}.mce-visualblocks ul{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==)}.mce-visualblocks ol{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==)}.mce-visualblocks dl{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==)}.mce-visualblocks:not([dir=rtl]) address,.mce-visualblocks:not([dir=rtl]) article,.mce-visualblocks:not([dir=rtl]) aside,.mce-visualblocks:not([dir=rtl]) blockquote,.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]),.mce-visualblocks:not([dir=rtl]) dl,.mce-visualblocks:not([dir=rtl]) figcaption,.mce-visualblocks:not([dir=rtl]) figure,.mce-visualblocks:not([dir=rtl]) h1,.mce-visualblocks:not([dir=rtl]) h2,.mce-visualblocks:not([dir=rtl]) h3,.mce-visualblocks:not([dir=rtl]) h4,.mce-visualblocks:not([dir=rtl]) h5,.mce-visualblocks:not([dir=rtl]) h6,.mce-visualblocks:not([dir=rtl]) hgroup,.mce-visualblocks:not([dir=rtl]) ol,.mce-visualblocks:not([dir=rtl]) p,.mce-visualblocks:not([dir=rtl]) pre,.mce-visualblocks:not([dir=rtl]) section,.mce-visualblocks:not([dir=rtl]) ul{margin-left:3px}.mce-visualblocks[dir=rtl] address,.mce-visualblocks[dir=rtl] article,.mce-visualblocks[dir=rtl] aside,.mce-visualblocks[dir=rtl] blockquote,.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]),.mce-visualblocks[dir=rtl] dl,.mce-visualblocks[dir=rtl] figcaption,.mce-visualblocks[dir=rtl] figure,.mce-visualblocks[dir=rtl] h1,.mce-visualblocks[dir=rtl] h2,.mce-visualblocks[dir=rtl] h3,.mce-visualblocks[dir=rtl] h4,.mce-visualblocks[dir=rtl] h5,.mce-visualblocks[dir=rtl] h6,.mce-visualblocks[dir=rtl] hgroup,.mce-visualblocks[dir=rtl] ol,.mce-visualblocks[dir=rtl] p,.mce-visualblocks[dir=rtl] pre,.mce-visualblocks[dir=rtl] section,.mce-visualblocks[dir=rtl] ul{background-position-x:right;margin-right:3px}.mce-nbsp,.mce-shy{background:#aaa}.mce-shy::after{content:'-'}body{font-family:sans-serif}table{border-collapse:collapse} -/*# sourceMappingURL=content.min.css.map */ diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.min.css.map b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.min.css.map deleted file mode 100644 index 582c5e5ede37..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.min.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["ui/dark/content.css"],"names":[],"mappings":";;;;;;AAMA,mCACE,WAAY,YAAY,+OAA+O,UAAU,OACjR,OAAQ,QACR,QAAS,aACT,OAAQ,eACR,QAAS,EAAE,IACX,oBAAqB,UACrB,iBAAkB,UAClB,oBAAqB,IACrB,iBAAkB,IAClB,gBAAiB,IACb,YAAa,IACjB,MAAO,cAET,sDACE,eAAgB,IAElB,mCACE,iBAAkB,QAEpB,2CACE,iBAAkB,QAEpB,8CACE,WAAY,KACZ,OAAQ,MAAO,EAEjB,sDACE,QAAS,gdACT,OAAQ,QACR,OAAQ,IACR,YAAa,OACb,WAAY,OACZ,SAAU,SACV,MAAO,IAET,6EACE,QAAS,shCAEX,gEACE,YAAa,EACb,aAAc,OAUhB,uBACA,sBACE,MAAO,QACP,WAAY,IACZ,YAAa,EAAE,IAAI,eACnB,YAAa,QAAQ,CAAE,MAAM,CAAE,aAAa,CAAE,aAAa,CAAE,UAC7D,WAAY,KACZ,YAAa,IACb,aAAc,OACd,WAAY,OACZ,UAAW,OACX,YAAa,IACb,cAAe,EACf,SAAU,EACV,gBAAiB,KACjB,YAAa,KACb,QAAS,KAGX,sBACE,QAAS,IACT,OAAQ,KAAM,EACd,SAAU,KACV,cAAe,KAEjB,iCACA,sBACE,WAAY,QAGd,iCACE,QAAS,KACT,cAAe,KACf,YAAa,OAKf,aAHA,eAEA,eADA,cAGE,MAAO,QAET,mBACE,MAAO,QAET,WACE,QAAS,GAIX,gBAEA,eAJA,gBAGA,cAFA,WAIE,MAAO,QAET,eACA,cACE,MAAO,QAGT,iBAGA,eADA,YAEA,gBALA,gBAEA,cAIE,MAAO,QAKT,4BACA,qBAHA,cADA,gBAEA,WAGA,gBACE,MAAO,QAET,cACA,kBAEA,kBADA,gBAEE,MAAO,QAET,eACE,MAAO,QAGT,iBADA,aAEE,MAAO,QAGT,YADA,iBAEE,YAAa,IAEf,cACE,WAAY,OAEd,cACE,OAAQ,KAGV,kBACE,cAAe,WACf,UAAW,WAEb,oCACE,iBAAkB,KAClB,iBAAkB,aAClB,SAAU,SAEZ,2CACE,QAAS,KAEX,mCACE,KAAM,QACN,OAAQ,EACR,QAAS,EACT,SAAU,SACV,MAAO,KACP,IAAK,EAEP,2CACE,KAAM,WACN,UAAW,UACX,SAAU,SAEZ,0CACE,OAAQ,QAEV,yCACE,OAAQ,KAEV,2BACE,OAAQ,qkCAAqkC,CAAE,QAEjlC,oCACE,MAAO,KAET,qCACE,MAAO,MAET,4CACE,QAAS,MACT,YAAa,KACb,aAAc,KAEhB,oBACE,OAAQ,IAAI,MAAM,KAClB,QAAS,aACT,YAAa,EACb,OAAQ,EAAE,IAAI,EAAE,IAChB,SAAU,SAEZ,8BACE,WAAY,oFACZ,OAAQ,KACR,KAAM,EACN,SAAU,SACV,IAAK,EACL,MAAO,KAET,qDACE,QAAS,KAEX,YACE,WAAY,YAAY,mdAAmd,UAAU,OACrf,OAAQ,IAAI,OAAO,KAErB,eACE,OAAQ,IAAI,OAAO,KACnB,OAAQ,QACR,QAAS,MACT,OAAQ,IACR,WAAY,KACZ,kBAAmB,OACnB,MAAO,KAET,aACE,eACE,OAAQ,GAGZ,0BACE,WAAY,oFACZ,OAAQ,KACR,KAAM,EACN,SAAU,SACV,IAAK,EACL,MAAO,KAET,iDACE,QAAS,KAEX,gBACE,QAAS,aACT,SAAU,SAGZ,uBAEA,sBAHA,uBAEA,sBAEE,QAAS,MACT,SAAU,OACV,QAAS,EACT,SAAU,SACV,MAAO,KAET,uBACE,YAAa,WAEf,uBACE,YAAa,OAEf,sBACE,YAAa,IAEf,sBACE,YAAa,KAGf,8BAEA,6BAHA,8BAEA,6BAEE,OAAQ,EACR,OAAQ,KACR,KAAM,EACN,SAAU,SACV,IAAK,EACL,MAAO,KAET,wCACE,SAAU,SAEZ,uEACE,MAAO,kBACP,QAAS,2BACT,SAAU,SAEZ,sFACE,KAAM,IAER,gFACE,MAAO,IAET,uCACE,iBAAkB,QAClB,aAAc,QACd,aAAc,MACd,aAAc,IACd,WAAY,WACZ,OAAQ,KACR,SAAU,SACV,MAAO,KACP,QAAS,MAEX,6CACE,iBAAkB,QAEpB,sDACE,OAAQ,YAEV,sDACE,OAAQ,YAEV,sDACE,OAAQ,YAEV,sDACE,OAAQ,YAEV,uCACE,QAAS,GACT,QAAS,IAAI,OAAO,KACpB,SAAU,SACV,QAAS,MAGX,kEADA,kEAEE,OAAQ,EAEV,qCACE,WAAY,KACZ,WAAY,gBACZ,OAAQ,IACR,cAAe,IACf,MAAO,KACP,QAAS,KACT,YAAa,WACb,UAAW,KACX,YAAa,KACb,OAAQ,IAAI,KACZ,QAAS,IACT,SAAU,SACV,YAAa,OACb,QAAS,MAEX,wBACE,SAAU,SAEZ,qBACE,OAAQ,EACR,OAAQ,QACR,SAAU,SACV,IAAK,EACL,MAAO,IAET,6BACE,iBAAkB,QAClB,cAAe,IACf,QAAS,GACT,QAAS,MACT,OAAQ,IACR,SAAU,SACV,MAAO,KACP,IAAK,KACL,MAAO,IAET,kCACE,iBAAkB,QAClB,cAAe,MACf,WAAY,WACZ,MAAO,KACP,QAAS,gBACT,QAAS,MACT,UAAW,KACX,YAAa,IACb,KAAM,KACN,WAAY,IACZ,UAAW,IACX,QAAS,EAAE,KACX,SAAU,SACV,IAAK,MACL,YAAa,OACb,QAAS,KAEX,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,sBACE,WAAY,QAAQ,ymCAAymC,UAAU,OAAO,OAC9oC,OAAQ,IAAI,MAAM,KAClB,WAAY,MACZ,UAAW,MAEb,kBACE,WAAY,KACZ,MAAO,KAET,2BACE,WAAY,KACZ,MAAO,KAET,2CACE,WAAY,KACZ,MAAO,KAET,sCACE,WAAY,KACZ,MAAO,KAIT,2CAEA,2CAJA,yCAGA,4CAEA,2CAJA,2CAKE,QAAS,IAAI,MAAM,QAErB,wCACE,QAAS,IAAI,MAAM,QACnB,eAAgB,IAElB,uEACE,QAAS,IAAI,MAAM,QAErB,uEACE,QAAS,IAAI,MAAM,QAErB,6DACE,OAAQ,YACR,QAAS,IAAI,MAAM,QAErB,oEACA,oEACE,QAAS,EAEX,sDACE,iBAAkB,QAEpB,kCACE,QAAS,IAAI,MAAM,QAErB,wCACA,wCACE,SAAU,SAEZ,wDACA,wDACE,WAAY,IAEd,mDACA,mDACE,WAAY,IAEd,0CACA,0CACE,QAAS,EACT,sBAAuB,KACvB,oBAAqB,KAClB,iBAAkB,KACjB,gBAAiB,KACb,YAAa,KAEvB,+CACA,+CACE,iBAAkB,sBAClB,OAAQ,IAAI,MAAM,YAClB,OAAQ,KACR,QAAS,GACT,KAAM,KACN,eAAgB,QAChB,SAAU,SACV,MAAO,KACP,IAAK,KAEP,6CAA+C,yBAC7C,+CACA,+CACE,aAAc,oBAGlB,sCACE,WAAY,IAEd,iCACE,WAAY,IAEd,2BACE,iBAAkB,QAClB,QAAS,EACT,oBAAqB,KACrB,iBAAkB,KAClB,gBAAiB,KACjB,YAAa,KAEf,4BACE,OAAQ,WAEV,4BACE,OAAQ,WAEV,8DACE,QAAS,EAEX,uBACE,iBAAkB,oRAClB,oBAAqB,EAAE,iBACvB,kBAAmB,SACnB,gBAAiB,KAAK,IACtB,OAAQ,QACR,OAAQ,KAEV,0BACE,iBAAkB,2PAClB,oBAAqB,EAAE,iBACvB,kBAAmB,SACnB,gBAAiB,KAAK,IACtB,OAAQ,QAEV,SACE,OAAQ,IAAI,MAAM,KAEpB,YACE,OAAQ,IAEV,YACE,gBAAiB,KAGnB,8BASA,sCANA,iCAGA,iCALA,4BASA,oCANA,+BAGA,+BARA,kCASA,0CANA,qCAGA,qCAME,OAAQ,IAAI,OAAO,KAarB,0BAFA,0BAOA,wBANA,6BAHA,4CAYA,qBALA,6BADA,yBAZA,qBACA,qBACA,qBACA,qBACA,qBACA,qBASA,yBAGA,qBAlBA,oBAYA,sBAJA,0BASA,qBAGE,kBAAmB,UACnB,OAAQ,IAAI,OAAO,KACnB,YAAa,IACb,YAAa,KAEf,oBACE,iBAAkB,gHAEpB,qBACE,iBAAkB,oHAEpB,qBACE,iBAAkB,wHAEpB,qBACE,iBAAkB,oHAEpB,qBACE,iBAAkB,wHAEpB,qBACE,iBAAkB,wHAEpB,qBACE,iBAAkB,wHAEpB,4CACE,iBAAkB,4HAEpB,0BACE,iBAAkB,gKAEpB,0BACE,iBAAkB,gKAEpB,6BACE,iBAAkB,4LAEpB,0BACE,iBAAkB,wKAEpB,sBACE,iBAAkB,oIAEpB,yBACE,iBAAkB,wJAEpB,6BACE,OAAQ,IAAI,OAAO,KAErB,yBACE,iBAAkB,4JAEpB,wBACE,iBAAkB,gJAEpB,qBACE,iBAAkB,oHAEpB,qBACE,iBAAkB,oHAEpB,qBACE,iBAAkB,oHAapB,yCAFA,yCAOA,uCANA,4CAHA,2DAYA,oCALA,4CADA,wCAZA,oCACA,oCACA,oCACA,oCACA,oCACA,oCASA,wCAGA,oCAlBA,mCAYA,qCAJA,yCASA,oCAGE,YAAa,IAaf,mCAFA,mCAOA,iCANA,sCAHA,qDAYA,8BALA,sCADA,kCAZA,8BACA,8BACA,8BACA,8BACA,8BACA,8BASA,kCAGA,8BAlBA,6BAYA,+BAJA,mCASA,8BAGE,sBAAuB,MACvB,aAAc,IAEhB,UACA,SACE,WAAY,KAEd,gBACE,QAAS,IAEX,KACE,YAAa,WAEf,MACE,gBAAiB","file":"content.min.css","sourcesContent":["/**\n * Copyright (c) Tiny Technologies, Inc. All rights reserved.\n * Licensed under the LGPL or a commercial license.\n * For LGPL see License.txt in the project root for license information.\n * For commercial licenses see https://www.tiny.cloud/\n */\n.mce-content-body .mce-item-anchor {\n background: transparent url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%20fill%3D%22%23cccccc%22%2F%3E%3C%2Fsvg%3E%0A\") no-repeat center;\n cursor: default;\n display: inline-block;\n height: 12px !important;\n padding: 0 2px;\n -webkit-user-modify: read-only;\n -moz-user-modify: read-only;\n -webkit-user-select: all;\n -moz-user-select: all;\n -ms-user-select: all;\n user-select: all;\n width: 8px !important;\n}\n.mce-content-body .mce-item-anchor[data-mce-selected] {\n outline-offset: 1px;\n}\n.tox-comments-visible .tox-comment {\n background-color: #fff0b7;\n}\n.tox-comments-visible .tox-comment--active {\n background-color: #ffe168;\n}\n.tox-checklist > li:not(.tox-checklist--hidden) {\n list-style: none;\n margin: 0.25em 0;\n}\n.tox-checklist > li:not(.tox-checklist--hidden)::before {\n content: url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%236d737b%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A\");\n cursor: pointer;\n height: 1em;\n margin-left: -1.5em;\n margin-top: 0.125em;\n position: absolute;\n width: 1em;\n}\n.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before {\n content: url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A\");\n}\n[dir=rtl] .tox-checklist > li:not(.tox-checklist--hidden)::before {\n margin-left: 0;\n margin-right: -1.5em;\n}\n/* stylelint-disable */\n/* http://prismjs.com/ */\n/**\n * Dracula Theme originally by Zeno Rocha [@zenorocha]\n * https://draculatheme.com/\n *\n * Ported for PrismJS by Albert Vallverdu [@byverdu]\n */\ncode[class*=\"language-\"],\npre[class*=\"language-\"] {\n color: #f8f8f2;\n background: none;\n text-shadow: 0 1px rgba(0, 0, 0, 0.3);\n font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;\n text-align: left;\n white-space: pre;\n word-spacing: normal;\n word-break: normal;\n word-wrap: normal;\n line-height: 1.5;\n -moz-tab-size: 4;\n tab-size: 4;\n -webkit-hyphens: none;\n -ms-hyphens: none;\n hyphens: none;\n}\n/* Code blocks */\npre[class*=\"language-\"] {\n padding: 1em;\n margin: 0.5em 0;\n overflow: auto;\n border-radius: 0.3em;\n}\n:not(pre) > code[class*=\"language-\"],\npre[class*=\"language-\"] {\n background: #282a36;\n}\n/* Inline code */\n:not(pre) > code[class*=\"language-\"] {\n padding: 0.1em;\n border-radius: 0.3em;\n white-space: normal;\n}\n.token.comment,\n.token.prolog,\n.token.doctype,\n.token.cdata {\n color: #6272a4;\n}\n.token.punctuation {\n color: #f8f8f2;\n}\n.namespace {\n opacity: 0.7;\n}\n.token.property,\n.token.tag,\n.token.constant,\n.token.symbol,\n.token.deleted {\n color: #ff79c6;\n}\n.token.boolean,\n.token.number {\n color: #bd93f9;\n}\n.token.selector,\n.token.attr-name,\n.token.string,\n.token.char,\n.token.builtin,\n.token.inserted {\n color: #50fa7b;\n}\n.token.operator,\n.token.entity,\n.token.url,\n.language-css .token.string,\n.style .token.string,\n.token.variable {\n color: #f8f8f2;\n}\n.token.atrule,\n.token.attr-value,\n.token.function,\n.token.class-name {\n color: #f1fa8c;\n}\n.token.keyword {\n color: #8be9fd;\n}\n.token.regex,\n.token.important {\n color: #ffb86c;\n}\n.token.important,\n.token.bold {\n font-weight: bold;\n}\n.token.italic {\n font-style: italic;\n}\n.token.entity {\n cursor: help;\n}\n/* stylelint-enable */\n.mce-content-body {\n overflow-wrap: break-word;\n word-wrap: break-word;\n}\n.mce-content-body .mce-visual-caret {\n background-color: black;\n background-color: currentColor;\n position: absolute;\n}\n.mce-content-body .mce-visual-caret-hidden {\n display: none;\n}\n.mce-content-body *[data-mce-caret] {\n left: -1000px;\n margin: 0;\n padding: 0;\n position: absolute;\n right: auto;\n top: 0;\n}\n.mce-content-body .mce-offscreen-selection {\n left: -2000000px;\n max-width: 1000000px;\n position: absolute;\n}\n.mce-content-body *[contentEditable=false] {\n cursor: default;\n}\n.mce-content-body *[contentEditable=true] {\n cursor: text;\n}\n.tox-cursor-format-painter {\n cursor: url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A\"), default;\n}\n.mce-content-body figure.align-left {\n float: left;\n}\n.mce-content-body figure.align-right {\n float: right;\n}\n.mce-content-body figure.image.align-center {\n display: table;\n margin-left: auto;\n margin-right: auto;\n}\n.mce-preview-object {\n border: 1px solid gray;\n display: inline-block;\n line-height: 0;\n margin: 0 2px 0 2px;\n position: relative;\n}\n.mce-preview-object .mce-shim {\n background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n}\n.mce-preview-object[data-mce-selected=\"2\"] .mce-shim {\n display: none;\n}\n.mce-object {\n background: transparent url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%20fill%3D%22%23cccccc%22%2F%3E%3C%2Fsvg%3E%0A\") no-repeat center;\n border: 1px dashed #aaa;\n}\n.mce-pagebreak {\n border: 1px dashed #aaa;\n cursor: default;\n display: block;\n height: 5px;\n margin-top: 15px;\n page-break-before: always;\n width: 100%;\n}\n@media print {\n .mce-pagebreak {\n border: 0;\n }\n}\n.tiny-pageembed .mce-shim {\n background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n}\n.tiny-pageembed[data-mce-selected=\"2\"] .mce-shim {\n display: none;\n}\n.tiny-pageembed {\n display: inline-block;\n position: relative;\n}\n.tiny-pageembed--21by9,\n.tiny-pageembed--16by9,\n.tiny-pageembed--4by3,\n.tiny-pageembed--1by1 {\n display: block;\n overflow: hidden;\n padding: 0;\n position: relative;\n width: 100%;\n}\n.tiny-pageembed--21by9 {\n padding-top: 42.857143%;\n}\n.tiny-pageembed--16by9 {\n padding-top: 56.25%;\n}\n.tiny-pageembed--4by3 {\n padding-top: 75%;\n}\n.tiny-pageembed--1by1 {\n padding-top: 100%;\n}\n.tiny-pageembed--21by9 iframe,\n.tiny-pageembed--16by9 iframe,\n.tiny-pageembed--4by3 iframe,\n.tiny-pageembed--1by1 iframe {\n border: 0;\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n}\n.mce-content-body[data-mce-placeholder] {\n position: relative;\n}\n.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before {\n color: rgba(34, 47, 62, 0.7);\n content: attr(data-mce-placeholder);\n position: absolute;\n}\n.mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before {\n left: 1px;\n}\n.mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before {\n right: 1px;\n}\n.mce-content-body div.mce-resizehandle {\n background-color: #4099ff;\n border-color: #4099ff;\n border-style: solid;\n border-width: 1px;\n box-sizing: border-box;\n height: 10px;\n position: absolute;\n width: 10px;\n z-index: 10000;\n}\n.mce-content-body div.mce-resizehandle:hover {\n background-color: #4099ff;\n}\n.mce-content-body div.mce-resizehandle:nth-of-type(1) {\n cursor: nwse-resize;\n}\n.mce-content-body div.mce-resizehandle:nth-of-type(2) {\n cursor: nesw-resize;\n}\n.mce-content-body div.mce-resizehandle:nth-of-type(3) {\n cursor: nwse-resize;\n}\n.mce-content-body div.mce-resizehandle:nth-of-type(4) {\n cursor: nesw-resize;\n}\n.mce-content-body .mce-clonedresizable {\n opacity: 0.5;\n outline: 1px dashed black;\n position: absolute;\n z-index: 10000;\n}\n.mce-content-body .mce-clonedresizable.mce-resizetable-columns th,\n.mce-content-body .mce-clonedresizable.mce-resizetable-columns td {\n border: 0;\n}\n.mce-content-body .mce-resize-helper {\n background: #555;\n background: rgba(0, 0, 0, 0.75);\n border: 1px;\n border-radius: 3px;\n color: white;\n display: none;\n font-family: sans-serif;\n font-size: 12px;\n line-height: 14px;\n margin: 5px 10px;\n padding: 5px;\n position: absolute;\n white-space: nowrap;\n z-index: 10001;\n}\n.tox-rtc-user-selection {\n position: relative;\n}\n.tox-rtc-user-cursor {\n bottom: 0;\n cursor: default;\n position: absolute;\n top: 0;\n width: 2px;\n}\n.tox-rtc-user-cursor::before {\n background-color: inherit;\n border-radius: 50%;\n content: '';\n display: block;\n height: 8px;\n position: absolute;\n right: -3px;\n top: -3px;\n width: 8px;\n}\n.tox-rtc-user-cursor:hover::after {\n background-color: inherit;\n border-radius: 100px;\n box-sizing: border-box;\n color: #fff;\n content: attr(data-user);\n display: block;\n font-size: 12px;\n font-weight: bold;\n left: -5px;\n min-height: 8px;\n min-width: 8px;\n padding: 0 12px;\n position: absolute;\n top: -11px;\n white-space: nowrap;\n z-index: 1000;\n}\n.tox-rtc-user-selection--1 .tox-rtc-user-cursor {\n background-color: #2dc26b;\n}\n.tox-rtc-user-selection--2 .tox-rtc-user-cursor {\n background-color: #e03e2d;\n}\n.tox-rtc-user-selection--3 .tox-rtc-user-cursor {\n background-color: #f1c40f;\n}\n.tox-rtc-user-selection--4 .tox-rtc-user-cursor {\n background-color: #3598db;\n}\n.tox-rtc-user-selection--5 .tox-rtc-user-cursor {\n background-color: #b96ad9;\n}\n.tox-rtc-user-selection--6 .tox-rtc-user-cursor {\n background-color: #e67e23;\n}\n.tox-rtc-user-selection--7 .tox-rtc-user-cursor {\n background-color: #aaa69d;\n}\n.tox-rtc-user-selection--8 .tox-rtc-user-cursor {\n background-color: #f368e0;\n}\n.tox-rtc-remote-image {\n background: #eaeaea url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2236%22%20height%3D%2212%22%20viewBox%3D%220%200%2036%2012%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Ccircle%20cx%3D%226%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2218%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.33s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2230%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.66s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A\") no-repeat center center;\n border: 1px solid #ccc;\n min-height: 240px;\n min-width: 320px;\n}\n.mce-match-marker {\n background: #aaa;\n color: #fff;\n}\n.mce-match-marker-selected {\n background: #39f;\n color: #fff;\n}\n.mce-match-marker-selected::-moz-selection {\n background: #39f;\n color: #fff;\n}\n.mce-match-marker-selected::selection {\n background: #39f;\n color: #fff;\n}\n.mce-content-body img[data-mce-selected],\n.mce-content-body video[data-mce-selected],\n.mce-content-body audio[data-mce-selected],\n.mce-content-body object[data-mce-selected],\n.mce-content-body embed[data-mce-selected],\n.mce-content-body table[data-mce-selected] {\n outline: 3px solid #4099ff;\n}\n.mce-content-body hr[data-mce-selected] {\n outline: 3px solid #4099ff;\n outline-offset: 1px;\n}\n.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus {\n outline: 3px solid #4099ff;\n}\n.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover {\n outline: 3px solid #4099ff;\n}\n.mce-content-body *[contentEditable=false][data-mce-selected] {\n cursor: not-allowed;\n outline: 3px solid #4099ff;\n}\n.mce-content-body.mce-content-readonly *[contentEditable=true]:focus,\n.mce-content-body.mce-content-readonly *[contentEditable=true]:hover {\n outline: none;\n}\n.mce-content-body *[data-mce-selected=\"inline-boundary\"] {\n background-color: #4099ff;\n}\n.mce-content-body .mce-edit-focus {\n outline: 3px solid #4099ff;\n}\n.mce-content-body td[data-mce-selected],\n.mce-content-body th[data-mce-selected] {\n position: relative;\n}\n.mce-content-body td[data-mce-selected]::-moz-selection,\n.mce-content-body th[data-mce-selected]::-moz-selection {\n background: none;\n}\n.mce-content-body td[data-mce-selected]::selection,\n.mce-content-body th[data-mce-selected]::selection {\n background: none;\n}\n.mce-content-body td[data-mce-selected] *,\n.mce-content-body th[data-mce-selected] * {\n outline: none;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.mce-content-body td[data-mce-selected]::after,\n.mce-content-body th[data-mce-selected]::after {\n background-color: rgba(180, 215, 255, 0.35);\n border: 1px solid transparent;\n bottom: -1px;\n content: '';\n left: -1px;\n mix-blend-mode: lighten;\n position: absolute;\n right: -1px;\n top: -1px;\n}\n@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n .mce-content-body td[data-mce-selected]::after,\n .mce-content-body th[data-mce-selected]::after {\n border-color: rgba(0, 84, 180, 0.35);\n }\n}\n.mce-content-body img::-moz-selection {\n background: none;\n}\n.mce-content-body img::selection {\n background: none;\n}\n.ephox-snooker-resizer-bar {\n background-color: #4099ff;\n opacity: 0;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.ephox-snooker-resizer-cols {\n cursor: col-resize;\n}\n.ephox-snooker-resizer-rows {\n cursor: row-resize;\n}\n.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging {\n opacity: 1;\n}\n.mce-spellchecker-word {\n background-image: url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A\");\n background-position: 0 calc(100% + 1px);\n background-repeat: repeat-x;\n background-size: auto 6px;\n cursor: default;\n height: 2rem;\n}\n.mce-spellchecker-grammar {\n background-image: url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A\");\n background-position: 0 calc(100% + 1px);\n background-repeat: repeat-x;\n background-size: auto 6px;\n cursor: default;\n}\n.mce-toc {\n border: 1px solid gray;\n}\n.mce-toc h2 {\n margin: 4px;\n}\n.mce-toc li {\n list-style-type: none;\n}\ntable[style*=\"border-width: 0px\"],\n.mce-item-table:not([border]),\n.mce-item-table[border=\"0\"],\ntable[style*=\"border-width: 0px\"] td,\n.mce-item-table:not([border]) td,\n.mce-item-table[border=\"0\"] td,\ntable[style*=\"border-width: 0px\"] th,\n.mce-item-table:not([border]) th,\n.mce-item-table[border=\"0\"] th,\ntable[style*=\"border-width: 0px\"] caption,\n.mce-item-table:not([border]) caption,\n.mce-item-table[border=\"0\"] caption {\n border: 1px dashed #bbb;\n}\n.mce-visualblocks p,\n.mce-visualblocks h1,\n.mce-visualblocks h2,\n.mce-visualblocks h3,\n.mce-visualblocks h4,\n.mce-visualblocks h5,\n.mce-visualblocks h6,\n.mce-visualblocks div:not([data-mce-bogus]),\n.mce-visualblocks section,\n.mce-visualblocks article,\n.mce-visualblocks blockquote,\n.mce-visualblocks address,\n.mce-visualblocks pre,\n.mce-visualblocks figure,\n.mce-visualblocks figcaption,\n.mce-visualblocks hgroup,\n.mce-visualblocks aside,\n.mce-visualblocks ul,\n.mce-visualblocks ol,\n.mce-visualblocks dl {\n background-repeat: no-repeat;\n border: 1px dashed #bbb;\n margin-left: 3px;\n padding-top: 10px;\n}\n.mce-visualblocks p {\n background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7);\n}\n.mce-visualblocks h1 {\n background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==);\n}\n.mce-visualblocks h2 {\n background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==);\n}\n.mce-visualblocks h3 {\n background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7);\n}\n.mce-visualblocks h4 {\n background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==);\n}\n.mce-visualblocks h5 {\n background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==);\n}\n.mce-visualblocks h6 {\n background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==);\n}\n.mce-visualblocks div:not([data-mce-bogus]) {\n background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7);\n}\n.mce-visualblocks section {\n background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=);\n}\n.mce-visualblocks article {\n background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7);\n}\n.mce-visualblocks blockquote {\n background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7);\n}\n.mce-visualblocks address {\n background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=);\n}\n.mce-visualblocks pre {\n background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==);\n}\n.mce-visualblocks figure {\n background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7);\n}\n.mce-visualblocks figcaption {\n border: 1px dashed #bbb;\n}\n.mce-visualblocks hgroup {\n background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7);\n}\n.mce-visualblocks aside {\n background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=);\n}\n.mce-visualblocks ul {\n background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==);\n}\n.mce-visualblocks ol {\n background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==);\n}\n.mce-visualblocks dl {\n background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==);\n}\n.mce-visualblocks:not([dir=rtl]) p,\n.mce-visualblocks:not([dir=rtl]) h1,\n.mce-visualblocks:not([dir=rtl]) h2,\n.mce-visualblocks:not([dir=rtl]) h3,\n.mce-visualblocks:not([dir=rtl]) h4,\n.mce-visualblocks:not([dir=rtl]) h5,\n.mce-visualblocks:not([dir=rtl]) h6,\n.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]),\n.mce-visualblocks:not([dir=rtl]) section,\n.mce-visualblocks:not([dir=rtl]) article,\n.mce-visualblocks:not([dir=rtl]) blockquote,\n.mce-visualblocks:not([dir=rtl]) address,\n.mce-visualblocks:not([dir=rtl]) pre,\n.mce-visualblocks:not([dir=rtl]) figure,\n.mce-visualblocks:not([dir=rtl]) figcaption,\n.mce-visualblocks:not([dir=rtl]) hgroup,\n.mce-visualblocks:not([dir=rtl]) aside,\n.mce-visualblocks:not([dir=rtl]) ul,\n.mce-visualblocks:not([dir=rtl]) ol,\n.mce-visualblocks:not([dir=rtl]) dl {\n margin-left: 3px;\n}\n.mce-visualblocks[dir=rtl] p,\n.mce-visualblocks[dir=rtl] h1,\n.mce-visualblocks[dir=rtl] h2,\n.mce-visualblocks[dir=rtl] h3,\n.mce-visualblocks[dir=rtl] h4,\n.mce-visualblocks[dir=rtl] h5,\n.mce-visualblocks[dir=rtl] h6,\n.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]),\n.mce-visualblocks[dir=rtl] section,\n.mce-visualblocks[dir=rtl] article,\n.mce-visualblocks[dir=rtl] blockquote,\n.mce-visualblocks[dir=rtl] address,\n.mce-visualblocks[dir=rtl] pre,\n.mce-visualblocks[dir=rtl] figure,\n.mce-visualblocks[dir=rtl] figcaption,\n.mce-visualblocks[dir=rtl] hgroup,\n.mce-visualblocks[dir=rtl] aside,\n.mce-visualblocks[dir=rtl] ul,\n.mce-visualblocks[dir=rtl] ol,\n.mce-visualblocks[dir=rtl] dl {\n background-position-x: right;\n margin-right: 3px;\n}\n.mce-nbsp,\n.mce-shy {\n background: #aaa;\n}\n.mce-shy::after {\n content: '-';\n}\nbody {\n font-family: sans-serif;\n}\ntable {\n border-collapse: collapse;\n}\n"]} \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.mobile.min.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.mobile.min.css deleted file mode 100644 index 627f6934476e..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.mobile.min.css +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ -.tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection{background-color:green;display:inline-block;opacity:.5;position:absolute}body{-webkit-text-size-adjust:none}body img{max-width:96vw}body table img{max-width:95%}body{font-family:sans-serif}table{border-collapse:collapse} -/*# sourceMappingURL=content.mobile.min.css.map */ diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.mobile.min.css.map b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.mobile.min.css.map deleted file mode 100644 index 6d8e69f351f4..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.mobile.min.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["ui/dark/content.mobile.css"],"names":[],"mappings":";;;;;;AAMA,yEAEE,iBAAkB,MAClB,QAAS,aACT,QAAS,GACT,SAAU,SAEZ,KACE,yBAA0B,KAE5B,SAEE,UAAW,KAEb,eACE,UAAW,IAEb,KACE,YAAa,WAEf,MACE,gBAAiB","file":"content.mobile.min.css","sourcesContent":["/**\n * Copyright (c) Tiny Technologies, Inc. All rights reserved.\n * Licensed under the LGPL or a commercial license.\n * For LGPL see License.txt in the project root for license information.\n * For commercial licenses see https://www.tiny.cloud/\n */\n.tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection {\n /* Note: this file is used inside the content, so isn't part of theming */\n background-color: green;\n display: inline-block;\n opacity: 0.5;\n position: absolute;\n}\nbody {\n -webkit-text-size-adjust: none;\n}\nbody img {\n /* this is related to the content margin */\n max-width: 96vw;\n}\nbody table img {\n max-width: 95%;\n}\nbody {\n font-family: sans-serif;\n}\ntable {\n border-collapse: collapse;\n}\n"]} \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.css deleted file mode 100644 index 5ddd7c6b011b..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.css +++ /dev/null @@ -1,2972 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ -.tox { - box-sizing: content-box; - color: #2A3746; - cursor: auto; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - font-size: 16px; - font-style: normal; - font-weight: normal; - line-height: normal; - -webkit-tap-highlight-color: transparent; - text-decoration: none; - text-shadow: none; - text-transform: none; - vertical-align: initial; - white-space: normal; -} -.tox *:not(svg):not(rect) { - box-sizing: inherit; - color: inherit; - cursor: inherit; - direction: inherit; - font-family: inherit; - font-size: inherit; - font-style: inherit; - font-weight: inherit; - line-height: inherit; - -webkit-tap-highlight-color: inherit; - text-align: inherit; - text-decoration: inherit; - text-shadow: inherit; - text-transform: inherit; - vertical-align: inherit; - white-space: inherit; -} -.tox *:not(svg):not(rect) { - /* stylelint-disable-line no-duplicate-selectors */ - background: transparent; - border: 0; - float: none; - height: auto; - margin: 0; - max-width: none; - outline: 0; - padding: 0; - position: static; - width: auto; -} -.tox:not([dir=rtl]) { - direction: ltr; - text-align: left; -} -.tox[dir=rtl] { - direction: rtl; - text-align: right; -} -.tox-tinymce { - border: 1px solid #000000; - border-radius: 0; - box-shadow: none; - box-sizing: border-box; - display: flex; - flex-direction: column; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - overflow: hidden; - position: relative; - visibility: inherit !important; -} -.tox-tinymce-inline { - border: none; - box-shadow: none; -} -.tox-tinymce-inline .tox-editor-header { - border: 1px solid #000000; - border-radius: 0; - box-shadow: none; -} -.tox-tinymce-aux { - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - z-index: 1300; -} -.tox-tinymce *:focus, -.tox-tinymce-aux *:focus { - outline: none; -} -button::-moz-focus-inner { - border: 0; -} -.tox .accessibility-issue__header { - align-items: center; - display: flex; - margin-bottom: 4px; -} -.tox .accessibility-issue__description { - align-items: stretch; - border: 1px solid #000000; - border-radius: 3px; - display: flex; - justify-content: space-between; -} -.tox .accessibility-issue__description > div { - padding-bottom: 4px; -} -.tox .accessibility-issue__description > div > div { - align-items: center; - display: flex; - margin-bottom: 4px; -} -.tox .accessibility-issue__description > *:last-child:not(:only-child) { - border-color: #000000; - border-style: solid; -} -.tox .accessibility-issue__repair { - margin-top: 16px; -} -.tox .tox-dialog__body-content .accessibility-issue--info .accessibility-issue__description { - background-color: rgba(32, 122, 183, 0.5); - border-color: #207ab7; - color: #fff; -} -.tox .tox-dialog__body-content .accessibility-issue--info .accessibility-issue__description > *:last-child { - border-color: #207ab7; -} -.tox .tox-dialog__body-content .accessibility-issue--info .tox-form__group h2 { - color: #fff; -} -.tox .tox-dialog__body-content .accessibility-issue--info .tox-icon svg { - fill: #fff; -} -.tox .tox-dialog__body-content .accessibility-issue--info a .tox-icon { - color: #fff; -} -.tox .tox-dialog__body-content .accessibility-issue--warn .accessibility-issue__description { - background-color: rgba(255, 165, 0, 0.5); - border-color: rgba(255, 165, 0, 0.8); - color: #fff; -} -.tox .tox-dialog__body-content .accessibility-issue--warn .accessibility-issue__description > *:last-child { - border-color: rgba(255, 165, 0, 0.8); -} -.tox .tox-dialog__body-content .accessibility-issue--warn .tox-form__group h2 { - color: #fff; -} -.tox .tox-dialog__body-content .accessibility-issue--warn .tox-icon svg { - fill: #fff; -} -.tox .tox-dialog__body-content .accessibility-issue--warn a .tox-icon { - color: #fff; -} -.tox .tox-dialog__body-content .accessibility-issue--error .accessibility-issue__description { - background-color: rgba(204, 0, 0, 0.5); - border-color: rgba(204, 0, 0, 0.8); - color: #fff; -} -.tox .tox-dialog__body-content .accessibility-issue--error .accessibility-issue__description > *:last-child { - border-color: rgba(204, 0, 0, 0.8); -} -.tox .tox-dialog__body-content .accessibility-issue--error .tox-form__group h2 { - color: #fff; -} -.tox .tox-dialog__body-content .accessibility-issue--error .tox-icon svg { - fill: #fff; -} -.tox .tox-dialog__body-content .accessibility-issue--error a .tox-icon { - color: #fff; -} -.tox .tox-dialog__body-content .accessibility-issue--success .accessibility-issue__description { - background-color: rgba(120, 171, 70, 0.5); - border-color: rgba(120, 171, 70, 0.8); - color: #fff; -} -.tox .tox-dialog__body-content .accessibility-issue--success .accessibility-issue__description > *:last-child { - border-color: rgba(120, 171, 70, 0.8); -} -.tox .tox-dialog__body-content .accessibility-issue--success .tox-form__group h2 { - color: #fff; -} -.tox .tox-dialog__body-content .accessibility-issue--success .tox-icon svg { - fill: #fff; -} -.tox .tox-dialog__body-content .accessibility-issue--success a .tox-icon { - color: #fff; -} -.tox .tox-dialog__body-content .accessibility-issue__header h1, -.tox .tox-dialog__body-content .tox-form__group .accessibility-issue__description h2 { - margin-top: 0; -} -.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__header .tox-button { - margin-left: 4px; -} -.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__header > *:nth-last-child(2) { - margin-left: auto; -} -.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__description { - padding: 4px 4px 4px 8px; -} -.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__description > *:last-child { - border-left-width: 1px; - padding-left: 4px; -} -.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__header .tox-button { - margin-right: 4px; -} -.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__header > *:nth-last-child(2) { - margin-right: auto; -} -.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__description { - padding: 4px 8px 4px 4px; -} -.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__description > *:last-child { - border-right-width: 1px; - padding-right: 4px; -} -.tox .tox-anchorbar { - display: flex; - flex: 0 0 auto; -} -.tox .tox-bar { - display: flex; - flex: 0 0 auto; -} -.tox .tox-button { - background-color: #207ab7; - background-image: none; - background-position: 0 0; - background-repeat: repeat; - border-color: #207ab7; - border-radius: 3px; - border-style: solid; - border-width: 1px; - box-shadow: none; - box-sizing: border-box; - color: #fff; - cursor: pointer; - display: inline-block; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - font-size: 14px; - font-style: normal; - font-weight: bold; - letter-spacing: normal; - line-height: 24px; - margin: 0; - outline: none; - padding: 4px 16px; - text-align: center; - text-decoration: none; - text-transform: capitalize; - white-space: nowrap; -} -.tox .tox-button[disabled] { - background-color: #207ab7; - background-image: none; - border-color: #207ab7; - box-shadow: none; - color: rgba(255, 255, 255, 0.5); - cursor: not-allowed; -} -.tox .tox-button:focus:not(:disabled) { - background-color: #1c6ca1; - background-image: none; - border-color: #1c6ca1; - box-shadow: none; - color: #fff; -} -.tox .tox-button:hover:not(:disabled) { - background-color: #1c6ca1; - background-image: none; - border-color: #1c6ca1; - box-shadow: none; - color: #fff; -} -.tox .tox-button:active:not(:disabled) { - background-color: #185d8c; - background-image: none; - border-color: #185d8c; - box-shadow: none; - color: #fff; -} -.tox .tox-button--secondary { - background-color: #3d546f; - background-image: none; - background-position: 0 0; - background-repeat: repeat; - border-color: #3d546f; - border-radius: 3px; - border-style: solid; - border-width: 1px; - box-shadow: none; - color: #fff; - font-size: 14px; - font-style: normal; - font-weight: bold; - letter-spacing: normal; - outline: none; - padding: 4px 16px; - text-decoration: none; - text-transform: capitalize; -} -.tox .tox-button--secondary[disabled] { - background-color: #3d546f; - background-image: none; - border-color: #3d546f; - box-shadow: none; - color: rgba(255, 255, 255, 0.5); -} -.tox .tox-button--secondary:focus:not(:disabled) { - background-color: #34485f; - background-image: none; - border-color: #34485f; - box-shadow: none; - color: #fff; -} -.tox .tox-button--secondary:hover:not(:disabled) { - background-color: #34485f; - background-image: none; - border-color: #34485f; - box-shadow: none; - color: #fff; -} -.tox .tox-button--secondary:active:not(:disabled) { - background-color: #2b3b4e; - background-image: none; - border-color: #2b3b4e; - box-shadow: none; - color: #fff; -} -.tox .tox-button--icon, -.tox .tox-button.tox-button--icon, -.tox .tox-button.tox-button--secondary.tox-button--icon { - padding: 4px; -} -.tox .tox-button--icon .tox-icon svg, -.tox .tox-button.tox-button--icon .tox-icon svg, -.tox .tox-button.tox-button--secondary.tox-button--icon .tox-icon svg { - display: block; - fill: currentColor; -} -.tox .tox-button-link { - background: 0; - border: none; - box-sizing: border-box; - cursor: pointer; - display: inline-block; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - font-size: 16px; - font-weight: normal; - line-height: 1.3; - margin: 0; - padding: 0; - white-space: nowrap; -} -.tox .tox-button-link--sm { - font-size: 14px; -} -.tox .tox-button--naked { - background-color: transparent; - border-color: transparent; - box-shadow: unset; - color: #fff; -} -.tox .tox-button--naked[disabled] { - background-color: #3d546f; - border-color: #3d546f; - box-shadow: none; - color: rgba(255, 255, 255, 0.5); -} -.tox .tox-button--naked:hover:not(:disabled) { - background-color: #34485f; - border-color: #34485f; - box-shadow: none; - color: #fff; -} -.tox .tox-button--naked:focus:not(:disabled) { - background-color: #34485f; - border-color: #34485f; - box-shadow: none; - color: #fff; -} -.tox .tox-button--naked:active:not(:disabled) { - background-color: #2b3b4e; - border-color: #2b3b4e; - box-shadow: none; - color: #fff; -} -.tox .tox-button--naked .tox-icon svg { - fill: currentColor; -} -.tox .tox-button--naked.tox-button--icon:hover:not(:disabled) { - color: #fff; -} -.tox .tox-checkbox { - align-items: center; - border-radius: 3px; - cursor: pointer; - display: flex; - height: 36px; - min-width: 36px; -} -.tox .tox-checkbox__input { - /* Hide from view but visible to screen readers */ - height: 1px; - overflow: hidden; - position: absolute; - top: auto; - width: 1px; -} -.tox .tox-checkbox__icons { - align-items: center; - border-radius: 3px; - box-shadow: 0 0 0 2px transparent; - box-sizing: content-box; - display: flex; - height: 24px; - justify-content: center; - padding: calc(4px - 1px); - width: 24px; -} -.tox .tox-checkbox__icons .tox-checkbox-icon__unchecked svg { - display: block; - fill: rgba(255, 255, 255, 0.2); -} -.tox .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg { - display: none; - fill: #207ab7; -} -.tox .tox-checkbox__icons .tox-checkbox-icon__checked svg { - display: none; - fill: #207ab7; -} -.tox .tox-checkbox--disabled { - color: rgba(255, 255, 255, 0.5); - cursor: not-allowed; -} -.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__checked svg { - fill: rgba(255, 255, 255, 0.5); -} -.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__unchecked svg { - fill: rgba(255, 255, 255, 0.5); -} -.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg { - fill: rgba(255, 255, 255, 0.5); -} -.tox input.tox-checkbox__input:checked + .tox-checkbox__icons .tox-checkbox-icon__unchecked svg { - display: none; -} -.tox input.tox-checkbox__input:checked + .tox-checkbox__icons .tox-checkbox-icon__checked svg { - display: block; -} -.tox input.tox-checkbox__input:indeterminate + .tox-checkbox__icons .tox-checkbox-icon__unchecked svg { - display: none; -} -.tox input.tox-checkbox__input:indeterminate + .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg { - display: block; -} -.tox input.tox-checkbox__input:focus + .tox-checkbox__icons { - border-radius: 3px; - box-shadow: inset 0 0 0 1px #207ab7; - padding: calc(4px - 1px); -} -.tox:not([dir=rtl]) .tox-checkbox__label { - margin-left: 4px; -} -.tox:not([dir=rtl]) .tox-checkbox__input { - left: -10000px; -} -.tox:not([dir=rtl]) .tox-bar .tox-checkbox { - margin-left: 4px; -} -.tox[dir=rtl] .tox-checkbox__label { - margin-right: 4px; -} -.tox[dir=rtl] .tox-checkbox__input { - right: -10000px; -} -.tox[dir=rtl] .tox-bar .tox-checkbox { - margin-right: 4px; -} -.tox { - /* stylelint-disable-next-line no-descending-specificity */ -} -.tox .tox-collection--toolbar .tox-collection__group { - display: flex; - padding: 0; -} -.tox .tox-collection--grid .tox-collection__group { - display: flex; - flex-wrap: wrap; - max-height: 208px; - overflow-x: hidden; - overflow-y: auto; - padding: 0; -} -.tox .tox-collection--list .tox-collection__group { - border-bottom-width: 0; - border-color: #1a1a1a; - border-left-width: 0; - border-right-width: 0; - border-style: solid; - border-top-width: 1px; - padding: 4px 0; -} -.tox .tox-collection--list .tox-collection__group:first-child { - border-top-width: 0; -} -.tox .tox-collection__group-heading { - background-color: #333333; - color: #fff; - cursor: default; - font-size: 12px; - font-style: normal; - font-weight: normal; - margin-bottom: 4px; - margin-top: -4px; - padding: 4px 8px; - text-transform: none; - -webkit-touch-callout: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.tox .tox-collection__item { - align-items: center; - color: #fff; - cursor: pointer; - display: flex; - -webkit-touch-callout: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.tox .tox-collection--list .tox-collection__item { - padding: 4px 8px; -} -.tox .tox-collection--toolbar .tox-collection__item { - border-radius: 3px; - padding: 4px; -} -.tox .tox-collection--grid .tox-collection__item { - border-radius: 3px; - padding: 4px; -} -.tox .tox-collection--list .tox-collection__item--enabled { - background-color: #2b3b4e; - color: #fff; -} -.tox .tox-collection--list .tox-collection__item--active { - background-color: #4a5562; -} -.tox .tox-collection--toolbar .tox-collection__item--enabled { - background-color: #757d87; - color: #fff; -} -.tox .tox-collection--toolbar .tox-collection__item--active { - background-color: #4a5562; -} -.tox .tox-collection--grid .tox-collection__item--enabled { - background-color: #757d87; - color: #fff; -} -.tox .tox-collection--grid .tox-collection__item--active:not(.tox-collection__item--state-disabled) { - background-color: #4a5562; - color: #fff; -} -.tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled) { - color: #fff; -} -.tox .tox-collection--toolbar .tox-collection__item--active:not(.tox-collection__item--state-disabled) { - color: #fff; -} -.tox .tox-collection__item--state-disabled { - background-color: transparent; - color: rgba(255, 255, 255, 0.5); - cursor: not-allowed; -} -.tox .tox-collection__item-icon, -.tox .tox-collection__item-checkmark { - align-items: center; - display: flex; - height: 24px; - justify-content: center; - width: 24px; -} -.tox .tox-collection__item-icon svg, -.tox .tox-collection__item-checkmark svg { - fill: currentColor; -} -.tox .tox-collection--toolbar-lg .tox-collection__item-icon { - height: 48px; - width: 48px; -} -.tox .tox-collection__item-label { - color: currentColor; - display: inline-block; - flex: 1; - -ms-flex-preferred-size: auto; - font-size: 14px; - font-style: normal; - font-weight: normal; - line-height: 24px; - text-transform: none; - word-break: break-all; -} -.tox .tox-collection__item-accessory { - color: rgba(255, 255, 255, 0.5); - display: inline-block; - font-size: 14px; - height: 24px; - line-height: 24px; - text-transform: none; -} -.tox .tox-collection__item-caret { - align-items: center; - display: flex; - min-height: 24px; -} -.tox .tox-collection__item-caret::after { - content: ''; - font-size: 0; - min-height: inherit; -} -.tox .tox-collection__item-caret svg { - fill: #fff; -} -.tox .tox-collection--list .tox-collection__item:not(.tox-collection__item--enabled) .tox-collection__item-checkmark svg { - display: none; -} -.tox .tox-collection--list .tox-collection__item:not(.tox-collection__item--enabled) .tox-collection__item-accessory + .tox-collection__item-checkmark { - display: none; -} -.tox .tox-collection--horizontal { - background-color: #2b3b4e; - border: 1px solid #1a1a1a; - border-radius: 3px; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); - display: flex; - flex: 0 0 auto; - flex-shrink: 0; - flex-wrap: nowrap; - margin-bottom: 0; - overflow-x: auto; - padding: 0; -} -.tox .tox-collection--horizontal .tox-collection__group { - align-items: center; - display: flex; - flex-wrap: nowrap; - margin: 0; - padding: 0 4px; -} -.tox .tox-collection--horizontal .tox-collection__item { - height: 34px; - margin: 2px 0 3px 0; - padding: 0 4px; -} -.tox .tox-collection--horizontal .tox-collection__item-label { - white-space: nowrap; -} -.tox .tox-collection--horizontal .tox-collection__item-caret { - margin-left: 4px; -} -.tox:not([dir=rtl]) .tox-collection--horizontal .tox-collection__group:not(:last-of-type) { - border-right: 1px solid #000000; -} -.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item > *:not(:first-child) { - margin-left: 8px; -} -.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item-label:first-child { - margin-left: 4px; -} -.tox:not([dir=rtl]) .tox-collection__item-accessory { - margin-left: 16px; - text-align: right; -} -.tox:not([dir=rtl]) .tox-collection .tox-collection__item-caret { - margin-left: 16px; -} -.tox[dir=rtl] .tox-collection--horizontal .tox-collection__group:not(:last-of-type) { - border-left: 1px solid #000000; -} -.tox[dir=rtl] .tox-collection--list .tox-collection__item > *:not(:first-child) { - margin-right: 8px; -} -.tox[dir=rtl] .tox-collection--list .tox-collection__item-label:first-child { - margin-right: 4px; -} -.tox[dir=rtl] .tox-collection__item-icon-rtl { - /* stylelint-disable-next-line no-descending-specificity */ -} -.tox[dir=rtl] .tox-collection__item-icon-rtl .tox-collection__item-icon svg { - transform: rotateY(180deg); -} -.tox[dir=rtl] .tox-collection__item-accessory { - margin-right: 16px; - text-align: left; -} -.tox[dir=rtl] .tox-collection .tox-collection__item-caret { - margin-right: 16px; - transform: rotateY(180deg); -} -.tox[dir=rtl] .tox-collection--horizontal .tox-collection__item-caret { - margin-right: 4px; -} -.tox .tox-color-picker-container { - display: flex; - flex-direction: row; - height: 225px; - margin: 0; -} -.tox .tox-sv-palette { - box-sizing: border-box; - display: flex; - height: 100%; -} -.tox .tox-sv-palette-spectrum { - height: 100%; -} -.tox .tox-sv-palette, -.tox .tox-sv-palette-spectrum { - width: 225px; -} -.tox .tox-sv-palette-thumb { - background: none; - border: 1px solid black; - border-radius: 50%; - box-sizing: content-box; - height: 12px; - position: absolute; - width: 12px; -} -.tox .tox-sv-palette-inner-thumb { - border: 1px solid white; - border-radius: 50%; - height: 10px; - position: absolute; - width: 10px; -} -.tox .tox-hue-slider { - box-sizing: border-box; - height: 100%; - width: 25px; -} -.tox .tox-hue-slider-spectrum { - background: linear-gradient(to bottom, #f00, #ff0080, #f0f, #8000ff, #00f, #0080ff, #0ff, #00ff80, #0f0, #80ff00, #ff0, #ff8000, #f00); - height: 100%; - width: 100%; -} -.tox .tox-hue-slider, -.tox .tox-hue-slider-spectrum { - width: 20px; -} -.tox .tox-hue-slider-thumb { - background: white; - border: 1px solid black; - box-sizing: content-box; - height: 4px; - width: 100%; -} -.tox .tox-rgb-form { - display: flex; - flex-direction: column; - justify-content: space-between; -} -.tox .tox-rgb-form div { - align-items: center; - display: flex; - justify-content: space-between; - margin-bottom: 5px; - width: inherit; -} -.tox .tox-rgb-form input { - width: 6em; -} -.tox .tox-rgb-form input.tox-invalid { - /* Need !important to override Chrome's focus styling unfortunately */ - border: 1px solid red !important; -} -.tox .tox-rgb-form .tox-rgba-preview { - border: 1px solid black; - flex-grow: 2; - margin-bottom: 0; -} -.tox:not([dir=rtl]) .tox-sv-palette { - margin-right: 15px; -} -.tox:not([dir=rtl]) .tox-hue-slider { - margin-right: 15px; -} -.tox:not([dir=rtl]) .tox-hue-slider-thumb { - margin-left: -1px; -} -.tox:not([dir=rtl]) .tox-rgb-form label { - margin-right: 0.5em; -} -.tox[dir=rtl] .tox-sv-palette { - margin-left: 15px; -} -.tox[dir=rtl] .tox-hue-slider { - margin-left: 15px; -} -.tox[dir=rtl] .tox-hue-slider-thumb { - margin-right: -1px; -} -.tox[dir=rtl] .tox-rgb-form label { - margin-left: 0.5em; -} -.tox .tox-toolbar .tox-swatches, -.tox .tox-toolbar__primary .tox-swatches, -.tox .tox-toolbar__overflow .tox-swatches { - margin: 2px 0 3px 4px; -} -.tox .tox-collection--list .tox-collection__group .tox-swatches-menu { - border: 0; - margin: -4px 0; -} -.tox .tox-swatches__row { - display: flex; -} -.tox .tox-swatch { - height: 30px; - transition: transform 0.15s, box-shadow 0.15s; - width: 30px; -} -.tox .tox-swatch:hover, -.tox .tox-swatch:focus { - box-shadow: 0 0 0 1px rgba(127, 127, 127, 0.3) inset; - transform: scale(0.8); -} -.tox .tox-swatch--remove { - align-items: center; - display: flex; - justify-content: center; -} -.tox .tox-swatch--remove svg path { - stroke: #e74c3c; -} -.tox .tox-swatches__picker-btn { - align-items: center; - background-color: transparent; - border: 0; - cursor: pointer; - display: flex; - height: 30px; - justify-content: center; - outline: none; - padding: 0; - width: 30px; -} -.tox .tox-swatches__picker-btn svg { - height: 24px; - width: 24px; -} -.tox .tox-swatches__picker-btn:hover { - background: #4a5562; -} -.tox:not([dir=rtl]) .tox-swatches__picker-btn { - margin-left: auto; -} -.tox[dir=rtl] .tox-swatches__picker-btn { - margin-right: auto; -} -.tox .tox-comment-thread { - background: #2b3b4e; - position: relative; -} -.tox .tox-comment-thread > *:not(:first-child) { - margin-top: 8px; -} -.tox .tox-comment { - background: #2b3b4e; - border: 1px solid #000000; - border-radius: 3px; - box-shadow: 0 4px 8px 0 rgba(42, 55, 70, 0.1); - padding: 8px 8px 16px 8px; - position: relative; -} -.tox .tox-comment__header { - align-items: center; - color: #fff; - display: flex; - justify-content: space-between; -} -.tox .tox-comment__date { - color: rgba(255, 255, 255, 0.5); - font-size: 12px; -} -.tox .tox-comment__body { - color: #fff; - font-size: 14px; - font-style: normal; - font-weight: normal; - line-height: 1.3; - margin-top: 8px; - position: relative; - text-transform: initial; -} -.tox .tox-comment__body textarea { - resize: none; - white-space: normal; - width: 100%; -} -.tox .tox-comment__expander { - padding-top: 8px; -} -.tox .tox-comment__expander p { - color: rgba(255, 255, 255, 0.5); - font-size: 14px; - font-style: normal; -} -.tox .tox-comment__body p { - margin: 0; -} -.tox .tox-comment__buttonspacing { - padding-top: 16px; - text-align: center; -} -.tox .tox-comment-thread__overlay::after { - background: #2b3b4e; - bottom: 0; - content: ""; - display: flex; - left: 0; - opacity: 0.9; - position: absolute; - right: 0; - top: 0; - z-index: 5; -} -.tox .tox-comment__reply { - display: flex; - flex-shrink: 0; - flex-wrap: wrap; - justify-content: flex-end; - margin-top: 8px; -} -.tox .tox-comment__reply > *:first-child { - margin-bottom: 8px; - width: 100%; -} -.tox .tox-comment__edit { - display: flex; - flex-wrap: wrap; - justify-content: flex-end; - margin-top: 16px; -} -.tox .tox-comment__gradient::after { - background: linear-gradient(rgba(43, 59, 78, 0), #2b3b4e); - bottom: 0; - content: ""; - display: block; - height: 5em; - margin-top: -40px; - position: absolute; - width: 100%; -} -.tox .tox-comment__overlay { - background: #2b3b4e; - bottom: 0; - display: flex; - flex-direction: column; - flex-grow: 1; - left: 0; - opacity: 0.9; - position: absolute; - right: 0; - text-align: center; - top: 0; - z-index: 5; -} -.tox .tox-comment__loading-text { - align-items: center; - color: #fff; - display: flex; - flex-direction: column; - position: relative; -} -.tox .tox-comment__loading-text > div { - padding-bottom: 16px; -} -.tox .tox-comment__overlaytext { - bottom: 0; - flex-direction: column; - font-size: 14px; - left: 0; - padding: 1em; - position: absolute; - right: 0; - top: 0; - z-index: 10; -} -.tox .tox-comment__overlaytext p { - background-color: #2b3b4e; - box-shadow: 0 0 8px 8px #2b3b4e; - color: #fff; - text-align: center; -} -.tox .tox-comment__overlaytext div:nth-of-type(2) { - font-size: 0.8em; -} -.tox .tox-comment__busy-spinner { - align-items: center; - background-color: #2b3b4e; - bottom: 0; - display: flex; - justify-content: center; - left: 0; - position: absolute; - right: 0; - top: 0; - z-index: 20; -} -.tox .tox-comment__scroll { - display: flex; - flex-direction: column; - flex-shrink: 1; - overflow: auto; -} -.tox .tox-conversations { - margin: 8px; -} -.tox:not([dir=rtl]) .tox-comment__edit { - margin-left: 8px; -} -.tox:not([dir=rtl]) .tox-comment__buttonspacing > *:last-child, -.tox:not([dir=rtl]) .tox-comment__edit > *:last-child, -.tox:not([dir=rtl]) .tox-comment__reply > *:last-child { - margin-left: 8px; -} -.tox[dir=rtl] .tox-comment__edit { - margin-right: 8px; -} -.tox[dir=rtl] .tox-comment__buttonspacing > *:last-child, -.tox[dir=rtl] .tox-comment__edit > *:last-child, -.tox[dir=rtl] .tox-comment__reply > *:last-child { - margin-right: 8px; -} -.tox .tox-user { - align-items: center; - display: flex; -} -.tox .tox-user__avatar svg { - fill: rgba(255, 255, 255, 0.5); -} -.tox .tox-user__name { - color: rgba(255, 255, 255, 0.5); - font-size: 12px; - font-style: normal; - font-weight: bold; - text-transform: uppercase; -} -.tox:not([dir=rtl]) .tox-user__avatar svg { - margin-right: 8px; -} -.tox:not([dir=rtl]) .tox-user__avatar + .tox-user__name { - margin-left: 8px; -} -.tox[dir=rtl] .tox-user__avatar svg { - margin-left: 8px; -} -.tox[dir=rtl] .tox-user__avatar + .tox-user__name { - margin-right: 8px; -} -.tox .tox-dialog-wrap { - align-items: center; - bottom: 0; - display: flex; - justify-content: center; - left: 0; - position: fixed; - right: 0; - top: 0; - z-index: 1100; -} -.tox .tox-dialog-wrap__backdrop { - background-color: rgba(34, 47, 62, 0.75); - bottom: 0; - left: 0; - position: absolute; - right: 0; - top: 0; - z-index: 1; -} -.tox .tox-dialog-wrap__backdrop--opaque { - background-color: #222f3e; -} -.tox .tox-dialog { - background-color: #2b3b4e; - border-color: #000000; - border-radius: 3px; - border-style: solid; - border-width: 1px; - box-shadow: 0 16px 16px -10px rgba(42, 55, 70, 0.15), 0 0 40px 1px rgba(42, 55, 70, 0.15); - display: flex; - flex-direction: column; - max-height: 100%; - max-width: 480px; - overflow: hidden; - position: relative; - width: 95vw; - z-index: 2; -} -@media only screen and (max-width:767px) { - body:not(.tox-force-desktop) .tox .tox-dialog { - align-self: flex-start; - margin: 8px auto; - width: calc(100vw - 16px); - } -} -.tox .tox-dialog-inline { - z-index: 1100; -} -.tox .tox-dialog__header { - align-items: center; - background-color: #2b3b4e; - border-bottom: none; - color: #fff; - display: flex; - font-size: 16px; - justify-content: space-between; - padding: 8px 16px 0 16px; - position: relative; -} -.tox .tox-dialog__header .tox-button { - z-index: 1; -} -.tox .tox-dialog__draghandle { - cursor: grab; - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; -} -.tox .tox-dialog__draghandle:active { - cursor: grabbing; -} -.tox .tox-dialog__dismiss { - margin-left: auto; -} -.tox .tox-dialog__title { - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - font-size: 20px; - font-style: normal; - font-weight: normal; - line-height: 1.3; - margin: 0; - text-transform: none; -} -.tox .tox-dialog__body { - color: #fff; - display: flex; - flex: 1; - -ms-flex-preferred-size: auto; - font-size: 16px; - font-style: normal; - font-weight: normal; - line-height: 1.3; - min-width: 0; - text-align: left; - text-transform: none; -} -@media only screen and (max-width:767px) { - body:not(.tox-force-desktop) .tox .tox-dialog__body { - flex-direction: column; - } -} -.tox .tox-dialog__body-nav { - align-items: flex-start; - display: flex; - flex-direction: column; - padding: 16px 16px; -} -@media only screen and (max-width:767px) { - body:not(.tox-force-desktop) .tox .tox-dialog__body-nav { - flex-direction: row; - -webkit-overflow-scrolling: touch; - overflow-x: auto; - padding-bottom: 0; - } -} -.tox .tox-dialog__body-nav-item { - border-bottom: 2px solid transparent; - color: rgba(255, 255, 255, 0.5); - display: inline-block; - font-size: 14px; - line-height: 1.3; - margin-bottom: 8px; - text-decoration: none; - white-space: nowrap; -} -.tox .tox-dialog__body-nav-item:focus { - background-color: rgba(32, 122, 183, 0.1); -} -.tox .tox-dialog__body-nav-item--active { - border-bottom: 2px solid #207ab7; - color: #207ab7; -} -.tox .tox-dialog__body-content { - box-sizing: border-box; - display: flex; - flex: 1; - flex-direction: column; - -ms-flex-preferred-size: auto; - max-height: 650px; - overflow: auto; - -webkit-overflow-scrolling: touch; - padding: 16px 16px; -} -.tox .tox-dialog__body-content > * { - margin-bottom: 0; - margin-top: 16px; -} -.tox .tox-dialog__body-content > *:first-child { - margin-top: 0; -} -.tox .tox-dialog__body-content > *:last-child { - margin-bottom: 0; -} -.tox .tox-dialog__body-content > *:only-child { - margin-bottom: 0; - margin-top: 0; -} -.tox .tox-dialog__body-content a { - color: #207ab7; - cursor: pointer; - text-decoration: none; -} -.tox .tox-dialog__body-content a:hover, -.tox .tox-dialog__body-content a:focus { - color: #185d8c; - text-decoration: none; -} -.tox .tox-dialog__body-content a:active { - color: #185d8c; - text-decoration: none; -} -.tox .tox-dialog__body-content svg { - fill: #fff; -} -.tox .tox-dialog__body-content ul { - display: block; - list-style-type: disc; - margin-bottom: 16px; - -webkit-margin-end: 0; - margin-inline-end: 0; - -webkit-margin-start: 0; - margin-inline-start: 0; - -webkit-padding-start: 2.5rem; - padding-inline-start: 2.5rem; -} -.tox .tox-dialog__body-content .tox-form__group h1 { - color: #fff; - font-size: 20px; - font-style: normal; - font-weight: bold; - letter-spacing: normal; - margin-bottom: 16px; - margin-top: 2rem; - text-transform: none; -} -.tox .tox-dialog__body-content .tox-form__group h2 { - color: #fff; - font-size: 16px; - font-style: normal; - font-weight: bold; - letter-spacing: normal; - margin-bottom: 16px; - margin-top: 2rem; - text-transform: none; -} -.tox .tox-dialog__body-content .tox-form__group p { - margin-bottom: 16px; -} -.tox .tox-dialog__body-content .tox-form__group h1:first-child, -.tox .tox-dialog__body-content .tox-form__group h2:first-child, -.tox .tox-dialog__body-content .tox-form__group p:first-child { - margin-top: 0; -} -.tox .tox-dialog__body-content .tox-form__group h1:last-child, -.tox .tox-dialog__body-content .tox-form__group h2:last-child, -.tox .tox-dialog__body-content .tox-form__group p:last-child { - margin-bottom: 0; -} -.tox .tox-dialog__body-content .tox-form__group h1:only-child, -.tox .tox-dialog__body-content .tox-form__group h2:only-child, -.tox .tox-dialog__body-content .tox-form__group p:only-child { - margin-bottom: 0; - margin-top: 0; -} -.tox .tox-dialog--width-lg { - height: 650px; - max-width: 1200px; -} -.tox .tox-dialog--width-md { - max-width: 800px; -} -.tox .tox-dialog--width-md .tox-dialog__body-content { - overflow: auto; -} -.tox .tox-dialog__body-content--centered { - text-align: center; -} -.tox .tox-dialog__footer { - align-items: center; - background-color: #2b3b4e; - border-top: 1px solid #000000; - display: flex; - justify-content: space-between; - padding: 8px 16px; -} -.tox .tox-dialog__footer-start, -.tox .tox-dialog__footer-end { - display: flex; -} -.tox .tox-dialog__busy-spinner { - align-items: center; - background-color: rgba(34, 47, 62, 0.75); - bottom: 0; - display: flex; - justify-content: center; - left: 0; - position: absolute; - right: 0; - top: 0; - z-index: 3; -} -.tox .tox-dialog__table { - border-collapse: collapse; - width: 100%; -} -.tox .tox-dialog__table thead th { - font-weight: bold; - padding-bottom: 8px; -} -.tox .tox-dialog__table tbody tr { - border-bottom: 1px solid #000000; -} -.tox .tox-dialog__table tbody tr:last-child { - border-bottom: none; -} -.tox .tox-dialog__table td { - padding-bottom: 8px; - padding-top: 8px; -} -.tox .tox-dialog__popups { - position: absolute; - width: 100%; - z-index: 1100; -} -.tox .tox-dialog__body-iframe { - display: flex; - flex: 1; - flex-direction: column; - -ms-flex-preferred-size: auto; -} -.tox .tox-dialog__body-iframe .tox-navobj { - display: flex; - flex: 1; - -ms-flex-preferred-size: auto; -} -.tox .tox-dialog__body-iframe .tox-navobj :nth-child(2) { - flex: 1; - -ms-flex-preferred-size: auto; - height: 100%; -} -.tox .tox-dialog-dock-fadeout { - opacity: 0; - visibility: hidden; -} -.tox .tox-dialog-dock-fadein { - opacity: 1; - visibility: visible; -} -.tox .tox-dialog-dock-transition { - transition: visibility 0s linear 0.3s, opacity 0.3s ease; -} -.tox .tox-dialog-dock-transition.tox-dialog-dock-fadein { - transition-delay: 0s; -} -body.tox-dialog__disable-scroll { - overflow: hidden; -} -.tox.tox-platform-ie { - /* IE11 CSS styles go here */ -} -.tox.tox-platform-ie .tox-dialog-wrap { - position: -ms-device-fixed; -} -@media only screen and (max-width:767px) { - body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav { - margin-right: 0; - } -} -@media only screen and (max-width:767px) { - body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav-item:not(:first-child) { - margin-left: 8px; - } -} -.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-start > *, -.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-end > * { - margin-left: 8px; -} -.tox[dir=rtl] .tox-dialog__body { - text-align: right; -} -@media only screen and (max-width:767px) { - body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav { - margin-left: 0; - } -} -@media only screen and (max-width:767px) { - body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav-item:not(:first-child) { - margin-right: 8px; - } -} -.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-start > *, -.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-end > * { - margin-right: 8px; -} -.tox .tox-dropzone-container { - display: flex; - flex: 1; - -ms-flex-preferred-size: auto; -} -.tox .tox-dropzone { - align-items: center; - background: #fff; - border: 2px dashed #000000; - box-sizing: border-box; - display: flex; - flex-direction: column; - flex-grow: 1; - justify-content: center; - min-height: 100px; - padding: 10px; -} -.tox .tox-dropzone p { - color: rgba(255, 255, 255, 0.5); - margin: 0 0 16px 0; -} -.tox .tox-edit-area { - display: flex; - flex: 1; - -ms-flex-preferred-size: auto; - overflow: hidden; - position: relative; -} -.tox .tox-edit-area__iframe { - background-color: #fff; - border: 0; - box-sizing: border-box; - flex: 1; - -ms-flex-preferred-size: auto; - height: 100%; - position: absolute; - width: 100%; -} -.tox.tox-inline-edit-area { - border: 1px dotted #000000; -} -.tox .tox-editor-container { - display: flex; - flex: 1 1 auto; - flex-direction: column; - overflow: hidden; -} -.tox .tox-editor-header { - z-index: 1; -} -.tox:not(.tox-tinymce-inline) .tox-editor-header { - box-shadow: none; - transition: box-shadow 0.5s; -} -.tox.tox-tinymce--toolbar-bottom .tox-editor-header, -.tox.tox-tinymce-inline .tox-editor-header { - margin-bottom: -1px; -} -.tox.tox-tinymce--toolbar-sticky-on .tox-editor-header { - box-shadow: 0 4px 4px -3px rgba(0, 0, 0, 0.25); -} -.tox-editor-dock-fadeout { - opacity: 0; - visibility: hidden; -} -.tox-editor-dock-fadein { - opacity: 1; - visibility: visible; -} -.tox-editor-dock-transition { - transition: visibility 0s linear 0.25s, opacity 0.25s ease; -} -.tox-editor-dock-transition.tox-editor-dock-fadein { - transition-delay: 0s; -} -.tox .tox-control-wrap { - flex: 1; - position: relative; -} -.tox .tox-control-wrap:not(.tox-control-wrap--status-invalid) .tox-control-wrap__status-icon-invalid, -.tox .tox-control-wrap:not(.tox-control-wrap--status-unknown) .tox-control-wrap__status-icon-unknown, -.tox .tox-control-wrap:not(.tox-control-wrap--status-valid) .tox-control-wrap__status-icon-valid { - display: none; -} -.tox .tox-control-wrap svg { - display: block; -} -.tox .tox-control-wrap__status-icon-wrap { - position: absolute; - top: 50%; - transform: translateY(-50%); -} -.tox .tox-control-wrap__status-icon-invalid svg { - fill: #c00; -} -.tox .tox-control-wrap__status-icon-unknown svg { - fill: orange; -} -.tox .tox-control-wrap__status-icon-valid svg { - fill: green; -} -.tox:not([dir=rtl]) .tox-control-wrap--status-invalid .tox-textfield, -.tox:not([dir=rtl]) .tox-control-wrap--status-unknown .tox-textfield, -.tox:not([dir=rtl]) .tox-control-wrap--status-valid .tox-textfield { - padding-right: 32px; -} -.tox:not([dir=rtl]) .tox-control-wrap__status-icon-wrap { - right: 4px; -} -.tox[dir=rtl] .tox-control-wrap--status-invalid .tox-textfield, -.tox[dir=rtl] .tox-control-wrap--status-unknown .tox-textfield, -.tox[dir=rtl] .tox-control-wrap--status-valid .tox-textfield { - padding-left: 32px; -} -.tox[dir=rtl] .tox-control-wrap__status-icon-wrap { - left: 4px; -} -.tox .tox-autocompleter { - max-width: 25em; -} -.tox .tox-autocompleter .tox-menu { - max-width: 25em; -} -.tox .tox-autocompleter .tox-autocompleter-highlight { - font-weight: bold; -} -.tox .tox-color-input { - display: flex; - position: relative; - z-index: 1; -} -.tox .tox-color-input .tox-textfield { - z-index: -1; -} -.tox .tox-color-input span { - border-color: rgba(42, 55, 70, 0.2); - border-radius: 3px; - border-style: solid; - border-width: 1px; - box-shadow: none; - box-sizing: border-box; - height: 24px; - position: absolute; - top: 6px; - width: 24px; -} -.tox .tox-color-input span:hover:not([aria-disabled=true]), -.tox .tox-color-input span:focus:not([aria-disabled=true]) { - border-color: #207ab7; - cursor: pointer; -} -.tox .tox-color-input span::before { - background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.25) 25%, transparent 25%), linear-gradient(-45deg, rgba(255, 255, 255, 0.25) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.25) 75%), linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.25) 75%); - background-position: 0 0, 0 6px, 6px -6px, -6px 0; - background-size: 12px 12px; - border: 1px solid #2b3b4e; - border-radius: 3px; - box-sizing: border-box; - content: ''; - height: 24px; - left: -1px; - position: absolute; - top: -1px; - width: 24px; - z-index: -1; -} -.tox .tox-color-input span[aria-disabled=true] { - cursor: not-allowed; -} -.tox:not([dir=rtl]) .tox-color-input { - /* stylelint-disable-next-line no-descending-specificity */ -} -.tox:not([dir=rtl]) .tox-color-input .tox-textfield { - padding-left: 36px; -} -.tox:not([dir=rtl]) .tox-color-input span { - left: 6px; -} -.tox[dir="rtl"] .tox-color-input { - /* stylelint-disable-next-line no-descending-specificity */ -} -.tox[dir="rtl"] .tox-color-input .tox-textfield { - padding-right: 36px; -} -.tox[dir="rtl"] .tox-color-input span { - right: 6px; -} -.tox .tox-label, -.tox .tox-toolbar-label { - color: rgba(255, 255, 255, 0.5); - display: block; - font-size: 14px; - font-style: normal; - font-weight: normal; - line-height: 1.3; - padding: 0 8px 0 0; - text-transform: none; - white-space: nowrap; -} -.tox .tox-toolbar-label { - padding: 0 8px; -} -.tox[dir=rtl] .tox-label { - padding: 0 0 0 8px; -} -.tox .tox-form { - display: flex; - flex: 1; - flex-direction: column; - -ms-flex-preferred-size: auto; -} -.tox .tox-form__group { - box-sizing: border-box; - margin-bottom: 4px; -} -.tox .tox-form-group--maximize { - flex: 1; -} -.tox .tox-form__group--error { - color: #c00; -} -.tox .tox-form__group--collection { - display: flex; -} -.tox .tox-form__grid { - display: flex; - flex-direction: row; - flex-wrap: wrap; - justify-content: space-between; -} -.tox .tox-form__grid--2col > .tox-form__group { - width: calc(50% - (8px / 2)); -} -.tox .tox-form__grid--3col > .tox-form__group { - width: calc(100% / 3 - (8px / 2)); -} -.tox .tox-form__grid--4col > .tox-form__group { - width: calc(25% - (8px / 2)); -} -.tox .tox-form__controls-h-stack { - align-items: center; - display: flex; -} -.tox .tox-form__group--inline { - align-items: center; - display: flex; -} -.tox .tox-form__group--stretched { - display: flex; - flex: 1; - flex-direction: column; - -ms-flex-preferred-size: auto; -} -.tox .tox-form__group--stretched .tox-textarea { - flex: 1; - -ms-flex-preferred-size: auto; -} -.tox .tox-form__group--stretched .tox-navobj { - display: flex; - flex: 1; - -ms-flex-preferred-size: auto; -} -.tox .tox-form__group--stretched .tox-navobj :nth-child(2) { - flex: 1; - -ms-flex-preferred-size: auto; - height: 100%; -} -.tox:not([dir=rtl]) .tox-form__controls-h-stack > *:not(:first-child) { - margin-left: 4px; -} -.tox[dir=rtl] .tox-form__controls-h-stack > *:not(:first-child) { - margin-right: 4px; -} -.tox .tox-lock.tox-locked .tox-lock-icon__unlock, -.tox .tox-lock:not(.tox-locked) .tox-lock-icon__lock { - display: none; -} -.tox .tox-textfield, -.tox .tox-toolbar-textfield, -.tox .tox-listboxfield .tox-listbox--select, -.tox .tox-textarea { - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #2b3b4e; - border-color: #000000; - border-radius: 3px; - border-style: solid; - border-width: 1px; - box-shadow: none; - box-sizing: border-box; - color: #fff; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - font-size: 16px; - line-height: 24px; - margin: 0; - min-height: 34px; - outline: none; - padding: 5px 4.75px; - resize: none; - width: 100%; -} -.tox .tox-textfield[disabled], -.tox .tox-textarea[disabled] { - background-color: #222f3e; - color: rgba(255, 255, 255, 0.85); - cursor: not-allowed; -} -.tox .tox-textfield:focus, -.tox .tox-listboxfield .tox-listbox--select:focus, -.tox .tox-textarea:focus { - background-color: #2b3b4e; - border-color: #207ab7; - box-shadow: none; - outline: none; -} -.tox .tox-toolbar-textfield { - border-width: 0; - margin-bottom: 3px; - margin-top: 2px; - max-width: 250px; -} -.tox .tox-naked-btn { - background-color: transparent; - border: 0; - border-color: transparent; - box-shadow: unset; - color: #207ab7; - cursor: pointer; - display: block; - margin: 0; - padding: 0; -} -.tox .tox-naked-btn svg { - display: block; - fill: #fff; -} -.tox:not([dir=rtl]) .tox-toolbar-textfield + * { - margin-left: 4px; -} -.tox[dir=rtl] .tox-toolbar-textfield + * { - margin-right: 4px; -} -.tox .tox-listboxfield { - cursor: pointer; - position: relative; -} -.tox .tox-listboxfield .tox-listbox--select[disabled] { - background-color: #19232e; - color: rgba(255, 255, 255, 0.85); - cursor: not-allowed; -} -.tox .tox-listbox__select-label { - cursor: default; - flex: 1; - margin: 0 4px; -} -.tox .tox-listbox__select-chevron { - align-items: center; - display: flex; - justify-content: center; - width: 16px; -} -.tox .tox-listbox__select-chevron svg { - fill: #fff; -} -.tox .tox-listboxfield .tox-listbox--select { - align-items: center; - display: flex; -} -.tox:not([dir=rtl]) .tox-listboxfield svg { - right: 8px; -} -.tox[dir=rtl] .tox-listboxfield svg { - left: 8px; -} -.tox .tox-selectfield { - cursor: pointer; - position: relative; -} -.tox .tox-selectfield select { - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; - background-color: #2b3b4e; - border-color: #000000; - border-radius: 3px; - border-style: solid; - border-width: 1px; - box-shadow: none; - box-sizing: border-box; - color: #fff; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; - font-size: 16px; - line-height: 24px; - margin: 0; - min-height: 34px; - outline: none; - padding: 5px 4.75px; - resize: none; - width: 100%; -} -.tox .tox-selectfield select[disabled] { - background-color: #19232e; - color: rgba(255, 255, 255, 0.85); - cursor: not-allowed; -} -.tox .tox-selectfield select::-ms-expand { - display: none; -} -.tox .tox-selectfield select:focus { - background-color: #2b3b4e; - border-color: #207ab7; - box-shadow: none; - outline: none; -} -.tox .tox-selectfield svg { - pointer-events: none; - position: absolute; - top: 50%; - transform: translateY(-50%); -} -.tox:not([dir=rtl]) .tox-selectfield select[size="0"], -.tox:not([dir=rtl]) .tox-selectfield select[size="1"] { - padding-right: 24px; -} -.tox:not([dir=rtl]) .tox-selectfield svg { - right: 8px; -} -.tox[dir=rtl] .tox-selectfield select[size="0"], -.tox[dir=rtl] .tox-selectfield select[size="1"] { - padding-left: 24px; -} -.tox[dir=rtl] .tox-selectfield svg { - left: 8px; -} -.tox .tox-textarea { - -webkit-appearance: textarea; - -moz-appearance: textarea; - appearance: textarea; - white-space: pre-wrap; -} -.tox-fullscreen { - border: 0; - height: 100%; - left: 0; - margin: 0; - overflow: hidden; - -ms-scroll-chaining: none; - overscroll-behavior: none; - padding: 0; - position: fixed; - top: 0; - touch-action: pinch-zoom; - width: 100%; -} -.tox-fullscreen .tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle { - display: none; -} -.tox-fullscreen .tox.tox-tinymce.tox-fullscreen { - z-index: 1200; -} -.tox-fullscreen .tox.tox-tinymce-aux { - z-index: 1201; -} -.tox .tox-help__more-link { - list-style: none; - margin-top: 1em; -} -.tox .tox-image-tools { - width: 100%; -} -.tox .tox-image-tools__toolbar { - align-items: center; - display: flex; - justify-content: center; -} -.tox .tox-image-tools__image { - background-color: #666; - height: 380px; - overflow: auto; - position: relative; - width: 100%; -} -.tox .tox-image-tools__image, -.tox .tox-image-tools__image + .tox-image-tools__toolbar { - margin-top: 8px; -} -.tox .tox-image-tools__image-bg { - background: url(data:image/gif;base64,R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw==); -} -.tox .tox-image-tools__toolbar > .tox-spacer { - flex: 1; - -ms-flex-preferred-size: auto; -} -.tox .tox-croprect-block { - background: black; - filter: alpha(opacity=50); - opacity: 0.5; - position: absolute; - zoom: 1; -} -.tox .tox-croprect-handle { - border: 2px solid white; - height: 20px; - left: 0; - position: absolute; - top: 0; - width: 20px; -} -.tox .tox-croprect-handle-move { - border: 0; - cursor: move; - position: absolute; -} -.tox .tox-croprect-handle-nw { - border-width: 2px 0 0 2px; - cursor: nw-resize; - left: 100px; - margin: -2px 0 0 -2px; - top: 100px; -} -.tox .tox-croprect-handle-ne { - border-width: 2px 2px 0 0; - cursor: ne-resize; - left: 200px; - margin: -2px 0 0 -20px; - top: 100px; -} -.tox .tox-croprect-handle-sw { - border-width: 0 0 2px 2px; - cursor: sw-resize; - left: 100px; - margin: -20px 2px 0 -2px; - top: 200px; -} -.tox .tox-croprect-handle-se { - border-width: 0 2px 2px 0; - cursor: se-resize; - left: 200px; - margin: -20px 0 0 -20px; - top: 200px; -} -.tox:not([dir=rtl]) .tox-image-tools__toolbar > .tox-slider:not(:first-of-type) { - margin-left: 8px; -} -.tox:not([dir=rtl]) .tox-image-tools__toolbar > .tox-button + .tox-slider { - margin-left: 32px; -} -.tox:not([dir=rtl]) .tox-image-tools__toolbar > .tox-slider + .tox-button { - margin-left: 32px; -} -.tox[dir=rtl] .tox-image-tools__toolbar > .tox-slider:not(:first-of-type) { - margin-right: 8px; -} -.tox[dir=rtl] .tox-image-tools__toolbar > .tox-button + .tox-slider { - margin-right: 32px; -} -.tox[dir=rtl] .tox-image-tools__toolbar > .tox-slider + .tox-button { - margin-right: 32px; -} -.tox .tox-insert-table-picker { - display: flex; - flex-wrap: wrap; - width: 170px; -} -.tox .tox-insert-table-picker > div { - border-color: #000000; - border-style: solid; - border-width: 0 1px 1px 0; - box-sizing: border-box; - height: 17px; - width: 17px; -} -.tox .tox-collection--list .tox-collection__group .tox-insert-table-picker { - margin: -4px 0; -} -.tox .tox-insert-table-picker .tox-insert-table-picker__selected { - background-color: rgba(32, 122, 183, 0.5); - border-color: rgba(32, 122, 183, 0.5); -} -.tox .tox-insert-table-picker__label { - color: #fff; - display: block; - font-size: 14px; - padding: 4px; - text-align: center; - width: 100%; -} -.tox:not([dir=rtl]) { - /* stylelint-disable-next-line no-descending-specificity */ -} -.tox:not([dir=rtl]) .tox-insert-table-picker > div:nth-child(10n) { - border-right: 0; -} -.tox[dir=rtl] { - /* stylelint-disable-next-line no-descending-specificity */ -} -.tox[dir=rtl] .tox-insert-table-picker > div:nth-child(10n+1) { - border-right: 0; -} -.tox { - /* stylelint-disable */ - /* stylelint-enable */ -} -.tox .tox-menu { - background-color: #2b3b4e; - border: 1px solid #000000; - border-radius: 3px; - box-shadow: 0 4px 8px 0 rgba(42, 55, 70, 0.1); - display: inline-block; - overflow: hidden; - vertical-align: top; - z-index: 1150; -} -.tox .tox-menu.tox-collection.tox-collection--list { - padding: 0; -} -.tox .tox-menu.tox-collection.tox-collection--toolbar { - padding: 4px; -} -.tox .tox-menu.tox-collection.tox-collection--grid { - padding: 4px; -} -.tox .tox-menu__label h1, -.tox .tox-menu__label h2, -.tox .tox-menu__label h3, -.tox .tox-menu__label h4, -.tox .tox-menu__label h5, -.tox .tox-menu__label h6, -.tox .tox-menu__label p, -.tox .tox-menu__label blockquote, -.tox .tox-menu__label code { - margin: 0; -} -.tox .tox-menubar { - background: url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23000000'/%3E%3C/svg%3E") left 0 top 0 #222f3e; - background-color: #222f3e; - display: flex; - flex: 0 0 auto; - flex-shrink: 0; - flex-wrap: wrap; - padding: 0 4px 0 4px; -} -.tox.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-menubar { - border-top: 1px solid #000000; -} -/* Deprecated. Remove in next major release */ -.tox .tox-mbtn { - align-items: center; - background: transparent; - border: 0; - border-radius: 3px; - box-shadow: none; - color: #fff; - display: flex; - flex: 0 0 auto; - font-size: 14px; - font-style: normal; - font-weight: normal; - height: 34px; - justify-content: center; - margin: 2px 0 3px 0; - outline: none; - overflow: hidden; - padding: 0 4px; - text-transform: none; - width: auto; -} -.tox .tox-mbtn[disabled] { - background-color: transparent; - border: 0; - box-shadow: none; - color: rgba(255, 255, 255, 0.5); - cursor: not-allowed; -} -.tox .tox-mbtn:focus:not(:disabled) { - background: #4a5562; - border: 0; - box-shadow: none; - color: #fff; -} -.tox .tox-mbtn--active { - background: #757d87; - border: 0; - box-shadow: none; - color: #fff; -} -.tox .tox-mbtn:hover:not(:disabled):not(.tox-mbtn--active) { - background: #4a5562; - border: 0; - box-shadow: none; - color: #fff; -} -.tox .tox-mbtn__select-label { - cursor: default; - font-weight: normal; - margin: 0 4px; -} -.tox .tox-mbtn[disabled] .tox-mbtn__select-label { - cursor: not-allowed; -} -.tox .tox-mbtn__select-chevron { - align-items: center; - display: flex; - justify-content: center; - width: 16px; - display: none; -} -.tox .tox-notification { - border-radius: 3px; - border-style: solid; - border-width: 1px; - box-shadow: none; - box-sizing: border-box; - display: -ms-grid; - display: grid; - font-size: 14px; - font-weight: normal; - -ms-grid-columns: minmax(40px, 1fr) auto minmax(40px, 1fr); - grid-template-columns: minmax(40px, 1fr) auto minmax(40px, 1fr); - margin-top: 4px; - opacity: 0; - padding: 4px; - transition: transform 100ms ease-in, opacity 150ms ease-in; -} -.tox .tox-notification p { - font-size: 14px; - font-weight: normal; -} -.tox .tox-notification a { - text-decoration: underline; -} -.tox .tox-notification--in { - opacity: 1; -} -.tox .tox-notification--success { - background-color: #e4eeda; - border-color: #d7e6c8; - color: #fff; -} -.tox .tox-notification--success p { - color: #fff; -} -.tox .tox-notification--success a { - color: #547831; -} -.tox .tox-notification--success svg { - fill: #fff; -} -.tox .tox-notification--error { - background-color: #f8dede; - border-color: #f2bfbf; - color: #fff; -} -.tox .tox-notification--error p { - color: #fff; -} -.tox .tox-notification--error a { - color: #c00; -} -.tox .tox-notification--error svg { - fill: #fff; -} -.tox .tox-notification--warn, -.tox .tox-notification--warning { - background-color: #fffaea; - border-color: #ffe89d; - color: #fff; -} -.tox .tox-notification--warn p, -.tox .tox-notification--warning p { - color: #fff; -} -.tox .tox-notification--warn a, -.tox .tox-notification--warning a { - color: #fff; -} -.tox .tox-notification--warn svg, -.tox .tox-notification--warning svg { - fill: #fff; -} -.tox .tox-notification--info { - background-color: #d9edf7; - border-color: #779ecb; - color: #fff; -} -.tox .tox-notification--info p { - color: #fff; -} -.tox .tox-notification--info a { - color: #fff; -} -.tox .tox-notification--info svg { - fill: #fff; -} -.tox .tox-notification__body { - -ms-grid-row-align: center; - align-self: center; - color: #fff; - font-size: 14px; - -ms-grid-column-span: 1; - grid-column-end: 3; - -ms-grid-column: 2; - grid-column-start: 2; - -ms-grid-row-span: 1; - grid-row-end: 2; - -ms-grid-row: 1; - grid-row-start: 1; - text-align: center; - white-space: normal; - word-break: break-all; - word-break: break-word; -} -.tox .tox-notification__body > * { - margin: 0; -} -.tox .tox-notification__body > * + * { - margin-top: 1rem; -} -.tox .tox-notification__icon { - -ms-grid-row-align: center; - align-self: center; - -ms-grid-column-span: 1; - grid-column-end: 2; - -ms-grid-column: 1; - grid-column-start: 1; - -ms-grid-row-span: 1; - grid-row-end: 2; - -ms-grid-row: 1; - grid-row-start: 1; - -ms-grid-column-align: end; - justify-self: end; -} -.tox .tox-notification__icon svg { - display: block; -} -.tox .tox-notification__dismiss { - -ms-grid-row-align: start; - align-self: start; - -ms-grid-column-span: 1; - grid-column-end: 4; - -ms-grid-column: 3; - grid-column-start: 3; - -ms-grid-row-span: 1; - grid-row-end: 2; - -ms-grid-row: 1; - grid-row-start: 1; - -ms-grid-column-align: end; - justify-self: end; -} -.tox .tox-notification .tox-progress-bar { - -ms-grid-column-span: 3; - grid-column-end: 4; - -ms-grid-column: 1; - grid-column-start: 1; - -ms-grid-row-span: 1; - grid-row-end: 3; - -ms-grid-row: 2; - grid-row-start: 2; - -ms-grid-column-align: center; - justify-self: center; -} -.tox .tox-pop { - display: inline-block; - position: relative; -} -.tox .tox-pop--resizing { - transition: width 0.1s ease; -} -.tox .tox-pop--resizing .tox-toolbar { - flex-wrap: nowrap; -} -.tox .tox-pop__dialog { - background-color: #222f3e; - border: 1px solid #000000; - border-radius: 3px; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); - min-width: 0; - overflow: hidden; -} -.tox .tox-pop__dialog > *:not(.tox-toolbar) { - margin: 4px 4px 4px 8px; -} -.tox .tox-pop__dialog .tox-toolbar { - background-color: transparent; - margin-bottom: -1px; -} -.tox .tox-pop::before, -.tox .tox-pop::after { - border-style: solid; - content: ''; - display: block; - height: 0; - position: absolute; - width: 0; -} -.tox .tox-pop.tox-pop--bottom::before, -.tox .tox-pop.tox-pop--bottom::after { - left: 50%; - top: 100%; -} -.tox .tox-pop.tox-pop--bottom::after { - border-color: #222f3e transparent transparent transparent; - border-width: 8px; - margin-left: -8px; - margin-top: -1px; -} -.tox .tox-pop.tox-pop--bottom::before { - border-color: #000000 transparent transparent transparent; - border-width: 9px; - margin-left: -9px; -} -.tox .tox-pop.tox-pop--top::before, -.tox .tox-pop.tox-pop--top::after { - left: 50%; - top: 0; - transform: translateY(-100%); -} -.tox .tox-pop.tox-pop--top::after { - border-color: transparent transparent #222f3e transparent; - border-width: 8px; - margin-left: -8px; - margin-top: 1px; -} -.tox .tox-pop.tox-pop--top::before { - border-color: transparent transparent #000000 transparent; - border-width: 9px; - margin-left: -9px; -} -.tox .tox-pop.tox-pop--left::before, -.tox .tox-pop.tox-pop--left::after { - left: 0; - top: calc(50% - 1px); - transform: translateY(-50%); -} -.tox .tox-pop.tox-pop--left::after { - border-color: transparent #222f3e transparent transparent; - border-width: 8px; - margin-left: -15px; -} -.tox .tox-pop.tox-pop--left::before { - border-color: transparent #000000 transparent transparent; - border-width: 10px; - margin-left: -19px; -} -.tox .tox-pop.tox-pop--right::before, -.tox .tox-pop.tox-pop--right::after { - left: 100%; - top: calc(50% + 1px); - transform: translateY(-50%); -} -.tox .tox-pop.tox-pop--right::after { - border-color: transparent transparent transparent #222f3e; - border-width: 8px; - margin-left: -1px; -} -.tox .tox-pop.tox-pop--right::before { - border-color: transparent transparent transparent #000000; - border-width: 10px; - margin-left: -1px; -} -.tox .tox-pop.tox-pop--align-left::before, -.tox .tox-pop.tox-pop--align-left::after { - left: 20px; -} -.tox .tox-pop.tox-pop--align-right::before, -.tox .tox-pop.tox-pop--align-right::after { - left: calc(100% - 20px); -} -.tox .tox-sidebar-wrap { - display: flex; - flex-direction: row; - flex-grow: 1; - -ms-flex-preferred-size: 0; - min-height: 0; -} -.tox .tox-sidebar { - background-color: #222f3e; - display: flex; - flex-direction: row; - justify-content: flex-end; -} -.tox .tox-sidebar__slider { - display: flex; - overflow: hidden; -} -.tox .tox-sidebar__pane-container { - display: flex; -} -.tox .tox-sidebar__pane { - display: flex; -} -.tox .tox-sidebar--sliding-closed { - opacity: 0; -} -.tox .tox-sidebar--sliding-open { - opacity: 1; -} -.tox .tox-sidebar--sliding-growing, -.tox .tox-sidebar--sliding-shrinking { - transition: width 0.5s ease, opacity 0.5s ease; -} -.tox .tox-selector { - background-color: #4099ff; - border-color: #4099ff; - border-style: solid; - border-width: 1px; - box-sizing: border-box; - display: inline-block; - height: 10px; - position: absolute; - width: 10px; -} -.tox.tox-platform-touch .tox-selector { - height: 12px; - width: 12px; -} -.tox .tox-slider { - align-items: center; - display: flex; - flex: 1; - -ms-flex-preferred-size: auto; - height: 24px; - justify-content: center; - position: relative; -} -.tox .tox-slider__rail { - background-color: transparent; - border: 1px solid #000000; - border-radius: 3px; - height: 10px; - min-width: 120px; - width: 100%; -} -.tox .tox-slider__handle { - background-color: #207ab7; - border: 2px solid #185d8c; - border-radius: 3px; - box-shadow: none; - height: 24px; - left: 50%; - position: absolute; - top: 50%; - transform: translateX(-50%) translateY(-50%); - width: 14px; -} -.tox .tox-source-code { - overflow: auto; -} -.tox .tox-spinner { - display: flex; -} -.tox .tox-spinner > div { - animation: tam-bouncing-dots 1.5s ease-in-out 0s infinite both; - background-color: rgba(255, 255, 255, 0.5); - border-radius: 100%; - height: 8px; - width: 8px; -} -.tox .tox-spinner > div:nth-child(1) { - animation-delay: -0.32s; -} -.tox .tox-spinner > div:nth-child(2) { - animation-delay: -0.16s; -} -@keyframes tam-bouncing-dots { - 0%, - 80%, - 100% { - transform: scale(0); - } - 40% { - transform: scale(1); - } -} -.tox:not([dir=rtl]) .tox-spinner > div:not(:first-child) { - margin-left: 4px; -} -.tox[dir=rtl] .tox-spinner > div:not(:first-child) { - margin-right: 4px; -} -.tox .tox-statusbar { - align-items: center; - background-color: #222f3e; - border-top: 1px solid #000000; - color: #fff; - display: flex; - flex: 0 0 auto; - font-size: 12px; - font-weight: normal; - height: 18px; - overflow: hidden; - padding: 0 8px; - position: relative; - text-transform: uppercase; -} -.tox .tox-statusbar__text-container { - display: flex; - flex: 1 1 auto; - justify-content: flex-end; - overflow: hidden; -} -.tox .tox-statusbar__path { - display: flex; - flex: 1 1 auto; - margin-right: auto; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} -.tox .tox-statusbar__path > * { - display: inline; - white-space: nowrap; -} -.tox .tox-statusbar__wordcount { - flex: 0 0 auto; - margin-left: 1ch; -} -.tox .tox-statusbar a, -.tox .tox-statusbar__path-item, -.tox .tox-statusbar__wordcount { - color: #fff; - text-decoration: none; -} -.tox .tox-statusbar a:hover:not(:disabled):not([aria-disabled=true]), -.tox .tox-statusbar__path-item:hover:not(:disabled):not([aria-disabled=true]), -.tox .tox-statusbar__wordcount:hover:not(:disabled):not([aria-disabled=true]), -.tox .tox-statusbar a:focus:not(:disabled):not([aria-disabled=true]), -.tox .tox-statusbar__path-item:focus:not(:disabled):not([aria-disabled=true]), -.tox .tox-statusbar__wordcount:focus:not(:disabled):not([aria-disabled=true]) { - cursor: pointer; - text-decoration: underline; -} -.tox .tox-statusbar__resize-handle { - align-items: flex-end; - align-self: stretch; - cursor: nwse-resize; - display: flex; - flex: 0 0 auto; - justify-content: flex-end; - margin-left: auto; - margin-right: -8px; - padding-left: 1ch; -} -.tox .tox-statusbar__resize-handle svg { - display: block; - fill: #fff; -} -.tox:not([dir=rtl]) .tox-statusbar__path > * { - margin-right: 4px; -} -.tox:not([dir=rtl]) .tox-statusbar__branding { - margin-left: 1ch; -} -.tox[dir=rtl] .tox-statusbar { - flex-direction: row-reverse; -} -.tox[dir=rtl] .tox-statusbar__path > * { - margin-left: 4px; -} -.tox .tox-throbber { - z-index: 1400; -} -.tox .tox-throbber__busy-spinner { - align-items: center; - background-color: rgba(34, 47, 62, 0.6); - bottom: 0; - display: flex; - justify-content: center; - left: 0; - position: absolute; - right: 0; - top: 0; -} -.tox .tox-tbtn { - align-items: center; - background: transparent; - border: 0; - border-radius: 3px; - box-shadow: none; - color: #fff; - display: flex; - flex: 0 0 auto; - font-size: 14px; - font-style: normal; - font-weight: normal; - height: 34px; - justify-content: center; - margin: 2px 0 3px 0; - outline: none; - overflow: hidden; - padding: 0; - text-transform: none; - width: 34px; -} -.tox .tox-tbtn svg { - display: block; - fill: #fff; -} -.tox .tox-tbtn.tox-tbtn-more { - padding-left: 5px; - padding-right: 5px; - width: inherit; -} -.tox .tox-tbtn:focus { - background: #4a5562; - border: 0; - box-shadow: none; -} -.tox .tox-tbtn:hover { - background: #4a5562; - border: 0; - box-shadow: none; - color: #fff; -} -.tox .tox-tbtn:hover svg { - fill: #fff; -} -.tox .tox-tbtn:active { - background: #757d87; - border: 0; - box-shadow: none; - color: #fff; -} -.tox .tox-tbtn:active svg { - fill: #fff; -} -.tox .tox-tbtn--disabled, -.tox .tox-tbtn--disabled:hover, -.tox .tox-tbtn:disabled, -.tox .tox-tbtn:disabled:hover { - background: transparent; - border: 0; - box-shadow: none; - color: rgba(255, 255, 255, 0.5); - cursor: not-allowed; -} -.tox .tox-tbtn--disabled svg, -.tox .tox-tbtn--disabled:hover svg, -.tox .tox-tbtn:disabled svg, -.tox .tox-tbtn:disabled:hover svg { - /* stylelint-disable-line no-descending-specificity */ - fill: rgba(255, 255, 255, 0.5); -} -.tox .tox-tbtn--enabled, -.tox .tox-tbtn--enabled:hover { - background: #757d87; - border: 0; - box-shadow: none; - color: #fff; -} -.tox .tox-tbtn--enabled > *, -.tox .tox-tbtn--enabled:hover > * { - transform: none; -} -.tox .tox-tbtn--enabled svg, -.tox .tox-tbtn--enabled:hover svg { - /* stylelint-disable-line no-descending-specificity */ - fill: #fff; -} -.tox .tox-tbtn:focus:not(.tox-tbtn--disabled) { - color: #fff; -} -.tox .tox-tbtn:focus:not(.tox-tbtn--disabled) svg { - fill: #fff; -} -.tox .tox-tbtn:active > * { - transform: none; -} -.tox .tox-tbtn--md { - height: 51px; - width: 51px; -} -.tox .tox-tbtn--lg { - flex-direction: column; - height: 68px; - width: 68px; -} -.tox .tox-tbtn--return { - -ms-grid-row-align: stretch; - align-self: stretch; - height: unset; - width: 16px; -} -.tox .tox-tbtn--labeled { - padding: 0 4px; - width: unset; -} -.tox .tox-tbtn__vlabel { - display: block; - font-size: 10px; - font-weight: normal; - letter-spacing: -0.025em; - margin-bottom: 4px; - white-space: nowrap; -} -.tox .tox-tbtn--select { - margin: 2px 0 3px 0; - padding: 0 4px; - width: auto; -} -.tox .tox-tbtn__select-label { - cursor: default; - font-weight: normal; - margin: 0 4px; -} -.tox .tox-tbtn__select-chevron { - align-items: center; - display: flex; - justify-content: center; - width: 16px; -} -.tox .tox-tbtn__select-chevron svg { - fill: rgba(255, 255, 255, 0.5); -} -.tox .tox-tbtn--bespoke .tox-tbtn__select-label { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - width: 7em; -} -.tox .tox-split-button { - border: 0; - border-radius: 3px; - box-sizing: border-box; - display: flex; - margin: 2px 0 3px 0; - overflow: hidden; -} -.tox .tox-split-button:hover { - box-shadow: 0 0 0 1px #4a5562 inset; -} -.tox .tox-split-button:focus { - background: #4a5562; - box-shadow: none; - color: #fff; -} -.tox .tox-split-button > * { - border-radius: 0; -} -.tox .tox-split-button__chevron { - width: 16px; -} -.tox .tox-split-button__chevron svg { - fill: rgba(255, 255, 255, 0.5); -} -.tox .tox-split-button .tox-tbtn { - margin: 0; -} -.tox.tox-platform-touch .tox-split-button .tox-tbtn:first-child { - width: 30px; -} -.tox.tox-platform-touch .tox-split-button__chevron { - width: 20px; -} -.tox .tox-split-button.tox-tbtn--disabled:hover, -.tox .tox-split-button.tox-tbtn--disabled:focus, -.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:hover, -.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:focus { - background: transparent; - box-shadow: none; - color: rgba(255, 255, 255, 0.5); -} -.tox .tox-toolbar-overlord { - background-color: #222f3e; -} -.tox .tox-toolbar, -.tox .tox-toolbar__primary, -.tox .tox-toolbar__overflow { - background: url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23000000'/%3E%3C/svg%3E") left 0 top 0 #222f3e; - background-color: #222f3e; - display: flex; - flex: 0 0 auto; - flex-shrink: 0; - flex-wrap: wrap; - padding: 0 0; -} -.tox .tox-toolbar__overflow.tox-toolbar__overflow--closed { - height: 0; - opacity: 0; - padding-bottom: 0; - padding-top: 0; - visibility: hidden; -} -.tox .tox-toolbar__overflow--growing { - transition: height 0.3s ease, opacity 0.2s linear 0.1s; -} -.tox .tox-toolbar__overflow--shrinking { - transition: opacity 0.3s ease, height 0.2s linear 0.1s, visibility 0s linear 0.3s; -} -.tox .tox-menubar + .tox-toolbar, -.tox .tox-menubar + .tox-toolbar-overlord .tox-toolbar__primary { - border-top: 1px solid #000000; - margin-top: -1px; -} -.tox .tox-toolbar--scrolling { - flex-wrap: nowrap; - overflow-x: auto; -} -.tox .tox-pop .tox-toolbar { - border-width: 0; -} -.tox .tox-toolbar--no-divider { - background-image: none; -} -.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar:first-child, -.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar-overlord:first-child .tox-toolbar__primary { - border-top: 1px solid #000000; -} -.tox.tox-tinymce-aux .tox-toolbar__overflow { - background-color: #222f3e; - border: 1px solid #000000; - border-radius: 3px; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); -} -.tox[dir=rtl] .tox-tbtn__icon-rtl svg { - transform: rotateY(180deg); -} -.tox .tox-toolbar__group { - align-items: center; - display: flex; - flex-wrap: wrap; - margin: 0 0; - padding: 0 4px 0 4px; -} -.tox .tox-toolbar__group--pull-right { - margin-left: auto; -} -.tox .tox-toolbar--scrolling .tox-toolbar__group { - flex-shrink: 0; - flex-wrap: nowrap; -} -.tox:not([dir=rtl]) .tox-toolbar__group:not(:last-of-type) { - border-right: 1px solid #000000; -} -.tox[dir=rtl] .tox-toolbar__group:not(:last-of-type) { - border-left: 1px solid #000000; -} -.tox .tox-tooltip { - display: inline-block; - padding: 8px; - position: relative; -} -.tox .tox-tooltip__body { - background-color: #3d546f; - border-radius: 3px; - box-shadow: 0 2px 4px rgba(42, 55, 70, 0.3); - color: rgba(255, 255, 255, 0.75); - font-size: 14px; - font-style: normal; - font-weight: normal; - padding: 4px 8px; - text-transform: none; -} -.tox .tox-tooltip__arrow { - position: absolute; -} -.tox .tox-tooltip--down .tox-tooltip__arrow { - border-left: 8px solid transparent; - border-right: 8px solid transparent; - border-top: 8px solid #3d546f; - bottom: 0; - left: 50%; - position: absolute; - transform: translateX(-50%); -} -.tox .tox-tooltip--up .tox-tooltip__arrow { - border-bottom: 8px solid #3d546f; - border-left: 8px solid transparent; - border-right: 8px solid transparent; - left: 50%; - position: absolute; - top: 0; - transform: translateX(-50%); -} -.tox .tox-tooltip--right .tox-tooltip__arrow { - border-bottom: 8px solid transparent; - border-left: 8px solid #3d546f; - border-top: 8px solid transparent; - position: absolute; - right: 0; - top: 50%; - transform: translateY(-50%); -} -.tox .tox-tooltip--left .tox-tooltip__arrow { - border-bottom: 8px solid transparent; - border-right: 8px solid #3d546f; - border-top: 8px solid transparent; - left: 0; - position: absolute; - top: 50%; - transform: translateY(-50%); -} -.tox .tox-well { - border: 1px solid #000000; - border-radius: 3px; - padding: 8px; - width: 100%; -} -.tox .tox-well > *:first-child { - margin-top: 0; -} -.tox .tox-well > *:last-child { - margin-bottom: 0; -} -.tox .tox-well > *:only-child { - margin: 0; -} -.tox .tox-custom-editor { - border: 1px solid #000000; - border-radius: 3px; - display: flex; - flex: 1; - position: relative; -} -/* stylelint-disable */ -.tox { - /* stylelint-enable */ -} -.tox .tox-dialog-loading::before { - background-color: rgba(0, 0, 0, 0.5); - content: ""; - height: 100%; - position: absolute; - width: 100%; - z-index: 1000; -} -.tox .tox-tab { - cursor: pointer; -} -.tox .tox-dialog__content-js { - display: flex; - flex: 1; - -ms-flex-preferred-size: auto; -} -.tox .tox-dialog__body-content .tox-collection { - display: flex; - flex: 1; - -ms-flex-preferred-size: auto; -} -.tox .tox-image-tools-edit-panel { - height: 60px; -} -.tox .tox-image-tools__sidebar { - height: 60px; -} diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.min.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.min.css deleted file mode 100644 index fe2e7e43b393..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.min.css +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ -.tox{box-sizing:content-box;color:#2a3746;cursor:auto;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;font-style:normal;font-weight:400;line-height:normal;-webkit-tap-highlight-color:transparent;text-decoration:none;text-shadow:none;text-transform:none;vertical-align:initial;white-space:normal}.tox :not(svg):not(rect){box-sizing:inherit;color:inherit;cursor:inherit;direction:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;line-height:inherit;-webkit-tap-highlight-color:inherit;text-align:inherit;text-decoration:inherit;text-shadow:inherit;text-transform:inherit;vertical-align:inherit;white-space:inherit}.tox :not(svg):not(rect){background:0 0;border:0;float:none;height:auto;margin:0;max-width:none;outline:0;padding:0;position:static;width:auto}.tox:not([dir=rtl]){direction:ltr;text-align:left}.tox[dir=rtl]{direction:rtl;text-align:right}.tox-tinymce{border:1px solid #000;border-radius:0;box-shadow:none;box-sizing:border-box;display:flex;flex-direction:column;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;overflow:hidden;position:relative;visibility:inherit!important}.tox-tinymce-inline{border:none;box-shadow:none}.tox-tinymce-inline .tox-editor-header{border:1px solid #000;border-radius:0;box-shadow:none}.tox-tinymce-aux{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;z-index:1300}.tox-tinymce :focus,.tox-tinymce-aux :focus{outline:0}button::-moz-focus-inner{border:0}.tox .accessibility-issue__header{align-items:center;display:flex;margin-bottom:4px}.tox .accessibility-issue__description{align-items:stretch;border:1px solid #000;border-radius:3px;display:flex;justify-content:space-between}.tox .accessibility-issue__description>div{padding-bottom:4px}.tox .accessibility-issue__description>div>div{align-items:center;display:flex;margin-bottom:4px}.tox .accessibility-issue__description>:last-child:not(:only-child){border-color:#000;border-style:solid}.tox .accessibility-issue__repair{margin-top:16px}.tox .tox-dialog__body-content .accessibility-issue--info .accessibility-issue__description{background-color:rgba(32,122,183,.5);border-color:#207ab7;color:#fff}.tox .tox-dialog__body-content .accessibility-issue--info .accessibility-issue__description>:last-child{border-color:#207ab7}.tox .tox-dialog__body-content .accessibility-issue--info .tox-form__group h2{color:#fff}.tox .tox-dialog__body-content .accessibility-issue--info .tox-icon svg{fill:#fff}.tox .tox-dialog__body-content .accessibility-issue--info a .tox-icon{color:#fff}.tox .tox-dialog__body-content .accessibility-issue--warn .accessibility-issue__description{background-color:rgba(255,165,0,.5);border-color:rgba(255,165,0,.8);color:#fff}.tox .tox-dialog__body-content .accessibility-issue--warn .accessibility-issue__description>:last-child{border-color:rgba(255,165,0,.8)}.tox .tox-dialog__body-content .accessibility-issue--warn .tox-form__group h2{color:#fff}.tox .tox-dialog__body-content .accessibility-issue--warn .tox-icon svg{fill:#fff}.tox .tox-dialog__body-content .accessibility-issue--warn a .tox-icon{color:#fff}.tox .tox-dialog__body-content .accessibility-issue--error .accessibility-issue__description{background-color:rgba(204,0,0,.5);border-color:rgba(204,0,0,.8);color:#fff}.tox .tox-dialog__body-content .accessibility-issue--error .accessibility-issue__description>:last-child{border-color:rgba(204,0,0,.8)}.tox .tox-dialog__body-content .accessibility-issue--error .tox-form__group h2{color:#fff}.tox .tox-dialog__body-content .accessibility-issue--error .tox-icon svg{fill:#fff}.tox .tox-dialog__body-content .accessibility-issue--error a .tox-icon{color:#fff}.tox .tox-dialog__body-content .accessibility-issue--success .accessibility-issue__description{background-color:rgba(120,171,70,.5);border-color:rgba(120,171,70,.8);color:#fff}.tox .tox-dialog__body-content .accessibility-issue--success .accessibility-issue__description>:last-child{border-color:rgba(120,171,70,.8)}.tox .tox-dialog__body-content .accessibility-issue--success .tox-form__group h2{color:#fff}.tox .tox-dialog__body-content .accessibility-issue--success .tox-icon svg{fill:#fff}.tox .tox-dialog__body-content .accessibility-issue--success a .tox-icon{color:#fff}.tox .tox-dialog__body-content .accessibility-issue__header h1,.tox .tox-dialog__body-content .tox-form__group .accessibility-issue__description h2{margin-top:0}.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__header .tox-button{margin-left:4px}.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__header>:nth-last-child(2){margin-left:auto}.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__description{padding:4px 4px 4px 8px}.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__description>:last-child{border-left-width:1px;padding-left:4px}.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__header .tox-button{margin-right:4px}.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__header>:nth-last-child(2){margin-right:auto}.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__description{padding:4px 8px 4px 4px}.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__description>:last-child{border-right-width:1px;padding-right:4px}.tox .tox-anchorbar{display:flex;flex:0 0 auto}.tox .tox-bar{display:flex;flex:0 0 auto}.tox .tox-button{background-color:#207ab7;background-image:none;background-position:0 0;background-repeat:repeat;border-color:#207ab7;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-block;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:14px;font-style:normal;font-weight:700;letter-spacing:normal;line-height:24px;margin:0;outline:0;padding:4px 16px;text-align:center;text-decoration:none;text-transform:capitalize;white-space:nowrap}.tox .tox-button[disabled]{background-color:#207ab7;background-image:none;border-color:#207ab7;box-shadow:none;color:rgba(255,255,255,.5);cursor:not-allowed}.tox .tox-button:focus:not(:disabled){background-color:#1c6ca1;background-image:none;border-color:#1c6ca1;box-shadow:none;color:#fff}.tox .tox-button:hover:not(:disabled){background-color:#1c6ca1;background-image:none;border-color:#1c6ca1;box-shadow:none;color:#fff}.tox .tox-button:active:not(:disabled){background-color:#185d8c;background-image:none;border-color:#185d8c;box-shadow:none;color:#fff}.tox .tox-button--secondary{background-color:#3d546f;background-image:none;background-position:0 0;background-repeat:repeat;border-color:#3d546f;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;color:#fff;font-size:14px;font-style:normal;font-weight:700;letter-spacing:normal;outline:0;padding:4px 16px;text-decoration:none;text-transform:capitalize}.tox .tox-button--secondary[disabled]{background-color:#3d546f;background-image:none;border-color:#3d546f;box-shadow:none;color:rgba(255,255,255,.5)}.tox .tox-button--secondary:focus:not(:disabled){background-color:#34485f;background-image:none;border-color:#34485f;box-shadow:none;color:#fff}.tox .tox-button--secondary:hover:not(:disabled){background-color:#34485f;background-image:none;border-color:#34485f;box-shadow:none;color:#fff}.tox .tox-button--secondary:active:not(:disabled){background-color:#2b3b4e;background-image:none;border-color:#2b3b4e;box-shadow:none;color:#fff}.tox .tox-button--icon,.tox .tox-button.tox-button--icon,.tox .tox-button.tox-button--secondary.tox-button--icon{padding:4px}.tox .tox-button--icon .tox-icon svg,.tox .tox-button.tox-button--icon .tox-icon svg,.tox .tox-button.tox-button--secondary.tox-button--icon .tox-icon svg{display:block;fill:currentColor}.tox .tox-button-link{background:0;border:none;box-sizing:border-box;cursor:pointer;display:inline-block;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0;white-space:nowrap}.tox .tox-button-link--sm{font-size:14px}.tox .tox-button--naked{background-color:transparent;border-color:transparent;box-shadow:unset;color:#fff}.tox .tox-button--naked[disabled]{background-color:#3d546f;border-color:#3d546f;box-shadow:none;color:rgba(255,255,255,.5)}.tox .tox-button--naked:hover:not(:disabled){background-color:#34485f;border-color:#34485f;box-shadow:none;color:#fff}.tox .tox-button--naked:focus:not(:disabled){background-color:#34485f;border-color:#34485f;box-shadow:none;color:#fff}.tox .tox-button--naked:active:not(:disabled){background-color:#2b3b4e;border-color:#2b3b4e;box-shadow:none;color:#fff}.tox .tox-button--naked .tox-icon svg{fill:currentColor}.tox .tox-button--naked.tox-button--icon:hover:not(:disabled){color:#fff}.tox .tox-checkbox{align-items:center;border-radius:3px;cursor:pointer;display:flex;height:36px;min-width:36px}.tox .tox-checkbox__input{height:1px;overflow:hidden;position:absolute;top:auto;width:1px}.tox .tox-checkbox__icons{align-items:center;border-radius:3px;box-shadow:0 0 0 2px transparent;box-sizing:content-box;display:flex;height:24px;justify-content:center;padding:calc(4px - 1px);width:24px}.tox .tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display:block;fill:rgba(255,255,255,.2)}.tox .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{display:none;fill:#207ab7}.tox .tox-checkbox__icons .tox-checkbox-icon__checked svg{display:none;fill:#207ab7}.tox .tox-checkbox--disabled{color:rgba(255,255,255,.5);cursor:not-allowed}.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__checked svg{fill:rgba(255,255,255,.5)}.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__unchecked svg{fill:rgba(255,255,255,.5)}.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{fill:rgba(255,255,255,.5)}.tox input.tox-checkbox__input:checked+.tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display:none}.tox input.tox-checkbox__input:checked+.tox-checkbox__icons .tox-checkbox-icon__checked svg{display:block}.tox input.tox-checkbox__input:indeterminate+.tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display:none}.tox input.tox-checkbox__input:indeterminate+.tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{display:block}.tox input.tox-checkbox__input:focus+.tox-checkbox__icons{border-radius:3px;box-shadow:inset 0 0 0 1px #207ab7;padding:calc(4px - 1px)}.tox:not([dir=rtl]) .tox-checkbox__label{margin-left:4px}.tox:not([dir=rtl]) .tox-checkbox__input{left:-10000px}.tox:not([dir=rtl]) .tox-bar .tox-checkbox{margin-left:4px}.tox[dir=rtl] .tox-checkbox__label{margin-right:4px}.tox[dir=rtl] .tox-checkbox__input{right:-10000px}.tox[dir=rtl] .tox-bar .tox-checkbox{margin-right:4px}.tox .tox-collection--toolbar .tox-collection__group{display:flex;padding:0}.tox .tox-collection--grid .tox-collection__group{display:flex;flex-wrap:wrap;max-height:208px;overflow-x:hidden;overflow-y:auto;padding:0}.tox .tox-collection--list .tox-collection__group{border-bottom-width:0;border-color:#1a1a1a;border-left-width:0;border-right-width:0;border-style:solid;border-top-width:1px;padding:4px 0}.tox .tox-collection--list .tox-collection__group:first-child{border-top-width:0}.tox .tox-collection__group-heading{background-color:#333;color:#fff;cursor:default;font-size:12px;font-style:normal;font-weight:400;margin-bottom:4px;margin-top:-4px;padding:4px 8px;text-transform:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.tox .tox-collection__item{align-items:center;color:#fff;cursor:pointer;display:flex;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.tox .tox-collection--list .tox-collection__item{padding:4px 8px}.tox .tox-collection--toolbar .tox-collection__item{border-radius:3px;padding:4px}.tox .tox-collection--grid .tox-collection__item{border-radius:3px;padding:4px}.tox .tox-collection--list .tox-collection__item--enabled{background-color:#2b3b4e;color:#fff}.tox .tox-collection--list .tox-collection__item--active{background-color:#4a5562}.tox .tox-collection--toolbar .tox-collection__item--enabled{background-color:#757d87;color:#fff}.tox .tox-collection--toolbar .tox-collection__item--active{background-color:#4a5562}.tox .tox-collection--grid .tox-collection__item--enabled{background-color:#757d87;color:#fff}.tox .tox-collection--grid .tox-collection__item--active:not(.tox-collection__item--state-disabled){background-color:#4a5562;color:#fff}.tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled){color:#fff}.tox .tox-collection--toolbar .tox-collection__item--active:not(.tox-collection__item--state-disabled){color:#fff}.tox .tox-collection__item--state-disabled{background-color:transparent;color:rgba(255,255,255,.5);cursor:not-allowed}.tox .tox-collection__item-checkmark,.tox .tox-collection__item-icon{align-items:center;display:flex;height:24px;justify-content:center;width:24px}.tox .tox-collection__item-checkmark svg,.tox .tox-collection__item-icon svg{fill:currentColor}.tox .tox-collection--toolbar-lg .tox-collection__item-icon{height:48px;width:48px}.tox .tox-collection__item-label{color:currentColor;display:inline-block;flex:1;-ms-flex-preferred-size:auto;font-size:14px;font-style:normal;font-weight:400;line-height:24px;text-transform:none;word-break:break-all}.tox .tox-collection__item-accessory{color:rgba(255,255,255,.5);display:inline-block;font-size:14px;height:24px;line-height:24px;text-transform:none}.tox .tox-collection__item-caret{align-items:center;display:flex;min-height:24px}.tox .tox-collection__item-caret::after{content:'';font-size:0;min-height:inherit}.tox .tox-collection__item-caret svg{fill:#fff}.tox .tox-collection--list .tox-collection__item:not(.tox-collection__item--enabled) .tox-collection__item-checkmark svg{display:none}.tox .tox-collection--list .tox-collection__item:not(.tox-collection__item--enabled) .tox-collection__item-accessory+.tox-collection__item-checkmark{display:none}.tox .tox-collection--horizontal{background-color:#2b3b4e;border:1px solid #1a1a1a;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.15);display:flex;flex:0 0 auto;flex-shrink:0;flex-wrap:nowrap;margin-bottom:0;overflow-x:auto;padding:0}.tox .tox-collection--horizontal .tox-collection__group{align-items:center;display:flex;flex-wrap:nowrap;margin:0;padding:0 4px}.tox .tox-collection--horizontal .tox-collection__item{height:34px;margin:2px 0 3px 0;padding:0 4px}.tox .tox-collection--horizontal .tox-collection__item-label{white-space:nowrap}.tox .tox-collection--horizontal .tox-collection__item-caret{margin-left:4px}.tox:not([dir=rtl]) .tox-collection--horizontal .tox-collection__group:not(:last-of-type){border-right:1px solid #000}.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item>:not(:first-child){margin-left:8px}.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item-label:first-child{margin-left:4px}.tox:not([dir=rtl]) .tox-collection__item-accessory{margin-left:16px;text-align:right}.tox:not([dir=rtl]) .tox-collection .tox-collection__item-caret{margin-left:16px}.tox[dir=rtl] .tox-collection--horizontal .tox-collection__group:not(:last-of-type){border-left:1px solid #000}.tox[dir=rtl] .tox-collection--list .tox-collection__item>:not(:first-child){margin-right:8px}.tox[dir=rtl] .tox-collection--list .tox-collection__item-label:first-child{margin-right:4px}.tox[dir=rtl] .tox-collection__item-icon-rtl .tox-collection__item-icon svg{transform:rotateY(180deg)}.tox[dir=rtl] .tox-collection__item-accessory{margin-right:16px;text-align:left}.tox[dir=rtl] .tox-collection .tox-collection__item-caret{margin-right:16px;transform:rotateY(180deg)}.tox[dir=rtl] .tox-collection--horizontal .tox-collection__item-caret{margin-right:4px}.tox .tox-color-picker-container{display:flex;flex-direction:row;height:225px;margin:0}.tox .tox-sv-palette{box-sizing:border-box;display:flex;height:100%}.tox .tox-sv-palette-spectrum{height:100%}.tox .tox-sv-palette,.tox .tox-sv-palette-spectrum{width:225px}.tox .tox-sv-palette-thumb{background:0 0;border:1px solid #000;border-radius:50%;box-sizing:content-box;height:12px;position:absolute;width:12px}.tox .tox-sv-palette-inner-thumb{border:1px solid #fff;border-radius:50%;height:10px;position:absolute;width:10px}.tox .tox-hue-slider{box-sizing:border-box;height:100%;width:25px}.tox .tox-hue-slider-spectrum{background:linear-gradient(to bottom,red,#ff0080,#f0f,#8000ff,#00f,#0080ff,#0ff,#00ff80,#0f0,#80ff00,#ff0,#ff8000,red);height:100%;width:100%}.tox .tox-hue-slider,.tox .tox-hue-slider-spectrum{width:20px}.tox .tox-hue-slider-thumb{background:#fff;border:1px solid #000;box-sizing:content-box;height:4px;width:100%}.tox .tox-rgb-form{display:flex;flex-direction:column;justify-content:space-between}.tox .tox-rgb-form div{align-items:center;display:flex;justify-content:space-between;margin-bottom:5px;width:inherit}.tox .tox-rgb-form input{width:6em}.tox .tox-rgb-form input.tox-invalid{border:1px solid red!important}.tox .tox-rgb-form .tox-rgba-preview{border:1px solid #000;flex-grow:2;margin-bottom:0}.tox:not([dir=rtl]) .tox-sv-palette{margin-right:15px}.tox:not([dir=rtl]) .tox-hue-slider{margin-right:15px}.tox:not([dir=rtl]) .tox-hue-slider-thumb{margin-left:-1px}.tox:not([dir=rtl]) .tox-rgb-form label{margin-right:.5em}.tox[dir=rtl] .tox-sv-palette{margin-left:15px}.tox[dir=rtl] .tox-hue-slider{margin-left:15px}.tox[dir=rtl] .tox-hue-slider-thumb{margin-right:-1px}.tox[dir=rtl] .tox-rgb-form label{margin-left:.5em}.tox .tox-toolbar .tox-swatches,.tox .tox-toolbar__overflow .tox-swatches,.tox .tox-toolbar__primary .tox-swatches{margin:2px 0 3px 4px}.tox .tox-collection--list .tox-collection__group .tox-swatches-menu{border:0;margin:-4px 0}.tox .tox-swatches__row{display:flex}.tox .tox-swatch{height:30px;transition:transform .15s,box-shadow .15s;width:30px}.tox .tox-swatch:focus,.tox .tox-swatch:hover{box-shadow:0 0 0 1px rgba(127,127,127,.3) inset;transform:scale(.8)}.tox .tox-swatch--remove{align-items:center;display:flex;justify-content:center}.tox .tox-swatch--remove svg path{stroke:#e74c3c}.tox .tox-swatches__picker-btn{align-items:center;background-color:transparent;border:0;cursor:pointer;display:flex;height:30px;justify-content:center;outline:0;padding:0;width:30px}.tox .tox-swatches__picker-btn svg{height:24px;width:24px}.tox .tox-swatches__picker-btn:hover{background:#4a5562}.tox:not([dir=rtl]) .tox-swatches__picker-btn{margin-left:auto}.tox[dir=rtl] .tox-swatches__picker-btn{margin-right:auto}.tox .tox-comment-thread{background:#2b3b4e;position:relative}.tox .tox-comment-thread>:not(:first-child){margin-top:8px}.tox .tox-comment{background:#2b3b4e;border:1px solid #000;border-radius:3px;box-shadow:0 4px 8px 0 rgba(42,55,70,.1);padding:8px 8px 16px 8px;position:relative}.tox .tox-comment__header{align-items:center;color:#fff;display:flex;justify-content:space-between}.tox .tox-comment__date{color:rgba(255,255,255,.5);font-size:12px}.tox .tox-comment__body{color:#fff;font-size:14px;font-style:normal;font-weight:400;line-height:1.3;margin-top:8px;position:relative;text-transform:initial}.tox .tox-comment__body textarea{resize:none;white-space:normal;width:100%}.tox .tox-comment__expander{padding-top:8px}.tox .tox-comment__expander p{color:rgba(255,255,255,.5);font-size:14px;font-style:normal}.tox .tox-comment__body p{margin:0}.tox .tox-comment__buttonspacing{padding-top:16px;text-align:center}.tox .tox-comment-thread__overlay::after{background:#2b3b4e;bottom:0;content:"";display:flex;left:0;opacity:.9;position:absolute;right:0;top:0;z-index:5}.tox .tox-comment__reply{display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end;margin-top:8px}.tox .tox-comment__reply>:first-child{margin-bottom:8px;width:100%}.tox .tox-comment__edit{display:flex;flex-wrap:wrap;justify-content:flex-end;margin-top:16px}.tox .tox-comment__gradient::after{background:linear-gradient(rgba(43,59,78,0),#2b3b4e);bottom:0;content:"";display:block;height:5em;margin-top:-40px;position:absolute;width:100%}.tox .tox-comment__overlay{background:#2b3b4e;bottom:0;display:flex;flex-direction:column;flex-grow:1;left:0;opacity:.9;position:absolute;right:0;text-align:center;top:0;z-index:5}.tox .tox-comment__loading-text{align-items:center;color:#fff;display:flex;flex-direction:column;position:relative}.tox .tox-comment__loading-text>div{padding-bottom:16px}.tox .tox-comment__overlaytext{bottom:0;flex-direction:column;font-size:14px;left:0;padding:1em;position:absolute;right:0;top:0;z-index:10}.tox .tox-comment__overlaytext p{background-color:#2b3b4e;box-shadow:0 0 8px 8px #2b3b4e;color:#fff;text-align:center}.tox .tox-comment__overlaytext div:nth-of-type(2){font-size:.8em}.tox .tox-comment__busy-spinner{align-items:center;background-color:#2b3b4e;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:20}.tox .tox-comment__scroll{display:flex;flex-direction:column;flex-shrink:1;overflow:auto}.tox .tox-conversations{margin:8px}.tox:not([dir=rtl]) .tox-comment__edit{margin-left:8px}.tox:not([dir=rtl]) .tox-comment__buttonspacing>:last-child,.tox:not([dir=rtl]) .tox-comment__edit>:last-child,.tox:not([dir=rtl]) .tox-comment__reply>:last-child{margin-left:8px}.tox[dir=rtl] .tox-comment__edit{margin-right:8px}.tox[dir=rtl] .tox-comment__buttonspacing>:last-child,.tox[dir=rtl] .tox-comment__edit>:last-child,.tox[dir=rtl] .tox-comment__reply>:last-child{margin-right:8px}.tox .tox-user{align-items:center;display:flex}.tox .tox-user__avatar svg{fill:rgba(255,255,255,.5)}.tox .tox-user__name{color:rgba(255,255,255,.5);font-size:12px;font-style:normal;font-weight:700;text-transform:uppercase}.tox:not([dir=rtl]) .tox-user__avatar svg{margin-right:8px}.tox:not([dir=rtl]) .tox-user__avatar+.tox-user__name{margin-left:8px}.tox[dir=rtl] .tox-user__avatar svg{margin-left:8px}.tox[dir=rtl] .tox-user__avatar+.tox-user__name{margin-right:8px}.tox .tox-dialog-wrap{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:1100}.tox .tox-dialog-wrap__backdrop{background-color:rgba(34,47,62,.75);bottom:0;left:0;position:absolute;right:0;top:0;z-index:1}.tox .tox-dialog-wrap__backdrop--opaque{background-color:#222f3e}.tox .tox-dialog{background-color:#2b3b4e;border-color:#000;border-radius:3px;border-style:solid;border-width:1px;box-shadow:0 16px 16px -10px rgba(42,55,70,.15),0 0 40px 1px rgba(42,55,70,.15);display:flex;flex-direction:column;max-height:100%;max-width:480px;overflow:hidden;position:relative;width:95vw;z-index:2}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox .tox-dialog{align-self:flex-start;margin:8px auto;width:calc(100vw - 16px)}}.tox .tox-dialog-inline{z-index:1100}.tox .tox-dialog__header{align-items:center;background-color:#2b3b4e;border-bottom:none;color:#fff;display:flex;font-size:16px;justify-content:space-between;padding:8px 16px 0 16px;position:relative}.tox .tox-dialog__header .tox-button{z-index:1}.tox .tox-dialog__draghandle{cursor:grab;height:100%;left:0;position:absolute;top:0;width:100%}.tox .tox-dialog__draghandle:active{cursor:grabbing}.tox .tox-dialog__dismiss{margin-left:auto}.tox .tox-dialog__title{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:20px;font-style:normal;font-weight:400;line-height:1.3;margin:0;text-transform:none}.tox .tox-dialog__body{color:#fff;display:flex;flex:1;-ms-flex-preferred-size:auto;font-size:16px;font-style:normal;font-weight:400;line-height:1.3;min-width:0;text-align:left;text-transform:none}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox .tox-dialog__body{flex-direction:column}}.tox .tox-dialog__body-nav{align-items:flex-start;display:flex;flex-direction:column;padding:16px 16px}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox .tox-dialog__body-nav{flex-direction:row;-webkit-overflow-scrolling:touch;overflow-x:auto;padding-bottom:0}}.tox .tox-dialog__body-nav-item{border-bottom:2px solid transparent;color:rgba(255,255,255,.5);display:inline-block;font-size:14px;line-height:1.3;margin-bottom:8px;text-decoration:none;white-space:nowrap}.tox .tox-dialog__body-nav-item:focus{background-color:rgba(32,122,183,.1)}.tox .tox-dialog__body-nav-item--active{border-bottom:2px solid #207ab7;color:#207ab7}.tox .tox-dialog__body-content{box-sizing:border-box;display:flex;flex:1;flex-direction:column;-ms-flex-preferred-size:auto;max-height:650px;overflow:auto;-webkit-overflow-scrolling:touch;padding:16px 16px}.tox .tox-dialog__body-content>*{margin-bottom:0;margin-top:16px}.tox .tox-dialog__body-content>:first-child{margin-top:0}.tox .tox-dialog__body-content>:last-child{margin-bottom:0}.tox .tox-dialog__body-content>:only-child{margin-bottom:0;margin-top:0}.tox .tox-dialog__body-content a{color:#207ab7;cursor:pointer;text-decoration:none}.tox .tox-dialog__body-content a:focus,.tox .tox-dialog__body-content a:hover{color:#185d8c;text-decoration:none}.tox .tox-dialog__body-content a:active{color:#185d8c;text-decoration:none}.tox .tox-dialog__body-content svg{fill:#fff}.tox .tox-dialog__body-content ul{display:block;list-style-type:disc;margin-bottom:16px;-webkit-margin-end:0;margin-inline-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-padding-start:2.5rem;padding-inline-start:2.5rem}.tox .tox-dialog__body-content .tox-form__group h1{color:#fff;font-size:20px;font-style:normal;font-weight:700;letter-spacing:normal;margin-bottom:16px;margin-top:2rem;text-transform:none}.tox .tox-dialog__body-content .tox-form__group h2{color:#fff;font-size:16px;font-style:normal;font-weight:700;letter-spacing:normal;margin-bottom:16px;margin-top:2rem;text-transform:none}.tox .tox-dialog__body-content .tox-form__group p{margin-bottom:16px}.tox .tox-dialog__body-content .tox-form__group h1:first-child,.tox .tox-dialog__body-content .tox-form__group h2:first-child,.tox .tox-dialog__body-content .tox-form__group p:first-child{margin-top:0}.tox .tox-dialog__body-content .tox-form__group h1:last-child,.tox .tox-dialog__body-content .tox-form__group h2:last-child,.tox .tox-dialog__body-content .tox-form__group p:last-child{margin-bottom:0}.tox .tox-dialog__body-content .tox-form__group h1:only-child,.tox .tox-dialog__body-content .tox-form__group h2:only-child,.tox .tox-dialog__body-content .tox-form__group p:only-child{margin-bottom:0;margin-top:0}.tox .tox-dialog--width-lg{height:650px;max-width:1200px}.tox .tox-dialog--width-md{max-width:800px}.tox .tox-dialog--width-md .tox-dialog__body-content{overflow:auto}.tox .tox-dialog__body-content--centered{text-align:center}.tox .tox-dialog__footer{align-items:center;background-color:#2b3b4e;border-top:1px solid #000;display:flex;justify-content:space-between;padding:8px 16px}.tox .tox-dialog__footer-end,.tox .tox-dialog__footer-start{display:flex}.tox .tox-dialog__busy-spinner{align-items:center;background-color:rgba(34,47,62,.75);bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:3}.tox .tox-dialog__table{border-collapse:collapse;width:100%}.tox .tox-dialog__table thead th{font-weight:700;padding-bottom:8px}.tox .tox-dialog__table tbody tr{border-bottom:1px solid #000}.tox .tox-dialog__table tbody tr:last-child{border-bottom:none}.tox .tox-dialog__table td{padding-bottom:8px;padding-top:8px}.tox .tox-dialog__popups{position:absolute;width:100%;z-index:1100}.tox .tox-dialog__body-iframe{display:flex;flex:1;flex-direction:column;-ms-flex-preferred-size:auto}.tox .tox-dialog__body-iframe .tox-navobj{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-dialog__body-iframe .tox-navobj :nth-child(2){flex:1;-ms-flex-preferred-size:auto;height:100%}.tox .tox-dialog-dock-fadeout{opacity:0;visibility:hidden}.tox .tox-dialog-dock-fadein{opacity:1;visibility:visible}.tox .tox-dialog-dock-transition{transition:visibility 0s linear .3s,opacity .3s ease}.tox .tox-dialog-dock-transition.tox-dialog-dock-fadein{transition-delay:0s}body.tox-dialog__disable-scroll{overflow:hidden}.tox.tox-platform-ie .tox-dialog-wrap{position:-ms-device-fixed}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav{margin-right:0}}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav-item:not(:first-child){margin-left:8px}}.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-end>*,.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-start>*{margin-left:8px}.tox[dir=rtl] .tox-dialog__body{text-align:right}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav{margin-left:0}}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav-item:not(:first-child){margin-right:8px}}.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-end>*,.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-start>*{margin-right:8px}.tox .tox-dropzone-container{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-dropzone{align-items:center;background:#fff;border:2px dashed #000;box-sizing:border-box;display:flex;flex-direction:column;flex-grow:1;justify-content:center;min-height:100px;padding:10px}.tox .tox-dropzone p{color:rgba(255,255,255,.5);margin:0 0 16px 0}.tox .tox-edit-area{display:flex;flex:1;-ms-flex-preferred-size:auto;overflow:hidden;position:relative}.tox .tox-edit-area__iframe{background-color:#fff;border:0;box-sizing:border-box;flex:1;-ms-flex-preferred-size:auto;height:100%;position:absolute;width:100%}.tox.tox-inline-edit-area{border:1px dotted #000}.tox .tox-editor-container{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.tox .tox-editor-header{z-index:1}.tox:not(.tox-tinymce-inline) .tox-editor-header{box-shadow:none;transition:box-shadow .5s}.tox.tox-tinymce--toolbar-bottom .tox-editor-header,.tox.tox-tinymce-inline .tox-editor-header{margin-bottom:-1px}.tox.tox-tinymce--toolbar-sticky-on .tox-editor-header{box-shadow:0 4px 4px -3px rgba(0,0,0,.25)}.tox-editor-dock-fadeout{opacity:0;visibility:hidden}.tox-editor-dock-fadein{opacity:1;visibility:visible}.tox-editor-dock-transition{transition:visibility 0s linear .25s,opacity .25s ease}.tox-editor-dock-transition.tox-editor-dock-fadein{transition-delay:0s}.tox .tox-control-wrap{flex:1;position:relative}.tox .tox-control-wrap:not(.tox-control-wrap--status-invalid) .tox-control-wrap__status-icon-invalid,.tox .tox-control-wrap:not(.tox-control-wrap--status-unknown) .tox-control-wrap__status-icon-unknown,.tox .tox-control-wrap:not(.tox-control-wrap--status-valid) .tox-control-wrap__status-icon-valid{display:none}.tox .tox-control-wrap svg{display:block}.tox .tox-control-wrap__status-icon-wrap{position:absolute;top:50%;transform:translateY(-50%)}.tox .tox-control-wrap__status-icon-invalid svg{fill:#c00}.tox .tox-control-wrap__status-icon-unknown svg{fill:orange}.tox .tox-control-wrap__status-icon-valid svg{fill:green}.tox:not([dir=rtl]) .tox-control-wrap--status-invalid .tox-textfield,.tox:not([dir=rtl]) .tox-control-wrap--status-unknown .tox-textfield,.tox:not([dir=rtl]) .tox-control-wrap--status-valid .tox-textfield{padding-right:32px}.tox:not([dir=rtl]) .tox-control-wrap__status-icon-wrap{right:4px}.tox[dir=rtl] .tox-control-wrap--status-invalid .tox-textfield,.tox[dir=rtl] .tox-control-wrap--status-unknown .tox-textfield,.tox[dir=rtl] .tox-control-wrap--status-valid .tox-textfield{padding-left:32px}.tox[dir=rtl] .tox-control-wrap__status-icon-wrap{left:4px}.tox .tox-autocompleter{max-width:25em}.tox .tox-autocompleter .tox-menu{max-width:25em}.tox .tox-autocompleter .tox-autocompleter-highlight{font-weight:700}.tox .tox-color-input{display:flex;position:relative;z-index:1}.tox .tox-color-input .tox-textfield{z-index:-1}.tox .tox-color-input span{border-color:rgba(42,55,70,.2);border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;height:24px;position:absolute;top:6px;width:24px}.tox .tox-color-input span:focus:not([aria-disabled=true]),.tox .tox-color-input span:hover:not([aria-disabled=true]){border-color:#207ab7;cursor:pointer}.tox .tox-color-input span::before{background-image:linear-gradient(45deg,rgba(255,255,255,.25) 25%,transparent 25%),linear-gradient(-45deg,rgba(255,255,255,.25) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,rgba(255,255,255,.25) 75%),linear-gradient(-45deg,transparent 75%,rgba(255,255,255,.25) 75%);background-position:0 0,0 6px,6px -6px,-6px 0;background-size:12px 12px;border:1px solid #2b3b4e;border-radius:3px;box-sizing:border-box;content:'';height:24px;left:-1px;position:absolute;top:-1px;width:24px;z-index:-1}.tox .tox-color-input span[aria-disabled=true]{cursor:not-allowed}.tox:not([dir=rtl]) .tox-color-input .tox-textfield{padding-left:36px}.tox:not([dir=rtl]) .tox-color-input span{left:6px}.tox[dir=rtl] .tox-color-input .tox-textfield{padding-right:36px}.tox[dir=rtl] .tox-color-input span{right:6px}.tox .tox-label,.tox .tox-toolbar-label{color:rgba(255,255,255,.5);display:block;font-size:14px;font-style:normal;font-weight:400;line-height:1.3;padding:0 8px 0 0;text-transform:none;white-space:nowrap}.tox .tox-toolbar-label{padding:0 8px}.tox[dir=rtl] .tox-label{padding:0 0 0 8px}.tox .tox-form{display:flex;flex:1;flex-direction:column;-ms-flex-preferred-size:auto}.tox .tox-form__group{box-sizing:border-box;margin-bottom:4px}.tox .tox-form-group--maximize{flex:1}.tox .tox-form__group--error{color:#c00}.tox .tox-form__group--collection{display:flex}.tox .tox-form__grid{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between}.tox .tox-form__grid--2col>.tox-form__group{width:calc(50% - (8px / 2))}.tox .tox-form__grid--3col>.tox-form__group{width:calc(100% / 3 - (8px / 2))}.tox .tox-form__grid--4col>.tox-form__group{width:calc(25% - (8px / 2))}.tox .tox-form__controls-h-stack{align-items:center;display:flex}.tox .tox-form__group--inline{align-items:center;display:flex}.tox .tox-form__group--stretched{display:flex;flex:1;flex-direction:column;-ms-flex-preferred-size:auto}.tox .tox-form__group--stretched .tox-textarea{flex:1;-ms-flex-preferred-size:auto}.tox .tox-form__group--stretched .tox-navobj{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-form__group--stretched .tox-navobj :nth-child(2){flex:1;-ms-flex-preferred-size:auto;height:100%}.tox:not([dir=rtl]) .tox-form__controls-h-stack>:not(:first-child){margin-left:4px}.tox[dir=rtl] .tox-form__controls-h-stack>:not(:first-child){margin-right:4px}.tox .tox-lock.tox-locked .tox-lock-icon__unlock,.tox .tox-lock:not(.tox-locked) .tox-lock-icon__lock{display:none}.tox .tox-listboxfield .tox-listbox--select,.tox .tox-textarea,.tox .tox-textfield,.tox .tox-toolbar-textfield{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#2b3b4e;border-color:#000;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;color:#fff;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;line-height:24px;margin:0;min-height:34px;outline:0;padding:5px 4.75px;resize:none;width:100%}.tox .tox-textarea[disabled],.tox .tox-textfield[disabled]{background-color:#222f3e;color:rgba(255,255,255,.85);cursor:not-allowed}.tox .tox-listboxfield .tox-listbox--select:focus,.tox .tox-textarea:focus,.tox .tox-textfield:focus{background-color:#2b3b4e;border-color:#207ab7;box-shadow:none;outline:0}.tox .tox-toolbar-textfield{border-width:0;margin-bottom:3px;margin-top:2px;max-width:250px}.tox .tox-naked-btn{background-color:transparent;border:0;border-color:transparent;box-shadow:unset;color:#207ab7;cursor:pointer;display:block;margin:0;padding:0}.tox .tox-naked-btn svg{display:block;fill:#fff}.tox:not([dir=rtl]) .tox-toolbar-textfield+*{margin-left:4px}.tox[dir=rtl] .tox-toolbar-textfield+*{margin-right:4px}.tox .tox-listboxfield{cursor:pointer;position:relative}.tox .tox-listboxfield .tox-listbox--select[disabled]{background-color:#19232e;color:rgba(255,255,255,.85);cursor:not-allowed}.tox .tox-listbox__select-label{cursor:default;flex:1;margin:0 4px}.tox .tox-listbox__select-chevron{align-items:center;display:flex;justify-content:center;width:16px}.tox .tox-listbox__select-chevron svg{fill:#fff}.tox .tox-listboxfield .tox-listbox--select{align-items:center;display:flex}.tox:not([dir=rtl]) .tox-listboxfield svg{right:8px}.tox[dir=rtl] .tox-listboxfield svg{left:8px}.tox .tox-selectfield{cursor:pointer;position:relative}.tox .tox-selectfield select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#2b3b4e;border-color:#000;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;color:#fff;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;line-height:24px;margin:0;min-height:34px;outline:0;padding:5px 4.75px;resize:none;width:100%}.tox .tox-selectfield select[disabled]{background-color:#19232e;color:rgba(255,255,255,.85);cursor:not-allowed}.tox .tox-selectfield select::-ms-expand{display:none}.tox .tox-selectfield select:focus{background-color:#2b3b4e;border-color:#207ab7;box-shadow:none;outline:0}.tox .tox-selectfield svg{pointer-events:none;position:absolute;top:50%;transform:translateY(-50%)}.tox:not([dir=rtl]) .tox-selectfield select[size="0"],.tox:not([dir=rtl]) .tox-selectfield select[size="1"]{padding-right:24px}.tox:not([dir=rtl]) .tox-selectfield svg{right:8px}.tox[dir=rtl] .tox-selectfield select[size="0"],.tox[dir=rtl] .tox-selectfield select[size="1"]{padding-left:24px}.tox[dir=rtl] .tox-selectfield svg{left:8px}.tox .tox-textarea{-webkit-appearance:textarea;-moz-appearance:textarea;appearance:textarea;white-space:pre-wrap}.tox-fullscreen{border:0;height:100%;left:0;margin:0;overflow:hidden;-ms-scroll-chaining:none;overscroll-behavior:none;padding:0;position:fixed;top:0;touch-action:pinch-zoom;width:100%}.tox-fullscreen .tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle{display:none}.tox-fullscreen .tox.tox-tinymce.tox-fullscreen{z-index:1200}.tox-fullscreen .tox.tox-tinymce-aux{z-index:1201}.tox .tox-help__more-link{list-style:none;margin-top:1em}.tox .tox-image-tools{width:100%}.tox .tox-image-tools__toolbar{align-items:center;display:flex;justify-content:center}.tox .tox-image-tools__image{background-color:#666;height:380px;overflow:auto;position:relative;width:100%}.tox .tox-image-tools__image,.tox .tox-image-tools__image+.tox-image-tools__toolbar{margin-top:8px}.tox .tox-image-tools__image-bg{background:url(data:image/gif;base64,R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw==)}.tox .tox-image-tools__toolbar>.tox-spacer{flex:1;-ms-flex-preferred-size:auto}.tox .tox-croprect-block{background:#000;opacity:.5;position:absolute;zoom:1}.tox .tox-croprect-handle{border:2px solid #fff;height:20px;left:0;position:absolute;top:0;width:20px}.tox .tox-croprect-handle-move{border:0;cursor:move;position:absolute}.tox .tox-croprect-handle-nw{border-width:2px 0 0 2px;cursor:nw-resize;left:100px;margin:-2px 0 0 -2px;top:100px}.tox .tox-croprect-handle-ne{border-width:2px 2px 0 0;cursor:ne-resize;left:200px;margin:-2px 0 0 -20px;top:100px}.tox .tox-croprect-handle-sw{border-width:0 0 2px 2px;cursor:sw-resize;left:100px;margin:-20px 2px 0 -2px;top:200px}.tox .tox-croprect-handle-se{border-width:0 2px 2px 0;cursor:se-resize;left:200px;margin:-20px 0 0 -20px;top:200px}.tox:not([dir=rtl]) .tox-image-tools__toolbar>.tox-slider:not(:first-of-type){margin-left:8px}.tox:not([dir=rtl]) .tox-image-tools__toolbar>.tox-button+.tox-slider{margin-left:32px}.tox:not([dir=rtl]) .tox-image-tools__toolbar>.tox-slider+.tox-button{margin-left:32px}.tox[dir=rtl] .tox-image-tools__toolbar>.tox-slider:not(:first-of-type){margin-right:8px}.tox[dir=rtl] .tox-image-tools__toolbar>.tox-button+.tox-slider{margin-right:32px}.tox[dir=rtl] .tox-image-tools__toolbar>.tox-slider+.tox-button{margin-right:32px}.tox .tox-insert-table-picker{display:flex;flex-wrap:wrap;width:170px}.tox .tox-insert-table-picker>div{border-color:#000;border-style:solid;border-width:0 1px 1px 0;box-sizing:border-box;height:17px;width:17px}.tox .tox-collection--list .tox-collection__group .tox-insert-table-picker{margin:-4px 0}.tox .tox-insert-table-picker .tox-insert-table-picker__selected{background-color:rgba(32,122,183,.5);border-color:rgba(32,122,183,.5)}.tox .tox-insert-table-picker__label{color:#fff;display:block;font-size:14px;padding:4px;text-align:center;width:100%}.tox:not([dir=rtl]) .tox-insert-table-picker>div:nth-child(10n){border-right:0}.tox[dir=rtl] .tox-insert-table-picker>div:nth-child(10n+1){border-right:0}.tox .tox-menu{background-color:#2b3b4e;border:1px solid #000;border-radius:3px;box-shadow:0 4px 8px 0 rgba(42,55,70,.1);display:inline-block;overflow:hidden;vertical-align:top;z-index:1150}.tox .tox-menu.tox-collection.tox-collection--list{padding:0}.tox .tox-menu.tox-collection.tox-collection--toolbar{padding:4px}.tox .tox-menu.tox-collection.tox-collection--grid{padding:4px}.tox .tox-menu__label blockquote,.tox .tox-menu__label code,.tox .tox-menu__label h1,.tox .tox-menu__label h2,.tox .tox-menu__label h3,.tox .tox-menu__label h4,.tox .tox-menu__label h5,.tox .tox-menu__label h6,.tox .tox-menu__label p{margin:0}.tox .tox-menubar{background:url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23000000'/%3E%3C/svg%3E") left 0 top 0 #222f3e;background-color:#222f3e;display:flex;flex:0 0 auto;flex-shrink:0;flex-wrap:wrap;padding:0 4px 0 4px}.tox.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-menubar{border-top:1px solid #000}.tox .tox-mbtn{align-items:center;background:0 0;border:0;border-radius:3px;box-shadow:none;color:#fff;display:flex;flex:0 0 auto;font-size:14px;font-style:normal;font-weight:400;height:34px;justify-content:center;margin:2px 0 3px 0;outline:0;overflow:hidden;padding:0 4px;text-transform:none;width:auto}.tox .tox-mbtn[disabled]{background-color:transparent;border:0;box-shadow:none;color:rgba(255,255,255,.5);cursor:not-allowed}.tox .tox-mbtn:focus:not(:disabled){background:#4a5562;border:0;box-shadow:none;color:#fff}.tox .tox-mbtn--active{background:#757d87;border:0;box-shadow:none;color:#fff}.tox .tox-mbtn:hover:not(:disabled):not(.tox-mbtn--active){background:#4a5562;border:0;box-shadow:none;color:#fff}.tox .tox-mbtn__select-label{cursor:default;font-weight:400;margin:0 4px}.tox .tox-mbtn[disabled] .tox-mbtn__select-label{cursor:not-allowed}.tox .tox-mbtn__select-chevron{align-items:center;display:flex;justify-content:center;width:16px;display:none}.tox .tox-notification{border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;display:-ms-grid;display:grid;font-size:14px;font-weight:400;-ms-grid-columns:minmax(40px,1fr) auto minmax(40px,1fr);grid-template-columns:minmax(40px,1fr) auto minmax(40px,1fr);margin-top:4px;opacity:0;padding:4px;transition:transform .1s ease-in,opacity 150ms ease-in}.tox .tox-notification p{font-size:14px;font-weight:400}.tox .tox-notification a{text-decoration:underline}.tox .tox-notification--in{opacity:1}.tox .tox-notification--success{background-color:#e4eeda;border-color:#d7e6c8;color:#fff}.tox .tox-notification--success p{color:#fff}.tox .tox-notification--success a{color:#547831}.tox .tox-notification--success svg{fill:#fff}.tox .tox-notification--error{background-color:#f8dede;border-color:#f2bfbf;color:#fff}.tox .tox-notification--error p{color:#fff}.tox .tox-notification--error a{color:#c00}.tox .tox-notification--error svg{fill:#fff}.tox .tox-notification--warn,.tox .tox-notification--warning{background-color:#fffaea;border-color:#ffe89d;color:#fff}.tox .tox-notification--warn p,.tox .tox-notification--warning p{color:#fff}.tox .tox-notification--warn a,.tox .tox-notification--warning a{color:#fff}.tox .tox-notification--warn svg,.tox .tox-notification--warning svg{fill:#fff}.tox .tox-notification--info{background-color:#d9edf7;border-color:#779ecb;color:#fff}.tox .tox-notification--info p{color:#fff}.tox .tox-notification--info a{color:#fff}.tox .tox-notification--info svg{fill:#fff}.tox .tox-notification__body{-ms-grid-row-align:center;align-self:center;color:#fff;font-size:14px;-ms-grid-column-span:1;grid-column-end:3;-ms-grid-column:2;grid-column-start:2;-ms-grid-row-span:1;grid-row-end:2;-ms-grid-row:1;grid-row-start:1;text-align:center;white-space:normal;word-break:break-all;word-break:break-word}.tox .tox-notification__body>*{margin:0}.tox .tox-notification__body>*+*{margin-top:1rem}.tox .tox-notification__icon{-ms-grid-row-align:center;align-self:center;-ms-grid-column-span:1;grid-column-end:2;-ms-grid-column:1;grid-column-start:1;-ms-grid-row-span:1;grid-row-end:2;-ms-grid-row:1;grid-row-start:1;-ms-grid-column-align:end;justify-self:end}.tox .tox-notification__icon svg{display:block}.tox .tox-notification__dismiss{-ms-grid-row-align:start;align-self:start;-ms-grid-column-span:1;grid-column-end:4;-ms-grid-column:3;grid-column-start:3;-ms-grid-row-span:1;grid-row-end:2;-ms-grid-row:1;grid-row-start:1;-ms-grid-column-align:end;justify-self:end}.tox .tox-notification .tox-progress-bar{-ms-grid-column-span:3;grid-column-end:4;-ms-grid-column:1;grid-column-start:1;-ms-grid-row-span:1;grid-row-end:3;-ms-grid-row:2;grid-row-start:2;-ms-grid-column-align:center;justify-self:center}.tox .tox-pop{display:inline-block;position:relative}.tox .tox-pop--resizing{transition:width .1s ease}.tox .tox-pop--resizing .tox-toolbar{flex-wrap:nowrap}.tox .tox-pop__dialog{background-color:#222f3e;border:1px solid #000;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.15);min-width:0;overflow:hidden}.tox .tox-pop__dialog>:not(.tox-toolbar){margin:4px 4px 4px 8px}.tox .tox-pop__dialog .tox-toolbar{background-color:transparent;margin-bottom:-1px}.tox .tox-pop::after,.tox .tox-pop::before{border-style:solid;content:'';display:block;height:0;position:absolute;width:0}.tox .tox-pop.tox-pop--bottom::after,.tox .tox-pop.tox-pop--bottom::before{left:50%;top:100%}.tox .tox-pop.tox-pop--bottom::after{border-color:#222f3e transparent transparent transparent;border-width:8px;margin-left:-8px;margin-top:-1px}.tox .tox-pop.tox-pop--bottom::before{border-color:#000 transparent transparent transparent;border-width:9px;margin-left:-9px}.tox .tox-pop.tox-pop--top::after,.tox .tox-pop.tox-pop--top::before{left:50%;top:0;transform:translateY(-100%)}.tox .tox-pop.tox-pop--top::after{border-color:transparent transparent #222f3e transparent;border-width:8px;margin-left:-8px;margin-top:1px}.tox .tox-pop.tox-pop--top::before{border-color:transparent transparent #000 transparent;border-width:9px;margin-left:-9px}.tox .tox-pop.tox-pop--left::after,.tox .tox-pop.tox-pop--left::before{left:0;top:calc(50% - 1px);transform:translateY(-50%)}.tox .tox-pop.tox-pop--left::after{border-color:transparent #222f3e transparent transparent;border-width:8px;margin-left:-15px}.tox .tox-pop.tox-pop--left::before{border-color:transparent #000 transparent transparent;border-width:10px;margin-left:-19px}.tox .tox-pop.tox-pop--right::after,.tox .tox-pop.tox-pop--right::before{left:100%;top:calc(50% + 1px);transform:translateY(-50%)}.tox .tox-pop.tox-pop--right::after{border-color:transparent transparent transparent #222f3e;border-width:8px;margin-left:-1px}.tox .tox-pop.tox-pop--right::before{border-color:transparent transparent transparent #000;border-width:10px;margin-left:-1px}.tox .tox-pop.tox-pop--align-left::after,.tox .tox-pop.tox-pop--align-left::before{left:20px}.tox .tox-pop.tox-pop--align-right::after,.tox .tox-pop.tox-pop--align-right::before{left:calc(100% - 20px)}.tox .tox-sidebar-wrap{display:flex;flex-direction:row;flex-grow:1;-ms-flex-preferred-size:0;min-height:0}.tox .tox-sidebar{background-color:#222f3e;display:flex;flex-direction:row;justify-content:flex-end}.tox .tox-sidebar__slider{display:flex;overflow:hidden}.tox .tox-sidebar__pane-container{display:flex}.tox .tox-sidebar__pane{display:flex}.tox .tox-sidebar--sliding-closed{opacity:0}.tox .tox-sidebar--sliding-open{opacity:1}.tox .tox-sidebar--sliding-growing,.tox .tox-sidebar--sliding-shrinking{transition:width .5s ease,opacity .5s ease}.tox .tox-selector{background-color:#4099ff;border-color:#4099ff;border-style:solid;border-width:1px;box-sizing:border-box;display:inline-block;height:10px;position:absolute;width:10px}.tox.tox-platform-touch .tox-selector{height:12px;width:12px}.tox .tox-slider{align-items:center;display:flex;flex:1;-ms-flex-preferred-size:auto;height:24px;justify-content:center;position:relative}.tox .tox-slider__rail{background-color:transparent;border:1px solid #000;border-radius:3px;height:10px;min-width:120px;width:100%}.tox .tox-slider__handle{background-color:#207ab7;border:2px solid #185d8c;border-radius:3px;box-shadow:none;height:24px;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:14px}.tox .tox-source-code{overflow:auto}.tox .tox-spinner{display:flex}.tox .tox-spinner>div{animation:tam-bouncing-dots 1.5s ease-in-out 0s infinite both;background-color:rgba(255,255,255,.5);border-radius:100%;height:8px;width:8px}.tox .tox-spinner>div:nth-child(1){animation-delay:-.32s}.tox .tox-spinner>div:nth-child(2){animation-delay:-.16s}@keyframes tam-bouncing-dots{0%,100%,80%{transform:scale(0)}40%{transform:scale(1)}}.tox:not([dir=rtl]) .tox-spinner>div:not(:first-child){margin-left:4px}.tox[dir=rtl] .tox-spinner>div:not(:first-child){margin-right:4px}.tox .tox-statusbar{align-items:center;background-color:#222f3e;border-top:1px solid #000;color:#fff;display:flex;flex:0 0 auto;font-size:12px;font-weight:400;height:18px;overflow:hidden;padding:0 8px;position:relative;text-transform:uppercase}.tox .tox-statusbar__text-container{display:flex;flex:1 1 auto;justify-content:flex-end;overflow:hidden}.tox .tox-statusbar__path{display:flex;flex:1 1 auto;margin-right:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tox .tox-statusbar__path>*{display:inline;white-space:nowrap}.tox .tox-statusbar__wordcount{flex:0 0 auto;margin-left:1ch}.tox .tox-statusbar a,.tox .tox-statusbar__path-item,.tox .tox-statusbar__wordcount{color:#fff;text-decoration:none}.tox .tox-statusbar a:focus:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar a:hover:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar__path-item:focus:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar__path-item:hover:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar__wordcount:focus:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar__wordcount:hover:not(:disabled):not([aria-disabled=true]){cursor:pointer;text-decoration:underline}.tox .tox-statusbar__resize-handle{align-items:flex-end;align-self:stretch;cursor:nwse-resize;display:flex;flex:0 0 auto;justify-content:flex-end;margin-left:auto;margin-right:-8px;padding-left:1ch}.tox .tox-statusbar__resize-handle svg{display:block;fill:#fff}.tox:not([dir=rtl]) .tox-statusbar__path>*{margin-right:4px}.tox:not([dir=rtl]) .tox-statusbar__branding{margin-left:1ch}.tox[dir=rtl] .tox-statusbar{flex-direction:row-reverse}.tox[dir=rtl] .tox-statusbar__path>*{margin-left:4px}.tox .tox-throbber{z-index:1400}.tox .tox-throbber__busy-spinner{align-items:center;background-color:rgba(34,47,62,.6);bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}.tox .tox-tbtn{align-items:center;background:0 0;border:0;border-radius:3px;box-shadow:none;color:#fff;display:flex;flex:0 0 auto;font-size:14px;font-style:normal;font-weight:400;height:34px;justify-content:center;margin:2px 0 3px 0;outline:0;overflow:hidden;padding:0;text-transform:none;width:34px}.tox .tox-tbtn svg{display:block;fill:#fff}.tox .tox-tbtn.tox-tbtn-more{padding-left:5px;padding-right:5px;width:inherit}.tox .tox-tbtn:focus{background:#4a5562;border:0;box-shadow:none}.tox .tox-tbtn:hover{background:#4a5562;border:0;box-shadow:none;color:#fff}.tox .tox-tbtn:hover svg{fill:#fff}.tox .tox-tbtn:active{background:#757d87;border:0;box-shadow:none;color:#fff}.tox .tox-tbtn:active svg{fill:#fff}.tox .tox-tbtn--disabled,.tox .tox-tbtn--disabled:hover,.tox .tox-tbtn:disabled,.tox .tox-tbtn:disabled:hover{background:0 0;border:0;box-shadow:none;color:rgba(255,255,255,.5);cursor:not-allowed}.tox .tox-tbtn--disabled svg,.tox .tox-tbtn--disabled:hover svg,.tox .tox-tbtn:disabled svg,.tox .tox-tbtn:disabled:hover svg{fill:rgba(255,255,255,.5)}.tox .tox-tbtn--enabled,.tox .tox-tbtn--enabled:hover{background:#757d87;border:0;box-shadow:none;color:#fff}.tox .tox-tbtn--enabled:hover>*,.tox .tox-tbtn--enabled>*{transform:none}.tox .tox-tbtn--enabled svg,.tox .tox-tbtn--enabled:hover svg{fill:#fff}.tox .tox-tbtn:focus:not(.tox-tbtn--disabled){color:#fff}.tox .tox-tbtn:focus:not(.tox-tbtn--disabled) svg{fill:#fff}.tox .tox-tbtn:active>*{transform:none}.tox .tox-tbtn--md{height:51px;width:51px}.tox .tox-tbtn--lg{flex-direction:column;height:68px;width:68px}.tox .tox-tbtn--return{-ms-grid-row-align:stretch;align-self:stretch;height:unset;width:16px}.tox .tox-tbtn--labeled{padding:0 4px;width:unset}.tox .tox-tbtn__vlabel{display:block;font-size:10px;font-weight:400;letter-spacing:-.025em;margin-bottom:4px;white-space:nowrap}.tox .tox-tbtn--select{margin:2px 0 3px 0;padding:0 4px;width:auto}.tox .tox-tbtn__select-label{cursor:default;font-weight:400;margin:0 4px}.tox .tox-tbtn__select-chevron{align-items:center;display:flex;justify-content:center;width:16px}.tox .tox-tbtn__select-chevron svg{fill:rgba(255,255,255,.5)}.tox .tox-tbtn--bespoke .tox-tbtn__select-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:7em}.tox .tox-split-button{border:0;border-radius:3px;box-sizing:border-box;display:flex;margin:2px 0 3px 0;overflow:hidden}.tox .tox-split-button:hover{box-shadow:0 0 0 1px #4a5562 inset}.tox .tox-split-button:focus{background:#4a5562;box-shadow:none;color:#fff}.tox .tox-split-button>*{border-radius:0}.tox .tox-split-button__chevron{width:16px}.tox .tox-split-button__chevron svg{fill:rgba(255,255,255,.5)}.tox .tox-split-button .tox-tbtn{margin:0}.tox.tox-platform-touch .tox-split-button .tox-tbtn:first-child{width:30px}.tox.tox-platform-touch .tox-split-button__chevron{width:20px}.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:focus,.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:hover,.tox .tox-split-button.tox-tbtn--disabled:focus,.tox .tox-split-button.tox-tbtn--disabled:hover{background:0 0;box-shadow:none;color:rgba(255,255,255,.5)}.tox .tox-toolbar-overlord{background-color:#222f3e}.tox .tox-toolbar,.tox .tox-toolbar__overflow,.tox .tox-toolbar__primary{background:url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23000000'/%3E%3C/svg%3E") left 0 top 0 #222f3e;background-color:#222f3e;display:flex;flex:0 0 auto;flex-shrink:0;flex-wrap:wrap;padding:0 0}.tox .tox-toolbar__overflow.tox-toolbar__overflow--closed{height:0;opacity:0;padding-bottom:0;padding-top:0;visibility:hidden}.tox .tox-toolbar__overflow--growing{transition:height .3s ease,opacity .2s linear .1s}.tox .tox-toolbar__overflow--shrinking{transition:opacity .3s ease,height .2s linear .1s,visibility 0s linear .3s}.tox .tox-menubar+.tox-toolbar,.tox .tox-menubar+.tox-toolbar-overlord .tox-toolbar__primary{border-top:1px solid #000;margin-top:-1px}.tox .tox-toolbar--scrolling{flex-wrap:nowrap;overflow-x:auto}.tox .tox-pop .tox-toolbar{border-width:0}.tox .tox-toolbar--no-divider{background-image:none}.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar-overlord:first-child .tox-toolbar__primary,.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar:first-child{border-top:1px solid #000}.tox.tox-tinymce-aux .tox-toolbar__overflow{background-color:#222f3e;border:1px solid #000;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.15)}.tox[dir=rtl] .tox-tbtn__icon-rtl svg{transform:rotateY(180deg)}.tox .tox-toolbar__group{align-items:center;display:flex;flex-wrap:wrap;margin:0 0;padding:0 4px 0 4px}.tox .tox-toolbar__group--pull-right{margin-left:auto}.tox .tox-toolbar--scrolling .tox-toolbar__group{flex-shrink:0;flex-wrap:nowrap}.tox:not([dir=rtl]) .tox-toolbar__group:not(:last-of-type){border-right:1px solid #000}.tox[dir=rtl] .tox-toolbar__group:not(:last-of-type){border-left:1px solid #000}.tox .tox-tooltip{display:inline-block;padding:8px;position:relative}.tox .tox-tooltip__body{background-color:#3d546f;border-radius:3px;box-shadow:0 2px 4px rgba(42,55,70,.3);color:rgba(255,255,255,.75);font-size:14px;font-style:normal;font-weight:400;padding:4px 8px;text-transform:none}.tox .tox-tooltip__arrow{position:absolute}.tox .tox-tooltip--down .tox-tooltip__arrow{border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #3d546f;bottom:0;left:50%;position:absolute;transform:translateX(-50%)}.tox .tox-tooltip--up .tox-tooltip__arrow{border-bottom:8px solid #3d546f;border-left:8px solid transparent;border-right:8px solid transparent;left:50%;position:absolute;top:0;transform:translateX(-50%)}.tox .tox-tooltip--right .tox-tooltip__arrow{border-bottom:8px solid transparent;border-left:8px solid #3d546f;border-top:8px solid transparent;position:absolute;right:0;top:50%;transform:translateY(-50%)}.tox .tox-tooltip--left .tox-tooltip__arrow{border-bottom:8px solid transparent;border-right:8px solid #3d546f;border-top:8px solid transparent;left:0;position:absolute;top:50%;transform:translateY(-50%)}.tox .tox-well{border:1px solid #000;border-radius:3px;padding:8px;width:100%}.tox .tox-well>:first-child{margin-top:0}.tox .tox-well>:last-child{margin-bottom:0}.tox .tox-well>:only-child{margin:0}.tox .tox-custom-editor{border:1px solid #000;border-radius:3px;display:flex;flex:1;position:relative}.tox .tox-dialog-loading::before{background-color:rgba(0,0,0,.5);content:"";height:100%;position:absolute;width:100%;z-index:1000}.tox .tox-tab{cursor:pointer}.tox .tox-dialog__content-js{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-dialog__body-content .tox-collection{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-image-tools-edit-panel{height:60px}.tox .tox-image-tools__sidebar{height:60px} -/*# sourceMappingURL=skin.min.css.map */ diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.min.css.map b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.min.css.map deleted file mode 100644 index 59b221ac8d28..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.min.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["ui/dark/skin.css"],"names":[],"mappings":";;;;;;AAMA,KACE,WAAY,YACZ,MAAO,QACP,OAAQ,KACR,YAAa,aAAa,CAAE,kBAAkB,CAAE,UAAU,CAAE,MAAM,CAAE,WAAW,CAAE,MAAM,CAAE,SAAS,CAAE,gBAAgB,CAAE,WACtH,UAAW,KACX,WAAY,OACZ,YAAa,IACb,YAAa,OACb,4BAA6B,YAC7B,gBAAiB,KACjB,YAAa,KACb,eAAgB,KAChB,eAAgB,QAChB,YAAa,OAEf,yBACE,WAAY,QACZ,MAAO,QACP,OAAQ,QACR,UAAW,QACX,YAAa,QACb,UAAW,QACX,WAAY,QACZ,YAAa,QACb,YAAa,QACb,4BAA6B,QAC7B,WAAY,QACZ,gBAAiB,QACjB,YAAa,QACb,eAAgB,QAChB,eAAgB,QAChB,YAAa,QAEf,yBAEE,WAAY,IACZ,OAAQ,EACR,MAAO,KACP,OAAQ,KACR,OAAQ,EACR,UAAW,KACX,QAAS,EACT,QAAS,EACT,SAAU,OACV,MAAO,KAET,oBACE,UAAW,IACX,WAAY,KAEd,cACE,UAAW,IACX,WAAY,MAEd,aACE,OAAQ,IAAI,MAAM,KAClB,cAAe,EACf,WAAY,KACZ,WAAY,WACZ,QAAS,KACT,eAAgB,OAChB,YAAa,aAAa,CAAE,kBAAkB,CAAE,UAAU,CAAE,MAAM,CAAE,WAAW,CAAE,MAAM,CAAE,SAAS,CAAE,gBAAgB,CAAE,WACtH,SAAU,OACV,SAAU,SACV,WAAY,kBAEd,oBACE,OAAQ,KACR,WAAY,KAEd,uCACE,OAAQ,IAAI,MAAM,KAClB,cAAe,EACf,WAAY,KAEd,iBACE,YAAa,aAAa,CAAE,kBAAkB,CAAE,UAAU,CAAE,MAAM,CAAE,WAAW,CAAE,MAAM,CAAE,SAAS,CAAE,gBAAgB,CAAE,WACtH,QAAS,KAEX,oBACA,wBACE,QAAS,EAEX,yBACE,OAAQ,EAEV,kCACE,YAAa,OACb,QAAS,KACT,cAAe,IAEjB,uCACE,YAAa,QACb,OAAQ,IAAI,MAAM,KAClB,cAAe,IACf,QAAS,KACT,gBAAiB,cAEnB,2CACE,eAAgB,IAElB,+CACE,YAAa,OACb,QAAS,KACT,cAAe,IAEjB,oEACE,aAAc,KACd,aAAc,MAEhB,kCACE,WAAY,KAEd,4FACE,iBAAkB,oBAClB,aAAc,QACd,MAAO,KAET,wGACE,aAAc,QAEhB,8EACE,MAAO,KAET,wEACE,KAAM,KAER,sEACE,MAAO,KAET,4FACE,iBAAkB,mBAClB,aAAc,mBACd,MAAO,KAET,wGACE,aAAc,mBAEhB,8EACE,MAAO,KAET,wEACE,KAAM,KAER,sEACE,MAAO,KAET,6FACE,iBAAkB,iBAClB,aAAc,iBACd,MAAO,KAET,yGACE,aAAc,iBAEhB,+EACE,MAAO,KAET,yEACE,KAAM,KAER,uEACE,MAAO,KAET,+FACE,iBAAkB,oBAClB,aAAc,oBACd,MAAO,KAET,2GACE,aAAc,oBAEhB,iFACE,MAAO,KAET,2EACE,KAAM,KAER,yEACE,MAAO,KAET,+DACA,qFACE,WAAY,EAEd,uFACE,YAAa,IAEf,8FACE,YAAa,KAEf,gFACE,QAAS,IAAI,IAAI,IAAI,IAEvB,4FACE,kBAAmB,IACnB,aAAc,IAEhB,iFACE,aAAc,IAEhB,wFACE,aAAc,KAEhB,0EACE,QAAS,IAAI,IAAI,IAAI,IAEvB,sFACE,mBAAoB,IACpB,cAAe,IAEjB,oBACE,QAAS,KACT,KAAM,EAAE,EAAE,KAEZ,cACE,QAAS,KACT,KAAM,EAAE,EAAE,KAEZ,iBACE,iBAAkB,QAClB,iBAAkB,KAClB,oBAAqB,EAAE,EACvB,kBAAmB,OACnB,aAAc,QACd,cAAe,IACf,aAAc,MACd,aAAc,IACd,WAAY,KACZ,WAAY,WACZ,MAAO,KACP,OAAQ,QACR,QAAS,aACT,YAAa,aAAa,CAAE,kBAAkB,CAAE,UAAU,CAAE,MAAM,CAAE,WAAW,CAAE,MAAM,CAAE,SAAS,CAAE,gBAAgB,CAAE,WACtH,UAAW,KACX,WAAY,OACZ,YAAa,IACb,eAAgB,OAChB,YAAa,KACb,OAAQ,EACR,QAAS,EACT,QAAS,IAAI,KACb,WAAY,OACZ,gBAAiB,KACjB,eAAgB,WAChB,YAAa,OAEf,2BACE,iBAAkB,QAClB,iBAAkB,KAClB,aAAc,QACd,WAAY,KACZ,MAAO,qBACP,OAAQ,YAEV,sCACE,iBAAkB,QAClB,iBAAkB,KAClB,aAAc,QACd,WAAY,KACZ,MAAO,KAET,sCACE,iBAAkB,QAClB,iBAAkB,KAClB,aAAc,QACd,WAAY,KACZ,MAAO,KAET,uCACE,iBAAkB,QAClB,iBAAkB,KAClB,aAAc,QACd,WAAY,KACZ,MAAO,KAET,4BACE,iBAAkB,QAClB,iBAAkB,KAClB,oBAAqB,EAAE,EACvB,kBAAmB,OACnB,aAAc,QACd,cAAe,IACf,aAAc,MACd,aAAc,IACd,WAAY,KACZ,MAAO,KACP,UAAW,KACX,WAAY,OACZ,YAAa,IACb,eAAgB,OAChB,QAAS,EACT,QAAS,IAAI,KACb,gBAAiB,KACjB,eAAgB,WAElB,sCACE,iBAAkB,QAClB,iBAAkB,KAClB,aAAc,QACd,WAAY,KACZ,MAAO,qBAET,iDACE,iBAAkB,QAClB,iBAAkB,KAClB,aAAc,QACd,WAAY,KACZ,MAAO,KAET,iDACE,iBAAkB,QAClB,iBAAkB,KAClB,aAAc,QACd,WAAY,KACZ,MAAO,KAET,kDACE,iBAAkB,QAClB,iBAAkB,KAClB,aAAc,QACd,WAAY,KACZ,MAAO,KAET,uBACA,kCACA,wDACE,QAAS,IAEX,qCACA,gDACA,sEACE,QAAS,MACT,KAAM,aAER,sBACE,WAAY,EACZ,OAAQ,KACR,WAAY,WACZ,OAAQ,QACR,QAAS,aACT,YAAa,aAAa,CAAE,kBAAkB,CAAE,UAAU,CAAE,MAAM,CAAE,WAAW,CAAE,MAAM,CAAE,SAAS,CAAE,gBAAgB,CAAE,WACtH,UAAW,KACX,YAAa,IACb,YAAa,IACb,OAAQ,EACR,QAAS,EACT,YAAa,OAEf,0BACE,UAAW,KAEb,wBACE,iBAAkB,YAClB,aAAc,YACd,WAAY,MACZ,MAAO,KAET,kCACE,iBAAkB,QAClB,aAAc,QACd,WAAY,KACZ,MAAO,qBAET,6CACE,iBAAkB,QAClB,aAAc,QACd,WAAY,KACZ,MAAO,KAET,6CACE,iBAAkB,QAClB,aAAc,QACd,WAAY,KACZ,MAAO,KAET,8CACE,iBAAkB,QAClB,aAAc,QACd,WAAY,KACZ,MAAO,KAET,sCACE,KAAM,aAER,8DACE,MAAO,KAET,mBACE,YAAa,OACb,cAAe,IACf,OAAQ,QACR,QAAS,KACT,OAAQ,KACR,UAAW,KAEb,0BAEE,OAAQ,IACR,SAAU,OACV,SAAU,SACV,IAAK,KACL,MAAO,IAET,0BACE,YAAa,OACb,cAAe,IACf,WAAY,EAAE,EAAE,EAAE,IAAI,YACtB,WAAY,YACZ,QAAS,KACT,OAAQ,KACR,gBAAiB,OACjB,QAAS,gBACT,MAAO,KAET,4DACE,QAAS,MACT,KAAM,qBAER,gEACE,QAAS,KACT,KAAM,QAER,0DACE,QAAS,KACT,KAAM,QAER,6BACE,MAAO,qBACP,OAAQ,YAEV,kFACE,KAAM,qBAER,oFACE,KAAM,qBAER,wFACE,KAAM,qBAER,8FACE,QAAS,KAEX,4FACE,QAAS,MAEX,oGACE,QAAS,KAEX,wGACE,QAAS,MAEX,0DACE,cAAe,IACf,WAAY,MAAM,EAAE,EAAE,EAAE,IAAI,QAC5B,QAAS,gBAEX,yCACE,YAAa,IAEf,yCACE,KAAM,SAER,2CACE,YAAa,IAEf,mCACE,aAAc,IAEhB,mCACE,MAAO,SAET,qCACE,aAAc,IAKhB,qDACE,QAAS,KACT,QAAS,EAEX,kDACE,QAAS,KACT,UAAW,KACX,WAAY,MACZ,WAAY,OACZ,WAAY,KACZ,QAAS,EAEX,kDACE,oBAAqB,EACrB,aAAc,QACd,kBAAmB,EACnB,mBAAoB,EACpB,aAAc,MACd,iBAAkB,IAClB,QAAS,IAAI,EAEf,8DACE,iBAAkB,EAEpB,oCACE,iBAAkB,KAClB,MAAO,KACP,OAAQ,QACR,UAAW,KACX,WAAY,OACZ,YAAa,IACb,cAAe,IACf,WAAY,KACZ,QAAS,IAAI,IACb,eAAgB,KAChB,sBAAuB,KACvB,oBAAqB,KAClB,iBAAkB,KACjB,gBAAiB,KACb,YAAa,KAEvB,2BACE,YAAa,OACb,MAAO,KACP,OAAQ,QACR,QAAS,KACT,sBAAuB,KACvB,oBAAqB,KAClB,iBAAkB,KACjB,gBAAiB,KACb,YAAa,KAEvB,iDACE,QAAS,IAAI,IAEf,oDACE,cAAe,IACf,QAAS,IAEX,iDACE,cAAe,IACf,QAAS,IAEX,0DACE,iBAAkB,QAClB,MAAO,KAET,yDACE,iBAAkB,QAEpB,6DACE,iBAAkB,QAClB,MAAO,KAET,4DACE,iBAAkB,QAEpB,0DACE,iBAAkB,QAClB,MAAO,KAET,oGACE,iBAAkB,QAClB,MAAO,KAET,oGACE,MAAO,KAET,uGACE,MAAO,KAET,2CACE,iBAAkB,YAClB,MAAO,qBACP,OAAQ,YAGV,qCADA,gCAEE,YAAa,OACb,QAAS,KACT,OAAQ,KACR,gBAAiB,OACjB,MAAO,KAGT,yCADA,oCAEE,KAAM,aAER,4DACE,OAAQ,KACR,MAAO,KAET,iCACE,MAAO,aACP,QAAS,aACT,KAAM,EACN,wBAAyB,KACzB,UAAW,KACX,WAAY,OACZ,YAAa,IACb,YAAa,KACb,eAAgB,KAChB,WAAY,UAEd,qCACE,MAAO,qBACP,QAAS,aACT,UAAW,KACX,OAAQ,KACR,YAAa,KACb,eAAgB,KAElB,iCACE,YAAa,OACb,QAAS,KACT,WAAY,KAEd,wCACE,QAAS,GACT,UAAW,EACX,WAAY,QAEd,qCACE,KAAM,KAER,yHACE,QAAS,KAEX,qJACE,QAAS,KAEX,iCACE,iBAAkB,QAClB,OAAQ,IAAI,MAAM,QAClB,cAAe,IACf,WAAY,EAAE,IAAI,IAAI,gBACtB,QAAS,KACT,KAAM,EAAE,EAAE,KACV,YAAa,EACb,UAAW,OACX,cAAe,EACf,WAAY,KACZ,QAAS,EAEX,wDACE,YAAa,OACb,QAAS,KACT,UAAW,OACX,OAAQ,EACR,QAAS,EAAE,IAEb,uDACE,OAAQ,KACR,OAAQ,IAAI,EAAE,IAAI,EAClB,QAAS,EAAE,IAEb,6DACE,YAAa,OAEf,6DACE,YAAa,IAEf,0FACE,aAAc,IAAI,MAAM,KAE1B,mFACE,YAAa,IAEf,kFACE,YAAa,IAEf,oDACE,YAAa,KACb,WAAY,MAEd,gEACE,YAAa,KAEf,oFACE,YAAa,IAAI,MAAM,KAEzB,6EACE,aAAc,IAEhB,4EACE,aAAc,IAKhB,4EACE,UAAW,gBAEb,8CACE,aAAc,KACd,WAAY,KAEd,0DACE,aAAc,KACd,UAAW,gBAEb,sEACE,aAAc,IAEhB,iCACE,QAAS,KACT,eAAgB,IAChB,OAAQ,MACR,OAAQ,EAEV,qBACE,WAAY,WACZ,QAAS,KACT,OAAQ,KAEV,8BACE,OAAQ,KAEV,qBACA,8BACE,MAAO,MAET,2BACE,WAAY,IACZ,OAAQ,IAAI,MAAM,KAClB,cAAe,IACf,WAAY,YACZ,OAAQ,KACR,SAAU,SACV,MAAO,KAET,iCACE,OAAQ,IAAI,MAAM,KAClB,cAAe,IACf,OAAQ,KACR,SAAU,SACV,MAAO,KAET,qBACE,WAAY,WACZ,OAAQ,KACR,MAAO,KAET,8BACE,WAAY,4GACZ,OAAQ,KACR,MAAO,KAET,qBACA,8BACE,MAAO,KAET,2BACE,WAAY,KACZ,OAAQ,IAAI,MAAM,KAClB,WAAY,YACZ,OAAQ,IACR,MAAO,KAET,mBACE,QAAS,KACT,eAAgB,OAChB,gBAAiB,cAEnB,uBACE,YAAa,OACb,QAAS,KACT,gBAAiB,cACjB,cAAe,IACf,MAAO,QAET,yBACE,MAAO,IAET,qCAEE,OAAQ,IAAI,MAAM,cAEpB,qCACE,OAAQ,IAAI,MAAM,KAClB,UAAW,EACX,cAAe,EAEjB,oCACE,aAAc,KAEhB,oCACE,aAAc,KAEhB,0CACE,YAAa,KAEf,wCACE,aAAc,KAEhB,8BACE,YAAa,KAEf,8BACE,YAAa,KAEf,oCACE,aAAc,KAEhB,kCACE,YAAa,KAEf,gCAEA,0CADA,yCAEE,OAAQ,IAAI,EAAE,IAAI,IAEpB,qEACE,OAAQ,EACR,OAAQ,KAAK,EAEf,wBACE,QAAS,KAEX,iBACE,OAAQ,KACR,WAAY,UAAU,IAAK,CAAE,WAAW,KACxC,MAAO,KAGT,uBADA,uBAEE,WAAY,EAAE,EAAE,EAAE,IAAI,qBAAyB,MAC/C,UAAW,UAEb,yBACE,YAAa,OACb,QAAS,KACT,gBAAiB,OAEnB,kCACE,OAAQ,QAEV,+BACE,YAAa,OACb,iBAAkB,YAClB,OAAQ,EACR,OAAQ,QACR,QAAS,KACT,OAAQ,KACR,gBAAiB,OACjB,QAAS,EACT,QAAS,EACT,MAAO,KAET,mCACE,OAAQ,KACR,MAAO,KAET,qCACE,WAAY,QAEd,8CACE,YAAa,KAEf,wCACE,aAAc,KAEhB,yBACE,WAAY,QACZ,SAAU,SAEZ,4CACE,WAAY,IAEd,kBACE,WAAY,QACZ,OAAQ,IAAI,MAAM,KAClB,cAAe,IACf,WAAY,EAAE,IAAI,IAAI,EAAE,kBACxB,QAAS,IAAI,IAAI,KAAK,IACtB,SAAU,SAEZ,0BACE,YAAa,OACb,MAAO,KACP,QAAS,KACT,gBAAiB,cAEnB,wBACE,MAAO,qBACP,UAAW,KAEb,wBACE,MAAO,KACP,UAAW,KACX,WAAY,OACZ,YAAa,IACb,YAAa,IACb,WAAY,IACZ,SAAU,SACV,eAAgB,QAElB,iCACE,OAAQ,KACR,YAAa,OACb,MAAO,KAET,4BACE,YAAa,IAEf,8BACE,MAAO,qBACP,UAAW,KACX,WAAY,OAEd,0BACE,OAAQ,EAEV,iCACE,YAAa,KACb,WAAY,OAEd,yCACE,WAAY,QACZ,OAAQ,EACR,QAAS,GACT,QAAS,KACT,KAAM,EACN,QAAS,GACT,SAAU,SACV,MAAO,EACP,IAAK,EACL,QAAS,EAEX,yBACE,QAAS,KACT,YAAa,EACb,UAAW,KACX,gBAAiB,SACjB,WAAY,IAEd,sCACE,cAAe,IACf,MAAO,KAET,wBACE,QAAS,KACT,UAAW,KACX,gBAAiB,SACjB,WAAY,KAEd,mCACE,WAAY,0CACZ,OAAQ,EACR,QAAS,GACT,QAAS,MACT,OAAQ,IACR,WAAY,MACZ,SAAU,SACV,MAAO,KAET,2BACE,WAAY,QACZ,OAAQ,EACR,QAAS,KACT,eAAgB,OAChB,UAAW,EACX,KAAM,EACN,QAAS,GACT,SAAU,SACV,MAAO,EACP,WAAY,OACZ,IAAK,EACL,QAAS,EAEX,gCACE,YAAa,OACb,MAAO,KACP,QAAS,KACT,eAAgB,OAChB,SAAU,SAEZ,oCACE,eAAgB,KAElB,+BACE,OAAQ,EACR,eAAgB,OAChB,UAAW,KACX,KAAM,EACN,QAAS,IACT,SAAU,SACV,MAAO,EACP,IAAK,EACL,QAAS,GAEX,iCACE,iBAAkB,QAClB,WAAY,EAAE,EAAE,IAAI,IAAI,QACxB,MAAO,KACP,WAAY,OAEd,kDACE,UAAW,KAEb,gCACE,YAAa,OACb,iBAAkB,QAClB,OAAQ,EACR,QAAS,KACT,gBAAiB,OACjB,KAAM,EACN,SAAU,SACV,MAAO,EACP,IAAK,EACL,QAAS,GAEX,0BACE,QAAS,KACT,eAAgB,OAChB,YAAa,EACb,SAAU,KAEZ,wBACE,OAAQ,IAEV,uCACE,YAAa,IAEf,4DACA,mDACA,oDACE,YAAa,IAEf,iCACE,aAAc,IAEhB,sDACA,6CACA,8CACE,aAAc,IAEhB,eACE,YAAa,OACb,QAAS,KAEX,2BACE,KAAM,qBAER,qBACE,MAAO,qBACP,UAAW,KACX,WAAY,OACZ,YAAa,IACb,eAAgB,UAElB,0CACE,aAAc,IAEhB,sDACE,YAAa,IAEf,oCACE,YAAa,IAEf,gDACE,aAAc,IAEhB,sBACE,YAAa,OACb,OAAQ,EACR,QAAS,KACT,gBAAiB,OACjB,KAAM,EACN,SAAU,MACV,MAAO,EACP,IAAK,EACL,QAAS,KAEX,gCACE,iBAAkB,mBAClB,OAAQ,EACR,KAAM,EACN,SAAU,SACV,MAAO,EACP,IAAK,EACL,QAAS,EAEX,wCACE,iBAAkB,QAEpB,iBACE,iBAAkB,QAClB,aAAc,KACd,cAAe,IACf,aAAc,MACd,aAAc,IACd,WAAY,EAAE,KAAK,KAAK,MAAM,kBAAsB,CAAE,EAAE,EAAE,KAAK,IAAI,mBACnE,QAAS,KACT,eAAgB,OAChB,WAAY,KACZ,UAAW,MACX,SAAU,OACV,SAAU,SACV,MAAO,KACP,QAAS,EAEX,yCACE,8CACE,WAAY,WACZ,OAAQ,IAAI,KACZ,MAAO,oBAGX,wBACE,QAAS,KAEX,yBACE,YAAa,OACb,iBAAkB,QAClB,cAAe,KACf,MAAO,KACP,QAAS,KACT,UAAW,KACX,gBAAiB,cACjB,QAAS,IAAI,KAAK,EAAE,KACpB,SAAU,SAEZ,qCACE,QAAS,EAEX,6BACE,OAAQ,KACR,OAAQ,KACR,KAAM,EACN,SAAU,SACV,IAAK,EACL,MAAO,KAET,oCACE,OAAQ,SAEV,0BACE,YAAa,KAEf,wBACE,YAAa,aAAa,CAAE,kBAAkB,CAAE,UAAU,CAAE,MAAM,CAAE,WAAW,CAAE,MAAM,CAAE,SAAS,CAAE,gBAAgB,CAAE,WACtH,UAAW,KACX,WAAY,OACZ,YAAa,IACb,YAAa,IACb,OAAQ,EACR,eAAgB,KAElB,uBACE,MAAO,KACP,QAAS,KACT,KAAM,EACN,wBAAyB,KACzB,UAAW,KACX,WAAY,OACZ,YAAa,IACb,YAAa,IACb,UAAW,EACX,WAAY,KACZ,eAAgB,KAElB,yCACE,oDACE,eAAgB,QAGpB,2BACE,YAAa,WACb,QAAS,KACT,eAAgB,OAChB,QAAS,KAAK,KAEhB,yCACE,wDACE,eAAgB,IAChB,2BAA4B,MAC5B,WAAY,KACZ,eAAgB,GAGpB,gCACE,cAAe,IAAI,MAAM,YACzB,MAAO,qBACP,QAAS,aACT,UAAW,KACX,YAAa,IACb,cAAe,IACf,gBAAiB,KACjB,YAAa,OAEf,sCACE,iBAAkB,oBAEpB,wCACE,cAAe,IAAI,MAAM,QACzB,MAAO,QAET,+BACE,WAAY,WACZ,QAAS,KACT,KAAM,EACN,eAAgB,OAChB,wBAAyB,KACzB,WAAY,MACZ,SAAU,KACV,2BAA4B,MAC5B,QAAS,KAAK,KAEhB,iCACE,cAAe,EACf,WAAY,KAEd,4CACE,WAAY,EAEd,2CACE,cAAe,EAEjB,2CACE,cAAe,EACf,WAAY,EAEd,iCACE,MAAO,QACP,OAAQ,QACR,gBAAiB,KAGnB,uCADA,uCAEE,MAAO,QACP,gBAAiB,KAEnB,wCACE,MAAO,QACP,gBAAiB,KAEnB,mCACE,KAAM,KAER,kCACE,QAAS,MACT,gBAAiB,KACjB,cAAe,KACf,mBAAoB,EACZ,kBAAmB,EAC3B,qBAAsB,EACd,oBAAqB,EAC7B,sBAAuB,OACf,qBAAsB,OAEhC,mDACE,MAAO,KACP,UAAW,KACX,WAAY,OACZ,YAAa,IACb,eAAgB,OAChB,cAAe,KACf,WAAY,KACZ,eAAgB,KAElB,mDACE,MAAO,KACP,UAAW,KACX,WAAY,OACZ,YAAa,IACb,eAAgB,OAChB,cAAe,KACf,WAAY,KACZ,eAAgB,KAElB,kDACE,cAAe,KAEjB,+DACA,+DACA,8DACE,WAAY,EAEd,8DACA,8DACA,6DACE,cAAe,EAEjB,8DACA,8DACA,6DACE,cAAe,EACf,WAAY,EAEd,2BACE,OAAQ,MACR,UAAW,OAEb,2BACE,UAAW,MAEb,qDACE,SAAU,KAEZ,yCACE,WAAY,OAEd,yBACE,YAAa,OACb,iBAAkB,QAClB,WAAY,IAAI,MAAM,KACtB,QAAS,KACT,gBAAiB,cACjB,QAAS,IAAI,KAGf,6BADA,+BAEE,QAAS,KAEX,+BACE,YAAa,OACb,iBAAkB,mBAClB,OAAQ,EACR,QAAS,KACT,gBAAiB,OACjB,KAAM,EACN,SAAU,SACV,MAAO,EACP,IAAK,EACL,QAAS,EAEX,wBACE,gBAAiB,SACjB,MAAO,KAET,iCACE,YAAa,IACb,eAAgB,IAElB,iCACE,cAAe,IAAI,MAAM,KAE3B,4CACE,cAAe,KAEjB,2BACE,eAAgB,IAChB,YAAa,IAEf,yBACE,SAAU,SACV,MAAO,KACP,QAAS,KAEX,8BACE,QAAS,KACT,KAAM,EACN,eAAgB,OAChB,wBAAyB,KAE3B,0CACE,QAAS,KACT,KAAM,EACN,wBAAyB,KAE3B,wDACE,KAAM,EACN,wBAAyB,KACzB,OAAQ,KAEV,8BACE,QAAS,EACT,WAAY,OAEd,6BACE,QAAS,EACT,WAAY,QAEd,iCACE,WAAY,WAAW,GAAG,OAAO,GAAI,CAAE,QAAQ,IAAK,KAEtD,wDACE,iBAAkB,GAEpB,gCACE,SAAU,OAKZ,sCACE,SAAU,iBAEZ,yCACE,uEACE,aAAc,GAGlB,yCACE,8FACE,YAAa,KAIjB,kEADA,oEAEE,YAAa,IAEf,gCACE,WAAY,MAEd,yCACE,iEACE,YAAa,GAGjB,yCACE,wFACE,aAAc,KAIlB,4DADA,8DAEE,aAAc,IAEhB,6BACE,QAAS,KACT,KAAM,EACN,wBAAyB,KAE3B,mBACE,YAAa,OACb,WAAY,KACZ,OAAQ,IAAI,OAAO,KACnB,WAAY,WACZ,QAAS,KACT,eAAgB,OAChB,UAAW,EACX,gBAAiB,OACjB,WAAY,MACZ,QAAS,KAEX,qBACE,MAAO,qBACP,OAAQ,EAAE,EAAE,KAAK,EAEnB,oBACE,QAAS,KACT,KAAM,EACN,wBAAyB,KACzB,SAAU,OACV,SAAU,SAEZ,4BACE,iBAAkB,KAClB,OAAQ,EACR,WAAY,WACZ,KAAM,EACN,wBAAyB,KACzB,OAAQ,KACR,SAAU,SACV,MAAO,KAET,0BACE,OAAQ,IAAI,OAAO,KAErB,2BACE,QAAS,KACT,KAAM,EAAE,EAAE,KACV,eAAgB,OAChB,SAAU,OAEZ,wBACE,QAAS,EAEX,iDACE,WAAY,KACZ,WAAY,WAAW,IAEzB,oDACA,2CACE,cAAe,KAEjB,uDACE,WAAY,EAAE,IAAI,IAAI,KAAK,gBAE7B,yBACE,QAAS,EACT,WAAY,OAEd,wBACE,QAAS,EACT,WAAY,QAEd,4BACE,WAAY,WAAW,GAAG,OAAO,IAAK,CAAE,QAAQ,KAAM,KAExD,mDACE,iBAAkB,GAEpB,uBACE,KAAM,EACN,SAAU,SAEZ,qGACA,qGACA,iGACE,QAAS,KAEX,2BACE,QAAS,MAEX,yCACE,SAAU,SACV,IAAK,IACL,UAAW,iBAEb,gDACE,KAAM,KAER,gDACE,KAAM,OAER,8CACE,KAAM,MAER,qEACA,qEACA,mEACE,cAAe,KAEjB,wDACE,MAAO,IAET,+DACA,+DACA,6DACE,aAAc,KAEhB,kDACE,KAAM,IAER,wBACE,UAAW,KAEb,kCACE,UAAW,KAEb,qDACE,YAAa,IAEf,sBACE,QAAS,KACT,SAAU,SACV,QAAS,EAEX,qCACE,QAAS,GAEX,2BACE,aAAc,kBACd,cAAe,IACf,aAAc,MACd,aAAc,IACd,WAAY,KACZ,WAAY,WACZ,OAAQ,KACR,SAAU,SACV,IAAK,IACL,MAAO,KAGT,2DADA,2DAEE,aAAc,QACd,OAAQ,QAEV,mCACE,iBAAkB,gEAAsE,CAAE,iEAAuE,CAAE,gEAAsE,CAAE,kEAC3O,oBAAqB,EAAE,CAAC,CAAE,EAAE,GAAG,CAAE,IAAI,IAAI,CAAE,KAAK,EAChD,gBAAiB,KAAK,KACtB,OAAQ,IAAI,MAAM,QAClB,cAAe,IACf,WAAY,WACZ,QAAS,GACT,OAAQ,KACR,KAAM,KACN,SAAU,SACV,IAAK,KACL,MAAO,KACP,QAAS,GAEX,+CACE,OAAQ,YAKV,oDACE,aAAc,KAEhB,0CACE,KAAM,IAKR,8CACE,cAAe,KAEjB,oCACE,MAAO,IAET,gBACA,wBACE,MAAO,qBACP,QAAS,MACT,UAAW,KACX,WAAY,OACZ,YAAa,IACb,YAAa,IACb,QAAS,EAAE,IAAI,EAAE,EACjB,eAAgB,KAChB,YAAa,OAEf,wBACE,QAAS,EAAE,IAEb,yBACE,QAAS,EAAE,EAAE,EAAE,IAEjB,eACE,QAAS,KACT,KAAM,EACN,eAAgB,OAChB,wBAAyB,KAE3B,sBACE,WAAY,WACZ,cAAe,IAEjB,+BACE,KAAM,EAER,6BACE,MAAO,KAET,kCACE,QAAS,KAEX,qBACE,QAAS,KACT,eAAgB,IAChB,UAAW,KACX,gBAAiB,cAEnB,4CACE,MAAO,sBAET,4CACE,MAAO,2BAET,4CACE,MAAO,sBAET,iCACE,YAAa,OACb,QAAS,KAEX,8BACE,YAAa,OACb,QAAS,KAEX,iCACE,QAAS,KACT,KAAM,EACN,eAAgB,OAChB,wBAAyB,KAE3B,+CACE,KAAM,EACN,wBAAyB,KAE3B,6CACE,QAAS,KACT,KAAM,EACN,wBAAyB,KAE3B,2DACE,KAAM,EACN,wBAAyB,KACzB,OAAQ,KAEV,mEACE,YAAa,IAEf,6DACE,aAAc,IAEhB,iDACA,qDACE,QAAS,KAIX,4CACA,mBAHA,oBACA,4BAGE,mBAAoB,KACjB,gBAAiB,KACZ,WAAY,KACpB,iBAAkB,QAClB,aAAc,KACd,cAAe,IACf,aAAc,MACd,aAAc,IACd,WAAY,KACZ,WAAY,WACZ,MAAO,KACP,YAAa,aAAa,CAAE,kBAAkB,CAAE,UAAU,CAAE,MAAM,CAAE,WAAW,CAAE,MAAM,CAAE,SAAS,CAAE,gBAAgB,CAAE,WACtH,UAAW,KACX,YAAa,KACb,OAAQ,EACR,WAAY,KACZ,QAAS,EACT,QAAS,IAAI,OACb,OAAQ,KACR,MAAO,KAGT,6BADA,8BAEE,iBAAkB,QAClB,MAAO,sBACP,OAAQ,YAGV,kDACA,yBAFA,0BAGE,iBAAkB,QAClB,aAAc,QACd,WAAY,KACZ,QAAS,EAEX,4BACE,aAAc,EACd,cAAe,IACf,WAAY,IACZ,UAAW,MAEb,oBACE,iBAAkB,YAClB,OAAQ,EACR,aAAc,YACd,WAAY,MACZ,MAAO,QACP,OAAQ,QACR,QAAS,MACT,OAAQ,EACR,QAAS,EAEX,wBACE,QAAS,MACT,KAAM,KAER,6CACE,YAAa,IAEf,uCACE,aAAc,IAEhB,uBACE,OAAQ,QACR,SAAU,SAEZ,sDACE,iBAAkB,QAClB,MAAO,sBACP,OAAQ,YAEV,gCACE,OAAQ,QACR,KAAM,EACN,OAAQ,EAAE,IAEZ,kCACE,YAAa,OACb,QAAS,KACT,gBAAiB,OACjB,MAAO,KAET,sCACE,KAAM,KAER,4CACE,YAAa,OACb,QAAS,KAEX,0CACE,MAAO,IAET,oCACE,KAAM,IAER,sBACE,OAAQ,QACR,SAAU,SAEZ,6BACE,mBAAoB,KACjB,gBAAiB,KACZ,WAAY,KACpB,iBAAkB,QAClB,aAAc,KACd,cAAe,IACf,aAAc,MACd,aAAc,IACd,WAAY,KACZ,WAAY,WACZ,MAAO,KACP,YAAa,aAAa,CAAE,kBAAkB,CAAE,UAAU,CAAE,MAAM,CAAE,WAAW,CAAE,MAAM,CAAE,SAAS,CAAE,gBAAgB,CAAE,WACtH,UAAW,KACX,YAAa,KACb,OAAQ,EACR,WAAY,KACZ,QAAS,EACT,QAAS,IAAI,OACb,OAAQ,KACR,MAAO,KAET,uCACE,iBAAkB,QAClB,MAAO,sBACP,OAAQ,YAEV,yCACE,QAAS,KAEX,mCACE,iBAAkB,QAClB,aAAc,QACd,WAAY,KACZ,QAAS,EAEX,0BACE,eAAgB,KAChB,SAAU,SACV,IAAK,IACL,UAAW,iBAEb,sDACA,sDACE,cAAe,KAEjB,yCACE,MAAO,IAET,gDACA,gDACE,aAAc,KAEhB,mCACE,KAAM,IAER,mBACE,mBAAoB,SACjB,gBAAiB,SACZ,WAAY,SACpB,YAAa,SAEf,gBACE,OAAQ,EACR,OAAQ,KACR,KAAM,EACN,OAAQ,EACR,SAAU,OACV,oBAAqB,KACjB,oBAAqB,KACzB,QAAS,EACT,SAAU,MACV,IAAK,EACL,aAAc,WACd,MAAO,KAET,8EACE,QAAS,KAEX,gDACE,QAAS,KAEX,qCACE,QAAS,KAEX,0BACE,WAAY,KACZ,WAAY,IAEd,sBACE,MAAO,KAET,+BACE,YAAa,OACb,QAAS,KACT,gBAAiB,OAEnB,6BACE,iBAAkB,KAClB,OAAQ,MACR,SAAU,KACV,SAAU,SACV,MAAO,KAET,6BACA,uDACE,WAAY,IAEd,gCACE,WAAY,wGAEd,2CACE,KAAM,EACN,wBAAyB,KAE3B,yBACE,WAAY,KAEZ,QAAS,GACT,SAAU,SACV,KAAM,EAER,0BACE,OAAQ,IAAI,MAAM,KAClB,OAAQ,KACR,KAAM,EACN,SAAU,SACV,IAAK,EACL,MAAO,KAET,+BACE,OAAQ,EACR,OAAQ,KACR,SAAU,SAEZ,6BACE,aAAc,IAAI,EAAE,EAAE,IACtB,OAAQ,UACR,KAAM,MACN,OAAQ,KAAK,EAAE,EAAE,KACjB,IAAK,MAEP,6BACE,aAAc,IAAI,IAAI,EAAE,EACxB,OAAQ,UACR,KAAM,MACN,OAAQ,KAAK,EAAE,EAAE,MACjB,IAAK,MAEP,6BACE,aAAc,EAAE,EAAE,IAAI,IACtB,OAAQ,UACR,KAAM,MACN,OAAQ,MAAM,IAAI,EAAE,KACpB,IAAK,MAEP,6BACE,aAAc,EAAE,IAAI,IAAI,EACxB,OAAQ,UACR,KAAM,MACN,OAAQ,MAAM,EAAE,EAAE,MAClB,IAAK,MAEP,8EACE,YAAa,IAEf,sEACE,YAAa,KAEf,sEACE,YAAa,KAEf,wEACE,aAAc,IAEhB,gEACE,aAAc,KAEhB,gEACE,aAAc,KAEhB,8BACE,QAAS,KACT,UAAW,KACX,MAAO,MAET,kCACE,aAAc,KACd,aAAc,MACd,aAAc,EAAE,IAAI,IAAI,EACxB,WAAY,WACZ,OAAQ,KACR,MAAO,KAET,2EACE,OAAQ,KAAK,EAEf,iEACE,iBAAkB,oBAClB,aAAc,oBAEhB,qCACE,MAAO,KACP,QAAS,MACT,UAAW,KACX,QAAS,IACT,WAAY,OACZ,MAAO,KAKT,gEACE,aAAc,EAKhB,4DACE,aAAc,EAMhB,eACE,iBAAkB,QAClB,OAAQ,IAAI,MAAM,KAClB,cAAe,IACf,WAAY,EAAE,IAAI,IAAI,EAAE,kBACxB,QAAS,aACT,SAAU,OACV,eAAgB,IAChB,QAAS,KAEX,mDACE,QAAS,EAEX,sDACE,QAAS,IAEX,mDACE,QAAS,IASX,iCACA,2BARA,yBACA,yBACA,yBACA,yBACA,yBACA,yBACA,wBAGE,OAAQ,EAEV,kBACE,WAAY,+MAA+M,KAAK,EAAE,IAAI,EAAE,QACxO,iBAAkB,QAClB,QAAS,KACT,KAAM,EAAE,EAAE,KACV,YAAa,EACb,UAAW,KACX,QAAS,EAAE,IAAI,EAAE,IAEnB,4FACE,WAAY,IAAI,MAAM,KAGxB,eACE,YAAa,OACb,WAAY,IACZ,OAAQ,EACR,cAAe,IACf,WAAY,KACZ,MAAO,KACP,QAAS,KACT,KAAM,EAAE,EAAE,KACV,UAAW,KACX,WAAY,OACZ,YAAa,IACb,OAAQ,KACR,gBAAiB,OACjB,OAAQ,IAAI,EAAE,IAAI,EAClB,QAAS,EACT,SAAU,OACV,QAAS,EAAE,IACX,eAAgB,KAChB,MAAO,KAET,yBACE,iBAAkB,YAClB,OAAQ,EACR,WAAY,KACZ,MAAO,qBACP,OAAQ,YAEV,oCACE,WAAY,QACZ,OAAQ,EACR,WAAY,KACZ,MAAO,KAET,uBACE,WAAY,QACZ,OAAQ,EACR,WAAY,KACZ,MAAO,KAET,2DACE,WAAY,QACZ,OAAQ,EACR,WAAY,KACZ,MAAO,KAET,6BACE,OAAQ,QACR,YAAa,IACb,OAAQ,EAAE,IAEZ,iDACE,OAAQ,YAEV,+BACE,YAAa,OACb,QAAS,KACT,gBAAiB,OACjB,MAAO,KACP,QAAS,KAEX,uBACE,cAAe,IACf,aAAc,MACd,aAAc,IACd,WAAY,KACZ,WAAY,WACZ,QAAS,SACT,QAAS,KACT,UAAW,KACX,YAAa,IACb,iBAAkB,iBAAkB,KAAK,iBACrC,sBAAuB,iBAAkB,KAAK,iBAClD,WAAY,IACZ,QAAS,EACT,QAAS,IACT,WAAY,UAAU,IAAM,OAAO,CAAE,QAAQ,MAAM,QAErD,yBACE,UAAW,KACX,YAAa,IAEf,yBACE,gBAAiB,UAEnB,2BACE,QAAS,EAEX,gCACE,iBAAkB,QAClB,aAAc,QACd,MAAO,KAET,kCACE,MAAO,KAET,kCACE,MAAO,QAET,oCACE,KAAM,KAER,8BACE,iBAAkB,QAClB,aAAc,QACd,MAAO,KAET,gCACE,MAAO,KAET,gCACE,MAAO,KAET,kCACE,KAAM,KAER,6BACA,gCACE,iBAAkB,QAClB,aAAc,QACd,MAAO,KAET,+BACA,kCACE,MAAO,KAET,+BACA,kCACE,MAAO,KAET,iCACA,oCACE,KAAM,KAER,6BACE,iBAAkB,QAClB,aAAc,QACd,MAAO,KAET,+BACE,MAAO,KAET,+BACE,MAAO,KAET,iCACE,KAAM,KAER,6BACE,mBAAoB,OAChB,WAAY,OAChB,MAAO,KACP,UAAW,KACX,qBAAsB,EACtB,gBAAiB,EACjB,gBAAiB,EACb,kBAAmB,EACvB,kBAAmB,EACnB,aAAc,EACd,aAAc,EACV,eAAgB,EACpB,WAAY,OACZ,YAAa,OACb,WAAY,UACZ,WAAY,WAEd,+BACE,OAAQ,EAEV,iCACE,WAAY,KAEd,6BACE,mBAAoB,OAChB,WAAY,OAChB,qBAAsB,EACtB,gBAAiB,EACjB,gBAAiB,EACb,kBAAmB,EACvB,kBAAmB,EACnB,aAAc,EACd,aAAc,EACV,eAAgB,EACpB,sBAAuB,IACnB,aAAc,IAEpB,iCACE,QAAS,MAEX,gCACE,mBAAoB,MAChB,WAAY,MAChB,qBAAsB,EACtB,gBAAiB,EACjB,gBAAiB,EACb,kBAAmB,EACvB,kBAAmB,EACnB,aAAc,EACd,aAAc,EACV,eAAgB,EACpB,sBAAuB,IACnB,aAAc,IAEpB,yCACE,qBAAsB,EACtB,gBAAiB,EACjB,gBAAiB,EACb,kBAAmB,EACvB,kBAAmB,EACnB,aAAc,EACd,aAAc,EACV,eAAgB,EACpB,sBAAuB,OACnB,aAAc,OAEpB,cACE,QAAS,aACT,SAAU,SAEZ,wBACE,WAAY,MAAM,IAAK,KAEzB,qCACE,UAAW,OAEb,sBACE,iBAAkB,QAClB,OAAQ,IAAI,MAAM,KAClB,cAAe,IACf,WAAY,EAAE,IAAI,IAAI,gBACtB,UAAW,EACX,SAAU,OAEZ,yCACE,OAAQ,IAAI,IAAI,IAAI,IAEtB,mCACE,iBAAkB,YAClB,cAAe,KAGjB,qBADA,sBAEE,aAAc,MACd,QAAS,GACT,QAAS,MACT,OAAQ,EACR,SAAU,SACV,MAAO,EAGT,qCADA,sCAEE,KAAM,IACN,IAAK,KAEP,qCACE,aAAc,QAAQ,YAAY,YAAY,YAC9C,aAAc,IACd,YAAa,KACb,WAAY,KAEd,sCACE,aAAc,KAAQ,YAAY,YAAY,YAC9C,aAAc,IACd,YAAa,KAGf,kCADA,mCAEE,KAAM,IACN,IAAK,EACL,UAAW,kBAEb,kCACE,aAAc,YAAY,YAAY,QAAQ,YAC9C,aAAc,IACd,YAAa,KACb,WAAY,IAEd,mCACE,aAAc,YAAY,YAAY,KAAQ,YAC9C,aAAc,IACd,YAAa,KAGf,mCADA,oCAEE,KAAM,EACN,IAAK,gBACL,UAAW,iBAEb,mCACE,aAAc,YAAY,QAAQ,YAAY,YAC9C,aAAc,IACd,YAAa,MAEf,oCACE,aAAc,YAAY,KAAQ,YAAY,YAC9C,aAAc,KACd,YAAa,MAGf,oCADA,qCAEE,KAAM,KACN,IAAK,gBACL,UAAW,iBAEb,oCACE,aAAc,YAAY,YAAY,YAAY,QAClD,aAAc,IACd,YAAa,KAEf,qCACE,aAAc,YAAY,YAAY,YAAY,KAClD,aAAc,KACd,YAAa,KAGf,yCADA,0CAEE,KAAM,KAGR,0CADA,2CAEE,KAAM,kBAER,uBACE,QAAS,KACT,eAAgB,IAChB,UAAW,EACX,wBAAyB,EACzB,WAAY,EAEd,kBACE,iBAAkB,QAClB,QAAS,KACT,eAAgB,IAChB,gBAAiB,SAEnB,0BACE,QAAS,KACT,SAAU,OAEZ,kCACE,QAAS,KAEX,wBACE,QAAS,KAEX,kCACE,QAAS,EAEX,gCACE,QAAS,EAEX,mCACA,qCACE,WAAY,MAAM,IAAK,IAAI,CAAE,QAAQ,IAAK,KAE5C,mBACE,iBAAkB,QAClB,aAAc,QACd,aAAc,MACd,aAAc,IACd,WAAY,WACZ,QAAS,aACT,OAAQ,KACR,SAAU,SACV,MAAO,KAET,sCACE,OAAQ,KACR,MAAO,KAET,iBACE,YAAa,OACb,QAAS,KACT,KAAM,EACN,wBAAyB,KACzB,OAAQ,KACR,gBAAiB,OACjB,SAAU,SAEZ,uBACE,iBAAkB,YAClB,OAAQ,IAAI,MAAM,KAClB,cAAe,IACf,OAAQ,KACR,UAAW,MACX,MAAO,KAET,yBACE,iBAAkB,QAClB,OAAQ,IAAI,MAAM,QAClB,cAAe,IACf,WAAY,KACZ,OAAQ,KACR,KAAM,IACN,SAAU,SACV,IAAK,IACL,UAAW,iBAAiB,iBAC5B,MAAO,KAET,sBACE,SAAU,KAEZ,kBACE,QAAS,KAEX,sBACE,UAAW,kBAAkB,KAAK,YAAY,GAAG,SAAS,KAC1D,iBAAkB,qBAClB,cAAe,KACf,OAAQ,IACR,MAAO,IAET,mCACE,gBAAiB,MAEnB,mCACE,gBAAiB,MAEnB,6BACE,GAEA,KADA,IAEE,UAAW,SAEb,IACE,UAAW,UAGf,uDACE,YAAa,IAEf,iDACE,aAAc,IAEhB,oBACE,YAAa,OACb,iBAAkB,QAClB,WAAY,IAAI,MAAM,KACtB,MAAO,KACP,QAAS,KACT,KAAM,EAAE,EAAE,KACV,UAAW,KACX,YAAa,IACb,OAAQ,KACR,SAAU,OACV,QAAS,EAAE,IACX,SAAU,SACV,eAAgB,UAElB,oCACE,QAAS,KACT,KAAM,EAAE,EAAE,KACV,gBAAiB,SACjB,SAAU,OAEZ,0BACE,QAAS,KACT,KAAM,EAAE,EAAE,KACV,aAAc,KACd,SAAU,OACV,cAAe,SACf,YAAa,OAEf,4BACE,QAAS,OACT,YAAa,OAEf,+BACE,KAAM,EAAE,EAAE,KACV,YAAa,IAEf,sBACA,+BACA,+BACE,MAAO,KACP,gBAAiB,KAKnB,qEAHA,qEAIA,8EAHA,8EAIA,8EAHA,8EAIE,OAAQ,QACR,gBAAiB,UAEnB,mCACE,YAAa,SACb,WAAY,QACZ,OAAQ,YACR,QAAS,KACT,KAAM,EAAE,EAAE,KACV,gBAAiB,SACjB,YAAa,KACb,aAAc,KACd,aAAc,IAEhB,uCACE,QAAS,MACT,KAAM,KAER,2CACE,aAAc,IAEhB,6CACE,YAAa,IAEf,6BACE,eAAgB,YAElB,qCACE,YAAa,IAEf,mBACE,QAAS,KAEX,iCACE,YAAa,OACb,iBAAkB,kBAClB,OAAQ,EACR,QAAS,KACT,gBAAiB,OACjB,KAAM,EACN,SAAU,SACV,MAAO,EACP,IAAK,EAEP,eACE,YAAa,OACb,WAAY,IACZ,OAAQ,EACR,cAAe,IACf,WAAY,KACZ,MAAO,KACP,QAAS,KACT,KAAM,EAAE,EAAE,KACV,UAAW,KACX,WAAY,OACZ,YAAa,IACb,OAAQ,KACR,gBAAiB,OACjB,OAAQ,IAAI,EAAE,IAAI,EAClB,QAAS,EACT,SAAU,OACV,QAAS,EACT,eAAgB,KAChB,MAAO,KAET,mBACE,QAAS,MACT,KAAM,KAER,6BACE,aAAc,IACd,cAAe,IACf,MAAO,QAET,qBACE,WAAY,QACZ,OAAQ,EACR,WAAY,KAEd,qBACE,WAAY,QACZ,OAAQ,EACR,WAAY,KACZ,MAAO,KAET,yBACE,KAAM,KAER,sBACE,WAAY,QACZ,OAAQ,EACR,WAAY,KACZ,MAAO,KAET,0BACE,KAAM,KAER,yBACA,+BACA,wBACA,8BACE,WAAY,IACZ,OAAQ,EACR,WAAY,KACZ,MAAO,qBACP,OAAQ,YAEV,6BACA,mCACA,4BACA,kCAEE,KAAM,qBAER,wBACA,8BACE,WAAY,QACZ,OAAQ,EACR,WAAY,KACZ,MAAO,KAGT,gCADA,0BAEE,UAAW,KAEb,4BACA,kCAEE,KAAM,KAER,8CACE,MAAO,KAET,kDACE,KAAM,KAER,wBACE,UAAW,KAEb,mBACE,OAAQ,KACR,MAAO,KAET,mBACE,eAAgB,OAChB,OAAQ,KACR,MAAO,KAET,uBACE,mBAAoB,QAChB,WAAY,QAChB,OAAQ,MACR,MAAO,KAET,wBACE,QAAS,EAAE,IACX,MAAO,MAET,uBACE,QAAS,MACT,UAAW,KACX,YAAa,IACb,eAAgB,QAChB,cAAe,IACf,YAAa,OAEf,uBACE,OAAQ,IAAI,EAAE,IAAI,EAClB,QAAS,EAAE,IACX,MAAO,KAET,6BACE,OAAQ,QACR,YAAa,IACb,OAAQ,EAAE,IAEZ,+BACE,YAAa,OACb,QAAS,KACT,gBAAiB,OACjB,MAAO,KAET,mCACE,KAAM,qBAER,gDACE,SAAU,OACV,cAAe,SACf,YAAa,OACb,MAAO,IAET,uBACE,OAAQ,EACR,cAAe,IACf,WAAY,WACZ,QAAS,KACT,OAAQ,IAAI,EAAE,IAAI,EAClB,SAAU,OAEZ,6BACE,WAAY,EAAE,EAAE,EAAE,IAAI,QAAQ,MAEhC,6BACE,WAAY,QACZ,WAAY,KACZ,MAAO,KAET,yBACE,cAAe,EAEjB,gCACE,MAAO,KAET,oCACE,KAAM,qBAER,iCACE,OAAQ,EAEV,gEACE,MAAO,KAET,mDACE,MAAO,KAKT,0DADA,0DADA,gDADA,gDAIE,WAAY,IACZ,WAAY,KACZ,MAAO,qBAET,2BACE,iBAAkB,QAEpB,kBAEA,4BADA,2BAEE,WAAY,+MAA+M,KAAK,EAAE,IAAI,EAAE,QACxO,iBAAkB,QAClB,QAAS,KACT,KAAM,EAAE,EAAE,KACV,YAAa,EACb,UAAW,KACX,QAAS,EAAE,EAEb,0DACE,OAAQ,EACR,QAAS,EACT,eAAgB,EAChB,YAAa,EACb,WAAY,OAEd,qCACE,WAAY,OAAO,IAAK,IAAI,CAAE,QAAQ,IAAK,OAAO,IAEpD,uCACE,WAAY,QAAQ,IAAK,IAAI,CAAE,OAAO,IAAK,OAAO,GAAI,CAAE,WAAW,GAAG,OAAO,IAE/E,+BACA,8DACE,WAAY,IAAI,MAAM,KACtB,WAAY,KAEd,6BACE,UAAW,OACX,WAAY,KAEd,2BACE,aAAc,EAEhB,8BACE,iBAAkB,KAGpB,mIADA,oGAEE,WAAY,IAAI,MAAM,KAExB,4CACE,iBAAkB,QAClB,OAAQ,IAAI,MAAM,KAClB,cAAe,IACf,WAAY,EAAE,IAAI,IAAI,gBAExB,sCACE,UAAW,gBAEb,yBACE,YAAa,OACb,QAAS,KACT,UAAW,KACX,OAAQ,EAAE,EACV,QAAS,EAAE,IAAI,EAAE,IAEnB,qCACE,YAAa,KAEf,iDACE,YAAa,EACb,UAAW,OAEb,2DACE,aAAc,IAAI,MAAM,KAE1B,qDACE,YAAa,IAAI,MAAM,KAEzB,kBACE,QAAS,aACT,QAAS,IACT,SAAU,SAEZ,wBACE,iBAAkB,QAClB,cAAe,IACf,WAAY,EAAE,IAAI,IAAI,kBACtB,MAAO,sBACP,UAAW,KACX,WAAY,OACZ,YAAa,IACb,QAAS,IAAI,IACb,eAAgB,KAElB,yBACE,SAAU,SAEZ,4CACE,YAAa,IAAI,MAAM,YACvB,aAAc,IAAI,MAAM,YACxB,WAAY,IAAI,MAAM,QACtB,OAAQ,EACR,KAAM,IACN,SAAU,SACV,UAAW,iBAEb,0CACE,cAAe,IAAI,MAAM,QACzB,YAAa,IAAI,MAAM,YACvB,aAAc,IAAI,MAAM,YACxB,KAAM,IACN,SAAU,SACV,IAAK,EACL,UAAW,iBAEb,6CACE,cAAe,IAAI,MAAM,YACzB,YAAa,IAAI,MAAM,QACvB,WAAY,IAAI,MAAM,YACtB,SAAU,SACV,MAAO,EACP,IAAK,IACL,UAAW,iBAEb,4CACE,cAAe,IAAI,MAAM,YACzB,aAAc,IAAI,MAAM,QACxB,WAAY,IAAI,MAAM,YACtB,KAAM,EACN,SAAU,SACV,IAAK,IACL,UAAW,iBAEb,eACE,OAAQ,IAAI,MAAM,KAClB,cAAe,IACf,QAAS,IACT,MAAO,KAET,4BACE,WAAY,EAEd,2BACE,cAAe,EAEjB,2BACE,OAAQ,EAEV,wBACE,OAAQ,IAAI,MAAM,KAClB,cAAe,IACf,QAAS,KACT,KAAM,EACN,SAAU,SAMZ,iCACE,iBAAkB,eAClB,QAAS,GACT,OAAQ,KACR,SAAU,SACV,MAAO,KACP,QAAS,KAEX,cACE,OAAQ,QAEV,6BACE,QAAS,KACT,KAAM,EACN,wBAAyB,KAE3B,+CACE,QAAS,KACT,KAAM,EACN,wBAAyB,KAE3B,iCACE,OAAQ,KAEV,+BACE,OAAQ","file":"skin.min.css","sourcesContent":["/**\n * Copyright (c) Tiny Technologies, Inc. All rights reserved.\n * Licensed under the LGPL or a commercial license.\n * For LGPL see License.txt in the project root for license information.\n * For commercial licenses see https://www.tiny.cloud/\n */\n.tox {\n box-sizing: content-box;\n color: #2A3746;\n cursor: auto;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n font-size: 16px;\n font-style: normal;\n font-weight: normal;\n line-height: normal;\n -webkit-tap-highlight-color: transparent;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n vertical-align: initial;\n white-space: normal;\n}\n.tox *:not(svg):not(rect) {\n box-sizing: inherit;\n color: inherit;\n cursor: inherit;\n direction: inherit;\n font-family: inherit;\n font-size: inherit;\n font-style: inherit;\n font-weight: inherit;\n line-height: inherit;\n -webkit-tap-highlight-color: inherit;\n text-align: inherit;\n text-decoration: inherit;\n text-shadow: inherit;\n text-transform: inherit;\n vertical-align: inherit;\n white-space: inherit;\n}\n.tox *:not(svg):not(rect) {\n /* stylelint-disable-line no-duplicate-selectors */\n background: transparent;\n border: 0;\n float: none;\n height: auto;\n margin: 0;\n max-width: none;\n outline: 0;\n padding: 0;\n position: static;\n width: auto;\n}\n.tox:not([dir=rtl]) {\n direction: ltr;\n text-align: left;\n}\n.tox[dir=rtl] {\n direction: rtl;\n text-align: right;\n}\n.tox-tinymce {\n border: 1px solid #000000;\n border-radius: 0;\n box-shadow: none;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n overflow: hidden;\n position: relative;\n visibility: inherit !important;\n}\n.tox-tinymce-inline {\n border: none;\n box-shadow: none;\n}\n.tox-tinymce-inline .tox-editor-header {\n border: 1px solid #000000;\n border-radius: 0;\n box-shadow: none;\n}\n.tox-tinymce-aux {\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n z-index: 1300;\n}\n.tox-tinymce *:focus,\n.tox-tinymce-aux *:focus {\n outline: none;\n}\nbutton::-moz-focus-inner {\n border: 0;\n}\n.tox .accessibility-issue__header {\n align-items: center;\n display: flex;\n margin-bottom: 4px;\n}\n.tox .accessibility-issue__description {\n align-items: stretch;\n border: 1px solid #000000;\n border-radius: 3px;\n display: flex;\n justify-content: space-between;\n}\n.tox .accessibility-issue__description > div {\n padding-bottom: 4px;\n}\n.tox .accessibility-issue__description > div > div {\n align-items: center;\n display: flex;\n margin-bottom: 4px;\n}\n.tox .accessibility-issue__description > *:last-child:not(:only-child) {\n border-color: #000000;\n border-style: solid;\n}\n.tox .accessibility-issue__repair {\n margin-top: 16px;\n}\n.tox .tox-dialog__body-content .accessibility-issue--info .accessibility-issue__description {\n background-color: rgba(32, 122, 183, 0.5);\n border-color: #207ab7;\n color: #fff;\n}\n.tox .tox-dialog__body-content .accessibility-issue--info .accessibility-issue__description > *:last-child {\n border-color: #207ab7;\n}\n.tox .tox-dialog__body-content .accessibility-issue--info .tox-form__group h2 {\n color: #fff;\n}\n.tox .tox-dialog__body-content .accessibility-issue--info .tox-icon svg {\n fill: #fff;\n}\n.tox .tox-dialog__body-content .accessibility-issue--info a .tox-icon {\n color: #fff;\n}\n.tox .tox-dialog__body-content .accessibility-issue--warn .accessibility-issue__description {\n background-color: rgba(255, 165, 0, 0.5);\n border-color: rgba(255, 165, 0, 0.8);\n color: #fff;\n}\n.tox .tox-dialog__body-content .accessibility-issue--warn .accessibility-issue__description > *:last-child {\n border-color: rgba(255, 165, 0, 0.8);\n}\n.tox .tox-dialog__body-content .accessibility-issue--warn .tox-form__group h2 {\n color: #fff;\n}\n.tox .tox-dialog__body-content .accessibility-issue--warn .tox-icon svg {\n fill: #fff;\n}\n.tox .tox-dialog__body-content .accessibility-issue--warn a .tox-icon {\n color: #fff;\n}\n.tox .tox-dialog__body-content .accessibility-issue--error .accessibility-issue__description {\n background-color: rgba(204, 0, 0, 0.5);\n border-color: rgba(204, 0, 0, 0.8);\n color: #fff;\n}\n.tox .tox-dialog__body-content .accessibility-issue--error .accessibility-issue__description > *:last-child {\n border-color: rgba(204, 0, 0, 0.8);\n}\n.tox .tox-dialog__body-content .accessibility-issue--error .tox-form__group h2 {\n color: #fff;\n}\n.tox .tox-dialog__body-content .accessibility-issue--error .tox-icon svg {\n fill: #fff;\n}\n.tox .tox-dialog__body-content .accessibility-issue--error a .tox-icon {\n color: #fff;\n}\n.tox .tox-dialog__body-content .accessibility-issue--success .accessibility-issue__description {\n background-color: rgba(120, 171, 70, 0.5);\n border-color: rgba(120, 171, 70, 0.8);\n color: #fff;\n}\n.tox .tox-dialog__body-content .accessibility-issue--success .accessibility-issue__description > *:last-child {\n border-color: rgba(120, 171, 70, 0.8);\n}\n.tox .tox-dialog__body-content .accessibility-issue--success .tox-form__group h2 {\n color: #fff;\n}\n.tox .tox-dialog__body-content .accessibility-issue--success .tox-icon svg {\n fill: #fff;\n}\n.tox .tox-dialog__body-content .accessibility-issue--success a .tox-icon {\n color: #fff;\n}\n.tox .tox-dialog__body-content .accessibility-issue__header h1,\n.tox .tox-dialog__body-content .tox-form__group .accessibility-issue__description h2 {\n margin-top: 0;\n}\n.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__header .tox-button {\n margin-left: 4px;\n}\n.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__header > *:nth-last-child(2) {\n margin-left: auto;\n}\n.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__description {\n padding: 4px 4px 4px 8px;\n}\n.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__description > *:last-child {\n border-left-width: 1px;\n padding-left: 4px;\n}\n.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__header .tox-button {\n margin-right: 4px;\n}\n.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__header > *:nth-last-child(2) {\n margin-right: auto;\n}\n.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__description {\n padding: 4px 8px 4px 4px;\n}\n.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__description > *:last-child {\n border-right-width: 1px;\n padding-right: 4px;\n}\n.tox .tox-anchorbar {\n display: flex;\n flex: 0 0 auto;\n}\n.tox .tox-bar {\n display: flex;\n flex: 0 0 auto;\n}\n.tox .tox-button {\n background-color: #207ab7;\n background-image: none;\n background-position: 0 0;\n background-repeat: repeat;\n border-color: #207ab7;\n border-radius: 3px;\n border-style: solid;\n border-width: 1px;\n box-shadow: none;\n box-sizing: border-box;\n color: #fff;\n cursor: pointer;\n display: inline-block;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n font-size: 14px;\n font-style: normal;\n font-weight: bold;\n letter-spacing: normal;\n line-height: 24px;\n margin: 0;\n outline: none;\n padding: 4px 16px;\n text-align: center;\n text-decoration: none;\n text-transform: capitalize;\n white-space: nowrap;\n}\n.tox .tox-button[disabled] {\n background-color: #207ab7;\n background-image: none;\n border-color: #207ab7;\n box-shadow: none;\n color: rgba(255, 255, 255, 0.5);\n cursor: not-allowed;\n}\n.tox .tox-button:focus:not(:disabled) {\n background-color: #1c6ca1;\n background-image: none;\n border-color: #1c6ca1;\n box-shadow: none;\n color: #fff;\n}\n.tox .tox-button:hover:not(:disabled) {\n background-color: #1c6ca1;\n background-image: none;\n border-color: #1c6ca1;\n box-shadow: none;\n color: #fff;\n}\n.tox .tox-button:active:not(:disabled) {\n background-color: #185d8c;\n background-image: none;\n border-color: #185d8c;\n box-shadow: none;\n color: #fff;\n}\n.tox .tox-button--secondary {\n background-color: #3d546f;\n background-image: none;\n background-position: 0 0;\n background-repeat: repeat;\n border-color: #3d546f;\n border-radius: 3px;\n border-style: solid;\n border-width: 1px;\n box-shadow: none;\n color: #fff;\n font-size: 14px;\n font-style: normal;\n font-weight: bold;\n letter-spacing: normal;\n outline: none;\n padding: 4px 16px;\n text-decoration: none;\n text-transform: capitalize;\n}\n.tox .tox-button--secondary[disabled] {\n background-color: #3d546f;\n background-image: none;\n border-color: #3d546f;\n box-shadow: none;\n color: rgba(255, 255, 255, 0.5);\n}\n.tox .tox-button--secondary:focus:not(:disabled) {\n background-color: #34485f;\n background-image: none;\n border-color: #34485f;\n box-shadow: none;\n color: #fff;\n}\n.tox .tox-button--secondary:hover:not(:disabled) {\n background-color: #34485f;\n background-image: none;\n border-color: #34485f;\n box-shadow: none;\n color: #fff;\n}\n.tox .tox-button--secondary:active:not(:disabled) {\n background-color: #2b3b4e;\n background-image: none;\n border-color: #2b3b4e;\n box-shadow: none;\n color: #fff;\n}\n.tox .tox-button--icon,\n.tox .tox-button.tox-button--icon,\n.tox .tox-button.tox-button--secondary.tox-button--icon {\n padding: 4px;\n}\n.tox .tox-button--icon .tox-icon svg,\n.tox .tox-button.tox-button--icon .tox-icon svg,\n.tox .tox-button.tox-button--secondary.tox-button--icon .tox-icon svg {\n display: block;\n fill: currentColor;\n}\n.tox .tox-button-link {\n background: 0;\n border: none;\n box-sizing: border-box;\n cursor: pointer;\n display: inline-block;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n font-size: 16px;\n font-weight: normal;\n line-height: 1.3;\n margin: 0;\n padding: 0;\n white-space: nowrap;\n}\n.tox .tox-button-link--sm {\n font-size: 14px;\n}\n.tox .tox-button--naked {\n background-color: transparent;\n border-color: transparent;\n box-shadow: unset;\n color: #fff;\n}\n.tox .tox-button--naked[disabled] {\n background-color: #3d546f;\n border-color: #3d546f;\n box-shadow: none;\n color: rgba(255, 255, 255, 0.5);\n}\n.tox .tox-button--naked:hover:not(:disabled) {\n background-color: #34485f;\n border-color: #34485f;\n box-shadow: none;\n color: #fff;\n}\n.tox .tox-button--naked:focus:not(:disabled) {\n background-color: #34485f;\n border-color: #34485f;\n box-shadow: none;\n color: #fff;\n}\n.tox .tox-button--naked:active:not(:disabled) {\n background-color: #2b3b4e;\n border-color: #2b3b4e;\n box-shadow: none;\n color: #fff;\n}\n.tox .tox-button--naked .tox-icon svg {\n fill: currentColor;\n}\n.tox .tox-button--naked.tox-button--icon:hover:not(:disabled) {\n color: #fff;\n}\n.tox .tox-checkbox {\n align-items: center;\n border-radius: 3px;\n cursor: pointer;\n display: flex;\n height: 36px;\n min-width: 36px;\n}\n.tox .tox-checkbox__input {\n /* Hide from view but visible to screen readers */\n height: 1px;\n overflow: hidden;\n position: absolute;\n top: auto;\n width: 1px;\n}\n.tox .tox-checkbox__icons {\n align-items: center;\n border-radius: 3px;\n box-shadow: 0 0 0 2px transparent;\n box-sizing: content-box;\n display: flex;\n height: 24px;\n justify-content: center;\n padding: calc(4px - 1px);\n width: 24px;\n}\n.tox .tox-checkbox__icons .tox-checkbox-icon__unchecked svg {\n display: block;\n fill: rgba(255, 255, 255, 0.2);\n}\n.tox .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg {\n display: none;\n fill: #207ab7;\n}\n.tox .tox-checkbox__icons .tox-checkbox-icon__checked svg {\n display: none;\n fill: #207ab7;\n}\n.tox .tox-checkbox--disabled {\n color: rgba(255, 255, 255, 0.5);\n cursor: not-allowed;\n}\n.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__checked svg {\n fill: rgba(255, 255, 255, 0.5);\n}\n.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__unchecked svg {\n fill: rgba(255, 255, 255, 0.5);\n}\n.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg {\n fill: rgba(255, 255, 255, 0.5);\n}\n.tox input.tox-checkbox__input:checked + .tox-checkbox__icons .tox-checkbox-icon__unchecked svg {\n display: none;\n}\n.tox input.tox-checkbox__input:checked + .tox-checkbox__icons .tox-checkbox-icon__checked svg {\n display: block;\n}\n.tox input.tox-checkbox__input:indeterminate + .tox-checkbox__icons .tox-checkbox-icon__unchecked svg {\n display: none;\n}\n.tox input.tox-checkbox__input:indeterminate + .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg {\n display: block;\n}\n.tox input.tox-checkbox__input:focus + .tox-checkbox__icons {\n border-radius: 3px;\n box-shadow: inset 0 0 0 1px #207ab7;\n padding: calc(4px - 1px);\n}\n.tox:not([dir=rtl]) .tox-checkbox__label {\n margin-left: 4px;\n}\n.tox:not([dir=rtl]) .tox-checkbox__input {\n left: -10000px;\n}\n.tox:not([dir=rtl]) .tox-bar .tox-checkbox {\n margin-left: 4px;\n}\n.tox[dir=rtl] .tox-checkbox__label {\n margin-right: 4px;\n}\n.tox[dir=rtl] .tox-checkbox__input {\n right: -10000px;\n}\n.tox[dir=rtl] .tox-bar .tox-checkbox {\n margin-right: 4px;\n}\n.tox {\n /* stylelint-disable-next-line no-descending-specificity */\n}\n.tox .tox-collection--toolbar .tox-collection__group {\n display: flex;\n padding: 0;\n}\n.tox .tox-collection--grid .tox-collection__group {\n display: flex;\n flex-wrap: wrap;\n max-height: 208px;\n overflow-x: hidden;\n overflow-y: auto;\n padding: 0;\n}\n.tox .tox-collection--list .tox-collection__group {\n border-bottom-width: 0;\n border-color: #1a1a1a;\n border-left-width: 0;\n border-right-width: 0;\n border-style: solid;\n border-top-width: 1px;\n padding: 4px 0;\n}\n.tox .tox-collection--list .tox-collection__group:first-child {\n border-top-width: 0;\n}\n.tox .tox-collection__group-heading {\n background-color: #333333;\n color: #fff;\n cursor: default;\n font-size: 12px;\n font-style: normal;\n font-weight: normal;\n margin-bottom: 4px;\n margin-top: -4px;\n padding: 4px 8px;\n text-transform: none;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.tox .tox-collection__item {\n align-items: center;\n color: #fff;\n cursor: pointer;\n display: flex;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.tox .tox-collection--list .tox-collection__item {\n padding: 4px 8px;\n}\n.tox .tox-collection--toolbar .tox-collection__item {\n border-radius: 3px;\n padding: 4px;\n}\n.tox .tox-collection--grid .tox-collection__item {\n border-radius: 3px;\n padding: 4px;\n}\n.tox .tox-collection--list .tox-collection__item--enabled {\n background-color: #2b3b4e;\n color: #fff;\n}\n.tox .tox-collection--list .tox-collection__item--active {\n background-color: #4a5562;\n}\n.tox .tox-collection--toolbar .tox-collection__item--enabled {\n background-color: #757d87;\n color: #fff;\n}\n.tox .tox-collection--toolbar .tox-collection__item--active {\n background-color: #4a5562;\n}\n.tox .tox-collection--grid .tox-collection__item--enabled {\n background-color: #757d87;\n color: #fff;\n}\n.tox .tox-collection--grid .tox-collection__item--active:not(.tox-collection__item--state-disabled) {\n background-color: #4a5562;\n color: #fff;\n}\n.tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled) {\n color: #fff;\n}\n.tox .tox-collection--toolbar .tox-collection__item--active:not(.tox-collection__item--state-disabled) {\n color: #fff;\n}\n.tox .tox-collection__item--state-disabled {\n background-color: transparent;\n color: rgba(255, 255, 255, 0.5);\n cursor: not-allowed;\n}\n.tox .tox-collection__item-icon,\n.tox .tox-collection__item-checkmark {\n align-items: center;\n display: flex;\n height: 24px;\n justify-content: center;\n width: 24px;\n}\n.tox .tox-collection__item-icon svg,\n.tox .tox-collection__item-checkmark svg {\n fill: currentColor;\n}\n.tox .tox-collection--toolbar-lg .tox-collection__item-icon {\n height: 48px;\n width: 48px;\n}\n.tox .tox-collection__item-label {\n color: currentColor;\n display: inline-block;\n flex: 1;\n -ms-flex-preferred-size: auto;\n font-size: 14px;\n font-style: normal;\n font-weight: normal;\n line-height: 24px;\n text-transform: none;\n word-break: break-all;\n}\n.tox .tox-collection__item-accessory {\n color: rgba(255, 255, 255, 0.5);\n display: inline-block;\n font-size: 14px;\n height: 24px;\n line-height: 24px;\n text-transform: none;\n}\n.tox .tox-collection__item-caret {\n align-items: center;\n display: flex;\n min-height: 24px;\n}\n.tox .tox-collection__item-caret::after {\n content: '';\n font-size: 0;\n min-height: inherit;\n}\n.tox .tox-collection__item-caret svg {\n fill: #fff;\n}\n.tox .tox-collection--list .tox-collection__item:not(.tox-collection__item--enabled) .tox-collection__item-checkmark svg {\n display: none;\n}\n.tox .tox-collection--list .tox-collection__item:not(.tox-collection__item--enabled) .tox-collection__item-accessory + .tox-collection__item-checkmark {\n display: none;\n}\n.tox .tox-collection--horizontal {\n background-color: #2b3b4e;\n border: 1px solid #1a1a1a;\n border-radius: 3px;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);\n display: flex;\n flex: 0 0 auto;\n flex-shrink: 0;\n flex-wrap: nowrap;\n margin-bottom: 0;\n overflow-x: auto;\n padding: 0;\n}\n.tox .tox-collection--horizontal .tox-collection__group {\n align-items: center;\n display: flex;\n flex-wrap: nowrap;\n margin: 0;\n padding: 0 4px;\n}\n.tox .tox-collection--horizontal .tox-collection__item {\n height: 34px;\n margin: 2px 0 3px 0;\n padding: 0 4px;\n}\n.tox .tox-collection--horizontal .tox-collection__item-label {\n white-space: nowrap;\n}\n.tox .tox-collection--horizontal .tox-collection__item-caret {\n margin-left: 4px;\n}\n.tox:not([dir=rtl]) .tox-collection--horizontal .tox-collection__group:not(:last-of-type) {\n border-right: 1px solid #000000;\n}\n.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item > *:not(:first-child) {\n margin-left: 8px;\n}\n.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item-label:first-child {\n margin-left: 4px;\n}\n.tox:not([dir=rtl]) .tox-collection__item-accessory {\n margin-left: 16px;\n text-align: right;\n}\n.tox:not([dir=rtl]) .tox-collection .tox-collection__item-caret {\n margin-left: 16px;\n}\n.tox[dir=rtl] .tox-collection--horizontal .tox-collection__group:not(:last-of-type) {\n border-left: 1px solid #000000;\n}\n.tox[dir=rtl] .tox-collection--list .tox-collection__item > *:not(:first-child) {\n margin-right: 8px;\n}\n.tox[dir=rtl] .tox-collection--list .tox-collection__item-label:first-child {\n margin-right: 4px;\n}\n.tox[dir=rtl] .tox-collection__item-icon-rtl {\n /* stylelint-disable-next-line no-descending-specificity */\n}\n.tox[dir=rtl] .tox-collection__item-icon-rtl .tox-collection__item-icon svg {\n transform: rotateY(180deg);\n}\n.tox[dir=rtl] .tox-collection__item-accessory {\n margin-right: 16px;\n text-align: left;\n}\n.tox[dir=rtl] .tox-collection .tox-collection__item-caret {\n margin-right: 16px;\n transform: rotateY(180deg);\n}\n.tox[dir=rtl] .tox-collection--horizontal .tox-collection__item-caret {\n margin-right: 4px;\n}\n.tox .tox-color-picker-container {\n display: flex;\n flex-direction: row;\n height: 225px;\n margin: 0;\n}\n.tox .tox-sv-palette {\n box-sizing: border-box;\n display: flex;\n height: 100%;\n}\n.tox .tox-sv-palette-spectrum {\n height: 100%;\n}\n.tox .tox-sv-palette,\n.tox .tox-sv-palette-spectrum {\n width: 225px;\n}\n.tox .tox-sv-palette-thumb {\n background: none;\n border: 1px solid black;\n border-radius: 50%;\n box-sizing: content-box;\n height: 12px;\n position: absolute;\n width: 12px;\n}\n.tox .tox-sv-palette-inner-thumb {\n border: 1px solid white;\n border-radius: 50%;\n height: 10px;\n position: absolute;\n width: 10px;\n}\n.tox .tox-hue-slider {\n box-sizing: border-box;\n height: 100%;\n width: 25px;\n}\n.tox .tox-hue-slider-spectrum {\n background: linear-gradient(to bottom, #f00, #ff0080, #f0f, #8000ff, #00f, #0080ff, #0ff, #00ff80, #0f0, #80ff00, #ff0, #ff8000, #f00);\n height: 100%;\n width: 100%;\n}\n.tox .tox-hue-slider,\n.tox .tox-hue-slider-spectrum {\n width: 20px;\n}\n.tox .tox-hue-slider-thumb {\n background: white;\n border: 1px solid black;\n box-sizing: content-box;\n height: 4px;\n width: 100%;\n}\n.tox .tox-rgb-form {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n.tox .tox-rgb-form div {\n align-items: center;\n display: flex;\n justify-content: space-between;\n margin-bottom: 5px;\n width: inherit;\n}\n.tox .tox-rgb-form input {\n width: 6em;\n}\n.tox .tox-rgb-form input.tox-invalid {\n /* Need !important to override Chrome's focus styling unfortunately */\n border: 1px solid red !important;\n}\n.tox .tox-rgb-form .tox-rgba-preview {\n border: 1px solid black;\n flex-grow: 2;\n margin-bottom: 0;\n}\n.tox:not([dir=rtl]) .tox-sv-palette {\n margin-right: 15px;\n}\n.tox:not([dir=rtl]) .tox-hue-slider {\n margin-right: 15px;\n}\n.tox:not([dir=rtl]) .tox-hue-slider-thumb {\n margin-left: -1px;\n}\n.tox:not([dir=rtl]) .tox-rgb-form label {\n margin-right: 0.5em;\n}\n.tox[dir=rtl] .tox-sv-palette {\n margin-left: 15px;\n}\n.tox[dir=rtl] .tox-hue-slider {\n margin-left: 15px;\n}\n.tox[dir=rtl] .tox-hue-slider-thumb {\n margin-right: -1px;\n}\n.tox[dir=rtl] .tox-rgb-form label {\n margin-left: 0.5em;\n}\n.tox .tox-toolbar .tox-swatches,\n.tox .tox-toolbar__primary .tox-swatches,\n.tox .tox-toolbar__overflow .tox-swatches {\n margin: 2px 0 3px 4px;\n}\n.tox .tox-collection--list .tox-collection__group .tox-swatches-menu {\n border: 0;\n margin: -4px 0;\n}\n.tox .tox-swatches__row {\n display: flex;\n}\n.tox .tox-swatch {\n height: 30px;\n transition: transform 0.15s, box-shadow 0.15s;\n width: 30px;\n}\n.tox .tox-swatch:hover,\n.tox .tox-swatch:focus {\n box-shadow: 0 0 0 1px rgba(127, 127, 127, 0.3) inset;\n transform: scale(0.8);\n}\n.tox .tox-swatch--remove {\n align-items: center;\n display: flex;\n justify-content: center;\n}\n.tox .tox-swatch--remove svg path {\n stroke: #e74c3c;\n}\n.tox .tox-swatches__picker-btn {\n align-items: center;\n background-color: transparent;\n border: 0;\n cursor: pointer;\n display: flex;\n height: 30px;\n justify-content: center;\n outline: none;\n padding: 0;\n width: 30px;\n}\n.tox .tox-swatches__picker-btn svg {\n height: 24px;\n width: 24px;\n}\n.tox .tox-swatches__picker-btn:hover {\n background: #4a5562;\n}\n.tox:not([dir=rtl]) .tox-swatches__picker-btn {\n margin-left: auto;\n}\n.tox[dir=rtl] .tox-swatches__picker-btn {\n margin-right: auto;\n}\n.tox .tox-comment-thread {\n background: #2b3b4e;\n position: relative;\n}\n.tox .tox-comment-thread > *:not(:first-child) {\n margin-top: 8px;\n}\n.tox .tox-comment {\n background: #2b3b4e;\n border: 1px solid #000000;\n border-radius: 3px;\n box-shadow: 0 4px 8px 0 rgba(42, 55, 70, 0.1);\n padding: 8px 8px 16px 8px;\n position: relative;\n}\n.tox .tox-comment__header {\n align-items: center;\n color: #fff;\n display: flex;\n justify-content: space-between;\n}\n.tox .tox-comment__date {\n color: rgba(255, 255, 255, 0.5);\n font-size: 12px;\n}\n.tox .tox-comment__body {\n color: #fff;\n font-size: 14px;\n font-style: normal;\n font-weight: normal;\n line-height: 1.3;\n margin-top: 8px;\n position: relative;\n text-transform: initial;\n}\n.tox .tox-comment__body textarea {\n resize: none;\n white-space: normal;\n width: 100%;\n}\n.tox .tox-comment__expander {\n padding-top: 8px;\n}\n.tox .tox-comment__expander p {\n color: rgba(255, 255, 255, 0.5);\n font-size: 14px;\n font-style: normal;\n}\n.tox .tox-comment__body p {\n margin: 0;\n}\n.tox .tox-comment__buttonspacing {\n padding-top: 16px;\n text-align: center;\n}\n.tox .tox-comment-thread__overlay::after {\n background: #2b3b4e;\n bottom: 0;\n content: \"\";\n display: flex;\n left: 0;\n opacity: 0.9;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 5;\n}\n.tox .tox-comment__reply {\n display: flex;\n flex-shrink: 0;\n flex-wrap: wrap;\n justify-content: flex-end;\n margin-top: 8px;\n}\n.tox .tox-comment__reply > *:first-child {\n margin-bottom: 8px;\n width: 100%;\n}\n.tox .tox-comment__edit {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-end;\n margin-top: 16px;\n}\n.tox .tox-comment__gradient::after {\n background: linear-gradient(rgba(43, 59, 78, 0), #2b3b4e);\n bottom: 0;\n content: \"\";\n display: block;\n height: 5em;\n margin-top: -40px;\n position: absolute;\n width: 100%;\n}\n.tox .tox-comment__overlay {\n background: #2b3b4e;\n bottom: 0;\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n left: 0;\n opacity: 0.9;\n position: absolute;\n right: 0;\n text-align: center;\n top: 0;\n z-index: 5;\n}\n.tox .tox-comment__loading-text {\n align-items: center;\n color: #fff;\n display: flex;\n flex-direction: column;\n position: relative;\n}\n.tox .tox-comment__loading-text > div {\n padding-bottom: 16px;\n}\n.tox .tox-comment__overlaytext {\n bottom: 0;\n flex-direction: column;\n font-size: 14px;\n left: 0;\n padding: 1em;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 10;\n}\n.tox .tox-comment__overlaytext p {\n background-color: #2b3b4e;\n box-shadow: 0 0 8px 8px #2b3b4e;\n color: #fff;\n text-align: center;\n}\n.tox .tox-comment__overlaytext div:nth-of-type(2) {\n font-size: 0.8em;\n}\n.tox .tox-comment__busy-spinner {\n align-items: center;\n background-color: #2b3b4e;\n bottom: 0;\n display: flex;\n justify-content: center;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 20;\n}\n.tox .tox-comment__scroll {\n display: flex;\n flex-direction: column;\n flex-shrink: 1;\n overflow: auto;\n}\n.tox .tox-conversations {\n margin: 8px;\n}\n.tox:not([dir=rtl]) .tox-comment__edit {\n margin-left: 8px;\n}\n.tox:not([dir=rtl]) .tox-comment__buttonspacing > *:last-child,\n.tox:not([dir=rtl]) .tox-comment__edit > *:last-child,\n.tox:not([dir=rtl]) .tox-comment__reply > *:last-child {\n margin-left: 8px;\n}\n.tox[dir=rtl] .tox-comment__edit {\n margin-right: 8px;\n}\n.tox[dir=rtl] .tox-comment__buttonspacing > *:last-child,\n.tox[dir=rtl] .tox-comment__edit > *:last-child,\n.tox[dir=rtl] .tox-comment__reply > *:last-child {\n margin-right: 8px;\n}\n.tox .tox-user {\n align-items: center;\n display: flex;\n}\n.tox .tox-user__avatar svg {\n fill: rgba(255, 255, 255, 0.5);\n}\n.tox .tox-user__name {\n color: rgba(255, 255, 255, 0.5);\n font-size: 12px;\n font-style: normal;\n font-weight: bold;\n text-transform: uppercase;\n}\n.tox:not([dir=rtl]) .tox-user__avatar svg {\n margin-right: 8px;\n}\n.tox:not([dir=rtl]) .tox-user__avatar + .tox-user__name {\n margin-left: 8px;\n}\n.tox[dir=rtl] .tox-user__avatar svg {\n margin-left: 8px;\n}\n.tox[dir=rtl] .tox-user__avatar + .tox-user__name {\n margin-right: 8px;\n}\n.tox .tox-dialog-wrap {\n align-items: center;\n bottom: 0;\n display: flex;\n justify-content: center;\n left: 0;\n position: fixed;\n right: 0;\n top: 0;\n z-index: 1100;\n}\n.tox .tox-dialog-wrap__backdrop {\n background-color: rgba(34, 47, 62, 0.75);\n bottom: 0;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 1;\n}\n.tox .tox-dialog-wrap__backdrop--opaque {\n background-color: #222f3e;\n}\n.tox .tox-dialog {\n background-color: #2b3b4e;\n border-color: #000000;\n border-radius: 3px;\n border-style: solid;\n border-width: 1px;\n box-shadow: 0 16px 16px -10px rgba(42, 55, 70, 0.15), 0 0 40px 1px rgba(42, 55, 70, 0.15);\n display: flex;\n flex-direction: column;\n max-height: 100%;\n max-width: 480px;\n overflow: hidden;\n position: relative;\n width: 95vw;\n z-index: 2;\n}\n@media only screen and (max-width:767px) {\n body:not(.tox-force-desktop) .tox .tox-dialog {\n align-self: flex-start;\n margin: 8px auto;\n width: calc(100vw - 16px);\n }\n}\n.tox .tox-dialog-inline {\n z-index: 1100;\n}\n.tox .tox-dialog__header {\n align-items: center;\n background-color: #2b3b4e;\n border-bottom: none;\n color: #fff;\n display: flex;\n font-size: 16px;\n justify-content: space-between;\n padding: 8px 16px 0 16px;\n position: relative;\n}\n.tox .tox-dialog__header .tox-button {\n z-index: 1;\n}\n.tox .tox-dialog__draghandle {\n cursor: grab;\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n}\n.tox .tox-dialog__draghandle:active {\n cursor: grabbing;\n}\n.tox .tox-dialog__dismiss {\n margin-left: auto;\n}\n.tox .tox-dialog__title {\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n font-size: 20px;\n font-style: normal;\n font-weight: normal;\n line-height: 1.3;\n margin: 0;\n text-transform: none;\n}\n.tox .tox-dialog__body {\n color: #fff;\n display: flex;\n flex: 1;\n -ms-flex-preferred-size: auto;\n font-size: 16px;\n font-style: normal;\n font-weight: normal;\n line-height: 1.3;\n min-width: 0;\n text-align: left;\n text-transform: none;\n}\n@media only screen and (max-width:767px) {\n body:not(.tox-force-desktop) .tox .tox-dialog__body {\n flex-direction: column;\n }\n}\n.tox .tox-dialog__body-nav {\n align-items: flex-start;\n display: flex;\n flex-direction: column;\n padding: 16px 16px;\n}\n@media only screen and (max-width:767px) {\n body:not(.tox-force-desktop) .tox .tox-dialog__body-nav {\n flex-direction: row;\n -webkit-overflow-scrolling: touch;\n overflow-x: auto;\n padding-bottom: 0;\n }\n}\n.tox .tox-dialog__body-nav-item {\n border-bottom: 2px solid transparent;\n color: rgba(255, 255, 255, 0.5);\n display: inline-block;\n font-size: 14px;\n line-height: 1.3;\n margin-bottom: 8px;\n text-decoration: none;\n white-space: nowrap;\n}\n.tox .tox-dialog__body-nav-item:focus {\n background-color: rgba(32, 122, 183, 0.1);\n}\n.tox .tox-dialog__body-nav-item--active {\n border-bottom: 2px solid #207ab7;\n color: #207ab7;\n}\n.tox .tox-dialog__body-content {\n box-sizing: border-box;\n display: flex;\n flex: 1;\n flex-direction: column;\n -ms-flex-preferred-size: auto;\n max-height: 650px;\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n padding: 16px 16px;\n}\n.tox .tox-dialog__body-content > * {\n margin-bottom: 0;\n margin-top: 16px;\n}\n.tox .tox-dialog__body-content > *:first-child {\n margin-top: 0;\n}\n.tox .tox-dialog__body-content > *:last-child {\n margin-bottom: 0;\n}\n.tox .tox-dialog__body-content > *:only-child {\n margin-bottom: 0;\n margin-top: 0;\n}\n.tox .tox-dialog__body-content a {\n color: #207ab7;\n cursor: pointer;\n text-decoration: none;\n}\n.tox .tox-dialog__body-content a:hover,\n.tox .tox-dialog__body-content a:focus {\n color: #185d8c;\n text-decoration: none;\n}\n.tox .tox-dialog__body-content a:active {\n color: #185d8c;\n text-decoration: none;\n}\n.tox .tox-dialog__body-content svg {\n fill: #fff;\n}\n.tox .tox-dialog__body-content ul {\n display: block;\n list-style-type: disc;\n margin-bottom: 16px;\n -webkit-margin-end: 0;\n margin-inline-end: 0;\n -webkit-margin-start: 0;\n margin-inline-start: 0;\n -webkit-padding-start: 2.5rem;\n padding-inline-start: 2.5rem;\n}\n.tox .tox-dialog__body-content .tox-form__group h1 {\n color: #fff;\n font-size: 20px;\n font-style: normal;\n font-weight: bold;\n letter-spacing: normal;\n margin-bottom: 16px;\n margin-top: 2rem;\n text-transform: none;\n}\n.tox .tox-dialog__body-content .tox-form__group h2 {\n color: #fff;\n font-size: 16px;\n font-style: normal;\n font-weight: bold;\n letter-spacing: normal;\n margin-bottom: 16px;\n margin-top: 2rem;\n text-transform: none;\n}\n.tox .tox-dialog__body-content .tox-form__group p {\n margin-bottom: 16px;\n}\n.tox .tox-dialog__body-content .tox-form__group h1:first-child,\n.tox .tox-dialog__body-content .tox-form__group h2:first-child,\n.tox .tox-dialog__body-content .tox-form__group p:first-child {\n margin-top: 0;\n}\n.tox .tox-dialog__body-content .tox-form__group h1:last-child,\n.tox .tox-dialog__body-content .tox-form__group h2:last-child,\n.tox .tox-dialog__body-content .tox-form__group p:last-child {\n margin-bottom: 0;\n}\n.tox .tox-dialog__body-content .tox-form__group h1:only-child,\n.tox .tox-dialog__body-content .tox-form__group h2:only-child,\n.tox .tox-dialog__body-content .tox-form__group p:only-child {\n margin-bottom: 0;\n margin-top: 0;\n}\n.tox .tox-dialog--width-lg {\n height: 650px;\n max-width: 1200px;\n}\n.tox .tox-dialog--width-md {\n max-width: 800px;\n}\n.tox .tox-dialog--width-md .tox-dialog__body-content {\n overflow: auto;\n}\n.tox .tox-dialog__body-content--centered {\n text-align: center;\n}\n.tox .tox-dialog__footer {\n align-items: center;\n background-color: #2b3b4e;\n border-top: 1px solid #000000;\n display: flex;\n justify-content: space-between;\n padding: 8px 16px;\n}\n.tox .tox-dialog__footer-start,\n.tox .tox-dialog__footer-end {\n display: flex;\n}\n.tox .tox-dialog__busy-spinner {\n align-items: center;\n background-color: rgba(34, 47, 62, 0.75);\n bottom: 0;\n display: flex;\n justify-content: center;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 3;\n}\n.tox .tox-dialog__table {\n border-collapse: collapse;\n width: 100%;\n}\n.tox .tox-dialog__table thead th {\n font-weight: bold;\n padding-bottom: 8px;\n}\n.tox .tox-dialog__table tbody tr {\n border-bottom: 1px solid #000000;\n}\n.tox .tox-dialog__table tbody tr:last-child {\n border-bottom: none;\n}\n.tox .tox-dialog__table td {\n padding-bottom: 8px;\n padding-top: 8px;\n}\n.tox .tox-dialog__popups {\n position: absolute;\n width: 100%;\n z-index: 1100;\n}\n.tox .tox-dialog__body-iframe {\n display: flex;\n flex: 1;\n flex-direction: column;\n -ms-flex-preferred-size: auto;\n}\n.tox .tox-dialog__body-iframe .tox-navobj {\n display: flex;\n flex: 1;\n -ms-flex-preferred-size: auto;\n}\n.tox .tox-dialog__body-iframe .tox-navobj :nth-child(2) {\n flex: 1;\n -ms-flex-preferred-size: auto;\n height: 100%;\n}\n.tox .tox-dialog-dock-fadeout {\n opacity: 0;\n visibility: hidden;\n}\n.tox .tox-dialog-dock-fadein {\n opacity: 1;\n visibility: visible;\n}\n.tox .tox-dialog-dock-transition {\n transition: visibility 0s linear 0.3s, opacity 0.3s ease;\n}\n.tox .tox-dialog-dock-transition.tox-dialog-dock-fadein {\n transition-delay: 0s;\n}\nbody.tox-dialog__disable-scroll {\n overflow: hidden;\n}\n.tox.tox-platform-ie {\n /* IE11 CSS styles go here */\n}\n.tox.tox-platform-ie .tox-dialog-wrap {\n position: -ms-device-fixed;\n}\n@media only screen and (max-width:767px) {\n body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav {\n margin-right: 0;\n }\n}\n@media only screen and (max-width:767px) {\n body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav-item:not(:first-child) {\n margin-left: 8px;\n }\n}\n.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-start > *,\n.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-end > * {\n margin-left: 8px;\n}\n.tox[dir=rtl] .tox-dialog__body {\n text-align: right;\n}\n@media only screen and (max-width:767px) {\n body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav {\n margin-left: 0;\n }\n}\n@media only screen and (max-width:767px) {\n body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav-item:not(:first-child) {\n margin-right: 8px;\n }\n}\n.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-start > *,\n.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-end > * {\n margin-right: 8px;\n}\n.tox .tox-dropzone-container {\n display: flex;\n flex: 1;\n -ms-flex-preferred-size: auto;\n}\n.tox .tox-dropzone {\n align-items: center;\n background: #fff;\n border: 2px dashed #000000;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n justify-content: center;\n min-height: 100px;\n padding: 10px;\n}\n.tox .tox-dropzone p {\n color: rgba(255, 255, 255, 0.5);\n margin: 0 0 16px 0;\n}\n.tox .tox-edit-area {\n display: flex;\n flex: 1;\n -ms-flex-preferred-size: auto;\n overflow: hidden;\n position: relative;\n}\n.tox .tox-edit-area__iframe {\n background-color: #fff;\n border: 0;\n box-sizing: border-box;\n flex: 1;\n -ms-flex-preferred-size: auto;\n height: 100%;\n position: absolute;\n width: 100%;\n}\n.tox.tox-inline-edit-area {\n border: 1px dotted #000000;\n}\n.tox .tox-editor-container {\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n overflow: hidden;\n}\n.tox .tox-editor-header {\n z-index: 1;\n}\n.tox:not(.tox-tinymce-inline) .tox-editor-header {\n box-shadow: none;\n transition: box-shadow 0.5s;\n}\n.tox.tox-tinymce--toolbar-bottom .tox-editor-header,\n.tox.tox-tinymce-inline .tox-editor-header {\n margin-bottom: -1px;\n}\n.tox.tox-tinymce--toolbar-sticky-on .tox-editor-header {\n box-shadow: 0 4px 4px -3px rgba(0, 0, 0, 0.25);\n}\n.tox-editor-dock-fadeout {\n opacity: 0;\n visibility: hidden;\n}\n.tox-editor-dock-fadein {\n opacity: 1;\n visibility: visible;\n}\n.tox-editor-dock-transition {\n transition: visibility 0s linear 0.25s, opacity 0.25s ease;\n}\n.tox-editor-dock-transition.tox-editor-dock-fadein {\n transition-delay: 0s;\n}\n.tox .tox-control-wrap {\n flex: 1;\n position: relative;\n}\n.tox .tox-control-wrap:not(.tox-control-wrap--status-invalid) .tox-control-wrap__status-icon-invalid,\n.tox .tox-control-wrap:not(.tox-control-wrap--status-unknown) .tox-control-wrap__status-icon-unknown,\n.tox .tox-control-wrap:not(.tox-control-wrap--status-valid) .tox-control-wrap__status-icon-valid {\n display: none;\n}\n.tox .tox-control-wrap svg {\n display: block;\n}\n.tox .tox-control-wrap__status-icon-wrap {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n}\n.tox .tox-control-wrap__status-icon-invalid svg {\n fill: #c00;\n}\n.tox .tox-control-wrap__status-icon-unknown svg {\n fill: orange;\n}\n.tox .tox-control-wrap__status-icon-valid svg {\n fill: green;\n}\n.tox:not([dir=rtl]) .tox-control-wrap--status-invalid .tox-textfield,\n.tox:not([dir=rtl]) .tox-control-wrap--status-unknown .tox-textfield,\n.tox:not([dir=rtl]) .tox-control-wrap--status-valid .tox-textfield {\n padding-right: 32px;\n}\n.tox:not([dir=rtl]) .tox-control-wrap__status-icon-wrap {\n right: 4px;\n}\n.tox[dir=rtl] .tox-control-wrap--status-invalid .tox-textfield,\n.tox[dir=rtl] .tox-control-wrap--status-unknown .tox-textfield,\n.tox[dir=rtl] .tox-control-wrap--status-valid .tox-textfield {\n padding-left: 32px;\n}\n.tox[dir=rtl] .tox-control-wrap__status-icon-wrap {\n left: 4px;\n}\n.tox .tox-autocompleter {\n max-width: 25em;\n}\n.tox .tox-autocompleter .tox-menu {\n max-width: 25em;\n}\n.tox .tox-autocompleter .tox-autocompleter-highlight {\n font-weight: bold;\n}\n.tox .tox-color-input {\n display: flex;\n position: relative;\n z-index: 1;\n}\n.tox .tox-color-input .tox-textfield {\n z-index: -1;\n}\n.tox .tox-color-input span {\n border-color: rgba(42, 55, 70, 0.2);\n border-radius: 3px;\n border-style: solid;\n border-width: 1px;\n box-shadow: none;\n box-sizing: border-box;\n height: 24px;\n position: absolute;\n top: 6px;\n width: 24px;\n}\n.tox .tox-color-input span:hover:not([aria-disabled=true]),\n.tox .tox-color-input span:focus:not([aria-disabled=true]) {\n border-color: #207ab7;\n cursor: pointer;\n}\n.tox .tox-color-input span::before {\n background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.25) 25%, transparent 25%), linear-gradient(-45deg, rgba(255, 255, 255, 0.25) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(255, 255, 255, 0.25) 75%), linear-gradient(-45deg, transparent 75%, rgba(255, 255, 255, 0.25) 75%);\n background-position: 0 0, 0 6px, 6px -6px, -6px 0;\n background-size: 12px 12px;\n border: 1px solid #2b3b4e;\n border-radius: 3px;\n box-sizing: border-box;\n content: '';\n height: 24px;\n left: -1px;\n position: absolute;\n top: -1px;\n width: 24px;\n z-index: -1;\n}\n.tox .tox-color-input span[aria-disabled=true] {\n cursor: not-allowed;\n}\n.tox:not([dir=rtl]) .tox-color-input {\n /* stylelint-disable-next-line no-descending-specificity */\n}\n.tox:not([dir=rtl]) .tox-color-input .tox-textfield {\n padding-left: 36px;\n}\n.tox:not([dir=rtl]) .tox-color-input span {\n left: 6px;\n}\n.tox[dir=\"rtl\"] .tox-color-input {\n /* stylelint-disable-next-line no-descending-specificity */\n}\n.tox[dir=\"rtl\"] .tox-color-input .tox-textfield {\n padding-right: 36px;\n}\n.tox[dir=\"rtl\"] .tox-color-input span {\n right: 6px;\n}\n.tox .tox-label,\n.tox .tox-toolbar-label {\n color: rgba(255, 255, 255, 0.5);\n display: block;\n font-size: 14px;\n font-style: normal;\n font-weight: normal;\n line-height: 1.3;\n padding: 0 8px 0 0;\n text-transform: none;\n white-space: nowrap;\n}\n.tox .tox-toolbar-label {\n padding: 0 8px;\n}\n.tox[dir=rtl] .tox-label {\n padding: 0 0 0 8px;\n}\n.tox .tox-form {\n display: flex;\n flex: 1;\n flex-direction: column;\n -ms-flex-preferred-size: auto;\n}\n.tox .tox-form__group {\n box-sizing: border-box;\n margin-bottom: 4px;\n}\n.tox .tox-form-group--maximize {\n flex: 1;\n}\n.tox .tox-form__group--error {\n color: #c00;\n}\n.tox .tox-form__group--collection {\n display: flex;\n}\n.tox .tox-form__grid {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: space-between;\n}\n.tox .tox-form__grid--2col > .tox-form__group {\n width: calc(50% - (8px / 2));\n}\n.tox .tox-form__grid--3col > .tox-form__group {\n width: calc(100% / 3 - (8px / 2));\n}\n.tox .tox-form__grid--4col > .tox-form__group {\n width: calc(25% - (8px / 2));\n}\n.tox .tox-form__controls-h-stack {\n align-items: center;\n display: flex;\n}\n.tox .tox-form__group--inline {\n align-items: center;\n display: flex;\n}\n.tox .tox-form__group--stretched {\n display: flex;\n flex: 1;\n flex-direction: column;\n -ms-flex-preferred-size: auto;\n}\n.tox .tox-form__group--stretched .tox-textarea {\n flex: 1;\n -ms-flex-preferred-size: auto;\n}\n.tox .tox-form__group--stretched .tox-navobj {\n display: flex;\n flex: 1;\n -ms-flex-preferred-size: auto;\n}\n.tox .tox-form__group--stretched .tox-navobj :nth-child(2) {\n flex: 1;\n -ms-flex-preferred-size: auto;\n height: 100%;\n}\n.tox:not([dir=rtl]) .tox-form__controls-h-stack > *:not(:first-child) {\n margin-left: 4px;\n}\n.tox[dir=rtl] .tox-form__controls-h-stack > *:not(:first-child) {\n margin-right: 4px;\n}\n.tox .tox-lock.tox-locked .tox-lock-icon__unlock,\n.tox .tox-lock:not(.tox-locked) .tox-lock-icon__lock {\n display: none;\n}\n.tox .tox-textfield,\n.tox .tox-toolbar-textfield,\n.tox .tox-listboxfield .tox-listbox--select,\n.tox .tox-textarea {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n background-color: #2b3b4e;\n border-color: #000000;\n border-radius: 3px;\n border-style: solid;\n border-width: 1px;\n box-shadow: none;\n box-sizing: border-box;\n color: #fff;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n font-size: 16px;\n line-height: 24px;\n margin: 0;\n min-height: 34px;\n outline: none;\n padding: 5px 4.75px;\n resize: none;\n width: 100%;\n}\n.tox .tox-textfield[disabled],\n.tox .tox-textarea[disabled] {\n background-color: #222f3e;\n color: rgba(255, 255, 255, 0.85);\n cursor: not-allowed;\n}\n.tox .tox-textfield:focus,\n.tox .tox-listboxfield .tox-listbox--select:focus,\n.tox .tox-textarea:focus {\n background-color: #2b3b4e;\n border-color: #207ab7;\n box-shadow: none;\n outline: none;\n}\n.tox .tox-toolbar-textfield {\n border-width: 0;\n margin-bottom: 3px;\n margin-top: 2px;\n max-width: 250px;\n}\n.tox .tox-naked-btn {\n background-color: transparent;\n border: 0;\n border-color: transparent;\n box-shadow: unset;\n color: #207ab7;\n cursor: pointer;\n display: block;\n margin: 0;\n padding: 0;\n}\n.tox .tox-naked-btn svg {\n display: block;\n fill: #fff;\n}\n.tox:not([dir=rtl]) .tox-toolbar-textfield + * {\n margin-left: 4px;\n}\n.tox[dir=rtl] .tox-toolbar-textfield + * {\n margin-right: 4px;\n}\n.tox .tox-listboxfield {\n cursor: pointer;\n position: relative;\n}\n.tox .tox-listboxfield .tox-listbox--select[disabled] {\n background-color: #19232e;\n color: rgba(255, 255, 255, 0.85);\n cursor: not-allowed;\n}\n.tox .tox-listbox__select-label {\n cursor: default;\n flex: 1;\n margin: 0 4px;\n}\n.tox .tox-listbox__select-chevron {\n align-items: center;\n display: flex;\n justify-content: center;\n width: 16px;\n}\n.tox .tox-listbox__select-chevron svg {\n fill: #fff;\n}\n.tox .tox-listboxfield .tox-listbox--select {\n align-items: center;\n display: flex;\n}\n.tox:not([dir=rtl]) .tox-listboxfield svg {\n right: 8px;\n}\n.tox[dir=rtl] .tox-listboxfield svg {\n left: 8px;\n}\n.tox .tox-selectfield {\n cursor: pointer;\n position: relative;\n}\n.tox .tox-selectfield select {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n background-color: #2b3b4e;\n border-color: #000000;\n border-radius: 3px;\n border-style: solid;\n border-width: 1px;\n box-shadow: none;\n box-sizing: border-box;\n color: #fff;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n font-size: 16px;\n line-height: 24px;\n margin: 0;\n min-height: 34px;\n outline: none;\n padding: 5px 4.75px;\n resize: none;\n width: 100%;\n}\n.tox .tox-selectfield select[disabled] {\n background-color: #19232e;\n color: rgba(255, 255, 255, 0.85);\n cursor: not-allowed;\n}\n.tox .tox-selectfield select::-ms-expand {\n display: none;\n}\n.tox .tox-selectfield select:focus {\n background-color: #2b3b4e;\n border-color: #207ab7;\n box-shadow: none;\n outline: none;\n}\n.tox .tox-selectfield svg {\n pointer-events: none;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n}\n.tox:not([dir=rtl]) .tox-selectfield select[size=\"0\"],\n.tox:not([dir=rtl]) .tox-selectfield select[size=\"1\"] {\n padding-right: 24px;\n}\n.tox:not([dir=rtl]) .tox-selectfield svg {\n right: 8px;\n}\n.tox[dir=rtl] .tox-selectfield select[size=\"0\"],\n.tox[dir=rtl] .tox-selectfield select[size=\"1\"] {\n padding-left: 24px;\n}\n.tox[dir=rtl] .tox-selectfield svg {\n left: 8px;\n}\n.tox .tox-textarea {\n -webkit-appearance: textarea;\n -moz-appearance: textarea;\n appearance: textarea;\n white-space: pre-wrap;\n}\n.tox-fullscreen {\n border: 0;\n height: 100%;\n left: 0;\n margin: 0;\n overflow: hidden;\n -ms-scroll-chaining: none;\n overscroll-behavior: none;\n padding: 0;\n position: fixed;\n top: 0;\n touch-action: pinch-zoom;\n width: 100%;\n}\n.tox-fullscreen .tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle {\n display: none;\n}\n.tox-fullscreen .tox.tox-tinymce.tox-fullscreen {\n z-index: 1200;\n}\n.tox-fullscreen .tox.tox-tinymce-aux {\n z-index: 1201;\n}\n.tox .tox-help__more-link {\n list-style: none;\n margin-top: 1em;\n}\n.tox .tox-image-tools {\n width: 100%;\n}\n.tox .tox-image-tools__toolbar {\n align-items: center;\n display: flex;\n justify-content: center;\n}\n.tox .tox-image-tools__image {\n background-color: #666;\n height: 380px;\n overflow: auto;\n position: relative;\n width: 100%;\n}\n.tox .tox-image-tools__image,\n.tox .tox-image-tools__image + .tox-image-tools__toolbar {\n margin-top: 8px;\n}\n.tox .tox-image-tools__image-bg {\n background: url(data:image/gif;base64,R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw==);\n}\n.tox .tox-image-tools__toolbar > .tox-spacer {\n flex: 1;\n -ms-flex-preferred-size: auto;\n}\n.tox .tox-croprect-block {\n background: black;\n filter: alpha(opacity=50);\n opacity: 0.5;\n position: absolute;\n zoom: 1;\n}\n.tox .tox-croprect-handle {\n border: 2px solid white;\n height: 20px;\n left: 0;\n position: absolute;\n top: 0;\n width: 20px;\n}\n.tox .tox-croprect-handle-move {\n border: 0;\n cursor: move;\n position: absolute;\n}\n.tox .tox-croprect-handle-nw {\n border-width: 2px 0 0 2px;\n cursor: nw-resize;\n left: 100px;\n margin: -2px 0 0 -2px;\n top: 100px;\n}\n.tox .tox-croprect-handle-ne {\n border-width: 2px 2px 0 0;\n cursor: ne-resize;\n left: 200px;\n margin: -2px 0 0 -20px;\n top: 100px;\n}\n.tox .tox-croprect-handle-sw {\n border-width: 0 0 2px 2px;\n cursor: sw-resize;\n left: 100px;\n margin: -20px 2px 0 -2px;\n top: 200px;\n}\n.tox .tox-croprect-handle-se {\n border-width: 0 2px 2px 0;\n cursor: se-resize;\n left: 200px;\n margin: -20px 0 0 -20px;\n top: 200px;\n}\n.tox:not([dir=rtl]) .tox-image-tools__toolbar > .tox-slider:not(:first-of-type) {\n margin-left: 8px;\n}\n.tox:not([dir=rtl]) .tox-image-tools__toolbar > .tox-button + .tox-slider {\n margin-left: 32px;\n}\n.tox:not([dir=rtl]) .tox-image-tools__toolbar > .tox-slider + .tox-button {\n margin-left: 32px;\n}\n.tox[dir=rtl] .tox-image-tools__toolbar > .tox-slider:not(:first-of-type) {\n margin-right: 8px;\n}\n.tox[dir=rtl] .tox-image-tools__toolbar > .tox-button + .tox-slider {\n margin-right: 32px;\n}\n.tox[dir=rtl] .tox-image-tools__toolbar > .tox-slider + .tox-button {\n margin-right: 32px;\n}\n.tox .tox-insert-table-picker {\n display: flex;\n flex-wrap: wrap;\n width: 170px;\n}\n.tox .tox-insert-table-picker > div {\n border-color: #000000;\n border-style: solid;\n border-width: 0 1px 1px 0;\n box-sizing: border-box;\n height: 17px;\n width: 17px;\n}\n.tox .tox-collection--list .tox-collection__group .tox-insert-table-picker {\n margin: -4px 0;\n}\n.tox .tox-insert-table-picker .tox-insert-table-picker__selected {\n background-color: rgba(32, 122, 183, 0.5);\n border-color: rgba(32, 122, 183, 0.5);\n}\n.tox .tox-insert-table-picker__label {\n color: #fff;\n display: block;\n font-size: 14px;\n padding: 4px;\n text-align: center;\n width: 100%;\n}\n.tox:not([dir=rtl]) {\n /* stylelint-disable-next-line no-descending-specificity */\n}\n.tox:not([dir=rtl]) .tox-insert-table-picker > div:nth-child(10n) {\n border-right: 0;\n}\n.tox[dir=rtl] {\n /* stylelint-disable-next-line no-descending-specificity */\n}\n.tox[dir=rtl] .tox-insert-table-picker > div:nth-child(10n+1) {\n border-right: 0;\n}\n.tox {\n /* stylelint-disable */\n /* stylelint-enable */\n}\n.tox .tox-menu {\n background-color: #2b3b4e;\n border: 1px solid #000000;\n border-radius: 3px;\n box-shadow: 0 4px 8px 0 rgba(42, 55, 70, 0.1);\n display: inline-block;\n overflow: hidden;\n vertical-align: top;\n z-index: 1150;\n}\n.tox .tox-menu.tox-collection.tox-collection--list {\n padding: 0;\n}\n.tox .tox-menu.tox-collection.tox-collection--toolbar {\n padding: 4px;\n}\n.tox .tox-menu.tox-collection.tox-collection--grid {\n padding: 4px;\n}\n.tox .tox-menu__label h1,\n.tox .tox-menu__label h2,\n.tox .tox-menu__label h3,\n.tox .tox-menu__label h4,\n.tox .tox-menu__label h5,\n.tox .tox-menu__label h6,\n.tox .tox-menu__label p,\n.tox .tox-menu__label blockquote,\n.tox .tox-menu__label code {\n margin: 0;\n}\n.tox .tox-menubar {\n background: url(\"data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23000000'/%3E%3C/svg%3E\") left 0 top 0 #222f3e;\n background-color: #222f3e;\n display: flex;\n flex: 0 0 auto;\n flex-shrink: 0;\n flex-wrap: wrap;\n padding: 0 4px 0 4px;\n}\n.tox.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-menubar {\n border-top: 1px solid #000000;\n}\n/* Deprecated. Remove in next major release */\n.tox .tox-mbtn {\n align-items: center;\n background: transparent;\n border: 0;\n border-radius: 3px;\n box-shadow: none;\n color: #fff;\n display: flex;\n flex: 0 0 auto;\n font-size: 14px;\n font-style: normal;\n font-weight: normal;\n height: 34px;\n justify-content: center;\n margin: 2px 0 3px 0;\n outline: none;\n overflow: hidden;\n padding: 0 4px;\n text-transform: none;\n width: auto;\n}\n.tox .tox-mbtn[disabled] {\n background-color: transparent;\n border: 0;\n box-shadow: none;\n color: rgba(255, 255, 255, 0.5);\n cursor: not-allowed;\n}\n.tox .tox-mbtn:focus:not(:disabled) {\n background: #4a5562;\n border: 0;\n box-shadow: none;\n color: #fff;\n}\n.tox .tox-mbtn--active {\n background: #757d87;\n border: 0;\n box-shadow: none;\n color: #fff;\n}\n.tox .tox-mbtn:hover:not(:disabled):not(.tox-mbtn--active) {\n background: #4a5562;\n border: 0;\n box-shadow: none;\n color: #fff;\n}\n.tox .tox-mbtn__select-label {\n cursor: default;\n font-weight: normal;\n margin: 0 4px;\n}\n.tox .tox-mbtn[disabled] .tox-mbtn__select-label {\n cursor: not-allowed;\n}\n.tox .tox-mbtn__select-chevron {\n align-items: center;\n display: flex;\n justify-content: center;\n width: 16px;\n display: none;\n}\n.tox .tox-notification {\n border-radius: 3px;\n border-style: solid;\n border-width: 1px;\n box-shadow: none;\n box-sizing: border-box;\n display: -ms-grid;\n display: grid;\n font-size: 14px;\n font-weight: normal;\n -ms-grid-columns: minmax(40px, 1fr) auto minmax(40px, 1fr);\n grid-template-columns: minmax(40px, 1fr) auto minmax(40px, 1fr);\n margin-top: 4px;\n opacity: 0;\n padding: 4px;\n transition: transform 100ms ease-in, opacity 150ms ease-in;\n}\n.tox .tox-notification p {\n font-size: 14px;\n font-weight: normal;\n}\n.tox .tox-notification a {\n text-decoration: underline;\n}\n.tox .tox-notification--in {\n opacity: 1;\n}\n.tox .tox-notification--success {\n background-color: #e4eeda;\n border-color: #d7e6c8;\n color: #fff;\n}\n.tox .tox-notification--success p {\n color: #fff;\n}\n.tox .tox-notification--success a {\n color: #547831;\n}\n.tox .tox-notification--success svg {\n fill: #fff;\n}\n.tox .tox-notification--error {\n background-color: #f8dede;\n border-color: #f2bfbf;\n color: #fff;\n}\n.tox .tox-notification--error p {\n color: #fff;\n}\n.tox .tox-notification--error a {\n color: #c00;\n}\n.tox .tox-notification--error svg {\n fill: #fff;\n}\n.tox .tox-notification--warn,\n.tox .tox-notification--warning {\n background-color: #fffaea;\n border-color: #ffe89d;\n color: #fff;\n}\n.tox .tox-notification--warn p,\n.tox .tox-notification--warning p {\n color: #fff;\n}\n.tox .tox-notification--warn a,\n.tox .tox-notification--warning a {\n color: #fff;\n}\n.tox .tox-notification--warn svg,\n.tox .tox-notification--warning svg {\n fill: #fff;\n}\n.tox .tox-notification--info {\n background-color: #d9edf7;\n border-color: #779ecb;\n color: #fff;\n}\n.tox .tox-notification--info p {\n color: #fff;\n}\n.tox .tox-notification--info a {\n color: #fff;\n}\n.tox .tox-notification--info svg {\n fill: #fff;\n}\n.tox .tox-notification__body {\n -ms-grid-row-align: center;\n align-self: center;\n color: #fff;\n font-size: 14px;\n -ms-grid-column-span: 1;\n grid-column-end: 3;\n -ms-grid-column: 2;\n grid-column-start: 2;\n -ms-grid-row-span: 1;\n grid-row-end: 2;\n -ms-grid-row: 1;\n grid-row-start: 1;\n text-align: center;\n white-space: normal;\n word-break: break-all;\n word-break: break-word;\n}\n.tox .tox-notification__body > * {\n margin: 0;\n}\n.tox .tox-notification__body > * + * {\n margin-top: 1rem;\n}\n.tox .tox-notification__icon {\n -ms-grid-row-align: center;\n align-self: center;\n -ms-grid-column-span: 1;\n grid-column-end: 2;\n -ms-grid-column: 1;\n grid-column-start: 1;\n -ms-grid-row-span: 1;\n grid-row-end: 2;\n -ms-grid-row: 1;\n grid-row-start: 1;\n -ms-grid-column-align: end;\n justify-self: end;\n}\n.tox .tox-notification__icon svg {\n display: block;\n}\n.tox .tox-notification__dismiss {\n -ms-grid-row-align: start;\n align-self: start;\n -ms-grid-column-span: 1;\n grid-column-end: 4;\n -ms-grid-column: 3;\n grid-column-start: 3;\n -ms-grid-row-span: 1;\n grid-row-end: 2;\n -ms-grid-row: 1;\n grid-row-start: 1;\n -ms-grid-column-align: end;\n justify-self: end;\n}\n.tox .tox-notification .tox-progress-bar {\n -ms-grid-column-span: 3;\n grid-column-end: 4;\n -ms-grid-column: 1;\n grid-column-start: 1;\n -ms-grid-row-span: 1;\n grid-row-end: 3;\n -ms-grid-row: 2;\n grid-row-start: 2;\n -ms-grid-column-align: center;\n justify-self: center;\n}\n.tox .tox-pop {\n display: inline-block;\n position: relative;\n}\n.tox .tox-pop--resizing {\n transition: width 0.1s ease;\n}\n.tox .tox-pop--resizing .tox-toolbar {\n flex-wrap: nowrap;\n}\n.tox .tox-pop__dialog {\n background-color: #222f3e;\n border: 1px solid #000000;\n border-radius: 3px;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);\n min-width: 0;\n overflow: hidden;\n}\n.tox .tox-pop__dialog > *:not(.tox-toolbar) {\n margin: 4px 4px 4px 8px;\n}\n.tox .tox-pop__dialog .tox-toolbar {\n background-color: transparent;\n margin-bottom: -1px;\n}\n.tox .tox-pop::before,\n.tox .tox-pop::after {\n border-style: solid;\n content: '';\n display: block;\n height: 0;\n position: absolute;\n width: 0;\n}\n.tox .tox-pop.tox-pop--bottom::before,\n.tox .tox-pop.tox-pop--bottom::after {\n left: 50%;\n top: 100%;\n}\n.tox .tox-pop.tox-pop--bottom::after {\n border-color: #222f3e transparent transparent transparent;\n border-width: 8px;\n margin-left: -8px;\n margin-top: -1px;\n}\n.tox .tox-pop.tox-pop--bottom::before {\n border-color: #000000 transparent transparent transparent;\n border-width: 9px;\n margin-left: -9px;\n}\n.tox .tox-pop.tox-pop--top::before,\n.tox .tox-pop.tox-pop--top::after {\n left: 50%;\n top: 0;\n transform: translateY(-100%);\n}\n.tox .tox-pop.tox-pop--top::after {\n border-color: transparent transparent #222f3e transparent;\n border-width: 8px;\n margin-left: -8px;\n margin-top: 1px;\n}\n.tox .tox-pop.tox-pop--top::before {\n border-color: transparent transparent #000000 transparent;\n border-width: 9px;\n margin-left: -9px;\n}\n.tox .tox-pop.tox-pop--left::before,\n.tox .tox-pop.tox-pop--left::after {\n left: 0;\n top: calc(50% - 1px);\n transform: translateY(-50%);\n}\n.tox .tox-pop.tox-pop--left::after {\n border-color: transparent #222f3e transparent transparent;\n border-width: 8px;\n margin-left: -15px;\n}\n.tox .tox-pop.tox-pop--left::before {\n border-color: transparent #000000 transparent transparent;\n border-width: 10px;\n margin-left: -19px;\n}\n.tox .tox-pop.tox-pop--right::before,\n.tox .tox-pop.tox-pop--right::after {\n left: 100%;\n top: calc(50% + 1px);\n transform: translateY(-50%);\n}\n.tox .tox-pop.tox-pop--right::after {\n border-color: transparent transparent transparent #222f3e;\n border-width: 8px;\n margin-left: -1px;\n}\n.tox .tox-pop.tox-pop--right::before {\n border-color: transparent transparent transparent #000000;\n border-width: 10px;\n margin-left: -1px;\n}\n.tox .tox-pop.tox-pop--align-left::before,\n.tox .tox-pop.tox-pop--align-left::after {\n left: 20px;\n}\n.tox .tox-pop.tox-pop--align-right::before,\n.tox .tox-pop.tox-pop--align-right::after {\n left: calc(100% - 20px);\n}\n.tox .tox-sidebar-wrap {\n display: flex;\n flex-direction: row;\n flex-grow: 1;\n -ms-flex-preferred-size: 0;\n min-height: 0;\n}\n.tox .tox-sidebar {\n background-color: #222f3e;\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n}\n.tox .tox-sidebar__slider {\n display: flex;\n overflow: hidden;\n}\n.tox .tox-sidebar__pane-container {\n display: flex;\n}\n.tox .tox-sidebar__pane {\n display: flex;\n}\n.tox .tox-sidebar--sliding-closed {\n opacity: 0;\n}\n.tox .tox-sidebar--sliding-open {\n opacity: 1;\n}\n.tox .tox-sidebar--sliding-growing,\n.tox .tox-sidebar--sliding-shrinking {\n transition: width 0.5s ease, opacity 0.5s ease;\n}\n.tox .tox-selector {\n background-color: #4099ff;\n border-color: #4099ff;\n border-style: solid;\n border-width: 1px;\n box-sizing: border-box;\n display: inline-block;\n height: 10px;\n position: absolute;\n width: 10px;\n}\n.tox.tox-platform-touch .tox-selector {\n height: 12px;\n width: 12px;\n}\n.tox .tox-slider {\n align-items: center;\n display: flex;\n flex: 1;\n -ms-flex-preferred-size: auto;\n height: 24px;\n justify-content: center;\n position: relative;\n}\n.tox .tox-slider__rail {\n background-color: transparent;\n border: 1px solid #000000;\n border-radius: 3px;\n height: 10px;\n min-width: 120px;\n width: 100%;\n}\n.tox .tox-slider__handle {\n background-color: #207ab7;\n border: 2px solid #185d8c;\n border-radius: 3px;\n box-shadow: none;\n height: 24px;\n left: 50%;\n position: absolute;\n top: 50%;\n transform: translateX(-50%) translateY(-50%);\n width: 14px;\n}\n.tox .tox-source-code {\n overflow: auto;\n}\n.tox .tox-spinner {\n display: flex;\n}\n.tox .tox-spinner > div {\n animation: tam-bouncing-dots 1.5s ease-in-out 0s infinite both;\n background-color: rgba(255, 255, 255, 0.5);\n border-radius: 100%;\n height: 8px;\n width: 8px;\n}\n.tox .tox-spinner > div:nth-child(1) {\n animation-delay: -0.32s;\n}\n.tox .tox-spinner > div:nth-child(2) {\n animation-delay: -0.16s;\n}\n@keyframes tam-bouncing-dots {\n 0%,\n 80%,\n 100% {\n transform: scale(0);\n }\n 40% {\n transform: scale(1);\n }\n}\n.tox:not([dir=rtl]) .tox-spinner > div:not(:first-child) {\n margin-left: 4px;\n}\n.tox[dir=rtl] .tox-spinner > div:not(:first-child) {\n margin-right: 4px;\n}\n.tox .tox-statusbar {\n align-items: center;\n background-color: #222f3e;\n border-top: 1px solid #000000;\n color: #fff;\n display: flex;\n flex: 0 0 auto;\n font-size: 12px;\n font-weight: normal;\n height: 18px;\n overflow: hidden;\n padding: 0 8px;\n position: relative;\n text-transform: uppercase;\n}\n.tox .tox-statusbar__text-container {\n display: flex;\n flex: 1 1 auto;\n justify-content: flex-end;\n overflow: hidden;\n}\n.tox .tox-statusbar__path {\n display: flex;\n flex: 1 1 auto;\n margin-right: auto;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.tox .tox-statusbar__path > * {\n display: inline;\n white-space: nowrap;\n}\n.tox .tox-statusbar__wordcount {\n flex: 0 0 auto;\n margin-left: 1ch;\n}\n.tox .tox-statusbar a,\n.tox .tox-statusbar__path-item,\n.tox .tox-statusbar__wordcount {\n color: #fff;\n text-decoration: none;\n}\n.tox .tox-statusbar a:hover:not(:disabled):not([aria-disabled=true]),\n.tox .tox-statusbar__path-item:hover:not(:disabled):not([aria-disabled=true]),\n.tox .tox-statusbar__wordcount:hover:not(:disabled):not([aria-disabled=true]),\n.tox .tox-statusbar a:focus:not(:disabled):not([aria-disabled=true]),\n.tox .tox-statusbar__path-item:focus:not(:disabled):not([aria-disabled=true]),\n.tox .tox-statusbar__wordcount:focus:not(:disabled):not([aria-disabled=true]) {\n cursor: pointer;\n text-decoration: underline;\n}\n.tox .tox-statusbar__resize-handle {\n align-items: flex-end;\n align-self: stretch;\n cursor: nwse-resize;\n display: flex;\n flex: 0 0 auto;\n justify-content: flex-end;\n margin-left: auto;\n margin-right: -8px;\n padding-left: 1ch;\n}\n.tox .tox-statusbar__resize-handle svg {\n display: block;\n fill: #fff;\n}\n.tox:not([dir=rtl]) .tox-statusbar__path > * {\n margin-right: 4px;\n}\n.tox:not([dir=rtl]) .tox-statusbar__branding {\n margin-left: 1ch;\n}\n.tox[dir=rtl] .tox-statusbar {\n flex-direction: row-reverse;\n}\n.tox[dir=rtl] .tox-statusbar__path > * {\n margin-left: 4px;\n}\n.tox .tox-throbber {\n z-index: 1400;\n}\n.tox .tox-throbber__busy-spinner {\n align-items: center;\n background-color: rgba(34, 47, 62, 0.6);\n bottom: 0;\n display: flex;\n justify-content: center;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n}\n.tox .tox-tbtn {\n align-items: center;\n background: transparent;\n border: 0;\n border-radius: 3px;\n box-shadow: none;\n color: #fff;\n display: flex;\n flex: 0 0 auto;\n font-size: 14px;\n font-style: normal;\n font-weight: normal;\n height: 34px;\n justify-content: center;\n margin: 2px 0 3px 0;\n outline: none;\n overflow: hidden;\n padding: 0;\n text-transform: none;\n width: 34px;\n}\n.tox .tox-tbtn svg {\n display: block;\n fill: #fff;\n}\n.tox .tox-tbtn.tox-tbtn-more {\n padding-left: 5px;\n padding-right: 5px;\n width: inherit;\n}\n.tox .tox-tbtn:focus {\n background: #4a5562;\n border: 0;\n box-shadow: none;\n}\n.tox .tox-tbtn:hover {\n background: #4a5562;\n border: 0;\n box-shadow: none;\n color: #fff;\n}\n.tox .tox-tbtn:hover svg {\n fill: #fff;\n}\n.tox .tox-tbtn:active {\n background: #757d87;\n border: 0;\n box-shadow: none;\n color: #fff;\n}\n.tox .tox-tbtn:active svg {\n fill: #fff;\n}\n.tox .tox-tbtn--disabled,\n.tox .tox-tbtn--disabled:hover,\n.tox .tox-tbtn:disabled,\n.tox .tox-tbtn:disabled:hover {\n background: transparent;\n border: 0;\n box-shadow: none;\n color: rgba(255, 255, 255, 0.5);\n cursor: not-allowed;\n}\n.tox .tox-tbtn--disabled svg,\n.tox .tox-tbtn--disabled:hover svg,\n.tox .tox-tbtn:disabled svg,\n.tox .tox-tbtn:disabled:hover svg {\n /* stylelint-disable-line no-descending-specificity */\n fill: rgba(255, 255, 255, 0.5);\n}\n.tox .tox-tbtn--enabled,\n.tox .tox-tbtn--enabled:hover {\n background: #757d87;\n border: 0;\n box-shadow: none;\n color: #fff;\n}\n.tox .tox-tbtn--enabled > *,\n.tox .tox-tbtn--enabled:hover > * {\n transform: none;\n}\n.tox .tox-tbtn--enabled svg,\n.tox .tox-tbtn--enabled:hover svg {\n /* stylelint-disable-line no-descending-specificity */\n fill: #fff;\n}\n.tox .tox-tbtn:focus:not(.tox-tbtn--disabled) {\n color: #fff;\n}\n.tox .tox-tbtn:focus:not(.tox-tbtn--disabled) svg {\n fill: #fff;\n}\n.tox .tox-tbtn:active > * {\n transform: none;\n}\n.tox .tox-tbtn--md {\n height: 51px;\n width: 51px;\n}\n.tox .tox-tbtn--lg {\n flex-direction: column;\n height: 68px;\n width: 68px;\n}\n.tox .tox-tbtn--return {\n -ms-grid-row-align: stretch;\n align-self: stretch;\n height: unset;\n width: 16px;\n}\n.tox .tox-tbtn--labeled {\n padding: 0 4px;\n width: unset;\n}\n.tox .tox-tbtn__vlabel {\n display: block;\n font-size: 10px;\n font-weight: normal;\n letter-spacing: -0.025em;\n margin-bottom: 4px;\n white-space: nowrap;\n}\n.tox .tox-tbtn--select {\n margin: 2px 0 3px 0;\n padding: 0 4px;\n width: auto;\n}\n.tox .tox-tbtn__select-label {\n cursor: default;\n font-weight: normal;\n margin: 0 4px;\n}\n.tox .tox-tbtn__select-chevron {\n align-items: center;\n display: flex;\n justify-content: center;\n width: 16px;\n}\n.tox .tox-tbtn__select-chevron svg {\n fill: rgba(255, 255, 255, 0.5);\n}\n.tox .tox-tbtn--bespoke .tox-tbtn__select-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n width: 7em;\n}\n.tox .tox-split-button {\n border: 0;\n border-radius: 3px;\n box-sizing: border-box;\n display: flex;\n margin: 2px 0 3px 0;\n overflow: hidden;\n}\n.tox .tox-split-button:hover {\n box-shadow: 0 0 0 1px #4a5562 inset;\n}\n.tox .tox-split-button:focus {\n background: #4a5562;\n box-shadow: none;\n color: #fff;\n}\n.tox .tox-split-button > * {\n border-radius: 0;\n}\n.tox .tox-split-button__chevron {\n width: 16px;\n}\n.tox .tox-split-button__chevron svg {\n fill: rgba(255, 255, 255, 0.5);\n}\n.tox .tox-split-button .tox-tbtn {\n margin: 0;\n}\n.tox.tox-platform-touch .tox-split-button .tox-tbtn:first-child {\n width: 30px;\n}\n.tox.tox-platform-touch .tox-split-button__chevron {\n width: 20px;\n}\n.tox .tox-split-button.tox-tbtn--disabled:hover,\n.tox .tox-split-button.tox-tbtn--disabled:focus,\n.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:hover,\n.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:focus {\n background: transparent;\n box-shadow: none;\n color: rgba(255, 255, 255, 0.5);\n}\n.tox .tox-toolbar-overlord {\n background-color: #222f3e;\n}\n.tox .tox-toolbar,\n.tox .tox-toolbar__primary,\n.tox .tox-toolbar__overflow {\n background: url(\"data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23000000'/%3E%3C/svg%3E\") left 0 top 0 #222f3e;\n background-color: #222f3e;\n display: flex;\n flex: 0 0 auto;\n flex-shrink: 0;\n flex-wrap: wrap;\n padding: 0 0;\n}\n.tox .tox-toolbar__overflow.tox-toolbar__overflow--closed {\n height: 0;\n opacity: 0;\n padding-bottom: 0;\n padding-top: 0;\n visibility: hidden;\n}\n.tox .tox-toolbar__overflow--growing {\n transition: height 0.3s ease, opacity 0.2s linear 0.1s;\n}\n.tox .tox-toolbar__overflow--shrinking {\n transition: opacity 0.3s ease, height 0.2s linear 0.1s, visibility 0s linear 0.3s;\n}\n.tox .tox-menubar + .tox-toolbar,\n.tox .tox-menubar + .tox-toolbar-overlord .tox-toolbar__primary {\n border-top: 1px solid #000000;\n margin-top: -1px;\n}\n.tox .tox-toolbar--scrolling {\n flex-wrap: nowrap;\n overflow-x: auto;\n}\n.tox .tox-pop .tox-toolbar {\n border-width: 0;\n}\n.tox .tox-toolbar--no-divider {\n background-image: none;\n}\n.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar:first-child,\n.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar-overlord:first-child .tox-toolbar__primary {\n border-top: 1px solid #000000;\n}\n.tox.tox-tinymce-aux .tox-toolbar__overflow {\n background-color: #222f3e;\n border: 1px solid #000000;\n border-radius: 3px;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);\n}\n.tox[dir=rtl] .tox-tbtn__icon-rtl svg {\n transform: rotateY(180deg);\n}\n.tox .tox-toolbar__group {\n align-items: center;\n display: flex;\n flex-wrap: wrap;\n margin: 0 0;\n padding: 0 4px 0 4px;\n}\n.tox .tox-toolbar__group--pull-right {\n margin-left: auto;\n}\n.tox .tox-toolbar--scrolling .tox-toolbar__group {\n flex-shrink: 0;\n flex-wrap: nowrap;\n}\n.tox:not([dir=rtl]) .tox-toolbar__group:not(:last-of-type) {\n border-right: 1px solid #000000;\n}\n.tox[dir=rtl] .tox-toolbar__group:not(:last-of-type) {\n border-left: 1px solid #000000;\n}\n.tox .tox-tooltip {\n display: inline-block;\n padding: 8px;\n position: relative;\n}\n.tox .tox-tooltip__body {\n background-color: #3d546f;\n border-radius: 3px;\n box-shadow: 0 2px 4px rgba(42, 55, 70, 0.3);\n color: rgba(255, 255, 255, 0.75);\n font-size: 14px;\n font-style: normal;\n font-weight: normal;\n padding: 4px 8px;\n text-transform: none;\n}\n.tox .tox-tooltip__arrow {\n position: absolute;\n}\n.tox .tox-tooltip--down .tox-tooltip__arrow {\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-top: 8px solid #3d546f;\n bottom: 0;\n left: 50%;\n position: absolute;\n transform: translateX(-50%);\n}\n.tox .tox-tooltip--up .tox-tooltip__arrow {\n border-bottom: 8px solid #3d546f;\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n left: 50%;\n position: absolute;\n top: 0;\n transform: translateX(-50%);\n}\n.tox .tox-tooltip--right .tox-tooltip__arrow {\n border-bottom: 8px solid transparent;\n border-left: 8px solid #3d546f;\n border-top: 8px solid transparent;\n position: absolute;\n right: 0;\n top: 50%;\n transform: translateY(-50%);\n}\n.tox .tox-tooltip--left .tox-tooltip__arrow {\n border-bottom: 8px solid transparent;\n border-right: 8px solid #3d546f;\n border-top: 8px solid transparent;\n left: 0;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n}\n.tox .tox-well {\n border: 1px solid #000000;\n border-radius: 3px;\n padding: 8px;\n width: 100%;\n}\n.tox .tox-well > *:first-child {\n margin-top: 0;\n}\n.tox .tox-well > *:last-child {\n margin-bottom: 0;\n}\n.tox .tox-well > *:only-child {\n margin: 0;\n}\n.tox .tox-custom-editor {\n border: 1px solid #000000;\n border-radius: 3px;\n display: flex;\n flex: 1;\n position: relative;\n}\n/* stylelint-disable */\n.tox {\n /* stylelint-enable */\n}\n.tox .tox-dialog-loading::before {\n background-color: rgba(0, 0, 0, 0.5);\n content: \"\";\n height: 100%;\n position: absolute;\n width: 100%;\n z-index: 1000;\n}\n.tox .tox-tab {\n cursor: pointer;\n}\n.tox .tox-dialog__content-js {\n display: flex;\n flex: 1;\n -ms-flex-preferred-size: auto;\n}\n.tox .tox-dialog__body-content .tox-collection {\n display: flex;\n flex: 1;\n -ms-flex-preferred-size: auto;\n}\n.tox .tox-image-tools-edit-panel {\n height: 60px;\n}\n.tox .tox-image-tools__sidebar {\n height: 60px;\n}\n"]} \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.mobile.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.mobile.css deleted file mode 100644 index 875721a27d02..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.mobile.css +++ /dev/null @@ -1,673 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ -/* RESET all the things! */ -.tinymce-mobile-outer-container { - all: initial; - display: block; -} -.tinymce-mobile-outer-container * { - border: 0; - box-sizing: initial; - cursor: inherit; - float: none; - line-height: 1; - margin: 0; - outline: 0; - padding: 0; - -webkit-tap-highlight-color: transparent; - /* TBIO-3691, stop the gray flicker on touch. */ - text-shadow: none; - white-space: nowrap; -} -.tinymce-mobile-icon-arrow-back::before { - content: "\e5cd"; -} -.tinymce-mobile-icon-image::before { - content: "\e412"; -} -.tinymce-mobile-icon-cancel-circle::before { - content: "\e5c9"; -} -.tinymce-mobile-icon-full-dot::before { - content: "\e061"; -} -.tinymce-mobile-icon-align-center::before { - content: "\e234"; -} -.tinymce-mobile-icon-align-left::before { - content: "\e236"; -} -.tinymce-mobile-icon-align-right::before { - content: "\e237"; -} -.tinymce-mobile-icon-bold::before { - content: "\e238"; -} -.tinymce-mobile-icon-italic::before { - content: "\e23f"; -} -.tinymce-mobile-icon-unordered-list::before { - content: "\e241"; -} -.tinymce-mobile-icon-ordered-list::before { - content: "\e242"; -} -.tinymce-mobile-icon-font-size::before { - content: "\e245"; -} -.tinymce-mobile-icon-underline::before { - content: "\e249"; -} -.tinymce-mobile-icon-link::before { - content: "\e157"; -} -.tinymce-mobile-icon-unlink::before { - content: "\eca2"; -} -.tinymce-mobile-icon-color::before { - content: "\e891"; -} -.tinymce-mobile-icon-previous::before { - content: "\e314"; -} -.tinymce-mobile-icon-next::before { - content: "\e315"; -} -.tinymce-mobile-icon-large-font::before, -.tinymce-mobile-icon-style-formats::before { - content: "\e264"; -} -.tinymce-mobile-icon-undo::before { - content: "\e166"; -} -.tinymce-mobile-icon-redo::before { - content: "\e15a"; -} -.tinymce-mobile-icon-removeformat::before { - content: "\e239"; -} -.tinymce-mobile-icon-small-font::before { - content: "\e906"; -} -.tinymce-mobile-icon-readonly-back::before, -.tinymce-mobile-format-matches::after { - content: "\e5ca"; -} -.tinymce-mobile-icon-small-heading::before { - content: "small"; -} -.tinymce-mobile-icon-large-heading::before { - content: "large"; -} -.tinymce-mobile-icon-small-heading::before, -.tinymce-mobile-icon-large-heading::before { - font-family: sans-serif; - font-size: 80%; -} -.tinymce-mobile-mask-edit-icon::before { - content: "\e254"; -} -.tinymce-mobile-icon-back::before { - content: "\e5c4"; -} -.tinymce-mobile-icon-heading::before { - /* TODO: Translate */ - content: "Headings"; - font-family: sans-serif; - font-size: 80%; - font-weight: bold; -} -.tinymce-mobile-icon-h1::before { - content: "H1"; - font-weight: bold; -} -.tinymce-mobile-icon-h2::before { - content: "H2"; - font-weight: bold; -} -.tinymce-mobile-icon-h3::before { - content: "H3"; - font-weight: bold; -} -.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask { - align-items: center; - display: flex; - justify-content: center; - background: rgba(51, 51, 51, 0.5); - height: 100%; - position: absolute; - top: 0; - width: 100%; -} -.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container { - align-items: center; - border-radius: 50%; - display: flex; - flex-direction: column; - font-family: sans-serif; - font-size: 1em; - justify-content: space-between; -} -.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .mixin-menu-item { - align-items: center; - display: flex; - justify-content: center; - border-radius: 50%; - height: 2.1em; - width: 2.1em; -} -.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section { - align-items: center; - display: flex; - justify-content: center; - flex-direction: column; - font-size: 1em; -} -@media only screen and (min-device-width:700px) { - .tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section { - font-size: 1.2em; - } -} -.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon { - align-items: center; - display: flex; - justify-content: center; - border-radius: 50%; - height: 2.1em; - width: 2.1em; - background-color: white; - color: #207ab7; -} -.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon::before { - content: "\e900"; - font-family: 'tinymce-mobile', sans-serif; -} -.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section:not(.tinymce-mobile-mask-tap-icon-selected) .tinymce-mobile-mask-tap-icon { - z-index: 2; -} -.tinymce-mobile-android-container.tinymce-mobile-android-maximized { - background: #ffffff; - border: none; - bottom: 0; - display: flex; - flex-direction: column; - left: 0; - position: fixed; - right: 0; - top: 0; -} -.tinymce-mobile-android-container:not(.tinymce-mobile-android-maximized) { - position: relative; -} -.tinymce-mobile-android-container .tinymce-mobile-editor-socket { - display: flex; - flex-grow: 1; -} -.tinymce-mobile-android-container .tinymce-mobile-editor-socket iframe { - display: flex !important; - flex-grow: 1; - height: auto !important; -} -.tinymce-mobile-android-scroll-reload { - overflow: hidden; -} -:not(.tinymce-mobile-readonly-mode) > .tinymce-mobile-android-selection-context-toolbar { - margin-top: 23px; -} -.tinymce-mobile-toolstrip { - background: #fff; - display: flex; - flex: 0 0 auto; - z-index: 1; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar { - align-items: center; - background-color: #fff; - border-bottom: 1px solid #cccccc; - display: flex; - flex: 1; - height: 2.5em; - width: 100%; - /* Make it no larger than the toolstrip, so that it needs to scroll */ -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group { - align-items: center; - display: flex; - height: 100%; - flex-shrink: 1; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group > div { - align-items: center; - display: flex; - height: 100%; - flex: 1; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-exit-container { - background: #f44336; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-toolbar-scrollable-group { - flex-grow: 1; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item { - padding-left: 0.5em; - padding-right: 0.5em; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button { - align-items: center; - display: flex; - height: 80%; - margin-left: 2px; - margin-right: 2px; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button.tinymce-mobile-toolbar-button-selected { - background: #c8cbcf; - color: #cccccc; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:first-of-type, -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:last-of-type { - background: #207ab7; - color: #eceff1; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar { - /* Note, this file is imported inside .tinymce-mobile-context-toolbar, so that prefix is on everything here. */ -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group { - align-items: center; - display: flex; - height: 100%; - flex: 1; - padding-bottom: 0.4em; - padding-top: 0.4em; - /* Make any buttons appearing on the left and right display in the centre (e.g. color edges) */ - /* For widgets like the colour picker, use the whole height */ -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog { - display: flex; - min-height: 1.5em; - overflow: hidden; - padding-left: 0; - padding-right: 0; - position: relative; - width: 100%; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain { - display: flex; - height: 100%; - transition: left cubic-bezier(0.4, 0, 1, 1) 0.15s; - width: 100%; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen { - display: flex; - flex: 0 0 auto; - justify-content: space-between; - width: 100%; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen input { - font-family: Sans-serif; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container { - display: flex; - flex-grow: 1; - position: relative; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container .tinymce-mobile-input-container-x { - -ms-grid-row-align: center; - align-self: center; - background: inherit; - border: none; - border-radius: 50%; - color: #888; - font-size: 0.6em; - font-weight: bold; - height: 100%; - padding-right: 2px; - position: absolute; - right: 0; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container.tinymce-mobile-input-container-empty .tinymce-mobile-input-container-x { - display: none; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous, -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next { - align-items: center; - display: flex; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous::before, -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next::before { - align-items: center; - display: flex; - font-weight: bold; - height: 100%; - padding-left: 0.5em; - padding-right: 0.5em; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous.tinymce-mobile-toolbar-navigation-disabled::before, -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next.tinymce-mobile-toolbar-navigation-disabled::before { - visibility: hidden; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item { - color: #cccccc; - font-size: 10px; - line-height: 10px; - margin: 0 2px; - padding-top: 3px; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item.tinymce-mobile-dot-active { - color: #c8cbcf; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-font::before, -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-heading::before { - margin-left: 0.5em; - margin-right: 0.9em; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-font::before, -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-heading::before { - margin-left: 0.9em; - margin-right: 0.5em; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider { - display: flex; - flex: 1; - margin-left: 0; - margin-right: 0; - padding: 0.28em 0; - position: relative; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container { - align-items: center; - display: flex; - flex-grow: 1; - height: 100%; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container .tinymce-mobile-slider-size-line { - background: #cccccc; - display: flex; - flex: 1; - height: 0.2em; - margin-bottom: 0.3em; - margin-top: 0.3em; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container { - padding-left: 2em; - padding-right: 2em; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container { - align-items: center; - display: flex; - flex-grow: 1; - height: 100%; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container .tinymce-mobile-slider-gradient { - background: linear-gradient(to right, hsl(0, 100%, 50%) 0%, hsl(60, 100%, 50%) 17%, hsl(120, 100%, 50%) 33%, hsl(180, 100%, 50%) 50%, hsl(240, 100%, 50%) 67%, hsl(300, 100%, 50%) 83%, hsl(0, 100%, 50%) 100%); - display: flex; - flex: 1; - height: 0.2em; - margin-bottom: 0.3em; - margin-top: 0.3em; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-black { - /* Not part of theming */ - background: black; - height: 0.2em; - margin-bottom: 0.3em; - margin-top: 0.3em; - width: 1.2em; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-white { - /* Not part of theming */ - background: white; - height: 0.2em; - margin-bottom: 0.3em; - margin-top: 0.3em; - width: 1.2em; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb { - /* vertically centering trick (margin: auto, top: 0, bottom: 0). On iOS and Safari, if you leave - * out these values, then it shows the thumb at the top of the spectrum. This is probably because it is - * absolutely positioned with only a left value, and not a top. Note, on Chrome it seems to be fine without - * this approach. - */ - align-items: center; - background-clip: padding-box; - background-color: #455a64; - border: 0.5em solid rgba(136, 136, 136, 0); - border-radius: 3em; - bottom: 0; - color: #fff; - display: flex; - height: 0.5em; - justify-content: center; - left: -10px; - margin: auto; - position: absolute; - top: 0; - transition: border 120ms cubic-bezier(0.39, 0.58, 0.57, 1); - width: 0.5em; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb.tinymce-mobile-thumb-active { - border: 0.5em solid rgba(136, 136, 136, 0.39); -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper, -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group > div { - align-items: center; - display: flex; - height: 100%; - flex: 1; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper { - flex-direction: column; - justify-content: center; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item { - align-items: center; - display: flex; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item:not(.tinymce-mobile-serialised-dialog) { - height: 100%; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-container { - display: flex; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input { - background: #ffffff; - border: none; - border-radius: 0; - color: #455a64; - flex-grow: 1; - font-size: 0.85em; - padding-bottom: 0.1em; - padding-left: 5px; - padding-top: 0.1em; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::-webkit-input-placeholder { - /* WebKit, Blink, Edge */ - color: #888; -} -.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::placeholder { - /* WebKit, Blink, Edge */ - color: #888; -} -/* dropup */ -.tinymce-mobile-dropup { - background: white; - display: flex; - overflow: hidden; - width: 100%; -} -.tinymce-mobile-dropup.tinymce-mobile-dropup-shrinking { - transition: height 0.3s ease-out; -} -.tinymce-mobile-dropup.tinymce-mobile-dropup-growing { - transition: height 0.3s ease-in; -} -.tinymce-mobile-dropup.tinymce-mobile-dropup-closed { - flex-grow: 0; -} -.tinymce-mobile-dropup.tinymce-mobile-dropup-open:not(.tinymce-mobile-dropup-growing) { - flex-grow: 1; -} -/* TODO min-height for device size and orientation */ -.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) { - min-height: 200px; -} -@media only screen and (orientation: landscape) { - .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) { - min-height: 200px; - } -} -@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : landscape) { - .tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) { - min-height: 150px; - } -} -/* styles menu */ -.tinymce-mobile-styles-menu { - font-family: sans-serif; - outline: 4px solid black; - overflow: hidden; - position: relative; - width: 100%; -} -.tinymce-mobile-styles-menu [role="menu"] { - display: flex; - flex-direction: column; - height: 100%; - position: absolute; - width: 100%; -} -.tinymce-mobile-styles-menu [role="menu"].transitioning { - transition: transform 0.5s ease-in-out; -} -.tinymce-mobile-styles-menu .tinymce-mobile-styles-item { - border-bottom: 1px solid #ddd; - color: #455a64; - cursor: pointer; - display: flex; - padding: 1em 1em; - position: relative; -} -.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser .tinymce-mobile-styles-collapse-icon::before { - color: #455a64; - content: "\e314"; - font-family: 'tinymce-mobile', sans-serif; -} -.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-styles-item-is-menu::after { - color: #455a64; - content: "\e315"; - font-family: 'tinymce-mobile', sans-serif; - padding-left: 1em; - padding-right: 1em; - position: absolute; - right: 0; -} -.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-format-matches::after { - font-family: 'tinymce-mobile', sans-serif; - padding-left: 1em; - padding-right: 1em; - position: absolute; - right: 0; -} -.tinymce-mobile-styles-menu .tinymce-mobile-styles-separator, -.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser { - align-items: center; - background: #fff; - border-top: #455a64; - color: #455a64; - display: flex; - min-height: 2.5em; - padding-left: 1em; - padding-right: 1em; -} -.tinymce-mobile-styles-menu [data-transitioning-destination="before"][data-transitioning-state], -.tinymce-mobile-styles-menu [data-transitioning-state="before"] { - transform: translate(-100%); -} -.tinymce-mobile-styles-menu [data-transitioning-destination="current"][data-transitioning-state], -.tinymce-mobile-styles-menu [data-transitioning-state="current"] { - transform: translate(0%); -} -.tinymce-mobile-styles-menu [data-transitioning-destination="after"][data-transitioning-state], -.tinymce-mobile-styles-menu [data-transitioning-state="after"] { - transform: translate(100%); -} -@font-face { - font-family: 'tinymce-mobile'; - font-style: normal; - font-weight: normal; - src: url('fonts/tinymce-mobile.woff?8x92w3') format('woff'); -} -@media (min-device-width: 700px) { - .tinymce-mobile-outer-container, - .tinymce-mobile-outer-container input { - font-size: 25px; - } -} -@media (max-device-width: 700px) { - .tinymce-mobile-outer-container, - .tinymce-mobile-outer-container input { - font-size: 18px; - } -} -.tinymce-mobile-icon { - font-family: 'tinymce-mobile', sans-serif; -} -.mixin-flex-and-centre { - align-items: center; - display: flex; - justify-content: center; -} -.mixin-flex-bar { - align-items: center; - display: flex; - height: 100%; -} -.tinymce-mobile-outer-container .tinymce-mobile-editor-socket iframe { - background-color: #fff; - width: 100%; -} -.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon { - /* Note, on the iPod touch in landscape, this isn't visible when the navbar appears */ - background-color: #207ab7; - border-radius: 50%; - bottom: 1em; - color: white; - font-size: 1em; - height: 2.1em; - position: fixed; - right: 2em; - width: 2.1em; - align-items: center; - display: flex; - justify-content: center; -} -@media only screen and (min-device-width:700px) { - .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon { - font-size: 1.2em; - } -} -.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket { - height: 300px; - overflow: hidden; -} -.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket iframe { - height: 100%; -} -.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-toolstrip { - display: none; -} -/* - Note, that if you don't include this (::-webkit-file-upload-button), the toolbar width gets - increased and the whole body becomes scrollable. It's important! - */ -input[type="file"]::-webkit-file-upload-button { - display: none; -} -@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : landscape) { - .tinymce-mobile-ios-container .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon { - bottom: 50%; - } -} diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.mobile.min.css.map b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.mobile.min.css.map deleted file mode 100644 index bd4e3c31e88f..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.mobile.min.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["ui/dark/skin.mobile.css"],"names":[],"mappings":";;;;;;AAOA,gCACE,IAAK,QACL,QAAS,MAEX,kCACE,OAAQ,EACR,WAAY,QACZ,OAAQ,QACR,MAAO,KACP,YAAa,EACb,OAAQ,EACR,QAAS,EACT,QAAS,EACT,4BAA6B,YAE7B,YAAa,KACb,YAAa,OAEf,wCACE,QAAS,QAEX,mCACE,QAAS,QAEX,2CACE,QAAS,QAEX,sCACE,QAAS,QAEX,0CACE,QAAS,QAEX,wCACE,QAAS,QAEX,yCACE,QAAS,QAEX,kCACE,QAAS,QAEX,oCACE,QAAS,QAEX,4CACE,QAAS,QAEX,0CACE,QAAS,QAEX,uCACE,QAAS,QAEX,uCACE,QAAS,QAEX,kCACE,QAAS,QAEX,oCACE,QAAS,QAEX,mCACE,QAAS,QAEX,sCACE,QAAS,QAEX,kCACE,QAAS,QAEX,wCACA,2CACE,QAAS,QAEX,kCACE,QAAS,QAEX,kCACE,QAAS,QAEX,0CACE,QAAS,QAEX,wCACE,QAAS,QAGX,sCADA,2CAEE,QAAS,QAEX,2CACE,QAAS,QAEX,2CACE,QAAS,QAGX,2CADA,2CAEE,YAAa,WACb,UAAW,IAEb,uCACE,QAAS,QAEX,kCACE,QAAS,QAEX,qCAEE,QAAS,WACT,YAAa,WACb,UAAW,IACX,YAAa,IAEf,gCACE,QAAS,KACT,YAAa,IAEf,gCACE,QAAS,KACT,YAAa,IAEf,gCACE,QAAS,KACT,YAAa,IAEf,8DACE,YAAa,OACb,QAAS,KACT,gBAAiB,OACjB,WAAY,kBACZ,OAAQ,KACR,SAAU,SACV,IAAK,EACL,MAAO,KAET,gGACE,YAAa,OACb,cAAe,IACf,QAAS,KACT,eAAgB,OAChB,YAAa,WACb,UAAW,IACX,gBAAiB,cAEnB,iHACE,YAAa,OACb,QAAS,KACT,gBAAiB,OACjB,cAAe,IACf,OAAQ,MACR,MAAO,MAET,oIACE,YAAa,OACb,QAAS,KACT,gBAAiB,OACjB,eAAgB,OAChB,UAAW,IAEb,gDACE,oIACE,UAAW,OAGf,kKACE,YAAa,OACb,QAAS,KACT,gBAAiB,OACjB,cAAe,IACf,OAAQ,MACR,MAAO,MACP,iBAAkB,KAClB,MAAO,QAET,0KACE,QAAS,QACT,YAAa,cAAgB,CAAE,WAEjC,8MACE,QAAS,EAEX,mEACE,WAAY,KACZ,OAAQ,KACR,OAAQ,EACR,QAAS,KACT,eAAgB,OAChB,KAAM,EACN,SAAU,MACV,MAAO,EACP,IAAK,EAEP,yEACE,SAAU,SAEZ,gEACE,QAAS,KACT,UAAW,EAEb,uEACE,QAAS,eACT,UAAW,EACX,OAAQ,eAEV,sCACE,SAAU,OAEZ,sFACE,WAAY,KAEd,0BACE,WAAY,KACZ,QAAS,KACT,KAAM,EAAE,EAAE,KACV,QAAS,EAEX,kDACE,YAAa,OACb,iBAAkB,KAClB,cAAe,IAAI,MAAM,KACzB,QAAS,KACT,KAAM,EACN,OAAQ,MACR,MAAO,KAGT,qHACE,YAAa,OACb,QAAS,KACT,OAAQ,KACR,YAAa,EAEf,yHACE,YAAa,OACb,QAAS,KACT,OAAQ,KACR,KAAM,EAER,mJACE,WAAY,QAEd,6JACE,UAAW,EAEb,wJACE,aAAc,KACd,cAAe,KAEjB,sLACE,YAAa,OACb,QAAS,KACT,OAAQ,IACR,YAAa,IACb,aAAc,IAEhB,6NACE,WAAY,QACZ,MAAO,KAET,mIACA,kIACE,WAAY,QACZ,MAAO,QAKT,+GACE,YAAa,OACb,QAAS,KACT,OAAQ,KACR,KAAM,EACN,eAAgB,KAChB,YAAa,KAIf,iJACE,QAAS,KACT,WAAY,MACZ,SAAU,OACV,aAAc,EACd,cAAe,EACf,SAAU,SACV,MAAO,KAET,yLACE,QAAS,KACT,OAAQ,KACR,WAAY,KAAK,uBAA2B,KAC5C,MAAO,KAET,kOACE,QAAS,KACT,KAAM,EAAE,EAAE,KACV,gBAAiB,cACjB,MAAO,KAET,wOACE,YAAa,WAEf,kQACE,QAAS,KACT,UAAW,EACX,SAAU,SAEZ,oSACE,mBAAoB,OAChB,WAAY,OAChB,WAAY,QACZ,OAAQ,KACR,cAAe,IACf,MAAO,KACP,UAAW,KACX,YAAa,IACb,OAAQ,KACR,cAAe,IACf,SAAU,SACV,MAAO,EAET,yUACE,QAAS,KAGX,4PADA,gQAEE,YAAa,OACb,QAAS,KAGX,oQADA,wQAEE,YAAa,OACb,QAAS,KACT,YAAa,IACb,OAAQ,KACR,aAAc,KACd,cAAe,KAGjB,+SADA,mTAEE,WAAY,OAEd,wIACE,MAAO,KACP,UAAW,KACX,YAAa,KACb,OAAQ,EAAE,IACV,YAAa,IAEf,kKACE,MAAO,QAET,uJACA,0JACE,YAAa,KACb,aAAc,KAEhB,uJACA,0JACE,YAAa,KACb,aAAc,KAEhB,sIACE,QAAS,KACT,KAAM,EACN,YAAa,EACb,aAAc,EACd,QAAS,MAAO,EAChB,SAAU,SAEZ,4KACE,YAAa,OACb,QAAS,KACT,UAAW,EACX,OAAQ,KAEV,6MACE,WAAY,KACZ,QAAS,KACT,KAAM,EACN,OAAQ,KACR,cAAe,KACf,WAAY,KAEd,0KACE,aAAc,IACd,cAAe,IAEjB,oNACE,YAAa,OACb,QAAS,KACT,UAAW,EACX,OAAQ,KAEV,oPACE,WAAY,+FACZ,QAAS,KACT,KAAM,EACN,OAAQ,KACR,cAAe,KACf,WAAY,KAEd,2MAEE,WAAY,KACZ,OAAQ,KACR,cAAe,KACf,WAAY,KACZ,MAAO,MAET,2MAEE,WAAY,KACZ,OAAQ,KACR,cAAe,KACf,WAAY,KACZ,MAAO,MAET,mKAME,YAAa,OACb,gBAAiB,YACjB,iBAAkB,QAClB,OAAQ,KAAM,MAAM,oBACpB,cAAe,IACf,OAAQ,EACR,MAAO,KACP,QAAS,KACT,OAAQ,KACR,gBAAiB,OACjB,KAAM,MACN,OAAQ,KACR,SAAU,SACV,IAAK,EACL,WAAY,OAAO,MAAM,4BACzB,MAAO,KAET,+LACE,OAAQ,KAAM,MAAM,sBAEtB,kJACA,mHACE,YAAa,OACb,QAAS,KACT,OAAQ,KACR,KAAM,EAER,kJACE,eAAgB,OAChB,gBAAiB,OAEnB,kJACE,YAAa,OACb,QAAS,KAEX,yLACE,OAAQ,KAEV,6IACE,QAAS,KAEX,qHACE,WAAY,KACZ,OAAQ,KACR,cAAe,EACf,MAAO,QACP,UAAW,EACX,UAAW,MACX,eAAgB,KAChB,aAAc,IACd,YAAa,KAEf,gJAEE,MAAO,KAET,kIAEE,MAAO,KAGT,uBACE,WAAY,KACZ,QAAS,KACT,SAAU,OACV,MAAO,KAET,uDACE,WAAY,OAAO,IAAK,SAE1B,qDACE,WAAY,OAAO,IAAK,QAE1B,oDACE,UAAW,EAEb,sFACE,UAAW,EAGb,wFACE,WAAY,MAEd,+CACE,0DACE,WAAY,OAGhB,4GACE,wFACE,WAAY,OAIhB,4BACE,YAAa,WACb,QAAS,IAAI,MAAM,KACnB,SAAU,OACV,SAAU,SACV,MAAO,KAET,wCACE,QAAS,KACT,eAAgB,OAChB,OAAQ,KACR,SAAU,SACV,MAAO,KAET,sDACE,WAAY,UAAU,IAAK,YAE7B,wDACE,cAAe,IAAI,MAAM,KACzB,MAAO,QACP,OAAQ,QACR,QAAS,KACT,QAAS,IAAI,IACb,SAAU,SAEZ,0GACE,MAAO,QACP,QAAS,QACT,YAAa,cAAgB,CAAE,WAEjC,kGACE,MAAO,QACP,QAAS,QACT,YAAa,cAAgB,CAAE,WAC/B,aAAc,IACd,cAAe,IACf,SAAU,SACV,MAAO,EAET,6FACE,YAAa,cAAgB,CAAE,WAC/B,aAAc,IACd,cAAe,IACf,SAAU,SACV,MAAO,EAGT,6DADA,6DAEE,YAAa,OACb,WAAY,KACZ,WAAY,QACZ,MAAO,QACP,QAAS,KACT,WAAY,MACZ,aAAc,IACd,cAAe,IAEjB,8FACA,8DACE,UAAW,iBAEb,+FACA,+DACE,UAAW,aAEb,6FACA,6DACE,UAAW,gBAEb,WACE,YAAa,eACb,WAAY,OACZ,YAAa,IACb,IAAK,sCAAwC,eAE/C,gCACE,gCACA,sCACE,UAAW,MAGf,gCACE,gCACA,sCACE,UAAW,MAGf,qBACE,YAAa,cAAgB,CAAE,WAEjC,uBACE,YAAa,OACb,QAAS,KACT,gBAAiB,OAEnB,gBACE,YAAa,OACb,QAAS,KACT,OAAQ,KAEV,qEACE,iBAAkB,KAClB,MAAO,KAET,6DAEE,iBAAkB,QAClB,cAAe,IACf,OAAQ,IACR,MAAO,KACP,UAAW,IACX,OAAQ,MACR,SAAU,MACV,MAAO,IACP,MAAO,MACP,YAAa,OACb,QAAS,KACT,gBAAiB,OAEnB,gDACE,6DACE,UAAW,OAGf,wGACE,OAAQ,MACR,SAAU,OAEZ,+GACE,OAAQ,KAEV,oGACE,QAAS,KAMX,6CACE,QAAS,KAEX,4GACE,2FACE,OAAQ","file":"skin.mobile.min.css","sourcesContent":["/**\n * Copyright (c) Tiny Technologies, Inc. All rights reserved.\n * Licensed under the LGPL or a commercial license.\n * For LGPL see License.txt in the project root for license information.\n * For commercial licenses see https://www.tiny.cloud/\n */\n/* RESET all the things! */\n.tinymce-mobile-outer-container {\n all: initial;\n display: block;\n}\n.tinymce-mobile-outer-container * {\n border: 0;\n box-sizing: initial;\n cursor: inherit;\n float: none;\n line-height: 1;\n margin: 0;\n outline: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n /* TBIO-3691, stop the gray flicker on touch. */\n text-shadow: none;\n white-space: nowrap;\n}\n.tinymce-mobile-icon-arrow-back::before {\n content: \"\\e5cd\";\n}\n.tinymce-mobile-icon-image::before {\n content: \"\\e412\";\n}\n.tinymce-mobile-icon-cancel-circle::before {\n content: \"\\e5c9\";\n}\n.tinymce-mobile-icon-full-dot::before {\n content: \"\\e061\";\n}\n.tinymce-mobile-icon-align-center::before {\n content: \"\\e234\";\n}\n.tinymce-mobile-icon-align-left::before {\n content: \"\\e236\";\n}\n.tinymce-mobile-icon-align-right::before {\n content: \"\\e237\";\n}\n.tinymce-mobile-icon-bold::before {\n content: \"\\e238\";\n}\n.tinymce-mobile-icon-italic::before {\n content: \"\\e23f\";\n}\n.tinymce-mobile-icon-unordered-list::before {\n content: \"\\e241\";\n}\n.tinymce-mobile-icon-ordered-list::before {\n content: \"\\e242\";\n}\n.tinymce-mobile-icon-font-size::before {\n content: \"\\e245\";\n}\n.tinymce-mobile-icon-underline::before {\n content: \"\\e249\";\n}\n.tinymce-mobile-icon-link::before {\n content: \"\\e157\";\n}\n.tinymce-mobile-icon-unlink::before {\n content: \"\\eca2\";\n}\n.tinymce-mobile-icon-color::before {\n content: \"\\e891\";\n}\n.tinymce-mobile-icon-previous::before {\n content: \"\\e314\";\n}\n.tinymce-mobile-icon-next::before {\n content: \"\\e315\";\n}\n.tinymce-mobile-icon-large-font::before,\n.tinymce-mobile-icon-style-formats::before {\n content: \"\\e264\";\n}\n.tinymce-mobile-icon-undo::before {\n content: \"\\e166\";\n}\n.tinymce-mobile-icon-redo::before {\n content: \"\\e15a\";\n}\n.tinymce-mobile-icon-removeformat::before {\n content: \"\\e239\";\n}\n.tinymce-mobile-icon-small-font::before {\n content: \"\\e906\";\n}\n.tinymce-mobile-icon-readonly-back::before,\n.tinymce-mobile-format-matches::after {\n content: \"\\e5ca\";\n}\n.tinymce-mobile-icon-small-heading::before {\n content: \"small\";\n}\n.tinymce-mobile-icon-large-heading::before {\n content: \"large\";\n}\n.tinymce-mobile-icon-small-heading::before,\n.tinymce-mobile-icon-large-heading::before {\n font-family: sans-serif;\n font-size: 80%;\n}\n.tinymce-mobile-mask-edit-icon::before {\n content: \"\\e254\";\n}\n.tinymce-mobile-icon-back::before {\n content: \"\\e5c4\";\n}\n.tinymce-mobile-icon-heading::before {\n /* TODO: Translate */\n content: \"Headings\";\n font-family: sans-serif;\n font-size: 80%;\n font-weight: bold;\n}\n.tinymce-mobile-icon-h1::before {\n content: \"H1\";\n font-weight: bold;\n}\n.tinymce-mobile-icon-h2::before {\n content: \"H2\";\n font-weight: bold;\n}\n.tinymce-mobile-icon-h3::before {\n content: \"H3\";\n font-weight: bold;\n}\n.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask {\n align-items: center;\n display: flex;\n justify-content: center;\n background: rgba(51, 51, 51, 0.5);\n height: 100%;\n position: absolute;\n top: 0;\n width: 100%;\n}\n.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container {\n align-items: center;\n border-radius: 50%;\n display: flex;\n flex-direction: column;\n font-family: sans-serif;\n font-size: 1em;\n justify-content: space-between;\n}\n.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .mixin-menu-item {\n align-items: center;\n display: flex;\n justify-content: center;\n border-radius: 50%;\n height: 2.1em;\n width: 2.1em;\n}\n.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section {\n align-items: center;\n display: flex;\n justify-content: center;\n flex-direction: column;\n font-size: 1em;\n}\n@media only screen and (min-device-width:700px) {\n .tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section {\n font-size: 1.2em;\n }\n}\n.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon {\n align-items: center;\n display: flex;\n justify-content: center;\n border-radius: 50%;\n height: 2.1em;\n width: 2.1em;\n background-color: white;\n color: #207ab7;\n}\n.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon::before {\n content: \"\\e900\";\n font-family: 'tinymce-mobile', sans-serif;\n}\n.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section:not(.tinymce-mobile-mask-tap-icon-selected) .tinymce-mobile-mask-tap-icon {\n z-index: 2;\n}\n.tinymce-mobile-android-container.tinymce-mobile-android-maximized {\n background: #ffffff;\n border: none;\n bottom: 0;\n display: flex;\n flex-direction: column;\n left: 0;\n position: fixed;\n right: 0;\n top: 0;\n}\n.tinymce-mobile-android-container:not(.tinymce-mobile-android-maximized) {\n position: relative;\n}\n.tinymce-mobile-android-container .tinymce-mobile-editor-socket {\n display: flex;\n flex-grow: 1;\n}\n.tinymce-mobile-android-container .tinymce-mobile-editor-socket iframe {\n display: flex !important;\n flex-grow: 1;\n height: auto !important;\n}\n.tinymce-mobile-android-scroll-reload {\n overflow: hidden;\n}\n:not(.tinymce-mobile-readonly-mode) > .tinymce-mobile-android-selection-context-toolbar {\n margin-top: 23px;\n}\n.tinymce-mobile-toolstrip {\n background: #fff;\n display: flex;\n flex: 0 0 auto;\n z-index: 1;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar {\n align-items: center;\n background-color: #fff;\n border-bottom: 1px solid #cccccc;\n display: flex;\n flex: 1;\n height: 2.5em;\n width: 100%;\n /* Make it no larger than the toolstrip, so that it needs to scroll */\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group {\n align-items: center;\n display: flex;\n height: 100%;\n flex-shrink: 1;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group > div {\n align-items: center;\n display: flex;\n height: 100%;\n flex: 1;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-exit-container {\n background: #f44336;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-toolbar-scrollable-group {\n flex-grow: 1;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item {\n padding-left: 0.5em;\n padding-right: 0.5em;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button {\n align-items: center;\n display: flex;\n height: 80%;\n margin-left: 2px;\n margin-right: 2px;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button.tinymce-mobile-toolbar-button-selected {\n background: #c8cbcf;\n color: #cccccc;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:first-of-type,\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:last-of-type {\n background: #207ab7;\n color: #eceff1;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar {\n /* Note, this file is imported inside .tinymce-mobile-context-toolbar, so that prefix is on everything here. */\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group {\n align-items: center;\n display: flex;\n height: 100%;\n flex: 1;\n padding-bottom: 0.4em;\n padding-top: 0.4em;\n /* Make any buttons appearing on the left and right display in the centre (e.g. color edges) */\n /* For widgets like the colour picker, use the whole height */\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog {\n display: flex;\n min-height: 1.5em;\n overflow: hidden;\n padding-left: 0;\n padding-right: 0;\n position: relative;\n width: 100%;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain {\n display: flex;\n height: 100%;\n transition: left cubic-bezier(0.4, 0, 1, 1) 0.15s;\n width: 100%;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen {\n display: flex;\n flex: 0 0 auto;\n justify-content: space-between;\n width: 100%;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen input {\n font-family: Sans-serif;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container {\n display: flex;\n flex-grow: 1;\n position: relative;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container .tinymce-mobile-input-container-x {\n -ms-grid-row-align: center;\n align-self: center;\n background: inherit;\n border: none;\n border-radius: 50%;\n color: #888;\n font-size: 0.6em;\n font-weight: bold;\n height: 100%;\n padding-right: 2px;\n position: absolute;\n right: 0;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container.tinymce-mobile-input-container-empty .tinymce-mobile-input-container-x {\n display: none;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous,\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next {\n align-items: center;\n display: flex;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous::before,\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next::before {\n align-items: center;\n display: flex;\n font-weight: bold;\n height: 100%;\n padding-left: 0.5em;\n padding-right: 0.5em;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous.tinymce-mobile-toolbar-navigation-disabled::before,\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next.tinymce-mobile-toolbar-navigation-disabled::before {\n visibility: hidden;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item {\n color: #cccccc;\n font-size: 10px;\n line-height: 10px;\n margin: 0 2px;\n padding-top: 3px;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item.tinymce-mobile-dot-active {\n color: #c8cbcf;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-font::before,\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-heading::before {\n margin-left: 0.5em;\n margin-right: 0.9em;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-font::before,\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-heading::before {\n margin-left: 0.9em;\n margin-right: 0.5em;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider {\n display: flex;\n flex: 1;\n margin-left: 0;\n margin-right: 0;\n padding: 0.28em 0;\n position: relative;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container {\n align-items: center;\n display: flex;\n flex-grow: 1;\n height: 100%;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container .tinymce-mobile-slider-size-line {\n background: #cccccc;\n display: flex;\n flex: 1;\n height: 0.2em;\n margin-bottom: 0.3em;\n margin-top: 0.3em;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container {\n padding-left: 2em;\n padding-right: 2em;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container {\n align-items: center;\n display: flex;\n flex-grow: 1;\n height: 100%;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container .tinymce-mobile-slider-gradient {\n background: linear-gradient(to right, hsl(0, 100%, 50%) 0%, hsl(60, 100%, 50%) 17%, hsl(120, 100%, 50%) 33%, hsl(180, 100%, 50%) 50%, hsl(240, 100%, 50%) 67%, hsl(300, 100%, 50%) 83%, hsl(0, 100%, 50%) 100%);\n display: flex;\n flex: 1;\n height: 0.2em;\n margin-bottom: 0.3em;\n margin-top: 0.3em;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-black {\n /* Not part of theming */\n background: black;\n height: 0.2em;\n margin-bottom: 0.3em;\n margin-top: 0.3em;\n width: 1.2em;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-white {\n /* Not part of theming */\n background: white;\n height: 0.2em;\n margin-bottom: 0.3em;\n margin-top: 0.3em;\n width: 1.2em;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb {\n /* vertically centering trick (margin: auto, top: 0, bottom: 0). On iOS and Safari, if you leave\n * out these values, then it shows the thumb at the top of the spectrum. This is probably because it is\n * absolutely positioned with only a left value, and not a top. Note, on Chrome it seems to be fine without\n * this approach.\n */\n align-items: center;\n background-clip: padding-box;\n background-color: #455a64;\n border: 0.5em solid rgba(136, 136, 136, 0);\n border-radius: 3em;\n bottom: 0;\n color: #fff;\n display: flex;\n height: 0.5em;\n justify-content: center;\n left: -10px;\n margin: auto;\n position: absolute;\n top: 0;\n transition: border 120ms cubic-bezier(0.39, 0.58, 0.57, 1);\n width: 0.5em;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb.tinymce-mobile-thumb-active {\n border: 0.5em solid rgba(136, 136, 136, 0.39);\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper,\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group > div {\n align-items: center;\n display: flex;\n height: 100%;\n flex: 1;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper {\n flex-direction: column;\n justify-content: center;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item {\n align-items: center;\n display: flex;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item:not(.tinymce-mobile-serialised-dialog) {\n height: 100%;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-container {\n display: flex;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input {\n background: #ffffff;\n border: none;\n border-radius: 0;\n color: #455a64;\n flex-grow: 1;\n font-size: 0.85em;\n padding-bottom: 0.1em;\n padding-left: 5px;\n padding-top: 0.1em;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::-webkit-input-placeholder {\n /* WebKit, Blink, Edge */\n color: #888;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::placeholder {\n /* WebKit, Blink, Edge */\n color: #888;\n}\n/* dropup */\n.tinymce-mobile-dropup {\n background: white;\n display: flex;\n overflow: hidden;\n width: 100%;\n}\n.tinymce-mobile-dropup.tinymce-mobile-dropup-shrinking {\n transition: height 0.3s ease-out;\n}\n.tinymce-mobile-dropup.tinymce-mobile-dropup-growing {\n transition: height 0.3s ease-in;\n}\n.tinymce-mobile-dropup.tinymce-mobile-dropup-closed {\n flex-grow: 0;\n}\n.tinymce-mobile-dropup.tinymce-mobile-dropup-open:not(.tinymce-mobile-dropup-growing) {\n flex-grow: 1;\n}\n/* TODO min-height for device size and orientation */\n.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) {\n min-height: 200px;\n}\n@media only screen and (orientation: landscape) {\n .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) {\n min-height: 200px;\n }\n}\n@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : landscape) {\n .tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) {\n min-height: 150px;\n }\n}\n/* styles menu */\n.tinymce-mobile-styles-menu {\n font-family: sans-serif;\n outline: 4px solid black;\n overflow: hidden;\n position: relative;\n width: 100%;\n}\n.tinymce-mobile-styles-menu [role=\"menu\"] {\n display: flex;\n flex-direction: column;\n height: 100%;\n position: absolute;\n width: 100%;\n}\n.tinymce-mobile-styles-menu [role=\"menu\"].transitioning {\n transition: transform 0.5s ease-in-out;\n}\n.tinymce-mobile-styles-menu .tinymce-mobile-styles-item {\n border-bottom: 1px solid #ddd;\n color: #455a64;\n cursor: pointer;\n display: flex;\n padding: 1em 1em;\n position: relative;\n}\n.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser .tinymce-mobile-styles-collapse-icon::before {\n color: #455a64;\n content: \"\\e314\";\n font-family: 'tinymce-mobile', sans-serif;\n}\n.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-styles-item-is-menu::after {\n color: #455a64;\n content: \"\\e315\";\n font-family: 'tinymce-mobile', sans-serif;\n padding-left: 1em;\n padding-right: 1em;\n position: absolute;\n right: 0;\n}\n.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-format-matches::after {\n font-family: 'tinymce-mobile', sans-serif;\n padding-left: 1em;\n padding-right: 1em;\n position: absolute;\n right: 0;\n}\n.tinymce-mobile-styles-menu .tinymce-mobile-styles-separator,\n.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser {\n align-items: center;\n background: #fff;\n border-top: #455a64;\n color: #455a64;\n display: flex;\n min-height: 2.5em;\n padding-left: 1em;\n padding-right: 1em;\n}\n.tinymce-mobile-styles-menu [data-transitioning-destination=\"before\"][data-transitioning-state],\n.tinymce-mobile-styles-menu [data-transitioning-state=\"before\"] {\n transform: translate(-100%);\n}\n.tinymce-mobile-styles-menu [data-transitioning-destination=\"current\"][data-transitioning-state],\n.tinymce-mobile-styles-menu [data-transitioning-state=\"current\"] {\n transform: translate(0%);\n}\n.tinymce-mobile-styles-menu [data-transitioning-destination=\"after\"][data-transitioning-state],\n.tinymce-mobile-styles-menu [data-transitioning-state=\"after\"] {\n transform: translate(100%);\n}\n@font-face {\n font-family: 'tinymce-mobile';\n font-style: normal;\n font-weight: normal;\n src: url('fonts/tinymce-mobile.woff?8x92w3') format('woff');\n}\n@media (min-device-width: 700px) {\n .tinymce-mobile-outer-container,\n .tinymce-mobile-outer-container input {\n font-size: 25px;\n }\n}\n@media (max-device-width: 700px) {\n .tinymce-mobile-outer-container,\n .tinymce-mobile-outer-container input {\n font-size: 18px;\n }\n}\n.tinymce-mobile-icon {\n font-family: 'tinymce-mobile', sans-serif;\n}\n.mixin-flex-and-centre {\n align-items: center;\n display: flex;\n justify-content: center;\n}\n.mixin-flex-bar {\n align-items: center;\n display: flex;\n height: 100%;\n}\n.tinymce-mobile-outer-container .tinymce-mobile-editor-socket iframe {\n background-color: #fff;\n width: 100%;\n}\n.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon {\n /* Note, on the iPod touch in landscape, this isn't visible when the navbar appears */\n background-color: #207ab7;\n border-radius: 50%;\n bottom: 1em;\n color: white;\n font-size: 1em;\n height: 2.1em;\n position: fixed;\n right: 2em;\n width: 2.1em;\n align-items: center;\n display: flex;\n justify-content: center;\n}\n@media only screen and (min-device-width:700px) {\n .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon {\n font-size: 1.2em;\n }\n}\n.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket {\n height: 300px;\n overflow: hidden;\n}\n.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket iframe {\n height: 100%;\n}\n.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-toolstrip {\n display: none;\n}\n/*\n Note, that if you don't include this (::-webkit-file-upload-button), the toolbar width gets\n increased and the whole body becomes scrollable. It's important!\n */\ninput[type=\"file\"]::-webkit-file-upload-button {\n display: none;\n}\n@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : landscape) {\n .tinymce-mobile-ios-container .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon {\n bottom: 50%;\n }\n}\n"]} \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.css deleted file mode 100644 index 835508d9fde4..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.css +++ /dev/null @@ -1,728 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ -.mce-content-body .mce-item-anchor { - background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; - cursor: default; - display: inline-block; - height: 12px !important; - padding: 0 2px; - -webkit-user-modify: read-only; - -moz-user-modify: read-only; - -webkit-user-select: all; - -moz-user-select: all; - -ms-user-select: all; - user-select: all; - width: 8px !important; -} -.mce-content-body .mce-item-anchor[data-mce-selected] { - outline-offset: 1px; -} -.tox-comments-visible .tox-comment { - background-color: #fff0b7; -} -.tox-comments-visible .tox-comment--active { - background-color: #ffe168; -} -.tox-checklist > li:not(.tox-checklist--hidden) { - list-style: none; - margin: 0.25em 0; -} -.tox-checklist > li:not(.tox-checklist--hidden)::before { - content: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); - cursor: pointer; - height: 1em; - margin-left: -1.5em; - margin-top: 0.125em; - position: absolute; - width: 1em; -} -.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before { - content: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A"); -} -[dir=rtl] .tox-checklist > li:not(.tox-checklist--hidden)::before { - margin-left: 0; - margin-right: -1.5em; -} -/* stylelint-disable */ -/* http://prismjs.com/ */ -/** - * prism.js default theme for JavaScript, CSS and HTML - * Based on dabblet (http://dabblet.com) - * @author Lea Verou - */ -code[class*="language-"], -pre[class*="language-"] { - color: black; - background: none; - text-shadow: 0 1px white; - font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; - font-size: 1em; - text-align: left; - white-space: pre; - word-spacing: normal; - word-break: normal; - word-wrap: normal; - line-height: 1.5; - -moz-tab-size: 4; - tab-size: 4; - -webkit-hyphens: none; - -ms-hyphens: none; - hyphens: none; -} -pre[class*="language-"]::-moz-selection, -pre[class*="language-"] ::-moz-selection, -code[class*="language-"]::-moz-selection, -code[class*="language-"] ::-moz-selection { - text-shadow: none; - background: #b3d4fc; -} -pre[class*="language-"]::selection, -pre[class*="language-"] ::selection, -code[class*="language-"]::selection, -code[class*="language-"] ::selection { - text-shadow: none; - background: #b3d4fc; -} -@media print { - code[class*="language-"], - pre[class*="language-"] { - text-shadow: none; - } -} -/* Code blocks */ -pre[class*="language-"] { - padding: 1em; - margin: 0.5em 0; - overflow: auto; -} -:not(pre) > code[class*="language-"], -pre[class*="language-"] { - background: #f5f2f0; -} -/* Inline code */ -:not(pre) > code[class*="language-"] { - padding: 0.1em; - border-radius: 0.3em; - white-space: normal; -} -.token.comment, -.token.prolog, -.token.doctype, -.token.cdata { - color: slategray; -} -.token.punctuation { - color: #999; -} -.namespace { - opacity: 0.7; -} -.token.property, -.token.tag, -.token.boolean, -.token.number, -.token.constant, -.token.symbol, -.token.deleted { - color: #905; -} -.token.selector, -.token.attr-name, -.token.string, -.token.char, -.token.builtin, -.token.inserted { - color: #690; -} -.token.operator, -.token.entity, -.token.url, -.language-css .token.string, -.style .token.string { - color: #9a6e3a; - background: hsla(0, 0%, 100%, 0.5); -} -.token.atrule, -.token.attr-value, -.token.keyword { - color: #07a; -} -.token.function, -.token.class-name { - color: #DD4A68; -} -.token.regex, -.token.important, -.token.variable { - color: #e90; -} -.token.important, -.token.bold { - font-weight: bold; -} -.token.italic { - font-style: italic; -} -.token.entity { - cursor: help; -} -/* stylelint-enable */ -.mce-content-body { - overflow-wrap: break-word; - word-wrap: break-word; -} -.mce-content-body .mce-visual-caret { - background-color: black; - background-color: currentColor; - position: absolute; -} -.mce-content-body .mce-visual-caret-hidden { - display: none; -} -.mce-content-body *[data-mce-caret] { - left: -1000px; - margin: 0; - padding: 0; - position: absolute; - right: auto; - top: 0; -} -.mce-content-body .mce-offscreen-selection { - left: -2000000px; - max-width: 1000000px; - position: absolute; -} -.mce-content-body *[contentEditable=false] { - cursor: default; -} -.mce-content-body *[contentEditable=true] { - cursor: text; -} -.tox-cursor-format-painter { - cursor: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"), default; -} -.mce-content-body figure.align-left { - float: left; -} -.mce-content-body figure.align-right { - float: right; -} -.mce-content-body figure.image.align-center { - display: table; - margin-left: auto; - margin-right: auto; -} -.mce-preview-object { - border: 1px solid gray; - display: inline-block; - line-height: 0; - margin: 0 2px 0 2px; - position: relative; -} -.mce-preview-object .mce-shim { - background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; -} -.mce-preview-object[data-mce-selected="2"] .mce-shim { - display: none; -} -.mce-object { - background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; - border: 1px dashed #aaa; -} -.mce-pagebreak { - border: 1px dashed #aaa; - cursor: default; - display: block; - height: 5px; - margin-top: 15px; - page-break-before: always; - width: 100%; -} -@media print { - .mce-pagebreak { - border: 0; - } -} -.tiny-pageembed .mce-shim { - background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7); - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; -} -.tiny-pageembed[data-mce-selected="2"] .mce-shim { - display: none; -} -.tiny-pageembed { - display: inline-block; - position: relative; -} -.tiny-pageembed--21by9, -.tiny-pageembed--16by9, -.tiny-pageembed--4by3, -.tiny-pageembed--1by1 { - display: block; - overflow: hidden; - padding: 0; - position: relative; - width: 100%; -} -.tiny-pageembed--21by9 { - padding-top: 42.857143%; -} -.tiny-pageembed--16by9 { - padding-top: 56.25%; -} -.tiny-pageembed--4by3 { - padding-top: 75%; -} -.tiny-pageembed--1by1 { - padding-top: 100%; -} -.tiny-pageembed--21by9 iframe, -.tiny-pageembed--16by9 iframe, -.tiny-pageembed--4by3 iframe, -.tiny-pageembed--1by1 iframe { - border: 0; - height: 100%; - left: 0; - position: absolute; - top: 0; - width: 100%; -} -.mce-content-body[data-mce-placeholder] { - position: relative; -} -.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before { - color: rgba(34, 47, 62, 0.7); - content: attr(data-mce-placeholder); - position: absolute; -} -.mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before { - left: 1px; -} -.mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before { - right: 1px; -} -.mce-content-body div.mce-resizehandle { - background-color: #4099ff; - border-color: #4099ff; - border-style: solid; - border-width: 1px; - box-sizing: border-box; - height: 10px; - position: absolute; - width: 10px; - z-index: 10000; -} -.mce-content-body div.mce-resizehandle:hover { - background-color: #4099ff; -} -.mce-content-body div.mce-resizehandle:nth-of-type(1) { - cursor: nwse-resize; -} -.mce-content-body div.mce-resizehandle:nth-of-type(2) { - cursor: nesw-resize; -} -.mce-content-body div.mce-resizehandle:nth-of-type(3) { - cursor: nwse-resize; -} -.mce-content-body div.mce-resizehandle:nth-of-type(4) { - cursor: nesw-resize; -} -.mce-content-body .mce-clonedresizable { - opacity: 0.5; - outline: 1px dashed black; - position: absolute; - z-index: 10000; -} -.mce-content-body .mce-clonedresizable.mce-resizetable-columns th, -.mce-content-body .mce-clonedresizable.mce-resizetable-columns td { - border: 0; -} -.mce-content-body .mce-resize-helper { - background: #555; - background: rgba(0, 0, 0, 0.75); - border: 1px; - border-radius: 3px; - color: white; - display: none; - font-family: sans-serif; - font-size: 12px; - line-height: 14px; - margin: 5px 10px; - padding: 5px; - position: absolute; - white-space: nowrap; - z-index: 10001; -} -.tox-rtc-user-selection { - position: relative; -} -.tox-rtc-user-cursor { - bottom: 0; - cursor: default; - position: absolute; - top: 0; - width: 2px; -} -.tox-rtc-user-cursor::before { - background-color: inherit; - border-radius: 50%; - content: ''; - display: block; - height: 8px; - position: absolute; - right: -3px; - top: -3px; - width: 8px; -} -.tox-rtc-user-cursor:hover::after { - background-color: inherit; - border-radius: 100px; - box-sizing: border-box; - color: #fff; - content: attr(data-user); - display: block; - font-size: 12px; - font-weight: bold; - left: -5px; - min-height: 8px; - min-width: 8px; - padding: 0 12px; - position: absolute; - top: -11px; - white-space: nowrap; - z-index: 1000; -} -.tox-rtc-user-selection--1 .tox-rtc-user-cursor { - background-color: #2dc26b; -} -.tox-rtc-user-selection--2 .tox-rtc-user-cursor { - background-color: #e03e2d; -} -.tox-rtc-user-selection--3 .tox-rtc-user-cursor { - background-color: #f1c40f; -} -.tox-rtc-user-selection--4 .tox-rtc-user-cursor { - background-color: #3598db; -} -.tox-rtc-user-selection--5 .tox-rtc-user-cursor { - background-color: #b96ad9; -} -.tox-rtc-user-selection--6 .tox-rtc-user-cursor { - background-color: #e67e23; -} -.tox-rtc-user-selection--7 .tox-rtc-user-cursor { - background-color: #aaa69d; -} -.tox-rtc-user-selection--8 .tox-rtc-user-cursor { - background-color: #f368e0; -} -.tox-rtc-remote-image { - background: #eaeaea url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2236%22%20height%3D%2212%22%20viewBox%3D%220%200%2036%2012%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Ccircle%20cx%3D%226%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2218%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.33s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2230%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.66s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A") no-repeat center center; - border: 1px solid #ccc; - min-height: 240px; - min-width: 320px; -} -.mce-match-marker { - background: #aaa; - color: #fff; -} -.mce-match-marker-selected { - background: #39f; - color: #fff; -} -.mce-match-marker-selected::-moz-selection { - background: #39f; - color: #fff; -} -.mce-match-marker-selected::selection { - background: #39f; - color: #fff; -} -.mce-content-body img[data-mce-selected], -.mce-content-body video[data-mce-selected], -.mce-content-body audio[data-mce-selected], -.mce-content-body object[data-mce-selected], -.mce-content-body embed[data-mce-selected], -.mce-content-body table[data-mce-selected] { - outline: 3px solid #b4d7ff; -} -.mce-content-body hr[data-mce-selected] { - outline: 3px solid #b4d7ff; - outline-offset: 1px; -} -.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus { - outline: 3px solid #b4d7ff; -} -.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover { - outline: 3px solid #b4d7ff; -} -.mce-content-body *[contentEditable=false][data-mce-selected] { - cursor: not-allowed; - outline: 3px solid #b4d7ff; -} -.mce-content-body.mce-content-readonly *[contentEditable=true]:focus, -.mce-content-body.mce-content-readonly *[contentEditable=true]:hover { - outline: none; -} -.mce-content-body *[data-mce-selected="inline-boundary"] { - background-color: #b4d7ff; -} -.mce-content-body .mce-edit-focus { - outline: 3px solid #b4d7ff; -} -.mce-content-body td[data-mce-selected], -.mce-content-body th[data-mce-selected] { - position: relative; -} -.mce-content-body td[data-mce-selected]::-moz-selection, -.mce-content-body th[data-mce-selected]::-moz-selection { - background: none; -} -.mce-content-body td[data-mce-selected]::selection, -.mce-content-body th[data-mce-selected]::selection { - background: none; -} -.mce-content-body td[data-mce-selected] *, -.mce-content-body th[data-mce-selected] * { - outline: none; - -webkit-touch-callout: none; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.mce-content-body td[data-mce-selected]::after, -.mce-content-body th[data-mce-selected]::after { - background-color: rgba(180, 215, 255, 0.35); - border: 1px solid rgba(180, 215, 255, 0.35); - bottom: -1px; - content: ''; - left: -1px; - mix-blend-mode: multiply; - position: absolute; - right: -1px; - top: -1px; -} -@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { - .mce-content-body td[data-mce-selected]::after, - .mce-content-body th[data-mce-selected]::after { - border-color: rgba(0, 84, 180, 0.35); - } -} -.mce-content-body img::-moz-selection { - background: none; -} -.mce-content-body img::selection { - background: none; -} -.ephox-snooker-resizer-bar { - background-color: #b4d7ff; - opacity: 0; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -.ephox-snooker-resizer-cols { - cursor: col-resize; -} -.ephox-snooker-resizer-rows { - cursor: row-resize; -} -.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging { - opacity: 1; -} -.mce-spellchecker-word { - background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); - background-position: 0 calc(100% + 1px); - background-repeat: repeat-x; - background-size: auto 6px; - cursor: default; - height: 2rem; -} -.mce-spellchecker-grammar { - background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A"); - background-position: 0 calc(100% + 1px); - background-repeat: repeat-x; - background-size: auto 6px; - cursor: default; -} -.mce-toc { - border: 1px solid gray; -} -.mce-toc h2 { - margin: 4px; -} -.mce-toc li { - list-style-type: none; -} -table[style*="border-width: 0px"], -.mce-item-table:not([border]), -.mce-item-table[border="0"], -table[style*="border-width: 0px"] td, -.mce-item-table:not([border]) td, -.mce-item-table[border="0"] td, -table[style*="border-width: 0px"] th, -.mce-item-table:not([border]) th, -.mce-item-table[border="0"] th, -table[style*="border-width: 0px"] caption, -.mce-item-table:not([border]) caption, -.mce-item-table[border="0"] caption { - border: 1px dashed #bbb; -} -.mce-visualblocks p, -.mce-visualblocks h1, -.mce-visualblocks h2, -.mce-visualblocks h3, -.mce-visualblocks h4, -.mce-visualblocks h5, -.mce-visualblocks h6, -.mce-visualblocks div:not([data-mce-bogus]), -.mce-visualblocks section, -.mce-visualblocks article, -.mce-visualblocks blockquote, -.mce-visualblocks address, -.mce-visualblocks pre, -.mce-visualblocks figure, -.mce-visualblocks figcaption, -.mce-visualblocks hgroup, -.mce-visualblocks aside, -.mce-visualblocks ul, -.mce-visualblocks ol, -.mce-visualblocks dl { - background-repeat: no-repeat; - border: 1px dashed #bbb; - margin-left: 3px; - padding-top: 10px; -} -.mce-visualblocks p { - background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7); -} -.mce-visualblocks h1 { - background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==); -} -.mce-visualblocks h2 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==); -} -.mce-visualblocks h3 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7); -} -.mce-visualblocks h4 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==); -} -.mce-visualblocks h5 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==); -} -.mce-visualblocks h6 { - background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==); -} -.mce-visualblocks div:not([data-mce-bogus]) { - background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7); -} -.mce-visualblocks section { - background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=); -} -.mce-visualblocks article { - background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7); -} -.mce-visualblocks blockquote { - background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7); -} -.mce-visualblocks address { - background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=); -} -.mce-visualblocks pre { - background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==); -} -.mce-visualblocks figure { - background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7); -} -.mce-visualblocks figcaption { - border: 1px dashed #bbb; -} -.mce-visualblocks hgroup { - background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7); -} -.mce-visualblocks aside { - background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=); -} -.mce-visualblocks ul { - background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==); -} -.mce-visualblocks ol { - background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==); -} -.mce-visualblocks dl { - background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==); -} -.mce-visualblocks:not([dir=rtl]) p, -.mce-visualblocks:not([dir=rtl]) h1, -.mce-visualblocks:not([dir=rtl]) h2, -.mce-visualblocks:not([dir=rtl]) h3, -.mce-visualblocks:not([dir=rtl]) h4, -.mce-visualblocks:not([dir=rtl]) h5, -.mce-visualblocks:not([dir=rtl]) h6, -.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]), -.mce-visualblocks:not([dir=rtl]) section, -.mce-visualblocks:not([dir=rtl]) article, -.mce-visualblocks:not([dir=rtl]) blockquote, -.mce-visualblocks:not([dir=rtl]) address, -.mce-visualblocks:not([dir=rtl]) pre, -.mce-visualblocks:not([dir=rtl]) figure, -.mce-visualblocks:not([dir=rtl]) figcaption, -.mce-visualblocks:not([dir=rtl]) hgroup, -.mce-visualblocks:not([dir=rtl]) aside, -.mce-visualblocks:not([dir=rtl]) ul, -.mce-visualblocks:not([dir=rtl]) ol, -.mce-visualblocks:not([dir=rtl]) dl { - margin-left: 3px; -} -.mce-visualblocks[dir=rtl] p, -.mce-visualblocks[dir=rtl] h1, -.mce-visualblocks[dir=rtl] h2, -.mce-visualblocks[dir=rtl] h3, -.mce-visualblocks[dir=rtl] h4, -.mce-visualblocks[dir=rtl] h5, -.mce-visualblocks[dir=rtl] h6, -.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]), -.mce-visualblocks[dir=rtl] section, -.mce-visualblocks[dir=rtl] article, -.mce-visualblocks[dir=rtl] blockquote, -.mce-visualblocks[dir=rtl] address, -.mce-visualblocks[dir=rtl] pre, -.mce-visualblocks[dir=rtl] figure, -.mce-visualblocks[dir=rtl] figcaption, -.mce-visualblocks[dir=rtl] hgroup, -.mce-visualblocks[dir=rtl] aside, -.mce-visualblocks[dir=rtl] ul, -.mce-visualblocks[dir=rtl] ol, -.mce-visualblocks[dir=rtl] dl { - background-position-x: right; - margin-right: 3px; -} -.mce-nbsp, -.mce-shy { - background: #aaa; -} -.mce-shy::after { - content: '-'; -} -body { - font-family: sans-serif; -} -table { - border-collapse: collapse; -} diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.inline.min.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.inline.min.css deleted file mode 100644 index b483a47ea9c7..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.inline.min.css +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ -.mce-content-body .mce-item-anchor{background:transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;cursor:default;display:inline-block;height:12px!important;padding:0 2px;-webkit-user-modify:read-only;-moz-user-modify:read-only;-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all;width:8px!important}.mce-content-body .mce-item-anchor[data-mce-selected]{outline-offset:1px}.tox-comments-visible .tox-comment{background-color:#fff0b7}.tox-comments-visible .tox-comment--active{background-color:#ffe168}.tox-checklist>li:not(.tox-checklist--hidden){list-style:none;margin:.25em 0}.tox-checklist>li:not(.tox-checklist--hidden)::before{content:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A");cursor:pointer;height:1em;margin-left:-1.5em;margin-top:.125em;position:absolute;width:1em}.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before{content:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A")}[dir=rtl] .tox-checklist>li:not(.tox-checklist--hidden)::before{margin-left:0;margin-right:-1.5em}code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;tab-size:4;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.mce-content-body{overflow-wrap:break-word;word-wrap:break-word}.mce-content-body .mce-visual-caret{background-color:#000;background-color:currentColor;position:absolute}.mce-content-body .mce-visual-caret-hidden{display:none}.mce-content-body [data-mce-caret]{left:-1000px;margin:0;padding:0;position:absolute;right:auto;top:0}.mce-content-body .mce-offscreen-selection{left:-2000000px;max-width:1000000px;position:absolute}.mce-content-body [contentEditable=false]{cursor:default}.mce-content-body [contentEditable=true]{cursor:text}.tox-cursor-format-painter{cursor:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"),default}.mce-content-body figure.align-left{float:left}.mce-content-body figure.align-right{float:right}.mce-content-body figure.image.align-center{display:table;margin-left:auto;margin-right:auto}.mce-preview-object{border:1px solid gray;display:inline-block;line-height:0;margin:0 2px 0 2px;position:relative}.mce-preview-object .mce-shim{background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);height:100%;left:0;position:absolute;top:0;width:100%}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-object{background:transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;border:1px dashed #aaa}.mce-pagebreak{border:1px dashed #aaa;cursor:default;display:block;height:5px;margin-top:15px;page-break-before:always;width:100%}@media print{.mce-pagebreak{border:0}}.tiny-pageembed .mce-shim{background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);height:100%;left:0;position:absolute;top:0;width:100%}.tiny-pageembed[data-mce-selected="2"] .mce-shim{display:none}.tiny-pageembed{display:inline-block;position:relative}.tiny-pageembed--16by9,.tiny-pageembed--1by1,.tiny-pageembed--21by9,.tiny-pageembed--4by3{display:block;overflow:hidden;padding:0;position:relative;width:100%}.tiny-pageembed--21by9{padding-top:42.857143%}.tiny-pageembed--16by9{padding-top:56.25%}.tiny-pageembed--4by3{padding-top:75%}.tiny-pageembed--1by1{padding-top:100%}.tiny-pageembed--16by9 iframe,.tiny-pageembed--1by1 iframe,.tiny-pageembed--21by9 iframe,.tiny-pageembed--4by3 iframe{border:0;height:100%;left:0;position:absolute;top:0;width:100%}.mce-content-body[data-mce-placeholder]{position:relative}.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before{color:rgba(34,47,62,.7);content:attr(data-mce-placeholder);position:absolute}.mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before{left:1px}.mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before{right:1px}.mce-content-body div.mce-resizehandle{background-color:#4099ff;border-color:#4099ff;border-style:solid;border-width:1px;box-sizing:border-box;height:10px;position:absolute;width:10px;z-index:10000}.mce-content-body div.mce-resizehandle:hover{background-color:#4099ff}.mce-content-body div.mce-resizehandle:nth-of-type(1){cursor:nwse-resize}.mce-content-body div.mce-resizehandle:nth-of-type(2){cursor:nesw-resize}.mce-content-body div.mce-resizehandle:nth-of-type(3){cursor:nwse-resize}.mce-content-body div.mce-resizehandle:nth-of-type(4){cursor:nesw-resize}.mce-content-body .mce-clonedresizable{opacity:.5;outline:1px dashed #000;position:absolute;z-index:10000}.mce-content-body .mce-clonedresizable.mce-resizetable-columns td,.mce-content-body .mce-clonedresizable.mce-resizetable-columns th{border:0}.mce-content-body .mce-resize-helper{background:#555;background:rgba(0,0,0,.75);border:1px;border-radius:3px;color:#fff;display:none;font-family:sans-serif;font-size:12px;line-height:14px;margin:5px 10px;padding:5px;position:absolute;white-space:nowrap;z-index:10001}.tox-rtc-user-selection{position:relative}.tox-rtc-user-cursor{bottom:0;cursor:default;position:absolute;top:0;width:2px}.tox-rtc-user-cursor::before{background-color:inherit;border-radius:50%;content:'';display:block;height:8px;position:absolute;right:-3px;top:-3px;width:8px}.tox-rtc-user-cursor:hover::after{background-color:inherit;border-radius:100px;box-sizing:border-box;color:#fff;content:attr(data-user);display:block;font-size:12px;font-weight:700;left:-5px;min-height:8px;min-width:8px;padding:0 12px;position:absolute;top:-11px;white-space:nowrap;z-index:1000}.tox-rtc-user-selection--1 .tox-rtc-user-cursor{background-color:#2dc26b}.tox-rtc-user-selection--2 .tox-rtc-user-cursor{background-color:#e03e2d}.tox-rtc-user-selection--3 .tox-rtc-user-cursor{background-color:#f1c40f}.tox-rtc-user-selection--4 .tox-rtc-user-cursor{background-color:#3598db}.tox-rtc-user-selection--5 .tox-rtc-user-cursor{background-color:#b96ad9}.tox-rtc-user-selection--6 .tox-rtc-user-cursor{background-color:#e67e23}.tox-rtc-user-selection--7 .tox-rtc-user-cursor{background-color:#aaa69d}.tox-rtc-user-selection--8 .tox-rtc-user-cursor{background-color:#f368e0}.tox-rtc-remote-image{background:#eaeaea url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2236%22%20height%3D%2212%22%20viewBox%3D%220%200%2036%2012%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Ccircle%20cx%3D%226%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2218%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.33s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2230%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.66s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A") no-repeat center center;border:1px solid #ccc;min-height:240px;min-width:320px}.mce-match-marker{background:#aaa;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-match-marker-selected::-moz-selection{background:#39f;color:#fff}.mce-match-marker-selected::selection{background:#39f;color:#fff}.mce-content-body audio[data-mce-selected],.mce-content-body embed[data-mce-selected],.mce-content-body img[data-mce-selected],.mce-content-body object[data-mce-selected],.mce-content-body table[data-mce-selected],.mce-content-body video[data-mce-selected]{outline:3px solid #b4d7ff}.mce-content-body hr[data-mce-selected]{outline:3px solid #b4d7ff;outline-offset:1px}.mce-content-body [contentEditable=false] [contentEditable=true]:focus{outline:3px solid #b4d7ff}.mce-content-body [contentEditable=false] [contentEditable=true]:hover{outline:3px solid #b4d7ff}.mce-content-body [contentEditable=false][data-mce-selected]{cursor:not-allowed;outline:3px solid #b4d7ff}.mce-content-body.mce-content-readonly [contentEditable=true]:focus,.mce-content-body.mce-content-readonly [contentEditable=true]:hover{outline:0}.mce-content-body [data-mce-selected=inline-boundary]{background-color:#b4d7ff}.mce-content-body .mce-edit-focus{outline:3px solid #b4d7ff}.mce-content-body td[data-mce-selected],.mce-content-body th[data-mce-selected]{position:relative}.mce-content-body td[data-mce-selected]::-moz-selection,.mce-content-body th[data-mce-selected]::-moz-selection{background:0 0}.mce-content-body td[data-mce-selected]::selection,.mce-content-body th[data-mce-selected]::selection{background:0 0}.mce-content-body td[data-mce-selected] *,.mce-content-body th[data-mce-selected] *{outline:0;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mce-content-body td[data-mce-selected]::after,.mce-content-body th[data-mce-selected]::after{background-color:rgba(180,215,255,.35);border:1px solid rgba(180,215,255,.35);bottom:-1px;content:'';left:-1px;mix-blend-mode:multiply;position:absolute;right:-1px;top:-1px}@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){.mce-content-body td[data-mce-selected]::after,.mce-content-body th[data-mce-selected]::after{border-color:rgba(0,84,180,.35)}}.mce-content-body img::-moz-selection{background:0 0}.mce-content-body img::selection{background:0 0}.ephox-snooker-resizer-bar{background-color:#b4d7ff;opacity:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ephox-snooker-resizer-cols{cursor:col-resize}.ephox-snooker-resizer-rows{cursor:row-resize}.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity:1}.mce-spellchecker-word{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position:0 calc(100% + 1px);background-repeat:repeat-x;background-size:auto 6px;cursor:default;height:2rem}.mce-spellchecker-grammar{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position:0 calc(100% + 1px);background-repeat:repeat-x;background-size:auto 6px;cursor:default}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-item-table:not([border]),.mce-item-table:not([border]) caption,.mce-item-table:not([border]) td,.mce-item-table:not([border]) th,.mce-item-table[border="0"],.mce-item-table[border="0"] caption,.mce-item-table[border="0"] td,.mce-item-table[border="0"] th,table[style*="border-width: 0px"],table[style*="border-width: 0px"] caption,table[style*="border-width: 0px"] td,table[style*="border-width: 0px"] th{border:1px dashed #bbb}.mce-visualblocks address,.mce-visualblocks article,.mce-visualblocks aside,.mce-visualblocks blockquote,.mce-visualblocks div:not([data-mce-bogus]),.mce-visualblocks dl,.mce-visualblocks figcaption,.mce-visualblocks figure,.mce-visualblocks h1,.mce-visualblocks h2,.mce-visualblocks h3,.mce-visualblocks h4,.mce-visualblocks h5,.mce-visualblocks h6,.mce-visualblocks hgroup,.mce-visualblocks ol,.mce-visualblocks p,.mce-visualblocks pre,.mce-visualblocks section,.mce-visualblocks ul{background-repeat:no-repeat;border:1px dashed #bbb;margin-left:3px;padding-top:10px}.mce-visualblocks p{background-image:url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7)}.mce-visualblocks h1{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==)}.mce-visualblocks h2{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==)}.mce-visualblocks h3{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7)}.mce-visualblocks h4{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==)}.mce-visualblocks h5{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==)}.mce-visualblocks h6{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==)}.mce-visualblocks div:not([data-mce-bogus]){background-image:url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7)}.mce-visualblocks section{background-image:url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=)}.mce-visualblocks article{background-image:url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7)}.mce-visualblocks blockquote{background-image:url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7)}.mce-visualblocks address{background-image:url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=)}.mce-visualblocks pre{background-image:url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==)}.mce-visualblocks figure{background-image:url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7)}.mce-visualblocks figcaption{border:1px dashed #bbb}.mce-visualblocks hgroup{background-image:url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7)}.mce-visualblocks aside{background-image:url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=)}.mce-visualblocks ul{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==)}.mce-visualblocks ol{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==)}.mce-visualblocks dl{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==)}.mce-visualblocks:not([dir=rtl]) address,.mce-visualblocks:not([dir=rtl]) article,.mce-visualblocks:not([dir=rtl]) aside,.mce-visualblocks:not([dir=rtl]) blockquote,.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]),.mce-visualblocks:not([dir=rtl]) dl,.mce-visualblocks:not([dir=rtl]) figcaption,.mce-visualblocks:not([dir=rtl]) figure,.mce-visualblocks:not([dir=rtl]) h1,.mce-visualblocks:not([dir=rtl]) h2,.mce-visualblocks:not([dir=rtl]) h3,.mce-visualblocks:not([dir=rtl]) h4,.mce-visualblocks:not([dir=rtl]) h5,.mce-visualblocks:not([dir=rtl]) h6,.mce-visualblocks:not([dir=rtl]) hgroup,.mce-visualblocks:not([dir=rtl]) ol,.mce-visualblocks:not([dir=rtl]) p,.mce-visualblocks:not([dir=rtl]) pre,.mce-visualblocks:not([dir=rtl]) section,.mce-visualblocks:not([dir=rtl]) ul{margin-left:3px}.mce-visualblocks[dir=rtl] address,.mce-visualblocks[dir=rtl] article,.mce-visualblocks[dir=rtl] aside,.mce-visualblocks[dir=rtl] blockquote,.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]),.mce-visualblocks[dir=rtl] dl,.mce-visualblocks[dir=rtl] figcaption,.mce-visualblocks[dir=rtl] figure,.mce-visualblocks[dir=rtl] h1,.mce-visualblocks[dir=rtl] h2,.mce-visualblocks[dir=rtl] h3,.mce-visualblocks[dir=rtl] h4,.mce-visualblocks[dir=rtl] h5,.mce-visualblocks[dir=rtl] h6,.mce-visualblocks[dir=rtl] hgroup,.mce-visualblocks[dir=rtl] ol,.mce-visualblocks[dir=rtl] p,.mce-visualblocks[dir=rtl] pre,.mce-visualblocks[dir=rtl] section,.mce-visualblocks[dir=rtl] ul{background-position-x:right;margin-right:3px}.mce-nbsp,.mce-shy{background:#aaa}.mce-shy::after{content:'-'} -/*# sourceMappingURL=content.inline.min.css.map */ diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.inline.min.css.map b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.inline.min.css.map deleted file mode 100644 index 4c18b0c2b0eb..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.inline.min.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["ui/default/content.inline.css"],"names":[],"mappings":";;;;;;AAMA,mCACE,WAAY,YAAY,sNAAsN,UAAU,OACxP,OAAQ,QACR,QAAS,aACT,OAAQ,eACR,QAAS,EAAE,IACX,oBAAqB,UACrB,iBAAkB,UAClB,oBAAqB,IACrB,iBAAkB,IAClB,gBAAiB,IACb,YAAa,IACjB,MAAO,cAET,sDACE,eAAgB,IAElB,mCACE,iBAAkB,QAEpB,2CACE,iBAAkB,QAEpB,8CACE,WAAY,KACZ,OAAQ,MAAO,EAEjB,sDACE,QAAS,gdACT,OAAQ,QACR,OAAQ,IACR,YAAa,OACb,WAAY,OACZ,SAAU,SACV,MAAO,IAET,6EACE,QAAS,shCAEX,gEACE,YAAa,EACb,aAAc,OAShB,uBACA,sBACE,MAAO,KACP,WAAY,IACZ,YAAa,EAAE,IAAI,KACnB,YAAa,QAAQ,CAAE,MAAM,CAAE,aAAa,CAAE,aAAa,CAAE,UAC7D,UAAW,IACX,WAAY,KACZ,YAAa,IACb,aAAc,OACd,WAAY,OACZ,UAAW,OACX,YAAa,IACb,cAAe,EACf,SAAU,EACV,gBAAiB,KACjB,YAAa,KACb,QAAS,KAKX,wCADA,uCADA,uCADA,sCAIE,YAAa,KACb,WAAY,QAKd,mCADA,kCADA,kCADA,iCAIE,YAAa,KACb,WAAY,QAEd,aACE,uBACA,sBACE,YAAa,MAIjB,sBACE,QAAS,IACT,OAAQ,KAAM,EACd,SAAU,KAEZ,iCACA,sBACE,WAAY,QAGd,iCACE,QAAS,KACT,cAAe,KACf,YAAa,OAKf,aAHA,eAEA,eADA,cAGE,MAAO,QAET,mBACE,MAAO,KAET,WACE,QAAS,GAIX,eAEA,gBAEA,eAHA,cAHA,gBAKA,cAJA,WAME,MAAO,KAGT,iBAGA,eADA,YAEA,gBALA,gBAEA,cAIE,MAAO,KAKT,4BACA,qBAHA,cADA,gBAEA,WAGE,MAAO,QACP,WAAY,mBAEd,cACA,kBACA,eACE,MAAO,KAGT,kBADA,gBAEE,MAAO,QAGT,iBADA,aAEA,gBACE,MAAO,KAGT,YADA,iBAEE,YAAa,IAEf,cACE,WAAY,OAEd,cACE,OAAQ,KAGV,kBACE,cAAe,WACf,UAAW,WAEb,oCACE,iBAAkB,KAClB,iBAAkB,aAClB,SAAU,SAEZ,2CACE,QAAS,KAEX,mCACE,KAAM,QACN,OAAQ,EACR,QAAS,EACT,SAAU,SACV,MAAO,KACP,IAAK,EAEP,2CACE,KAAM,WACN,UAAW,UACX,SAAU,SAEZ,0CACE,OAAQ,QAEV,yCACE,OAAQ,KAEV,2BACE,OAAQ,qkCAAqkC,CAAE,QAEjlC,oCACE,MAAO,KAET,qCACE,MAAO,MAET,4CACE,QAAS,MACT,YAAa,KACb,aAAc,KAEhB,oBACE,OAAQ,IAAI,MAAM,KAClB,QAAS,aACT,YAAa,EACb,OAAQ,EAAE,IAAI,EAAE,IAChB,SAAU,SAEZ,8BACE,WAAY,oFACZ,OAAQ,KACR,KAAM,EACN,SAAU,SACV,IAAK,EACL,MAAO,KAET,qDACE,QAAS,KAEX,YACE,WAAY,YAAY,0bAA0b,UAAU,OAC5d,OAAQ,IAAI,OAAO,KAErB,eACE,OAAQ,IAAI,OAAO,KACnB,OAAQ,QACR,QAAS,MACT,OAAQ,IACR,WAAY,KACZ,kBAAmB,OACnB,MAAO,KAET,aACE,eACE,OAAQ,GAGZ,0BACE,WAAY,oFACZ,OAAQ,KACR,KAAM,EACN,SAAU,SACV,IAAK,EACL,MAAO,KAET,iDACE,QAAS,KAEX,gBACE,QAAS,aACT,SAAU,SAGZ,uBAEA,sBAHA,uBAEA,sBAEE,QAAS,MACT,SAAU,OACV,QAAS,EACT,SAAU,SACV,MAAO,KAET,uBACE,YAAa,WAEf,uBACE,YAAa,OAEf,sBACE,YAAa,IAEf,sBACE,YAAa,KAGf,8BAEA,6BAHA,8BAEA,6BAEE,OAAQ,EACR,OAAQ,KACR,KAAM,EACN,SAAU,SACV,IAAK,EACL,MAAO,KAET,wCACE,SAAU,SAEZ,uEACE,MAAO,kBACP,QAAS,2BACT,SAAU,SAEZ,sFACE,KAAM,IAER,gFACE,MAAO,IAET,uCACE,iBAAkB,QAClB,aAAc,QACd,aAAc,MACd,aAAc,IACd,WAAY,WACZ,OAAQ,KACR,SAAU,SACV,MAAO,KACP,QAAS,MAEX,6CACE,iBAAkB,QAEpB,sDACE,OAAQ,YAEV,sDACE,OAAQ,YAEV,sDACE,OAAQ,YAEV,sDACE,OAAQ,YAEV,uCACE,QAAS,GACT,QAAS,IAAI,OAAO,KACpB,SAAU,SACV,QAAS,MAGX,kEADA,kEAEE,OAAQ,EAEV,qCACE,WAAY,KACZ,WAAY,gBACZ,OAAQ,IACR,cAAe,IACf,MAAO,KACP,QAAS,KACT,YAAa,WACb,UAAW,KACX,YAAa,KACb,OAAQ,IAAI,KACZ,QAAS,IACT,SAAU,SACV,YAAa,OACb,QAAS,MAEX,wBACE,SAAU,SAEZ,qBACE,OAAQ,EACR,OAAQ,QACR,SAAU,SACV,IAAK,EACL,MAAO,IAET,6BACE,iBAAkB,QAClB,cAAe,IACf,QAAS,GACT,QAAS,MACT,OAAQ,IACR,SAAU,SACV,MAAO,KACP,IAAK,KACL,MAAO,IAET,kCACE,iBAAkB,QAClB,cAAe,MACf,WAAY,WACZ,MAAO,KACP,QAAS,gBACT,QAAS,MACT,UAAW,KACX,YAAa,IACb,KAAM,KACN,WAAY,IACZ,UAAW,IACX,QAAS,EAAE,KACX,SAAU,SACV,IAAK,MACL,YAAa,OACb,QAAS,KAEX,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,sBACE,WAAY,QAAQ,ymCAAymC,UAAU,OAAO,OAC9oC,OAAQ,IAAI,MAAM,KAClB,WAAY,MACZ,UAAW,MAEb,kBACE,WAAY,KACZ,MAAO,KAET,2BACE,WAAY,KACZ,MAAO,KAET,2CACE,WAAY,KACZ,MAAO,KAET,sCACE,WAAY,KACZ,MAAO,KAIT,2CAEA,2CAJA,yCAGA,4CAEA,2CAJA,2CAKE,QAAS,IAAI,MAAM,QAErB,wCACE,QAAS,IAAI,MAAM,QACnB,eAAgB,IAElB,uEACE,QAAS,IAAI,MAAM,QAErB,uEACE,QAAS,IAAI,MAAM,QAErB,6DACE,OAAQ,YACR,QAAS,IAAI,MAAM,QAErB,oEACA,oEACE,QAAS,EAEX,sDACE,iBAAkB,QAEpB,kCACE,QAAS,IAAI,MAAM,QAErB,wCACA,wCACE,SAAU,SAEZ,wDACA,wDACE,WAAY,IAEd,mDACA,mDACE,WAAY,IAEd,0CACA,0CACE,QAAS,EACT,sBAAuB,KACvB,oBAAqB,KAClB,iBAAkB,KACjB,gBAAiB,KACb,YAAa,KAEvB,+CACA,+CACE,iBAAkB,sBAClB,OAAQ,IAAI,MAAM,sBAClB,OAAQ,KACR,QAAS,GACT,KAAM,KACN,eAAgB,SAChB,SAAU,SACV,MAAO,KACP,IAAK,KAEP,6CAA+C,yBAC7C,+CACA,+CACE,aAAc,oBAGlB,sCACE,WAAY,IAEd,iCACE,WAAY,IAEd,2BACE,iBAAkB,QAClB,QAAS,EACT,oBAAqB,KACrB,iBAAkB,KAClB,gBAAiB,KACjB,YAAa,KAEf,4BACE,OAAQ,WAEV,4BACE,OAAQ,WAEV,8DACE,QAAS,EAEX,uBACE,iBAAkB,oRAClB,oBAAqB,EAAE,iBACvB,kBAAmB,SACnB,gBAAiB,KAAK,IACtB,OAAQ,QACR,OAAQ,KAEV,0BACE,iBAAkB,2PAClB,oBAAqB,EAAE,iBACvB,kBAAmB,SACnB,gBAAiB,KAAK,IACtB,OAAQ,QAEV,SACE,OAAQ,IAAI,MAAM,KAEpB,YACE,OAAQ,IAEV,YACE,gBAAiB,KAGnB,8BASA,sCANA,iCAGA,iCALA,4BASA,oCANA,+BAGA,+BARA,kCASA,0CANA,qCAGA,qCAME,OAAQ,IAAI,OAAO,KAarB,0BAFA,0BAOA,wBANA,6BAHA,4CAYA,qBALA,6BADA,yBAZA,qBACA,qBACA,qBACA,qBACA,qBACA,qBASA,yBAGA,qBAlBA,oBAYA,sBAJA,0BASA,qBAGE,kBAAmB,UACnB,OAAQ,IAAI,OAAO,KACnB,YAAa,IACb,YAAa,KAEf,oBACE,iBAAkB,gHAEpB,qBACE,iBAAkB,oHAEpB,qBACE,iBAAkB,wHAEpB,qBACE,iBAAkB,oHAEpB,qBACE,iBAAkB,wHAEpB,qBACE,iBAAkB,wHAEpB,qBACE,iBAAkB,wHAEpB,4CACE,iBAAkB,4HAEpB,0BACE,iBAAkB,gKAEpB,0BACE,iBAAkB,gKAEpB,6BACE,iBAAkB,4LAEpB,0BACE,iBAAkB,wKAEpB,sBACE,iBAAkB,oIAEpB,yBACE,iBAAkB,wJAEpB,6BACE,OAAQ,IAAI,OAAO,KAErB,yBACE,iBAAkB,4JAEpB,wBACE,iBAAkB,gJAEpB,qBACE,iBAAkB,oHAEpB,qBACE,iBAAkB,oHAEpB,qBACE,iBAAkB,oHAapB,yCAFA,yCAOA,uCANA,4CAHA,2DAYA,oCALA,4CADA,wCAZA,oCACA,oCACA,oCACA,oCACA,oCACA,oCASA,wCAGA,oCAlBA,mCAYA,qCAJA,yCASA,oCAGE,YAAa,IAaf,mCAFA,mCAOA,iCANA,sCAHA,qDAYA,8BALA,sCADA,kCAZA,8BACA,8BACA,8BACA,8BACA,8BACA,8BASA,kCAGA,8BAlBA,6BAYA,+BAJA,mCASA,8BAGE,sBAAuB,MACvB,aAAc,IAEhB,UACA,SACE,WAAY,KAEd,gBACE,QAAS","file":"content.inline.min.css","sourcesContent":["/**\n * Copyright (c) Tiny Technologies, Inc. All rights reserved.\n * Licensed under the LGPL or a commercial license.\n * For LGPL see License.txt in the project root for license information.\n * For commercial licenses see https://www.tiny.cloud/\n */\n.mce-content-body .mce-item-anchor {\n background: transparent url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A\") no-repeat center;\n cursor: default;\n display: inline-block;\n height: 12px !important;\n padding: 0 2px;\n -webkit-user-modify: read-only;\n -moz-user-modify: read-only;\n -webkit-user-select: all;\n -moz-user-select: all;\n -ms-user-select: all;\n user-select: all;\n width: 8px !important;\n}\n.mce-content-body .mce-item-anchor[data-mce-selected] {\n outline-offset: 1px;\n}\n.tox-comments-visible .tox-comment {\n background-color: #fff0b7;\n}\n.tox-comments-visible .tox-comment--active {\n background-color: #ffe168;\n}\n.tox-checklist > li:not(.tox-checklist--hidden) {\n list-style: none;\n margin: 0.25em 0;\n}\n.tox-checklist > li:not(.tox-checklist--hidden)::before {\n content: url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A\");\n cursor: pointer;\n height: 1em;\n margin-left: -1.5em;\n margin-top: 0.125em;\n position: absolute;\n width: 1em;\n}\n.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before {\n content: url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A\");\n}\n[dir=rtl] .tox-checklist > li:not(.tox-checklist--hidden)::before {\n margin-left: 0;\n margin-right: -1.5em;\n}\n/* stylelint-disable */\n/* http://prismjs.com/ */\n/**\n * prism.js default theme for JavaScript, CSS and HTML\n * Based on dabblet (http://dabblet.com)\n * @author Lea Verou\n */\ncode[class*=\"language-\"],\npre[class*=\"language-\"] {\n color: black;\n background: none;\n text-shadow: 0 1px white;\n font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;\n font-size: 1em;\n text-align: left;\n white-space: pre;\n word-spacing: normal;\n word-break: normal;\n word-wrap: normal;\n line-height: 1.5;\n -moz-tab-size: 4;\n tab-size: 4;\n -webkit-hyphens: none;\n -ms-hyphens: none;\n hyphens: none;\n}\npre[class*=\"language-\"]::-moz-selection,\npre[class*=\"language-\"] ::-moz-selection,\ncode[class*=\"language-\"]::-moz-selection,\ncode[class*=\"language-\"] ::-moz-selection {\n text-shadow: none;\n background: #b3d4fc;\n}\npre[class*=\"language-\"]::selection,\npre[class*=\"language-\"] ::selection,\ncode[class*=\"language-\"]::selection,\ncode[class*=\"language-\"] ::selection {\n text-shadow: none;\n background: #b3d4fc;\n}\n@media print {\n code[class*=\"language-\"],\n pre[class*=\"language-\"] {\n text-shadow: none;\n }\n}\n/* Code blocks */\npre[class*=\"language-\"] {\n padding: 1em;\n margin: 0.5em 0;\n overflow: auto;\n}\n:not(pre) > code[class*=\"language-\"],\npre[class*=\"language-\"] {\n background: #f5f2f0;\n}\n/* Inline code */\n:not(pre) > code[class*=\"language-\"] {\n padding: 0.1em;\n border-radius: 0.3em;\n white-space: normal;\n}\n.token.comment,\n.token.prolog,\n.token.doctype,\n.token.cdata {\n color: slategray;\n}\n.token.punctuation {\n color: #999;\n}\n.namespace {\n opacity: 0.7;\n}\n.token.property,\n.token.tag,\n.token.boolean,\n.token.number,\n.token.constant,\n.token.symbol,\n.token.deleted {\n color: #905;\n}\n.token.selector,\n.token.attr-name,\n.token.string,\n.token.char,\n.token.builtin,\n.token.inserted {\n color: #690;\n}\n.token.operator,\n.token.entity,\n.token.url,\n.language-css .token.string,\n.style .token.string {\n color: #9a6e3a;\n background: hsla(0, 0%, 100%, 0.5);\n}\n.token.atrule,\n.token.attr-value,\n.token.keyword {\n color: #07a;\n}\n.token.function,\n.token.class-name {\n color: #DD4A68;\n}\n.token.regex,\n.token.important,\n.token.variable {\n color: #e90;\n}\n.token.important,\n.token.bold {\n font-weight: bold;\n}\n.token.italic {\n font-style: italic;\n}\n.token.entity {\n cursor: help;\n}\n/* stylelint-enable */\n.mce-content-body {\n overflow-wrap: break-word;\n word-wrap: break-word;\n}\n.mce-content-body .mce-visual-caret {\n background-color: black;\n background-color: currentColor;\n position: absolute;\n}\n.mce-content-body .mce-visual-caret-hidden {\n display: none;\n}\n.mce-content-body *[data-mce-caret] {\n left: -1000px;\n margin: 0;\n padding: 0;\n position: absolute;\n right: auto;\n top: 0;\n}\n.mce-content-body .mce-offscreen-selection {\n left: -2000000px;\n max-width: 1000000px;\n position: absolute;\n}\n.mce-content-body *[contentEditable=false] {\n cursor: default;\n}\n.mce-content-body *[contentEditable=true] {\n cursor: text;\n}\n.tox-cursor-format-painter {\n cursor: url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A\"), default;\n}\n.mce-content-body figure.align-left {\n float: left;\n}\n.mce-content-body figure.align-right {\n float: right;\n}\n.mce-content-body figure.image.align-center {\n display: table;\n margin-left: auto;\n margin-right: auto;\n}\n.mce-preview-object {\n border: 1px solid gray;\n display: inline-block;\n line-height: 0;\n margin: 0 2px 0 2px;\n position: relative;\n}\n.mce-preview-object .mce-shim {\n background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n}\n.mce-preview-object[data-mce-selected=\"2\"] .mce-shim {\n display: none;\n}\n.mce-object {\n background: transparent url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A\") no-repeat center;\n border: 1px dashed #aaa;\n}\n.mce-pagebreak {\n border: 1px dashed #aaa;\n cursor: default;\n display: block;\n height: 5px;\n margin-top: 15px;\n page-break-before: always;\n width: 100%;\n}\n@media print {\n .mce-pagebreak {\n border: 0;\n }\n}\n.tiny-pageembed .mce-shim {\n background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n}\n.tiny-pageembed[data-mce-selected=\"2\"] .mce-shim {\n display: none;\n}\n.tiny-pageembed {\n display: inline-block;\n position: relative;\n}\n.tiny-pageembed--21by9,\n.tiny-pageembed--16by9,\n.tiny-pageembed--4by3,\n.tiny-pageembed--1by1 {\n display: block;\n overflow: hidden;\n padding: 0;\n position: relative;\n width: 100%;\n}\n.tiny-pageembed--21by9 {\n padding-top: 42.857143%;\n}\n.tiny-pageembed--16by9 {\n padding-top: 56.25%;\n}\n.tiny-pageembed--4by3 {\n padding-top: 75%;\n}\n.tiny-pageembed--1by1 {\n padding-top: 100%;\n}\n.tiny-pageembed--21by9 iframe,\n.tiny-pageembed--16by9 iframe,\n.tiny-pageembed--4by3 iframe,\n.tiny-pageembed--1by1 iframe {\n border: 0;\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n}\n.mce-content-body[data-mce-placeholder] {\n position: relative;\n}\n.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before {\n color: rgba(34, 47, 62, 0.7);\n content: attr(data-mce-placeholder);\n position: absolute;\n}\n.mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before {\n left: 1px;\n}\n.mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before {\n right: 1px;\n}\n.mce-content-body div.mce-resizehandle {\n background-color: #4099ff;\n border-color: #4099ff;\n border-style: solid;\n border-width: 1px;\n box-sizing: border-box;\n height: 10px;\n position: absolute;\n width: 10px;\n z-index: 10000;\n}\n.mce-content-body div.mce-resizehandle:hover {\n background-color: #4099ff;\n}\n.mce-content-body div.mce-resizehandle:nth-of-type(1) {\n cursor: nwse-resize;\n}\n.mce-content-body div.mce-resizehandle:nth-of-type(2) {\n cursor: nesw-resize;\n}\n.mce-content-body div.mce-resizehandle:nth-of-type(3) {\n cursor: nwse-resize;\n}\n.mce-content-body div.mce-resizehandle:nth-of-type(4) {\n cursor: nesw-resize;\n}\n.mce-content-body .mce-clonedresizable {\n opacity: 0.5;\n outline: 1px dashed black;\n position: absolute;\n z-index: 10000;\n}\n.mce-content-body .mce-clonedresizable.mce-resizetable-columns th,\n.mce-content-body .mce-clonedresizable.mce-resizetable-columns td {\n border: 0;\n}\n.mce-content-body .mce-resize-helper {\n background: #555;\n background: rgba(0, 0, 0, 0.75);\n border: 1px;\n border-radius: 3px;\n color: white;\n display: none;\n font-family: sans-serif;\n font-size: 12px;\n line-height: 14px;\n margin: 5px 10px;\n padding: 5px;\n position: absolute;\n white-space: nowrap;\n z-index: 10001;\n}\n.tox-rtc-user-selection {\n position: relative;\n}\n.tox-rtc-user-cursor {\n bottom: 0;\n cursor: default;\n position: absolute;\n top: 0;\n width: 2px;\n}\n.tox-rtc-user-cursor::before {\n background-color: inherit;\n border-radius: 50%;\n content: '';\n display: block;\n height: 8px;\n position: absolute;\n right: -3px;\n top: -3px;\n width: 8px;\n}\n.tox-rtc-user-cursor:hover::after {\n background-color: inherit;\n border-radius: 100px;\n box-sizing: border-box;\n color: #fff;\n content: attr(data-user);\n display: block;\n font-size: 12px;\n font-weight: bold;\n left: -5px;\n min-height: 8px;\n min-width: 8px;\n padding: 0 12px;\n position: absolute;\n top: -11px;\n white-space: nowrap;\n z-index: 1000;\n}\n.tox-rtc-user-selection--1 .tox-rtc-user-cursor {\n background-color: #2dc26b;\n}\n.tox-rtc-user-selection--2 .tox-rtc-user-cursor {\n background-color: #e03e2d;\n}\n.tox-rtc-user-selection--3 .tox-rtc-user-cursor {\n background-color: #f1c40f;\n}\n.tox-rtc-user-selection--4 .tox-rtc-user-cursor {\n background-color: #3598db;\n}\n.tox-rtc-user-selection--5 .tox-rtc-user-cursor {\n background-color: #b96ad9;\n}\n.tox-rtc-user-selection--6 .tox-rtc-user-cursor {\n background-color: #e67e23;\n}\n.tox-rtc-user-selection--7 .tox-rtc-user-cursor {\n background-color: #aaa69d;\n}\n.tox-rtc-user-selection--8 .tox-rtc-user-cursor {\n background-color: #f368e0;\n}\n.tox-rtc-remote-image {\n background: #eaeaea url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2236%22%20height%3D%2212%22%20viewBox%3D%220%200%2036%2012%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Ccircle%20cx%3D%226%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2218%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.33s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2230%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.66s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A\") no-repeat center center;\n border: 1px solid #ccc;\n min-height: 240px;\n min-width: 320px;\n}\n.mce-match-marker {\n background: #aaa;\n color: #fff;\n}\n.mce-match-marker-selected {\n background: #39f;\n color: #fff;\n}\n.mce-match-marker-selected::-moz-selection {\n background: #39f;\n color: #fff;\n}\n.mce-match-marker-selected::selection {\n background: #39f;\n color: #fff;\n}\n.mce-content-body img[data-mce-selected],\n.mce-content-body video[data-mce-selected],\n.mce-content-body audio[data-mce-selected],\n.mce-content-body object[data-mce-selected],\n.mce-content-body embed[data-mce-selected],\n.mce-content-body table[data-mce-selected] {\n outline: 3px solid #b4d7ff;\n}\n.mce-content-body hr[data-mce-selected] {\n outline: 3px solid #b4d7ff;\n outline-offset: 1px;\n}\n.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus {\n outline: 3px solid #b4d7ff;\n}\n.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover {\n outline: 3px solid #b4d7ff;\n}\n.mce-content-body *[contentEditable=false][data-mce-selected] {\n cursor: not-allowed;\n outline: 3px solid #b4d7ff;\n}\n.mce-content-body.mce-content-readonly *[contentEditable=true]:focus,\n.mce-content-body.mce-content-readonly *[contentEditable=true]:hover {\n outline: none;\n}\n.mce-content-body *[data-mce-selected=\"inline-boundary\"] {\n background-color: #b4d7ff;\n}\n.mce-content-body .mce-edit-focus {\n outline: 3px solid #b4d7ff;\n}\n.mce-content-body td[data-mce-selected],\n.mce-content-body th[data-mce-selected] {\n position: relative;\n}\n.mce-content-body td[data-mce-selected]::-moz-selection,\n.mce-content-body th[data-mce-selected]::-moz-selection {\n background: none;\n}\n.mce-content-body td[data-mce-selected]::selection,\n.mce-content-body th[data-mce-selected]::selection {\n background: none;\n}\n.mce-content-body td[data-mce-selected] *,\n.mce-content-body th[data-mce-selected] * {\n outline: none;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.mce-content-body td[data-mce-selected]::after,\n.mce-content-body th[data-mce-selected]::after {\n background-color: rgba(180, 215, 255, 0.35);\n border: 1px solid rgba(180, 215, 255, 0.35);\n bottom: -1px;\n content: '';\n left: -1px;\n mix-blend-mode: multiply;\n position: absolute;\n right: -1px;\n top: -1px;\n}\n@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n .mce-content-body td[data-mce-selected]::after,\n .mce-content-body th[data-mce-selected]::after {\n border-color: rgba(0, 84, 180, 0.35);\n }\n}\n.mce-content-body img::-moz-selection {\n background: none;\n}\n.mce-content-body img::selection {\n background: none;\n}\n.ephox-snooker-resizer-bar {\n background-color: #b4d7ff;\n opacity: 0;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.ephox-snooker-resizer-cols {\n cursor: col-resize;\n}\n.ephox-snooker-resizer-rows {\n cursor: row-resize;\n}\n.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging {\n opacity: 1;\n}\n.mce-spellchecker-word {\n background-image: url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A\");\n background-position: 0 calc(100% + 1px);\n background-repeat: repeat-x;\n background-size: auto 6px;\n cursor: default;\n height: 2rem;\n}\n.mce-spellchecker-grammar {\n background-image: url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A\");\n background-position: 0 calc(100% + 1px);\n background-repeat: repeat-x;\n background-size: auto 6px;\n cursor: default;\n}\n.mce-toc {\n border: 1px solid gray;\n}\n.mce-toc h2 {\n margin: 4px;\n}\n.mce-toc li {\n list-style-type: none;\n}\ntable[style*=\"border-width: 0px\"],\n.mce-item-table:not([border]),\n.mce-item-table[border=\"0\"],\ntable[style*=\"border-width: 0px\"] td,\n.mce-item-table:not([border]) td,\n.mce-item-table[border=\"0\"] td,\ntable[style*=\"border-width: 0px\"] th,\n.mce-item-table:not([border]) th,\n.mce-item-table[border=\"0\"] th,\ntable[style*=\"border-width: 0px\"] caption,\n.mce-item-table:not([border]) caption,\n.mce-item-table[border=\"0\"] caption {\n border: 1px dashed #bbb;\n}\n.mce-visualblocks p,\n.mce-visualblocks h1,\n.mce-visualblocks h2,\n.mce-visualblocks h3,\n.mce-visualblocks h4,\n.mce-visualblocks h5,\n.mce-visualblocks h6,\n.mce-visualblocks div:not([data-mce-bogus]),\n.mce-visualblocks section,\n.mce-visualblocks article,\n.mce-visualblocks blockquote,\n.mce-visualblocks address,\n.mce-visualblocks pre,\n.mce-visualblocks figure,\n.mce-visualblocks figcaption,\n.mce-visualblocks hgroup,\n.mce-visualblocks aside,\n.mce-visualblocks ul,\n.mce-visualblocks ol,\n.mce-visualblocks dl {\n background-repeat: no-repeat;\n border: 1px dashed #bbb;\n margin-left: 3px;\n padding-top: 10px;\n}\n.mce-visualblocks p {\n background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7);\n}\n.mce-visualblocks h1 {\n background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==);\n}\n.mce-visualblocks h2 {\n background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==);\n}\n.mce-visualblocks h3 {\n background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7);\n}\n.mce-visualblocks h4 {\n background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==);\n}\n.mce-visualblocks h5 {\n background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==);\n}\n.mce-visualblocks h6 {\n background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==);\n}\n.mce-visualblocks div:not([data-mce-bogus]) {\n background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7);\n}\n.mce-visualblocks section {\n background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=);\n}\n.mce-visualblocks article {\n background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7);\n}\n.mce-visualblocks blockquote {\n background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7);\n}\n.mce-visualblocks address {\n background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=);\n}\n.mce-visualblocks pre {\n background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==);\n}\n.mce-visualblocks figure {\n background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7);\n}\n.mce-visualblocks figcaption {\n border: 1px dashed #bbb;\n}\n.mce-visualblocks hgroup {\n background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7);\n}\n.mce-visualblocks aside {\n background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=);\n}\n.mce-visualblocks ul {\n background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==);\n}\n.mce-visualblocks ol {\n background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==);\n}\n.mce-visualblocks dl {\n background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==);\n}\n.mce-visualblocks:not([dir=rtl]) p,\n.mce-visualblocks:not([dir=rtl]) h1,\n.mce-visualblocks:not([dir=rtl]) h2,\n.mce-visualblocks:not([dir=rtl]) h3,\n.mce-visualblocks:not([dir=rtl]) h4,\n.mce-visualblocks:not([dir=rtl]) h5,\n.mce-visualblocks:not([dir=rtl]) h6,\n.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]),\n.mce-visualblocks:not([dir=rtl]) section,\n.mce-visualblocks:not([dir=rtl]) article,\n.mce-visualblocks:not([dir=rtl]) blockquote,\n.mce-visualblocks:not([dir=rtl]) address,\n.mce-visualblocks:not([dir=rtl]) pre,\n.mce-visualblocks:not([dir=rtl]) figure,\n.mce-visualblocks:not([dir=rtl]) figcaption,\n.mce-visualblocks:not([dir=rtl]) hgroup,\n.mce-visualblocks:not([dir=rtl]) aside,\n.mce-visualblocks:not([dir=rtl]) ul,\n.mce-visualblocks:not([dir=rtl]) ol,\n.mce-visualblocks:not([dir=rtl]) dl {\n margin-left: 3px;\n}\n.mce-visualblocks[dir=rtl] p,\n.mce-visualblocks[dir=rtl] h1,\n.mce-visualblocks[dir=rtl] h2,\n.mce-visualblocks[dir=rtl] h3,\n.mce-visualblocks[dir=rtl] h4,\n.mce-visualblocks[dir=rtl] h5,\n.mce-visualblocks[dir=rtl] h6,\n.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]),\n.mce-visualblocks[dir=rtl] section,\n.mce-visualblocks[dir=rtl] article,\n.mce-visualblocks[dir=rtl] blockquote,\n.mce-visualblocks[dir=rtl] address,\n.mce-visualblocks[dir=rtl] pre,\n.mce-visualblocks[dir=rtl] figure,\n.mce-visualblocks[dir=rtl] figcaption,\n.mce-visualblocks[dir=rtl] hgroup,\n.mce-visualblocks[dir=rtl] aside,\n.mce-visualblocks[dir=rtl] ul,\n.mce-visualblocks[dir=rtl] ol,\n.mce-visualblocks[dir=rtl] dl {\n background-position-x: right;\n margin-right: 3px;\n}\n.mce-nbsp,\n.mce-shy {\n background: #aaa;\n}\n.mce-shy::after {\n content: '-';\n}\n"]} \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.min.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.min.css deleted file mode 100644 index fe2b07b01fed..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.min.css +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ -.mce-content-body .mce-item-anchor{background:transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;cursor:default;display:inline-block;height:12px!important;padding:0 2px;-webkit-user-modify:read-only;-moz-user-modify:read-only;-webkit-user-select:all;-moz-user-select:all;-ms-user-select:all;user-select:all;width:8px!important}.mce-content-body .mce-item-anchor[data-mce-selected]{outline-offset:1px}.tox-comments-visible .tox-comment{background-color:#fff0b7}.tox-comments-visible .tox-comment--active{background-color:#ffe168}.tox-checklist>li:not(.tox-checklist--hidden){list-style:none;margin:.25em 0}.tox-checklist>li:not(.tox-checklist--hidden)::before{content:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A");cursor:pointer;height:1em;margin-left:-1.5em;margin-top:.125em;position:absolute;width:1em}.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before{content:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A")}[dir=rtl] .tox-checklist>li:not(.tox-checklist--hidden)::before{margin-left:0;margin-right:-1.5em}code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;tab-size:4;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::-moz-selection,code[class*=language-]::-moz-selection,pre[class*=language-] ::-moz-selection,pre[class*=language-]::-moz-selection{text-shadow:none;background:#b3d4fc}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.mce-content-body{overflow-wrap:break-word;word-wrap:break-word}.mce-content-body .mce-visual-caret{background-color:#000;background-color:currentColor;position:absolute}.mce-content-body .mce-visual-caret-hidden{display:none}.mce-content-body [data-mce-caret]{left:-1000px;margin:0;padding:0;position:absolute;right:auto;top:0}.mce-content-body .mce-offscreen-selection{left:-2000000px;max-width:1000000px;position:absolute}.mce-content-body [contentEditable=false]{cursor:default}.mce-content-body [contentEditable=true]{cursor:text}.tox-cursor-format-painter{cursor:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"),default}.mce-content-body figure.align-left{float:left}.mce-content-body figure.align-right{float:right}.mce-content-body figure.image.align-center{display:table;margin-left:auto;margin-right:auto}.mce-preview-object{border:1px solid gray;display:inline-block;line-height:0;margin:0 2px 0 2px;position:relative}.mce-preview-object .mce-shim{background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);height:100%;left:0;position:absolute;top:0;width:100%}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-object{background:transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;border:1px dashed #aaa}.mce-pagebreak{border:1px dashed #aaa;cursor:default;display:block;height:5px;margin-top:15px;page-break-before:always;width:100%}@media print{.mce-pagebreak{border:0}}.tiny-pageembed .mce-shim{background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);height:100%;left:0;position:absolute;top:0;width:100%}.tiny-pageembed[data-mce-selected="2"] .mce-shim{display:none}.tiny-pageembed{display:inline-block;position:relative}.tiny-pageembed--16by9,.tiny-pageembed--1by1,.tiny-pageembed--21by9,.tiny-pageembed--4by3{display:block;overflow:hidden;padding:0;position:relative;width:100%}.tiny-pageembed--21by9{padding-top:42.857143%}.tiny-pageembed--16by9{padding-top:56.25%}.tiny-pageembed--4by3{padding-top:75%}.tiny-pageembed--1by1{padding-top:100%}.tiny-pageembed--16by9 iframe,.tiny-pageembed--1by1 iframe,.tiny-pageembed--21by9 iframe,.tiny-pageembed--4by3 iframe{border:0;height:100%;left:0;position:absolute;top:0;width:100%}.mce-content-body[data-mce-placeholder]{position:relative}.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before{color:rgba(34,47,62,.7);content:attr(data-mce-placeholder);position:absolute}.mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before{left:1px}.mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before{right:1px}.mce-content-body div.mce-resizehandle{background-color:#4099ff;border-color:#4099ff;border-style:solid;border-width:1px;box-sizing:border-box;height:10px;position:absolute;width:10px;z-index:10000}.mce-content-body div.mce-resizehandle:hover{background-color:#4099ff}.mce-content-body div.mce-resizehandle:nth-of-type(1){cursor:nwse-resize}.mce-content-body div.mce-resizehandle:nth-of-type(2){cursor:nesw-resize}.mce-content-body div.mce-resizehandle:nth-of-type(3){cursor:nwse-resize}.mce-content-body div.mce-resizehandle:nth-of-type(4){cursor:nesw-resize}.mce-content-body .mce-clonedresizable{opacity:.5;outline:1px dashed #000;position:absolute;z-index:10000}.mce-content-body .mce-clonedresizable.mce-resizetable-columns td,.mce-content-body .mce-clonedresizable.mce-resizetable-columns th{border:0}.mce-content-body .mce-resize-helper{background:#555;background:rgba(0,0,0,.75);border:1px;border-radius:3px;color:#fff;display:none;font-family:sans-serif;font-size:12px;line-height:14px;margin:5px 10px;padding:5px;position:absolute;white-space:nowrap;z-index:10001}.tox-rtc-user-selection{position:relative}.tox-rtc-user-cursor{bottom:0;cursor:default;position:absolute;top:0;width:2px}.tox-rtc-user-cursor::before{background-color:inherit;border-radius:50%;content:'';display:block;height:8px;position:absolute;right:-3px;top:-3px;width:8px}.tox-rtc-user-cursor:hover::after{background-color:inherit;border-radius:100px;box-sizing:border-box;color:#fff;content:attr(data-user);display:block;font-size:12px;font-weight:700;left:-5px;min-height:8px;min-width:8px;padding:0 12px;position:absolute;top:-11px;white-space:nowrap;z-index:1000}.tox-rtc-user-selection--1 .tox-rtc-user-cursor{background-color:#2dc26b}.tox-rtc-user-selection--2 .tox-rtc-user-cursor{background-color:#e03e2d}.tox-rtc-user-selection--3 .tox-rtc-user-cursor{background-color:#f1c40f}.tox-rtc-user-selection--4 .tox-rtc-user-cursor{background-color:#3598db}.tox-rtc-user-selection--5 .tox-rtc-user-cursor{background-color:#b96ad9}.tox-rtc-user-selection--6 .tox-rtc-user-cursor{background-color:#e67e23}.tox-rtc-user-selection--7 .tox-rtc-user-cursor{background-color:#aaa69d}.tox-rtc-user-selection--8 .tox-rtc-user-cursor{background-color:#f368e0}.tox-rtc-remote-image{background:#eaeaea url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2236%22%20height%3D%2212%22%20viewBox%3D%220%200%2036%2012%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Ccircle%20cx%3D%226%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2218%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.33s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2230%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.66s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A") no-repeat center center;border:1px solid #ccc;min-height:240px;min-width:320px}.mce-match-marker{background:#aaa;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-match-marker-selected::-moz-selection{background:#39f;color:#fff}.mce-match-marker-selected::selection{background:#39f;color:#fff}.mce-content-body audio[data-mce-selected],.mce-content-body embed[data-mce-selected],.mce-content-body img[data-mce-selected],.mce-content-body object[data-mce-selected],.mce-content-body table[data-mce-selected],.mce-content-body video[data-mce-selected]{outline:3px solid #b4d7ff}.mce-content-body hr[data-mce-selected]{outline:3px solid #b4d7ff;outline-offset:1px}.mce-content-body [contentEditable=false] [contentEditable=true]:focus{outline:3px solid #b4d7ff}.mce-content-body [contentEditable=false] [contentEditable=true]:hover{outline:3px solid #b4d7ff}.mce-content-body [contentEditable=false][data-mce-selected]{cursor:not-allowed;outline:3px solid #b4d7ff}.mce-content-body.mce-content-readonly [contentEditable=true]:focus,.mce-content-body.mce-content-readonly [contentEditable=true]:hover{outline:0}.mce-content-body [data-mce-selected=inline-boundary]{background-color:#b4d7ff}.mce-content-body .mce-edit-focus{outline:3px solid #b4d7ff}.mce-content-body td[data-mce-selected],.mce-content-body th[data-mce-selected]{position:relative}.mce-content-body td[data-mce-selected]::-moz-selection,.mce-content-body th[data-mce-selected]::-moz-selection{background:0 0}.mce-content-body td[data-mce-selected]::selection,.mce-content-body th[data-mce-selected]::selection{background:0 0}.mce-content-body td[data-mce-selected] *,.mce-content-body th[data-mce-selected] *{outline:0;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mce-content-body td[data-mce-selected]::after,.mce-content-body th[data-mce-selected]::after{background-color:rgba(180,215,255,.35);border:1px solid rgba(180,215,255,.35);bottom:-1px;content:'';left:-1px;mix-blend-mode:multiply;position:absolute;right:-1px;top:-1px}@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){.mce-content-body td[data-mce-selected]::after,.mce-content-body th[data-mce-selected]::after{border-color:rgba(0,84,180,.35)}}.mce-content-body img::-moz-selection{background:0 0}.mce-content-body img::selection{background:0 0}.ephox-snooker-resizer-bar{background-color:#b4d7ff;opacity:0;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ephox-snooker-resizer-cols{cursor:col-resize}.ephox-snooker-resizer-rows{cursor:row-resize}.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity:1}.mce-spellchecker-word{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position:0 calc(100% + 1px);background-repeat:repeat-x;background-size:auto 6px;cursor:default;height:2rem}.mce-spellchecker-grammar{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position:0 calc(100% + 1px);background-repeat:repeat-x;background-size:auto 6px;cursor:default}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-item-table:not([border]),.mce-item-table:not([border]) caption,.mce-item-table:not([border]) td,.mce-item-table:not([border]) th,.mce-item-table[border="0"],.mce-item-table[border="0"] caption,.mce-item-table[border="0"] td,.mce-item-table[border="0"] th,table[style*="border-width: 0px"],table[style*="border-width: 0px"] caption,table[style*="border-width: 0px"] td,table[style*="border-width: 0px"] th{border:1px dashed #bbb}.mce-visualblocks address,.mce-visualblocks article,.mce-visualblocks aside,.mce-visualblocks blockquote,.mce-visualblocks div:not([data-mce-bogus]),.mce-visualblocks dl,.mce-visualblocks figcaption,.mce-visualblocks figure,.mce-visualblocks h1,.mce-visualblocks h2,.mce-visualblocks h3,.mce-visualblocks h4,.mce-visualblocks h5,.mce-visualblocks h6,.mce-visualblocks hgroup,.mce-visualblocks ol,.mce-visualblocks p,.mce-visualblocks pre,.mce-visualblocks section,.mce-visualblocks ul{background-repeat:no-repeat;border:1px dashed #bbb;margin-left:3px;padding-top:10px}.mce-visualblocks p{background-image:url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7)}.mce-visualblocks h1{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==)}.mce-visualblocks h2{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==)}.mce-visualblocks h3{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7)}.mce-visualblocks h4{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==)}.mce-visualblocks h5{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==)}.mce-visualblocks h6{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==)}.mce-visualblocks div:not([data-mce-bogus]){background-image:url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7)}.mce-visualblocks section{background-image:url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=)}.mce-visualblocks article{background-image:url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7)}.mce-visualblocks blockquote{background-image:url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7)}.mce-visualblocks address{background-image:url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=)}.mce-visualblocks pre{background-image:url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==)}.mce-visualblocks figure{background-image:url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7)}.mce-visualblocks figcaption{border:1px dashed #bbb}.mce-visualblocks hgroup{background-image:url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7)}.mce-visualblocks aside{background-image:url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=)}.mce-visualblocks ul{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==)}.mce-visualblocks ol{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==)}.mce-visualblocks dl{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==)}.mce-visualblocks:not([dir=rtl]) address,.mce-visualblocks:not([dir=rtl]) article,.mce-visualblocks:not([dir=rtl]) aside,.mce-visualblocks:not([dir=rtl]) blockquote,.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]),.mce-visualblocks:not([dir=rtl]) dl,.mce-visualblocks:not([dir=rtl]) figcaption,.mce-visualblocks:not([dir=rtl]) figure,.mce-visualblocks:not([dir=rtl]) h1,.mce-visualblocks:not([dir=rtl]) h2,.mce-visualblocks:not([dir=rtl]) h3,.mce-visualblocks:not([dir=rtl]) h4,.mce-visualblocks:not([dir=rtl]) h5,.mce-visualblocks:not([dir=rtl]) h6,.mce-visualblocks:not([dir=rtl]) hgroup,.mce-visualblocks:not([dir=rtl]) ol,.mce-visualblocks:not([dir=rtl]) p,.mce-visualblocks:not([dir=rtl]) pre,.mce-visualblocks:not([dir=rtl]) section,.mce-visualblocks:not([dir=rtl]) ul{margin-left:3px}.mce-visualblocks[dir=rtl] address,.mce-visualblocks[dir=rtl] article,.mce-visualblocks[dir=rtl] aside,.mce-visualblocks[dir=rtl] blockquote,.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]),.mce-visualblocks[dir=rtl] dl,.mce-visualblocks[dir=rtl] figcaption,.mce-visualblocks[dir=rtl] figure,.mce-visualblocks[dir=rtl] h1,.mce-visualblocks[dir=rtl] h2,.mce-visualblocks[dir=rtl] h3,.mce-visualblocks[dir=rtl] h4,.mce-visualblocks[dir=rtl] h5,.mce-visualblocks[dir=rtl] h6,.mce-visualblocks[dir=rtl] hgroup,.mce-visualblocks[dir=rtl] ol,.mce-visualblocks[dir=rtl] p,.mce-visualblocks[dir=rtl] pre,.mce-visualblocks[dir=rtl] section,.mce-visualblocks[dir=rtl] ul{background-position-x:right;margin-right:3px}.mce-nbsp,.mce-shy{background:#aaa}.mce-shy::after{content:'-'}body{font-family:sans-serif}table{border-collapse:collapse} -/*# sourceMappingURL=content.min.css.map */ diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.min.css.map b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.min.css.map deleted file mode 100644 index 4876c0429f06..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.min.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["ui/default/content.css"],"names":[],"mappings":";;;;;;AAMA,mCACE,WAAY,YAAY,sNAAsN,UAAU,OACxP,OAAQ,QACR,QAAS,aACT,OAAQ,eACR,QAAS,EAAE,IACX,oBAAqB,UACrB,iBAAkB,UAClB,oBAAqB,IACrB,iBAAkB,IAClB,gBAAiB,IACb,YAAa,IACjB,MAAO,cAET,sDACE,eAAgB,IAElB,mCACE,iBAAkB,QAEpB,2CACE,iBAAkB,QAEpB,8CACE,WAAY,KACZ,OAAQ,MAAO,EAEjB,sDACE,QAAS,gdACT,OAAQ,QACR,OAAQ,IACR,YAAa,OACb,WAAY,OACZ,SAAU,SACV,MAAO,IAET,6EACE,QAAS,shCAEX,gEACE,YAAa,EACb,aAAc,OAShB,uBACA,sBACE,MAAO,KACP,WAAY,IACZ,YAAa,EAAE,IAAI,KACnB,YAAa,QAAQ,CAAE,MAAM,CAAE,aAAa,CAAE,aAAa,CAAE,UAC7D,UAAW,IACX,WAAY,KACZ,YAAa,IACb,aAAc,OACd,WAAY,OACZ,UAAW,OACX,YAAa,IACb,cAAe,EACf,SAAU,EACV,gBAAiB,KACjB,YAAa,KACb,QAAS,KAKX,wCADA,uCADA,uCADA,sCAIE,YAAa,KACb,WAAY,QAKd,mCADA,kCADA,kCADA,iCAIE,YAAa,KACb,WAAY,QAEd,aACE,uBACA,sBACE,YAAa,MAIjB,sBACE,QAAS,IACT,OAAQ,KAAM,EACd,SAAU,KAEZ,iCACA,sBACE,WAAY,QAGd,iCACE,QAAS,KACT,cAAe,KACf,YAAa,OAKf,aAHA,eAEA,eADA,cAGE,MAAO,QAET,mBACE,MAAO,KAET,WACE,QAAS,GAIX,eAEA,gBAEA,eAHA,cAHA,gBAKA,cAJA,WAME,MAAO,KAGT,iBAGA,eADA,YAEA,gBALA,gBAEA,cAIE,MAAO,KAKT,4BACA,qBAHA,cADA,gBAEA,WAGE,MAAO,QACP,WAAY,mBAEd,cACA,kBACA,eACE,MAAO,KAGT,kBADA,gBAEE,MAAO,QAGT,iBADA,aAEA,gBACE,MAAO,KAGT,YADA,iBAEE,YAAa,IAEf,cACE,WAAY,OAEd,cACE,OAAQ,KAGV,kBACE,cAAe,WACf,UAAW,WAEb,oCACE,iBAAkB,KAClB,iBAAkB,aAClB,SAAU,SAEZ,2CACE,QAAS,KAEX,mCACE,KAAM,QACN,OAAQ,EACR,QAAS,EACT,SAAU,SACV,MAAO,KACP,IAAK,EAEP,2CACE,KAAM,WACN,UAAW,UACX,SAAU,SAEZ,0CACE,OAAQ,QAEV,yCACE,OAAQ,KAEV,2BACE,OAAQ,qkCAAqkC,CAAE,QAEjlC,oCACE,MAAO,KAET,qCACE,MAAO,MAET,4CACE,QAAS,MACT,YAAa,KACb,aAAc,KAEhB,oBACE,OAAQ,IAAI,MAAM,KAClB,QAAS,aACT,YAAa,EACb,OAAQ,EAAE,IAAI,EAAE,IAChB,SAAU,SAEZ,8BACE,WAAY,oFACZ,OAAQ,KACR,KAAM,EACN,SAAU,SACV,IAAK,EACL,MAAO,KAET,qDACE,QAAS,KAEX,YACE,WAAY,YAAY,0bAA0b,UAAU,OAC5d,OAAQ,IAAI,OAAO,KAErB,eACE,OAAQ,IAAI,OAAO,KACnB,OAAQ,QACR,QAAS,MACT,OAAQ,IACR,WAAY,KACZ,kBAAmB,OACnB,MAAO,KAET,aACE,eACE,OAAQ,GAGZ,0BACE,WAAY,oFACZ,OAAQ,KACR,KAAM,EACN,SAAU,SACV,IAAK,EACL,MAAO,KAET,iDACE,QAAS,KAEX,gBACE,QAAS,aACT,SAAU,SAGZ,uBAEA,sBAHA,uBAEA,sBAEE,QAAS,MACT,SAAU,OACV,QAAS,EACT,SAAU,SACV,MAAO,KAET,uBACE,YAAa,WAEf,uBACE,YAAa,OAEf,sBACE,YAAa,IAEf,sBACE,YAAa,KAGf,8BAEA,6BAHA,8BAEA,6BAEE,OAAQ,EACR,OAAQ,KACR,KAAM,EACN,SAAU,SACV,IAAK,EACL,MAAO,KAET,wCACE,SAAU,SAEZ,uEACE,MAAO,kBACP,QAAS,2BACT,SAAU,SAEZ,sFACE,KAAM,IAER,gFACE,MAAO,IAET,uCACE,iBAAkB,QAClB,aAAc,QACd,aAAc,MACd,aAAc,IACd,WAAY,WACZ,OAAQ,KACR,SAAU,SACV,MAAO,KACP,QAAS,MAEX,6CACE,iBAAkB,QAEpB,sDACE,OAAQ,YAEV,sDACE,OAAQ,YAEV,sDACE,OAAQ,YAEV,sDACE,OAAQ,YAEV,uCACE,QAAS,GACT,QAAS,IAAI,OAAO,KACpB,SAAU,SACV,QAAS,MAGX,kEADA,kEAEE,OAAQ,EAEV,qCACE,WAAY,KACZ,WAAY,gBACZ,OAAQ,IACR,cAAe,IACf,MAAO,KACP,QAAS,KACT,YAAa,WACb,UAAW,KACX,YAAa,KACb,OAAQ,IAAI,KACZ,QAAS,IACT,SAAU,SACV,YAAa,OACb,QAAS,MAEX,wBACE,SAAU,SAEZ,qBACE,OAAQ,EACR,OAAQ,QACR,SAAU,SACV,IAAK,EACL,MAAO,IAET,6BACE,iBAAkB,QAClB,cAAe,IACf,QAAS,GACT,QAAS,MACT,OAAQ,IACR,SAAU,SACV,MAAO,KACP,IAAK,KACL,MAAO,IAET,kCACE,iBAAkB,QAClB,cAAe,MACf,WAAY,WACZ,MAAO,KACP,QAAS,gBACT,QAAS,MACT,UAAW,KACX,YAAa,IACb,KAAM,KACN,WAAY,IACZ,UAAW,IACX,QAAS,EAAE,KACX,SAAU,SACV,IAAK,MACL,YAAa,OACb,QAAS,KAEX,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,gDACE,iBAAkB,QAEpB,sBACE,WAAY,QAAQ,ymCAAymC,UAAU,OAAO,OAC9oC,OAAQ,IAAI,MAAM,KAClB,WAAY,MACZ,UAAW,MAEb,kBACE,WAAY,KACZ,MAAO,KAET,2BACE,WAAY,KACZ,MAAO,KAET,2CACE,WAAY,KACZ,MAAO,KAET,sCACE,WAAY,KACZ,MAAO,KAIT,2CAEA,2CAJA,yCAGA,4CAEA,2CAJA,2CAKE,QAAS,IAAI,MAAM,QAErB,wCACE,QAAS,IAAI,MAAM,QACnB,eAAgB,IAElB,uEACE,QAAS,IAAI,MAAM,QAErB,uEACE,QAAS,IAAI,MAAM,QAErB,6DACE,OAAQ,YACR,QAAS,IAAI,MAAM,QAErB,oEACA,oEACE,QAAS,EAEX,sDACE,iBAAkB,QAEpB,kCACE,QAAS,IAAI,MAAM,QAErB,wCACA,wCACE,SAAU,SAEZ,wDACA,wDACE,WAAY,IAEd,mDACA,mDACE,WAAY,IAEd,0CACA,0CACE,QAAS,EACT,sBAAuB,KACvB,oBAAqB,KAClB,iBAAkB,KACjB,gBAAiB,KACb,YAAa,KAEvB,+CACA,+CACE,iBAAkB,sBAClB,OAAQ,IAAI,MAAM,sBAClB,OAAQ,KACR,QAAS,GACT,KAAM,KACN,eAAgB,SAChB,SAAU,SACV,MAAO,KACP,IAAK,KAEP,6CAA+C,yBAC7C,+CACA,+CACE,aAAc,oBAGlB,sCACE,WAAY,IAEd,iCACE,WAAY,IAEd,2BACE,iBAAkB,QAClB,QAAS,EACT,oBAAqB,KACrB,iBAAkB,KAClB,gBAAiB,KACjB,YAAa,KAEf,4BACE,OAAQ,WAEV,4BACE,OAAQ,WAEV,8DACE,QAAS,EAEX,uBACE,iBAAkB,oRAClB,oBAAqB,EAAE,iBACvB,kBAAmB,SACnB,gBAAiB,KAAK,IACtB,OAAQ,QACR,OAAQ,KAEV,0BACE,iBAAkB,2PAClB,oBAAqB,EAAE,iBACvB,kBAAmB,SACnB,gBAAiB,KAAK,IACtB,OAAQ,QAEV,SACE,OAAQ,IAAI,MAAM,KAEpB,YACE,OAAQ,IAEV,YACE,gBAAiB,KAGnB,8BASA,sCANA,iCAGA,iCALA,4BASA,oCANA,+BAGA,+BARA,kCASA,0CANA,qCAGA,qCAME,OAAQ,IAAI,OAAO,KAarB,0BAFA,0BAOA,wBANA,6BAHA,4CAYA,qBALA,6BADA,yBAZA,qBACA,qBACA,qBACA,qBACA,qBACA,qBASA,yBAGA,qBAlBA,oBAYA,sBAJA,0BASA,qBAGE,kBAAmB,UACnB,OAAQ,IAAI,OAAO,KACnB,YAAa,IACb,YAAa,KAEf,oBACE,iBAAkB,gHAEpB,qBACE,iBAAkB,oHAEpB,qBACE,iBAAkB,wHAEpB,qBACE,iBAAkB,oHAEpB,qBACE,iBAAkB,wHAEpB,qBACE,iBAAkB,wHAEpB,qBACE,iBAAkB,wHAEpB,4CACE,iBAAkB,4HAEpB,0BACE,iBAAkB,gKAEpB,0BACE,iBAAkB,gKAEpB,6BACE,iBAAkB,4LAEpB,0BACE,iBAAkB,wKAEpB,sBACE,iBAAkB,oIAEpB,yBACE,iBAAkB,wJAEpB,6BACE,OAAQ,IAAI,OAAO,KAErB,yBACE,iBAAkB,4JAEpB,wBACE,iBAAkB,gJAEpB,qBACE,iBAAkB,oHAEpB,qBACE,iBAAkB,oHAEpB,qBACE,iBAAkB,oHAapB,yCAFA,yCAOA,uCANA,4CAHA,2DAYA,oCALA,4CADA,wCAZA,oCACA,oCACA,oCACA,oCACA,oCACA,oCASA,wCAGA,oCAlBA,mCAYA,qCAJA,yCASA,oCAGE,YAAa,IAaf,mCAFA,mCAOA,iCANA,sCAHA,qDAYA,8BALA,sCADA,kCAZA,8BACA,8BACA,8BACA,8BACA,8BACA,8BASA,kCAGA,8BAlBA,6BAYA,+BAJA,mCASA,8BAGE,sBAAuB,MACvB,aAAc,IAEhB,UACA,SACE,WAAY,KAEd,gBACE,QAAS,IAEX,KACE,YAAa,WAEf,MACE,gBAAiB","file":"content.min.css","sourcesContent":["/**\n * Copyright (c) Tiny Technologies, Inc. All rights reserved.\n * Licensed under the LGPL or a commercial license.\n * For LGPL see License.txt in the project root for license information.\n * For commercial licenses see https://www.tiny.cloud/\n */\n.mce-content-body .mce-item-anchor {\n background: transparent url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A\") no-repeat center;\n cursor: default;\n display: inline-block;\n height: 12px !important;\n padding: 0 2px;\n -webkit-user-modify: read-only;\n -moz-user-modify: read-only;\n -webkit-user-select: all;\n -moz-user-select: all;\n -ms-user-select: all;\n user-select: all;\n width: 8px !important;\n}\n.mce-content-body .mce-item-anchor[data-mce-selected] {\n outline-offset: 1px;\n}\n.tox-comments-visible .tox-comment {\n background-color: #fff0b7;\n}\n.tox-comments-visible .tox-comment--active {\n background-color: #ffe168;\n}\n.tox-checklist > li:not(.tox-checklist--hidden) {\n list-style: none;\n margin: 0.25em 0;\n}\n.tox-checklist > li:not(.tox-checklist--hidden)::before {\n content: url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A\");\n cursor: pointer;\n height: 1em;\n margin-left: -1.5em;\n margin-top: 0.125em;\n position: absolute;\n width: 1em;\n}\n.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before {\n content: url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A\");\n}\n[dir=rtl] .tox-checklist > li:not(.tox-checklist--hidden)::before {\n margin-left: 0;\n margin-right: -1.5em;\n}\n/* stylelint-disable */\n/* http://prismjs.com/ */\n/**\n * prism.js default theme for JavaScript, CSS and HTML\n * Based on dabblet (http://dabblet.com)\n * @author Lea Verou\n */\ncode[class*=\"language-\"],\npre[class*=\"language-\"] {\n color: black;\n background: none;\n text-shadow: 0 1px white;\n font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;\n font-size: 1em;\n text-align: left;\n white-space: pre;\n word-spacing: normal;\n word-break: normal;\n word-wrap: normal;\n line-height: 1.5;\n -moz-tab-size: 4;\n tab-size: 4;\n -webkit-hyphens: none;\n -ms-hyphens: none;\n hyphens: none;\n}\npre[class*=\"language-\"]::-moz-selection,\npre[class*=\"language-\"] ::-moz-selection,\ncode[class*=\"language-\"]::-moz-selection,\ncode[class*=\"language-\"] ::-moz-selection {\n text-shadow: none;\n background: #b3d4fc;\n}\npre[class*=\"language-\"]::selection,\npre[class*=\"language-\"] ::selection,\ncode[class*=\"language-\"]::selection,\ncode[class*=\"language-\"] ::selection {\n text-shadow: none;\n background: #b3d4fc;\n}\n@media print {\n code[class*=\"language-\"],\n pre[class*=\"language-\"] {\n text-shadow: none;\n }\n}\n/* Code blocks */\npre[class*=\"language-\"] {\n padding: 1em;\n margin: 0.5em 0;\n overflow: auto;\n}\n:not(pre) > code[class*=\"language-\"],\npre[class*=\"language-\"] {\n background: #f5f2f0;\n}\n/* Inline code */\n:not(pre) > code[class*=\"language-\"] {\n padding: 0.1em;\n border-radius: 0.3em;\n white-space: normal;\n}\n.token.comment,\n.token.prolog,\n.token.doctype,\n.token.cdata {\n color: slategray;\n}\n.token.punctuation {\n color: #999;\n}\n.namespace {\n opacity: 0.7;\n}\n.token.property,\n.token.tag,\n.token.boolean,\n.token.number,\n.token.constant,\n.token.symbol,\n.token.deleted {\n color: #905;\n}\n.token.selector,\n.token.attr-name,\n.token.string,\n.token.char,\n.token.builtin,\n.token.inserted {\n color: #690;\n}\n.token.operator,\n.token.entity,\n.token.url,\n.language-css .token.string,\n.style .token.string {\n color: #9a6e3a;\n background: hsla(0, 0%, 100%, 0.5);\n}\n.token.atrule,\n.token.attr-value,\n.token.keyword {\n color: #07a;\n}\n.token.function,\n.token.class-name {\n color: #DD4A68;\n}\n.token.regex,\n.token.important,\n.token.variable {\n color: #e90;\n}\n.token.important,\n.token.bold {\n font-weight: bold;\n}\n.token.italic {\n font-style: italic;\n}\n.token.entity {\n cursor: help;\n}\n/* stylelint-enable */\n.mce-content-body {\n overflow-wrap: break-word;\n word-wrap: break-word;\n}\n.mce-content-body .mce-visual-caret {\n background-color: black;\n background-color: currentColor;\n position: absolute;\n}\n.mce-content-body .mce-visual-caret-hidden {\n display: none;\n}\n.mce-content-body *[data-mce-caret] {\n left: -1000px;\n margin: 0;\n padding: 0;\n position: absolute;\n right: auto;\n top: 0;\n}\n.mce-content-body .mce-offscreen-selection {\n left: -2000000px;\n max-width: 1000000px;\n position: absolute;\n}\n.mce-content-body *[contentEditable=false] {\n cursor: default;\n}\n.mce-content-body *[contentEditable=true] {\n cursor: text;\n}\n.tox-cursor-format-painter {\n cursor: url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A\"), default;\n}\n.mce-content-body figure.align-left {\n float: left;\n}\n.mce-content-body figure.align-right {\n float: right;\n}\n.mce-content-body figure.image.align-center {\n display: table;\n margin-left: auto;\n margin-right: auto;\n}\n.mce-preview-object {\n border: 1px solid gray;\n display: inline-block;\n line-height: 0;\n margin: 0 2px 0 2px;\n position: relative;\n}\n.mce-preview-object .mce-shim {\n background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n}\n.mce-preview-object[data-mce-selected=\"2\"] .mce-shim {\n display: none;\n}\n.mce-object {\n background: transparent url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A\") no-repeat center;\n border: 1px dashed #aaa;\n}\n.mce-pagebreak {\n border: 1px dashed #aaa;\n cursor: default;\n display: block;\n height: 5px;\n margin-top: 15px;\n page-break-before: always;\n width: 100%;\n}\n@media print {\n .mce-pagebreak {\n border: 0;\n }\n}\n.tiny-pageembed .mce-shim {\n background: url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n}\n.tiny-pageembed[data-mce-selected=\"2\"] .mce-shim {\n display: none;\n}\n.tiny-pageembed {\n display: inline-block;\n position: relative;\n}\n.tiny-pageembed--21by9,\n.tiny-pageembed--16by9,\n.tiny-pageembed--4by3,\n.tiny-pageembed--1by1 {\n display: block;\n overflow: hidden;\n padding: 0;\n position: relative;\n width: 100%;\n}\n.tiny-pageembed--21by9 {\n padding-top: 42.857143%;\n}\n.tiny-pageembed--16by9 {\n padding-top: 56.25%;\n}\n.tiny-pageembed--4by3 {\n padding-top: 75%;\n}\n.tiny-pageembed--1by1 {\n padding-top: 100%;\n}\n.tiny-pageembed--21by9 iframe,\n.tiny-pageembed--16by9 iframe,\n.tiny-pageembed--4by3 iframe,\n.tiny-pageembed--1by1 iframe {\n border: 0;\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n}\n.mce-content-body[data-mce-placeholder] {\n position: relative;\n}\n.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before {\n color: rgba(34, 47, 62, 0.7);\n content: attr(data-mce-placeholder);\n position: absolute;\n}\n.mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before {\n left: 1px;\n}\n.mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before {\n right: 1px;\n}\n.mce-content-body div.mce-resizehandle {\n background-color: #4099ff;\n border-color: #4099ff;\n border-style: solid;\n border-width: 1px;\n box-sizing: border-box;\n height: 10px;\n position: absolute;\n width: 10px;\n z-index: 10000;\n}\n.mce-content-body div.mce-resizehandle:hover {\n background-color: #4099ff;\n}\n.mce-content-body div.mce-resizehandle:nth-of-type(1) {\n cursor: nwse-resize;\n}\n.mce-content-body div.mce-resizehandle:nth-of-type(2) {\n cursor: nesw-resize;\n}\n.mce-content-body div.mce-resizehandle:nth-of-type(3) {\n cursor: nwse-resize;\n}\n.mce-content-body div.mce-resizehandle:nth-of-type(4) {\n cursor: nesw-resize;\n}\n.mce-content-body .mce-clonedresizable {\n opacity: 0.5;\n outline: 1px dashed black;\n position: absolute;\n z-index: 10000;\n}\n.mce-content-body .mce-clonedresizable.mce-resizetable-columns th,\n.mce-content-body .mce-clonedresizable.mce-resizetable-columns td {\n border: 0;\n}\n.mce-content-body .mce-resize-helper {\n background: #555;\n background: rgba(0, 0, 0, 0.75);\n border: 1px;\n border-radius: 3px;\n color: white;\n display: none;\n font-family: sans-serif;\n font-size: 12px;\n line-height: 14px;\n margin: 5px 10px;\n padding: 5px;\n position: absolute;\n white-space: nowrap;\n z-index: 10001;\n}\n.tox-rtc-user-selection {\n position: relative;\n}\n.tox-rtc-user-cursor {\n bottom: 0;\n cursor: default;\n position: absolute;\n top: 0;\n width: 2px;\n}\n.tox-rtc-user-cursor::before {\n background-color: inherit;\n border-radius: 50%;\n content: '';\n display: block;\n height: 8px;\n position: absolute;\n right: -3px;\n top: -3px;\n width: 8px;\n}\n.tox-rtc-user-cursor:hover::after {\n background-color: inherit;\n border-radius: 100px;\n box-sizing: border-box;\n color: #fff;\n content: attr(data-user);\n display: block;\n font-size: 12px;\n font-weight: bold;\n left: -5px;\n min-height: 8px;\n min-width: 8px;\n padding: 0 12px;\n position: absolute;\n top: -11px;\n white-space: nowrap;\n z-index: 1000;\n}\n.tox-rtc-user-selection--1 .tox-rtc-user-cursor {\n background-color: #2dc26b;\n}\n.tox-rtc-user-selection--2 .tox-rtc-user-cursor {\n background-color: #e03e2d;\n}\n.tox-rtc-user-selection--3 .tox-rtc-user-cursor {\n background-color: #f1c40f;\n}\n.tox-rtc-user-selection--4 .tox-rtc-user-cursor {\n background-color: #3598db;\n}\n.tox-rtc-user-selection--5 .tox-rtc-user-cursor {\n background-color: #b96ad9;\n}\n.tox-rtc-user-selection--6 .tox-rtc-user-cursor {\n background-color: #e67e23;\n}\n.tox-rtc-user-selection--7 .tox-rtc-user-cursor {\n background-color: #aaa69d;\n}\n.tox-rtc-user-selection--8 .tox-rtc-user-cursor {\n background-color: #f368e0;\n}\n.tox-rtc-remote-image {\n background: #eaeaea url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2236%22%20height%3D%2212%22%20viewBox%3D%220%200%2036%2012%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Ccircle%20cx%3D%226%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2218%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.33s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2230%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.66s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A\") no-repeat center center;\n border: 1px solid #ccc;\n min-height: 240px;\n min-width: 320px;\n}\n.mce-match-marker {\n background: #aaa;\n color: #fff;\n}\n.mce-match-marker-selected {\n background: #39f;\n color: #fff;\n}\n.mce-match-marker-selected::-moz-selection {\n background: #39f;\n color: #fff;\n}\n.mce-match-marker-selected::selection {\n background: #39f;\n color: #fff;\n}\n.mce-content-body img[data-mce-selected],\n.mce-content-body video[data-mce-selected],\n.mce-content-body audio[data-mce-selected],\n.mce-content-body object[data-mce-selected],\n.mce-content-body embed[data-mce-selected],\n.mce-content-body table[data-mce-selected] {\n outline: 3px solid #b4d7ff;\n}\n.mce-content-body hr[data-mce-selected] {\n outline: 3px solid #b4d7ff;\n outline-offset: 1px;\n}\n.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus {\n outline: 3px solid #b4d7ff;\n}\n.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover {\n outline: 3px solid #b4d7ff;\n}\n.mce-content-body *[contentEditable=false][data-mce-selected] {\n cursor: not-allowed;\n outline: 3px solid #b4d7ff;\n}\n.mce-content-body.mce-content-readonly *[contentEditable=true]:focus,\n.mce-content-body.mce-content-readonly *[contentEditable=true]:hover {\n outline: none;\n}\n.mce-content-body *[data-mce-selected=\"inline-boundary\"] {\n background-color: #b4d7ff;\n}\n.mce-content-body .mce-edit-focus {\n outline: 3px solid #b4d7ff;\n}\n.mce-content-body td[data-mce-selected],\n.mce-content-body th[data-mce-selected] {\n position: relative;\n}\n.mce-content-body td[data-mce-selected]::-moz-selection,\n.mce-content-body th[data-mce-selected]::-moz-selection {\n background: none;\n}\n.mce-content-body td[data-mce-selected]::selection,\n.mce-content-body th[data-mce-selected]::selection {\n background: none;\n}\n.mce-content-body td[data-mce-selected] *,\n.mce-content-body th[data-mce-selected] * {\n outline: none;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.mce-content-body td[data-mce-selected]::after,\n.mce-content-body th[data-mce-selected]::after {\n background-color: rgba(180, 215, 255, 0.35);\n border: 1px solid rgba(180, 215, 255, 0.35);\n bottom: -1px;\n content: '';\n left: -1px;\n mix-blend-mode: multiply;\n position: absolute;\n right: -1px;\n top: -1px;\n}\n@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {\n .mce-content-body td[data-mce-selected]::after,\n .mce-content-body th[data-mce-selected]::after {\n border-color: rgba(0, 84, 180, 0.35);\n }\n}\n.mce-content-body img::-moz-selection {\n background: none;\n}\n.mce-content-body img::selection {\n background: none;\n}\n.ephox-snooker-resizer-bar {\n background-color: #b4d7ff;\n opacity: 0;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.ephox-snooker-resizer-cols {\n cursor: col-resize;\n}\n.ephox-snooker-resizer-rows {\n cursor: row-resize;\n}\n.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging {\n opacity: 1;\n}\n.mce-spellchecker-word {\n background-image: url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A\");\n background-position: 0 calc(100% + 1px);\n background-repeat: repeat-x;\n background-size: auto 6px;\n cursor: default;\n height: 2rem;\n}\n.mce-spellchecker-grammar {\n background-image: url(\"data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A\");\n background-position: 0 calc(100% + 1px);\n background-repeat: repeat-x;\n background-size: auto 6px;\n cursor: default;\n}\n.mce-toc {\n border: 1px solid gray;\n}\n.mce-toc h2 {\n margin: 4px;\n}\n.mce-toc li {\n list-style-type: none;\n}\ntable[style*=\"border-width: 0px\"],\n.mce-item-table:not([border]),\n.mce-item-table[border=\"0\"],\ntable[style*=\"border-width: 0px\"] td,\n.mce-item-table:not([border]) td,\n.mce-item-table[border=\"0\"] td,\ntable[style*=\"border-width: 0px\"] th,\n.mce-item-table:not([border]) th,\n.mce-item-table[border=\"0\"] th,\ntable[style*=\"border-width: 0px\"] caption,\n.mce-item-table:not([border]) caption,\n.mce-item-table[border=\"0\"] caption {\n border: 1px dashed #bbb;\n}\n.mce-visualblocks p,\n.mce-visualblocks h1,\n.mce-visualblocks h2,\n.mce-visualblocks h3,\n.mce-visualblocks h4,\n.mce-visualblocks h5,\n.mce-visualblocks h6,\n.mce-visualblocks div:not([data-mce-bogus]),\n.mce-visualblocks section,\n.mce-visualblocks article,\n.mce-visualblocks blockquote,\n.mce-visualblocks address,\n.mce-visualblocks pre,\n.mce-visualblocks figure,\n.mce-visualblocks figcaption,\n.mce-visualblocks hgroup,\n.mce-visualblocks aside,\n.mce-visualblocks ul,\n.mce-visualblocks ol,\n.mce-visualblocks dl {\n background-repeat: no-repeat;\n border: 1px dashed #bbb;\n margin-left: 3px;\n padding-top: 10px;\n}\n.mce-visualblocks p {\n background-image: url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7);\n}\n.mce-visualblocks h1 {\n background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==);\n}\n.mce-visualblocks h2 {\n background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==);\n}\n.mce-visualblocks h3 {\n background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7);\n}\n.mce-visualblocks h4 {\n background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==);\n}\n.mce-visualblocks h5 {\n background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==);\n}\n.mce-visualblocks h6 {\n background-image: url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==);\n}\n.mce-visualblocks div:not([data-mce-bogus]) {\n background-image: url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7);\n}\n.mce-visualblocks section {\n background-image: url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=);\n}\n.mce-visualblocks article {\n background-image: url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7);\n}\n.mce-visualblocks blockquote {\n background-image: url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7);\n}\n.mce-visualblocks address {\n background-image: url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=);\n}\n.mce-visualblocks pre {\n background-image: url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==);\n}\n.mce-visualblocks figure {\n background-image: url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7);\n}\n.mce-visualblocks figcaption {\n border: 1px dashed #bbb;\n}\n.mce-visualblocks hgroup {\n background-image: url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7);\n}\n.mce-visualblocks aside {\n background-image: url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=);\n}\n.mce-visualblocks ul {\n background-image: url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==);\n}\n.mce-visualblocks ol {\n background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==);\n}\n.mce-visualblocks dl {\n background-image: url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==);\n}\n.mce-visualblocks:not([dir=rtl]) p,\n.mce-visualblocks:not([dir=rtl]) h1,\n.mce-visualblocks:not([dir=rtl]) h2,\n.mce-visualblocks:not([dir=rtl]) h3,\n.mce-visualblocks:not([dir=rtl]) h4,\n.mce-visualblocks:not([dir=rtl]) h5,\n.mce-visualblocks:not([dir=rtl]) h6,\n.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]),\n.mce-visualblocks:not([dir=rtl]) section,\n.mce-visualblocks:not([dir=rtl]) article,\n.mce-visualblocks:not([dir=rtl]) blockquote,\n.mce-visualblocks:not([dir=rtl]) address,\n.mce-visualblocks:not([dir=rtl]) pre,\n.mce-visualblocks:not([dir=rtl]) figure,\n.mce-visualblocks:not([dir=rtl]) figcaption,\n.mce-visualblocks:not([dir=rtl]) hgroup,\n.mce-visualblocks:not([dir=rtl]) aside,\n.mce-visualblocks:not([dir=rtl]) ul,\n.mce-visualblocks:not([dir=rtl]) ol,\n.mce-visualblocks:not([dir=rtl]) dl {\n margin-left: 3px;\n}\n.mce-visualblocks[dir=rtl] p,\n.mce-visualblocks[dir=rtl] h1,\n.mce-visualblocks[dir=rtl] h2,\n.mce-visualblocks[dir=rtl] h3,\n.mce-visualblocks[dir=rtl] h4,\n.mce-visualblocks[dir=rtl] h5,\n.mce-visualblocks[dir=rtl] h6,\n.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]),\n.mce-visualblocks[dir=rtl] section,\n.mce-visualblocks[dir=rtl] article,\n.mce-visualblocks[dir=rtl] blockquote,\n.mce-visualblocks[dir=rtl] address,\n.mce-visualblocks[dir=rtl] pre,\n.mce-visualblocks[dir=rtl] figure,\n.mce-visualblocks[dir=rtl] figcaption,\n.mce-visualblocks[dir=rtl] hgroup,\n.mce-visualblocks[dir=rtl] aside,\n.mce-visualblocks[dir=rtl] ul,\n.mce-visualblocks[dir=rtl] ol,\n.mce-visualblocks[dir=rtl] dl {\n background-position-x: right;\n margin-right: 3px;\n}\n.mce-nbsp,\n.mce-shy {\n background: #aaa;\n}\n.mce-shy::after {\n content: '-';\n}\nbody {\n font-family: sans-serif;\n}\ntable {\n border-collapse: collapse;\n}\n"]} \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.mobile.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.mobile.css deleted file mode 100644 index 4bdb8babcbb1..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.mobile.css +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ -.tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection { - /* Note: this file is used inside the content, so isn't part of theming */ - background-color: green; - display: inline-block; - opacity: 0.5; - position: absolute; -} -body { - -webkit-text-size-adjust: none; -} -body img { - /* this is related to the content margin */ - max-width: 96vw; -} -body table img { - max-width: 95%; -} -body { - font-family: sans-serif; -} -table { - border-collapse: collapse; -} diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.mobile.min.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.mobile.min.css deleted file mode 100644 index 627f6934476e..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.mobile.min.css +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ -.tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection{background-color:green;display:inline-block;opacity:.5;position:absolute}body{-webkit-text-size-adjust:none}body img{max-width:96vw}body table img{max-width:95%}body{font-family:sans-serif}table{border-collapse:collapse} -/*# sourceMappingURL=content.mobile.min.css.map */ diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.mobile.min.css.map b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.mobile.min.css.map deleted file mode 100644 index 2a1b98a745a8..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.mobile.min.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["ui/default/content.mobile.css"],"names":[],"mappings":";;;;;;AAMA,yEAEE,iBAAkB,MAClB,QAAS,aACT,QAAS,GACT,SAAU,SAEZ,KACE,yBAA0B,KAE5B,SAEE,UAAW,KAEb,eACE,UAAW,IAEb,KACE,YAAa,WAEf,MACE,gBAAiB","file":"content.mobile.min.css","sourcesContent":["/**\n * Copyright (c) Tiny Technologies, Inc. All rights reserved.\n * Licensed under the LGPL or a commercial license.\n * For LGPL see License.txt in the project root for license information.\n * For commercial licenses see https://www.tiny.cloud/\n */\n.tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection {\n /* Note: this file is used inside the content, so isn't part of theming */\n background-color: green;\n display: inline-block;\n opacity: 0.5;\n position: absolute;\n}\nbody {\n -webkit-text-size-adjust: none;\n}\nbody img {\n /* this is related to the content margin */\n max-width: 96vw;\n}\nbody table img {\n max-width: 95%;\n}\nbody {\n font-family: sans-serif;\n}\ntable {\n border-collapse: collapse;\n}\n"]} \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff deleted file mode 100644 index 1e3be038a607cb7c2544ed8ae3d6621f77bf4c38..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4624 zcmb7IeQaFC5#QN&AGUL{efE7g{=BM1W-|RaVdWQe^e?BC`eGz4^i8S3PQw?Hhd_eQHxTkckXZB zdzU((wCVGko!Qyh+1c6InRotvZ%+>+hNrBQtrFOI4t*}DZ$7=>Sr=uD3c$ZlKuKBQ z8~ervCczs9SOk2!>AAqrz+v$CC}f1JfYPDSqx->|V$6{ekbe8M#Bh3Gkg?)-Fdi3B zeB$}UFqn*$pv&q7*net~hsUOlfG7Ho2zaowY%JPRytMvu{&xRPm(h_~w##F>vqE&a5-ssH##mlfAk}44^ zXRJKd!Ifw&ce{$Y9BAg5c>e>p_Z;t!=P{izddGWie?aHLdKL3Cn9rG=d2vt;esWqH zoD}uAoi3Z~4+LABvADt+so4~t%VlyIJ{O3tm$NC+(!yenQD%NVr*btG$T3+_WX=LH z#1M2ZNEtrO+-x;l2i>M^5o%GQ@s?N+gw*19H@G~vl3Q5Zf*t6jjW0GOTmAmlWYgSS zJeiEo%~LA-FW|YAd_Em$OE#@dw)y*#@p!UtnWa);V1HY3ZBw!>(3gY{iFFa_c6iW9 zIQ@xck^{xu9_o;UyQH#ba@y?L$xW?8J35?$p1z46ZjIctZ8QCKCa29bMC1-t@pT>S zTUT1WMjQz-75d)5zJxv~@Yd)bY)ejQBx_XQiaMJ z>$5`NO3?L*ND{UQeF8%xl)$_>w9tmQpfEebzedazFeh#~d}suN+vzsqLiW~@TLhoe zk1%xEcxP2ZL)FuoXeYzb-J5goljDxPL2@@#RW)d&X#&6QO5U=04_628@ONSvtgpha zDqqmoVep`A4<+PK$V>K+T}}{8Rj+Q|UAzCtl!Fh)uXJg{x$}HMJH7LcBLzj-r{h;< zzote8Id%pcAyE;87D<8glyaFeq#k)OEDB%yA ze%CeZ!?4TEs#pj+%14DBZHn8jxaF2as6}p3+!6p-&@I>5lbP3&N$svcIF-`0R5(o2 zh7la++|;-euckH44a4BAwB++#-cZ z)kFyC=eUS-4D0t}H8LdZY!JD^sW@F85io)%=8HU)ouhEeo-K_dJ3BV+8fo0JXIjlP zZt0H`0=Yv~I|PpRZ)r5_iAYmY9V=wT@BsoN9<3vftB|}TOH;|yNk_e7(2-?y{&cSK zG=E5Nz^Ko4>KxcbY!Q13!=HBS$lM96_+0y3M1yWTAt2u5C;6MWMXbRN?RI{$eHnAx z&t=-PSjZ>Qe2V2-YGs1YWemAq zVHdG{9V$QvsY~Cgq-L*PZqMPGv|px$)K~3<%+fBtG{oIRPL_7ye$-(`C=tS)^xC}% zue73qiF&{nXJ*>-@668G!`IrAeB;ad09shzt{O?7omLE_X@H|#ozGt&64 zb-&_lLkZI8TzigPZvUr=4g2-8M6M8b9EQLgoPswYg)d)j&%gZHJO!2>(?;I*8d>aG z#oS295Kcq{uD4R2@VEG($}WWiF-6YK)kjqks%o_U{CIAVX2;tX7o|unkew5?Gn3(| zOePS^{$(;Xi4ph;`KO#;k+vaLt8n5@doi+OEvH&?*+3(WgqkT9-$b0fTHm;)r=NmR zJnJ9o>UvNR(JMoIdRBf{%kd}jmZ)b)#4>dnDfq0G(?~S%d zv50QeMR$Kzd*S$AEXdp5Fhqe0Pz zZ!oS2e!i-tWEJ2^YoVo}V7S0tV7CujimbVJtVNb#yB&<-f&xpSb@m2=wBZ|qU-_^; z?C{lk+;tlxk&Sh3Pwh(D7~kNh`O=~TMWuRUu^0=9)`CYEVwhvGWUt4Wd3`6*H)Zs>LLYQcC#*~B78EfTt7RQ*l)b{v zqntLNsC`h&zZCY{x*}gfPU4at;nfileU3>zeyLdO7;;lFIft~ zsm6#wb5Jjtv;_VxleU0<%cQON-O*ywHt`@C4fn-Y83}=|hJPOpN>1H%C#7)9etg_yG)$div{padding-bottom:4px}.tox .accessibility-issue__description>div>div{align-items:center;display:flex;margin-bottom:4px}.tox .accessibility-issue__description>:last-child:not(:only-child){border-color:#ccc;border-style:solid}.tox .accessibility-issue__repair{margin-top:16px}.tox .tox-dialog__body-content .accessibility-issue--info .accessibility-issue__description{background-color:rgba(32,122,183,.1);border-color:rgba(32,122,183,.4);color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--info .accessibility-issue__description>:last-child{border-color:rgba(32,122,183,.4)}.tox .tox-dialog__body-content .accessibility-issue--info .tox-form__group h2{color:#207ab7}.tox .tox-dialog__body-content .accessibility-issue--info .tox-icon svg{fill:#207ab7}.tox .tox-dialog__body-content .accessibility-issue--info a .tox-icon{color:#207ab7}.tox .tox-dialog__body-content .accessibility-issue--warn .accessibility-issue__description{background-color:rgba(255,165,0,.1);border-color:rgba(255,165,0,.5);color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--warn .accessibility-issue__description>:last-child{border-color:rgba(255,165,0,.5)}.tox .tox-dialog__body-content .accessibility-issue--warn .tox-form__group h2{color:#cc8500}.tox .tox-dialog__body-content .accessibility-issue--warn .tox-icon svg{fill:#cc8500}.tox .tox-dialog__body-content .accessibility-issue--warn a .tox-icon{color:#cc8500}.tox .tox-dialog__body-content .accessibility-issue--error .accessibility-issue__description{background-color:rgba(204,0,0,.1);border-color:rgba(204,0,0,.4);color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--error .accessibility-issue__description>:last-child{border-color:rgba(204,0,0,.4)}.tox .tox-dialog__body-content .accessibility-issue--error .tox-form__group h2{color:#c00}.tox .tox-dialog__body-content .accessibility-issue--error .tox-icon svg{fill:#c00}.tox .tox-dialog__body-content .accessibility-issue--error a .tox-icon{color:#c00}.tox .tox-dialog__body-content .accessibility-issue--success .accessibility-issue__description{background-color:rgba(120,171,70,.1);border-color:rgba(120,171,70,.4);color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--success .accessibility-issue__description>:last-child{border-color:rgba(120,171,70,.4)}.tox .tox-dialog__body-content .accessibility-issue--success .tox-form__group h2{color:#78ab46}.tox .tox-dialog__body-content .accessibility-issue--success .tox-icon svg{fill:#78ab46}.tox .tox-dialog__body-content .accessibility-issue--success a .tox-icon{color:#78ab46}.tox .tox-dialog__body-content .accessibility-issue__header h1,.tox .tox-dialog__body-content .tox-form__group .accessibility-issue__description h2{margin-top:0}.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__header .tox-button{margin-left:4px}.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__header>:nth-last-child(2){margin-left:auto}.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__description{padding:4px 4px 4px 8px}.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__description>:last-child{border-left-width:1px;padding-left:4px}.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__header .tox-button{margin-right:4px}.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__header>:nth-last-child(2){margin-right:auto}.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__description{padding:4px 8px 4px 4px}.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__description>:last-child{border-right-width:1px;padding-right:4px}.tox .tox-anchorbar{display:flex;flex:0 0 auto}.tox .tox-bar{display:flex;flex:0 0 auto}.tox .tox-button{background-color:#207ab7;background-image:none;background-position:0 0;background-repeat:repeat;border-color:#207ab7;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-block;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:14px;font-style:normal;font-weight:700;letter-spacing:normal;line-height:24px;margin:0;outline:0;padding:4px 16px;text-align:center;text-decoration:none;text-transform:capitalize;white-space:nowrap}.tox .tox-button[disabled]{background-color:#207ab7;background-image:none;border-color:#207ab7;box-shadow:none;color:rgba(255,255,255,.5);cursor:not-allowed}.tox .tox-button:focus:not(:disabled){background-color:#1c6ca1;background-image:none;border-color:#1c6ca1;box-shadow:none;color:#fff}.tox .tox-button:hover:not(:disabled){background-color:#1c6ca1;background-image:none;border-color:#1c6ca1;box-shadow:none;color:#fff}.tox .tox-button:active:not(:disabled){background-color:#185d8c;background-image:none;border-color:#185d8c;box-shadow:none;color:#fff}.tox .tox-button--secondary{background-color:#f0f0f0;background-image:none;background-position:0 0;background-repeat:repeat;border-color:#f0f0f0;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;color:#222f3e;font-size:14px;font-style:normal;font-weight:700;letter-spacing:normal;outline:0;padding:4px 16px;text-decoration:none;text-transform:capitalize}.tox .tox-button--secondary[disabled]{background-color:#f0f0f0;background-image:none;border-color:#f0f0f0;box-shadow:none;color:rgba(34,47,62,.5)}.tox .tox-button--secondary:focus:not(:disabled){background-color:#e3e3e3;background-image:none;border-color:#e3e3e3;box-shadow:none;color:#222f3e}.tox .tox-button--secondary:hover:not(:disabled){background-color:#e3e3e3;background-image:none;border-color:#e3e3e3;box-shadow:none;color:#222f3e}.tox .tox-button--secondary:active:not(:disabled){background-color:#d6d6d6;background-image:none;border-color:#d6d6d6;box-shadow:none;color:#222f3e}.tox .tox-button--icon,.tox .tox-button.tox-button--icon,.tox .tox-button.tox-button--secondary.tox-button--icon{padding:4px}.tox .tox-button--icon .tox-icon svg,.tox .tox-button.tox-button--icon .tox-icon svg,.tox .tox-button.tox-button--secondary.tox-button--icon .tox-icon svg{display:block;fill:currentColor}.tox .tox-button-link{background:0;border:none;box-sizing:border-box;cursor:pointer;display:inline-block;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0;white-space:nowrap}.tox .tox-button-link--sm{font-size:14px}.tox .tox-button--naked{background-color:transparent;border-color:transparent;box-shadow:unset;color:#222f3e}.tox .tox-button--naked[disabled]{background-color:#f0f0f0;border-color:#f0f0f0;box-shadow:none;color:rgba(34,47,62,.5)}.tox .tox-button--naked:hover:not(:disabled){background-color:#e3e3e3;border-color:#e3e3e3;box-shadow:none;color:#222f3e}.tox .tox-button--naked:focus:not(:disabled){background-color:#e3e3e3;border-color:#e3e3e3;box-shadow:none;color:#222f3e}.tox .tox-button--naked:active:not(:disabled){background-color:#d6d6d6;border-color:#d6d6d6;box-shadow:none;color:#222f3e}.tox .tox-button--naked .tox-icon svg{fill:currentColor}.tox .tox-button--naked.tox-button--icon:hover:not(:disabled){color:#222f3e}.tox .tox-checkbox{align-items:center;border-radius:3px;cursor:pointer;display:flex;height:36px;min-width:36px}.tox .tox-checkbox__input{height:1px;overflow:hidden;position:absolute;top:auto;width:1px}.tox .tox-checkbox__icons{align-items:center;border-radius:3px;box-shadow:0 0 0 2px transparent;box-sizing:content-box;display:flex;height:24px;justify-content:center;padding:calc(4px - 1px);width:24px}.tox .tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display:block;fill:rgba(34,47,62,.3)}.tox .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{display:none;fill:#207ab7}.tox .tox-checkbox__icons .tox-checkbox-icon__checked svg{display:none;fill:#207ab7}.tox .tox-checkbox--disabled{color:rgba(34,47,62,.5);cursor:not-allowed}.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__checked svg{fill:rgba(34,47,62,.5)}.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__unchecked svg{fill:rgba(34,47,62,.5)}.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{fill:rgba(34,47,62,.5)}.tox input.tox-checkbox__input:checked+.tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display:none}.tox input.tox-checkbox__input:checked+.tox-checkbox__icons .tox-checkbox-icon__checked svg{display:block}.tox input.tox-checkbox__input:indeterminate+.tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display:none}.tox input.tox-checkbox__input:indeterminate+.tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{display:block}.tox input.tox-checkbox__input:focus+.tox-checkbox__icons{border-radius:3px;box-shadow:inset 0 0 0 1px #207ab7;padding:calc(4px - 1px)}.tox:not([dir=rtl]) .tox-checkbox__label{margin-left:4px}.tox:not([dir=rtl]) .tox-checkbox__input{left:-10000px}.tox:not([dir=rtl]) .tox-bar .tox-checkbox{margin-left:4px}.tox[dir=rtl] .tox-checkbox__label{margin-right:4px}.tox[dir=rtl] .tox-checkbox__input{right:-10000px}.tox[dir=rtl] .tox-bar .tox-checkbox{margin-right:4px}.tox .tox-collection--toolbar .tox-collection__group{display:flex;padding:0}.tox .tox-collection--grid .tox-collection__group{display:flex;flex-wrap:wrap;max-height:208px;overflow-x:hidden;overflow-y:auto;padding:0}.tox .tox-collection--list .tox-collection__group{border-bottom-width:0;border-color:#ccc;border-left-width:0;border-right-width:0;border-style:solid;border-top-width:1px;padding:4px 0}.tox .tox-collection--list .tox-collection__group:first-child{border-top-width:0}.tox .tox-collection__group-heading{background-color:#e6e6e6;color:rgba(34,47,62,.7);cursor:default;font-size:12px;font-style:normal;font-weight:400;margin-bottom:4px;margin-top:-4px;padding:4px 8px;text-transform:none;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.tox .tox-collection__item{align-items:center;color:#222f3e;cursor:pointer;display:flex;-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.tox .tox-collection--list .tox-collection__item{padding:4px 8px}.tox .tox-collection--toolbar .tox-collection__item{border-radius:3px;padding:4px}.tox .tox-collection--grid .tox-collection__item{border-radius:3px;padding:4px}.tox .tox-collection--list .tox-collection__item--enabled{background-color:#fff;color:#222f3e}.tox .tox-collection--list .tox-collection__item--active{background-color:#dee0e2}.tox .tox-collection--toolbar .tox-collection__item--enabled{background-color:#c8cbcf;color:#222f3e}.tox .tox-collection--toolbar .tox-collection__item--active{background-color:#dee0e2}.tox .tox-collection--grid .tox-collection__item--enabled{background-color:#c8cbcf;color:#222f3e}.tox .tox-collection--grid .tox-collection__item--active:not(.tox-collection__item--state-disabled){background-color:#dee0e2;color:#222f3e}.tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled){color:#222f3e}.tox .tox-collection--toolbar .tox-collection__item--active:not(.tox-collection__item--state-disabled){color:#222f3e}.tox .tox-collection__item--state-disabled{background-color:transparent;color:rgba(34,47,62,.5);cursor:not-allowed}.tox .tox-collection__item-checkmark,.tox .tox-collection__item-icon{align-items:center;display:flex;height:24px;justify-content:center;width:24px}.tox .tox-collection__item-checkmark svg,.tox .tox-collection__item-icon svg{fill:currentColor}.tox .tox-collection--toolbar-lg .tox-collection__item-icon{height:48px;width:48px}.tox .tox-collection__item-label{color:currentColor;display:inline-block;flex:1;-ms-flex-preferred-size:auto;font-size:14px;font-style:normal;font-weight:400;line-height:24px;text-transform:none;word-break:break-all}.tox .tox-collection__item-accessory{color:rgba(34,47,62,.7);display:inline-block;font-size:14px;height:24px;line-height:24px;text-transform:none}.tox .tox-collection__item-caret{align-items:center;display:flex;min-height:24px}.tox .tox-collection__item-caret::after{content:'';font-size:0;min-height:inherit}.tox .tox-collection__item-caret svg{fill:#222f3e}.tox .tox-collection--list .tox-collection__item:not(.tox-collection__item--enabled) .tox-collection__item-checkmark svg{display:none}.tox .tox-collection--list .tox-collection__item:not(.tox-collection__item--enabled) .tox-collection__item-accessory+.tox-collection__item-checkmark{display:none}.tox .tox-collection--horizontal{background-color:#fff;border:1px solid #ccc;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.15);display:flex;flex:0 0 auto;flex-shrink:0;flex-wrap:nowrap;margin-bottom:0;overflow-x:auto;padding:0}.tox .tox-collection--horizontal .tox-collection__group{align-items:center;display:flex;flex-wrap:nowrap;margin:0;padding:0 4px}.tox .tox-collection--horizontal .tox-collection__item{height:34px;margin:2px 0 3px 0;padding:0 4px}.tox .tox-collection--horizontal .tox-collection__item-label{white-space:nowrap}.tox .tox-collection--horizontal .tox-collection__item-caret{margin-left:4px}.tox:not([dir=rtl]) .tox-collection--horizontal .tox-collection__group:not(:last-of-type){border-right:1px solid #ccc}.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item>:not(:first-child){margin-left:8px}.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item-label:first-child{margin-left:4px}.tox:not([dir=rtl]) .tox-collection__item-accessory{margin-left:16px;text-align:right}.tox:not([dir=rtl]) .tox-collection .tox-collection__item-caret{margin-left:16px}.tox[dir=rtl] .tox-collection--horizontal .tox-collection__group:not(:last-of-type){border-left:1px solid #ccc}.tox[dir=rtl] .tox-collection--list .tox-collection__item>:not(:first-child){margin-right:8px}.tox[dir=rtl] .tox-collection--list .tox-collection__item-label:first-child{margin-right:4px}.tox[dir=rtl] .tox-collection__item-icon-rtl .tox-collection__item-icon svg{transform:rotateY(180deg)}.tox[dir=rtl] .tox-collection__item-accessory{margin-right:16px;text-align:left}.tox[dir=rtl] .tox-collection .tox-collection__item-caret{margin-right:16px;transform:rotateY(180deg)}.tox[dir=rtl] .tox-collection--horizontal .tox-collection__item-caret{margin-right:4px}.tox .tox-color-picker-container{display:flex;flex-direction:row;height:225px;margin:0}.tox .tox-sv-palette{box-sizing:border-box;display:flex;height:100%}.tox .tox-sv-palette-spectrum{height:100%}.tox .tox-sv-palette,.tox .tox-sv-palette-spectrum{width:225px}.tox .tox-sv-palette-thumb{background:0 0;border:1px solid #000;border-radius:50%;box-sizing:content-box;height:12px;position:absolute;width:12px}.tox .tox-sv-palette-inner-thumb{border:1px solid #fff;border-radius:50%;height:10px;position:absolute;width:10px}.tox .tox-hue-slider{box-sizing:border-box;height:100%;width:25px}.tox .tox-hue-slider-spectrum{background:linear-gradient(to bottom,red,#ff0080,#f0f,#8000ff,#00f,#0080ff,#0ff,#00ff80,#0f0,#80ff00,#ff0,#ff8000,red);height:100%;width:100%}.tox .tox-hue-slider,.tox .tox-hue-slider-spectrum{width:20px}.tox .tox-hue-slider-thumb{background:#fff;border:1px solid #000;box-sizing:content-box;height:4px;width:100%}.tox .tox-rgb-form{display:flex;flex-direction:column;justify-content:space-between}.tox .tox-rgb-form div{align-items:center;display:flex;justify-content:space-between;margin-bottom:5px;width:inherit}.tox .tox-rgb-form input{width:6em}.tox .tox-rgb-form input.tox-invalid{border:1px solid red!important}.tox .tox-rgb-form .tox-rgba-preview{border:1px solid #000;flex-grow:2;margin-bottom:0}.tox:not([dir=rtl]) .tox-sv-palette{margin-right:15px}.tox:not([dir=rtl]) .tox-hue-slider{margin-right:15px}.tox:not([dir=rtl]) .tox-hue-slider-thumb{margin-left:-1px}.tox:not([dir=rtl]) .tox-rgb-form label{margin-right:.5em}.tox[dir=rtl] .tox-sv-palette{margin-left:15px}.tox[dir=rtl] .tox-hue-slider{margin-left:15px}.tox[dir=rtl] .tox-hue-slider-thumb{margin-right:-1px}.tox[dir=rtl] .tox-rgb-form label{margin-left:.5em}.tox .tox-toolbar .tox-swatches,.tox .tox-toolbar__overflow .tox-swatches,.tox .tox-toolbar__primary .tox-swatches{margin:2px 0 3px 4px}.tox .tox-collection--list .tox-collection__group .tox-swatches-menu{border:0;margin:-4px 0}.tox .tox-swatches__row{display:flex}.tox .tox-swatch{height:30px;transition:transform .15s,box-shadow .15s;width:30px}.tox .tox-swatch:focus,.tox .tox-swatch:hover{box-shadow:0 0 0 1px rgba(127,127,127,.3) inset;transform:scale(.8)}.tox .tox-swatch--remove{align-items:center;display:flex;justify-content:center}.tox .tox-swatch--remove svg path{stroke:#e74c3c}.tox .tox-swatches__picker-btn{align-items:center;background-color:transparent;border:0;cursor:pointer;display:flex;height:30px;justify-content:center;outline:0;padding:0;width:30px}.tox .tox-swatches__picker-btn svg{height:24px;width:24px}.tox .tox-swatches__picker-btn:hover{background:#dee0e2}.tox:not([dir=rtl]) .tox-swatches__picker-btn{margin-left:auto}.tox[dir=rtl] .tox-swatches__picker-btn{margin-right:auto}.tox .tox-comment-thread{background:#fff;position:relative}.tox .tox-comment-thread>:not(:first-child){margin-top:8px}.tox .tox-comment{background:#fff;border:1px solid #ccc;border-radius:3px;box-shadow:0 4px 8px 0 rgba(34,47,62,.1);padding:8px 8px 16px 8px;position:relative}.tox .tox-comment__header{align-items:center;color:#222f3e;display:flex;justify-content:space-between}.tox .tox-comment__date{color:rgba(34,47,62,.7);font-size:12px}.tox .tox-comment__body{color:#222f3e;font-size:14px;font-style:normal;font-weight:400;line-height:1.3;margin-top:8px;position:relative;text-transform:initial}.tox .tox-comment__body textarea{resize:none;white-space:normal;width:100%}.tox .tox-comment__expander{padding-top:8px}.tox .tox-comment__expander p{color:rgba(34,47,62,.7);font-size:14px;font-style:normal}.tox .tox-comment__body p{margin:0}.tox .tox-comment__buttonspacing{padding-top:16px;text-align:center}.tox .tox-comment-thread__overlay::after{background:#fff;bottom:0;content:"";display:flex;left:0;opacity:.9;position:absolute;right:0;top:0;z-index:5}.tox .tox-comment__reply{display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end;margin-top:8px}.tox .tox-comment__reply>:first-child{margin-bottom:8px;width:100%}.tox .tox-comment__edit{display:flex;flex-wrap:wrap;justify-content:flex-end;margin-top:16px}.tox .tox-comment__gradient::after{background:linear-gradient(rgba(255,255,255,0),#fff);bottom:0;content:"";display:block;height:5em;margin-top:-40px;position:absolute;width:100%}.tox .tox-comment__overlay{background:#fff;bottom:0;display:flex;flex-direction:column;flex-grow:1;left:0;opacity:.9;position:absolute;right:0;text-align:center;top:0;z-index:5}.tox .tox-comment__loading-text{align-items:center;color:#222f3e;display:flex;flex-direction:column;position:relative}.tox .tox-comment__loading-text>div{padding-bottom:16px}.tox .tox-comment__overlaytext{bottom:0;flex-direction:column;font-size:14px;left:0;padding:1em;position:absolute;right:0;top:0;z-index:10}.tox .tox-comment__overlaytext p{background-color:#fff;box-shadow:0 0 8px 8px #fff;color:#222f3e;text-align:center}.tox .tox-comment__overlaytext div:nth-of-type(2){font-size:.8em}.tox .tox-comment__busy-spinner{align-items:center;background-color:#fff;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:20}.tox .tox-comment__scroll{display:flex;flex-direction:column;flex-shrink:1;overflow:auto}.tox .tox-conversations{margin:8px}.tox:not([dir=rtl]) .tox-comment__edit{margin-left:8px}.tox:not([dir=rtl]) .tox-comment__buttonspacing>:last-child,.tox:not([dir=rtl]) .tox-comment__edit>:last-child,.tox:not([dir=rtl]) .tox-comment__reply>:last-child{margin-left:8px}.tox[dir=rtl] .tox-comment__edit{margin-right:8px}.tox[dir=rtl] .tox-comment__buttonspacing>:last-child,.tox[dir=rtl] .tox-comment__edit>:last-child,.tox[dir=rtl] .tox-comment__reply>:last-child{margin-right:8px}.tox .tox-user{align-items:center;display:flex}.tox .tox-user__avatar svg{fill:rgba(34,47,62,.7)}.tox .tox-user__name{color:rgba(34,47,62,.7);font-size:12px;font-style:normal;font-weight:700;text-transform:uppercase}.tox:not([dir=rtl]) .tox-user__avatar svg{margin-right:8px}.tox:not([dir=rtl]) .tox-user__avatar+.tox-user__name{margin-left:8px}.tox[dir=rtl] .tox-user__avatar svg{margin-left:8px}.tox[dir=rtl] .tox-user__avatar+.tox-user__name{margin-right:8px}.tox .tox-dialog-wrap{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:1100}.tox .tox-dialog-wrap__backdrop{background-color:rgba(255,255,255,.75);bottom:0;left:0;position:absolute;right:0;top:0;z-index:1}.tox .tox-dialog-wrap__backdrop--opaque{background-color:#fff}.tox .tox-dialog{background-color:#fff;border-color:#ccc;border-radius:3px;border-style:solid;border-width:1px;box-shadow:0 16px 16px -10px rgba(34,47,62,.15),0 0 40px 1px rgba(34,47,62,.15);display:flex;flex-direction:column;max-height:100%;max-width:480px;overflow:hidden;position:relative;width:95vw;z-index:2}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox .tox-dialog{align-self:flex-start;margin:8px auto;width:calc(100vw - 16px)}}.tox .tox-dialog-inline{z-index:1100}.tox .tox-dialog__header{align-items:center;background-color:#fff;border-bottom:none;color:#222f3e;display:flex;font-size:16px;justify-content:space-between;padding:8px 16px 0 16px;position:relative}.tox .tox-dialog__header .tox-button{z-index:1}.tox .tox-dialog__draghandle{cursor:grab;height:100%;left:0;position:absolute;top:0;width:100%}.tox .tox-dialog__draghandle:active{cursor:grabbing}.tox .tox-dialog__dismiss{margin-left:auto}.tox .tox-dialog__title{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:20px;font-style:normal;font-weight:400;line-height:1.3;margin:0;text-transform:none}.tox .tox-dialog__body{color:#222f3e;display:flex;flex:1;-ms-flex-preferred-size:auto;font-size:16px;font-style:normal;font-weight:400;line-height:1.3;min-width:0;text-align:left;text-transform:none}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox .tox-dialog__body{flex-direction:column}}.tox .tox-dialog__body-nav{align-items:flex-start;display:flex;flex-direction:column;padding:16px 16px}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox .tox-dialog__body-nav{flex-direction:row;-webkit-overflow-scrolling:touch;overflow-x:auto;padding-bottom:0}}.tox .tox-dialog__body-nav-item{border-bottom:2px solid transparent;color:rgba(34,47,62,.7);display:inline-block;font-size:14px;line-height:1.3;margin-bottom:8px;text-decoration:none;white-space:nowrap}.tox .tox-dialog__body-nav-item:focus{background-color:rgba(32,122,183,.1)}.tox .tox-dialog__body-nav-item--active{border-bottom:2px solid #207ab7;color:#207ab7}.tox .tox-dialog__body-content{box-sizing:border-box;display:flex;flex:1;flex-direction:column;-ms-flex-preferred-size:auto;max-height:650px;overflow:auto;-webkit-overflow-scrolling:touch;padding:16px 16px}.tox .tox-dialog__body-content>*{margin-bottom:0;margin-top:16px}.tox .tox-dialog__body-content>:first-child{margin-top:0}.tox .tox-dialog__body-content>:last-child{margin-bottom:0}.tox .tox-dialog__body-content>:only-child{margin-bottom:0;margin-top:0}.tox .tox-dialog__body-content a{color:#207ab7;cursor:pointer;text-decoration:none}.tox .tox-dialog__body-content a:focus,.tox .tox-dialog__body-content a:hover{color:#185d8c;text-decoration:none}.tox .tox-dialog__body-content a:active{color:#185d8c;text-decoration:none}.tox .tox-dialog__body-content svg{fill:#222f3e}.tox .tox-dialog__body-content ul{display:block;list-style-type:disc;margin-bottom:16px;-webkit-margin-end:0;margin-inline-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-padding-start:2.5rem;padding-inline-start:2.5rem}.tox .tox-dialog__body-content .tox-form__group h1{color:#222f3e;font-size:20px;font-style:normal;font-weight:700;letter-spacing:normal;margin-bottom:16px;margin-top:2rem;text-transform:none}.tox .tox-dialog__body-content .tox-form__group h2{color:#222f3e;font-size:16px;font-style:normal;font-weight:700;letter-spacing:normal;margin-bottom:16px;margin-top:2rem;text-transform:none}.tox .tox-dialog__body-content .tox-form__group p{margin-bottom:16px}.tox .tox-dialog__body-content .tox-form__group h1:first-child,.tox .tox-dialog__body-content .tox-form__group h2:first-child,.tox .tox-dialog__body-content .tox-form__group p:first-child{margin-top:0}.tox .tox-dialog__body-content .tox-form__group h1:last-child,.tox .tox-dialog__body-content .tox-form__group h2:last-child,.tox .tox-dialog__body-content .tox-form__group p:last-child{margin-bottom:0}.tox .tox-dialog__body-content .tox-form__group h1:only-child,.tox .tox-dialog__body-content .tox-form__group h2:only-child,.tox .tox-dialog__body-content .tox-form__group p:only-child{margin-bottom:0;margin-top:0}.tox .tox-dialog--width-lg{height:650px;max-width:1200px}.tox .tox-dialog--width-md{max-width:800px}.tox .tox-dialog--width-md .tox-dialog__body-content{overflow:auto}.tox .tox-dialog__body-content--centered{text-align:center}.tox .tox-dialog__footer{align-items:center;background-color:#fff;border-top:1px solid #ccc;display:flex;justify-content:space-between;padding:8px 16px}.tox .tox-dialog__footer-end,.tox .tox-dialog__footer-start{display:flex}.tox .tox-dialog__busy-spinner{align-items:center;background-color:rgba(255,255,255,.75);bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:3}.tox .tox-dialog__table{border-collapse:collapse;width:100%}.tox .tox-dialog__table thead th{font-weight:700;padding-bottom:8px}.tox .tox-dialog__table tbody tr{border-bottom:1px solid #ccc}.tox .tox-dialog__table tbody tr:last-child{border-bottom:none}.tox .tox-dialog__table td{padding-bottom:8px;padding-top:8px}.tox .tox-dialog__popups{position:absolute;width:100%;z-index:1100}.tox .tox-dialog__body-iframe{display:flex;flex:1;flex-direction:column;-ms-flex-preferred-size:auto}.tox .tox-dialog__body-iframe .tox-navobj{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-dialog__body-iframe .tox-navobj :nth-child(2){flex:1;-ms-flex-preferred-size:auto;height:100%}.tox .tox-dialog-dock-fadeout{opacity:0;visibility:hidden}.tox .tox-dialog-dock-fadein{opacity:1;visibility:visible}.tox .tox-dialog-dock-transition{transition:visibility 0s linear .3s,opacity .3s ease}.tox .tox-dialog-dock-transition.tox-dialog-dock-fadein{transition-delay:0s}body.tox-dialog__disable-scroll{overflow:hidden}.tox.tox-platform-ie .tox-dialog-wrap{position:-ms-device-fixed}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav{margin-right:0}}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav-item:not(:first-child){margin-left:8px}}.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-end>*,.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-start>*{margin-left:8px}.tox[dir=rtl] .tox-dialog__body{text-align:right}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav{margin-left:0}}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav-item:not(:first-child){margin-right:8px}}.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-end>*,.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-start>*{margin-right:8px}.tox .tox-dropzone-container{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-dropzone{align-items:center;background:#fff;border:2px dashed #ccc;box-sizing:border-box;display:flex;flex-direction:column;flex-grow:1;justify-content:center;min-height:100px;padding:10px}.tox .tox-dropzone p{color:rgba(34,47,62,.7);margin:0 0 16px 0}.tox .tox-edit-area{display:flex;flex:1;-ms-flex-preferred-size:auto;overflow:hidden;position:relative}.tox .tox-edit-area__iframe{background-color:#fff;border:0;box-sizing:border-box;flex:1;-ms-flex-preferred-size:auto;height:100%;position:absolute;width:100%}.tox.tox-inline-edit-area{border:1px dotted #ccc}.tox .tox-editor-container{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.tox .tox-editor-header{z-index:1}.tox:not(.tox-tinymce-inline) .tox-editor-header{box-shadow:none;transition:box-shadow .5s}.tox.tox-tinymce--toolbar-bottom .tox-editor-header,.tox.tox-tinymce-inline .tox-editor-header{margin-bottom:-1px}.tox.tox-tinymce--toolbar-sticky-on .tox-editor-header{box-shadow:0 4px 4px -3px rgba(0,0,0,.25)}.tox-editor-dock-fadeout{opacity:0;visibility:hidden}.tox-editor-dock-fadein{opacity:1;visibility:visible}.tox-editor-dock-transition{transition:visibility 0s linear .25s,opacity .25s ease}.tox-editor-dock-transition.tox-editor-dock-fadein{transition-delay:0s}.tox .tox-control-wrap{flex:1;position:relative}.tox .tox-control-wrap:not(.tox-control-wrap--status-invalid) .tox-control-wrap__status-icon-invalid,.tox .tox-control-wrap:not(.tox-control-wrap--status-unknown) .tox-control-wrap__status-icon-unknown,.tox .tox-control-wrap:not(.tox-control-wrap--status-valid) .tox-control-wrap__status-icon-valid{display:none}.tox .tox-control-wrap svg{display:block}.tox .tox-control-wrap__status-icon-wrap{position:absolute;top:50%;transform:translateY(-50%)}.tox .tox-control-wrap__status-icon-invalid svg{fill:#c00}.tox .tox-control-wrap__status-icon-unknown svg{fill:orange}.tox .tox-control-wrap__status-icon-valid svg{fill:green}.tox:not([dir=rtl]) .tox-control-wrap--status-invalid .tox-textfield,.tox:not([dir=rtl]) .tox-control-wrap--status-unknown .tox-textfield,.tox:not([dir=rtl]) .tox-control-wrap--status-valid .tox-textfield{padding-right:32px}.tox:not([dir=rtl]) .tox-control-wrap__status-icon-wrap{right:4px}.tox[dir=rtl] .tox-control-wrap--status-invalid .tox-textfield,.tox[dir=rtl] .tox-control-wrap--status-unknown .tox-textfield,.tox[dir=rtl] .tox-control-wrap--status-valid .tox-textfield{padding-left:32px}.tox[dir=rtl] .tox-control-wrap__status-icon-wrap{left:4px}.tox .tox-autocompleter{max-width:25em}.tox .tox-autocompleter .tox-menu{max-width:25em}.tox .tox-autocompleter .tox-autocompleter-highlight{font-weight:700}.tox .tox-color-input{display:flex;position:relative;z-index:1}.tox .tox-color-input .tox-textfield{z-index:-1}.tox .tox-color-input span{border-color:rgba(34,47,62,.2);border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;height:24px;position:absolute;top:6px;width:24px}.tox .tox-color-input span:focus:not([aria-disabled=true]),.tox .tox-color-input span:hover:not([aria-disabled=true]){border-color:#207ab7;cursor:pointer}.tox .tox-color-input span::before{background-image:linear-gradient(45deg,rgba(0,0,0,.25) 25%,transparent 25%),linear-gradient(-45deg,rgba(0,0,0,.25) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,rgba(0,0,0,.25) 75%),linear-gradient(-45deg,transparent 75%,rgba(0,0,0,.25) 75%);background-position:0 0,0 6px,6px -6px,-6px 0;background-size:12px 12px;border:1px solid #fff;border-radius:3px;box-sizing:border-box;content:'';height:24px;left:-1px;position:absolute;top:-1px;width:24px;z-index:-1}.tox .tox-color-input span[aria-disabled=true]{cursor:not-allowed}.tox:not([dir=rtl]) .tox-color-input .tox-textfield{padding-left:36px}.tox:not([dir=rtl]) .tox-color-input span{left:6px}.tox[dir=rtl] .tox-color-input .tox-textfield{padding-right:36px}.tox[dir=rtl] .tox-color-input span{right:6px}.tox .tox-label,.tox .tox-toolbar-label{color:rgba(34,47,62,.7);display:block;font-size:14px;font-style:normal;font-weight:400;line-height:1.3;padding:0 8px 0 0;text-transform:none;white-space:nowrap}.tox .tox-toolbar-label{padding:0 8px}.tox[dir=rtl] .tox-label{padding:0 0 0 8px}.tox .tox-form{display:flex;flex:1;flex-direction:column;-ms-flex-preferred-size:auto}.tox .tox-form__group{box-sizing:border-box;margin-bottom:4px}.tox .tox-form-group--maximize{flex:1}.tox .tox-form__group--error{color:#c00}.tox .tox-form__group--collection{display:flex}.tox .tox-form__grid{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between}.tox .tox-form__grid--2col>.tox-form__group{width:calc(50% - (8px / 2))}.tox .tox-form__grid--3col>.tox-form__group{width:calc(100% / 3 - (8px / 2))}.tox .tox-form__grid--4col>.tox-form__group{width:calc(25% - (8px / 2))}.tox .tox-form__controls-h-stack{align-items:center;display:flex}.tox .tox-form__group--inline{align-items:center;display:flex}.tox .tox-form__group--stretched{display:flex;flex:1;flex-direction:column;-ms-flex-preferred-size:auto}.tox .tox-form__group--stretched .tox-textarea{flex:1;-ms-flex-preferred-size:auto}.tox .tox-form__group--stretched .tox-navobj{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-form__group--stretched .tox-navobj :nth-child(2){flex:1;-ms-flex-preferred-size:auto;height:100%}.tox:not([dir=rtl]) .tox-form__controls-h-stack>:not(:first-child){margin-left:4px}.tox[dir=rtl] .tox-form__controls-h-stack>:not(:first-child){margin-right:4px}.tox .tox-lock.tox-locked .tox-lock-icon__unlock,.tox .tox-lock:not(.tox-locked) .tox-lock-icon__lock{display:none}.tox .tox-listboxfield .tox-listbox--select,.tox .tox-textarea,.tox .tox-textfield,.tox .tox-toolbar-textfield{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#ccc;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;color:#222f3e;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;line-height:24px;margin:0;min-height:34px;outline:0;padding:5px 4.75px;resize:none;width:100%}.tox .tox-textarea[disabled],.tox .tox-textfield[disabled]{background-color:#f2f2f2;color:rgba(34,47,62,.85);cursor:not-allowed}.tox .tox-listboxfield .tox-listbox--select:focus,.tox .tox-textarea:focus,.tox .tox-textfield:focus{background-color:#fff;border-color:#207ab7;box-shadow:none;outline:0}.tox .tox-toolbar-textfield{border-width:0;margin-bottom:3px;margin-top:2px;max-width:250px}.tox .tox-naked-btn{background-color:transparent;border:0;border-color:transparent;box-shadow:unset;color:#207ab7;cursor:pointer;display:block;margin:0;padding:0}.tox .tox-naked-btn svg{display:block;fill:#222f3e}.tox:not([dir=rtl]) .tox-toolbar-textfield+*{margin-left:4px}.tox[dir=rtl] .tox-toolbar-textfield+*{margin-right:4px}.tox .tox-listboxfield{cursor:pointer;position:relative}.tox .tox-listboxfield .tox-listbox--select[disabled]{background-color:#f2f2f2;color:rgba(34,47,62,.85);cursor:not-allowed}.tox .tox-listbox__select-label{cursor:default;flex:1;margin:0 4px}.tox .tox-listbox__select-chevron{align-items:center;display:flex;justify-content:center;width:16px}.tox .tox-listbox__select-chevron svg{fill:#222f3e}.tox .tox-listboxfield .tox-listbox--select{align-items:center;display:flex}.tox:not([dir=rtl]) .tox-listboxfield svg{right:8px}.tox[dir=rtl] .tox-listboxfield svg{left:8px}.tox .tox-selectfield{cursor:pointer;position:relative}.tox .tox-selectfield select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#ccc;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;color:#222f3e;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif;font-size:16px;line-height:24px;margin:0;min-height:34px;outline:0;padding:5px 4.75px;resize:none;width:100%}.tox .tox-selectfield select[disabled]{background-color:#f2f2f2;color:rgba(34,47,62,.85);cursor:not-allowed}.tox .tox-selectfield select::-ms-expand{display:none}.tox .tox-selectfield select:focus{background-color:#fff;border-color:#207ab7;box-shadow:none;outline:0}.tox .tox-selectfield svg{pointer-events:none;position:absolute;top:50%;transform:translateY(-50%)}.tox:not([dir=rtl]) .tox-selectfield select[size="0"],.tox:not([dir=rtl]) .tox-selectfield select[size="1"]{padding-right:24px}.tox:not([dir=rtl]) .tox-selectfield svg{right:8px}.tox[dir=rtl] .tox-selectfield select[size="0"],.tox[dir=rtl] .tox-selectfield select[size="1"]{padding-left:24px}.tox[dir=rtl] .tox-selectfield svg{left:8px}.tox .tox-textarea{-webkit-appearance:textarea;-moz-appearance:textarea;appearance:textarea;white-space:pre-wrap}.tox-fullscreen{border:0;height:100%;left:0;margin:0;overflow:hidden;-ms-scroll-chaining:none;overscroll-behavior:none;padding:0;position:fixed;top:0;touch-action:pinch-zoom;width:100%}.tox-fullscreen .tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle{display:none}.tox-fullscreen .tox.tox-tinymce.tox-fullscreen{z-index:1200}.tox-fullscreen .tox.tox-tinymce-aux{z-index:1201}.tox .tox-help__more-link{list-style:none;margin-top:1em}.tox .tox-image-tools{width:100%}.tox .tox-image-tools__toolbar{align-items:center;display:flex;justify-content:center}.tox .tox-image-tools__image{background-color:#666;height:380px;overflow:auto;position:relative;width:100%}.tox .tox-image-tools__image,.tox .tox-image-tools__image+.tox-image-tools__toolbar{margin-top:8px}.tox .tox-image-tools__image-bg{background:url(data:image/gif;base64,R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw==)}.tox .tox-image-tools__toolbar>.tox-spacer{flex:1;-ms-flex-preferred-size:auto}.tox .tox-croprect-block{background:#000;opacity:.5;position:absolute;zoom:1}.tox .tox-croprect-handle{border:2px solid #fff;height:20px;left:0;position:absolute;top:0;width:20px}.tox .tox-croprect-handle-move{border:0;cursor:move;position:absolute}.tox .tox-croprect-handle-nw{border-width:2px 0 0 2px;cursor:nw-resize;left:100px;margin:-2px 0 0 -2px;top:100px}.tox .tox-croprect-handle-ne{border-width:2px 2px 0 0;cursor:ne-resize;left:200px;margin:-2px 0 0 -20px;top:100px}.tox .tox-croprect-handle-sw{border-width:0 0 2px 2px;cursor:sw-resize;left:100px;margin:-20px 2px 0 -2px;top:200px}.tox .tox-croprect-handle-se{border-width:0 2px 2px 0;cursor:se-resize;left:200px;margin:-20px 0 0 -20px;top:200px}.tox:not([dir=rtl]) .tox-image-tools__toolbar>.tox-slider:not(:first-of-type){margin-left:8px}.tox:not([dir=rtl]) .tox-image-tools__toolbar>.tox-button+.tox-slider{margin-left:32px}.tox:not([dir=rtl]) .tox-image-tools__toolbar>.tox-slider+.tox-button{margin-left:32px}.tox[dir=rtl] .tox-image-tools__toolbar>.tox-slider:not(:first-of-type){margin-right:8px}.tox[dir=rtl] .tox-image-tools__toolbar>.tox-button+.tox-slider{margin-right:32px}.tox[dir=rtl] .tox-image-tools__toolbar>.tox-slider+.tox-button{margin-right:32px}.tox .tox-insert-table-picker{display:flex;flex-wrap:wrap;width:170px}.tox .tox-insert-table-picker>div{border-color:#ccc;border-style:solid;border-width:0 1px 1px 0;box-sizing:border-box;height:17px;width:17px}.tox .tox-collection--list .tox-collection__group .tox-insert-table-picker{margin:-4px 0}.tox .tox-insert-table-picker .tox-insert-table-picker__selected{background-color:rgba(32,122,183,.5);border-color:rgba(32,122,183,.5)}.tox .tox-insert-table-picker__label{color:rgba(34,47,62,.7);display:block;font-size:14px;padding:4px;text-align:center;width:100%}.tox:not([dir=rtl]) .tox-insert-table-picker>div:nth-child(10n){border-right:0}.tox[dir=rtl] .tox-insert-table-picker>div:nth-child(10n+1){border-right:0}.tox .tox-menu{background-color:#fff;border:1px solid #ccc;border-radius:3px;box-shadow:0 4px 8px 0 rgba(34,47,62,.1);display:inline-block;overflow:hidden;vertical-align:top;z-index:1150}.tox .tox-menu.tox-collection.tox-collection--list{padding:0}.tox .tox-menu.tox-collection.tox-collection--toolbar{padding:4px}.tox .tox-menu.tox-collection.tox-collection--grid{padding:4px}.tox .tox-menu__label blockquote,.tox .tox-menu__label code,.tox .tox-menu__label h1,.tox .tox-menu__label h2,.tox .tox-menu__label h3,.tox .tox-menu__label h4,.tox .tox-menu__label h5,.tox .tox-menu__label h6,.tox .tox-menu__label p{margin:0}.tox .tox-menubar{background:url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23cccccc'/%3E%3C/svg%3E") left 0 top 0 #fff;background-color:#fff;display:flex;flex:0 0 auto;flex-shrink:0;flex-wrap:wrap;padding:0 4px 0 4px}.tox.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-menubar{border-top:1px solid #ccc}.tox .tox-mbtn{align-items:center;background:0 0;border:0;border-radius:3px;box-shadow:none;color:#222f3e;display:flex;flex:0 0 auto;font-size:14px;font-style:normal;font-weight:400;height:34px;justify-content:center;margin:2px 0 3px 0;outline:0;overflow:hidden;padding:0 4px;text-transform:none;width:auto}.tox .tox-mbtn[disabled]{background-color:transparent;border:0;box-shadow:none;color:rgba(34,47,62,.5);cursor:not-allowed}.tox .tox-mbtn:focus:not(:disabled){background:#dee0e2;border:0;box-shadow:none;color:#222f3e}.tox .tox-mbtn--active{background:#c8cbcf;border:0;box-shadow:none;color:#222f3e}.tox .tox-mbtn:hover:not(:disabled):not(.tox-mbtn--active){background:#dee0e2;border:0;box-shadow:none;color:#222f3e}.tox .tox-mbtn__select-label{cursor:default;font-weight:400;margin:0 4px}.tox .tox-mbtn[disabled] .tox-mbtn__select-label{cursor:not-allowed}.tox .tox-mbtn__select-chevron{align-items:center;display:flex;justify-content:center;width:16px;display:none}.tox .tox-notification{border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;display:-ms-grid;display:grid;font-size:14px;font-weight:400;-ms-grid-columns:minmax(40px,1fr) auto minmax(40px,1fr);grid-template-columns:minmax(40px,1fr) auto minmax(40px,1fr);margin-top:4px;opacity:0;padding:4px;transition:transform .1s ease-in,opacity 150ms ease-in}.tox .tox-notification p{font-size:14px;font-weight:400}.tox .tox-notification a{text-decoration:underline}.tox .tox-notification--in{opacity:1}.tox .tox-notification--success{background-color:#e4eeda;border-color:#d7e6c8;color:#222f3e}.tox .tox-notification--success p{color:#222f3e}.tox .tox-notification--success a{color:#547831}.tox .tox-notification--success svg{fill:#222f3e}.tox .tox-notification--error{background-color:#f8dede;border-color:#f2bfbf;color:#222f3e}.tox .tox-notification--error p{color:#222f3e}.tox .tox-notification--error a{color:#c00}.tox .tox-notification--error svg{fill:#222f3e}.tox .tox-notification--warn,.tox .tox-notification--warning{background-color:#fffaea;border-color:#ffe89d;color:#222f3e}.tox .tox-notification--warn p,.tox .tox-notification--warning p{color:#222f3e}.tox .tox-notification--warn a,.tox .tox-notification--warning a{color:#222f3e}.tox .tox-notification--warn svg,.tox .tox-notification--warning svg{fill:#222f3e}.tox .tox-notification--info{background-color:#d9edf7;border-color:#779ecb;color:#222f3e}.tox .tox-notification--info p{color:#222f3e}.tox .tox-notification--info a{color:#222f3e}.tox .tox-notification--info svg{fill:#222f3e}.tox .tox-notification__body{-ms-grid-row-align:center;align-self:center;color:#222f3e;font-size:14px;-ms-grid-column-span:1;grid-column-end:3;-ms-grid-column:2;grid-column-start:2;-ms-grid-row-span:1;grid-row-end:2;-ms-grid-row:1;grid-row-start:1;text-align:center;white-space:normal;word-break:break-all;word-break:break-word}.tox .tox-notification__body>*{margin:0}.tox .tox-notification__body>*+*{margin-top:1rem}.tox .tox-notification__icon{-ms-grid-row-align:center;align-self:center;-ms-grid-column-span:1;grid-column-end:2;-ms-grid-column:1;grid-column-start:1;-ms-grid-row-span:1;grid-row-end:2;-ms-grid-row:1;grid-row-start:1;-ms-grid-column-align:end;justify-self:end}.tox .tox-notification__icon svg{display:block}.tox .tox-notification__dismiss{-ms-grid-row-align:start;align-self:start;-ms-grid-column-span:1;grid-column-end:4;-ms-grid-column:3;grid-column-start:3;-ms-grid-row-span:1;grid-row-end:2;-ms-grid-row:1;grid-row-start:1;-ms-grid-column-align:end;justify-self:end}.tox .tox-notification .tox-progress-bar{-ms-grid-column-span:3;grid-column-end:4;-ms-grid-column:1;grid-column-start:1;-ms-grid-row-span:1;grid-row-end:3;-ms-grid-row:2;grid-row-start:2;-ms-grid-column-align:center;justify-self:center}.tox .tox-pop{display:inline-block;position:relative}.tox .tox-pop--resizing{transition:width .1s ease}.tox .tox-pop--resizing .tox-toolbar{flex-wrap:nowrap}.tox .tox-pop__dialog{background-color:#fff;border:1px solid #ccc;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.15);min-width:0;overflow:hidden}.tox .tox-pop__dialog>:not(.tox-toolbar){margin:4px 4px 4px 8px}.tox .tox-pop__dialog .tox-toolbar{background-color:transparent;margin-bottom:-1px}.tox .tox-pop::after,.tox .tox-pop::before{border-style:solid;content:'';display:block;height:0;position:absolute;width:0}.tox .tox-pop.tox-pop--bottom::after,.tox .tox-pop.tox-pop--bottom::before{left:50%;top:100%}.tox .tox-pop.tox-pop--bottom::after{border-color:#fff transparent transparent transparent;border-width:8px;margin-left:-8px;margin-top:-1px}.tox .tox-pop.tox-pop--bottom::before{border-color:#ccc transparent transparent transparent;border-width:9px;margin-left:-9px}.tox .tox-pop.tox-pop--top::after,.tox .tox-pop.tox-pop--top::before{left:50%;top:0;transform:translateY(-100%)}.tox .tox-pop.tox-pop--top::after{border-color:transparent transparent #fff transparent;border-width:8px;margin-left:-8px;margin-top:1px}.tox .tox-pop.tox-pop--top::before{border-color:transparent transparent #ccc transparent;border-width:9px;margin-left:-9px}.tox .tox-pop.tox-pop--left::after,.tox .tox-pop.tox-pop--left::before{left:0;top:calc(50% - 1px);transform:translateY(-50%)}.tox .tox-pop.tox-pop--left::after{border-color:transparent #fff transparent transparent;border-width:8px;margin-left:-15px}.tox .tox-pop.tox-pop--left::before{border-color:transparent #ccc transparent transparent;border-width:10px;margin-left:-19px}.tox .tox-pop.tox-pop--right::after,.tox .tox-pop.tox-pop--right::before{left:100%;top:calc(50% + 1px);transform:translateY(-50%)}.tox .tox-pop.tox-pop--right::after{border-color:transparent transparent transparent #fff;border-width:8px;margin-left:-1px}.tox .tox-pop.tox-pop--right::before{border-color:transparent transparent transparent #ccc;border-width:10px;margin-left:-1px}.tox .tox-pop.tox-pop--align-left::after,.tox .tox-pop.tox-pop--align-left::before{left:20px}.tox .tox-pop.tox-pop--align-right::after,.tox .tox-pop.tox-pop--align-right::before{left:calc(100% - 20px)}.tox .tox-sidebar-wrap{display:flex;flex-direction:row;flex-grow:1;-ms-flex-preferred-size:0;min-height:0}.tox .tox-sidebar{background-color:#fff;display:flex;flex-direction:row;justify-content:flex-end}.tox .tox-sidebar__slider{display:flex;overflow:hidden}.tox .tox-sidebar__pane-container{display:flex}.tox .tox-sidebar__pane{display:flex}.tox .tox-sidebar--sliding-closed{opacity:0}.tox .tox-sidebar--sliding-open{opacity:1}.tox .tox-sidebar--sliding-growing,.tox .tox-sidebar--sliding-shrinking{transition:width .5s ease,opacity .5s ease}.tox .tox-selector{background-color:#4099ff;border-color:#4099ff;border-style:solid;border-width:1px;box-sizing:border-box;display:inline-block;height:10px;position:absolute;width:10px}.tox.tox-platform-touch .tox-selector{height:12px;width:12px}.tox .tox-slider{align-items:center;display:flex;flex:1;-ms-flex-preferred-size:auto;height:24px;justify-content:center;position:relative}.tox .tox-slider__rail{background-color:transparent;border:1px solid #ccc;border-radius:3px;height:10px;min-width:120px;width:100%}.tox .tox-slider__handle{background-color:#207ab7;border:2px solid #185d8c;border-radius:3px;box-shadow:none;height:24px;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:14px}.tox .tox-source-code{overflow:auto}.tox .tox-spinner{display:flex}.tox .tox-spinner>div{animation:tam-bouncing-dots 1.5s ease-in-out 0s infinite both;background-color:rgba(34,47,62,.7);border-radius:100%;height:8px;width:8px}.tox .tox-spinner>div:nth-child(1){animation-delay:-.32s}.tox .tox-spinner>div:nth-child(2){animation-delay:-.16s}@keyframes tam-bouncing-dots{0%,100%,80%{transform:scale(0)}40%{transform:scale(1)}}.tox:not([dir=rtl]) .tox-spinner>div:not(:first-child){margin-left:4px}.tox[dir=rtl] .tox-spinner>div:not(:first-child){margin-right:4px}.tox .tox-statusbar{align-items:center;background-color:#fff;border-top:1px solid #ccc;color:rgba(34,47,62,.7);display:flex;flex:0 0 auto;font-size:12px;font-weight:400;height:18px;overflow:hidden;padding:0 8px;position:relative;text-transform:uppercase}.tox .tox-statusbar__text-container{display:flex;flex:1 1 auto;justify-content:flex-end;overflow:hidden}.tox .tox-statusbar__path{display:flex;flex:1 1 auto;margin-right:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tox .tox-statusbar__path>*{display:inline;white-space:nowrap}.tox .tox-statusbar__wordcount{flex:0 0 auto;margin-left:1ch}.tox .tox-statusbar a,.tox .tox-statusbar__path-item,.tox .tox-statusbar__wordcount{color:rgba(34,47,62,.7);text-decoration:none}.tox .tox-statusbar a:focus:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar a:hover:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar__path-item:focus:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar__path-item:hover:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar__wordcount:focus:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar__wordcount:hover:not(:disabled):not([aria-disabled=true]){cursor:pointer;text-decoration:underline}.tox .tox-statusbar__resize-handle{align-items:flex-end;align-self:stretch;cursor:nwse-resize;display:flex;flex:0 0 auto;justify-content:flex-end;margin-left:auto;margin-right:-8px;padding-left:1ch}.tox .tox-statusbar__resize-handle svg{display:block;fill:rgba(34,47,62,.7)}.tox:not([dir=rtl]) .tox-statusbar__path>*{margin-right:4px}.tox:not([dir=rtl]) .tox-statusbar__branding{margin-left:1ch}.tox[dir=rtl] .tox-statusbar{flex-direction:row-reverse}.tox[dir=rtl] .tox-statusbar__path>*{margin-left:4px}.tox .tox-throbber{z-index:1400}.tox .tox-throbber__busy-spinner{align-items:center;background-color:rgba(255,255,255,.6);bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}.tox .tox-tbtn{align-items:center;background:0 0;border:0;border-radius:3px;box-shadow:none;color:#222f3e;display:flex;flex:0 0 auto;font-size:14px;font-style:normal;font-weight:400;height:34px;justify-content:center;margin:2px 0 3px 0;outline:0;overflow:hidden;padding:0;text-transform:none;width:34px}.tox .tox-tbtn svg{display:block;fill:#222f3e}.tox .tox-tbtn.tox-tbtn-more{padding-left:5px;padding-right:5px;width:inherit}.tox .tox-tbtn:focus{background:#dee0e2;border:0;box-shadow:none}.tox .tox-tbtn:hover{background:#dee0e2;border:0;box-shadow:none;color:#222f3e}.tox .tox-tbtn:hover svg{fill:#222f3e}.tox .tox-tbtn:active{background:#c8cbcf;border:0;box-shadow:none;color:#222f3e}.tox .tox-tbtn:active svg{fill:#222f3e}.tox .tox-tbtn--disabled,.tox .tox-tbtn--disabled:hover,.tox .tox-tbtn:disabled,.tox .tox-tbtn:disabled:hover{background:0 0;border:0;box-shadow:none;color:rgba(34,47,62,.5);cursor:not-allowed}.tox .tox-tbtn--disabled svg,.tox .tox-tbtn--disabled:hover svg,.tox .tox-tbtn:disabled svg,.tox .tox-tbtn:disabled:hover svg{fill:rgba(34,47,62,.5)}.tox .tox-tbtn--enabled,.tox .tox-tbtn--enabled:hover{background:#c8cbcf;border:0;box-shadow:none;color:#222f3e}.tox .tox-tbtn--enabled:hover>*,.tox .tox-tbtn--enabled>*{transform:none}.tox .tox-tbtn--enabled svg,.tox .tox-tbtn--enabled:hover svg{fill:#222f3e}.tox .tox-tbtn:focus:not(.tox-tbtn--disabled){color:#222f3e}.tox .tox-tbtn:focus:not(.tox-tbtn--disabled) svg{fill:#222f3e}.tox .tox-tbtn:active>*{transform:none}.tox .tox-tbtn--md{height:51px;width:51px}.tox .tox-tbtn--lg{flex-direction:column;height:68px;width:68px}.tox .tox-tbtn--return{-ms-grid-row-align:stretch;align-self:stretch;height:unset;width:16px}.tox .tox-tbtn--labeled{padding:0 4px;width:unset}.tox .tox-tbtn__vlabel{display:block;font-size:10px;font-weight:400;letter-spacing:-.025em;margin-bottom:4px;white-space:nowrap}.tox .tox-tbtn--select{margin:2px 0 3px 0;padding:0 4px;width:auto}.tox .tox-tbtn__select-label{cursor:default;font-weight:400;margin:0 4px}.tox .tox-tbtn__select-chevron{align-items:center;display:flex;justify-content:center;width:16px}.tox .tox-tbtn__select-chevron svg{fill:rgba(34,47,62,.5)}.tox .tox-tbtn--bespoke .tox-tbtn__select-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:7em}.tox .tox-split-button{border:0;border-radius:3px;box-sizing:border-box;display:flex;margin:2px 0 3px 0;overflow:hidden}.tox .tox-split-button:hover{box-shadow:0 0 0 1px #dee0e2 inset}.tox .tox-split-button:focus{background:#dee0e2;box-shadow:none;color:#222f3e}.tox .tox-split-button>*{border-radius:0}.tox .tox-split-button__chevron{width:16px}.tox .tox-split-button__chevron svg{fill:rgba(34,47,62,.5)}.tox .tox-split-button .tox-tbtn{margin:0}.tox.tox-platform-touch .tox-split-button .tox-tbtn:first-child{width:30px}.tox.tox-platform-touch .tox-split-button__chevron{width:20px}.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:focus,.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:hover,.tox .tox-split-button.tox-tbtn--disabled:focus,.tox .tox-split-button.tox-tbtn--disabled:hover{background:0 0;box-shadow:none;color:rgba(34,47,62,.5)}.tox .tox-toolbar-overlord{background-color:#fff}.tox .tox-toolbar,.tox .tox-toolbar__overflow,.tox .tox-toolbar__primary{background:url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23cccccc'/%3E%3C/svg%3E") left 0 top 0 #fff;background-color:#fff;display:flex;flex:0 0 auto;flex-shrink:0;flex-wrap:wrap;padding:0 0}.tox .tox-toolbar__overflow.tox-toolbar__overflow--closed{height:0;opacity:0;padding-bottom:0;padding-top:0;visibility:hidden}.tox .tox-toolbar__overflow--growing{transition:height .3s ease,opacity .2s linear .1s}.tox .tox-toolbar__overflow--shrinking{transition:opacity .3s ease,height .2s linear .1s,visibility 0s linear .3s}.tox .tox-menubar+.tox-toolbar,.tox .tox-menubar+.tox-toolbar-overlord .tox-toolbar__primary{border-top:1px solid #ccc;margin-top:-1px}.tox .tox-toolbar--scrolling{flex-wrap:nowrap;overflow-x:auto}.tox .tox-pop .tox-toolbar{border-width:0}.tox .tox-toolbar--no-divider{background-image:none}.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar-overlord:first-child .tox-toolbar__primary,.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar:first-child{border-top:1px solid #ccc}.tox.tox-tinymce-aux .tox-toolbar__overflow{background-color:#fff;border:1px solid #ccc;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.15)}.tox[dir=rtl] .tox-tbtn__icon-rtl svg{transform:rotateY(180deg)}.tox .tox-toolbar__group{align-items:center;display:flex;flex-wrap:wrap;margin:0 0;padding:0 4px 0 4px}.tox .tox-toolbar__group--pull-right{margin-left:auto}.tox .tox-toolbar--scrolling .tox-toolbar__group{flex-shrink:0;flex-wrap:nowrap}.tox:not([dir=rtl]) .tox-toolbar__group:not(:last-of-type){border-right:1px solid #ccc}.tox[dir=rtl] .tox-toolbar__group:not(:last-of-type){border-left:1px solid #ccc}.tox .tox-tooltip{display:inline-block;padding:8px;position:relative}.tox .tox-tooltip__body{background-color:#222f3e;border-radius:3px;box-shadow:0 2px 4px rgba(34,47,62,.3);color:rgba(255,255,255,.75);font-size:14px;font-style:normal;font-weight:400;padding:4px 8px;text-transform:none}.tox .tox-tooltip__arrow{position:absolute}.tox .tox-tooltip--down .tox-tooltip__arrow{border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #222f3e;bottom:0;left:50%;position:absolute;transform:translateX(-50%)}.tox .tox-tooltip--up .tox-tooltip__arrow{border-bottom:8px solid #222f3e;border-left:8px solid transparent;border-right:8px solid transparent;left:50%;position:absolute;top:0;transform:translateX(-50%)}.tox .tox-tooltip--right .tox-tooltip__arrow{border-bottom:8px solid transparent;border-left:8px solid #222f3e;border-top:8px solid transparent;position:absolute;right:0;top:50%;transform:translateY(-50%)}.tox .tox-tooltip--left .tox-tooltip__arrow{border-bottom:8px solid transparent;border-right:8px solid #222f3e;border-top:8px solid transparent;left:0;position:absolute;top:50%;transform:translateY(-50%)}.tox .tox-well{border:1px solid #ccc;border-radius:3px;padding:8px;width:100%}.tox .tox-well>:first-child{margin-top:0}.tox .tox-well>:last-child{margin-bottom:0}.tox .tox-well>:only-child{margin:0}.tox .tox-custom-editor{border:1px solid #ccc;border-radius:3px;display:flex;flex:1;position:relative}.tox .tox-dialog-loading::before{background-color:rgba(0,0,0,.5);content:"";height:100%;position:absolute;width:100%;z-index:1000}.tox .tox-tab{cursor:pointer}.tox .tox-dialog__content-js{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-dialog__body-content .tox-collection{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-image-tools-edit-panel{height:60px}.tox .tox-image-tools__sidebar{height:60px} -/*# sourceMappingURL=skin.min.css.map */ diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.min.css.map b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.min.css.map deleted file mode 100644 index c0917db25704..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.min.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["ui/default/skin.css"],"names":[],"mappings":";;;;;;AAMA,KACE,WAAY,YACZ,MAAO,QACP,OAAQ,KACR,YAAa,aAAa,CAAE,kBAAkB,CAAE,UAAU,CAAE,MAAM,CAAE,WAAW,CAAE,MAAM,CAAE,SAAS,CAAE,gBAAgB,CAAE,WACtH,UAAW,KACX,WAAY,OACZ,YAAa,IACb,YAAa,OACb,4BAA6B,YAC7B,gBAAiB,KACjB,YAAa,KACb,eAAgB,KAChB,eAAgB,QAChB,YAAa,OAEf,yBACE,WAAY,QACZ,MAAO,QACP,OAAQ,QACR,UAAW,QACX,YAAa,QACb,UAAW,QACX,WAAY,QACZ,YAAa,QACb,YAAa,QACb,4BAA6B,QAC7B,WAAY,QACZ,gBAAiB,QACjB,YAAa,QACb,eAAgB,QAChB,eAAgB,QAChB,YAAa,QAEf,yBAEE,WAAY,IACZ,OAAQ,EACR,MAAO,KACP,OAAQ,KACR,OAAQ,EACR,UAAW,KACX,QAAS,EACT,QAAS,EACT,SAAU,OACV,MAAO,KAET,oBACE,UAAW,IACX,WAAY,KAEd,cACE,UAAW,IACX,WAAY,MAEd,aACE,OAAQ,IAAI,MAAM,KAClB,cAAe,EACf,WAAY,KACZ,WAAY,WACZ,QAAS,KACT,eAAgB,OAChB,YAAa,aAAa,CAAE,kBAAkB,CAAE,UAAU,CAAE,MAAM,CAAE,WAAW,CAAE,MAAM,CAAE,SAAS,CAAE,gBAAgB,CAAE,WACtH,SAAU,OACV,SAAU,SACV,WAAY,kBAEd,oBACE,OAAQ,KACR,WAAY,KAEd,uCACE,OAAQ,IAAI,MAAM,KAClB,cAAe,EACf,WAAY,KAEd,iBACE,YAAa,aAAa,CAAE,kBAAkB,CAAE,UAAU,CAAE,MAAM,CAAE,WAAW,CAAE,MAAM,CAAE,SAAS,CAAE,gBAAgB,CAAE,WACtH,QAAS,KAEX,oBACA,wBACE,QAAS,EAEX,yBACE,OAAQ,EAEV,kCACE,YAAa,OACb,QAAS,KACT,cAAe,IAEjB,uCACE,YAAa,QACb,OAAQ,IAAI,MAAM,KAClB,cAAe,IACf,QAAS,KACT,gBAAiB,cAEnB,2CACE,eAAgB,IAElB,+CACE,YAAa,OACb,QAAS,KACT,cAAe,IAEjB,oEACE,aAAc,KACd,aAAc,MAEhB,kCACE,WAAY,KAEd,4FACE,iBAAkB,oBAClB,aAAc,oBACd,MAAO,QAET,wGACE,aAAc,oBAEhB,8EACE,MAAO,QAET,wEACE,KAAM,QAER,sEACE,MAAO,QAET,4FACE,iBAAkB,mBAClB,aAAc,mBACd,MAAO,QAET,wGACE,aAAc,mBAEhB,8EACE,MAAO,QAET,wEACE,KAAM,QAER,sEACE,MAAO,QAET,6FACE,iBAAkB,iBAClB,aAAc,iBACd,MAAO,QAET,yGACE,aAAc,iBAEhB,+EACE,MAAO,KAET,yEACE,KAAM,KAER,uEACE,MAAO,KAET,+FACE,iBAAkB,oBAClB,aAAc,oBACd,MAAO,QAET,2GACE,aAAc,oBAEhB,iFACE,MAAO,QAET,2EACE,KAAM,QAER,yEACE,MAAO,QAET,+DACA,qFACE,WAAY,EAEd,uFACE,YAAa,IAEf,8FACE,YAAa,KAEf,gFACE,QAAS,IAAI,IAAI,IAAI,IAEvB,4FACE,kBAAmB,IACnB,aAAc,IAEhB,iFACE,aAAc,IAEhB,wFACE,aAAc,KAEhB,0EACE,QAAS,IAAI,IAAI,IAAI,IAEvB,sFACE,mBAAoB,IACpB,cAAe,IAEjB,oBACE,QAAS,KACT,KAAM,EAAE,EAAE,KAEZ,cACE,QAAS,KACT,KAAM,EAAE,EAAE,KAEZ,iBACE,iBAAkB,QAClB,iBAAkB,KAClB,oBAAqB,EAAE,EACvB,kBAAmB,OACnB,aAAc,QACd,cAAe,IACf,aAAc,MACd,aAAc,IACd,WAAY,KACZ,WAAY,WACZ,MAAO,KACP,OAAQ,QACR,QAAS,aACT,YAAa,aAAa,CAAE,kBAAkB,CAAE,UAAU,CAAE,MAAM,CAAE,WAAW,CAAE,MAAM,CAAE,SAAS,CAAE,gBAAgB,CAAE,WACtH,UAAW,KACX,WAAY,OACZ,YAAa,IACb,eAAgB,OAChB,YAAa,KACb,OAAQ,EACR,QAAS,EACT,QAAS,IAAI,KACb,WAAY,OACZ,gBAAiB,KACjB,eAAgB,WAChB,YAAa,OAEf,2BACE,iBAAkB,QAClB,iBAAkB,KAClB,aAAc,QACd,WAAY,KACZ,MAAO,qBACP,OAAQ,YAEV,sCACE,iBAAkB,QAClB,iBAAkB,KAClB,aAAc,QACd,WAAY,KACZ,MAAO,KAET,sCACE,iBAAkB,QAClB,iBAAkB,KAClB,aAAc,QACd,WAAY,KACZ,MAAO,KAET,uCACE,iBAAkB,QAClB,iBAAkB,KAClB,aAAc,QACd,WAAY,KACZ,MAAO,KAET,4BACE,iBAAkB,QAClB,iBAAkB,KAClB,oBAAqB,EAAE,EACvB,kBAAmB,OACnB,aAAc,QACd,cAAe,IACf,aAAc,MACd,aAAc,IACd,WAAY,KACZ,MAAO,QACP,UAAW,KACX,WAAY,OACZ,YAAa,IACb,eAAgB,OAChB,QAAS,EACT,QAAS,IAAI,KACb,gBAAiB,KACjB,eAAgB,WAElB,sCACE,iBAAkB,QAClB,iBAAkB,KAClB,aAAc,QACd,WAAY,KACZ,MAAO,kBAET,iDACE,iBAAkB,QAClB,iBAAkB,KAClB,aAAc,QACd,WAAY,KACZ,MAAO,QAET,iDACE,iBAAkB,QAClB,iBAAkB,KAClB,aAAc,QACd,WAAY,KACZ,MAAO,QAET,kDACE,iBAAkB,QAClB,iBAAkB,KAClB,aAAc,QACd,WAAY,KACZ,MAAO,QAET,uBACA,kCACA,wDACE,QAAS,IAEX,qCACA,gDACA,sEACE,QAAS,MACT,KAAM,aAER,sBACE,WAAY,EACZ,OAAQ,KACR,WAAY,WACZ,OAAQ,QACR,QAAS,aACT,YAAa,aAAa,CAAE,kBAAkB,CAAE,UAAU,CAAE,MAAM,CAAE,WAAW,CAAE,MAAM,CAAE,SAAS,CAAE,gBAAgB,CAAE,WACtH,UAAW,KACX,YAAa,IACb,YAAa,IACb,OAAQ,EACR,QAAS,EACT,YAAa,OAEf,0BACE,UAAW,KAEb,wBACE,iBAAkB,YAClB,aAAc,YACd,WAAY,MACZ,MAAO,QAET,kCACE,iBAAkB,QAClB,aAAc,QACd,WAAY,KACZ,MAAO,kBAET,6CACE,iBAAkB,QAClB,aAAc,QACd,WAAY,KACZ,MAAO,QAET,6CACE,iBAAkB,QAClB,aAAc,QACd,WAAY,KACZ,MAAO,QAET,8CACE,iBAAkB,QAClB,aAAc,QACd,WAAY,KACZ,MAAO,QAET,sCACE,KAAM,aAER,8DACE,MAAO,QAET,mBACE,YAAa,OACb,cAAe,IACf,OAAQ,QACR,QAAS,KACT,OAAQ,KACR,UAAW,KAEb,0BAEE,OAAQ,IACR,SAAU,OACV,SAAU,SACV,IAAK,KACL,MAAO,IAET,0BACE,YAAa,OACb,cAAe,IACf,WAAY,EAAE,EAAE,EAAE,IAAI,YACtB,WAAY,YACZ,QAAS,KACT,OAAQ,KACR,gBAAiB,OACjB,QAAS,gBACT,MAAO,KAET,4DACE,QAAS,MACT,KAAM,kBAER,gEACE,QAAS,KACT,KAAM,QAER,0DACE,QAAS,KACT,KAAM,QAER,6BACE,MAAO,kBACP,OAAQ,YAEV,kFACE,KAAM,kBAER,oFACE,KAAM,kBAER,wFACE,KAAM,kBAER,8FACE,QAAS,KAEX,4FACE,QAAS,MAEX,oGACE,QAAS,KAEX,wGACE,QAAS,MAEX,0DACE,cAAe,IACf,WAAY,MAAM,EAAE,EAAE,EAAE,IAAI,QAC5B,QAAS,gBAEX,yCACE,YAAa,IAEf,yCACE,KAAM,SAER,2CACE,YAAa,IAEf,mCACE,aAAc,IAEhB,mCACE,MAAO,SAET,qCACE,aAAc,IAKhB,qDACE,QAAS,KACT,QAAS,EAEX,kDACE,QAAS,KACT,UAAW,KACX,WAAY,MACZ,WAAY,OACZ,WAAY,KACZ,QAAS,EAEX,kDACE,oBAAqB,EACrB,aAAc,KACd,kBAAmB,EACnB,mBAAoB,EACpB,aAAc,MACd,iBAAkB,IAClB,QAAS,IAAI,EAEf,8DACE,iBAAkB,EAEpB,oCACE,iBAAkB,QAClB,MAAO,kBACP,OAAQ,QACR,UAAW,KACX,WAAY,OACZ,YAAa,IACb,cAAe,IACf,WAAY,KACZ,QAAS,IAAI,IACb,eAAgB,KAChB,sBAAuB,KACvB,oBAAqB,KAClB,iBAAkB,KACjB,gBAAiB,KACb,YAAa,KAEvB,2BACE,YAAa,OACb,MAAO,QACP,OAAQ,QACR,QAAS,KACT,sBAAuB,KACvB,oBAAqB,KAClB,iBAAkB,KACjB,gBAAiB,KACb,YAAa,KAEvB,iDACE,QAAS,IAAI,IAEf,oDACE,cAAe,IACf,QAAS,IAEX,iDACE,cAAe,IACf,QAAS,IAEX,0DACE,iBAAkB,KAClB,MAAO,QAET,yDACE,iBAAkB,QAEpB,6DACE,iBAAkB,QAClB,MAAO,QAET,4DACE,iBAAkB,QAEpB,0DACE,iBAAkB,QAClB,MAAO,QAET,oGACE,iBAAkB,QAClB,MAAO,QAET,oGACE,MAAO,QAET,uGACE,MAAO,QAET,2CACE,iBAAkB,YAClB,MAAO,kBACP,OAAQ,YAGV,qCADA,gCAEE,YAAa,OACb,QAAS,KACT,OAAQ,KACR,gBAAiB,OACjB,MAAO,KAGT,yCADA,oCAEE,KAAM,aAER,4DACE,OAAQ,KACR,MAAO,KAET,iCACE,MAAO,aACP,QAAS,aACT,KAAM,EACN,wBAAyB,KACzB,UAAW,KACX,WAAY,OACZ,YAAa,IACb,YAAa,KACb,eAAgB,KAChB,WAAY,UAEd,qCACE,MAAO,kBACP,QAAS,aACT,UAAW,KACX,OAAQ,KACR,YAAa,KACb,eAAgB,KAElB,iCACE,YAAa,OACb,QAAS,KACT,WAAY,KAEd,wCACE,QAAS,GACT,UAAW,EACX,WAAY,QAEd,qCACE,KAAM,QAER,yHACE,QAAS,KAEX,qJACE,QAAS,KAEX,iCACE,iBAAkB,KAClB,OAAQ,IAAI,MAAM,KAClB,cAAe,IACf,WAAY,EAAE,IAAI,IAAI,gBACtB,QAAS,KACT,KAAM,EAAE,EAAE,KACV,YAAa,EACb,UAAW,OACX,cAAe,EACf,WAAY,KACZ,QAAS,EAEX,wDACE,YAAa,OACb,QAAS,KACT,UAAW,OACX,OAAQ,EACR,QAAS,EAAE,IAEb,uDACE,OAAQ,KACR,OAAQ,IAAI,EAAE,IAAI,EAClB,QAAS,EAAE,IAEb,6DACE,YAAa,OAEf,6DACE,YAAa,IAEf,0FACE,aAAc,IAAI,MAAM,KAE1B,mFACE,YAAa,IAEf,kFACE,YAAa,IAEf,oDACE,YAAa,KACb,WAAY,MAEd,gEACE,YAAa,KAEf,oFACE,YAAa,IAAI,MAAM,KAEzB,6EACE,aAAc,IAEhB,4EACE,aAAc,IAKhB,4EACE,UAAW,gBAEb,8CACE,aAAc,KACd,WAAY,KAEd,0DACE,aAAc,KACd,UAAW,gBAEb,sEACE,aAAc,IAEhB,iCACE,QAAS,KACT,eAAgB,IAChB,OAAQ,MACR,OAAQ,EAEV,qBACE,WAAY,WACZ,QAAS,KACT,OAAQ,KAEV,8BACE,OAAQ,KAEV,qBACA,8BACE,MAAO,MAET,2BACE,WAAY,IACZ,OAAQ,IAAI,MAAM,KAClB,cAAe,IACf,WAAY,YACZ,OAAQ,KACR,SAAU,SACV,MAAO,KAET,iCACE,OAAQ,IAAI,MAAM,KAClB,cAAe,IACf,OAAQ,KACR,SAAU,SACV,MAAO,KAET,qBACE,WAAY,WACZ,OAAQ,KACR,MAAO,KAET,8BACE,WAAY,4GACZ,OAAQ,KACR,MAAO,KAET,qBACA,8BACE,MAAO,KAET,2BACE,WAAY,KACZ,OAAQ,IAAI,MAAM,KAClB,WAAY,YACZ,OAAQ,IACR,MAAO,KAET,mBACE,QAAS,KACT,eAAgB,OAChB,gBAAiB,cAEnB,uBACE,YAAa,OACb,QAAS,KACT,gBAAiB,cACjB,cAAe,IACf,MAAO,QAET,yBACE,MAAO,IAET,qCAEE,OAAQ,IAAI,MAAM,cAEpB,qCACE,OAAQ,IAAI,MAAM,KAClB,UAAW,EACX,cAAe,EAEjB,oCACE,aAAc,KAEhB,oCACE,aAAc,KAEhB,0CACE,YAAa,KAEf,wCACE,aAAc,KAEhB,8BACE,YAAa,KAEf,8BACE,YAAa,KAEf,oCACE,aAAc,KAEhB,kCACE,YAAa,KAEf,gCAEA,0CADA,yCAEE,OAAQ,IAAI,EAAE,IAAI,IAEpB,qEACE,OAAQ,EACR,OAAQ,KAAK,EAEf,wBACE,QAAS,KAEX,iBACE,OAAQ,KACR,WAAY,UAAU,IAAK,CAAE,WAAW,KACxC,MAAO,KAGT,uBADA,uBAEE,WAAY,EAAE,EAAE,EAAE,IAAI,qBAAyB,MAC/C,UAAW,UAEb,yBACE,YAAa,OACb,QAAS,KACT,gBAAiB,OAEnB,kCACE,OAAQ,QAEV,+BACE,YAAa,OACb,iBAAkB,YAClB,OAAQ,EACR,OAAQ,QACR,QAAS,KACT,OAAQ,KACR,gBAAiB,OACjB,QAAS,EACT,QAAS,EACT,MAAO,KAET,mCACE,OAAQ,KACR,MAAO,KAET,qCACE,WAAY,QAEd,8CACE,YAAa,KAEf,wCACE,aAAc,KAEhB,yBACE,WAAY,KACZ,SAAU,SAEZ,4CACE,WAAY,IAEd,kBACE,WAAY,KACZ,OAAQ,IAAI,MAAM,KAClB,cAAe,IACf,WAAY,EAAE,IAAI,IAAI,EAAE,kBACxB,QAAS,IAAI,IAAI,KAAK,IACtB,SAAU,SAEZ,0BACE,YAAa,OACb,MAAO,QACP,QAAS,KACT,gBAAiB,cAEnB,wBACE,MAAO,kBACP,UAAW,KAEb,wBACE,MAAO,QACP,UAAW,KACX,WAAY,OACZ,YAAa,IACb,YAAa,IACb,WAAY,IACZ,SAAU,SACV,eAAgB,QAElB,iCACE,OAAQ,KACR,YAAa,OACb,MAAO,KAET,4BACE,YAAa,IAEf,8BACE,MAAO,kBACP,UAAW,KACX,WAAY,OAEd,0BACE,OAAQ,EAEV,iCACE,YAAa,KACb,WAAY,OAEd,yCACE,WAAY,KACZ,OAAQ,EACR,QAAS,GACT,QAAS,KACT,KAAM,EACN,QAAS,GACT,SAAU,SACV,MAAO,EACP,IAAK,EACL,QAAS,EAEX,yBACE,QAAS,KACT,YAAa,EACb,UAAW,KACX,gBAAiB,SACjB,WAAY,IAEd,sCACE,cAAe,IACf,MAAO,KAET,wBACE,QAAS,KACT,UAAW,KACX,gBAAiB,SACjB,WAAY,KAEd,mCACE,WAAY,0CACZ,OAAQ,EACR,QAAS,GACT,QAAS,MACT,OAAQ,IACR,WAAY,MACZ,SAAU,SACV,MAAO,KAET,2BACE,WAAY,KACZ,OAAQ,EACR,QAAS,KACT,eAAgB,OAChB,UAAW,EACX,KAAM,EACN,QAAS,GACT,SAAU,SACV,MAAO,EACP,WAAY,OACZ,IAAK,EACL,QAAS,EAEX,gCACE,YAAa,OACb,MAAO,QACP,QAAS,KACT,eAAgB,OAChB,SAAU,SAEZ,oCACE,eAAgB,KAElB,+BACE,OAAQ,EACR,eAAgB,OAChB,UAAW,KACX,KAAM,EACN,QAAS,IACT,SAAU,SACV,MAAO,EACP,IAAK,EACL,QAAS,GAEX,iCACE,iBAAkB,KAClB,WAAY,EAAE,EAAE,IAAI,IAAI,KACxB,MAAO,QACP,WAAY,OAEd,kDACE,UAAW,KAEb,gCACE,YAAa,OACb,iBAAkB,KAClB,OAAQ,EACR,QAAS,KACT,gBAAiB,OACjB,KAAM,EACN,SAAU,SACV,MAAO,EACP,IAAK,EACL,QAAS,GAEX,0BACE,QAAS,KACT,eAAgB,OAChB,YAAa,EACb,SAAU,KAEZ,wBACE,OAAQ,IAEV,uCACE,YAAa,IAEf,4DACA,mDACA,oDACE,YAAa,IAEf,iCACE,aAAc,IAEhB,sDACA,6CACA,8CACE,aAAc,IAEhB,eACE,YAAa,OACb,QAAS,KAEX,2BACE,KAAM,kBAER,qBACE,MAAO,kBACP,UAAW,KACX,WAAY,OACZ,YAAa,IACb,eAAgB,UAElB,0CACE,aAAc,IAEhB,sDACE,YAAa,IAEf,oCACE,YAAa,IAEf,gDACE,aAAc,IAEhB,sBACE,YAAa,OACb,OAAQ,EACR,QAAS,KACT,gBAAiB,OACjB,KAAM,EACN,SAAU,MACV,MAAO,EACP,IAAK,EACL,QAAS,KAEX,gCACE,iBAAkB,sBAClB,OAAQ,EACR,KAAM,EACN,SAAU,SACV,MAAO,EACP,IAAK,EACL,QAAS,EAEX,wCACE,iBAAkB,KAEpB,iBACE,iBAAkB,KAClB,aAAc,KACd,cAAe,IACf,aAAc,MACd,aAAc,IACd,WAAY,EAAE,KAAK,KAAK,MAAM,kBAAsB,CAAE,EAAE,EAAE,KAAK,IAAI,mBACnE,QAAS,KACT,eAAgB,OAChB,WAAY,KACZ,UAAW,MACX,SAAU,OACV,SAAU,SACV,MAAO,KACP,QAAS,EAEX,yCACE,8CACE,WAAY,WACZ,OAAQ,IAAI,KACZ,MAAO,oBAGX,wBACE,QAAS,KAEX,yBACE,YAAa,OACb,iBAAkB,KAClB,cAAe,KACf,MAAO,QACP,QAAS,KACT,UAAW,KACX,gBAAiB,cACjB,QAAS,IAAI,KAAK,EAAE,KACpB,SAAU,SAEZ,qCACE,QAAS,EAEX,6BACE,OAAQ,KACR,OAAQ,KACR,KAAM,EACN,SAAU,SACV,IAAK,EACL,MAAO,KAET,oCACE,OAAQ,SAEV,0BACE,YAAa,KAEf,wBACE,YAAa,aAAa,CAAE,kBAAkB,CAAE,UAAU,CAAE,MAAM,CAAE,WAAW,CAAE,MAAM,CAAE,SAAS,CAAE,gBAAgB,CAAE,WACtH,UAAW,KACX,WAAY,OACZ,YAAa,IACb,YAAa,IACb,OAAQ,EACR,eAAgB,KAElB,uBACE,MAAO,QACP,QAAS,KACT,KAAM,EACN,wBAAyB,KACzB,UAAW,KACX,WAAY,OACZ,YAAa,IACb,YAAa,IACb,UAAW,EACX,WAAY,KACZ,eAAgB,KAElB,yCACE,oDACE,eAAgB,QAGpB,2BACE,YAAa,WACb,QAAS,KACT,eAAgB,OAChB,QAAS,KAAK,KAEhB,yCACE,wDACE,eAAgB,IAChB,2BAA4B,MAC5B,WAAY,KACZ,eAAgB,GAGpB,gCACE,cAAe,IAAI,MAAM,YACzB,MAAO,kBACP,QAAS,aACT,UAAW,KACX,YAAa,IACb,cAAe,IACf,gBAAiB,KACjB,YAAa,OAEf,sCACE,iBAAkB,oBAEpB,wCACE,cAAe,IAAI,MAAM,QACzB,MAAO,QAET,+BACE,WAAY,WACZ,QAAS,KACT,KAAM,EACN,eAAgB,OAChB,wBAAyB,KACzB,WAAY,MACZ,SAAU,KACV,2BAA4B,MAC5B,QAAS,KAAK,KAEhB,iCACE,cAAe,EACf,WAAY,KAEd,4CACE,WAAY,EAEd,2CACE,cAAe,EAEjB,2CACE,cAAe,EACf,WAAY,EAEd,iCACE,MAAO,QACP,OAAQ,QACR,gBAAiB,KAGnB,uCADA,uCAEE,MAAO,QACP,gBAAiB,KAEnB,wCACE,MAAO,QACP,gBAAiB,KAEnB,mCACE,KAAM,QAER,kCACE,QAAS,MACT,gBAAiB,KACjB,cAAe,KACf,mBAAoB,EACZ,kBAAmB,EAC3B,qBAAsB,EACd,oBAAqB,EAC7B,sBAAuB,OACf,qBAAsB,OAEhC,mDACE,MAAO,QACP,UAAW,KACX,WAAY,OACZ,YAAa,IACb,eAAgB,OAChB,cAAe,KACf,WAAY,KACZ,eAAgB,KAElB,mDACE,MAAO,QACP,UAAW,KACX,WAAY,OACZ,YAAa,IACb,eAAgB,OAChB,cAAe,KACf,WAAY,KACZ,eAAgB,KAElB,kDACE,cAAe,KAEjB,+DACA,+DACA,8DACE,WAAY,EAEd,8DACA,8DACA,6DACE,cAAe,EAEjB,8DACA,8DACA,6DACE,cAAe,EACf,WAAY,EAEd,2BACE,OAAQ,MACR,UAAW,OAEb,2BACE,UAAW,MAEb,qDACE,SAAU,KAEZ,yCACE,WAAY,OAEd,yBACE,YAAa,OACb,iBAAkB,KAClB,WAAY,IAAI,MAAM,KACtB,QAAS,KACT,gBAAiB,cACjB,QAAS,IAAI,KAGf,6BADA,+BAEE,QAAS,KAEX,+BACE,YAAa,OACb,iBAAkB,sBAClB,OAAQ,EACR,QAAS,KACT,gBAAiB,OACjB,KAAM,EACN,SAAU,SACV,MAAO,EACP,IAAK,EACL,QAAS,EAEX,wBACE,gBAAiB,SACjB,MAAO,KAET,iCACE,YAAa,IACb,eAAgB,IAElB,iCACE,cAAe,IAAI,MAAM,KAE3B,4CACE,cAAe,KAEjB,2BACE,eAAgB,IAChB,YAAa,IAEf,yBACE,SAAU,SACV,MAAO,KACP,QAAS,KAEX,8BACE,QAAS,KACT,KAAM,EACN,eAAgB,OAChB,wBAAyB,KAE3B,0CACE,QAAS,KACT,KAAM,EACN,wBAAyB,KAE3B,wDACE,KAAM,EACN,wBAAyB,KACzB,OAAQ,KAEV,8BACE,QAAS,EACT,WAAY,OAEd,6BACE,QAAS,EACT,WAAY,QAEd,iCACE,WAAY,WAAW,GAAG,OAAO,GAAI,CAAE,QAAQ,IAAK,KAEtD,wDACE,iBAAkB,GAEpB,gCACE,SAAU,OAKZ,sCACE,SAAU,iBAEZ,yCACE,uEACE,aAAc,GAGlB,yCACE,8FACE,YAAa,KAIjB,kEADA,oEAEE,YAAa,IAEf,gCACE,WAAY,MAEd,yCACE,iEACE,YAAa,GAGjB,yCACE,wFACE,aAAc,KAIlB,4DADA,8DAEE,aAAc,IAEhB,6BACE,QAAS,KACT,KAAM,EACN,wBAAyB,KAE3B,mBACE,YAAa,OACb,WAAY,KACZ,OAAQ,IAAI,OAAO,KACnB,WAAY,WACZ,QAAS,KACT,eAAgB,OAChB,UAAW,EACX,gBAAiB,OACjB,WAAY,MACZ,QAAS,KAEX,qBACE,MAAO,kBACP,OAAQ,EAAE,EAAE,KAAK,EAEnB,oBACE,QAAS,KACT,KAAM,EACN,wBAAyB,KACzB,SAAU,OACV,SAAU,SAEZ,4BACE,iBAAkB,KAClB,OAAQ,EACR,WAAY,WACZ,KAAM,EACN,wBAAyB,KACzB,OAAQ,KACR,SAAU,SACV,MAAO,KAET,0BACE,OAAQ,IAAI,OAAO,KAErB,2BACE,QAAS,KACT,KAAM,EAAE,EAAE,KACV,eAAgB,OAChB,SAAU,OAEZ,wBACE,QAAS,EAEX,iDACE,WAAY,KACZ,WAAY,WAAW,IAEzB,oDACA,2CACE,cAAe,KAEjB,uDACE,WAAY,EAAE,IAAI,IAAI,KAAK,gBAE7B,yBACE,QAAS,EACT,WAAY,OAEd,wBACE,QAAS,EACT,WAAY,QAEd,4BACE,WAAY,WAAW,GAAG,OAAO,IAAK,CAAE,QAAQ,KAAM,KAExD,mDACE,iBAAkB,GAEpB,uBACE,KAAM,EACN,SAAU,SAEZ,qGACA,qGACA,iGACE,QAAS,KAEX,2BACE,QAAS,MAEX,yCACE,SAAU,SACV,IAAK,IACL,UAAW,iBAEb,gDACE,KAAM,KAER,gDACE,KAAM,OAER,8CACE,KAAM,MAER,qEACA,qEACA,mEACE,cAAe,KAEjB,wDACE,MAAO,IAET,+DACA,+DACA,6DACE,aAAc,KAEhB,kDACE,KAAM,IAER,wBACE,UAAW,KAEb,kCACE,UAAW,KAEb,qDACE,YAAa,IAEf,sBACE,QAAS,KACT,SAAU,SACV,QAAS,EAEX,qCACE,QAAS,GAEX,2BACE,aAAc,kBACd,cAAe,IACf,aAAc,MACd,aAAc,IACd,WAAY,KACZ,WAAY,WACZ,OAAQ,KACR,SAAU,SACV,IAAK,IACL,MAAO,KAGT,2DADA,2DAEE,aAAc,QACd,OAAQ,QAEV,mCACE,iBAAkB,0DAAgE,CAAE,2DAAiE,CAAE,0DAAgE,CAAE,4DACzN,oBAAqB,EAAE,CAAC,CAAE,EAAE,GAAG,CAAE,IAAI,IAAI,CAAE,KAAK,EAChD,gBAAiB,KAAK,KACtB,OAAQ,IAAI,MAAM,KAClB,cAAe,IACf,WAAY,WACZ,QAAS,GACT,OAAQ,KACR,KAAM,KACN,SAAU,SACV,IAAK,KACL,MAAO,KACP,QAAS,GAEX,+CACE,OAAQ,YAKV,oDACE,aAAc,KAEhB,0CACE,KAAM,IAKR,8CACE,cAAe,KAEjB,oCACE,MAAO,IAET,gBACA,wBACE,MAAO,kBACP,QAAS,MACT,UAAW,KACX,WAAY,OACZ,YAAa,IACb,YAAa,IACb,QAAS,EAAE,IAAI,EAAE,EACjB,eAAgB,KAChB,YAAa,OAEf,wBACE,QAAS,EAAE,IAEb,yBACE,QAAS,EAAE,EAAE,EAAE,IAEjB,eACE,QAAS,KACT,KAAM,EACN,eAAgB,OAChB,wBAAyB,KAE3B,sBACE,WAAY,WACZ,cAAe,IAEjB,+BACE,KAAM,EAER,6BACE,MAAO,KAET,kCACE,QAAS,KAEX,qBACE,QAAS,KACT,eAAgB,IAChB,UAAW,KACX,gBAAiB,cAEnB,4CACE,MAAO,sBAET,4CACE,MAAO,2BAET,4CACE,MAAO,sBAET,iCACE,YAAa,OACb,QAAS,KAEX,8BACE,YAAa,OACb,QAAS,KAEX,iCACE,QAAS,KACT,KAAM,EACN,eAAgB,OAChB,wBAAyB,KAE3B,+CACE,KAAM,EACN,wBAAyB,KAE3B,6CACE,QAAS,KACT,KAAM,EACN,wBAAyB,KAE3B,2DACE,KAAM,EACN,wBAAyB,KACzB,OAAQ,KAEV,mEACE,YAAa,IAEf,6DACE,aAAc,IAEhB,iDACA,qDACE,QAAS,KAIX,4CACA,mBAHA,oBACA,4BAGE,mBAAoB,KACjB,gBAAiB,KACZ,WAAY,KACpB,iBAAkB,KAClB,aAAc,KACd,cAAe,IACf,aAAc,MACd,aAAc,IACd,WAAY,KACZ,WAAY,WACZ,MAAO,QACP,YAAa,aAAa,CAAE,kBAAkB,CAAE,UAAU,CAAE,MAAM,CAAE,WAAW,CAAE,MAAM,CAAE,SAAS,CAAE,gBAAgB,CAAE,WACtH,UAAW,KACX,YAAa,KACb,OAAQ,EACR,WAAY,KACZ,QAAS,EACT,QAAS,IAAI,OACb,OAAQ,KACR,MAAO,KAGT,6BADA,8BAEE,iBAAkB,QAClB,MAAO,mBACP,OAAQ,YAGV,kDACA,yBAFA,0BAGE,iBAAkB,KAClB,aAAc,QACd,WAAY,KACZ,QAAS,EAEX,4BACE,aAAc,EACd,cAAe,IACf,WAAY,IACZ,UAAW,MAEb,oBACE,iBAAkB,YAClB,OAAQ,EACR,aAAc,YACd,WAAY,MACZ,MAAO,QACP,OAAQ,QACR,QAAS,MACT,OAAQ,EACR,QAAS,EAEX,wBACE,QAAS,MACT,KAAM,QAER,6CACE,YAAa,IAEf,uCACE,aAAc,IAEhB,uBACE,OAAQ,QACR,SAAU,SAEZ,sDACE,iBAAkB,QAClB,MAAO,mBACP,OAAQ,YAEV,gCACE,OAAQ,QACR,KAAM,EACN,OAAQ,EAAE,IAEZ,kCACE,YAAa,OACb,QAAS,KACT,gBAAiB,OACjB,MAAO,KAET,sCACE,KAAM,QAER,4CACE,YAAa,OACb,QAAS,KAEX,0CACE,MAAO,IAET,oCACE,KAAM,IAER,sBACE,OAAQ,QACR,SAAU,SAEZ,6BACE,mBAAoB,KACjB,gBAAiB,KACZ,WAAY,KACpB,iBAAkB,KAClB,aAAc,KACd,cAAe,IACf,aAAc,MACd,aAAc,IACd,WAAY,KACZ,WAAY,WACZ,MAAO,QACP,YAAa,aAAa,CAAE,kBAAkB,CAAE,UAAU,CAAE,MAAM,CAAE,WAAW,CAAE,MAAM,CAAE,SAAS,CAAE,gBAAgB,CAAE,WACtH,UAAW,KACX,YAAa,KACb,OAAQ,EACR,WAAY,KACZ,QAAS,EACT,QAAS,IAAI,OACb,OAAQ,KACR,MAAO,KAET,uCACE,iBAAkB,QAClB,MAAO,mBACP,OAAQ,YAEV,yCACE,QAAS,KAEX,mCACE,iBAAkB,KAClB,aAAc,QACd,WAAY,KACZ,QAAS,EAEX,0BACE,eAAgB,KAChB,SAAU,SACV,IAAK,IACL,UAAW,iBAEb,sDACA,sDACE,cAAe,KAEjB,yCACE,MAAO,IAET,gDACA,gDACE,aAAc,KAEhB,mCACE,KAAM,IAER,mBACE,mBAAoB,SACjB,gBAAiB,SACZ,WAAY,SACpB,YAAa,SAEf,gBACE,OAAQ,EACR,OAAQ,KACR,KAAM,EACN,OAAQ,EACR,SAAU,OACV,oBAAqB,KACjB,oBAAqB,KACzB,QAAS,EACT,SAAU,MACV,IAAK,EACL,aAAc,WACd,MAAO,KAET,8EACE,QAAS,KAEX,gDACE,QAAS,KAEX,qCACE,QAAS,KAEX,0BACE,WAAY,KACZ,WAAY,IAEd,sBACE,MAAO,KAET,+BACE,YAAa,OACb,QAAS,KACT,gBAAiB,OAEnB,6BACE,iBAAkB,KAClB,OAAQ,MACR,SAAU,KACV,SAAU,SACV,MAAO,KAET,6BACA,uDACE,WAAY,IAEd,gCACE,WAAY,wGAEd,2CACE,KAAM,EACN,wBAAyB,KAE3B,yBACE,WAAY,KAEZ,QAAS,GACT,SAAU,SACV,KAAM,EAER,0BACE,OAAQ,IAAI,MAAM,KAClB,OAAQ,KACR,KAAM,EACN,SAAU,SACV,IAAK,EACL,MAAO,KAET,+BACE,OAAQ,EACR,OAAQ,KACR,SAAU,SAEZ,6BACE,aAAc,IAAI,EAAE,EAAE,IACtB,OAAQ,UACR,KAAM,MACN,OAAQ,KAAK,EAAE,EAAE,KACjB,IAAK,MAEP,6BACE,aAAc,IAAI,IAAI,EAAE,EACxB,OAAQ,UACR,KAAM,MACN,OAAQ,KAAK,EAAE,EAAE,MACjB,IAAK,MAEP,6BACE,aAAc,EAAE,EAAE,IAAI,IACtB,OAAQ,UACR,KAAM,MACN,OAAQ,MAAM,IAAI,EAAE,KACpB,IAAK,MAEP,6BACE,aAAc,EAAE,IAAI,IAAI,EACxB,OAAQ,UACR,KAAM,MACN,OAAQ,MAAM,EAAE,EAAE,MAClB,IAAK,MAEP,8EACE,YAAa,IAEf,sEACE,YAAa,KAEf,sEACE,YAAa,KAEf,wEACE,aAAc,IAEhB,gEACE,aAAc,KAEhB,gEACE,aAAc,KAEhB,8BACE,QAAS,KACT,UAAW,KACX,MAAO,MAET,kCACE,aAAc,KACd,aAAc,MACd,aAAc,EAAE,IAAI,IAAI,EACxB,WAAY,WACZ,OAAQ,KACR,MAAO,KAET,2EACE,OAAQ,KAAK,EAEf,iEACE,iBAAkB,oBAClB,aAAc,oBAEhB,qCACE,MAAO,kBACP,QAAS,MACT,UAAW,KACX,QAAS,IACT,WAAY,OACZ,MAAO,KAKT,gEACE,aAAc,EAKhB,4DACE,aAAc,EAMhB,eACE,iBAAkB,KAClB,OAAQ,IAAI,MAAM,KAClB,cAAe,IACf,WAAY,EAAE,IAAI,IAAI,EAAE,kBACxB,QAAS,aACT,SAAU,OACV,eAAgB,IAChB,QAAS,KAEX,mDACE,QAAS,EAEX,sDACE,QAAS,IAEX,mDACE,QAAS,IASX,iCACA,2BARA,yBACA,yBACA,yBACA,yBACA,yBACA,yBACA,wBAGE,OAAQ,EAEV,kBACE,WAAY,+MAA+M,KAAK,EAAE,IAAI,EAAE,KACxO,iBAAkB,KAClB,QAAS,KACT,KAAM,EAAE,EAAE,KACV,YAAa,EACb,UAAW,KACX,QAAS,EAAE,IAAI,EAAE,IAEnB,4FACE,WAAY,IAAI,MAAM,KAGxB,eACE,YAAa,OACb,WAAY,IACZ,OAAQ,EACR,cAAe,IACf,WAAY,KACZ,MAAO,QACP,QAAS,KACT,KAAM,EAAE,EAAE,KACV,UAAW,KACX,WAAY,OACZ,YAAa,IACb,OAAQ,KACR,gBAAiB,OACjB,OAAQ,IAAI,EAAE,IAAI,EAClB,QAAS,EACT,SAAU,OACV,QAAS,EAAE,IACX,eAAgB,KAChB,MAAO,KAET,yBACE,iBAAkB,YAClB,OAAQ,EACR,WAAY,KACZ,MAAO,kBACP,OAAQ,YAEV,oCACE,WAAY,QACZ,OAAQ,EACR,WAAY,KACZ,MAAO,QAET,uBACE,WAAY,QACZ,OAAQ,EACR,WAAY,KACZ,MAAO,QAET,2DACE,WAAY,QACZ,OAAQ,EACR,WAAY,KACZ,MAAO,QAET,6BACE,OAAQ,QACR,YAAa,IACb,OAAQ,EAAE,IAEZ,iDACE,OAAQ,YAEV,+BACE,YAAa,OACb,QAAS,KACT,gBAAiB,OACjB,MAAO,KACP,QAAS,KAEX,uBACE,cAAe,IACf,aAAc,MACd,aAAc,IACd,WAAY,KACZ,WAAY,WACZ,QAAS,SACT,QAAS,KACT,UAAW,KACX,YAAa,IACb,iBAAkB,iBAAkB,KAAK,iBACrC,sBAAuB,iBAAkB,KAAK,iBAClD,WAAY,IACZ,QAAS,EACT,QAAS,IACT,WAAY,UAAU,IAAM,OAAO,CAAE,QAAQ,MAAM,QAErD,yBACE,UAAW,KACX,YAAa,IAEf,yBACE,gBAAiB,UAEnB,2BACE,QAAS,EAEX,gCACE,iBAAkB,QAClB,aAAc,QACd,MAAO,QAET,kCACE,MAAO,QAET,kCACE,MAAO,QAET,oCACE,KAAM,QAER,8BACE,iBAAkB,QAClB,aAAc,QACd,MAAO,QAET,gCACE,MAAO,QAET,gCACE,MAAO,KAET,kCACE,KAAM,QAER,6BACA,gCACE,iBAAkB,QAClB,aAAc,QACd,MAAO,QAET,+BACA,kCACE,MAAO,QAET,+BACA,kCACE,MAAO,QAET,iCACA,oCACE,KAAM,QAER,6BACE,iBAAkB,QAClB,aAAc,QACd,MAAO,QAET,+BACE,MAAO,QAET,+BACE,MAAO,QAET,iCACE,KAAM,QAER,6BACE,mBAAoB,OAChB,WAAY,OAChB,MAAO,QACP,UAAW,KACX,qBAAsB,EACtB,gBAAiB,EACjB,gBAAiB,EACb,kBAAmB,EACvB,kBAAmB,EACnB,aAAc,EACd,aAAc,EACV,eAAgB,EACpB,WAAY,OACZ,YAAa,OACb,WAAY,UACZ,WAAY,WAEd,+BACE,OAAQ,EAEV,iCACE,WAAY,KAEd,6BACE,mBAAoB,OAChB,WAAY,OAChB,qBAAsB,EACtB,gBAAiB,EACjB,gBAAiB,EACb,kBAAmB,EACvB,kBAAmB,EACnB,aAAc,EACd,aAAc,EACV,eAAgB,EACpB,sBAAuB,IACnB,aAAc,IAEpB,iCACE,QAAS,MAEX,gCACE,mBAAoB,MAChB,WAAY,MAChB,qBAAsB,EACtB,gBAAiB,EACjB,gBAAiB,EACb,kBAAmB,EACvB,kBAAmB,EACnB,aAAc,EACd,aAAc,EACV,eAAgB,EACpB,sBAAuB,IACnB,aAAc,IAEpB,yCACE,qBAAsB,EACtB,gBAAiB,EACjB,gBAAiB,EACb,kBAAmB,EACvB,kBAAmB,EACnB,aAAc,EACd,aAAc,EACV,eAAgB,EACpB,sBAAuB,OACnB,aAAc,OAEpB,cACE,QAAS,aACT,SAAU,SAEZ,wBACE,WAAY,MAAM,IAAK,KAEzB,qCACE,UAAW,OAEb,sBACE,iBAAkB,KAClB,OAAQ,IAAI,MAAM,KAClB,cAAe,IACf,WAAY,EAAE,IAAI,IAAI,gBACtB,UAAW,EACX,SAAU,OAEZ,yCACE,OAAQ,IAAI,IAAI,IAAI,IAEtB,mCACE,iBAAkB,YAClB,cAAe,KAGjB,qBADA,sBAEE,aAAc,MACd,QAAS,GACT,QAAS,MACT,OAAQ,EACR,SAAU,SACV,MAAO,EAGT,qCADA,sCAEE,KAAM,IACN,IAAK,KAEP,qCACE,aAAc,KAAK,YAAY,YAAY,YAC3C,aAAc,IACd,YAAa,KACb,WAAY,KAEd,sCACE,aAAc,KAAQ,YAAY,YAAY,YAC9C,aAAc,IACd,YAAa,KAGf,kCADA,mCAEE,KAAM,IACN,IAAK,EACL,UAAW,kBAEb,kCACE,aAAc,YAAY,YAAY,KAAK,YAC3C,aAAc,IACd,YAAa,KACb,WAAY,IAEd,mCACE,aAAc,YAAY,YAAY,KAAQ,YAC9C,aAAc,IACd,YAAa,KAGf,mCADA,oCAEE,KAAM,EACN,IAAK,gBACL,UAAW,iBAEb,mCACE,aAAc,YAAY,KAAK,YAAY,YAC3C,aAAc,IACd,YAAa,MAEf,oCACE,aAAc,YAAY,KAAQ,YAAY,YAC9C,aAAc,KACd,YAAa,MAGf,oCADA,qCAEE,KAAM,KACN,IAAK,gBACL,UAAW,iBAEb,oCACE,aAAc,YAAY,YAAY,YAAY,KAClD,aAAc,IACd,YAAa,KAEf,qCACE,aAAc,YAAY,YAAY,YAAY,KAClD,aAAc,KACd,YAAa,KAGf,yCADA,0CAEE,KAAM,KAGR,0CADA,2CAEE,KAAM,kBAER,uBACE,QAAS,KACT,eAAgB,IAChB,UAAW,EACX,wBAAyB,EACzB,WAAY,EAEd,kBACE,iBAAkB,KAClB,QAAS,KACT,eAAgB,IAChB,gBAAiB,SAEnB,0BACE,QAAS,KACT,SAAU,OAEZ,kCACE,QAAS,KAEX,wBACE,QAAS,KAEX,kCACE,QAAS,EAEX,gCACE,QAAS,EAEX,mCACA,qCACE,WAAY,MAAM,IAAK,IAAI,CAAE,QAAQ,IAAK,KAE5C,mBACE,iBAAkB,QAClB,aAAc,QACd,aAAc,MACd,aAAc,IACd,WAAY,WACZ,QAAS,aACT,OAAQ,KACR,SAAU,SACV,MAAO,KAET,sCACE,OAAQ,KACR,MAAO,KAET,iBACE,YAAa,OACb,QAAS,KACT,KAAM,EACN,wBAAyB,KACzB,OAAQ,KACR,gBAAiB,OACjB,SAAU,SAEZ,uBACE,iBAAkB,YAClB,OAAQ,IAAI,MAAM,KAClB,cAAe,IACf,OAAQ,KACR,UAAW,MACX,MAAO,KAET,yBACE,iBAAkB,QAClB,OAAQ,IAAI,MAAM,QAClB,cAAe,IACf,WAAY,KACZ,OAAQ,KACR,KAAM,IACN,SAAU,SACV,IAAK,IACL,UAAW,iBAAiB,iBAC5B,MAAO,KAET,sBACE,SAAU,KAEZ,kBACE,QAAS,KAEX,sBACE,UAAW,kBAAkB,KAAK,YAAY,GAAG,SAAS,KAC1D,iBAAkB,kBAClB,cAAe,KACf,OAAQ,IACR,MAAO,IAET,mCACE,gBAAiB,MAEnB,mCACE,gBAAiB,MAEnB,6BACE,GAEA,KADA,IAEE,UAAW,SAEb,IACE,UAAW,UAGf,uDACE,YAAa,IAEf,iDACE,aAAc,IAEhB,oBACE,YAAa,OACb,iBAAkB,KAClB,WAAY,IAAI,MAAM,KACtB,MAAO,kBACP,QAAS,KACT,KAAM,EAAE,EAAE,KACV,UAAW,KACX,YAAa,IACb,OAAQ,KACR,SAAU,OACV,QAAS,EAAE,IACX,SAAU,SACV,eAAgB,UAElB,oCACE,QAAS,KACT,KAAM,EAAE,EAAE,KACV,gBAAiB,SACjB,SAAU,OAEZ,0BACE,QAAS,KACT,KAAM,EAAE,EAAE,KACV,aAAc,KACd,SAAU,OACV,cAAe,SACf,YAAa,OAEf,4BACE,QAAS,OACT,YAAa,OAEf,+BACE,KAAM,EAAE,EAAE,KACV,YAAa,IAEf,sBACA,+BACA,+BACE,MAAO,kBACP,gBAAiB,KAKnB,qEAHA,qEAIA,8EAHA,8EAIA,8EAHA,8EAIE,OAAQ,QACR,gBAAiB,UAEnB,mCACE,YAAa,SACb,WAAY,QACZ,OAAQ,YACR,QAAS,KACT,KAAM,EAAE,EAAE,KACV,gBAAiB,SACjB,YAAa,KACb,aAAc,KACd,aAAc,IAEhB,uCACE,QAAS,MACT,KAAM,kBAER,2CACE,aAAc,IAEhB,6CACE,YAAa,IAEf,6BACE,eAAgB,YAElB,qCACE,YAAa,IAEf,mBACE,QAAS,KAEX,iCACE,YAAa,OACb,iBAAkB,qBAClB,OAAQ,EACR,QAAS,KACT,gBAAiB,OACjB,KAAM,EACN,SAAU,SACV,MAAO,EACP,IAAK,EAEP,eACE,YAAa,OACb,WAAY,IACZ,OAAQ,EACR,cAAe,IACf,WAAY,KACZ,MAAO,QACP,QAAS,KACT,KAAM,EAAE,EAAE,KACV,UAAW,KACX,WAAY,OACZ,YAAa,IACb,OAAQ,KACR,gBAAiB,OACjB,OAAQ,IAAI,EAAE,IAAI,EAClB,QAAS,EACT,SAAU,OACV,QAAS,EACT,eAAgB,KAChB,MAAO,KAET,mBACE,QAAS,MACT,KAAM,QAER,6BACE,aAAc,IACd,cAAe,IACf,MAAO,QAET,qBACE,WAAY,QACZ,OAAQ,EACR,WAAY,KAEd,qBACE,WAAY,QACZ,OAAQ,EACR,WAAY,KACZ,MAAO,QAET,yBACE,KAAM,QAER,sBACE,WAAY,QACZ,OAAQ,EACR,WAAY,KACZ,MAAO,QAET,0BACE,KAAM,QAER,yBACA,+BACA,wBACA,8BACE,WAAY,IACZ,OAAQ,EACR,WAAY,KACZ,MAAO,kBACP,OAAQ,YAEV,6BACA,mCACA,4BACA,kCAEE,KAAM,kBAER,wBACA,8BACE,WAAY,QACZ,OAAQ,EACR,WAAY,KACZ,MAAO,QAGT,gCADA,0BAEE,UAAW,KAEb,4BACA,kCAEE,KAAM,QAER,8CACE,MAAO,QAET,kDACE,KAAM,QAER,wBACE,UAAW,KAEb,mBACE,OAAQ,KACR,MAAO,KAET,mBACE,eAAgB,OAChB,OAAQ,KACR,MAAO,KAET,uBACE,mBAAoB,QAChB,WAAY,QAChB,OAAQ,MACR,MAAO,KAET,wBACE,QAAS,EAAE,IACX,MAAO,MAET,uBACE,QAAS,MACT,UAAW,KACX,YAAa,IACb,eAAgB,QAChB,cAAe,IACf,YAAa,OAEf,uBACE,OAAQ,IAAI,EAAE,IAAI,EAClB,QAAS,EAAE,IACX,MAAO,KAET,6BACE,OAAQ,QACR,YAAa,IACb,OAAQ,EAAE,IAEZ,+BACE,YAAa,OACb,QAAS,KACT,gBAAiB,OACjB,MAAO,KAET,mCACE,KAAM,kBAER,gDACE,SAAU,OACV,cAAe,SACf,YAAa,OACb,MAAO,IAET,uBACE,OAAQ,EACR,cAAe,IACf,WAAY,WACZ,QAAS,KACT,OAAQ,IAAI,EAAE,IAAI,EAClB,SAAU,OAEZ,6BACE,WAAY,EAAE,EAAE,EAAE,IAAI,QAAQ,MAEhC,6BACE,WAAY,QACZ,WAAY,KACZ,MAAO,QAET,yBACE,cAAe,EAEjB,gCACE,MAAO,KAET,oCACE,KAAM,kBAER,iCACE,OAAQ,EAEV,gEACE,MAAO,KAET,mDACE,MAAO,KAKT,0DADA,0DADA,gDADA,gDAIE,WAAY,IACZ,WAAY,KACZ,MAAO,kBAET,2BACE,iBAAkB,KAEpB,kBAEA,4BADA,2BAEE,WAAY,+MAA+M,KAAK,EAAE,IAAI,EAAE,KACxO,iBAAkB,KAClB,QAAS,KACT,KAAM,EAAE,EAAE,KACV,YAAa,EACb,UAAW,KACX,QAAS,EAAE,EAEb,0DACE,OAAQ,EACR,QAAS,EACT,eAAgB,EAChB,YAAa,EACb,WAAY,OAEd,qCACE,WAAY,OAAO,IAAK,IAAI,CAAE,QAAQ,IAAK,OAAO,IAEpD,uCACE,WAAY,QAAQ,IAAK,IAAI,CAAE,OAAO,IAAK,OAAO,GAAI,CAAE,WAAW,GAAG,OAAO,IAE/E,+BACA,8DACE,WAAY,IAAI,MAAM,KACtB,WAAY,KAEd,6BACE,UAAW,OACX,WAAY,KAEd,2BACE,aAAc,EAEhB,8BACE,iBAAkB,KAGpB,mIADA,oGAEE,WAAY,IAAI,MAAM,KAExB,4CACE,iBAAkB,KAClB,OAAQ,IAAI,MAAM,KAClB,cAAe,IACf,WAAY,EAAE,IAAI,IAAI,gBAExB,sCACE,UAAW,gBAEb,yBACE,YAAa,OACb,QAAS,KACT,UAAW,KACX,OAAQ,EAAE,EACV,QAAS,EAAE,IAAI,EAAE,IAEnB,qCACE,YAAa,KAEf,iDACE,YAAa,EACb,UAAW,OAEb,2DACE,aAAc,IAAI,MAAM,KAE1B,qDACE,YAAa,IAAI,MAAM,KAEzB,kBACE,QAAS,aACT,QAAS,IACT,SAAU,SAEZ,wBACE,iBAAkB,QAClB,cAAe,IACf,WAAY,EAAE,IAAI,IAAI,kBACtB,MAAO,sBACP,UAAW,KACX,WAAY,OACZ,YAAa,IACb,QAAS,IAAI,IACb,eAAgB,KAElB,yBACE,SAAU,SAEZ,4CACE,YAAa,IAAI,MAAM,YACvB,aAAc,IAAI,MAAM,YACxB,WAAY,IAAI,MAAM,QACtB,OAAQ,EACR,KAAM,IACN,SAAU,SACV,UAAW,iBAEb,0CACE,cAAe,IAAI,MAAM,QACzB,YAAa,IAAI,MAAM,YACvB,aAAc,IAAI,MAAM,YACxB,KAAM,IACN,SAAU,SACV,IAAK,EACL,UAAW,iBAEb,6CACE,cAAe,IAAI,MAAM,YACzB,YAAa,IAAI,MAAM,QACvB,WAAY,IAAI,MAAM,YACtB,SAAU,SACV,MAAO,EACP,IAAK,IACL,UAAW,iBAEb,4CACE,cAAe,IAAI,MAAM,YACzB,aAAc,IAAI,MAAM,QACxB,WAAY,IAAI,MAAM,YACtB,KAAM,EACN,SAAU,SACV,IAAK,IACL,UAAW,iBAEb,eACE,OAAQ,IAAI,MAAM,KAClB,cAAe,IACf,QAAS,IACT,MAAO,KAET,4BACE,WAAY,EAEd,2BACE,cAAe,EAEjB,2BACE,OAAQ,EAEV,wBACE,OAAQ,IAAI,MAAM,KAClB,cAAe,IACf,QAAS,KACT,KAAM,EACN,SAAU,SAMZ,iCACE,iBAAkB,eAClB,QAAS,GACT,OAAQ,KACR,SAAU,SACV,MAAO,KACP,QAAS,KAEX,cACE,OAAQ,QAEV,6BACE,QAAS,KACT,KAAM,EACN,wBAAyB,KAE3B,+CACE,QAAS,KACT,KAAM,EACN,wBAAyB,KAE3B,iCACE,OAAQ,KAEV,+BACE,OAAQ","file":"skin.min.css","sourcesContent":["/**\n * Copyright (c) Tiny Technologies, Inc. All rights reserved.\n * Licensed under the LGPL or a commercial license.\n * For LGPL see License.txt in the project root for license information.\n * For commercial licenses see https://www.tiny.cloud/\n */\n.tox {\n box-sizing: content-box;\n color: #222f3e;\n cursor: auto;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n font-size: 16px;\n font-style: normal;\n font-weight: normal;\n line-height: normal;\n -webkit-tap-highlight-color: transparent;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n vertical-align: initial;\n white-space: normal;\n}\n.tox *:not(svg):not(rect) {\n box-sizing: inherit;\n color: inherit;\n cursor: inherit;\n direction: inherit;\n font-family: inherit;\n font-size: inherit;\n font-style: inherit;\n font-weight: inherit;\n line-height: inherit;\n -webkit-tap-highlight-color: inherit;\n text-align: inherit;\n text-decoration: inherit;\n text-shadow: inherit;\n text-transform: inherit;\n vertical-align: inherit;\n white-space: inherit;\n}\n.tox *:not(svg):not(rect) {\n /* stylelint-disable-line no-duplicate-selectors */\n background: transparent;\n border: 0;\n float: none;\n height: auto;\n margin: 0;\n max-width: none;\n outline: 0;\n padding: 0;\n position: static;\n width: auto;\n}\n.tox:not([dir=rtl]) {\n direction: ltr;\n text-align: left;\n}\n.tox[dir=rtl] {\n direction: rtl;\n text-align: right;\n}\n.tox-tinymce {\n border: 1px solid #cccccc;\n border-radius: 0;\n box-shadow: none;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n overflow: hidden;\n position: relative;\n visibility: inherit !important;\n}\n.tox-tinymce-inline {\n border: none;\n box-shadow: none;\n}\n.tox-tinymce-inline .tox-editor-header {\n border: 1px solid #cccccc;\n border-radius: 0;\n box-shadow: none;\n}\n.tox-tinymce-aux {\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n z-index: 1300;\n}\n.tox-tinymce *:focus,\n.tox-tinymce-aux *:focus {\n outline: none;\n}\nbutton::-moz-focus-inner {\n border: 0;\n}\n.tox .accessibility-issue__header {\n align-items: center;\n display: flex;\n margin-bottom: 4px;\n}\n.tox .accessibility-issue__description {\n align-items: stretch;\n border: 1px solid #cccccc;\n border-radius: 3px;\n display: flex;\n justify-content: space-between;\n}\n.tox .accessibility-issue__description > div {\n padding-bottom: 4px;\n}\n.tox .accessibility-issue__description > div > div {\n align-items: center;\n display: flex;\n margin-bottom: 4px;\n}\n.tox .accessibility-issue__description > *:last-child:not(:only-child) {\n border-color: #cccccc;\n border-style: solid;\n}\n.tox .accessibility-issue__repair {\n margin-top: 16px;\n}\n.tox .tox-dialog__body-content .accessibility-issue--info .accessibility-issue__description {\n background-color: rgba(32, 122, 183, 0.1);\n border-color: rgba(32, 122, 183, 0.4);\n color: #222f3e;\n}\n.tox .tox-dialog__body-content .accessibility-issue--info .accessibility-issue__description > *:last-child {\n border-color: rgba(32, 122, 183, 0.4);\n}\n.tox .tox-dialog__body-content .accessibility-issue--info .tox-form__group h2 {\n color: #207ab7;\n}\n.tox .tox-dialog__body-content .accessibility-issue--info .tox-icon svg {\n fill: #207ab7;\n}\n.tox .tox-dialog__body-content .accessibility-issue--info a .tox-icon {\n color: #207ab7;\n}\n.tox .tox-dialog__body-content .accessibility-issue--warn .accessibility-issue__description {\n background-color: rgba(255, 165, 0, 0.1);\n border-color: rgba(255, 165, 0, 0.5);\n color: #222f3e;\n}\n.tox .tox-dialog__body-content .accessibility-issue--warn .accessibility-issue__description > *:last-child {\n border-color: rgba(255, 165, 0, 0.5);\n}\n.tox .tox-dialog__body-content .accessibility-issue--warn .tox-form__group h2 {\n color: #cc8500;\n}\n.tox .tox-dialog__body-content .accessibility-issue--warn .tox-icon svg {\n fill: #cc8500;\n}\n.tox .tox-dialog__body-content .accessibility-issue--warn a .tox-icon {\n color: #cc8500;\n}\n.tox .tox-dialog__body-content .accessibility-issue--error .accessibility-issue__description {\n background-color: rgba(204, 0, 0, 0.1);\n border-color: rgba(204, 0, 0, 0.4);\n color: #222f3e;\n}\n.tox .tox-dialog__body-content .accessibility-issue--error .accessibility-issue__description > *:last-child {\n border-color: rgba(204, 0, 0, 0.4);\n}\n.tox .tox-dialog__body-content .accessibility-issue--error .tox-form__group h2 {\n color: #c00;\n}\n.tox .tox-dialog__body-content .accessibility-issue--error .tox-icon svg {\n fill: #c00;\n}\n.tox .tox-dialog__body-content .accessibility-issue--error a .tox-icon {\n color: #c00;\n}\n.tox .tox-dialog__body-content .accessibility-issue--success .accessibility-issue__description {\n background-color: rgba(120, 171, 70, 0.1);\n border-color: rgba(120, 171, 70, 0.4);\n color: #222f3e;\n}\n.tox .tox-dialog__body-content .accessibility-issue--success .accessibility-issue__description > *:last-child {\n border-color: rgba(120, 171, 70, 0.4);\n}\n.tox .tox-dialog__body-content .accessibility-issue--success .tox-form__group h2 {\n color: #78AB46;\n}\n.tox .tox-dialog__body-content .accessibility-issue--success .tox-icon svg {\n fill: #78AB46;\n}\n.tox .tox-dialog__body-content .accessibility-issue--success a .tox-icon {\n color: #78AB46;\n}\n.tox .tox-dialog__body-content .accessibility-issue__header h1,\n.tox .tox-dialog__body-content .tox-form__group .accessibility-issue__description h2 {\n margin-top: 0;\n}\n.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__header .tox-button {\n margin-left: 4px;\n}\n.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__header > *:nth-last-child(2) {\n margin-left: auto;\n}\n.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__description {\n padding: 4px 4px 4px 8px;\n}\n.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__description > *:last-child {\n border-left-width: 1px;\n padding-left: 4px;\n}\n.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__header .tox-button {\n margin-right: 4px;\n}\n.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__header > *:nth-last-child(2) {\n margin-right: auto;\n}\n.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__description {\n padding: 4px 8px 4px 4px;\n}\n.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__description > *:last-child {\n border-right-width: 1px;\n padding-right: 4px;\n}\n.tox .tox-anchorbar {\n display: flex;\n flex: 0 0 auto;\n}\n.tox .tox-bar {\n display: flex;\n flex: 0 0 auto;\n}\n.tox .tox-button {\n background-color: #207ab7;\n background-image: none;\n background-position: 0 0;\n background-repeat: repeat;\n border-color: #207ab7;\n border-radius: 3px;\n border-style: solid;\n border-width: 1px;\n box-shadow: none;\n box-sizing: border-box;\n color: #fff;\n cursor: pointer;\n display: inline-block;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n font-size: 14px;\n font-style: normal;\n font-weight: bold;\n letter-spacing: normal;\n line-height: 24px;\n margin: 0;\n outline: none;\n padding: 4px 16px;\n text-align: center;\n text-decoration: none;\n text-transform: capitalize;\n white-space: nowrap;\n}\n.tox .tox-button[disabled] {\n background-color: #207ab7;\n background-image: none;\n border-color: #207ab7;\n box-shadow: none;\n color: rgba(255, 255, 255, 0.5);\n cursor: not-allowed;\n}\n.tox .tox-button:focus:not(:disabled) {\n background-color: #1c6ca1;\n background-image: none;\n border-color: #1c6ca1;\n box-shadow: none;\n color: #fff;\n}\n.tox .tox-button:hover:not(:disabled) {\n background-color: #1c6ca1;\n background-image: none;\n border-color: #1c6ca1;\n box-shadow: none;\n color: #fff;\n}\n.tox .tox-button:active:not(:disabled) {\n background-color: #185d8c;\n background-image: none;\n border-color: #185d8c;\n box-shadow: none;\n color: #fff;\n}\n.tox .tox-button--secondary {\n background-color: #f0f0f0;\n background-image: none;\n background-position: 0 0;\n background-repeat: repeat;\n border-color: #f0f0f0;\n border-radius: 3px;\n border-style: solid;\n border-width: 1px;\n box-shadow: none;\n color: #222f3e;\n font-size: 14px;\n font-style: normal;\n font-weight: bold;\n letter-spacing: normal;\n outline: none;\n padding: 4px 16px;\n text-decoration: none;\n text-transform: capitalize;\n}\n.tox .tox-button--secondary[disabled] {\n background-color: #f0f0f0;\n background-image: none;\n border-color: #f0f0f0;\n box-shadow: none;\n color: rgba(34, 47, 62, 0.5);\n}\n.tox .tox-button--secondary:focus:not(:disabled) {\n background-color: #e3e3e3;\n background-image: none;\n border-color: #e3e3e3;\n box-shadow: none;\n color: #222f3e;\n}\n.tox .tox-button--secondary:hover:not(:disabled) {\n background-color: #e3e3e3;\n background-image: none;\n border-color: #e3e3e3;\n box-shadow: none;\n color: #222f3e;\n}\n.tox .tox-button--secondary:active:not(:disabled) {\n background-color: #d6d6d6;\n background-image: none;\n border-color: #d6d6d6;\n box-shadow: none;\n color: #222f3e;\n}\n.tox .tox-button--icon,\n.tox .tox-button.tox-button--icon,\n.tox .tox-button.tox-button--secondary.tox-button--icon {\n padding: 4px;\n}\n.tox .tox-button--icon .tox-icon svg,\n.tox .tox-button.tox-button--icon .tox-icon svg,\n.tox .tox-button.tox-button--secondary.tox-button--icon .tox-icon svg {\n display: block;\n fill: currentColor;\n}\n.tox .tox-button-link {\n background: 0;\n border: none;\n box-sizing: border-box;\n cursor: pointer;\n display: inline-block;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n font-size: 16px;\n font-weight: normal;\n line-height: 1.3;\n margin: 0;\n padding: 0;\n white-space: nowrap;\n}\n.tox .tox-button-link--sm {\n font-size: 14px;\n}\n.tox .tox-button--naked {\n background-color: transparent;\n border-color: transparent;\n box-shadow: unset;\n color: #222f3e;\n}\n.tox .tox-button--naked[disabled] {\n background-color: #f0f0f0;\n border-color: #f0f0f0;\n box-shadow: none;\n color: rgba(34, 47, 62, 0.5);\n}\n.tox .tox-button--naked:hover:not(:disabled) {\n background-color: #e3e3e3;\n border-color: #e3e3e3;\n box-shadow: none;\n color: #222f3e;\n}\n.tox .tox-button--naked:focus:not(:disabled) {\n background-color: #e3e3e3;\n border-color: #e3e3e3;\n box-shadow: none;\n color: #222f3e;\n}\n.tox .tox-button--naked:active:not(:disabled) {\n background-color: #d6d6d6;\n border-color: #d6d6d6;\n box-shadow: none;\n color: #222f3e;\n}\n.tox .tox-button--naked .tox-icon svg {\n fill: currentColor;\n}\n.tox .tox-button--naked.tox-button--icon:hover:not(:disabled) {\n color: #222f3e;\n}\n.tox .tox-checkbox {\n align-items: center;\n border-radius: 3px;\n cursor: pointer;\n display: flex;\n height: 36px;\n min-width: 36px;\n}\n.tox .tox-checkbox__input {\n /* Hide from view but visible to screen readers */\n height: 1px;\n overflow: hidden;\n position: absolute;\n top: auto;\n width: 1px;\n}\n.tox .tox-checkbox__icons {\n align-items: center;\n border-radius: 3px;\n box-shadow: 0 0 0 2px transparent;\n box-sizing: content-box;\n display: flex;\n height: 24px;\n justify-content: center;\n padding: calc(4px - 1px);\n width: 24px;\n}\n.tox .tox-checkbox__icons .tox-checkbox-icon__unchecked svg {\n display: block;\n fill: rgba(34, 47, 62, 0.3);\n}\n.tox .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg {\n display: none;\n fill: #207ab7;\n}\n.tox .tox-checkbox__icons .tox-checkbox-icon__checked svg {\n display: none;\n fill: #207ab7;\n}\n.tox .tox-checkbox--disabled {\n color: rgba(34, 47, 62, 0.5);\n cursor: not-allowed;\n}\n.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__checked svg {\n fill: rgba(34, 47, 62, 0.5);\n}\n.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__unchecked svg {\n fill: rgba(34, 47, 62, 0.5);\n}\n.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg {\n fill: rgba(34, 47, 62, 0.5);\n}\n.tox input.tox-checkbox__input:checked + .tox-checkbox__icons .tox-checkbox-icon__unchecked svg {\n display: none;\n}\n.tox input.tox-checkbox__input:checked + .tox-checkbox__icons .tox-checkbox-icon__checked svg {\n display: block;\n}\n.tox input.tox-checkbox__input:indeterminate + .tox-checkbox__icons .tox-checkbox-icon__unchecked svg {\n display: none;\n}\n.tox input.tox-checkbox__input:indeterminate + .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg {\n display: block;\n}\n.tox input.tox-checkbox__input:focus + .tox-checkbox__icons {\n border-radius: 3px;\n box-shadow: inset 0 0 0 1px #207ab7;\n padding: calc(4px - 1px);\n}\n.tox:not([dir=rtl]) .tox-checkbox__label {\n margin-left: 4px;\n}\n.tox:not([dir=rtl]) .tox-checkbox__input {\n left: -10000px;\n}\n.tox:not([dir=rtl]) .tox-bar .tox-checkbox {\n margin-left: 4px;\n}\n.tox[dir=rtl] .tox-checkbox__label {\n margin-right: 4px;\n}\n.tox[dir=rtl] .tox-checkbox__input {\n right: -10000px;\n}\n.tox[dir=rtl] .tox-bar .tox-checkbox {\n margin-right: 4px;\n}\n.tox {\n /* stylelint-disable-next-line no-descending-specificity */\n}\n.tox .tox-collection--toolbar .tox-collection__group {\n display: flex;\n padding: 0;\n}\n.tox .tox-collection--grid .tox-collection__group {\n display: flex;\n flex-wrap: wrap;\n max-height: 208px;\n overflow-x: hidden;\n overflow-y: auto;\n padding: 0;\n}\n.tox .tox-collection--list .tox-collection__group {\n border-bottom-width: 0;\n border-color: #cccccc;\n border-left-width: 0;\n border-right-width: 0;\n border-style: solid;\n border-top-width: 1px;\n padding: 4px 0;\n}\n.tox .tox-collection--list .tox-collection__group:first-child {\n border-top-width: 0;\n}\n.tox .tox-collection__group-heading {\n background-color: #e6e6e6;\n color: rgba(34, 47, 62, 0.7);\n cursor: default;\n font-size: 12px;\n font-style: normal;\n font-weight: normal;\n margin-bottom: 4px;\n margin-top: -4px;\n padding: 4px 8px;\n text-transform: none;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.tox .tox-collection__item {\n align-items: center;\n color: #222f3e;\n cursor: pointer;\n display: flex;\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n.tox .tox-collection--list .tox-collection__item {\n padding: 4px 8px;\n}\n.tox .tox-collection--toolbar .tox-collection__item {\n border-radius: 3px;\n padding: 4px;\n}\n.tox .tox-collection--grid .tox-collection__item {\n border-radius: 3px;\n padding: 4px;\n}\n.tox .tox-collection--list .tox-collection__item--enabled {\n background-color: #fff;\n color: #222f3e;\n}\n.tox .tox-collection--list .tox-collection__item--active {\n background-color: #dee0e2;\n}\n.tox .tox-collection--toolbar .tox-collection__item--enabled {\n background-color: #c8cbcf;\n color: #222f3e;\n}\n.tox .tox-collection--toolbar .tox-collection__item--active {\n background-color: #dee0e2;\n}\n.tox .tox-collection--grid .tox-collection__item--enabled {\n background-color: #c8cbcf;\n color: #222f3e;\n}\n.tox .tox-collection--grid .tox-collection__item--active:not(.tox-collection__item--state-disabled) {\n background-color: #dee0e2;\n color: #222f3e;\n}\n.tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled) {\n color: #222f3e;\n}\n.tox .tox-collection--toolbar .tox-collection__item--active:not(.tox-collection__item--state-disabled) {\n color: #222f3e;\n}\n.tox .tox-collection__item--state-disabled {\n background-color: transparent;\n color: rgba(34, 47, 62, 0.5);\n cursor: not-allowed;\n}\n.tox .tox-collection__item-icon,\n.tox .tox-collection__item-checkmark {\n align-items: center;\n display: flex;\n height: 24px;\n justify-content: center;\n width: 24px;\n}\n.tox .tox-collection__item-icon svg,\n.tox .tox-collection__item-checkmark svg {\n fill: currentColor;\n}\n.tox .tox-collection--toolbar-lg .tox-collection__item-icon {\n height: 48px;\n width: 48px;\n}\n.tox .tox-collection__item-label {\n color: currentColor;\n display: inline-block;\n flex: 1;\n -ms-flex-preferred-size: auto;\n font-size: 14px;\n font-style: normal;\n font-weight: normal;\n line-height: 24px;\n text-transform: none;\n word-break: break-all;\n}\n.tox .tox-collection__item-accessory {\n color: rgba(34, 47, 62, 0.7);\n display: inline-block;\n font-size: 14px;\n height: 24px;\n line-height: 24px;\n text-transform: none;\n}\n.tox .tox-collection__item-caret {\n align-items: center;\n display: flex;\n min-height: 24px;\n}\n.tox .tox-collection__item-caret::after {\n content: '';\n font-size: 0;\n min-height: inherit;\n}\n.tox .tox-collection__item-caret svg {\n fill: #222f3e;\n}\n.tox .tox-collection--list .tox-collection__item:not(.tox-collection__item--enabled) .tox-collection__item-checkmark svg {\n display: none;\n}\n.tox .tox-collection--list .tox-collection__item:not(.tox-collection__item--enabled) .tox-collection__item-accessory + .tox-collection__item-checkmark {\n display: none;\n}\n.tox .tox-collection--horizontal {\n background-color: #fff;\n border: 1px solid #cccccc;\n border-radius: 3px;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);\n display: flex;\n flex: 0 0 auto;\n flex-shrink: 0;\n flex-wrap: nowrap;\n margin-bottom: 0;\n overflow-x: auto;\n padding: 0;\n}\n.tox .tox-collection--horizontal .tox-collection__group {\n align-items: center;\n display: flex;\n flex-wrap: nowrap;\n margin: 0;\n padding: 0 4px;\n}\n.tox .tox-collection--horizontal .tox-collection__item {\n height: 34px;\n margin: 2px 0 3px 0;\n padding: 0 4px;\n}\n.tox .tox-collection--horizontal .tox-collection__item-label {\n white-space: nowrap;\n}\n.tox .tox-collection--horizontal .tox-collection__item-caret {\n margin-left: 4px;\n}\n.tox:not([dir=rtl]) .tox-collection--horizontal .tox-collection__group:not(:last-of-type) {\n border-right: 1px solid #cccccc;\n}\n.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item > *:not(:first-child) {\n margin-left: 8px;\n}\n.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item-label:first-child {\n margin-left: 4px;\n}\n.tox:not([dir=rtl]) .tox-collection__item-accessory {\n margin-left: 16px;\n text-align: right;\n}\n.tox:not([dir=rtl]) .tox-collection .tox-collection__item-caret {\n margin-left: 16px;\n}\n.tox[dir=rtl] .tox-collection--horizontal .tox-collection__group:not(:last-of-type) {\n border-left: 1px solid #cccccc;\n}\n.tox[dir=rtl] .tox-collection--list .tox-collection__item > *:not(:first-child) {\n margin-right: 8px;\n}\n.tox[dir=rtl] .tox-collection--list .tox-collection__item-label:first-child {\n margin-right: 4px;\n}\n.tox[dir=rtl] .tox-collection__item-icon-rtl {\n /* stylelint-disable-next-line no-descending-specificity */\n}\n.tox[dir=rtl] .tox-collection__item-icon-rtl .tox-collection__item-icon svg {\n transform: rotateY(180deg);\n}\n.tox[dir=rtl] .tox-collection__item-accessory {\n margin-right: 16px;\n text-align: left;\n}\n.tox[dir=rtl] .tox-collection .tox-collection__item-caret {\n margin-right: 16px;\n transform: rotateY(180deg);\n}\n.tox[dir=rtl] .tox-collection--horizontal .tox-collection__item-caret {\n margin-right: 4px;\n}\n.tox .tox-color-picker-container {\n display: flex;\n flex-direction: row;\n height: 225px;\n margin: 0;\n}\n.tox .tox-sv-palette {\n box-sizing: border-box;\n display: flex;\n height: 100%;\n}\n.tox .tox-sv-palette-spectrum {\n height: 100%;\n}\n.tox .tox-sv-palette,\n.tox .tox-sv-palette-spectrum {\n width: 225px;\n}\n.tox .tox-sv-palette-thumb {\n background: none;\n border: 1px solid black;\n border-radius: 50%;\n box-sizing: content-box;\n height: 12px;\n position: absolute;\n width: 12px;\n}\n.tox .tox-sv-palette-inner-thumb {\n border: 1px solid white;\n border-radius: 50%;\n height: 10px;\n position: absolute;\n width: 10px;\n}\n.tox .tox-hue-slider {\n box-sizing: border-box;\n height: 100%;\n width: 25px;\n}\n.tox .tox-hue-slider-spectrum {\n background: linear-gradient(to bottom, #f00, #ff0080, #f0f, #8000ff, #00f, #0080ff, #0ff, #00ff80, #0f0, #80ff00, #ff0, #ff8000, #f00);\n height: 100%;\n width: 100%;\n}\n.tox .tox-hue-slider,\n.tox .tox-hue-slider-spectrum {\n width: 20px;\n}\n.tox .tox-hue-slider-thumb {\n background: white;\n border: 1px solid black;\n box-sizing: content-box;\n height: 4px;\n width: 100%;\n}\n.tox .tox-rgb-form {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n}\n.tox .tox-rgb-form div {\n align-items: center;\n display: flex;\n justify-content: space-between;\n margin-bottom: 5px;\n width: inherit;\n}\n.tox .tox-rgb-form input {\n width: 6em;\n}\n.tox .tox-rgb-form input.tox-invalid {\n /* Need !important to override Chrome's focus styling unfortunately */\n border: 1px solid red !important;\n}\n.tox .tox-rgb-form .tox-rgba-preview {\n border: 1px solid black;\n flex-grow: 2;\n margin-bottom: 0;\n}\n.tox:not([dir=rtl]) .tox-sv-palette {\n margin-right: 15px;\n}\n.tox:not([dir=rtl]) .tox-hue-slider {\n margin-right: 15px;\n}\n.tox:not([dir=rtl]) .tox-hue-slider-thumb {\n margin-left: -1px;\n}\n.tox:not([dir=rtl]) .tox-rgb-form label {\n margin-right: 0.5em;\n}\n.tox[dir=rtl] .tox-sv-palette {\n margin-left: 15px;\n}\n.tox[dir=rtl] .tox-hue-slider {\n margin-left: 15px;\n}\n.tox[dir=rtl] .tox-hue-slider-thumb {\n margin-right: -1px;\n}\n.tox[dir=rtl] .tox-rgb-form label {\n margin-left: 0.5em;\n}\n.tox .tox-toolbar .tox-swatches,\n.tox .tox-toolbar__primary .tox-swatches,\n.tox .tox-toolbar__overflow .tox-swatches {\n margin: 2px 0 3px 4px;\n}\n.tox .tox-collection--list .tox-collection__group .tox-swatches-menu {\n border: 0;\n margin: -4px 0;\n}\n.tox .tox-swatches__row {\n display: flex;\n}\n.tox .tox-swatch {\n height: 30px;\n transition: transform 0.15s, box-shadow 0.15s;\n width: 30px;\n}\n.tox .tox-swatch:hover,\n.tox .tox-swatch:focus {\n box-shadow: 0 0 0 1px rgba(127, 127, 127, 0.3) inset;\n transform: scale(0.8);\n}\n.tox .tox-swatch--remove {\n align-items: center;\n display: flex;\n justify-content: center;\n}\n.tox .tox-swatch--remove svg path {\n stroke: #e74c3c;\n}\n.tox .tox-swatches__picker-btn {\n align-items: center;\n background-color: transparent;\n border: 0;\n cursor: pointer;\n display: flex;\n height: 30px;\n justify-content: center;\n outline: none;\n padding: 0;\n width: 30px;\n}\n.tox .tox-swatches__picker-btn svg {\n height: 24px;\n width: 24px;\n}\n.tox .tox-swatches__picker-btn:hover {\n background: #dee0e2;\n}\n.tox:not([dir=rtl]) .tox-swatches__picker-btn {\n margin-left: auto;\n}\n.tox[dir=rtl] .tox-swatches__picker-btn {\n margin-right: auto;\n}\n.tox .tox-comment-thread {\n background: #fff;\n position: relative;\n}\n.tox .tox-comment-thread > *:not(:first-child) {\n margin-top: 8px;\n}\n.tox .tox-comment {\n background: #fff;\n border: 1px solid #cccccc;\n border-radius: 3px;\n box-shadow: 0 4px 8px 0 rgba(34, 47, 62, 0.1);\n padding: 8px 8px 16px 8px;\n position: relative;\n}\n.tox .tox-comment__header {\n align-items: center;\n color: #222f3e;\n display: flex;\n justify-content: space-between;\n}\n.tox .tox-comment__date {\n color: rgba(34, 47, 62, 0.7);\n font-size: 12px;\n}\n.tox .tox-comment__body {\n color: #222f3e;\n font-size: 14px;\n font-style: normal;\n font-weight: normal;\n line-height: 1.3;\n margin-top: 8px;\n position: relative;\n text-transform: initial;\n}\n.tox .tox-comment__body textarea {\n resize: none;\n white-space: normal;\n width: 100%;\n}\n.tox .tox-comment__expander {\n padding-top: 8px;\n}\n.tox .tox-comment__expander p {\n color: rgba(34, 47, 62, 0.7);\n font-size: 14px;\n font-style: normal;\n}\n.tox .tox-comment__body p {\n margin: 0;\n}\n.tox .tox-comment__buttonspacing {\n padding-top: 16px;\n text-align: center;\n}\n.tox .tox-comment-thread__overlay::after {\n background: #fff;\n bottom: 0;\n content: \"\";\n display: flex;\n left: 0;\n opacity: 0.9;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 5;\n}\n.tox .tox-comment__reply {\n display: flex;\n flex-shrink: 0;\n flex-wrap: wrap;\n justify-content: flex-end;\n margin-top: 8px;\n}\n.tox .tox-comment__reply > *:first-child {\n margin-bottom: 8px;\n width: 100%;\n}\n.tox .tox-comment__edit {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-end;\n margin-top: 16px;\n}\n.tox .tox-comment__gradient::after {\n background: linear-gradient(rgba(255, 255, 255, 0), #fff);\n bottom: 0;\n content: \"\";\n display: block;\n height: 5em;\n margin-top: -40px;\n position: absolute;\n width: 100%;\n}\n.tox .tox-comment__overlay {\n background: #fff;\n bottom: 0;\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n left: 0;\n opacity: 0.9;\n position: absolute;\n right: 0;\n text-align: center;\n top: 0;\n z-index: 5;\n}\n.tox .tox-comment__loading-text {\n align-items: center;\n color: #222f3e;\n display: flex;\n flex-direction: column;\n position: relative;\n}\n.tox .tox-comment__loading-text > div {\n padding-bottom: 16px;\n}\n.tox .tox-comment__overlaytext {\n bottom: 0;\n flex-direction: column;\n font-size: 14px;\n left: 0;\n padding: 1em;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 10;\n}\n.tox .tox-comment__overlaytext p {\n background-color: #fff;\n box-shadow: 0 0 8px 8px #fff;\n color: #222f3e;\n text-align: center;\n}\n.tox .tox-comment__overlaytext div:nth-of-type(2) {\n font-size: 0.8em;\n}\n.tox .tox-comment__busy-spinner {\n align-items: center;\n background-color: #fff;\n bottom: 0;\n display: flex;\n justify-content: center;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 20;\n}\n.tox .tox-comment__scroll {\n display: flex;\n flex-direction: column;\n flex-shrink: 1;\n overflow: auto;\n}\n.tox .tox-conversations {\n margin: 8px;\n}\n.tox:not([dir=rtl]) .tox-comment__edit {\n margin-left: 8px;\n}\n.tox:not([dir=rtl]) .tox-comment__buttonspacing > *:last-child,\n.tox:not([dir=rtl]) .tox-comment__edit > *:last-child,\n.tox:not([dir=rtl]) .tox-comment__reply > *:last-child {\n margin-left: 8px;\n}\n.tox[dir=rtl] .tox-comment__edit {\n margin-right: 8px;\n}\n.tox[dir=rtl] .tox-comment__buttonspacing > *:last-child,\n.tox[dir=rtl] .tox-comment__edit > *:last-child,\n.tox[dir=rtl] .tox-comment__reply > *:last-child {\n margin-right: 8px;\n}\n.tox .tox-user {\n align-items: center;\n display: flex;\n}\n.tox .tox-user__avatar svg {\n fill: rgba(34, 47, 62, 0.7);\n}\n.tox .tox-user__name {\n color: rgba(34, 47, 62, 0.7);\n font-size: 12px;\n font-style: normal;\n font-weight: bold;\n text-transform: uppercase;\n}\n.tox:not([dir=rtl]) .tox-user__avatar svg {\n margin-right: 8px;\n}\n.tox:not([dir=rtl]) .tox-user__avatar + .tox-user__name {\n margin-left: 8px;\n}\n.tox[dir=rtl] .tox-user__avatar svg {\n margin-left: 8px;\n}\n.tox[dir=rtl] .tox-user__avatar + .tox-user__name {\n margin-right: 8px;\n}\n.tox .tox-dialog-wrap {\n align-items: center;\n bottom: 0;\n display: flex;\n justify-content: center;\n left: 0;\n position: fixed;\n right: 0;\n top: 0;\n z-index: 1100;\n}\n.tox .tox-dialog-wrap__backdrop {\n background-color: rgba(255, 255, 255, 0.75);\n bottom: 0;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 1;\n}\n.tox .tox-dialog-wrap__backdrop--opaque {\n background-color: #fff;\n}\n.tox .tox-dialog {\n background-color: #fff;\n border-color: #cccccc;\n border-radius: 3px;\n border-style: solid;\n border-width: 1px;\n box-shadow: 0 16px 16px -10px rgba(34, 47, 62, 0.15), 0 0 40px 1px rgba(34, 47, 62, 0.15);\n display: flex;\n flex-direction: column;\n max-height: 100%;\n max-width: 480px;\n overflow: hidden;\n position: relative;\n width: 95vw;\n z-index: 2;\n}\n@media only screen and (max-width:767px) {\n body:not(.tox-force-desktop) .tox .tox-dialog {\n align-self: flex-start;\n margin: 8px auto;\n width: calc(100vw - 16px);\n }\n}\n.tox .tox-dialog-inline {\n z-index: 1100;\n}\n.tox .tox-dialog__header {\n align-items: center;\n background-color: #fff;\n border-bottom: none;\n color: #222f3e;\n display: flex;\n font-size: 16px;\n justify-content: space-between;\n padding: 8px 16px 0 16px;\n position: relative;\n}\n.tox .tox-dialog__header .tox-button {\n z-index: 1;\n}\n.tox .tox-dialog__draghandle {\n cursor: grab;\n height: 100%;\n left: 0;\n position: absolute;\n top: 0;\n width: 100%;\n}\n.tox .tox-dialog__draghandle:active {\n cursor: grabbing;\n}\n.tox .tox-dialog__dismiss {\n margin-left: auto;\n}\n.tox .tox-dialog__title {\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n font-size: 20px;\n font-style: normal;\n font-weight: normal;\n line-height: 1.3;\n margin: 0;\n text-transform: none;\n}\n.tox .tox-dialog__body {\n color: #222f3e;\n display: flex;\n flex: 1;\n -ms-flex-preferred-size: auto;\n font-size: 16px;\n font-style: normal;\n font-weight: normal;\n line-height: 1.3;\n min-width: 0;\n text-align: left;\n text-transform: none;\n}\n@media only screen and (max-width:767px) {\n body:not(.tox-force-desktop) .tox .tox-dialog__body {\n flex-direction: column;\n }\n}\n.tox .tox-dialog__body-nav {\n align-items: flex-start;\n display: flex;\n flex-direction: column;\n padding: 16px 16px;\n}\n@media only screen and (max-width:767px) {\n body:not(.tox-force-desktop) .tox .tox-dialog__body-nav {\n flex-direction: row;\n -webkit-overflow-scrolling: touch;\n overflow-x: auto;\n padding-bottom: 0;\n }\n}\n.tox .tox-dialog__body-nav-item {\n border-bottom: 2px solid transparent;\n color: rgba(34, 47, 62, 0.7);\n display: inline-block;\n font-size: 14px;\n line-height: 1.3;\n margin-bottom: 8px;\n text-decoration: none;\n white-space: nowrap;\n}\n.tox .tox-dialog__body-nav-item:focus {\n background-color: rgba(32, 122, 183, 0.1);\n}\n.tox .tox-dialog__body-nav-item--active {\n border-bottom: 2px solid #207ab7;\n color: #207ab7;\n}\n.tox .tox-dialog__body-content {\n box-sizing: border-box;\n display: flex;\n flex: 1;\n flex-direction: column;\n -ms-flex-preferred-size: auto;\n max-height: 650px;\n overflow: auto;\n -webkit-overflow-scrolling: touch;\n padding: 16px 16px;\n}\n.tox .tox-dialog__body-content > * {\n margin-bottom: 0;\n margin-top: 16px;\n}\n.tox .tox-dialog__body-content > *:first-child {\n margin-top: 0;\n}\n.tox .tox-dialog__body-content > *:last-child {\n margin-bottom: 0;\n}\n.tox .tox-dialog__body-content > *:only-child {\n margin-bottom: 0;\n margin-top: 0;\n}\n.tox .tox-dialog__body-content a {\n color: #207ab7;\n cursor: pointer;\n text-decoration: none;\n}\n.tox .tox-dialog__body-content a:hover,\n.tox .tox-dialog__body-content a:focus {\n color: #185d8c;\n text-decoration: none;\n}\n.tox .tox-dialog__body-content a:active {\n color: #185d8c;\n text-decoration: none;\n}\n.tox .tox-dialog__body-content svg {\n fill: #222f3e;\n}\n.tox .tox-dialog__body-content ul {\n display: block;\n list-style-type: disc;\n margin-bottom: 16px;\n -webkit-margin-end: 0;\n margin-inline-end: 0;\n -webkit-margin-start: 0;\n margin-inline-start: 0;\n -webkit-padding-start: 2.5rem;\n padding-inline-start: 2.5rem;\n}\n.tox .tox-dialog__body-content .tox-form__group h1 {\n color: #222f3e;\n font-size: 20px;\n font-style: normal;\n font-weight: bold;\n letter-spacing: normal;\n margin-bottom: 16px;\n margin-top: 2rem;\n text-transform: none;\n}\n.tox .tox-dialog__body-content .tox-form__group h2 {\n color: #222f3e;\n font-size: 16px;\n font-style: normal;\n font-weight: bold;\n letter-spacing: normal;\n margin-bottom: 16px;\n margin-top: 2rem;\n text-transform: none;\n}\n.tox .tox-dialog__body-content .tox-form__group p {\n margin-bottom: 16px;\n}\n.tox .tox-dialog__body-content .tox-form__group h1:first-child,\n.tox .tox-dialog__body-content .tox-form__group h2:first-child,\n.tox .tox-dialog__body-content .tox-form__group p:first-child {\n margin-top: 0;\n}\n.tox .tox-dialog__body-content .tox-form__group h1:last-child,\n.tox .tox-dialog__body-content .tox-form__group h2:last-child,\n.tox .tox-dialog__body-content .tox-form__group p:last-child {\n margin-bottom: 0;\n}\n.tox .tox-dialog__body-content .tox-form__group h1:only-child,\n.tox .tox-dialog__body-content .tox-form__group h2:only-child,\n.tox .tox-dialog__body-content .tox-form__group p:only-child {\n margin-bottom: 0;\n margin-top: 0;\n}\n.tox .tox-dialog--width-lg {\n height: 650px;\n max-width: 1200px;\n}\n.tox .tox-dialog--width-md {\n max-width: 800px;\n}\n.tox .tox-dialog--width-md .tox-dialog__body-content {\n overflow: auto;\n}\n.tox .tox-dialog__body-content--centered {\n text-align: center;\n}\n.tox .tox-dialog__footer {\n align-items: center;\n background-color: #fff;\n border-top: 1px solid #cccccc;\n display: flex;\n justify-content: space-between;\n padding: 8px 16px;\n}\n.tox .tox-dialog__footer-start,\n.tox .tox-dialog__footer-end {\n display: flex;\n}\n.tox .tox-dialog__busy-spinner {\n align-items: center;\n background-color: rgba(255, 255, 255, 0.75);\n bottom: 0;\n display: flex;\n justify-content: center;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n z-index: 3;\n}\n.tox .tox-dialog__table {\n border-collapse: collapse;\n width: 100%;\n}\n.tox .tox-dialog__table thead th {\n font-weight: bold;\n padding-bottom: 8px;\n}\n.tox .tox-dialog__table tbody tr {\n border-bottom: 1px solid #cccccc;\n}\n.tox .tox-dialog__table tbody tr:last-child {\n border-bottom: none;\n}\n.tox .tox-dialog__table td {\n padding-bottom: 8px;\n padding-top: 8px;\n}\n.tox .tox-dialog__popups {\n position: absolute;\n width: 100%;\n z-index: 1100;\n}\n.tox .tox-dialog__body-iframe {\n display: flex;\n flex: 1;\n flex-direction: column;\n -ms-flex-preferred-size: auto;\n}\n.tox .tox-dialog__body-iframe .tox-navobj {\n display: flex;\n flex: 1;\n -ms-flex-preferred-size: auto;\n}\n.tox .tox-dialog__body-iframe .tox-navobj :nth-child(2) {\n flex: 1;\n -ms-flex-preferred-size: auto;\n height: 100%;\n}\n.tox .tox-dialog-dock-fadeout {\n opacity: 0;\n visibility: hidden;\n}\n.tox .tox-dialog-dock-fadein {\n opacity: 1;\n visibility: visible;\n}\n.tox .tox-dialog-dock-transition {\n transition: visibility 0s linear 0.3s, opacity 0.3s ease;\n}\n.tox .tox-dialog-dock-transition.tox-dialog-dock-fadein {\n transition-delay: 0s;\n}\nbody.tox-dialog__disable-scroll {\n overflow: hidden;\n}\n.tox.tox-platform-ie {\n /* IE11 CSS styles go here */\n}\n.tox.tox-platform-ie .tox-dialog-wrap {\n position: -ms-device-fixed;\n}\n@media only screen and (max-width:767px) {\n body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav {\n margin-right: 0;\n }\n}\n@media only screen and (max-width:767px) {\n body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav-item:not(:first-child) {\n margin-left: 8px;\n }\n}\n.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-start > *,\n.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-end > * {\n margin-left: 8px;\n}\n.tox[dir=rtl] .tox-dialog__body {\n text-align: right;\n}\n@media only screen and (max-width:767px) {\n body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav {\n margin-left: 0;\n }\n}\n@media only screen and (max-width:767px) {\n body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav-item:not(:first-child) {\n margin-right: 8px;\n }\n}\n.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-start > *,\n.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-end > * {\n margin-right: 8px;\n}\n.tox .tox-dropzone-container {\n display: flex;\n flex: 1;\n -ms-flex-preferred-size: auto;\n}\n.tox .tox-dropzone {\n align-items: center;\n background: #fff;\n border: 2px dashed #cccccc;\n box-sizing: border-box;\n display: flex;\n flex-direction: column;\n flex-grow: 1;\n justify-content: center;\n min-height: 100px;\n padding: 10px;\n}\n.tox .tox-dropzone p {\n color: rgba(34, 47, 62, 0.7);\n margin: 0 0 16px 0;\n}\n.tox .tox-edit-area {\n display: flex;\n flex: 1;\n -ms-flex-preferred-size: auto;\n overflow: hidden;\n position: relative;\n}\n.tox .tox-edit-area__iframe {\n background-color: #fff;\n border: 0;\n box-sizing: border-box;\n flex: 1;\n -ms-flex-preferred-size: auto;\n height: 100%;\n position: absolute;\n width: 100%;\n}\n.tox.tox-inline-edit-area {\n border: 1px dotted #cccccc;\n}\n.tox .tox-editor-container {\n display: flex;\n flex: 1 1 auto;\n flex-direction: column;\n overflow: hidden;\n}\n.tox .tox-editor-header {\n z-index: 1;\n}\n.tox:not(.tox-tinymce-inline) .tox-editor-header {\n box-shadow: none;\n transition: box-shadow 0.5s;\n}\n.tox.tox-tinymce--toolbar-bottom .tox-editor-header,\n.tox.tox-tinymce-inline .tox-editor-header {\n margin-bottom: -1px;\n}\n.tox.tox-tinymce--toolbar-sticky-on .tox-editor-header {\n box-shadow: 0 4px 4px -3px rgba(0, 0, 0, 0.25);\n}\n.tox-editor-dock-fadeout {\n opacity: 0;\n visibility: hidden;\n}\n.tox-editor-dock-fadein {\n opacity: 1;\n visibility: visible;\n}\n.tox-editor-dock-transition {\n transition: visibility 0s linear 0.25s, opacity 0.25s ease;\n}\n.tox-editor-dock-transition.tox-editor-dock-fadein {\n transition-delay: 0s;\n}\n.tox .tox-control-wrap {\n flex: 1;\n position: relative;\n}\n.tox .tox-control-wrap:not(.tox-control-wrap--status-invalid) .tox-control-wrap__status-icon-invalid,\n.tox .tox-control-wrap:not(.tox-control-wrap--status-unknown) .tox-control-wrap__status-icon-unknown,\n.tox .tox-control-wrap:not(.tox-control-wrap--status-valid) .tox-control-wrap__status-icon-valid {\n display: none;\n}\n.tox .tox-control-wrap svg {\n display: block;\n}\n.tox .tox-control-wrap__status-icon-wrap {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n}\n.tox .tox-control-wrap__status-icon-invalid svg {\n fill: #c00;\n}\n.tox .tox-control-wrap__status-icon-unknown svg {\n fill: orange;\n}\n.tox .tox-control-wrap__status-icon-valid svg {\n fill: green;\n}\n.tox:not([dir=rtl]) .tox-control-wrap--status-invalid .tox-textfield,\n.tox:not([dir=rtl]) .tox-control-wrap--status-unknown .tox-textfield,\n.tox:not([dir=rtl]) .tox-control-wrap--status-valid .tox-textfield {\n padding-right: 32px;\n}\n.tox:not([dir=rtl]) .tox-control-wrap__status-icon-wrap {\n right: 4px;\n}\n.tox[dir=rtl] .tox-control-wrap--status-invalid .tox-textfield,\n.tox[dir=rtl] .tox-control-wrap--status-unknown .tox-textfield,\n.tox[dir=rtl] .tox-control-wrap--status-valid .tox-textfield {\n padding-left: 32px;\n}\n.tox[dir=rtl] .tox-control-wrap__status-icon-wrap {\n left: 4px;\n}\n.tox .tox-autocompleter {\n max-width: 25em;\n}\n.tox .tox-autocompleter .tox-menu {\n max-width: 25em;\n}\n.tox .tox-autocompleter .tox-autocompleter-highlight {\n font-weight: bold;\n}\n.tox .tox-color-input {\n display: flex;\n position: relative;\n z-index: 1;\n}\n.tox .tox-color-input .tox-textfield {\n z-index: -1;\n}\n.tox .tox-color-input span {\n border-color: rgba(34, 47, 62, 0.2);\n border-radius: 3px;\n border-style: solid;\n border-width: 1px;\n box-shadow: none;\n box-sizing: border-box;\n height: 24px;\n position: absolute;\n top: 6px;\n width: 24px;\n}\n.tox .tox-color-input span:hover:not([aria-disabled=true]),\n.tox .tox-color-input span:focus:not([aria-disabled=true]) {\n border-color: #207ab7;\n cursor: pointer;\n}\n.tox .tox-color-input span::before {\n background-image: linear-gradient(45deg, rgba(0, 0, 0, 0.25) 25%, transparent 25%), linear-gradient(-45deg, rgba(0, 0, 0, 0.25) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, 0.25) 75%), linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, 0.25) 75%);\n background-position: 0 0, 0 6px, 6px -6px, -6px 0;\n background-size: 12px 12px;\n border: 1px solid #fff;\n border-radius: 3px;\n box-sizing: border-box;\n content: '';\n height: 24px;\n left: -1px;\n position: absolute;\n top: -1px;\n width: 24px;\n z-index: -1;\n}\n.tox .tox-color-input span[aria-disabled=true] {\n cursor: not-allowed;\n}\n.tox:not([dir=rtl]) .tox-color-input {\n /* stylelint-disable-next-line no-descending-specificity */\n}\n.tox:not([dir=rtl]) .tox-color-input .tox-textfield {\n padding-left: 36px;\n}\n.tox:not([dir=rtl]) .tox-color-input span {\n left: 6px;\n}\n.tox[dir=\"rtl\"] .tox-color-input {\n /* stylelint-disable-next-line no-descending-specificity */\n}\n.tox[dir=\"rtl\"] .tox-color-input .tox-textfield {\n padding-right: 36px;\n}\n.tox[dir=\"rtl\"] .tox-color-input span {\n right: 6px;\n}\n.tox .tox-label,\n.tox .tox-toolbar-label {\n color: rgba(34, 47, 62, 0.7);\n display: block;\n font-size: 14px;\n font-style: normal;\n font-weight: normal;\n line-height: 1.3;\n padding: 0 8px 0 0;\n text-transform: none;\n white-space: nowrap;\n}\n.tox .tox-toolbar-label {\n padding: 0 8px;\n}\n.tox[dir=rtl] .tox-label {\n padding: 0 0 0 8px;\n}\n.tox .tox-form {\n display: flex;\n flex: 1;\n flex-direction: column;\n -ms-flex-preferred-size: auto;\n}\n.tox .tox-form__group {\n box-sizing: border-box;\n margin-bottom: 4px;\n}\n.tox .tox-form-group--maximize {\n flex: 1;\n}\n.tox .tox-form__group--error {\n color: #c00;\n}\n.tox .tox-form__group--collection {\n display: flex;\n}\n.tox .tox-form__grid {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n justify-content: space-between;\n}\n.tox .tox-form__grid--2col > .tox-form__group {\n width: calc(50% - (8px / 2));\n}\n.tox .tox-form__grid--3col > .tox-form__group {\n width: calc(100% / 3 - (8px / 2));\n}\n.tox .tox-form__grid--4col > .tox-form__group {\n width: calc(25% - (8px / 2));\n}\n.tox .tox-form__controls-h-stack {\n align-items: center;\n display: flex;\n}\n.tox .tox-form__group--inline {\n align-items: center;\n display: flex;\n}\n.tox .tox-form__group--stretched {\n display: flex;\n flex: 1;\n flex-direction: column;\n -ms-flex-preferred-size: auto;\n}\n.tox .tox-form__group--stretched .tox-textarea {\n flex: 1;\n -ms-flex-preferred-size: auto;\n}\n.tox .tox-form__group--stretched .tox-navobj {\n display: flex;\n flex: 1;\n -ms-flex-preferred-size: auto;\n}\n.tox .tox-form__group--stretched .tox-navobj :nth-child(2) {\n flex: 1;\n -ms-flex-preferred-size: auto;\n height: 100%;\n}\n.tox:not([dir=rtl]) .tox-form__controls-h-stack > *:not(:first-child) {\n margin-left: 4px;\n}\n.tox[dir=rtl] .tox-form__controls-h-stack > *:not(:first-child) {\n margin-right: 4px;\n}\n.tox .tox-lock.tox-locked .tox-lock-icon__unlock,\n.tox .tox-lock:not(.tox-locked) .tox-lock-icon__lock {\n display: none;\n}\n.tox .tox-textfield,\n.tox .tox-toolbar-textfield,\n.tox .tox-listboxfield .tox-listbox--select,\n.tox .tox-textarea {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n background-color: #fff;\n border-color: #cccccc;\n border-radius: 3px;\n border-style: solid;\n border-width: 1px;\n box-shadow: none;\n box-sizing: border-box;\n color: #222f3e;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n font-size: 16px;\n line-height: 24px;\n margin: 0;\n min-height: 34px;\n outline: none;\n padding: 5px 4.75px;\n resize: none;\n width: 100%;\n}\n.tox .tox-textfield[disabled],\n.tox .tox-textarea[disabled] {\n background-color: #f2f2f2;\n color: rgba(34, 47, 62, 0.85);\n cursor: not-allowed;\n}\n.tox .tox-textfield:focus,\n.tox .tox-listboxfield .tox-listbox--select:focus,\n.tox .tox-textarea:focus {\n background-color: #fff;\n border-color: #207ab7;\n box-shadow: none;\n outline: none;\n}\n.tox .tox-toolbar-textfield {\n border-width: 0;\n margin-bottom: 3px;\n margin-top: 2px;\n max-width: 250px;\n}\n.tox .tox-naked-btn {\n background-color: transparent;\n border: 0;\n border-color: transparent;\n box-shadow: unset;\n color: #207ab7;\n cursor: pointer;\n display: block;\n margin: 0;\n padding: 0;\n}\n.tox .tox-naked-btn svg {\n display: block;\n fill: #222f3e;\n}\n.tox:not([dir=rtl]) .tox-toolbar-textfield + * {\n margin-left: 4px;\n}\n.tox[dir=rtl] .tox-toolbar-textfield + * {\n margin-right: 4px;\n}\n.tox .tox-listboxfield {\n cursor: pointer;\n position: relative;\n}\n.tox .tox-listboxfield .tox-listbox--select[disabled] {\n background-color: #f2f2f2;\n color: rgba(34, 47, 62, 0.85);\n cursor: not-allowed;\n}\n.tox .tox-listbox__select-label {\n cursor: default;\n flex: 1;\n margin: 0 4px;\n}\n.tox .tox-listbox__select-chevron {\n align-items: center;\n display: flex;\n justify-content: center;\n width: 16px;\n}\n.tox .tox-listbox__select-chevron svg {\n fill: #222f3e;\n}\n.tox .tox-listboxfield .tox-listbox--select {\n align-items: center;\n display: flex;\n}\n.tox:not([dir=rtl]) .tox-listboxfield svg {\n right: 8px;\n}\n.tox[dir=rtl] .tox-listboxfield svg {\n left: 8px;\n}\n.tox .tox-selectfield {\n cursor: pointer;\n position: relative;\n}\n.tox .tox-selectfield select {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n background-color: #fff;\n border-color: #cccccc;\n border-radius: 3px;\n border-style: solid;\n border-width: 1px;\n box-shadow: none;\n box-sizing: border-box;\n color: #222f3e;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n font-size: 16px;\n line-height: 24px;\n margin: 0;\n min-height: 34px;\n outline: none;\n padding: 5px 4.75px;\n resize: none;\n width: 100%;\n}\n.tox .tox-selectfield select[disabled] {\n background-color: #f2f2f2;\n color: rgba(34, 47, 62, 0.85);\n cursor: not-allowed;\n}\n.tox .tox-selectfield select::-ms-expand {\n display: none;\n}\n.tox .tox-selectfield select:focus {\n background-color: #fff;\n border-color: #207ab7;\n box-shadow: none;\n outline: none;\n}\n.tox .tox-selectfield svg {\n pointer-events: none;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n}\n.tox:not([dir=rtl]) .tox-selectfield select[size=\"0\"],\n.tox:not([dir=rtl]) .tox-selectfield select[size=\"1\"] {\n padding-right: 24px;\n}\n.tox:not([dir=rtl]) .tox-selectfield svg {\n right: 8px;\n}\n.tox[dir=rtl] .tox-selectfield select[size=\"0\"],\n.tox[dir=rtl] .tox-selectfield select[size=\"1\"] {\n padding-left: 24px;\n}\n.tox[dir=rtl] .tox-selectfield svg {\n left: 8px;\n}\n.tox .tox-textarea {\n -webkit-appearance: textarea;\n -moz-appearance: textarea;\n appearance: textarea;\n white-space: pre-wrap;\n}\n.tox-fullscreen {\n border: 0;\n height: 100%;\n left: 0;\n margin: 0;\n overflow: hidden;\n -ms-scroll-chaining: none;\n overscroll-behavior: none;\n padding: 0;\n position: fixed;\n top: 0;\n touch-action: pinch-zoom;\n width: 100%;\n}\n.tox-fullscreen .tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle {\n display: none;\n}\n.tox-fullscreen .tox.tox-tinymce.tox-fullscreen {\n z-index: 1200;\n}\n.tox-fullscreen .tox.tox-tinymce-aux {\n z-index: 1201;\n}\n.tox .tox-help__more-link {\n list-style: none;\n margin-top: 1em;\n}\n.tox .tox-image-tools {\n width: 100%;\n}\n.tox .tox-image-tools__toolbar {\n align-items: center;\n display: flex;\n justify-content: center;\n}\n.tox .tox-image-tools__image {\n background-color: #666;\n height: 380px;\n overflow: auto;\n position: relative;\n width: 100%;\n}\n.tox .tox-image-tools__image,\n.tox .tox-image-tools__image + .tox-image-tools__toolbar {\n margin-top: 8px;\n}\n.tox .tox-image-tools__image-bg {\n background: url(data:image/gif;base64,R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw==);\n}\n.tox .tox-image-tools__toolbar > .tox-spacer {\n flex: 1;\n -ms-flex-preferred-size: auto;\n}\n.tox .tox-croprect-block {\n background: black;\n filter: alpha(opacity=50);\n opacity: 0.5;\n position: absolute;\n zoom: 1;\n}\n.tox .tox-croprect-handle {\n border: 2px solid white;\n height: 20px;\n left: 0;\n position: absolute;\n top: 0;\n width: 20px;\n}\n.tox .tox-croprect-handle-move {\n border: 0;\n cursor: move;\n position: absolute;\n}\n.tox .tox-croprect-handle-nw {\n border-width: 2px 0 0 2px;\n cursor: nw-resize;\n left: 100px;\n margin: -2px 0 0 -2px;\n top: 100px;\n}\n.tox .tox-croprect-handle-ne {\n border-width: 2px 2px 0 0;\n cursor: ne-resize;\n left: 200px;\n margin: -2px 0 0 -20px;\n top: 100px;\n}\n.tox .tox-croprect-handle-sw {\n border-width: 0 0 2px 2px;\n cursor: sw-resize;\n left: 100px;\n margin: -20px 2px 0 -2px;\n top: 200px;\n}\n.tox .tox-croprect-handle-se {\n border-width: 0 2px 2px 0;\n cursor: se-resize;\n left: 200px;\n margin: -20px 0 0 -20px;\n top: 200px;\n}\n.tox:not([dir=rtl]) .tox-image-tools__toolbar > .tox-slider:not(:first-of-type) {\n margin-left: 8px;\n}\n.tox:not([dir=rtl]) .tox-image-tools__toolbar > .tox-button + .tox-slider {\n margin-left: 32px;\n}\n.tox:not([dir=rtl]) .tox-image-tools__toolbar > .tox-slider + .tox-button {\n margin-left: 32px;\n}\n.tox[dir=rtl] .tox-image-tools__toolbar > .tox-slider:not(:first-of-type) {\n margin-right: 8px;\n}\n.tox[dir=rtl] .tox-image-tools__toolbar > .tox-button + .tox-slider {\n margin-right: 32px;\n}\n.tox[dir=rtl] .tox-image-tools__toolbar > .tox-slider + .tox-button {\n margin-right: 32px;\n}\n.tox .tox-insert-table-picker {\n display: flex;\n flex-wrap: wrap;\n width: 170px;\n}\n.tox .tox-insert-table-picker > div {\n border-color: #cccccc;\n border-style: solid;\n border-width: 0 1px 1px 0;\n box-sizing: border-box;\n height: 17px;\n width: 17px;\n}\n.tox .tox-collection--list .tox-collection__group .tox-insert-table-picker {\n margin: -4px 0;\n}\n.tox .tox-insert-table-picker .tox-insert-table-picker__selected {\n background-color: rgba(32, 122, 183, 0.5);\n border-color: rgba(32, 122, 183, 0.5);\n}\n.tox .tox-insert-table-picker__label {\n color: rgba(34, 47, 62, 0.7);\n display: block;\n font-size: 14px;\n padding: 4px;\n text-align: center;\n width: 100%;\n}\n.tox:not([dir=rtl]) {\n /* stylelint-disable-next-line no-descending-specificity */\n}\n.tox:not([dir=rtl]) .tox-insert-table-picker > div:nth-child(10n) {\n border-right: 0;\n}\n.tox[dir=rtl] {\n /* stylelint-disable-next-line no-descending-specificity */\n}\n.tox[dir=rtl] .tox-insert-table-picker > div:nth-child(10n+1) {\n border-right: 0;\n}\n.tox {\n /* stylelint-disable */\n /* stylelint-enable */\n}\n.tox .tox-menu {\n background-color: #fff;\n border: 1px solid #cccccc;\n border-radius: 3px;\n box-shadow: 0 4px 8px 0 rgba(34, 47, 62, 0.1);\n display: inline-block;\n overflow: hidden;\n vertical-align: top;\n z-index: 1150;\n}\n.tox .tox-menu.tox-collection.tox-collection--list {\n padding: 0;\n}\n.tox .tox-menu.tox-collection.tox-collection--toolbar {\n padding: 4px;\n}\n.tox .tox-menu.tox-collection.tox-collection--grid {\n padding: 4px;\n}\n.tox .tox-menu__label h1,\n.tox .tox-menu__label h2,\n.tox .tox-menu__label h3,\n.tox .tox-menu__label h4,\n.tox .tox-menu__label h5,\n.tox .tox-menu__label h6,\n.tox .tox-menu__label p,\n.tox .tox-menu__label blockquote,\n.tox .tox-menu__label code {\n margin: 0;\n}\n.tox .tox-menubar {\n background: url(\"data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23cccccc'/%3E%3C/svg%3E\") left 0 top 0 #fff;\n background-color: #fff;\n display: flex;\n flex: 0 0 auto;\n flex-shrink: 0;\n flex-wrap: wrap;\n padding: 0 4px 0 4px;\n}\n.tox.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-menubar {\n border-top: 1px solid #cccccc;\n}\n/* Deprecated. Remove in next major release */\n.tox .tox-mbtn {\n align-items: center;\n background: transparent;\n border: 0;\n border-radius: 3px;\n box-shadow: none;\n color: #222f3e;\n display: flex;\n flex: 0 0 auto;\n font-size: 14px;\n font-style: normal;\n font-weight: normal;\n height: 34px;\n justify-content: center;\n margin: 2px 0 3px 0;\n outline: none;\n overflow: hidden;\n padding: 0 4px;\n text-transform: none;\n width: auto;\n}\n.tox .tox-mbtn[disabled] {\n background-color: transparent;\n border: 0;\n box-shadow: none;\n color: rgba(34, 47, 62, 0.5);\n cursor: not-allowed;\n}\n.tox .tox-mbtn:focus:not(:disabled) {\n background: #dee0e2;\n border: 0;\n box-shadow: none;\n color: #222f3e;\n}\n.tox .tox-mbtn--active {\n background: #c8cbcf;\n border: 0;\n box-shadow: none;\n color: #222f3e;\n}\n.tox .tox-mbtn:hover:not(:disabled):not(.tox-mbtn--active) {\n background: #dee0e2;\n border: 0;\n box-shadow: none;\n color: #222f3e;\n}\n.tox .tox-mbtn__select-label {\n cursor: default;\n font-weight: normal;\n margin: 0 4px;\n}\n.tox .tox-mbtn[disabled] .tox-mbtn__select-label {\n cursor: not-allowed;\n}\n.tox .tox-mbtn__select-chevron {\n align-items: center;\n display: flex;\n justify-content: center;\n width: 16px;\n display: none;\n}\n.tox .tox-notification {\n border-radius: 3px;\n border-style: solid;\n border-width: 1px;\n box-shadow: none;\n box-sizing: border-box;\n display: -ms-grid;\n display: grid;\n font-size: 14px;\n font-weight: normal;\n -ms-grid-columns: minmax(40px, 1fr) auto minmax(40px, 1fr);\n grid-template-columns: minmax(40px, 1fr) auto minmax(40px, 1fr);\n margin-top: 4px;\n opacity: 0;\n padding: 4px;\n transition: transform 100ms ease-in, opacity 150ms ease-in;\n}\n.tox .tox-notification p {\n font-size: 14px;\n font-weight: normal;\n}\n.tox .tox-notification a {\n text-decoration: underline;\n}\n.tox .tox-notification--in {\n opacity: 1;\n}\n.tox .tox-notification--success {\n background-color: #e4eeda;\n border-color: #d7e6c8;\n color: #222f3e;\n}\n.tox .tox-notification--success p {\n color: #222f3e;\n}\n.tox .tox-notification--success a {\n color: #547831;\n}\n.tox .tox-notification--success svg {\n fill: #222f3e;\n}\n.tox .tox-notification--error {\n background-color: #f8dede;\n border-color: #f2bfbf;\n color: #222f3e;\n}\n.tox .tox-notification--error p {\n color: #222f3e;\n}\n.tox .tox-notification--error a {\n color: #c00;\n}\n.tox .tox-notification--error svg {\n fill: #222f3e;\n}\n.tox .tox-notification--warn,\n.tox .tox-notification--warning {\n background-color: #fffaea;\n border-color: #ffe89d;\n color: #222f3e;\n}\n.tox .tox-notification--warn p,\n.tox .tox-notification--warning p {\n color: #222f3e;\n}\n.tox .tox-notification--warn a,\n.tox .tox-notification--warning a {\n color: #222f3e;\n}\n.tox .tox-notification--warn svg,\n.tox .tox-notification--warning svg {\n fill: #222f3e;\n}\n.tox .tox-notification--info {\n background-color: #d9edf7;\n border-color: #779ecb;\n color: #222f3e;\n}\n.tox .tox-notification--info p {\n color: #222f3e;\n}\n.tox .tox-notification--info a {\n color: #222f3e;\n}\n.tox .tox-notification--info svg {\n fill: #222f3e;\n}\n.tox .tox-notification__body {\n -ms-grid-row-align: center;\n align-self: center;\n color: #222f3e;\n font-size: 14px;\n -ms-grid-column-span: 1;\n grid-column-end: 3;\n -ms-grid-column: 2;\n grid-column-start: 2;\n -ms-grid-row-span: 1;\n grid-row-end: 2;\n -ms-grid-row: 1;\n grid-row-start: 1;\n text-align: center;\n white-space: normal;\n word-break: break-all;\n word-break: break-word;\n}\n.tox .tox-notification__body > * {\n margin: 0;\n}\n.tox .tox-notification__body > * + * {\n margin-top: 1rem;\n}\n.tox .tox-notification__icon {\n -ms-grid-row-align: center;\n align-self: center;\n -ms-grid-column-span: 1;\n grid-column-end: 2;\n -ms-grid-column: 1;\n grid-column-start: 1;\n -ms-grid-row-span: 1;\n grid-row-end: 2;\n -ms-grid-row: 1;\n grid-row-start: 1;\n -ms-grid-column-align: end;\n justify-self: end;\n}\n.tox .tox-notification__icon svg {\n display: block;\n}\n.tox .tox-notification__dismiss {\n -ms-grid-row-align: start;\n align-self: start;\n -ms-grid-column-span: 1;\n grid-column-end: 4;\n -ms-grid-column: 3;\n grid-column-start: 3;\n -ms-grid-row-span: 1;\n grid-row-end: 2;\n -ms-grid-row: 1;\n grid-row-start: 1;\n -ms-grid-column-align: end;\n justify-self: end;\n}\n.tox .tox-notification .tox-progress-bar {\n -ms-grid-column-span: 3;\n grid-column-end: 4;\n -ms-grid-column: 1;\n grid-column-start: 1;\n -ms-grid-row-span: 1;\n grid-row-end: 3;\n -ms-grid-row: 2;\n grid-row-start: 2;\n -ms-grid-column-align: center;\n justify-self: center;\n}\n.tox .tox-pop {\n display: inline-block;\n position: relative;\n}\n.tox .tox-pop--resizing {\n transition: width 0.1s ease;\n}\n.tox .tox-pop--resizing .tox-toolbar {\n flex-wrap: nowrap;\n}\n.tox .tox-pop__dialog {\n background-color: #fff;\n border: 1px solid #cccccc;\n border-radius: 3px;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);\n min-width: 0;\n overflow: hidden;\n}\n.tox .tox-pop__dialog > *:not(.tox-toolbar) {\n margin: 4px 4px 4px 8px;\n}\n.tox .tox-pop__dialog .tox-toolbar {\n background-color: transparent;\n margin-bottom: -1px;\n}\n.tox .tox-pop::before,\n.tox .tox-pop::after {\n border-style: solid;\n content: '';\n display: block;\n height: 0;\n position: absolute;\n width: 0;\n}\n.tox .tox-pop.tox-pop--bottom::before,\n.tox .tox-pop.tox-pop--bottom::after {\n left: 50%;\n top: 100%;\n}\n.tox .tox-pop.tox-pop--bottom::after {\n border-color: #fff transparent transparent transparent;\n border-width: 8px;\n margin-left: -8px;\n margin-top: -1px;\n}\n.tox .tox-pop.tox-pop--bottom::before {\n border-color: #cccccc transparent transparent transparent;\n border-width: 9px;\n margin-left: -9px;\n}\n.tox .tox-pop.tox-pop--top::before,\n.tox .tox-pop.tox-pop--top::after {\n left: 50%;\n top: 0;\n transform: translateY(-100%);\n}\n.tox .tox-pop.tox-pop--top::after {\n border-color: transparent transparent #fff transparent;\n border-width: 8px;\n margin-left: -8px;\n margin-top: 1px;\n}\n.tox .tox-pop.tox-pop--top::before {\n border-color: transparent transparent #cccccc transparent;\n border-width: 9px;\n margin-left: -9px;\n}\n.tox .tox-pop.tox-pop--left::before,\n.tox .tox-pop.tox-pop--left::after {\n left: 0;\n top: calc(50% - 1px);\n transform: translateY(-50%);\n}\n.tox .tox-pop.tox-pop--left::after {\n border-color: transparent #fff transparent transparent;\n border-width: 8px;\n margin-left: -15px;\n}\n.tox .tox-pop.tox-pop--left::before {\n border-color: transparent #cccccc transparent transparent;\n border-width: 10px;\n margin-left: -19px;\n}\n.tox .tox-pop.tox-pop--right::before,\n.tox .tox-pop.tox-pop--right::after {\n left: 100%;\n top: calc(50% + 1px);\n transform: translateY(-50%);\n}\n.tox .tox-pop.tox-pop--right::after {\n border-color: transparent transparent transparent #fff;\n border-width: 8px;\n margin-left: -1px;\n}\n.tox .tox-pop.tox-pop--right::before {\n border-color: transparent transparent transparent #cccccc;\n border-width: 10px;\n margin-left: -1px;\n}\n.tox .tox-pop.tox-pop--align-left::before,\n.tox .tox-pop.tox-pop--align-left::after {\n left: 20px;\n}\n.tox .tox-pop.tox-pop--align-right::before,\n.tox .tox-pop.tox-pop--align-right::after {\n left: calc(100% - 20px);\n}\n.tox .tox-sidebar-wrap {\n display: flex;\n flex-direction: row;\n flex-grow: 1;\n -ms-flex-preferred-size: 0;\n min-height: 0;\n}\n.tox .tox-sidebar {\n background-color: #fff;\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n}\n.tox .tox-sidebar__slider {\n display: flex;\n overflow: hidden;\n}\n.tox .tox-sidebar__pane-container {\n display: flex;\n}\n.tox .tox-sidebar__pane {\n display: flex;\n}\n.tox .tox-sidebar--sliding-closed {\n opacity: 0;\n}\n.tox .tox-sidebar--sliding-open {\n opacity: 1;\n}\n.tox .tox-sidebar--sliding-growing,\n.tox .tox-sidebar--sliding-shrinking {\n transition: width 0.5s ease, opacity 0.5s ease;\n}\n.tox .tox-selector {\n background-color: #4099ff;\n border-color: #4099ff;\n border-style: solid;\n border-width: 1px;\n box-sizing: border-box;\n display: inline-block;\n height: 10px;\n position: absolute;\n width: 10px;\n}\n.tox.tox-platform-touch .tox-selector {\n height: 12px;\n width: 12px;\n}\n.tox .tox-slider {\n align-items: center;\n display: flex;\n flex: 1;\n -ms-flex-preferred-size: auto;\n height: 24px;\n justify-content: center;\n position: relative;\n}\n.tox .tox-slider__rail {\n background-color: transparent;\n border: 1px solid #cccccc;\n border-radius: 3px;\n height: 10px;\n min-width: 120px;\n width: 100%;\n}\n.tox .tox-slider__handle {\n background-color: #207ab7;\n border: 2px solid #185d8c;\n border-radius: 3px;\n box-shadow: none;\n height: 24px;\n left: 50%;\n position: absolute;\n top: 50%;\n transform: translateX(-50%) translateY(-50%);\n width: 14px;\n}\n.tox .tox-source-code {\n overflow: auto;\n}\n.tox .tox-spinner {\n display: flex;\n}\n.tox .tox-spinner > div {\n animation: tam-bouncing-dots 1.5s ease-in-out 0s infinite both;\n background-color: rgba(34, 47, 62, 0.7);\n border-radius: 100%;\n height: 8px;\n width: 8px;\n}\n.tox .tox-spinner > div:nth-child(1) {\n animation-delay: -0.32s;\n}\n.tox .tox-spinner > div:nth-child(2) {\n animation-delay: -0.16s;\n}\n@keyframes tam-bouncing-dots {\n 0%,\n 80%,\n 100% {\n transform: scale(0);\n }\n 40% {\n transform: scale(1);\n }\n}\n.tox:not([dir=rtl]) .tox-spinner > div:not(:first-child) {\n margin-left: 4px;\n}\n.tox[dir=rtl] .tox-spinner > div:not(:first-child) {\n margin-right: 4px;\n}\n.tox .tox-statusbar {\n align-items: center;\n background-color: #fff;\n border-top: 1px solid #cccccc;\n color: rgba(34, 47, 62, 0.7);\n display: flex;\n flex: 0 0 auto;\n font-size: 12px;\n font-weight: normal;\n height: 18px;\n overflow: hidden;\n padding: 0 8px;\n position: relative;\n text-transform: uppercase;\n}\n.tox .tox-statusbar__text-container {\n display: flex;\n flex: 1 1 auto;\n justify-content: flex-end;\n overflow: hidden;\n}\n.tox .tox-statusbar__path {\n display: flex;\n flex: 1 1 auto;\n margin-right: auto;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.tox .tox-statusbar__path > * {\n display: inline;\n white-space: nowrap;\n}\n.tox .tox-statusbar__wordcount {\n flex: 0 0 auto;\n margin-left: 1ch;\n}\n.tox .tox-statusbar a,\n.tox .tox-statusbar__path-item,\n.tox .tox-statusbar__wordcount {\n color: rgba(34, 47, 62, 0.7);\n text-decoration: none;\n}\n.tox .tox-statusbar a:hover:not(:disabled):not([aria-disabled=true]),\n.tox .tox-statusbar__path-item:hover:not(:disabled):not([aria-disabled=true]),\n.tox .tox-statusbar__wordcount:hover:not(:disabled):not([aria-disabled=true]),\n.tox .tox-statusbar a:focus:not(:disabled):not([aria-disabled=true]),\n.tox .tox-statusbar__path-item:focus:not(:disabled):not([aria-disabled=true]),\n.tox .tox-statusbar__wordcount:focus:not(:disabled):not([aria-disabled=true]) {\n cursor: pointer;\n text-decoration: underline;\n}\n.tox .tox-statusbar__resize-handle {\n align-items: flex-end;\n align-self: stretch;\n cursor: nwse-resize;\n display: flex;\n flex: 0 0 auto;\n justify-content: flex-end;\n margin-left: auto;\n margin-right: -8px;\n padding-left: 1ch;\n}\n.tox .tox-statusbar__resize-handle svg {\n display: block;\n fill: rgba(34, 47, 62, 0.7);\n}\n.tox:not([dir=rtl]) .tox-statusbar__path > * {\n margin-right: 4px;\n}\n.tox:not([dir=rtl]) .tox-statusbar__branding {\n margin-left: 1ch;\n}\n.tox[dir=rtl] .tox-statusbar {\n flex-direction: row-reverse;\n}\n.tox[dir=rtl] .tox-statusbar__path > * {\n margin-left: 4px;\n}\n.tox .tox-throbber {\n z-index: 1400;\n}\n.tox .tox-throbber__busy-spinner {\n align-items: center;\n background-color: rgba(255, 255, 255, 0.6);\n bottom: 0;\n display: flex;\n justify-content: center;\n left: 0;\n position: absolute;\n right: 0;\n top: 0;\n}\n.tox .tox-tbtn {\n align-items: center;\n background: transparent;\n border: 0;\n border-radius: 3px;\n box-shadow: none;\n color: #222f3e;\n display: flex;\n flex: 0 0 auto;\n font-size: 14px;\n font-style: normal;\n font-weight: normal;\n height: 34px;\n justify-content: center;\n margin: 2px 0 3px 0;\n outline: none;\n overflow: hidden;\n padding: 0;\n text-transform: none;\n width: 34px;\n}\n.tox .tox-tbtn svg {\n display: block;\n fill: #222f3e;\n}\n.tox .tox-tbtn.tox-tbtn-more {\n padding-left: 5px;\n padding-right: 5px;\n width: inherit;\n}\n.tox .tox-tbtn:focus {\n background: #dee0e2;\n border: 0;\n box-shadow: none;\n}\n.tox .tox-tbtn:hover {\n background: #dee0e2;\n border: 0;\n box-shadow: none;\n color: #222f3e;\n}\n.tox .tox-tbtn:hover svg {\n fill: #222f3e;\n}\n.tox .tox-tbtn:active {\n background: #c8cbcf;\n border: 0;\n box-shadow: none;\n color: #222f3e;\n}\n.tox .tox-tbtn:active svg {\n fill: #222f3e;\n}\n.tox .tox-tbtn--disabled,\n.tox .tox-tbtn--disabled:hover,\n.tox .tox-tbtn:disabled,\n.tox .tox-tbtn:disabled:hover {\n background: transparent;\n border: 0;\n box-shadow: none;\n color: rgba(34, 47, 62, 0.5);\n cursor: not-allowed;\n}\n.tox .tox-tbtn--disabled svg,\n.tox .tox-tbtn--disabled:hover svg,\n.tox .tox-tbtn:disabled svg,\n.tox .tox-tbtn:disabled:hover svg {\n /* stylelint-disable-line no-descending-specificity */\n fill: rgba(34, 47, 62, 0.5);\n}\n.tox .tox-tbtn--enabled,\n.tox .tox-tbtn--enabled:hover {\n background: #c8cbcf;\n border: 0;\n box-shadow: none;\n color: #222f3e;\n}\n.tox .tox-tbtn--enabled > *,\n.tox .tox-tbtn--enabled:hover > * {\n transform: none;\n}\n.tox .tox-tbtn--enabled svg,\n.tox .tox-tbtn--enabled:hover svg {\n /* stylelint-disable-line no-descending-specificity */\n fill: #222f3e;\n}\n.tox .tox-tbtn:focus:not(.tox-tbtn--disabled) {\n color: #222f3e;\n}\n.tox .tox-tbtn:focus:not(.tox-tbtn--disabled) svg {\n fill: #222f3e;\n}\n.tox .tox-tbtn:active > * {\n transform: none;\n}\n.tox .tox-tbtn--md {\n height: 51px;\n width: 51px;\n}\n.tox .tox-tbtn--lg {\n flex-direction: column;\n height: 68px;\n width: 68px;\n}\n.tox .tox-tbtn--return {\n -ms-grid-row-align: stretch;\n align-self: stretch;\n height: unset;\n width: 16px;\n}\n.tox .tox-tbtn--labeled {\n padding: 0 4px;\n width: unset;\n}\n.tox .tox-tbtn__vlabel {\n display: block;\n font-size: 10px;\n font-weight: normal;\n letter-spacing: -0.025em;\n margin-bottom: 4px;\n white-space: nowrap;\n}\n.tox .tox-tbtn--select {\n margin: 2px 0 3px 0;\n padding: 0 4px;\n width: auto;\n}\n.tox .tox-tbtn__select-label {\n cursor: default;\n font-weight: normal;\n margin: 0 4px;\n}\n.tox .tox-tbtn__select-chevron {\n align-items: center;\n display: flex;\n justify-content: center;\n width: 16px;\n}\n.tox .tox-tbtn__select-chevron svg {\n fill: rgba(34, 47, 62, 0.5);\n}\n.tox .tox-tbtn--bespoke .tox-tbtn__select-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n width: 7em;\n}\n.tox .tox-split-button {\n border: 0;\n border-radius: 3px;\n box-sizing: border-box;\n display: flex;\n margin: 2px 0 3px 0;\n overflow: hidden;\n}\n.tox .tox-split-button:hover {\n box-shadow: 0 0 0 1px #dee0e2 inset;\n}\n.tox .tox-split-button:focus {\n background: #dee0e2;\n box-shadow: none;\n color: #222f3e;\n}\n.tox .tox-split-button > * {\n border-radius: 0;\n}\n.tox .tox-split-button__chevron {\n width: 16px;\n}\n.tox .tox-split-button__chevron svg {\n fill: rgba(34, 47, 62, 0.5);\n}\n.tox .tox-split-button .tox-tbtn {\n margin: 0;\n}\n.tox.tox-platform-touch .tox-split-button .tox-tbtn:first-child {\n width: 30px;\n}\n.tox.tox-platform-touch .tox-split-button__chevron {\n width: 20px;\n}\n.tox .tox-split-button.tox-tbtn--disabled:hover,\n.tox .tox-split-button.tox-tbtn--disabled:focus,\n.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:hover,\n.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:focus {\n background: transparent;\n box-shadow: none;\n color: rgba(34, 47, 62, 0.5);\n}\n.tox .tox-toolbar-overlord {\n background-color: #fff;\n}\n.tox .tox-toolbar,\n.tox .tox-toolbar__primary,\n.tox .tox-toolbar__overflow {\n background: url(\"data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23cccccc'/%3E%3C/svg%3E\") left 0 top 0 #fff;\n background-color: #fff;\n display: flex;\n flex: 0 0 auto;\n flex-shrink: 0;\n flex-wrap: wrap;\n padding: 0 0;\n}\n.tox .tox-toolbar__overflow.tox-toolbar__overflow--closed {\n height: 0;\n opacity: 0;\n padding-bottom: 0;\n padding-top: 0;\n visibility: hidden;\n}\n.tox .tox-toolbar__overflow--growing {\n transition: height 0.3s ease, opacity 0.2s linear 0.1s;\n}\n.tox .tox-toolbar__overflow--shrinking {\n transition: opacity 0.3s ease, height 0.2s linear 0.1s, visibility 0s linear 0.3s;\n}\n.tox .tox-menubar + .tox-toolbar,\n.tox .tox-menubar + .tox-toolbar-overlord .tox-toolbar__primary {\n border-top: 1px solid #cccccc;\n margin-top: -1px;\n}\n.tox .tox-toolbar--scrolling {\n flex-wrap: nowrap;\n overflow-x: auto;\n}\n.tox .tox-pop .tox-toolbar {\n border-width: 0;\n}\n.tox .tox-toolbar--no-divider {\n background-image: none;\n}\n.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar:first-child,\n.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar-overlord:first-child .tox-toolbar__primary {\n border-top: 1px solid #cccccc;\n}\n.tox.tox-tinymce-aux .tox-toolbar__overflow {\n background-color: #fff;\n border: 1px solid #cccccc;\n border-radius: 3px;\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);\n}\n.tox[dir=rtl] .tox-tbtn__icon-rtl svg {\n transform: rotateY(180deg);\n}\n.tox .tox-toolbar__group {\n align-items: center;\n display: flex;\n flex-wrap: wrap;\n margin: 0 0;\n padding: 0 4px 0 4px;\n}\n.tox .tox-toolbar__group--pull-right {\n margin-left: auto;\n}\n.tox .tox-toolbar--scrolling .tox-toolbar__group {\n flex-shrink: 0;\n flex-wrap: nowrap;\n}\n.tox:not([dir=rtl]) .tox-toolbar__group:not(:last-of-type) {\n border-right: 1px solid #cccccc;\n}\n.tox[dir=rtl] .tox-toolbar__group:not(:last-of-type) {\n border-left: 1px solid #cccccc;\n}\n.tox .tox-tooltip {\n display: inline-block;\n padding: 8px;\n position: relative;\n}\n.tox .tox-tooltip__body {\n background-color: #222f3e;\n border-radius: 3px;\n box-shadow: 0 2px 4px rgba(34, 47, 62, 0.3);\n color: rgba(255, 255, 255, 0.75);\n font-size: 14px;\n font-style: normal;\n font-weight: normal;\n padding: 4px 8px;\n text-transform: none;\n}\n.tox .tox-tooltip__arrow {\n position: absolute;\n}\n.tox .tox-tooltip--down .tox-tooltip__arrow {\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n border-top: 8px solid #222f3e;\n bottom: 0;\n left: 50%;\n position: absolute;\n transform: translateX(-50%);\n}\n.tox .tox-tooltip--up .tox-tooltip__arrow {\n border-bottom: 8px solid #222f3e;\n border-left: 8px solid transparent;\n border-right: 8px solid transparent;\n left: 50%;\n position: absolute;\n top: 0;\n transform: translateX(-50%);\n}\n.tox .tox-tooltip--right .tox-tooltip__arrow {\n border-bottom: 8px solid transparent;\n border-left: 8px solid #222f3e;\n border-top: 8px solid transparent;\n position: absolute;\n right: 0;\n top: 50%;\n transform: translateY(-50%);\n}\n.tox .tox-tooltip--left .tox-tooltip__arrow {\n border-bottom: 8px solid transparent;\n border-right: 8px solid #222f3e;\n border-top: 8px solid transparent;\n left: 0;\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n}\n.tox .tox-well {\n border: 1px solid #cccccc;\n border-radius: 3px;\n padding: 8px;\n width: 100%;\n}\n.tox .tox-well > *:first-child {\n margin-top: 0;\n}\n.tox .tox-well > *:last-child {\n margin-bottom: 0;\n}\n.tox .tox-well > *:only-child {\n margin: 0;\n}\n.tox .tox-custom-editor {\n border: 1px solid #cccccc;\n border-radius: 3px;\n display: flex;\n flex: 1;\n position: relative;\n}\n/* stylelint-disable */\n.tox {\n /* stylelint-enable */\n}\n.tox .tox-dialog-loading::before {\n background-color: rgba(0, 0, 0, 0.5);\n content: \"\";\n height: 100%;\n position: absolute;\n width: 100%;\n z-index: 1000;\n}\n.tox .tox-tab {\n cursor: pointer;\n}\n.tox .tox-dialog__content-js {\n display: flex;\n flex: 1;\n -ms-flex-preferred-size: auto;\n}\n.tox .tox-dialog__body-content .tox-collection {\n display: flex;\n flex: 1;\n -ms-flex-preferred-size: auto;\n}\n.tox .tox-image-tools-edit-panel {\n height: 60px;\n}\n.tox .tox-image-tools__sidebar {\n height: 60px;\n}\n"]} \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.mobile.min.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.mobile.min.css deleted file mode 100644 index 15555127c43c..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.mobile.min.css +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ -.tinymce-mobile-outer-container{all:initial;display:block}.tinymce-mobile-outer-container *{border:0;box-sizing:initial;cursor:inherit;float:none;line-height:1;margin:0;outline:0;padding:0;-webkit-tap-highlight-color:transparent;text-shadow:none;white-space:nowrap}.tinymce-mobile-icon-arrow-back::before{content:"\e5cd"}.tinymce-mobile-icon-image::before{content:"\e412"}.tinymce-mobile-icon-cancel-circle::before{content:"\e5c9"}.tinymce-mobile-icon-full-dot::before{content:"\e061"}.tinymce-mobile-icon-align-center::before{content:"\e234"}.tinymce-mobile-icon-align-left::before{content:"\e236"}.tinymce-mobile-icon-align-right::before{content:"\e237"}.tinymce-mobile-icon-bold::before{content:"\e238"}.tinymce-mobile-icon-italic::before{content:"\e23f"}.tinymce-mobile-icon-unordered-list::before{content:"\e241"}.tinymce-mobile-icon-ordered-list::before{content:"\e242"}.tinymce-mobile-icon-font-size::before{content:"\e245"}.tinymce-mobile-icon-underline::before{content:"\e249"}.tinymce-mobile-icon-link::before{content:"\e157"}.tinymce-mobile-icon-unlink::before{content:"\eca2"}.tinymce-mobile-icon-color::before{content:"\e891"}.tinymce-mobile-icon-previous::before{content:"\e314"}.tinymce-mobile-icon-next::before{content:"\e315"}.tinymce-mobile-icon-large-font::before,.tinymce-mobile-icon-style-formats::before{content:"\e264"}.tinymce-mobile-icon-undo::before{content:"\e166"}.tinymce-mobile-icon-redo::before{content:"\e15a"}.tinymce-mobile-icon-removeformat::before{content:"\e239"}.tinymce-mobile-icon-small-font::before{content:"\e906"}.tinymce-mobile-format-matches::after,.tinymce-mobile-icon-readonly-back::before{content:"\e5ca"}.tinymce-mobile-icon-small-heading::before{content:"small"}.tinymce-mobile-icon-large-heading::before{content:"large"}.tinymce-mobile-icon-large-heading::before,.tinymce-mobile-icon-small-heading::before{font-family:sans-serif;font-size:80%}.tinymce-mobile-mask-edit-icon::before{content:"\e254"}.tinymce-mobile-icon-back::before{content:"\e5c4"}.tinymce-mobile-icon-heading::before{content:"Headings";font-family:sans-serif;font-size:80%;font-weight:700}.tinymce-mobile-icon-h1::before{content:"H1";font-weight:700}.tinymce-mobile-icon-h2::before{content:"H2";font-weight:700}.tinymce-mobile-icon-h3::before{content:"H3";font-weight:700}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask{align-items:center;display:flex;justify-content:center;background:rgba(51,51,51,.5);height:100%;position:absolute;top:0;width:100%}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container{align-items:center;border-radius:50%;display:flex;flex-direction:column;font-family:sans-serif;font-size:1em;justify-content:space-between}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .mixin-menu-item{align-items:center;display:flex;justify-content:center;border-radius:50%;height:2.1em;width:2.1em}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section{align-items:center;display:flex;justify-content:center;flex-direction:column;font-size:1em}@media only screen and (min-device-width:700px){.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section{font-size:1.2em}}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon{align-items:center;display:flex;justify-content:center;border-radius:50%;height:2.1em;width:2.1em;background-color:#fff;color:#207ab7}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon::before{content:"\e900";font-family:tinymce-mobile,sans-serif}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section:not(.tinymce-mobile-mask-tap-icon-selected) .tinymce-mobile-mask-tap-icon{z-index:2}.tinymce-mobile-android-container.tinymce-mobile-android-maximized{background:#fff;border:none;bottom:0;display:flex;flex-direction:column;left:0;position:fixed;right:0;top:0}.tinymce-mobile-android-container:not(.tinymce-mobile-android-maximized){position:relative}.tinymce-mobile-android-container .tinymce-mobile-editor-socket{display:flex;flex-grow:1}.tinymce-mobile-android-container .tinymce-mobile-editor-socket iframe{display:flex!important;flex-grow:1;height:auto!important}.tinymce-mobile-android-scroll-reload{overflow:hidden}:not(.tinymce-mobile-readonly-mode)>.tinymce-mobile-android-selection-context-toolbar{margin-top:23px}.tinymce-mobile-toolstrip{background:#fff;display:flex;flex:0 0 auto;z-index:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar{align-items:center;background-color:#fff;border-bottom:1px solid #ccc;display:flex;flex:1;height:2.5em;width:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group{align-items:center;display:flex;height:100%;flex-shrink:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group>div{align-items:center;display:flex;height:100%;flex:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-exit-container{background:#f44336}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-toolbar-scrollable-group{flex-grow:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item{padding-left:.5em;padding-right:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button{align-items:center;display:flex;height:80%;margin-left:2px;margin-right:2px}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button.tinymce-mobile-toolbar-button-selected{background:#c8cbcf;color:#ccc}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:first-of-type,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:last-of-type{background:#207ab7;color:#eceff1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group{align-items:center;display:flex;height:100%;flex:1;padding-bottom:.4em;padding-top:.4em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog{display:flex;min-height:1.5em;overflow:hidden;padding-left:0;padding-right:0;position:relative;width:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain{display:flex;height:100%;transition:left cubic-bezier(.4,0,1,1) .15s;width:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen{display:flex;flex:0 0 auto;justify-content:space-between;width:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen input{font-family:Sans-serif}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container{display:flex;flex-grow:1;position:relative}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container .tinymce-mobile-input-container-x{-ms-grid-row-align:center;align-self:center;background:inherit;border:none;border-radius:50%;color:#888;font-size:.6em;font-weight:700;height:100%;padding-right:2px;position:absolute;right:0}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container.tinymce-mobile-input-container-empty .tinymce-mobile-input-container-x{display:none}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous{align-items:center;display:flex}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous::before{align-items:center;display:flex;font-weight:700;height:100%;padding-left:.5em;padding-right:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next.tinymce-mobile-toolbar-navigation-disabled::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous.tinymce-mobile-toolbar-navigation-disabled::before{visibility:hidden}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item{color:#ccc;font-size:10px;line-height:10px;margin:0 2px;padding-top:3px}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item.tinymce-mobile-dot-active{color:#c8cbcf}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-font::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-heading::before{margin-left:.5em;margin-right:.9em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-font::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-heading::before{margin-left:.9em;margin-right:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider{display:flex;flex:1;margin-left:0;margin-right:0;padding:.28em 0;position:relative}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container{align-items:center;display:flex;flex-grow:1;height:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container .tinymce-mobile-slider-size-line{background:#ccc;display:flex;flex:1;height:.2em;margin-bottom:.3em;margin-top:.3em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container{padding-left:2em;padding-right:2em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container{align-items:center;display:flex;flex-grow:1;height:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container .tinymce-mobile-slider-gradient{background:linear-gradient(to right,red 0,#feff00 17%,#0f0 33%,#00feff 50%,#00f 67%,#ff00fe 83%,red 100%);display:flex;flex:1;height:.2em;margin-bottom:.3em;margin-top:.3em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-black{background:#000;height:.2em;margin-bottom:.3em;margin-top:.3em;width:1.2em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-white{background:#fff;height:.2em;margin-bottom:.3em;margin-top:.3em;width:1.2em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb{align-items:center;background-clip:padding-box;background-color:#455a64;border:.5em solid rgba(136,136,136,0);border-radius:3em;bottom:0;color:#fff;display:flex;height:.5em;justify-content:center;left:-10px;margin:auto;position:absolute;top:0;transition:border 120ms cubic-bezier(.39,.58,.57,1);width:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb.tinymce-mobile-thumb-active{border:.5em solid rgba(136,136,136,.39)}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group>div{align-items:center;display:flex;height:100%;flex:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper{flex-direction:column;justify-content:center}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item{align-items:center;display:flex}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item:not(.tinymce-mobile-serialised-dialog){height:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-container{display:flex}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input{background:#fff;border:none;border-radius:0;color:#455a64;flex-grow:1;font-size:.85em;padding-bottom:.1em;padding-left:5px;padding-top:.1em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::-webkit-input-placeholder{color:#888}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::placeholder{color:#888}.tinymce-mobile-dropup{background:#fff;display:flex;overflow:hidden;width:100%}.tinymce-mobile-dropup.tinymce-mobile-dropup-shrinking{transition:height .3s ease-out}.tinymce-mobile-dropup.tinymce-mobile-dropup-growing{transition:height .3s ease-in}.tinymce-mobile-dropup.tinymce-mobile-dropup-closed{flex-grow:0}.tinymce-mobile-dropup.tinymce-mobile-dropup-open:not(.tinymce-mobile-dropup-growing){flex-grow:1}.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height:200px}@media only screen and (orientation:landscape){.tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height:200px}}@media only screen and (min-device-width :320px) and (max-device-width :568px) and (orientation :landscape){.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height:150px}}.tinymce-mobile-styles-menu{font-family:sans-serif;outline:4px solid #000;overflow:hidden;position:relative;width:100%}.tinymce-mobile-styles-menu [role=menu]{display:flex;flex-direction:column;height:100%;position:absolute;width:100%}.tinymce-mobile-styles-menu [role=menu].transitioning{transition:transform .5s ease-in-out}.tinymce-mobile-styles-menu .tinymce-mobile-styles-item{border-bottom:1px solid #ddd;color:#455a64;cursor:pointer;display:flex;padding:1em 1em;position:relative}.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser .tinymce-mobile-styles-collapse-icon::before{color:#455a64;content:"\e314";font-family:tinymce-mobile,sans-serif}.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-styles-item-is-menu::after{color:#455a64;content:"\e315";font-family:tinymce-mobile,sans-serif;padding-left:1em;padding-right:1em;position:absolute;right:0}.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-format-matches::after{font-family:tinymce-mobile,sans-serif;padding-left:1em;padding-right:1em;position:absolute;right:0}.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser,.tinymce-mobile-styles-menu .tinymce-mobile-styles-separator{align-items:center;background:#fff;border-top:#455a64;color:#455a64;display:flex;min-height:2.5em;padding-left:1em;padding-right:1em}.tinymce-mobile-styles-menu [data-transitioning-destination=before][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state=before]{transform:translate(-100%)}.tinymce-mobile-styles-menu [data-transitioning-destination=current][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state=current]{transform:translate(0)}.tinymce-mobile-styles-menu [data-transitioning-destination=after][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state=after]{transform:translate(100%)}@font-face{font-family:tinymce-mobile;font-style:normal;font-weight:400;src:url(fonts/tinymce-mobile.woff?8x92w3) format('woff')}@media (min-device-width:700px){.tinymce-mobile-outer-container,.tinymce-mobile-outer-container input{font-size:25px}}@media (max-device-width:700px){.tinymce-mobile-outer-container,.tinymce-mobile-outer-container input{font-size:18px}}.tinymce-mobile-icon{font-family:tinymce-mobile,sans-serif}.mixin-flex-and-centre{align-items:center;display:flex;justify-content:center}.mixin-flex-bar{align-items:center;display:flex;height:100%}.tinymce-mobile-outer-container .tinymce-mobile-editor-socket iframe{background-color:#fff;width:100%}.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{background-color:#207ab7;border-radius:50%;bottom:1em;color:#fff;font-size:1em;height:2.1em;position:fixed;right:2em;width:2.1em;align-items:center;display:flex;justify-content:center}@media only screen and (min-device-width:700px){.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{font-size:1.2em}}.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket{height:300px;overflow:hidden}.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket iframe{height:100%}.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-toolstrip{display:none}input[type=file]::-webkit-file-upload-button{display:none}@media only screen and (min-device-width :320px) and (max-device-width :568px) and (orientation :landscape){.tinymce-mobile-ios-container .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{bottom:50%}} -/*# sourceMappingURL=skin.mobile.min.css.map */ diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.mobile.min.css.map b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.mobile.min.css.map deleted file mode 100644 index ed893bc5fa7e..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.mobile.min.css.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["ui/default/skin.mobile.css"],"names":[],"mappings":";;;;;;AAOA,gCACE,IAAK,QACL,QAAS,MAEX,kCACE,OAAQ,EACR,WAAY,QACZ,OAAQ,QACR,MAAO,KACP,YAAa,EACb,OAAQ,EACR,QAAS,EACT,QAAS,EACT,4BAA6B,YAE7B,YAAa,KACb,YAAa,OAEf,wCACE,QAAS,QAEX,mCACE,QAAS,QAEX,2CACE,QAAS,QAEX,sCACE,QAAS,QAEX,0CACE,QAAS,QAEX,wCACE,QAAS,QAEX,yCACE,QAAS,QAEX,kCACE,QAAS,QAEX,oCACE,QAAS,QAEX,4CACE,QAAS,QAEX,0CACE,QAAS,QAEX,uCACE,QAAS,QAEX,uCACE,QAAS,QAEX,kCACE,QAAS,QAEX,oCACE,QAAS,QAEX,mCACE,QAAS,QAEX,sCACE,QAAS,QAEX,kCACE,QAAS,QAEX,wCACA,2CACE,QAAS,QAEX,kCACE,QAAS,QAEX,kCACE,QAAS,QAEX,0CACE,QAAS,QAEX,wCACE,QAAS,QAGX,sCADA,2CAEE,QAAS,QAEX,2CACE,QAAS,QAEX,2CACE,QAAS,QAGX,2CADA,2CAEE,YAAa,WACb,UAAW,IAEb,uCACE,QAAS,QAEX,kCACE,QAAS,QAEX,qCAEE,QAAS,WACT,YAAa,WACb,UAAW,IACX,YAAa,IAEf,gCACE,QAAS,KACT,YAAa,IAEf,gCACE,QAAS,KACT,YAAa,IAEf,gCACE,QAAS,KACT,YAAa,IAEf,8DACE,YAAa,OACb,QAAS,KACT,gBAAiB,OACjB,WAAY,kBACZ,OAAQ,KACR,SAAU,SACV,IAAK,EACL,MAAO,KAET,gGACE,YAAa,OACb,cAAe,IACf,QAAS,KACT,eAAgB,OAChB,YAAa,WACb,UAAW,IACX,gBAAiB,cAEnB,iHACE,YAAa,OACb,QAAS,KACT,gBAAiB,OACjB,cAAe,IACf,OAAQ,MACR,MAAO,MAET,oIACE,YAAa,OACb,QAAS,KACT,gBAAiB,OACjB,eAAgB,OAChB,UAAW,IAEb,gDACE,oIACE,UAAW,OAGf,kKACE,YAAa,OACb,QAAS,KACT,gBAAiB,OACjB,cAAe,IACf,OAAQ,MACR,MAAO,MACP,iBAAkB,KAClB,MAAO,QAET,0KACE,QAAS,QACT,YAAa,cAAgB,CAAE,WAEjC,8MACE,QAAS,EAEX,mEACE,WAAY,KACZ,OAAQ,KACR,OAAQ,EACR,QAAS,KACT,eAAgB,OAChB,KAAM,EACN,SAAU,MACV,MAAO,EACP,IAAK,EAEP,yEACE,SAAU,SAEZ,gEACE,QAAS,KACT,UAAW,EAEb,uEACE,QAAS,eACT,UAAW,EACX,OAAQ,eAEV,sCACE,SAAU,OAEZ,sFACE,WAAY,KAEd,0BACE,WAAY,KACZ,QAAS,KACT,KAAM,EAAE,EAAE,KACV,QAAS,EAEX,kDACE,YAAa,OACb,iBAAkB,KAClB,cAAe,IAAI,MAAM,KACzB,QAAS,KACT,KAAM,EACN,OAAQ,MACR,MAAO,KAGT,qHACE,YAAa,OACb,QAAS,KACT,OAAQ,KACR,YAAa,EAEf,yHACE,YAAa,OACb,QAAS,KACT,OAAQ,KACR,KAAM,EAER,mJACE,WAAY,QAEd,6JACE,UAAW,EAEb,wJACE,aAAc,KACd,cAAe,KAEjB,sLACE,YAAa,OACb,QAAS,KACT,OAAQ,IACR,YAAa,IACb,aAAc,IAEhB,6NACE,WAAY,QACZ,MAAO,KAET,mIACA,kIACE,WAAY,QACZ,MAAO,QAKT,+GACE,YAAa,OACb,QAAS,KACT,OAAQ,KACR,KAAM,EACN,eAAgB,KAChB,YAAa,KAIf,iJACE,QAAS,KACT,WAAY,MACZ,SAAU,OACV,aAAc,EACd,cAAe,EACf,SAAU,SACV,MAAO,KAET,yLACE,QAAS,KACT,OAAQ,KACR,WAAY,KAAK,uBAA2B,KAC5C,MAAO,KAET,kOACE,QAAS,KACT,KAAM,EAAE,EAAE,KACV,gBAAiB,cACjB,MAAO,KAET,wOACE,YAAa,WAEf,kQACE,QAAS,KACT,UAAW,EACX,SAAU,SAEZ,oSACE,mBAAoB,OAChB,WAAY,OAChB,WAAY,QACZ,OAAQ,KACR,cAAe,IACf,MAAO,KACP,UAAW,KACX,YAAa,IACb,OAAQ,KACR,cAAe,IACf,SAAU,SACV,MAAO,EAET,yUACE,QAAS,KAGX,4PADA,gQAEE,YAAa,OACb,QAAS,KAGX,oQADA,wQAEE,YAAa,OACb,QAAS,KACT,YAAa,IACb,OAAQ,KACR,aAAc,KACd,cAAe,KAGjB,+SADA,mTAEE,WAAY,OAEd,wIACE,MAAO,KACP,UAAW,KACX,YAAa,KACb,OAAQ,EAAE,IACV,YAAa,IAEf,kKACE,MAAO,QAET,uJACA,0JACE,YAAa,KACb,aAAc,KAEhB,uJACA,0JACE,YAAa,KACb,aAAc,KAEhB,sIACE,QAAS,KACT,KAAM,EACN,YAAa,EACb,aAAc,EACd,QAAS,MAAO,EAChB,SAAU,SAEZ,4KACE,YAAa,OACb,QAAS,KACT,UAAW,EACX,OAAQ,KAEV,6MACE,WAAY,KACZ,QAAS,KACT,KAAM,EACN,OAAQ,KACR,cAAe,KACf,WAAY,KAEd,0KACE,aAAc,IACd,cAAe,IAEjB,oNACE,YAAa,OACb,QAAS,KACT,UAAW,EACX,OAAQ,KAEV,oPACE,WAAY,+FACZ,QAAS,KACT,KAAM,EACN,OAAQ,KACR,cAAe,KACf,WAAY,KAEd,2MAEE,WAAY,KACZ,OAAQ,KACR,cAAe,KACf,WAAY,KACZ,MAAO,MAET,2MAEE,WAAY,KACZ,OAAQ,KACR,cAAe,KACf,WAAY,KACZ,MAAO,MAET,mKAME,YAAa,OACb,gBAAiB,YACjB,iBAAkB,QAClB,OAAQ,KAAM,MAAM,oBACpB,cAAe,IACf,OAAQ,EACR,MAAO,KACP,QAAS,KACT,OAAQ,KACR,gBAAiB,OACjB,KAAM,MACN,OAAQ,KACR,SAAU,SACV,IAAK,EACL,WAAY,OAAO,MAAM,4BACzB,MAAO,KAET,+LACE,OAAQ,KAAM,MAAM,sBAEtB,kJACA,mHACE,YAAa,OACb,QAAS,KACT,OAAQ,KACR,KAAM,EAER,kJACE,eAAgB,OAChB,gBAAiB,OAEnB,kJACE,YAAa,OACb,QAAS,KAEX,yLACE,OAAQ,KAEV,6IACE,QAAS,KAEX,qHACE,WAAY,KACZ,OAAQ,KACR,cAAe,EACf,MAAO,QACP,UAAW,EACX,UAAW,MACX,eAAgB,KAChB,aAAc,IACd,YAAa,KAEf,gJAEE,MAAO,KAET,kIAEE,MAAO,KAGT,uBACE,WAAY,KACZ,QAAS,KACT,SAAU,OACV,MAAO,KAET,uDACE,WAAY,OAAO,IAAK,SAE1B,qDACE,WAAY,OAAO,IAAK,QAE1B,oDACE,UAAW,EAEb,sFACE,UAAW,EAGb,wFACE,WAAY,MAEd,+CACE,0DACE,WAAY,OAGhB,4GACE,wFACE,WAAY,OAIhB,4BACE,YAAa,WACb,QAAS,IAAI,MAAM,KACnB,SAAU,OACV,SAAU,SACV,MAAO,KAET,wCACE,QAAS,KACT,eAAgB,OAChB,OAAQ,KACR,SAAU,SACV,MAAO,KAET,sDACE,WAAY,UAAU,IAAK,YAE7B,wDACE,cAAe,IAAI,MAAM,KACzB,MAAO,QACP,OAAQ,QACR,QAAS,KACT,QAAS,IAAI,IACb,SAAU,SAEZ,0GACE,MAAO,QACP,QAAS,QACT,YAAa,cAAgB,CAAE,WAEjC,kGACE,MAAO,QACP,QAAS,QACT,YAAa,cAAgB,CAAE,WAC/B,aAAc,IACd,cAAe,IACf,SAAU,SACV,MAAO,EAET,6FACE,YAAa,cAAgB,CAAE,WAC/B,aAAc,IACd,cAAe,IACf,SAAU,SACV,MAAO,EAGT,6DADA,6DAEE,YAAa,OACb,WAAY,KACZ,WAAY,QACZ,MAAO,QACP,QAAS,KACT,WAAY,MACZ,aAAc,IACd,cAAe,IAEjB,8FACA,8DACE,UAAW,iBAEb,+FACA,+DACE,UAAW,aAEb,6FACA,6DACE,UAAW,gBAEb,WACE,YAAa,eACb,WAAY,OACZ,YAAa,IACb,IAAK,sCAAwC,eAE/C,gCACE,gCACA,sCACE,UAAW,MAGf,gCACE,gCACA,sCACE,UAAW,MAGf,qBACE,YAAa,cAAgB,CAAE,WAEjC,uBACE,YAAa,OACb,QAAS,KACT,gBAAiB,OAEnB,gBACE,YAAa,OACb,QAAS,KACT,OAAQ,KAEV,qEACE,iBAAkB,KAClB,MAAO,KAET,6DAEE,iBAAkB,QAClB,cAAe,IACf,OAAQ,IACR,MAAO,KACP,UAAW,IACX,OAAQ,MACR,SAAU,MACV,MAAO,IACP,MAAO,MACP,YAAa,OACb,QAAS,KACT,gBAAiB,OAEnB,gDACE,6DACE,UAAW,OAGf,wGACE,OAAQ,MACR,SAAU,OAEZ,+GACE,OAAQ,KAEV,oGACE,QAAS,KAMX,6CACE,QAAS,KAEX,4GACE,2FACE,OAAQ","file":"skin.mobile.min.css","sourcesContent":["/**\n * Copyright (c) Tiny Technologies, Inc. All rights reserved.\n * Licensed under the LGPL or a commercial license.\n * For LGPL see License.txt in the project root for license information.\n * For commercial licenses see https://www.tiny.cloud/\n */\n/* RESET all the things! */\n.tinymce-mobile-outer-container {\n all: initial;\n display: block;\n}\n.tinymce-mobile-outer-container * {\n border: 0;\n box-sizing: initial;\n cursor: inherit;\n float: none;\n line-height: 1;\n margin: 0;\n outline: 0;\n padding: 0;\n -webkit-tap-highlight-color: transparent;\n /* TBIO-3691, stop the gray flicker on touch. */\n text-shadow: none;\n white-space: nowrap;\n}\n.tinymce-mobile-icon-arrow-back::before {\n content: \"\\e5cd\";\n}\n.tinymce-mobile-icon-image::before {\n content: \"\\e412\";\n}\n.tinymce-mobile-icon-cancel-circle::before {\n content: \"\\e5c9\";\n}\n.tinymce-mobile-icon-full-dot::before {\n content: \"\\e061\";\n}\n.tinymce-mobile-icon-align-center::before {\n content: \"\\e234\";\n}\n.tinymce-mobile-icon-align-left::before {\n content: \"\\e236\";\n}\n.tinymce-mobile-icon-align-right::before {\n content: \"\\e237\";\n}\n.tinymce-mobile-icon-bold::before {\n content: \"\\e238\";\n}\n.tinymce-mobile-icon-italic::before {\n content: \"\\e23f\";\n}\n.tinymce-mobile-icon-unordered-list::before {\n content: \"\\e241\";\n}\n.tinymce-mobile-icon-ordered-list::before {\n content: \"\\e242\";\n}\n.tinymce-mobile-icon-font-size::before {\n content: \"\\e245\";\n}\n.tinymce-mobile-icon-underline::before {\n content: \"\\e249\";\n}\n.tinymce-mobile-icon-link::before {\n content: \"\\e157\";\n}\n.tinymce-mobile-icon-unlink::before {\n content: \"\\eca2\";\n}\n.tinymce-mobile-icon-color::before {\n content: \"\\e891\";\n}\n.tinymce-mobile-icon-previous::before {\n content: \"\\e314\";\n}\n.tinymce-mobile-icon-next::before {\n content: \"\\e315\";\n}\n.tinymce-mobile-icon-large-font::before,\n.tinymce-mobile-icon-style-formats::before {\n content: \"\\e264\";\n}\n.tinymce-mobile-icon-undo::before {\n content: \"\\e166\";\n}\n.tinymce-mobile-icon-redo::before {\n content: \"\\e15a\";\n}\n.tinymce-mobile-icon-removeformat::before {\n content: \"\\e239\";\n}\n.tinymce-mobile-icon-small-font::before {\n content: \"\\e906\";\n}\n.tinymce-mobile-icon-readonly-back::before,\n.tinymce-mobile-format-matches::after {\n content: \"\\e5ca\";\n}\n.tinymce-mobile-icon-small-heading::before {\n content: \"small\";\n}\n.tinymce-mobile-icon-large-heading::before {\n content: \"large\";\n}\n.tinymce-mobile-icon-small-heading::before,\n.tinymce-mobile-icon-large-heading::before {\n font-family: sans-serif;\n font-size: 80%;\n}\n.tinymce-mobile-mask-edit-icon::before {\n content: \"\\e254\";\n}\n.tinymce-mobile-icon-back::before {\n content: \"\\e5c4\";\n}\n.tinymce-mobile-icon-heading::before {\n /* TODO: Translate */\n content: \"Headings\";\n font-family: sans-serif;\n font-size: 80%;\n font-weight: bold;\n}\n.tinymce-mobile-icon-h1::before {\n content: \"H1\";\n font-weight: bold;\n}\n.tinymce-mobile-icon-h2::before {\n content: \"H2\";\n font-weight: bold;\n}\n.tinymce-mobile-icon-h3::before {\n content: \"H3\";\n font-weight: bold;\n}\n.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask {\n align-items: center;\n display: flex;\n justify-content: center;\n background: rgba(51, 51, 51, 0.5);\n height: 100%;\n position: absolute;\n top: 0;\n width: 100%;\n}\n.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container {\n align-items: center;\n border-radius: 50%;\n display: flex;\n flex-direction: column;\n font-family: sans-serif;\n font-size: 1em;\n justify-content: space-between;\n}\n.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .mixin-menu-item {\n align-items: center;\n display: flex;\n justify-content: center;\n border-radius: 50%;\n height: 2.1em;\n width: 2.1em;\n}\n.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section {\n align-items: center;\n display: flex;\n justify-content: center;\n flex-direction: column;\n font-size: 1em;\n}\n@media only screen and (min-device-width:700px) {\n .tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section {\n font-size: 1.2em;\n }\n}\n.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon {\n align-items: center;\n display: flex;\n justify-content: center;\n border-radius: 50%;\n height: 2.1em;\n width: 2.1em;\n background-color: white;\n color: #207ab7;\n}\n.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon::before {\n content: \"\\e900\";\n font-family: 'tinymce-mobile', sans-serif;\n}\n.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section:not(.tinymce-mobile-mask-tap-icon-selected) .tinymce-mobile-mask-tap-icon {\n z-index: 2;\n}\n.tinymce-mobile-android-container.tinymce-mobile-android-maximized {\n background: #ffffff;\n border: none;\n bottom: 0;\n display: flex;\n flex-direction: column;\n left: 0;\n position: fixed;\n right: 0;\n top: 0;\n}\n.tinymce-mobile-android-container:not(.tinymce-mobile-android-maximized) {\n position: relative;\n}\n.tinymce-mobile-android-container .tinymce-mobile-editor-socket {\n display: flex;\n flex-grow: 1;\n}\n.tinymce-mobile-android-container .tinymce-mobile-editor-socket iframe {\n display: flex !important;\n flex-grow: 1;\n height: auto !important;\n}\n.tinymce-mobile-android-scroll-reload {\n overflow: hidden;\n}\n:not(.tinymce-mobile-readonly-mode) > .tinymce-mobile-android-selection-context-toolbar {\n margin-top: 23px;\n}\n.tinymce-mobile-toolstrip {\n background: #fff;\n display: flex;\n flex: 0 0 auto;\n z-index: 1;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar {\n align-items: center;\n background-color: #fff;\n border-bottom: 1px solid #cccccc;\n display: flex;\n flex: 1;\n height: 2.5em;\n width: 100%;\n /* Make it no larger than the toolstrip, so that it needs to scroll */\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group {\n align-items: center;\n display: flex;\n height: 100%;\n flex-shrink: 1;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group > div {\n align-items: center;\n display: flex;\n height: 100%;\n flex: 1;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-exit-container {\n background: #f44336;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-toolbar-scrollable-group {\n flex-grow: 1;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item {\n padding-left: 0.5em;\n padding-right: 0.5em;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button {\n align-items: center;\n display: flex;\n height: 80%;\n margin-left: 2px;\n margin-right: 2px;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button.tinymce-mobile-toolbar-button-selected {\n background: #c8cbcf;\n color: #cccccc;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:first-of-type,\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:last-of-type {\n background: #207ab7;\n color: #eceff1;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar {\n /* Note, this file is imported inside .tinymce-mobile-context-toolbar, so that prefix is on everything here. */\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group {\n align-items: center;\n display: flex;\n height: 100%;\n flex: 1;\n padding-bottom: 0.4em;\n padding-top: 0.4em;\n /* Make any buttons appearing on the left and right display in the centre (e.g. color edges) */\n /* For widgets like the colour picker, use the whole height */\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog {\n display: flex;\n min-height: 1.5em;\n overflow: hidden;\n padding-left: 0;\n padding-right: 0;\n position: relative;\n width: 100%;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain {\n display: flex;\n height: 100%;\n transition: left cubic-bezier(0.4, 0, 1, 1) 0.15s;\n width: 100%;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen {\n display: flex;\n flex: 0 0 auto;\n justify-content: space-between;\n width: 100%;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen input {\n font-family: Sans-serif;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container {\n display: flex;\n flex-grow: 1;\n position: relative;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container .tinymce-mobile-input-container-x {\n -ms-grid-row-align: center;\n align-self: center;\n background: inherit;\n border: none;\n border-radius: 50%;\n color: #888;\n font-size: 0.6em;\n font-weight: bold;\n height: 100%;\n padding-right: 2px;\n position: absolute;\n right: 0;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container.tinymce-mobile-input-container-empty .tinymce-mobile-input-container-x {\n display: none;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous,\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next {\n align-items: center;\n display: flex;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous::before,\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next::before {\n align-items: center;\n display: flex;\n font-weight: bold;\n height: 100%;\n padding-left: 0.5em;\n padding-right: 0.5em;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous.tinymce-mobile-toolbar-navigation-disabled::before,\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next.tinymce-mobile-toolbar-navigation-disabled::before {\n visibility: hidden;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item {\n color: #cccccc;\n font-size: 10px;\n line-height: 10px;\n margin: 0 2px;\n padding-top: 3px;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item.tinymce-mobile-dot-active {\n color: #c8cbcf;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-font::before,\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-heading::before {\n margin-left: 0.5em;\n margin-right: 0.9em;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-font::before,\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-heading::before {\n margin-left: 0.9em;\n margin-right: 0.5em;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider {\n display: flex;\n flex: 1;\n margin-left: 0;\n margin-right: 0;\n padding: 0.28em 0;\n position: relative;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container {\n align-items: center;\n display: flex;\n flex-grow: 1;\n height: 100%;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container .tinymce-mobile-slider-size-line {\n background: #cccccc;\n display: flex;\n flex: 1;\n height: 0.2em;\n margin-bottom: 0.3em;\n margin-top: 0.3em;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container {\n padding-left: 2em;\n padding-right: 2em;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container {\n align-items: center;\n display: flex;\n flex-grow: 1;\n height: 100%;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container .tinymce-mobile-slider-gradient {\n background: linear-gradient(to right, hsl(0, 100%, 50%) 0%, hsl(60, 100%, 50%) 17%, hsl(120, 100%, 50%) 33%, hsl(180, 100%, 50%) 50%, hsl(240, 100%, 50%) 67%, hsl(300, 100%, 50%) 83%, hsl(0, 100%, 50%) 100%);\n display: flex;\n flex: 1;\n height: 0.2em;\n margin-bottom: 0.3em;\n margin-top: 0.3em;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-black {\n /* Not part of theming */\n background: black;\n height: 0.2em;\n margin-bottom: 0.3em;\n margin-top: 0.3em;\n width: 1.2em;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-white {\n /* Not part of theming */\n background: white;\n height: 0.2em;\n margin-bottom: 0.3em;\n margin-top: 0.3em;\n width: 1.2em;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb {\n /* vertically centering trick (margin: auto, top: 0, bottom: 0). On iOS and Safari, if you leave\n * out these values, then it shows the thumb at the top of the spectrum. This is probably because it is\n * absolutely positioned with only a left value, and not a top. Note, on Chrome it seems to be fine without\n * this approach.\n */\n align-items: center;\n background-clip: padding-box;\n background-color: #455a64;\n border: 0.5em solid rgba(136, 136, 136, 0);\n border-radius: 3em;\n bottom: 0;\n color: #fff;\n display: flex;\n height: 0.5em;\n justify-content: center;\n left: -10px;\n margin: auto;\n position: absolute;\n top: 0;\n transition: border 120ms cubic-bezier(0.39, 0.58, 0.57, 1);\n width: 0.5em;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb.tinymce-mobile-thumb-active {\n border: 0.5em solid rgba(136, 136, 136, 0.39);\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper,\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group > div {\n align-items: center;\n display: flex;\n height: 100%;\n flex: 1;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper {\n flex-direction: column;\n justify-content: center;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item {\n align-items: center;\n display: flex;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item:not(.tinymce-mobile-serialised-dialog) {\n height: 100%;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-container {\n display: flex;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input {\n background: #ffffff;\n border: none;\n border-radius: 0;\n color: #455a64;\n flex-grow: 1;\n font-size: 0.85em;\n padding-bottom: 0.1em;\n padding-left: 5px;\n padding-top: 0.1em;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::-webkit-input-placeholder {\n /* WebKit, Blink, Edge */\n color: #888;\n}\n.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::placeholder {\n /* WebKit, Blink, Edge */\n color: #888;\n}\n/* dropup */\n.tinymce-mobile-dropup {\n background: white;\n display: flex;\n overflow: hidden;\n width: 100%;\n}\n.tinymce-mobile-dropup.tinymce-mobile-dropup-shrinking {\n transition: height 0.3s ease-out;\n}\n.tinymce-mobile-dropup.tinymce-mobile-dropup-growing {\n transition: height 0.3s ease-in;\n}\n.tinymce-mobile-dropup.tinymce-mobile-dropup-closed {\n flex-grow: 0;\n}\n.tinymce-mobile-dropup.tinymce-mobile-dropup-open:not(.tinymce-mobile-dropup-growing) {\n flex-grow: 1;\n}\n/* TODO min-height for device size and orientation */\n.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) {\n min-height: 200px;\n}\n@media only screen and (orientation: landscape) {\n .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) {\n min-height: 200px;\n }\n}\n@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : landscape) {\n .tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed) {\n min-height: 150px;\n }\n}\n/* styles menu */\n.tinymce-mobile-styles-menu {\n font-family: sans-serif;\n outline: 4px solid black;\n overflow: hidden;\n position: relative;\n width: 100%;\n}\n.tinymce-mobile-styles-menu [role=\"menu\"] {\n display: flex;\n flex-direction: column;\n height: 100%;\n position: absolute;\n width: 100%;\n}\n.tinymce-mobile-styles-menu [role=\"menu\"].transitioning {\n transition: transform 0.5s ease-in-out;\n}\n.tinymce-mobile-styles-menu .tinymce-mobile-styles-item {\n border-bottom: 1px solid #ddd;\n color: #455a64;\n cursor: pointer;\n display: flex;\n padding: 1em 1em;\n position: relative;\n}\n.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser .tinymce-mobile-styles-collapse-icon::before {\n color: #455a64;\n content: \"\\e314\";\n font-family: 'tinymce-mobile', sans-serif;\n}\n.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-styles-item-is-menu::after {\n color: #455a64;\n content: \"\\e315\";\n font-family: 'tinymce-mobile', sans-serif;\n padding-left: 1em;\n padding-right: 1em;\n position: absolute;\n right: 0;\n}\n.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-format-matches::after {\n font-family: 'tinymce-mobile', sans-serif;\n padding-left: 1em;\n padding-right: 1em;\n position: absolute;\n right: 0;\n}\n.tinymce-mobile-styles-menu .tinymce-mobile-styles-separator,\n.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser {\n align-items: center;\n background: #fff;\n border-top: #455a64;\n color: #455a64;\n display: flex;\n min-height: 2.5em;\n padding-left: 1em;\n padding-right: 1em;\n}\n.tinymce-mobile-styles-menu [data-transitioning-destination=\"before\"][data-transitioning-state],\n.tinymce-mobile-styles-menu [data-transitioning-state=\"before\"] {\n transform: translate(-100%);\n}\n.tinymce-mobile-styles-menu [data-transitioning-destination=\"current\"][data-transitioning-state],\n.tinymce-mobile-styles-menu [data-transitioning-state=\"current\"] {\n transform: translate(0%);\n}\n.tinymce-mobile-styles-menu [data-transitioning-destination=\"after\"][data-transitioning-state],\n.tinymce-mobile-styles-menu [data-transitioning-state=\"after\"] {\n transform: translate(100%);\n}\n@font-face {\n font-family: 'tinymce-mobile';\n font-style: normal;\n font-weight: normal;\n src: url('fonts/tinymce-mobile.woff?8x92w3') format('woff');\n}\n@media (min-device-width: 700px) {\n .tinymce-mobile-outer-container,\n .tinymce-mobile-outer-container input {\n font-size: 25px;\n }\n}\n@media (max-device-width: 700px) {\n .tinymce-mobile-outer-container,\n .tinymce-mobile-outer-container input {\n font-size: 18px;\n }\n}\n.tinymce-mobile-icon {\n font-family: 'tinymce-mobile', sans-serif;\n}\n.mixin-flex-and-centre {\n align-items: center;\n display: flex;\n justify-content: center;\n}\n.mixin-flex-bar {\n align-items: center;\n display: flex;\n height: 100%;\n}\n.tinymce-mobile-outer-container .tinymce-mobile-editor-socket iframe {\n background-color: #fff;\n width: 100%;\n}\n.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon {\n /* Note, on the iPod touch in landscape, this isn't visible when the navbar appears */\n background-color: #207ab7;\n border-radius: 50%;\n bottom: 1em;\n color: white;\n font-size: 1em;\n height: 2.1em;\n position: fixed;\n right: 2em;\n width: 2.1em;\n align-items: center;\n display: flex;\n justify-content: center;\n}\n@media only screen and (min-device-width:700px) {\n .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon {\n font-size: 1.2em;\n }\n}\n.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket {\n height: 300px;\n overflow: hidden;\n}\n.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket iframe {\n height: 100%;\n}\n.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-toolstrip {\n display: none;\n}\n/*\n Note, that if you don't include this (::-webkit-file-upload-button), the toolbar width gets\n increased and the whole body becomes scrollable. It's important!\n */\ninput[type=\"file\"]::-webkit-file-upload-button {\n display: none;\n}\n@media only screen and (min-device-width : 320px) and (max-device-width : 568px) and (orientation : landscape) {\n .tinymce-mobile-ios-container .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon {\n bottom: 50%;\n }\n}\n"]} \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/content.inline.min.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/content.inline.min.css deleted file mode 100755 index 8ff8ee266f34..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/content.inline.min.css +++ /dev/null @@ -1 +0,0 @@ -.mce-object{border:1px dotted #3a3a3a;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px!important;height:9px!important;border:1px dotted #3a3a3a;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-nbsp{background:#AAA}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-spellchecker-word{background:url(img/wline.gif) repeat-x bottom left;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td.mce-item-selected,th.mce-item-selected{background-color:#39f!important}.mce-edit-focus{outline:1px dotted #333} \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/content.min.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/content.min.css deleted file mode 100755 index 12361d843436..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/content.min.css +++ /dev/null @@ -1,2 +0,0 @@ -/* NOTE: This file, which based off of TinyMCE's vendor content styling (but customized to help with scoping), is 2 of 3 CSS files compiled in our production pipeline */ -html,body{height:100%}.mce-content-body{background-color:#fff;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px;scrollbar-3dlight-color:#f0f0ee;scrollbar-arrow-color:#676662;scrollbar-base-color:#f0f0ee;scrollbar-darkshadow-color:#ddd;scrollbar-face-color:#e0e0dd;scrollbar-highlight-color:#f0f0ee;scrollbar-shadow-color:#f0f0ee;scrollbar-track-color:#f5f5f5}.mce-content-body td,.mce-content-body th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px}.mce-content-body .mce-object{border:1px dotted #3a3a3a;background:#d5d5d5 url(img/object.gif) no-repeat center}.mce-content-body .mce-pagebreak{cursor:default;display:block;width:100%;height:5px;border:1px dashed #666;margin-top:15px}.mce-content-body .mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px!important;height:9px!important;border:1px dotted #3a3a3a;background:#d5d5d5 url(img/anchor.gif) no-repeat center}.mce-content-body .mce-nbsp{background:#AAA}.mce-content-body hr{cursor:default}.mce-content-body .mce-match-marker{background:#AAA;color:#fff}.mce-content-body .mce-match-marker-selected{background:#39f;color:#fff}.mce-content-body .mce-spellchecker-word{background:url(img/wline.gif) repeat-x bottom left;cursor:default}.mce-content-body .mce-item-table,.mce-content-body .mce-item-table caption,.mce-content-body .mce-item-table td,.mce-content-body .mce-item-table th{border:1px dashed #BBB}.mce-content-body td.mce-item-selected,.mce-content-body th.mce-item-selected{background-color:#39f!important}.mce-content-body .mce-edit-focus{outline:1px dotted #333} diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon-small.eot b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon-small.eot deleted file mode 100755 index 43a30f992596498938e08ba09fd157d744cfe413..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8344 zcmds6du$xXd7tkdyLU(4i}zTOI+Ald^7bT3AnrZgytAnfd0MZ@$;e-sX(;CK)3ZVB!g|a8MQixkaM%iH=ui zDL+RGvqkwUGau|8z#imd>@s_St+5rPHMYw3vTG<`U{~;CEViwdXJ^<&b``M8vM*;f zHpi;y_joMmAZUw&jv(tSFQ0z$;*Y+0hOx=-0a`eI^w=`cDyV-Gb^gg`=IitC{Y0$t zIn>X*uyUdM2mgKhZLD?=U_ZEY;aYcN1DMz(U@UU!$`@XIcQyYeVq5cl)uU=Vu;ex~NV0`euP`|oz;YOEz zjlF^P1=RWKg_Vo{8P@)tv7NU8`>XESwO8tY_Y2HFZh@vnxi+kC_Xjgy`Ss+1pRplt zZ~nS0a55(Hjr$wD0HYqN5r6A|3jf|lkIeoED)1~nSM6{ z)>|yhBJ>G*5wPQa{xdepzO+?7ME^~ZK)LhcvClHI$L{+yfHrP#QsAus-Tn{>59*xR zNSr;*+A`yJU zl9)NphJZ81qQI*{62oi{6k(R_hIr3ob>pC|$QsPR{1a@7O|lBx#mY>F0*ryvJDA2w zY?{rmG;4uBO)yf~WG2HVNft^91}|@AgWCW1JOPP#j;6^Wm;ND;4J-z%z*~X82`&V0 z1lL1jp~cYip;tq9LcMS(TnL{Ee>MCAC8C^AZYWsv%a>0?`bLqSRX>(mnR#8z?$y!{#`QFXtMTBzs|wDUT43}UI$b!PbEpoPEuPhe~eo7Ny?)>HBYLRuLICXl9tbU zpmM|Ofv)}_uZx~X|1y?^!C7Uhe2~Nv$0^$`O#!^0>HtsstzJ*j>h)9&(K<__C*3=e znom8GO3@T4$}<5qa3mZSSzsz48-6%Nfq;a2*#MsM$K6bYO=U>Dt|X$-MD&)aMx&~D z_22l&CR#a?!ld&lU<+f`z!3$L20()Ze|stb3Iy2825`(NM_pIUaB4`rPIyyczHeY| z{D1n6w-F^)*W7DtuvbeE(~oIfx;!fQTz_tp5mFJAhxq?iE z2S~ynuuL&m)R3A;DpFcgxlmY#c)ur-BWm3)*`{qeNW?mw$KcBOxI_-6mAD3|1SWDH z!4-n7^lX$z*NjJ%z#x8lv(zl*jGRa?QZh#wPj2gj47B)@W6qz3m#dY`)$SR`Q{I+iZ4bEVKRZPf07X;qI02R5n@4ud`f{C%ELaj4w3;I?Ufp3+G4l1+AwVkoc_GP#bO;^Nak|M z8_Aq0-?{!z&#FU1s(5{x3-cph-`Io^#&BDtT=K_a^DUr}c4s_vdh9Si{#4CcEdMRx{kaevj z{)XUeSnw7la)84nZW)Ga7>;d00x+XRCb#;I)iaE{hH1H$=~`m1s=#*-(Q*l~(;_GGh6o3z)#inaZR_lt?KtqN)d_sJ^a@q%sLr9Z8g= zJZ`rIn>x_+b%A^8Dpb}_0~5eJdH#s;?T5!(#5R~r4-kYNu|=EnKQi9gRP$eI{G;^y zmTc36fqwGmcM$KgnOQ1JRf6x=j55LrRmp03ZI*Jy2|{dyM!l3r1k!Fb8@fTgu&p#O?gECuW^v3y}GF!^F{XK^prMk-?y6WroNT-}+{27v0=4v+#LV8JHY z(kA5?6YJ09vZ?}cI!Gnh0bvg;!GvCJ$MTMxdHTj_69e2GnOrWj!*!caJkfN;noQtv zfM*DmTq!6`OQzH$=Y)NtheQtVyPQMnF)b{h?av!WL=P)CgVjNa(?(qs^g*aJOTy5= zBnekU`}C!`?yb3{%I!pKDwWTt7Edk45~oo5m&xkv!M=TPw%B+%mMByTP9k;!nKzdS znq25?1}6xPvOY(MvZR$TikL9nD64s`)XZy{BJ|jxZ!g7o{GKoa1Va($;n3NkaHsFO zHeFhZ0n)c+V=B($;i0pkaQ}6(ZA>O)i^0abIOn8c9rj{nX}$PhF2NYgWFU$4N_&MV z2L@N8Ubp|_w5Fx0o7TWD({)XriM#O(N9M#cW`!zUE#1F`PITGo*|sFbCesomojHuN z6$fv7@aqF#o57jMvzI#jO}dy4H;wT?so91>6h={)D`6;w=?^0>!ftV>o1>?eM;<3DBBlGN|T)ztIsKG{K#t|=$XiWQlE#!N*{2-swC*XM6ckisM z+*u**y_+}(^j&E6`!HA|YB(^Q-_^pc7bh~B<$neUjEE#F&;SgwF?fyg5ESLm*b^$7`BEO72Y*Blmatc5 z-x`3>2Hav@Vox357JCVe5phEplI8hrI3K7EjvM75q^l(&Id}nE&SZMhY634rWW{wa z#k28v7EuF43esa)GTUJG^8y~1>%=XB)aL|d68i?VNXuW-om*O(6T45&(%B`4%)U$5 zde{;{qYD}nko|{8;Z)Td4D4G7#I_C=qJ{CetB`B_u<_uVGZ_Eya2KP+y$1Jn&y#zh zf1~ivCEOqE#qB|x?PniD4+yvr__j!**es!>B0=iq!PIDKB04I~KvROnbTN!RMpN{M zXD@+^c(8nnn>|?&Rqi5z5ialBLPHSLNX;Mwf86HW!pr16Zrdo?mLuJoMRpH$mvd0g z)J^(@?mW<0Mq06LAdy~FOGttWN&S|bZb$lVBo!eR>GvXJqPW2#&q*4r!JAyybuhK# z*me(-dJm>%%I4f@8CTVDx3UOcH4#ifz%*4?wYG?R!^WoF0#kIbOlvkubs>0gSr9=% zoM12YV2>iVkMHWSz3dfahcVZ>ap*0ide zSL2yp=8wQ^L1O?k3i+^P?9AGJe1+*sGeZ24dIBYovOZp7ckpn>k>Vlc%R+2r!AikP zK^w8Cj0(YO-?PN7I9z7(MNC%2yunT01f@-5g7-Krjgtx!3ZArlyN3Dfc;@Py<@|*- zVYW$F+%r#N<4sGNEQ!mL@g#1>Ccxn>zCrjQTwdV%qBuAJz`6h>+>m@*oi0SihF>dG z$blD<+!8LT?>OeI`(z#vP4IeApI6Q{Nz!r8Huvb9-e~|L4vuCJ$iiO9vZ#l1?QJyl z?@FecJ=e9o(gtqBAEHGz2&>R{y*{o5K86vkGx~eFEBP;M*etAs)@tiY8}7GV4&v@a zUI~p80$WuX@%if6vV2zGr5{f|`}5>+eOK*9D0mWwgSHY1hVo9g>vX?#<1~U3Ix%Ky zbK~Q4nmP7V|AWBv=R}l$rVt!fqQuax>-5m=^bOCZnvkd80gpymk?n&_AcjT=tu?(s zOohi%rE4lHzD3nUXr!ZCTij%cU`0o8rYU@C_SoCUW~WAXKK-Xp?;NG+uU^;n>*Doi z(u4h$an;Z#CiGY=vd~$G#A2xYqC8rujF$K3QuFhvT=dxf{l}0J(yhHVF_ABq^GZ0A z#VNaz&4d-yA;X_%7X2=KdmQq^$O~kWWWYecpBM#>a*nEzK>8?jO56ws7<^V1u@RHkQ>CUngW?9jfT=k|xUPe85kGhH z=DCxXF1=~!v2)$-so~#z7Xt1=uB(^cywoVSZ2Q!zYdT`9fs*<6g1U@yn_wE$tvpX9 z;Dz2PNy>q5(7pU5sBghDf~z|08w{-$U>#+sv0!GkNGGCY&4tF0()kdOCtcrtY@flf zl`#QmEfpQ zf%kg&lq({5tlzbJJvWu&J32c!t`;9T?2`0SBHD+|vN--GgLc>qb{cE^uy}G7`)f$w zDm|<4qk;({4P3#%Uk%`cHUS?bvN@)dkIe9LWeqQsH~(Y-ARbG;9r=Fn60#TCwAW!s zbw!@2ONjW2L8D#F7@OD5nl6qSGPbF={VU$Ge|V;Q_fqe0au4iD^-caKm3pV!i62Qo zbr&i-wRU7I8jOCqF+JUwh66J0`(=Fl zV+Z_l2z|cem&33c@B3wijZye21!rpqd zhMtf4lDcgWK5Bxj5BZLI=Hk_Bm)BN#Z4NgszdSZ@8@BDS&jMQU(U<}hq!5L16RT2$ zq7V97HbHBa1?A5Es{QQWYANBJk zKR@i}`}};t%MBl2we7`xlc#k$6NR3sr&fr1N;Mg1NsN;KD<6yk3YUP zz~`^8?ysZnuge(l!>6n6(^>cFtNZlTe0a_8SM%FzgLZ$tHGlmzpWeC;uMYU@&s+29 xz%f(qhvByyo(&*;KZV1EjNoL2yASb*dJs00V7mtLC3>*$e{HQM@~z*u{}(^GzG(me diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon-small.svg b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon-small.svg deleted file mode 100755 index d338114f0784..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon-small.svg +++ /dev/null @@ -1,175 +0,0 @@ - - - - -This is a custom SVG font generated by IcoMoon. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon-small.ttf b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon-small.ttf deleted file mode 100755 index 841c79c182342d92dc995a5cc1349a9451edede6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8160 zcmds6Yiu0Xb-rgGGrLRfi~AUnT9S9Uwou4 z;2*a@(;^dlL)!hbncw}56IG~HhKX@Jv1ZC>y~qDdZUJg<_IUlAb+(Nf zj4uQFxs3t=Ec~v?6abc6?U>Z%d;%Yu?!nwDR4Fc$sEF(F&4$TDkL$?_OQKdmhEP9Y#zHC z2W>^xUQF5I{fAE50r>< zLb<7YNqI;4S5;BV>azMR^&cax$hpY%$eqX!qxtB?=y#*N*l_IGm>v68>_3J+KJ+G7 z2+sQ22A-#>7+`$}d0#S@aFS?{i}PeN%|p~|l&6$jHm~JMdd_Ih0nn=Fb6G`2OC@V@ z`PRF)mKQDVl;@v*_38Pt!_AC#VPB`)?d-dtWvbn^>{Ihg7cVZ&Kb2kUR)Hk|`DbJU zM+g$dGU>LK4(e*!ux*=LmP>Bmw9(!Fnq|=w!XgNo-jg&PgMM9LSJ@5rJM1+;_3~7b zl77_wBPHE6usU^)eyb2Bu3KxBdPh+nN*6VNKwuN)WDH&SQLS&fb96;6a@kj z?iB-g%Aa>D6*iS2kzGqfqlxHkQ;kMdk@a8yz%E)jk^<8C6jloZYv70iqyf+%!QY+= zfC2&biUAxr<*XZu8BPs}?1YC3_`VL@`2F;QyKs!KIor?W|L8QpS9wt4*nVY>UclBI zu|MZmWK$Ez;)t_xpg*S|dEbXTrcgFDwOLLCCrF#4LqvRieb?etIuwmWo0ahw>CDRd z`Whv36}~VzzW>!vAH)<`Kt_M;%`YAb%mvk)-p;iqNFfXJLg}f+UF++gd~v)oKDodv zxg@Qvudf6Te)?7D4reCx(}pE2L3f1kc@k^nreFnH#m69aWntkH`=E`Lh!P=nTWk2h z*#if5CqDU`i?fkvU|WO1%5%mgt{_w40g~_sEK|%CHKZnzij>w=E)>=w-tURzh*q~t zwrQIV60uI_L)OaqYl#v{E7uwi?QZu8NJlN_Hj${16COYp#fvA(_i1Zzgl5%ya#po>zy4RFQp(3-cqguW!N#bGR*1 zF8O0I^R2f;j_L;UtcJU-z+QwLG59qXyqg5~%7`AIH;wYFmx*nZ;AGNb2RWnNoWUN| zrjg4ujdn?F7iyt)GI2AW=?IFtuGR11Y9yRY=Z2NYr=%pkq7LOoQUQu6!?|=a{5r;4!RYvSMXY0vj9C8c0ucCX zrZTA!B~nU^sOmu}s;?;{sZ2suM-n9|kK1j*rVccHUErR&3YGQKzyvT)oB)%+vPf1G~bl5LtW&`&;o2k|bOnWeH+CHQ{LC?lLum8_Q6 zW+_*kAjC%K)Ju6pAnjJOp&Qf-+j^r|s}&1-A`8m2zN*j8Qos%q%NMo+lh5~d7WZ;( zq%t-!!7Wb2)txDA0H}`b04eYR7HpC&ZBmXgvHwgit11wugH(bY5ca?lOz7oyEbqvf zXK$W0F~QxD$>lOTT(|ke6HQm_$;3Ji))_)0R|-ngk|{OGIbomZA(6xTF6WSXpoImr zeY|l*^ss_6*d3HOZPZ0YAB0M?Bn%Bql5j<|PhXnr-kw{k+)2cyQu%yp@$_OWaT>LM znXJwp?Ar%ti;Wj!i9)5|Bw{B}c(_c^{nyC0flSC2gN=7_ z&q>2N?8VN~dhsDH!5CmNki>qay#mUC!PThO?f*EfX=&=FHSo)HU6W_xZal+LIPr{G zp-NXv_itkmUA20)ElIJ-v;;}#4&!dc!P_4E`oPy_aA)%Dr4E0SE~djxV?0o5wqX#3 zQ55D%7)oLK!zhceTO6t<7Pk>bTO_i+Eh}XA9kO7-xUib|EHBw8Jo_m3ufjTNu+hLc z;>8h-Y2UAfeD9VYlvDZy98de+-IbNQE2O=93-^G&D-Fkr%*XE5qQ}o4kJ4QXSh@QL z=)d)DYKt3OpWm~8KU~2>{wp|vEOyN@It+hXGum3Sq^UVg#a%-$sknjY?FW|mwrSZi z-%`bP1$+xcR&l;UcU|mHNU*dTf=#B7egP4De}JiMPfUE-$>AD$fi5ItDJUYUJs074(u7W)!s>R@egme3dxH-sTsp5KP^f$HG8 zQ4T`7S|XBz7qBHJ)00*c>q10UT=z;m8;@rZH9({wJ(eYl4Q4+p;BmQ6ydp?_P5_fQ zH>gEg{x#jXrKLG>`s6H~UvkLoyM&{MEfF-jpfLg2e{>dZRlUK)zJ)++>trEXn2)y# zxySdL5575r`HxO_FU#dvu361a#D+qbyclNHhAE)p2w^1dxJ1VN3|3_|e7 zZO$!ZChu|EM$NVy>DDZ=duY3ygL0;B(l2!9q0TbWifsdl^rBiq5>!a)x0G}z(sv`N z2(d`N7a%uhQxGss)m5!6 z;@+^aX}7=>9W2wDjZ$3*9$XegP!K2BOFh`5$erW6y7x`UG$ake$H6K$pU=cCbb>4) zL&B^LN5Am#((N91Tvr$|7pyg{D(BUBrkD96Fk8?V0F6REEEzkqwjW;sU1>&$KT=OD ziA7l-nK&JM+;OCMNcpl5TUoGD@KVr5Y$~Hdu-f-6aVid%h0KV_hQJ%#tXcec65 zaeB7_h&VW!K_ClzCF`Oc&b7DE(7z{{YW7^$@@gCG_M^1O4q+Agt~bWDz{fD6bw+X~X@t%R#)I$S0w3LSU;ZBR*d}Tb9r2yY%D9r+<+=uJ5Yd3i;Y-{aF#^pDP51l_)U`>pDFQJA2c! zsV3y<_rRl3R%H7i6NsS^LTgPg5L4l?ROy<^if>Uh5gO?j))p^WB3RK8oM{T5nmzW` zvDvB7ou~fv)Xq_w{_+i7zag?elOF81jq8R!F`>s|k%i7eBo;&Cm*vq)Wwg9MmztkX z<)X*-?>~l=kZ$eOiHUre(h zo+>rv9TYDB229N%!gC#zi};0Gw=SH#a^(#}k6q|?PY?grI}mUea$UXh#+637W!tA$ zUDFXqjU}1?E~v{Ww+W^}-OBS+!n)8qB}qB(4Z4?~1obU=MsQV!eS@LZ0<5D9H5SaQ z7U@K^thvw_QabMg@}%p#A3A0*EhPs_+7jTQi&uE*rD3(OL7~UE<0CFWkbqdh&=Im* zutKXxFJ3%q+cKxmkMfffNbQRkZ5s*uOlksjkQybqNt)F=(`l8DsO=S<}T;L&i4sw*SOi_Ak$L z|9)MT5~VHKwN<({Nzs2J7|R#PXhnPG=$Y z>uqf(RJOB_I5LD$V+ICIHw0mLF?f@atP%9L;MehwBb>Ac4}#vW`t=aT{Hj6amyZt);_s0(S^$^B<$FGNBHQw{<3LB#^-oKw?YitE+jjbY1 zdI|MQ>>B>q)#uh$*49?{zO-`b8k$>re8{q#^D-0Vb#?{+S>$-Nm=kdvq6hvVYkU1I z;9EedV@3^9#Fp1qUtV6je&sT+&sF&%-$nu2t-T9->(v@Yesr?WfvoEw{;DLF1Cbz* zox6PfrK@YJyf%l%M_&!xhHd-MZvnl;0u-Pig(!@dSd}6ar5Fv-FvTfBNlHGxNcy>|7OUmo$xqkg&MmxujwpIC;j7*RA__>i+um!TN*s2J{d5eRzGaAAf#ru%5ray1$RQzb|9J51+2O zPiNhyukO=V^WimrT+Q#V4f_54*8Kg~e0u9XygJ~okGJO2forBb55w;_JR3mx|0x_U iWCS-WynTpIw1cpr1lu)`FEN6B|0`=XQEvVJ_WuGSUZ}7D diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon-small.woff b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon-small.woff deleted file mode 100755 index ad14a2406e7887c3ed22440d42d726f0ff176119..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8336 zcmZX4bx<5nwDkguy9RfH2loVL@!%TVT?4`0-7UDgyDo0QCAhmgED(77-uwRhy6V)_ zIdl5nuG=%!UDNYR0R&P|RaF20$m0OWfRDx#1%UeR`u{gE5QrQAfIQY@0Awg18tVtR|LM4FTYQKg+Sd5x5qTg;|rCYQtG{xfQ)meQz%G$;AhL0HN9I^(|l@zk(Xeomi zrhJvOr{izEa1G{5Qrs!g=84NF58UI%k<0AO301~KOL)zR=f zb;=}V-SbjbUreQb$&wV>DchIja4LEz6H-K{I2D!6W~S=9bxWF=eHMH)Hw#zzZF4<} zmBYP5wZiThHuZ03PTs3MQbFVTm{RaDLP6kPB6F+B29==g;4r=5ugF+@ZdulGtjY%9 zR3-Tod1`KEFSq|6BpK%CCPXJp=Mk(OGsNwNzy@4V6U6xXASNx*6mIBcP+TLXt!;p< z5y*Dnbp>Ix9>~s7%E6{c#Aefcl*+tPpVg8+an3!E#;M|=;vt(sLqBVCY-<_AsgXh3 zMKzI%C*?ldG3z+X~JKqu5>cmJ=6 z63mawuMxi*@(DOg@*TJjmX*^RDpNBv7xV@E8iq=Cc{^w=(KGnTI?WDjw&LzH-!(kG zO?rGe9fxEPndw>x4nKaBHzazdQBC%4siUwz5S=2&X?1|s^nY_m-s6# zXQ+~6-zEJvK(hPb&)eKw=8O8{L8WyUti{RghFlb1y*iC~Kk3rIvXC7i@9!&@SaNb= z{b2RC3wfAm$o}nn;ada6Wbn)YN9wIg)h5pmRco-V$}Ph>Xrf%3>(zwo(`)-(y<^#9 zN_56=4ey1b)X~dSW}TIHN0Kkm{4cFlN+^dMJ{H4m6bAx7v{B5-emXl}oF6nhnmySz ziPi>j93Lr9=J$+2JrP1@fJ7`34^cUX(}^?T@ql;j%lrM}Fz)Y^3EG+Z=&zMw?ccG0 z?$|h1+T>4)>t})7S{ms?OOx*VFv&(bdJ8{G6+&K}RqRr9Nvi*Ll^m$XO4yGa^lmgAPztnmKLXvGb18TjdDdO2zo zkp}4k>dh_0OA@YCS&yGNkE;I0oVUreY|KC9sf4Tpi%(C;Xr3_I6n#xEzZ<3BvE3KV znXVtV6Kb)XK2&2;t zs>cknElwT2S}>)w40nR8_^$=O1v@^V0E7tPw~IML$e!P5&d_a5XgNYMevw@4a4f2w zgCPZ8kt-r09J0!DYP60kgUdX|5#cZ1neUE1K#y7_MxNtBZTPN&MgKKj9eb@S(~w^+ zk#$ddyZc67-6lvJ{o(SKFEFV_Le(&ijFX>@uOfaBWZpsm+JOp6W3~CdU2mDAd&ejZ z28K7YBy?(px#Fu$Z}F16)~wwKq>fjYnKXs>J51iLc>!hXsdX554|;fa-6!31nJg>; zf1Ecv`3&UmcQXa)W^nk^=ho{-MlmAtRw!E%$DIT%^Gu-P#`e*hx%`y z#dyE)%Kiz_)sqOFY`1k&p4iCujs%D=`aax z2VQfv8-z_yFB^IFt!hkjs+J6k9U7EIiOm#FOyAhZ8_&NnxTA2~b1KndyYOJ!Lw_YF zWX+BUcNu8x6xO%Qh}1oSWJI zD={2CrJefCTm>WG%4l4aYz?YUa8h|ZJ5X4MD5iZID1%#~m~gJDEz?SKg}F*t&4aZg zmQM`IMO0Hz33p9iTsqtFDl^TKckyJ?;)>P4Rj%!=Z??hlE2th3tUSf%uvO> zaD3Il*)ne0hgmo2PG){v%?;j?r|m|d<*7nn`V%?@_SYwA6gCDAWgxT+4f5)6k$93fwBKKV^r_lkS@R3FM8_6xd z#F6JX;58T{BC?0v{-6@%NF@LLbL(n6V&?|p#e1^FaMXI+rn9tQ78;1qjVc`>9oGsI zo+CJ@U>POg;>aezeS|%Ue%=lwsrNz4yd&uO?n>2u5r@ydEoV@;Vp#VLDz^pjdfs9^9Y6^dWSb$ zfO6o&v|x-nh~ZvQV5Rpi_w8H^s;`?gptOfL!AoRagIYF$L%$pb4kYoe`mVH9P}b)(Vd854xvCe?1!TxF~8THOiPM>H@EbGTs^7aE}F4 zzy(18&hIoJ_%A1$l+wE!+ypjeuv!2QqmVhRO&jZ6SP=w`Iu~TKv?x@!e^;s*F33qvt_fHMYCJNjbBf1>SA&K1 zCUpqyND~y^8QFq#>T>$R&<7dt$lk9D$*aE`oq8sU4j^*cq$eK73c!U><;1j}`YJo5 zz4A70^ux$tt8D!`FG8nU8)PQ2jHK7g7Mhd%{Mb^5_HP ztU~@w+lw{2OX}h7eGT;*e0>lw(;MW`zoQ&U+eES{K_Ng!bi-YPvY*c%GO0eZe|E$k)&!W2zHQiAq$;VK$ED{et{24l^j0o&3ww+9#_2hOH2~+%V1?a1_7K={SUWQ1*E)$ zy~JoKiJ{s68cBjoWao$h$4q5CeierO8sRD!ylilvhprhdN?G;d1@XRzboMT$OIf>C z2@FHpuib%o7n!hHi+ePg9v{TW7l8T2N@KZ?3P(8^IW^aZZC=hpFj5}P0 zs_SSn2h526v8GrbvTHYHi9y+hJA5vNoQ63G^4p!tbYUV6k=ir!)(0JEh@{o#&qoC! zQ^cp7@&zf1GM*IEk#c?7R^fpa0nJbZC!Dwv#rNxWN>R+{60x}+O9OXM4?mw~1Qdo& z>Ia;-P6V?C4--2300blK6@(1`&cdiK0J2;P*JzNnfGdQUmX76EU+rXC`ZK1yZZHo& z*>#7jbt)t1ad`F}f7NP$~+{EY@J*e!HG3}FBJ))K#S}uUms~6JRdNS4j$j8f><-(}? zG3`Rt)deAhsUW5-v=GO=#p+!QLpB0QHcW-2{7_ai+cs$yU_pkWh4J5rD6XqsDGMbZ zE3j2LCQ|UVt4kU}e67X(#)LmHe0G6SokUHKE-=yB(taFLLPijO`1&b)$z_}|iM2np z)?$Umml!`Biw5MYsEyC%NtX0_9gECIv{p=hW=E-I0Cj;W@+b zGYa~9UiOl0O=DgMV!Z6FvMXR}fQ5`GOkzeVaEND!ww-spYymB$&T1CKSFgoO^*ea8 z0GA>XLbU22iIx*ja1^Qru1eORjBzOs`%)!1VWnDy_S?**jBcMmT*Ud=1}$~-=xRyF zCr8?ac4m0H3F3`b;M0xRC@ZNs-zf~IzAx$hLUz=J`r-{AKZ@7$Rq6;NjDrSTjP*&t!Do7^^V=#c9B#~l(hgre@+sMNxQKpN%n)3Tu1-Ch>mBmK8ElnmKkX>I!vG#&LkR;Hc?buzj zZ}YSei)rusNCle%eNh0@y}#8FR*%o;wM}vI5AF5vpLrM+p-)aKh^kXWgKI9n29+?# ztFNeZec>WvoTg&E>E~+hgip^nd{Dm2FNg`V?y22s=knzh#BaKtQE;oh;<$MtkQglo z8R6$+TU>dCyT=_)RO+k2BZlA~6(TMb}&kT`=8ys5Jdb6YldrlJEir`+-v@pw!!voW0;ha&sF;Tp4xSE+agKm)DtR|PgduI zTT6Z-fcaj-Y)~~YwWpRvq0BR@-_^nqE|?-b?zhS<;;!p#H$jYc6O*p?X*O^)x8HX8bQ{`yY=(b?)?ji2~`kvwxGlO+Lwi6Hh!ImLm~+-Ql;-B z@mMk){phE5`l_%K&Ex4Y)Tt0t+z@l|c**KHa0gvHJoGipTM(UwMi!lB0*EWOWoo8$6vD1hzcx`VF zq4BNr-qWHMAl0y++Fz68a{c2JIpc!JFHr0Wa?f4N<-lVVDcUhht@DtdWGcK!7C14` zAt42R!}kbgnb*Du&NzBaRojtytdbpJ;1uuz5ns88tWb!~v2;F}w)NNfi9#MkVFtW~ zR2fgiKa^V>)(EUMDO{lsiL`3uidj}D&|QQ>*W+~8&Z_*MK3>k?mld(Z$6mGmd;`?Q z)$YFD-Zl#fI$8j3EkbWri2|%Tj%jL`FM4PbSivc>iH_@t9*M(l~UKMxul~IqwsO7qFYzIE%H_+_AP8fVI!2| z_N`&Skz#TtoWKZ2Pu+v`WM%o3@oZBzmXfFR7fjnLL;#u<;yR)~l~e`2ui|Ow9*X%+ zBgBUoZvBUQkFO}~;n6lnGH>yr+b_7zLG$ks>B-i1*%H6(FGYJHaY$~})(Fd`9wTV` zlM#Q$v1R+}Xn5Lvt_04*<7p1m7a~LYI=GFe7!9Xl%&Idht=o9BiRV{TL zUdrc_;_YPwY8Z#&{E{eRbk)D3=6w^=mJ_9Kg5k!aIoP)}xz%v^t|OrLU89Pi$LRP$ znb0K-tGYi4{-TK5nq_^CjGH+0rP%sk$G&QNON7vL=JTg~@yjTuPwjHw@@9DN@V&?A zh7OWdHgRsQ#^$Ty>PTi|XRZGRt*r@p(M`Yx=(z>y88-Lz=p6aV{~@R%6G89zq7=)* zE4%8)bT`&76*xy9-e#%Ur!^;>j}>qX;~NqxEQ2t%Z1CV-x7=6svY9nh^wvyV+W0q= zcV~x%%5r7hgZ04c^D1IwhI4MZ-Xy5KQNWl2|98ZdCYOlB7 z^l9(#j3#wt7^|qIdZ0CiiV=i*PjuIt(bp&)qVB_n?a6S@*7L($rU zTI!aHelj*05NGo1H&B3jm(A2re`433ttq1PMwy^QqZ^`so^??!aN|9HzI;M7;3;-t zLJvsMI<0Lw2HTOi02(YwFiUl_s`?e=b*Vc>2 z!Mwzf!-sv^%l9aC(2D~OM7YP%E8lz;c1e)r(=XSb3c<9Zuy3B;B;r0JMhdPZLS6Jv z`;HSlTP02p3ybU62-C84hB`g?x9J${;yY5#A6H+-e+h*_XWY1@8Txe{ubwMMk&%5)`Ezp^w&I+@0 zpW4XDbWi5uD%YcmMe!Dw$(WH5wO+qDTS(c^$xeRvma;KRM;mwfIc336QhT|bDliwP zNjDcwoF0-Xrs_(F^V2vXPm zo2f)6AV%qD$p1c;G8orhe@{X2aJB_x#dUU&@(wsZ^8McNo=%o2h(i%c5$v&dT7zIZ z_hCCOGJQjCuQz>Gfnlx_-R4fPfF;YJ`~kfv+<9J|Mj_2?q^S2@qG@fB@>Nkg7x#&) zz3}&a1=Q9aSmfiao8*jK{W|zQHMA)}Y47Z^?FpvKl0j-!!lHV+aV>jU?sY zQ5}cr@Z0V%{(L!Djjydp%kc%5KXx}|-=4Q%)cg`380m?~kj!P-UWA7#$7wq+gef_u zB;E+#q-b>Pc0+rkHsw-%+KRr!jn&3+V8m|Jv3OnkScp-h@j)?Uex(Io&yF5={+_L( z@7NuJ=6-03of2j! z*8N`V(C!$Ze7NVqv7x=oieg;f<1$fQWrM|<7@8kkmZAPx2_VKcg9M5v3>G<1KyamEj19@%bKVc_18?SLe7vbP02u;d~ z(PzA2;0A%&-QNu;J)l5W4-^qSLVd1@biDEfhr^BRK!Vvs&4Kcw8kJ5;3a2);dj=V* zxLzld3c0cL;vjNE0p^?3L zDDy+5yH5YqarSvXPm91kKOcF!FE5~5d_##vmhzs$Zq~eH#GjtMK#{*1YGpx4!kihM zo(*Yd%xBchL1D2KZ3^HS%dd!wZWrCyZ$Ik?;^-pEir*sK&EZ}#_;;AjB)4KIX@|XX z!xmzmmRQsI9SA8M@fSY#QY;85<*_`&Y2Rrzc0&5XYS*xnF{mr;9NOLEFi#>kBEdgA z-migr6qF`%EjL6AT=+nO4eiD-xMS(0%`|C}WmZAKbBkA->8 zA1DgK66Amzl$4ZYKA_8X6;^;)dwDqFOcGoff?agnv3!!TE>z1D&Z#moz;UZeyx1zw zx8z8;Cd9EbinLv}R2A$0c3r)7c>gXZb%fqod}EZ$MBYD^{%1&8RrIq)?)&Q@-N~0X zVpzMfy5}DMyLZ@hqXnH*Sw^Qa3DSVOw1#j0c)vw(Ly7Qv{Teoo4kSlLrO-*7UmD?w zl8C=7Wvq(N37^j&`IJ`Ioh%a%6I!RBH1zSgS@+-b`|h4*J5nKIZ?;T@Y?bzXA+0`1 zgMQom$t(@uLl4xB#Kri>L8n`$v4Mes2_PUb3lc*9oVijd%}NLmfq~=vzk4PI23s&j zh;SGNMg~Ap6>>AETYLaqJiy}r^))jx$OMDOz`aNPX+vP}7FtmcyA*pPD=RBoEjtI; z9}qB#5qFT$w{_*W4Fj_q_>PW$hfl^z$NAyt!=(dIPysMRQOG{Vu^$tT8K8(FzWGU_ z^Sb-08^b=xjH!2wX+YEm(bW%9s@BSpZo<*=8-SN{qlo`CxGc%sU5aHlE}r20RB@Ok zVPJ%le|jdCpq1esx6M)E6U=j_55{%sp-3+0stKAvm7G_;ZlX zUiokmrZqQ{mSetTDw?g?A1y^H$^)dagO}I$9n?p69JT+g&qoaaI|^8ykX?vvH@gD| zn;)33Nh{Id?j8M|jFpX55a7gz51s``N}~AvSI-Z>*VQ{zASrhLhXX&&PX|sFi~{(r z54--YOjNqOo8Zn=>VpjS^T?8p9Bm`sSj_>;$_=dm~ zJn9@O)9Qr4Js=;b{VTl+wFG#>G|k?8|Hpq*)1#a;Bj&e_EYei?92^=DSiEzjo6E1f$KFbmS(og$ocGsqc13By~@`EkrF6 zyO&AsUl;1e%rg0++jfP6OUP+d^cdeZ|IM+e{h&vZ-}`E5Xrb_XnuI~WFkSye2<`4m zqMEWvThig`#+Z7E&o_oHK|+-Js`hTQs;RlN0Nc%~8tFg(_w1R0KYl*&1_1vDL8`q* diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon.eot b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon.eot deleted file mode 100755 index eed4f8149a44a99566fe9d3778dd21d0950a7ff8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8268 zcmds6Ym6J$bv}o$;l4@pF}vK?klZDACG9TBS&}R3;aNqyiX+*k6j`e5N*zg-Wh;`F zkS*6%9BTj>j*FzJ;I^uh76ID=X==ED>K1O`y6zZBU8Fx;0deDf8$9Pe0X`mk-`|>TgfIOEmsv)Q;@gy|fI{A(YReY&`JUxzgO9{y@$!4`Cq;~PZW5JNS}J_)bU6D`)F0h z{s5u!7%Bq1`a_J3qdf80xhJ329`^O4d>!TI&aRw1{`KXT9U}itl%G0x{OLM<3Ckp2 zK-oBd{M@OF2jBfE(ePE&U8%1;@#ItYU3;Er6!d)etF>W$gG0f$e_>$zkEy494)5kZ ze?P{Pq^mbq-}f;$Q4D*>1XB1nSKp^uAFbYOk&hK68Pa)zs^)GwMgyu!2)BD#UKjQe zU!@?0c^^NDx;w7kC4@*n=*$c&0=n8N6krE+bclk6)AaT z2bl;NR6}Z$g%)FSfYOX+7C{HQfn=?sw}RR4OKSQ%2Jd%%c~I?mM}t$nCM$5 zNp6G!^jk>7otpKlS&ZM0?k2CXJ`v;rcE?WQA*JwuLph-j07(PuLu7s_+O!g(239`Eu=YGLvyvCgfroN;TOZ->6-1T zcYV+u@4ma+?tY>By`FearDwV4*RYq^`qd_MqAB|x<+P7lD74fr2fQ{HrxnM!7tlSM z&uVGESxv{xSuW34O36fA&sWOxxlAaYG)q-IS-OWSDCVRw&NpsEt{d!*l0($nJ>_M;8 zXVGZ_s0Dd)$l?aukZ=uBH2_J|A${YJ$ULNU4w74?ZJ4c@$Z7})FXY#y)phmKE^X@r zJBDEy>QMEqWe%pU7TqSoDmG?Dc~l*(o- zTgFlwRuh3;qvaR|WJ>z`*YO^rG*&J8v)Lcr<||1qZ$fcGn^^}H$?=J?y=BWX49hO> z&AeqM#>Nt6tyW8nkAIMzEAMStd&`+^zl&wM4kB6GYE#X}FH#|r9xEkBS;Mrd<#gG# z?HlothTT{t$WwD9e$}>Y{AF%Fu~5JR7aE_!YJ`8bEJu+6u9#Zh+{wBuFTuvqD_4%* zd;0WCX1@Dqy?&tgxj%NW(kpLVDV%=k^n9-3I0w#S2NYdxO$To2>@d!pKq)ITTp#>; zx@sbDKCNXDEKJXKI&nDMa>9`?Tj5qC%#v-n;il1f*l0Fgw?(eoXoz*~;G6JmBSjl0 z+9+`keTw!#Uph08rIoW~%`4}jl(Ja;e`)7*G#!hkqb??CVab-!Z08KiHttXdS;AHs zz*|{AB`FL_0%Z{kVgjuTW;Q4Gx zYwwd8)ACil3gL|PS$#1q70A^Wi}iu2M18Sj5|x(a+^A3Qxz4ujN~`Ot5e>Q#lz%6z7w_wfL*=m*SeWCeq~$g)Nj4^@4a^U@@tn{KZ>PdvDDwFxbf(rWcZ;=4~3K5 zM2~ClwcbLP%dfp7UA+H06RE|+hZmvKz^jf<2=j*9@5x$ z47aosI=!>x8qS_0U~y!RVL6{mp4d@aS*h(fk^G!vMN;);L4@VH@bE$NY+z6ma;nSO zi5^uUM`l9HYWb|LnN{7)vjf?*?DM;i9oy|VD&}W~jC;ors>hBw4ua59cqTFrT9fN& z`9Gf4kVlHAJG7Ks@lDLDjYFVU#+l2x53}wMDiMQ3>zWP)YT7vG#^y(Np5VaZ;&|t8 zSU$2^4Sq4wdeQDwqP4xZV~BD~BFiPuE; zu&JB=tUqSz+20<0esrr{w_lhTJ!WCJ1ye^dNOT0N#hs}OcrimeP|k$3F@{*?Cd4{G zO7)O3+WB0*Qms@)io}lPlX_AQ<(1(`paDi)FX#Baue~rc^MXXHq=fU^W9jsAIz3jH zm?#VmN8s>9h6hmy?tf$d%;cuZ-dFZkHchg%v~AlGLQskH`GGK=fuX6Xq2BP|DE!2! z(ZO&p%I|L4l+09TMsm54nQ8{ph2DuJ`zQVe)-B$bvO68U6WtO|b&f-tUI|unc`d1B z6Y+7b=DF6W*BkZ1!KV-6|F6k?xy|GJ;O5-E@nvZ~_?&9ksd{a* z!vSj$u<9cNdeCGWv%sFmGzfjwRN~)o963G&9G;DwJThM;qu6ti(Kb%3v*B$ms(7f; zIf15SIejqzedG04FI{@|QtKUs6^_L~BOAbKST$5%di52B4}{YsGQgt&9vgjVY?+co z58y>*m33QJ4kiG&Ehw%$Yyb_(R(Y${bhx2B%Z93e7(tZUZLSTTB2U;9kM97GU2*fn zeumVAA(YY6F#&Y3d9E`uH8L`_yXCBK-LwDR`sYq zuSL^#qhUA>UI4&$HX4}neJK4ZZlHv>3$ni%TB3XDKH5(Y(h)iedy4DK0EaSjoSVlr z#w_Vo_@JnPJjlgnCp>9L^Z@rWTFTO=gccbCS5?CWNG?A?v58Pu@gjm^u8>OkgFyHG z?&0oYHRLQ zf#@)jKso}7iy#S#+w_0-()67=Z2^soK#N~Tny{M&B!S>tF!rSfe!+gc3QAUF$+-}g z2M_%JU}wJCAJe|Bv5F7gah0ERH@?`o#`9tuOxvXpDT)!`= z&-!-y*npdIXi|&am7VSxS~$UvJnOob*(fjXPEQ^=ynlNZ!pF*=`fKbN#s_!utWQhi ztBJ~(ub=q~cg3{HL-4&8Pb>`eOdILl%VmQvyY91`-M;_u5v2+QJ!D{Vlt2%Dx*#fC ztcsZskGqooP)&Vqaq;M`D@S+Db!lBZwV_0~&h46w9KB-Ab#?KE0#T@~EF0`kvTdbw zSgOuXLoSxci{Vn*tBe7(*p(V6kgMQCAcZZZ(?0{<9jt!@-F0LgPz}kxDjjX(Qxtb* zcuQ5xO{}VfyckKCN+?#_vk=QE&bx#SGq>SUD?h_-BN3B@Kg^@i`l;t3{9*%r3`6#4 z1K(KNT8Mwp`T0DY>flu;-N4etMQr0A3k1+x{DNxu+PYYdWh38dynkB+E~$HoH~?^R z#UDU`lNJ@1T>Mg8R#mPXozHPr>=^1HK-G15eO(>`&E&doj=<223?vc*FApRv6(?HX zepc)0(Ik4<(7L)biT-4*j+@vVjB=dBK zlfyei=$KqG)@~YW>q(f^sH{{grxUTVS;bPLX>N3Bb#=3-%bcz@Z80V`4$thf8vu5z zrga(OhZ|j5%hkF7jpRTyjn*HShRp^n0^|t#{WeYFZQ~+vo+iORU#-l;)e~6PvKb9% zF7K`?z-<7X@h(Fy*u%uK)G3=X>P z;Gkpl&t%56Aw9DtI~`7^!_(O<8GT4=eJ_;k@9mAof}vzzUvDISG?z-{QZL4$y}kX( zP%s|p?dwDOg)Au5gj5Z*vSSaVlG$l9oi?Yl$7$VONLn4_$b0&+LA@1ZNR6WA;7y2Q{fxBi4*b}i8GbTa zowY%n)KAUAYWpL1q$FF_(fvH$A<|?S4lVARxjD`PiE;6S9ZbN9)%0p|oK3j8dKDgT z9`7j1cwgb8TBv7!!HVnQT3C-;3-djp+8wIe81$`=?b8_+QJt~>eou~@xb>&-9-bHi zD3^6X12YYO8yKJ^ffGqR7SE>9_NUNs06rxi-e)RCQ9u9~3dYCT<0^r}-n*jVLykQidFq($K#?tZ@ zvux^e0l}9UvMd)byV#f<7QYKV9Q;G4(HJJEEr8eMx=54kotC$*-n6dQZm1Zw&{c)` z16X1E&4k?c#C1w2V8_KY|55mnz6Bqc7*ix-4Aut?BpWfL?T`vih~L_@49CFVvTsKc zw%b6`V1wl8rEBOf50eIK-_HAxpYrm4%Ft6@K7jh)_wwTTf7i>0Q2#^hCI`AuBVT^n zdATnSdU-$X#=G`*eE{`e_3}Y{SNTIPA42{2ZvX7~_{o)XD=X*e_K%MTPMyAZ_Bg&m zE~`(EPpb3+z9F6>1Mh$2Go(RxBW(N-*{-YL*0+FALa!p;tkd$!`6riGE}TAPlx7RY z-G;{%xysDKOsP;rpN)iQZDJqs4fN2d3r{@0a^5J;!lD1Dv7(1KE@Yx4A!co49V;tuMCt2q~9^w=a^9Yaf7>~2TY0hw#CwLNHVDdc0 z)4U0awuNVSmgl&@MJ}<)^IYZ%S9w9Zc>eL_LZKk(Qo)?}(vp`Jz0_+jEw{_1B`@9W zrJwTBU0%BArCYsJ@mVUAs$RL`rDZSm_?Aqs?C~#o{7WAHqQ}4J@h^J(iyr@?$G_D_<|ANQA;PEeb{MXLMYd6bEk{Dk<0XWEuCJw4PDf{6oFnkAP6A()e`tC2S L6eV5%o%(+O+no0t diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon.svg b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon.svg deleted file mode 100755 index 727f61af1383..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon.svg +++ /dev/null @@ -1,153 +0,0 @@ - - - - -This is a custom SVG font generated by IcoMoon. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon.ttf b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon.ttf deleted file mode 100755 index dea6e458f9db36c0cc4ad7dcbe579aed13213126..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8104 zcmds6Ym6J$bv}o$A@@m|kJ;tEhU6}}D`|I0&XQbN56>#vRUG+2IkHsQl{%6v%T^>U zAzQAaIMx6%90y5L!EIG1EdsU$($;VR)h*n>b=?V)x=4Sx0_qe&k-`Mp6lsAPLV*NL zAKZTDa=6;HW!C}vtHZhPd(XL#bG~!#keG=2$ss@0S5^+*d+Kjby-hUnWz>%D+q=9% zrzwQ;S(J_YKRsWb|I;5#5b@8UeCXu43iU6%r_LRJxh+<5=R&t;nv!_H0PtWn{D#3 zq9jAQPf*p|NylhVRmsRsFU#w~KH{qsq%hyZkD_j$m;RWB2{ZIj5c|}9qTLMA`lHK_ zkkz7_ggLZm4s**mYEIIrJ4Jd~N?zGPCQ1g?k=kS-*lV(5@)#uhKtqi1Tdm zGyL29I{%9=>|5|PeBbx|yZ;{lv;Noo{}I?0cp&g};P(Qr1%48Y1}_A!2mdPgU!ld& ziO?l2q&ZqsbG4s@v*CNfFND7nnTs?c@AV{l?(DI9p6_|5H_=<|UFrQ*>?O8-tp%NE z$-c)pKI34jvzOgVlxiHC1!&;+O z+Z|Zhwpgz(Mn8L4ADLc6&w-P@=#~C7I!yw#AWsfi++-UPu0g5>A!$0KZvqlofRxTd za%;2$vo(`B4I$};!iKcApEdnLYsBsv*_I7{cH42- zFwH+QExYB|EgL+1&@&tyyU?{5Q9P5(#ni7N2f>A!!(`!^+p~wig5j>!cGzhGsz5}FPG<>xw5tWzU|u!*4(C2+Z8GP`>DoME;qH9&gVgA zW5K{OeL!P^47u2?Bywgl5z6LwNeT(BRV#{%Z5?~=n3WzqIGV-*SZ%EB#?FHWciy-$ zp{LXO#B~d^$GVZIb@w7o=KK()iW$#Uu+*m2LSWZuJB9(7lK%b;yoV`+Rg3;?^~ZMj z%91OXP@K?K)~541PURGZDCu(Q*hDre{0dI2>*};b@qxaJw01$+q2a z%jiCAv|6s)Cf98?#kzL!P55?@qJtA1l(>sNLHnRD-5JQzD!Gd0l?zZxS*-rQv~wnw ziN`WA7n8KGWXouEa)xCax2c0HVXF*att0bx3`^k$#yLjw12t@*H$WN6f>+_S4cv?4 zY-PHF9Jyp}DhcpFXvtaH76y^Ujw^ZFa$UzEJQ^904g6q{V?fL~*!U{#R6Agb6mm8+ z#zHeURmn*{k=ntsBdRfJmaDsXAy?Kq`((zoLQSthIOF|Re;i8%a`ngK{a`9le>{~! zrDZuc8Z-N@vu(T5>bhz~6C;|%Vt>39?=Kp4OBsNxxljE%T+{V)3t^@SpgT0H0A>Z? zP(g!w)gUv4+MsBOUh~oNnd+J4zmUlN&t(^-v&b!<;g;mjEUUHCp|9EJ5>`ZS8D^D%@uU@|V z>gD#2;^}xi{WmIZK6)q>e(2Ie;S{&f$5S5_B4P)zt~X z9upf`*$rC`3!Y4*M7eddvToc%8rzQHmUly^cb8qm*>?mij_flm=QF7jyXvc}^<5`Y zpK+{cy0IdNu+k77K4_i|3~E76bvZlHqZ;JMOlmo;kkd7@rke$JAe)wbe($kkdmTr` z{MljS?s0_Lv15*dAhZ;oiOhr6)COAqkES*3k>Z&yEhSfc6Z7ie5a?BK=5p>MtowsX z#30eSrbB^RHqN=Z_0ioYIIy%d(R~feM^?MZFGSlf*xgFBcJ`KBpKP%o{uHQ+DPl1Y z1n(CQ+FXzKX1|4o0U}&6$9%a;9GeA=uEsl?-SLK8`c^Vzb<>~o$4x!=TVv0SZMPft^OIx8EDX0`>PQBO zj$pO8Gev+Gv$PB4Y)Bhth-H3KtOKM}4=JNv$QP=$YE7g_>{ubCr}R)k8IB|xV8r!G zp6~tI^Ru(hOSDExIKMrf$*g2D{md4F}w6kE$X zb}S_LeQFY;ATlpC6sAWiegoomjGe;%{Kx z;(aN*)73lCE%8+6Ii%^;U@c$JQd%yVnBZE0>&-@^*(e@-`XJtaP2H28Ta&EJ#S z{ToK8p7<0yXl^vWEX@a>RSmmUuN`(cU=0CQePlonT5Mw$*z>psp|6=r{F{y=$A^H! zvyqcW=Bs2BdoD8C!HEqvyrV@`4>h_c(6TJ2KMtU8zV^zcORrpNzooFku^4D%16U2K zj_OOVysYqnaGFF0cr?Ldvk#3eQ9zVyN`IDk(B~c;Y|giP)Aud*`HL$O6jmv-JgbBJXsLKrLtgk0&)?%_!t&&N`D`pK#jb*qQ z(HiPz(U3V^ZP{W>Y#g51Z#Mz#R$Yr2;)fd%t?greU)IivT%-et(Om z@U?LXI8RgHU#L|V;OYsiYq_ijG?#BzRp2&&PICDmkOi0yjIZtH8Y}_uui9}H5-9=u zImTxSsA*Xr$LJ*gS$1~7aE69lcWB5l24=Gp+OVG8mYWG@GU1urwyZv^wZ9ii4fOTJ z;=xd=zrQbO!gxTDkH2)2ZBynaP+lxm5c8 zymX1jdR12py$>YP`CnE<*NMZ~z@NJ+-5Gv7THUoloYYUv!s_@Vx1}Uo)z$q1z9G_71r9CloB4Up z0f}+(gdI%6iPiL4YJyF;x_S*BZvo#ZD)?UEqk5=!VbMzH;d)q4Sc?n2q55sAIvDiL zkL=SO7FC_G|9(%7Te$V7@g1HR0w|YtK?5@be;XK}rGOJDJ)X#AvM2)#^rQ*V{LUwP zXQDTwLqkz+M2BKopZ@{B|DkaEYB+o|5V*|z%qM$eL(z6!bt%TCd;RF)Yd;(g^Yt)a z4g|ozyEg&&Px!(pK4B~ag^g$AD`v&i(S zGLUS>kd8wtI3a#(%Q74TuVudEz|UJmls5v=`snJM{t7f7Qze@xRI+difCQzekVL zNm`|I2&;6S=<$=Q=T=vdd4NvgAHs`tmX6Z}6i=PLc=k9lE2`gV?y%jPhL3xYO{sB3GSVoGlki=(Cy7t%)51 z%M0`b+GWB92nusLbn3zrkFTCLN^>ZD*jUlek9_V#E8}lLANx7LLHviJahN0A!@bx%gbK6*GoU)rF*<|$xF9; zsp7L-EZ4kp)k`a0>hUd`UfJVc_V|}Q{w0rp$>U%0_?JBXC69l}<6rXlmpuL@kAKPI zU-I~uJpLt*f63!t^7xlL{zZ>}(c@qA_!m9?MUQ{c<6rdn7d`$(kAKnQU-bAFJ^n?H zf6?P#^!TrzkJoNilq50!{RH43FPb={>ZI(4ufXsflubY^J?Oh%TrEku@qg<70h-6= AmjD0& diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon.woff b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/fonts/icomoon.woff deleted file mode 100755 index f17657986c6ab0ee65c0405db24b01ee22450025..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8400 zcmaiaV{|1v*zKupn^W`Do#NCuQ`>f@=G3-rPdmlbnA)~&d#3j7``!ERu61wL+AG;R zPo5+@|B|>XNJ=WGsww~gGEh{C1bL|zj={AK@NZd z06elMv=Ka17MeCoO$(F#;~S*Gy^7fI(qZIDbcO_+i0~L4k%;i&(55W|V`amYa1a!9 zK!or}=vre5Q_KVzQKfuTaxnt!P;!%<{@m%ech`FvZS<{&OZTpa&IhH%mA+M*i;l%r z8(vyW4*Ya#nbb4`Vt&)(X^nL3A?ka>7BAfvsSpR0pln4Ec{bkNl?}miN3B>c%yARA zkfV_L7<$K!@?ti1t}iSe8i-(N8NUWX8yQZfN<^?}qb7rME%IVwqgjq7-aYl%fWB$a zvIBQy$K=nt=8QaM)3KFOrZAt0rWz7k)~~~;^;qXjZT)sNS&1U$)M`nWsn*~J*$0`4 zVz}b45~&i};?felVu)FEdL2SWx#Z1c^EmH=gIFsoD-RdxF_$Q*P>Y}V;S%qrwI;kNcRqCxptRr?D}@xrXdEa8bWz0|X) zHlq*yfvkbdS#fpA-7L>6tW{Bi%<8yy{K`Nrw3WN=kM-o1hrPxADvsg7ml%Z%{w$hI zi!24rXH6Q7Z1k(&*m*V0|9Dc|RfPs-Vt6t#ZPZ8iYtFR`o*X^P9Wb+2` zpjK83OST^lPZkJ|P^SXQg#>u?^_0dz{o}2aZ|dbYhsC9lMD|BQ-Dry{?_A0py?&s{bW%TR4@63 zmeu33xB;JvWOR)zsQPrltdZC^V2ccz>(9Uv2`)H*eTLwyEho$d9E@Gx7F?& z9Q*jcB0U@aAR2s+4kMp}sczNE^3*<0kyohfFClFof(n6xW`r96IeUF@x}4$cJVSU` zPYzc#MWjmiew-ah0B958pRINiyCBKutiMIWrd2hC8o6+uOGE-Av3UJkjdzXNi=|kQ z)`qC`CU$lTqj;rjwEKj8V{nde&-3ZZ6O)*3?%2iA*pL)mx%>2jI-^|N5n1M}Jbv># zu$?f;NDYZK=jJ$QUlVu5$4Hn7OdsmB;A?))?DGC~(mvY*sX3kHx@6~J8*u}r>+jIo z#`HxTk?SBQfG$kILEqy6k`K`;S*`L4JH7H0vNfdd>R?>EA(5_gMC-27WI1KxJznDE z2;%Fcv*g4<<=j85Y`?GH;Vl$|d9u5;3HxSNXKk0P#E4~u>odt}SI!1?`b@*Dn^-NC zH!!lKLa#6H9yd~Rq5w}?Y7M16m|b(S(-S z2~b7nz`XjOjxPm|KXJ-OI1%styxHU94U>n4i!k}M)dMEc4qbafeOogm*_@Q}O>Rj7 zP!+ZEqb_^eSNIX*&Bp4{pO;-p_|6`NVM#3YAia%T0u_8sgE*kkjsh5ig+qz!Q92E~ ziKTBtI6ZV;j0Wt<7!{N|96FP*S-I-_xL5FHK*{=aQz0r-X-DOD)<3Ay$8O;5u*EXiOBpa-j1=33N3dK`h?T)H~;~a zUA}||^b&PbV6#+@#L_GOy6>D}$&ykNo2=x(a0wj!Rr{9;HG6nt^>@Oa?w4MrQ~uTh z0Vz0D2F2=RDc6?d^XZ)CW0j5j{2>$6(1tM4f^j^>dR2|ZDId7rLX{YGc>1+i{86ni z{v5t72V0*UerYD|K7ogZJfF88D=i6Wv3yOr9Dp|bFQ6TbyVSetvkCSMubeYN zdXef_Nm(dFbq0M!K{=?jQf^}LJ8$fVNcvUnG z39UoWfJlvKt1->qI2cZKxylmuM~Yc!3;TxWL(Ov+4flTJ^0Cjl4U{f&<~4dhVMTR7*)+fEHyH|tQG{I2&xd{DMv_6@~R7S;8M zf~w5mcMr;1s_j05#)C>dQ*^d4mfiCa36xrXm`uUTOvK2O>!woeJcuxj(lK0Wbco@S zatp-q<3D-mzGn@ht(%?ng+|RvWlYOAi6ez=hH?g(NQ;dG3v5s3PGhRoOpMGJXHQ3S zut=G&%c!)XvnA`b?Gwy)oH2g(0_G~_$4i6%UFiM6Di-lt>hGBzEGhzyPKbpcKKwCqijR`<&N%tuDPkd z#4p6qaIM?|q>n-cUpj;)H~~%)b?kN$?IzsbQm(l8Wqkl(%~!W=LQbAQ#IEupifpRP z7ZBvd>M9WWq8eI5_P5Wz7h=P009RBwU>EXF@I**U88(qPl$}1AGKSQ(_~?$@d~P{& zKC9}DnxD&LNgPEbYt$KLFyCeCl^|d7zB9Lr3`h7L%zI{L+{{ldiWij(yJR*Kc8HAa zKoeHZ^pn8*1z@7e{_R@+CKeLwUhBQu*xp>^&yC!bd3W0X#OuL0U5Q_k;3IFI@5 z_LxeeZj6ZtxTBmuh<_1GV9|IH->h2S^Uj>O66gy+xpY%#HRV&kDEz+9(S-qa9K4`9 zzdv)(7ypf@nJ9Os?Qv7et`~33lS!ssBz^}1g=BGUP`mv5(DIq;Xq+ws|5`Ob5 zGG}Y8_NnOyMgXz&@}hhnnM@!b)!JtPzjS-VT^`y)UyqT$c;cCdQxduOauY}4PFd?g z-dUboYVE`z^^|`&Q&&mBYF7>F7DhlF(-AxR84i!ztQ`&Ijuu~^%1+$yGb3U)lev;NeWW;czfifF1N)z+KFbJ z&ivqLQQ}H|G~{SF?0{f!Oc^+XOI76wD6cDS9VXODY=BFdNW~PDNHM=1nE7WgZQUFu zElPUWZWo9WRV}7Ja`#tuGSU}c><a$u4Ljcnfv7j-9L*oWLDFQJ@#lK*IlPP`R_lB@G|qgK4a| zY2{1~+s=HXc{eDw!OXD95uijIseD=z6^JDKbob5n`Wtq1UQ?!`QO@wY8*#$~m?gu|Btz1X=Xd-^TbBlvqPxE?@cDisHsos-L>ai|FKR7{!Ox^>PuvG}(`A z8eFZGd5=lP>^NXf^W5`Dy88fvQ|0}kF(uqy9bdC%IB~XW(U?z+I4aC>#^PHzam(BD z0Y9Y%lp9wC;4QO6ag(e%Wtk#SL9wDvO7`l=`$edw4++Qcz=A>5hGailhHhL-7gE%+ zm{u<*D%_VxSn}N>y_+1WXu%vIqYAOZt1vyPEb4(cIxJ#yh_`}ooaI`ZlJ#^pce7pIo? z?RyJ{nvK3lPEERL_UB4aE6i(t0ha8X6WEj;(dh*SQ_JVv3Ez2*lSw-hJFJ6tpIziKxA?gtNROB0>np|pp!bgw?GY>=16j&$xCS$~SpD#==MK?zwHv_qovUR& zlie^*J~;*f8|4oh?4%TJ*%|z=qy*yPAGskZEqdi!mM9cA8vlBTxLR}ugo_fR6xUI| zByd`c{aBa+hc%qps&iKCo>KyW+|G|6P1)~1s@1+;vqjTeLI0kLn1L_ndHA;dy4?iT zvMBSHuv<=Zt}zYPa5v4*4!ljV4$+T5N_xxRxS8143G4V}9G;aBvtstxwQ?)$j!Cc- z{!F1#6yzqr2hkM&zGFZCn%m92K2GbTj!xI_TfY4a*-fTClmpcfRwhB9u+U*Dsph@~ zLf0APt?)+BX}ipTWEmRSB6~;;jN*T$*X@@V^LN3?Rk4mOO17;Gd!s+8fWLf&Zg!KD#g^!xDB&t z3(1MclW5)FB_jyQ)Eo$h4?{sFfmWV0EYG@NK))*-jZ<-*8%x4Qa!e_3=mwrfYC#5P zZGAJ}s^adxc*3=))-J-AEzZn=3Vi`D8%s89nR%(oe&7}Qyr>h*r#%A~PkN4THBTnn zvqTAZ)@m(XkL$I#z;q@Q{D=$LRS+7vnh^Si>LTU$ikn6in)eHOq!_aze$45y)XOX~ z9HMZ`a`dyYwM3y-obu&`^zdk^yY(V^8I|S96me5ZBl*SY#+#*ifA*g*_kma#2}RJd z+`hzIS&VqY$*@UE%yjj2?3#Y5`g8n0$=?UL#Do@FP)?ur>v=fya~k472}(R>6J-@! z?Xvgl>h-pxXkaO;X}Nz}vUui<^sx7;t$(=PXwc43d}tD>G1D&hz3JCPto#_MRpSXD z;?Z2hbX{C^jND-qWliTQG8MbWzi2d5P73P9tsy8Gh;l(CWMCJyLPU>zJ;P3u8RoB`k$8%%;$f?uwH^Fl$ahY(bJ4oV>pa(yqdOZPjjg8~_D41pZ65X~ zLSw9tJ&fvIQEv#J;61JB#OU*~J9cou*B=^)3o_SMYGKoY_7edDRobw+ggtHO<8tI=L2i&7)k zD)@A1GKL$me0=#3+!OI2_z$jSNsM3EK+r}ckkb}Y<+Wx6vpz~()1GvFN>#TZQ9f;^ zHEXl-!#{F@69RQ!+M2Tf-fZv<1%6wdPg_6)0K2g*^rNU5Qo_7QuEGpFUD=T}w>2wa zuu!mUg0-wkXRLFoGzkQFY+l_dx(tFOT|~)>u0jcAVSO0;fnkYAHw^4KOWdzu+diAi znw{k3P`E+vb-^a1wXUw6=h)*=w7hwUm^ZUN<3MiRt(|;#^SiwT@3f9fX0~1Tm9rr! z+iCy%!sx`a58OF2?CRm;j#Qqq35Lx&seY0gFK-Bq?tPV{i@V(*(zY?YThE3Milj#x zg=OnMQvGqV7r7n_Hq!xI{={pg9#Dsdh4<+{XNg8m;Vmi|Lh8ZT%Pgj?Ij7bfT)?{m zaCipir6N&QLn!`G;WzEvBh^;Vc{?-kKVvYk2z>k33EWLN%CB-=>NrF@v#KN@cRFO< z`L^j{7A$H2OLq(8*vT~M$p)ZBMSNps`|3l3VZokV3MDaacB*OQQ=&ppU>+p&_LFjp zRQZi24Lp&05TD7=$DJHq(LGV0`q!D^>F`+SI3=`+0Gzu}fDc)#p!lXBA)LchcIQqu z!<+PH&QLhCmPTZ~cCRT24!x0&o3v3OBRWVg*duENOAWDphzY z?H(}L%^&Hme%n$VMDxW?NAVR0z2m$m643U|`6^V`#cql}d7S_Ds!c&`G10(O^b7ON zi9p$J5)ZjovS06ccd#RQbjD(47{YEinNf{6_9~H zNySOX?%&@q@X|W(A?j&jw}-oOh;mQEEAqDAwCy4akxi-fwIg{;cnf;Lg9A zj%XlTWv)=eSnw$Mu7?hzOgLL1a`p|;a?%D=#@r)KQ%sR6&n5t+hBw_dyQ*w4-W-!9 zCw<0AUHN=}HpJ_9JVk9SLaj5wQj~r)1YRGhQny`qhi|Q5Bd(ns#|SNcqrjJ)LUjlt{=3q? z2Xj6naL-ieot7&NgPR+$6VJwkfX#ulP0l>>mJpHPRLnZE8a92U+k2-l^V;U%UlK!x zW8)z%xvab!Zz4HdK~ID+Dw~^&bk3EIQcZ$*4Fjo{?rW#`Z(bqxOCcX0 zG#W`k@}61CkCScbhH^>=4g84gIm|!di#ta%qmb--qsWHB5L5QP#06W(UMA+x5y5|x z#y|y2MmVSxHx0ThfrxFfWIZdwk`p0@HrV!sWO)sNC99;qX$=9Y`LLzlWs)a(Y%L@m z1IWTE^zv{N{LYq1XnMdb4%LojZ86n?7>jUYdP)gHzRLZWoTCvrwUAWilq#1;wc>)f z2$X-wH!YGbk`DegsPXD3)ZKl>C(P6fUTkg$`V>~gg`_fh=l;I5nEE$FByQYR^eK~1 zd{&pVn4@r(dV!`4rc@D%hu^7oddhkqkja^mYe#zt$t{tzhD|Yj$*lGJ*;8z&Mv_sX zjt1Nj{Qhxd!XgddvKYS4#hAuU>!mkR{hFj*Aj3^u9EX_AQ=qAf;hgm!r;)NmIC@Or z(A<<5%9B7a*&W$OpLu_BB>VRog-vT+0I8%fH51HC=_I+ge{sFoQa;oX z&mAN0BDBjQeD!|TzNIGQy$M7M`*(+mT`gb{jzb&e7cZMx|L4{Zfgew zD*Ve5L@>bD;Z&(mF4u~5Q8c}hC=t_X@TufGi<+1#KDaR@lgPGaGqgrTFkrc5La?n@ zs4swcps;=(bvdv+Pp=5?cqoiKI5%zMef$xTt4bn^+bl zKEfeivD+T77iJsytDy?h*mgN^>TKB(TwNSmKg=6kUOngktigwl4hc6=?n-^5)J}TN-z8z^e z(Fbt!tu33r>;^w#rz+;C73URdn3JT3bqv$g@~m7bw{j|tJvY2g>B?ZUYHvU)rhQ(# zg{vF7Htxc-2N~(G8B^hNYW$;n^6ybN@J{=-WxS7(OX2hqe}5xmQgYm!Bkz>tESKpL z=`-=9B($`@&S&yPVVR72Q%b#Wvmq}w?-ZiG91n_qCZdi#ppb$rB0%N8D>Vj3^;-D4 zM#U<3ogdZH!Kp1F--iXv;n~X@ zG!yXQ%ah%w8)0}(Yum_iUPBn&Qz^!^(*C+*4`@x5{eaOfD{uIGIQ7UjF*GzZ1q3GL zJcW`!XKOc-MZ*FFj$rKmcb}=D;Wm^p0xY_ru_3gmGr2j$4L$(26kz>-#+n-&W_Ndw zcK00jr4M#@Z=;rU0i}TrY;0`oH9(H;06^dfdi-H#@AkF-4iwa0&<7g+Ej}3=9p`66 zFAg1mf(n2xicI#oj)T}Rj9x`#u`OEAaqyBtTfp z3qECgarA;rZYF^mrFMG|nvo@e@F9U$R#P4X&u?8`=iT7|!LLoWn)SvbfqWc4AHU&q z7!QL;1zTM#=L%(l__@keujy0@r2_=`>SVV^sY=9A-Ag?E6D)`y{r<^$pp8@nkA|oP0fcOJ?Ai}ZU{rnje4gDd6$b)s=(&GUl5P)4+*q%?L0iRFly#JktYpjShqzJmi*0Cjg!nSOkt*#kI z-#E0mZWP>bZ-+Doav4h1Ass~A_N>W1fKT)?;YyPTj~n~#^r8A01^JO?=LcpkKB0U6 z)u7&>H$my_)S#gLBl{)zBZ)&MucW<6MdLDjE4po*K3e63c8`>bWzgrOi?b5JRxN;p z^Q;C%IWUrN@)G9jEB<5wG8q|kKzxu40~1eAV&{y5e`l1KFoiKNSOWkz C+YCGa diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/img/loader.gif b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/img/loader.gif deleted file mode 100755 index 15c045ae8240810442bad3a920489021151837b9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2569 zcmdVbjZ@S29S86{{X#;>BR|LkN%?_5S$UA5BCc!)`Go+PKq8dJrR{(p2|uv5F^!Ig zZNdN{KC~>5q0o9f+88VYv^FRdA~7Ihg%EA1k%$K5I%}QlIAzR7m&AG+uQs5`=_U;S65e!Mx(>wSYBRENJxl?h>%L9R;yL5R_pcpyu7@%wKWt)#bU9| zW{Z!HPft%@Uth<3moH?Ul9ig91E)w+<74CSSnsTmrv$Pu2Es&d%-#4VhPa;Gs807I z5o>Yit|5qTHEPjBsPAQl^5X5Sn4FTrs+c`Pt{*?2lp8&z+PZc&zlQV3{O<3_Q5>jT zUR(+O%vVN!lTVT-Jj^T?tEr!3 zNVvZntyaYCd|zh?>=kSx>b{f?#1-Fes1s5P$C%3P_j;Y~Kd7MRC^GWiGR4U63?}r@LcYv8$qf4ikDc#t_nF}|HF2g-6#CF4(Up$= zedILSctew`U6;4yIqny`R3^w6?7rgvgOvZUME@<&{(Y& zin9L8m$=B5dxz*mjG3F#StP8ZkPe@I)_3+lG^!T#okF}u&2_kX9PeZ8nl{|gCFRiN9YBCq1)kyZFd+?I7Y^B|$I<9{fjS zdm~ARVK+4Vv kBcy=`!ihy|KvSh7Y)f1}E1o^3$N&HU diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/img/object.gif b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/img/object.gif deleted file mode 100755 index cccd7f023fb80908cb33bb7d9604236cd21b7ae7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 152 zcmV;J0B8S4Nk%w1VG#fg0J9GO<>lo+KR<78Z?v?uS65g4{r%Y3*xlXT%F4>`@9+2b z_ww@cot>Tk|Nk>HGXMYpA^8LW000jFEC2ui01*HU000C<(8)=wd#<&tyXIMjHBV`d zBSi|xsj3(;nD0kQ0aJq8eLH~x02P|t2!_J&Wqb%0io?#xD.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#9e9e9e;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.mce-floatpanel.mce-popover.mce-bottom.mce-start{margin-left:-22px}.mce-floatpanel.mce-popover.mce-bottom.mce-start>.mce-arrow{left:20px}.mce-floatpanel.mce-popover.mce-bottom.mce-end{margin-left:22px}.mce-floatpanel.mce-popover.mce-bottom.mce-end>.mce-arrow{right:10px;left:auto}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;background:#fff;height:100%}div.mce-fullscreen{position:fixed;top:0;left:0}#mce-modal-block{opacity:0;filter:alpha(opacity=0);zoom:1;position:fixed;left:0;top:0;width:100%;height:100%;background:#000}#mce-modal-block.mce-in{opacity:.3;filter:alpha(opacity=30);zoom:1}.mce-window-move{cursor:move}.mce-window{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;background:#fff;position:fixed;top:0;left:0;opacity:0;-webkit-transition:opacity 150ms ease-in;transition:opacity 150ms ease-in}.mce-window.mce-in{opacity:1}.mce-window-head{padding:9px 15px;border-bottom:1px solid #ddd;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:bold;line-height:20px;color:#999;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#bbb}.mce-window-head .mce-title{line-height:20px;font-size:20px;font-weight:bold;text-rendering:optimizelegibility;padding-right:10px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:#fff;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.mce-window-head .mce-dragh{position:absolute;top:0;left:0;cursor:move;width:90%;height:100%}.mce-window iframe{width:100%;height:100%}.mce-window.mce-fullscreen,.mce-window.mce-fullscreen .mce-foot{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-rtl .mce-window-head .mce-close{position:absolute;right:auto;left:15px}.mce-rtl .mce-window-head .mce-dragh{left:auto;right:0}.mce-rtl .mce-window-head .mce-title{direction:rtl;text-align:right}.mce-abs-layout{position:relative}body .mce-abs-layout-item,.mce-abs-end{position:absolute}.mce-abs-end{width:1px;height:1px}.mce-container-body.mce-abs-layout{overflow:hidden}.mce-tooltip{position:absolute;padding:5px;opacity:.8;filter:alpha(opacity=80);zoom:1}.mce-tooltip-inner{font-size:11px;background-color:#000;color:#fff;max-width:200px;padding:5px 8px 4px 8px;text-align:center;white-space:normal}.mce-tooltip-inner{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-tooltip-inner{-webkit-box-shadow:0 0 5px #000000;-moz-box-shadow:0 0 5px #000000;box-shadow:0 0 5px #000000}.mce-tooltip-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.mce-tooltip-arrow-n{border-bottom-color:#000}.mce-tooltip-arrow-s{border-top-color:#000}.mce-tooltip-arrow-e{border-left-color:#000}.mce-tooltip-arrow-w{border-right-color:#000}.mce-tooltip-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-n .mce-tooltip-arrow{top:0px;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-s .mce-tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-e .mce-tooltip-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:none;border-top-color:transparent;border-bottom-color:transparent}.mce-tooltip-w .mce-tooltip-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}.mce-btn{border:1px solid #eef1f5;border-color:#cad6e3 #cad6e3 #cad6e3 #cad6e3;position:relative;text-shadow:0 1px 1px rgba(255,255,255,0.75);display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);background-color:#d0d7df}.mce-btn:hover,.mce-btn:focus{color:#626b73;background-color:#c1cad5}.mce-btn.mce-disabled button,.mce-btn.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{background-color:#b2beca;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-btn:not(.mce-disabled):active{background-color:#b2beca;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-btn button{padding:4px 10px;font-size:14px;line-height:20px;*line-height:16px;cursor:pointer;color:#626b73;text-align:center;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px #eee}.mce-primary{min-width:50px;color:#fff;border:1px solid #eef1f5;border-color:#cad6e3 #cad6e3 #cad6e3 #cad6e3;background-color:#0499dc}.mce-primary:hover,.mce-primary:focus{background-color:#0388c3}.mce-primary.mce-disabled button,.mce-primary.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-primary.mce-active,.mce-primary.mce-active:hover,.mce-primary:not(.mce-disabled):active{background-color:#0376a9;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-primary button,.mce-primary button i{color:#fff;text-shadow:1px 1px #333}.mce-btn-large button{padding:9px 14px;font-size:16px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.mce-btn-large i{margin-top:2px}.mce-btn-small button{padding:3px 5px;font-size:12px;line-height:15px}.mce-btn-small i{margin-top:0}.mce-btn .mce-caret{margin-top:8px;*margin-top:6px;margin-left:0}.mce-btn-small .mce-caret{margin-top:6px;*margin-top:4px;margin-left:0}.mce-caret{display:inline-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #626b73;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#aaa}.mce-caret.mce-up{border-bottom:4px solid #626b73;border-top:0}.mce-rtl .mce-btn button{direction:rtl}.mce-btn-group .mce-btn{border-width:1px 0 1px 0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-btn-group .mce-first{border-left:1px solid #eef1f5;border-left:1px solid #cad6e3;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.mce-btn-group .mce-last{border-right:1px solid #eef1f5;border-right:1px solid #cad6e3;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.mce-btn-group .mce-first.mce-last{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-btn-group .mce-btn.mce-flow-layout-item{margin:0}.mce-checkbox{cursor:pointer}i.mce-i-checkbox{margin:0 3px 0 0;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);background-color:#d0d7df;text-indent:-10em;*font-size:0;*line-height:0;*text-indent:0;overflow:hidden}.mce-checked i.mce-i-checkbox{color:#626b73;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox,.mce-checkbox.mce-focus i.mce-i-checkbox{border:1px solid #59a5e1;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(89, 165, 225, 0.85);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(89, 165, 225, 0.85);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(89, 165, 225, 0.85)}.mce-checkbox.mce-disabled .mce-label,.mce-checkbox.mce-disabled i.mce-i-checkbox{color:#bababa}.mce-rtl .mce-checkbox{direction:rtl;text-align:right}.mce-rtl i.mce-i-checkbox{margin:0 0 0 3px}.mce-colorbutton .mce-ico{position:relative}.mce-colorbutton-grid{margin:4px}.mce-colorbutton button{padding-right:4px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-14px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-17px;padding-right:0;width:16px}.mce-colorbutton .mce-open{padding-left:4px;border-left:1px solid transparent;border-right:1px solid transparent}.mce-colorbutton:hover .mce-open{border-left-color:#cad6e3;border-right-color:#cad6e3}.mce-rtl .mce-colorbutton{direction:rtl}.mce-rtl .mce-colorbutton .mce-preview{margin-left:0;padding-right:0;padding-left:3px;margin-right:-14px}.mce-rtl .mce-colorbutton.mce-btn-small .mce-preview{margin-left:0;padding-right:0;margin-right:-17px;padding-left:0}.mce-rtl .mce-colorbutton button{padding-right:10px;padding-left:10px}.mce-rtl .mce-colorbutton .mce-open{padding-left:4px;padding-right:4px}.mce-combobox{display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);*height:32px}.mce-combobox input{border:1px solid #c5c5c5;border-right-color:#c5c5c5;height:28px}.mce-combobox.mce-disabled input{color:#bbb}.mce-combobox.mce-has-open input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.mce-combobox .mce-btn{border-left:0;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.mce-combobox button{padding-right:8px;padding-left:8px}.mce-combobox.mce-disabled .mce-btn button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-path{display:inline-block;*display:inline;*zoom:1;padding:8px;white-space:normal}.mce-path .mce-txt{display:inline-block;padding-right:3px}.mce-path .mce-path-body{display:inline-block}.mce-path-item{display:inline-block;*display:inline;*zoom:1;cursor:pointer;color:#555}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:#666;color:#fff}.mce-path .mce-divider{display:inline}.mce-disabled .mce-path-item{color:#aaa}.mce-rtl .mce-path{direction:rtl}.mce-fieldset{border:0 solid #9E9E9E;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-fieldset>.mce-container-body{margin-top:-15px}.mce-fieldset-title{margin-left:5px;padding:0 5px 0 5px}.mce-fit-layout{display:inline-block;*display:inline;*zoom:1}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;*display:inline;*zoom:1}.mce-flow-layout-item{margin:2px 0 2px 2px}.mce-flow-layout-item.mce-last{margin-right:2px}.mce-flow-layout{white-space:normal}.mce-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-rtl .mce-flow-layout{text-align:right;direction:rtl}.mce-rtl .mce-flow-layout-item{margin:2px 2px 2px 0}.mce-rtl .mce-flow-layout-item.mce-last{margin-left:2px}.mce-iframe{border:0 solid #9e9e9e;width:100%;height:100%}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);border:0;overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label.mce-disabled{color:#aaa}.mce-label.mce-multiline{white-space:pre-wrap}.mce-rtl .mce-label{text-align:right;direction:rtl}.mce-menubar .mce-menubtn{border-color:transparent;background:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-menubar{border:1px solid #c4c4c4}.mce-menubar .mce-menubtn button span{color:#555}.mce-menubar .mce-caret{border-top-color:#555}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:transparent;background:#a9bcd1;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-menubtn.mce-disabled span{color:#aaa}.mce-menubtn span{color:#626b73;margin-right:2px;line-height:20px;*line-height:16px}.mce-menubtn.mce-btn-small span{font-size:12px;line-height:15px;*line-height:16px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn.mce-fixed-width.mce-btn-small span{width:70px}.mce-rtl .mce-menubtn button{direction:rtl;text-align:right}.mce-listbox button{text-align:left;padding-right:20px;position:relative}.mce-listbox .mce-caret{position:absolute;margin-top:-2px;right:8px;top:50%}.mce-rtl .mce-listbox .mce-caret{right:auto;left:8px}.mce-rtl .mce-listbox button{padding-right:10px;padding-left:20px}.mce-menu-item{display:block;padding:6px 15px 6px 12px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item .mce-ico,.mce-menu-item .mce-text{color:#333}.mce-menu-item.mce-disabled .mce-text,.mce-menu-item.mce-disabled .mce-ico{color:#adadad}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text{color:#fff}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:#fff}.mce-menu-item.mce-disabled:hover{background:#ccc}.mce-menu-shortcut{display:inline-block;color:#adadad}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 15px 0 20px}.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item.mce-selected .mce-menu-shortcut,.mce-menu-item:focus .mce-menu-shortcut{color:#fff}.mce-menu-item .mce-caret{margin-top:4px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #333}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret,.mce-menu-item:hover .mce-caret{border-left-color:#fff}.mce-menu-align .mce-menu-shortcut{*margin-top:-2px}.mce-menu-align .mce-menu-shortcut,.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item-normal.mce-active{background-color:#c8def4}.mce-menu-item-preview.mce-active{border-left:5px solid #aaa}.mce-menu-item-normal.mce-active .mce-text{color:#333}.mce-menu-item-normal.mce-active:hover .mce-text,.mce-menu-item-normal.mce-active:hover .mce-ico{color:#fff}.mce-menu-item:hover,.mce-menu-item.mce-selected,.mce-menu-item:focus{text-decoration:none;color:#fff;background-color:#0081c2}div.mce-menu .mce-menu-item-sep,.mce-menu-item-sep:hover{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#cbcbcb;border-bottom:1px solid #fff;cursor:default;filter:none}.mce-rtl .mce-menu-item{text-align:right;direction:rtl;padding:6px 12px 6px 15px}.mce-menu-align.mce-rtl .mce-menu-shortcut,.mce-menu-align.mce-rtl .mce-caret{right:auto;left:0}.mce-rtl .mce-menu-item .mce-caret{margin-left:6px;margin-right:0;border-right:4px solid #333;border-left:0}.mce-rtl .mce-menu-item.mce-selected .mce-caret,.mce-rtl .mce-menu-item:focus .mce-caret,.mce-rtl .mce-menu-item:hover .mce-caret{border-left-color:transparent;border-right-color:#fff}.mce-menu{position:absolute;left:0;top:0;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;z-index:1000;padding:5px 0 5px 0;margin:2px 0 0;min-width:160px;background:#fff;border:1px solid #989898;border:1px solid rgba(0,0,0,0.2);z-index:1002;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);max-height:400px;overflow:auto;overflow-x:hidden}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline}.mce-menu-sub-tr-tl{margin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#555}.mce-spacer{visibility:hidden}.mce-splitbtn .mce-open{border-left:1px solid transparent;border-right:1px solid transparent}.mce-splitbtn:hover .mce-open{border-left-color:#cad6e3;border-right-color:#cad6e3}.mce-splitbtn button{padding-right:4px}.mce-splitbtn .mce-open{padding-left:4px}.mce-splitbtn .mce-open.mce-active{-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-rtl .mce-splitbtn{direction:rtl;text-align:right}.mce-rtl .mce-splitbtn button{padding-right:10px;padding-left:10px}.mce-rtl .mce-splitbtn .mce-open{padding-left:4px;padding-right:4px}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #c5c5c5}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #c5c5c5;border-width:0 1px 0 0;background:#e5ecf3;padding:8px;text-shadow:0 1px 1px rgba(255,255,255,0.75);height:13px;cursor:pointer}.mce-tab:hover{background:#fdfdfd}.mce-tab.mce-active{background:#fdfdfd;border-bottom-color:transparent;margin-bottom:-1px;height:14px}.mce-rtl .mce-tabs{text-align:right;direction:rtl}.mce-rtl .mce-tab{border-width:0 0 0 1px}.mce-textbox{background:#fff;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);display:inline-block;-webkit-transition:border linear .2s, box-shadow linear .2s;transition:border linear .2s, box-shadow linear .2s;height:28px;resize:none;padding:0 4px 0 4px;white-space:pre-wrap;*white-space:pre;color:#555}.mce-textbox:focus,.mce-textbox.mce-focus{border-color:#59a5e1;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(89, 165, 225, 0.85);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(89, 165, 225, 0.85);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(89, 165, 225, 0.85)}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.mce-textbox.mce-disabled{color:#bbb}.mce-rtl .mce-textbox{text-align:right;direction:rtl}.mce-throbber{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.6;filter:alpha(opacity=60);zoom:1;background:#fff url('img/loader.gif') no-repeat center center}@font-face{font-family:'icomoon';src:url('fonts/icomoon.eot');src:url('fonts/icomoon.eot?#iefix') format('embedded-opentype'),url('fonts/icomoon.svg#icomoon') format('svg'),url('fonts/icomoon.woff') format('woff'),url('fonts/icomoon.ttf') format('truetype');font-weight:normal;font-style:normal}@font-face{font-family:'icomoon-small';src:url('fonts/icomoon-small.eot');src:url('fonts/icomoon-small.eot?#iefix') format('embedded-opentype'),url('fonts/icomoon-small.svg#icomoon') format('svg'),url('fonts/icomoon-small.woff') format('woff'),url('fonts/icomoon-small.ttf') format('truetype');font-weight:normal;font-style:normal}.mce-ico{font-family:'icomoon';font-style:normal;font-weight:normal;font-size:16px;line-height:16px;vertical-align:text-top;-webkit-font-smoothing:antialiased;display:inline-block;background:transparent center center;width:16px;height:16px;color:#626b73;-ie7-icon:' '}.mce-btn-small .mce-ico{font-family:'icomoon-small'}.mce-ico,i.mce-i-checkbox{zoom:expression(this.runtimeStyle['zoom'] = '1', this.innerHTML = this.currentStyle['-ie7-icon'].substr(1, 1) + ' ')}.mce-i-save{-ie7-icon:"\e000"}.mce-i-newdocument{-ie7-icon:"\e001"}.mce-i-fullpage{-ie7-icon:"\e002"}.mce-i-alignleft{-ie7-icon:"\e003"}.mce-i-aligncenter{-ie7-icon:"\e004"}.mce-i-alignright{-ie7-icon:"\e005"}.mce-i-alignjustify{-ie7-icon:"\e006"}.mce-i-cut{-ie7-icon:"\e007"}.mce-i-paste{-ie7-icon:"\e008"}.mce-i-searchreplace{-ie7-icon:"\e009"}.mce-i-bullist{-ie7-icon:"\e00a"}.mce-i-numlist{-ie7-icon:"\e00b"}.mce-i-indent{-ie7-icon:"\e00c"}.mce-i-outdent{-ie7-icon:"\e00d"}.mce-i-blockquote{-ie7-icon:"\e00e"}.mce-i-undo{-ie7-icon:"\e00f"}.mce-i-redo{-ie7-icon:"\e010"}.mce-i-link{-ie7-icon:"\e011"}.mce-i-unlink{-ie7-icon:"\e012"}.mce-i-anchor{-ie7-icon:"\e013"}.mce-i-image{-ie7-icon:"\e014"}.mce-i-media{-ie7-icon:"\e015"}.mce-i-help{-ie7-icon:"\e016"}.mce-i-code{-ie7-icon:"\e017"}.mce-i-inserttime{-ie7-icon:"\e018"}.mce-i-preview{-ie7-icon:"\e019"}.mce-i-forecolor{-ie7-icon:"\e01a"}.mce-i-backcolor{-ie7-icon:"\e01a"}.mce-i-table{-ie7-icon:"\e01b"}.mce-i-hr{-ie7-icon:"\e01c"}.mce-i-removeformat{-ie7-icon:"\e01d"}.mce-i-subscript{-ie7-icon:"\e01e"}.mce-i-superscript{-ie7-icon:"\e01f"}.mce-i-charmap{-ie7-icon:"\e020"}.mce-i-emoticons{-ie7-icon:"\e021"}.mce-i-print{-ie7-icon:"\e022"}.mce-i-fullscreen{-ie7-icon:"\e023"}.mce-i-spellchecker{-ie7-icon:"\e024"}.mce-i-nonbreaking{-ie7-icon:"\e025"}.mce-i-template{-ie7-icon:"\e026"}.mce-i-pagebreak{-ie7-icon:"\e027"}.mce-i-restoredraft{-ie7-icon:"\e028"}.mce-i-untitled{-ie7-icon:"\e029"}.mce-i-bold{-ie7-icon:"\e02a"}.mce-i-italic{-ie7-icon:"\e02b"}.mce-i-underline{-ie7-icon:"\e02c"}.mce-i-strikethrough{-ie7-icon:"\e02d"}.mce-i-visualchars{-ie7-icon:"\e02e"}.mce-i-ltr{-ie7-icon:"\e02f"}.mce-i-rtl{-ie7-icon:"\e030"}.mce-i-copy{-ie7-icon:"\e031"}.mce-i-resize{-ie7-icon:"\e032"}.mce-i-browse{-ie7-icon:"\e034"}.mce-i-checkbox,.mce-i-selected{-ie7-icon:"\e033"}.mce-i-selected{visibility:hidden}.mce-i-backcolor{background:#BBB} \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/skin.json b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/skin.json deleted file mode 100755 index 77915918547d..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/skin.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "skin-name": "studio-tmce4", - "preview-bg": "#eeeeee", - "text": "#555555", - "text-inverse": "#ffffff", - "text-disabled": "#aaaaaa", - "has-gradients": false, - "has-radius": true, - "has-boxshadow": true, - "btn-text": "#626b73", - "btn-text-shadow": "#eeeeee", - "btn-bg": "#cad6e3", - "btn-bg-hlight": "#d9d9d9", - "btn-border-top": "#cad6e3", - "btn-border-right": "#cad6e3", - "btn-border-bottom": "rgba(202,214,227,1)", - "btn-border-left": "#cad6e3", - "btn-split-border": "#cad6e3", - "btn-primary-text": "#ffffff", - "btn-primary-text-shadow": "#333333", - "btn-primary-bg": "#009fe6", - "btn-primary-bg-hlight": "#0990cc", - "menu-bg": "#ffffff", - "menu-border": "rgba(0,0,0,0.2)", - "menuitem-text": "#333333", - "menuitem-bg-selected": "#0088cc", - "menuitem-bg-selected-hlight": "#0077b3", - "menuitem-separator-top": "#cbcbcb", - "menuitem-separator-bottom": "#ffffff", - "menuitem-text-inverse": "#ffffff", - "menuitem-bg-active": "#c8def4", - "menuitem-text-active": "#333333", - "menuitem-preview-border-active": "#aaaaaa", - "checkbox-border": "#c5c5c5", - "checkbox-border-focus": "#59a5e1", - "panel-border": "#9e9e9e", - "panel-bg": "#fdfdfd", - "panel-bg-hlight": "#dddddd", - "textbox-bg": "#ffffff", - "textbox-border": "#c5c5c5", - "textbox-border-focus": "#59a5e1", - "window-bg": "#ffffff", - "window-border": "#dddddd", - "tab-bg": "#e5ecf3", - "tab-bg-hover": "#fdfdfd", - "tab-bg-active": "#fdfdfd", - "tab-border": "#c5c5c5", - "colorbtn-backcolor-bg": "#bbbbbb", - "grid-border": "#d6d6d6", - "grid-border-active": "#a1a1a1" -} \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/skin.min.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/skin.min.css deleted file mode 100755 index 8f199d2c065e..000000000000 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/skin.min.css +++ /dev/null @@ -1 +0,0 @@ -.mce-container,.mce-container *,.mce-widget,.mce-widget *{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:#555;font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;-webkit-tap-highlight-color:transparent;line-height:normal;font-weight:normal;text-align:left;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr}.mce-widget button{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.mce-container *[unselectable]{-moz-user-select:none;-webkit-user-select:none;-o-user-select:none;user-select:none}.mce-container ::-webkit-scrollbar{width:8px;height:8px;-webkit-border-radius:4px}.mce-container ::-webkit-scrollbar-track,.mce-container ::-webkit-scrollbar-track-piece{background-color:transparent}.mce-container ::-webkit-scrollbar-thumb{background-color:rgba(53,57,71,0.3);width:6px;height:6px;-webkit-border-radius:4px}.mce-fade{opacity:0;-webkit-transition:opacity .15s linear;transition:opacity .15s linear}.mce-fade.mce-in{opacity:1}.mce-tinymce{visibility:visible !important;position:relative}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;-webkit-border-radius:2px;-moz-border-radius:2px;border-radius:2px}.mce-wordcount{position:absolute;top:0;right:0;padding:8px}div.mce-edit-area{background:#FFF;filter:none}.mce-statusbar{position:relative}.mce-statusbar .mce-container-body{position:relative}.mce-fullscreen .mce-resizehandle{display:none}.mce-charmap{border-collapse:collapse}.mce-charmap td{cursor:default;border:1px solid #9e9e9e;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:middle;padding:2px}.mce-charmap td div{text-align:center}.mce-charmap td:hover{background:#d9d9d9}.mce-grid td div{border:1px solid #d6d6d6;width:12px;height:12px;margin:2px;cursor:pointer}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover{border-color:#a1a1a1}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#d6d6d6;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#a1a1a1;background:#c8def4}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-rtl .mce-wordcount{left:0;right:auto}.mce-container,.mce-container-body{display:block}.mce-autoscroll{overflow:hidden}.mce-scrollbar{position:absolute;width:7px;height:100%;top:2px;right:2px;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-scrollbar-h{top:auto;right:auto;left:2px;bottom:2px;width:100%;height:7px}.mce-scrollbar-thumb{position:absolute;background-color:#000;border:1px solid #888;border-color:rgba(85,85,85,0.6);width:5px;height:100%;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scrollbar-h .mce-scrollbar-thumb{width:100%;height:5px}.mce-scrollbar:hover,.mce-scrollbar.mce-active{background-color:#AAA;opacity:.6;filter:alpha(opacity=60);zoom:1;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px}.mce-scroll{position:relative}.mce-panel{border:0 solid #9e9e9e;background-color:#f0f0f0}.mce-floatpanel{position:absolute;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2)}.mce-floatpanel.mce-fixed{position:fixed}.mce-floatpanel .mce-arrow,.mce-floatpanel .mce-arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.mce-floatpanel .mce-arrow{border-width:11px}.mce-floatpanel .mce-arrow:after{border-width:10px;content:""}.mce-floatpanel.mce-popover{filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);top:0;left:0;background:#fff;border:1px solid #9e9e9e;border:1px solid rgba(0,0,0,0.25)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px;*margin-top:0}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#9e9e9e;border-bottom-color:rgba(0,0,0,0.25);top:-11px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow:after{top:1px;margin-left:-10px;border-top-width:0;border-bottom-color:#fff}.mce-floatpanel.mce-popover.mce-bottom.mce-start{margin-left:-22px}.mce-floatpanel.mce-popover.mce-bottom.mce-start>.mce-arrow{left:20px}.mce-floatpanel.mce-popover.mce-bottom.mce-end{margin-left:22px}.mce-floatpanel.mce-popover.mce-bottom.mce-end>.mce-arrow{right:10px;left:auto}.mce-fullscreen{border:0;padding:0;margin:0;overflow:hidden;background:#fff;height:100%}div.mce-fullscreen{position:fixed;top:0;left:0}#mce-modal-block{opacity:0;filter:alpha(opacity=0);zoom:1;position:fixed;left:0;top:0;width:100%;height:100%;background:#000}#mce-modal-block.mce-in{opacity:.3;filter:alpha(opacity=30);zoom:1}.mce-window-move{cursor:move}.mce-window{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);-moz-box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);box-shadow:0 3px 7px rgba(0, 0, 0, 0.3);filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;background:#fff;position:fixed;top:0;left:0;opacity:0;-webkit-transition:opacity 150ms ease-in;transition:opacity 150ms ease-in}.mce-window.mce-in{opacity:1}.mce-window-head{padding:9px 15px;border-bottom:1px solid #ddd;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:bold;line-height:20px;color:#999;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#bbb}.mce-window-head .mce-title{line-height:20px;font-size:20px;font-weight:bold;text-rendering:optimizelegibility;padding-right:10px}.mce-window .mce-container-body{display:block}.mce-foot{display:block;background-color:#fff;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.mce-window-head .mce-dragh{position:absolute;top:0;left:0;cursor:move;width:90%;height:100%}.mce-window iframe{width:100%;height:100%}.mce-window.mce-fullscreen,.mce-window.mce-fullscreen .mce-foot{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-rtl .mce-window-head .mce-close{position:absolute;right:auto;left:15px}.mce-rtl .mce-window-head .mce-dragh{left:auto;right:0}.mce-rtl .mce-window-head .mce-title{direction:rtl;text-align:right}.mce-abs-layout{position:relative}body .mce-abs-layout-item,.mce-abs-end{position:absolute}.mce-abs-end{width:1px;height:1px}.mce-container-body.mce-abs-layout{overflow:hidden}.mce-tooltip{position:absolute;padding:5px;opacity:.8;filter:alpha(opacity=80);zoom:1}.mce-tooltip-inner{font-size:11px;background-color:#000;color:#fff;max-width:200px;padding:5px 8px 4px 8px;text-align:center;white-space:normal}.mce-tooltip-inner{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-tooltip-inner{-webkit-box-shadow:0 0 5px #000000;-moz-box-shadow:0 0 5px #000000;box-shadow:0 0 5px #000000}.mce-tooltip-arrow{position:absolute;width:0;height:0;line-height:0;border:5px dashed #000}.mce-tooltip-arrow-n{border-bottom-color:#000}.mce-tooltip-arrow-s{border-top-color:#000}.mce-tooltip-arrow-e{border-left-color:#000}.mce-tooltip-arrow-w{border-right-color:#000}.mce-tooltip-nw,.mce-tooltip-sw{margin-left:-14px}.mce-tooltip-n .mce-tooltip-arrow{top:0px;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-s .mce-tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:none;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-e .mce-tooltip-arrow{right:0;top:50%;margin-top:-5px;border-left-style:solid;border-right:none;border-top-color:transparent;border-bottom-color:transparent}.mce-tooltip-w .mce-tooltip-arrow{left:0;top:50%;margin-top:-5px;border-right-style:solid;border-left:none;border-top-color:transparent;border-bottom-color:transparent}.mce-btn{border:0;position:relative;text-shadow:0 1px 1px rgba(255,255,255,0.75);display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;background-color:transparent}.mce-btn:hover,.mce-btn:focus{color:#626b73;background-color:#c1cad5}.mce-btn.mce-disabled button,.mce-btn.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{background-color:#b2beca;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-btn:not(.mce-disabled):active{background-color:#b2beca;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-btn button{padding:4px 8px;font-size:14px;line-height:20px;*line-height:16px;cursor:pointer;color:#626b73;text-align:center;overflow:visible;-webkit-appearance:none}.mce-btn button:active{border: none !important;}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px #eee;font-size:.9em;text-align:center}.mce-primary{min-width:50px;color:#fff;border:1px solid #007FB8;background-color:#009FE6;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0));}.mce-primary:hover,.mce-primary:focus{background-color:#0388c3}.mce-primary.mce-disabled button,.mce-primary.mce-disabled:hover button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-primary.mce-active,.mce-primary.mce-active:hover,.mce-primary:not(.mce-disabled):active{background-color:#0376a9;-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-primary button,.mce-primary button i{color:#fff;text-transform:uppercase;}.mce-btn-large button{padding:9px 14px;font-size:16px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.mce-btn-large i{margin-top:2px}.mce-btn-small button{padding:3px 5px;font-size:12px;line-height:15px}.mce-btn-small i{margin-top:0}.mce-btn .mce-caret{margin-top:8px;*margin-top:6px;margin-left:0}.mce-btn-small .mce-caret{margin-top:6px;*margin-top:4px;margin-left:0}.mce-caret{display:inline-block;*display:inline;*zoom:1;width:0;height:0;vertical-align:top;border-top:4px solid #626b73;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#aaa}.mce-caret.mce-up{border-bottom:4px solid #626b73;border-top:0}.mce-rtl .mce-btn button{direction:rtl}.mce-btn-group .mce-btn{border-width:0;margin:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.mce-btn-group .mce-first{border-left:1px solid #eef1f5;border-left:0;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.mce-btn-group .mce-last{border-right:0;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.mce-btn-group .mce-first.mce-last{-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-btn-group .mce-btn.mce-flow-layout-item{margin:0}.mce-checkbox{cursor:pointer}i.mce-i-checkbox{margin:0 3px 0 0;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.05);background-color:#d0d7df;text-indent:-10em;*font-size:0;*line-height:0;*text-indent:0;overflow:hidden}.mce-checked i.mce-i-checkbox{color:#626b73;font-size:16px;line-height:16px;text-indent:0}.mce-checkbox:focus i.mce-i-checkbox,.mce-checkbox.mce-focus i.mce-i-checkbox{border:1px solid #59a5e1;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(89, 165, 225, 0.85);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(89, 165, 225, 0.85);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(89, 165, 225, 0.85)}.mce-checkbox.mce-disabled .mce-label,.mce-checkbox.mce-disabled i.mce-i-checkbox{color:#bababa}.mce-rtl .mce-checkbox{direction:rtl;text-align:right}.mce-rtl i.mce-i-checkbox{margin:0 0 0 3px}.mce-colorbutton .mce-ico{position:relative}.mce-colorbutton-grid{margin:4px}.mce-colorbutton button{padding-right:4px}.mce-colorbutton .mce-preview{padding-right:3px;display:block;position:absolute;left:50%;top:50%;margin-left:-14px;margin-top:7px;background:gray;width:13px;height:2px;overflow:hidden}.mce-colorbutton.mce-btn-small .mce-preview{margin-left:-17px;padding-right:0;width:16px}.mce-colorbutton .mce-open{padding-left:4px;border-left:1px solid transparent;border-right:1px solid transparent}.mce-colorbutton:hover .mce-open{border-left-color:#cad6e3;border-right-color:#cad6e3}.mce-rtl .mce-colorbutton{direction:rtl}.mce-rtl .mce-colorbutton .mce-preview{margin-left:0;padding-right:0;padding-left:3px;margin-right:-14px}.mce-rtl .mce-colorbutton.mce-btn-small .mce-preview{margin-left:0;padding-right:0;margin-right:-17px;padding-left:0}.mce-rtl .mce-colorbutton button{padding-right:10px;padding-left:10px}.mce-rtl .mce-colorbutton .mce-open{padding-left:4px;padding-right:4px}.mce-combobox{display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);*height:32px}.mce-combobox input{border:1px solid #c5c5c5;border-right-color:#c5c5c5;height:28px}.mce-combobox.mce-disabled input{color:#bbb}.mce-combobox.mce-has-open input{-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.mce-combobox .mce-btn{border-left:0;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.mce-combobox button{padding-right:8px;padding-left:8px}.mce-combobox.mce-disabled .mce-btn button{cursor:default;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.4;filter:alpha(opacity=40);zoom:1}.mce-path{display:inline-block;*display:inline;*zoom:1;padding:8px;white-space:normal}.mce-path .mce-txt{display:inline-block;padding-right:3px}.mce-path .mce-path-body{display:inline-block}.mce-path-item{display:inline-block;*display:inline;*zoom:1;cursor:pointer;color:#555}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:#666;color:#fff}.mce-path .mce-divider{display:inline}.mce-disabled .mce-path-item{color:#aaa}.mce-rtl .mce-path{direction:rtl}.mce-fieldset{border:0 solid #9E9E9E;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.mce-fieldset>.mce-container-body{margin-top:-15px}.mce-fieldset-title{margin-left:5px;padding:0 5px 0 5px}.mce-fit-layout{display:inline-block;*display:inline;*zoom:1}.mce-fit-layout-item{position:absolute}.mce-flow-layout-item{display:inline-block;*display:inline;*zoom:1}.mce-flow-layout-item{margin:2px 0 2px 2px}.mce-flow-layout-item.mce-last{margin-right:2px}.mce-flow-layout{white-space:normal}.mce-tinymce-inline .mce-flow-layout{white-space:nowrap}.mce-rtl .mce-flow-layout{text-align:right;direction:rtl}.mce-rtl .mce-flow-layout-item{margin:2px 2px 2px 0}.mce-rtl .mce-flow-layout-item.mce-last{margin-left:2px}.mce-iframe{border:0 solid #9e9e9e;width:100%;height:100%}.mce-label{display:inline-block;*display:inline;*zoom:1;text-shadow:0 1px 1px rgba(255,255,255,0.75);border:0;overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label.mce-disabled{color:#aaa}.mce-label.mce-multiline{white-space:pre-wrap}.mce-rtl .mce-label{text-align:right;direction:rtl}.mce-menubar .mce-menubtn{border-color:transparent;background:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;filter:none}.mce-menubar{border:1px solid #c4c4c4}.mce-menubar .mce-menubtn button span{color:#555}.mce-menubar .mce-caret{border-top-color:#555}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubar .mce-menubtn:focus{border-color:transparent;background:#a9bcd1;filter:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.mce-menubtn.mce-disabled span{color:#aaa}.mce-menubtn span{color:#626b73;margin-right:2px;line-height:20px;*line-height:16px}.mce-menubtn.mce-btn-small span{font-size:12px;line-height:15px;*line-height:16px}.mce-menubtn.mce-fixed-width span{display:inline-block;overflow-x:hidden;text-overflow:ellipsis;width:90px}.mce-menubtn.mce-fixed-width.mce-btn-small span{width:70px}.mce-rtl .mce-menubtn button{direction:rtl;text-align:right}.mce-listbox button{text-align:left;padding-right:20px;position:relative}.mce-listbox .mce-caret{position:absolute;margin-top:-2px;right:8px;top:50%}.mce-rtl .mce-listbox .mce-caret{right:auto;left:8px}.mce-rtl .mce-listbox button{padding-right:10px;padding-left:20px}.mce-menu-item{display:block;padding:6px 15px 6px 12px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal;border-left:4px solid transparent;margin-bottom:1px}.mce-menu-item .mce-ico,.mce-menu-item .mce-text{color:#333}.mce-menu-item.mce-disabled .mce-text,.mce-menu-item.mce-disabled .mce-ico{color:#adadad}.mce-menu-item:hover .mce-text,.mce-menu-item.mce-selected .mce-text{color:#fff}.mce-menu-item:hover .mce-ico,.mce-menu-item.mce-selected .mce-ico,.mce-menu-item:focus .mce-ico{color:#fff}.mce-menu-item.mce-disabled:hover{background:#ccc}.mce-menu-shortcut{display:inline-block;color:#adadad}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 15px 0 20px}.mce-menu-item:hover .mce-menu-shortcut,.mce-menu-item.mce-selected .mce-menu-shortcut,.mce-menu-item:focus .mce-menu-shortcut{color:#fff}.mce-menu-item .mce-caret{margin-top:4px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #333}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .mce-caret,.mce-menu-item:hover .mce-caret{border-left-color:#fff}.mce-menu-align .mce-menu-shortcut{*margin-top:-2px}.mce-menu-align .mce-menu-shortcut,.mce-menu-align .mce-caret{position:absolute;right:0}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item-normal.mce-active{background-color:#c8def4}.mce-menu-item-preview.mce-active{border-left:5px solid #aaa}.mce-menu-item-normal.mce-active .mce-text{color:#333}.mce-menu-item-normal.mce-active:hover .mce-text,.mce-menu-item-normal.mce-active:hover .mce-ico{color:#fff}.mce-menu-item:hover,.mce-menu-item.mce-selected,.mce-menu-item:focus{text-decoration:none;color:#fff;background-color:#0081c2}div.mce-menu .mce-menu-item-sep,.mce-menu-item-sep:hover{border:0;padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#cbcbcb;border-bottom:1px solid #fff;cursor:default;filter:none}.mce-rtl .mce-menu-item{text-align:right;direction:rtl;padding:6px 12px 6px 15px}.mce-menu-align.mce-rtl .mce-menu-shortcut,.mce-menu-align.mce-rtl .mce-caret{right:auto;left:0}.mce-rtl .mce-menu-item .mce-caret{margin-left:6px;margin-right:0;border-right:4px solid #333;border-left:0}.mce-rtl .mce-menu-item.mce-selected .mce-caret,.mce-rtl .mce-menu-item:focus .mce-caret,.mce-rtl .mce-menu-item:hover .mce-caret{border-left-color:transparent;border-right-color:#fff}.mce-menu{position:absolute;left:0;top:0;filter:progid:DXImageTransform.Microsoft.gradient(enabled = false);background:transparent;z-index:1000;padding:5px 0 5px 0;margin:2px 0 0;min-width:160px;background:#fff;border:1px solid #989898;border:1px solid rgba(0,0,0,0.2);z-index:1002;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);-moz-box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);box-shadow:0 5px 10px rgba(0, 0, 0, 0.2);max-height:400px;overflow:auto;overflow-x:hidden}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline}.mce-menu-sub-tr-tl{margin:-6px 0 0 -1px}.mce-menu-sub-br-bl{margin:6px 0 0 -1px}.mce-menu-sub-tl-tr{margin:-6px 0 0 1px}.mce-menu-sub-bl-br{margin:6px 0 0 1px}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-container-body .mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#555}.mce-spacer{visibility:hidden}.mce-splitbtn .mce-open{border-left:1px solid transparent;border-right:1px solid transparent}.mce-splitbtn:hover .mce-open{border-left-color:#cad6e3;border-right-color:#cad6e3}.mce-splitbtn button{padding-right:4px}.mce-splitbtn .mce-open{padding-left:4px}.mce-splitbtn .mce-open.mce-active{-webkit-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);-moz-box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05);box-shadow:inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(0, 0, 0, 0.05)}.mce-rtl .mce-splitbtn{direction:rtl;text-align:right}.mce-rtl .mce-splitbtn button{padding-right:10px;padding-left:10px}.mce-rtl .mce-splitbtn .mce-open{padding-left:4px;padding-right:4px}.mce-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #c5c5c5}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #c5c5c5;border-width:0 1px 0 0;background:#e5ecf3;padding:8px;text-shadow:0 1px 1px rgba(255,255,255,0.75);height:13px;cursor:pointer}.mce-tab:hover{background:#fdfdfd}.mce-tab.mce-active{background:#fdfdfd;border-bottom-color:transparent;margin-bottom:-1px;height:14px}.mce-rtl .mce-tabs{text-align:right;direction:rtl}.mce-rtl .mce-tab{border-width:0 0 0 1px}.mce-textbox{background:#fff;border:1px solid #c5c5c5;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075);display:inline-block;-webkit-transition:border linear .2s, box-shadow linear .2s;transition:border linear .2s, box-shadow linear .2s;height:28px;resize:none;padding:0 4px 0 4px;white-space:pre-wrap;*white-space:pre;color:#555}.mce-textbox:focus,.mce-textbox.mce-focus{border-color:#59a5e1;-webkit-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(89, 165, 225, 0.85);-moz-box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(89, 165, 225, 0.85);box-shadow:inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(89, 165, 225, 0.85)}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.mce-textbox.mce-disabled{color:#bbb}.mce-rtl .mce-textbox{text-align:right;direction:rtl}.mce-throbber{position:absolute;top:0;left:0;width:100%;height:100%;opacity:.6;filter:alpha(opacity=60);zoom:1;background:#fff url('img/loader.gif') no-repeat center center}@font-face{font-family:'tinymce';src:url('fonts/icomoon.eot');src:url('fonts/icomoon.eot?#iefix') format('embedded-opentype'),url('fonts/icomoon.svg#icomoon') format('svg'),url('fonts/icomoon.woff') format('woff'),url('fonts/icomoon.ttf') format('truetype');font-weight:normal;font-style:normal}@font-face{font-family:'tinymce-small';src:url('fonts/icomoon-small.eot');src:url('fonts/icomoon-small.eot?#iefix') format('embedded-opentype'),url('fonts/icomoon-small.svg#icomoon') format('svg'),url('fonts/icomoon-small.woff') format('woff'),url('fonts/icomoon-small.ttf') format('truetype');font-weight:normal;font-style:normal}.mce-ico{font-family:'tinymce',Arial;font-style:normal;font-weight:normal;font-size:16px;line-height:16px;vertical-align:middle;-webkit-font-smoothing:antialiased;display:inline-block;background:transparent center center;width:16px;height:16px;color:#626b73}.mce-btn-small .mce-ico{font-family:'tinymce-small',Arial}.mce-i-save:before{content:"\e000"}.mce-i-newdocument:before{content:"\e001"}.mce-i-fullpage:before{content:"\e002"}.mce-i-alignleft:before{content:"\e003"}.mce-i-aligncenter:before{content:"\e004"}.mce-i-alignright:before{content:"\e005"}.mce-i-alignjustify:before{content:"\e006"}.mce-i-cut:before{content:"\e007"}.mce-i-paste:before{content:"\e008"}.mce-i-searchreplace:before{content:"\e009"}.mce-i-bullist:before{content:"\e00a"}.mce-i-numlist:before{content:"\e00b"}.mce-i-indent:before{content:"\e00c"}.mce-i-outdent:before{content:"\e00d"}.mce-i-blockquote:before{content:"\e00e"}.mce-i-undo:before{content:"\e00f"}.mce-i-redo:before{content:"\e010"}.mce-i-link:before{content:"\e011"}.mce-i-unlink:before{content:"\e012"}.mce-i-anchor:before{content:"\e013"}.mce-i-image:before{content:"\e014"}.mce-i-media:before{content:"\e015"}.mce-i-help:before{content:"\e016"}.mce-i-code:before{content:"\e017"}.mce-i-inserttime:before{content:"\e018"}.mce-i-preview:before{content:"\e019"}.mce-i-forecolor:before{content:"\e01a"}.mce-i-backcolor:before{content:"\e01a"}.mce-i-table:before{content:"\e01b"}.mce-i-hr:before{content:"\e01c"}.mce-i-removeformat:before{content:"\e01d"}.mce-i-subscript:before{content:"\e01e"}.mce-i-superscript:before{content:"\e01f"}.mce-i-charmap:before{content:"\e020"}.mce-i-emoticons:before{content:"\e021"}.mce-i-print:before{content:"\e022"}.mce-i-fullscreen:before{content:"\e023"}.mce-i-spellchecker:before{content:"\e024"}.mce-i-nonbreaking:before{content:"\e025"}.mce-i-template:before{content:"\e026"}.mce-i-pagebreak:before{content:"\e027"}.mce-i-restoredraft:before{content:"\e028"}.mce-i-untitled:before{content:"\e029"}.mce-i-bold:before{content:"\e02a"}.mce-i-italic:before{content:"\e02b"}.mce-i-underline:before{content:"\e02c"}.mce-i-strikethrough:before{content:"\e02d"}.mce-i-visualchars:before{content:"\e02e"}.mce-i-visualblocks:before{content:"\e02e"}.mce-i-ltr:before{content:"\e02f"}.mce-i-rtl:before{content:"\e030"}.mce-i-copy:before{content:"\e031"}.mce-i-resize:before{content:"\e032"}.mce-i-browse:before{content:"\e034"}.mce-i-pastetext:before{content:"\e035"}.mce-i-checkbox:before,.mce-i-selected:before{content:"\e033"}.mce-i-selected{visibility:hidden}i.mce-i-backcolor{text-shadow:none;background:#bbb} diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/content.css similarity index 95% rename from common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.css rename to common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/content.css index b2db0b09e45f..9d5f01b37c68 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.css +++ b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/content.css @@ -1,9 +1,9 @@ /** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ +* Copyright (c) Tiny Technologies, Inc. All rights reserved. +* Licensed under the LGPL or a commercial license. +* For LGPL see License.txt in the project root for license information. +* For commercial licenses see https://www.tiny.cloud/ +*/ .mce-content-body .mce-item-anchor { background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; cursor: default; @@ -13,7 +13,6 @@ -webkit-user-modify: read-only; -moz-user-modify: read-only; -webkit-user-select: all; - -moz-user-select: all; -ms-user-select: all; user-select: all; width: 8px !important; @@ -73,13 +72,6 @@ pre[class*="language-"] { -ms-hyphens: none; hyphens: none; } -pre[class*="language-"]::-moz-selection, -pre[class*="language-"] ::-moz-selection, -code[class*="language-"]::-moz-selection, -code[class*="language-"] ::-moz-selection { - text-shadow: none; - background: #b3d4fc; -} pre[class*="language-"]::selection, pre[class*="language-"] ::selection, code[class*="language-"]::selection, @@ -323,7 +315,7 @@ pre[class*="language-"] { height: 10px; position: absolute; width: 10px; - z-index: 10000; + z-index: 1298; } .mce-content-body div.mce-resizehandle:hover { background-color: #4099ff; @@ -340,11 +332,15 @@ pre[class*="language-"] { .mce-content-body div.mce-resizehandle:nth-of-type(4) { cursor: nesw-resize; } +.mce-content-body .mce-resize-backdrop { + z-index: 10000; +} .mce-content-body .mce-clonedresizable { + cursor: default; opacity: 0.5; outline: 1px dashed black; position: absolute; - z-index: 10000; + z-index: 10001; } .mce-content-body .mce-clonedresizable.mce-resizetable-columns th, .mce-content-body .mce-clonedresizable.mce-resizetable-columns td { @@ -364,7 +360,7 @@ pre[class*="language-"] { padding: 5px; position: absolute; white-space: nowrap; - z-index: 10001; + z-index: 10002; } .tox-rtc-user-selection { position: relative; @@ -443,10 +439,6 @@ pre[class*="language-"] { background: #39f; color: #fff; } -.mce-match-marker-selected::-moz-selection { - background: #39f; - color: #fff; -} .mce-match-marker-selected::selection { background: #39f; color: #fff; @@ -487,10 +479,6 @@ pre[class*="language-"] { .mce-content-body th[data-mce-selected] { position: relative; } -.mce-content-body td[data-mce-selected]::-moz-selection, -.mce-content-body th[data-mce-selected]::-moz-selection { - background: none; -} .mce-content-body td[data-mce-selected]::selection, .mce-content-body th[data-mce-selected]::selection { background: none; @@ -500,14 +488,13 @@ pre[class*="language-"] { outline: none; -webkit-touch-callout: none; -webkit-user-select: none; - -moz-user-select: none; -ms-user-select: none; user-select: none; } .mce-content-body td[data-mce-selected]::after, .mce-content-body th[data-mce-selected]::after { - background-color: rgba(180, 215, 255, 0.35); - border: 1px solid rgba(180, 215, 255, 0.35); + background-color: rgba(180, 215, 255, 0.7); + border: 1px solid rgba(180, 215, 255, 0.7); bottom: -1px; content: ''; left: -1px; @@ -519,12 +506,9 @@ pre[class*="language-"] { @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { .mce-content-body td[data-mce-selected]::after, .mce-content-body th[data-mce-selected]::after { - border-color: rgba(0, 84, 180, 0.35); + border-color: rgba(0, 84, 180, 0.7); } } -.mce-content-body img::-moz-selection { - background: none; -} .mce-content-body img::selection { background: none; } @@ -532,7 +516,6 @@ pre[class*="language-"] { background-color: #b4d7ff; opacity: 0; -webkit-user-select: none; - -moz-user-select: none; -ms-user-select: none; user-select: none; } @@ -720,3 +703,9 @@ table[style*="border-width: 0px"] caption, .mce-shy::after { content: '-'; } +body { + font-family: sans-serif; +} +table { + border-collapse: collapse; +} diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.inline.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/content.inline.css similarity index 95% rename from common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.inline.css rename to common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/content.inline.css index b2db0b09e45f..ded4da78e111 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/content.inline.css +++ b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/content.inline.css @@ -1,9 +1,9 @@ /** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ +* Copyright (c) Tiny Technologies, Inc. All rights reserved. +* Licensed under the LGPL or a commercial license. +* For LGPL see License.txt in the project root for license information. +* For commercial licenses see https://www.tiny.cloud/ +*/ .mce-content-body .mce-item-anchor { background: transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center; cursor: default; @@ -13,7 +13,6 @@ -webkit-user-modify: read-only; -moz-user-modify: read-only; -webkit-user-select: all; - -moz-user-select: all; -ms-user-select: all; user-select: all; width: 8px !important; @@ -73,13 +72,6 @@ pre[class*="language-"] { -ms-hyphens: none; hyphens: none; } -pre[class*="language-"]::-moz-selection, -pre[class*="language-"] ::-moz-selection, -code[class*="language-"]::-moz-selection, -code[class*="language-"] ::-moz-selection { - text-shadow: none; - background: #b3d4fc; -} pre[class*="language-"]::selection, pre[class*="language-"] ::selection, code[class*="language-"]::selection, @@ -323,7 +315,7 @@ pre[class*="language-"] { height: 10px; position: absolute; width: 10px; - z-index: 10000; + z-index: 1298; } .mce-content-body div.mce-resizehandle:hover { background-color: #4099ff; @@ -340,11 +332,15 @@ pre[class*="language-"] { .mce-content-body div.mce-resizehandle:nth-of-type(4) { cursor: nesw-resize; } +.mce-content-body .mce-resize-backdrop { + z-index: 10000; +} .mce-content-body .mce-clonedresizable { + cursor: default; opacity: 0.5; outline: 1px dashed black; position: absolute; - z-index: 10000; + z-index: 10001; } .mce-content-body .mce-clonedresizable.mce-resizetable-columns th, .mce-content-body .mce-clonedresizable.mce-resizetable-columns td { @@ -364,7 +360,7 @@ pre[class*="language-"] { padding: 5px; position: absolute; white-space: nowrap; - z-index: 10001; + z-index: 10002; } .tox-rtc-user-selection { position: relative; @@ -443,10 +439,6 @@ pre[class*="language-"] { background: #39f; color: #fff; } -.mce-match-marker-selected::-moz-selection { - background: #39f; - color: #fff; -} .mce-match-marker-selected::selection { background: #39f; color: #fff; @@ -487,10 +479,6 @@ pre[class*="language-"] { .mce-content-body th[data-mce-selected] { position: relative; } -.mce-content-body td[data-mce-selected]::-moz-selection, -.mce-content-body th[data-mce-selected]::-moz-selection { - background: none; -} .mce-content-body td[data-mce-selected]::selection, .mce-content-body th[data-mce-selected]::selection { background: none; @@ -500,14 +488,13 @@ pre[class*="language-"] { outline: none; -webkit-touch-callout: none; -webkit-user-select: none; - -moz-user-select: none; -ms-user-select: none; user-select: none; } .mce-content-body td[data-mce-selected]::after, .mce-content-body th[data-mce-selected]::after { - background-color: rgba(180, 215, 255, 0.35); - border: 1px solid rgba(180, 215, 255, 0.35); + background-color: rgba(180, 215, 255, 0.7); + border: 1px solid rgba(180, 215, 255, 0.7); bottom: -1px; content: ''; left: -1px; @@ -519,12 +506,9 @@ pre[class*="language-"] { @media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) { .mce-content-body td[data-mce-selected]::after, .mce-content-body th[data-mce-selected]::after { - border-color: rgba(0, 84, 180, 0.35); + border-color: rgba(0, 84, 180, 0.7); } } -.mce-content-body img::-moz-selection { - background: none; -} .mce-content-body img::selection { background: none; } @@ -532,7 +516,6 @@ pre[class*="language-"] { background-color: #b4d7ff; opacity: 0; -webkit-user-select: none; - -moz-user-select: none; -ms-user-select: none; user-select: none; } diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/content.inline.min.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/content.inline.min.css new file mode 100644 index 000000000000..07e11d08c311 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/content.inline.min.css @@ -0,0 +1,7 @@ +/** +* Copyright (c) Tiny Technologies, Inc. All rights reserved. +* Licensed under the LGPL or a commercial license. +* For LGPL see License.txt in the project root for license information. +* For commercial licenses see https://www.tiny.cloud/ +*/ +.mce-content-body .mce-item-anchor{background:transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;cursor:default;display:inline-block;height:12px!important;padding:0 2px;-webkit-user-modify:read-only;-moz-user-modify:read-only;-webkit-user-select:all;-ms-user-select:all;user-select:all;width:8px!important}.mce-content-body .mce-item-anchor[data-mce-selected]{outline-offset:1px}.tox-comments-visible .tox-comment{background-color:#fff0b7}.tox-comments-visible .tox-comment--active{background-color:#ffe168}.tox-checklist>li:not(.tox-checklist--hidden){list-style:none;margin:.25em 0}.tox-checklist>li:not(.tox-checklist--hidden)::before{content:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A");cursor:pointer;height:1em;margin-left:-1.5em;margin-top:.125em;position:absolute;width:1em}.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before{content:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A")}[dir=rtl] .tox-checklist>li:not(.tox-checklist--hidden)::before{margin-left:0;margin-right:-1.5em}code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;tab-size:4;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.mce-content-body{overflow-wrap:break-word;word-wrap:break-word}.mce-content-body .mce-visual-caret{background-color:#000;background-color:currentColor;position:absolute}.mce-content-body .mce-visual-caret-hidden{display:none}.mce-content-body [data-mce-caret]{left:-1000px;margin:0;padding:0;position:absolute;right:auto;top:0}.mce-content-body .mce-offscreen-selection{left:-2000000px;max-width:1000000px;position:absolute}.mce-content-body [contentEditable=false]{cursor:default}.mce-content-body [contentEditable=true]{cursor:text}.tox-cursor-format-painter{cursor:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"),default}.mce-content-body figure.align-left{float:left}.mce-content-body figure.align-right{float:right}.mce-content-body figure.image.align-center{display:table;margin-left:auto;margin-right:auto}.mce-preview-object{border:1px solid gray;display:inline-block;line-height:0;margin:0 2px 0 2px;position:relative}.mce-preview-object .mce-shim{background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);height:100%;left:0;position:absolute;top:0;width:100%}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-object{background:transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;border:1px dashed #aaa}.mce-pagebreak{border:1px dashed #aaa;cursor:default;display:block;height:5px;margin-top:15px;page-break-before:always;width:100%}@media print{.mce-pagebreak{border:0}}.tiny-pageembed .mce-shim{background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);height:100%;left:0;position:absolute;top:0;width:100%}.tiny-pageembed[data-mce-selected="2"] .mce-shim{display:none}.tiny-pageembed{display:inline-block;position:relative}.tiny-pageembed--16by9,.tiny-pageembed--1by1,.tiny-pageembed--21by9,.tiny-pageembed--4by3{display:block;overflow:hidden;padding:0;position:relative;width:100%}.tiny-pageembed--21by9{padding-top:42.857143%}.tiny-pageembed--16by9{padding-top:56.25%}.tiny-pageembed--4by3{padding-top:75%}.tiny-pageembed--1by1{padding-top:100%}.tiny-pageembed--16by9 iframe,.tiny-pageembed--1by1 iframe,.tiny-pageembed--21by9 iframe,.tiny-pageembed--4by3 iframe{border:0;height:100%;left:0;position:absolute;top:0;width:100%}.mce-content-body[data-mce-placeholder]{position:relative}.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before{color:rgba(34,47,62,.7);content:attr(data-mce-placeholder);position:absolute}.mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before{left:1px}.mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before{right:1px}.mce-content-body div.mce-resizehandle{background-color:#4099ff;border-color:#4099ff;border-style:solid;border-width:1px;box-sizing:border-box;height:10px;position:absolute;width:10px;z-index:1298}.mce-content-body div.mce-resizehandle:hover{background-color:#4099ff}.mce-content-body div.mce-resizehandle:nth-of-type(1){cursor:nwse-resize}.mce-content-body div.mce-resizehandle:nth-of-type(2){cursor:nesw-resize}.mce-content-body div.mce-resizehandle:nth-of-type(3){cursor:nwse-resize}.mce-content-body div.mce-resizehandle:nth-of-type(4){cursor:nesw-resize}.mce-content-body .mce-resize-backdrop{z-index:10000}.mce-content-body .mce-clonedresizable{cursor:default;opacity:.5;outline:1px dashed #000;position:absolute;z-index:10001}.mce-content-body .mce-clonedresizable.mce-resizetable-columns td,.mce-content-body .mce-clonedresizable.mce-resizetable-columns th{border:0}.mce-content-body .mce-resize-helper{background:#555;background:rgba(0,0,0,.75);border:1px;border-radius:3px;color:#fff;display:none;font-family:sans-serif;font-size:12px;line-height:14px;margin:5px 10px;padding:5px;position:absolute;white-space:nowrap;z-index:10002}.tox-rtc-user-selection{position:relative}.tox-rtc-user-cursor{bottom:0;cursor:default;position:absolute;top:0;width:2px}.tox-rtc-user-cursor::before{background-color:inherit;border-radius:50%;content:'';display:block;height:8px;position:absolute;right:-3px;top:-3px;width:8px}.tox-rtc-user-cursor:hover::after{background-color:inherit;border-radius:100px;box-sizing:border-box;color:#fff;content:attr(data-user);display:block;font-size:12px;font-weight:700;left:-5px;min-height:8px;min-width:8px;padding:0 12px;position:absolute;top:-11px;white-space:nowrap;z-index:1000}.tox-rtc-user-selection--1 .tox-rtc-user-cursor{background-color:#2dc26b}.tox-rtc-user-selection--2 .tox-rtc-user-cursor{background-color:#e03e2d}.tox-rtc-user-selection--3 .tox-rtc-user-cursor{background-color:#f1c40f}.tox-rtc-user-selection--4 .tox-rtc-user-cursor{background-color:#3598db}.tox-rtc-user-selection--5 .tox-rtc-user-cursor{background-color:#b96ad9}.tox-rtc-user-selection--6 .tox-rtc-user-cursor{background-color:#e67e23}.tox-rtc-user-selection--7 .tox-rtc-user-cursor{background-color:#aaa69d}.tox-rtc-user-selection--8 .tox-rtc-user-cursor{background-color:#f368e0}.tox-rtc-remote-image{background:#eaeaea url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2236%22%20height%3D%2212%22%20viewBox%3D%220%200%2036%2012%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Ccircle%20cx%3D%226%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2218%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.33s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2230%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.66s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A") no-repeat center center;border:1px solid #ccc;min-height:240px;min-width:320px}.mce-match-marker{background:#aaa;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-match-marker-selected::selection{background:#39f;color:#fff}.mce-content-body audio[data-mce-selected],.mce-content-body embed[data-mce-selected],.mce-content-body img[data-mce-selected],.mce-content-body object[data-mce-selected],.mce-content-body table[data-mce-selected],.mce-content-body video[data-mce-selected]{outline:3px solid #b4d7ff}.mce-content-body hr[data-mce-selected]{outline:3px solid #b4d7ff;outline-offset:1px}.mce-content-body [contentEditable=false] [contentEditable=true]:focus{outline:3px solid #b4d7ff}.mce-content-body [contentEditable=false] [contentEditable=true]:hover{outline:3px solid #b4d7ff}.mce-content-body [contentEditable=false][data-mce-selected]{cursor:not-allowed;outline:3px solid #b4d7ff}.mce-content-body.mce-content-readonly [contentEditable=true]:focus,.mce-content-body.mce-content-readonly [contentEditable=true]:hover{outline:0}.mce-content-body [data-mce-selected=inline-boundary]{background-color:#b4d7ff}.mce-content-body .mce-edit-focus{outline:3px solid #b4d7ff}.mce-content-body td[data-mce-selected],.mce-content-body th[data-mce-selected]{position:relative}.mce-content-body td[data-mce-selected]::selection,.mce-content-body th[data-mce-selected]::selection{background:0 0}.mce-content-body td[data-mce-selected] *,.mce-content-body th[data-mce-selected] *{outline:0;-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.mce-content-body td[data-mce-selected]::after,.mce-content-body th[data-mce-selected]::after{background-color:rgba(180,215,255,.7);border:1px solid rgba(180,215,255,.7);bottom:-1px;content:'';left:-1px;mix-blend-mode:multiply;position:absolute;right:-1px;top:-1px}@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){.mce-content-body td[data-mce-selected]::after,.mce-content-body th[data-mce-selected]::after{border-color:rgba(0,84,180,.7)}}.mce-content-body img::selection{background:0 0}.ephox-snooker-resizer-bar{background-color:#b4d7ff;opacity:0;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ephox-snooker-resizer-cols{cursor:col-resize}.ephox-snooker-resizer-rows{cursor:row-resize}.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity:1}.mce-spellchecker-word{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position:0 calc(100% + 1px);background-repeat:repeat-x;background-size:auto 6px;cursor:default;height:2rem}.mce-spellchecker-grammar{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position:0 calc(100% + 1px);background-repeat:repeat-x;background-size:auto 6px;cursor:default}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-item-table:not([border]),.mce-item-table:not([border]) caption,.mce-item-table:not([border]) td,.mce-item-table:not([border]) th,.mce-item-table[border="0"],.mce-item-table[border="0"] caption,.mce-item-table[border="0"] td,.mce-item-table[border="0"] th,table[style*="border-width: 0px"],table[style*="border-width: 0px"] caption,table[style*="border-width: 0px"] td,table[style*="border-width: 0px"] th{border:1px dashed #bbb}.mce-visualblocks address,.mce-visualblocks article,.mce-visualblocks aside,.mce-visualblocks blockquote,.mce-visualblocks div:not([data-mce-bogus]),.mce-visualblocks dl,.mce-visualblocks figcaption,.mce-visualblocks figure,.mce-visualblocks h1,.mce-visualblocks h2,.mce-visualblocks h3,.mce-visualblocks h4,.mce-visualblocks h5,.mce-visualblocks h6,.mce-visualblocks hgroup,.mce-visualblocks ol,.mce-visualblocks p,.mce-visualblocks pre,.mce-visualblocks section,.mce-visualblocks ul{background-repeat:no-repeat;border:1px dashed #bbb;margin-left:3px;padding-top:10px}.mce-visualblocks p{background-image:url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7)}.mce-visualblocks h1{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==)}.mce-visualblocks h2{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==)}.mce-visualblocks h3{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7)}.mce-visualblocks h4{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==)}.mce-visualblocks h5{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==)}.mce-visualblocks h6{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==)}.mce-visualblocks div:not([data-mce-bogus]){background-image:url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7)}.mce-visualblocks section{background-image:url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=)}.mce-visualblocks article{background-image:url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7)}.mce-visualblocks blockquote{background-image:url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7)}.mce-visualblocks address{background-image:url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=)}.mce-visualblocks pre{background-image:url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==)}.mce-visualblocks figure{background-image:url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7)}.mce-visualblocks figcaption{border:1px dashed #bbb}.mce-visualblocks hgroup{background-image:url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7)}.mce-visualblocks aside{background-image:url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=)}.mce-visualblocks ul{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==)}.mce-visualblocks ol{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==)}.mce-visualblocks dl{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==)}.mce-visualblocks:not([dir=rtl]) address,.mce-visualblocks:not([dir=rtl]) article,.mce-visualblocks:not([dir=rtl]) aside,.mce-visualblocks:not([dir=rtl]) blockquote,.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]),.mce-visualblocks:not([dir=rtl]) dl,.mce-visualblocks:not([dir=rtl]) figcaption,.mce-visualblocks:not([dir=rtl]) figure,.mce-visualblocks:not([dir=rtl]) h1,.mce-visualblocks:not([dir=rtl]) h2,.mce-visualblocks:not([dir=rtl]) h3,.mce-visualblocks:not([dir=rtl]) h4,.mce-visualblocks:not([dir=rtl]) h5,.mce-visualblocks:not([dir=rtl]) h6,.mce-visualblocks:not([dir=rtl]) hgroup,.mce-visualblocks:not([dir=rtl]) ol,.mce-visualblocks:not([dir=rtl]) p,.mce-visualblocks:not([dir=rtl]) pre,.mce-visualblocks:not([dir=rtl]) section,.mce-visualblocks:not([dir=rtl]) ul{margin-left:3px}.mce-visualblocks[dir=rtl] address,.mce-visualblocks[dir=rtl] article,.mce-visualblocks[dir=rtl] aside,.mce-visualblocks[dir=rtl] blockquote,.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]),.mce-visualblocks[dir=rtl] dl,.mce-visualblocks[dir=rtl] figcaption,.mce-visualblocks[dir=rtl] figure,.mce-visualblocks[dir=rtl] h1,.mce-visualblocks[dir=rtl] h2,.mce-visualblocks[dir=rtl] h3,.mce-visualblocks[dir=rtl] h4,.mce-visualblocks[dir=rtl] h5,.mce-visualblocks[dir=rtl] h6,.mce-visualblocks[dir=rtl] hgroup,.mce-visualblocks[dir=rtl] ol,.mce-visualblocks[dir=rtl] p,.mce-visualblocks[dir=rtl] pre,.mce-visualblocks[dir=rtl] section,.mce-visualblocks[dir=rtl] ul{background-position-x:right;margin-right:3px}.mce-nbsp,.mce-shy{background:#aaa}.mce-shy::after{content:'-'} \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/content.min.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/content.min.css new file mode 100644 index 000000000000..fc45d0da475f --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/content.min.css @@ -0,0 +1,7 @@ +/** +* Copyright (c) Tiny Technologies, Inc. All rights reserved. +* Licensed under the LGPL or a commercial license. +* For LGPL see License.txt in the project root for license information. +* For commercial licenses see https://www.tiny.cloud/ +*/ +.mce-content-body .mce-item-anchor{background:transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'8'%20height%3D'12'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20d%3D'M0%200L8%200%208%2012%204.09117821%209%200%2012z'%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;cursor:default;display:inline-block;height:12px!important;padding:0 2px;-webkit-user-modify:read-only;-moz-user-modify:read-only;-webkit-user-select:all;-ms-user-select:all;user-select:all;width:8px!important}.mce-content-body .mce-item-anchor[data-mce-selected]{outline-offset:1px}.tox-comments-visible .tox-comment{background-color:#fff0b7}.tox-comments-visible .tox-comment--active{background-color:#ffe168}.tox-checklist>li:not(.tox-checklist--hidden){list-style:none;margin:.25em 0}.tox-checklist>li:not(.tox-checklist--hidden)::before{content:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-unchecked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2215%22%20height%3D%2215%22%20x%3D%22.5%22%20y%3D%22.5%22%20fill-rule%3D%22nonzero%22%20stroke%3D%22%234C4C4C%22%20rx%3D%222%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A");cursor:pointer;height:1em;margin-left:-1.5em;margin-top:.125em;position:absolute;width:1em}.tox-checklist li:not(.tox-checklist--hidden).tox-checklist--checked::before{content:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2216%22%20height%3D%2216%22%20viewBox%3D%220%200%2016%2016%22%3E%3Cg%20id%3D%22checklist-checked%22%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%3Crect%20id%3D%22Rectangle%22%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22%234099FF%22%20fill-rule%3D%22nonzero%22%20rx%3D%222%22%2F%3E%3Cpath%20id%3D%22Path%22%20fill%3D%22%23FFF%22%20fill-rule%3D%22nonzero%22%20d%3D%22M11.5703186%2C3.14417309%20C11.8516238%2C2.73724603%2012.4164781%2C2.62829933%2012.83558%2C2.89774797%20C13.260121%2C3.17069355%2013.3759736%2C3.72932262%2013.0909105%2C4.14168582%20L7.7580587%2C11.8560195%20C7.43776896%2C12.3193404%206.76483983%2C12.3852142%206.35607322%2C11.9948725%20L3.02491697%2C8.8138662%20C2.66090143%2C8.46625845%202.65798871%2C7.89594698%203.01850234%2C7.54483354%20C3.373942%2C7.19866177%203.94940006%2C7.19592841%204.30829608%2C7.5386474%20L6.85276923%2C9.9684299%20L11.5703186%2C3.14417309%20Z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E%0A")}[dir=rtl] .tox-checklist>li:not(.tox-checklist--hidden)::before{margin-left:0;margin-right:-1.5em}code[class*=language-],pre[class*=language-]{color:#000;background:0 0;text-shadow:0 1px #fff;font-family:Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace;font-size:1em;text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;line-height:1.5;-moz-tab-size:4;tab-size:4;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none}code[class*=language-] ::selection,code[class*=language-]::selection,pre[class*=language-] ::selection,pre[class*=language-]::selection{text-shadow:none;background:#b3d4fc}@media print{code[class*=language-],pre[class*=language-]{text-shadow:none}}pre[class*=language-]{padding:1em;margin:.5em 0;overflow:auto}:not(pre)>code[class*=language-],pre[class*=language-]{background:#f5f2f0}:not(pre)>code[class*=language-]{padding:.1em;border-radius:.3em;white-space:normal}.token.cdata,.token.comment,.token.doctype,.token.prolog{color:#708090}.token.punctuation{color:#999}.namespace{opacity:.7}.token.boolean,.token.constant,.token.deleted,.token.number,.token.property,.token.symbol,.token.tag{color:#905}.token.attr-name,.token.builtin,.token.char,.token.inserted,.token.selector,.token.string{color:#690}.language-css .token.string,.style .token.string,.token.entity,.token.operator,.token.url{color:#9a6e3a;background:hsla(0,0%,100%,.5)}.token.atrule,.token.attr-value,.token.keyword{color:#07a}.token.class-name,.token.function{color:#dd4a68}.token.important,.token.regex,.token.variable{color:#e90}.token.bold,.token.important{font-weight:700}.token.italic{font-style:italic}.token.entity{cursor:help}.mce-content-body{overflow-wrap:break-word;word-wrap:break-word}.mce-content-body .mce-visual-caret{background-color:#000;background-color:currentColor;position:absolute}.mce-content-body .mce-visual-caret-hidden{display:none}.mce-content-body [data-mce-caret]{left:-1000px;margin:0;padding:0;position:absolute;right:auto;top:0}.mce-content-body .mce-offscreen-selection{left:-2000000px;max-width:1000000px;position:absolute}.mce-content-body [contentEditable=false]{cursor:default}.mce-content-body [contentEditable=true]{cursor:text}.tox-cursor-format-painter{cursor:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%3E%0A%20%20%3Cg%20fill%3D%22none%22%20fill-rule%3D%22evenodd%22%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M15%2C6%20C15%2C5.45%2014.55%2C5%2014%2C5%20L6%2C5%20C5.45%2C5%205%2C5.45%205%2C6%20L5%2C10%20C5%2C10.55%205.45%2C11%206%2C11%20L14%2C11%20C14.55%2C11%2015%2C10.55%2015%2C10%20L15%2C9%20L16%2C9%20L16%2C12%20L9%2C12%20L9%2C19%20C9%2C19.55%209.45%2C20%2010%2C20%20L11%2C20%20C11.55%2C20%2012%2C19.55%2012%2C19%20L12%2C14%20L18%2C14%20L18%2C7%20L15%2C7%20L15%2C6%20Z%22%2F%3E%0A%20%20%20%20%3Cpath%20fill%3D%22%23000%22%20fill-rule%3D%22nonzero%22%20d%3D%22M1%2C1%20L8.25%2C1%20C8.66421356%2C1%209%2C1.33578644%209%2C1.75%20L9%2C1.75%20C9%2C2.16421356%208.66421356%2C2.5%208.25%2C2.5%20L2.5%2C2.5%20L2.5%2C8.25%20C2.5%2C8.66421356%202.16421356%2C9%201.75%2C9%20L1.75%2C9%20C1.33578644%2C9%201%2C8.66421356%201%2C8.25%20L1%2C1%20Z%22%2F%3E%0A%20%20%3C%2Fg%3E%0A%3C%2Fsvg%3E%0A"),default}.mce-content-body figure.align-left{float:left}.mce-content-body figure.align-right{float:right}.mce-content-body figure.image.align-center{display:table;margin-left:auto;margin-right:auto}.mce-preview-object{border:1px solid gray;display:inline-block;line-height:0;margin:0 2px 0 2px;position:relative}.mce-preview-object .mce-shim{background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);height:100%;left:0;position:absolute;top:0;width:100%}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-object{background:transparent url("data:image/svg+xml;charset=UTF-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2224%22%20height%3D%2224%22%3E%3Cpath%20d%3D%22M4%203h16a1%201%200%200%201%201%201v16a1%201%200%200%201-1%201H4a1%201%200%200%201-1-1V4a1%201%200%200%201%201-1zm1%202v14h14V5H5zm4.79%202.565l5.64%204.028a.5.5%200%200%201%200%20.814l-5.64%204.028a.5.5%200%200%201-.79-.407V7.972a.5.5%200%200%201%20.79-.407z%22%2F%3E%3C%2Fsvg%3E%0A") no-repeat center;border:1px dashed #aaa}.mce-pagebreak{border:1px dashed #aaa;cursor:default;display:block;height:5px;margin-top:15px;page-break-before:always;width:100%}@media print{.mce-pagebreak{border:0}}.tiny-pageembed .mce-shim{background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7);height:100%;left:0;position:absolute;top:0;width:100%}.tiny-pageembed[data-mce-selected="2"] .mce-shim{display:none}.tiny-pageembed{display:inline-block;position:relative}.tiny-pageembed--16by9,.tiny-pageembed--1by1,.tiny-pageembed--21by9,.tiny-pageembed--4by3{display:block;overflow:hidden;padding:0;position:relative;width:100%}.tiny-pageembed--21by9{padding-top:42.857143%}.tiny-pageembed--16by9{padding-top:56.25%}.tiny-pageembed--4by3{padding-top:75%}.tiny-pageembed--1by1{padding-top:100%}.tiny-pageembed--16by9 iframe,.tiny-pageembed--1by1 iframe,.tiny-pageembed--21by9 iframe,.tiny-pageembed--4by3 iframe{border:0;height:100%;left:0;position:absolute;top:0;width:100%}.mce-content-body[data-mce-placeholder]{position:relative}.mce-content-body[data-mce-placeholder]:not(.mce-visualblocks)::before{color:rgba(34,47,62,.7);content:attr(data-mce-placeholder);position:absolute}.mce-content-body:not([dir=rtl])[data-mce-placeholder]:not(.mce-visualblocks)::before{left:1px}.mce-content-body[dir=rtl][data-mce-placeholder]:not(.mce-visualblocks)::before{right:1px}.mce-content-body div.mce-resizehandle{background-color:#4099ff;border-color:#4099ff;border-style:solid;border-width:1px;box-sizing:border-box;height:10px;position:absolute;width:10px;z-index:1298}.mce-content-body div.mce-resizehandle:hover{background-color:#4099ff}.mce-content-body div.mce-resizehandle:nth-of-type(1){cursor:nwse-resize}.mce-content-body div.mce-resizehandle:nth-of-type(2){cursor:nesw-resize}.mce-content-body div.mce-resizehandle:nth-of-type(3){cursor:nwse-resize}.mce-content-body div.mce-resizehandle:nth-of-type(4){cursor:nesw-resize}.mce-content-body .mce-resize-backdrop{z-index:10000}.mce-content-body .mce-clonedresizable{cursor:default;opacity:.5;outline:1px dashed #000;position:absolute;z-index:10001}.mce-content-body .mce-clonedresizable.mce-resizetable-columns td,.mce-content-body .mce-clonedresizable.mce-resizetable-columns th{border:0}.mce-content-body .mce-resize-helper{background:#555;background:rgba(0,0,0,.75);border:1px;border-radius:3px;color:#fff;display:none;font-family:sans-serif;font-size:12px;line-height:14px;margin:5px 10px;padding:5px;position:absolute;white-space:nowrap;z-index:10002}.tox-rtc-user-selection{position:relative}.tox-rtc-user-cursor{bottom:0;cursor:default;position:absolute;top:0;width:2px}.tox-rtc-user-cursor::before{background-color:inherit;border-radius:50%;content:'';display:block;height:8px;position:absolute;right:-3px;top:-3px;width:8px}.tox-rtc-user-cursor:hover::after{background-color:inherit;border-radius:100px;box-sizing:border-box;color:#fff;content:attr(data-user);display:block;font-size:12px;font-weight:700;left:-5px;min-height:8px;min-width:8px;padding:0 12px;position:absolute;top:-11px;white-space:nowrap;z-index:1000}.tox-rtc-user-selection--1 .tox-rtc-user-cursor{background-color:#2dc26b}.tox-rtc-user-selection--2 .tox-rtc-user-cursor{background-color:#e03e2d}.tox-rtc-user-selection--3 .tox-rtc-user-cursor{background-color:#f1c40f}.tox-rtc-user-selection--4 .tox-rtc-user-cursor{background-color:#3598db}.tox-rtc-user-selection--5 .tox-rtc-user-cursor{background-color:#b96ad9}.tox-rtc-user-selection--6 .tox-rtc-user-cursor{background-color:#e67e23}.tox-rtc-user-selection--7 .tox-rtc-user-cursor{background-color:#aaa69d}.tox-rtc-user-selection--8 .tox-rtc-user-cursor{background-color:#f368e0}.tox-rtc-remote-image{background:#eaeaea url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D%2236%22%20height%3D%2212%22%20viewBox%3D%220%200%2036%2012%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%20%20%3Ccircle%20cx%3D%226%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2218%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.33s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%20%20%3Ccircle%20cx%3D%2230%22%20cy%3D%226%22%20r%3D%223%22%20fill%3D%22rgba(0%2C%200%2C%200%2C%20.2)%22%3E%0A%20%20%20%20%3Canimate%20attributeName%3D%22r%22%20values%3D%223%3B5%3B3%22%20calcMode%3D%22linear%22%20begin%3D%22.66s%22%20dur%3D%221s%22%20repeatCount%3D%22indefinite%22%20%2F%3E%0A%20%20%3C%2Fcircle%3E%0A%3C%2Fsvg%3E%0A") no-repeat center center;border:1px solid #ccc;min-height:240px;min-width:320px}.mce-match-marker{background:#aaa;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-match-marker-selected::selection{background:#39f;color:#fff}.mce-content-body audio[data-mce-selected],.mce-content-body embed[data-mce-selected],.mce-content-body img[data-mce-selected],.mce-content-body object[data-mce-selected],.mce-content-body table[data-mce-selected],.mce-content-body video[data-mce-selected]{outline:3px solid #b4d7ff}.mce-content-body hr[data-mce-selected]{outline:3px solid #b4d7ff;outline-offset:1px}.mce-content-body [contentEditable=false] [contentEditable=true]:focus{outline:3px solid #b4d7ff}.mce-content-body [contentEditable=false] [contentEditable=true]:hover{outline:3px solid #b4d7ff}.mce-content-body [contentEditable=false][data-mce-selected]{cursor:not-allowed;outline:3px solid #b4d7ff}.mce-content-body.mce-content-readonly [contentEditable=true]:focus,.mce-content-body.mce-content-readonly [contentEditable=true]:hover{outline:0}.mce-content-body [data-mce-selected=inline-boundary]{background-color:#b4d7ff}.mce-content-body .mce-edit-focus{outline:3px solid #b4d7ff}.mce-content-body td[data-mce-selected],.mce-content-body th[data-mce-selected]{position:relative}.mce-content-body td[data-mce-selected]::selection,.mce-content-body th[data-mce-selected]::selection{background:0 0}.mce-content-body td[data-mce-selected] *,.mce-content-body th[data-mce-selected] *{outline:0;-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.mce-content-body td[data-mce-selected]::after,.mce-content-body th[data-mce-selected]::after{background-color:rgba(180,215,255,.7);border:1px solid rgba(180,215,255,.7);bottom:-1px;content:'';left:-1px;mix-blend-mode:multiply;position:absolute;right:-1px;top:-1px}@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){.mce-content-body td[data-mce-selected]::after,.mce-content-body th[data-mce-selected]::after{border-color:rgba(0,84,180,.7)}}.mce-content-body img::selection{background:0 0}.ephox-snooker-resizer-bar{background-color:#b4d7ff;opacity:0;-webkit-user-select:none;-ms-user-select:none;user-select:none}.ephox-snooker-resizer-cols{cursor:col-resize}.ephox-snooker-resizer-rows{cursor:row-resize}.ephox-snooker-resizer-bar.ephox-snooker-resizer-bar-dragging{opacity:1}.mce-spellchecker-word{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%23ff0000'%20fill%3D'none'%20stroke-linecap%3D'round'%20stroke-opacity%3D'.75'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position:0 calc(100% + 1px);background-repeat:repeat-x;background-size:auto 6px;cursor:default;height:2rem}.mce-spellchecker-grammar{background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg%20width%3D'4'%20height%3D'4'%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%3E%3Cpath%20stroke%3D'%2300A835'%20fill%3D'none'%20stroke-linecap%3D'round'%20d%3D'M0%203L2%201%204%203'%2F%3E%3C%2Fsvg%3E%0A");background-position:0 calc(100% + 1px);background-repeat:repeat-x;background-size:auto 6px;cursor:default}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-item-table:not([border]),.mce-item-table:not([border]) caption,.mce-item-table:not([border]) td,.mce-item-table:not([border]) th,.mce-item-table[border="0"],.mce-item-table[border="0"] caption,.mce-item-table[border="0"] td,.mce-item-table[border="0"] th,table[style*="border-width: 0px"],table[style*="border-width: 0px"] caption,table[style*="border-width: 0px"] td,table[style*="border-width: 0px"] th{border:1px dashed #bbb}.mce-visualblocks address,.mce-visualblocks article,.mce-visualblocks aside,.mce-visualblocks blockquote,.mce-visualblocks div:not([data-mce-bogus]),.mce-visualblocks dl,.mce-visualblocks figcaption,.mce-visualblocks figure,.mce-visualblocks h1,.mce-visualblocks h2,.mce-visualblocks h3,.mce-visualblocks h4,.mce-visualblocks h5,.mce-visualblocks h6,.mce-visualblocks hgroup,.mce-visualblocks ol,.mce-visualblocks p,.mce-visualblocks pre,.mce-visualblocks section,.mce-visualblocks ul{background-repeat:no-repeat;border:1px dashed #bbb;margin-left:3px;padding-top:10px}.mce-visualblocks p{background-image:url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7)}.mce-visualblocks h1{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==)}.mce-visualblocks h2{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==)}.mce-visualblocks h3{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7)}.mce-visualblocks h4{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==)}.mce-visualblocks h5{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==)}.mce-visualblocks h6{background-image:url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==)}.mce-visualblocks div:not([data-mce-bogus]){background-image:url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7)}.mce-visualblocks section{background-image:url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=)}.mce-visualblocks article{background-image:url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7)}.mce-visualblocks blockquote{background-image:url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7)}.mce-visualblocks address{background-image:url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=)}.mce-visualblocks pre{background-image:url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==)}.mce-visualblocks figure{background-image:url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7)}.mce-visualblocks figcaption{border:1px dashed #bbb}.mce-visualblocks hgroup{background-image:url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7)}.mce-visualblocks aside{background-image:url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=)}.mce-visualblocks ul{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIAAALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGuYnqUVSjvw26DzzXiqIDlVwAAOw==)}.mce-visualblocks ol{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybH6HHt0qourxC6CvzXieHyeWQAAOw==)}.mce-visualblocks dl{background-image:url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybEOnmOvUoWznTqeuEjNSCqeGRUAOw==)}.mce-visualblocks:not([dir=rtl]) address,.mce-visualblocks:not([dir=rtl]) article,.mce-visualblocks:not([dir=rtl]) aside,.mce-visualblocks:not([dir=rtl]) blockquote,.mce-visualblocks:not([dir=rtl]) div:not([data-mce-bogus]),.mce-visualblocks:not([dir=rtl]) dl,.mce-visualblocks:not([dir=rtl]) figcaption,.mce-visualblocks:not([dir=rtl]) figure,.mce-visualblocks:not([dir=rtl]) h1,.mce-visualblocks:not([dir=rtl]) h2,.mce-visualblocks:not([dir=rtl]) h3,.mce-visualblocks:not([dir=rtl]) h4,.mce-visualblocks:not([dir=rtl]) h5,.mce-visualblocks:not([dir=rtl]) h6,.mce-visualblocks:not([dir=rtl]) hgroup,.mce-visualblocks:not([dir=rtl]) ol,.mce-visualblocks:not([dir=rtl]) p,.mce-visualblocks:not([dir=rtl]) pre,.mce-visualblocks:not([dir=rtl]) section,.mce-visualblocks:not([dir=rtl]) ul{margin-left:3px}.mce-visualblocks[dir=rtl] address,.mce-visualblocks[dir=rtl] article,.mce-visualblocks[dir=rtl] aside,.mce-visualblocks[dir=rtl] blockquote,.mce-visualblocks[dir=rtl] div:not([data-mce-bogus]),.mce-visualblocks[dir=rtl] dl,.mce-visualblocks[dir=rtl] figcaption,.mce-visualblocks[dir=rtl] figure,.mce-visualblocks[dir=rtl] h1,.mce-visualblocks[dir=rtl] h2,.mce-visualblocks[dir=rtl] h3,.mce-visualblocks[dir=rtl] h4,.mce-visualblocks[dir=rtl] h5,.mce-visualblocks[dir=rtl] h6,.mce-visualblocks[dir=rtl] hgroup,.mce-visualblocks[dir=rtl] ol,.mce-visualblocks[dir=rtl] p,.mce-visualblocks[dir=rtl] pre,.mce-visualblocks[dir=rtl] section,.mce-visualblocks[dir=rtl] ul{background-position-x:right;margin-right:3px}.mce-nbsp,.mce-shy{background:#aaa}.mce-shy::after{content:'-'}body{font-family:sans-serif}table{border-collapse:collapse} \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.mobile.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/content.mobile.css similarity index 66% rename from common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.mobile.css rename to common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/content.mobile.css index 4bdb8babcbb1..64783f03c4d1 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/content.mobile.css +++ b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/content.mobile.css @@ -1,9 +1,9 @@ /** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ +* Copyright (c) Tiny Technologies, Inc. All rights reserved. +* Licensed under the LGPL or a commercial license. +* For LGPL see License.txt in the project root for license information. +* For commercial licenses see https://www.tiny.cloud/ +*/ .tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection { /* Note: this file is used inside the content, so isn't part of theming */ background-color: green; diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/content.mobile.min.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/content.mobile.min.css new file mode 100644 index 000000000000..1b8724679068 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/content.mobile.min.css @@ -0,0 +1,7 @@ +/** +* Copyright (c) Tiny Technologies, Inc. All rights reserved. +* Licensed under the LGPL or a commercial license. +* For LGPL see License.txt in the project root for license information. +* For commercial licenses see https://www.tiny.cloud/ +*/ +.tinymce-mobile-unfocused-selections .tinymce-mobile-unfocused-selection{background-color:green;display:inline-block;opacity:.5;position:absolute}body{-webkit-text-size-adjust:none}body img{max-width:96vw}body table img{max-width:95%}body{font-family:sans-serif}table{border-collapse:collapse} \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/fonts/tinymce-mobile.woff similarity index 100% rename from common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff rename to common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/fonts/tinymce-mobile.woff diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/skin.css similarity index 91% rename from common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.css rename to common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/skin.css index d7ca4368753b..7b85a32197f9 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.css +++ b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/skin.css @@ -1,14 +1,15 @@ /** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ +* Copyright (c) Tiny Technologies, Inc. All rights reserved. +* Licensed under the LGPL or a commercial license. +* For LGPL see License.txt in the project root for license information. +* For commercial licenses see https://www.tiny.cloud/ +*/ .tox { + box-shadow: none; box-sizing: content-box; color: #222f3e; cursor: auto; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-weight: normal; @@ -42,6 +43,7 @@ /* stylelint-disable-line no-duplicate-selectors */ background: transparent; border: 0; + box-shadow: none; float: none; height: auto; margin: 0; @@ -60,13 +62,13 @@ text-align: right; } .tox-tinymce { - border: 1px solid #cccccc; - border-radius: 0; + border: 1px solid #9e9e9e; + border-radius: 0px; box-shadow: none; box-sizing: border-box; display: flex; flex-direction: column; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; overflow: hidden; position: relative; visibility: inherit !important; @@ -76,12 +78,13 @@ box-shadow: none; } .tox-tinymce-inline .tox-editor-header { - border: 1px solid #cccccc; - border-radius: 0; + background-color: transparent; + border: 1px solid #9e9e9e; + border-radius: 0px; box-shadow: none; } .tox-tinymce-aux { - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; z-index: 1300; } .tox-tinymce *:focus, @@ -91,6 +94,9 @@ button::-moz-focus-inner { border: 0; } +.tox[dir=rtl] .tox-icon--flip svg { + transform: rotateY(180deg); +} .tox .accessibility-issue__header { align-items: center; display: flex; @@ -98,7 +104,7 @@ button::-moz-focus-inner { } .tox .accessibility-issue__description { align-items: stretch; - border: 1px solid #cccccc; + border: 1px solid #9e9e9e; border-radius: 3px; display: flex; justify-content: space-between; @@ -112,7 +118,7 @@ button::-moz-focus-inner { margin-bottom: 4px; } .tox .accessibility-issue__description > *:last-child:not(:only-child) { - border-color: #cccccc; + border-color: #9e9e9e; border-style: solid; } .tox .accessibility-issue__repair { @@ -238,7 +244,7 @@ button::-moz-focus-inner { color: #fff; cursor: pointer; display: inline-block; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; font-style: normal; font-weight: bold; @@ -249,7 +255,7 @@ button::-moz-focus-inner { padding: 4px 16px; text-align: center; text-decoration: none; - text-transform: capitalize; + text-transform: none; white-space: nowrap; } .tox .tox-button[disabled] { @@ -299,7 +305,7 @@ button::-moz-focus-inner { outline: none; padding: 4px 16px; text-decoration: none; - text-transform: capitalize; + text-transform: none; } .tox .tox-button--secondary[disabled] { background-color: #f0f0f0; @@ -346,7 +352,7 @@ button::-moz-focus-inner { box-sizing: border-box; cursor: pointer; display: inline-block; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px; font-weight: normal; line-height: 1.3; @@ -497,7 +503,7 @@ button::-moz-focus-inner { } .tox .tox-collection--list .tox-collection__group { border-bottom-width: 0; - border-color: #cccccc; + border-color: #9e9e9e; border-left-width: 0; border-right-width: 0; border-style: solid; @@ -508,7 +514,7 @@ button::-moz-focus-inner { border-top-width: 0; } .tox .tox-collection__group-heading { - background-color: #e6e6e6; + background-color: #b8b8b8; color: rgba(34, 47, 62, 0.7); cursor: default; font-size: 12px; @@ -520,7 +526,6 @@ button::-moz-focus-inner { text-transform: none; -webkit-touch-callout: none; -webkit-user-select: none; - -moz-user-select: none; -ms-user-select: none; user-select: none; } @@ -531,7 +536,6 @@ button::-moz-focus-inner { display: flex; -webkit-touch-callout: none; -webkit-user-select: none; - -moz-user-select: none; -ms-user-select: none; user-select: none; } @@ -551,21 +555,21 @@ button::-moz-focus-inner { color: #222f3e; } .tox .tox-collection--list .tox-collection__item--active { - background-color: #dee0e2; + background-color: #c1cad5; } .tox .tox-collection--toolbar .tox-collection__item--enabled { - background-color: #c8cbcf; + background-color: #b2beca; color: #222f3e; } .tox .tox-collection--toolbar .tox-collection__item--active { - background-color: #dee0e2; + background-color: #c1cad5; } .tox .tox-collection--grid .tox-collection__item--enabled { - background-color: #c8cbcf; + background-color: #b2beca; color: #222f3e; } .tox .tox-collection--grid .tox-collection__item--active:not(.tox-collection__item--state-disabled) { - background-color: #dee0e2; + background-color: #c1cad5; color: #222f3e; } .tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled) { @@ -574,11 +578,6 @@ button::-moz-focus-inner { .tox .tox-collection--toolbar .tox-collection__item--active:not(.tox-collection__item--state-disabled) { color: #222f3e; } -.tox .tox-collection__item--state-disabled { - background-color: transparent; - color: rgba(34, 47, 62, 0.5); - cursor: not-allowed; -} .tox .tox-collection__item-icon, .tox .tox-collection__item-checkmark { align-items: center; @@ -628,6 +627,14 @@ button::-moz-focus-inner { .tox .tox-collection__item-caret svg { fill: #222f3e; } +.tox .tox-collection__item--state-disabled { + background-color: transparent; + color: rgba(34, 47, 62, 0.5); + cursor: not-allowed; +} +.tox .tox-collection__item--state-disabled .tox-collection__item-caret svg { + fill: rgba(34, 47, 62, 0.5); +} .tox .tox-collection--list .tox-collection__item:not(.tox-collection__item--enabled) .tox-collection__item-checkmark svg { display: none; } @@ -636,7 +643,7 @@ button::-moz-focus-inner { } .tox .tox-collection--horizontal { background-color: #fff; - border: 1px solid #cccccc; + border: 1px solid #9e9e9e; border-radius: 3px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); display: flex; @@ -665,13 +672,61 @@ button::-moz-focus-inner { .tox .tox-collection--horizontal .tox-collection__item-caret { margin-left: 4px; } +.tox .tox-collection__item-container { + display: flex; +} +.tox .tox-collection__item-container--row { + align-items: center; + flex: 1 1 auto; + flex-direction: row; +} +.tox .tox-collection__item-container--row.tox-collection__item-container--align-left { + margin-right: auto; +} +.tox .tox-collection__item-container--row.tox-collection__item-container--align-right { + justify-content: flex-end; + margin-left: auto; +} +.tox .tox-collection__item-container--row.tox-collection__item-container--valign-top { + align-items: flex-start; + margin-bottom: auto; +} +.tox .tox-collection__item-container--row.tox-collection__item-container--valign-middle { + align-items: center; +} +.tox .tox-collection__item-container--row.tox-collection__item-container--valign-bottom { + align-items: flex-end; + margin-top: auto; +} +.tox .tox-collection__item-container--column { + -ms-grid-row-align: center; + align-self: center; + flex: 1 1 auto; + flex-direction: column; +} +.tox .tox-collection__item-container--column.tox-collection__item-container--align-left { + align-items: flex-start; +} +.tox .tox-collection__item-container--column.tox-collection__item-container--align-right { + align-items: flex-end; +} +.tox .tox-collection__item-container--column.tox-collection__item-container--valign-top { + align-self: flex-start; +} +.tox .tox-collection__item-container--column.tox-collection__item-container--valign-middle { + -ms-grid-row-align: center; + align-self: center; +} +.tox .tox-collection__item-container--column.tox-collection__item-container--valign-bottom { + align-self: flex-end; +} .tox:not([dir=rtl]) .tox-collection--horizontal .tox-collection__group:not(:last-of-type) { - border-right: 1px solid #cccccc; + border-right: 1px solid #9e9e9e; } .tox:not([dir=rtl]) .tox-collection--list .tox-collection__item > *:not(:first-child) { margin-left: 8px; } -.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item-label:first-child { +.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item > .tox-collection__item-label:first-child { margin-left: 4px; } .tox:not([dir=rtl]) .tox-collection__item-accessory { @@ -682,20 +737,14 @@ button::-moz-focus-inner { margin-left: 16px; } .tox[dir=rtl] .tox-collection--horizontal .tox-collection__group:not(:last-of-type) { - border-left: 1px solid #cccccc; + border-left: 1px solid #9e9e9e; } .tox[dir=rtl] .tox-collection--list .tox-collection__item > *:not(:first-child) { margin-right: 8px; } -.tox[dir=rtl] .tox-collection--list .tox-collection__item-label:first-child { +.tox[dir=rtl] .tox-collection--list .tox-collection__item > .tox-collection__item-label:first-child { margin-right: 4px; } -.tox[dir=rtl] .tox-collection__item-icon-rtl { - /* stylelint-disable-next-line no-descending-specificity */ -} -.tox[dir=rtl] .tox-collection__item-icon-rtl .tox-collection__item-icon svg { - transform: rotateY(180deg); -} .tox[dir=rtl] .tox-collection__item-accessory { margin-right: 16px; text-align: left; @@ -857,7 +906,7 @@ button::-moz-focus-inner { width: 24px; } .tox .tox-swatches__picker-btn:hover { - background: #dee0e2; + background: #c1cad5; } .tox:not([dir=rtl]) .tox-swatches__picker-btn { margin-left: auto; @@ -874,7 +923,7 @@ button::-moz-focus-inner { } .tox .tox-comment { background: #fff; - border: 1px solid #cccccc; + border: 1px solid #9e9e9e; border-radius: 3px; box-shadow: 0 4px 8px 0 rgba(34, 47, 62, 0.1); padding: 8px 8px 16px 8px; @@ -1091,7 +1140,7 @@ button::-moz-focus-inner { } .tox .tox-dialog { background-color: #fff; - border-color: #cccccc; + border-color: #9e9e9e; border-radius: 3px; border-style: solid; border-width: 1px; @@ -1144,7 +1193,7 @@ button::-moz-focus-inner { margin-left: auto; } .tox .tox-dialog__title { - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 20px; font-style: normal; font-weight: normal; @@ -1309,7 +1358,7 @@ button::-moz-focus-inner { .tox .tox-dialog__footer { align-items: center; background-color: #fff; - border-top: 1px solid #cccccc; + border-top: 1px solid #9e9e9e; display: flex; justify-content: space-between; padding: 8px 16px; @@ -1339,7 +1388,7 @@ button::-moz-focus-inner { padding-bottom: 8px; } .tox .tox-dialog__table tbody tr { - border-bottom: 1px solid #cccccc; + border-bottom: 1px solid #9e9e9e; } .tox .tox-dialog__table tbody tr:last-child { border-bottom: none; @@ -1383,9 +1432,6 @@ button::-moz-focus-inner { .tox .tox-dialog-dock-transition.tox-dialog-dock-fadein { transition-delay: 0s; } -body.tox-dialog__disable-scroll { - overflow: hidden; -} .tox.tox-platform-ie { /* IE11 CSS styles go here */ } @@ -1423,6 +1469,9 @@ body.tox-dialog__disable-scroll { .tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-end > * { margin-right: 8px; } +body.tox-dialog__disable-scroll { + overflow: hidden; +} .tox .tox-dropzone-container { display: flex; flex: 1; @@ -1431,7 +1480,7 @@ body.tox-dialog__disable-scroll { .tox .tox-dropzone { align-items: center; background: #fff; - border: 2px dashed #cccccc; + border: 2px dashed #9e9e9e; box-sizing: border-box; display: flex; flex-direction: column; @@ -1462,7 +1511,7 @@ body.tox-dialog__disable-scroll { width: 100%; } .tox.tox-inline-edit-area { - border: 1px dotted #cccccc; + border: 1px dotted #9e9e9e; } .tox .tox-editor-container { display: flex; @@ -1482,6 +1531,7 @@ body.tox-dialog__disable-scroll { margin-bottom: -1px; } .tox.tox-tinymce--toolbar-sticky-on .tox-editor-header { + background-color: transparent; box-shadow: 0 4px 4px -3px rgba(0, 0, 0, 0.25); } .tox-editor-dock-fadeout { @@ -1708,14 +1758,14 @@ body.tox-dialog__disable-scroll { -moz-appearance: none; appearance: none; background-color: #fff; - border-color: #cccccc; + border-color: #9e9e9e; border-radius: 3px; border-style: solid; border-width: 1px; box-shadow: none; box-sizing: border-box; color: #222f3e; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px; line-height: 24px; margin: 0; @@ -1808,14 +1858,14 @@ body.tox-dialog__disable-scroll { -moz-appearance: none; appearance: none; background-color: #fff; - border-color: #cccccc; + border-color: #9e9e9e; border-radius: 3px; border-style: solid; border-width: 1px; box-shadow: none; box-sizing: border-box; color: #222f3e; - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; + font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px; line-height: 24px; margin: 0; @@ -1868,24 +1918,29 @@ body.tox-dialog__disable-scroll { .tox-fullscreen { border: 0; height: 100%; - left: 0; margin: 0; overflow: hidden; -ms-scroll-chaining: none; overscroll-behavior: none; padding: 0; - position: fixed; - top: 0; touch-action: pinch-zoom; width: 100%; } -.tox-fullscreen .tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle { +.tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle { display: none; } -.tox-fullscreen .tox.tox-tinymce.tox-fullscreen { +.tox.tox-tinymce.tox-fullscreen, +.tox-shadowhost.tox-fullscreen { + left: 0; + position: fixed; + top: 0; z-index: 1200; } -.tox-fullscreen .tox.tox-tinymce-aux { +.tox.tox-tinymce.tox-fullscreen { + background-color: transparent; +} +.tox-fullscreen .tox.tox-tinymce-aux, +.tox-fullscreen ~ .tox.tox-tinymce-aux { z-index: 1201; } .tox .tox-help__more-link { @@ -1990,7 +2045,7 @@ body.tox-dialog__disable-scroll { width: 170px; } .tox .tox-insert-table-picker > div { - border-color: #cccccc; + border-color: #9e9e9e; border-style: solid; border-width: 0 1px 1px 0; box-sizing: border-box; @@ -2030,7 +2085,7 @@ body.tox-dialog__disable-scroll { } .tox .tox-menu { background-color: #fff; - border: 1px solid #cccccc; + border: 1px solid #9e9e9e; border-radius: 3px; box-shadow: 0 4px 8px 0 rgba(34, 47, 62, 0.1); display: inline-block; @@ -2059,8 +2114,8 @@ body.tox-dialog__disable-scroll { margin: 0; } .tox .tox-menubar { - background: url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23cccccc'/%3E%3C/svg%3E") left 0 top 0 #fff; - background-color: #fff; + background: url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%239e9e9e'/%3E%3C/svg%3E") left 0 top 0 #f0f0f0; + background-color: #f0f0f0; display: flex; flex: 0 0 auto; flex-shrink: 0; @@ -2068,7 +2123,7 @@ body.tox-dialog__disable-scroll { padding: 0 4px 0 4px; } .tox.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-menubar { - border-top: 1px solid #cccccc; + border-top: 1px solid #9e9e9e; } /* Deprecated. Remove in next major release */ .tox .tox-mbtn { @@ -2077,7 +2132,7 @@ body.tox-dialog__disable-scroll { border: 0; border-radius: 3px; box-shadow: none; - color: #222f3e; + color: #626b73; display: flex; flex: 0 0 auto; font-size: 14px; @@ -2096,26 +2151,26 @@ body.tox-dialog__disable-scroll { background-color: transparent; border: 0; box-shadow: none; - color: rgba(34, 47, 62, 0.5); + color: rgba(98, 107, 115, 0.5); cursor: not-allowed; } .tox .tox-mbtn:focus:not(:disabled) { - background: #dee0e2; + background: #c1cad5; border: 0; box-shadow: none; - color: #222f3e; + color: #626b73; } .tox .tox-mbtn--active { - background: #c8cbcf; + background: #b2beca; border: 0; box-shadow: none; - color: #222f3e; + color: #626b73; } .tox .tox-mbtn:hover:not(:disabled):not(.tox-mbtn--active) { - background: #dee0e2; + background: #c1cad5; border: 0; box-shadow: none; - color: #222f3e; + color: #626b73; } .tox .tox-mbtn__select-label { cursor: default; @@ -2143,7 +2198,7 @@ body.tox-dialog__disable-scroll { font-size: 14px; font-weight: normal; -ms-grid-columns: minmax(40px, 1fr) auto minmax(40px, 1fr); - grid-template-columns: minmax(40px, 1fr) auto minmax(40px, 1fr); + grid-template-columns: minmax(40px, 1fr) auto minmax(40px, 1fr); margin-top: 4px; opacity: 0; padding: 4px; @@ -2154,6 +2209,7 @@ body.tox-dialog__disable-scroll { font-weight: normal; } .tox .tox-notification a { + cursor: pointer; text-decoration: underline; } .tox .tox-notification--in { @@ -2293,12 +2349,21 @@ body.tox-dialog__disable-scroll { .tox .tox-pop--resizing { transition: width 0.1s ease; } -.tox .tox-pop--resizing .tox-toolbar { +.tox .tox-pop--resizing .tox-toolbar, +.tox .tox-pop--resizing .tox-toolbar__group { flex-wrap: nowrap; } +.tox .tox-pop--transition { + transition: 0.15s ease; + transition-property: left, right, top, bottom; +} +.tox .tox-pop--transition::before, +.tox .tox-pop--transition::after { + transition: all 0.15s, visibility 0s, opacity 0.075s ease 0.075s; +} .tox .tox-pop__dialog { background-color: #fff; - border: 1px solid #cccccc; + border: 1px solid #9e9e9e; border-radius: 3px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); min-width: 0; @@ -2317,9 +2382,15 @@ body.tox-dialog__disable-scroll { content: ''; display: block; height: 0; + opacity: 1; position: absolute; width: 0; } +.tox .tox-pop.tox-pop--inset::before, +.tox .tox-pop.tox-pop--inset::after { + opacity: 0; + transition: all 0s 0.15s, visibility 0s, opacity 0.075s ease; +} .tox .tox-pop.tox-pop--bottom::before, .tox .tox-pop.tox-pop--bottom::after { left: 50%; @@ -2332,7 +2403,7 @@ body.tox-dialog__disable-scroll { margin-top: -1px; } .tox .tox-pop.tox-pop--bottom::before { - border-color: #cccccc transparent transparent transparent; + border-color: #9e9e9e transparent transparent transparent; border-width: 9px; margin-left: -9px; } @@ -2349,7 +2420,7 @@ body.tox-dialog__disable-scroll { margin-top: 1px; } .tox .tox-pop.tox-pop--top::before { - border-color: transparent transparent #cccccc transparent; + border-color: transparent transparent #9e9e9e transparent; border-width: 9px; margin-left: -9px; } @@ -2365,7 +2436,7 @@ body.tox-dialog__disable-scroll { margin-left: -15px; } .tox .tox-pop.tox-pop--left::before { - border-color: transparent #cccccc transparent transparent; + border-color: transparent #9e9e9e transparent transparent; border-width: 10px; margin-left: -19px; } @@ -2381,7 +2452,7 @@ body.tox-dialog__disable-scroll { margin-left: -1px; } .tox .tox-pop.tox-pop--right::before { - border-color: transparent transparent transparent #cccccc; + border-color: transparent transparent transparent #9e9e9e; border-width: 10px; margin-left: -1px; } @@ -2452,7 +2523,7 @@ body.tox-dialog__disable-scroll { } .tox .tox-slider__rail { background-color: transparent; - border: 1px solid #cccccc; + border: 1px solid #9e9e9e; border-radius: 3px; height: 10px; min-width: 120px; @@ -2508,7 +2579,7 @@ body.tox-dialog__disable-scroll { .tox .tox-statusbar { align-items: center; background-color: #fff; - border-top: 1px solid #cccccc; + border-top: 1px solid #9e9e9e; color: rgba(34, 47, 62, 0.7); display: flex; flex: 0 0 auto; @@ -2572,6 +2643,11 @@ body.tox-dialog__disable-scroll { display: block; fill: rgba(34, 47, 62, 0.7); } +.tox .tox-statusbar__resize-handle:focus svg { + background-color: #dee0e2; + border-radius: 1px; + box-shadow: 0 0 0 2px #dee0e2; +} .tox:not([dir=rtl]) .tox-statusbar__path > * { margin-right: 4px; } @@ -2585,7 +2661,7 @@ body.tox-dialog__disable-scroll { margin-left: 4px; } .tox .tox-throbber { - z-index: 1400; + z-index: 1299; } .tox .tox-throbber__busy-spinner { align-items: center; @@ -2604,7 +2680,7 @@ body.tox-dialog__disable-scroll { border: 0; border-radius: 3px; box-shadow: none; - color: #222f3e; + color: #626b73; display: flex; flex: 0 0 auto; font-size: 14px; @@ -2621,7 +2697,7 @@ body.tox-dialog__disable-scroll { } .tox .tox-tbtn svg { display: block; - fill: #222f3e; + fill: #626b73; } .tox .tox-tbtn.tox-tbtn-more { padding-left: 5px; @@ -2629,27 +2705,27 @@ body.tox-dialog__disable-scroll { width: inherit; } .tox .tox-tbtn:focus { - background: #dee0e2; + background: #c1cad5; border: 0; box-shadow: none; } .tox .tox-tbtn:hover { - background: #dee0e2; + background: #c1cad5; border: 0; box-shadow: none; - color: #222f3e; + color: #626b73; } .tox .tox-tbtn:hover svg { - fill: #222f3e; + fill: #626b73; } .tox .tox-tbtn:active { - background: #c8cbcf; + background: #b2beca; border: 0; box-shadow: none; - color: #222f3e; + color: #626b73; } .tox .tox-tbtn:active svg { - fill: #222f3e; + fill: #626b73; } .tox .tox-tbtn--disabled, .tox .tox-tbtn--disabled:hover, @@ -2658,7 +2734,7 @@ body.tox-dialog__disable-scroll { background: transparent; border: 0; box-shadow: none; - color: rgba(34, 47, 62, 0.5); + color: rgba(98, 107, 115, 0.5); cursor: not-allowed; } .tox .tox-tbtn--disabled svg, @@ -2666,14 +2742,14 @@ body.tox-dialog__disable-scroll { .tox .tox-tbtn:disabled svg, .tox .tox-tbtn:disabled:hover svg { /* stylelint-disable-line no-descending-specificity */ - fill: rgba(34, 47, 62, 0.5); + fill: rgba(98, 107, 115, 0.5); } .tox .tox-tbtn--enabled, .tox .tox-tbtn--enabled:hover { - background: #c8cbcf; + background: #b2beca; border: 0; box-shadow: none; - color: #222f3e; + color: #626b73; } .tox .tox-tbtn--enabled > *, .tox .tox-tbtn--enabled:hover > * { @@ -2682,13 +2758,13 @@ body.tox-dialog__disable-scroll { .tox .tox-tbtn--enabled svg, .tox .tox-tbtn--enabled:hover svg { /* stylelint-disable-line no-descending-specificity */ - fill: #222f3e; + fill: #626b73; } .tox .tox-tbtn:focus:not(.tox-tbtn--disabled) { - color: #222f3e; + color: #626b73; } .tox .tox-tbtn:focus:not(.tox-tbtn--disabled) svg { - fill: #222f3e; + fill: #626b73; } .tox .tox-tbtn:active > * { transform: none; @@ -2737,7 +2813,7 @@ body.tox-dialog__disable-scroll { width: 16px; } .tox .tox-tbtn__select-chevron svg { - fill: rgba(34, 47, 62, 0.5); + fill: rgba(98, 107, 115, 0.5); } .tox .tox-tbtn--bespoke .tox-tbtn__select-label { overflow: hidden; @@ -2754,12 +2830,12 @@ body.tox-dialog__disable-scroll { overflow: hidden; } .tox .tox-split-button:hover { - box-shadow: 0 0 0 1px #dee0e2 inset; + box-shadow: 0 0 0 1px #c1cad5 inset; } .tox .tox-split-button:focus { - background: #dee0e2; + background: #c1cad5; box-shadow: none; - color: #222f3e; + color: #626b73; } .tox .tox-split-button > * { border-radius: 0; @@ -2768,7 +2844,7 @@ body.tox-dialog__disable-scroll { width: 16px; } .tox .tox-split-button__chevron svg { - fill: rgba(34, 47, 62, 0.5); + fill: rgba(98, 107, 115, 0.5); } .tox .tox-split-button .tox-tbtn { margin: 0; @@ -2785,16 +2861,16 @@ body.tox-dialog__disable-scroll { .tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:focus { background: transparent; box-shadow: none; - color: rgba(34, 47, 62, 0.5); + color: rgba(98, 107, 115, 0.5); } .tox .tox-toolbar-overlord { - background-color: #fff; + background-color: #f0f0f0; } .tox .tox-toolbar, .tox .tox-toolbar__primary, .tox .tox-toolbar__overflow { - background: url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%23cccccc'/%3E%3C/svg%3E") left 0 top 0 #fff; - background-color: #fff; + background: url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%239e9e9e'/%3E%3C/svg%3E") left 0 top 0 #f0f0f0; + background-color: #f0f0f0; display: flex; flex: 0 0 auto; flex-shrink: 0; @@ -2816,7 +2892,7 @@ body.tox-dialog__disable-scroll { } .tox .tox-menubar + .tox-toolbar, .tox .tox-menubar + .tox-toolbar-overlord .tox-toolbar__primary { - border-top: 1px solid #cccccc; + border-top: 1px solid #9e9e9e; margin-top: -1px; } .tox .tox-toolbar--scrolling { @@ -2831,17 +2907,14 @@ body.tox-dialog__disable-scroll { } .tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar:first-child, .tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar-overlord:first-child .tox-toolbar__primary { - border-top: 1px solid #cccccc; + border-top: 1px solid #9e9e9e; } .tox.tox-tinymce-aux .tox-toolbar__overflow { background-color: #fff; - border: 1px solid #cccccc; + border: 1px solid #9e9e9e; border-radius: 3px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); } -.tox[dir=rtl] .tox-tbtn__icon-rtl svg { - transform: rotateY(180deg); -} .tox .tox-toolbar__group { align-items: center; display: flex; @@ -2857,10 +2930,10 @@ body.tox-dialog__disable-scroll { flex-wrap: nowrap; } .tox:not([dir=rtl]) .tox-toolbar__group:not(:last-of-type) { - border-right: 1px solid #cccccc; + border-right: 1px solid #9e9e9e; } .tox[dir=rtl] .tox-toolbar__group:not(:last-of-type) { - border-left: 1px solid #cccccc; + border-left: 1px solid #9e9e9e; } .tox .tox-tooltip { display: inline-block; @@ -2918,7 +2991,7 @@ body.tox-dialog__disable-scroll { transform: translateY(-50%); } .tox .tox-well { - border: 1px solid #cccccc; + border: 1px solid #9e9e9e; border-radius: 3px; padding: 8px; width: 100%; @@ -2933,7 +3006,7 @@ body.tox-dialog__disable-scroll { margin: 0; } .tox .tox-custom-editor { - border: 1px solid #cccccc; + border: 1px solid #9e9e9e; border-radius: 3px; display: flex; flex: 1; diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/skin.min.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/skin.min.css new file mode 100644 index 000000000000..7956bd3d1758 --- /dev/null +++ b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/skin.min.css @@ -0,0 +1,7 @@ +/** +* Copyright (c) Tiny Technologies, Inc. All rights reserved. +* Licensed under the LGPL or a commercial license. +* For LGPL see License.txt in the project root for license information. +* For commercial licenses see https://www.tiny.cloud/ +*/ +.tox{box-shadow:none;box-sizing:content-box;color:#222f3e;cursor:auto;font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:16px;font-style:normal;font-weight:400;line-height:normal;-webkit-tap-highlight-color:transparent;text-decoration:none;text-shadow:none;text-transform:none;vertical-align:initial;white-space:normal}.tox :not(svg):not(rect){box-sizing:inherit;color:inherit;cursor:inherit;direction:inherit;font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;line-height:inherit;-webkit-tap-highlight-color:inherit;text-align:inherit;text-decoration:inherit;text-shadow:inherit;text-transform:inherit;vertical-align:inherit;white-space:inherit}.tox :not(svg):not(rect){background:0 0;border:0;box-shadow:none;float:none;height:auto;margin:0;max-width:none;outline:0;padding:0;position:static;width:auto}.tox:not([dir=rtl]){direction:ltr;text-align:left}.tox[dir=rtl]{direction:rtl;text-align:right}.tox-tinymce{border:1px solid #9e9e9e;border-radius:0;box-shadow:none;box-sizing:border-box;display:flex;flex-direction:column;font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;overflow:hidden;position:relative;visibility:inherit!important}.tox-tinymce-inline{border:none;box-shadow:none}.tox-tinymce-inline .tox-editor-header{background-color:transparent;border:1px solid #9e9e9e;border-radius:0;box-shadow:none}.tox-tinymce-aux{font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;z-index:1300}.tox-tinymce :focus,.tox-tinymce-aux :focus{outline:0}button::-moz-focus-inner{border:0}.tox[dir=rtl] .tox-icon--flip svg{transform:rotateY(180deg)}.tox .accessibility-issue__header{align-items:center;display:flex;margin-bottom:4px}.tox .accessibility-issue__description{align-items:stretch;border:1px solid #9e9e9e;border-radius:3px;display:flex;justify-content:space-between}.tox .accessibility-issue__description>div{padding-bottom:4px}.tox .accessibility-issue__description>div>div{align-items:center;display:flex;margin-bottom:4px}.tox .accessibility-issue__description>:last-child:not(:only-child){border-color:#9e9e9e;border-style:solid}.tox .accessibility-issue__repair{margin-top:16px}.tox .tox-dialog__body-content .accessibility-issue--info .accessibility-issue__description{background-color:rgba(32,122,183,.1);border-color:rgba(32,122,183,.4);color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--info .accessibility-issue__description>:last-child{border-color:rgba(32,122,183,.4)}.tox .tox-dialog__body-content .accessibility-issue--info .tox-form__group h2{color:#207ab7}.tox .tox-dialog__body-content .accessibility-issue--info .tox-icon svg{fill:#207ab7}.tox .tox-dialog__body-content .accessibility-issue--info a .tox-icon{color:#207ab7}.tox .tox-dialog__body-content .accessibility-issue--warn .accessibility-issue__description{background-color:rgba(255,165,0,.1);border-color:rgba(255,165,0,.5);color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--warn .accessibility-issue__description>:last-child{border-color:rgba(255,165,0,.5)}.tox .tox-dialog__body-content .accessibility-issue--warn .tox-form__group h2{color:#cc8500}.tox .tox-dialog__body-content .accessibility-issue--warn .tox-icon svg{fill:#cc8500}.tox .tox-dialog__body-content .accessibility-issue--warn a .tox-icon{color:#cc8500}.tox .tox-dialog__body-content .accessibility-issue--error .accessibility-issue__description{background-color:rgba(204,0,0,.1);border-color:rgba(204,0,0,.4);color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--error .accessibility-issue__description>:last-child{border-color:rgba(204,0,0,.4)}.tox .tox-dialog__body-content .accessibility-issue--error .tox-form__group h2{color:#c00}.tox .tox-dialog__body-content .accessibility-issue--error .tox-icon svg{fill:#c00}.tox .tox-dialog__body-content .accessibility-issue--error a .tox-icon{color:#c00}.tox .tox-dialog__body-content .accessibility-issue--success .accessibility-issue__description{background-color:rgba(120,171,70,.1);border-color:rgba(120,171,70,.4);color:#222f3e}.tox .tox-dialog__body-content .accessibility-issue--success .accessibility-issue__description>:last-child{border-color:rgba(120,171,70,.4)}.tox .tox-dialog__body-content .accessibility-issue--success .tox-form__group h2{color:#78ab46}.tox .tox-dialog__body-content .accessibility-issue--success .tox-icon svg{fill:#78ab46}.tox .tox-dialog__body-content .accessibility-issue--success a .tox-icon{color:#78ab46}.tox .tox-dialog__body-content .accessibility-issue__header h1,.tox .tox-dialog__body-content .tox-form__group .accessibility-issue__description h2{margin-top:0}.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__header .tox-button{margin-left:4px}.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__header>:nth-last-child(2){margin-left:auto}.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__description{padding:4px 4px 4px 8px}.tox:not([dir=rtl]) .tox-dialog__body-content .accessibility-issue__description>:last-child{border-left-width:1px;padding-left:4px}.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__header .tox-button{margin-right:4px}.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__header>:nth-last-child(2){margin-right:auto}.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__description{padding:4px 8px 4px 4px}.tox[dir=rtl] .tox-dialog__body-content .accessibility-issue__description>:last-child{border-right-width:1px;padding-right:4px}.tox .tox-anchorbar{display:flex;flex:0 0 auto}.tox .tox-bar{display:flex;flex:0 0 auto}.tox .tox-button{background-color:#207ab7;background-image:none;background-position:0 0;background-repeat:repeat;border-color:#207ab7;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-block;font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;font-style:normal;font-weight:700;letter-spacing:normal;line-height:24px;margin:0;outline:0;padding:4px 16px;text-align:center;text-decoration:none;text-transform:none;white-space:nowrap}.tox .tox-button[disabled]{background-color:#207ab7;background-image:none;border-color:#207ab7;box-shadow:none;color:rgba(255,255,255,.5);cursor:not-allowed}.tox .tox-button:focus:not(:disabled){background-color:#1c6ca1;background-image:none;border-color:#1c6ca1;box-shadow:none;color:#fff}.tox .tox-button:hover:not(:disabled){background-color:#1c6ca1;background-image:none;border-color:#1c6ca1;box-shadow:none;color:#fff}.tox .tox-button:active:not(:disabled){background-color:#185d8c;background-image:none;border-color:#185d8c;box-shadow:none;color:#fff}.tox .tox-button--secondary{background-color:#f0f0f0;background-image:none;background-position:0 0;background-repeat:repeat;border-color:#f0f0f0;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;color:#222f3e;font-size:14px;font-style:normal;font-weight:700;letter-spacing:normal;outline:0;padding:4px 16px;text-decoration:none;text-transform:none}.tox .tox-button--secondary[disabled]{background-color:#f0f0f0;background-image:none;border-color:#f0f0f0;box-shadow:none;color:rgba(34,47,62,.5)}.tox .tox-button--secondary:focus:not(:disabled){background-color:#e3e3e3;background-image:none;border-color:#e3e3e3;box-shadow:none;color:#222f3e}.tox .tox-button--secondary:hover:not(:disabled){background-color:#e3e3e3;background-image:none;border-color:#e3e3e3;box-shadow:none;color:#222f3e}.tox .tox-button--secondary:active:not(:disabled){background-color:#d6d6d6;background-image:none;border-color:#d6d6d6;box-shadow:none;color:#222f3e}.tox .tox-button--icon,.tox .tox-button.tox-button--icon,.tox .tox-button.tox-button--secondary.tox-button--icon{padding:4px}.tox .tox-button--icon .tox-icon svg,.tox .tox-button.tox-button--icon .tox-icon svg,.tox .tox-button.tox-button--secondary.tox-button--icon .tox-icon svg{display:block;fill:currentColor}.tox .tox-button-link{background:0;border:none;box-sizing:border-box;cursor:pointer;display:inline-block;font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;padding:0;white-space:nowrap}.tox .tox-button-link--sm{font-size:14px}.tox .tox-button--naked{background-color:transparent;border-color:transparent;box-shadow:unset;color:#222f3e}.tox .tox-button--naked[disabled]{background-color:#f0f0f0;border-color:#f0f0f0;box-shadow:none;color:rgba(34,47,62,.5)}.tox .tox-button--naked:hover:not(:disabled){background-color:#e3e3e3;border-color:#e3e3e3;box-shadow:none;color:#222f3e}.tox .tox-button--naked:focus:not(:disabled){background-color:#e3e3e3;border-color:#e3e3e3;box-shadow:none;color:#222f3e}.tox .tox-button--naked:active:not(:disabled){background-color:#d6d6d6;border-color:#d6d6d6;box-shadow:none;color:#222f3e}.tox .tox-button--naked .tox-icon svg{fill:currentColor}.tox .tox-button--naked.tox-button--icon:hover:not(:disabled){color:#222f3e}.tox .tox-checkbox{align-items:center;border-radius:3px;cursor:pointer;display:flex;height:36px;min-width:36px}.tox .tox-checkbox__input{height:1px;overflow:hidden;position:absolute;top:auto;width:1px}.tox .tox-checkbox__icons{align-items:center;border-radius:3px;box-shadow:0 0 0 2px transparent;box-sizing:content-box;display:flex;height:24px;justify-content:center;padding:calc(4px - 1px);width:24px}.tox .tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display:block;fill:rgba(34,47,62,.3)}.tox .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{display:none;fill:#207ab7}.tox .tox-checkbox__icons .tox-checkbox-icon__checked svg{display:none;fill:#207ab7}.tox .tox-checkbox--disabled{color:rgba(34,47,62,.5);cursor:not-allowed}.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__checked svg{fill:rgba(34,47,62,.5)}.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__unchecked svg{fill:rgba(34,47,62,.5)}.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{fill:rgba(34,47,62,.5)}.tox input.tox-checkbox__input:checked+.tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display:none}.tox input.tox-checkbox__input:checked+.tox-checkbox__icons .tox-checkbox-icon__checked svg{display:block}.tox input.tox-checkbox__input:indeterminate+.tox-checkbox__icons .tox-checkbox-icon__unchecked svg{display:none}.tox input.tox-checkbox__input:indeterminate+.tox-checkbox__icons .tox-checkbox-icon__indeterminate svg{display:block}.tox input.tox-checkbox__input:focus+.tox-checkbox__icons{border-radius:3px;box-shadow:inset 0 0 0 1px #207ab7;padding:calc(4px - 1px)}.tox:not([dir=rtl]) .tox-checkbox__label{margin-left:4px}.tox:not([dir=rtl]) .tox-checkbox__input{left:-10000px}.tox:not([dir=rtl]) .tox-bar .tox-checkbox{margin-left:4px}.tox[dir=rtl] .tox-checkbox__label{margin-right:4px}.tox[dir=rtl] .tox-checkbox__input{right:-10000px}.tox[dir=rtl] .tox-bar .tox-checkbox{margin-right:4px}.tox .tox-collection--toolbar .tox-collection__group{display:flex;padding:0}.tox .tox-collection--grid .tox-collection__group{display:flex;flex-wrap:wrap;max-height:208px;overflow-x:hidden;overflow-y:auto;padding:0}.tox .tox-collection--list .tox-collection__group{border-bottom-width:0;border-color:#9e9e9e;border-left-width:0;border-right-width:0;border-style:solid;border-top-width:1px;padding:4px 0}.tox .tox-collection--list .tox-collection__group:first-child{border-top-width:0}.tox .tox-collection__group-heading{background-color:#b8b8b8;color:rgba(34,47,62,.7);cursor:default;font-size:12px;font-style:normal;font-weight:400;margin-bottom:4px;margin-top:-4px;padding:4px 8px;text-transform:none;-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.tox .tox-collection__item{align-items:center;color:#222f3e;cursor:pointer;display:flex;-webkit-touch-callout:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.tox .tox-collection--list .tox-collection__item{padding:4px 8px}.tox .tox-collection--toolbar .tox-collection__item{border-radius:3px;padding:4px}.tox .tox-collection--grid .tox-collection__item{border-radius:3px;padding:4px}.tox .tox-collection--list .tox-collection__item--enabled{background-color:#fff;color:#222f3e}.tox .tox-collection--list .tox-collection__item--active{background-color:#c1cad5}.tox .tox-collection--toolbar .tox-collection__item--enabled{background-color:#b2beca;color:#222f3e}.tox .tox-collection--toolbar .tox-collection__item--active{background-color:#c1cad5}.tox .tox-collection--grid .tox-collection__item--enabled{background-color:#b2beca;color:#222f3e}.tox .tox-collection--grid .tox-collection__item--active:not(.tox-collection__item--state-disabled){background-color:#c1cad5;color:#222f3e}.tox .tox-collection--list .tox-collection__item--active:not(.tox-collection__item--state-disabled){color:#222f3e}.tox .tox-collection--toolbar .tox-collection__item--active:not(.tox-collection__item--state-disabled){color:#222f3e}.tox .tox-collection__item-checkmark,.tox .tox-collection__item-icon{align-items:center;display:flex;height:24px;justify-content:center;width:24px}.tox .tox-collection__item-checkmark svg,.tox .tox-collection__item-icon svg{fill:currentColor}.tox .tox-collection--toolbar-lg .tox-collection__item-icon{height:48px;width:48px}.tox .tox-collection__item-label{color:currentColor;display:inline-block;flex:1;-ms-flex-preferred-size:auto;font-size:14px;font-style:normal;font-weight:400;line-height:24px;text-transform:none;word-break:break-all}.tox .tox-collection__item-accessory{color:rgba(34,47,62,.7);display:inline-block;font-size:14px;height:24px;line-height:24px;text-transform:none}.tox .tox-collection__item-caret{align-items:center;display:flex;min-height:24px}.tox .tox-collection__item-caret::after{content:'';font-size:0;min-height:inherit}.tox .tox-collection__item-caret svg{fill:#222f3e}.tox .tox-collection__item--state-disabled{background-color:transparent;color:rgba(34,47,62,.5);cursor:not-allowed}.tox .tox-collection__item--state-disabled .tox-collection__item-caret svg{fill:rgba(34,47,62,.5)}.tox .tox-collection--list .tox-collection__item:not(.tox-collection__item--enabled) .tox-collection__item-checkmark svg{display:none}.tox .tox-collection--list .tox-collection__item:not(.tox-collection__item--enabled) .tox-collection__item-accessory+.tox-collection__item-checkmark{display:none}.tox .tox-collection--horizontal{background-color:#fff;border:1px solid #9e9e9e;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.15);display:flex;flex:0 0 auto;flex-shrink:0;flex-wrap:nowrap;margin-bottom:0;overflow-x:auto;padding:0}.tox .tox-collection--horizontal .tox-collection__group{align-items:center;display:flex;flex-wrap:nowrap;margin:0;padding:0 4px}.tox .tox-collection--horizontal .tox-collection__item{height:34px;margin:2px 0 3px 0;padding:0 4px}.tox .tox-collection--horizontal .tox-collection__item-label{white-space:nowrap}.tox .tox-collection--horizontal .tox-collection__item-caret{margin-left:4px}.tox .tox-collection__item-container{display:flex}.tox .tox-collection__item-container--row{align-items:center;flex:1 1 auto;flex-direction:row}.tox .tox-collection__item-container--row.tox-collection__item-container--align-left{margin-right:auto}.tox .tox-collection__item-container--row.tox-collection__item-container--align-right{justify-content:flex-end;margin-left:auto}.tox .tox-collection__item-container--row.tox-collection__item-container--valign-top{align-items:flex-start;margin-bottom:auto}.tox .tox-collection__item-container--row.tox-collection__item-container--valign-middle{align-items:center}.tox .tox-collection__item-container--row.tox-collection__item-container--valign-bottom{align-items:flex-end;margin-top:auto}.tox .tox-collection__item-container--column{-ms-grid-row-align:center;align-self:center;flex:1 1 auto;flex-direction:column}.tox .tox-collection__item-container--column.tox-collection__item-container--align-left{align-items:flex-start}.tox .tox-collection__item-container--column.tox-collection__item-container--align-right{align-items:flex-end}.tox .tox-collection__item-container--column.tox-collection__item-container--valign-top{align-self:flex-start}.tox .tox-collection__item-container--column.tox-collection__item-container--valign-middle{-ms-grid-row-align:center;align-self:center}.tox .tox-collection__item-container--column.tox-collection__item-container--valign-bottom{align-self:flex-end}.tox:not([dir=rtl]) .tox-collection--horizontal .tox-collection__group:not(:last-of-type){border-right:1px solid #9e9e9e}.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item>:not(:first-child){margin-left:8px}.tox:not([dir=rtl]) .tox-collection--list .tox-collection__item>.tox-collection__item-label:first-child{margin-left:4px}.tox:not([dir=rtl]) .tox-collection__item-accessory{margin-left:16px;text-align:right}.tox:not([dir=rtl]) .tox-collection .tox-collection__item-caret{margin-left:16px}.tox[dir=rtl] .tox-collection--horizontal .tox-collection__group:not(:last-of-type){border-left:1px solid #9e9e9e}.tox[dir=rtl] .tox-collection--list .tox-collection__item>:not(:first-child){margin-right:8px}.tox[dir=rtl] .tox-collection--list .tox-collection__item>.tox-collection__item-label:first-child{margin-right:4px}.tox[dir=rtl] .tox-collection__item-accessory{margin-right:16px;text-align:left}.tox[dir=rtl] .tox-collection .tox-collection__item-caret{margin-right:16px;transform:rotateY(180deg)}.tox[dir=rtl] .tox-collection--horizontal .tox-collection__item-caret{margin-right:4px}.tox .tox-color-picker-container{display:flex;flex-direction:row;height:225px;margin:0}.tox .tox-sv-palette{box-sizing:border-box;display:flex;height:100%}.tox .tox-sv-palette-spectrum{height:100%}.tox .tox-sv-palette,.tox .tox-sv-palette-spectrum{width:225px}.tox .tox-sv-palette-thumb{background:0 0;border:1px solid #000;border-radius:50%;box-sizing:content-box;height:12px;position:absolute;width:12px}.tox .tox-sv-palette-inner-thumb{border:1px solid #fff;border-radius:50%;height:10px;position:absolute;width:10px}.tox .tox-hue-slider{box-sizing:border-box;height:100%;width:25px}.tox .tox-hue-slider-spectrum{background:linear-gradient(to bottom,red,#ff0080,#f0f,#8000ff,#00f,#0080ff,#0ff,#00ff80,#0f0,#80ff00,#ff0,#ff8000,red);height:100%;width:100%}.tox .tox-hue-slider,.tox .tox-hue-slider-spectrum{width:20px}.tox .tox-hue-slider-thumb{background:#fff;border:1px solid #000;box-sizing:content-box;height:4px;width:100%}.tox .tox-rgb-form{display:flex;flex-direction:column;justify-content:space-between}.tox .tox-rgb-form div{align-items:center;display:flex;justify-content:space-between;margin-bottom:5px;width:inherit}.tox .tox-rgb-form input{width:6em}.tox .tox-rgb-form input.tox-invalid{border:1px solid red!important}.tox .tox-rgb-form .tox-rgba-preview{border:1px solid #000;flex-grow:2;margin-bottom:0}.tox:not([dir=rtl]) .tox-sv-palette{margin-right:15px}.tox:not([dir=rtl]) .tox-hue-slider{margin-right:15px}.tox:not([dir=rtl]) .tox-hue-slider-thumb{margin-left:-1px}.tox:not([dir=rtl]) .tox-rgb-form label{margin-right:.5em}.tox[dir=rtl] .tox-sv-palette{margin-left:15px}.tox[dir=rtl] .tox-hue-slider{margin-left:15px}.tox[dir=rtl] .tox-hue-slider-thumb{margin-right:-1px}.tox[dir=rtl] .tox-rgb-form label{margin-left:.5em}.tox .tox-toolbar .tox-swatches,.tox .tox-toolbar__overflow .tox-swatches,.tox .tox-toolbar__primary .tox-swatches{margin:2px 0 3px 4px}.tox .tox-collection--list .tox-collection__group .tox-swatches-menu{border:0;margin:-4px 0}.tox .tox-swatches__row{display:flex}.tox .tox-swatch{height:30px;transition:transform .15s,box-shadow .15s;width:30px}.tox .tox-swatch:focus,.tox .tox-swatch:hover{box-shadow:0 0 0 1px rgba(127,127,127,.3) inset;transform:scale(.8)}.tox .tox-swatch--remove{align-items:center;display:flex;justify-content:center}.tox .tox-swatch--remove svg path{stroke:#e74c3c}.tox .tox-swatches__picker-btn{align-items:center;background-color:transparent;border:0;cursor:pointer;display:flex;height:30px;justify-content:center;outline:0;padding:0;width:30px}.tox .tox-swatches__picker-btn svg{height:24px;width:24px}.tox .tox-swatches__picker-btn:hover{background:#c1cad5}.tox:not([dir=rtl]) .tox-swatches__picker-btn{margin-left:auto}.tox[dir=rtl] .tox-swatches__picker-btn{margin-right:auto}.tox .tox-comment-thread{background:#fff;position:relative}.tox .tox-comment-thread>:not(:first-child){margin-top:8px}.tox .tox-comment{background:#fff;border:1px solid #9e9e9e;border-radius:3px;box-shadow:0 4px 8px 0 rgba(34,47,62,.1);padding:8px 8px 16px 8px;position:relative}.tox .tox-comment__header{align-items:center;color:#222f3e;display:flex;justify-content:space-between}.tox .tox-comment__date{color:rgba(34,47,62,.7);font-size:12px}.tox .tox-comment__body{color:#222f3e;font-size:14px;font-style:normal;font-weight:400;line-height:1.3;margin-top:8px;position:relative;text-transform:initial}.tox .tox-comment__body textarea{resize:none;white-space:normal;width:100%}.tox .tox-comment__expander{padding-top:8px}.tox .tox-comment__expander p{color:rgba(34,47,62,.7);font-size:14px;font-style:normal}.tox .tox-comment__body p{margin:0}.tox .tox-comment__buttonspacing{padding-top:16px;text-align:center}.tox .tox-comment-thread__overlay::after{background:#fff;bottom:0;content:"";display:flex;left:0;opacity:.9;position:absolute;right:0;top:0;z-index:5}.tox .tox-comment__reply{display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:flex-end;margin-top:8px}.tox .tox-comment__reply>:first-child{margin-bottom:8px;width:100%}.tox .tox-comment__edit{display:flex;flex-wrap:wrap;justify-content:flex-end;margin-top:16px}.tox .tox-comment__gradient::after{background:linear-gradient(rgba(255,255,255,0),#fff);bottom:0;content:"";display:block;height:5em;margin-top:-40px;position:absolute;width:100%}.tox .tox-comment__overlay{background:#fff;bottom:0;display:flex;flex-direction:column;flex-grow:1;left:0;opacity:.9;position:absolute;right:0;text-align:center;top:0;z-index:5}.tox .tox-comment__loading-text{align-items:center;color:#222f3e;display:flex;flex-direction:column;position:relative}.tox .tox-comment__loading-text>div{padding-bottom:16px}.tox .tox-comment__overlaytext{bottom:0;flex-direction:column;font-size:14px;left:0;padding:1em;position:absolute;right:0;top:0;z-index:10}.tox .tox-comment__overlaytext p{background-color:#fff;box-shadow:0 0 8px 8px #fff;color:#222f3e;text-align:center}.tox .tox-comment__overlaytext div:nth-of-type(2){font-size:.8em}.tox .tox-comment__busy-spinner{align-items:center;background-color:#fff;bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:20}.tox .tox-comment__scroll{display:flex;flex-direction:column;flex-shrink:1;overflow:auto}.tox .tox-conversations{margin:8px}.tox:not([dir=rtl]) .tox-comment__edit{margin-left:8px}.tox:not([dir=rtl]) .tox-comment__buttonspacing>:last-child,.tox:not([dir=rtl]) .tox-comment__edit>:last-child,.tox:not([dir=rtl]) .tox-comment__reply>:last-child{margin-left:8px}.tox[dir=rtl] .tox-comment__edit{margin-right:8px}.tox[dir=rtl] .tox-comment__buttonspacing>:last-child,.tox[dir=rtl] .tox-comment__edit>:last-child,.tox[dir=rtl] .tox-comment__reply>:last-child{margin-right:8px}.tox .tox-user{align-items:center;display:flex}.tox .tox-user__avatar svg{fill:rgba(34,47,62,.7)}.tox .tox-user__name{color:rgba(34,47,62,.7);font-size:12px;font-style:normal;font-weight:700;text-transform:uppercase}.tox:not([dir=rtl]) .tox-user__avatar svg{margin-right:8px}.tox:not([dir=rtl]) .tox-user__avatar+.tox-user__name{margin-left:8px}.tox[dir=rtl] .tox-user__avatar svg{margin-left:8px}.tox[dir=rtl] .tox-user__avatar+.tox-user__name{margin-right:8px}.tox .tox-dialog-wrap{align-items:center;bottom:0;display:flex;justify-content:center;left:0;position:fixed;right:0;top:0;z-index:1100}.tox .tox-dialog-wrap__backdrop{background-color:rgba(255,255,255,.75);bottom:0;left:0;position:absolute;right:0;top:0;z-index:1}.tox .tox-dialog-wrap__backdrop--opaque{background-color:#fff}.tox .tox-dialog{background-color:#fff;border-color:#9e9e9e;border-radius:3px;border-style:solid;border-width:1px;box-shadow:0 16px 16px -10px rgba(34,47,62,.15),0 0 40px 1px rgba(34,47,62,.15);display:flex;flex-direction:column;max-height:100%;max-width:480px;overflow:hidden;position:relative;width:95vw;z-index:2}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox .tox-dialog{align-self:flex-start;margin:8px auto;width:calc(100vw - 16px)}}.tox .tox-dialog-inline{z-index:1100}.tox .tox-dialog__header{align-items:center;background-color:#fff;border-bottom:none;color:#222f3e;display:flex;font-size:16px;justify-content:space-between;padding:8px 16px 0 16px;position:relative}.tox .tox-dialog__header .tox-button{z-index:1}.tox .tox-dialog__draghandle{cursor:grab;height:100%;left:0;position:absolute;top:0;width:100%}.tox .tox-dialog__draghandle:active{cursor:grabbing}.tox .tox-dialog__dismiss{margin-left:auto}.tox .tox-dialog__title{font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:20px;font-style:normal;font-weight:400;line-height:1.3;margin:0;text-transform:none}.tox .tox-dialog__body{color:#222f3e;display:flex;flex:1;-ms-flex-preferred-size:auto;font-size:16px;font-style:normal;font-weight:400;line-height:1.3;min-width:0;text-align:left;text-transform:none}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox .tox-dialog__body{flex-direction:column}}.tox .tox-dialog__body-nav{align-items:flex-start;display:flex;flex-direction:column;padding:16px 16px}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox .tox-dialog__body-nav{flex-direction:row;-webkit-overflow-scrolling:touch;overflow-x:auto;padding-bottom:0}}.tox .tox-dialog__body-nav-item{border-bottom:2px solid transparent;color:rgba(34,47,62,.7);display:inline-block;font-size:14px;line-height:1.3;margin-bottom:8px;text-decoration:none;white-space:nowrap}.tox .tox-dialog__body-nav-item:focus{background-color:rgba(32,122,183,.1)}.tox .tox-dialog__body-nav-item--active{border-bottom:2px solid #207ab7;color:#207ab7}.tox .tox-dialog__body-content{box-sizing:border-box;display:flex;flex:1;flex-direction:column;-ms-flex-preferred-size:auto;max-height:650px;overflow:auto;-webkit-overflow-scrolling:touch;padding:16px 16px}.tox .tox-dialog__body-content>*{margin-bottom:0;margin-top:16px}.tox .tox-dialog__body-content>:first-child{margin-top:0}.tox .tox-dialog__body-content>:last-child{margin-bottom:0}.tox .tox-dialog__body-content>:only-child{margin-bottom:0;margin-top:0}.tox .tox-dialog__body-content a{color:#207ab7;cursor:pointer;text-decoration:none}.tox .tox-dialog__body-content a:focus,.tox .tox-dialog__body-content a:hover{color:#185d8c;text-decoration:none}.tox .tox-dialog__body-content a:active{color:#185d8c;text-decoration:none}.tox .tox-dialog__body-content svg{fill:#222f3e}.tox .tox-dialog__body-content ul{display:block;list-style-type:disc;margin-bottom:16px;-webkit-margin-end:0;margin-inline-end:0;-webkit-margin-start:0;margin-inline-start:0;-webkit-padding-start:2.5rem;padding-inline-start:2.5rem}.tox .tox-dialog__body-content .tox-form__group h1{color:#222f3e;font-size:20px;font-style:normal;font-weight:700;letter-spacing:normal;margin-bottom:16px;margin-top:2rem;text-transform:none}.tox .tox-dialog__body-content .tox-form__group h2{color:#222f3e;font-size:16px;font-style:normal;font-weight:700;letter-spacing:normal;margin-bottom:16px;margin-top:2rem;text-transform:none}.tox .tox-dialog__body-content .tox-form__group p{margin-bottom:16px}.tox .tox-dialog__body-content .tox-form__group h1:first-child,.tox .tox-dialog__body-content .tox-form__group h2:first-child,.tox .tox-dialog__body-content .tox-form__group p:first-child{margin-top:0}.tox .tox-dialog__body-content .tox-form__group h1:last-child,.tox .tox-dialog__body-content .tox-form__group h2:last-child,.tox .tox-dialog__body-content .tox-form__group p:last-child{margin-bottom:0}.tox .tox-dialog__body-content .tox-form__group h1:only-child,.tox .tox-dialog__body-content .tox-form__group h2:only-child,.tox .tox-dialog__body-content .tox-form__group p:only-child{margin-bottom:0;margin-top:0}.tox .tox-dialog--width-lg{height:650px;max-width:1200px}.tox .tox-dialog--width-md{max-width:800px}.tox .tox-dialog--width-md .tox-dialog__body-content{overflow:auto}.tox .tox-dialog__body-content--centered{text-align:center}.tox .tox-dialog__footer{align-items:center;background-color:#fff;border-top:1px solid #9e9e9e;display:flex;justify-content:space-between;padding:8px 16px}.tox .tox-dialog__footer-end,.tox .tox-dialog__footer-start{display:flex}.tox .tox-dialog__busy-spinner{align-items:center;background-color:rgba(255,255,255,.75);bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0;z-index:3}.tox .tox-dialog__table{border-collapse:collapse;width:100%}.tox .tox-dialog__table thead th{font-weight:700;padding-bottom:8px}.tox .tox-dialog__table tbody tr{border-bottom:1px solid #9e9e9e}.tox .tox-dialog__table tbody tr:last-child{border-bottom:none}.tox .tox-dialog__table td{padding-bottom:8px;padding-top:8px}.tox .tox-dialog__popups{position:absolute;width:100%;z-index:1100}.tox .tox-dialog__body-iframe{display:flex;flex:1;flex-direction:column;-ms-flex-preferred-size:auto}.tox .tox-dialog__body-iframe .tox-navobj{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-dialog__body-iframe .tox-navobj :nth-child(2){flex:1;-ms-flex-preferred-size:auto;height:100%}.tox .tox-dialog-dock-fadeout{opacity:0;visibility:hidden}.tox .tox-dialog-dock-fadein{opacity:1;visibility:visible}.tox .tox-dialog-dock-transition{transition:visibility 0s linear .3s,opacity .3s ease}.tox .tox-dialog-dock-transition.tox-dialog-dock-fadein{transition-delay:0s}.tox.tox-platform-ie .tox-dialog-wrap{position:-ms-device-fixed}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav{margin-right:0}}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox:not([dir=rtl]) .tox-dialog__body-nav-item:not(:first-child){margin-left:8px}}.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-end>*,.tox:not([dir=rtl]) .tox-dialog__footer .tox-dialog__footer-start>*{margin-left:8px}.tox[dir=rtl] .tox-dialog__body{text-align:right}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav{margin-left:0}}@media only screen and (max-width:767px){body:not(.tox-force-desktop) .tox[dir=rtl] .tox-dialog__body-nav-item:not(:first-child){margin-right:8px}}.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-end>*,.tox[dir=rtl] .tox-dialog__footer .tox-dialog__footer-start>*{margin-right:8px}body.tox-dialog__disable-scroll{overflow:hidden}.tox .tox-dropzone-container{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-dropzone{align-items:center;background:#fff;border:2px dashed #9e9e9e;box-sizing:border-box;display:flex;flex-direction:column;flex-grow:1;justify-content:center;min-height:100px;padding:10px}.tox .tox-dropzone p{color:rgba(34,47,62,.7);margin:0 0 16px 0}.tox .tox-edit-area{display:flex;flex:1;-ms-flex-preferred-size:auto;overflow:hidden;position:relative}.tox .tox-edit-area__iframe{background-color:#fff;border:0;box-sizing:border-box;flex:1;-ms-flex-preferred-size:auto;height:100%;position:absolute;width:100%}.tox.tox-inline-edit-area{border:1px dotted #9e9e9e}.tox .tox-editor-container{display:flex;flex:1 1 auto;flex-direction:column;overflow:hidden}.tox .tox-editor-header{z-index:1}.tox:not(.tox-tinymce-inline) .tox-editor-header{box-shadow:none;transition:box-shadow .5s}.tox.tox-tinymce--toolbar-bottom .tox-editor-header,.tox.tox-tinymce-inline .tox-editor-header{margin-bottom:-1px}.tox.tox-tinymce--toolbar-sticky-on .tox-editor-header{background-color:transparent;box-shadow:0 4px 4px -3px rgba(0,0,0,.25)}.tox-editor-dock-fadeout{opacity:0;visibility:hidden}.tox-editor-dock-fadein{opacity:1;visibility:visible}.tox-editor-dock-transition{transition:visibility 0s linear .25s,opacity .25s ease}.tox-editor-dock-transition.tox-editor-dock-fadein{transition-delay:0s}.tox .tox-control-wrap{flex:1;position:relative}.tox .tox-control-wrap:not(.tox-control-wrap--status-invalid) .tox-control-wrap__status-icon-invalid,.tox .tox-control-wrap:not(.tox-control-wrap--status-unknown) .tox-control-wrap__status-icon-unknown,.tox .tox-control-wrap:not(.tox-control-wrap--status-valid) .tox-control-wrap__status-icon-valid{display:none}.tox .tox-control-wrap svg{display:block}.tox .tox-control-wrap__status-icon-wrap{position:absolute;top:50%;transform:translateY(-50%)}.tox .tox-control-wrap__status-icon-invalid svg{fill:#c00}.tox .tox-control-wrap__status-icon-unknown svg{fill:orange}.tox .tox-control-wrap__status-icon-valid svg{fill:green}.tox:not([dir=rtl]) .tox-control-wrap--status-invalid .tox-textfield,.tox:not([dir=rtl]) .tox-control-wrap--status-unknown .tox-textfield,.tox:not([dir=rtl]) .tox-control-wrap--status-valid .tox-textfield{padding-right:32px}.tox:not([dir=rtl]) .tox-control-wrap__status-icon-wrap{right:4px}.tox[dir=rtl] .tox-control-wrap--status-invalid .tox-textfield,.tox[dir=rtl] .tox-control-wrap--status-unknown .tox-textfield,.tox[dir=rtl] .tox-control-wrap--status-valid .tox-textfield{padding-left:32px}.tox[dir=rtl] .tox-control-wrap__status-icon-wrap{left:4px}.tox .tox-autocompleter{max-width:25em}.tox .tox-autocompleter .tox-menu{max-width:25em}.tox .tox-autocompleter .tox-autocompleter-highlight{font-weight:700}.tox .tox-color-input{display:flex;position:relative;z-index:1}.tox .tox-color-input .tox-textfield{z-index:-1}.tox .tox-color-input span{border-color:rgba(34,47,62,.2);border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;height:24px;position:absolute;top:6px;width:24px}.tox .tox-color-input span:focus:not([aria-disabled=true]),.tox .tox-color-input span:hover:not([aria-disabled=true]){border-color:#207ab7;cursor:pointer}.tox .tox-color-input span::before{background-image:linear-gradient(45deg,rgba(0,0,0,.25) 25%,transparent 25%),linear-gradient(-45deg,rgba(0,0,0,.25) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,rgba(0,0,0,.25) 75%),linear-gradient(-45deg,transparent 75%,rgba(0,0,0,.25) 75%);background-position:0 0,0 6px,6px -6px,-6px 0;background-size:12px 12px;border:1px solid #fff;border-radius:3px;box-sizing:border-box;content:'';height:24px;left:-1px;position:absolute;top:-1px;width:24px;z-index:-1}.tox .tox-color-input span[aria-disabled=true]{cursor:not-allowed}.tox:not([dir=rtl]) .tox-color-input .tox-textfield{padding-left:36px}.tox:not([dir=rtl]) .tox-color-input span{left:6px}.tox[dir=rtl] .tox-color-input .tox-textfield{padding-right:36px}.tox[dir=rtl] .tox-color-input span{right:6px}.tox .tox-label,.tox .tox-toolbar-label{color:rgba(34,47,62,.7);display:block;font-size:14px;font-style:normal;font-weight:400;line-height:1.3;padding:0 8px 0 0;text-transform:none;white-space:nowrap}.tox .tox-toolbar-label{padding:0 8px}.tox[dir=rtl] .tox-label{padding:0 0 0 8px}.tox .tox-form{display:flex;flex:1;flex-direction:column;-ms-flex-preferred-size:auto}.tox .tox-form__group{box-sizing:border-box;margin-bottom:4px}.tox .tox-form-group--maximize{flex:1}.tox .tox-form__group--error{color:#c00}.tox .tox-form__group--collection{display:flex}.tox .tox-form__grid{display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between}.tox .tox-form__grid--2col>.tox-form__group{width:calc(50% - (8px / 2))}.tox .tox-form__grid--3col>.tox-form__group{width:calc(100% / 3 - (8px / 2))}.tox .tox-form__grid--4col>.tox-form__group{width:calc(25% - (8px / 2))}.tox .tox-form__controls-h-stack{align-items:center;display:flex}.tox .tox-form__group--inline{align-items:center;display:flex}.tox .tox-form__group--stretched{display:flex;flex:1;flex-direction:column;-ms-flex-preferred-size:auto}.tox .tox-form__group--stretched .tox-textarea{flex:1;-ms-flex-preferred-size:auto}.tox .tox-form__group--stretched .tox-navobj{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-form__group--stretched .tox-navobj :nth-child(2){flex:1;-ms-flex-preferred-size:auto;height:100%}.tox:not([dir=rtl]) .tox-form__controls-h-stack>:not(:first-child){margin-left:4px}.tox[dir=rtl] .tox-form__controls-h-stack>:not(:first-child){margin-right:4px}.tox .tox-lock.tox-locked .tox-lock-icon__unlock,.tox .tox-lock:not(.tox-locked) .tox-lock-icon__lock{display:none}.tox .tox-listboxfield .tox-listbox--select,.tox .tox-textarea,.tox .tox-textfield,.tox .tox-toolbar-textfield{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#9e9e9e;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;color:#222f3e;font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:16px;line-height:24px;margin:0;min-height:34px;outline:0;padding:5px 4.75px;resize:none;width:100%}.tox .tox-textarea[disabled],.tox .tox-textfield[disabled]{background-color:#f2f2f2;color:rgba(34,47,62,.85);cursor:not-allowed}.tox .tox-listboxfield .tox-listbox--select:focus,.tox .tox-textarea:focus,.tox .tox-textfield:focus{background-color:#fff;border-color:#207ab7;box-shadow:none;outline:0}.tox .tox-toolbar-textfield{border-width:0;margin-bottom:3px;margin-top:2px;max-width:250px}.tox .tox-naked-btn{background-color:transparent;border:0;border-color:transparent;box-shadow:unset;color:#207ab7;cursor:pointer;display:block;margin:0;padding:0}.tox .tox-naked-btn svg{display:block;fill:#222f3e}.tox:not([dir=rtl]) .tox-toolbar-textfield+*{margin-left:4px}.tox[dir=rtl] .tox-toolbar-textfield+*{margin-right:4px}.tox .tox-listboxfield{cursor:pointer;position:relative}.tox .tox-listboxfield .tox-listbox--select[disabled]{background-color:#f2f2f2;color:rgba(34,47,62,.85);cursor:not-allowed}.tox .tox-listbox__select-label{cursor:default;flex:1;margin:0 4px}.tox .tox-listbox__select-chevron{align-items:center;display:flex;justify-content:center;width:16px}.tox .tox-listbox__select-chevron svg{fill:#222f3e}.tox .tox-listboxfield .tox-listbox--select{align-items:center;display:flex}.tox:not([dir=rtl]) .tox-listboxfield svg{right:8px}.tox[dir=rtl] .tox-listboxfield svg{left:8px}.tox .tox-selectfield{cursor:pointer;position:relative}.tox .tox-selectfield select{-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;border-color:#9e9e9e;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;color:#222f3e;font-family:"Open Sans","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:16px;line-height:24px;margin:0;min-height:34px;outline:0;padding:5px 4.75px;resize:none;width:100%}.tox .tox-selectfield select[disabled]{background-color:#f2f2f2;color:rgba(34,47,62,.85);cursor:not-allowed}.tox .tox-selectfield select::-ms-expand{display:none}.tox .tox-selectfield select:focus{background-color:#fff;border-color:#207ab7;box-shadow:none;outline:0}.tox .tox-selectfield svg{pointer-events:none;position:absolute;top:50%;transform:translateY(-50%)}.tox:not([dir=rtl]) .tox-selectfield select[size="0"],.tox:not([dir=rtl]) .tox-selectfield select[size="1"]{padding-right:24px}.tox:not([dir=rtl]) .tox-selectfield svg{right:8px}.tox[dir=rtl] .tox-selectfield select[size="0"],.tox[dir=rtl] .tox-selectfield select[size="1"]{padding-left:24px}.tox[dir=rtl] .tox-selectfield svg{left:8px}.tox .tox-textarea{-webkit-appearance:textarea;-moz-appearance:textarea;appearance:textarea;white-space:pre-wrap}.tox-fullscreen{border:0;height:100%;margin:0;overflow:hidden;-ms-scroll-chaining:none;overscroll-behavior:none;padding:0;touch-action:pinch-zoom;width:100%}.tox.tox-tinymce.tox-fullscreen .tox-statusbar__resize-handle{display:none}.tox-shadowhost.tox-fullscreen,.tox.tox-tinymce.tox-fullscreen{left:0;position:fixed;top:0;z-index:1200}.tox.tox-tinymce.tox-fullscreen{background-color:transparent}.tox-fullscreen .tox.tox-tinymce-aux,.tox-fullscreen~.tox.tox-tinymce-aux{z-index:1201}.tox .tox-help__more-link{list-style:none;margin-top:1em}.tox .tox-image-tools{width:100%}.tox .tox-image-tools__toolbar{align-items:center;display:flex;justify-content:center}.tox .tox-image-tools__image{background-color:#666;height:380px;overflow:auto;position:relative;width:100%}.tox .tox-image-tools__image,.tox .tox-image-tools__image+.tox-image-tools__toolbar{margin-top:8px}.tox .tox-image-tools__image-bg{background:url(data:image/gif;base64,R0lGODdhDAAMAIABAMzMzP///ywAAAAADAAMAAACFoQfqYeabNyDMkBQb81Uat85nxguUAEAOw==)}.tox .tox-image-tools__toolbar>.tox-spacer{flex:1;-ms-flex-preferred-size:auto}.tox .tox-croprect-block{background:#000;opacity:.5;position:absolute;zoom:1}.tox .tox-croprect-handle{border:2px solid #fff;height:20px;left:0;position:absolute;top:0;width:20px}.tox .tox-croprect-handle-move{border:0;cursor:move;position:absolute}.tox .tox-croprect-handle-nw{border-width:2px 0 0 2px;cursor:nw-resize;left:100px;margin:-2px 0 0 -2px;top:100px}.tox .tox-croprect-handle-ne{border-width:2px 2px 0 0;cursor:ne-resize;left:200px;margin:-2px 0 0 -20px;top:100px}.tox .tox-croprect-handle-sw{border-width:0 0 2px 2px;cursor:sw-resize;left:100px;margin:-20px 2px 0 -2px;top:200px}.tox .tox-croprect-handle-se{border-width:0 2px 2px 0;cursor:se-resize;left:200px;margin:-20px 0 0 -20px;top:200px}.tox:not([dir=rtl]) .tox-image-tools__toolbar>.tox-slider:not(:first-of-type){margin-left:8px}.tox:not([dir=rtl]) .tox-image-tools__toolbar>.tox-button+.tox-slider{margin-left:32px}.tox:not([dir=rtl]) .tox-image-tools__toolbar>.tox-slider+.tox-button{margin-left:32px}.tox[dir=rtl] .tox-image-tools__toolbar>.tox-slider:not(:first-of-type){margin-right:8px}.tox[dir=rtl] .tox-image-tools__toolbar>.tox-button+.tox-slider{margin-right:32px}.tox[dir=rtl] .tox-image-tools__toolbar>.tox-slider+.tox-button{margin-right:32px}.tox .tox-insert-table-picker{display:flex;flex-wrap:wrap;width:170px}.tox .tox-insert-table-picker>div{border-color:#9e9e9e;border-style:solid;border-width:0 1px 1px 0;box-sizing:border-box;height:17px;width:17px}.tox .tox-collection--list .tox-collection__group .tox-insert-table-picker{margin:-4px 0}.tox .tox-insert-table-picker .tox-insert-table-picker__selected{background-color:rgba(32,122,183,.5);border-color:rgba(32,122,183,.5)}.tox .tox-insert-table-picker__label{color:rgba(34,47,62,.7);display:block;font-size:14px;padding:4px;text-align:center;width:100%}.tox:not([dir=rtl]) .tox-insert-table-picker>div:nth-child(10n){border-right:0}.tox[dir=rtl] .tox-insert-table-picker>div:nth-child(10n+1){border-right:0}.tox .tox-menu{background-color:#fff;border:1px solid #9e9e9e;border-radius:3px;box-shadow:0 4px 8px 0 rgba(34,47,62,.1);display:inline-block;overflow:hidden;vertical-align:top;z-index:1150}.tox .tox-menu.tox-collection.tox-collection--list{padding:0}.tox .tox-menu.tox-collection.tox-collection--toolbar{padding:4px}.tox .tox-menu.tox-collection.tox-collection--grid{padding:4px}.tox .tox-menu__label blockquote,.tox .tox-menu__label code,.tox .tox-menu__label h1,.tox .tox-menu__label h2,.tox .tox-menu__label h3,.tox .tox-menu__label h4,.tox .tox-menu__label h5,.tox .tox-menu__label h6,.tox .tox-menu__label p{margin:0}.tox .tox-menubar{background:url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%239e9e9e'/%3E%3C/svg%3E") left 0 top 0 #f0f0f0;background-color:#f0f0f0;display:flex;flex:0 0 auto;flex-shrink:0;flex-wrap:wrap;padding:0 4px 0 4px}.tox.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-menubar{border-top:1px solid #9e9e9e}.tox .tox-mbtn{align-items:center;background:0 0;border:0;border-radius:3px;box-shadow:none;color:#626b73;display:flex;flex:0 0 auto;font-size:14px;font-style:normal;font-weight:400;height:34px;justify-content:center;margin:2px 0 3px 0;outline:0;overflow:hidden;padding:0 4px;text-transform:none;width:auto}.tox .tox-mbtn[disabled]{background-color:transparent;border:0;box-shadow:none;color:rgba(98,107,115,.5);cursor:not-allowed}.tox .tox-mbtn:focus:not(:disabled){background:#c1cad5;border:0;box-shadow:none;color:#626b73}.tox .tox-mbtn--active{background:#b2beca;border:0;box-shadow:none;color:#626b73}.tox .tox-mbtn:hover:not(:disabled):not(.tox-mbtn--active){background:#c1cad5;border:0;box-shadow:none;color:#626b73}.tox .tox-mbtn__select-label{cursor:default;font-weight:400;margin:0 4px}.tox .tox-mbtn[disabled] .tox-mbtn__select-label{cursor:not-allowed}.tox .tox-mbtn__select-chevron{align-items:center;display:flex;justify-content:center;width:16px;display:none}.tox .tox-notification{border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;box-sizing:border-box;display:-ms-grid;display:grid;font-size:14px;font-weight:400;-ms-grid-columns:minmax(40px,1fr) auto minmax(40px,1fr);grid-template-columns:minmax(40px,1fr) auto minmax(40px,1fr);margin-top:4px;opacity:0;padding:4px;transition:transform .1s ease-in,opacity 150ms ease-in}.tox .tox-notification p{font-size:14px;font-weight:400}.tox .tox-notification a{cursor:pointer;text-decoration:underline}.tox .tox-notification--in{opacity:1}.tox .tox-notification--success{background-color:#e4eeda;border-color:#d7e6c8;color:#222f3e}.tox .tox-notification--success p{color:#222f3e}.tox .tox-notification--success a{color:#547831}.tox .tox-notification--success svg{fill:#222f3e}.tox .tox-notification--error{background-color:#f8dede;border-color:#f2bfbf;color:#222f3e}.tox .tox-notification--error p{color:#222f3e}.tox .tox-notification--error a{color:#c00}.tox .tox-notification--error svg{fill:#222f3e}.tox .tox-notification--warn,.tox .tox-notification--warning{background-color:#fffaea;border-color:#ffe89d;color:#222f3e}.tox .tox-notification--warn p,.tox .tox-notification--warning p{color:#222f3e}.tox .tox-notification--warn a,.tox .tox-notification--warning a{color:#222f3e}.tox .tox-notification--warn svg,.tox .tox-notification--warning svg{fill:#222f3e}.tox .tox-notification--info{background-color:#d9edf7;border-color:#779ecb;color:#222f3e}.tox .tox-notification--info p{color:#222f3e}.tox .tox-notification--info a{color:#222f3e}.tox .tox-notification--info svg{fill:#222f3e}.tox .tox-notification__body{-ms-grid-row-align:center;align-self:center;color:#222f3e;font-size:14px;-ms-grid-column-span:1;grid-column-end:3;-ms-grid-column:2;grid-column-start:2;-ms-grid-row-span:1;grid-row-end:2;-ms-grid-row:1;grid-row-start:1;text-align:center;white-space:normal;word-break:break-all;word-break:break-word}.tox .tox-notification__body>*{margin:0}.tox .tox-notification__body>*+*{margin-top:1rem}.tox .tox-notification__icon{-ms-grid-row-align:center;align-self:center;-ms-grid-column-span:1;grid-column-end:2;-ms-grid-column:1;grid-column-start:1;-ms-grid-row-span:1;grid-row-end:2;-ms-grid-row:1;grid-row-start:1;-ms-grid-column-align:end;justify-self:end}.tox .tox-notification__icon svg{display:block}.tox .tox-notification__dismiss{-ms-grid-row-align:start;align-self:start;-ms-grid-column-span:1;grid-column-end:4;-ms-grid-column:3;grid-column-start:3;-ms-grid-row-span:1;grid-row-end:2;-ms-grid-row:1;grid-row-start:1;-ms-grid-column-align:end;justify-self:end}.tox .tox-notification .tox-progress-bar{-ms-grid-column-span:3;grid-column-end:4;-ms-grid-column:1;grid-column-start:1;-ms-grid-row-span:1;grid-row-end:3;-ms-grid-row:2;grid-row-start:2;-ms-grid-column-align:center;justify-self:center}.tox .tox-pop{display:inline-block;position:relative}.tox .tox-pop--resizing{transition:width .1s ease}.tox .tox-pop--resizing .tox-toolbar,.tox .tox-pop--resizing .tox-toolbar__group{flex-wrap:nowrap}.tox .tox-pop--transition{transition:.15s ease;transition-property:left,right,top,bottom}.tox .tox-pop--transition::after,.tox .tox-pop--transition::before{transition:all .15s,visibility 0s,opacity 75ms ease 75ms}.tox .tox-pop__dialog{background-color:#fff;border:1px solid #9e9e9e;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.15);min-width:0;overflow:hidden}.tox .tox-pop__dialog>:not(.tox-toolbar){margin:4px 4px 4px 8px}.tox .tox-pop__dialog .tox-toolbar{background-color:transparent;margin-bottom:-1px}.tox .tox-pop::after,.tox .tox-pop::before{border-style:solid;content:'';display:block;height:0;opacity:1;position:absolute;width:0}.tox .tox-pop.tox-pop--inset::after,.tox .tox-pop.tox-pop--inset::before{opacity:0;transition:all 0s .15s,visibility 0s,opacity 75ms ease}.tox .tox-pop.tox-pop--bottom::after,.tox .tox-pop.tox-pop--bottom::before{left:50%;top:100%}.tox .tox-pop.tox-pop--bottom::after{border-color:#fff transparent transparent transparent;border-width:8px;margin-left:-8px;margin-top:-1px}.tox .tox-pop.tox-pop--bottom::before{border-color:#9e9e9e transparent transparent transparent;border-width:9px;margin-left:-9px}.tox .tox-pop.tox-pop--top::after,.tox .tox-pop.tox-pop--top::before{left:50%;top:0;transform:translateY(-100%)}.tox .tox-pop.tox-pop--top::after{border-color:transparent transparent #fff transparent;border-width:8px;margin-left:-8px;margin-top:1px}.tox .tox-pop.tox-pop--top::before{border-color:transparent transparent #9e9e9e transparent;border-width:9px;margin-left:-9px}.tox .tox-pop.tox-pop--left::after,.tox .tox-pop.tox-pop--left::before{left:0;top:calc(50% - 1px);transform:translateY(-50%)}.tox .tox-pop.tox-pop--left::after{border-color:transparent #fff transparent transparent;border-width:8px;margin-left:-15px}.tox .tox-pop.tox-pop--left::before{border-color:transparent #9e9e9e transparent transparent;border-width:10px;margin-left:-19px}.tox .tox-pop.tox-pop--right::after,.tox .tox-pop.tox-pop--right::before{left:100%;top:calc(50% + 1px);transform:translateY(-50%)}.tox .tox-pop.tox-pop--right::after{border-color:transparent transparent transparent #fff;border-width:8px;margin-left:-1px}.tox .tox-pop.tox-pop--right::before{border-color:transparent transparent transparent #9e9e9e;border-width:10px;margin-left:-1px}.tox .tox-pop.tox-pop--align-left::after,.tox .tox-pop.tox-pop--align-left::before{left:20px}.tox .tox-pop.tox-pop--align-right::after,.tox .tox-pop.tox-pop--align-right::before{left:calc(100% - 20px)}.tox .tox-sidebar-wrap{display:flex;flex-direction:row;flex-grow:1;-ms-flex-preferred-size:0;min-height:0}.tox .tox-sidebar{background-color:#fff;display:flex;flex-direction:row;justify-content:flex-end}.tox .tox-sidebar__slider{display:flex;overflow:hidden}.tox .tox-sidebar__pane-container{display:flex}.tox .tox-sidebar__pane{display:flex}.tox .tox-sidebar--sliding-closed{opacity:0}.tox .tox-sidebar--sliding-open{opacity:1}.tox .tox-sidebar--sliding-growing,.tox .tox-sidebar--sliding-shrinking{transition:width .5s ease,opacity .5s ease}.tox .tox-selector{background-color:#4099ff;border-color:#4099ff;border-style:solid;border-width:1px;box-sizing:border-box;display:inline-block;height:10px;position:absolute;width:10px}.tox.tox-platform-touch .tox-selector{height:12px;width:12px}.tox .tox-slider{align-items:center;display:flex;flex:1;-ms-flex-preferred-size:auto;height:24px;justify-content:center;position:relative}.tox .tox-slider__rail{background-color:transparent;border:1px solid #9e9e9e;border-radius:3px;height:10px;min-width:120px;width:100%}.tox .tox-slider__handle{background-color:#207ab7;border:2px solid #185d8c;border-radius:3px;box-shadow:none;height:24px;left:50%;position:absolute;top:50%;transform:translateX(-50%) translateY(-50%);width:14px}.tox .tox-source-code{overflow:auto}.tox .tox-spinner{display:flex}.tox .tox-spinner>div{animation:tam-bouncing-dots 1.5s ease-in-out 0s infinite both;background-color:rgba(34,47,62,.7);border-radius:100%;height:8px;width:8px}.tox .tox-spinner>div:nth-child(1){animation-delay:-.32s}.tox .tox-spinner>div:nth-child(2){animation-delay:-.16s}@keyframes tam-bouncing-dots{0%,100%,80%{transform:scale(0)}40%{transform:scale(1)}}.tox:not([dir=rtl]) .tox-spinner>div:not(:first-child){margin-left:4px}.tox[dir=rtl] .tox-spinner>div:not(:first-child){margin-right:4px}.tox .tox-statusbar{align-items:center;background-color:#fff;border-top:1px solid #9e9e9e;color:rgba(34,47,62,.7);display:flex;flex:0 0 auto;font-size:12px;font-weight:400;height:18px;overflow:hidden;padding:0 8px;position:relative;text-transform:uppercase}.tox .tox-statusbar__text-container{display:flex;flex:1 1 auto;justify-content:flex-end;overflow:hidden}.tox .tox-statusbar__path{display:flex;flex:1 1 auto;margin-right:auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tox .tox-statusbar__path>*{display:inline;white-space:nowrap}.tox .tox-statusbar__wordcount{flex:0 0 auto;margin-left:1ch}.tox .tox-statusbar a,.tox .tox-statusbar__path-item,.tox .tox-statusbar__wordcount{color:rgba(34,47,62,.7);text-decoration:none}.tox .tox-statusbar a:focus:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar a:hover:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar__path-item:focus:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar__path-item:hover:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar__wordcount:focus:not(:disabled):not([aria-disabled=true]),.tox .tox-statusbar__wordcount:hover:not(:disabled):not([aria-disabled=true]){cursor:pointer;text-decoration:underline}.tox .tox-statusbar__resize-handle{align-items:flex-end;align-self:stretch;cursor:nwse-resize;display:flex;flex:0 0 auto;justify-content:flex-end;margin-left:auto;margin-right:-8px;padding-left:1ch}.tox .tox-statusbar__resize-handle svg{display:block;fill:rgba(34,47,62,.7)}.tox .tox-statusbar__resize-handle:focus svg{background-color:#dee0e2;border-radius:1px;box-shadow:0 0 0 2px #dee0e2}.tox:not([dir=rtl]) .tox-statusbar__path>*{margin-right:4px}.tox:not([dir=rtl]) .tox-statusbar__branding{margin-left:1ch}.tox[dir=rtl] .tox-statusbar{flex-direction:row-reverse}.tox[dir=rtl] .tox-statusbar__path>*{margin-left:4px}.tox .tox-throbber{z-index:1299}.tox .tox-throbber__busy-spinner{align-items:center;background-color:rgba(255,255,255,.6);bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}.tox .tox-tbtn{align-items:center;background:0 0;border:0;border-radius:3px;box-shadow:none;color:#626b73;display:flex;flex:0 0 auto;font-size:14px;font-style:normal;font-weight:400;height:34px;justify-content:center;margin:2px 0 3px 0;outline:0;overflow:hidden;padding:0;text-transform:none;width:34px}.tox .tox-tbtn svg{display:block;fill:#626b73}.tox .tox-tbtn.tox-tbtn-more{padding-left:5px;padding-right:5px;width:inherit}.tox .tox-tbtn:focus{background:#c1cad5;border:0;box-shadow:none}.tox .tox-tbtn:hover{background:#c1cad5;border:0;box-shadow:none;color:#626b73}.tox .tox-tbtn:hover svg{fill:#626b73}.tox .tox-tbtn:active{background:#b2beca;border:0;box-shadow:none;color:#626b73}.tox .tox-tbtn:active svg{fill:#626b73}.tox .tox-tbtn--disabled,.tox .tox-tbtn--disabled:hover,.tox .tox-tbtn:disabled,.tox .tox-tbtn:disabled:hover{background:0 0;border:0;box-shadow:none;color:rgba(98,107,115,.5);cursor:not-allowed}.tox .tox-tbtn--disabled svg,.tox .tox-tbtn--disabled:hover svg,.tox .tox-tbtn:disabled svg,.tox .tox-tbtn:disabled:hover svg{fill:rgba(98,107,115,.5)}.tox .tox-tbtn--enabled,.tox .tox-tbtn--enabled:hover{background:#b2beca;border:0;box-shadow:none;color:#626b73}.tox .tox-tbtn--enabled:hover>*,.tox .tox-tbtn--enabled>*{transform:none}.tox .tox-tbtn--enabled svg,.tox .tox-tbtn--enabled:hover svg{fill:#626b73}.tox .tox-tbtn:focus:not(.tox-tbtn--disabled){color:#626b73}.tox .tox-tbtn:focus:not(.tox-tbtn--disabled) svg{fill:#626b73}.tox .tox-tbtn:active>*{transform:none}.tox .tox-tbtn--md{height:51px;width:51px}.tox .tox-tbtn--lg{flex-direction:column;height:68px;width:68px}.tox .tox-tbtn--return{-ms-grid-row-align:stretch;align-self:stretch;height:unset;width:16px}.tox .tox-tbtn--labeled{padding:0 4px;width:unset}.tox .tox-tbtn__vlabel{display:block;font-size:10px;font-weight:400;letter-spacing:-.025em;margin-bottom:4px;white-space:nowrap}.tox .tox-tbtn--select{margin:2px 0 3px 0;padding:0 4px;width:auto}.tox .tox-tbtn__select-label{cursor:default;font-weight:400;margin:0 4px}.tox .tox-tbtn__select-chevron{align-items:center;display:flex;justify-content:center;width:16px}.tox .tox-tbtn__select-chevron svg{fill:rgba(98,107,115,.5)}.tox .tox-tbtn--bespoke .tox-tbtn__select-label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:7em}.tox .tox-split-button{border:0;border-radius:3px;box-sizing:border-box;display:flex;margin:2px 0 3px 0;overflow:hidden}.tox .tox-split-button:hover{box-shadow:0 0 0 1px #c1cad5 inset}.tox .tox-split-button:focus{background:#c1cad5;box-shadow:none;color:#626b73}.tox .tox-split-button>*{border-radius:0}.tox .tox-split-button__chevron{width:16px}.tox .tox-split-button__chevron svg{fill:rgba(98,107,115,.5)}.tox .tox-split-button .tox-tbtn{margin:0}.tox.tox-platform-touch .tox-split-button .tox-tbtn:first-child{width:30px}.tox.tox-platform-touch .tox-split-button__chevron{width:20px}.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:focus,.tox .tox-split-button.tox-tbtn--disabled .tox-tbtn:hover,.tox .tox-split-button.tox-tbtn--disabled:focus,.tox .tox-split-button.tox-tbtn--disabled:hover{background:0 0;box-shadow:none;color:rgba(98,107,115,.5)}.tox .tox-toolbar-overlord{background-color:#f0f0f0}.tox .tox-toolbar,.tox .tox-toolbar__overflow,.tox .tox-toolbar__primary{background:url("data:image/svg+xml;charset=utf8,%3Csvg height='39px' viewBox='0 0 40 39px' width='40' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0' y='38px' width='100' height='1' fill='%239e9e9e'/%3E%3C/svg%3E") left 0 top 0 #f0f0f0;background-color:#f0f0f0;display:flex;flex:0 0 auto;flex-shrink:0;flex-wrap:wrap;padding:0 0}.tox .tox-toolbar__overflow.tox-toolbar__overflow--closed{height:0;opacity:0;padding-bottom:0;padding-top:0;visibility:hidden}.tox .tox-toolbar__overflow--growing{transition:height .3s ease,opacity .2s linear .1s}.tox .tox-toolbar__overflow--shrinking{transition:opacity .3s ease,height .2s linear .1s,visibility 0s linear .3s}.tox .tox-menubar+.tox-toolbar,.tox .tox-menubar+.tox-toolbar-overlord .tox-toolbar__primary{border-top:1px solid #9e9e9e;margin-top:-1px}.tox .tox-toolbar--scrolling{flex-wrap:nowrap;overflow-x:auto}.tox .tox-pop .tox-toolbar{border-width:0}.tox .tox-toolbar--no-divider{background-image:none}.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar-overlord:first-child .tox-toolbar__primary,.tox-tinymce:not(.tox-tinymce-inline) .tox-editor-header:not(:first-child) .tox-toolbar:first-child{border-top:1px solid #9e9e9e}.tox.tox-tinymce-aux .tox-toolbar__overflow{background-color:#fff;border:1px solid #9e9e9e;border-radius:3px;box-shadow:0 1px 3px rgba(0,0,0,.15)}.tox .tox-toolbar__group{align-items:center;display:flex;flex-wrap:wrap;margin:0 0;padding:0 4px 0 4px}.tox .tox-toolbar__group--pull-right{margin-left:auto}.tox .tox-toolbar--scrolling .tox-toolbar__group{flex-shrink:0;flex-wrap:nowrap}.tox:not([dir=rtl]) .tox-toolbar__group:not(:last-of-type){border-right:1px solid #9e9e9e}.tox[dir=rtl] .tox-toolbar__group:not(:last-of-type){border-left:1px solid #9e9e9e}.tox .tox-tooltip{display:inline-block;padding:8px;position:relative}.tox .tox-tooltip__body{background-color:#222f3e;border-radius:3px;box-shadow:0 2px 4px rgba(34,47,62,.3);color:rgba(255,255,255,.75);font-size:14px;font-style:normal;font-weight:400;padding:4px 8px;text-transform:none}.tox .tox-tooltip__arrow{position:absolute}.tox .tox-tooltip--down .tox-tooltip__arrow{border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #222f3e;bottom:0;left:50%;position:absolute;transform:translateX(-50%)}.tox .tox-tooltip--up .tox-tooltip__arrow{border-bottom:8px solid #222f3e;border-left:8px solid transparent;border-right:8px solid transparent;left:50%;position:absolute;top:0;transform:translateX(-50%)}.tox .tox-tooltip--right .tox-tooltip__arrow{border-bottom:8px solid transparent;border-left:8px solid #222f3e;border-top:8px solid transparent;position:absolute;right:0;top:50%;transform:translateY(-50%)}.tox .tox-tooltip--left .tox-tooltip__arrow{border-bottom:8px solid transparent;border-right:8px solid #222f3e;border-top:8px solid transparent;left:0;position:absolute;top:50%;transform:translateY(-50%)}.tox .tox-well{border:1px solid #9e9e9e;border-radius:3px;padding:8px;width:100%}.tox .tox-well>:first-child{margin-top:0}.tox .tox-well>:last-child{margin-bottom:0}.tox .tox-well>:only-child{margin:0}.tox .tox-custom-editor{border:1px solid #9e9e9e;border-radius:3px;display:flex;flex:1;position:relative}.tox .tox-dialog-loading::before{background-color:rgba(0,0,0,.5);content:"";height:100%;position:absolute;width:100%;z-index:1000}.tox .tox-tab{cursor:pointer}.tox .tox-dialog__content-js{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-dialog__body-content .tox-collection{display:flex;flex:1;-ms-flex-preferred-size:auto}.tox .tox-image-tools-edit-panel{height:60px}.tox .tox-image-tools__sidebar{height:60px} \ No newline at end of file diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.mobile.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/skin.mobile.css similarity index 98% rename from common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.mobile.css rename to common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/skin.mobile.css index 875721a27d02..77fee99b5ffe 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide/skin.mobile.css +++ b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/skin.mobile.css @@ -1,9 +1,9 @@ /** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ +* Copyright (c) Tiny Technologies, Inc. All rights reserved. +* Licensed under the LGPL or a commercial license. +* For LGPL see License.txt in the project root for license information. +* For commercial licenses see https://www.tiny.cloud/ +*/ /* RESET all the things! */ .tinymce-mobile-outer-container { all: initial; @@ -487,6 +487,10 @@ /* WebKit, Blink, Edge */ color: #888; } +.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input:-ms-input-placeholder { + /* WebKit, Blink, Edge */ + color: #888; +} .tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::placeholder { /* WebKit, Blink, Edge */ color: #888; diff --git a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.mobile.min.css b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/skin.mobile.min.css similarity index 77% rename from common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.mobile.min.css rename to common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/skin.mobile.min.css index 15555127c43c..f27eeea21cfe 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +++ b/common/static/js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/skin.mobile.min.css @@ -1,8 +1,7 @@ /** - * Copyright (c) Tiny Technologies, Inc. All rights reserved. - * Licensed under the LGPL or a commercial license. - * For LGPL see License.txt in the project root for license information. - * For commercial licenses see https://www.tiny.cloud/ - */ -.tinymce-mobile-outer-container{all:initial;display:block}.tinymce-mobile-outer-container *{border:0;box-sizing:initial;cursor:inherit;float:none;line-height:1;margin:0;outline:0;padding:0;-webkit-tap-highlight-color:transparent;text-shadow:none;white-space:nowrap}.tinymce-mobile-icon-arrow-back::before{content:"\e5cd"}.tinymce-mobile-icon-image::before{content:"\e412"}.tinymce-mobile-icon-cancel-circle::before{content:"\e5c9"}.tinymce-mobile-icon-full-dot::before{content:"\e061"}.tinymce-mobile-icon-align-center::before{content:"\e234"}.tinymce-mobile-icon-align-left::before{content:"\e236"}.tinymce-mobile-icon-align-right::before{content:"\e237"}.tinymce-mobile-icon-bold::before{content:"\e238"}.tinymce-mobile-icon-italic::before{content:"\e23f"}.tinymce-mobile-icon-unordered-list::before{content:"\e241"}.tinymce-mobile-icon-ordered-list::before{content:"\e242"}.tinymce-mobile-icon-font-size::before{content:"\e245"}.tinymce-mobile-icon-underline::before{content:"\e249"}.tinymce-mobile-icon-link::before{content:"\e157"}.tinymce-mobile-icon-unlink::before{content:"\eca2"}.tinymce-mobile-icon-color::before{content:"\e891"}.tinymce-mobile-icon-previous::before{content:"\e314"}.tinymce-mobile-icon-next::before{content:"\e315"}.tinymce-mobile-icon-large-font::before,.tinymce-mobile-icon-style-formats::before{content:"\e264"}.tinymce-mobile-icon-undo::before{content:"\e166"}.tinymce-mobile-icon-redo::before{content:"\e15a"}.tinymce-mobile-icon-removeformat::before{content:"\e239"}.tinymce-mobile-icon-small-font::before{content:"\e906"}.tinymce-mobile-format-matches::after,.tinymce-mobile-icon-readonly-back::before{content:"\e5ca"}.tinymce-mobile-icon-small-heading::before{content:"small"}.tinymce-mobile-icon-large-heading::before{content:"large"}.tinymce-mobile-icon-large-heading::before,.tinymce-mobile-icon-small-heading::before{font-family:sans-serif;font-size:80%}.tinymce-mobile-mask-edit-icon::before{content:"\e254"}.tinymce-mobile-icon-back::before{content:"\e5c4"}.tinymce-mobile-icon-heading::before{content:"Headings";font-family:sans-serif;font-size:80%;font-weight:700}.tinymce-mobile-icon-h1::before{content:"H1";font-weight:700}.tinymce-mobile-icon-h2::before{content:"H2";font-weight:700}.tinymce-mobile-icon-h3::before{content:"H3";font-weight:700}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask{align-items:center;display:flex;justify-content:center;background:rgba(51,51,51,.5);height:100%;position:absolute;top:0;width:100%}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container{align-items:center;border-radius:50%;display:flex;flex-direction:column;font-family:sans-serif;font-size:1em;justify-content:space-between}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .mixin-menu-item{align-items:center;display:flex;justify-content:center;border-radius:50%;height:2.1em;width:2.1em}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section{align-items:center;display:flex;justify-content:center;flex-direction:column;font-size:1em}@media only screen and (min-device-width:700px){.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section{font-size:1.2em}}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon{align-items:center;display:flex;justify-content:center;border-radius:50%;height:2.1em;width:2.1em;background-color:#fff;color:#207ab7}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon::before{content:"\e900";font-family:tinymce-mobile,sans-serif}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section:not(.tinymce-mobile-mask-tap-icon-selected) .tinymce-mobile-mask-tap-icon{z-index:2}.tinymce-mobile-android-container.tinymce-mobile-android-maximized{background:#fff;border:none;bottom:0;display:flex;flex-direction:column;left:0;position:fixed;right:0;top:0}.tinymce-mobile-android-container:not(.tinymce-mobile-android-maximized){position:relative}.tinymce-mobile-android-container .tinymce-mobile-editor-socket{display:flex;flex-grow:1}.tinymce-mobile-android-container .tinymce-mobile-editor-socket iframe{display:flex!important;flex-grow:1;height:auto!important}.tinymce-mobile-android-scroll-reload{overflow:hidden}:not(.tinymce-mobile-readonly-mode)>.tinymce-mobile-android-selection-context-toolbar{margin-top:23px}.tinymce-mobile-toolstrip{background:#fff;display:flex;flex:0 0 auto;z-index:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar{align-items:center;background-color:#fff;border-bottom:1px solid #ccc;display:flex;flex:1;height:2.5em;width:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group{align-items:center;display:flex;height:100%;flex-shrink:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group>div{align-items:center;display:flex;height:100%;flex:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-exit-container{background:#f44336}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-toolbar-scrollable-group{flex-grow:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item{padding-left:.5em;padding-right:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button{align-items:center;display:flex;height:80%;margin-left:2px;margin-right:2px}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button.tinymce-mobile-toolbar-button-selected{background:#c8cbcf;color:#ccc}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:first-of-type,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:last-of-type{background:#207ab7;color:#eceff1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group{align-items:center;display:flex;height:100%;flex:1;padding-bottom:.4em;padding-top:.4em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog{display:flex;min-height:1.5em;overflow:hidden;padding-left:0;padding-right:0;position:relative;width:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain{display:flex;height:100%;transition:left cubic-bezier(.4,0,1,1) .15s;width:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen{display:flex;flex:0 0 auto;justify-content:space-between;width:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen input{font-family:Sans-serif}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container{display:flex;flex-grow:1;position:relative}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container .tinymce-mobile-input-container-x{-ms-grid-row-align:center;align-self:center;background:inherit;border:none;border-radius:50%;color:#888;font-size:.6em;font-weight:700;height:100%;padding-right:2px;position:absolute;right:0}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container.tinymce-mobile-input-container-empty .tinymce-mobile-input-container-x{display:none}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous{align-items:center;display:flex}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous::before{align-items:center;display:flex;font-weight:700;height:100%;padding-left:.5em;padding-right:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next.tinymce-mobile-toolbar-navigation-disabled::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous.tinymce-mobile-toolbar-navigation-disabled::before{visibility:hidden}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item{color:#ccc;font-size:10px;line-height:10px;margin:0 2px;padding-top:3px}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item.tinymce-mobile-dot-active{color:#c8cbcf}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-font::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-heading::before{margin-left:.5em;margin-right:.9em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-font::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-heading::before{margin-left:.9em;margin-right:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider{display:flex;flex:1;margin-left:0;margin-right:0;padding:.28em 0;position:relative}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container{align-items:center;display:flex;flex-grow:1;height:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container .tinymce-mobile-slider-size-line{background:#ccc;display:flex;flex:1;height:.2em;margin-bottom:.3em;margin-top:.3em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container{padding-left:2em;padding-right:2em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container{align-items:center;display:flex;flex-grow:1;height:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container .tinymce-mobile-slider-gradient{background:linear-gradient(to right,red 0,#feff00 17%,#0f0 33%,#00feff 50%,#00f 67%,#ff00fe 83%,red 100%);display:flex;flex:1;height:.2em;margin-bottom:.3em;margin-top:.3em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-black{background:#000;height:.2em;margin-bottom:.3em;margin-top:.3em;width:1.2em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-white{background:#fff;height:.2em;margin-bottom:.3em;margin-top:.3em;width:1.2em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb{align-items:center;background-clip:padding-box;background-color:#455a64;border:.5em solid rgba(136,136,136,0);border-radius:3em;bottom:0;color:#fff;display:flex;height:.5em;justify-content:center;left:-10px;margin:auto;position:absolute;top:0;transition:border 120ms cubic-bezier(.39,.58,.57,1);width:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb.tinymce-mobile-thumb-active{border:.5em solid rgba(136,136,136,.39)}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group>div{align-items:center;display:flex;height:100%;flex:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper{flex-direction:column;justify-content:center}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item{align-items:center;display:flex}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item:not(.tinymce-mobile-serialised-dialog){height:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-container{display:flex}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input{background:#fff;border:none;border-radius:0;color:#455a64;flex-grow:1;font-size:.85em;padding-bottom:.1em;padding-left:5px;padding-top:.1em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::-webkit-input-placeholder{color:#888}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::placeholder{color:#888}.tinymce-mobile-dropup{background:#fff;display:flex;overflow:hidden;width:100%}.tinymce-mobile-dropup.tinymce-mobile-dropup-shrinking{transition:height .3s ease-out}.tinymce-mobile-dropup.tinymce-mobile-dropup-growing{transition:height .3s ease-in}.tinymce-mobile-dropup.tinymce-mobile-dropup-closed{flex-grow:0}.tinymce-mobile-dropup.tinymce-mobile-dropup-open:not(.tinymce-mobile-dropup-growing){flex-grow:1}.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height:200px}@media only screen and (orientation:landscape){.tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height:200px}}@media only screen and (min-device-width :320px) and (max-device-width :568px) and (orientation :landscape){.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height:150px}}.tinymce-mobile-styles-menu{font-family:sans-serif;outline:4px solid #000;overflow:hidden;position:relative;width:100%}.tinymce-mobile-styles-menu [role=menu]{display:flex;flex-direction:column;height:100%;position:absolute;width:100%}.tinymce-mobile-styles-menu [role=menu].transitioning{transition:transform .5s ease-in-out}.tinymce-mobile-styles-menu .tinymce-mobile-styles-item{border-bottom:1px solid #ddd;color:#455a64;cursor:pointer;display:flex;padding:1em 1em;position:relative}.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser .tinymce-mobile-styles-collapse-icon::before{color:#455a64;content:"\e314";font-family:tinymce-mobile,sans-serif}.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-styles-item-is-menu::after{color:#455a64;content:"\e315";font-family:tinymce-mobile,sans-serif;padding-left:1em;padding-right:1em;position:absolute;right:0}.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-format-matches::after{font-family:tinymce-mobile,sans-serif;padding-left:1em;padding-right:1em;position:absolute;right:0}.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser,.tinymce-mobile-styles-menu .tinymce-mobile-styles-separator{align-items:center;background:#fff;border-top:#455a64;color:#455a64;display:flex;min-height:2.5em;padding-left:1em;padding-right:1em}.tinymce-mobile-styles-menu [data-transitioning-destination=before][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state=before]{transform:translate(-100%)}.tinymce-mobile-styles-menu [data-transitioning-destination=current][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state=current]{transform:translate(0)}.tinymce-mobile-styles-menu [data-transitioning-destination=after][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state=after]{transform:translate(100%)}@font-face{font-family:tinymce-mobile;font-style:normal;font-weight:400;src:url(fonts/tinymce-mobile.woff?8x92w3) format('woff')}@media (min-device-width:700px){.tinymce-mobile-outer-container,.tinymce-mobile-outer-container input{font-size:25px}}@media (max-device-width:700px){.tinymce-mobile-outer-container,.tinymce-mobile-outer-container input{font-size:18px}}.tinymce-mobile-icon{font-family:tinymce-mobile,sans-serif}.mixin-flex-and-centre{align-items:center;display:flex;justify-content:center}.mixin-flex-bar{align-items:center;display:flex;height:100%}.tinymce-mobile-outer-container .tinymce-mobile-editor-socket iframe{background-color:#fff;width:100%}.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{background-color:#207ab7;border-radius:50%;bottom:1em;color:#fff;font-size:1em;height:2.1em;position:fixed;right:2em;width:2.1em;align-items:center;display:flex;justify-content:center}@media only screen and (min-device-width:700px){.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{font-size:1.2em}}.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket{height:300px;overflow:hidden}.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket iframe{height:100%}.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-toolstrip{display:none}input[type=file]::-webkit-file-upload-button{display:none}@media only screen and (min-device-width :320px) and (max-device-width :568px) and (orientation :landscape){.tinymce-mobile-ios-container .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{bottom:50%}} -/*# sourceMappingURL=skin.mobile.min.css.map */ +* Copyright (c) Tiny Technologies, Inc. All rights reserved. +* Licensed under the LGPL or a commercial license. +* For LGPL see License.txt in the project root for license information. +* For commercial licenses see https://www.tiny.cloud/ +*/ +.tinymce-mobile-outer-container{all:initial;display:block}.tinymce-mobile-outer-container *{border:0;box-sizing:initial;cursor:inherit;float:none;line-height:1;margin:0;outline:0;padding:0;-webkit-tap-highlight-color:transparent;text-shadow:none;white-space:nowrap}.tinymce-mobile-icon-arrow-back::before{content:"\e5cd"}.tinymce-mobile-icon-image::before{content:"\e412"}.tinymce-mobile-icon-cancel-circle::before{content:"\e5c9"}.tinymce-mobile-icon-full-dot::before{content:"\e061"}.tinymce-mobile-icon-align-center::before{content:"\e234"}.tinymce-mobile-icon-align-left::before{content:"\e236"}.tinymce-mobile-icon-align-right::before{content:"\e237"}.tinymce-mobile-icon-bold::before{content:"\e238"}.tinymce-mobile-icon-italic::before{content:"\e23f"}.tinymce-mobile-icon-unordered-list::before{content:"\e241"}.tinymce-mobile-icon-ordered-list::before{content:"\e242"}.tinymce-mobile-icon-font-size::before{content:"\e245"}.tinymce-mobile-icon-underline::before{content:"\e249"}.tinymce-mobile-icon-link::before{content:"\e157"}.tinymce-mobile-icon-unlink::before{content:"\eca2"}.tinymce-mobile-icon-color::before{content:"\e891"}.tinymce-mobile-icon-previous::before{content:"\e314"}.tinymce-mobile-icon-next::before{content:"\e315"}.tinymce-mobile-icon-large-font::before,.tinymce-mobile-icon-style-formats::before{content:"\e264"}.tinymce-mobile-icon-undo::before{content:"\e166"}.tinymce-mobile-icon-redo::before{content:"\e15a"}.tinymce-mobile-icon-removeformat::before{content:"\e239"}.tinymce-mobile-icon-small-font::before{content:"\e906"}.tinymce-mobile-format-matches::after,.tinymce-mobile-icon-readonly-back::before{content:"\e5ca"}.tinymce-mobile-icon-small-heading::before{content:"small"}.tinymce-mobile-icon-large-heading::before{content:"large"}.tinymce-mobile-icon-large-heading::before,.tinymce-mobile-icon-small-heading::before{font-family:sans-serif;font-size:80%}.tinymce-mobile-mask-edit-icon::before{content:"\e254"}.tinymce-mobile-icon-back::before{content:"\e5c4"}.tinymce-mobile-icon-heading::before{content:"Headings";font-family:sans-serif;font-size:80%;font-weight:700}.tinymce-mobile-icon-h1::before{content:"H1";font-weight:700}.tinymce-mobile-icon-h2::before{content:"H2";font-weight:700}.tinymce-mobile-icon-h3::before{content:"H3";font-weight:700}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask{align-items:center;display:flex;justify-content:center;background:rgba(51,51,51,.5);height:100%;position:absolute;top:0;width:100%}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container{align-items:center;border-radius:50%;display:flex;flex-direction:column;font-family:sans-serif;font-size:1em;justify-content:space-between}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .mixin-menu-item{align-items:center;display:flex;justify-content:center;border-radius:50%;height:2.1em;width:2.1em}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section{align-items:center;display:flex;justify-content:center;flex-direction:column;font-size:1em}@media only screen and (min-device-width:700px){.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section{font-size:1.2em}}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon{align-items:center;display:flex;justify-content:center;border-radius:50%;height:2.1em;width:2.1em;background-color:#fff;color:#207ab7}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section .tinymce-mobile-mask-tap-icon::before{content:"\e900";font-family:tinymce-mobile,sans-serif}.tinymce-mobile-outer-container .tinymce-mobile-disabled-mask .tinymce-mobile-content-container .tinymce-mobile-content-tap-section:not(.tinymce-mobile-mask-tap-icon-selected) .tinymce-mobile-mask-tap-icon{z-index:2}.tinymce-mobile-android-container.tinymce-mobile-android-maximized{background:#fff;border:none;bottom:0;display:flex;flex-direction:column;left:0;position:fixed;right:0;top:0}.tinymce-mobile-android-container:not(.tinymce-mobile-android-maximized){position:relative}.tinymce-mobile-android-container .tinymce-mobile-editor-socket{display:flex;flex-grow:1}.tinymce-mobile-android-container .tinymce-mobile-editor-socket iframe{display:flex!important;flex-grow:1;height:auto!important}.tinymce-mobile-android-scroll-reload{overflow:hidden}:not(.tinymce-mobile-readonly-mode)>.tinymce-mobile-android-selection-context-toolbar{margin-top:23px}.tinymce-mobile-toolstrip{background:#fff;display:flex;flex:0 0 auto;z-index:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar{align-items:center;background-color:#fff;border-bottom:1px solid #ccc;display:flex;flex:1;height:2.5em;width:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group{align-items:center;display:flex;height:100%;flex-shrink:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group>div{align-items:center;display:flex;height:100%;flex:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-exit-container{background:#f44336}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group.tinymce-mobile-toolbar-scrollable-group{flex-grow:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item{padding-left:.5em;padding-right:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button{align-items:center;display:flex;height:80%;margin-left:2px;margin-right:2px}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item.tinymce-mobile-toolbar-button.tinymce-mobile-toolbar-button-selected{background:#c8cbcf;color:#ccc}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:first-of-type,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar:not(.tinymce-mobile-context-toolbar) .tinymce-mobile-toolbar-group:last-of-type{background:#207ab7;color:#eceff1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group{align-items:center;display:flex;height:100%;flex:1;padding-bottom:.4em;padding-top:.4em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog{display:flex;min-height:1.5em;overflow:hidden;padding-left:0;padding-right:0;position:relative;width:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain{display:flex;height:100%;transition:left cubic-bezier(.4,0,1,1) .15s;width:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen{display:flex;flex:0 0 auto;justify-content:space-between;width:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen input{font-family:Sans-serif}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container{display:flex;flex-grow:1;position:relative}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container .tinymce-mobile-input-container-x{-ms-grid-row-align:center;align-self:center;background:inherit;border:none;border-radius:50%;color:#888;font-size:.6em;font-weight:700;height:100%;padding-right:2px;position:absolute;right:0}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-input-container.tinymce-mobile-input-container-empty .tinymce-mobile-input-container-x{display:none}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous{align-items:center;display:flex}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous::before{align-items:center;display:flex;font-weight:700;height:100%;padding-left:.5em;padding-right:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-next.tinymce-mobile-toolbar-navigation-disabled::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serialised-dialog .tinymce-mobile-serialised-dialog-chain .tinymce-mobile-serialised-dialog-screen .tinymce-mobile-icon-previous.tinymce-mobile-toolbar-navigation-disabled::before{visibility:hidden}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item{color:#ccc;font-size:10px;line-height:10px;margin:0 2px;padding-top:3px}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-item.tinymce-mobile-dot-active{color:#c8cbcf}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-font::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-large-heading::before{margin-left:.5em;margin-right:.9em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-font::before,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-icon-small-heading::before{margin-left:.9em;margin-right:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider{display:flex;flex:1;margin-left:0;margin-right:0;padding:.28em 0;position:relative}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container{align-items:center;display:flex;flex-grow:1;height:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-size-container .tinymce-mobile-slider-size-line{background:#ccc;display:flex;flex:1;height:.2em;margin-bottom:.3em;margin-top:.3em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container{padding-left:2em;padding-right:2em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container{align-items:center;display:flex;flex-grow:1;height:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-slider-gradient-container .tinymce-mobile-slider-gradient{background:linear-gradient(to right,red 0,#feff00 17%,#0f0 33%,#00feff 50%,#00f 67%,#ff00fe 83%,red 100%);display:flex;flex:1;height:.2em;margin-bottom:.3em;margin-top:.3em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-black{background:#000;height:.2em;margin-bottom:.3em;margin-top:.3em;width:1.2em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider.tinymce-mobile-hue-slider-container .tinymce-mobile-hue-slider-white{background:#fff;height:.2em;margin-bottom:.3em;margin-top:.3em;width:1.2em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb{align-items:center;background-clip:padding-box;background-color:#455a64;border:.5em solid rgba(136,136,136,0);border-radius:3em;bottom:0;color:#fff;display:flex;height:.5em;justify-content:center;left:-10px;margin:auto;position:absolute;top:0;transition:border 120ms cubic-bezier(.39,.58,.57,1);width:.5em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-slider .tinymce-mobile-slider-thumb.tinymce-mobile-thumb-active{border:.5em solid rgba(136,136,136,.39)}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper,.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group>div{align-items:center;display:flex;height:100%;flex:1}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-serializer-wrapper{flex-direction:column;justify-content:center}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item{align-items:center;display:flex}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-toolbar-group-item:not(.tinymce-mobile-serialised-dialog){height:100%}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group .tinymce-mobile-dot-container{display:flex}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input{background:#fff;border:none;border-radius:0;color:#455a64;flex-grow:1;font-size:.85em;padding-bottom:.1em;padding-left:5px;padding-top:.1em}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::-webkit-input-placeholder{color:#888}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input:-ms-input-placeholder{color:#888}.tinymce-mobile-toolstrip .tinymce-mobile-toolbar.tinymce-mobile-context-toolbar .tinymce-mobile-toolbar-group input::placeholder{color:#888}.tinymce-mobile-dropup{background:#fff;display:flex;overflow:hidden;width:100%}.tinymce-mobile-dropup.tinymce-mobile-dropup-shrinking{transition:height .3s ease-out}.tinymce-mobile-dropup.tinymce-mobile-dropup-growing{transition:height .3s ease-in}.tinymce-mobile-dropup.tinymce-mobile-dropup-closed{flex-grow:0}.tinymce-mobile-dropup.tinymce-mobile-dropup-open:not(.tinymce-mobile-dropup-growing){flex-grow:1}.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height:200px}@media only screen and (orientation:landscape){.tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height:200px}}@media only screen and (min-device-width :320px) and (max-device-width :568px) and (orientation :landscape){.tinymce-mobile-ios-container .tinymce-mobile-dropup:not(.tinymce-mobile-dropup-closed){min-height:150px}}.tinymce-mobile-styles-menu{font-family:sans-serif;outline:4px solid #000;overflow:hidden;position:relative;width:100%}.tinymce-mobile-styles-menu [role=menu]{display:flex;flex-direction:column;height:100%;position:absolute;width:100%}.tinymce-mobile-styles-menu [role=menu].transitioning{transition:transform .5s ease-in-out}.tinymce-mobile-styles-menu .tinymce-mobile-styles-item{border-bottom:1px solid #ddd;color:#455a64;cursor:pointer;display:flex;padding:1em 1em;position:relative}.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser .tinymce-mobile-styles-collapse-icon::before{color:#455a64;content:"\e314";font-family:tinymce-mobile,sans-serif}.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-styles-item-is-menu::after{color:#455a64;content:"\e315";font-family:tinymce-mobile,sans-serif;padding-left:1em;padding-right:1em;position:absolute;right:0}.tinymce-mobile-styles-menu .tinymce-mobile-styles-item.tinymce-mobile-format-matches::after{font-family:tinymce-mobile,sans-serif;padding-left:1em;padding-right:1em;position:absolute;right:0}.tinymce-mobile-styles-menu .tinymce-mobile-styles-collapser,.tinymce-mobile-styles-menu .tinymce-mobile-styles-separator{align-items:center;background:#fff;border-top:#455a64;color:#455a64;display:flex;min-height:2.5em;padding-left:1em;padding-right:1em}.tinymce-mobile-styles-menu [data-transitioning-destination=before][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state=before]{transform:translate(-100%)}.tinymce-mobile-styles-menu [data-transitioning-destination=current][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state=current]{transform:translate(0)}.tinymce-mobile-styles-menu [data-transitioning-destination=after][data-transitioning-state],.tinymce-mobile-styles-menu [data-transitioning-state=after]{transform:translate(100%)}@font-face{font-family:tinymce-mobile;font-style:normal;font-weight:400;src:url(fonts/tinymce-mobile.woff?8x92w3) format('woff')}@media (min-device-width:700px){.tinymce-mobile-outer-container,.tinymce-mobile-outer-container input{font-size:25px}}@media (max-device-width:700px){.tinymce-mobile-outer-container,.tinymce-mobile-outer-container input{font-size:18px}}.tinymce-mobile-icon{font-family:tinymce-mobile,sans-serif}.mixin-flex-and-centre{align-items:center;display:flex;justify-content:center}.mixin-flex-bar{align-items:center;display:flex;height:100%}.tinymce-mobile-outer-container .tinymce-mobile-editor-socket iframe{background-color:#fff;width:100%}.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{background-color:#207ab7;border-radius:50%;bottom:1em;color:#fff;font-size:1em;height:2.1em;position:fixed;right:2em;width:2.1em;align-items:center;display:flex;justify-content:center}@media only screen and (min-device-width:700px){.tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{font-size:1.2em}}.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket{height:300px;overflow:hidden}.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-editor-socket iframe{height:100%}.tinymce-mobile-outer-container:not(.tinymce-mobile-fullscreen-maximized) .tinymce-mobile-toolstrip{display:none}input[type=file]::-webkit-file-upload-button{display:none}@media only screen and (min-device-width :320px) and (max-device-width :568px) and (orientation :landscape){.tinymce-mobile-ios-container .tinymce-mobile-editor-socket .tinymce-mobile-mask-edit-icon{bottom:50%}} \ No newline at end of file diff --git a/lms/envs/common.py b/lms/envs/common.py index c94b9c1f3d95..07d8557cdf50 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -2400,13 +2400,13 @@ def _make_locale_paths(settings): # pylint: disable=missing-function-docstring }, 'style-vendor-tinymce-content': { 'source_filenames': [ - 'js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/content.min.css' + 'js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/content.min.css' ], 'output_filename': 'css/lms-style-vendor-tinymce-content.css', }, 'style-vendor-tinymce-skin': { 'source_filenames': [ - 'js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce4/skin.min.css' + 'js/vendor/tinymce/js/tinymce/skins/ui/studio-tmce5/skin.min.css' ], 'output_filename': 'css/lms-style-vendor-tinymce-skin.css', }, diff --git a/xmodule/js/src/html/edit.js b/xmodule/js/src/html/edit.js index 80bbb2a0c25b..267297e21688 100644 --- a/xmodule/js/src/html/edit.js +++ b/xmodule/js/src/html/edit.js @@ -100,6 +100,7 @@ script_url: baseUrl + "js/vendor/tinymce/js/tinymce/tinymce.full.min.js", font_formats: _getFonts(), theme: "silver", + skin: "studio-tmce5", schema: "html5", entity_encoding: "raw", @@ -124,22 +125,23 @@ Disable visual aid on borderless table. */ visual: false, - plugins: "textcolor,link,image,codemirror", + plugins: "lists, link, image, codemirror", codemirror: { path: baseUrl + "js/vendor", disableFilesMerge: true, jsFiles: ["codemirror-compressed.js"], cssFiles: ["CodeMirror/codemirror.css"] }, + image_advtab: true, /* We may want to add "styleselect" when we collect all styles used throughout the LMS */ - toolbar: "formatselect | fontselect | bold italic underline forecolor wrapAsCode | " + - "alignleft aligncenter alignright alignjustify | " + - "bullist numlist outdent indent blockquote | link unlink " + - ((this.new_image_modal ? 'insertImage' : 'image') + " | code"), + toolbar: "formatselect fontselect bold italic underline forecolor wrapAsCode " + + "alignleft aligncenter alignright alignjustify " + + "bullist numlist outdent indent blockquote link unlink " + + ((this.new_image_modal ? 'insertImage' : 'image') + " code"), block_formats: edx.StringUtils.interpolate( gettext("{paragraph}=p;{preformatted}=pre;{heading3}=h3;{heading4}=h4;{heading5}=h5;{heading6}=h6"), { @@ -1241,7 +1243,7 @@ Translators: this is a toolbar button tooltip from the raw HTML editor displayed in the browser when a user needs to edit HTML */ tooltip: gettext('Code block'), - image: baseUrl + "images/ico-tinymce-code.png", + icon: 'code-sample', onAction: function() { return ed.formatter.toggle('code'); } From f2ebc332be9ea4d852f7e1e95f27f8de31387ff9 Mon Sep 17 00:00:00 2001 From: Arunmozhi Date: Fri, 3 Jun 2022 12:12:43 +1000 Subject: [PATCH 03/14] fix: prevent tinymce from breaking on optimised builds --- webpack.common.config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webpack.common.config.js b/webpack.common.config.js index 7aa2d02d1042..32d20559a734 100644 --- a/webpack.common.config.js +++ b/webpack.common.config.js @@ -173,7 +173,7 @@ module.exports = Merge.smart({ // https://github.com/webpack/webpack/issues/304#issuecomment-272150177 // (I've tried every other suggestion solution on that page, this // was the only one that worked.) - /\/sinon\.js|codemirror-compressed\.js|hls\.js|tinymce\.full\.min\.js/ + /\/sinon\.js|codemirror-compressed\.js|hls\.js|tinymce.js/ ], rules: [ { @@ -377,7 +377,7 @@ module.exports = Merge.smart({ 'jquery.timepicker': 'timepicker/jquery.timepicker', 'backbone.associations': 'backbone-associations/backbone-associations-min', squire: 'Squire', - tinymce: 'tinymce.full.min', + tinymce: 'tinymce', // See sinon/webpack interaction weirdness: // https://github.com/webpack/webpack/issues/304#issuecomment-272150177 From 18f822dab6e3b23f8b10cc950dd636832c4125d6 Mon Sep 17 00:00:00 2001 From: Arunmozhi Date: Wed, 8 Jun 2022 18:35:09 +1000 Subject: [PATCH 04/14] fix: update the CodeMirror plugin to use iframe messaging This commit implements the iframe postMessage based communication between TinyMCE and the CodeMirror plugin to get around cross-origin issues when hosting on CDN. This is a rewritten set of changes for TinyMCE 5 based on a similar commit[1] for TinyMCE 4. https://github.com/openedx/edx-platform/commit/9c1a42b85236d226db82a0d599a913d17588764f --- .../js/tinymce/plugins/codemirror/plugin.js | 110 +++++++++++- .../tinymce/plugins/codemirror/plugin.min.js | 2 +- .../js/tinymce/plugins/codemirror/source.html | 168 +++++++++--------- 3 files changed, 184 insertions(+), 96 deletions(-) diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/plugin.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/plugin.js index 65f9991d2700..a0e979627671 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/plugin.js +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/plugin.js @@ -10,7 +10,7 @@ tinymce.PluginManager.requireLangPack('codemirror') -tinymce.PluginManager.add('codemirror', function(editor, url) { +tinymce.PluginManager.add('codemirror', function (editor, url) { function showSourceEditor() { editor.focus() editor.selection.collapse(true) @@ -20,6 +20,24 @@ tinymce.PluginManager.add('codemirror', function(editor, url) { editor.selection.setContent('') } + // EDX: Use Iframe based URLs + // Determine the origin of the window that will host the code editor. + // If tinyMCE's baseURL is relative, then static files are hosted in the + // same origin as the containing page. If it is not relative, then we know that + // the origin of the iframe hosting the code editor will match the origin + // of tinyMCE's baseURL, as they are both hosted on the CDN. + var codeEditorOrigin; + var index = tinyMCE.baseURL.indexOf("/static/"); + if (index > 0) { + codeEditorOrigin = tinyMCE.baseURL.substring(0, index); + } + else { + codeEditorOrigin = window.location.origin; + } + + // Send the path location for CodeMirror and the parent origin to use in postMessage. + var sourceHtmlParams = "?CodeMirrorPath=" + editor.settings.codemirror.path + + "&ParentOrigin=" + window.location.origin; var codemirrorWidth = 800 if (editor.settings.codemirror.width) { codemirrorWidth = editor.settings.codemirror.width @@ -62,23 +80,28 @@ tinymce.PluginManager.add('codemirror', function(editor, url) { var config = { title: 'HTML source code', - url: url + '/source.html', + url: url + '/source.html' + sourceHtmlParams, width: codemirrorWidth, height: codemirrorHeight, resizable: true, maximizable: true, fullScreen: editor.settings.codemirror.fullscreen, saveCursorPosition: false, - buttons: buttonsConfig + buttons: buttonsConfig, + // EDX: Use the onClose callback to remove the message listener. + onClose: function () { + window.removeEventListener("message", messageListener); + } } if (tinymce.majorVersion >= 5) { config.onAction = function (dialogApi, actionData) { + // EDX: Change the onAction to use messages instead of window object references if (actionData.name === 'codemirrorOk') { - var doc = document.querySelectorAll('.tox-dialog__body-iframe iframe')[0] - doc.contentWindow.submit() - editor.undoManager.add() - win.close() + postToCodeEditor({type: "save"}); + } else if (actionData.name === 'codemirrorCancel') { + postToCodeEditor({type: "cancel"}); + win.close(); } } } @@ -87,9 +110,78 @@ tinymce.PluginManager.add('codemirror', function(editor, url) { ? editor.windowManager.open(config) : editor.windowManager.openUrl(config) - if (editor.settings.codemirror.fullscreen) { - win.fullscreen(true) + // EDX: The if block is commented because, + // In TinyMCE windowManager.openUrl returns a dialog instance API object + // and not a window object. So fullscreen cannot be called directly on `win`. + // if (editor.settings.codemirror.fullscreen) { + // win.fullscreen(true) + // } + + // EDX: Functions to send message to the CodeMirror Iframe and listen to + // messages posted by the iframe + var postToCodeEditor = function (message) { + win.sendMessage(message); + }; + var messageListener = function (event) { + // Check that the message came from the code editor. + if (codeEditorOrigin !== event.origin) { + return; + } + + var source; + if (event.data.type === "init") { + source = { content: editor.getContent({ source_view: true }) }; + // Post an event to allow rewriting of static links on the content. + editor.fire("ShowCodeEditor", source); + + postToCodeEditor( + { + type: "init", + content: source.content + } + ); + editor.dom.remove(editor.dom.select('.CmCaReT')); + } + else if (event.data.type === "setText") { + source = { content: event.data.text }; + var isDirty = event.data.isDirty; + + // Post an event to allow rewriting of static links on the content. + editor.fire('SaveCodeEditor', source); + + editor.setContent(source.content); + + // Set cursor: + var el = editor.dom.select('span#CmCaReT')[0]; + if (el) { + editor.selection.scrollIntoView(el); + editor.selection.setCursorLocation(el, 0); + editor.dom.remove(el); + } + // EDX: added because CmCaReT span was getting left in when caret was within a style tag. + // Make sure to strip it out (and accept that caret will not be in the correct place). + else { + var content = editor.getContent(); + var strippedContent = content.replace('', ''); + if (content !== strippedContent) { + editor.setContent(strippedContent); + } + } + + // EDX: moved block of code from original location since we may change content in bug fix code above. + editor.isNotDirty = !isDirty; + if (isDirty) { + editor.nodeChanged(); + } + editor.undoManager.add(); + win.close(); + } + else if (event.data.type === "closeWindow") { + win.close(); + } } + + window.addEventListener("message", messageListener, false); } if (tinymce.majorVersion < 5) { diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/plugin.min.js b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/plugin.min.js index 94c41ef0f5b7..08fff22af4f3 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/plugin.min.js +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/plugin.min.js @@ -1 +1 @@ -tinymce.PluginManager.requireLangPack("codemirror");tinymce.PluginManager.add("codemirror",function(e,o){function t(){e.focus();e.selection.collapse(true);if(e.settings.codemirror.saveCursorPosition){e.selection.setContent('')}var t=800;if(e.settings.codemirror.width){t=e.settings.codemirror.width}var r=550;if(e.settings.codemirror.height){r=e.settings.codemirror.height}var i=tinymce.majorVersion<5?[{text:"Ok",subtype:"primary",onclick:function(){var e=document.querySelectorAll(".mce-container-body>iframe")[0];e.contentWindow.submit();c.close()}},{text:"Cancel",onclick:"close"}]:[{type:"custom",text:"Ok",name:"codemirrorOk",primary:true},{type:"cancel",text:"Cancel",name:"codemirrorCancel"}];var n={title:"HTML source code",url:o+"/source.html",width:t,height:r,resizable:true,maximizable:true,fullScreen:e.settings.codemirror.fullscreen,saveCursorPosition:false,buttons:i};if(tinymce.majorVersion>=5){n.onAction=function(o,t){if(t.name==="codemirrorOk"){var r=document.querySelectorAll(".tox-dialog__body-iframe iframe")[0];r.contentWindow.submit();e.undoManager.add();c.close()}}}var c=tinymce.majorVersion<5?e.windowManager.open(n):e.windowManager.openUrl(n);if(e.settings.codemirror.fullscreen){c.fullscreen(true)}}if(tinymce.majorVersion<5){e.addButton("code",{title:"Source code",icon:"code",onclick:t});e.addMenuItem("code",{icon:"code",text:"Source code",context:"tools",onclick:t})}else{e.ui.registry.addButton("code",{text:"HTML",tooltip:"Edit HTML",onAction:t});e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Edit HTML",onAction:t,context:"tools"})}}); \ No newline at end of file +tinymce.PluginManager.requireLangPack("codemirror"),tinymce.PluginManager.add("codemirror",function(e,y){function i(){e.focus(),e.selection.collapse(!0),e.settings.codemirror.saveCursorPosition&&e.selection.setContent('');var c,l=tinyMCE.baseURL.indexOf("/static/");l>0?c=tinyMCE.baseURL.substring(0,l):c=window.location.origin;var p="?CodeMirrorPath="+e.settings.codemirror.path+"&ParentOrigin="+window.location.origin,m=800;e.settings.codemirror.width&&(m=e.settings.codemirror.width);var d=550;e.settings.codemirror.height&&(d=e.settings.codemirror.height);var w=tinymce.majorVersion<5?[{text:"Ok",subtype:"primary",onclick:function(){var o=document.querySelectorAll(".mce-container-body>iframe")[0];o.contentWindow.submit(),t.close()}},{text:"Cancel",onclick:"close"}]:[{type:"custom",text:"Ok",name:"codemirrorOk",primary:!0},{type:"cancel",text:"Cancel",name:"codemirrorCancel"}],s={title:"HTML source code",url:y+"/source.html"+p,width:m,height:d,resizable:!0,maximizable:!0,fullScreen:e.settings.codemirror.fullscreen,saveCursorPosition:!1,buttons:w,onClose:function(){window.removeEventListener("message",u)}};tinymce.majorVersion>=5&&(s.onAction=function(o,n){n.name==="codemirrorOk"?a({type:"save"}):n.name==="codemirrorCancel"&&(a({type:"cancel"}),t.close())});var t=tinymce.majorVersion<5?e.windowManager.open(s):e.windowManager.openUrl(s),a=function(o){t.sendMessage(o)},u=function(o){if(c===o.origin){var n;if(o.data.type==="init")n={content:e.getContent({source_view:!0})},e.fire("ShowCodeEditor",n),a({type:"init",content:n.content}),e.dom.remove(e.dom.select(".CmCaReT"));else if(o.data.type==="setText"){n={content:o.data.text};var g=o.data.isDirty;e.fire("SaveCodeEditor",n),e.setContent(n.content);var r=e.dom.select("span#CmCaReT")[0];if(r)e.selection.scrollIntoView(r),e.selection.setCursorLocation(r,0),e.dom.remove(r);else{var f=e.getContent(),C=f.replace('',"");f!==C&&e.setContent(C)}e.isNotDirty=!g,g&&e.nodeChanged(),e.undoManager.add(),t.close()}else o.data.type==="closeWindow"&&t.close()}};window.addEventListener("message",u,!1)}tinymce.majorVersion<5?(e.addButton("code",{title:"Source code",icon:"code",onclick:i}),e.addMenuItem("code",{icon:"code",text:"Source code",context:"tools",onclick:i})):(e.ui.registry.addButton("code",{text:"HTML",tooltip:"Edit HTML",onAction:i}),e.ui.registry.addMenuItem("code",{icon:"sourcecode",text:"Edit HTML",onAction:i,context:"tools"}))}); diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/source.html b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/source.html index 89e6932ce0cd..75e00072783e 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/source.html +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/source.html @@ -12,12 +12,37 @@ */ // Global vars: -var tinymce, // Reference to TinyMCE - editor, // Reference to TinyMCE editor - codemirror, // CodeMirror instance +var codemirror, // CodeMirror instance chr = 0, // Unused utf-8 character, placeholder for cursor isMac = /macintosh|mac os/i.test(navigator.userAgent), - CMsettings; // CodeMirror settings + CMsettings, // CodeMirror settings + messageHandler, + parentOrigin, + postToParent; + +// EDX: Add message handler for listening to events from TinyMCE +messageHandler = function(event) { + var cleanup = function () { + window.removeEventListener("message", messageHandler); + postToParent({type: "closeWindow"}); + }; + if (event.data.type === "init") { + start(event.data.content); + } + else if (event.data.type == "save") { + submit(); + cleanup(); + } + else if (event.data.type == "cancel") { + cleanup(); + } +}; +window.addEventListener("message", messageHandler); + +// EDX: Function to post messages to the TinyMCE instance. +postToParent = function(data) { + parent.postMessage(data, parentOrigin); +} function inArray(key, arr) { @@ -30,13 +55,24 @@ {// Initialise (before load) "use strict"; - tinymce = parent.tinymce; - editor = tinymce.activeEditor; - var i, userSettings = editor.settings.codemirror ? editor.settings.codemirror : {}; + var i; + var getParamByName = function (name) { + var match = new RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search); + return match && decodeURIComponent(match[1].replace(/\+/g, ' ')); + }; + + + // Getting this as a query parameter is very ugly, but the JS and CSS needs + // to be added to the head as the page is being rendered. Therefore it isn't possible + // to use postMessage APIs to get the setting value. And we can't hardcode the value in here + // because we need the baseURL, which is only added to server-side templated files. + var codemirrorPath = getParamByName("CodeMirrorPath"), + parentOrigin = getParamByName("ParentOrigin"); + CMsettings = { - path: userSettings.path || 'codemirror-4.8', - indentOnInit: userSettings.indentOnInit || false, - disableFilesMerge: userSettings.disableFilesMerge || false, + path: codemirrorPath, + indentOnInit: false, + disableFilesMerge: false, config: {// Default config mode: 'htmlmixed', theme: 'default', @@ -46,69 +82,29 @@ tabSize: 2, indentWithTabs: true, matchBrackets: true, - saveCursorPosition: true, + saveCursorPosition: true, styleActiveLine: true }, + // EDX: File paths are updated based on the directory structure of the JS + // files from common/static/js/vendor/CodeMirror/ jsFiles: [// Default JS files - 'lib/codemirror.js', - 'addon/edit/matchbrackets.js', - 'mode/xml/xml.js', - 'mode/javascript/javascript.js', - 'mode/css/css.js', - 'mode/htmlmixed/htmlmixed.js', - 'addon/dialog/dialog.js', - 'addon/search/searchcursor.js', - 'addon/search/search.js', - 'addon/selection/active-line.js' + 'CodeMirror/codemirror.js', + 'CodeMirror/addons/match-highlighter.js', + 'CodeMirror/addons/xml.js', + 'CodeMirror/addons/javascript.js', + 'CodeMirror/addons/css.js', + 'CodeMirror/addons/htmlmixed.js', + 'CodeMirror/addons/dialog/dialog.js', + 'CodeMirror/addons/searchcursor.js', + 'CodeMirror/addons/search.js', + 'CodeMirror/addons/edx_markdown.js' ], cssFiles: [// Default CSS files - 'lib/codemirror.css', - 'addon/dialog/dialog.css' + 'CodeMirror/codemirror.css', + 'CodeMirror/addons/dialog/dialog.css' ] }; - if (userSettings.fullscreen) { - CMsettings.jsFiles.push('addon/display/fullscreen.js'); - CMsettings.cssFiles.push('addon/display/fullscreen.css'); - } - - if (CMsettings.disableFilesMerge) { - if ( - Array.isArray(userSettings.jsFiles) && - Array.isArray(userSettings.cssFiles) && - (userSettings.jsFiles.length > 0) && - (userSettings.cssFiles.length > 0) - ) { - CMsettings.jsFiles = [] - CMsettings.cssFiles = [] - } else { - if (console) { - console.error('Codemirror plugin: jsFiles and cssFiles must be specified if disableFilesMerge is set to true') - console.warn('Codemirror plugin: ignoring disableFilesMerge') - } - } - } - - // Merge config - for (i in userSettings.config) { - CMsettings.config[i] = userSettings.config[i]; - } - - - // Merge jsFiles - for (i in userSettings.jsFiles) { - if (!inArray(userSettings.jsFiles[i], CMsettings.jsFiles)) { - CMsettings.jsFiles.push(userSettings.jsFiles[i]); - } - } - - // Merge cssFiles - for (i in userSettings.cssFiles) { - if (!inArray(userSettings.cssFiles[i], CMsettings.cssFiles)) { - CMsettings.cssFiles.push(userSettings.cssFiles[i]); - } - } - // Add trailing slash to path if (!/\/$/.test(CMsettings.path)) { CMsettings.path += '/'; @@ -131,10 +127,17 @@ document.documentElement.className += CMsettings.config.theme.replace(/(^|\s)\s*/g, " cm-s-"); } - window.onload = start; + // window.onload = postToParent({type: "init"}); + // Window Onload seems to fire as soon as the source.html is loaded and doesn't wait for + // the injected JS Files are loaded and until the CodeMirror object becomes available. + document.addEventListener('readystatechange', function() { + if (document.readyState == "complete") { + postToParent({type: "init"}); + } + }); }()); -function start() +function start(html) {// Initialise (on load) "use strict"; @@ -155,17 +158,17 @@ // head.appendChild(div); // Set CodeMirror cursor and bookmark to same position as cursor was in TinyMCE: - var html = editor.getContent({source_view: true}); + // var html = editor.getContent({source_view: true}); // [FIX] #6 z-index issue with table panel and source code dialog // editor.selection.getBookmark(); html = html.replace(/]*)>([^<]*)<\/span>/gm, String.fromCharCode(chr)); - editor.dom.remove(editor.dom.select('.CmCaReT')); + // editor.dom.remove(editor.dom.select('.CmCaReT')); // Hide TinyMCE toolbar panels, [FIX] #6 z-index issue with table panel and source code dialog // https://github.com/christiaan/tinymce-codemirror/issues/6 - tinymce.each(editor.contextToolbars, function(toolbar) { if (toolbar.panel) { toolbar.panel.hide(); } }); + // tinymce.each(editor.contextToolbars, function(toolbar) { if (toolbar.panel) { toolbar.panel.hide(); } }); CodeMirror.defineInitHook(function(inst) { @@ -178,7 +181,7 @@ } // Indent all code, if so requested: - if (editor.settings.codemirror.indentOnInit) { + if (CMsettings.indentOnInit) { var last = inst.lineCount(); inst.operation(function() { for (var i = 0; i < last; ++i) { @@ -229,7 +232,7 @@ doc.replaceSelection(cc); var pos = codemirror.getCursor(), - curLineHTML = doc.getLine(pos.line); + curLineHTML = doc.getLine(pos.line); if (findDepth(curLineHTML, cc) !== 0) { // Cursor is inside a , don't set cursor: @@ -255,25 +258,18 @@ code.search(ccLocationCheck) !== -1 ) { - editor.setContent(code.replace(cc, '')); + code = code.replace(cc, ''); } else { - editor.setContent(code.replace(cc, '')); + code = code.replace(cc, ''); } - editor.isNotDirty = !isDirty; - if (isDirty) { - editor.nodeChanged(); - } - - // Set cursor: - var el = editor.dom.select('span#CmCaReT')[0]; - if (el) { - editor.selection.scrollIntoView(el); - editor.selection.setCursorLocation(el,0); - editor.dom.remove(el); - } + postToParent({ + type: "setText", + text: code, + isDirty: isDirty + }); } document.onkeydown = function (evt) From 078eeda11e03f71abe8716b91e1a4b7a13540d10 Mon Sep 17 00:00:00 2001 From: Arunmozhi Date: Thu, 9 Jun 2022 14:46:12 +1000 Subject: [PATCH 05/14] refactor: replace CodeMirror addons files with codemirror-compressed in source.html --- .../js/tinymce/plugins/codemirror/source.html | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/source.html b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/source.html index 75e00072783e..a2d2fe68055a 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/source.html +++ b/common/static/js/vendor/tinymce/js/tinymce/plugins/codemirror/source.html @@ -88,16 +88,20 @@ // EDX: File paths are updated based on the directory structure of the JS // files from common/static/js/vendor/CodeMirror/ jsFiles: [// Default JS files - 'CodeMirror/codemirror.js', - 'CodeMirror/addons/match-highlighter.js', - 'CodeMirror/addons/xml.js', - 'CodeMirror/addons/javascript.js', - 'CodeMirror/addons/css.js', - 'CodeMirror/addons/htmlmixed.js', - 'CodeMirror/addons/dialog/dialog.js', - 'CodeMirror/addons/searchcursor.js', - 'CodeMirror/addons/search.js', - 'CodeMirror/addons/edx_markdown.js' + // 'CodeMirror/codemirror.js', + // 'CodeMirror/addons/match-highlighter.js', + // 'CodeMirror/addons/xml.js', + // 'CodeMirror/addons/javascript.js', + // 'CodeMirror/addons/css.js', + // 'CodeMirror/addons/htmlmixed.js', + // 'CodeMirror/addons/dialog/dialog.js', + // 'CodeMirror/addons/searchcursor.js', + // 'CodeMirror/addons/search.js', + // 'CodeMirror/addons/edx_markdown.js' + + // EDX: Use the codemirror-compressed.js and load everything in a single + // request instead of using multiple requests for multiple files + 'codemirror-compressed.js' ], cssFiles: [// Default CSS files 'CodeMirror/codemirror.css', From f6f2fc90b4c533421d56222078c89492e9f50526 Mon Sep 17 00:00:00 2001 From: Arunmozhi Date: Thu, 9 Jun 2022 23:11:01 +1000 Subject: [PATCH 06/14] docs: update BUILD_README with working instructions for bundling * This commit updates the instructions for updating TinyMCE with working set of steps as the previous instructions using the Jakefile was outdated. * The Jakefile zip bundle in vendor_extras is removed as it is no longer required --- .../static/js/vendor/tinymce/BUILD_README.txt | 31 +++- .../tinymce/js/tinymce/tinymce.full.min.js | 148 +++++++----------- vendor_extra/tinymce/JakePackage.zip | Bin 6547369 -> 0 bytes 3 files changed, 81 insertions(+), 98 deletions(-) delete mode 100644 vendor_extra/tinymce/JakePackage.zip diff --git a/common/static/js/vendor/tinymce/BUILD_README.txt b/common/static/js/vendor/tinymce/BUILD_README.txt index 7f067dabd056..ec03e41543e1 100644 --- a/common/static/js/vendor/tinymce/BUILD_README.txt +++ b/common/static/js/vendor/tinymce/BUILD_README.txt @@ -20,10 +20,29 @@ # Instructions for creating js/tinymce.full.min.js -1. Follow the README file of the downloaded tinymce’s codebase and install all the requirements. +The following uses the version 5.5.1 as a reference. Change your filenames depending the version you have downloaded. + +1. Unzip the zip file downloaded from Github. + ``` + unzip tinymce-5.5.1.zip + ``` 2. Open terminal and change directory to the newly downloaded tinymce. -3. Run the build command: “yarn build”, this will create multiple zip files in the build directory. -4. Unzip the tinymce_.zip file in common/static/vendor/js/ -5. Unzip vendor_extra/tinymce/JakePackage.zip in common/static/vendor/js/tinymce/. -6. Run the following command in the tinymce directory: npx jake minify bundle[themes:silver,plugins:*] -7. Cleanup by deleting the unversioned files that were created from unzipping jake_package.zip. + ``` + cd tinymce-5.5.1 + ``` +3. Build TinyMCE using Yarn. this will create multiple zip files in the `dist` directory. + ``` + yarn && yarn build + ``` +4. Unzip the dev bundle to the edx-platform's vendor directory. + ``` + unzip dist/tinymce_5.5.1_dev.zip -d /path/to/edx-platform/common/static/js/vendor/ + ``` +5. Remove the unnecessary files in `/path/to/edx-platform/common/static/js/vendor/tinymce` like `package.json`, `yarn.lock`...etc., +6. Generate a bundled version of the TinyMCE with all the plugins using the following command + ``` + cd common/static/js/vendor/tinymce/js/tinymce + find . -name "*.min.js" -not -name "jquery*" -not -name "tinymce.full.min.js" | sort -r | xargs cat > tinymce.full.min.js + ``` + This `find`s all the min.js files in the tinymce folders, sorts them reverse (local file first, folders next), and combines their content into a single file. + diff --git a/common/static/js/vendor/tinymce/js/tinymce/tinymce.full.min.js b/common/static/js/vendor/tinymce/js/tinymce/tinymce.full.min.js index a1cbec923f49..15f90f5f9dfc 100644 --- a/common/static/js/vendor/tinymce/js/tinymce/tinymce.full.min.js +++ b/common/static/js/vendor/tinymce/js/tinymce/tinymce.full.min.js @@ -6,8 +6,7 @@ * * Version: 5.5.1 (2020-10-01) */ -!function(){"use strict";var r=function(e){if(null===e)return"null";if(e===undefined)return"undefined";var t=typeof e;return"object"==t&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==t&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":t},t=function(e){return{eq:e}},s=t(function(e,t){return e===t}),i=function(o){return t(function(e,t){if(e.length!==t.length)return!1;for(var n=e.length,r=0;r=r.length&&n.substr(o,o+r.length)===r;var n,r,o},ze=function(t){return function(e){return e.replace(t,"")}},je=ze(/^\s+|\s+$/g),He=ze(/^\s+/g),Ve=ze(/\s+$/g),qe=/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,$e=function(t){return function(e){return Fe(e,t)}},We=[{name:"Edge",versionRegexes:[/.*?edge\/ ?([0-9]+)\.([0-9]+)$/],search:function(e){return Fe(e,"edge/")&&Fe(e,"chrome")&&Fe(e,"safari")&&Fe(e,"applewebkit")}},{name:"Chrome",versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/,qe],search:function(e){return Fe(e,"chrome")&&!Fe(e,"chromeframe")}},{name:"IE",versionRegexes:[/.*?msie\ ?([0-9]+)\.([0-9]+).*/,/.*?rv:([0-9]+)\.([0-9]+).*/],search:function(e){return Fe(e,"msie")||Fe(e,"trident")}},{name:"Opera",versionRegexes:[qe,/.*?opera\/([0-9]+)\.([0-9]+).*/],search:$e("opera")},{name:"Firefox",versionRegexes:[/.*?firefox\/\ ?([0-9]+)\.([0-9]+).*/],search:$e("firefox")},{name:"Safari",versionRegexes:[qe,/.*?cpu os ([0-9]+)_([0-9]+).*/],search:function(e){return(Fe(e,"safari")||Fe(e,"mobile/"))&&Fe(e,"applewebkit")}}],Ke=[{name:"Windows",search:$e("win"),versionRegexes:[/.*?windows\ nt\ ?([0-9]+)\.([0-9]+).*/]},{name:"iOS",search:function(e){return Fe(e,"iphone")||Fe(e,"ipad")},versionRegexes:[/.*?version\/\ ?([0-9]+)\.([0-9]+).*/,/.*cpu os ([0-9]+)_([0-9]+).*/,/.*cpu iphone os ([0-9]+)_([0-9]+).*/]},{name:"Android",search:$e("android"),versionRegexes:[/.*?android\ ?([0-9]+)\.([0-9]+).*/]},{name:"OSX",search:$e("mac os x"),versionRegexes:[/.*?mac\ os\ x\ ?([0-9]+)_([0-9]+).*/]},{name:"Linux",search:$e("linux"),versionRegexes:[]},{name:"Solaris",search:$e("sunos"),versionRegexes:[]},{name:"FreeBSD",search:$e("freebsd"),versionRegexes:[]},{name:"ChromeOS",search:$e("cros"),versionRegexes:[/.*?chrome\/([0-9]+)\.([0-9]+).*/]}],Xe={browsers:N(We),oses:N(Ke)},Ye="Firefox",Ge=function(e){var t=e.current,n=e.version,r=function(e){return function(){return t===e}};return{current:t,version:n,isEdge:r("Edge"),isChrome:r("Chrome"),isIE:r("IE"),isOpera:r("Opera"),isFirefox:r(Ye),isSafari:r("Safari")}},Je={unknown:function(){return Ge({current:undefined,version:Pe.unknown()})},nu:Ge,edge:N("Edge"),chrome:N("Chrome"),ie:N("IE"),opera:N("Opera"),firefox:N(Ye),safari:N("Safari")},Qe="Windows",Ze="Android",et="Solaris",tt="FreeBSD",nt="ChromeOS",rt=function(e){var t=e.current,n=e.version,r=function(e){return function(){return t===e}};return{current:t,version:n,isWindows:r(Qe),isiOS:r("iOS"),isAndroid:r(Ze),isOSX:r("OSX"),isLinux:r("Linux"),isSolaris:r(et),isFreeBSD:r(tt),isChromeOS:r(nt)}},ot={unknown:function(){return rt({current:undefined,version:Pe.unknown()})},nu:rt,windows:N(Qe),ios:N("iOS"),android:N(Ze),linux:N("Linux"),osx:N("OSX"),solaris:N(et),freebsd:N(tt),chromeos:N(nt)},it=function(e,t){var n,r,o,i,a,u,s,c,l,f,d,m,p=Xe.browsers(),g=Xe.oses(),h=Ie(p,e).fold(Je.unknown,Je.nu),v=Me(g,e).fold(ot.unknown,ot.nu);return{browser:h,os:v,deviceType:(r=h,o=e,i=t,a=(n=v).isiOS()&&!0===/ipad/i.test(o),u=n.isiOS()&&!a,s=n.isiOS()||n.isAndroid(),c=s||i("(pointer:coarse)"),l=a||!u&&s&&i("(min-device-width:768px)"),f=u||s&&!l,d=r.isSafari()&&n.isiOS()&&!1===/safari/i.test(o),m=!f&&!l&&!d,{isiPad:N(a),isiPhone:N(u),isTablet:N(l),isPhone:N(f),isTouch:N(c),isAndroid:n.isAndroid,isiOS:n.isiOS,isWebView:N(d),isDesktop:N(m)})}},at=function(e){return window.matchMedia(e).matches},ut=(ke=!(Ne=function(){return it(navigator.userAgent,at)}),function(){for(var e=[],t=0;t=a.length&&r(o)}))})})},dr=function(n){return{is:function(e){return n===e},isValue:k,isError:p,getOr:N(n),getOrThunk:N(n),getOrDie:N(n),or:function(e){return dr(n)},orThunk:function(e){return dr(n)},fold:function(e,t){return t(n)},map:function(e){return dr(e(n))},mapError:function(e){return dr(n)},each:function(e){e(n)},bind:function(e){return e(n)},exists:function(e){return e(n)},forall:function(e){return e(n)},toOptional:function(){return U.some(n)}}},mr=function(n){return{is:p,isValue:p,isError:k,getOr:o,getOrThunk:function(e){return e()},getOrDie:function(){return m(String(n))()},or:function(e){return e},orThunk:function(e){return e()},fold:function(e,t){return e(n)},map:function(e){return mr(n)},mapError:function(e){return mr(e(n))},each:V,bind:function(e){return mr(n)},exists:p,forall:k,toOptional:U.none}},pr={value:dr,error:mr,fromOption:function(e,t){return e.fold(function(){return mr(t)},dr)}},gr=function(a){if(!S(a))throw new Error("cases must be an array");if(0===a.length)throw new Error("there must be at least one case");var u=[],n={};return $(a,function(e,r){var t=ne(e);if(1!==t.length)throw new Error("one and only one name per case");var o=t[0],i=e[o];if(n[o]!==undefined)throw new Error("duplicate key detected:"+o);if("cata"===o)throw new Error("cannot have a case named cata (sorry)");if(!S(i))throw new Error("case arguments must be an array");u.push(o),n[o]=function(){var e=arguments.length;if(e!==i.length)throw new Error("Wrong number of arguments to case "+o+". Expected "+i.length+" ("+i+"), got "+e);for(var n=new Array(e),t=0;t\"\u0060\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Wo=/[<>&\u007E-\uD7FF\uE000-\uFFEF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Ko=/[<>&\"\']/g,Xo=/&#([a-z0-9]+);?|&([a-z0-9]+);/gi,Yo={128:"\u20ac",130:"\u201a",131:"\u0192",132:"\u201e",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02c6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017d",145:"\u2018",146:"\u2019",147:"\u201c",148:"\u201d",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02dc",153:"\u2122",154:"\u0161",155:"\u203a",156:"\u0153",158:"\u017e",159:"\u0178"},Go={'"':""","'":"'","<":"<",">":">","&":"&","`":"`"},Jo={"<":"<",">":">","&":"&",""":'"',"'":"'"},Qo=function(e,t){var n,r,o,i={};if(e){for(e=e.split(","),t=t||10,n=0;n>10),56320+(1023&t))):Yo[t]||String.fromCharCode(t):Jo[e]||Zo[e]||(n=e,(r=Nt.fromTag("div").dom).innerHTML=n,r.textContent||r.innerText||n);var n,r})}},oi={},ii={},ai=xt.makeMap,ui=xt.each,si=xt.extend,ci=xt.explode,li=xt.inArray,fi=function(e,t){return(e=xt.trim(e))?e.split(t||" "):[]},di=function(e){var s,t,n,r,o,i,c={},a=function(e,t,n){var r,o,i=function(e,t){for(var n={},r=0,o=e.length;r