diff --git a/.gitignore b/.gitignore index 040254cb..afa8f46a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ build *.swp .DS_Store .project +.idea node_modules diff --git a/demo/index.html b/demo/index.html index 0fbb962d..175391cb 100644 --- a/demo/index.html +++ b/demo/index.html @@ -1,9 +1,8 @@ - - + @@ -182,15 +181,11 @@

Tinymce Plugin

tinymce.init({ mode: "exact", elements: "tinymce", - theme: "modern", - plugins: 'ice,icesearchreplace', - theme_advanced_buttons1: "bold,italic,underline,|,bullist,numlist,|,undo,redo,code,|,search,replace,|,ice_togglechanges,ice_toggleshowchanges,iceacceptall,icerejectall,iceaccept,icereject", - theme_advanced_buttons2: "", - theme_advanced_buttons3: "", - theme_advanced_buttons4: "", - theme_advanced_toolbar_location: "top", - theme_advanced_toolbar_align: "left", + plugins: 'searchreplace ice icesearchreplace', + toolbar1: "bold italic underline | bullist numlist | undo redo code | search replace", + toolbar2: "ice_togglechanges | ice_toggleshowchanges | iceacceptall icerejectall | iceaccept icereject", extended_valid_elements: "p,span[*],delete[*],insert[*]", + content_css: "/ice/demo/demo.css", ice: { user: { name: 'Geoffrey Jellineck', id: 11}, preserveOnPaste: 'p,a[href],i,em,b,span', diff --git a/lib/tinymce/changelog.txt b/lib/tinymce/changelog.txt deleted file mode 100644 index 69b7ae50..00000000 --- a/lib/tinymce/changelog.txt +++ /dev/null @@ -1,477 +0,0 @@ -Version 3.5.8 (2012-11-20) - Fixed bug where html5 data attributes where stripped from contents. - Fixed bug where toolbar was annouced multiple times with JAWS on Firefox. - Fixed bug where the editor view whouldn't scroll to BR elements when using shift+enter or br enter mode. - Fixed bug where a JS error would be thrown when trying to paste table rows then the rows clipboard was empty. - Fixed bug with auto detection logic for youtube urls in the media plugin. - Fixed bug where the formatter would throw errors if you used the jQuery version of TinyMCE and the latest jQuery. - Fixed bug where the latest WebKit versions would produce span elements when deleting text between blocks. - Fixed bug where the autolink plugin would produce DOM exceptions when pressing shift+enter inside a block element. - Fixed bug where toggling of blockquotes when using br enter mode would produce an exception. - Fixed bug where focusing out of the body of the editor wouldn't properly add an undo level. - Fixed issue with warning message being displayed on IE 9+ about the meta header fix for IE 8. -Version 3.5.7 (2012-09-20) - Changed table row properties dialog to not update multiple rows when row type is header or footer. - Fixed bug in hyperlink dialog for IE9 where links with no target attr set had target value of -- - Changing toolbars to have a toolbar role for FF keyboard navigation works correctly. - Fixed bug where applying formatting to an empty block element would produce redundant spans. - Fixed bug where caret formatting on IE wouldn't properly apply if you pressed enter/return. - Fixed bug where loading TinyMCE using an async script wouldn't properly initialize editors. - Fixed bug where some white space would be removed after inline elements before block elements. - Fixed bug where it wouldn't properly parse attributes with a single backslash as it's contents. - Fixed bug where noscript elements would loose it's contents on older IE versions. - Fixed bug where backspace inside empty blockquote wouldn't delete it properly. - Fixed bug where custom elements with . in their names wouldn't work properly. - Fixed bug where the custom_elements option didn't properly setup the block elements schema structure. - Fixed bug where the custom_elements option didn't auto populate the extended_valid_elements. - Fixed bug where the whole TD element would get blcok formatted when there where BR elements in it. - Fixed bug where IE 9 might crash if the editor was hidden and specific styles where applied to surrounding contents. - Fixed bug where shift+enter inside a table cell on Gecko would produce an zero width non breaking space between tr:s. - Fixed bug where the advlink dialog wouldn't properly populate the anchors dropdown if the HTML5 schema was used. - Fixed issue with missing autofocus attribute on input element when using the HTML5 schema. - Fixed issue where enter inside a block contained within an LI element wouldn't produce a new LI. -Version 3.5.6 (2012-07-26) - Added "text" as a valid option to the editor.getContent format option. Makes it easier to get a text representation of the editor contents. - Fixed bug where resizing an image to less that 0x0 pixels would display the ghost image at an incorrect position. - Fixed bug where the remove format button would produce extra paragraphs on WebKit if all of the contents was selected. - Fixed issue where edge resize handles on images of wouldn't scale it with the same aspect ratio. - Fixed so force_p_newlines option works again since some users want mixed mode paragraphs. - Fixed so directionality plugin modifies the dir attribute of all selected blocks in the editor. - Fixed bug where backspace/delete of a custom element would move it's attributes to the parent block on Gecko. -Version 3.5.5 (2012-07-19) - Added full resize support for images and tables on WebKit/Opera. It now behaves just like Gecko. - Added automatic embed support for Vimeo, Stream.cz and Google Maps in media plugin. Patch contributed by Jakub Matas. - Fixed bug where the lists plugin wouldn't properly remove all li elements when toggling selected items of. Patched by Taku AMANO. - Fixed bug where the lists plugin would remove the entire list if you pressed deleted at the beginning of the first element. Patched by Taku AMANO. - Fixed bug where the ordered/unordered list buttons could both be enabled if you nested lists. Patch contributed by Craig Petchell. - Fixed bug where shift+enter wouldn't produce a BR in a LI when having forced_root_blocks set to false. - Fixed bug where scrollbars aren't visible in fullscreen when window is resized. - Fixed bug with updating the border size using the advimage dialog on IE 9. - Fixed bug where the selection of inner elements on IE 8 in contentEditable mode would select the whole parent element. - Fixed bug where the enter key would produce an empty anchor if you pressed it at the space after a link on IE. - Fixed bug where autolink plugin would produce an exception for specific html see bug #5365 - Fixed so the formatChanged function takes an optional "similar" parameter to use while matching the format. -Version 3.5.4.1 (2012-06-24) - Fixed issue with Shift+A selecting all contents on Chrome. -Version 3.5.4 (2012-06-21) - Added missing mouse events to HTML5 schema. Some events needs to be manually defined though since the spec is huge. - Added image resizing for WebKit browsers by faking the whole resize behavior. - Fixed bug in context menu plugin where listener to hide menu wasn't removed correctly. - Fixed bug where media plugin wouldn't use placeholder size for the object/video elements. - Fixed bug where jQuery plugin would break attr function in jQuery 1.7.2. - Fixed bug where jQuery plugin would throw an error if you used the tinymce pseudo selector when TinyMCE wasn't loaded. - Fixed so encoding option gets applied when using jQuery val() or attr() to extract the contents. - Fixed so any non valid width/height passed to media plugin would get parsed to proper integer or percent values. -Version 3.5.3 (2012-06-19) - Added missing wbr element to HTML5 schema. - Added new mceToggleFormat command. Enabled you to toggle a specific format on/off. - Fixed bug where undo/redo state didn't update correctly after executing an execCommand call. - Fixed bug where the editor would get auto focused on IE running in quirks mode. - Fixed bug where pressing enter before an IMG or INPUT element wouldn't properly split the block. - Fixed bug where backspace would navigate back when selecting control types on IE. - Fixed bug where the editor remove method would unbind events for controls outside the editor instance UI. - Fixed bug where the autosave plugin would try to store a draft copy of editors that where removed. - Fixed bug where floated elements wouldn't expand the block created when pressing enter on non IE browsers. - Fixed bug where the caret would be placed in the wrong location when pressing enter at the beginning of a block. - Fixed bug where it wasn't possible to block events using the handle_event_callback option. - Fixed bug where keyboard navigation of the ColorSplitButton.js didn't work correctly. - Fixed bug where keyboard navigation didn't work correctly on split buttons. - Fixed bug where the legacy Event.add function didn't properly handle multiple id:s passed in. - Fixed bug where the caret would disappear on IE when selecting all contents and pressing backspace/delete. - Fixed bug where the getStart/getEnd methods would sometimes return elements from the wrong document on IE. - Fixed so paragraphs gets created if you press enter inside a form element. -Version 3.5.2 (2012-05-31) - Added new formatChanged method to tinymce.Formatter class. Enables easier state change handling of formats. - Added new selectorChanged method to tinymce.dom.Selection class. Enables easier state change handling of matching CSS selectors. - Changed the default theme to be advanced instead of simple since most users uses the advanced theme. - Changed so the theme_advanced_buttons doesn't have a default set if one button row is specified. - Changed the theme_advanced_toolbar_align default value to "left". - Changed the theme_advanced_toolbar_location default value to "top". - Changed the theme_advanced_statusbar_location default value to "bottom". - Fixed bug where the simple link dialog would remove class and target attributes from links when updating them if the drop downs wasn't visible. - Fixed bug where the link/unlink buttons wouldn't get disabled once a link was created by the autolink plugin logic. - Fixed bug where the border attribute was missing in the HTML5 schema. - Fixed bug where the legacyoutput plugin would use inline styles for font color. - Fixed bug where editing of anchor names wouldn't produce an undo level. - Fixed bug where the table plugin would delete the last empty block element in the editor. - Fixed bug where pasting table rows when they where selected would make it impossible to editor that table row. - Fixed bug with pressing enter in IE while having a select list focused would produce a JS error. - Fixed bug where it wasn't possible to merge table cells by selecting them and using merge from context menu. - Removed summary from HTML5 table attributes and fixed so this and other deprecated table fields gets hidden in the table dialog. -Version 3.5.1.1 (2012-05-25) - Fixed bug with control creation where plugin specific controls didn't work as expected. -Version 3.5.1 (2012-05-25) - Added new onBeforeAdd event to UndoManager patch contributed by Dan Rumney. - Added support for overriding the theme rendering logic by using a custom function. - Fixed bug where links wasn't automatically created by the autolink plugin on old IE versions when pressing enter in BR mode. - Fixed bug where enter on older IE versions wouldn't produce a new paragraph if the previous sibling paragraph was empty. - Fixed bug where toString on a faked DOM range on older IE versions wouldn't return a proper string. - Fixed bug where named anchors wouldn't work properly when schema was set to HTML5. - Fixed bug where HTML5 datalist options wasn't correctly parsed or indented. - Fixed bug where linking would add anchors around block elements when the HTML5 schema was used. - Fixed issue where the autolink plugin wouldn't properly handle mailto:user@domain.com. - Optimized initialization and reduced rendering flicker by hiding the target element while initializing. -Version 3.5.0.1 (2012-05-10) - Fixed bug where selection normalization logic would break the selections of parent elements using the element path. - Fixed bug where the autolink plugin would include trailing dots in domain names in the link creation. - Fixed bug where the autolink plugin would produce an error on older IE versions when pressing enter. - Fixed bug where old IE versions would throw an error during initialization when the editor was placed in an size restricted div. -Version 3.5 (2012-05-03) - Fixed menu rendering issue if the document was in rtl mode. - Fixed bug where the hide function would throw an error about a missing variable. - Fixed bug where autolink wouldn't convert URLs when hitting enter on IE due to the new enter key logic. - Fixed bug where formatting using shortcuts like ctrl+b wouldn't work properly the first time. - Fixed bug where selection.setContent after a formatter call wouldn't generate formatted contents. - Fixed bug where whitespace would be removed before/after invalid_elements when they where removed. - Fixed bug where updating styles using the theme image dialog in non inline mode on IE9 would produce errors. - Fixed bug where IE 8 would produce an error when using the contextmenu plugin. - Fixed bug where delete/backspace could remove contents of noneditable elements. - Fixed so background color in style preview gets computed from body element if the current style element is transparent. -Version 3.5b3 (2012-03-29) - Added cancel button to colour picker dialog. - Added figure and figcaption to the html5 visualblocks plugin. - Added default alignment options for the figure element. - Fixed bug where empty inline elements within block elements would sometimes produce a br child element. - Fixed bug where urls pointing to the same domain as the current one would cause undefined errors. Patch contributed by Paul Giberson. - Fixed bug where enter inside an editable element inside an non editable element would split the element. - Fixed bug where cut/copy/paste of noneditable elements didn't work. - Fixed bug where backspace would sometimes produce font elements on WebKit. - Fixed bug where WebKit would produce spans out of various inline elements when using backspace. - Fixed bug where IE9 wouldn't properly update image styles when images where resized. - Fixed bug where drag/drop of noneditable elements didn't work correctly. - Fixed bug where applying formatting to all contents wouldn't work correctly when an end point was inside an empty bock. Patch contributed by Jose Luiz. - Fixed bug where IE10 removed the scopeName from the DOM element interface and there for it produced an undefined string in element path. - Fixed bug where the caret would be placed at an incorrect location if you applied block formatting while having the caret at the end of the block. - Fixed bug where applying column changes using the cell dialog would only update the first column. Patch contributed by krzyko. - Fixed bug where the visualblocks plugin would force editor focus if it was turned on by default. - Fixed bug where the tabfocus plugin would tab to iframes these are now ignored. - Fixed bug where format drop down list wouldn't show the currently active format for a parent element. - Fixed bug where paste of plain text in IE 9 would remove the new line characters from text. - Fixed bug where the menu buttons/split button menus wouldn't be opened at the right location on older IE versions. - Fixed bug where Gecko browsers wouldn't properly display the right format when having the selection as specific places. - Fixed bug where shift+enter inside the body when having forced_root_blocks set to false would throw an error. - Fixed bug where the jQuery plugin would break the attr method of jQuery 1.7.2. Patch contributed by Markus Kemmerling. - Fixed so options like content_css accepts and array as well as a comma separated string as input. - Restructured the internal logic to make it more separate from Editor.js. - Updated the Sizzle engine to the latest version. -Version 3.5b2 (2012-03-15) - Rewrote the enter key logic to normalize browser behavior. - Fixed so enter within PRE elements produces a BR and shift+enter breaks/end the PRE. Can be disabled using the br_in_pre option. - Fixed bug where the selection wouldn't be correct after applying formatting and having the caret at the end of the new format node. - Fixed bug where the noneditable plugin would process contents on raw input calls for example on undo/redo calls. - Fixed bug where WebKit could produce an exception when a bookmark was requested when there wasn't a proper selection. - Fixed bug where WebKit would fail to open the image dialog since it would be returning false for a class name instead of a string. - Fixed so alignment and indentation works properly when forced_root_blocks is set to false. It will produce a DIV by default. -Version 3.5b1 (2012-03-08) - Added new event class that is faster and enables support for faking events. - Added new self_closing_elements, short_ended_elements, boolean_attributes, non_empty_elements and block_elements options to control the HTML Schema. - Added new schema option and support for the HTML5 schema. - Added new visualblocks plugin that shows html5 blocks with visual borders. - Added new types and selector options to make it easier to create editor instances with different configs. - Added new preview of formatting options in various listboxes. - Added new preview_styles option that enables control over what gets previewed. - Fixed bug where content css would be loaded twice into iframe. - Fixed bug where start elements with only whitespace in the attribute part wouldn't be correctly parsed. - Fixed bug where the advlink dialog would produce an error about the addSelectAccessibility function not being defined. - Fixed bug where the caret would be placed at an incorrect position if span was removed by the invalid_elements setting. - Fixed bug where elements inside a white space preserve element like pre didn't inherit the behavior while parsing. -Version 3.4.9 (2012-02-23) - Added settings to wordcount plugin to configure update rate and checking wordcount on backspace and delete using wordcount_update_rate and wordcount_update_on_delete. - Fixed bug in Webkit and IE where deleting empty paragraphs would remove entire editor contents. - Fixed bug where pressing enter on end of list item with a heading would create a new item with heading. - Fixed edit css style dialog text-decoration none checkbox so it disables other text-decoration options when enabled. - Fixed bug in Gecko where undo wasn't added when focus was lost. - Fixed bug in Gecko where shift-enter in table cell ending with BR doesn't move caret to new line. - Fixed bug where right-click on formatted text in IE selected the entire line. - Fixed bug where text ending with space could not be unformatted in IE. - Fixed bug where caret formatting would be removed when moving the caret when a selector expression was used. - Fixed bug where formatting would be applied to the body element when all contents where selected and format had both inline and selector parts. - Fixed bug where the media plugin would throw errors if you had iframe set as an invalid element in config. - Fixed bug where the caret would be placed at the top of the document if you inserted a table and undo:ed that operation. Patch contributed by Wesley Walser. - Fixed bug where content css files where loaded twice into the iframe. - Fixed so elements with comments would be trated as non empty elements. Patch contributed by Arjan Scherpenisse. -Version 3.4.8 (2012-02-02) - Fixed bug in IE where selected text ending with space cannot be formatted then formatted again to get original text. - Fixed bug in IE where images larger than editor area were being deselected when toolbar buttons are clicked. - Fixed bug where wrong text align buttons are active when multiple block elements are selected. - Fixed bug where selected link not showing in target field of link dialog in some selection cases. - Use settings for remove_trailing_br so this can be turned off instead of hard coding the value. - Fixed bug in IE where the media plugin displayed null text when some values aren't filled in. - Added API method 'onSetAttrib' that fires when the attribute value on a node changes. - Fix font size dropdown value not being updated when text already has a font size in the advanced template. - Fixed bug in IE where IE doesn't use ARIA attributes properly on options - causing labels to be read out 2 times. - Fixed bug where caret cannot be placed after table if table is at end of document in IE. - Fixed bug where adding range isn't always successful so we need to check range count otherwise an exception can occur. - Added spacebar onclick handler to toolbar buttons to ensure that the accessibility behaviour works correctly. - Fixed bug where a stranded bullet point would get created in WebKit. - Fixed bug where selecting text in a blockquote and pressing backspace toggles the style. - Fixed bug where pressing enter from a heading in IE, the resulting P tag below it shares the style property. - Fix white space in between spans from being deleted. - Fixed bug where scrollbars where visible in the character map dialog on Gecko. - Fixed issue with missing translation for one of the emoticons. - Fixed bug where dots in id:s where causing problems. Patch provided by Abhishek Dev. - Fixed bug where urls with an at sign in the path wouldn't be parsed correctly. Patch contributed by Jason Grout. - Fixed bug where Opera would remove the first character of a inline formatted word if you pressed backspace. - Fixed bugs with the autoresize plugin on various browsers and removed the need for the throbber. - Fixed performance issue where the contextmenu plugin would try to remove the menu even if it was removed. Patch contributed by mhu. -Version 3.4.7 (2011-11-03) - Modified the caret formatting behavior to word similar to common desktop wordprocessors like Word or Libre Office. - Fixed bug in Webkit - Cursor positioning does not work vertically within a table cell with multiple lines of text. - Fixed bug in IE where Inserting a table in IE8 places cursor in the second cell of the first row. - Fixed bug in IE where editor in a frame doesn't give focus to the toolbar using ALT-F10. - Fix for webkit and gecko so that deleting bullet from start of list outdents inner list items and moves first item into paragraph. - Fix new list items in IE8 not displayed on a new line when list contains nested list items. - Clear formatting in table cell breaks the cell. - Made media type list localisable. - Fix out of memory error when using prototype in media dialog. - Fixed bug where could not add a space in the middle of a th cell. - Fixed bug where adding a bullet between two existing bullets adds an extra one - Fixed bug where trying to insert a new entry midway through a bulleted list fails dismally when the next entry is tabbed in. - Fixed bug where pressing enter on an empty list item does not outdent properly in FF - Fixed bug where adding a heading after a list item in a table cell changes all styles in that cell - Fixed bug where hitting enter to exit from a bullet list moves cursor to the top of the page in Firefox. - Fixed bug where pressing backspace would not delete HRs in Firefox and IE when next to an empty paragraph. - Fixed bug where deleting part of the link text can cause a link with no destination to be saved. - Fixed bug where css style border widths wasn't handled correctly in table dialog. - Fixed bug where parsing invalid html contents on IE or WebKit could produce an infinite loop. - Fixed bug where scripts with custom script types wasn't properly passed though the editor. - Fixed issue where some Japanese kanji characters wasn't properly entity encoded when numeric entity mode was enabled. - Made emoticons dialog use the keyboard naviation. - Added navigation instructions to the symbols dialog. - Added ability to set default values for the media plugin. - Added new font_size_legacy_values option for converting old font element sizes to span with font-size properties. - Fixed bug where the symbols dialog was not accessible. - Added quirk for IE ensuring that the body of the document containing tinyMCE has a role="application" for accessibility. - Fixed bug where the advanced color picker wasn't working properly on FF 7. - Fixed issue where the advanced color picker was producing uppercase hex codes. - Fixed bug where IE 8 could throw exceptions if the contents contained resizable content elements. - Fixed bug where caret formatting wouldn't be correctly applied to previous sibling on WebKit. - Fixed bug where the select boxes for font size/family would loose it's value on WebKit due to recent iOS fixes. -Version 3.4.6 (2011-09-29) - Fixed bug where list items were being created for empty divs. - Added support in Media plugin for audio media using the embed tag - Fixed accessibility bugs in WebKit and IE8 where toolbar items were not being read. - Added new use_accessible_selects option to ensure accessible list boxes are used in all browsers (custom widget in firefox native on other browsers) - Fixed bug where classid attribute was not being checked from embed objects. - Fixed bug in jsrobot tests with intermittently failing. - Fixed bug where anchors wasn't updated properly if you edited them using IE 8. - Fixed bug where input method on WebKit on Mac OS X would fail to initialize when sometimes focusing the editor. - Fixed bug where it wasn't possible to select HR elements on WebKit by simply clicking on them. - Fixed bug where the media plugin wouldn't work on IE9 when not using the inlinepopups plugin. - Fixed bug where hspace,vspace,align and bgcolor would be removed from object elements in the media plugin. - Fixed bug where the new youtube format wouldn't be properly parsed by the media plugin. - Fixed bug where the style attribute of layers wasn't properly updated on IE and Gecko. - Fixed bug where editing contents in a layer would fail on Gecko since contentEditable doesn't inherit properly. - Fixed bug where IE 6/7 would produce JS errors when serializing contents containing layers. -Version 3.4.5 (2011-09-06) - Fixed accessibility bug in WebKit where the right and left arrow keys would update native list boxes. - Added new whitespace_elements option to enable users to specify specific elements where the whitespace is preserved. - Added new merge_siblings option to formats. This option makes it possible to disable the auto merging of siblings when applying formats. - Fixed bug in IE where trailing comma in paste plugin would cause plugin to not run correctly. - Fixed bug in WebKit where console messages would be logged when deleting an empty document. - Fixed bug in IE8 where caret positioned is on list item instead of paragraph when outdent splits the list - Fixed bug with image dialogs not inserting an image if id was omitted from valid_elements. - Fixed bug where the selection normalization logic wouldn't properly handle image elements in specific config cases. - Fixed bug where the map elements coords attribute would be messed up by IE when serializing the DOM. - Fixed bug where IE wouldn't properly handle custom elements when the contents was serialized. - Fixed bug where you couldn't move the caret in Gecko if you focused the editor using the API or a UI control. - Fixed bug where adjacent links would get merged on IE due to bugs in their link command. - Fixed bug where the color split buttons would loose the selection on IE if the editor was placed in a frame/iframe. - Fixed bug where floated images in WebKit wouldn't get properly linked. - Fixed bug where the fullscreen mode in a separate window wasn't forced into IE9+ standards mode. - Fixed bug where pressing enter in an empty editor on WebKit could produce DIV elements instead of P. - Fixed bug where spans would get removed incorrectly when merging two blocks on backspace/delete on WebKit. - Fixed bug where the editor contents wouldn't be completely removed on backspace/delete on WebKit. - Fixed bug where the fullpage plugin wouldn't properly render style elements in the head on IE 6/7. - Fixed bug where the nonbreaking_force_tab option in the nonbreaking plugin wouldn't work on Gecko/WebKit. - Fixed bug where the isDirty state would become true on non IE browsers if there was an table at the end of the contents. - Fixed bug where entities wasn't properly encoded on WebKit when pasting text as plain text. - Fixed bug where empty editors would produce an exception of valid_elements didn't include body and forced_root_blocks where disabled. - Fixed bug where the fullscreen mode wouldn't retain the header/footer in the fullpage plugin. - Fixed issue where the plaintext_mode and plaintext_mode_sticky language keys where swapped. -Version 3.4.4 (2011-08-04) - Added new html5 audio support. Patch contributed by Ronald M. Clifford. - Added mute option for video elements and preload options for video/audio patch contributed by Dmitry Kalinkin. - Fixed selection to match visual selection before applying formatting changes. - Fixed browser specific bugs in lists for WebKit and IE. - Fixed bug where IE would scroll the window if you closed an inline dialog that was larger than the viewport. Patch by Laurence Keijmel. - Fixed bug where pasting contents near a span element could remove parts of that span. Patch contributed by Wesley Walser. - Fixed bug where formatting change would be lost after pressing enter. - Fixed bug in WebKit where deleting across blocks would add extra styles. - Fixed bug where moving cursor vertically in tables in WebKit wasn't working. - Fixed bug in IE where deleting would cause error in console. - Fixed bug where the formatter was not applying formats across list elements. - Fixed bug where the wordcount plugin would try and update the wordcount if tinymce had been destroyed. - Fixed bug where tabfocus plugin would attempt to focus elements not displayed when their parent element was hidden. - Fixed bug where the contentEditable state would sometimes be removed if you deleted contents in Gecko. - Fixed bug where inserting contents using mceInsertContent would fail if "span" was disabled in valid_elements. - Fixed bug where initialization might fail if some resource on gecko wouldn't load properly and fire the onload event. - Fixed bug where ctrl+7/8/9 keys wouldn't properly add the specific formats associated with them. - Fixed bug where the HTML tags wasn't properly closed in the style plugins properties dialog. - Fixed bug where the list plugin would produce an exception if the user tried to delete an element at the very first location. -Version 3.4.3.2 (2011-06-30) - Fixed bug where deleting all of a paragraph inside a table cell would behave badly in webkit. - Fixed bugs in tests in firefox5 and WebKit. - Fixed bug where selection of table cells would produce an exception on Gecko. - Fixed bug where the caret wasn't properly rendered on Gecko when the editor was hidden. - Fixed bug where pasting plain text into WebKit would produce a pre element it will now produce more semantic markup. - Fixed bug where selecting list type formats using the advlist plugin on IE8 would loose editor selection. - Fixed bug where forced root blocks logic wouldn't properly pad elements created if they contained data attributes. - Fixed bug where it would remove all contents of the editor if you inserted an image when not having a caret in the document. - Fixed bug where the YUI compressor wouldn't properly encode strings with only a quote in them. - Fixed bug where WebKit on iOS5 wouldn't call nodeChanged when the selection was changed. - Fixed bug where mceFocus command wouldn't work properly on Gecko since it didn't focus the body element. - Fixed performance issue with the noneditable plugin where it would enable/disable controls to often. -Version 3.4.3.1 (2011-06-16) - Fixed bug where listboxes were not being handled correctly by JAWS in firefox with the o2k7 skin. - Fixed bug where custom buttons were not being rendered correctly when in high contrast mode. - Added support for iOS 5 that now supporting contentEditable in it's latest beta. - Fixed bug where urls in style attributes with a _ character followed by a number would cause incorrect output. - Fixed bug where custom_elements option wasn't working properly on IE browsers. - Fixed bug where custom_elements marked as block elements wouldn't get correctly treated as block elements. - Fixed bug where attributes with wasn't properly encoded as XML entities. -Version 3.4.3 (2011-06-09) - Fixed bug where deleting backwards before an image into a list would put the cursor in the wrong location. - Fixed bug where styles plugin would not apply styles across multiple selected block elements correctly. - Fixed bug where cursor would jump to start of document when selection contained empty table cells in IE8. - Fixed bug where applied styles wouldn't be kept if you pressed enter twice to produce two paragraphs. - Fixed bug where a ghost like caret would appear on Gecko when pressing enter while having a text color applied. - Fixed bug where IE would produce absolute urls if you inserted a image/link and reloaded the page. - Fixed bug where applying a heading style to a list item would cascade style to children list items. - Fixed bug where Editor loses focus when backspacing and changing styles in WebKit. - Fixed bug where exception was thrown in tinymce.util.URI when parsing a relative URI and no base_uri setting was provided. - Fixed bug where alt-f10 was not always giving focus to the toolbar on Safari. - Added new 'allow_html_in_named_anchor' option to allow html to occur within a named anchor tag. Use at own risk. - Added plugin dependency support. Will autoload plugins specified as a dependency if they haven't been loaded. - Fixed bug where the autolink plugin didn't work with non-English keyboards when pressing ). - Added possibility to change properties of all table cells in a column. - Added external_image_list option to get images list from user-defined variable or function. - Fixed bug where the autoresize plugin wouldn't reduce the editors height on Chrome. - Fixed bug where table size inputs were to small for values with size units. - Fixed bug where table cell/row size input values were not validated. - Fixed bug where menu item line-height would be set to wrong value by external styles. - Fixed bug where hasUndo() would return wrong answer. - Fixed bug where page title would be set to undefined by fullpage plugin. - Fixed bug where HTML5 video properties were not updated in embedded media settings. - Fixed bug where HTML comment on the first line would cause an error. - Fixed bug where spellchecker menu was positioned incorrectly on IE. - Fixed bug where breaking out of list elements on WebKit would produce a DIV instead of P after the list. - Fixed bug where pasting from Word in IE9 would add extra BR elements when text was word wrapped. - Fixed bug where numeric entities with leading zeros would produce incorrect decoding. - Fixed bug where hexadecimal entities wasn't properly decoded. - Fixed bug where bookmarks wasn't properly stored/restored on undo/redo. - Fixed bug where the mceInsertCommand didn't retain the values of links if they contained non url contents. - Fixed bug where the valid_styles option wouldn't be properly used on styles for specific elements. - Fixed so contentEditable is used for the body of the editor if it's supported. - Fixed so trailing BR elements gets removed even when forced_root_blocks option was set to false/null. - Fixed performance issue with mceInsertCommand and inserting very simple contents. - Fixed performance issue with older IE version and huge documents by optimizing the forced root blocks logic. - Fixed performance issue with table plugin where it checked for selected cells to often. - Fixed bug where creating a link on centered/floated image would produce an error on WebKit browsers. - Fixed bug where Gecko would remove single paragraphs if there where contents before/after it. - Fixed bug where the scrollbar would move up/down when pasting contents using the paste plugin. -Version 3.4.2 (2011-04-07) - Added new 'paste_text_sticky_default' option to paste plugin, enables you to set the default state for paste as plain text. - Added new autoresize_bottom_margin option to autoresize plugin that enables you to add an extra margin at the bottom. Patch contributed by Andrew Ozz. - Rewritten the fullpage plugin to handle style contents better and have a more normalized behavior across browsers. - Fixed bug where contents inserted with mceInsertContent wasn't parsed using the default dom parser. - Fixed bug where blocks containing a single anchor element would be treated as empty. - Fixed bug where merging of table cells on IE 6, 7 wouldn't look correctly until the contents was refreshed. - Fixed bug where context menu wouldn't work properly on Safari since it was passing out the ctrl key as pressed. - Fixed bug where image border color/style values were overwritten by advimage plugin. - Fixed bug where setting border in advimage plugin would throw error in IE. - Fixed bug where empty anchors list in link settings wasn't hidden. - Fixed bug where xhtmlextras popups were missing localized popup-size parameters. - Fixed bug where the context menu wouldn't select images on WebKit browsers. - Fixed bug where paste plugin wouldn't properly extract the contents on WebKit due to recent changes in browser behavior. - Fixed bug where focus of the editor would get on control contents on IE lost due to a bug in the ColorSplitButton control. - Fixed bug where contextmenu wasn't disabled on noneditable elements. - Fixed bug where getStyle function would trigger error when called on element without style property. - Fixed bug where editor fail to load if Javascript Compressor was used. - Fixed bug where list-style-type=lower-greek would produce errors in IE<8. - Fixed bug where spellchecker plugin would produce errors on IE6-7. - Fixed bug where theme_advanced_containers configuration option causes error. - Fixed bug where the mceReplaceContent command would produce an error since it didn't correctly handle a return value. - Fixed bug where you couldn't enter float point values for em in dialog input fields since it wouldn't be considered a valid size. - Fixed bug in xhtmlxtras plugin where it wasn't possible to remove some attributes in the attributes dialog. -Version 3.4.1 (2011-03-24) - Added significantly improved list handling via the new 'lists' plugin. - Added 'autolink' plugin to enable automatically linking URLs. Similar to the behavior IE has by default. - Added 'theme_advanced_show_current_color' setting to enable the forecolor and backcolor buttons to continuously show the current text color. - Added 'contextmenu_never_use_native' setting to disable the ctrl-right-click showing the native browser context menu behaviour. - Added 'paste_enable_default_filters' setting to enable the default paste filters to be disabled. - Fixed bug where selection locations on undo/redo didn't work correctly on specific contents. - Fixed bug where an exception would be trown on IE when loading TinyMCE inside an iframe. - Fixed bug where some ascii numeric entities wasn't properly decoded. - Fixed bug where some non western language codes wasn't properly decoded/encoded. - Fixed bug where undo levels wasn't created when deleting contents on IE. - Fixed bug where the initial undo levels bookmark wasn't updated correctly. - Fixed bug where search/replace wouldn't be scoped to editor instances on IE8. - Fixed bug where IE9 would produce two br elements after block elements when pasting. - Fixed bug where IE would place the caret at an incorrect position after a paste operation. - Fixed bug where a paste operation using the keyboard would add an extra undo level. - Fixed bug where some attributes/elements wasn't correctly filtered when invalid contents was inserted. - Fixed bug where the table plugin couldn't correctly handle invalid table structures. - Fixed bug where charset and title of the page were handled incorrectly by the fullpage plugin. - Fixed bug where toggle states on some of the list boxes didn't update correctly. - Fixed bug where sub/sub wouldn't work correctly when done as a caret action in Chrome 10. - Fixed bug where the constrain proportions checkbox wouldn't work in the media plugin. - Fixed bug where block elements containing trailing br elements wouldn't treated properly if they where invalid. - Fixed bug where the color picker dialog wouldn't be rendered correctly when using the o2k7 theme. - Fixed bug where setting border=0 using advimage plugin invalid style attribute content was created in Chrome. - Fixed bug with references to non-existing images in css of fullpage plugin. - Fixed bug where item could be unselected in spellchecker's language selector. - Fixed bug where some mispelled words could be not highlighted using spellchecker plugin. - Fixed bug where spellchecking would merge some words on IE. - Fixed bug where spellchecker context menu was not always positioned correctly. - Fixed bug with empty anchors list in advlink popup when Invisible Elements feature was disabled. - Fixed bug where older IE versions wouldn't properly handle some elements if they where placed at the top of editor contents. - Fixed bug where selecting the whole table would enable table tools for cells and rows. - Fixed bug where it wasn't possible to replace selected contents on IE when pasting using the paste plugin. - Fixed bug where setting text color in fullpage plugin doesn't work. - Fixed bug where the state of checkboxes in media plugin wouldn't be set correctly. - Fixed bug where black spade suit character was not included in special character selector. - Fixed bug where setting invalid values for table cell size would throw an error in IE. - Fixed bug where spellchecking would remove whitespace characters from PRE block in IE. - Fixed bug where HR was inserted inside P elements instead of splitting them. - Fixed bug where extra, empty span tags were added when using a format with both selector and inline modes. - Fixed bug where bullet lists weren't always detected correctly. - Fixed bug where deleting some paragraphs on IE would cause an exception. - Fixed bug where the json encoder logic wouldn't properly encode \ characters. - Fixed bug where the onChange event would be fired when the editor was first initialized. - Fixed bug where mceSelected wouldn't be removed properly from output even if it's an internal class. - Fixed issue with table background colors not being transparent. This improves compliance with users browser color preferences. - Fixed issue where styles were not included when using the full page plugin. - Fixed issue where drag/drop operations wasn't properly added to the undo levels. - Fixed issue where colors wasn't correctly applied to elements with underline decoration. - Fixed issue where deleting some paragraphs on IE would cause an exception. -Version 3.4 (2011-03-10) - Added accessibility example with various accessibility options contributed by Ephox. - Fixed bug where attributes wasn't properly handled in the xhtmlxtras plugin. - Fixed bug where the image.htm had some strange td artifacts probably due to auto merging. - Fixed bug where the ToolbarGroup had an missing reference to this in it's destroy method. - Fixed bug with the resizeBy function in the advanced theme where it was scaled by the wrong parent. - Fixed bug where an exception would be thrown by the element if the page was served in xhtml mode. - Fixed bug where mceInsertContent would throw an exception when page was served in xhtml mode. - Fixed bug where you couldn't select a forground/background color when page was served in xhtml mode. - Fixed bug where the editor would scroll to the toolbar when clicked due to a call to focus in ListBox. - Fixed bug where pages with rtl dir wouldn't render split buttons correctly when using the o2k7 theme. - Fixed bug where anchor elements with names wasn't properly collapsed as they where in 3.3.x. - Fixed bug where WebKit wouldn't properly handle image selection if it was done left to right. - Fixed bug where the formatter would align images when the selection range was collapsed. - Fixed bug where the image button would be active when the selection range was collapsed. - Fixed bug where the element_format option wasn't used by the new (X)HTML serializer logic. - Fixed bug where the table cell/row dialogs would produce empty attributes. - Fixed bug where the tfoot wouldn't be added to the top of the table. - Fixed bug where the formatter would merge siblings with white space between them. - Fixed bug where pasting headers and paragraphs would produce an extra paragraph. - Fixed bug where the ColorSplitButton would throw an exception if you clicked out side a color. - Fixed bug where IE9 wouldn't properly produce new paragraphs on enter if the current paragraph had formatting. - Fixed bug where multiple BR elements at end of block elements where removed. - Fixed bug where fullscreen plugin wouldn't correctly display the edit area on IE6 for long pages. - Fixed bug where paste plugin wouldn't properly encode raw entities when pasting in plain text mode. - Fixed bug where the search/replace plugin wouldn't work correctly on IE 9. - Fixed so the drop menus doesn't get an outline border visible when focused, patch contributed by Ephox. - Fixed so the values entered in the color picker are forced to hex values. - Removed dialog workaround for IE 9 beta since the RC is now out and people should upgrade. - Removed obsolete calls in various plugins to the mceBeginUndoLevel command. diff --git a/lib/tinymce/js/tinymce/classes/AddOnManager.js b/lib/tinymce/js/tinymce/classes/AddOnManager.js deleted file mode 100644 index 26534193..00000000 --- a/lib/tinymce/js/tinymce/classes/AddOnManager.js +++ /dev/null @@ -1,370 +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. - */ - requireLangPack: function(name) { - var settings = AddOnManager.settings; - - if (settings && settings.language && settings.language_load !== false) { - ScriptLoader.ScriptLoader.add(this.urls[name] + '/langs/' + settings.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. - * @param pluginName {String} name of the plugin to load scripts from (will be used to get the base url for the plugins). - * @param scripts {Array} 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} n Short name of the add-on that gets loaded. - * @param {String} u URL to the add-on that will get loaded. - * @param {function} cb Optional callback to execute ones the add-on is loaded. - * @param {Object} s 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(n, u, cb, s) { - var t = this, url = u; - - function loadDependencies() { - var dependencies = t.dependencies(n); - - each(dependencies, function(dep) { - var newUrl = t.createUrl(u, dep); - - t.load(newUrl.resource, newUrl, undefined, undefined); - }); - - if (cb) { - if (s) { - cb.call(s); - } else { - cb.call(ScriptLoader); - } - } - } - - if (t.urls[n]) { - return; - } - - if (typeof u === "object") { - url = u.prefix + u.resource + u.suffix; - } - - if (url.indexOf('/') !== 0 && url.indexOf('://') == -1) { - url = AddOnManager.baseURL + '/' + url; - } - - t.urls[n] = url.substring(0, url.lastIndexOf('/')); - - if (t.lookup[n]) { - loadDependencies(); - } else { - ScriptLoader.ScriptLoader.add(url, loadDependencies, s); - } - } - }; - - AddOnManager.PluginManager = new AddOnManager(); - AddOnManager.ThemeManager = new AddOnManager(); - - return AddOnManager; -}); - -/** - * TinyMCE theme class. - * - * @class tinymce.Theme - */ - -/** - * Initializes the theme. - * - * @method init - * @param {tinymce.Editor} editor Editor instance that created the theme instance. - * @param {String} url Absolute URL where the theme is located. - */ - -/** - * Meta info method, this method gets executed when TinyMCE wants to present - * information about the theme for example in the about/help dialog. - * - * @method getInfo - * @return {Object} Returns an object with meta information about the theme the current items are - * longname, author, authorurl, infourl and version. - */ - -/** - * 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 - * // Create a new plugin class - * tinymce.create('tinymce.plugins.ExamplePlugin', { - * init: function(ed, url) { - * // Register an example button - * ed.addButton('example', { - * title: 'example.desc', - * onclick: function() { - * // Display an alert when the user clicks the button - * ed.windowManager.alert('Hello world!'); - * }, - * 'class': 'bold' // Use the bold icon from the theme - * }); - * } - * }); - * - * // Register plugin with a short name - * tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); - * - * // Initialize TinyMCE with the new plugin and button - * tinymce.init({ - * ... - * plugins: '-example', // - means TinyMCE will not try to load it - * theme_advanced_buttons1: 'example' // Add the new example button to the toolbar - * }); - */ - -/** - * Initialization function for the plugin. This will be called when the plugin is created. - * - * @method init - * @param {tinymce.Editor} editor Editor instance that created the plugin instance. - * @param {String} url Absolute URL where the plugin is located. - * @example - * // Creates a new plugin class - * tinymce.create('tinymce.plugins.ExamplePlugin', { - * init: function(ed, url) { - * // Register the command so that it can be invoked by using tinymce.activeEditor.execCommand('mceExample'); - * ed.addCommand('mceExample', function() { - * ed.windowManager.open({ - * file: url + '/dialog.htm', - * width: 320 + ed.getLang('example.delta_width', 0), - * height: 120 + ed.getLang('example.delta_height', 0), - * inline: 1 - * }, { - * plugin_url: url, // Plugin absolute URL - * some_custom_arg: 'custom arg' // Custom argument - * }); - * }); - * - * // Register example button - * ed.addButton('example', { - * title: 'example.desc', - * cmd: 'mceExample', - * image: url + '/img/example.gif' - * }); - * - * // Add a node change handler, selects the button in the UI when a image is selected - * ed.on('NodeChange', function(e) { - * cm.setActive('example', e.element.nodeName == 'IMG'); - * }); - * } - * }); - * - * // Register plugin - * tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); - */ - -/** - * Meta info method, this method gets executed when TinyMCE wants to present information about the plugin - * for example in the about/help dialog. - * - * @method getInfo - * @return {Object} Returns an object with meta information about the plugin the current items are longname, - * author, authorurl, infourl and version. - * @example - * // Creates a new plugin class - * tinymce.create('tinymce.plugins.ExamplePlugin', { - * // Meta info method - * getInfo: function() { - * return { - * longname: 'Example plugin', - * author: 'Some author', - * authorurl: 'http://www.tinymce.com', - * infourl: 'http://www.tinymce.com/wiki.php/Plugin:Plugins/example', - * version: "1.0" - * }; - * } - * }); - * - * // Register plugin - * tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); - * - * // Initialize TinyMCE with the new plugin - * tinymce.init({ - * ... - * plugins: '-example' // - means TinyMCE will not try to load it - * }); - */ - -/** - * Gets called when a new control instance is created. - * - * @method createControl - * @param {String} name Control name to create for example "mylistbox" - * @param {tinymce.ControlManager} controlman Control manager/factory to use to create the control. - * @return {tinymce.ui.Control} Returns a new control instance or null. - * @example - * // Creates a new plugin class - * tinymce.create('tinymce.plugins.ExamplePlugin', { - * createControl: function(n, cm) { - * switch (n) { - * case 'mylistbox': - * var mlb = cm.createListBox('mylistbox', { - * title: 'My list box', - * onselect: function(v) { - * tinymce.activeEditor.windowManager.alert('Value selected:' + v); - * } - * }); - * - * // Add some values to the list box - * mlb.add('Some item 1', 'val1'); - * mlb.add('some item 2', 'val2'); - * mlb.add('some item 3', 'val3'); - * - * // Return the new listbox instance - * return mlb; - * } - * - * return null; - * } - * }); - * - * // Register plugin - * tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin); - * - * // Initialize TinyMCE with the new plugin and button - * tinymce.init({ - * ... - * plugins: '-example', // - means TinyMCE will not try to load it - * theme_advanced_buttons1: 'mylistbox' // Add the new mylistbox control to the toolbar - * }); - */ diff --git a/lib/tinymce/js/tinymce/classes/Compat.js b/lib/tinymce/js/tinymce/classes/Compat.js deleted file mode 100644 index b0511f02..00000000 --- a/lib/tinymce/js/tinymce/classes/Compat.js +++ /dev/null @@ -1,41 +0,0 @@ -/** - * Compat.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * Adds various compatibility items. - */ -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; - - 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 {}; -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/Editor.js b/lib/tinymce/js/tinymce/classes/Editor.js deleted file mode 100644 index 850401d6..00000000 --- a/lib/tinymce/js/tinymce/classes/Editor.js +++ /dev/null @@ -1,2064 +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 */ - -/** - * This class contains the core logic for a TinyMCE editor. - * - * @class tinymce.Editor - * @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, isIE = Env.ie, isOpera = Env.opera; - - function getEventTarget(editor, eventName) { - // 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/.test(eventName)) { - return editor.getDoc(); - } - - return editor.getBody(); - } - - /** - * 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, - table_inline_editing: false, - 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%', - apply_source_formatting: true, - directionality: 'ltr', - 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); - - // TODO: Fix this - AddOnManager.settings = settings; - 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 = 1; // Force not dirty state - * } - */ - self.isNotDirty = false; - - /** - * 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.suffix = editorManager.suffix; - self.editorManager = editorManager; - self.inline = settings.inline; - - // Call setup - 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; - - // Page is not loaded yet, wait for it - if (!Event.domLoaded) { - DOM.bind(window, 'ready', function() { - self.render(); - }); - return; - } - - self.editorManager.settings = settings; - - // 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); - } - - // 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 = 1; - - 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(); - self.isNotDirty = 1; - } - }); - } - - if (settings.add_unload_trigger) { - self._beforeUnload = function() { - if (self.initialized && !self.destroyed && !self.isHidden()) { - self.save({format: 'raw', no_events: true}); - } - }; - - self.editorManager.on('BeforeUnload', self._beforeUnload); - } - - // Load scripts - function loadScripts() { - var scriptLoader = ScriptLoader.ScriptLoader; - - if (settings.language) { - scriptLoader.add(self.editorManager.baseURL + '/langs/' + settings.language + '.js'); - } - - if (settings.theme && typeof settings.theme != "function" && - settings.theme.charAt(0) != '-' && !ThemeManager.urls[settings.theme]) { - ThemeManager.load(settings.theme, 'themes/' + settings.theme + '/theme' + suffix + '.js'); - } - - if (Tools.isArray(settings.plugins)) { - settings.plugins = settings.plugins.join(' '); - } - - 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, url, bodyId, bodyClass, re, i, initializedPlugins = []; - - 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(/-/, ''); - o = ThemeManager.get(settings.theme); - self.theme = new o(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 constr = PluginManager.get(plugin), url, pluginInstance; - - url = PluginManager.urls[plugin] || self.documentBaseUrl.replace(/\/$/, ''); - plugin = trim(plugin); - if (constr && inArray(initializedPlugins, plugin) === -1) { - each(PluginManager.dependencies(plugin), function(dep){ - initPlugin(dep); - }); - - pluginInstance = new constr(self, url); - - self.plugins[plugin] = pluginInstance; - - if (pluginInstance.init) { - pluginInstance.init(self, url); - initializedPlugins.push(plugin); - } - } - } - - // Create all plugins - each(settings.plugins.replace(/\-/g, '').split(/[ ,]/), initPlugin); - - // Enables users to override the control factory - self.fire('BeforeRenderUI'); - - // 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) + (o.deltaWidth || 0), 100); - } - - if (re.test('' + h)) { - h = Math.max(parseInt(h, 10) + (o.deltaHeight || 0), 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(); - } - - // User specified a document.domain value - if (document.domain && location.hostname != document.domain) { - self.editorManager.relaxedDomain = document.domain; - } - - 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++) { - self.iframeHTML += ''; - } - - self.contentCSS = []; - - 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 += '
'; - - // Domain relaxing enabled, then set document domain - // TODO: Fix this old stuff - if (self.editorManager.relaxedDomain && (isIE || (isOpera && parseFloat(window.opera.version()) < 11))) { - // We need to write the contents here in IE since multiple writes messes up refresh button and back button - url = 'javascript:(function(){document.open();document.domain="' + document.domain + '";' + - 'var ed = window.parent.tinymce.get("' + self.id + '");document.write(ed.iframeHTML);' + - 'document.close();ed.initContentBody();})()'; - } - - // 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 - } - }); - - 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 (!self.editorManager.relaxedDomain || !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() { - var self = this, settings = self.settings, targetElm = DOM.get(self.id), doc = self.getDoc(), body, contentCssText; - - // Restore visibility on target element - self.getElement().style.visibility = self.orgVisibility; - - // Setup iframe body - if ((!isIE || !self.editorManager.relaxedDomain) && !settings.content_editable) { - doc.open(); - doc.write(self.iframeHTML); - doc.close(); - - if (self.editorManager.relaxedDomain) { - doc.domain = self.editorManager.relaxedDomain; - } - } - - if (settings.content_editable) { - 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) { - 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, - 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; - } - - 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(url) { - self.dom.loadCSS(url); - }); - - // 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) { - if ((rng = selection.lastRng)) { - selection.lastRng = null; - selection.setRng(rng); - self.nodeChanged(); - } - - // Get selected control element - rng = selection.getRng(); - if (rng.item) { - controlElm = rng.item(0); - } - - self._refreshContentEditable(); - - // Focus the window iframe - if (!contentEditable) { - 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) { - 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[lang + '.' + text] || text.replace(/\{\#([^\}]+)\}/g, function(a, b) { - return i18n[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[(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) { - // Get start node - root = self.getBody(); - node = selection.getStart() || root; - node = isIE && 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 ControlManager. This is a shorter and easier method - * of adding buttons without the need to deal with the ControlManager directly. But it's also less - * powerfull if you need more control use the ControlManagers factory methods instead. - * - * @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 and when a user clicks the button it will open - * // an alert box with the selected contents as plain text. - * tinymce.init({ - * ... - * - * theme_advanced_buttons1: 'example,..' - * - * setup: function(ed) { - * // Register example button - * ed.addButton('example', { - * title: 'example.desc', - * image: '../js/tinymce/plugins/example/img/example.gif', - * onclick: function() { - * ed.windowManager.alert('Hello world!! Selection: ' + ed.selection.getContent({format: 'text'})); - * } - * }); - * } - * }); - */ - addButton: function(name, settings) { - var self = this; - - if (settings.cmd) { - settings.onclick = function() { - self.execCommand(settings.cmd); - }; - } - - self.buttons = self.buttons || {}; - settings.tooltip = settings.tooltip || settings.title; - settings.icon = settings.icon || (settings.icon !== false ? name : false); - self.buttons[name] = settings; - }, - - 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); - self.fire('BeforeExecCommand', {command: cmd, ui: ui, value: value}); - if (args.terminate) { - 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 (isIE && doc) { - 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)) { - 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; - - 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 (!isIE && (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())) { - content = '<' + forcedRootBlockName + '>
'; - } else { - content = '
'; - } - - body.innerHTML = content; - self.selection.select(body, true); - self.selection.collapse(true); - return; - } - - // 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 - * @params {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 && this.undoManager.hasUndo(); - }, - - /** - * 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 = '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, elm = self.getContainer(), doc = self.getDoc(); - - if (!self.removed) { - self.removed = 1; // Cancels post remove event execution - - // Fixed bug where IE has a blinking cursor left from the editor - if (isIE && doc) { - doc.execCommand('SelectAll'); - } - - // We must save before we hide so Safari doesn't crash - self.save(); - - 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()); - } - - Event.unbind(self.getBody()); - Event.unbind(elm); - - self.fire('remove'); - - self.editorManager.remove(self); - DOM.remove(elm); - } - }, - - bindNative: function(name) { - var self = this; - - 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; - } - - // 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 (isGecko) { - Event.unbind(self.getDoc()); - Event.unbind(self.getWin()); - Event.unbind(self.getBody()); - } - - if (!automatic) { - self.editorManager.off(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) { - form.submit = form._mceOldSubmit; - form._mceOldSubmit = null; - DOM.unbind(form, 'submit reset', self.formEventDelegate); - } - - self.contentAreaContainer = self.formElement = self.container = 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/lib/tinymce/js/tinymce/classes/EditorCommands.js b/lib/tinymce/js/tinymce/classes/EditorCommands.js deleted file mode 100644 index 67dedb1d..00000000 --- a/lib/tinymce/js/tinymce/classes/EditorCommands.js +++ /dev/null @@ -1,691 +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)) { - if (isGecko) { - editor.windowManager.confirm(editor.getLang('clipboard_msg'), function(state) { - if (state) { - window.open('http://www.mozilla.org/editor/midasdemo/securityprefs.html', '_blank'); - } - }); - } else { - editor.windowManager.alert( - "Your browser doesn't support direct access to the clipboard. " + - "Please use the Ctrl+X/C/V keyboard shortcuts instead." - ); - } - } - }, - - // Override unlink command - unlink: function(command) { - if (selection.isCollapsed()) { - selection.select(selection.getNode()); - } - - execNativeCommand(command); - selection.collapse(FALSE); - }, - - // 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, nodeRect, viewPortRect, rng, node, node2, bookmarkHtml, viewportBodyElement; - - 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 = ''; - - // 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); - - // 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 - args = {context: parentNode.nodeName.toLowerCase()}; - fragment = parser.parse(value, args); - - // 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 (!args.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'); - - // Scroll range into view scrollIntoView on element can't be used since it will scroll the main view port as well - nodeRect = dom.getRect(marker); - viewPortRect = dom.getViewPort(editor.getWin()); - - // Check if node is out side the viewport if it is then scroll to it - if ((nodeRect.y + nodeRect.h > viewPortRect.y + viewPortRect.h || nodeRect.y < viewPortRect.y) || - (nodeRect.x > viewPortRect.x + viewPortRect.w || nodeRect.x < viewPortRect.x)) { - viewportBodyElement = isIE ? editor.getDoc().documentElement : editor.getBody(); - viewportBodyElement.scrollLeft = nodeRect.x; - viewportBodyElement.scrollTop = nodeRect.y - viewPortRect.h + 25; - } - - // 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) { - var indentStyleName; - - if (element.nodeName != "LI") { - indentStyleName = dom.getStyle(element, 'direction', true) == 'rtl' ? 'paddingRight' : 'paddingLeft'; - - 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 = dom.createRng(); - - // Old IE does a better job with selectall than new versions - if (selection.getRng().setStart) { - rng.setStart(root, 0); - rng.setEnd(root, root.childNodes.length); - - selection.setRng(rng); - } else { - execNativeCommand('SelectAll'); - } - }, - - 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/lib/tinymce/js/tinymce/classes/EditorManager.js b/lib/tinymce/js/tinymce/classes/EditorManager.js deleted file mode 100644 index d565067c..00000000 --- a/lib/tinymce/js/tinymce/classes/EditorManager.js +++ /dev/null @@ -1,501 +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 instaces. - * - * @class tinymce.EditorManager - */ -define("tinymce/EditorManager", [ - "tinymce/Editor", - "tinymce/dom/DOMUtils", - "tinymce/util/URI", - "tinymce/Env", - "tinymce/util/Tools", - "tinymce/util/Observable" -], function(Editor, DOMUtils, URI, Env, Tools, Observable) { - 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: {}, - - /** - * 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; - - if (/tinymce(\.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; - }, - - /** - * 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); - } - - self.settings = settings; - - DOM.bind(window, 'ready', function() { - var l, co; - - execCallback(settings, 'onpageload'); - - 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; - - default: - 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); - }); - }); - } 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); - }); - } - } - - // 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'); - } - }); - } - }); - }, - - /** - * 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; - 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. - * - * @param {Object} settings Editor instance settings. - * @return {tinymce.Editor} Editor instance that got created. - */ - createEditor: function(settings) { - return this.add(new Editor(settings)); - }, - - /** - * Removes a editor instance from the collection. - * - * @method remove - * @param {tinymce.Editor} e Editor instance to remove. - * @return {tinymce.Editor} The editor that got passed in will be return if it was found otherwise null. - */ - remove: function(editor) { - var self = this, i, editors = self.editors; - - // 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); - break; - } - } - - // Select another editor since the active one was removed - if (self.activeEditor == editor) { - self.activeEditor = editors[0]; - } - - editor.destroy(); - self.fire('RemoveEditor', {editor: editor}); - - if (!editors.length) { - DOM.unbind(window, 'beforeunload', beforeUnloadDelegate); - } - - 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) { - extend(this.i18n, items || code); - }, - - /** - * Translates the specified string using the language pack items. - * - * @param {String/Array} str String to translate - * @return {String} Translated string. - */ - translate: function(str) { - if (typeof(str) !== "string") { - return (this.i18n[str[0]] || str[0]).replace(/%d/, str[1]); - } - - return this.i18n[str] || str; - } - }; - - EditorManager.setup(); - - // Export EditorManager as tinymce/tinymce in global namespace - window.tinymce = window.tinyMCE = EditorManager; - - extend(EditorManager, Observable); - - return EditorManager; -}); diff --git a/lib/tinymce/js/tinymce/classes/EnterKey.js b/lib/tinymce/js/tinymce/classes/EnterKey.js deleted file mode 100644 index ebaab6c4..00000000 --- a/lib/tinymce/js/tinymce/classes/EnterKey.js +++ /dev/null @@ -1,611 +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/Env" -], function(TreeWalker, Env) { - var isIE = Env.ie; - - 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 = selection.getRng(true), 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; - - 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); - } - - // 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; - - block = name || parentBlockName == "TABLE" ? dom.create(name || newBlockName) : parentBlock.cloneNode(false); - caretNode = block; - - // Clone any parent styles - if (settings.keep_styles !== false) { - do { - if (/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.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); - 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); - 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(); - 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'); - } - } - } - - // Delete any selected contents - if (!rng.collapsed) { - editor.execCommand('Delete'); - return; - } - - // Event is blocked by some other handler for example the lists plugin - if (evt.isDefaultPrevented()) { - return; - } - - // Setup range items and newBlockName - 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); - } 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 - 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/lib/tinymce/js/tinymce/classes/Env.js b/lib/tinymce/js/tinymce/classes/Env.js deleted file mode 100644 index f0452361..00000000 --- a/lib/tinymce/js/tinymce/classes/Env.js +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Env.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -define("tinymce/Env", [], function() { - var nav = navigator, userAgent = nav.userAgent; - var opera, webkit, ie, 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]; - gecko = !webkit && /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 - }; -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ForceBlocks.js b/lib/tinymce/js/tinymce/classes/ForceBlocks.js deleted file mode 100644 index 55e68b3c..00000000 --- a/lib/tinymce/js/tinymce/classes/ForceBlocks.js +++ /dev/null @@ -1,127 +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; - restoreSelection = editor.getDoc().activeElement === rootNode; - } 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); - 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('KeyUp NodeChange', addRootBlocks); - } - }; -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/Formatter.js b/lib/tinymce/js/tinymce/classes/Formatter.js deleted file mode 100644 index b2f751b2..00000000 --- a/lib/tinymce/js/tinymce/classes/Formatter.js +++ /dev/null @@ -1,2366 +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 inconsistant 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', 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 && 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; - - // 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; - - 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 TD in a SPAN - // so lets see if the can use the first child instead - // This will happen if you tripple click a table cell and use remove formatting - if (/^(TR|TD)$/.test(startContainer.nodeName) && startContainer.firstChild) { - if (startContainer.nodeName == "TD") { - startContainer = startContainer.firstChild || startContainer; - } else { - startContainer = startContainer.firstChild.firstChild || startContainer; - } - } - - // 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, replaceVars(items[key], vars))) { - 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) { - // Find first node with similar format settings - node = dom.getParent(node, function(node) { - return !!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 - if (!selector) { - 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) { - var styleVal = dom.getStyle(node, name); - - // Force the format to hex - if (name == 'color' || name == 'backgroundColor') { - styleVal = dom.toHex(styleVal); - } - - // Opera will return bold as 700 - if (name == 'fontWeight' && styleVal == 700) { - styleVal = 'bold'; - } - - return '' + styleVal; - } - - /** - * 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; - } - } - - for (;;) { - // 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; - - // Expand to block of similar type - if (!format[0].wrapper) { - node = dom.getParent(container, format[0].block); - } - - // Expand to first wrappable block element or any block element - if (!node) { - node = dom.getParent(container.nodeType == 3 ? container.parentNode : container, isTextBlock); - } - - // 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 boundery - endPoint = findWordEndPoint(startContainer, startOffset, true); - if (endPoint) { - startContainer = endPoint.container; - startOffset = endPoint.offset; - } - - // Expand right to closest word boundery - 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 = replaceVars(value, vars); - - // 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); - } 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. - * - * @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') { - 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 TRUE; - } - - 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; - - // Insert caret container after the formated node - dom.insertAfter(caretContainer, formatNode); - - // Move selection to text node - selection.setCursorLocation(node, 1); - } - } - - // 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/lib/tinymce/js/tinymce/classes/LegacyInput.js b/lib/tinymce/js/tinymce/classes/LegacyInput.js deleted file mode 100644 index 09813300..00000000 --- a/lib/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 ed = e.editor; - - ed.on('preInit', function() { - var filters, fontSizes, dom, settings = ed.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 = ed.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' - }); - } - }; - - ed.on('PreProcess SetContent', convert); - } - }); - }); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/Shortcuts.js b/lib/tinymce/js/tinymce/classes/Shortcuts.js deleted file mode 100644 index 3d4dd1ff..00000000 --- a/lib/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 ctrlState = Env.isMac ? e.metaKey : e.ctrlKey; - - if (shortcut.ctrl != ctrlState || 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 (cmdFunc.length) { - 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/lib/tinymce/js/tinymce/classes/UndoManager.js b/lib/tinymce/js/tinymce/classes/UndoManager.js deleted file mode 100644 index 330ca999..00000000 --- a/lib/tinymce/js/tinymce/classes/UndoManager.js +++ /dev/null @@ -1,301 +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, index = 0, data = [], beforeBookmark; - - // Returns a trimmed version of the current editor contents - function getContent() { - return trim(editor.getContent({format: 'raw', no_events: 1}).replace(trimContentRegExp, '')); - } - - function addNonTypingUndoLevel() { - self.typing = false; - self.add(); - } - - // 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') { - self.add(); - } - }); - - editor.on('ObjectResizeStart', function() { - self.beforeChange(); - }); - - editor.on('SaveContent ObjectResized', addNonTypingUndoLevel); - editor.dom.bind(editor.dom.getRoot(), 'dragend', addNonTypingUndoLevel); - editor.dom.bind(editor.getBody(), 'focusout', function() { - if (!editor.removed && self.typing) { - 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.isMac && (keyCode == 91 || keyCode == 93))) { - 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(); - } - - 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(); - } - }); - - editor.on('MouseDown', function() { - if (self.typing) { - addNonTypingUndoLevel(); - } - }); - - // Add keyboard shortcuts for undo/redo keys - editor.addShortcut('ctrl+z', 'undo_desc', 'Undo'); - editor.addShortcut('ctrl+y', 'redo_desc', '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() { - beforeBookmark = editor.selection.getBookmark(2, true); - }, - - /** - * Adds a new undo level/snapshot to the undo list. - * - * @method add - * @param {Object} l Optional undo level object to add. - * @return {Object} Undo level that got added or null it a level wasn't needed. - */ - add: function(level) { - var i, settings = editor.settings, lastLevel; - - level = level || {}; - level.content = getContent(); - - if (editor.fire('BeforeAddUndo', {level: level}).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; - - editor.fire('AddUndo', {level: level, lastLevel: lastLevel}); - editor.isNotDirty = 0; - - 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]; - - 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. - * - * @method transact - * @params {function} callback - */ - transact: function(callback) { - self.beforeChange(); - callback(); - self.add(); - } - }; - - return self; - }; -}); diff --git a/lib/tinymce/js/tinymce/classes/WindowManager.js b/lib/tinymce/js/tinymce/classes/WindowManager.js deleted file mode 100644 index 484f12c7..00000000 --- a/lib/tinymce/js/tinymce/classes/WindowManager.js +++ /dev/null @@ -1,175 +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 = []; - - 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/bool} scrollbars Specifies whether the popup window can have scrollbars if required (i.e. content - * larger than the popup size specified). - */ - self.open = function(args) { - var win; - - // 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', minWidth: 50, onclick: function() { - win.find('form')[0].submit(); - win.close(); - }}, - - {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]); - } - }); - }); - } - - 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() { - callback.call(scope || this); - }); - }; - - /** - * 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 (windows.length) { - windows[window.length - 1].win.close(); - } - }; - }; -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/dom/ControlSelection.js b/lib/tinymce/js/tinymce/classes/dom/ControlSelection.js deleted file mode 100644 index 78946337..00000000 --- a/lib/tinymce/js/tinymce/classes/dom/ControlSelection.js +++ /dev/null @@ -1,450 +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 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; - var startX, startY, selectedElmX, selectedElmY, startW, startH, ratio, resizeStarted; - var width, height, editableDoc = editor.getDoc(), rootDocument = document, isIE = Env.ie; - - // 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) { - if (editor.settings.object_resizing === false) { - return false; - } - - if (!/TABLE|IMG|DIV/.test(elm.nodeName)) { - return false; - } - - if (elm.getAttribute('data-mce-resize') === 'false') { - return false; - } - - return true; - } - - 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; - - // Get position and size of target - position = dom.getPos(targetElm, editor.getBody()); - selectedElmX = position.x; - selectedElmY = position.y; - rect = targetElm.getBoundingClientRect(); // Fix for Gecko offsetHeight for table with caption - targetWidth = rect.width; - targetHeight = rect.height; - - // 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) { - resizeStarted = true; - - 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', - contentEditable: false, // Hides IE move layer cursor - unSelectabe: true, - style: 'cursor:' + name + '-resize; margin:0; padding:0' - }); - - dom.bind(handleElm, 'mousedown', function(e) { - e.preventDefault(); - startDrag(e); - }); - } else { - dom.show(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; - - 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) { - 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 (controlElm) { - 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 = e.clientX - pos.left; - relativeY = e.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, e); - } - - 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 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); - } else { - try { - // Disable object resizing on Gecko - editor.getDoc().execCommand('enableObjectResizing', false, false); - } catch (ex) { - // Ignore - } - } - - editor.on('nodechange mousedown 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); - }); - - function destroy() { - selectedElm = selectedElmGhost = null; - - if (isIE) { - detachResizeStartListener(); - detachEvent(editor.getBody(), 'controlselect', nativeControlSelect); - } - } - - return { - controlSelect: controlSelect, - destroy: destroy - }; - }; -}); diff --git a/lib/tinymce/js/tinymce/classes/dom/DOMUtils.js b/lib/tinymce/js/tinymce/classes/dom/DOMUtils.js deleted file mode 100644 index ea6c5bb3..00000000 --- a/lib/tinymce/js/tinymce/classes/dom/DOMUtils.js +++ /dev/null @@ -1,2067 +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 retrival 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" -], function(Sizzle, Styles, EventUtils, TreeWalker, Range, Entities, Env, Tools) { - // 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.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 rectange from. - * @return {object} Rectange 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 rectange from. - * @return {object} Rectange 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; - - // 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 performes good 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 has 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 agains. - */ - 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; - } - } - - return Sizzle.matches(selector, elm.nodeType ? [elm] : elm).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 id's 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 array with elements if multiple elements where passed. - * @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); - }, - - /** - * Create HTML string for element. The element will be closed unless an empty inner HTML string is passed. - * - * @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 like 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)) { - 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 array of elements depending on input. - * @example - * // Removes all paragraphs in the active editor - * tinymce.activeEditor.dom.remove(tinymce.activeEditor.dom.select('p')); - * - * // Removes a 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) + ")"; - } - - 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 a 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 a 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 (name.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. - * - * @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 attributes value of a 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 of this value is falsy like null 0 or '' it will remove the attribute instead. - * @example - * // Sets an attribute to all paragraphs in the active editor - * tinymce.activeEditor.dom.setAttrib(tinymce.activeEditor.dom.select('p'), 'class', 'myclass'); - * - * // Sets an attribute to a specific element in the current page - * tinymce.dom.setAttrib('mydiv', 'class', 'myclass'); - */ - setAttrib: function(e, n, v) { - var t = this; - - // Whats the point - if (!e || !n) { - return; - } - - return this.run(e, function(e) { - var s = t.settings; - var originalValue = e.getAttribute(n); - if (v !== null) { - switch (n) { - case "style": - if (!is(v, 'string')) { - each(v, function(v, n) { - t.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 || t, v, n, e); - } - - t.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 the specified attributes of a 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 some attributes to all paragraphs in the active editor - * tinymce.activeEditor.dom.setAttribs(tinymce.activeEditor.dom.select('p'), {'class': 'myclass', title: 'some title'}); - * - * // Sets some attributes to 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 a object with x, y fields. - * - * @method getPos - * @param {Element/String} n HTML element or element id to get x, y position from. - * @param {Element} ro 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.clientTop; - y = pos.top + (doc.documentElement.scrollTop || doc.body.scrollTop) - rootElm.clientLeft; - - 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 like {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 realcing the document ones 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 to each element. - * @return {String/Array} String with new class value or array with new class values for all elements. - * @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 a 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 allready exists. - * - * @method uniqueId - * @param {String} prefix Optional prefix to add infront 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. - * @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 a 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 an 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 infront 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 a 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 a 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 decode a string, resolves any HTML entities like å. - * - * @method decode - * @param {String} s String to decode entities on. - * @return {String} Entity decoded string. - */ - decode: Entities.decode, - - /** - * Entity encodes a string, encodes the most common entities <>"& into entities. - * - * @method encode - * @param {String} text String to encode with entities. - * @return {String} Entity encoded string. - */ - encode: Entities.encodeAllRaw, - - /** - * Inserts a 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 specified element, the new element will - * be cloned if multiple inputs elements are passed. - * - * @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 to a new name and keep it's attributes and children. - * - * @method rename - * @param {Element} elm Element to rename. - * @param {String} name Name of the new element. - * @return 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)); - }, - - /** - * Returns a array of all single CSS classes in the document. A single CSS class is a simple - * rule like ".class" complex ones like "div td.class" will not be added to output. - * - * @method getClasses - * @return {Array} Array with class objects each object has a class field might be other fields in the future. - */ - getClasses: function() { - var self = this, classList = [], lookup = {}, filter = self.settings.class_filter, oldVal; - - if (self.classes) { - return self.classes; - } - - function addClasses(stylesheet) { - // IE style imports - each(stylesheet.imports, function(r) { - addClasses(r); - }); - - each(stylesheet.cssRules || stylesheet.rules, function(rule) { - // Real type or fake it on IE - switch (rule.type || 1) { - // Rule - case 1: - if (rule.selectorText) { - each(rule.selectorText.split(','), function(value) { - value = value.replace(/^\s*|\s*$|^\s\./g, ""); - - // Is internal or it doesn't contain a class - if (/\.mce/.test(value) || !/\.[\w\-]+$/.test(value)) { - return; - } - - // Remove everything but class name - oldVal = value; - value = value.replace(/.*\.([a-z0-9_\-]+).*/i, '$1'); - - // Filter classes - if (filter && !(value = filter(value, oldVal))) { - return; - } - - if (!lookup[value]) { - classList.push({'class': value}); - lookup[value] = 1; - } - }); - } - break; - - // Import - case 3: - addClasses(rule.styleSheet); - break; - } - }); - } - - try { - each(self.doc.styleSheets, addClasses); - } catch (ex) { - // Ignore - } - - if (classList.length > 0) { - self.classes = classList; - } - - return classList; - }, - - /** - * 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 array with objects depending on multiple input or not. - */ - 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 an 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; - }, - - /** - * Created a new DOM Range object. This will use the native DOM Range API if it's - * available if it's not it will fallback 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 it's parent. - * - * @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, lastNode, nodeType; - - if (node) { - for (lastNodeType = node.nodeType, node = node.previousSibling, lastNode = node; 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 element 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 by. - * @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 if this is chopped: - //

text 1CHOPtext 2

- // would produce: - //

text 1

CHOP

text 2

- // this function will then trim of 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/String} o Object or element id string to add event - * handler to or an array of elements/ids/documents. - * @param {String} n Name of event handler to add for example: click. - * @param {function} f Function to execute when the event occurs. - * @param {Object} s 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) { - return this.events.bind(target, name, func, scope || this); - }, - - /** - * Removes the specified event handler by name and function from a element or collection of elements. - * - * @method unbind - * @param {String/Element/Array} o Element ID string or HTML element or an array of elements or ids to remove handler from. - * @param {String} n Event handler name like for example: "click" - * @param {function} f Function to remove. - * @return {bool/Array} Bool state if true if the handler was removed or an array with states if multiple elements where passed in. - */ - unbind: function(target, name, func) { - 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; - - 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. - * - * @property DOM - * @member tinymce - * @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/lib/tinymce/js/tinymce/classes/dom/DomQuery.js b/lib/tinymce/js/tinymce/classes/dom/DomQuery.js deleted file mode 100644 index fae010cb..00000000 --- a/lib/tinymce/js/tinymce/classes/dom/DomQuery.js +++ /dev/null @@ -1,719 +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. - */ - -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) { - 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; - var trim = function(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() { - var node = this, 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 + ")"; - } - - return elems.length === 1 ? - DomQuery.find.matchesSelector(elems[0], expr) ? [elems[0]] : [] : - DomQuery.find.matches(expr, 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/lib/tinymce/js/tinymce/classes/dom/EventUtils.js b/lib/tinymce/js/tinymce/classes/dom/EventUtils.js deleted file mode 100644 index 5e16af28..00000000 --- a/lib/tinymce/js/tinymce/classes/dom/EventUtils.js +++ /dev/null @@ -1,525 +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*/ - -define("tinymce/dom/EventUtils", [], function() { - "use strict"; - - var eventExpandoPrefix = "mce-data-"; - - /** - * 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 || {}; - - // 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 (name !== "layerX" && name !== "layerY") { - event[name] = originalEvent[name]; - } - } - - // Normalize target IE uses srcElement - if (!event.target) { - event.target = event.srcElement || document; - } - - // 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() { - if (doc.readyState === "complete") { - 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) { - 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 === 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. - * - * @param {Event} evt Event object. - * @param {String} id Expando id value to look for. - */ - function executeHandlers(evt, id) { - var callbackList, i, l, callback; - - callbackList = events[id][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) { - callbackList.splice(ci, 1); - } - } - } - - // 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.destory = 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/lib/tinymce/js/tinymce/classes/dom/Range.js b/lib/tinymce/js/tinymce/classes/dom/Range.js deleted file mode 100644 index 5fb52ea7..00000000 --- a/lib/tinymce/js/tinymce/classes/dom/Range.js +++ /dev/null @@ -1,774 +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 t = 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) { - t[END_CONTAINER] = t[START_CONTAINER]; - t[END_OFFSET] = t[START_OFFSET]; - } else { - t[START_CONTAINER] = t[END_CONTAINER]; - t[START_OFFSET] = t[END_OFFSET]; - } - - t.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 = t[START_CONTAINER], so = t[START_OFFSET], ec = t[END_CONTAINER], eo = t[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 { - startContainer.appendChild(n); - } - } - } - - function surroundContents(n) { - var f = t.extractContents(); - - t.insertNode(n); - n.appendChild(f); - t.selectNode(n); - } - - function cloneRange() { - return extend(new Range(dom), { - startContainer: t[START_CONTAINER], - startOffset: t[START_OFFSET], - endContainer: t[END_CONTAINER], - endOffset: t[END_OFFSET], - collapsed: t.collapsed, - commonAncestorContainer: t.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 (t[START_CONTAINER] == t[END_CONTAINER] && t[START_OFFSET] == t[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) { - t[START_CONTAINER] = n; - t[START_OFFSET] = o; - } else { - t[END_CONTAINER] = n; - t[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 = t[END_CONTAINER]; - while (ec.parentNode) { - ec = ec.parentNode; - } - - sc = t[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(t[START_CONTAINER], t[START_OFFSET], t[END_CONTAINER], t[END_OFFSET]) > 0) { - t.collapse(st); - } - } else { - t.collapse(st); - } - - t.collapsed = _isCollapsed(); - t.commonAncestorContainer = dom.findCommonAncestor(t[START_CONTAINER], t[END_CONTAINER]); - } - - function _traverse(how) { - var c, endContainerDepth = 0, startContainerDepth = 0, p, depthDiff, startNode, endNode, sp, ep; - - if (t[START_CONTAINER] == t[END_CONTAINER]) { - return _traverseSameContainer(how); - } - - for (c = t[END_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) { - if (p == t[START_CONTAINER]) { - return _traverseCommonStartContainer(c, how); - } - - ++endContainerDepth; - } - - for (c = t[START_CONTAINER], p = c.parentNode; p; c = p, p = p.parentNode) { - if (p == t[END_CONTAINER]) { - return _traverseCommonEndContainer(c, how); - } - - ++startContainerDepth; - } - - depthDiff = startContainerDepth - endContainerDepth; - - startNode = t[START_CONTAINER]; - while (depthDiff > 0) { - startNode = startNode.parentNode; - depthDiff--; - } - - endNode = t[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 (t[START_OFFSET] == t[END_OFFSET]) { - return frag; - } - - // Text node needs special case handling - if (t[START_CONTAINER].nodeType == 3 /* TEXT_NODE */) { - // get the substring - s = t[START_CONTAINER].nodeValue; - sub = s.substring(t[START_OFFSET], t[END_OFFSET]); - - // set the original text node to its new value - if (how != CLONE) { - n = t[START_CONTAINER]; - start = t[START_OFFSET]; - len = t[END_OFFSET] - t[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 - t.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(t[START_CONTAINER], t[START_OFFSET]); - cnt = t[END_OFFSET] - t[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) { - t.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 - t[START_OFFSET]; - - if (cnt <= 0) { - // Collapse to just before the endAncestor, which - // is partially selected. - if (how != CLONE) { - t.setEndBefore(endAncestor); - t.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) { - t.setEndBefore(endAncestor); - t.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 = t[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) { - t.setStartAfter(startAncestor); - t.collapse(TRUE); - } - - return frag; - } - - function _traverseCommonAncestors(startAncestor, endAncestor, how) { - var n, frag, commonParent, startOffset, endOffset, cnt, sibling, nextSibling; - - if (how != DELETE) { - frag = createDocumentFragment(); - } - - n = _traverseLeftBoundary(startAncestor, how); - if (frag) { - frag.appendChild(n); - } - - commonParent = startAncestor.parentNode; - 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) { - t.setStartAfter(startAncestor); - t.collapse(TRUE); - } - - return frag; - } - - function _traverseRightBoundary(root, how) { - var next = _getSelectedNode(t[END_CONTAINER], t[END_OFFSET] - 1), parent, clonedParent; - var prevSibling, clonedChild, clonedGrandParent, isFullySelected = next != t[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(t[START_CONTAINER], t[START_OFFSET]), isFullySelected = next != t[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 = t[START_OFFSET]; - newNodeValue = txtValue.substring(offset); - oldNodeValue = txtValue.substring(0, offset); - } else { - offset = t[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(t, { - // 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 t; - } - - // 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/lib/tinymce/js/tinymce/classes/dom/RangeUtils.js b/lib/tinymce/js/tinymce/classes/dom/RangeUtils.js deleted file mode 100644 index d99339fb..00000000 --- a/lib/tinymce/js/tinymce/classes/dom/RangeUtils.js +++ /dev/null @@ -1,267 +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/RangeUtils", [ - "tinymce/util/Tools" -], function(Tools) { - var each = Tools.each; - - function RangeUtils(dom) { - /** - * Walks the specified range like object and executes the callback for each sibling collection it finds. - * - * @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. - * - * @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 - }; - }; - } - - /** - * Compares two ranges and checks if they are equal. - * - * @static - * @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/lib/tinymce/js/tinymce/classes/dom/ScriptLoader.js b/lib/tinymce/js/tinymce/classes/dom/ScriptLoader.js deleted file mode 100644 index 3294cdc9..00000000 --- a/lib/tinymce/js/tinymce/classes/dom/ScriptLoader.js +++ /dev/null @@ -1,249 +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() { - // 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; - - elm.onload = done; - elm.onreadystatechange = function() { - if (/loaded|complete/.test(elm.readyState)) { - 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/lib/tinymce/js/tinymce/classes/dom/Selection.js b/lib/tinymce/js/tinymce/classes/dom/Selection.js deleted file mode 100644 index fee8305f..00000000 --- a/lib/tinymce/js/tinymce/classes/dom/Selection.js +++ /dev/null @@ -1,1314 +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/Env", - "tinymce/util/Tools" -], function(TreeWalker, TridentSelection, ControlSelection, 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); - - editor.on('nodechange', function() { - var rng; - - // Use old style IE range since we want to restore control selections - if (editor.getDoc().selection) { - rng = editor.getDoc().selection.createRange(); - } else { - rng = self.getRng(); - } - - self.lastRng = rng; - }); - - // 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. - * @param node Node to put the cursor in. - * @param offset Offset from the start of the node to put the cursor at. - */ - setCursorLocation: function(node, offset) { - var self = this, rng = self.dom.createRng(); - 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 t = this, dom = t.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 = t.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(t.dom.nodeIndex(childNodes[offset], normalized) + after); - } - - for (; container && container != root; container = container.parentNode) { - point.push(t.dom.nodeIndex(container, normalized)); - } - - return point; - } - - bookmark.start = getPoint(rng, true); - - if (!t.isCollapsed()) { - bookmark.end = getPoint(rng); - } - - return bookmark; - } - - if (type == 2) { - element = t.getNode(); - name = element.nodeName; - - if (name == 'IMG') { - return {name: name, index: findIndex(name, element)}; - } - - if (t.tridentSel) { - return t.tridentSel.getBookmark(type); - } - - return getLocation(); - } - - // Handle simple range - if (type) { - return {rng: t.getRng()}; - } - - rng = t.getRng(); - id = dom.uniqueId(); - collapsed = t.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 = t.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)); - } - - t.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 t = this, dom = t.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 (t.tridentSel) { - return t.tridentSel.moveToBookmark(bookmark); - } - - if (setEndPoint(true) && setEndPoint()) { - t.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); - t.setRng(rng); - } - } else if (bookmark.name) { - t.select(dom.select(bookmark.name)[bookmark.index]); - } else if (bookmark.rng) { - t.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 t = this, dom = t.dom, rng = dom.createRng(), idx; - - function setPoint(node, start) { - var walker = new TreeWalker(node, node); - - 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 element - if (node.nodeName == 'BR') { - if (start) { - rng.setStartBefore(node); - } else { - rng.setEndBefore(node); - } - - return; - } - } while ((node = (start ? walker.next() : walker.prev()))); - } - - if (node) { - if (!content && t.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) { - setPoint(node, 1); - setPoint(node); - } - - t.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; - - // 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 - if (isIE && rng && rng.setStart && doc.selection.createRange().item) { - elm = doc.selection.createRange().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 (rng.compareBoundaryPoints(rng.START_TO_START, self.selectedRange) === 0 && - rng.compareBoundaryPoints(rng.END_TO_END, 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; - - self.lastRng = null; - - // 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(); - } catch (ex) { - // IE9 might throw errors here don't know why - } - - sel.addRange(rng); - - // 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; - - 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 self.dom.getRoot(); - } - - 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; - } - - return rng.item ? rng.item(0) : rng.parentElement(); - }, - - getSelectedBlocks: function(startElm, endElm) { - var self = this, dom = self.dom, node, selectedBlocks = []; - - startElm = dom.getParent(startElm || self.getStart(), dom.isBlock); - endElm = dom.getParent(endElm || self.getEnd(), dom.isBlock); - - if (startElm) { - selectedBlocks.push(startElm); - } - - if (startElm && endElm && startElm != endElm) { - node = startElm; - - var walker = new TreeWalker(startElm, dom.getRoot()); - while ((node = walker.next()) && node != endElm) { - if (dom.isBlock(node)) { - selectedBlocks.push(node); - } - } - } - - if (endElm && startElm != endElm) { - 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, normalized, collapsed; - - function normalizeEndPoint(start) { - var container, offset, walker, dom = self.dom, body = dom.getRoot(), node, nonEmptyElementsMap, nodeName; - - 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; - - startNode = startNode || container; - walker = new TreeWalker(startNode, dom.getParent(startNode.parentNode, dom.isBlock) || body); - - // Walk left until we hit a text node we can move to or a block/br/img - 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']; - nonEmptyElementsMap = dom.schema.getNonEmptyElements(); - - // 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 (start) { - 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(!start && 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 = start ? 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" && !start) { - offset++; - } - - normalized = true; - break; - } - } while ((node = (start ? 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]; - if(node && node.nodeName === 'BR' && !isPrevNode(node, 'A') && - !hasBrBeforeAfter(node) && !hasBrBeforeAfter(node, true)) { - findTextNodeRelative(true, container.childNodes[offset]); - } - } - } - - // Lean the start of the selection right if possible - // So this: x[x] - // Becomes: x[x] - if (start && !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); - } - } - - // Normalize only on non IE browsers for now - if (isIE) { - return; - } - - rng = self.getRng(); - collapsed = rng.collapsed; - - // Normalize the end points - normalizeEndPoint(true); - - if (!collapsed) { - normalizeEndPoint(); - } - - // Set the selection if it was normalized - if (normalized) { - // If it was collapsed then make sure it still is - if (collapsed) { - rng.collapse(true); - } - - //console.log(self.dom.dumpRng(rng)); - self.setRng(rng, self.isForward()); - } - }, - - /** - * 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; - }, - - scrollIntoView: function(elm) { - var y, viewPort, self = this, dom = self.dom; - - viewPort = dom.getViewPort(self.editor.getWin()); - y = dom.getPos(elm).y; - if (y < viewPort.y || y + 25 > viewPort.y + viewPort.h) { - self.editor.getWin().scrollTo(0, y < viewPort.y ? y : y - viewPort.h + 25); - } - }, - - destroy: function() { - this.win = this.lastRng = null; - this.controlSelection.destroy(); - } - }; - - return Selection; -}); diff --git a/lib/tinymce/js/tinymce/classes/dom/Serializer.js b/lib/tinymce/js/tinymce/classes/dom/Serializer.js deleted file mode 100644 index 30a21459..00000000 --- a/lib/tinymce/js/tinymce/classes/dom/Serializer.js +++ /dev/null @@ -1,385 +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; - - /** - * Constucts 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 */ - 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 - node.attr('type', (node.attr('type') || 'text/javascript').replace(/^mce\-/, '')); - - 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/lib/tinymce/js/tinymce/classes/dom/Sizzle.jQuery.js b/lib/tinymce/js/tinymce/classes/dom/Sizzle.jQuery.js deleted file mode 100644 index 21de9bcc..00000000 --- a/lib/tinymce/js/tinymce/classes/dom/Sizzle.jQuery.js +++ /dev/null @@ -1,28 +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() { - var $ = jQuery; - - function Sizzle(selector, context, results, seed) { - return $.find(selector, context, results, seed); - } - - Sizzle.matches = function(expr, elements) { - return $(elements).is(expr) ? elements : []; - }; - - return Sizzle; -}); diff --git a/lib/tinymce/js/tinymce/classes/dom/Sizzle.js b/lib/tinymce/js/tinymce/classes/dom/Sizzle.js deleted file mode 100644 index 98f25f93..00000000 --- a/lib/tinymce/js/tinymce/classes/dom/Sizzle.js +++ /dev/null @@ -1,1923 +0,0 @@ -/** - * Sizzle.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*jshint bitwise:false, expr:true, noempty:false, sub:true, eqnull:true, latedef:false, maxlen:255 */ - -/* - * 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 descendent - // 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/lib/tinymce/js/tinymce/classes/dom/TreeWalker.js b/lib/tinymce/js/tinymce/classes/dom/TreeWalker.js deleted file mode 100644 index c774ceef..00000000 --- a/lib/tinymce/js/tinymce/classes/dom/TreeWalker.js +++ /dev/null @@ -1,71 +0,0 @@ -/** - * TreeWalker.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -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. - * - * @return {Node} Current node where the walker is. - */ - this.current = function() { - return node; - }; - - /** - * Walks to the next node in tree. - * - * @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. - * - * @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/lib/tinymce/js/tinymce/classes/dom/TridentSelection.js b/lib/tinymce/js/tinymce/classes/dom/TridentSelection.js deleted file mode 100644 index cb1dcd07..00000000 --- a/lib/tinymce/js/tinymce/classes/dom/TridentSelection.js +++ /dev/null @@ -1,496 +0,0 @@ -/** - * TridentSelection.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -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/lib/tinymce/js/tinymce/classes/html/DomParser.js b/lib/tinymce/js/tinymce/classes/html/DomParser.js deleted file mode 100644 index 1d5ee75f..00000000 --- a/lib/tinymce/js/tinymce/classes/html/DomParser.js +++ /dev/null @@ -1,752 +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. - * - * @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); - 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, - - // 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.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/lib/tinymce/js/tinymce/classes/html/Entities.js b/lib/tinymce/js/tinymce/classes/html/Entities.js deleted file mode 100644 index 7fbd8c4d..00000000 --- a/lib/tinymce/js/tinymce/classes/html/Entities.js +++ /dev/null @@ -1,261 +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 */ - -/** - * 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. - * - * @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/lib/tinymce/js/tinymce/classes/html/Node.js b/lib/tinymce/js/tinymce/classes/html/Node.js deleted file mode 100644 index acfc57a9..00000000 --- a/lib/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/lib/tinymce/js/tinymce/classes/html/SaxParser.js b/lib/tinymce/js/tinymce/classes/html/SaxParser.js deleted file mode 100644 index f58e7b49..00000000 --- a/lib/tinymce/js/tinymce/classes/html/SaxParser.js +++ /dev/null @@ -1,390 +0,0 @@ -/** - * SaxParser.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 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, noop = function() {}; - - 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; - - 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; - - name = name.toLowerCase(); - value = name in fillAttrsMap ? name : decode(value || val2 || val3 || ''); // Handle boolean attribute than value attribute - - // Validate name and value - if (validate && !isInternalElement && name.indexOf('data-mce-') !== 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; - } - } - - // 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 - 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/lib/tinymce/js/tinymce/classes/html/Schema.js b/lib/tinymce/js/tinymce/classes/html/Schema.js deleted file mode 100644 index 6e027cc2..00000000 --- a/lib/tinymce/js/tinymce/classes/html/Schema.js +++ /dev/null @@ -1,917 +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 - * - * @param {String} type html4, html5 or html5-strict schema type. - * @return {Object} Schema lookup table. - */ - function compileSchema(type) { - var schema = {}, globalAttributes, eventAttributes, 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', 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 samp 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) { - 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]) { - elements[name] = elements[cloneName]; - } - - // Add custom elements at span/div positions - each(children, function(element) { - if (element[cloneName]) { - 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 === '-') { - 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; - }); - } 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/lib/tinymce/js/tinymce/classes/html/Serializer.js b/lib/tinymce/js/tinymce/classes/html/Serializer.js deleted file mode 100644 index 041272af..00000000 --- a/lib/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/lib/tinymce/js/tinymce/classes/html/Styles.js b/lib/tinymce/js/tinymce/classes/html/Styles.js deleted file mode 100644 index 1d869ff2..00000000 --- a/lib/tinymce/js/tinymce/classes/html/Styles.js +++ /dev/null @@ -1,297 +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 */ - 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, urlConverterScope = settings.url_converter_scope || this; - - function compress(prefix, suffix) { - var top, right, bottom, left; - - // Get values and check it it needs compressing - top = styles[prefix + '-top' + suffix]; - if (!top) { - return; - } - - right = styles[prefix + '-right' + suffix]; - if (top != right) { - return; - } - - bottom = styles[prefix + '-bottom' + suffix]; - if (right != bottom) { - return; - } - - left = styles[prefix + '-left' + suffix]; - if (bottom != left) { - return; - } - - // Compress - styles[prefix + suffix] = left; - 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 || value.indexOf(' ') < 0) { - 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); - - // 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) { - // 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) { - // 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", ""); - 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; - } - } - - 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/lib/tinymce/js/tinymce/classes/html/Writer.js b/lib/tinymce/js/tinymce/classes/html/Writer.js deleted file mode 100644 index 0f9eaaef..00000000 --- a/lib/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/lib/tinymce/js/tinymce/classes/jquery.tinymce.js b/lib/tinymce/js/tinymce/classes/jquery.tinymce.js deleted file mode 100644 index df983279..00000000 --- a/lib/tinymce/js/tinymce/classes/jquery.tinymce.js +++ /dev/null @@ -1,357 +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 = ""; - - // No match then just ignore the call - if (!self.length) { - return self; - } - - // Get editor instance - if (!settings) { - return tinymce.get(self[0].id); - } - - self.css('visibility', 'hidden'); // Hide textarea to avoid flicker - - function init() { - var editors = [], initCount = 0; - - // Apply patches to the jQuery object, only once - if (applyPatch) { - applyPatch(); - applyPatch = null; - } - - // 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(); - } - - // 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 aswell - 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) + "&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 || event; - - if (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 - if (value !== undef) { - 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); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/AbsoluteLayout.js b/lib/tinymce/js/tinymce/classes/ui/AbsoluteLayout.js deleted file mode 100644 index efe9b35d..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/AbsoluteLayout.js +++ /dev/null @@ -1,46 +0,0 @@ -/** - * AbsoluteLayout.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-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' - }, - - 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(); - } - }); - }, - - renderHtml: function(container) { - return '
    ' + this._super(container); - } - }); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/Button.js b/lib/tinymce/js/tinymce/classes/ui/Button.js deleted file mode 100644 index 70c8ef26..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/Button.js +++ /dev/null @@ -1,67 +0,0 @@ -/** - * Button.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-x-less Button.less - * @class tinymce.ui.Button - * @extends tinymce.ui.Control - */ -define("tinymce/ui/Button", [ - "tinymce/ui/Widget" -], function(Widget) { - "use strict"; - - return Widget.extend({ - Defaults: { - classes: "widget btn", - role: "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); - } - }, - - repaint: function() { - var btnStyle = this.getEl().firstChild.style; - - btnStyle.width = btnStyle.height = "100%"; - - this._super(); - }, - - 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 ( - '
    ' + - '' + - '
    ' - ); - } - }); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/ButtonGroup.js b/lib/tinymce/js/tinymce/classes/ui/ButtonGroup.js deleted file mode 100644 index 5a435bde..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/ButtonGroup.js +++ /dev/null @@ -1,41 +0,0 @@ -/** - * ButtonGroup.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-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: 'toolbar' - }, - - 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/lib/tinymce/js/tinymce/classes/ui/Checkbox.js b/lib/tinymce/js/tinymce/classes/ui/Checkbox.js deleted file mode 100644 index be0682b7..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/Checkbox.js +++ /dev/null @@ -1,80 +0,0 @@ -/** - * Checkbox.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-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 - }, - - 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); - }, - - 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; - }, - - value: function(state) { - return this.checked(state); - }, - - renderHtml: function() { - var self = this, id = self._id, prefix = self.classPrefix; - - return ( - '
    ' + - '' + - '' + self._text + '' + - '
    ' - ); - } - }); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/CheckboxGroup.js b/lib/tinymce/js/tinymce/classes/ui/CheckboxGroup.js deleted file mode 100644 index 8a77e8f9..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/CheckboxGroup.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * CheckboxGroup.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @class tinymce.ui.CheckboxGroup - * @extends tinymce.ui.Container - */ -define("tinymce/ui/CheckboxGroup", [ - "tinymce/ui/Container" -], function(Container) { - "use strict"; - - return Container.extend({}); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/Collection.js b/lib/tinymce/js/tinymce/classes/ui/Collection.js deleted file mode 100644 index da293806..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/Collection.js +++ /dev/null @@ -1,407 +0,0 @@ -/** - * Collection.js - * - * Copyright 2003-2013, Moxiecode Systems AB, All rights reserved. - */ - -/** - * 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. - * - * @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} - */ - 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; - } - - /** - * 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 recieved 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 width height 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/lib/tinymce/js/tinymce/classes/ui/ColorButton.js b/lib/tinymce/js/tinymce/classes/ui/ColorButton.js deleted file mode 100644 index 8fd35db6..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/ColorButton.js +++ /dev/null @@ -1,186 +0,0 @@ -/** - * ColorButton.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-x-less ColorButton.less - * @class tinymce.ui.ColorButton - * @extends tinymce.ui.MenuButton - */ -define("tinymce/ui/ColorButton", [ - "tinymce/ui/Button", - "tinymce/ui/FloatPanel", - "tinymce/ui/KeyboardNavigation" -], function(Button, FloatPanel, KeyboardNavigation) { - "use strict"; - - function mapColors() { - var i, colors = [], colorMap; - - colorMap = [ - "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" - ]; - - for (i = 0; i < colorMap.length; i += 2) { - colors.push({ - text: colorMap[i + 1], - color: colorMap[i] - }); - } - - return colors; - } - - return Button.extend({ - init: function(settings) { - var self = this; - - self._super(settings); - self.addClass('colorbutton'); - self.on('click', function(e) { - if (e.control == self) { - self.showPicker(); - } - }); - self.hasPopup = true; - }, - - showPicker: function() { - var self = this, html = '', size, x, y, prefix = self.classPrefix, colors; - - if (!self.picker) { - colors = mapColors(); - - html = ''; - size = Math.ceil(Math.sqrt(colors.length)); - - for (y = 0; y < 5; y++) { - html += ''; - - for (x = 0; x < 8; x++) { - var color = colors[y * 8 + x]; - - html += ( - '' - ); - } - - html += ''; - } - - html += ''; - - self.picker = new FloatPanel({ - popover: true, - autohide: true, - html: html, - border: 1, - classes: 'colorpicker' - }).parent(self).renderTo(self.getContainerElm()); - - self.picker._hasBody = false; - self.picker.reflow(); - self.picker.parent(self); - self.picker.on('cancel', function(e) { - if (e.control === self.menu) { - self.focus(); - } - }); - self.picker.on('click', function(e) { - var value; - - if ((value = e.target.getAttribute('data-mce-color'))) { - self.picker.hide(); - value = '#' + value; - self.showPreview(value); - self.fire('select', {value: value}); - } - }); - - self.keyboardNavigation = new KeyboardNavigation({ - root: self.picker, - items: self.picker.getEl().getElementsByTagName('div'), - onCancel: function() { - self.picker.hide(); - self.fire('cancel'); - } - }); - } - - self.picker.show(); - self.picker.moveRel(self.getEl(), 'bc-tl'); - self.keyboardNavigation.focusFirst(); - }, - - showPreview: function(color) { - this.getEl('preview').style.backgroundColor = color; - }, - - 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 ( - '
    ' + - '' + - '
    ' - ); - } - }); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/ComboBox.js b/lib/tinymce/js/tinymce/classes/ui/ComboBox.js deleted file mode 100644 index da25b464..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/ComboBox.js +++ /dev/null @@ -1,181 +0,0 @@ -/** - * ComboBox.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-x-less ComboBox.less - * @class tinymce.ui.ComboBox - * @extends tinymce.ui.Widget - */ -define("tinymce/ui/ComboBox", [ - "tinymce/ui/Widget", - "tinymce/ui/DomUtils" -], function(Widget, DomUtils) { - "use strict"; - - return Widget.extend({ - init: function(settings) { - var self = this; - - self._super(settings); - self.addClass('combobox'); - - self.on('click', function(e) { - var elm = e.target; - - while (elm) { - if (elm.id && elm.id.indexOf('-open') != -1) { - self.fire('action'); - } - - 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.submit) { - ctrl.submit(); - 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'); - } - }); - } - }, - - 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; - }, - - repaint: function() { - var self = this, elm = self.getEl(), openElm = self.getEl('open'), rect = self.layoutRect(); - - if (openElm) { - DomUtils.css(elm.firstChild, { - width: rect.w - openElm.offsetWidth - 10 - //lineHeight: (self.layoutRect().h - 2) + 'px' - }); - } else { - DomUtils.css(elm.firstChild, { - width: rect.w - 10 - }); - } - - self._super(); - - return self; - }, - - disabled: function(state) { - var self = this; - - self._super(state); - - if (self._rendered) { - self.getEl().disabled = state; - } - }, - - focus: function() { - this.getEl('inp').focus(); - }, - - postRender: function() { - var self = this; - - DomUtils.on(this.getEl('inp'), 'change', function() { - self.fire('change'); - }); - - return self._super(); - }, - - renderHtml: function() { - var self = this, id = self._id, settings = self.settings, prefix = self.classPrefix; - var value = settings.value || settings.placeholder || ''; - var icon, text, openBtnHtml = ''; - - icon = settings.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/lib/tinymce/js/tinymce/classes/ui/Container.js b/lib/tinymce/js/tinymce/classes/ui/Container.js deleted file mode 100644 index 48dabde3..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/Container.js +++ /dev/null @@ -1,325 +0,0 @@ -/** - * Container.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * Base container control. This will be extended by all controls - * that can have children such as panels etc. - * - * @-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/util/Tools", - "tinymce/ui/DomUtils" -], function(Control, Collection, Selector, Factory, Tools, DomUtils) { - "use strict"; - - var selectorCache = {}; - - return Control.extend({ - layout: '', - innerClass: 'container-inner', - - /** - * Constructor for the control. - * - * @constructor - * @method init - * @param {Object} settings Settings name/value object. - */ - init: function(settings) { - var self = this; - - self._super(settings); - settings = self.settings; - - self._items = new Collection(); - - 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; - }, - - focus: function() { - var self = this; - - if (self.keyNav) { - self.keyNav.focusFirst(); - } else { - self._super(); - } - - return self; - }, - - 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); - }, - - 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 !== null) { - // 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; - }, - - 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; - }, - - append: function(items) { - return this.add(items).renderNew(); - }, - - prepend: function(items) { - var self = this; - - self.items().set(self.create(items).concat(self.items().toArray())); - - return self.renderNew(); - }, - - insert: function(items, index, before) { - var self = this, curItems, beforeItems, afterItems; - - items = self.create(items); - curItems = self.items(); - - if (!before) { - 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(); - }, - - preRender: function() { - }, - - renderHtml: function() { - var self = this, layout = self._layout; - - self.preRender(); - layout.preRender(self); - - return ( - '
    ' + - '
    '+ - (self.settings.html || '') + layout.renderHtml(self) + - '
    ' + - '
    ' - ); - }, - - 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 - }); - } - - return self; - }, - - initLayoutRect: function() { - var self = this, layoutRect = self._super(); - - // Recalc container size by asking layout manager - self._layout.recalc(self); - - return layoutRect; - }, - - 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; - } - }, - - reflow: function() { - var i, items; - - if (this.visible()) { - Control.repaintControls = []; - Control.repaintControls.map = {}; - - items = 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/lib/tinymce/js/tinymce/classes/ui/Control.js b/lib/tinymce/js/tinymce/classes/ui/Control.js deleted file mode 100644 index bb7ebe97..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/Control.js +++ /dev/null @@ -1,1266 +0,0 @@ -/** - * Control.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * ... - * - * @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; - - /** - * Base control. All controls extend this class. - * - * @class tinymce.ui.Control - */ - var Control = Class.extend({ - Statics: { - controlIdLookup: {} - }, - - classPrefix: "mce-", - - getContainerElm: function() { - return document.body; - }, - - getParentCtrl: function(elm) { - var ctrl; - - while (elm) { - ctrl = Control.controlIdLookup[elm.id]; - if (ctrl) { - break; - } - - elm = elm.parentNode; - } - - return ctrl; - }, - - /** - * Constructor for the control. - * - * @constructor - * @method init - * @param {Object} settings Settings name/value object. - */ - init: function(settings) { - var self = this, classes, i; - - self.settings = settings = Tools.extend({}, self.Defaults, settings); - - // Initial states - self._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; - } - }); - - if (settings.classes) { - Tools.each(settings.classes.split(' '), function(cls) { - self.addClass(cls); - }); - } - - 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,refresh', - - 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 = parseInt(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") - }; - }, - - initLayoutRect: function() { - var self = this, settings = self.settings, borderBox, layoutRect; - var elm = self.getEl(), width, height, minWidth, minHeight, autoResize; - var startMinWidth, startMinHeight; - - // Measure boxes - 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'); - - // Setup minWidth/minHeight and width/height - startMinWidth = settings.minWidth; - startMinHeight = settings.minHeight; - minWidth = startMinWidth || elm.offsetWidth; - minHeight = startMinHeight || elm.offsetHeight; - 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; - }, - - 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; - }, - - repaint: function() { - var self = this, style, bodyStyle, rect, borderBox, borderW = 0, borderH = 0, lastRepaintRect; - - 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 = 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; - } - - // Update body if needed - if (self._hasBody && rect.innerW !== lastRepaintRect.innerW) { - bodyStyle = self.getEl('body').style; - bodyStyle.width = (rect.innerW) + 'px'; - lastRepaintRect.innerW = rect.innerW; - } - - if (self._hasBody && rect.innerH !== lastRepaintRect.innerH) { - bodyStyle = bodyStyle || self.getEl('body').style; - bodyStyle.height = (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 Optional name for the event to unbind. - * @param {function} callback Optional 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 Optional arguments to pass to the event. - * @param {Boolean} bubble Optional value to control bubbeling. Defaults to true. - * @return {tinymce.ui.Control} Current control 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 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 ctrl = this, parents = new Collection(); - - // Add each parent to collection - for (ctrl = ctrl.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; - }, - - next: function() { - var parentControls = this.parent().items(); - - return parentControls[parentControls.indexOf(this) + 1]; - }, - - prev: function() { - var parentControls = this.parent().items(); - - return parentControls[parentControls.indexOf(this) - 1]; - }, - - 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. - * - * @param {String} cls Class to check for. - * @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 - * - * @param {String} cls Class to check for. - * @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; - }, - - /** - * Removed the specified class from the control. - * - * @param {String} cls Class to remove. - * @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; - }, - - toggleClass: function(cls, state, group) { - var self = this; - - if (state) { - self.addClass(cls, group); - } else { - self.removeClass(cls, group); - } - - return self; - }, - - classes: function(group) { - var classes = this._classes[group || 'control']; - - return classes ? classes.join(' ') : ''; - }, - - 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. - * - * @return {tinymce.ui.Control} Current control instance. - */ - show: function() { - return this.visible(true); - }, - - /** - * Sets the visible state to false. - * - * @return {tinymce.ui.Control} Current control instance. - */ - hide: function() { - return this.visible(false); - }, - - focus: function() { - this.getEl().focus(); - }, - - blur: function() { - this.getEl().blur(); - }, - - aria: function(name, value) { - var self = this, elm = self.getEl(); - - if (typeof(value) === "undefined") { - return self._aria[name]; - } else { - self._aria[name] = value; - } - - if (self._rendered) { - if (name == 'label') { - elm.setAttribute('aria-labeledby', self._id); - } - - elm.setAttribute(name == 'role' ? name : 'aria-' + name, value); - } - - return self; - }, - - encode: function(text, translate) { - if (translate !== false && Control.translate) { - text = Control.translate(text); - } - - return (text || '').replace(/[&<>"]/g, function(match) { - return '&#' + match.charCodeAt(0) + ';'; - }); - }, - - before: function(items) { - var self = this, parent = self.parent(); - - if (parent) { - parent.insert(items, parent.items().indexOf(self), true); - } - - return self; - }, - - after: function(items) { - var self = this, parent = self.parent(); - - if (parent) { - parent.insert(items, parent.items().indexOf(self)); - } - - return self; - }, - - remove: function() { - var self = this, elm = self.getEl(), parent = self.parent(), newItems; - - if (self.items) { - var controls = self.items().toArray(); - var 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); - } - - delete Control.controlIdLookup[self._id]; - - if (elm.parentNode) { - elm.parentNode.removeChild(elm); - } - - return self; - }, - - renderBefore: function(elm) { - var self = this; - - elm.parentNode.insertBefore(DomUtils.createFragment(self.renderHtml()), elm); - self.postRender(); - - return self; - }, - - renderTo: function(elm) { - var self = this; - - elm = elm || self.getContainerElm(); - elm.appendChild(DomUtils.createFragment(self.renderHtml())); - self.postRender(); - - return self; - }, - - 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 - Control.controlIdLookup[self._id] = self; - - for (var key in self._aria) { - self.aria(key, self._aria[key]); - } - - self.fire('postrender', {}, false); - }, - - 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; - }, - - 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; - } - } - }, - - 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 for 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/lib/tinymce/js/tinymce/classes/ui/DomUtils.js b/lib/tinymce/js/tinymce/classes/ui/DomUtils.js deleted file mode 100644 index 7f107357..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/DomUtils.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * DomUtils.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -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) { - return DOMUtils.DOM.getSize(elm); - }, - - getPos: function(elm, root) { - return DOMUtils.DOM.getPos(elm, root); - }, - - 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); - } - }; -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/DragHelper.js b/lib/tinymce/js/tinymce/classes/ui/DragHelper.js deleted file mode 100644 index 2392d8a1..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/DragHelper.js +++ /dev/null @@ -1,125 +0,0 @@ -/** - * DragHelper.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * Drag/drop helper class. - * - * @example - * var dragHelper = new tinymce.ui.DragHelper('mydiv', { - * start: function(evt) { - * }, - * - * drag: function(evt) { - * }, - * - * end: function(evt) { - * } - * }); - */ -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: 0xFFFF, - 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); - } - }; - - this.destroy = function() { - DomUtils.off(getHandleElm()); - }; - - DomUtils.on(getHandleElm(), 'mousedown', start); - }; -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/ElementPath.js b/lib/tinymce/js/tinymce/classes/ui/ElementPath.js deleted file mode 100644 index b351e967..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/ElementPath.js +++ /dev/null @@ -1,64 +0,0 @@ -/** - * ElementPath.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @class tinymce.ui.ElementPath - * @extends tinymce.ui.Path - */ -define("tinymce/ui/ElementPath", [ - "tinymce/ui/Path", - "tinymce/EditorManager" -], function(Path, EditorManager) { - return Path.extend({ - postRender: function() { - var self = this, editor = EditorManager.activeEditor; - - function isBogus(elm) { - return elm.nodeType === 1 && (elm.nodeName == "BR" || !!elm.getAttribute('data-mce-bogus')); - } - - self.on('select', function(e) { - var parents = [], node = editor.selection.getNode(), body = editor.getBody(); - - while (node) { - if (!isBogus(node)) { - parents.push(node); - } - - node = node.parentNode; - if (node == body) { - break; - } - } - - editor.focus(); - 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 (!isBogus(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/lib/tinymce/js/tinymce/classes/ui/Factory.js b/lib/tinymce/js/tinymce/classes/ui/Factory.js deleted file mode 100644 index eeb2bb51..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/Factory.js +++ /dev/null @@ -1,78 +0,0 @@ -/** - * Factory.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/*global tinymce:true */ - -/** - * .. - * - * @class tinymce.ui.Factory - */ -define("tinymce/ui/Factory", [], function() { - "use strict"; - - var types = {}, namespaceInit; - - return { - add: function(type, typeClass) { - types[type.toLowerCase()] = typeClass; - }, - - 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. - * - * @method create - * @example tinymce.ui.Factory.create({type: 'button', text: 'Hello world!'}); - * @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/lib/tinymce/js/tinymce/classes/ui/FieldSet.js b/lib/tinymce/js/tinymce/classes/ui/FieldSet.js deleted file mode 100644 index 3e9fdcb5..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/FieldSet.js +++ /dev/null @@ -1,49 +0,0 @@ -/** - * FieldSet.js - * - * Copyright 2003-2013, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-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 - }, - - 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/lib/tinymce/js/tinymce/classes/ui/FilePicker.js b/lib/tinymce/js/tinymce/classes/ui/FilePicker.js deleted file mode 100644 index 85bd8413..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/FilePicker.js +++ /dev/null @@ -1,43 +0,0 @@ -/** - * FilePicker.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/*global tinymce:true */ - -/** - * .. - * - * @class tinymce.ui.FilePicker - * @extends tinymce.ui.ComboBox - */ -define("tinymce/ui/FilePicker", [ - "tinymce/ui/ComboBox" -], function(ComboBox) { - "use strict"; - - return ComboBox.extend({ - 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/lib/tinymce/js/tinymce/classes/ui/FitLayout.js b/lib/tinymce/js/tinymce/classes/ui/FitLayout.js deleted file mode 100644 index 24d2168f..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/FitLayout.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * FitLayout.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * This class jada jada. - * - * var x = 3; - * - * @-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({ - 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/lib/tinymce/js/tinymce/classes/ui/FlexLayout.js b/lib/tinymce/js/tinymce/classes/ui/FlexLayout.js deleted file mode 100644 index a4f22fa0..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/FlexLayout.js +++ /dev/null @@ -1,240 +0,0 @@ -/** - * FlexLayout.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * Settings: - * direction=row|row-reverse|column|column-reverse - * flex= - * align=start|end|center|stretch - * pack=start|end|justify - * - * @class tinymce.ui.layout.FlexLayout - * @extends tinymce.ui.AbsoluteLayout - */ -define("tinymce/ui/FlexLayout", [ - "tinymce/ui/AbsoluteLayout" -], function(AbsoluteLayout) { - "use strict"; - - return AbsoluteLayout.extend({ - recalc: function(container) { - 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, afterName, deltaSizeName, contentSizeName; - var alignAxisName, alignInnerSizeName, alignSizeName, alignMinSizeName, alignMaxSizeName, 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 = contSettings.direction; - align = contSettings.align; - pack = 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'; - afterName = 'bottom'; - deltaSizeName = "deltaH"; - contentSizeName = "contentH"; - - alignBeforeName = "left"; - alignSizeName = "w"; - alignAxisName = "x"; - alignInnerSizeName = "innerW"; - alignMinSizeName = "minW"; - alignMaxSizeName = "maxW"; - alignAfterName = "right"; - alignDeltaSizeName = "deltaW"; - alignContentSizeName = "contentW"; - } else { - posName = "x"; - sizeName = "w"; - minSizeName = "minW"; - maxSizeName = "maxW"; - innerSizeName = "innerW"; - beforeName = 'left'; - afterName = 'right'; - deltaSizeName = "deltaW"; - contentSizeName = "contentW"; - - alignBeforeName = "top"; - alignSizeName = "h"; - alignAxisName = "y"; - alignInnerSizeName = "innerH"; - alignMinSizeName = "minH"; - alignMaxSizeName = "maxH"; - 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] + Math.ceil(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 += Math.ceil(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/lib/tinymce/js/tinymce/classes/ui/FloatPanel.js b/lib/tinymce/js/tinymce/classes/ui/FloatPanel.js deleted file mode 100644 index 2662ec01..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/FloatPanel.js +++ /dev/null @@ -1,204 +0,0 @@ -/** - * FloatPanel.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-x-less FloatPanel.less - * @class tinymce.ui.FloatPanel - * @extends tinymce.ui.Panel - */ -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, autoHidePanels = []; - var zOrder = [], hasModal; - - var FloatPanel = Panel.extend({ - Mixins: [Movable, Resizable], - - 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(); - } - } - - 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) { - var i, clickCtrl = self.getParentCtrl(e.target); - - // 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 - i = autoHidePanels.length; - while (i--) { - if (clickCtrl) { - if (isChildOf(clickCtrl, autoHidePanels[i]) || autoHidePanels[i].parent() === clickCtrl) { - continue; - } - } - - autoHidePanels[i].hide(); - } - }; - - DomUtils.on(document, 'click', documentClickHandler); - } - - autoHidePanels.push(self); - } - - 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(); - } - }); - - if (settings.popover) { - self._preBodyHtml = '
    '; - self.addClass('popover').addClass('bottom').addClass('start'); - } - }, - - show: function() { - var self = this, i, state = self._super(); - - i = autoHidePanels.length; - while (i--) { - if (autoHidePanels[i] === self) { - break; - } - } - - if (self.settings.autohide && i === -1) { - autoHidePanels.push(self); - } - - return state; - }, - - hide: function() { - var i; - - i = autoHidePanels.length; - while (i--) { - if (autoHidePanels[i] === this) { - autoHidePanels.splice(i, 1); - } - } - - return this._super(); - }, - - hideAll: function() { - FloatPanel.hideAll(); - }, - - close: function() { - var self = this; - - self.fire('close'); - - return self.remove(); - }, - - remove: function() { - var self = this; - - self._super(); - } - }); - - FloatPanel.hideAll = function() { - var i = autoHidePanels.length; - - while (i--) { - autoHidePanels[i].fire('cancel', {}, false); - autoHidePanels[i].hide(); - autoHidePanels.splice(i, 1); - } - }; - - return FloatPanel; -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/FlowLayout.js b/lib/tinymce/js/tinymce/classes/ui/FlowLayout.js deleted file mode 100644 index 28d91136..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/FlowLayout.js +++ /dev/null @@ -1,32 +0,0 @@ -/** - * FlowLayout.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-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' - }, - - recalc: function(container) { - container.items().filter(':visible').each(function(ctrl) { - if (ctrl.recalc) { - ctrl.recalc(); - } - }); - } - }); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/Form.js b/lib/tinymce/js/tinymce/classes/ui/Form.js deleted file mode 100644 index 87513f11..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/Form.js +++ /dev/null @@ -1,130 +0,0 @@ -/** - * Form.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @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 - }, - - 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', text: label, flex: 0, forId: ctrl._id} - ] - }); - - formItem.type = 'formitem'; - - if (typeof(ctrl.settings.flex) == "undefined") { - ctrl.settings.flex = 1; - } - - self.replace(ctrl, formItem); - formItem.add(ctrl); - } - }); - }, - - 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; - } - }, - - visible: function(state) { - var val = this._super(state); - - if (state === true && this._rendered) { - this.recalcLabels(); - } - - return val; - }, - - fromJSON: function(data) { - var self = this; - - if (data) { - for (var name in data) { - self.find('#' + name).value(data[name]); - } - } - - return self; - }, - - 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; - }, - - submit: function() { - return this.fire('submit', {data: this.toJSON()}); - }, - - postRender: function() { - var self = this; - - self._super(); - self.recalcLabels(); - self.fromJSON(self.settings.data); - } - }); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/FormItem.js b/lib/tinymce/js/tinymce/classes/ui/FormItem.js deleted file mode 100644 index 90c8d269..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/FormItem.js +++ /dev/null @@ -1,44 +0,0 @@ -/** - * FormItem.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @class tinymce.ui.FormItem - * @extends tinymce.ui.Container - */ -define("tinymce/ui/FormItem", [ - "tinymce/ui/Container" -], function(Container) { - "use strict"; - - return Container.extend({ - Defaults: { - layout: 'flex', - align: 'center', - defaults: { - flex: 1 - } - }, - - 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/lib/tinymce/js/tinymce/classes/ui/FormatControls.js b/lib/tinymce/js/tinymce/classes/ui/FormatControls.js deleted file mode 100644 index 73c748af..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/FormatControls.js +++ /dev/null @@ -1,573 +0,0 @@ -/** - * FormatControls.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * - * @class tinymce.ui.FormatControls - */ -define("tinymce/ui/FormatControls", [ - "tinymce/ui/Factory", - "tinymce/ui/Control", - "tinymce/ui/FloatPanel", - "tinymce/util/Tools", - "tinymce/EditorManager" -], function(Factory, Control, FloatPanel, Tools, EditorManager) { - var each = Tools.each; - - Control.translate = function(text) { - return EditorManager.translate(text); - }; - - // Generates a preview for a format - function getPreviewCss(editor, format) { - var name, previewElm, dom = editor.dom, 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 text-decoration text-transform color background-color border border-radius'; - } - - // 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 createFormats(formats) { - formats = formats.split(';'); - - var i = formats.length; - while (i--) { - formats[i] = formats[i].split('='); - } - - return formats; - } - - EditorManager.on('AddEditor', function(e) { - var editor = e.editor, formatMenu; - - 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.textStyle = function() { - return getPreviewCss(editor, formatName); - }; - - menuItem.onclick = function() { - editor.execCommand('mceToggleFormat', false, formatName); - }; - } - - menu.push(menuItem); - }); - - return menu; - } - - editor.on('init', function() { - each(newFormats, function(format) { - editor.formatter.register(format.name, format); - }); - }); - - var menu = createMenu(editor.settings.style_formats || defaultStyleFormats); - - return menu; - } - - 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() { - editor.execCommand('mceToggleFormat', false, 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: ['Toggle blockquote', 'mceBlockQuote'], - numlist: ['Numbered list', 'InsertOrderedList'], - bullist: ['Bulleted 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', function() { - self.disabled(!hasUndo()); - }); - } - - function toggleRedoState() { - var self = this; - - self.disabled(!hasRedo()); - editor.on('Undo Redo AddUndo', function() { - self.disabled(!hasRedo()); - }); - } - - function toggleVisualAidState() { - var self = this; - - editor.on('VisualAid', function(e) { - self.active(e.hasVisual); - }); - - self.active(editor.hasVisual); - } - - editor.addButton('forecolor', { - type: 'colorbutton', - tooltip: 'Text color', - onselect: function(e) { - editor.execCommand('ForeColor', false, e.value); - } - }); - - editor.addButton('backcolor', { - type: 'colorbutton', - tooltip: 'Background color', - onselect: function(e) { - editor.execCommand('HiliteColor', false, e.value); - } - }); - - 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(e) { - if (e.control.settings.format) { - EditorManager.activeEditor.execCommand('mceToggleFormat', false, e.control.settings.format); - } - } - - Factory.add('styleselect', function(settings) { - var menu = [].concat(formatMenu); - - /* - menu.push({text: '-'}); - menu.push({ - text: 'Remove formatting', - icon: 'removeformat', - onclick: function() { - editor.execCommand('RemoveFormat'); - } - }); - */ - - return Factory.create('menubutton', Tools.extend({ - text: 'Formats', - menu: menu - }, settings)); - }); - - Factory.add('formatselect', function(settings) { - var items = [], blocks = createFormats( - '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], - format: block[1], - textStyle: function() { - return getPreviewCss(editor, block[1]); - } - }); - }); - - return Factory.create('listbox', Tools.extend({ - text: blocks[0][0], - menu: items, - onclick: toggleFormat - }, settings)); - }); - - Factory.add('fontselect', function(settings) { - var items = [], fonts = createFormats( - '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' - ); - - each(fonts, function(font) { - items.push({ - text: font[0], - format: font[1], - style: font[1].indexOf('dings') == -1 ? 'font-family:' + font[1] : '' - }); - }); - - return Factory.create('listbox', Tools.extend({ - text: 'Font Family', - menu: items, - onclick: function(e) { - if (e.control.settings.format) { - EditorManager.activeEditor.execCommand('FontName', false, e.control.settings.format); - } - } - }, settings)); - }); - - Factory.add('fontsizeselect', function(settings) { - var items = []; - - each('8pt 10pt 12pt 14pt 18pt 24pt 36pt'.split(' '), function(item) { - items.push({text: item, format: item}); - }); - - return Factory.create('listbox', Tools.extend({ - text: 'Font Sizes', - menu: items, - onclick: function(e) { - if (e.control.settings.format) { - EditorManager.activeEditor.execCommand('FontSize', false, e.control.settings.format); - } - } - }, settings)); - }); - - editor.addMenuItem('formats', { - text: 'Formats', - menu: formatMenu - }); - }); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/GridLayout.js b/lib/tinymce/js/tinymce/classes/ui/GridLayout.js deleted file mode 100644 index 86efc2ef..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/GridLayout.js +++ /dev/null @@ -1,201 +0,0 @@ -/** - * GridLayout.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @class tinymce.ui.GridLayout - * @extends tinymce.ui.AbsoluteLayout - */ -define("tinymce/ui/GridLayout", [ - "tinymce/ui/AbsoluteLayout" -], function(AbsoluteLayout) { - "use strict"; - - return AbsoluteLayout.extend({ - 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, alignX, alignY, 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; - - // 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 ? Math.ceil(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 = colWidths[x]; - alignX = alignY = 0; - ctrlLayoutRect.x = posX; - ctrlLayoutRect.y = posY; - - // Align control horizontal - align = ctrlSettings.alignH || alignH; - 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; - 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/lib/tinymce/js/tinymce/classes/ui/Iframe.js b/lib/tinymce/js/tinymce/classes/ui/Iframe.js deleted file mode 100644 index 9008aaae..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/Iframe.js +++ /dev/null @@ -1,43 +0,0 @@ -/** - * Iframe.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/*jshint scripturl:true */ - -/** - * .. - * - * @-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({ - renderHtml: function() { - var self = this; - - self.addClass('iframe'); - self.canFocus = false; - - return ( - '' - ); - }, - - src: function(src) { - this.getEl().src = src; - }, - - html: function(html) { - this.getEl().contentWindow.document.body.innerHTML = html; - return this; - } - }); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/KeyboardNavigation.js b/lib/tinymce/js/tinymce/classes/ui/KeyboardNavigation.js deleted file mode 100644 index 147ba054..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/KeyboardNavigation.js +++ /dev/null @@ -1,302 +0,0 @@ -/** - * KeyboardFocus.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @class tinymce.ui.KeyboardNavigation - */ -define("tinymce/ui/KeyboardNavigation", [ - "tinymce/ui/DomUtils" -], function(DomUtils) { - "use strict"; - - /** - * Create a new KeyboardNavigation instance to handle the focus for a specific element. - * - * @constructor - * @method KeyboardNavigation - * @param {Object} settings the settings object to define how keyboard navigation works. - * - * @setting {tinymce.ui.Control} root the root control navigation focus movement is scoped to this root. - * @setting {Array} items an array containing the items to move focus between. Every object in this array must have an - * id attribute which maps to the actual DOM element and it must be able to have focus i.e. tabIndex=-1. - * @setting {Function} onCancel the callback for when the user presses escape or otherwise indicates cancelling. - * @setting {Function} onAction (optional) the action handler to call when the user activates an item. - * @setting {Boolean} enableLeftRight (optional, default) when true, the up/down arrows move through items. - * @setting {Boolean} enableUpDown (optional) when true, the up/down arrows move through items. - * Note for both up/down and left/right explicitly set both enableLeftRight and enableUpDown to true. - */ - return function(settings) { - var root = settings.root, enableUpDown = settings.enableUpDown !== false; - var enableLeftRight = settings.enableLeftRight !== false; - var items = settings.items, focussedId; - - /** - * Initializes the items array if needed. This will collect items/elements - * from the specified root control. - */ - function initItems() { - if (!items) { - items = []; - - if (root.find) { - // Root is a container then get child elements using the UI API - root.find('*').each(function(ctrl) { - if (ctrl.canFocus) { - items.push(ctrl.getEl()); - } - }); - } else { - // Root is a control/widget then get the child elements of that control - var elements = root.getEl().getElementsByTagName('*'); - for (var i = 0; i < elements.length; i++) { - if (elements[i].id && elements[i]) { - items.push(elements[i]); - } - } - } - } - } - - /** - * Returns the currently focused element. - * - * @return {Element} Currently focused element. - */ - function getFocusElement() { - return document.getElementById(focussedId); - } - - /** - * Returns the currently focused elements wai aria role. - * - * @param {Element} elm Optional element to get role from. - * @return {String} Role of specified element. - */ - function getRole(elm) { - elm = elm || getFocusElement(); - - return elm && elm.getAttribute('role'); - } - - /** - * Returns the role of the parent element. - * - * @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 || getFocusElement(); - - while ((parent = parent.parentNode)) { - if ((role = getRole(parent))) { - return role; - } - } - } - - /** - * Returns an wai aria property by name. - * - * @param {String} name Name of the aria property to get for example "disabled". - * @return {String} Aria property value. - */ - function getAriaProp(name) { - var elm = document.getElementById(focussedId); - - if (elm) { - return elm.getAttribute('aria-' + name); - } - } - - /** - * Executes the onAction event callback. This is when the user presses enter/space. - */ - function action() { - var focusElm = getFocusElement(); - - if (focusElm && (focusElm.nodeName == "TEXTAREA" || focusElm.type == "text")) { - return; - } - - if (settings.onAction) { - settings.onAction(focussedId); - } else { - DomUtils.fire(getFocusElement(), 'click', {keyboard: true}); - } - - return true; - } - - /** - * Cancels the current navigation. The same as pressing the Esc key. - */ - function cancel() { - var focusElm; - - if (settings.onCancel) { - if ((focusElm = getFocusElement())) { - focusElm.blur(); - } - - settings.onCancel(); - } else { - settings.root.fire('cancel'); - } - } - - /** - * Moves the focus to the next or previous item. It will wrap to start/end if it can't move. - * - * @param {Number} dir Direction for move -1 or 1. - */ - function moveFocus(dir) { - var idx = -1, focusElm, i; - - initItems(); - - i = items.length; - while (i--) { - if (items[i].id === focussedId) { - idx = i; - break; - } - } - - idx += dir; - if (idx < 0) { - idx = items.length - 1; - } else if (idx >= items.length) { - idx = 0; - } - - focusElm = items[idx]; - focusElm.focus(); - focussedId = focusElm.id; - - if (settings.actOnFocus) { - action(); - } - } - - /** - * Moves focus to the first item or the last focused item if root is a toolbar. - * - * @return {[type]} [description] - */ - function focusFirst() { - var i, rootRole; - - rootRole = getRole(settings.root.getEl()); - initItems(); - - i = items.length; - while (i--) { - if (rootRole == 'toolbar' && items[i].id === focussedId) { - items[i].focus(); - return; - } - } - - items[0].focus(); - } - - // Handle accessible keys - root.on('keydown', function(e) { - var DOM_VK_LEFT = 37, DOM_VK_RIGHT = 39, DOM_VK_UP = 38, DOM_VK_DOWN = 40; - var DOM_VK_ESCAPE = 27, DOM_VK_ENTER = 14, DOM_VK_RETURN = 13, DOM_VK_SPACE = 32, DOM_VK_TAB = 9; - var preventDefault; - - switch (e.keyCode) { - case DOM_VK_LEFT: - if (enableLeftRight) { - if (settings.leftAction) { - settings.leftAction(); - } else { - moveFocus(-1); - } - - preventDefault = true; - } - break; - - case DOM_VK_RIGHT: - if (enableLeftRight) { - if (getRole() == 'menuitem' && getParentRole() == 'menu') { - if (getAriaProp('haspopup')) { - action(); - } - } else { - moveFocus(1); - } - - preventDefault = true; - } - break; - - case DOM_VK_UP: - if (enableUpDown) { - moveFocus(-1); - preventDefault = true; - } - break; - - case DOM_VK_DOWN: - if (enableUpDown) { - if (getRole() == 'menuitem' && getParentRole() == 'menubar') { - action(); - } else if (getRole() == 'button' && getAriaProp('haspopup')) { - action(); - } else { - moveFocus(1); - } - - preventDefault = true; - } - break; - - case DOM_VK_TAB: - preventDefault = true; - - if (e.shiftKey) { - moveFocus(-1); - } else { - moveFocus(1); - } - break; - - case DOM_VK_ESCAPE: - preventDefault = true; - cancel(); - break; - - case DOM_VK_ENTER: - case DOM_VK_RETURN: - case DOM_VK_SPACE: - preventDefault = action(); - break; - } - - if (preventDefault) { - e.stopPropagation(); - e.preventDefault(); - } - }); - - // Init on focus in - root.on('focusin', function(e) { - initItems(); - focussedId = e.target.id; - }); - - return { - moveFocus: moveFocus, - focusFirst: focusFirst, - cancel: cancel - }; - }; -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/Label.js b/lib/tinymce/js/tinymce/classes/ui/Label.js deleted file mode 100644 index b5d76d4b..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/Label.js +++ /dev/null @@ -1,102 +0,0 @@ -/** - * Label.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-x-less Label.less - * @class tinymce.ui.Label - * @extends tinymce.ui.Control - */ -define("tinymce/ui/Label", [ - "tinymce/ui/Widget" -], function(Widget) { - "use strict"; - - return Widget.extend({ - init: function(settings) { - var self = this; - - self._super(settings); - self.addClass('widget'); - self.addClass('label'); - - if (settings.multiline) { - self.addClass('autoscroll'); - } - - if (settings.strong) { - self.addClass('strong'); - } - }, - - initLayoutRect: function() { - var self = this, layoutRect = self._super(); - - if (self.settings.multiline) { - // Check if the text fits within maxW if not then try word wrapping it - if (self.getEl().offsetWidth > 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, self.getEl().offsetHeight); - } - - return layoutRect; - }, - - disabled: function(state) { - var self = this, undef; - - if (state !== undef) { - self.toggleClass('label-disabled', state); - - if (self._rendered) { - self.getEl()[0].className = self.classes(); - } - } - - return self._super(state); - }, - - repaint: function() { - var self = this; - - if (!self.settings.multiline) { - self.getEl().style.lineHeight = self.layoutRect().h + 'px'; - } - - return self._super(); - }, - - text: function(text) { - var self = this; - - if (self._rendered && text) { - self.getEl().innerHTML = self.encode(text); - } - - return self._super(text); - }, - - /** - * ... - * - * @method render - */ - renderHtml: function() { - var self = this, forId = self.settings.forId; - - return ( - '' - ); - } - }); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/Layout.js b/lib/tinymce/js/tinymce/classes/ui/Layout.js deleted file mode 100644 index 44b8ea78..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/Layout.js +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Layout.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * 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' - }, - - init: function(settings) { - this.settings = Tools.extend({}, this.Defaults, settings); - }, - - preRender: function(container) { - container.addClass(this.settings.containerClass, 'body'); - }, - - 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); - }, - - 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; - }, - - recalc: function() { - }, - - postRender: function() { - } - }); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/ListBox.js b/lib/tinymce/js/tinymce/classes/ui/ListBox.js deleted file mode 100644 index 4eb6c25a..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/ListBox.js +++ /dev/null @@ -1,84 +0,0 @@ -/** - * ListBox.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-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({ - init: function(settings) { - var self = this, values, i, selected, selectedText; - - 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; - } - } - - settings.menu = values; - } - - settings.text = settings.text || selectedText || values[0].text; - - self._super(settings); - self.addClass('listbox'); - - self.on('select', function(e) { - if (settings.multiple) { - e.control.active(!e.control.active()); - } else { - self.value(e.control.settings.value); - } - }); - }, - - value: function(value) { - var self = this, active, selectedText, menu, i; - - if (typeof(value) != "undefined") { - if (self.menu) { - self.menu.items().each(function(ctrl) { - active = ctrl.value() === value; - - if (active) { - selectedText = selectedText || ctrl.text(); - } - - ctrl.active(active); - }); - } 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); - } - - return self._super(value); - } - }); -}); diff --git a/lib/tinymce/js/tinymce/classes/ui/Menu.js b/lib/tinymce/js/tinymce/classes/ui/Menu.js deleted file mode 100644 index e4f60c16..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/Menu.js +++ /dev/null @@ -1,99 +0,0 @@ -/** - * Menu.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-x-less Menu.less - * @class tinymce.ui.Menu - * @extends tinymce.ui.FloatPanel - */ -define("tinymce/ui/Menu", [ - "tinymce/ui/FloatPanel", - "tinymce/ui/KeyboardNavigation", - "tinymce/ui/MenuItem" -], function(FloatPanel, KeyboardNavigation, MenuItem) { - "use strict"; - - var Menu = FloatPanel.extend({ - Defaults: { - defaultType: 'menuitem', - border: 1, - layout: 'stack', - role: 'menu' - }, - - init: function(settings) { - var self = this; - - settings.autohide = true; - - self._super(settings); - self.addClass('menu'); - - self.keyNav = new KeyboardNavigation({ - root: self, - enableUpDown: true, - enableLeftRight: true, - - leftAction: function() { - if (self.parent() instanceof MenuItem) { - self.keyNav.cancel(); - } - }, - - onCancel: function() { - self.fire('cancel', {}, false); - self.hide(); - } - }); - }, - - repaint: function() { - this.toggleClass('menu-align', true); - - this._super(); - - this.getEl().style.height = ''; - this.getEl('body').style.height = ''; - - return this; - }, - - cancel: function() { - var self = this; - - self.hideAll(); - self.fire('cancel'); - self.fire('select'); - }, - - hideAll: function() { - var self = this; - - this.find('menuitem').exec('hideMenu'); - - return self._super(); - }, - - 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/lib/tinymce/js/tinymce/classes/ui/MenuBar.js b/lib/tinymce/js/tinymce/classes/ui/MenuBar.js deleted file mode 100644 index 6d666a2c..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/MenuBar.js +++ /dev/null @@ -1,28 +0,0 @@ -/** - * MenuBar.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-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', - defaults: { - type: 'menubutton' - } - } - }); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/MenuButton.js b/lib/tinymce/js/tinymce/classes/ui/MenuButton.js deleted file mode 100644 index fa0171b1..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/MenuButton.js +++ /dev/null @@ -1,183 +0,0 @@ -/** - * MenuButton.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-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({ - init: function(settings) { - var self = this; - - self._renderOpen = true; - self._super(settings); - - self.addClass('menubtn'); - - self.aria('haspopup', true); - self.hasPopup = true; - }, - - 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) { - if (e.control == self.menu) { - self.activeMenu(e.type == 'show'); - } - }).fire('show'); - - self.aria('expanded', true); - } - - self.menu.show(); - self.menu.layoutRect({w: self.layoutRect().w}); - self.menu.moveRel(self.getEl(), 'bl-tl'); - }, - - 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); - } - }, - - activeMenu: function(state) { - this.toggleClass('active', state); - }, - - 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 ( - '
    ' + - '' + - '
    ' - ); - }, - - postRender: function() { - var self = this; - - self.on('click', function(e) { - if (e.control === self && isChildOf(e.target, self.getEl())) { - self.showMenu(); - - if (e.keyboard) { - 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.showMenu(); - } - } - }); - - return self._super(); - }, - - text: function(text) { - var self = this, i, children; - - if (self._rendered) { - children = self.getEl('open').childNodes; - for (i = 0; i < children.length; i++) { - if (children[i].nodeType == 3) { - children[i].data = text; - } - } - } - - return this._super(text); - }, - - remove: function() { - this._super(); - - if (this.menu) { - this.menu.remove(); - } - } - }); - - return MenuButton; -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/MenuItem.js b/lib/tinymce/js/tinymce/classes/ui/MenuItem.js deleted file mode 100644 index 46c69a88..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/MenuItem.js +++ /dev/null @@ -1,198 +0,0 @@ -/** - * MenuItem.js - * - * Copyright 2003-2013, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-x-less MenuItem.less - * @class tinymce.ui.MenuItem - * @extends tinymce.ui.Control - */ -define("tinymce/ui/MenuItem", [ - "tinymce/ui/Widget", - "tinymce/ui/Factory" -], function(Widget, Factory) { - "use strict"; - - return Widget.extend({ - Defaults: { - border: 0, - role: 'menuitem' - }, - - 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 (self._text === '-' || self._text === '|') { - self.addClass('menu-item-sep'); - self.aria('role', 'separator'); - self.canFocus = false; - self._text = '-'; - } - - if (settings.selectable) { - self.aria('role', 'menuitemcheckbox'); - self.aria('checked', true); - self.addClass('menu-item-checkbox'); - settings.icon = 'selected'; - } - - self.on('mousedown', function(e) { - e.preventDefault(); - }); - - self.on('mouseenter click', function(e) { - if (e.control === self) { - if (!settings.menu && e.type === 'click') { - self.parent().hideAll(); - self.fire('cancel'); - self.fire('select'); - } else { - self.showMenu(); - - if (e.keyboard) { - setTimeout(function() { - self.menu.items()[0].focus(); - }, 0); - } - } - } - }); - - if (settings.menu) { - self.aria('haspopup', true); - } - }, - - hasMenus: function() { - return !!this.settings.menu; - }, - - showMenu: function() { - var self = this, settings = self.settings, menu; - - self.parent().items().each(function(ctrl) { - if (ctrl !== self) { - ctrl.hideMenu(); - } - }); - - if (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.menu.reflow(); - self.menu.fire('show'); - self.menu.on('cancel', function() { - self.focus(); - }); - - self.menu.on('hide', function(e) { - if (e.control === self.menu) { - self.removeClass('selected'); - } - }); - } else { - self.menu.show(); - } - - self.menu._parentMenu = self.parent(); - - self.menu.addClass('menu-sub'); - self.menu.moveRel(self.getEl(), 'tr-tl'); - self.addClass('selected'); - self.aria('expanded', true); - } - }, - - 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; - }, - - renderHtml: function() { - var self = this, id = self._id, settings = self.settings, prefix = self.classPrefix, text = self.encode(self._text); - var icon = self.settings.icon; - - if (icon) { - self.parent().addClass('menu-has-icons'); - } - - icon = prefix + 'ico ' + prefix + 'i-' + (self.settings.icon || 'none'); - - return ( - '
    ' + - (text !== '-' ? ' ' : '') + - (text !== '-' ? '' + text + '' : '') + - (settings.shortcut ? '
    ' + - settings.shortcut + '
    ' : '') + - (settings.menu ? '
    ' : '') + - '
    ' - ); - }, - - postRender: function() { - var self = this, settings = self.settings; - - var textStyle = settings.textStyle; - if (typeof(textStyle) == "function") { - textStyle = textStyle(); - } - - if (textStyle) { - var textElm = self.getEl('text'); - if (textElm) { - textElm.setAttribute('style', textStyle); - } - } - - return self._super(); - }, - - remove: function() { - this._super(); - - if (this.menu) { - this.menu.remove(); - } - } - }); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/MessageBox.js b/lib/tinymce/js/tinymce/classes/ui/MessageBox.js deleted file mode 100644 index 947876b7..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/MessageBox.js +++ /dev/null @@ -1,135 +0,0 @@ -/** - * MessageBox.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @class tinymce.ui.Window - * @extends tinymce.ui.FloatPanel - */ -define("tinymce/ui/MessageBox", [ - "tinymce/ui/Window" -], function(Window) { - "use strict"; - - var MessageBox = Window.extend({ - 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: 1, - OK_CANCEL: 2, - YES_NO: 3, - YES_NO_CANCEL: 4, - - 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(); - }} - ]; - 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, - items: { - type: "label", - multiline: true, - maxWidth: 500, - maxHeight: 200, - text: settings.text - }, - onClose: settings.onClose - }).renderTo(document.body).reflow(); - }, - - alert: function(settings, callback) { - if (typeof(settings) == "string") { - settings = {text: settings}; - } - - settings.callback = callback; - return MessageBox.msgBox(settings); - }, - - 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/lib/tinymce/js/tinymce/classes/ui/Movable.js b/lib/tinymce/js/tinymce/classes/ui/Movable.js deleted file mode 100644 index c1c37f25..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/Movable.js +++ /dev/null @@ -1,93 +0,0 @@ -/** - * Movable.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -define("tinymce/ui/Movable", [ - "tinymce/ui/DomUtils" -], function(DomUtils) { - "use strict"; - - return { - moveRel: function(elm, rel) { - var self = this, ctrlElm, pos, x, y, selfW, selfH, targetW, targetH; - - // Get pos of target - pos = DomUtils.getPos(elm); - x = pos.x; - y = pos.y; - - // Get size of self - ctrlElm = self.getEl(); - selfW = ctrlElm.offsetWidth; - selfH = ctrlElm.offsetHeight; - - // Get size of target - targetW = elm.offsetWidth; - targetH = elm.offsetHeight; - - // 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); - } - - self.moveTo(x, y); - - return self; - }, - - moveBy: function(dx, dy) { - var self = this, rect = self.layoutRect(); - - self.moveTo(rect.x + dx, rect.y + dy); - - return self; - }, - - moveTo: function(x, y) { - var self = this; - - if (self._rendered) { - self.layoutRect({x: x, y: y}).repaint(); - } else { - self.settings.x = x; - self.settings.y = y; - } - - return self; - } - }; -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/Panel.js b/lib/tinymce/js/tinymce/classes/ui/Panel.js deleted file mode 100644 index af4cd719..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/Panel.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - * Panel.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-x-less Panel.less - * @class tinymce.ui.Panel - * @extends tinymce.ui.Container - */ -define("tinymce/ui/Panel", [ - "tinymce/ui/Container", - "tinymce/ui/Scrollable" -], function(Container, Scrollable) { - "use strict"; - - var Panel = Container.extend({ - Defaults: { - layout: 'fit', - containerCls: 'panel' - }, - - Mixins: [Scrollable], - - fromJSON: function(data) { - var self = this; - - for (var name in data) { - self.find('#' + name).value(data[name]); - } - - return self; - }, - - 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; - }, - - 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(); - } - - self._hasBody = false; - } - - return ( - '
    ' + - (self._preBodyHtml || '') + - innerHtml + - '
    ' - ); - } - }); - - return Panel; -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/PanelButton.js b/lib/tinymce/js/tinymce/classes/ui/PanelButton.js deleted file mode 100644 index a7e7b2e6..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/PanelButton.js +++ /dev/null @@ -1,57 +0,0 @@ -/** - * MenuButton.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @class tinymce.ui.MenuButton - * @extends tinymce.ui.Button - */ -define("tinymce/ui/PanelButton", [ - "tinymce/ui/Button", - "tinymce/ui/FloatPanel" -], function(Button, FloatPanel) { - "use strict"; - - var PanelButton = Button.extend({ - showPanel: function() { - var self = this, settings = self.settings; - - settings.panel.popover = true; - self.active(true); - - if (!self.panel) { - self.panel = new FloatPanel(settings.panel).on('hide', function() { - self.active(false); - }).parent(self).renderTo(self.getContainerElm()).reflow().moveRel(self.getEl(), settings.popoverAlign || 'bc-tc'); - } else { - self.panel.show(); - } - }, - - hidePanel: function() { - var self = this; - - if (self.panel) { - self.panel.hide(); - } - }, - - postRender: function() { - var self = this; - - self.on('click', function(e) { - if (e.control === self) { - self.showPanel(); - } - }); - - return self._super(); - } - }); - - return PanelButton; -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/Path.js b/lib/tinymce/js/tinymce/classes/ui/Path.js deleted file mode 100644 index a5be054f..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/Path.js +++ /dev/null @@ -1,112 +0,0 @@ -/** - * Path.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-x-less Path.less - * @class tinymce.ui.Path - * @extends tinymce.ui.Control - */ -define("tinymce/ui/Path", [ - "tinymce/ui/Control", - "tinymce/ui/KeyboardNavigation" -], function(Control, KeyboardNavigation) { - "use strict"; - - return Control.extend({ - Defaults: { - delimiter: "\u00BB" - }, - - init: function(settings) { - var self = this; - - 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}); - } - }); - }, - - focus: function() { - var self = this; - - self.keyNav = new KeyboardNavigation({ - root: self, - enableLeftRight: true - }); - - self.keyNav.focusFirst(); - - return self; - }, - - data: function(data) { - var self = this; - - if (typeof(data) !== "undefined") { - self._data = data; - self.update(); - - return self; - } - - return self._data; - }, - - update: 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 + '
    ' - ); - } - - self.getEl().innerHTML = html; - }, - - postRender: function() { - var self = this; - - self._super(); - - self.data(self.settings.data); - }, - - repa2int: function() { - var self = this; - - self.getEl('text').style.lineHeight = self.layoutRect().h + 'px'; - - return self._super(); - }, - - /** - * ... - * - * @method render - */ - renderHtml: function() { - var self = this, prefix = self.classPrefix; - - return ( - '
    ' + - '
     
    ' + - '
    ' - ); - } - }); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/Radio.js b/lib/tinymce/js/tinymce/classes/ui/Radio.js deleted file mode 100644 index 84176a9e..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/Radio.js +++ /dev/null @@ -1,71 +0,0 @@ -/** - * Radio.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-x-less Radio.less - * @class tinymce.ui.Radio - * @extends tinymce.ui.Widget - */ -define("tinymce/ui/Radio", [ - "tinymce/ui/Widget" -], function(Widget) { - "use strict"; - - return Widget.extend({ - Defaults: { - classes: "radio", - checked: false - }, - - init: function(settings) { - var self = this; - - self._super(settings); - - self.on('click', function(e) { - e.preventDefault(); - - if (!self.disabled() && !self.checked()) { - self.parent().items().filter('radio:checked').exec('checked', false); - self.checked(true); - } - }); - - self.checked(settings.checked); - }, - - checked: function(state) { - var self = this; - - if (typeof state != "undefined") { - if (state) { - self.addClass('checked'); - } else { - self.removeClass('checked'); - } - - self._checked = state; - - return self; - } - - return self._checked; - }, - - renderHtml: function() { - var self = this, id = self._id, prefix = self.classPrefix; - - return ( - '' - ); - } - }); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/RadioGroup.js b/lib/tinymce/js/tinymce/classes/ui/RadioGroup.js deleted file mode 100644 index c47a2b8c..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/RadioGroup.js +++ /dev/null @@ -1,19 +0,0 @@ -/** - * RadioGroup.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @class tinymce.ui.RadioGroup - * @extends tinymce.ui.Container - */ -define("tinymce/ui/RadioGroup", [ - "tinymce/ui/Container" -], function(Container) { - "use strict"; - - return Container.extend({}); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/Resizable.js b/lib/tinymce/js/tinymce/classes/ui/Resizable.js deleted file mode 100644 index c80dd7ea..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/Resizable.js +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Resizable.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -define("tinymce/ui/Resizable", [ - "tinymce/ui/DomUtils" -], function(DomUtils) { - "use strict"; - - return { - resizeToContent: function() { - this._layoutRect.autoResize = true; - this._lastRect = null; - this.reflow(); - }, - - 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(); - }, - - 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/lib/tinymce/js/tinymce/classes/ui/ResizeHandle.js b/lib/tinymce/js/tinymce/classes/ui/ResizeHandle.js deleted file mode 100644 index 79187e29..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/ResizeHandle.js +++ /dev/null @@ -1,93 +0,0 @@ -/** - * ResizeHandle.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-x-less ResizeHandle.less - * @class tinymce.ui.ResizeHandle - * @extends tinymce.ui.Widget - */ -define("tinymce/ui/ResizeHandle", [ - "tinymce/ui/Widget", - "tinymce/ui/DragHelper", - "tinymce/ui/DomUtils" -], function(Widget, DragHelper, DomUtils) { - "use strict"; - - return Widget.extend({ - renderHtml: function() { - var self = this, prefix = self.classPrefix; - - self.addClass('resizehandle'); - - if (self.settings.both) { - self.addClass('resizehandle-both'); - } - - self.canFocus = false; - - return ( - '
    ' - ); - }, - - postRender: function() { - var self = this, iframeStartSize, editor = self.settings.editor; - - self._super(); - - function getSize(elm) { - return { - width: elm.clientWidth, - height: elm.clientHeight - }; - } - - function resizeIframe(width, height) { - var containerElm, iframeElm, containerSize, iframeSize, settings = editor.settings; - - containerElm = editor.getContainer(); - iframeElm = editor.getContentAreaContainer().firstChild; - containerSize = getSize(containerElm); - iframeSize = getSize(iframeElm); - - width = Math.max(settings.min_width || 100, width); - height = Math.max(settings.min_height || 100, height); - width = Math.min(settings.max_width || 0xFFFF, width); - height = Math.min(settings.max_height || 0xFFFF, height); - - if (self.settings.both) { - DomUtils.css(containerElm, 'width', width + (containerSize.width - iframeSize.width)); - } - - DomUtils.css(containerElm, 'height', height + (containerSize.height - iframeSize.height)); - - if (self.settings.both) { - DomUtils.css(iframeElm, 'width', width); - } - - DomUtils.css(iframeElm, 'height', height); - - editor.fire('ResizeEditor'); - } - - self.resizeDragHelper = new DragHelper(this._id, { - start: function() { - iframeStartSize = getSize(editor.getContentAreaContainer().firstChild); - }, - - drag: function(evt) { - resizeIframe(iframeStartSize.width + evt.deltaX, iframeStartSize.height + evt.deltaY); - }, - - end: function() { - } - }); - } - }); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/Scrollable.js b/lib/tinymce/js/tinymce/classes/ui/Scrollable.js deleted file mode 100644 index ec8e226d..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/Scrollable.js +++ /dev/null @@ -1,145 +0,0 @@ -/** - * Scrollable.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-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/lib/tinymce/js/tinymce/classes/ui/Selector.js b/lib/tinymce/js/tinymce/classes/ui/Selector.js deleted file mode 100644 index c29f039f..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/Selector.js +++ /dev/null @@ -1,356 +0,0 @@ -/** - * Selector.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * 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. - * - * 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", - "tinymce/util/Tools" -], function(Class, Tools) { - "use strict"; - - /** - * Produces an array with a unique set of objects. It will not compare the values - * but the references of the objects. - * - * @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 */ - var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, - whiteSpace = /^\s*|\s*$/g, - Collection; - - var Selector = Class.extend({ - /** - * Constructs a new Selector instance. - * - * @contructor - * @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 = Tools.inArray(item, siblings); - length = siblings.length; - } - - 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 expession like: panel toolbar [button] - if (index == selector.length - 1) { - matches.push(item); - } else { - // Collect next expession 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/lib/tinymce/js/tinymce/classes/ui/Spacer.js b/lib/tinymce/js/tinymce/classes/ui/Spacer.js deleted file mode 100644 index 3eb691a7..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/Spacer.js +++ /dev/null @@ -1,29 +0,0 @@ -/** - * Spacer.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-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({ - renderHtml: function() { - var self = this; - - self.addClass('spacer'); - self.canFocus = false; - - return '
    '; - } - }); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/SplitButton.js b/lib/tinymce/js/tinymce/classes/ui/SplitButton.js deleted file mode 100644 index fe73a254..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/SplitButton.js +++ /dev/null @@ -1,92 +0,0 @@ -/** - * SplitButton.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-x-less SplitButton.less - * @class tinymce.ui.SplitButton - * @extends tinymce.ui.Button - */ -define("tinymce/ui/SplitButton", [ - "tinymce/ui/MenuButton", - "tinymce/dom/DOMUtils" -], function(MenuButton, DomUtils) { - var DOM = DomUtils.DOM; - - return MenuButton.extend({ - Defaults: { - classes: "widget btn splitbtn", - role: "splitbutton" - }, - - repaint: function() { - var self = this, elm = self.getEl(), rect = self.layoutRect(), mainButtonElm, menuButtonElm, btnStyle; - - self._super(); - - mainButtonElm = elm.firstChild; - menuButtonElm = elm.lastChild; - - DOM.css(mainButtonElm, { - width: rect.w - menuButtonElm.offsetWidth, - height: rect.h - 2 - }); - - DOM.css(menuButtonElm, { - height: rect.h - 2 - }); - - btnStyle = mainButtonElm.firstChild.style; - btnStyle.width = btnStyle.height = "100%"; - - btnStyle = menuButtonElm.firstChild.style; - btnStyle.width = btnStyle.height = "100%"; - - return self; - }, - - activeMenu: function(state) { - var self = this; - - DOM.toggleClass(self.getEl().lastChild, self.classPrefix + 'active', state); - }, - - renderHtml: function() { - var self = this, id = self._id, prefix = self.classPrefix; - var icon = self.settings.icon ? prefix + 'ico ' + prefix + 'i-' + self.settings.icon : ''; - - return ( - '
    ' + - '' + - '' + - '
    ' - ); - }, - - postRender: function() { - var self = this, onClickHandler = self.settings.onclick; - - self.on('click', function(e) { - if (e.control == this && !DOM.getParent(e.target, '.' + this.classPrefix + 'open')) { - e.stopImmediatePropagation(); - onClickHandler.call(this, e); - } - }); - - delete self.settings.onclick; - - return self._super(); - } - }); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/StackLayout.js b/lib/tinymce/js/tinymce/classes/ui/StackLayout.js deleted file mode 100644 index 4e81e57f..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/StackLayout.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * StackLayout.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-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/lib/tinymce/js/tinymce/classes/ui/TabPanel.js b/lib/tinymce/js/tinymce/classes/ui/TabPanel.js deleted file mode 100644 index 6fdf1697..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/TabPanel.js +++ /dev/null @@ -1,135 +0,0 @@ -/** - * TabPanel.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-x-less TabPanel.less - * @class tinymce.ui.TabPanel - * @extends tinymce.ui.Panel - */ -define("tinymce/ui/TabPanel", [ - "tinymce/ui/Panel", - "tinymce/ui/DomUtils" -], function(Panel, DomUtils) { - "use stict"; - - return Panel.extend({ - lastIdx: 0, - - Defaults: { - layout: 'absolute', - defaults: { - type: 'panel' - } - }, - - activateTab: function(idx) { - if (this.activeTabId) { - DomUtils.removeClass(this.getEl(this.activeTabId), this.classPrefix + 'active'); - } - - this.activeTabId = 't' + idx; - - DomUtils.addClass(this.getEl('t' + idx), this.classPrefix + 'active'); - - if (idx != this.lastIdx) { - this.items()[this.lastIdx].hide(); - this.lastIdx = idx; - } - - this.items()[idx].show().fire('showtab'); - this.reflow(); - }, - - renderHtml: function() { - var self = this, layout = self._layout, tabsHtml = '', prefix = self.classPrefix; - - self.preRender(); - layout.preRender(self); - - self.items().each(function(ctrl, i) { - tabsHtml += ( - '
    ' + - ctrl.settings.title + - '
    ' - ); - }); - - return ( - '
    ' + - '
    ' + - tabsHtml + - '
    ' + - '
    ' + - layout.renderHtml(self) + - '
    ' + - '
    ' - ); - }, - - 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); - } - } - } - }); - }, - - initLayoutRect: function() { - var self = this, rect, minW, minH; - - 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 = self.getEl('head').offsetHeight; - - self.settings.minWidth = minW; - self.settings.minHeight = minH + headH; - - rect = self._super(); - rect.deltaH += self.getEl('head').offsetHeight; - rect.innerH = rect.h - rect.deltaH; - - return rect; - } - }); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/TextBox.js b/lib/tinymce/js/tinymce/classes/ui/TextBox.js deleted file mode 100644 index dd55c56c..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/TextBox.js +++ /dev/null @@ -1,150 +0,0 @@ -/** - * TextBox.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-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({ - 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.submit) { - ctrl.submit(); - return false; - } - }); - } - }); - } - }, - - 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; - }, - - repaint: function() { - var self = this, style, rect, borderBox, borderW = 0, borderH = 0, lastRepaintRect; - - style = self.getEl().style; - rect = self._layoutRect; - lastRepaintRect = self._lastRepaintRect || {}; - - 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; - } - - /*if (!self.settings.multiline) { - //style.lineHeight = (rect.h - borderH) + 'px'; - }*/ - - self._lastRepaintRect = lastRepaintRect; - self.fire('repaint', {}, false); - - return self; - }, - - 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 (settings.multiline) { - return ( - '' - ); - } - - return ''; - }, - - postRender: function() { - var self = this; - - DomUtils.on(self.getEl(), 'change', function(e) { - self.fire('change', e); - }); - - return self._super(); - } - }); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/Throbber.js b/lib/tinymce/js/tinymce/classes/ui/Throbber.js deleted file mode 100644 index f58acb1b..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/Throbber.js +++ /dev/null @@ -1,47 +0,0 @@ -/** - * Throbber.js - * - * Copyright 2003-2013, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-x-less Throbber.less - * @class tinymce.ui.Throbber - */ -define("tinymce/ui/Throbber", [ - "tinymce/ui/DomUtils" -], function(DomUtils) { - "use strict"; - - return function(elm) { - var self = this, state; - - self.show = function(time) { - self.hide(); - - state = true; - - window.setTimeout(function() { - if (state) { - elm.appendChild(DomUtils.createFragment('
    ')); - } - }, time || 0); - - return self; - }, - - 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/lib/tinymce/js/tinymce/classes/ui/Toolbar.js b/lib/tinymce/js/tinymce/classes/ui/Toolbar.js deleted file mode 100644 index 98846003..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/Toolbar.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * Toolbar.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @class tinymce.ui.Toolbar - * @extends tinymce.ui.Container - */ -define("tinymce/ui/Toolbar", [ - "tinymce/ui/Container", - "tinymce/ui/KeyboardNavigation" -], function(Container, KeyboardNavigation) { - "use strict"; - - return Container.extend({ - Defaults: { - role: 'toolbar', - layout: 'flow' - }, - - init: function(settings) { - var self = this; - - self._super(settings); - self.addClass('toolbar'); - }, - - postRender: function() { - var self = this; - - self.items().addClass('toolbar-item'); - - self.keyNav = new KeyboardNavigation({ - root: self, - enableLeftRight: true - }); - - return self._super(); - } - }); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/Tooltip.js b/lib/tinymce/js/tinymce/classes/ui/Tooltip.js deleted file mode 100644 index 8038d3ae..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/Tooltip.js +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Tooltip.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-x-less ToolTip.less - * @class tinymce.ui.ToolTip - * @extends tinymce.ui.Control - */ -define("tinymce/ui/Tooltip", [ - "tinymce/ui/Control", - "tinymce/ui/Movable" -], function(Control, Movable) { - return Control.extend({ - Mixins: [Movable], - - Defaults: { - classes: 'widget tooltip tooltip-n' - }, - - 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; - }, - - renderHtml: function() { - var self = this, prefix = self.classPrefix; - - return ( - '' - ); - }, - - 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/lib/tinymce/js/tinymce/classes/ui/Widget.js b/lib/tinymce/js/tinymce/classes/ui/Widget.js deleted file mode 100644 index 80782ac1..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/Widget.js +++ /dev/null @@ -1,99 +0,0 @@ -/** - * Widget.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * - * @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; - - return Control.extend({ - init: function(settings) { - var self = this; - - self._super(settings); - self.canFocus = true; - - if (settings.tooltip) { - self.on('mouseenter mouseleave', function(e) { - if (e.control == self && e.type == 'mouseenter') { - self.tooltip().moveTo(-0xFFFF).text(settings.tooltip).show().moveRel(self.getEl(), 'bc tc'); - } else { - self.tooltip().moveTo(-0xFFFF).hide(); - } - }); - } - - self.aria('label', settings.tooltip); - }, - - tooltip: function() { - var self = this; - - if (!tooltip) { - tooltip = new Tooltip({type: 'tooltip'}); - tooltip.renderTo(self.getContainerElm()); - } - - return tooltip; - }, - - active: function(state) { - var self = this, undef; - - if (state !== undef) { - self.aria('pressed', state); - self.toggleClass('active', state); - } - - return self._super(state); - }, - - disabled: function(state) { - var self = this, undef; - - if (state !== undef) { - self.aria('disabled', state); - self.toggleClass('disabled', state); - } - - return self._super(state); - }, - - 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(); - } - }, - - remove: function() { - this._super(); - - if (tooltip) { - tooltip.remove(); - tooltip = null; - } - } - }); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/ui/Window.js b/lib/tinymce/js/tinymce/classes/ui/Window.js deleted file mode 100644 index 483bfe3b..00000000 --- a/lib/tinymce/js/tinymce/classes/ui/Window.js +++ /dev/null @@ -1,384 +0,0 @@ -/** - * Window.js - * - * Copyright 2003-2012, Moxiecode Systems AB, All rights reserved. - */ - -/** - * .. - * - * @-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/KeyboardNavigation", - "tinymce/ui/DragHelper" -], function(FloatPanel, Panel, DomUtils, KeyboardNavigation, 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(); - } - } - }, - - init: function(settings) { - var self = this; - - self._super(settings); - - self.addClass('window'); - - // Create statusbar - if (settings.buttons) { - self.statusbar = new Panel({ - layout: 'flex', - border: '1 0 0 0', - spacing: 3, - padding: 10, - align: 'center', - pack: '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('postrender show', function(e) { - if (e.control == self) { - var parentWin = getTopMostWindow(), zIndex = FloatPanel.zIndex; - - if (parentWin) { - zIndex = parentWin.zIndex; - } - - if (!DomUtils.get(prefix + 'modal-block')) { - var modalBlockEl = DomUtils.createFragment('
    '); - - modalBlockEl = modalBlockEl.firstChild; - - self.getContainerElm().appendChild(modalBlockEl); - - setTimeout(function() { - DomUtils.addClass(modalBlockEl, prefix + 'in'); - DomUtils.addClass(self.getEl(), prefix + 'in'); - }, 0); - - FloatPanel.zOrder.push({zIndex: zIndex}); - DomUtils.css(self.getEl(), 'z-index', zIndex + 1); - } - - DomUtils.css(DomUtils.get(prefix + 'modal-block'), 'z-index', zIndex - 1); - } - }); - - self.on('close hide', function(e) { - if (e.control == self) { - var topWin = getTopMostWindow(); - - if (!topWin) { - var modalBlockEl = document.getElementById(prefix + 'modal-block'); - if (modalBlockEl) { - modalBlockEl.parentNode.removeChild(modalBlockEl); - } - } else { - DomUtils.css(DomUtils.get(prefix + 'modal-block'), 'z-index', topWin.zIndex - 1); - } - } - }); -*/ - self.aria('label', settings.title); - self._fullscreen = false; - }, - - recalc: function() { - var self = this, statusbar = self.statusbar, layoutRect, width, 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.minW) { - layoutRect.minW = layoutRect.w = width + (layoutRect.w - layoutRect.innerW); - layoutRect.innerW = layoutRect.w - layoutRect.deltaW; - 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.minW) { - layoutRect.minW = layoutRect.w = width; - layoutRect.innerW = layoutRect.w - layoutRect.deltaW; - needsRecalc = true; - } - } - - // Recalc body and disable auto resize - if (needsRecalc) { - self.recalc(); - return; - } - }, - - 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'); - layoutRect.headerW = headEl.offsetWidth; - layoutRect.headerH = headEl.offsetHeight; - 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; - }, - - 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 = ( - '
    ' + - '
    ' + 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 + - '
    ' - ); - }, - - 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(); - }, - - postRender: function() { - var self = this, items = [], focusCtrl, autoFocusFound, startPos; - - setTimeout(function() { - self.addClass('in'); - }, 0); - - self.find('*').each(function(ctrl) { - if (ctrl.canFocus) { - autoFocusFound = autoFocusFound || ctrl.settings.autofocus; - focusCtrl = focusCtrl || ctrl; - - // TODO: Figure out a better way - if (ctrl.type == 'filepicker') { - items.push(ctrl.getEl('inp')); - - if (ctrl.getEl('open')) { - items.push(ctrl.getEl('open').firstChild); - } - } else { - items.push(ctrl.getEl()); - } - } - }); - - if (self.statusbar) { - self.statusbar.find('*').each(function(ctrl) { - if (ctrl.canFocus) { - autoFocusFound = autoFocusFound || ctrl.settings.autofocus; - focusCtrl = focusCtrl || ctrl; - items.push(ctrl.getEl()); - } - }); - } - - self.keyboardNavigation = new KeyboardNavigation({ - root: self, - enableLeftRight: false, - enableUpDown: false, - items: items, - onCancel: function() { - self.close(); - } - }); - - self._super(); - - if (self.statusbar) { - self.statusbar.postRender(); - } - - if (!autoFocusFound && focusCtrl) { - focusCtrl.focus(); - } - - this.dragHelger = 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(); - } - }); - }, - - submit: function() { - return this.fire('submit', {data: this.toJSON()}); - }, - - remove: function() { - var self = this; - - self._super(); - self.dragHelger.destroy(); - - if (self.statusbar) { - this.statusbar.remove(); - } - } - }); - - return Window; -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/util/Class.js b/lib/tinymce/js/tinymce/classes/util/Class.js deleted file mode 100644 index 223e3f41..00000000 --- a/lib/tinymce/js/tinymce/classes/util/Class.js +++ /dev/null @@ -1,165 +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; - - // All construction is actually done in the init method - if (!initializing) { - self = this; - - // 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/lib/tinymce/js/tinymce/classes/util/JSON.js b/lib/tinymce/js/tinymce/classes/util/JSON.js deleted file mode 100644 index 621369e4..00000000 --- a/lib/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 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/lib/tinymce/js/tinymce/classes/util/JSONP.js b/lib/tinymce/js/tinymce/classes/util/JSONP.js deleted file mode 100644 index 3c0bf67d..00000000 --- a/lib/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/lib/tinymce/js/tinymce/classes/util/JSONRequest.js b/lib/tinymce/js/tinymce/classes/util/JSONRequest.js deleted file mode 100644 index 44d3e88f..00000000 --- a/lib/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/lib/tinymce/js/tinymce/classes/util/LocalStorage.js b/lib/tinymce/js/tinymce/classes/util/LocalStorage.js deleted file mode 100644 index e169555e..00000000 --- a/lib/tinymce/js/tinymce/classes/util/LocalStorage.js +++ /dev/null @@ -1,175 +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; - - // Check for native support - if (window.localStorage) { - return localStorage; - } - - userDataKey = "tinymce"; - storageElm = document.documentElement; - 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 = {}; - - 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 { - key = next(parseInt(next(), 32) || 0); - if (key !== null) { - value = next(parseInt(next(), 32) || 0); - items[key] = value; - } - } while (key !== null); - - updateKeys(); - } - - /** - * Saves the items structure into a the userData format. - */ - function save() { - var value, data = ''; - - for (var key in items) { - value = items[key]; - data += (data ? ',' : '') + key.length.toString(32) + ',' + key + ',' + value.length.toString(32) + ',' + value; - } - - storageElm.setAttribute(userDataKey, data); - storageElm.save(userDataKey); - updateKeys(); - } - - LocalStorage = { - /** - * Length of the number of items in storage. - * - * @property length - * @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/lib/tinymce/js/tinymce/classes/util/Observable.js b/lib/tinymce/js/tinymce/classes/util/Observable.js deleted file mode 100644 index 2dad4d81..00000000 --- a/lib/tinymce/js/tinymce/classes/util/Observable.js +++ /dev/null @@ -1,188 +0,0 @@ -/** - * Observable.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -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" + - " mouseout mouseenter mouseleave keydown keypress keyup contextmenu dragend dragover draggesture dragdrop drop drag", ' ' - ); - - function returnFalse() { - return false; - } - - function returnTrue() { - return true; - } - - return { - fire: function(name, args, bubble) { - var self = this, handlers, i, l, callback, parent; - - 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; - }, - - on: function(name, callback) { - 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); - } - } - - handlers.push(callback); - } - } - - return self; - }, - - 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; - } - }; -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/util/Quirks.js b/lib/tinymce/js/tinymce/classes/util/Quirks.js deleted file mode 100644 index 4a43a8ee..00000000 --- a/lib/tinymce/js/tinymce/classes/util/Quirks.js +++ /dev/null @@ -1,932 +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 file includes fixes for various browser quirks it's made to make it easy to add/remove browser specific fixes. - * - * @class tinymce.util.Quirks - * @private - */ -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. - * - * @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 code is a bit of a hack and hopefully it will be fixed soon in WebKit. - */ - function cleanupStylesWhenDeleting() { - function removeMergedFormatSpans(isDelete) { - var rng, blockElm, wrapperElm, bookmark, container, offset, elm; - - function isAtStartOrEndOfElm() { - if (container.nodeType == 3) { - if (isDelete && offset == container.length) { - return true; - } - - if (!isDelete && offset === 0) { - return true; - } - } - } - - rng = selection.getRng(); - var tmpRng = [rng.startContainer, rng.startOffset, rng.endContainer, rng.endOffset]; - - if (!rng.collapsed) { - isDelete = true; - } - - container = rng[(isDelete ? 'start' : 'end') + 'Container']; - offset = rng[(isDelete ? 'start' : 'end') + 'Offset']; - - if (container.nodeType == 3) { - blockElm = dom.getParent(rng.startContainer, dom.isBlock); - - // On delete clone the root span of the next block element - if (isDelete) { - blockElm = dom.getNext(blockElm, dom.isBlock); - } - - if (blockElm && (isAtStartOrEndOfElm() || !rng.collapsed)) { - // Wrap children of block in a EM and let WebKit stick is - // runtime styles junk into that EM - wrapperElm = dom.create('em', {'id': '__mceDel'}); - - each(Tools.grep(blockElm.childNodes), function(node) { - wrapperElm.appendChild(node); - }); - - blockElm.appendChild(wrapperElm); - } - } - - // Do the backspace/delete action - rng = dom.createRng(); - rng.setStart(tmpRng[0], tmpRng[1]); - rng.setEnd(tmpRng[2], tmpRng[3]); - selection.setRng(rng); - editor.getDoc().execCommand(isDelete ? 'ForwardDelete' : 'Delete', false, null); - - // Remove temp wrapper element - if (wrapperElm) { - bookmark = selection.getBookmark(); - - while ((elm = dom.get('__mceDel'))) { - dom.remove(elm, true); - } - - selection.moveToBookmark(bookmark); - } - } - - editor.on('keydown', function(e) { - var isDelete; - - isDelete = e.keyCode == DELETE; - if (!isDefaultPrevented(e) && (isDelete || e.keyCode == BACKSPACE) && !VK.modifierPressed(e)) { - e.preventDefault(); - removeMergedFormatSpans(isDelete); - } - }); - - editor.addCommand('Delete', function() {removeMergedFormatSpans();}); - } - - /** - * 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) { - 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; - - // Empty the editor if it's needed for example backspace at

    |

    - if (!isDefaultPrevented(e) && (keyCode == DELETE || keyCode == BACKSPACE)) { - isCollapsed = editor.selection.isCollapsed(); - - // Selection is collapsed but the editor isn't empty - if (isCollapsed && !dom.isEmpty(editor.getBody())) { - return; - } - - // IE deletes all contents correctly when everything is selected - if (isIE && !isCollapsed) { - 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(''); - editor.selection.setCursorLocation(editor.getBody(), 0); - editor.nodeChanged(); - } - }); - } - - /** - * WebKit doesn't select all the nodes in the body when you press Ctrl+A. - * 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.getWin().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 - */ - 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 (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, 'mceItemAnchor')) { - 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 removeStylesWhenDeletingAccrossBlockElements() { - 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() { - 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', ''); - } - } - }); - } - - /** - * Backspace or delete on WebKit will combine all visual styles in a span if the last character is deleted. - * - * For example backspace on: - *

    x|

    - * - * Will produce: - *

    |

    - * - * When it should produce: - *

    |

    - * - * See: https://bugs.webkit.org/show_bug.cgi?id=81656 - */ - function keepInlineElementOnDeleteBackspace() { - editor.on('keydown', function(e) { - var isDelete, rng, container, offset, brElm, sibling, collapsed, nonEmptyElements; - - isDelete = e.keyCode == DELETE; - if (!isDefaultPrevented(e) && (isDelete || e.keyCode == BACKSPACE) && !VK.modifierPressed(e)) { - rng = selection.getRng(); - container = rng.startContainer; - offset = rng.startOffset; - collapsed = rng.collapsed; - - // Override delete if the start container is a text node and is at the beginning of text or - // just before/after the last character to be deleted in collapsed mode - if (container.nodeType == 3 && container.nodeValue.length > 0 && ((offset === 0 && !collapsed) || - (collapsed && offset === (isDelete ? 0 : 1)))) { - // Edge case when deleting

    |x

    - sibling = container.previousSibling; - if (sibling && sibling.nodeName == "IMG") { - return; - } - - nonEmptyElements = editor.schema.getNonEmptyElements(); - - // Prevent default logic since it's broken - e.preventDefault(); - - // Insert a BR before the text node this will prevent the containing element from being deleted/converted - brElm = dom.create('br', {id: '__tmp'}); - container.parentNode.insertBefore(brElm, container); - - // Do the browser delete - editor.getDoc().execCommand(isDelete ? 'ForwardDelete' : 'Delete', false, null); - - // Check if the previous sibling is empty after deleting for example:

    |

    - container = selection.getRng().startContainer; - sibling = container.previousSibling; - if (sibling && sibling.nodeType == 1 && !dom.isBlock(sibling) && dom.isEmpty(sibling) && - !nonEmptyElements[sibling.nodeName.toLowerCase()]) { - dom.remove(sibling); - } - - // Remove the temp element we inserted - dom.remove('__tmp'); - } - } - }); - } - - /** - * 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.win.focus(); - startRng.select(); - } - } - }); - } - - /** - * Fixes selection issues on Gecko 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', function(e) { - if (e.keyCode != 65 || !VK.metaKeyPressed(e)) { - selection.normalize(); - } - }); - } - - // All browsers - disableBackspaceIntoATable(); - removeBlockQuoteOnBackSpace(); - emptyEditorWhenDeleting(); - normalizeSelection(); - - // WebKit - if (isWebKit) { - keepInlineElementOnDeleteBackspace(); - cleanupStylesWhenDeleting(); - inputMethodFocus(); - selectControlElements(); - setDefaultBlockType(); - - // iOS - if (Env.iOS) { - selectionChangeNodeChanged(); - } else { - selectAll(); - } - } - - // IE - if (isIE) { - removeHrOnBackspace(); - ensureBodyHasRoleApplication(); - addNewLinesBeforeBrInPre(); - removePreSerializedStylesWhenSelectingControls(); - deleteControlItemOnBackSpace(); - renderEmptyBlocksFix(); - keepNoScriptContents(); - fixCaretSelectionOfDocumentElementOnIe(); - } - - // Gecko - if (isGecko) { - removeHrOnBackspace(); - focusBody(); - removeStylesWhenDeletingAccrossBlockElements(); - setGeckoEditingOptions(); - addBrAfterLastLinks(); - removeGhostSelection(); - } - }; -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/classes/util/Tools.js b/lib/tinymce/js/tinymce/classes/util/Tools.js deleted file mode 100644 index 66b6b4b6..00000000 --- a/lib/tinymce/js/tinymce/classes/util/Tools.js +++ /dev/null @@ -1,496 +0,0 @@ -/** - * Quirks.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -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; - var trim = function(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 t = 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 = t.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]; - t.extend(ns[cn].prototype, p); - - // Extend - if (s[5]) { - sp = t.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 - t.each(sp, function(f, n) { - ns[cn].prototype[n] = sp[n]; - }); - - // Add overridden methods - t.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*/ - t.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= 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 + '://'; - } - - 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/lib/tinymce/js/tinymce/classes/util/VK.js b/lib/tinymce/js/tinymce/classes/util/VK.js deleted file mode 100644 index 94b868c9..00000000 --- a/lib/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/lib/tinymce/js/tinymce/classes/util/XHR.js b/lib/tinymce/js/tinymce/classes/util/XHR.js deleted file mode 100644 index 7b87fbc4..00000000 --- a/lib/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/lib/tinymce/js/tinymce/jquery.tinymce.min.js b/lib/tinymce/js/tinymce/jquery.tinymce.min.js index cfed3a4e..5a6ef56a 100644 --- a/lib/tinymce/js/tinymce/jquery.tinymce.min.js +++ b/lib/tinymce/js/tinymce/jquery.tinymce.min.js @@ -1 +1,91 @@ -(function(t){function e(){function e(t){"remove"===t&&this.each(function(t,e){var n=r(e);n&&n.remove()}),this.find("span.mceEditor,div.mceEditor").each(function(t,e){var n=tinymce.get(e.id.replace(/_parent$/,""));n&&n.remove()})}function i(t){var i,r=this;if(t!==n)e.call(r),r.each(function(e,n){var i;(i=tinymce.get(n.id))&&i.setContent(t)});else if(r.length>0&&(i=tinymce.get(r[0].id)))return i.getContent()}function r(t){var e=null;return t&&t.id&&a.tinymce&&(e=tinymce.get(t.id)),e}function c(t){return!!(t&&t.length&&a.tinymce&&t.is(":tinymce"))}var u={};t.each(["text","html","val"],function(e,a){var o=u[a]=t.fn[a],s="text"===a;t.fn[a]=function(e){var a=this;if(!c(a))return o.apply(a,arguments);if(e!==n)return i.call(a.filter(":tinymce"),e),o.apply(a.not(":tinymce"),arguments),a;var u="",l=arguments;return(s?a:a.eq(0)).each(function(e,n){var i=r(n);u+=i?s?i.getContent().replace(/<(?:"[^"]*"|'[^']*'|[^'">])*>/g,""):i.getContent({save:!0}):o.apply(t(n),l)}),u}}),t.each(["append","prepend"],function(e,i){var a=u[i]=t.fn[i],o="prepend"===i;t.fn[i]=function(t){var e=this;return c(e)?t!==n?(e.filter(":tinymce").each(function(e,n){var i=r(n);i&&i.setContent(o?t+i.getContent():i.getContent()+t)}),a.apply(e.not(":tinymce"),arguments),e):void 0:a.apply(e,arguments)}}),t.each(["remove","replaceWith","replaceAll","empty"],function(n,i){var r=u[i]=t.fn[i];t.fn[i]=function(){return e.call(this,i),r.apply(this,arguments)}}),u.attr=t.fn.attr,t.fn.attr=function(e,a){var o=this,s=arguments;if(!e||"value"!==e||!c(o))return a!==n?u.attr.apply(o,s):u.attr.apply(o,s);if(a!==n)return i.call(o.filter(":tinymce"),a),u.attr.apply(o.not(":tinymce"),s),o;var l=o[0],p=r(l);return p?p.getContent({save:!0}):u.attr.apply(t(l),s)}}var n,i,r=[],a=window;t.fn.tinymce=function(n){function c(){var i=[],r=0;e&&(e(),e=null),l.each(function(t,e){var a,c=e.id,u=n.oninit;c||(e.id=c=tinymce.DOM.uniqueId()),a=new tinymce.Editor(c,n,tinymce.EditorManager),i.push(a),a.on("init",function(){var t,e=u;l.css("visibility",""),u&&++r==i.length&&("string"==typeof e&&(t=-1===e.indexOf(".")?null:tinymce.resolve(e.replace(/\.\w+$/,"")),e=tinymce.resolve(e)),e.apply(t||tinymce,i))})}),t.each(i,function(t,e){e.render()})}var u,o,s,l=this,p="";if(!l.length)return l;if(!n)return tinymce.get(l[0].id);if(l.css("visibility","hidden"),a.tinymce||i||!(u=n.script_url))1===i?r.push(c):c();else{i=1,o=u.substring(0,u.lastIndexOf("/")),-1!=u.indexOf(".min")&&(p=".min"),a.tinymce=a.tinyMCEPreInit||{base:o,suffix:p},-1!=u.indexOf("gzip")&&(s=n.language||"en",u=u+(/\?/.test(u)?"&":"?")+"js=true&core=true&suffix="+escape(p)+"&themes="+escape(n.theme)+"&plugins="+escape(n.plugins)+"&languages="+s,a.tinyMCE_GZ||(a.tinyMCE_GZ={start:function(){function e(t){tinymce.ScriptLoader.markDone(tinymce.baseURI.toAbsolute(t))}e("langs/"+s+".js"),e("themes/"+n.theme+"/theme"+p+".js"),e("themes/"+n.theme+"/langs/"+s+".js"),t.each(n.plugins.split(","),function(t,n){n&&(e("plugins/"+n+"/plugin"+p+".js"),e("plugins/"+n+"/langs/"+s+".js"))})},end:function(){}}));var f=document.createElement("script");f.type="text/javascript",f.onload=f.onreadystatechange=function(e){e=e||event,("load"==e.type||/complete|loaded/.test(f.readyState))&&(tinymce.dom.Event.domLoaded=1,i=2,n.script_loaded&&n.script_loaded(),c(),t.each(r,function(t,e){e()}))},f.src=u,document.body.appendChild(f)}return l},t.extend(t.expr[":"],{tinymce:function(t){return!!(t.id&&"tinymce"in window&&tinymce.get(t.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,p,d,s=[];d="undefined"!=typeof global?global:window,p=d.jQuery;function v(){ +// Reference to tinymce needs to be lazily evaluated since tinymce +// might be loaded through the compressor or other means +return d.tinymce}p.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");function n(){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 +p.each(a,function(e,t){t.render()})} +// Load TinyMCE on demand, if we need to +if(d.tinymce||c||!(e=o.script_url)) +// Delay the init call until tinymce is loaded +1===c?s.push(n):n();else{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 +d.tinymce=d.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 +d.tinyMCE_GZ||(d.tinyMCE_GZ={start:function(){function n(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 +p.each(o.plugins.split(","),function(e,t){t&&(n("plugins/"+t+"/plugin"+r+".js"),n("plugins/"+t+"/langs/"+i+".js"))})},end:function(){}}));var a=document.createElement("script");a.type="text/javascript",a.onload=a.onreadystatechange=function(e){e=e||window.event,2===c||"load"!=e.type&&!/complete|loaded/.test(a.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(),n(),p.each(s,function(e,t){t()}))},a.src=e,document.body.appendChild(a)}return 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. +p.extend(p.expr[":"],{tinymce:function(e){var t;return!!(e.id&&"tinymce"in d&&(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(){function r(e){ +// If the function is remove +"remove"===e&&this.each(function(e,t){var n=u(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()})}function o(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(p(t),r)}),i}}), +// Makes it possible to use $('#id').append("content"); to append contents to the TinyMCE editor iframe +p.each(["append","prepend"],function(e,t){var n=s[t]=p.fn[t],r="prepend"===t;p.fn[t]=function(i){var e=this;return l(e)?i!==f?("string"==typeof i&&e.filter(":tinymce").each(function(e,t){var n=u(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 +p.each(["remove","replaceWith","replaceAll","empty"],function(e,t){var n=s[t]=p.fn[t];p.fn[t]=function(){return r.call(this,t),n.apply(this,arguments)}}),s.attr=p.fn.attr, +// Makes sure that $('#tinymce_id').attr('value') gets the editors current HTML contents +p.fn.attr=function(e,t){var n=this,i=arguments;if(!e||"value"!==e||!l(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=u(r);return a?a.getContent({save:!0}):s.attr.apply(p(r),i)}}}(); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/langs/readme.md b/lib/tinymce/js/tinymce/langs/readme.md index 403563ca..a52bf03f 100644 --- a/lib/tinymce/js/tinymce/langs/readme.md +++ b/lib/tinymce/js/tinymce/langs/readme.md @@ -1 +1,3 @@ -This is where language files should be placed. \ No newline at end of file +This is where language files should be placed. + +Please DO NOT translate these directly use this service: https://www.transifex.com/projects/p/tinymce/ diff --git a/lib/tinymce/js/tinymce/license.txt b/lib/tinymce/js/tinymce/license.txt index 1837b0ac..b17fc904 100644 --- a/lib/tinymce/js/tinymce/license.txt +++ b/lib/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/lib/tinymce/js/tinymce/plugins/advlist/plugin.js b/lib/tinymce/js/tinymce/plugins/advlist/plugin.js index 665f9aa6..e45e8215 100644 --- a/lib/tinymce/js/tinymce/plugins/advlist/plugin.js +++ b/lib/tinymce/js/tinymce/plugins/advlist/plugin.js @@ -1,93 +1,297 @@ /** - * 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.1.6 (2020-01-28) */ +(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 global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); - function applyListFormat(listName, styleValue) { - var list, dom = editor.dom, sel = editor.selection; + var applyListFormat = function (editor, listName, styleValue) { + var cmd = listName === 'UL' ? 'InsertUnorderedList' : 'InsertOrderedList'; + editor.execCommand(cmd, false, styleValue === false ? null : { 'list-style-type': styleValue }); + }; + var Actions = { applyListFormat: applyListFormat }; - // Check for existing list element - list = dom.getParent(sel.getNode(), 'ol,ul'); + var register = function (editor) { + editor.addCommand('ApplyUnorderedListStyle', function (ui, value) { + Actions.applyListFormat(editor, 'UL', value['list-style-type']); + }); + editor.addCommand('ApplyOrderedListStyle', function (ui, value) { + Actions.applyListFormat(editor, 'OL', value['list-style-type']); + }); + }; + var Commands = { register: register }; - // 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(/[ ,]/) : []; + }; + var Settings = { + getNumberStyles: getNumberStyles, + getBulletStyles: getBulletStyles + }; - // 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()') + }; + if (Object.freeze) { + Object.freeze(me); + } + 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 Option = { + 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 Option.from(style); + }; + var ListUtils = { + isTableCellNode: isTableCellNode, + isListNode: isListNode, + getSelectedStyleType: getSelectedStyleType + }; - 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, ListUtils.isTableCellNode); + var parents = tableCellIndex !== -1 ? e.parents.slice(0, tableCellIndex) : e.parents; + var lists = global$1.grep(parents, ListUtils.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) { + Actions.applyListFormat(editor, nodeName, value); + }, + select: function (value) { + var listStyleType = ListUtils.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 > 0) { + 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', Settings.getNumberStyles(editor)); + addControl(editor, 'bullist', 'Bullet list', 'InsertUnorderedList', 'UL', Settings.getBulletStyles(editor)); + }; + var Buttons = { register: register$1 }; - e.control.items().each(function(ctrl) { - ctrl.active(ctrl.settings.data === listStyleType); - }); - } + function Plugin () { + global.add('advlist', function (editor) { + var hasPlugin = function (editor, plugin) { + var plugins = editor.settings.plugins ? editor.settings.plugins : ''; + return global$1.inArray(plugins.split(/[ ,]/), plugin) !== -1; + }; + if (hasPlugin(editor, 'lists')) { + Buttons.register(editor); + Commands.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/lib/tinymce/js/tinymce/plugins/advlist/plugin.min.js b/lib/tinymce/js/tinymce/plugins/advlist/plugin.min.js index a4db7cca..36dfbe56 100644 --- a/lib/tinymce/js/tinymce/plugins/advlist/plugin.min.js +++ b/lib/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.1.6 (2020-01-28) + */ +!function(){"use strict";function n(){}function o(n){return function(){return n}}function t(){return d}var e,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.util.Tools"),l=function(n,t,e){var r="UL"===t?"InsertUnorderedList":"InsertOrderedList";n.execCommand(r,!1,!1===e?null:{"list-style-type":e})},i=function(e){e.addCommand("ApplyUnorderedListStyle",function(n,t){l(e,"UL",t["list-style-type"])}),e.addCommand("ApplyOrderedListStyle",function(n,t){l(e,"OL",t["list-style-type"])})},c=function(n){var t=n.getParam("advlist_number_styles","default,lower-alpha,lower-greek,lower-roman,upper-alpha,upper-roman");return t?t.split(/[ ,]/):[]},s=function(n){var t=n.getParam("advlist_bullet_styles","default,circle,square");return t?t.split(/[ ,]/):[]},f=o(!1),a=o(!0),d=(e={fold:function(n,t){return n()},is:f,isSome:f,isNone:a,getOr:m,getOrThunk:p,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(undefined),or:m,orThunk:p,map:t,each:n,bind:t,exists:f,forall:a,filter:t,equals:g,equals_:g,toArray:function(){return[]},toString:o("none()")},Object.freeze&&Object.freeze(e),e);function g(n){return n.isNone()}function p(n){return n()}function m(n){return n}function y(n,t,e){var r=function(n,t){for(var e=0;e= 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,  , delimeter, (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 Settings = { + getAutoLinkPattern: getAutoLinkPattern, + getDefaultLinkTarget: getDefaultLinkTarget + }; + + 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 rng, end, start, endContainer, bookmark, text, matches, prev, len, rngText; + var autoLinkPattern = Settings.getAutoLinkPattern(editor); + var defaultLinkTarget = Settings.getDefaultLinkTarget(editor); + if (editor.selection.getNode().tagName === 'A') { + return; + } + rng = editor.selection.getRng(true).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; + } + } + 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(); + matches = text.match(autoLinkPattern); + 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]); + 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); + } + }); + }; + var Keys = { setup: setup }; + + function Plugin () { + global.add('autolink', function (editor) { + Keys.setup(editor); + }); + } + + Plugin(); + +}()); diff --git a/lib/tinymce/js/tinymce/plugins/autolink/plugin.min.js b/lib/tinymce/js/tinymce/plugins/autolink/plugin.min.js index dc5f9cd0..bffc686c 100644 --- a/lib/tinymce/js/tinymce/plugins/autolink/plugin.min.js +++ b/lib/tinymce/js/tinymce/plugins/autolink/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("autolink",function(t){function e(t){i(t,-1,"(",!0)}function n(t){i(t,0,"",!0)}function o(t){i(t,-1,"",!1)}function i(t,e,n){var o,i,a,r,l,s,d,c,u;if(o=t.selection.getRng(!0).cloneRange(),5>o.startOffset){if(c=o.endContainer.previousSibling,!c){if(!o.endContainer.firstChild||!o.endContainer.firstChild.nextSibling)return;c=o.endContainer.firstChild.nextSibling}if(u=c.length,o.setStart(c,u),o.setEnd(c,u),5>o.endOffset)return;i=o.endOffset,r=c}else{if(r=o.endContainer,3!=r.nodeType&&r.firstChild){for(;3!=r.nodeType&&r.firstChild;)r=r.firstChild;3==r.nodeType&&(o.setStart(r,0),o.setEnd(r,r.nodeValue.length))}i=1==o.endOffset?2:o.endOffset-1-e}a=i;do o.setStart(r,i>=2?i-2:0),o.setEnd(r,i>=1?i-1:0),i-=1;while(" "!=""+o&&""!=""+o&&160!=(""+o).charCodeAt(0)&&i-2>=0&&""+o!=n);if(""+o==n||160==(""+o).charCodeAt(0)?(o.setStart(r,i),o.setEnd(r,a),i+=1):0===o.startOffset?(o.setStart(r,0),o.setEnd(r,a)):(o.setStart(r,i),o.setEnd(r,a)),s=""+o,"."==s.charAt(s.length-1)&&o.setEnd(r,a-1),s=""+o,d=s.match(/^(https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.|(?:mailto:)?[A-Z0-9._%+\-]+@)(.+)$/i),d&&("www."==d[1]?d[1]="http://www.":/@$/.test(d[1])&&!/^mailto:/.test(d[1])&&(d[1]="mailto:"+d[1]),l=t.selection.getBookmark(),t.selection.setRng(o),t.execCommand("createlink",!1,d[1]+d[2]),t.selection.moveToBookmark(l),t.nodeChanged(),tinymce.Env.webkit)){t.selection.collapse(!1);var f=Math.min(r.length,a+1);o.setStart(r,f),o.setEnd(r,f),t.selection.setRng(o)}}t.on("keydown",function(e){return 13==e.keyCode?o(t):void 0}),tinymce.Env.ie||(t.on("keypress",function(n){return 41==n.which?e(t):void 0}),t.on("keyup",function(e){return 32==e.keyCode?n(t):void 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.1.6 (2020-01-28) + */ +!function(){"use strict";function i(t,e){if(e<0&&(e=0),3===t.nodeType){var n=t.data.length;n settings.autoresize_min_height) { - resizeHeight = myHeight; - } + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); - // If a maximum height has been defined don't exceed this height - if (settings.autoresize_max_height && myHeight > settings.autoresize_max_height) { - resizeHeight = settings.autoresize_max_height; - body.style.overflowY = "auto"; - de.style.overflowY = "auto"; // Old IE - } else { - body.style.overflowY = "hidden"; - de.style.overflowY = "hidden"; // Old IE - body.scrollTop = 0; - } + var global$1 = tinymce.util.Tools.resolve('tinymce.Env'); - // Resize content element - if (resizeHeight !== oldSize) { - deltaSize = resizeHeight - oldSize; - DOM.setStyle(DOM.get(editor.id + '_ifr'), 'height', resizeHeight + 'px'); - oldSize = resizeHeight; + var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay'); - // WebKit doesn't decrease the size of the body element until the iframe gets resized - // So we need to continue to resize the iframe down until the size gets fixed - if (tinymce.isWebKit && deltaSize < 0) { - resize(e); - } - } - } + var fireResizeEditor = function (editor) { + return editor.fire('ResizeEditor'); + }; + var Events = { fireResizeEditor: fireResizeEditor }; - // Define minimum height - settings.autoresize_min_height = parseInt(editor.getParam('autoresize_min_height', editor.getElement().offsetHeight), 10); + var getAutoResizeMinHeight = function (editor) { + return editor.getParam('min_height', editor.getElement().offsetHeight, 'number'); + }; + var getAutoResizeMaxHeight = function (editor) { + return editor.getParam('max_height', 0, 'number'); + }; + var getAutoResizeOverflowPadding = function (editor) { + return editor.getParam('autoresize_overflow_padding', 1, 'number'); + }; + var getAutoResizeBottomMargin = function (editor) { + return editor.getParam('autoresize_bottom_margin', 50, 'number'); + }; + var shouldAutoResizeOnInit = function (editor) { + return editor.getParam('autoresize_on_init', true, 'boolean'); + }; + var Settings = { + getAutoResizeMinHeight: getAutoResizeMinHeight, + getAutoResizeMaxHeight: getAutoResizeMaxHeight, + getAutoResizeOverflowPadding: getAutoResizeOverflowPadding, + getAutoResizeBottomMargin: getAutoResizeBottomMargin, + shouldAutoResizeOnInit: shouldAutoResizeOnInit + }; - // Define maximum height - settings.autoresize_max_height = parseInt(editor.getParam('autoresize_max_height', 0), 10); + var isFullscreen = function (editor) { + return editor.plugins.fullscreen && editor.plugins.fullscreen.isFullscreen(); + }; + var wait = function (editor, oldSize, times, interval, callback) { + global$2.setEditorTimeout(editor, function () { + resize(editor, oldSize); + if (times--) { + wait(editor, oldSize, times, interval, callback); + } else if (callback) { + callback(); + } + }, interval); + }; + var toggleScrolling = function (editor, state) { + var body = editor.getBody(); + if (body) { + body.style.overflowY = state ? '' : 'hidden'; + if (!state) { + body.scrollTop = 0; + } + } + }; + var parseCssValueToInt = function (dom, elm, name, computed) { + var value = parseInt(dom.getStyle(elm, name, computed), 10); + return isNaN(value) ? 0 : value; + }; + var resize = function (editor, oldSize) { + var deltaSize, resizeHeight, contentHeight; + var dom = editor.dom; + var doc = editor.getDoc(); + if (!doc) { + return; + } + if (isFullscreen(editor)) { + toggleScrolling(editor, true); + return; + } + var docEle = doc.documentElement; + var resizeBottomMargin = Settings.getAutoResizeBottomMargin(editor); + resizeHeight = Settings.getAutoResizeMinHeight(editor); + var marginTop = parseCssValueToInt(dom, docEle, 'margin-top', true); + var marginBottom = parseCssValueToInt(dom, docEle, 'margin-bottom', true); + contentHeight = docEle.offsetHeight + marginTop + marginBottom + resizeBottomMargin; + if (contentHeight < 0) { + contentHeight = 0; + } + var containerHeight = editor.getContainer().offsetHeight; + var contentAreaHeight = editor.getContentAreaContainer().offsetHeight; + var chromeHeight = containerHeight - contentAreaHeight; + if (contentHeight + chromeHeight > Settings.getAutoResizeMinHeight(editor)) { + resizeHeight = contentHeight + chromeHeight; + } + var maxHeight = Settings.getAutoResizeMaxHeight(editor); + if (maxHeight && resizeHeight > maxHeight) { + resizeHeight = maxHeight; + toggleScrolling(editor, true); + } else { + toggleScrolling(editor, false); + } + if (resizeHeight !== oldSize.get()) { + deltaSize = resizeHeight - oldSize.get(); + dom.setStyle(editor.getContainer(), 'height', resizeHeight + 'px'); + oldSize.set(resizeHeight); + Events.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 = Settings.getAutoResizeOverflowPadding(editor); + var dom = editor.dom; + dom.setStyles(editor.getBody(), { + 'paddingLeft': overflowPadding, + 'paddingRight': overflowPadding, + 'min-height': 0 + }); + }); + editor.on('NodeChange SetContent keyup FullscreenStateChanged ResizeContent', function () { + resize(editor, oldSize); + }); + if (Settings.shouldAutoResizeOnInit(editor)) { + editor.on('init', function () { + wait(editor, oldSize, 20, 100, function () { + wait(editor, oldSize, 5, 1000); + }); + }); + } + }; + var Resize = { + setup: setup, + resize: resize + }; - // Add padding at the bottom for better UX - editor.on("init", function() { - editor.dom.setStyle(editor.getBody(), 'paddingBottom', editor.getParam('autoresize_bottom_margin', 50) + 'px'); - }); + var register = function (editor, oldSize) { + editor.addCommand('mceAutoResize', function () { + Resize.resize(editor, oldSize); + }); + }; + var Commands = { register: register }; - // Add appropriate listeners for resizing content area - editor.on("change setcontent paste keyup", resize); + function Plugin () { + global.add('autoresize', function (editor) { + if (!editor.settings.hasOwnProperty('resize')) { + editor.settings.resize = false; + } + if (!editor.inline) { + var oldSize = Cell(0); + Commands.register(editor, oldSize); + Resize.setup(editor, oldSize); + } + }); + } - if (editor.getParam('autoresize_on_init', true)) { - editor.on('load', resize); - } + Plugin(); - // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample'); - editor.addCommand('mceAutoResize', resize); -}); +}()); diff --git a/lib/tinymce/js/tinymce/plugins/autoresize/plugin.min.js b/lib/tinymce/js/tinymce/plugins/autoresize/plugin.min.js index e38f0461..fccb9fe6 100644 --- a/lib/tinymce/js/tinymce/plugins/autoresize/plugin.min.js +++ b/lib/tinymce/js/tinymce/plugins/autoresize/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("autoresize",function(e){function t(i){var a,s,r=e.getDoc(),l=r.body,c=r.documentElement,d=tinymce.DOM,u=n.autoresize_min_height;"setcontent"==i.type&&i.initial||e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen()||(s=tinymce.Env.ie?l.scrollHeight:tinymce.Env.webkit&&0===l.clientHeight?0:l.offsetHeight,s>n.autoresize_min_height&&(u=s),n.autoresize_max_height&&s>n.autoresize_max_height?(u=n.autoresize_max_height,l.style.overflowY="auto",c.style.overflowY="auto"):(l.style.overflowY="hidden",c.style.overflowY="hidden",l.scrollTop=0),u!==o&&(a=u-o,d.setStyle(d.get(e.id+"_ifr"),"height",u+"px"),o=u,tinymce.isWebKit&&0>a&&t(i)))}var n=e.settings,o=0;n.autoresize_min_height=parseInt(e.getParam("autoresize_min_height",e.getElement().offsetHeight),10),n.autoresize_max_height=parseInt(e.getParam("autoresize_max_height",0),10),e.on("init",function(){e.dom.setStyle(e.getBody(),"paddingBottom",e.getParam("autoresize_bottom_margin",50)+"px")}),e.on("change setcontent paste keyup",t),e.getParam("autoresize_on_init",!0)&&e.on("load",t),e.addCommand("mceAutoResize",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.1.6 (2020-01-28) + */ +!function(){"use strict";function d(e,t){var n=e.getBody();n&&(n.style.overflowY=t?"":"hidden",t||(n.scrollTop=0))}function h(e,t,n,i){var o=parseInt(e.getStyle(t,n,i),10);return isNaN(o)?0:o}var i=function(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return i(t())}}},e=tinymce.util.Tools.resolve("tinymce.PluginManager"),v=tinymce.util.Tools.resolve("tinymce.Env"),r=tinymce.util.Tools.resolve("tinymce.util.Delay"),p=function(e){return e.fire("ResizeEditor")},y=function(e){return e.getParam("min_height",e.getElement().offsetHeight,"number")},z=function(e){return e.getParam("max_height",0,"number")},n=function(e){return e.getParam("autoresize_overflow_padding",1,"number")},b=function(e){return e.getParam("autoresize_bottom_margin",50,"number")},o=function(e){return e.getParam("autoresize_on_init",!0,"boolean")},u=function(e,t,n,i,o){r.setEditorTimeout(e,function(){C(e,t),n--?u(e,t,n,i,o):o&&o()},i)},C=function(e,t){var n,i,o,r=e.dom,u=e.getDoc();if(u)if(function(e){return e.plugins.fullscreen&&e.plugins.fullscreen.isFullscreen()}(e))d(e,!0);else{var s=u.documentElement,a=b(e);i=y(e);var f=h(r,s,"margin-top",!0),c=h(r,s,"margin-bottom",!0);(o=s.offsetHeight+f+c+a)<0&&(o=0);var g=e.getContainer().offsetHeight-e.getContentAreaContainer().offsetHeight;o+g>y(e)&&(i=o+g);var l=z(e);if(l&&l settings.autosave_retention) { - removeDraft(); - return false; - } - - return true; - } - - function removeDraft() { - LocalStorage.removeItem(prefix + "autosave.draft"); - LocalStorage.removeItem(prefix + "autosave.time"); - } - - function storeDraft() { - if (started && editor.isDirty()) { - LocalStorage.setItem(prefix + "autosave.draft", editor.getContent({format: 'raw', no_events: true})); - LocalStorage.setItem(prefix + "autosave.time", new Date().getTime()); - editor.fire('StoreDraft'); - } - } - - function restoreDraft() { - if (hasDraft()) { - editor.setContent(LocalStorage.getItem(prefix + "autosave.draft"), {format: 'raw'}); - removeDraft(); - editor.fire('RestoreDraft'); - } - } - - function startStoreDraft() { - if (!started) { - setInterval(function() { - if (!editor.removed) { - storeDraft(); - } - }, settings.autosave_interval); - - started = true; - } - } - - settings.autosave_interval = parseTime(settings.autosave_interval, '30s'); - settings.autosave_retention = parseTime(settings.autosave_retention, '20m'); - - function postRender() { - var self = this; - - self.disabled(!hasDraft()); - - editor.on('StoreDraft RestoreDraft', function() { - self.disabled(!hasDraft()); - }); - - startStoreDraft(); - } - - function restoreLastDraft() { - editor.undoManager.beforeChange(); - restoreDraft(); - editor.undoManager.add(); - } - - editor.addButton('restoredraft', { - title: 'Restore draft', - onclick: restoreLastDraft, - onPostRender: postRender - }); - - editor.addMenuItem('restoredraft', { - text: 'Restore last draft', - onclick: restoreLastDraft, - onPostRender: postRender, - context: 'file' - }); - - this.storeDraft = storeDraft; - - // Internal unload handler will be called before the page is unloaded - function beforeUnloadHandler() { - var msg; - - tinymce.each(tinymce.editors, function(editor) { - // Store a draft for each editor instance - if (editor.plugins.autosave) { - editor.plugins.autosave.storeDraft(); - } - - // Setup a return message if the editor is dirty - if (!msg && editor.isDirty() && editor.getParam("autosave_ask_before_unload", true)) { - msg = editor.translate("You have unsaved changes are you sure you want to navigate away?"); - } - }); - - return msg; - } - - window.onbeforeunload = beforeUnloadHandler; -}); \ No newline at end of file +(function (domGlobals) { + 'use strict'; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Delay'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.util.LocalStorage'); + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var fireRestoreDraft = function (editor) { + return editor.fire('RestoreDraft'); + }; + var fireStoreDraft = function (editor) { + return editor.fire('StoreDraft'); + }; + var fireRemoveDraft = function (editor) { + return editor.fire('RemoveDraft'); + }; + + var parse = function (timeString, defaultTime) { + var multiples = { + s: 1000, + m: 60000 + }; + var toParse = timeString || defaultTime; + var parsedTime = /^(\d+)([ms]?)$/.exec('' + toParse); + return (parsedTime[2] ? multiples[parsedTime[2]] : 1) * parseInt(toParse, 10); + }; + + var shouldAskBeforeUnload = function (editor) { + return editor.getParam('autosave_ask_before_unload', true); + }; + var getAutoSavePrefix = function (editor) { + var prefix = editor.getParam('autosave_prefix', 'tinymce-autosave-{path}{query}{hash}-{id}-'); + prefix = prefix.replace(/\{path\}/g, domGlobals.document.location.pathname); + prefix = prefix.replace(/\{query\}/g, domGlobals.document.location.search); + prefix = prefix.replace(/\{hash\}/g, domGlobals.document.location.hash); + prefix = prefix.replace(/\{id\}/g, editor.id); + return prefix; + }; + var shouldRestoreWhenEmpty = function (editor) { + return editor.getParam('autosave_restore_when_empty', false); + }; + var getAutoSaveInterval = function (editor) { + return parse(editor.settings.autosave_interval, '30s'); + }; + var getAutoSaveRetention = function (editor) { + return parse(editor.settings.autosave_retention, '20m'); + }; + + var isEmpty = function (editor, html) { + var forcedRootBlockName = editor.settings.forced_root_block; + html = global$3.trim(typeof html === 'undefined' ? editor.getBody().innerHTML : html); + return html === '' || new RegExp('^<' + forcedRootBlockName + '[^>]*>((\xA0| |[ \t]|]*>)+?|)|
    $', 'i').test(html); + }; + var hasDraft = function (editor) { + var time = parseInt(global$2.getItem(getAutoSavePrefix(editor) + 'time'), 10) || 0; + if (new Date().getTime() - time > 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, started) { + var interval = getAutoSaveInterval(editor); + if (!started.get()) { + global$1.setInterval(function () { + if (!editor.removed) { + storeDraft(editor); + } + }, interval); + started.set(true); + } + }; + var restoreLastDraft = function (editor) { + editor.undoManager.transact(function () { + restoreDraft(editor); + removeDraft(editor); + }); + editor.focus(); + }; + + 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 get = function (editor) { + return { + hasDraft: curry(hasDraft, editor), + storeDraft: curry(storeDraft, editor), + restoreDraft: curry(restoreDraft, editor), + removeDraft: curry(removeDraft, editor), + isEmpty: curry(isEmpty, editor) + }; + }; + + 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, started) { + 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, started) { + startStoreDraft(editor, started); + 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) { + var started = Cell(false); + setup(editor); + register(editor, started); + editor.on('init', function () { + if (shouldRestoreWhenEmpty(editor) && editor.dom.isEmpty(editor.getBody())) { + restoreDraft(editor); + } + }); + return get(editor); + }); + } + + Plugin(); + +}(window)); diff --git a/lib/tinymce/js/tinymce/plugins/autosave/plugin.min.js b/lib/tinymce/js/tinymce/plugins/autosave/plugin.min.js index c1423ee5..50941ae7 100644 --- a/lib/tinymce/js/tinymce/plugins/autosave/plugin.min.js +++ b/lib/tinymce/js/tinymce/plugins/autosave/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("autosave",function(e){function t(e,t){var n={s:1e3,m:6e4};return e=/^(\d+)([ms]?)$/.exec(""+(e||t)),(e[2]?n[e[2]]:1)*parseInt(e,10)}function n(){var e=parseInt(f.getItem(m+"autosave.time"),10)||0;return(new Date).getTime()-e>c.autosave_retention?(o(),!1):!0}function o(){f.removeItem(m+"autosave.draft"),f.removeItem(m+"autosave.time")}function a(){d&&e.isDirty()&&(f.setItem(m+"autosave.draft",e.getContent({format:"raw",no_events:!0})),f.setItem(m+"autosave.time",(new Date).getTime()),e.fire("StoreDraft"))}function i(){n()&&(e.setContent(f.getItem(m+"autosave.draft"),{format:"raw"}),o(),e.fire("RestoreDraft"))}function r(){d||(setInterval(function(){e.removed||a()},c.autosave_interval),d=!0)}function s(){var t=this;t.disabled(!n()),e.on("StoreDraft RestoreDraft",function(){t.disabled(!n())}),r()}function l(){e.undoManager.beforeChange(),i(),e.undoManager.add()}function u(){var e;return tinymce.each(tinymce.editors,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}var d,c=e.settings,f=tinymce.util.LocalStorage,m=e.id;c.autosave_interval=t(c.autosave_interval,"30s"),c.autosave_retention=t(c.autosave_retention,"20m"),e.addButton("restoredraft",{title:"Restore draft",onclick:l,onPostRender:s}),e.addMenuItem("restoredraft",{text:"Restore last draft",onclick:l,onPostRender:s,context:"file"}),this.storeDraft=a,window.onbeforeunload=u}); \ 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.1.6 (2020-01-28) + */ +!function(n){"use strict";function r(t,e){var n=t||e,r=/^(\d+)([ms]?)$/.exec(""+n);return(r[2]?{s:1e3,m:6e4}[r[2]]:1)*parseInt(n,10)}function o(t){var e=t.getParam("autosave_prefix","tinymce-autosave-{path}{query}{hash}-{id}-");return e=(e=(e=(e=e.replace(/\{path\}/g,n.document.location.pathname)).replace(/\{query\}/g,n.document.location.search)).replace(/\{hash\}/g,n.document.location.hash)).replace(/\{id\}/g,t.id)}function a(t,e){var n=t.settings.forced_root_block;return""===(e=d.trim(void 0===e?t.getBody().innerHTML:e))||new RegExp("^<"+n+"[^>]*>((\xa0| |[ \t]|]*>)+?|)|
    $","i").test(e)}function i(t){var e=parseInt(v.getItem(o(t)+"time"),10)||0;return!((new Date).getTime()-e>function(t){return r(t.settings.autosave_retention,"20m")}(t))||(g(t,!1),!1)}function u(t){var e=o(t);!a(t)&&t.isDirty()&&(v.setItem(e+"draft",t.getContent({format:"raw",no_events:!0})),v.setItem(e+"time",(new Date).getTime().toString()),function(t){t.fire("StoreDraft")}(t))}function s(t){var e=o(t);i(t)&&(t.setContent(v.getItem(e+"draft"),{format:"raw"}),function(t){t.fire("RestoreDraft")}(t))}function c(t,e){var n=function(t){return r(t.settings.autosave_interval,"30s")}(t);e.get()||(m.setInterval(function(){t.removed||u(t)},n),e.set(!0))}function f(t){t.undoManager.transact(function(){s(t),g(t)}),t.focus()}var l=function(t){function e(){return n}var n=t;return{get:e,set:function(t){n=t},clone:function(){return l(e())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),m=tinymce.util.Tools.resolve("tinymce.util.Delay"),v=tinymce.util.Tools.resolve("tinymce.util.LocalStorage"),d=tinymce.util.Tools.resolve("tinymce.util.Tools"),g=function(t,e){var n=o(t);v.removeItem(n+"draft"),v.removeItem(n+"time"),!1!==e&&function(t){t.fire("RemoveDraft")}(t)};function y(r){for(var o=[],t=1;t BBCode in PunBB dialect - _punbb_html2bbcode : function(s) { - s = tinymce.trim(s); - - function rep(re, str) { - s = s.replace(re, str); - } - - // example: to [b] - 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; - }, - - // BBCode -> HTML from PunBB dialect - _punbb_bbcode2html : function(s) { - s = tinymce.trim(s); - - function rep(re, str) { - s = s.replace(re, str); - } - - // example: [b] to - 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; - } - }); - - // Register plugin - tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin); -})(); \ No newline at end of file +(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; + }; + var Convert = { + html2bbcode: html2bbcode, + bbcode2html: bbcode2html + }; + + function Plugin () { + global.add('bbcode', function (editor) { + editor.on('BeforeSetContent', function (e) { + e.content = Convert.bbcode2html(e.content); + }); + editor.on('PostProcess', function (e) { + if (e.set) { + e.content = Convert.bbcode2html(e.content); + } + if (e.get) { + e.content = Convert.html2bbcode(e.content); + } + }); + }); + } + + Plugin(); + +}()); diff --git a/lib/tinymce/js/tinymce/plugins/bbcode/plugin.min.js b/lib/tinymce/js/tinymce/plugins/bbcode/plugin.min.js index 578e8985..eb2a0055 100644 --- a/lib/tinymce/js/tinymce/plugins/bbcode/plugin.min.js +++ b/lib/tinymce/js/tinymce/plugins/bbcode/plugin.min.js @@ -1 +1,9 @@ -(function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(e){var t=this,n=e.getParam("bbcode_dialect","punbb").toLowerCase();e.on("beforeSetContent",function(e){e.content=t["_"+n+"_bbcode2html"](e.content)}),e.on("postProcess",function(e){e.set&&(e.content=t["_"+n+"_bbcode2html"](e.content)),e.get&&(e.content=t["_"+n+"_html2bbcode"](e.content))})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://www.tinymce.com",infourl:"http://www.tinymce.com/wiki.php/Plugin:bbcode"}},_punbb_html2bbcode:function(e){function t(t,n){e=e.replace(t,n)}return e=tinymce.trim(e),t(/(.*?)<\/a>/gi,"[url=$1]$2[/url]"),t(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),t(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),t(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]"),t(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]"),t(/(.*?)<\/span>/gi,"[color=$1]$2[/color]"),t(/(.*?)<\/font>/gi,"[color=$1]$2[/color]"),t(/(.*?)<\/span>/gi,"[size=$1]$2[/size]"),t(/(.*?)<\/font>/gi,"$1"),t(//gi,"[img]$1[/img]"),t(/(.*?)<\/span>/gi,"[code]$1[/code]"),t(/(.*?)<\/span>/gi,"[quote]$1[/quote]"),t(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]"),t(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]"),t(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]"),t(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]"),t(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]"),t(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]"),t(/<\/(strong|b)>/gi,"[/b]"),t(/<(strong|b)>/gi,"[b]"),t(/<\/(em|i)>/gi,"[/i]"),t(/<(em|i)>/gi,"[i]"),t(/<\/u>/gi,"[/u]"),t(/(.*?)<\/span>/gi,"[u]$1[/u]"),t(//gi,"[u]"),t(/]*>/gi,"[quote]"),t(/<\/blockquote>/gi,"[/quote]"),t(/
    /gi,"\n"),t(//gi,"\n"),t(/
    /gi,"\n"),t(/

    /gi,""),t(/<\/p>/gi,"\n"),t(/ |\u00a0/gi," "),t(/"/gi,'"'),t(/</gi,"<"),t(/>/gi,">"),t(/&/gi,"&"),e},_punbb_bbcode2html:function(e){function t(t,n){e=e.replace(t,n)}return e=tinymce.trim(e),t(/\n/gi,"
    "),t(/\[b\]/gi,""),t(/\[\/b\]/gi,""),t(/\[i\]/gi,""),t(/\[\/i\]/gi,""),t(/\[u\]/gi,""),t(/\[\/u\]/gi,""),t(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'$2'),t(/\[url\](.*?)\[\/url\]/gi,'$1'),t(/\[img\](.*?)\[\/img\]/gi,''),t(/\[color=(.*?)\](.*?)\[\/color\]/gi,'$2'),t(/\[code\](.*?)\[\/code\]/gi,'$1 '),t(/\[quote.*?\](.*?)\[\/quote\]/gi,'$1 '),e}}),tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})(); \ 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.1.6 (2020-01-28) + */ +!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);function o(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},i=function(t){t=e.trim(t);function o(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};!function n(){o.add("bbcode",function(o){o.on("BeforeSetContent",function(o){o.content=i(o.content)}),o.on("PostProcess",function(o){o.set&&(o.content=i(o.content)),o.get&&(o.content=t(o.content))})})}()}(); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/plugins/charmap/plugin.js b/lib/tinymce/js/tinymce/plugins/charmap/plugin.js index b82b671b..d981805c 100644 --- a/lib/tinymce/js/tinymce/plugins/charmap/plugin.js +++ b/lib/tinymce/js/tinymce/plugins/charmap/plugin.js @@ -1,361 +1,1696 @@ /** - * 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.1.6 (2020-01-28) */ +(function (domGlobals) { + 'use strict'; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var fireInsertCustomChar = function (editor, chr) { + return editor.fire('insertCustomChar', { chr: chr }); + }; + var Events = { fireInsertCustomChar: fireInsertCustomChar }; + + var insertChar = function (editor, chr) { + var evtChr = Events.fireInsertCustomChar(editor, chr).chr; + editor.execCommand('mceInsertContent', false, evtChr); + }; + var Actions = { insertChar: insertChar }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var getCharMap = function (editor) { + return editor.settings.charmap; + }; + var getCharMapAppend = function (editor) { + return editor.settings.charmap_append; + }; + var Settings = { + getCharMap: getCharMap, + getCharMapAppend: getCharMapAppend + }; + + 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()') + }; + if (Object.freeze) { + Object.freeze(me); + } + 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 Option = { + some: some, + none: none, + from: from + }; -/*global tinymce:true */ + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + 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 isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isArray = isType('array'); + var isFunction = isType('function'); -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 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 find = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Option.some(x); + } + } + return Option.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) { + var output = map(xs, f); + return flatten(output); + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; - function showDialog() { - var gridHtml, x, y, win; + 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 = Settings.getCharMap(editor); + if (userCharMap) { + charmap = [{ + name: UserDefined, + characters: getCharsFromSetting(userCharMap) + }]; + } + var userCharMapAppend = Settings.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; + }; + var CharMap = { getCharMap: getCharMap$1 }; - function getParentTd(elm) { - while (elm) { - if (elm.nodeName == 'TD') { - return elm; - } + var get = function (editor) { + var getCharMap = function () { + return CharMap.getCharMap(editor); + }; + var insertChar = function (chr) { + Actions.insertChar(editor, chr); + }; + return { + getCharMap: getCharMap, + insertChar: insertChar + }; + }; + var Api = { get: get }; - elm = elm.parentNode; - } - } + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; - gridHtml = ''; + var last = function (fn, rate) { + var timer = null; + var cancel = function () { + if (timer !== null) { + domGlobals.clearTimeout(timer); + timer = null; + } + }; + var throttle = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (timer !== null) { + domGlobals.clearTimeout(timer); + } + timer = domGlobals.setTimeout(function () { + fn.apply(null, args); + timer = null; + }, rate); + }; + return { + cancel: cancel, + throttle: throttle + }; + }; - for (y = 0; y < 10; y++) { - gridHtml += ''; + var contains = function (str, substr) { + return str.indexOf(substr) !== -1; + }; - for (x = 0; x < 20; x++) { - var chr = charmap[y * 10 + x]; - var id = 'g' + (y * 10 + x); + var charMatches = function (charCode, name, lowerCasePattern) { + if (contains(String.fromCharCode(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: String.fromCharCode(m[0]), + icon: String.fromCharCode(m[0]) + }; + }); + }; + var Scan = { scan: scan }; - 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.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.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') { + Actions.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); + }; + var Dialog = { open: open }; - gridHtml += ''; - } + var register = function (editor, charMap) { + editor.addCommand('mceShowCharmap', function () { + Dialog.open(editor, charMap); + }); + }; + var Commands = { register: register }; - gridHtml += ''; + var global$2 = tinymce.util.Tools.resolve('tinymce.util.Promise'); - var charMapPanel = { - type: 'container', - html: gridHtml, - onclick: function(e) { - var target = e.target; - if (target.nodeName == 'DIV') { - editor.execCommand('mceInsertContent', false, target.firstChild.nodeValue); - } - }, - 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.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'); + } + }); + }; + var Buttons = { register: register$1 }; - win = editor.windowManager.open({ - title: "Special characters", - 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 = CharMap.getCharMap(editor); + Commands.register(editor, charMap); + Buttons.register(editor); + init(editor, charMap[0]); + return Api.get(editor); + }); + } - editor.addButton('charmap', { - icon: 'charmap', - tooltip: 'Insert special character', - onclick: showDialog - }); + Plugin(); - editor.addMenuItem('charmap', { - icon: 'charmap', - text: 'Special character', - onclick: showDialog, - context: 'insert' - }); -}); \ No newline at end of file +}(window)); diff --git a/lib/tinymce/js/tinymce/plugins/charmap/plugin.min.js b/lib/tinymce/js/tinymce/plugins/charmap/plugin.min.js index c491c904..6afb56a4 100644 --- a/lib/tinymce/js/tinymce/plugins/charmap/plugin.min.js +++ b/lib/tinymce/js/tinymce/plugins/charmap/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("charmap",function(e){function t(){function t(e){for(;e;){if("TD"==e.nodeName)return e;e=e.parentNode}}var o,i,a,r;for(o='',a=0;10>a;a++){for(o+="",i=0;20>i;i++){var s=n[10*a+i],l="g"+(10*a+i);o+='"}o+=""}o+="";var c={type:"container",html:o,onclick:function(t){var n=t.target;"DIV"==n.nodeName&&e.execCommand("mceInsertContent",!1,n.firstChild.nodeValue)},onmouseover:function(e){var n=t(e.target);n&&r.find("#preview").text(n.firstChild.firstChild.data)}};r=e.windowManager.open({title:"Special characters",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(){r.close()}}]})}var n=[["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:"Insert special character",onclick:t}),e.addMenuItem("charmap",{icon:"charmap",text:"Special character",onclick:t,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.1.6 (2020-01-28) + */ +!function(c){"use strict";function n(){}function i(n){return function(){return n}}function e(){return m}var r,t=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=function(n,e){return n.fire("insertCustomChar",{chr:e})},u=function(n,e){var r=a(n,e).chr;n.execCommand("mceInsertContent",!1,r)},o=tinymce.util.Tools.resolve("tinymce.util.Tools"),s=function(n){return n.settings.charmap},l=function(n){return n.settings.charmap_append},f=i(!1),g=i(!0),m=(r={fold:function(n,e){return n()},is:f,isSome:f,isNone:g,getOr:p,getOrThunk:d,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:p,orThunk:d,map:e,each:n,bind:e,exists:f,forall:g,filter:e,equals:h,equals_:h,toArray:function(){return[]},toString:i("none()")},Object.freeze&&Object.freeze(r),r);function h(n){return n.isNone()}function d(n){return n()}function p(n){return n}function y(e){return function(n){return function(n){if(null===n)return"null";var e=typeof n;return"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}(n)===e}}function w(n,e){for(var r=n.length,t=new Array(r),a=0;a text.length) { + break tokenloop; + } + if (str instanceof Token) { + continue; + } + pattern.lastIndex = 0; + var match = pattern.exec(str); + if (match) { + if (lookbehind) { + lookbehindLength = match[1].length; + } + var from = match.index - 1 + lookbehindLength; + match = match[0].slice(lookbehindLength); + var len = match.length, to = from + len, before = str.slice(0, from + 1), after = str.slice(to + 1); + var args = [ + i, + 1 + ]; + if (before) { + args.push(before); + } + var wrapped = new Token(token, inside ? _.tokenize(match, inside) : match, alias); + args.push(wrapped); + if (after) { + args.push(after); + } + Array.prototype.splice.apply(strarr, args); + } + } + } + } + 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 = void 0; callback = callbacks[i++];) { + callback(env); + } + } + } + }; + var Token = _.Token = function (type, content, alias) { + this.type = type; + this.content = content; + this.alias = alias; + }; + Token.stringify = function (o, language, parent) { + if (typeof o === 'string') { + return o; + } + if (_.util.type(o) === 'Array') { + return o.map(function (element) { + return Token.stringify(element, language, o); + }).join(''); + } + var env = { + type: o.type, + content: Token.stringify(o.content, language, parent), + tag: 'span', + classes: [ + 'token', + o.type + ], + attributes: {}, + language: language, + parent: parent + }; + if (env.type === 'comment') { + env.attributes.spellcheck = 'true'; + } + if (o.alias) { + var aliases = _.util.type(o.alias) === 'Array' ? o.alias : [o.alias]; + Array.prototype.push.apply(env.classes, aliases); + } + _.hooks.run('wrap', env); + var attributes = ''; + for (var name in env.attributes) { + attributes += (attributes ? ' ' : '') + name + '="' + (env.attributes[name] || '') + '"'; + } + return '<' + env.tag + ' class="' + env.classes.join(' ') + '" ' + attributes + '>' + env.content + ''; + }; + if (!_self.document) { + if (!_self.addEventListener) { + return _self.Prism; + } + _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 _self.Prism; + } + }(); + if (typeof global$2 !== 'undefined') { + global$2.Prism = Prism; + } + Prism.languages.markup = { + comment: //, + prolog: /<\?[\w\W]+?\?>/, + doctype: //, + cdata: //i, + tag: { + pattern: /<\/?[^\s>\/=.]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i, + inside: { + 'tag': { + pattern: /^<\/?[^\s>\/]+/i, + inside: { + punctuation: /^<\/?/, + namespace: /^[^\s>\/:]+:/ + } + }, + 'attr-value': { + pattern: /=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i, + inside: { punctuation: /[=>"']/ } + }, + 'punctuation': /\/?>/, + 'attr-name': { + pattern: /[^\s>\/]+/, + inside: { namespace: /^[^\s>\/:]+:/ } + } + } + }, + entity: /&#?[\da-z]{1,8};/i + }; + Prism.hooks.add('wrap', function (env) { + if (env.type === 'entity') { + env.attributes.title = env.content.replace(/&/, '&'); + } + }); + Prism.languages.xml = Prism.languages.markup; + Prism.languages.html = Prism.languages.markup; + Prism.languages.mathml = Prism.languages.markup; + Prism.languages.svg = Prism.languages.markup; + Prism.languages.css = { + comment: /\/\*[\w\W]*?\*\//, + atrule: { + pattern: /@[\w-]+?.*?(;|(?=\s*\{))/i, + inside: { rule: /@[\w-]+/ } + }, + url: /url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i, + selector: /[^\{\}\s][^\{\};]*?(?=\s*\{)/, + string: /("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/, + property: /(\b|\B)[\w-]+(?=\s*:)/i, + important: /\B!important\b/i, + function: /[-a-z0-9]+(?=\()/i, + punctuation: /[(){};:]/ + }; + Prism.languages.css.atrule.inside.rest = Prism.util.clone(Prism.languages.css); + if (Prism.languages.markup) { + Prism.languages.insertBefore('markup', 'tag', { + style: { + pattern: /[\w\W]*?<\/style>/i, + inside: { + tag: { + pattern: /|<\/style>/i, + inside: Prism.languages.markup.tag.inside + }, + rest: Prism.languages.css + }, + alias: 'language-css' + } + }); + Prism.languages.insertBefore('inside', 'attr-value', { + 'style-attr': { + pattern: /\s*style=("|').*?\1/i, + inside: { + 'attr-name': { + pattern: /^\s*style/i, + inside: Prism.languages.markup.tag.inside + }, + 'punctuation': /^\s*=\s*['"]|['"]\s*$/, + 'attr-value': { + pattern: /.+/i, + inside: Prism.languages.css + } + }, + alias: 'language-css' + } + }, Prism.languages.markup.tag); + } + Prism.languages.clike = { + 'comment': [ + { + pattern: /(^|[^\\])\/\*[\w\W]*?\*\//, + lookbehind: true + }, + { + pattern: /(^|[^\\:])\/\/.*/, + lookbehind: true + } + ], + 'string': /(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, + 'class-name': { + pattern: /((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/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': /[a-z0-9_]+(?=\()/i, + 'number': /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i, + 'operator': /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/, + 'punctuation': /[{}[\];(),.:]/ + }; + Prism.languages.javascript = Prism.languages.extend('clike', { + keyword: /\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|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|true|try|typeof|var|void|while|with|yield)\b/, + number: /\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/, + function: /[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i + }); + Prism.languages.insertBefore('javascript', 'keyword', { + regex: { + pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/, + lookbehind: true + } + }); + Prism.languages.insertBefore('javascript', 'class-name', { + 'template-string': { + pattern: /`(?:\\`|\\?[^`])*`/, + inside: { + interpolation: { + pattern: /\$\{[^}]+\}/, + inside: { + 'interpolation-punctuation': { + pattern: /^\$\{|\}$/, + alias: 'punctuation' + }, + 'rest': Prism.languages.javascript + } + }, + string: /[\s\S]+/ + } + } + }); + if (Prism.languages.markup) { + Prism.languages.insertBefore('markup', 'tag', { + script: { + pattern: /[\w\W]*?<\/script>/i, + inside: { + tag: { + pattern: /|<\/script>/i, + inside: Prism.languages.markup.tag.inside + }, + rest: Prism.languages.javascript + }, + alias: 'language-javascript' + } + }); + } + Prism.languages.js = Prism.languages.javascript; + Prism.languages.c = Prism.languages.extend('clike', { + keyword: /\b(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: /\-[>-]?|\+\+?|!=?|<>?=?|==?|&&?|\|?\||[~^%?*\/]/, + number: /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i + }); + Prism.languages.insertBefore('c', 'string', { + macro: { + pattern: /(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im, + lookbehind: true, + alias: 'property', + inside: { + string: { + pattern: /(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/, + lookbehind: true + } + } + } + }); + delete Prism.languages.c['class-name']; + delete Prism.languages.c.boolean; + Prism.languages.csharp = Prism.languages.extend('clike', { + keyword: /\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/, + string: [ + /@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/, + /("|')(\\?.)*?\1/ + ], + number: /\b-?(0x[\da-f]+|\d*\.?\d+)\b/i + }); + Prism.languages.insertBefore('csharp', 'keyword', { + preprocessor: { + pattern: /(^\s*)#.*/m, + lookbehind: true + } + }); + Prism.languages.cpp = Prism.languages.extend('c', { + 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|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/, + boolean: /\b(true|false)\b/, + operator: /[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|:{1,2}|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\/|\b(and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/ + }); + Prism.languages.insertBefore('cpp', 'keyword', { + 'class-name': { + pattern: /(class\s+)[a-z0-9_]+/i, + lookbehind: true + } + }); + Prism.languages.java = Prism.languages.extend('clike', { + keyword: /\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/, + number: /\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+(?:e[+-]?\d+)?[df]?\b/i, + operator: { + pattern: /(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m, + lookbehind: true + } + }); + Prism.languages.php = Prism.languages.extend('clike', { + keyword: /\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i, + constant: /\b[A-Z0-9_]{2,}\b/, + comment: { + pattern: /(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/, + lookbehind: true + } + }); + Prism.languages.insertBefore('php', 'class-name', { + 'shell-comment': { + pattern: /(^|[^\\])#.*/, + lookbehind: true, + alias: 'comment' + } + }); + Prism.languages.insertBefore('php', 'keyword', { + delimiter: /\?>|<\?(?:php)?/i, + 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 + } + }); + if (Prism.languages.markup) { + Prism.hooks.add('before-highlight', function (env) { + if (env.language !== 'php') { + return; + } + env.tokenStack = []; + env.backupCode = env.code; + env.code = env.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/ig, function (match) { + env.tokenStack.push(match); + return '{{{PHP' + env.tokenStack.length + '}}}'; + }); + }); + Prism.hooks.add('before-insert', function (env) { + if (env.language === 'php') { + env.code = env.backupCode; + delete env.backupCode; + } + }); + Prism.hooks.add('after-highlight', function (env) { + if (env.language !== 'php') { + return; + } + for (var i = 0, t = void 0; t = env.tokenStack[i]; i++) { + env.highlightedCode = env.highlightedCode.replace('{{{PHP' + (i + 1) + '}}}', Prism.highlight(t, env.grammar, 'php').replace(/\$/g, '$$$$')); + } + env.element.innerHTML = env.highlightedCode; + }); + Prism.hooks.add('wrap', function (env) { + if (env.language === 'php' && env.type === 'markup') { + env.content = env.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g, '$1'); + } + }); + Prism.languages.insertBefore('php', 'comment', { + markup: { + pattern: /<[^?]\/?(.*?)>/, + inside: Prism.languages.markup + }, + php: /\{\{\{PHP[0-9]+\}\}\}/ + }); + } + Prism.languages.python = { + 'comment': { + pattern: /(^|[^\\])#.*/, + lookbehind: true + }, + 'string': /"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(?:\\?.)*?\1/, + 'function': { + pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g, + lookbehind: true + }, + 'class-name': { + pattern: /(\bclass\s+)[a-z0-9_]+/i, + lookbehind: true + }, + 'keyword': /\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/, + 'boolean': /\b(?:True|False)\b/, + 'number': /\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i, + 'operator': /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/, + 'punctuation': /[{}[\];(),.:]/ + }; + (function (Prism) { + Prism.languages.ruby = Prism.languages.extend('clike', { + comment: /#(?!\{[^\r\n]*?\}).*/, + keyword: /\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/ + }); + var interpolation = { + pattern: /#\{[^}]+\}/, + inside: { + delimiter: { + pattern: /^#\{|\}$/, + alias: 'tag' + }, + rest: Prism.util.clone(Prism.languages.ruby) + } + }; + Prism.languages.insertBefore('ruby', 'keyword', { + regex: [ + { + pattern: /%r([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1[gim]{0,3}/, + inside: { interpolation: interpolation } + }, + { + pattern: /%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/, + inside: { interpolation: interpolation } + }, + { + pattern: /%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/, + inside: { interpolation: interpolation } + }, + { + pattern: /%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/, + inside: { interpolation: interpolation } + }, + { + pattern: /%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/, + inside: { interpolation: interpolation } + }, + { + pattern: /(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/, + lookbehind: true + } + ], + variable: /[@$]+[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/, + symbol: /:[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/ + }); + Prism.languages.insertBefore('ruby', 'number', { + builtin: /\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|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][a-zA-Z_0-9]*(?:[?!]|\b)/ + }); + Prism.languages.ruby.string = [ + { + pattern: /%[qQiIwWxs]?([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1/, + inside: { interpolation: interpolation } + }, + { + pattern: /%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/, + inside: { interpolation: interpolation } + }, + { + pattern: /%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/, + inside: { interpolation: interpolation } + }, + { + pattern: /%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/, + inside: { interpolation: interpolation } + }, + { + pattern: /%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/, + inside: { interpolation: interpolation } + }, + { + pattern: /("|')(#\{[^}]+\}|\\(?:\r?\n|\r)|\\?.)*?\1/, + inside: { interpolation: interpolation } + } + ]; + }(Prism)); + + function isCodeSample(elm) { + return elm && elm.nodeName === 'PRE' && elm.className.indexOf('language-') !== -1; + } + function trimArg(predicateFn) { + return function (arg1, arg2) { + return predicateFn(arg2); + }; + } + var Utils = { + isCodeSample: isCodeSample, + trimArg: trimArg + }; + + 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()') + }; + if (Object.freeze) { + Object.freeze(me); + } + 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 Option = { + some: some, + none: none, + from: from + }; + + var getSelectedCodeSample = function (editor) { + var node = editor.selection ? editor.selection.getNode() : null; + if (Utils.isCodeSample(node)) { + return Option.some(node); + } + return Option.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; + Prism.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 CodeSample = { + getSelectedCodeSample: getSelectedCodeSample, + insertCodeSample: insertCodeSample, + getCurrentCode: getCurrentCode + }; + + var getLanguages = function (editor) { + return editor.settings.codesample_languages; + }; + var Settings = { getLanguages: getLanguages }; + + 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 = Settings.getLanguages(editor); + return customLanguages ? customLanguages : defaultLanguages; + }; + var getCurrentLanguage = function (editor, fallback) { + var node = CodeSample.getSelectedCodeSample(editor); + return node.fold(function () { + return fallback; + }, function (n) { + var matches = n.className.match(/language-(\w+)/); + return matches ? matches[1] : fallback; + }); + }; + var Languages = { + getLanguages: getLanguages$1, + getCurrentLanguage: getCurrentLanguage + }; + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + 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 isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isFunction = isType('function'); + + var nativeSlice = Array.prototype.slice; + var head = function (xs) { + return xs.length === 0 ? Option.none() : Option.some(xs[0]); + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + var open = function (editor) { + var languages = Languages.getLanguages(editor); + var defaultLanguage = head(languages).fold(function () { + return ''; + }, function (l) { + return l.value; + }); + var currentLanguage = Languages.getCurrentLanguage(editor, defaultLanguage); + var currentCode = CodeSample.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(); + CodeSample.insertCodeSample(editor, data.language, data.code); + api.close(); + } + }); + }; + var Dialog = { open: open }; + + var register = function (editor) { + editor.addCommand('codesample', function () { + var node = editor.selection.getNode(); + if (editor.selection.isCollapsed() || Utils.isCodeSample(node)) { + Dialog.open(editor); + } else { + editor.formatter.toggle('code'); + } + }); + }; + var Commands = { register: register }; + + var setup = function (editor) { + var $ = editor.$; + editor.on('PreProcess', function (e) { + $('pre[contenteditable=false]', e.node).filter(Utils.trimArg(Utils.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(Utils.trimArg(Utils.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); + Prism.highlightElement(elm); + elm.className = $.trim(elm.className); + }); + }); + } + }); + }; + var FilterContent = { setup: setup }; + + var isCodeSampleSelection = function (editor) { + var node = editor.selection.getStart(); + return editor.dom.is(node, 'pre.language-markup'); + }; + var register$1 = function (editor) { + editor.ui.registry.addToggleButton('codesample', { + icon: 'code-sample', + tooltip: 'Insert/edit code sample', + onAction: function () { + return Dialog.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 Dialog.open(editor); + } + }); + }; + var Buttons = { register: register$1 }; + + function Plugin () { + global.add('codesample', function (editor) { + FilterContent.setup(editor); + Buttons.register(editor); + Commands.register(editor); + editor.on('dblclick', function (ev) { + if (Utils.isCodeSample(ev.target)) { + Dialog.open(editor); + } + }); + }); + } + + Plugin(); + +}(window)); diff --git a/lib/tinymce/js/tinymce/plugins/codesample/plugin.min.js b/lib/tinymce/js/tinymce/plugins/codesample/plugin.min.js new file mode 100644 index 00000000..832f9415 --- /dev/null +++ b/lib/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.1.6 (2020-01-28) + */ +!function(c){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),r=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),t={},n=t,g=void 0!==t?t:"undefined"!=typeof WorkerGlobalScope&&c.self instanceof WorkerGlobalScope?c.self:{},i=function(){var u=/\blang(?:uage)?-(?!\*)(\w+)\b/i,S=g.Prism={util:{encode:function(e){return e instanceof s?new s(e.type,S.util.encode(e.content),e.alias):"Array"===S.util.type(e)?e.map(S.util.encode):e.replace(/&/g,"&").replace(/e.length)break e;if(!(h instanceof a)){u.lastIndex=0;var m=u.exec(h);if(m){g&&(d=m[1].length);var b=m.index-1+d,y=b+(m=m[0].slice(d)).length,v=h.slice(0,b+1),k=h.slice(y+1),w=[f,1];v&&w.push(v);var x=new a(o,c?S.tokenize(m,c):m,p);w.push(x),k&&w.push(k),Array.prototype.splice.apply(r,w)}}}}}return r},hooks:{all:{},add:function(e,t){var n=S.hooks.all;n[e]=n[e]||[],n[e].push(t)},run:function(e,t){var n=S.hooks.all[e];if(n&&n.length)for(var a=0,r=void 0;r=n[a++];)r(t)}}},s=S.Token=function(e,t,n){this.type=e,this.content=t,this.alias=n};if(s.stringify=function(t,n,e){if("string"==typeof t)return t;if("Array"===S.util.type(t))return t.map(function(e){return s.stringify(e,n,t)}).join("");var a={type:t.type,content:s.stringify(t.content,n,e),tag:"span",classes:["token",t.type],attributes:{},language:n,parent:e};if("comment"===a.type&&(a.attributes.spellcheck="true"),t.alias){var r="Array"===S.util.type(t.alias)?t.alias:[t.alias];Array.prototype.push.apply(a.classes,r)}S.hooks.run("wrap",a);var i="";for(var o in a.attributes)i+=(i?" ":"")+o+'="'+(a.attributes[o]||"")+'"';return"<"+a.tag+' class="'+a.classes.join(" ")+'" '+i+">"+a.content+""},!g.document)return g.addEventListener&&g.addEventListener("message",function(e){var t=JSON.parse(e.data),n=t.language,a=t.code,r=t.immediateClose;g.postMessage(S.highlight(a,S.languages[n],n)),r&&g.close()},!1),g.Prism}();void 0!==n&&(n.Prism=i),i.languages.markup={comment://,prolog:/<\?[\w\W]+?\?>/,doctype://,cdata://i,tag:{pattern:/<\/?[^\s>\/=.]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\\1|\\?(?!\1)[\w\W])*\1|[^\s'">=]+))?)*\s*\/?>/i,inside:{tag:{pattern:/^<\/?[^\s>\/]+/i,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/i,inside:{punctuation:/[=>"']/}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:/&#?[\da-z]{1,8};/i},i.hooks.add("wrap",function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))}),i.languages.xml=i.languages.markup,i.languages.html=i.languages.markup,i.languages.mathml=i.languages.markup,i.languages.svg=i.languages.markup,i.languages.css={comment:/\/\*[\w\W]*?\*\//,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*\{))/i,inside:{rule:/@[\w-]+/}},url:/url\((?:(["'])(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1|.*?)\)/i,selector:/[^\{\}\s][^\{\};]*?(?=\s*\{)/,string:/("|')(\\(?:\r\n|[\w\W])|(?!\1)[^\\\r\n])*\1/,property:/(\b|\B)[\w-]+(?=\s*:)/i,important:/\B!important\b/i,"function":/[-a-z0-9]+(?=\()/i,punctuation:/[(){};:]/},i.languages.css.atrule.inside.rest=i.util.clone(i.languages.css),i.languages.markup&&(i.languages.insertBefore("markup","tag",{style:{pattern:/[\w\W]*?<\/style>/i,inside:{tag:{pattern:/|<\/style>/i,inside:i.languages.markup.tag.inside},rest:i.languages.css},alias:"language-css"}}),i.languages.insertBefore("inside","attr-value",{"style-attr":{pattern:/\s*style=("|').*?\1/i,inside:{"attr-name":{pattern:/^\s*style/i,inside:i.languages.markup.tag.inside},punctuation:/^\s*=\s*['"]|['"]\s*$/,"attr-value":{pattern:/.+/i,inside:i.languages.css}},alias:"language-css"}},i.languages.markup.tag)),i.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\w\W]*?\*\//,lookbehind:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0}],string:/(["'])(\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,"class-name":{pattern:/((?:\b(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/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":/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,operator:/--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/,punctuation:/[{}[\];(),.:]/},i.languages.javascript=i.languages.extend("clike",{keyword:/\b(as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|false|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|true|try|typeof|var|void|while|with|yield)\b/,number:/\b-?(0x[\dA-Fa-f]+|0b[01]+|0o[0-7]+|\d*\.?\d+([Ee][+-]?\d+)?|NaN|Infinity)\b/,"function":/[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\()/i}),i.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\\\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}}),i.languages.insertBefore("javascript","class-name",{"template-string":{pattern:/`(?:\\`|\\?[^`])*`/,inside:{interpolation:{pattern:/\$\{[^}]+\}/,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:i.languages.javascript}},string:/[\s\S]+/}}}),i.languages.markup&&i.languages.insertBefore("markup","tag",{script:{pattern:/[\w\W]*?<\/script>/i,inside:{tag:{pattern:/|<\/script>/i,inside:i.languages.markup.tag.inside},rest:i.languages.javascript},alias:"language-javascript"}}),i.languages.js=i.languages.javascript,i.languages.c=i.languages.extend("clike",{keyword:/\b(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:/\-[>-]?|\+\+?|!=?|<>?=?|==?|&&?|\|?\||[~^%?*\/]/,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i}),i.languages.insertBefore("c","string",{macro:{pattern:/(^\s*)#\s*[a-z]+([^\r\n\\]|\\.|\\(?:\r\n?|\n))*/im,lookbehind:!0,alias:"property",inside:{string:{pattern:/(#\s*include\s*)(<.+?>|("|')(\\?.)+?\3)/,lookbehind:!0}}}}),delete i.languages.c["class-name"],delete i.languages.c["boolean"],i.languages.csharp=i.languages.extend("clike",{keyword:/\b(abstract|as|async|await|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double|else|enum|event|explicit|extern|false|finally|fixed|float|for|foreach|goto|if|implicit|in|int|interface|internal|is|lock|long|namespace|new|null|object|operator|out|override|params|private|protected|public|readonly|ref|return|sbyte|sealed|short|sizeof|stackalloc|static|string|struct|switch|this|throw|true|try|typeof|uint|ulong|unchecked|unsafe|ushort|using|virtual|void|volatile|while|add|alias|ascending|async|await|descending|dynamic|from|get|global|group|into|join|let|orderby|partial|remove|select|set|value|var|where|yield)\b/,string:[/@("|')(\1\1|\\\1|\\?(?!\1)[\s\S])*\1/,/("|')(\\?.)*?\1/],number:/\b-?(0x[\da-f]+|\d*\.?\d+)\b/i}),i.languages.insertBefore("csharp","keyword",{preprocessor:{pattern:/(^\s*)#.*/m,lookbehind:!0}}),i.languages.cpp=i.languages.extend("c",{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|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/,"boolean":/\b(true|false)\b/,operator:/[-+]{1,2}|!=?|<{1,2}=?|>{1,2}=?|\->|:{1,2}|={1,2}|\^|~|%|&{1,2}|\|?\||\?|\*|\/|\b(and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/}),i.languages.insertBefore("cpp","keyword",{"class-name":{pattern:/(class\s+)[a-z0-9_]+/i,lookbehind:!0}}),i.languages.java=i.languages.extend("clike",{keyword:/\b(abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/,number:/\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+(?:e[+-]?\d+)?[df]?\b/i,operator:{pattern:/(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m,lookbehind:!0}}),i.languages.php=i.languages.extend("clike",{keyword:/\b(and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i,constant:/\b[A-Z0-9_]{2,}\b/,comment:{pattern:/(^|[^\\])(?:\/\*[\w\W]*?\*\/|\/\/.*)/,lookbehind:!0}}),i.languages.insertBefore("php","class-name",{"shell-comment":{pattern:/(^|[^\\])#.*/,lookbehind:!0,alias:"comment"}}),i.languages.insertBefore("php","keyword",{delimiter:/\?>|<\?(?:php)?/i,variable:/\$\w+\b/i,"package":{pattern:/(\\|namespace\s+|use\s+)[\w\\]+/,lookbehind:!0,inside:{punctuation:/\\/}}}),i.languages.insertBefore("php","operator",{property:{pattern:/(->)[\w]+/,lookbehind:!0}}),i.languages.markup&&(i.hooks.add("before-highlight",function(t){"php"===t.language&&(t.tokenStack=[],t.backupCode=t.code,t.code=t.code.replace(/(?:<\?php|<\?)[\w\W]*?(?:\?>)/gi,function(e){return t.tokenStack.push(e),"{{{PHP"+t.tokenStack.length+"}}}"}))}),i.hooks.add("before-insert",function(e){"php"===e.language&&(e.code=e.backupCode,delete e.backupCode)}),i.hooks.add("after-highlight",function(e){if("php"===e.language){for(var t=0,n=void 0;n=e.tokenStack[t];t++)e.highlightedCode=e.highlightedCode.replace("{{{PHP"+(t+1)+"}}}",i.highlight(n,e.grammar,"php").replace(/\$/g,"$$$$"));e.element.innerHTML=e.highlightedCode}}),i.hooks.add("wrap",function(e){"php"===e.language&&"markup"===e.type&&(e.content=e.content.replace(/(\{\{\{PHP[0-9]+\}\}\})/g,'$1'))}),i.languages.insertBefore("php","comment",{markup:{pattern:/<[^?]\/?(.*?)>/,inside:i.languages.markup},php:/\{\{\{PHP[0-9]+\}\}\}/})),i.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},string:/"""[\s\S]+?"""|'''[\s\S]+?'''|("|')(?:\\?.)*?\1/,"function":{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_][a-zA-Z0-9_]*(?=\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)[a-z0-9_]+/i,lookbehind:!0},keyword:/\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|pass|print|raise|return|try|while|with|yield)\b/,"boolean":/\b(?:True|False)\b/,number:/\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/,punctuation:/[{}[\];(),.:]/},function(e){e.languages.ruby=e.languages.extend("clike",{comment:/#(?!\{[^\r\n]*?\}).*/,keyword:/\b(alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/});var t={pattern:/#\{[^}]+\}/,inside:{delimiter:{pattern:/^#\{|\}$/,alias:"tag"},rest:e.util.clone(e.languages.ruby)}};e.languages.insertBefore("ruby","keyword",{regex:[{pattern:/%r([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1[gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r\((?:[^()\\]|\\[\s\S])*\)[gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}[gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r\[(?:[^\[\]\\]|\\[\s\S])*\][gim]{0,3}/,inside:{interpolation:t}},{pattern:/%r<(?:[^<>\\]|\\[\s\S])*>[gim]{0,3}/,inside:{interpolation:t}},{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/,lookbehind:!0}],variable:/[@$]+[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/,symbol:/:[a-zA-Z_][a-zA-Z_0-9]*(?:[?!]|\b)/}),e.languages.insertBefore("ruby","number",{builtin:/\b(Array|Bignum|Binding|Class|Continuation|Dir|Exception|FalseClass|File|Stat|File|Fixnum|Fload|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][a-zA-Z_0-9]*(?:[?!]|\b)/}),e.languages.ruby.string=[{pattern:/%[qQiIwWxs]?([^a-zA-Z0-9\s\{\(\[<])(?:[^\\]|\\[\s\S])*?\1/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?\((?:[^()\\]|\\[\s\S])*\)/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?\{(?:[^#{}\\]|#(?:\{[^}]+\})?|\\[\s\S])*\}/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?\[(?:[^\[\]\\]|\\[\s\S])*\]/,inside:{interpolation:t}},{pattern:/%[qQiIwWxs]?<(?:[^<>\\]|\\[\s\S])*>/,inside:{interpolation:t}},{pattern:/("|')(#\{[^}]+\}|\\(?:\r?\n|\r)|\\?.)*?\1/,inside:{interpolation:t}}]}(i);function a(){}function o(e){return function(){return e}}function s(){return f}var l,u={isCodeSample:function B(e){return e&&"PRE"===e.nodeName&&-1!==e.className.indexOf("language-")},trimArg:function M(n){return function(e,t){return n(t)}}},d=o(!1),p=o(!0),f=(l={fold:function(e,t){return e()},is:d,isSome:d,isNone:p,getOr:b,getOrThunk:m,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:o(null),getOrUndefined:o(undefined),or:b,orThunk:m,map:s,each:a,bind:s,exists:d,forall:p,filter:s,equals:h,equals_:h,toArray:function(){return[]},toString:o("none()")},Object.freeze&&Object.freeze(l),l);function h(e){return e.isNone()}function m(e){return e()}function b(e){return e}function y(e){var t=e.selection?e.selection.getNode():null;return u.isCodeSample(t)?w.some(t):w.none()}var v,k=function(n){function e(){return r}function t(e){return e(n)}var a=o(n),r={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:p,isNone:d,getOr:a,getOrThunk:a,getOrDie:a,getOrNull:a,getOrUndefined:a,or:e,orThunk:e,map:function(e){return k(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?r:f},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(d,function(e){return t(n,e)})}};return r},w={some:k,none:s,from:function(e){return null===e||e===undefined?f:k(e)}},x=y,S=function(t,n,a){t.undoManager.transact(function(){var e=y(t);return a=r.DOM.encode(a),e.fold(function(){t.insertContent('
    '+a+"
    "),t.selection.select(t.$("#__new").removeAttr("id")[0])},function(e){t.dom.setAttrib(e,"class","language-"+n),e.innerHTML=a,i.highlightElement(e),t.selection.select(e)})})},A=function(e){return y(e).fold(function(){return""},function(e){return e.textContent})},C=function(e){return e.settings.codesample_languages},_=function(e){var t=C(e);return t||[{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"}]},N=function(e,n){return x(e).fold(function(){return n},function(e){var t=e.className.match(/language-(\w+)/);return t?t[1]:n})},O=(v="function",function(e){return function(e){if(null===e)return"null";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}(e)===v}),z=Array.prototype.slice,P=(O(Array.from)&&Array.from,function(n){var e=_(n),t=function(e){return 0===e.length?w.none():w.some(e[0])}(e).fold(function(){return""},function(e){return e.value}),a=N(n,t),r=A(n);n.windowManager.open({title:"Insert/Edit Code Sample",size:"large",body:{type:"panel",items:[{type:"selectbox",name:"language",label:"Language",items:e},{type:"textarea",name:"code",label:"Code view"}]},buttons:[{type:"cancel",name:"cancel",text:"Cancel"},{type:"submit",name:"save",text:"Save",primary:!0}],initialData:{language:a,code:r},onSubmit:function(e){var t=e.getData();S(n,t.language,t.code),e.close()}})}),W=function(t){t.addCommand("codesample",function(){var e=t.selection.getNode();t.selection.isCollapsed()||u.isCodeSample(e)?P(t):t.formatter.toggle("code")})},j=function(n){var r=n.$;n.on("PreProcess",function(e){r("pre[contenteditable=false]",e.node).filter(u.trimArg(u.isCodeSample)).each(function(e,t){var n=r(t),a=t.textContent;n.attr("class",r.trim(n.attr("class"))),n.removeAttr("contentEditable"),n.empty().append(r("").each(function(){this.textContent=a}))})}),n.on("SetContent",function(){var e=r("pre").filter(u.trimArg(u.isCodeSample)).filter(function(e,t){return"false"!==t.contentEditable});e.length&&n.undoManager.transact(function(){e.each(function(e,t){r(t).find("br").each(function(e,t){t.parentNode.replaceChild(n.getDoc().createTextNode("\n"),t)}),t.contentEditable="false",t.innerHTML=n.dom.encode(t.textContent),i.highlightElement(t),t.className=r.trim(t.className)})})})},T=function(n){n.ui.registry.addToggleButton("codesample",{icon:"code-sample",tooltip:"Insert/edit code sample",onAction:function(){return P(n)},onSetup:function(e){function t(){e.setActive(function(e){var t=e.selection.getStart();return e.dom.is(t,"pre.language-markup")}(n))}return n.on("NodeChange",t),function(){return n.off("NodeChange",t)}}}),n.ui.registry.addMenuItem("codesample",{text:"Code sample...",icon:"code-sample",onAction:function(){return P(n)}})};!function F(){e.add("codesample",function(t){j(t),T(t),W(t),t.on("dblclick",function(e){u.isCodeSample(e.target)&&P(t)})})}()}(window); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/plugins/colorpicker/plugin.js b/lib/tinymce/js/tinymce/plugins/colorpicker/plugin.js new file mode 100644 index 00000000..2008b920 --- /dev/null +++ b/lib/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.1.6 (2020-01-28) + */ +(function (domGlobals) { + 'use strict'; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + function Plugin () { + global.add('colorpicker', function () { + domGlobals.console.warn('Color picker plugin is now built in to the core editor, please remove it from your editor configuration'); + }); + } + + Plugin(); + +}(window)); diff --git a/lib/tinymce/js/tinymce/plugins/colorpicker/plugin.min.js b/lib/tinymce/js/tinymce/plugins/colorpicker/plugin.min.js new file mode 100644 index 00000000..1eb7860e --- /dev/null +++ b/lib/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.1.6 (2020-01-28) + */ +!function(o){"use strict";var i=tinymce.util.Tools.resolve("tinymce.PluginManager");!function n(){i.add("colorpicker",function(){o.console.warn("Color picker plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/plugins/compat3x/editable_selects.js b/lib/tinymce/js/tinymce/plugins/compat3x/editable_selects.js deleted file mode 100644 index 8d30787d..00000000 --- a/lib/tinymce/js/tinymce/plugins/compat3x/editable_selects.js +++ /dev/null @@ -1,70 +0,0 @@ -/** - * editable_selects.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -var TinyMCE_EditableSelects = { - editSelectElm : null, - - init : function() { - var nl = document.getElementsByTagName("select"), i, d = document, o; - - for (i=0; i'; - h += ' '; - - return h; -} - -function updateColor(img_id, form_element_id) { - document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value; -} - -function setBrowserDisabled(id, state) { - var img = document.getElementById(id); - var lnk = document.getElementById(id + "_link"); - - if (lnk) { - if (state) { - lnk.setAttribute("realhref", lnk.getAttribute("href")); - lnk.removeAttribute("href"); - tinyMCEPopup.dom.addClass(img, 'disabled'); - } else { - if (lnk.getAttribute("realhref")) - lnk.setAttribute("href", lnk.getAttribute("realhref")); - - tinyMCEPopup.dom.removeClass(img, 'disabled'); - } - } -} - -function getBrowserHTML(id, target_form_element, type, prefix) { - var option = prefix + "_" + type + "_browser_callback", cb, html; - - cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback")); - - if (!cb) - return ""; - - html = ""; - html += ''; - html += ' '; - - return html; -} - -function openBrowser(img_id, target_form_element, type, option) { - var img = document.getElementById(img_id); - - if (img.className != "mceButtonDisabled") - tinyMCEPopup.openBrowser(target_form_element, type, option); -} - -function selectByValue(form_obj, field_name, value, add_custom, ignore_case) { - if (!form_obj || !form_obj.elements[field_name]) - return; - - if (!value) - value = ""; - - var sel = form_obj.elements[field_name]; - - var found = false; - for (var i=0; i/langs/_dlg.js lang pack file. - * - * @method requireLangPack - */ - requireLangPack : function() { - var t = this, u = t.getWindowArg('plugin_url') || t.getWindowArg('theme_url'); - - if (u && t.editor.settings.language && t.features.translate_i18n !== false && t.editor.settings.language_load !== false) { - u += '/langs/' + t.editor.settings.language + '_dlg.js'; - - if (!tinymce.ScriptLoader.isDone(u)) { - document.write(''); - tinymce.ScriptLoader.markDone(u); - } - } - }, - - /** - * Executes a color picker on the specified element id. When the user - * then selects a color it will be set as the value of the specified element. - * - * @method pickColor - * @param {DOMEvent} e DOM event object. - * @param {string} element_id Element id to be filled with the color value from the picker. - */ - pickColor : function(e, element_id) { - this.execCommand('mceColorPicker', true, { - color : document.getElementById(element_id).value, - func : function(c) { - document.getElementById(element_id).value = c; - - try { - document.getElementById(element_id).onchange(); - } catch (ex) { - // Try fire event, ignore errors - } - } - }); - }, - - /** - * Opens a filebrowser/imagebrowser this will set the output value from - * the browser as a value on the specified element. - * - * @method openBrowser - * @param {string} element_id Id of the element to set value in. - * @param {string} type Type of browser to open image/file/flash. - * @param {string} option Option name to get the file_broswer_callback function name from. - */ - openBrowser : function(element_id, type, option) { - tinyMCEPopup.restoreSelection(); - this.editor.execCallback('file_browser_callback', element_id, document.getElementById(element_id).value, type, window); - }, - - /** - * 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} t Title for the new confirm dialog. - * @param {function} cb Callback function to be executed after the user has selected ok or cancel. - * @param {Object} s Optional scope to execute the callback in. - */ - confirm : function(t, cb, s) { - this.editor.windowManager.confirm(t, cb, s, window); - }, - - /** - * 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} t Title for the new alert dialog. - * @param {function} cb Callback function to be executed after the user has selected ok. - * @param {Object} s Optional scope to execute the callback in. - */ - alert : function(tx, cb, s) { - this.editor.windowManager.alert(tx, cb, s, window); - }, - - /** - * Closes the current window. - * - * @method close - */ - close : function() { - var t = this; - - // To avoid domain relaxing issue in Opera - function close() { - t.editor.windowManager.close(window); - tinymce = tinyMCE = t.editor = t.params = t.dom = t.dom.doc = null; // Cleanup - }; - - if (tinymce.isOpera) - t.getWin().setTimeout(close, 0); - else - close(); - }, - - // Internal functions - - _restoreSelection : function() { - var e = window.event.srcElement; - - if (e.nodeName == 'INPUT' && (e.type == 'submit' || e.type == 'button')) - tinyMCEPopup.restoreSelection(); - }, - -/* _restoreSelection : function() { - var e = window.event.srcElement; - - // If user focus a non text input or textarea - if ((e.nodeName != 'INPUT' && e.nodeName != 'TEXTAREA') || e.type != 'text') - tinyMCEPopup.restoreSelection(); - },*/ - - _onDOMLoaded : function() { - var t = tinyMCEPopup, ti = document.title, bm, h, nv; - - // Translate page - if (t.features.translate_i18n !== false) { - h = document.body.innerHTML; - - // Replace a=x with a="x" in IE - if (tinymce.isIE) - h = h.replace(/ (value|title|alt)=([^"][^\s>]+)/gi, ' $1="$2"') - - document.dir = t.editor.getParam('directionality',''); - - if ((nv = t.editor.translate(h)) && nv != h) - document.body.innerHTML = nv; - - if ((nv = t.editor.translate(ti)) && nv != ti) - document.title = ti = nv; - } - - if (!t.editor.getParam('browser_preferred_colors', false) || !t.isWindow) - t.dom.addClass(document.body, 'forceColors'); - - document.body.style.display = ''; - - // Restore selection in IE when focus is placed on a non textarea or input element of the type text - if (tinymce.isIE) { - document.attachEvent('onmouseup', tinyMCEPopup._restoreSelection); - - // Add base target element for it since it would fail with modal dialogs - t.dom.add(t.dom.select('head')[0], 'base', {target : '_self'}); - } - - t.restoreSelection(); - t.resizeToInnerSize(); - - // Set inline title - if (!t.isWindow) - t.editor.windowManager.setTitle(window, ti); - else - window.focus(); - - if (!tinymce.isIE && !t.isWindow) { - t.dom.bind(document, 'focus', function() { - t.editor.windowManager.focus(t.id); - }); - } - - // Patch for accessibility - tinymce.each(t.dom.select('select'), function(e) { - e.onkeydown = tinyMCEPopup._accessHandler; - }); - - // Call onInit - // Init must be called before focus so the selection won't get lost by the focus call - tinymce.each(t.listeners, function(o) { - o.func.call(o.scope, t.editor); - }); - - // Move focus to window - if (t.getWindowArg('mce_auto_focus', true)) { - window.focus(); - - // Focus element with mceFocus class - tinymce.each(document.forms, function(f) { - tinymce.each(f.elements, function(e) { - if (t.dom.hasClass(e, 'mceFocus') && !e.disabled) { - e.focus(); - return false; // Break loop - } - }); - }); - } - - document.onkeyup = tinyMCEPopup._closeWinKeyHandler; - }, - - _accessHandler : function(e) { - e = e || window.event; - - if (e.keyCode == 13 || e.keyCode == 32) { - var elm = e.target || e.srcElement; - - if (elm.onchange) - elm.onchange(); - - return tinymce.dom.Event.cancel(e); - } - }, - - _closeWinKeyHandler : function(e) { - e = e || window.event; - - if (e.keyCode == 27) - tinyMCEPopup.close(); - }, - - _eventProxy: function(id) { - return function(evt) { - tinyMCEPopup.dom.events.callNativeHandler(id, evt); - }; - } -}; - -tinyMCEPopup.init(); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/plugins/compat3x/validate.js b/lib/tinymce/js/tinymce/plugins/compat3x/validate.js deleted file mode 100644 index d13aaa1b..00000000 --- a/lib/tinymce/js/tinymce/plugins/compat3x/validate.js +++ /dev/null @@ -1,252 +0,0 @@ -/** - * validate.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - // String validation: - - if (!Validator.isEmail('myemail')) - alert('Invalid email.'); - - // Form validation: - - var f = document.forms['myform']; - - if (!Validator.isEmail(f.myemail)) - alert('Invalid email.'); -*/ - -var Validator = { - isEmail : function(s) { - return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$'); - }, - - isAbsUrl : function(s) { - return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$'); - }, - - isSize : function(s) { - return this.test(s, '^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)?$'); - }, - - isId : function(s) { - return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$'); - }, - - isEmpty : function(s) { - var nl, i; - - if (s.nodeName == 'SELECT' && s.selectedIndex < 1) - return true; - - if (s.type == 'checkbox' && !s.checked) - return true; - - if (s.type == 'radio') { - for (i=0, nl = s.form.elements; i parseInt(v)) - st = this.mark(f, n); - } - } - - return st; - }, - - hasClass : function(n, c, d) { - return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className); - }, - - getNum : function(n, c) { - c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0]; - c = c.replace(/[^0-9]/g, ''); - - return c; - }, - - addClass : function(n, c, b) { - var o = this.removeClass(n, c); - n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c; - }, - - removeClass : function(n, c) { - c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' '); - return n.className = c != ' ' ? c : ''; - }, - - tags : function(f, s) { - return f.getElementsByTagName(s); - }, - - mark : function(f, n) { - var s = this.settings; - - this.addClass(n, s.invalid_cls); - n.setAttribute('aria-invalid', 'true'); - this.markLabels(f, n, s.invalid_cls); - - return false; - }, - - markLabels : function(f, n, ic) { - var nl, i; - - nl = this.tags(f, "label"); - for (i=0; ia;a++)"|"==i[a].text&&(0===a||a==i.length-1)&&i.splice(a,1);t=new tinymce.ui.Menu({items:i,context:"contextmenu"}),t.renderTo(document.body)}var r=tinymce.DOM.getPos(e.getContentAreaContainer());r.x+=n.clientX,r.y+=n.clientY,t.moveTo(r.x,r.y),e.on("remove",function(){t.remove(),t=null})})}); \ 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.1.6 (2020-01-28) + */ +!function(n){"use strict";var o=tinymce.util.Tools.resolve("tinymce.PluginManager");!function e(){o.add("contextmenu",function(){n.console.warn("Context menu plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/plugins/directionality/plugin.js b/lib/tinymce/js/tinymce/plugins/directionality/plugin.js index 3fd0dabc..9dad4c6b 100644 --- a/lib/tinymce/js/tinymce/plugins/directionality/plugin.js +++ b/lib/tinymce/js/tinymce/plugins/directionality/plugin.js @@ -1,64 +1,314 @@ /** - * 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.1.6 (2020-01-28) */ +(function (domGlobals) { + 'use strict'; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var setDir = function (editor, dir) { + var dom = editor.dom; + var curDir; + var blocks = editor.selection.getSelectedBlocks(); + if (blocks.length) { + curDir = dom.getAttrib(blocks[0], 'dir'); + global$1.each(blocks, function (block) { + if (!dom.getParent(block.parentNode, '*[dir="' + dir + '"]', dom.getRoot())) { + dom.setAttrib(block, 'dir', curDir !== dir ? dir : null); + } + }); + editor.nodeChanged(); + } + }; + var Direction = { setDir: setDir }; + + var register = function (editor) { + editor.addCommand('mceDirectionLTR', function () { + Direction.setDir(editor, 'ltr'); + }); + editor.addCommand('mceDirectionRTL', function () { + Direction.setDir(editor, 'rtl'); + }); + }; + var Commands = { register: register }; + + 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()') + }; + if (Object.freeze) { + Object.freeze(me); + } + 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 Option = { + some: some, + none: none, + from: from + }; + + var fromHtml = function (html, scope) { + var doc = scope || domGlobals.document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + domGlobals.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 || domGlobals.document; + var node = doc.createElement(tag); + return fromDom(node); + }; + var fromText = function (text, scope) { + var doc = scope || domGlobals.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: constant(node) }; + }; + var fromPoint = function (docElm, x, y) { + var doc = docElm.dom(); + return Option.from(doc.elementFromPoint(x, y)).map(fromDom); + }; + var Element = { + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint + }; + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + 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 isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isFunction = isType('function'); + + var nativeSlice = Array.prototype.slice; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + var isSupported = function (dom) { + return dom.style !== undefined && isFunction(dom.style.getPropertyValue); + }; + + var ATTRIBUTE = domGlobals.Node.ATTRIBUTE_NODE; + var CDATA_SECTION = domGlobals.Node.CDATA_SECTION_NODE; + var COMMENT = domGlobals.Node.COMMENT_NODE; + var DOCUMENT = domGlobals.Node.DOCUMENT_NODE; + var DOCUMENT_TYPE = domGlobals.Node.DOCUMENT_TYPE_NODE; + var DOCUMENT_FRAGMENT = domGlobals.Node.DOCUMENT_FRAGMENT_NODE; + var ELEMENT = domGlobals.Node.ELEMENT_NODE; + var TEXT = domGlobals.Node.TEXT_NODE; + var PROCESSING_INSTRUCTION = domGlobals.Node.PROCESSING_INSTRUCTION_NODE; + var ENTITY_REFERENCE = domGlobals.Node.ENTITY_REFERENCE_NODE; + var ENTITY = domGlobals.Node.ENTITY_NODE; + var NOTATION = domGlobals.Node.NOTATION_NODE; + + var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')(); + + var type = function (element) { + return element.dom().nodeType; + }; + var isType$1 = function (t) { + return function (element) { + return type(element) === t; + }; + }; + var isText = isType$1(TEXT); + + var inBody = function (element) { + var dom = isText(element) ? element.dom().parentNode : element.dom(); + return dom !== undefined && dom !== null && dom.ownerDocument.body.contains(dom); + }; + + var get = function (element, property) { + var dom = element.dom(); + var styles = domGlobals.window.getComputedStyle(dom); + var r = styles.getPropertyValue(property); + var v = r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r; + return v === null ? undefined : v; + }; + 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 = Element.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') + }); + }; + var Buttons = { register: register$1 }; + + function Plugin () { + global.add('directionality', function (editor) { + Commands.register(editor); + Buttons.register(editor); + }); + } + + Plugin(); -/*global tinymce:true */ - -tinymce.PluginManager.add('directionality', function(editor) { - function setDir(dir) { - var dom = editor.dom, curDir, blocks = editor.selection.getSelectedBlocks(); - - if (blocks.length) { - curDir = dom.getAttrib(blocks[0], "dir"); - - tinymce.each(blocks, function(block) { - // Add dir to block if the parent block doesn't already have that dir - if (!dom.getParent(block.parentNode, "*[dir='" + dir + "']", dom.getRoot())) { - if (curDir != dir) { - dom.setAttrib(block, "dir", dir); - } else { - dom.setAttrib(block, "dir", null); - } - } - }); - - editor.nodeChanged(); - } - } - - function generateSelector(dir) { - var selector = []; - - tinymce.each('h1 h2 h3 h4 h5 h6 div p'.split(' '), function(name) { - selector.push(name + '[dir=' + dir + ']'); - }); - - return selector.join(','); - } - - editor.addCommand('mceDirectionLTR', function() { - setDir("ltr"); - }); - - editor.addCommand('mceDirectionRTL', function() { - setDir("rtl"); - }); - - editor.addButton('ltr', { - title: 'Left to right', - cmd: 'mceDirectionLTR', - stateSelector: generateSelector('ltr') - }); - - editor.addButton('rtl', { - title: 'Right to left', - cmd: 'mceDirectionRTL', - stateSelector: generateSelector('rtl') - }); -}); \ No newline at end of file +}(window)); diff --git a/lib/tinymce/js/tinymce/plugins/directionality/plugin.min.js b/lib/tinymce/js/tinymce/plugins/directionality/plugin.min.js index 480a8b7a..94f36f52 100644 --- a/lib/tinymce/js/tinymce/plugins/directionality/plugin.min.js +++ b/lib/tinymce/js/tinymce/plugins/directionality/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("directionality",function(e){function t(t){var n,o=e.dom,i=e.selection.getSelectedBlocks();i.length&&(n=o.getAttrib(i[0],"dir"),tinymce.each(i,function(e){o.getParent(e.parentNode,"*[dir='"+t+"']",o.getRoot())||(n!=t?o.setAttrib(e,"dir",t):o.setAttrib(e,"dir",null))}),e.nodeChanged())}function n(e){var t=[];return tinymce.each("h1 h2 h3 h4 h5 h6 div p".split(" "),function(n){t.push(n+"[dir="+e+"]")}),t.join(",")}e.addCommand("mceDirectionLTR",function(){t("ltr")}),e.addCommand("mceDirectionRTL",function(){t("rtl")}),e.addButton("ltr",{title:"Left to right",cmd:"mceDirectionLTR",stateSelector:n("ltr")}),e.addButton("rtl",{title:"Right to left",cmd:"mceDirectionRTL",stateSelector:n("rtl")})}); \ 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.1.6 (2020-01-28) + */ +!function(i){"use strict";function n(){}function u(n){return function(){return n}}function t(){return a}var e,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=tinymce.util.Tools.resolve("tinymce.util.Tools"),o=function(n,t){var e,r=n.dom,o=n.selection.getSelectedBlocks();o.length&&(e=r.getAttrib(o[0],"dir"),c.each(o,function(n){r.getParent(n.parentNode,'*[dir="'+t+'"]',r.getRoot())||r.setAttrib(n,"dir",e!==t?t:null)}),n.nodeChanged())},d=function(n){n.addCommand("mceDirectionLTR",function(){o(n,"ltr")}),n.addCommand("mceDirectionRTL",function(){o(n,"rtl")})},f=u(!1),l=u(!0),a=(e={fold:function(n,t){return n()},is:f,isSome:f,isNone:l,getOr:s,getOrThunk:N,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(undefined),or:s,orThunk:N,map:t,each:n,bind:t,exists:f,forall:l,filter:t,equals:m,equals_:m,toArray:function(){return[]},toString:u("none()")},Object.freeze&&Object.freeze(e),e);function m(n){return n.isNone()}function N(n){return n()}function s(n){return n}function g(n,t){var e=n.dom(),r=i.window.getComputedStyle(e).getPropertyValue(t),o=""!==r||function(n){var t=A(n)?n.dom().parentNode:n.dom();return t!==undefined&&null!==t&&t.ownerDocument.body.contains(t)}(n)?r:w(e,t);return null===o?undefined:o}function T(t,r){return function(e){function n(n){var t=p.fromDom(n.element);e.setActive(function(n){return"rtl"===g(n,"direction")?"rtl":"ltr"}(t)===r)}return t.on("NodeChange",n),function(){return t.off("NodeChange",n)}}}var E,O,y=function(e){function n(){return o}function t(n){return n(e)}var r=u(e),o={fold:function(n,t){return t(e)},is:function(n){return e===n},isSome:l,isNone:f,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:n,orThunk:n,map:function(n){return y(n(e))},each:function(n){n(e)},bind:t,exists:t,forall:t,filter:function(n){return n(e)?o:a},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 o},D=function(n){return null===n||n===undefined?a:y(n)},h=function(n){if(null===n||n===undefined)throw new Error("Node cannot be null or undefined");return{dom:u(n)}},p={fromHtml:function(n,t){var e=(t||i.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, Option.some(maxResults)); + }); + }, + onAction: function (autocompleteApi, rng, value) { + editor.selection.setRng(rng); + editor.insertContent(value); + autocompleteApi.hide(); + } + }); + }; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + var last = function (fn, rate) { + var timer = null; + var cancel = function () { + if (timer !== null) { + domGlobals.clearTimeout(timer); + timer = null; + } + }; + var throttle = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (timer !== null) { + domGlobals.clearTimeout(timer); + } + timer = domGlobals.setTimeout(function () { + fn.apply(null, args); + timer = null; + }, rate); + }; + return { + cancel: cancel, + throttle: throttle + }; + }; + + var insertEmoticon = function (editor, ch) { + editor.insertContent(ch); + }; + + var hasOwnProperty = Object.prototype.hasOwnProperty; + var shallow = function (old, nu) { + return 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 merge = baseMerge(shallow); + + var keys = Object.keys; + var hasOwnProperty$1 = Object.hasOwnProperty; + var each = 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(obj, function (x, i) { + var tuple = f(x, i); + r[tuple.k] = tuple.v; + }); + return r; + }; + var has = function (obj, key) { + return hasOwnProperty$1.call(obj, key); + }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.Resource'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay'); + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.Promise'); + + var DEFAULT_ID = 'tinymce.plugins.emoticons'; + var getEmoticonDatabaseUrl = function (editor, pluginUrl) { + return editor.getParam('emoticons_database_url', pluginUrl + '/js/emojis' + editor.suffix + '.js'); + }; + var getEmoticonDatabaseId = function (editor) { + return editor.getParam('emoticons_database_id', DEFAULT_ID, 'string'); + }; + var getAppendedEmoticons = function (editor) { + return editor.getParam('emoticons_append', {}, 'object'); + }; + var Settings = { + getEmoticonDatabaseUrl: getEmoticonDatabaseUrl, + getEmoticonDatabaseId: getEmoticonDatabaseId, + getAppendedEmoticons: getAppendedEmoticons + }; + + var ALL_CATEGORY = 'All'; + var categoryNameMap = { + symbols: 'Symbols', + people: 'People', + animals_and_nature: 'Animals and Nature', + food_and_drink: 'Food and Drink', + activity: 'Activity', + travel_and_places: 'Travel and Places', + objects: 'Objects', + flags: 'Flags', + user: 'User Defined' + }; + var translateCategory = function (categories, name) { + return has(categories, name) ? categories[name] : name; + }; + var getUserDefinedEmoticons = function (editor) { + var userDefinedEmoticons = Settings.getAppendedEmoticons(editor); + return map$1(userDefinedEmoticons, function (value) { + return merge({ + keywords: [], + category: 'user' + }, value); + }); + }; + var initDatabase = function (editor, databaseUrl, databaseId) { + var categories = Cell(Option.none()); + var all = Cell(Option.none()); + var processEmojis = function (emojis) { + var cats = {}; + var everything = []; + each(emojis, function (lib, title) { + var entry = { + title: title, + keywords: lib.keywords, + char: lib.char, + category: translateCategory(categoryNameMap, lib.category) + }; + var current = cats[entry.category] !== undefined ? cats[entry.category] : []; + cats[entry.category] = current.concat([entry]); + everything.push(entry); + }); + categories.set(Option.some(cats)); + all.set(Option.some(everything)); + }; + editor.on('init', function () { + global$1.load(databaseId, databaseUrl).then(function (emojis) { + var userEmojis = getUserDefinedEmoticons(editor); + processEmojis(merge(emojis, userEmojis)); + }, function (err) { + domGlobals.console.log('Failed to load emoticons: ' + err); + categories.set(Option.some({})); + all.set(Option.some([])); + }); + }); + var listCategory = function (category) { + if (category === ALL_CATEGORY) { + return listAll(); + } + return categories.get().bind(function (cats) { + return Option.from(cats[category]); + }).getOr([]); + }; + var listAll = function () { + return all.get().getOr([]); + }; + var listCategories = function () { + return [ALL_CATEGORY].concat(keys(categories.get().getOr({}))); + }; + var waitForLoad = function () { + if (hasLoaded()) { + return global$3.resolve(true); + } else { + return new global$3(function (resolve, reject) { + var numRetries = 15; + var interval = global$2.setInterval(function () { + if (hasLoaded()) { + global$2.clearInterval(interval); + resolve(true); + } else { + numRetries--; + if (numRetries < 0) { + domGlobals.console.log('Could not load emojis from url: ' + databaseUrl); + global$2.clearInterval(interval); + reject(false); + } + } + }, 100); + }); + } + }; + var hasLoaded = function () { + return categories.get().isSome() && all.get().isSome(); + }; + return { + listCategories: listCategories, + hasLoaded: hasLoaded, + waitForLoad: waitForLoad, + listAll: listAll, + listCategory: listCategory + }; + }; + + var patternName = 'pattern'; + var open = function (editor, database) { + var initialState = { + pattern: '', + results: emojisFrom(database.listAll(), '', Option.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 ? Option.some(300) : Option.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(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 Dialog = { open: open }; + + var register = function (editor, database) { + var onAction = function () { + return Dialog.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 + }); + }; + var Buttons = { register: register }; + + function Plugin () { + global.add('emoticons', function (editor, pluginUrl) { + var databaseUrl = Settings.getEmoticonDatabaseUrl(editor, pluginUrl); + var databaseId = Settings.getEmoticonDatabaseId(editor); + var database = initDatabase(editor, databaseUrl, databaseId); + Buttons.register(editor, database); + init(editor, database); + }); + } + + Plugin(); -/*global tinymce:true */ - -tinymce.PluginManager.add('emoticons', function(editor, url) { - var emoticons = [ - ["cool", "cry", "embarassed", "foot-in-mouth"], - ["frown", "innocent", "kiss", "laughing"], - ["money-mouth", "sealed", "smile", "surprised"], - ["tongue-out", "undecided", "wink", "yell"] - ]; - - function getHtml() { - var emoticonsHtml; - - emoticonsHtml = ''; - - tinymce.each(emoticons, function(row) { - emoticonsHtml += ''; - - tinymce.each(row, function(icon) { - var emoticonUrl = url + '/img/smiley-' + icon + '.gif'; - - emoticonsHtml += ''; - }); - - emoticonsHtml += ''; - }); - - emoticonsHtml += ''; - - return emoticonsHtml; - } - - editor.addButton('emoticons', { - type: 'panelbutton', - popoverAlign: 'bc-tl', - panel: { - autohide: true, - html: getHtml, - onclick: function(e) { - var linkElm = editor.dom.getParent(e.target, 'a'); - - if (linkElm) { - editor.insertContent(''); - this.hide(); - } - } - }, - tooltip: 'Emoticons' - }); -/* - editor.addButton('emoticons', { - type: 'panelbutton', - popoverAlign: 'bc-tl', - panel: { - layout: 'flex', - spacing: 5, - padding: 5, - autohide: true, - items: [ - {type: 'textbox', label: 'Url'}, - {type: 'button', text: 'OK'} - ] - }, - tooltip: 'Emoticons' - });*/ -}); +}(window)); diff --git a/lib/tinymce/js/tinymce/plugins/emoticons/plugin.min.js b/lib/tinymce/js/tinymce/plugins/emoticons/plugin.min.js index 9ba514a6..12ca5c7a 100644 --- a/lib/tinymce/js/tinymce/plugins/emoticons/plugin.min.js +++ b/lib/tinymce/js/tinymce/plugins/emoticons/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("emoticons",function(e,t){function n(){var e;return e='',tinymce.each(o,function(n){e+="",tinymce.each(n,function(n){var o=t+"/img/smiley-"+n+".gif";e+=''}),e+=""}),e+=""}var o=[["cool","cry","embarassed","foot-in-mouth"],["frown","innocent","kiss","laughing"],["money-mouth","sealed","smile","surprised"],["tongue-out","undecided","wink","yell"]];e.addButton("emoticons",{type:"panelbutton",popoverAlign:"bc-tl",panel:{autohide:!0,html:n,onclick:function(t){var n=e.dom.getParent(t.target,"a");n&&(e.insertContent(''),this.hide())}},tooltip:"Emoticons"})}); \ 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.1.6 (2020-01-28) + */ +!function(l){"use strict";function n(){}function i(n){return function(){return n}}function t(){return a}var e,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=i(!1),u=i(!0),a=(e={fold:function(n,t){return n()},is:c,isSome:c,isNone:u,getOr:f,getOrThunk:s,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:f,orThunk:s,map:t,each:n,bind:t,exists:c,forall:u,filter:t,equals:o,equals_:o,toArray:function(){return[]},toString:i("none()")},Object.freeze&&Object.freeze(e),e);function o(n){return n.isNone()}function s(n){return n()}function f(n){return n}function m(n,t){return-1!==n.indexOf(t)}function g(n,t){return m(n.title.toLowerCase(),t)||function(n,t){for(var e=0,r=n.length;eCould not load emoticons

    "}]},buttons:[{type:"cancel",text:"Close",primary:!0}],initialData:{pattern:"",results:[]}}),a.focus(M),a.unblock()}))},R=function(n,t){function e(){return U(n,t)}n.ui.registry.addButton("emoticons",{tooltip:"Emoticons",icon:"emoji",onAction:e}),n.ui.registry.addMenuItem("emoticons",{text:"Emoticons...",icon:"emoji",onAction:e})};!function B(){r.add("emoticons",function(n,t){var e=E(n,t),r=F(n),o=h(n,e,r);R(n,o),function(r,o){r.ui.registry.addAutocompleter("emoticons",{ch:":",columns:"auto",minChars:2,fetch:function(t,e){return o.waitForLoad().then(function(){var n=o.listAll();return d(n,t,A.some(e))})},onAction:function(n,t,e){r.selection.setRng(t),r.insertContent(e),n.hide()}})}(n,o)})}()}(window); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/plugins/example/plugin.js b/lib/tinymce/js/tinymce/plugins/example/plugin.js deleted file mode 100644 index aeb76530..00000000 --- a/lib/tinymce/js/tinymce/plugins/example/plugin.js +++ /dev/null @@ -1,45 +0,0 @@ -/** - * plugin.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*jshint unused:false */ -/*global tinymce:true */ - -tinymce.PluginManager.add('example', function(editor) { - function showSourceEditor() { - editor.windowManager.open({ - title: "Source code", - body: { - type: 'textbox', - name: 'code', - multiline: true, - minWidth: 600, - minHeight: 500, - value: editor.getContent(), - spellcheck: false - }, - onSubmit: function(e) { - editor.setContent(e.data.code); - } - }); - } - - editor.addButton('code', { - icon: 'code', - tooltip: 'HTML', - onclick: showSourceEditor - }); - - editor.addMenuItem('code', { - icon: 'code', - text: 'hTMl', - context: 'tools', - onclick: showSourceEditor - }); -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/plugins/example/plugin.min.js b/lib/tinymce/js/tinymce/plugins/example/plugin.min.js deleted file mode 100644 index 1d9c2160..00000000 --- a/lib/tinymce/js/tinymce/plugins/example/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("example",function(){}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/plugins/example_dependency/plugin.js b/lib/tinymce/js/tinymce/plugins/example_dependency/plugin.js deleted file mode 100644 index 4f1c8efe..00000000 --- a/lib/tinymce/js/tinymce/plugins/example_dependency/plugin.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * plugin.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/*jshint unused:false */ -/*global tinymce:true */ - -/** - * Register the plugin, specifying the list of the plugins that this plugin depends on. They are specified in a list, - * with the list loaded in order. plugins in this list will be initialised when this plugin is initialized. (before the - * init method is called). plugins in a depends list should typically be specified using the short name). If neccesary - * this can be done with an object which has the url to the plugin and the shortname. - */ -tinymce.PluginManager.add('example_dependency', function(editor) { - // Example logic here -}, ['example']); diff --git a/lib/tinymce/js/tinymce/plugins/example_dependency/plugin.min.js b/lib/tinymce/js/tinymce/plugins/example_dependency/plugin.min.js deleted file mode 100644 index e61bf473..00000000 --- a/lib/tinymce/js/tinymce/plugins/example_dependency/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("example_dependency",function(){},["example"]); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/plugins/fullpage/plugin.js b/lib/tinymce/js/tinymce/plugins/fullpage/plugin.js index 0d7c4c76..05a9ed2d 100644 --- a/lib/tinymce/js/tinymce/plugins/fullpage/plugin.js +++ b/lib/tinymce/js/tinymce/plugins/fullpage/plugin.js @@ -1,436 +1,582 @@ /** - * 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.1.6 (2020-01-28) */ - -/*global tinymce:true */ - -tinymce.PluginManager.add('fullpage', function(editor) { - var each = tinymce.each, Node = tinymce.html.Node; - var head, foot; - - function showDialog() { - var data = htmlToData(); - - editor.windowManager.open({ - title: 'Document properties', - data: data, - defaults: {type: 'textbox', size: 40}, - body: [ - {name: 'title', label: 'Title'}, - {name: 'keywords', label: 'Keywords'}, - {name: 'description', label: 'Description'}, - {name: 'robots', label: 'Robots'}, - {name: 'author', label: 'Author'}, - {name: 'docencoding', label: 'Encoding'} - ], - onSubmit: function(e) { - dataToHtml(tinymce.extend(data, e.data)); - } - }); - } - - function htmlToData() { - var headerFragment = parseHeader(), data = {}, elm, matches; - - function getAttr(elm, name) { - var value = elm.attr(name); - - return value || ''; - } - - // Default some values - data.fontface = editor.getParam("fullpage_default_fontface", ""); - data.fontsize = editor.getParam("fullpage_default_fontsize", ""); - - // Parse XML PI - elm = headerFragment.firstChild; - if (elm.type == 7) { - data.xml_pi = true; - matches = /encoding="([^"]+)"/.exec(elm.value); - if (matches) { - data.docencoding = matches[1]; - } - } - - // Parse doctype - elm = headerFragment.getAll('#doctype')[0]; - if (elm) { - data.doctype = '"; - } - - // Parse title element - elm = headerFragment.getAll('title')[0]; - if (elm && elm.firstChild) { - data.title = elm.firstChild.value; - } - - // Parse meta elements - each(headerFragment.getAll('meta'), function(meta) { - var name = meta.attr('name'), httpEquiv = meta.attr('http-equiv'), 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]; - } - } - }); - - // Parse html attribs - elm = headerFragment.getAll('html')[0]; - if (elm) { - data.langcode = getAttr(elm, 'lang') || getAttr(elm, 'xml:lang'); - } - - // Parse stylesheet - elm = headerFragment.getAll('link')[0]; - if (elm && elm.attr('rel') == 'stylesheet') { - data.stylesheet = elm.attr('href'); - } - - // Parse body parts - 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; - } - - function dataToHtml(data) { - var headerFragment, headElement, html, elm, value, 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); - } - } - - headerFragment = parseHeader(); - headElement = headerFragment.getAll('head')[0]; - if (!headElement) { - elm = headerFragment.getAll('html')[0]; - headElement = new Node('head', 1); - - if (elm.firstChild) { - elm.insert(headElement, elm.firstChild, true); - } else { - elm.append(headElement); - } - } - - // Add/update/remove XML-PI - elm = headerFragment.firstChild; - if (data.xml_pi) { - value = 'version="1.0"'; - - if (data.docencoding) { - value += ' encoding="' + data.docencoding + '"'; - } - - if (elm.type != 7) { - elm = new Node('xml', 7); - headerFragment.insert(elm, headerFragment.firstChild, true); - } - - elm.value = value; - } else if (elm && elm.type == 7) { - elm.remove(); - } - - // Add/update/remove doctype - elm = headerFragment.getAll('#doctype')[0]; - if (data.doctype) { - if (!elm) { - elm = new Node('#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(); - } - - // Add meta encoding - if (data.docencoding) { - elm = null; - each(headerFragment.getAll('meta'), function(meta) { - if (meta.attr('http-equiv') == 'Content-Type') { - elm = meta; - } - }); - - if (!elm) { - elm = new Node('meta', 1); - elm.attr('http-equiv', 'Content-Type'); - elm.shortEnded = true; - addHeadNode(elm); - } - - elm.attr('content', 'text/html; charset=' + data.docencoding); - } - - // Add/update/remove title - elm = headerFragment.getAll('title')[0]; - if (data.title) { - if (!elm) { - elm = new Node('title', 1); - elm.append(new Node('#text', 3)).value = data.title; - addHeadNode(elm); - } - } else if (elm) { - elm.remove(); - } - - // Add/update/remove meta - each('keywords,description,author,copyright,robots'.split(','), function(name) { - var nodes = headerFragment.getAll('meta'), i, meta, 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 Node('meta', 1); - elm.attr('name', name); - elm.attr('content', value); - elm.shortEnded = true; - - addHeadNode(elm); - } - }); - - // Add/update/delete link - elm = headerFragment.getAll('link')[0]; - if (elm && elm.attr('rel') == 'stylesheet') { - if (data.stylesheet) { - elm.attr('href', data.stylesheet); - } else { - elm.remove(); - } - } else if (data.stylesheet) { - elm = new Node('link', 1); - elm.attr({ - rel : 'stylesheet', - text : 'text/css', - href : data.stylesheet - }); - elm.shortEnded = true; - - addHeadNode(elm); - } - - // Update body attributes - 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); - - // Update iframe body as well - dom.setAttribs(editor.getBody(), { - style : data.style, - dir : data.dir, - vLink : data.visited_color, - link : data.link_color, - aLink : data.active_color - }); - } - - // Set html attributes - elm = headerFragment.getAll('html')[0]; - if (elm) { - setAttr(elm, 'lang', data.langcode); - setAttr(elm, 'xml:lang', data.langcode); - } - - // No need for a head element - if (!headElement.firstChild) { - headElement.remove(); - } - - // Serialize header fragment and crop away body part - html = new tinymce.html.Serializer({ - validate: false, - indent: true, - apply_source_formatting : true, - indent_before: 'head,html,body,meta,title,script,link,style', - indent_after: 'head,html,body,meta,title,script,link,style' - }).serialize(headerFragment); - - head = html.substring(0, html.indexOf('')); - } - - function parseHeader() { - // Parse the contents with a DOM parser - return new tinymce.html.DomParser({ - validate: false, - root_name: '#document' - }).parse(head); - } - - function setContent(o) { - var startPos, endPos, content = o.content, headerFragment, styles = '', dom = editor.dom, elm; - - function low(s) { - return s.replace(/<\/?[A-Z]+/g, function(a) { - return a.toLowerCase(); - }); - } - - // Ignore raw updated if we already have a head, this will fix issues with undo/redo keeping the head/foot separate - if (o.format == 'raw' && head) { - return; - } - - if (o.source_view && editor.getParam('fullpage_hide_in_source_view')) { - return; - } - - // Parse out head, body and footer - content = content.replace(/<(\/?)BODY/gi, '<$1body'); - startPos = content.indexOf('', startPos); - head = low(content.substring(0, startPos + 1)); - - endPos = content.indexOf('\n'; - } - - header += editor.getParam('fullpage_default_doctype', ''); - header += '\n\n\n'; - - if ((value = editor.getParam('fullpage_default_title'))) { - header += '' + value + '\n'; - } - - if ((value = editor.getParam('fullpage_default_encoding'))) { - header += '\n'; - } - - if ((value = editor.getParam('fullpage_default_font_family'))) { - styles += 'font-family: ' + value + ';'; - } - - if ((value = editor.getParam('fullpage_default_font_size'))) { - styles += 'font-size: ' + value + ';'; - } - - if ((value = editor.getParam('fullpage_default_text_color'))) { - styles += 'color: ' + value + ';'; - } - - header += '\n\n'; - - return header; - } - - function getContent(o) { - if (!o.selection && (!o.source_view || !editor.getParam('fullpage_hide_in_source_view'))) { - o.content = tinymce.trim(head) + '\n' + tinymce.trim(o.content) + '\n' + tinymce.trim(foot); - } - } - - editor.addCommand('mceFullPageProperties', showDialog); - - editor.addButton('fullpage', { - title: 'Document properties', - cmd : 'mceFullPageProperties' - }); - - editor.addMenuItem('fullpage', { - text: 'Document properties', - cmd : 'mceFullPageProperties', - context: 'file' - }); - - editor.on('BeforeSetContent', setContent); - editor.on('GetContent', getContent); -}); +(function (domGlobals) { + 'use strict'; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + 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 Settings = { + shouldHideInSourceView: shouldHideInSourceView, + getDefaultXmlPi: getDefaultXmlPi, + getDefaultEncoding: getDefaultEncoding, + getDefaultFontFamily: getDefaultFontFamily, + getDefaultFontSize: getDefaultFontSize, + getDefaultTextColor: getDefaultTextColor, + getDefaultTitle: getDefaultTitle, + getDefaultDocType: getDefaultDocType + }; + + var parseHeader = function (head) { + return global$2({ + validate: false, + root_name: '#document' + }).parse(head); + }; + 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 = Settings.getDefaultFontFamily(editor); + data.fontsize = Settings.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 headerFragment, headElement, html, 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); + } + } + 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(); + } + 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 Parser = { + parseHeader: parseHeader, + htmlToData: htmlToData, + dataToHtml: dataToHtml + }; + + var hasOwnProperty = Object.prototype.hasOwnProperty; + var shallow = function (old, nu) { + return 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 merge = baseMerge(shallow); + + var open = function (editor, headState) { + var data = Parser.htmlToData(editor, headState.get()); + var defaultData = { + title: '', + keywords: '', + description: '', + robots: '', + author: '', + docencoding: '' + }; + var initialData = merge(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 = Parser.dataToHtml(editor, global$1.extend(data, nuData), headState.get()); + headState.set(headHtml); + api.close(); + } + }); + }; + var Dialog = { open: open }; + + var register = function (editor, headState) { + editor.addCommand('mceFullPageProperties', function () { + Dialog.open(editor, headState); + }); + }; + var Commands = { register: register }; + + 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 Protect = { + protectHtml: protectHtml, + unprotectHtml: unprotectHtml + }; + + 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, headerFragment, styles = ''; + var dom = editor.dom; + if (evt.selection) { + return; + } + content = Protect.protectHtml(editor.settings.protect, evt.content); + if (evt.format === 'raw' && headState.get()) { + return; + } + if (evt.source_view && Settings.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'); + } + headerFragment = Parser.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(domGlobals.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 (Settings.getDefaultXmlPi(editor)) { + var piEncoding = Settings.getDefaultEncoding(editor); + header += '\n'; + } + header += Settings.getDefaultDocType(editor); + header += '\n\n\n'; + if (value = Settings.getDefaultTitle(editor)) { + header += '' + value + '\n'; + } + if (value = Settings.getDefaultEncoding(editor)) { + header += '\n'; + } + if (value = Settings.getDefaultFontFamily(editor)) { + styles += 'font-family: ' + value + ';'; + } + if (value = Settings.getDefaultFontSize(editor)) { + styles += 'font-size: ' + value + ';'; + } + if (value = Settings.getDefaultTextColor(editor)) { + styles += 'color: ' + value + ';'; + } + header += '\n\n'; + return header; + }; + var handleGetContent = function (editor, head, foot, evt) { + if (!evt.selection && (!evt.source_view || !Settings.shouldHideInSourceView(editor))) { + evt.content = Protect.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 FilterContent = { setup: setup }; + + 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'); + } + }); + }; + var Buttons = { register: register$1 }; + + function Plugin () { + global.add('fullpage', function (editor) { + var headState = Cell(''), footState = Cell(''); + Commands.register(editor, headState); + Buttons.register(editor); + FilterContent.setup(editor, headState, footState); + }); + } + + Plugin(); + +}(window)); diff --git a/lib/tinymce/js/tinymce/plugins/fullpage/plugin.min.js b/lib/tinymce/js/tinymce/plugins/fullpage/plugin.min.js index 5bd47c03..558b2559 100644 --- a/lib/tinymce/js/tinymce/plugins/fullpage/plugin.min.js +++ b/lib/tinymce/js/tinymce/plugins/fullpage/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("fullpage",function(e){function t(){var t=n();e.windowManager.open({title:"Document properties",data:t,defaults:{type:"textbox",size:40},body:[{name:"title",label:"Title"},{name:"keywords",label:"Keywords"},{name:"description",label:"Description"},{name:"robots",label:"Robots"},{name:"author",label:"Author"},{name:"docencoding",label:"Encoding"}],onSubmit:function(e){i(tinymce.extend(t,e.data))}})}function n(){function t(e,t){var n=e.attr(t);return n||""}var n,i,a=o(),r={};return r.fontface=e.getParam("fullpage_default_fontface",""),r.fontsize=e.getParam("fullpage_default_fontsize",""),n=a.firstChild,7==n.type&&(r.xml_pi=!0,i=/encoding="([^"]+)"/.exec(n.value),i&&(r.docencoding=i[1])),n=a.getAll("#doctype")[0],n&&(r.doctype=""),n=a.getAll("title")[0],n&&n.firstChild&&(r.title=n.firstChild.value),d(a.getAll("meta"),function(e){var t,n=e.attr("name"),i=e.attr("http-equiv");n?r[n.toLowerCase()]=e.attr("content"):"Content-Type"==i&&(t=/charset\s*=\s*(.*)\s*/gi.exec(e.attr("content")),t&&(r.docencoding=t[1]))}),n=a.getAll("html")[0],n&&(r.langcode=t(n,"lang")||t(n,"xml:lang")),n=a.getAll("link")[0],n&&"stylesheet"==n.attr("rel")&&(r.stylesheet=n.attr("href")),n=a.getAll("body")[0],n&&(r.langdir=t(n,"dir"),r.style=t(n,"style"),r.visited_color=t(n,"vlink"),r.link_color=t(n,"link"),r.active_color=t(n,"alink")),r}function i(t){function n(e,t,n){e.attr(t,n?n:void 0)}function i(e){r.firstChild?r.insert(e,r.firstChild):r.append(e)}var a,r,l,s,g,m=e.dom;a=o(),r=a.getAll("head")[0],r||(s=a.getAll("html")[0],r=new u("head",1),s.firstChild?s.insert(r,s.firstChild,!0):s.append(r)),s=a.firstChild,t.xml_pi?(g='version="1.0"',t.docencoding&&(g+=' encoding="'+t.docencoding+'"'),7!=s.type&&(s=new u("xml",7),a.insert(s,a.firstChild,!0)),s.value=g):s&&7==s.type&&s.remove(),s=a.getAll("#doctype")[0],t.doctype?(s||(s=new u("#doctype",10),t.xml_pi?a.insert(s,a.firstChild):i(s)),s.value=t.doctype.substring(9,t.doctype.length-1)):s&&s.remove(),t.docencoding&&(s=null,d(a.getAll("meta"),function(e){"Content-Type"==e.attr("http-equiv")&&(s=e)}),s||(s=new u("meta",1),s.attr("http-equiv","Content-Type"),s.shortEnded=!0,i(s)),s.attr("content","text/html; charset="+t.docencoding)),s=a.getAll("title")[0],t.title?s||(s=new u("title",1),s.append(new u("#text",3)).value=t.title,i(s)):s&&s.remove(),d("keywords,description,author,copyright,robots".split(","),function(e){var n,o,r=a.getAll("meta"),l=t[e];for(n=0;r.length>n;n++)if(o=r[n],o.attr("name")==e)return l?o.attr("content",l):o.remove(),void 0;l&&(s=new u("meta",1),s.attr("name",e),s.attr("content",l),s.shortEnded=!0,i(s))}),s=a.getAll("link")[0],s&&"stylesheet"==s.attr("rel")?t.stylesheet?s.attr("href",t.stylesheet):s.remove():t.stylesheet&&(s=new u("link",1),s.attr({rel:"stylesheet",text:"text/css",href:t.stylesheet}),s.shortEnded=!0,i(s)),s=a.getAll("body")[0],s&&(n(s,"dir",t.langdir),n(s,"style",t.style),n(s,"vlink",t.visited_color),n(s,"link",t.link_color),n(s,"alink",t.active_color),m.setAttribs(e.getBody(),{style:t.style,dir:t.dir,vLink:t.visited_color,link:t.link_color,aLink:t.active_color})),s=a.getAll("html")[0],s&&(n(s,"lang",t.langcode),n(s,"xml:lang",t.langcode)),r.firstChild||r.remove(),l=new tinymce.html.Serializer({validate:!1,indent:!0,apply_source_formatting:!0,indent_before:"head,html,body,meta,title,script,link,style",indent_after:"head,html,body,meta,title,script,link,style"}).serialize(a),c=l.substring(0,l.indexOf(""))}function o(){return new tinymce.html.DomParser({validate:!1,root_name:"#document"}).parse(c)}function a(t){function n(e){return e.replace(/<\/?[A-Z]+/g,function(e){return e.toLowerCase()})}var i,a,l,u,g=t.content,m="",f=e.dom;"raw"==t.format&&c||t.source_view&&e.getParam("fullpage_hide_in_source_view")||(g=g.replace(/<(\/?)BODY/gi,"<$1body"),i=g.indexOf("",i),c=n(g.substring(0,i+1)),a=g.indexOf("\n"),l=o(),d(l.getAll("style"),function(e){e.firstChild&&(m+=e.firstChild.value)}),u=l.getAll("body")[0],u&&f.setAttribs(e.getBody(),{style:u.attr("style")||"",dir:u.attr("dir")||"",vLink:u.attr("vlink")||"",link:u.attr("link")||"",aLink:u.attr("alink")||""}),f.remove("fullpage_styles"),m&&(f.add(e.getDoc().getElementsByTagName("head")[0],"style",{id:"fullpage_styles"},m),u=f.get("fullpage_styles"),u.styleSheet&&(u.styleSheet.cssText=m)))}function r(){var t,n="",i="";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=e.getParam("fullpage_default_encoding"))&&(n+='\n'),(t=e.getParam("fullpage_default_font_family"))&&(i+="font-family: "+t+";"),(t=e.getParam("fullpage_default_font_size"))&&(i+="font-size: "+t+";"),(t=e.getParam("fullpage_default_text_color"))&&(i+="color: "+t+";"),n+="\n\n"}function l(t){t.selection||t.source_view&&e.getParam("fullpage_hide_in_source_view")||(t.content=tinymce.trim(c)+"\n"+tinymce.trim(t.content)+"\n"+tinymce.trim(s))}var c,s,d=tinymce.each,u=tinymce.html.Node;e.addCommand("mceFullPageProperties",t),e.addButton("fullpage",{title:"Document properties",cmd:"mceFullPageProperties"}),e.addMenuItem("fullpage",{text:"Document properties",cmd:"mceFullPageProperties",context:"file"}),e.on("BeforeSetContent",a),e.on("GetContent",l)}); \ 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.1.6 (2020-01-28) + */ +!function(m){"use strict";function f(t){return e({validate:!1,root_name:"#document"}).parse(t)}function g(t){return t.replace(/<\/?[A-Z]+/g,function(t){return t.toLowerCase()})}var o,i=function(t){function e(){return n}var n=t;return{get:e,set:function(t){n=t},clone:function(){return i(e())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),p=tinymce.util.Tools.resolve("tinymce.util.Tools"),e=tinymce.util.Tools.resolve("tinymce.html.DomParser"),h=tinymce.util.Tools.resolve("tinymce.html.Node"),y=tinymce.util.Tools.resolve("tinymce.html.Serializer"),v=function(t){return t.getParam("fullpage_hide_in_source_view")},r=function(t){return t.getParam("fullpage_default_xml_pi")},a=function(t){return t.getParam("fullpage_default_encoding")},c=function(t){return t.getParam("fullpage_default_font_family")},u=function(t){return t.getParam("fullpage_default_font_size")},s=function(t){return t.getParam("fullpage_default_text_color")},d=function(t){return t.getParam("fullpage_default_title")},_=function(t){return t.getParam("fullpage_default_doctype","")},b=f,n=function(t,e){var n,i,l=f(e),r={};function o(t,e){return t.attr(e)||""}return r.fontface=c(t),r.fontsize=u(t),7===(n=l.firstChild).type&&(r.xml_pi=!0,(i=/encoding="([^"]+)"/.exec(n.value))&&(r.docencoding=i[1])),(n=l.getAll("#doctype")[0])&&(r.doctype=""),(n=l.getAll("title")[0])&&n.firstChild&&(r.title=n.firstChild.value),p.each(l.getAll("meta"),function(t){var e,n=t.attr("name"),i=t.attr("http-equiv");n?r[n.toLowerCase()]=t.attr("content"):"Content-Type"===i&&(e=/charset\s*=\s*(.*)\s*/gi.exec(t.attr("content")))&&(r.docencoding=e[1])}),(n=l.getAll("html")[0])&&(r.langcode=o(n,"lang")||o(n,"xml:lang")),r.stylesheets=[],p.each(l.getAll("link"),function(t){"stylesheet"===t.attr("rel")&&r.stylesheets.push(t.attr("href"))}),(n=l.getAll("body")[0])&&(r.langdir=o(n,"dir"),r.style=o(n,"style"),r.visited_color=o(n,"vlink"),r.link_color=o(n,"link"),r.active_color=o(n,"alink")),r},x=function(t,r,e){var o,n,i,a,l,c=t.dom;function u(t,e,n){t.attr(e,n||undefined)}function s(t){n.firstChild?n.insert(t,n.firstChild):n.append(t)}o=f(e),(n=o.getAll("head")[0])||(a=o.getAll("html")[0],n=new h("head",1),a.firstChild?a.insert(n,a.firstChild,!0):a.append(n)),a=o.firstChild,r.xml_pi?(l='version="1.0"',r.docencoding&&(l+=' encoding="'+r.docencoding+'"'),7!==a.type&&(a=new h("xml",7),o.insert(a,o.firstChild,!0)),a.value=l):a&&7===a.type&&a.remove(),a=o.getAll("#doctype")[0],r.doctype?(a||(a=new h("#doctype",10),r.xml_pi?o.insert(a,o.firstChild):s(a)),a.value=r.doctype.substring(9,r.doctype.length-1)):a&&a.remove(),a=null,p.each(o.getAll("meta"),function(t){"Content-Type"===t.attr("http-equiv")&&(a=t)}),r.docencoding?(a||((a=new h("meta",1)).attr("http-equiv","Content-Type"),a.shortEnded=!0,s(a)),a.attr("content","text/html; charset="+r.docencoding)):a&&a.remove(),a=o.getAll("title")[0],r.title?(a?a.empty():s(a=new h("title",1)),a.append(new h("#text",3)).value=r.title):a&&a.remove(),p.each("keywords,description,author,copyright,robots".split(","),function(t){var e,n,i=o.getAll("meta"),l=r[t];for(e=0;e"))},C=Object.prototype.hasOwnProperty,k=(o=function(t,e){return e},function(){for(var t=new Array(arguments.length),e=0;e/g,function(t,e){return unescape(e)})},T=p.each,O=function(t){var e,n="",i="";if(r(t)){var l=a(t);n+='\n'}return n+=_(t),n+="\n\n\n",(e=d(t))&&(n+=""+e+"\n"),(e=a(t))&&(n+='\n'),(e=c(t))&&(i+="font-family: "+e+";"),(e=u(t))&&(i+="font-size: "+e+";"),(e=s(t))&&(i+="color: "+e+";"),n+="\n\n"},D=function(e,n,i){e.on("BeforeSetContent",function(t){!function(t,e,n,i){var l,r,o,a,c="",u=t.dom;if(!(i.selection||(o=A(t.settings.protect,i.content),"raw"===i.format&&e.get()||i.source_view&&v(t)))){0!==o.length||i.source_view||(o=p.trim(e.get())+"\n"+p.trim(o)+"\n"+p.trim(n.get())),-1!==(l=(o=o.replace(/<(\/?)BODY/gi,"<$1body")).indexOf("",l),e.set(g(o.substring(0,l+1))),-1===(r=o.indexOf("\n")),a=b(e.get()),T(a.getAll("style"),function(t){t.firstChild&&(c+=t.firstChild.value)});var s=a.getAll("body")[0];s&&u.setAttribs(t.getBody(),{style:s.attr("style")||"",dir:s.attr("dir")||"",vLink:s.attr("vlink")||"",link:s.attr("link")||"",aLink:s.attr("alink")||""}),u.remove("fullpage_styles");var d=t.getDoc().getElementsByTagName("head")[0];if(c)u.add(d,"style",{id:"fullpage_styles"}).appendChild(m.document.createTextNode(c));var f={};p.each(d.getElementsByTagName("link"),function(t){"stylesheet"===t.rel&&t.getAttribute("data-mce-fullpage")&&(f[t.href]=t)}),p.each(a.getAll("link"),function(t){var e=t.attr("href");if(!e)return!0;f[e]||"stylesheet"!==t.attr("rel")||u.add(d,"link",{rel:"stylesheet",text:"text/css",href:e,"data-mce-fullpage":"1"}),delete f[e]}),p.each(f,function(t){t.parentNode.removeChild(t)})}}(e,n,i,t)}),e.on("GetContent",function(t){!function(t,e,n,i){i.selection||i.source_view&&v(t)||(i.content=P(p.trim(e)+"\n"+p.trim(i.content)+"\n"+p.trim(n)))}(e,n.get(),i.get(),t)})},E=function(t){t.ui.registry.addButton("fullpage",{tooltip:"Metadata and document properties",icon:"document-properties",onAction:function(){t.execCommand("mceFullPageProperties")}}),t.ui.registry.addMenuItem("fullpage",{text:"Metadata and document properties",icon:"document-properties",onAction:function(){t.execCommand("mceFullPageProperties")}})};!function z(){t.add("fullpage",function(t){var e=i(""),n=i("");w(t,e),E(t),D(t,e,n)})}()}(window); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/plugins/fullscreen/plugin.js b/lib/tinymce/js/tinymce/plugins/fullscreen/plugin.js index 24fec649..e3ed1235 100644 --- a/lib/tinymce/js/tinymce/plugins/fullscreen/plugin.js +++ b/lib/tinymce/js/tinymce/plugins/fullscreen/plugin.js @@ -1,115 +1,1114 @@ /** - * 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.1.6 (2020-01-28) */ +(function (domGlobals) { + 'use strict'; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var get = function (fullscreenState) { + return { + isFullscreen: function () { + return fullscreenState.get() !== null; + } + }; + }; + var Api = { get: get }; + + 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()') + }; + if (Object.freeze) { + Object.freeze(me); + } + 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 Option = { + some: some, + none: none, + from: from + }; + + var value = function () { + var subject = Cell(Option.none()); + var clear = function () { + subject.set(Option.none()); + }; + var set = function (s) { + subject.set(Option.some(s)); + }; + var on = function (f) { + subject.get().each(f); + }; + var isSet = function () { + return subject.get().isSome(); + }; + return { + clear: clear, + set: set, + isSet: isSet, + on: on + }; + }; + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + 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 isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isString = isType('string'); + var isArray = isType('array'); + var isBoolean = isType('boolean'); + var isFunction = isType('function'); + var isNumber = isType('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 find = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Option.some(x); + } + } + return Option.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) { + var output = map(xs, f); + return flatten(output); + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + 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 contains = function (str, substr) { + return str.indexOf(substr) !== -1; + }; + + var isSupported = function (dom) { + return dom.style !== undefined && isFunction(dom.style.getPropertyValue); + }; + + var fromHtml = function (html, scope) { + var doc = scope || domGlobals.document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + domGlobals.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 || domGlobals.document; + var node = doc.createElement(tag); + return fromDom(node); + }; + var fromText = function (text, scope) { + var doc = scope || domGlobals.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: constant(node) }; + }; + var fromPoint = function (docElm, x, y) { + var doc = docElm.dom(); + return Option.from(doc.elementFromPoint(x, y)).map(fromDom); + }; + var Element = { + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint + }; + + var ATTRIBUTE = domGlobals.Node.ATTRIBUTE_NODE; + var CDATA_SECTION = domGlobals.Node.CDATA_SECTION_NODE; + var COMMENT = domGlobals.Node.COMMENT_NODE; + var DOCUMENT = domGlobals.Node.DOCUMENT_NODE; + var DOCUMENT_TYPE = domGlobals.Node.DOCUMENT_TYPE_NODE; + var DOCUMENT_FRAGMENT = domGlobals.Node.DOCUMENT_FRAGMENT_NODE; + var ELEMENT = domGlobals.Node.ELEMENT_NODE; + var TEXT = domGlobals.Node.TEXT_NODE; + var PROCESSING_INSTRUCTION = domGlobals.Node.PROCESSING_INSTRUCTION_NODE; + var ENTITY_REFERENCE = domGlobals.Node.ENTITY_REFERENCE_NODE; + var ENTITY = domGlobals.Node.ENTITY_NODE; + var NOTATION = domGlobals.Node.NOTATION_NODE; + + var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')(); + + var type = function (element) { + return element.dom().nodeType; + }; + var isType$1 = function (t) { + return function (element) { + return type(element) === t; + }; + }; + var isText = isType$1(TEXT); + + var inBody = function (element) { + var dom = isText(element) ? element.dom().parentNode : element.dom(); + return dom !== undefined && dom !== null && dom.ownerDocument.body.contains(dom); + }; + + var rawSet = function (dom, key, value) { + if (isString(value) || isBoolean(value) || isNumber(value)) { + dom.setAttribute(key, value + ''); + } else { + domGlobals.console.error('Invalid call to Attr.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)) { + domGlobals.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 = domGlobals.window.getComputedStyle(dom); + var r = styles.getPropertyValue(property); + var v = r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r; + return v === null ? undefined : v; + }; + var getUnsafeProperty = function (dom, property) { + return isSupported(dom) ? dom.style.getPropertyValue(property) : ''; + }; + + 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 edge = 'Edge'; + var chrome = 'Chrome'; + var ie = 'IE'; + var opera = 'Opera'; + var firefox = 'Firefox'; + var safari = 'Safari'; + var isBrowser = function (name, current) { + return function () { + return current === name; + }; + }; + 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; + return { + current: current, + version: version, + isEdge: isBrowser(edge, current), + isChrome: isBrowser(chrome, current), + isIE: isBrowser(ie, current), + isOpera: isBrowser(opera, current), + isFirefox: isBrowser(firefox, current), + isSafari: isBrowser(safari, current) + }; + }; + 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 isOS = function (name, current) { + return function () { + return current === name; + }; + }; + 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; + return { + current: current, + version: version, + isWindows: isOS(windows, current), + isiOS: isOS(ios, current), + isAndroid: isOS(android, current), + isOSX: isOS(osx, current), + isLinux: isOS(linux, current), + isSolaris: isOS(solaris, current), + isFreeBSD: isOS(freebsd, current), + isChromeOS: isOS(chromeos, current) + }; + }; + 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 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 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 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 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 domGlobals.window.matchMedia(query).matches; + }; + var platform = Cell(PlatformDetection.detect(domGlobals.navigator.userAgent, mediaMatch)); + var detect$3 = function () { + return platform.get(); + }; + + var Immutable = function () { + var fields = []; + for (var _i = 0; _i < arguments.length; _i++) { + fields[_i] = arguments[_i]; + } + return function () { + var values = []; + for (var _i = 0; _i < arguments.length; _i++) { + values[_i] = arguments[_i]; + } + if (fields.length !== values.length) { + throw new Error('Wrong number of arguments to struct. Expected "[' + fields.length + ']", got ' + values.length + ' arguments'); + } + var struct = {}; + each(fields, function (name, i) { + struct[name] = constant(values[i]); + }); + return struct; + }; + }; + + var compareDocumentPosition = function (a, b, match) { + return (a.compareDocumentPosition(b) & match) !== 0; + }; + var documentPositionPreceding = function (a, b) { + return compareDocumentPosition(a, b, domGlobals.Node.DOCUMENT_POSITION_PRECEDING); + }; + var documentPositionContainedBy = function (a, b) { + return compareDocumentPosition(a, b, domGlobals.Node.DOCUMENT_POSITION_CONTAINED_BY); + }; + var Node = { + documentPositionPreceding: documentPositionPreceding, + documentPositionContainedBy: documentPositionContainedBy + }; + + var ELEMENT$1 = ELEMENT; + var DOCUMENT$1 = DOCUMENT; + var is = function (element, selector) { + var dom = element.dom(); + if (dom.nodeType !== ELEMENT$1) { + 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$1 && dom.nodeType !== DOCUMENT$1 || dom.childElementCount === 0; + }; + var all = function (selector, scope) { + var base = scope === undefined ? domGlobals.document : scope.dom(); + return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), Element.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 Node.documentPositionContainedBy(e1.dom(), e2.dom()); + }; + var browser = detect$3().browser; + var contains$1 = browser.isIE() ? ieContains : regularContains; + + var parent = function (element) { + return Option.from(element.dom().parentNode).map(Element.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 = Element.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, Element.fromDom); + }; + var spot = Immutable('element', 'offset'); + + var r = function (left, top) { + var translate = function (x, y) { + return r(left + x, top + y); + }; + return { + left: constant(left), + top: constant(top), + translate: translate + }; + }; + var Position = r; + + var isSafari = detect$3().browser.isSafari(); + var get$3 = function (_DOC) { + var doc = _DOC !== undefined ? _DOC.dom() : domGlobals.document; + var x = doc.body.scrollLeft || doc.documentElement.scrollLeft; + var y = doc.body.scrollTop || doc.documentElement.scrollTop; + return Position(x, y); + }; + + var bounds = function (x, y, width, height) { + return { + x: constant(x), + y: constant(y), + width: constant(width), + height: constant(height), + right: constant(x + width), + bottom: constant(y + height) + }; + }; + var getBounds = function (_win) { + var win = _win === undefined ? domGlobals.window : _win; + var doc = win.document; + var scroll = get$3(Element.fromDom(doc)); + var visualViewport = win['visualViewport']; + if (visualViewport !== undefined) { + return bounds(Math.max(visualViewport.pageLeft, scroll.left()), Math.max(visualViewport.pageTop, scroll.top()), visualViewport.width, visualViewport.height); + } else { + var html = doc.documentElement; + var width = html.clientWidth; + var height = html.clientHeight; + return bounds(scroll.left(), scroll.top(), width, height); + } + }; + + var fireFullscreenStateChanged = function (editor, state) { + editor.fire('FullscreenStateChanged', { state: state }); + }; + var Events = { fireFullscreenStateChanged: fireFullscreenStateChanged }; + + 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 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 (container, editorBody) { + var gatherSibilings = function (element) { + var siblings = siblings$2(element, '*:not(.tox-silver-sink)'); + return siblings; + }; + 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); + set(element, 'style', clobberStyle); + } + }; + }; + var ancestors = ancestors$1(container, '*'); + var siblings = bind(ancestors, gatherSibilings); + 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 () { + var clobberedEls = all$1('[' + attr + ']'); + each(clobberedEls, function (element) { + var restore = get$1(element, attr); + if (restore !== 'no-styles') { + set(element, 'style', restore); + } else { + remove(element, 'style'); + } + remove(element, attr); + }); + }; + var Thor = { + clobberStyles: clobberStyles, + restoreStyles: restoreStyles + }; + + var DOM = global$1.DOM; + var getScrollPos = function () { + var vp = getBounds(domGlobals.window); + return { + x: vp.x(), + y: vp.y() + }; + }; + var setScrollPos = function (pos) { + domGlobals.window.scrollTo(pos.x, pos.y); + }; + var visualViewport = domGlobals.window['visualViewport']; + var viewportUpdate = visualViewport === undefined ? { + bind: noop, + unbind: noop + } : function () { + var editorContainer = value(); + var refreshScroll = function () { + domGlobals.document.body.scrollTop = 0; + domGlobals.document.documentElement.scrollTop = 0; + }; + var refreshVisualViewport = function () { + domGlobals.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(); + visualViewport.addEventListener('resize', update); + visualViewport.addEventListener('scroll', update); + }; + var unbind = function () { + editorContainer.on(function () { + visualViewport.removeEventListener('scroll', update); + visualViewport.removeEventListener('resize', update); + }); + editorContainer.clear(); + }; + return { + bind: bind, + unbind: unbind + }; + }(); + var toggleFullscreen = function (editor, fullscreenState) { + var body = domGlobals.document.body; + var documentElement = domGlobals.document.documentElement; + var editorContainerStyle; + var editorContainer, iframe, iframeStyle; + editorContainer = editor.getContainer(); + var editorContainerS = Element.fromDom(editorContainer); + var fullscreenInfo = fullscreenState.get(); + var editorBody = Element.fromDom(editor.getBody()); + var isTouch = global$2.deviceType.isTouch(); + editorContainerStyle = editorContainer.style; + iframe = editor.getContentAreaContainer().firstChild; + iframeStyle = iframe.style; + if (!fullscreenInfo) { + var newFullScreenInfo = { + scrollPos: getScrollPos(), + containerWidth: editorContainerStyle.width, + containerHeight: editorContainerStyle.height, + containerTop: editorContainerStyle.top, + containerLeft: editorContainerStyle.left, + iframeWidth: iframeStyle.width, + iframeHeight: iframeStyle.height + }; + if (isTouch) { + Thor.clobberStyles(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', viewportUpdate.unbind); + fullscreenState.set(newFullScreenInfo); + Events.fireFullscreenStateChanged(editor, true); + } else { + iframeStyle.width = fullscreenInfo.iframeWidth; + iframeStyle.height = fullscreenInfo.iframeHeight; + editorContainerStyle.width = fullscreenInfo.containerWidth; + editorContainerStyle.height = fullscreenInfo.containerHeight; + editorContainerStyle.top = fullscreenInfo.containerTop; + editorContainerStyle.left = fullscreenInfo.containerLeft; + if (isTouch) { + Thor.restoreStyles(); + } + DOM.removeClass(body, 'tox-fullscreen'); + DOM.removeClass(documentElement, 'tox-fullscreen'); + DOM.removeClass(editorContainer, 'tox-fullscreen'); + setScrollPos(fullscreenInfo.scrollPos); + fullscreenState.set(null); + Events.fireFullscreenStateChanged(editor, false); + viewportUpdate.unbind(); + editor.off('remove', viewportUpdate.unbind); + } + }; + var Actions = { toggleFullscreen: toggleFullscreen }; + + var register = function (editor, fullscreenState) { + editor.addCommand('mceFullScreen', function () { + Actions.toggleFullscreen(editor, fullscreenState); + }); + }; + var Commands = { register: register }; + + 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', + 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) + }); + }; + var Buttons = { register: register$1 }; + + function Plugin () { + global.add('fullscreen', function (editor) { + var fullscreenState = Cell(null); + if (editor.settings.inline) { + return Api.get(fullscreenState); + } + Commands.register(editor, fullscreenState); + Buttons.register(editor, fullscreenState); + editor.addShortcut('Meta+Shift+F', '', 'mceFullScreen'); + return Api.get(fullscreenState); + }); + } + + Plugin(); -/*global tinymce:true */ - -tinymce.PluginManager.add('fullscreen', function(editor) { - var fullscreenState = false, DOM = tinymce.DOM, deltaHeight, iframeWidth, iframeHeight; - - if (editor.settings.inline) { - return; - } - - function getWindowSize() { - var w, h, win = window, doc = document; - var body = doc.body; - - // Old IE - if (body.offsetWidth) { - w = body.offsetWidth; - h = body.offsetHeight; - } - - // Modern browsers - if (win.innerWidth && win.innerHeight) { - w = win.innerWidth; - h = win.innerHeight; - } - - return {w: w, h: h}; - } - - function toggleFullscreen() { - var body = document.body, documentElement = document.documentElement; - var editorContainer, iframe, iframeStyle; - - function resize() { - DOM.setStyle(iframe, 'height', getWindowSize().h - (editorContainer.clientHeight - iframe.clientHeight)); - } - - fullscreenState = !fullscreenState; - - editorContainer = editor.getContainer().firstChild; - iframe = editor.getContentAreaContainer().firstChild; - iframeStyle = iframe.style; - - if (fullscreenState) { - iframeWidth = iframeStyle.width; - iframeHeight = iframeStyle.height; - deltaHeight = editorContainer.clientHeight - iframe.clientHeight; - iframeStyle.width = iframeStyle.height = '100%'; - - DOM.addClass(body, 'mce-fullscreen'); - DOM.addClass(documentElement, 'mce-fullscreen'); - DOM.addClass(editorContainer, 'mce-fullscreen'); - - DOM.bind(window, 'resize', resize); - resize(); - } else { - iframeStyle.width = iframeWidth; - iframeStyle.height = iframeHeight; - - DOM.removeClass(body, 'mce-fullscreen'); - DOM.removeClass(documentElement, 'mce-fullscreen'); - DOM.removeClass(editorContainer, 'mce-fullscreen'); - DOM.unbind(window, 'resize', resize); - } - - editor.fire('FullscreenStateChanged', {state: fullscreenState}); - } - - editor.on('init', function() { - editor.addShortcut('Ctrl+Alt+F', '', toggleFullscreen); - }); - - editor.addMenuItem('fullscreen', { - text: 'Fullscreen', - shortcut: 'Ctrl+Alt+F', - selectable: true, - onClick: toggleFullscreen, - onPostRender: function() { - var self = this; - - editor.on('FullscreenStateChanged', function(e) { - self.active(e.state); - }); - }, - context: 'view' - }); - - editor.addButton('fullscreen', { - tooltip: 'Fullscreen', - shortcut: 'Ctrl+Alt+F', - onClick: toggleFullscreen, - onPostRender: function() { - var self = this; - - editor.on('FullscreenStateChanged', function(e) { - self.active(e.state); - }); - } - }); - - return { - isFullscreen: function() { - return fullscreenState; - } - }; -}); \ No newline at end of file +}(window)); diff --git a/lib/tinymce/js/tinymce/plugins/fullscreen/plugin.min.js b/lib/tinymce/js/tinymce/plugins/fullscreen/plugin.min.js index 45606f26..fcb723d3 100644 --- a/lib/tinymce/js/tinymce/plugins/fullscreen/plugin.min.js +++ b/lib/tinymce/js/tinymce/plugins/fullscreen/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("fullscreen",function(e){function t(){var e,t,n=window,i=document,o=i.body;return o.offsetWidth&&(e=o.offsetWidth,t=o.offsetHeight),n.innerWidth&&n.innerHeight&&(e=n.innerWidth,t=n.innerHeight),{w:e,h:t}}function n(){function n(){l.setStyle(s,"height",t().h-(c.clientHeight-s.clientHeight))}var c,s,d,u=document.body,g=document.documentElement;r=!r,c=e.getContainer().firstChild,s=e.getContentAreaContainer().firstChild,d=s.style,r?(o=d.width,a=d.height,i=c.clientHeight-s.clientHeight,d.width=d.height="100%",l.addClass(u,"mce-fullscreen"),l.addClass(g,"mce-fullscreen"),l.addClass(c,"mce-fullscreen"),l.bind(window,"resize",n),n()):(d.width=o,d.height=a,l.removeClass(u,"mce-fullscreen"),l.removeClass(g,"mce-fullscreen"),l.removeClass(c,"mce-fullscreen"),l.unbind(window,"resize",n)),e.fire("FullscreenStateChanged",{state:r})}var i,o,a,r=!1,l=tinymce.DOM;if(!e.settings.inline)return e.on("init",function(){e.addShortcut("Ctrl+Alt+F","",n)}),e.addMenuItem("fullscreen",{text:"Fullscreen",shortcut:"Ctrl+Alt+F",selectable:!0,onClick:n,onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})},context:"view"}),e.addButton("fullscreen",{tooltip:"Fullscreen",shortcut:"Ctrl+Alt+F",onClick:n,onPostRender:function(){var t=this;e.on("FullscreenStateChanged",function(e){t.active(e.state)})}}),{isFullscreen:function(){return r}}}); \ 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.1.6 (2020-01-28) + */ +!function(l){"use strict";function e(){}function m(e){return function(){return e}}function n(){return s}var r,t=function(e){function n(){return r}var r=e;return{get:n,set:function(e){r=e},clone:function(){return t(n())}}},o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(e){return{isFullscreen:function(){return null!==e.get()}}},c=m(!1),u=m(!0),s=(r={fold:function(e,n){return e()},is:c,isSome:c,isNone:u,getOr:d,getOrThunk:f,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:m(null),getOrUndefined:m(undefined),or:d,orThunk:f,map:n,each:e,bind:n,exists:c,forall:u,filter:n,equals:a,equals_:a,toArray:function(){return[]},toString:m("none()")},Object.freeze&&Object.freeze(r),r);function a(e){return e.isNone()}function f(e){return e()}function d(e){return e}function h(n){return function(e){return function(e){if(null===e)return"null";var n=typeof e;return"object"==n&&(Array.prototype.isPrototypeOf(e)||e.constructor&&"Array"===e.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(e)||e.constructor&&"String"===e.constructor.name)?"string":n}(e)===n}}function v(e,n){for(var r=e.length,t=new Array(r),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 find = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Option.some(x); + } + } + return Option.none(); + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + var keys = Object.keys; + var hasOwnProperty = Object.hasOwnProperty; + var get$1 = function (obj, key) { + return has(obj, key) ? Option.from(obj[key]) : Option.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 Option.from(editor.getParam('help_tabs')); + }; + + 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: 'Header 1' + }, + { + shortcuts: ['Access + 2'], + action: 'Header 2' + }, + { + shortcuts: ['Access + 3'], + action: 'Header 3' + }, + { + shortcuts: ['Access + 4'], + action: 'Header 4' + }, + { + shortcuts: ['Access + 5'], + action: 'Header 5' + }, + { + shortcuts: ['Access + 6'], + action: 'Header 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 KeyboardShortcuts = { shortcuts: shortcuts }; + + 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 ConvertShortcut = { convertText: convertText }; + + var tab = function () { + var shortcutList = map(KeyboardShortcuts.shortcuts, function (shortcut) { + var shortcutText = map(shortcut.shortcuts, ConvertShortcut.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 KeyboardShortcutsTab = { tab: tab }; + + var supplant = function (str, obj) { + var isStringOrNumber = function (a) { + var t = typeof a; + return t === 'string' || t === 'number'; + }; + return str.replace(/\$\{([^{}]*)\}/g, function (fullMatch, key) { + var value = obj[key]; + return isStringOrNumber(value) ? value.toString() : fullMatch; + }); + }; + + 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*' + }, + { + 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*' + }, + { + key: 'advtable', + name: 'Advanced Tables*' + }, + { + key: 'autocorrect', + name: 'Autocorrect*' + } + ]; + var PluginUrls = { urls: urls }; + + var tab$1 = 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 = curry(supplant, '${name}'); + var maybeUrlize = function (editor, key) { + return find(PluginUrls.urls, function (x) { + return x.key === key; + }).fold(function () { + var getMetadata = editor.plugins[key].getMetadata; + return typeof getMetadata === 'function' ? makeLink(getMetadata()) : key; + }, function (x) { + return makeLink({ + name: x.name, + url: 'https://www.tiny.cloud/docs/plugins/' + x.key + }); + }); + }; + var getPluginKeys = function (editor) { + var keys$1 = keys(editor.plugins); + return editor.settings.forced_plugins === undefined ? keys$1 : filter(keys$1, not(curry(contains, editor.settings.forced_plugins))); + }; + 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 PluginsTab = { tab: tab$1 }; + + var global$3 = tinymce.util.Tools.resolve('tinymce.EditorManager'); + + var tab$2 = 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 VersionTab = { tab: tab$2 }; + + 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$3 = function () { + var body = { + type: 'htmlpanel', + presets: 'document', + html: description + }; + return { + name: 'keyboardnav', + title: 'Keyboard Navigation', + items: [body] + }; + }; + var KeyboardNavTab = { tab: tab$3 }; + + 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 versionsIdx = indexOf(names, 'versions'); + versionsIdx.each(function (idx) { + names.splice(idx, 1); + names.push('versions'); + }); + return { + tabs: tabs, + names: names + }; + }; + var parseCustomTabs = function (editor, customTabs) { + var _a; + var shortcuts = KeyboardShortcutsTab.tab(); + var nav = KeyboardNavTab.tab(); + var plugins = PluginsTab.tab(editor); + var versions = VersionTab.tab(); + 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); + Buttons.register(editor, dialogOpener); + Commands.register(editor, dialogOpener); + editor.shortcuts.add('Alt+0', 'Open help dialog', 'mceHelp'); + return api; + }); + } + + Plugin(); + +}()); diff --git a/lib/tinymce/js/tinymce/plugins/help/plugin.min.js b/lib/tinymce/js/tinymce/plugins/help/plugin.min.js new file mode 100644 index 00000000..31034b9f --- /dev/null +++ b/lib/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.1.6 (2020-01-28) + */ +!function(){"use strict";function e(){}function r(e){return function(){return e}}var a=function(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return a(t())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(e,t){e.addCommand("mceHelp",t)},s=function(e,t){e.ui.registry.addButton("help",{icon:"help",tooltip:"Help",onAction:t}),e.ui.registry.addMenuItem("help",{text:"Help",icon:"help",shortcut:"Alt+0",onAction:t})},c=function(){return(c=Object.assign||function(e){for(var t,n=1,o=arguments.length;n${name}');return{name:"plugins",title:"Plugins",items:[{type:"htmlpanel",presets:"document",html:[(n=e,null==n?"":'
    '+function(t){var e=function(e){var t=F(e.plugins);return e.settings.forced_plugins===undefined?t:function(e,t){for(var n=[],o=0,a=e.length;o"+r(t,e)+""}),o=n.length,a=n.join("");return"

    "+U.translate(["Plugins installed ({0}):",o])+"

      "+a+"
    "}(n)+"
    "),(t=y(["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"
  • "+U.translate(e)+"
  • "}).join(""),'

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

    ")].join("")}]}},N=tinymce.util.Tools.resolve("tinymce.EditorManager"),L=function(){var e,t,n='TinyMCE '+(e=N.majorVersion,t=N.minorVersion,0===e.indexOf("@")?"X.X.X":e+"."+t)+"";return{name:"versions",title:"Version",items:[{type:"htmlpanel",html:"

    "+U.translate(["You are using {0}",n])+"

    ",presets:"document"}]}},B=function(){return{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.

    "}]}};!function z(){t.add("help",function(e){var t=a({}),n=function(n){return{addTab:function(e){var t=n.get();t[e.name]=e,n.set(t)}}}(t),o=A(e,t);return s(e,o),i(e,o),e.shortcuts.add("Alt+0","Open help dialog","mceHelp"),n})}()}(); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/plugins/hr/plugin.js b/lib/tinymce/js/tinymce/plugins/hr/plugin.js index cd00cb3e..3b3bf7a0 100644 --- a/lib/tinymce/js/tinymce/plugins/hr/plugin.js +++ b/lib/tinymce/js/tinymce/plugins/hr/plugin.js @@ -1,30 +1,48 @@ /** - * 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.1.6 (2020-01-28) */ +(function () { + 'use strict'; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var register = function (editor) { + editor.addCommand('InsertHorizontalRule', function () { + editor.execCommand('mceInsertContent', false, '
    '); + }); + }; + var Commands = { register: register }; -/*global tinymce:true */ + 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'); + } + }); + }; + var Buttons = { register: register$1 }; -tinymce.PluginManager.add('hr', function(editor) { - editor.addCommand('InsertHorizontalRule', function() { - editor.execCommand('mceInsertContent', false, '
    '); - }); + function Plugin () { + global.add('hr', function (editor) { + Commands.register(editor); + Buttons.register(editor); + }); + } - editor.addButton('hr', { - icon: 'hr', - tooltip: 'Insert horizontal ruler', - cmd: 'InsertHorizontalRule' - }); + Plugin(); - editor.addMenuItem('hr', { - icon: 'hr', - text: 'Horizontal line', - cmd: 'InsertHorizontalRule', - context: 'insert' - }); -}); +}()); diff --git a/lib/tinymce/js/tinymce/plugins/hr/plugin.min.js b/lib/tinymce/js/tinymce/plugins/hr/plugin.min.js index f9268ae0..ca8ad54b 100644 --- a/lib/tinymce/js/tinymce/plugins/hr/plugin.min.js +++ b/lib/tinymce/js/tinymce/plugins/hr/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("hr",function(e){e.addCommand("InsertHorizontalRule",function(){e.execCommand("mceInsertContent",!1,"
    ")}),e.addButton("hr",{icon:"hr",tooltip:"Insert horizontal ruler",cmd:"InsertHorizontalRule"}),e.addMenuItem("hr",{icon:"hr",text:"Horizontal line",cmd:"InsertHorizontalRule",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.1.6 (2020-01-28) + */ +!function(){"use strict";var n=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=function(n){n.addCommand("InsertHorizontalRule",function(){n.execCommand("mceInsertContent",!1,"
    ")})},t=function(n){n.ui.registry.addButton("hr",{icon:"horizontal-rule",tooltip:"Horizontal line",onAction:function(){return n.execCommand("InsertHorizontalRule")}}),n.ui.registry.addMenuItem("hr",{icon:"horizontal-rule",text:"Horizontal line",onAction:function(){return n.execCommand("InsertHorizontalRule")}})};!function e(){n.add("hr",function(n){o(n),t(n)})}()}(); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/plugins/ice/plugin.js b/lib/tinymce/js/tinymce/plugins/ice/plugin.js index 5694f0c7..14082173 100644 --- a/lib/tinymce/js/tinymce/plugins/ice/plugin.js +++ b/lib/tinymce/js/tinymce/plugins/ice/plugin.js @@ -155,6 +155,16 @@ }, 500); }); + + // _____ _ + // / __ \ | | + // | / \/ ___ _ __ ___ _ __ ___ __ _ _ __ __| | + // | | / _ \ | '_ ` _ \ | '_ ` _ \ / _` || '_ \ / _` | + // | \__/\| (_) || | | | | || | | | | || (_| || | | || (_| | + // \____/ \___/ |_| |_| |_||_| |_| |_| \__,_||_| |_| \__,_| + // + // + /** * Re-initializes ice's environment - resets the environment variables for the current page * and re-initializes the internal ice range. This is useful after tinymce hides/switches @@ -284,20 +294,20 @@ if(ed.dom.hasClass(body,'CT-hide')) { //activate show changes button - ed.plugins.ice.showChangesButton.active(true); + ed.plugins.ice.showChangesButton.setActive(true); ed.dom.removeClass(body, 'CT-hide'); disabled = false; } else { //deactivate show changes button - ed.plugins.ice.showChangesButton.active(false); + ed.plugins.ice.showChangesButton.setActive(false); ed.dom.addClass(body, 'CT-hide'); } //toggle button disabling - ed.plugins.ice.acceptAllButton.disabled(disabled); - ed.plugins.ice.rejectAllButton.disabled(disabled); - ed.plugins.ice.acceptButton.disabled(disabled); - ed.plugins.ice.rejectButton.disabled(disabled); + ed.plugins.ice.acceptAllButton.setDisabled(disabled); + ed.plugins.ice.rejectAllButton.setDisabled(disabled); + ed.plugins.ice.acceptButton.setDisabled(disabled); + ed.plugins.ice.rejectButton.setDisabled(disabled); ed.execCommand('mceRepaint'); }); @@ -327,8 +337,8 @@ ed.addCommand('ice_enable', function() { changeEditor.enableChangeTracking(); //toggle buttons and call show changes - ed.plugins.ice.trackChangesButton.active(true); - ed.plugins.ice.showChangesButton.disabled(false); + ed.plugins.ice.trackChangesButton.setActive(true); + ed.plugins.ice.showChangesButton.setDisabled(false); ed.execCommand('ice_toggleshowchanges'); self.isTracking = true; }); @@ -341,13 +351,13 @@ //hide changes and toggle buttons var body = ed.getBody(); ed.dom.addClass(body, 'CT-hide'); - ed.plugins.ice.trackChangesButton.active(false); - ed.plugins.ice.showChangesButton.active(false); - ed.plugins.ice.showChangesButton.disabled(true); - ed.plugins.ice.acceptAllButton.disabled(true); - ed.plugins.ice.rejectAllButton.disabled(true); - ed.plugins.ice.acceptButton.disabled(true); - ed.plugins.ice.rejectButton.disabled(true); + ed.plugins.ice.trackChangesButton.setActive(false); + ed.plugins.ice.showChangesButton.setActive(false); + ed.plugins.ice.showChangesButton.setDisabled(true); + ed.plugins.ice.acceptAllButton.setDisabled(true); + ed.plugins.ice.rejectAllButton.setDisabled(true); + ed.plugins.ice.acceptButton.setDisabled(true); + ed.plugins.ice.rejectButton.setDisabled(true); changeEditor.disableChangeTracking(); self.isTracking = false; }); @@ -382,138 +392,169 @@ return changeEditor.pluginsManager.plugins['IceEmdashPlugin'].convertEmdash() ? 1 : 0; }); - /** - * Register Buttons - */ - ed.addButton('iceaccept', { - title : 'Accept Change', - image : url + '/img/accept.gif', - cmd : 'iceaccept', - onPostRender: function () { //assigns button and changes disabled status on node change - var self = this; + // _____ + // |_ _| + // | | ___ ___ _ __ ___ + // | | / __| / _ \ | '_ \ / __| + // _| |_ | (__ | (_) || | | |\__ \ + // \___/ \___| \___/ |_| |_||___/ + + // Icons are now svg only. Either you make a package https://www.tiny.cloud/docs/advanced/creating-an-icon-pack/ + // or you add icons as below + ed.ui.registry.addIcon('accept', ''); + ed.ui.registry.addIcon('reject', ''); + ed.ui.registry.addIcon('accept_all', ''); + ed.ui.registry.addIcon('reject_all', ''); + ed.ui.registry.addIcon('tracker', ''); + ed.ui.registry.addIcon('show_track_changes', ''); + + // ______ _ _ + // | ___ \ | | | | + // | |_/ / _ _ | |_ | |_ ___ _ __ ___ + // | ___ \| | | || __|| __| / _ \ | '_ \ / __| + // | |_/ /| |_| || |_ | |_ | (_) || | | |\__ \ + // \____/ \__,_| \__| \__| \___/ |_| |_||___/ + + ed.ui.registry.addToggleButton('iceaccept', { + tooltip: 'Accept Change', + icon: 'accept', + onAction: (_) => ed.execCommand('iceaccept'), + onSetup: (buttonApi) => { + var self = buttonApi; + const editorEventCallback = (eventApi) => { ed.plugins.ice.acceptButton = self; - ed.plugins.ice.acceptButton.disabled = self.disabled; - + ed.plugins.ice.acceptButton.disabled = self.disabled; }; + ed.on('init', editorEventCallback); ed.on('NodeChange', function (e) { if (isInsideChangeTag(e.element)) { - self.disabled(false); + self.setDisabled(false); } else { - self.disabled(true); + self.setDisabled(true); } }); + return (buttonApi) => editor.off('init', editorEventCallback); } }); - ed.addButton('icereject', { - title : 'Reject Change', - image : url + '/img/reject.gif', - cmd : 'icereject', - onPostRender: function () {//assigns button and changes disabled status on node change - var self = this; + ed.ui.registry.addToggleButton('icereject', { + tooltip: 'Reject Change', + icon: 'reject', + onAction: (_) => ed.execCommand('icereject'), + onSetup: (buttonApi) => { + var self = buttonApi; + const editorEventCallback = (eventApi) => { ed.plugins.ice.rejectButton = self; - ed.plugins.ice.rejectButton.disabled = self.disabled; - + ed.plugins.ice.rejectButton.disabled = self.disabled; }; + ed.on('init', editorEventCallback); ed.on('NodeChange', function (e) { if (isInsideChangeTag(e.element)) { - self.disabled(false); + self.setDisabled(false); } else { - self.disabled(true); + self.setDisabled(true); } }); + return (buttonApi) => editor.off('init', editorEventCallback); } }); - ed.addButton('iceacceptall', { - title : 'Accept All Changes', - image : url + '/img/ice-accept.png', - cmd : 'iceacceptall', - onPostRender: function () { //assigns button - var self = this; + ed.ui.registry.addButton('iceacceptall', { + tooltip: 'Accept All Changes', + icon: 'accept_all', + onAction: (_) => ed.execCommand('iceacceptall'), + onSetup: (buttonApi) => { + var self = buttonApi; + const editorEventCallback = (eventApi) => { ed.plugins.ice.acceptAllButton = self; ed.plugins.ice.acceptAllButton.disabled = self.disabled; + }; + ed.on('init', editorEventCallback); + return (buttonApi) => editor.off('init', editorEventCallback); } }); - ed.addButton('icerejectall', { - title : 'Reject All Changes', - image : url + '/img/ice-reject.png', - cmd : 'icerejectall', - onPostRender: function () { //assigns button - var self = this; + ed.ui.registry.addButton('icerejectall', { + tooltip: 'Reject All Changes', + icon: 'reject_all', + onAction: (_) => ed.execCommand('icerejectall'), + onSetup: (buttonApi) => { + var self = buttonApi; + const editorEventCallback = (eventApi) => { ed.plugins.ice.rejectAllButton = self; ed.plugins.ice.rejectAllButton.disabled = self.disabled; + }; + ed.on('init', editorEventCallback); + return (buttonApi) => editor.off('init', editorEventCallback); } }); - ed.addButton('ice_toggleshowchanges', { - title : 'Show/Hide Track Changes', - image : url + '/img/ice-showchanges.png', - onclick: function () { + ed.ui.registry.addToggleButton('ice_toggleshowchanges', { + tooltip: 'Show/Hide Track Changes', + icon: 'show_track_changes', + onAction: (_) => { ed.fire('ice_toggleshowchanges'); ed.execCommand('ice_toggleshowchanges'); }, - onPostRender: function () { //assigns button - var self = this; + onSetup: (buttonApi) => { + var self = buttonApi; + const editorEventCallback = (eventApi) => { ed.plugins.ice.showChangesButton = self; ed.plugins.ice.showChangesButton.disabled = self.disabled; ed.plugins.ice.showChangesButton.active = self.active; + }; + ed.on('init', editorEventCallback); + return (buttonApi) => editor.off('init', editorEventCallback); } }); - ed.addButton('ice_smartquotes', { - title : 'Convert quotes to smart quotes', - 'class' : 'mce_blockquote', - cmd : 'ice_smartquotes' + ed.ui.registry.addToggleButton('ice_smartquotes', { + icon: 'rejectAll', + tooltip: 'Convert quotes to smart quotes', + onAction: (_) => ed.execCommand('ice_smartquotes') }); - ed.addButton('ice_togglechanges', { - title : 'Turn On Track Changes ', - image : url + '/img/ice-togglechanges.png', - cmd : 'ice_togglechanges', - onPostRender: function () { //assigns button - var self = this; + ed.ui.registry.addToggleButton('ice_togglechanges', { + tooltip: 'Turn On Track Changes ', + icon: 'tracker', + onAction: (_) => { + ed.execCommand('ice_togglechanges'); + }, + onSetup: (buttonApi) => { + var self = buttonApi; + const editorEventCallback = (eventApi) => { ed.plugins.ice.trackChangesButton = self; ed.plugins.ice.trackChangesButton.disabled = self.disabled; ed.plugins.ice.trackChangesButton.active = self.active; + }; + ed.on('init', editorEventCallback); + return (buttonApi) => editor.off('init', editorEventCallback); } }); - ed.addMenuItem('iceaccept', { - icon: 'accept', - text: 'Accept Change', - onclick: function () { - ed.execCommand('iceaccept'); - }, - context: 'tools', - prependToContext: true - }); - - ed.addMenuItem('icereject', { - icon: 'reject', - text: 'Reject Change', - onclick: function () { - ed.execCommand('icereject'); - }, - context: 'tools', - prependToContext: true - }); - - if(ed.plugins.contextmenu) { - ed.plugins.contextmenu.onContextMenu.add(function(th, menu, node) { - if(isInsideChangeTag(node)) { - menu.add({ - title: "Accept Change", - icon: 'accept', - cmd: 'iceaccept' - }); - menu.add({ - title: "Reject Change", - icon: 'reject', - cmd: 'icereject' - }); - } - }); - } + + // ___ ___ _____ _ + // | \/ | |_ _|| | + // | . . | ___ _ __ _ _ | | | |_ ___ _ __ ___ + // | |\/| | / _ \| '_ \ | | | | | | | __| / _ \| '_ ` _ \ + // | | | || __/| | | || |_| | _| |_ | |_ | __/| | | | | | + // \_| |_/ \___||_| |_| \__,_| \___/ \__| \___||_| |_| |_| + + ed.ui.registry.addNestedMenuItem('nesteditem', { + text: 'ICE action', + getSubmenuItems: () => { + return [{ + type: 'menuitem', + icon: 'accept', + text: 'Accept Change', + onAction: (_) => ed.execCommand('iceaccept'), + }, { + type: 'menuitem', + icon: 'reject', + text: 'Reject Change', + onAction: (_) => ed.execCommand('icereject'), + }]; + } + }); + /** * Node Change event - watch for node changes and toggle buttons. diff --git a/lib/tinymce/js/tinymce/plugins/icesearchreplace/plugin.js b/lib/tinymce/js/tinymce/plugins/icesearchreplace/plugin.js index 37289376..4e25ff61 100644 --- a/lib/tinymce/js/tinymce/plugins/icesearchreplace/plugin.js +++ b/lib/tinymce/js/tinymce/plugins/icesearchreplace/plugin.js @@ -39,8 +39,12 @@ }); // Register buttons - ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'}); - ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'}); + ed.ui.registry.addButton('search', { + title : 'searchreplace.search_desc', + tooltip: 'ICE Search', + onAction: (_) => ed.execCommand('SearchReplace'), + icon: 'search' + }); ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch'); }, diff --git a/lib/tinymce/js/tinymce/plugins/image/plugin.js b/lib/tinymce/js/tinymce/plugins/image/plugin.js index e2bc7838..4d33d431 100644 --- a/lib/tinymce/js/tinymce/plugins/image/plugin.js +++ b/lib/tinymce/js/tinymce/plugins/image/plugin.js @@ -1,110 +1,2393 @@ /** - * 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.1.6 (2020-01-28) */ +(function (domGlobals) { + 'use strict'; + + var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var noop = function () { + }; + var constant = function (value) { + return function () { + return value; + }; + }; + var identity = function (x) { + return x; + }; + 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()') + }; + if (Object.freeze) { + Object.freeze(me); + } + 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 Option = { + some: some, + none: none, + from: from + }; + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + 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 isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isString = isType('string'); + var isObject = isType('object'); + var isArray = isType('array'); + var isBoolean = isType('boolean'); + var isFunction = isType('function'); + + var nativeSlice = Array.prototype.slice; + var nativePush = Array.prototype.push; + var each = function (xs, f) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } + }; + 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 ? Option.none() : Option.some(xs[0]); + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + 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 exports$1 = {}, module = { 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, undefined)); + var Promise = module.exports.boltExport; + + var nu = function (baseFn) { + var data = Option.none(); + var callbacks = []; + var map = function (f) { + return nu(function (nCallback) { + get(function (data) { + nCallback(f(data)); + }); + }); + }; + var get = function (nCallback) { + if (isReady()) { + call(nCallback); + } else { + callbacks.push(nCallback); + } + }; + var set = function (x) { + data = Option.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) { + domGlobals.setTimeout(function () { + cb(x); + }, 0); + }); + }; + baseFn(set); + return { + get: get, + map: map, + isReady: isReady + }; + }; + var pure = function (a) { + return nu(function (callback) { + callback(a); + }); + }; + var LazyValue = { + nu: nu, + pure: pure + }; + + var errorReporter = function (err) { + domGlobals.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$1 = 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$1, + pure: pure$1 + }; + + 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 toOption = function () { + return Option.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, + toOption: toOption + }; + }; + 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, + toOption: Option.none + }; + }; + var fromOption = function (opt, err) { + return opt.fold(function () { + return error(err); + }, value); + }; + var Result = { + value: value, + error: error, + fromOption: fromOption + }; + + var wrap = function (delegate) { + var toCached = function () { + return wrap(delegate.toCached()); + }; + var bindFuture = function (f) { + return wrap(delegate.bind(function (resA) { + return resA.fold(function (err) { + return Future.pure(Result.error(err)); + }, function (a) { + return f(a); + }); + })); + }; + var bindResult = function (f) { + return wrap(delegate.map(function (resA) { + return resA.bind(f); + })); + }; + var mapResult = function (f) { + return wrap(delegate.map(function (resA) { + return resA.map(f); + })); + }; + var mapError = function (f) { + return wrap(delegate.map(function (resA) { + return resA.mapError(f); + })); + }; + var foldResult = function (whenError, whenValue) { + return delegate.map(function (res) { + return res.fold(whenError, whenValue); + }); + }; + var withTimeout = function (timeout, errorThunk) { + return wrap(Future.nu(function (callback) { + var timedOut = false; + var timer = domGlobals.setTimeout(function () { + timedOut = true; + callback(Result.error(errorThunk())); + }, timeout); + delegate.get(function (result) { + if (!timedOut) { + domGlobals.clearTimeout(timer); + callback(result); + } + }); + })); + }; + return __assign(__assign({}, delegate), { + toCached: toCached, + bindFuture: bindFuture, + bindResult: bindResult, + mapResult: mapResult, + mapError: mapError, + foldResult: foldResult, + withTimeout: withTimeout + }); + }; + var nu$2 = function (worker) { + return wrap(Future.nu(worker)); + }; + var value$1 = function (value) { + return wrap(Future.pure(Result.value(value))); + }; + var error$1 = function (error) { + return wrap(Future.pure(Result.error(error))); + }; + var fromResult = function (result) { + return wrap(Future.pure(result)); + }; + var fromFuture = function (future) { + return wrap(future.map(Result.value)); + }; + var fromPromise = function (promise) { + return nu$2(function (completer) { + promise.then(function (value) { + completer(Result.value(value)); + }, function (error) { + completer(Result.error(error)); + }); + }); + }; + var FutureResult = { + nu: nu$2, + wrap: wrap, + pure: value$1, + value: value$1, + error: error$1, + fromResult: fromResult, + fromFuture: fromFuture, + fromPromise: fromPromise + }; + + var hasOwnProperty = Object.prototype.hasOwnProperty; + var shallow = function (old, nu) { + return nu; + }; + 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 merge = baseMerge(shallow); + + var global$2 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.Promise'); + + var global$4 = 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 isAutomaticUploadsEnabled = function (editor) { + return editor.getParam('automatic_uploads', true, 'boolean'); + }; + var Settings = { + hasDimensions: hasDimensions, + hasUploadTab: hasUploadTab, + hasAdvTab: hasAdvTab, + getPrependUrl: getPrependUrl, + getClassList: getClassList, + hasDescription: hasDescription, + hasImageTitle: hasImageTitle, + hasImageCaption: hasImageCaption, + getImageList: getImageList, + hasUploadUrl: hasUploadUrl, + hasUploadHandler: hasUploadHandler, + getUploadUrl: getUploadUrl, + getUploadHandler: getUploadHandler, + getUploadBasePath: getUploadBasePath, + getUploadCredentials: getUploadCredentials, + isAutomaticUploadsEnabled: isAutomaticUploadsEnabled + }; + + var parseIntAndGetMax = function (val1, val2) { + return Math.max(parseInt(val1, 10), parseInt(val2, 10)); + }; + var getImageSize = function (url, callback) { + var img = domGlobals.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(Result.value(dimensions)); + }; + img.onerror = function () { + done(Result.error('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'; + domGlobals.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 = Settings.getImageList(editor); + if (typeof imageList === 'string') { + global$4.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 && Settings.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$3(function (resolve, reject) { + var reader = new domGlobals.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 Utils = { + getImageSize: getImageSize, + removePixelSuffix: removePixelSuffix, + addPixelSuffix: addPixelSuffix, + mergeMargins: mergeMargins, + createImageList: createImageList, + waitLoadImage: waitLoadImage, + blobToDataUri: blobToDataUri, + isPlaceholderImage: isPlaceholderImage + }; + + var DOM = global$2.DOM; + var getHspace = function (image) { + if (image.style.marginLeft && image.style.marginRight && image.style.marginLeft === image.style.marginRight) { + return Utils.removePixelSuffix(image.style.marginLeft); + } else { + return ''; + } + }; + var getVspace = function (image) { + if (image.style.marginTop && image.style.marginBottom && image.style.marginTop === image.style.marginBottom) { + return Utils.removePixelSuffix(image.style.marginTop); + } else { + return ''; + } + }; + var getBorder = function (image) { + if (image.style.borderWidth) { + return Utils.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 setAttrib = function (image, name, value) { + 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] = Utils.addPixelSuffix(value); + normalizeStyle(image, normalizeCss); + } else { + setAttrib(image, name, value); + } + }; + }; + var getSize = function (image, name) { + if (image.style[name]) { + return Utils.removePixelSuffix(image.style[name]); + } else { + return getAttrib(image, name); + } + }; + var setHspace = function (image, value) { + var pxValue = Utils.addPixelSuffix(value); + image.style.marginLeft = pxValue; + image.style.marginRight = pxValue; + }; + var setVspace = function (image, value) { + var pxValue = Utils.addPixelSuffix(value); + image.style.marginTop = pxValue; + image.style.marginBottom = pxValue; + }; + var setBorder = function (image, value) { + var pxValue = Utils.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 defaultData = function () { + return { + src: '', + alt: '', + title: '', + width: '', + height: '', + class: '', + style: '', + caption: false, + hspace: '', + vspace: '', + border: '', + borderStyle: '' + }; + }; + var getStyleValue = function (normalizeCss, data) { + var image = domGlobals.document.createElement('img'); + setAttrib(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 = domGlobals.document.createElement('img'); + write(normalizeCss, merge(data, { caption: false }), image); + setAttrib(image, 'alt', data.alt); + 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: getAttrib(image, 'alt'), + 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') + }; + }; + var updateProp = function (image, oldData, newData, name, set) { + if (newData[name] !== oldData[name]) { + set(image, name, newData[name]); + } + }; + 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', setAttrib); + updateProp(image, oldData, newData, 'alt', setAttrib); + updateProp(image, oldData, newData, 'title', setAttrib); + updateProp(image, oldData, newData, 'width', setSize('width', normalizeCss)); + updateProp(image, oldData, newData, 'height', setSize('height', normalizeCss)); + updateProp(image, oldData, newData, 'class', setAttrib); + updateProp(image, oldData, newData, 'style', normalized(function (image, value) { + return setAttrib(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)); + }; + + var normalizeCss = function (editor, cssText) { + var css = editor.dom.styles.parse(cssText); + var mergedCss = Utils.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' || Utils.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); + Utils.waitLoadImage(editor, data, image); + } + }; + var insertOrUpdateImage = function (editor, data) { + var image = getSelectedImage(editor); + if (image) { + if (data.src) { + writeImageDataToSelection(editor, data); + } else { + deleteImage(editor, image); + } + } else if (data.src) { + insertImageAtCaret(editor, data); + } + }; + + 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 Option.none(); + }; + + var global$5 = 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$5.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 Option.from(list).map(function (list) { + return sanitizeList(list, extracter); + }); + } else { + return Option.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 Option.some(item); + } else { + return Option.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, formData; + xhr = new domGlobals.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 () { + var json; + if (xhr.status < 200 || xhr.status >= 300) { + failure('HTTP Error: ' + xhr.status); + return; + } + json = JSON.parse(xhr.responseText); + if (!json || typeof json.location !== 'string') { + failure('Invalid JSON: ' + xhr.responseText); + return; + } + success(pathJoin(settings.basePath, json.location)); + }; + formData = new domGlobals.FormData(); + formData.append('file', blobInfo.blob(), blobInfo.filename()); + xhr.send(formData); + }; + var uploadBlob = function (blobInfo, handler) { + return new global$3(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$3.reject('Upload url missing from the settings.') : uploadBlob(blobInfo, settings.handler); + }; + settings = global$5.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: 'selectbox', + 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 = Future.nu(function (completer) { + Utils.createImageList(editor, function (imageList) { + completer(urlListSanitizer(imageList).map(function (items) { + return flatten([ + [{ + text: 'None', + value: '' + }], + items + ]); + })); + }); + }); + var classList = ListUtils.sanitize(Settings.getClassList(editor)); + var hasAdvTab = Settings.hasAdvTab(editor); + var hasUploadTab = Settings.hasUploadTab(editor); + var hasUploadUrl = Settings.hasUploadUrl(editor); + var hasUploadHandler = Settings.hasUploadHandler(editor); + var image = readImageDataFromSelection(editor); + var hasDescription = Settings.hasDescription(editor); + var hasImageTitle = Settings.hasImageTitle(editor); + var hasDimensions = Settings.hasDimensions(editor); + var hasImageCaption = Settings.hasImageCaption(editor); + var url = Settings.getUploadUrl(editor); + var basePath = Settings.getUploadBasePath(editor); + var credentials = Settings.getUploadCredentials(editor); + var handler = Settings.getUploadHandler(editor); + var automaticUploads = Settings.isAutomaticUploadsEnabled(editor); + var prependURL = Option.some(Settings.getPrependUrl(editor)).filter(function (preUrl) { + return isString(preUrl) && preUrl.length > 0; + }); + return futureImageList.map(function (imageList) { + return { + image: image, + imageList: imageList, + classList: classList, + hasAdvTab: hasAdvTab, + hasUploadTab: hasUploadTab, + hasUploadUrl: hasUploadUrl, + hasUploadHandler: hasUploadHandler, + hasDescription: hasDescription, + hasImageTitle: hasImageTitle, + hasDimensions: hasDimensions, + hasImageCaption: hasImageCaption, + url: url, + basePath: basePath, + credentials: credentials, + handler: handler, + automaticUploads: automaticUploads, + prependURL: prependURL + }; + }); + }; + + 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: 'selectbox', + label: 'Image list', + items: items + }; + }); + var imageDescription = { + name: 'alt', + type: 'input', + label: 'Image description' + }; + var imageTitle = { + name: 'title', + type: 'input', + label: 'Image title' + }; + var imageDimensions = { + name: 'dimensions', + type: 'sizeinput' + }; + var classList = info.classList.map(function (items) { + return { + name: 'classes', + type: 'selectbox', + label: 'Class', + items: items + }; + }); + var caption = { + type: 'label', + label: 'Caption', + items: [{ + type: 'checkbox', + name: 'caption', + label: 'Show caption' + }] + }; + return flatten([ + [imageUrl], + imageList.toArray(), + 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: [] + }; + }; + var toImageData = function (data) { + return { + src: data.src.value, + alt: 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 + }; + }; + 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 Option.some(prependUrl + srcURL); + } + return Option.none(); + }); + } + return Option.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.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.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).get(function (result) { + result.each(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 ? Utils.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 ? Utils.removePixelSuffix(String(css['margin-right'])) : ''; + }; + var calcBorderWidth = function (css) { + return css['border-width'] ? Utils.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 = Utils.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)); + 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 = domGlobals.URL.createObjectURL(file); + var uploader = Uploader({ + url: info.url, + basePath: info.basePath, + credentials: info.credentials, + handler: info.handler + }); + var finalize = function () { + api.unblock(); + domGlobals.URL.revokeObjectURL(blobUri); + }; + var updateSrcAndSwitchTab = function (url) { + api.setData({ + src: { + value: url, + meta: {} + } + }); + api.showTab('general'); + changeSrc(helpers, info, state, api); + }; + Utils.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(api, 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); + } + }; + }; + 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.undoManager.transact(function () { + insertOrUpdateImage(editor, toImageData(data)); + }); + editor.editorUpload.uploadImagesAuto(); + api.close(); + }; + }; + }; + var imageSize = function (editor) { + return function (url) { + return FutureResult.nu(function (completer) { + Utils.getImageSize(editor.documentBaseURI.toAbsolute(url), function (data) { + var result = data.map(function (dimensions) { + return { + width: String(dimensions.width), + height: String(dimensions.height) + }; + }); + completer(result); + }); + }); + }; + }; + 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 (api, message) { + editor.windowManager.alert(message, api.close); + }; + }; + 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 () { + return collect(editor).map(makeDialog(helpers)).get(function (spec) { + editor.windowManager.open(spec); + }); + }; + return { open: open }; + }; + + var register = function (editor) { + editor.addCommand('mceImage', Dialog(editor).open); + }; + var Commands = { register: register }; + + 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$5.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 FilterContent = { setup: setup }; + + 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) && !Utils.isPlaceholderImage(element) ? ['image'] : []; + } + }); + }; + var Buttons = { register: register$1 }; + + function Plugin () { + global$1.add('image', function (editor) { + FilterContent.setup(editor); + Buttons.register(editor); + Commands.register(editor); + }); + } + + Plugin(); -/*global tinymce:true */ - -tinymce.PluginManager.add('image', function(editor) { - function showDialog() { - var win, data, dom = editor.dom, imgElm = editor.selection.getNode(); - var width, height; - - function recalcSize(e) { - var widthCtrl, heightCtrl, newWidth, newHeight; - - widthCtrl = win.find('#width')[0]; - heightCtrl = win.find('#height')[0]; - - newWidth = widthCtrl.value(); - newHeight = heightCtrl.value(); - - if (win.find('#constrain')[0].checked() && width && height && newWidth && newHeight) { - if (e.control == widthCtrl) { - newHeight = Math.round((newWidth / width) * newHeight); - heightCtrl.value(newHeight); - } else { - newWidth = Math.round((newHeight / height) * newWidth); - widthCtrl.value(newWidth); - } - } - - width = newWidth; - height = newHeight; - } - - width = dom.getAttrib(imgElm, 'width'); - height = dom.getAttrib(imgElm, 'height'); - - if (imgElm.nodeName == "IMG" && !imgElm.getAttribute('data-mce-object')) { - data = { - src: dom.getAttrib(imgElm, 'src'), - alt: dom.getAttrib(imgElm, 'alt'), - width: width, - height: height - }; - } else { - imgElm = null; - } - - win = editor.windowManager.open({ - title: "Edit image", - data: data, - body: [ - {name: 'src', type: 'filepicker', filetype: 'image', label: 'Source', autofocus: true}, - {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: 3, size: 3, onchange: recalcSize}, - {type: 'label', text: 'x'}, - {name: 'height', type: 'textbox', maxLength: 3, size: 3, onchange: recalcSize}, - {name: 'constrain', type: 'checkbox', checked: true, text: 'Constrain proportions'} - ] - } - ], - onSubmit: function(e) { - var data = e.data; - - if (data.width === '') { - delete data.width; - } - - if (data.height === '') { - delete data.height; - } - - if (imgElm) { - dom.setAttribs(imgElm, data); - } else { - editor.insertContent(dom.createHTML('img', data)); - } - } - }); - } - - editor.addButton('image', { - icon: 'image', - tooltip: 'Insert/edit image', - onclick: showDialog, - stateSelector: 'img:not([data-mce-object])' - }); - - editor.addMenuItem('image', { - icon: 'image', - text: 'Insert image', - onclick: showDialog, - context: 'insert', - prependToContext: true - }); -}); \ No newline at end of file +}(window)); diff --git a/lib/tinymce/js/tinymce/plugins/image/plugin.min.js b/lib/tinymce/js/tinymce/plugins/image/plugin.min.js index 5b763a55..a2b91925 100644 --- a/lib/tinymce/js/tinymce/plugins/image/plugin.min.js +++ b/lib/tinymce/js/tinymce/plugins/image/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("image",function(e){function t(){function t(e){var t,i,r,l;t=n.find("#width")[0],i=n.find("#height")[0],r=t.value(),l=i.value(),n.find("#constrain")[0].checked()&&o&&a&&r&&l&&(e.control==t?(l=Math.round(r/o*l),i.value(l)):(r=Math.round(l/a*r),t.value(r))),o=r,a=l}var n,i,o,a,r=e.dom,l=e.selection.getNode();o=r.getAttrib(l,"width"),a=r.getAttrib(l,"height"),"IMG"!=l.nodeName||l.getAttribute("data-mce-object")?l=null:i={src:r.getAttrib(l,"src"),alt:r.getAttrib(l,"alt"),width:o,height:a},n=e.windowManager.open({title:"Edit image",data:i,body:[{name:"src",type:"filepicker",filetype:"image",label:"Source",autofocus:!0},{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:3,size:3,onchange:t},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:3,size:3,onchange:t},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}],onSubmit:function(t){var n=t.data;""===n.width&&delete n.width,""===n.height&&delete n.height,l?r.setAttribs(l,n):e.insertContent(r.createHTML("img",n))}})}e.addButton("image",{icon:"image",tooltip:"Insert/edit image",onclick:t,stateSelector:"img:not([data-mce-object])"}),e.addMenuItem("image",{icon:"image",text:"Insert image",onclick:t,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.1.6 (2020-01-28) + */ +!function(s){"use strict";function i(){}function a(t){return function(){return t}}function t(t){return t}function e(){return l}var n,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=a(!1),c=a(!0),l=(n={fold:function(t,e){return t()},is:u,isSome:u,isNone:c,getOr:d,getOrThunk:f,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:a(null),getOrUndefined:a(undefined),or:d,orThunk:f,map:e,each:i,bind:e,exists:u,forall:c,filter:e,equals:o,equals_:o,toArray:function(){return[]},toString:a("none()")},Object.freeze&&Object.freeze(n),n);function o(t){return t.isNone()}function f(t){return t()}function d(t){return t}function m(e){return function(t){return function(t){if(null===t)return"null";var e=typeof t;return"object"==e&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==e&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":e}(t)===e}}function b(t){for(var e=[],n=0,r=t.length;n= 300 ? Errors.handleServiceErrorResponse(result.status, result.blob) : global$3.resolve(result.blob); + }); + }; + function requestBlob(url, withCredentials) { + return Utils.requestUrlAsBlob(url, {}, withCredentials).then(function (result) { + return result.status < 200 || result.status >= 300 ? Errors.handleHttpError(result.status) : global$3.resolve(result.blob); + }); + } + var getUrl = function (url, apiKey, withCredentials) { + return apiKey ? requestServiceBlob(url, apiKey) : requestBlob(url, withCredentials); + }; + + var compareDocumentPosition = function (a, b, match) { + return (a.compareDocumentPosition(b) & match) !== 0; + }; + var documentPositionPreceding = function (a, b) { + return compareDocumentPosition(a, b, domGlobals.Node.DOCUMENT_POSITION_PRECEDING); + }; + var documentPositionContainedBy = function (a, b) { + return compareDocumentPosition(a, b, domGlobals.Node.DOCUMENT_POSITION_CONTAINED_BY); + }; + var Node = { + documentPositionPreceding: documentPositionPreceding, + documentPositionContainedBy: documentPositionContainedBy + }; + + 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 edge = 'Edge'; + var chrome = 'Chrome'; + var ie = 'IE'; + var opera = 'Opera'; + var firefox = 'Firefox'; + var safari = 'Safari'; + var isBrowser = function (name, current) { + return function () { + return current === name; + }; + }; + 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; + return { + current: current, + version: version, + isEdge: isBrowser(edge, current), + isChrome: isBrowser(chrome, current), + isIE: isBrowser(ie, current), + isOpera: isBrowser(opera, current), + isFirefox: isBrowser(firefox, current), + isSafari: isBrowser(safari, current) + }; + }; + 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 isOS = function (name, current) { + return function () { + return current === name; + }; + }; + 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; + return { + current: current, + version: version, + isWindows: isOS(windows, current), + isiOS: isOS(ios, current), + isAndroid: isOS(android, current), + isOSX: isOS(osx, current), + isLinux: isOS(linux, current), + isSolaris: isOS(solaris, current), + isFreeBSD: isOS(freebsd, current), + isChromeOS: isOS(chromeos, current) + }; + }; + 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 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 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 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 domGlobals.window.matchMedia(query).matches; + }; + var platform = Cell(PlatformDetection.detect(domGlobals.navigator.userAgent, mediaMatch)); + var detect$3 = function () { + return platform.get(); + }; + + var fromHtml = function (html, scope) { + var doc = scope || domGlobals.document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + domGlobals.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 || domGlobals.document; + var node = doc.createElement(tag); + return fromDom(node); + }; + var fromText = function (text, scope) { + var doc = scope || domGlobals.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: constant(node) }; + }; + var fromPoint = function (docElm, x, y) { + var doc = docElm.dom(); + return Option.from(doc.elementFromPoint(x, y)).map(fromDom); + }; + var Element = { + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint + }; + + var ATTRIBUTE = domGlobals.Node.ATTRIBUTE_NODE; + var CDATA_SECTION = domGlobals.Node.CDATA_SECTION_NODE; + var COMMENT = domGlobals.Node.COMMENT_NODE; + var DOCUMENT = domGlobals.Node.DOCUMENT_NODE; + var DOCUMENT_TYPE = domGlobals.Node.DOCUMENT_TYPE_NODE; + var DOCUMENT_FRAGMENT = domGlobals.Node.DOCUMENT_FRAGMENT_NODE; + var ELEMENT = domGlobals.Node.ELEMENT_NODE; + var TEXT = domGlobals.Node.TEXT_NODE; + var PROCESSING_INSTRUCTION = domGlobals.Node.PROCESSING_INSTRUCTION_NODE; + var ENTITY_REFERENCE = domGlobals.Node.ENTITY_REFERENCE_NODE; + var ENTITY = domGlobals.Node.ENTITY_NODE; + var NOTATION = domGlobals.Node.NOTATION_NODE; + + var ELEMENT$1 = ELEMENT; + var is = function (element, selector) { + var dom = element.dom(); + if (dom.nodeType !== ELEMENT$1) { + 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 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 Node.documentPositionContainedBy(e1.dom(), e2.dom()); + }; + var browser = detect$3().browser; + var contains$1 = browser.isIE() ? ieContains : regularContains; + + var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')(); + + var child = function (scope, predicate) { + var pred = function (node) { + return predicate(Element.fromDom(node)); + }; + var result = find(scope.dom().childNodes, pred); + return result.map(Element.fromDom); + }; + + var child$1 = function (scope, selector) { + return child(scope, function (e) { + return is(e, selector); + }); + }; + + var count = 0; + var getFigureImg = function (elem) { + return child$1(Element.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) || editor.settings.imagetools_proxy); + }; + if (isFigure(editor, elem)) { + var imgOpt = getFigureImg(elem); + return imgOpt.map(function (img) { + return isEditable(img.dom()) ? Option.some(img.dom()) : Option.none(); + }); + } + return isEditable(elem) ? Option.some(elem) : Option.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 Option.some(Element.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) { + var src = img.src, apiKey; + if (isCorsImage(editor, img)) { + return getUrl(img.src, null, isCorsWithCredentialsImage(editor, img)); + } + if (!isLocalImage(editor, img)) { + src = getProxyUrl(editor); + src += (src.indexOf('?') === -1 ? '?' : '&') + 'url=' + encodeURIComponent(img.src); + 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; + 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, blobCache, blobInfo; + 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 = ImageSize.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 new global$3(function (resolve) { + blobToImage$1(blob).then(function (newImage) { + var newSize = ImageSize.getNaturalImageSize(newImage); + if (originalSize.w !== newSize.w || originalSize.h !== newSize.h) { + if (ImageSize.getImageSize(img)) { + ImageSize.setImageSize(img, newSize); + } + } + domGlobals.URL.revokeObjectURL(newImage.src); + return blob; + }).then(blobToImageResult).then(function (imageResult) { + return updateSelectedImage(editor, imageResult, true, imageUploadTimerState, img); + }, function () { + }); + }); + }; + var Actions = { + rotate: rotate$2, + flip: flip$2, + getEditableImage: getEditableImage, + cancelTimedUpload: cancelTimedUpload, + findBlob: findBlob, + getSelectedImage: getSelectedImage, + handleDialogBlob: handleDialogBlob + }; + + var saveState = constant('save-state'); + var disable = constant('disable'); + var enable = constant('enable'); + + var createState = function (blob) { + return { + blob: blob, + url: domGlobals.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) { + Actions.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 = Actions.getSelectedImage(editor); + var originalSizeOpt = originalImgOpt.map(function (origImg) { + return ImageSize.getNaturalImageSize(origImg.dom()); + }); + var imgOpt = Actions.getSelectedImage(editor); + imgOpt.each(function (img) { + Actions.getEditableImage(editor, img.dom()).each(function (_) { + Actions.findBlob(editor, img.dom()).then(function (blob) { + var state = createState(blob); + editor.windowManager.open(getLoadedSpec(state)); + }); + }); + }); + }; + }; + var Dialog = { makeOpen: makeOpen }; + + var register = function (editor, imageUploadTimerState) { + global$1.each({ + mceImageRotateLeft: Actions.rotate(editor, imageUploadTimerState, -90), + mceImageRotateRight: Actions.rotate(editor, imageUploadTimerState, 90), + mceImageFlipVertical: Actions.flip(editor, imageUploadTimerState, 'v'), + mceImageFlipHorizontal: Actions.flip(editor, imageUploadTimerState, 'h'), + mceEditImage: Dialog.makeOpen(editor, imageUploadTimerState) + }, function (fn, cmd) { + editor.addCommand(cmd, fn); + }); + }; + var Commands = { register: register }; + + var setup = function (editor, imageUploadTimerState, lastSelectedImageState) { + editor.on('NodeChange', function (e) { + var lastSelectedImage = lastSelectedImageState.get(); + if (lastSelectedImage && lastSelectedImage.src !== e.element.src) { + Actions.cancelTimedUpload(imageUploadTimerState); + editor.editorUpload.uploadImagesAuto(); + lastSelectedImageState.set(null); + } + Actions.getEditableImage(editor, e.element).each(lastSelectedImageState.set); + }); + }; + var UploadSelectedImage = { setup: setup }; + + 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 = Actions.getSelectedImage(editor); + elementOpt.each(function (element) { + var disabled = Actions.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-options', + onAction: cmd('mceImage') + }); + editor.ui.registry.addContextMenu('imagetools', { + update: function (element) { + return Actions.getEditableImage(editor, element).fold(function () { + return []; + }, function (_) { + return [{ + text: 'Edit image', + icon: 'edit-image', + onAction: cmd('mceEditImage') + }]; + }); + } + }); + }; + var Buttons = { register: register$1 }; + + var register$2 = function (editor) { + editor.ui.registry.addContextToolbar('imagetools', { + items: getToolbarItems(editor), + predicate: function (elem) { + return Actions.getEditableImage(editor, elem).isSome(); + }, + position: 'node', + scope: 'node' + }); + }; + var ContextToolbar = { register: register$2 }; + + function Plugin () { + global.add('imagetools', function (editor) { + var imageUploadTimerState = Cell(0); + var lastSelectedImageState = Cell(null); + Commands.register(editor, imageUploadTimerState); + Buttons.register(editor); + ContextToolbar.register(editor); + UploadSelectedImage.setup(editor, imageUploadTimerState, lastSelectedImageState); + }); + } + + Plugin(); + +}(window)); diff --git a/lib/tinymce/js/tinymce/plugins/imagetools/plugin.min.js b/lib/tinymce/js/tinymce/plugins/imagetools/plugin.min.js new file mode 100644 index 00000000..3a3da1b4 --- /dev/null +++ b/lib/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.1.6 (2020-01-28) + */ +!function(v){"use strict";function e(){}function n(){return c}var t,r=function(e){function n(){return t}var t=e;return{get:n,set:function(e){t=e},clone:function(){return r(n())}}},o=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=function(e){return function(){return e}},u=d(!1),a=d(!0),c=(t={fold:function(e,n){return e()},is:u,isSome:u,isNone:a,getOr:l,getOrThunk:f,getOrDie:function(e){throw new Error(e||"error: getOrDie called on none.")},getOrNull:d(null),getOrUndefined:d(undefined),or:l,orThunk:f,map:n,each:e,bind:n,exists:u,forall:a,filter:n,equals:s,equals_:s,toArray:function(){return[]},toString:d("none()")},Object.freeze&&Object.freeze(t),t);function s(e){return e.isNone()}function f(e){return e()}function l(e){return e}var m=function(t){function e(){return o}function n(e){return e(t)}var r=d(t),o={fold:function(e,n){return n(t)},is:function(e){return t===e},isSome:a,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return m(e(t))},each:function(e){e(t)},bind:n,exists:n,forall:n,filter:function(e){return e(t)?o:c},toArray:function(){return[t]},toString:function(){return"some("+t+")"},equals:function(e){return e.is(t)},equals_:function(e,n){return e.fold(u,function(e){return n(t,e)})}};return o},p={some:m,none:n,from:function(e){return null===e||e===undefined?c:m(e)}};function h(e,n){return y(v.document.createElement("canvas"),e,n)}function g(e){var n=h(e.width,e.height);return w(n).drawImage(e,0,0),n}function w(e){return e.getContext("2d")}function y(e,n,t){return e.width=n,e.height=t,e}var b,O,E=window.Promise?window.Promise:(b=T.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(e){v.setTimeout(e,1)},O=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},T.prototype["catch"]=function(e){return this.then(null,e)},T.prototype.then=function(t,r){var o=this;return new T(function(e,n){N.call(o,new R(t,r,e,n))})},T.all=function(){for(var e=[],n=0;n 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: !Settings.shouldAppend(editor) + }); + }); + }; + var ImportCss = { + defaultConvertSelectorToFormat: defaultConvertSelectorToFormat, + setup: setup + }; + + var get = function (editor) { + var convertSelectorToFormat = function (selectorText) { + return ImportCss.defaultConvertSelectorToFormat(editor, selectorText); + }; + return { convertSelectorToFormat: convertSelectorToFormat }; + }; + var Api = { get: get }; + + function Plugin () { + global.add('importcss', function (editor) { + ImportCss.setup(editor); + return Api.get(editor); + }); + } + + Plugin(); + +}()); diff --git a/lib/tinymce/js/tinymce/plugins/importcss/plugin.min.js b/lib/tinymce/js/tinymce/plugins/importcss/plugin.min.js new file mode 100644 index 00000000..e6cda83c --- /dev/null +++ b/lib/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.1.6 (2020-01-28) + */ +!function(){"use strict";function t(){}function n(t){return function(){return t}}function e(){return h}var r,o=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),f=tinymce.util.Tools.resolve("tinymce.EditorManager"),l=tinymce.util.Tools.resolve("tinymce.Env"),m=tinymce.util.Tools.resolve("tinymce.util.Tools"),c=function(t){return t.getParam("importcss_merge_classes")},i=function(t){return t.getParam("importcss_exclusive")},p=function(t){return t.getParam("importcss_selector_converter")},g=function(t){return t.getParam("importcss_selector_filter")},y=function(t){return t.getParam("importcss_groups")},v=function(t){return t.getParam("importcss_append")},d=function(t){return t.getParam("importcss_file_filter")},u=n(!1),s=n(!0),h=(r={fold:function(t,n){return t()},is:u,isSome:u,isNone:s,getOr:O,getOrThunk:x,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:n(null),getOrUndefined:n(undefined),or:O,orThunk:x,map:e,each:t,bind:e,exists:u,forall:s,filter:e,equals:_,equals_:_,toArray:function(){return[]},toString:n("none()")},Object.freeze&&Object.freeze(r),r);function _(t){return t.isNone()}function x(t){return t()}function O(t){return t}function T(n){return function(t){return function(t){if(null===t)return"null";var n=typeof t;return"object"==n&&(Array.prototype.isPrototypeOf(t)||t.constructor&&"Array"===t.constructor.name)?"array":"object"==n&&(String.prototype.isPrototypeOf(t)||t.constructor&&"String"===t.constructor.name)?"string":n}(t)===n}}function b(t,n){return function(t){for(var n=[],e=0,r=t.length;e 0 ? formats[0] : getTimeFormat(editor); + }; + var shouldInsertTimeElement = function (editor) { + return editor.getParam('insertdatetime_element', false); + }; + var Settings = { + getDateFormat: getDateFormat, + getTimeFormat: getTimeFormat, + getFormats: getFormats, + getDefaultDateTime: getDefaultDateTime, + shouldInsertTimeElement: shouldInsertTimeElement + }; - return fmt; - } + 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 (Settings.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 Actions = { + insertDateTime: insertDateTime, + getDateTime: getDateTime + }; - editor.addCommand('mceInsertDate', function() { - var str = getDateTime(editor.getParam("plugin_insertdate_dateFormat", editor.translate("%Y-%m-%d"))); + var register = function (editor) { + editor.addCommand('mceInsertDate', function () { + Actions.insertDateTime(editor, Settings.getDateFormat(editor)); + }); + editor.addCommand('mceInsertTime', function () { + Actions.insertDateTime(editor, Settings.getTimeFormat(editor)); + }); + }; + var Commands = { register: register }; - editor.execCommand('mceInsertContent', false, str); - }); + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); - editor.addCommand('mceInsertTime', function() { - var str = getDateTime(editor.getParam("plugin_insertdate_timeFormat", editor.translate('%H:%M:%S'))); + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; - editor.execCommand('mceInsertContent', false, str); - }); + var register$1 = function (editor) { + var formats = Settings.getFormats(editor); + var defaultFormat = Cell(Settings.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: Actions.getDateTime(editor, format), + value: format + }; + })); + }, + onAction: function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + Actions.insertDateTime(editor, defaultFormat.get()); + }, + onItemAction: function (_, value) { + defaultFormat.set(value); + Actions.insertDateTime(editor, value); + } + }); + var makeMenuItemHandler = function (format) { + return function () { + defaultFormat.set(format); + Actions.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: Actions.getDateTime(editor, format), + onAction: makeMenuItemHandler(format) + }; + }); + } + }); + }; + var Buttons = { register: register$1 }; - editor.addButton('inserttime', { - type: 'splitbutton', - title: 'Insert time', - onclick: function() { - editor.insertContent(getDateTime(lastFormat || "%H:%M:%S")); - }, - menu: menuItems - }); + function Plugin () { + global.add('insertdatetime', function (editor) { + Commands.register(editor); + Buttons.register(editor); + }); + } - // TODO: Add config option here - tinymce.each([ - "%H:%M:%S", - "%Y-%m-%d", - "%I:%M:%S %p", - "%D" - ], function(fmt) { - menuItems.push({ - text: getDateTime(fmt), - onclick: function() { - lastFormat = fmt; - editor.insertContent(getDateTime(fmt)); - } - }); - }); + Plugin(); - editor.addMenuItem('insertdatetime', { - icon: 'date', - text: 'Insert date/time', - menu: menuItems, - context: 'insert' - }); -}); +}()); diff --git a/lib/tinymce/js/tinymce/plugins/insertdatetime/plugin.min.js b/lib/tinymce/js/tinymce/plugins/insertdatetime/plugin.min.js index 52c28d89..287414b3 100644 --- a/lib/tinymce/js/tinymce/plugins/insertdatetime/plugin.min.js +++ b/lib/tinymce/js/tinymce/plugins/insertdatetime/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("insertdatetime",function(e){function t(t,n){function l(e,t){if(e=""+e,t>e.length)for(var n=0;t-e.length>n;n++)e="0"+e;return e}return n=n||new Date,t=t.replace("%D","%m/%d/%Y"),t=t.replace("%r","%I:%M:%S %p"),t=t.replace("%Y",""+n.getFullYear()),t=t.replace("%y",""+n.getYear()),t=t.replace("%m",l(n.getMonth()+1,2)),t=t.replace("%d",l(n.getDate(),2)),t=t.replace("%H",""+l(n.getHours(),2)),t=t.replace("%M",""+l(n.getMinutes(),2)),t=t.replace("%S",""+l(n.getSeconds(),2)),t=t.replace("%I",""+((n.getHours()+11)%12+1)),t=t.replace("%p",""+(12>n.getHours()?"AM":"PM")),t=t.replace("%B",""+e.translate(r[n.getMonth()])),t=t.replace("%b",""+e.translate(a[n.getMonth()])),t=t.replace("%A",""+e.translate(o[n.getDay()])),t=t.replace("%a",""+e.translate(i[n.getDay()])),t=t.replace("%%","%")}var n,i="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),o="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),a="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),r="January February March April May June July August September October November December".split(" "),l=[];e.addCommand("mceInsertDate",function(){var n=t(e.getParam("plugin_insertdate_dateFormat",e.translate("%Y-%m-%d")));e.execCommand("mceInsertContent",!1,n)}),e.addCommand("mceInsertTime",function(){var n=t(e.getParam("plugin_insertdate_timeFormat",e.translate("%H:%M:%S")));e.execCommand("mceInsertContent",!1,n)}),e.addButton("inserttime",{type:"splitbutton",title:"Insert time",onclick:function(){e.insertContent(t(n||"%H:%M:%S"))},menu:l}),tinymce.each(["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"],function(i){l.push({text:t(i),onclick:function(){n=i,e.insertContent(t(i))}})}),e.addMenuItem("insertdatetime",{icon:"date",text:"Insert date/time",menu:l,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.1.6 (2020-01-28) + */ +!function(){"use strict";function n(e){return e.getParam("insertdatetime_timeformat",e.translate("%H:%M:%S"))}function r(e){return e.getParam("insertdatetime_formats",["%H:%M:%S","%Y-%m-%d","%I:%M:%S %p","%D"])}function a(e,t){if((e=""+e).length'+n+"")}else e.insertContent(i(e,t))},g=i,y=function(e){e.addCommand("mceInsertDate",function(){p(e,t(e))}),e.addCommand("mceInsertTime",function(){p(e,o(e))})},M=tinymce.util.Tools.resolve("tinymce.util.Tools"),S=function(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return S(t())}}},v=function(n){var t=u(n),r=S(c(n));n.ui.registry.addSplitButton("insertdatetime",{icon:"insert-time",tooltip:"Insert date/time",select:function(e){return e===r.get()},fetch:function(e){e(M.map(t,function(e){return{type:"choiceitem",text:g(n,e),value:e}}))},onAction:function(){for(var e=[],t=0;t -1) { - nl[ci].style.zIndex = z[fi]; - nl[fi].style.zIndex = z[ci]; - } else { - if (z[ci] > 0) { - nl[ci].style.zIndex = z[ci] - 1; - } - } - } else { - // Move forward - - // Try find a higher one - for (i = 0; i < z.length; i++) { - if (z[i] > z[ci]) { - fi = i; - break; - } - } - - if (fi > -1) { - nl[ci].style.zIndex = z[fi]; - nl[fi].style.zIndex = z[ci]; - } else { - nl[ci].style.zIndex = z[ci] + 1; - } - } - - editor.execCommand('mceRepaint'); - } - - function insertLayer() { - var dom = editor.dom, p = dom.getPos(dom.getParent(editor.selection.getNode(), '*')); - var body = editor.getBody(); - - editor.dom.add(body, 'div', { - style: { - position: 'absolute', - left: p.x, - top: (p.y > 20 ? p.y : 20), - width: 100, - height: 100 - }, - 'class': 'mceItemVisualAid mceItemLayer' - }, editor.selection.getContent() || editor.getLang('layer.content')); - - // Workaround for IE where it messes up the JS engine if you insert a layer on IE 6,7 - if (tinymce.Env.ie) { - dom.setHTML(body, body.innerHTML); - } - } - - function toggleAbsolute() { - var le = getParentLayer(editor.selection.getNode()); - - if (!le) { - le = editor.dom.getParent(editor.selection.getNode(), 'DIV,P,IMG'); - } - - if (le) { - if (le.style.position.toLowerCase() == "absolute") { - editor.dom.setStyles(le, { - position: '', - left: '', - top: '', - width: '', - height: '' - }); - - editor.dom.removeClass(le, 'mceItemVisualAid'); - editor.dom.removeClass(le, 'mceItemLayer'); - } else { - if (!le.style.left) { - le.style.left = 20 + 'px'; - } - - if (!le.style.top) { - le.style.top = 20 + 'px'; - } - - if (!le.style.width) { - le.style.width = le.width ? (le.width + 'px') : '100px'; - } - - if (!le.style.height) { - le.style.height = le.height ? (le.height + 'px') : '100px'; - } - - le.style.position = "absolute"; - - editor.dom.setAttrib(le, 'data-mce-style', ''); - editor.addVisual(editor.getBody()); - } - - editor.execCommand('mceRepaint'); - editor.nodeChanged(); - } - } - - // Register commands - editor.addCommand('mceInsertLayer', insertLayer); - - editor.addCommand('mceMoveForward', function() { - move(1); - }); - - editor.addCommand('mceMoveBackward', function() { - move(-1); - }); - - editor.addCommand('mceMakeAbsolute', function() { - toggleAbsolute(); - }); - - // Register buttons - editor.addButton('moveforward', {title: 'layer.forward_desc', cmd: 'mceMoveForward'}); - editor.addButton('movebackward', {title: 'layer.backward_desc', cmd: 'mceMoveBackward'}); - editor.addButton('absolute', {title: 'layer.absolute_desc', cmd: 'mceMakeAbsolute'}); - editor.addButton('insertlayer', {title: 'layer.insertlayer_desc', cmd: 'mceInsertLayer'}); - - editor.on('init', function() { - if (tinymce.Env.ie) { - editor.getDoc().execCommand('2D-Position', false, true); - } - }); - - // Remove serialized styles when selecting a layer since it might be changed by a drag operation - editor.on('mouseup', function(e) { - var layer = getParentLayer(e.target); - - if (layer) { - editor.dom.setAttrib(layer, 'data-mce-style', ''); - } - }); - - // Fixes edit focus issues with layers on Gecko - // This will enable designMode while inside a layer and disable it when outside - editor.on('mousedown', function(e) { - var node = e.target, doc = editor.getDoc(), parent; - - if (tinymce.Env.gecko) { - if (getParentLayer(node)) { - if (doc.designMode !== 'on') { - doc.designMode = 'on'; - - // Repaint caret - node = doc.body; - parent = node.parentNode; - parent.removeChild(node); - parent.appendChild(node); - } - } else if (doc.designMode == 'on') { - doc.designMode = 'off'; - } - } - }); - - editor.on('NodeChange', visualAid); -}); diff --git a/lib/tinymce/js/tinymce/plugins/layer/plugin.min.js b/lib/tinymce/js/tinymce/plugins/layer/plugin.min.js deleted file mode 100644 index 88621269..00000000 --- a/lib/tinymce/js/tinymce/plugins/layer/plugin.min.js +++ /dev/null @@ -1 +0,0 @@ -tinymce.PluginManager.add("layer",function(e){function t(e){do if(e.className&&-1!=e.className.indexOf("mceItemLayer"))return e;while(e=e.parentNode)}function n(t){var n=e.dom;tinymce.each(n.select("div,p",t),function(e){/^(absolute|relative|fixed)$/i.test(e.style.position)&&(e.hasVisual?n.addClass(e,"mceItemVisualAid"):n.removeClass(e,"mceItemVisualAid"),n.addClass(e,"mceItemLayer"))})}function i(n){var i,o,a=[],r=t(e.selection.getNode()),l=-1,c=-1;for(o=[],tinymce.walk(e.getBody(),function(e){1==e.nodeType&&/^(absolute|relative|static)$/i.test(e.style.position)&&o.push(e)},"childNodes"),i=0;o.length>i;i++)a[i]=o[i].style.zIndex?parseInt(o[i].style.zIndex,10):0,0>l&&o[i]==r&&(l=i);if(0>n){for(i=0;a.length>i;i++)if(a[i]-1?(o[l].style.zIndex=a[c],o[c].style.zIndex=a[l]):a[l]>0&&(o[l].style.zIndex=a[l]-1)}else{for(i=0;a.length>i;i++)if(a[i]>a[l]){c=i;break}c>-1?(o[l].style.zIndex=a[c],o[c].style.zIndex=a[l]):o[l].style.zIndex=a[l]+1}e.execCommand("mceRepaint")}function o(){var t=e.dom,n=t.getPos(t.getParent(e.selection.getNode(),"*")),i=e.getBody();e.dom.add(i,"div",{style:{position:"absolute",left:n.x,top:n.y>20?n.y:20,width:100,height:100},"class":"mceItemVisualAid mceItemLayer"},e.selection.getContent()||e.getLang("layer.content")),tinymce.Env.ie&&t.setHTML(i,i.innerHTML)}function a(){var n=t(e.selection.getNode());n||(n=e.dom.getParent(e.selection.getNode(),"DIV,P,IMG")),n&&("absolute"==n.style.position.toLowerCase()?(e.dom.setStyles(n,{position:"",left:"",top:"",width:"",height:""}),e.dom.removeClass(n,"mceItemVisualAid"),e.dom.removeClass(n,"mceItemLayer")):(n.style.left||(n.style.left="20px"),n.style.top||(n.style.top="20px"),n.style.width||(n.style.width=n.width?n.width+"px":"100px"),n.style.height||(n.style.height=n.height?n.height+"px":"100px"),n.style.position="absolute",e.dom.setAttrib(n,"data-mce-style",""),e.addVisual(e.getBody())),e.execCommand("mceRepaint"),e.nodeChanged())}e.addCommand("mceInsertLayer",o),e.addCommand("mceMoveForward",function(){i(1)}),e.addCommand("mceMoveBackward",function(){i(-1)}),e.addCommand("mceMakeAbsolute",function(){a()}),e.addButton("moveforward",{title:"layer.forward_desc",cmd:"mceMoveForward"}),e.addButton("movebackward",{title:"layer.backward_desc",cmd:"mceMoveBackward"}),e.addButton("absolute",{title:"layer.absolute_desc",cmd:"mceMakeAbsolute"}),e.addButton("insertlayer",{title:"layer.insertlayer_desc",cmd:"mceInsertLayer"}),e.on("init",function(){tinymce.Env.ie&&e.getDoc().execCommand("2D-Position",!1,!0)}),e.on("mouseup",function(n){var i=t(n.target);i&&e.dom.setAttrib(i,"data-mce-style","")}),e.on("mousedown",function(n){var i,o=n.target,a=e.getDoc();tinymce.Env.gecko&&(t(o)?"on"!==a.designMode&&(a.designMode="on",o=a.body,i=o.parentNode,i.removeChild(o),i.appendChild(o)):"on"==a.designMode&&(a.designMode="off"))}),e.on("NodeChange",n)}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/plugins/legacyoutput/plugin.js b/lib/tinymce/js/tinymce/plugins/legacyoutput/plugin.js index 20939bd6..9ff500fc 100644 --- a/lib/tinymce/js/tinymce/plugins/legacyoutput/plugin.js +++ b/lib/tinymce/js/tinymce/plugins/legacyoutput/plugin.js @@ -1,110 +1,184 @@ /** - * 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 - * - * This plugin will force TinyMCE to produce deprecated legacy output such as font elements, u elements, align - * attributes and so forth. There are a few cases where these old items might be needed for example in email applications or with Flash - * - * However you should NOT use this plugin if you are building some system that produces web contents such as a CMS. All these elements are - * not apart of the newer specifications for HTML and XHTML. + * Version: 5.1.6 (2020-01-28) */ +(function () { + 'use strict'; -/*global tinymce:true */ - -(function(tinymce) { - // Override inline_styles setting to force TinyMCE to produce deprecated contents - tinymce.on('AddEditor', function(e) { - e.editor.settings.inline_styles = false; - }); - - tinymce.PluginManager.add('legacyoutput', function(editor) { - editor.on('init', function() { - var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img', - fontSizes = tinymce.explode(editor.settings.font_size_style_values), - schema = editor.schema; - - // Override some internal formats to produce legacy elements and attributes - editor.formatter.register({ - // Change alignment formats to use the deprecated align attribute - alignleft: {selector: alignElements, attributes: {align: 'left'}}, - aligncenter: {selector: alignElements, attributes: {align: 'center'}}, - alignright: {selector: alignElements, attributes: {align: 'right'}}, - alignjustify: {selector: alignElements, attributes: {align: 'justify'}}, - - // Change the basic formatting elements to use deprecated element types - bold: [ - {inline: 'b', remove: 'all'}, - {inline: 'strong', remove: 'all'}, - {inline: 'span', styles: {fontWeight: 'bold'}} - ], - italic: [ - {inline: 'i', remove: 'all'}, - {inline: 'em', remove: 'all'}, - {inline: 'span', styles: {fontStyle: 'italic'}} - ], - underline: [ - {inline: 'u', remove: 'all'}, - {inline: 'span', styles: {textDecoration: 'underline'}, exact: true} - ], - strikethrough: [ - {inline: 'strike', remove: 'all'}, - {inline: 'span', styles: {textDecoration: 'line-through'}, exact: true} - ], - - // Change font size and font family to use the deprecated font element - fontname: {inline: 'font', attributes: {face: '%value'}}, - fontsize: { - inline: 'font', - attributes: { - size: function(vars) { - return tinymce.inArray(fontSizes, vars.value) + 1; - } - } - }, - - // Setup font elements for colors as well - forecolor: {inline: 'font', attributes: {color: '%value'}}, - hilitecolor: {inline: 'font', styles: {backgroundColor: '%value'}} - }); + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); - // Check that deprecated elements are allowed if not add them - tinymce.each('b,i,u,strike'.split(','), function(name) { - schema.addValidElements(name + '[*]'); - }); + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); - // Add font element if it's missing - if (!schema.getElementRule("font")) { - schema.addValidElements("font[face|size|color|style]"); - } + var getFontSizeFormats = function (editor) { + return editor.getParam('fontsize_formats'); + }; + var setFontSizeFormats = function (editor, fontsize_formats) { + editor.settings.fontsize_formats = fontsize_formats; + }; + var getFontFormats = function (editor) { + return editor.getParam('font_formats'); + }; + var setFontFormats = function (editor, font_formats) { + editor.settings.font_formats = font_formats; + }; + var getFontSizeStyleValues = function (editor) { + return editor.getParam('font_size_style_values', 'xx-small,x-small,small,medium,large,x-large,xx-large'); + }; + var setInlineStyles = function (editor, inline_styles) { + editor.settings.inline_styles = inline_styles; + }; + var Settings = { + getFontFormats: getFontFormats, + getFontSizeFormats: getFontSizeFormats, + setFontSizeFormats: setFontSizeFormats, + setFontFormats: setFontFormats, + getFontSizeStyleValues: getFontSizeStyleValues, + setInlineStyles: setInlineStyles + }; - // Add the missing and depreacted align attribute for the serialization engine - tinymce.each(alignElements.split(','), function(name) { - var rule = schema.getElementRule(name); + var overrideFormats = function (editor) { + var alignElements = 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table', fontSizes = global$1.explode(Settings.getFontSizeStyleValues(editor)), schema = editor.schema; + editor.formatter.register({ + alignleft: { + selector: alignElements, + attributes: { align: 'left' } + }, + aligncenter: { + selector: alignElements, + attributes: { align: 'center' } + }, + alignright: { + selector: alignElements, + attributes: { align: 'right' } + }, + alignjustify: { + selector: alignElements, + attributes: { align: 'justify' } + }, + bold: [ + { + inline: 'b', + remove: 'all' + }, + { + inline: 'strong', + remove: 'all' + }, + { + inline: 'span', + styles: { fontWeight: 'bold' } + } + ], + italic: [ + { + inline: 'i', + remove: 'all' + }, + { + inline: 'em', + remove: 'all' + }, + { + inline: 'span', + styles: { fontStyle: 'italic' } + } + ], + underline: [ + { + inline: 'u', + remove: 'all' + }, + { + inline: 'span', + styles: { textDecoration: 'underline' }, + exact: true + } + ], + strikethrough: [ + { + inline: 'strike', + remove: 'all' + }, + { + inline: 'span', + styles: { textDecoration: 'line-through' }, + exact: true + } + ], + fontname: { + inline: 'font', + toggle: false, + attributes: { face: '%value' } + }, + fontsize: { + inline: 'font', + toggle: false, + attributes: { + size: function (vars) { + return global$1.inArray(fontSizes, vars.value) + 1; + } + } + }, + forecolor: { + inline: 'font', + attributes: { color: '%value' }, + links: true, + remove_similar: true, + clear_child_styles: true + }, + hilitecolor: { + inline: 'font', + styles: { backgroundColor: '%value' }, + links: true, + remove_similar: true, + clear_child_styles: true + } + }); + global$1.each('b,i,u,strike'.split(','), function (name) { + schema.addValidElements(name + '[*]'); + }); + if (!schema.getElementRule('font')) { + schema.addValidElements('font[face|size|color|style]'); + } + global$1.each(alignElements.split(','), function (name) { + var rule = schema.getElementRule(name); + if (rule) { + if (!rule.attributes.align) { + rule.attributes.align = {}; + rule.attributesOrder.push('align'); + } + } + }); + }; + var overrideSettings = function (editor) { + var defaultFontsizeFormats = '8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7'; + var defaultFontsFormats = 'Andale Mono=andale mono,monospace;' + 'Arial=arial,helvetica,sans-serif;' + 'Arial Black=arial black,sans-serif;' + 'Book Antiqua=book antiqua,palatino,serif;' + 'Comic Sans MS=comic sans ms,sans-serif;' + 'Courier New=courier new,courier,monospace;' + 'Georgia=georgia,palatino,serif;' + 'Helvetica=helvetica,arial,sans-serif;' + 'Impact=impact,sans-serif;' + 'Symbol=symbol;' + 'Tahoma=tahoma,arial,helvetica,sans-serif;' + 'Terminal=terminal,monaco,monospace;' + 'Times New Roman=times new roman,times,serif;' + 'Trebuchet MS=trebuchet ms,geneva,sans-serif;' + 'Verdana=verdana,geneva,sans-serif;' + 'Webdings=webdings;' + 'Wingdings=wingdings,zapf dingbats'; + Settings.setInlineStyles(editor, false); + if (!Settings.getFontSizeFormats(editor)) { + Settings.setFontSizeFormats(editor, defaultFontsizeFormats); + } + if (!Settings.getFontFormats(editor)) { + Settings.setFontFormats(editor, defaultFontsFormats); + } + }; + var setup = function (editor) { + overrideSettings(editor); + editor.on('PreInit', function () { + return overrideFormats(editor); + }); + }; + var Formats = { setup: setup }; - if (rule) { - if (!rule.attributes.align) { - rule.attributes.align = {}; - rule.attributesOrder.push('align'); - } - } - }); + function Plugin () { + global.add('legacyoutput', function (editor) { + Formats.setup(editor); + }); + } - // Listen for the onNodeChange event so that we can do special logic for the font size and font name drop boxes - /*editor.on('NodeChange', function() { - var fontElm, fontName, fontSize; + Plugin(); - // Find font element get it's name and size - fontElm = editor.dom.getParent(editor.selection.getNode(), 'font'); - if (fontElm) { - fontName = fontElm.face; - fontSize = fontElm.size; - } - });*/ - }); - }); -})(tinymce); +}()); diff --git a/lib/tinymce/js/tinymce/plugins/legacyoutput/plugin.min.js b/lib/tinymce/js/tinymce/plugins/legacyoutput/plugin.min.js index f2fdc1ba..f83c038f 100644 --- a/lib/tinymce/js/tinymce/plugins/legacyoutput/plugin.min.js +++ b/lib/tinymce/js/tinymce/plugins/legacyoutput/plugin.min.js @@ -1 +1,9 @@ -(function(e){e.on("AddEditor",function(e){e.editor.settings.inline_styles=!1}),e.PluginManager.add("legacyoutput",function(t){t.on("init",function(){var n="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table,img",i=e.explode(t.settings.font_size_style_values),o=t.schema;t.formatter.register({alignleft:{selector:n,attributes:{align:"left"}},aligncenter:{selector:n,attributes:{align:"center"}},alignright:{selector:n,attributes:{align:"right"}},alignjustify:{selector:n,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",attributes:{face:"%value"}},fontsize:{inline:"font",attributes:{size:function(t){return e.inArray(i,t.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"}},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"}}}),e.each("b,i,u,strike".split(","),function(e){o.addValidElements(e+"[*]")}),o.getElementRule("font")||o.addValidElements("font[face|size|color|style]"),e.each(n.split(","),function(e){var t=o.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))})})})})(tinymce); \ 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.1.6 (2020-01-28) + */ +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),a=tinymce.util.Tools.resolve("tinymce.util.Tools"),t=function(e){return e.getParam("font_formats")},i=function(e){return e.getParam("fontsize_formats")},n=function(e,t){e.settings.fontsize_formats=t},l=function(e,t){e.settings.font_formats=t},s=function(e){return e.getParam("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large")},r=function(e,t){e.settings.inline_styles=t},o=function(e){!function(e){r(e,!1),i(e)||n(e,"8pt=1 10pt=2 12pt=3 14pt=4 18pt=5 24pt=6 36pt=7"),t(e)||l(e,"Andale Mono=andale mono,monospace;Arial=arial,helvetica,sans-serif;Arial Black=arial black,sans-serif;Book Antiqua=book antiqua,palatino,serif;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,palatino,serif;Helvetica=helvetica,arial,sans-serif;Impact=impact,sans-serif;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco,monospace;Times New Roman=times new roman,times,serif;Trebuchet MS=trebuchet ms,geneva,sans-serif;Verdana=verdana,geneva,sans-serif;Webdings=webdings;Wingdings=wingdings,zapf dingbats")}(e),e.on("PreInit",function(){return function(e){var t="p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table",i=a.explode(s(e)),n=e.schema;e.formatter.register({alignleft:{selector:t,attributes:{align:"left"}},aligncenter:{selector:t,attributes:{align:"center"}},alignright:{selector:t,attributes:{align:"right"}},alignjustify:{selector:t,attributes:{align:"justify"}},bold:[{inline:"b",remove:"all"},{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}}],italic:[{inline:"i",remove:"all"},{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}}],underline:[{inline:"u",remove:"all"},{inline:"span",styles:{textDecoration:"underline"},exact:!0}],strikethrough:[{inline:"strike",remove:"all"},{inline:"span",styles:{textDecoration:"line-through"},exact:!0}],fontname:{inline:"font",toggle:!1,attributes:{face:"%value"}},fontsize:{inline:"font",toggle:!1,attributes:{size:function(e){return a.inArray(i,e.value)+1}}},forecolor:{inline:"font",attributes:{color:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0},hilitecolor:{inline:"font",styles:{backgroundColor:"%value"},links:!0,remove_similar:!0,clear_child_styles:!0}}),a.each("b,i,u,strike".split(","),function(e){n.addValidElements(e+"[*]")}),n.getElementRule("font")||n.addValidElements("font[face|size|color|style]"),a.each(t.split(","),function(e){var t=n.getElementRule(e);t&&(t.attributes.align||(t.attributes.align={},t.attributesOrder.push("align")))})}(e)})};!function c(){e.add("legacyoutput",function(e){o(e)})}()}(); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/plugins/link/plugin.js b/lib/tinymce/js/tinymce/plugins/link/plugin.js index ab701fe2..a18aeab8 100644 --- a/lib/tinymce/js/tinymce/plugins/link/plugin.js +++ b/lib/tinymce/js/tinymce/plugins/link/plugin.js @@ -1,122 +1,1835 @@ /** - * 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.1.6 (2020-01-28) */ +(function (domGlobals) { + 'use strict'; + + var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.util.VK'); + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + 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 isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isString = isType('string'); + var isArray = isType('array'); + var isBoolean = isType('boolean'); + var isFunction = isType('function'); + + var assumeExternalTargets = function (editor) { + var externalTargets = editor.getParam('link_assume_external_targets', false); + if (isBoolean(externalTargets) && externalTargets) { + return 1; + } else if (isString(externalTargets) && (externalTargets === 'http' || externalTargets === 'https')) { + return externalTargets; + } + return 0; + }; + var hasContextToolbar = function (editor) { + return editor.getParam('link_context_toolbar', false, 'boolean'); + }; + var getLinkList = function (editor) { + return editor.getParam('link_list'); + }; + var getDefaultLinkTarget = function (editor) { + return editor.getParam('default_link_target'); + }; + var getTargetList = function (editor) { + return editor.getParam('target_list', true); + }; + var getRelList = function (editor) { + return editor.getParam('rel_list', [], 'array'); + }; + var getLinkClassList = function (editor) { + return editor.getParam('link_class_list', [], 'array'); + }; + var shouldShowLinkTitle = function (editor) { + return editor.getParam('link_title', true, 'boolean'); + }; + var allowUnsafeLinkTarget = function (editor) { + return editor.getParam('allow_unsafe_link_target', false, 'boolean'); + }; + var useQuickLink = function (editor) { + return editor.getParam('link_quicklink', false, 'boolean'); + }; + var Settings = { + assumeExternalTargets: assumeExternalTargets, + hasContextToolbar: hasContextToolbar, + getLinkList: getLinkList, + getDefaultLinkTarget: getDefaultLinkTarget, + getTargetList: getTargetList, + getRelList: getRelList, + getLinkClassList: getLinkClassList, + shouldShowLinkTitle: shouldShowLinkTitle, + allowUnsafeLinkTarget: allowUnsafeLinkTarget, + useQuickLink: useQuickLink + }; + + var appendClickRemove = function (link, evt) { + domGlobals.document.body.appendChild(link); + link.dispatchEvent(evt); + domGlobals.document.body.removeChild(link); + }; + var open = function (url) { + var link = domGlobals.document.createElement('a'); + link.target = '_blank'; + link.href = url; + link.rel = 'noreferrer noopener'; + var evt = domGlobals.document.createEvent('MouseEvents'); + evt.initMouseEvent('click', true, true, domGlobals.window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); + appendClickRemove(link, evt); + }; + var OpenUrl = { open: open }; + + 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 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()') + }; + if (Object.freeze) { + Object.freeze(me); + } + 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 Option = { + some: some, + none: none, + from: from + }; + + 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 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) { + var output = map(xs, f); + return flatten(output); + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + 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$3.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$3.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 isLink = function (elm) { + return elm && elm.nodeName === 'A' && !!elm.href; + }; + var hasLinks = function (elements) { + return global$3.grep(elements, isLink).length > 0; + }; + var isOnlyTextSelected = function (html) { + if (/]+>[^<]+<\/a>$/.test(html) || html.indexOf('href=') === -1)) { + return false; + } + return true; + }; + 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 (!(Settings.getRelList(editor).length > 0) && Settings.allowUnsafeLinkTarget(editor) === false) { + var newRel = applyRelTargetRules(newLinkAttrs.rel, newLinkAttrs.target === '_blank'); + newLinkAttrs.rel = newRel ? newRel : null; + } + if (Option.from(newLinkAttrs.target).isNone() && Settings.getTargetList(editor) === false) { + newLinkAttrs.target = Settings.getDefaultLinkTarget(editor); + } + newLinkAttrs.href = handleExternalTargets(newLinkAttrs.href, Settings.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 link = 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 unlink = function (editor) { + editor.undoManager.transact(function () { + var node = editor.selection.getNode(); + if (isImageFigure(node)) { + unlinkImageFigure(editor, node); + } else { + var anchorElm = editor.dom.getParent(node, 'a[href]', editor.getBody()); + if (anchorElm) { + editor.dom.remove(anchorElm, true); + } + } + editor.focus(); + }); + }; + 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 Utils = { + link: link, + unlink: unlink, + isLink: isLink, + hasLinks: hasLinks, + getHref: getHref, + isOnlyTextSelected: isOnlyTextSelected, + getAnchorElement: getAnchorElement, + getAnchorText: getAnchorText, + applyRelTargetRules: applyRelTargetRules, + hasProtocol: hasProtocol + }; + + 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 findMap = function (arr, f) { + for (var i = 0; i < arr.length; i++) { + var r = f(arr[i], i); + if (r.isSome()) { + return r; + } + } + return Option.none(); + }; + + var getValue = function (item) { + return isString(item.value) ? item.value : ''; + }; + var sanitizeList = function (list, extractValue) { + var out = []; + global$3.each(list, function (item) { + var text = isString(item.text) ? item.text : isString(item.title) ? item.title : ''; + if (item.menu !== undefined) ; 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 Option.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: 'selectbox', + label: label, + items: items + }; + }; + }; + var ListOptions = { + sanitize: sanitize, + sanitizeWith: sanitizeWith, + createUi: createUi, + getValue: getValue + }; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + var findTextByValue = function (value, catalog) { + return findMap(catalog, function (item) { + return Option.some(item).filter(function (i) { + return i.value === value; + }); + }); + }; + 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 + }; + }) : Option.none(); + }; + var findCatalog = function (settings, fieldName) { + if (fieldName === 'link') { + return settings.catalogs.link; + } else if (fieldName === 'anchor') { + return settings.catalogs.anchor; + } else { + return Option.none(); + } + }; + var init = function (initialData, linkSettings) { + var persistentText = Cell(initialData.text); + var onUrlChange = function (data) { + if (persistentText.get().length <= 0) { + var urlText = data.url.meta.text !== undefined ? data.url.meta.text : data.url.value; + return Option.some({ text: urlText }); + } else { + return Option.none(); + } + }; + var onCatalogChange = function (data, change) { + var catalog = findCatalog(linkSettings, change.name).getOr([]); + return getDelta(persistentText.get(), change.name, catalog, data); + }; + var onChange = function (getData, change) { + if (change.name === 'url') { + return onUrlChange(getData()); + } else if (contains([ + 'anchor', + 'link' + ], change.name)) { + return onCatalogChange(getData(), change); + } else if (change.name === 'text') { + persistentText.set(getData().text); + return Option.none(); + } else { + return Option.none(); + } + }; + return { onChange: onChange }; + }; + var DialogChanges = { + init: init, + getDelta: getDelta + }; + + var exports$1 = {}, module = { 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, undefined)); + var Promise = module.exports.boltExport; + + var nu = function (baseFn) { + var data = Option.none(); + var callbacks = []; + var map = function (f) { + return nu(function (nCallback) { + get(function (data) { + nCallback(f(data)); + }); + }); + }; + var get = function (nCallback) { + if (isReady()) { + call(nCallback); + } else { + callbacks.push(nCallback); + } + }; + var set = function (x) { + data = Option.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) { + domGlobals.setTimeout(function () { + cb(x); + }, 0); + }); + }; + baseFn(set); + return { + get: get, + map: map, + isReady: isReady + }; + }; + var pure = function (a) { + return nu(function (callback) { + callback(a); + }); + }; + var LazyValue = { + nu: nu, + pure: pure + }; + + var errorReporter = function (err) { + domGlobals.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$1 = 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$1, + pure: pure$1 + }; + + var global$4 = tinymce.util.Tools.resolve('tinymce.util.Delay'); + + 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 ? Option.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 }); + } + }) : Option.none(); + }; + var tryProtocolTransform = function (assumeExternalTargets) { + return function (data) { + var url = data.href; + var suggestProtocol = assumeExternalTargets === 1 && !Utils.hasProtocol(url) || assumeExternalTargets === 0 && /^\s*www[\.|\d\.]/i.test(url); + return suggestProtocol ? Option.some({ + message: 'The URL you entered seems to be an external link. Do you want to add the required http:// prefix?', + preprocess: function (oldData) { + return __assign(__assign({}, oldData), { href: 'http://' + url }); + } + }) : Option.none(); + }; + }; + var preprocess = function (editor, assumeExternalTargets, data) { + return findMap([ + tryEmailTransform, + tryProtocolTransform(assumeExternalTargets) + ], function (f) { + return f(data); + }).fold(function () { + return Future.pure(data); + }, function (transform) { + return Future.nu(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 ? Option.some([{ + text: 'None', + value: '' + }].concat(anchors)) : Option.none(); + }; + var AnchorListOptions = { getAnchors: getAnchors }; + + var getClasses = function (editor) { + var list = Settings.getLinkClassList(editor); + if (list.length > 0) { + return ListOptions.sanitize(list); + } + return Option.none(); + }; + var ClassListOptions = { getClasses: getClasses }; + + var global$5 = tinymce.util.Tools.resolve('tinymce.util.XHR'); + + var parseJson = function (text) { + try { + return Option.some(JSON.parse(text)); + } catch (err) { + return Option.none(); + } + }; + var getLinks = function (editor) { + var extractor = function (item) { + return editor.convertURL(item.value || item.url, 'href'); + }; + var linkList = Settings.getLinkList(editor); + return Future.nu(function (callback) { + if (isString(linkList)) { + global$5.send({ + url: linkList, + success: function (text) { + return callback(parseJson(text)); + }, + error: function (_) { + return callback(Option.none()); + } + }); + } else if (isFunction(linkList)) { + linkList(function (output) { + return callback(Option.some(output)); + }); + } else { + callback(Option.from(linkList)); + } + }).map(function (optItems) { + return optItems.bind(ListOptions.sanitizeWith(extractor)).map(function (items) { + if (items.length > 0) { + return [{ + text: 'None', + value: '' + }].concat(items); + } else { + return items; + } + }); + }); + }; + var LinkListOptions = { getLinks: getLinks }; + + var getRels = function (editor, initialTarget) { + var list = Settings.getRelList(editor); + if (list.length > 0) { + var isTargetBlank_1 = initialTarget.is('_blank'); + var enforceSafe = Settings.allowUnsafeLinkTarget(editor) === false; + var safeRelExtractor = function (item) { + return Utils.applyRelTargetRules(ListOptions.getValue(item), isTargetBlank_1); + }; + var sanitizer = enforceSafe ? ListOptions.sanitizeWith(safeRelExtractor) : ListOptions.sanitize; + return sanitizer(list); + } + return Option.none(); + }; + var RelOptions = { getRels: getRels }; + + var fallbacks = [ + { + text: 'Current window', + value: '' + }, + { + text: 'New window', + value: '_blank' + } + ]; + var getTargets = function (editor) { + var list = Settings.getTargetList(editor); + if (isArray(list)) { + return ListOptions.sanitize(list).orThunk(function () { + return Option.some(fallbacks); + }); + } else if (list === false) { + return Option.none(); + } + return Option.some(fallbacks); + }; + var TargetOptions = { getTargets: getTargets }; + + var nonEmptyAttr = function (dom, elem, name) { + var val = dom.getAttrib(elem, name); + return val !== null && val.length > 0 ? Option.some(val) : Option.none(); + }; + var extractFromAnchor = function (editor, anchor) { + var dom = editor.dom; + var onlyText = Utils.isOnlyTextSelected(editor.selection.getContent()); + var text = onlyText ? Option.some(Utils.getAnchorText(editor.selection, anchor)) : Option.none(); + var url = anchor ? Option.some(dom.getAttrib(anchor, 'href')) : Option.none(); + var target = anchor ? Option.from(dom.getAttrib(anchor, 'target')) : Option.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).map(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: Option.from(linkNode), + flags: { titleEnabled: Settings.shouldShowLinkTitle(editor) } + }; + }); + }; + var DialogInfo = { collect: collect }; + + var handleSubmit = function (editor, info, assumeExternalTargets) { + return function (api) { + var data = api.getData(); + if (!data.url.value) { + Utils.unlink(editor); + api.close(); + return; + } + var getChangedValue = function (key) { + return Option.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, assumeExternalTargets, changedData).get(function (pData) { + Utils.link(editor, attachState, pData); + }); + api.close(); + }; + }; + var collectData = function (editor) { + var anchorNode = Utils.getAnchorElement(editor); + return DialogInfo.collect(editor, anchorNode); + }; + var getInitialData = function (info, defaultTarget) { + return { + url: { + value: info.anchor.url.getOr(''), + meta: { + attach: function () { + }, + text: info.anchor.url.fold(function () { + return ''; + }, function () { + return info.anchor.text.getOr(''); + }), + original: { value: info.anchor.url.getOr('') } + } + }, + text: info.anchor.text.getOr(''), + title: info.anchor.title.getOr(''), + anchor: info.anchor.url.getOr(''), + link: info.anchor.url.getOr(''), + rel: info.anchor.rel.getOr(''), + target: info.anchor.target.or(defaultTarget).getOr(''), + linkClass: info.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 = Option.from(Settings.getDefaultLinkTarget(editor)); + var initialData = getInitialData(settings, defaultTarget); + var dialogDelta = DialogChanges.init(initialData, settings); + var catalogs = settings.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$1 = function (editor) { + var data = collectData(editor); + data.map(function (info) { + var onSubmit = handleSubmit(editor, info, Settings.assumeExternalTargets(editor)); + return makeDialog(info, onSubmit, editor); + }).get(function (spec) { + editor.windowManager.open(spec); + }); + }; + var Dialog = { open: open$1 }; + + 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 = Utils.getHref(a); + if (/^#/.test(href)) { + var targetEl = editor.$(href); + if (targetEl.length) { + editor.selection.scrollIntoView(targetEl[0], true); + } + } else { + OpenUrl.open(a.href); + } + } + }; + var openDialog = function (editor) { + return function () { + Dialog.open(editor); + }; + }; + var gotoSelectedLink = function (editor) { + return function () { + gotoLink(editor, getSelectedLink(editor)); + }; + }; + var leftClickedOnAHref = function (editor) { + return function (elm) { + var sel, rng, node; + if (Settings.hasContextToolbar(editor) && Utils.isLink(elm)) { + sel = editor.selection; + rng = sel.getRng(); + node = rng.startContainer; + if (node.nodeType === 3 && sel.isCollapsed() && rng.startOffset > 0 && rng.startOffset < node.data.length) { + return true; + } + } + return false; + }; + }; + var setupGotoLinks = function (editor) { + editor.on('click', function (e) { + var link = getLink(editor, e.target); + if (link && global$2.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 toggleActiveState = function (editor) { + return function (api) { + var nodeChangeHandler = function (e) { + return api.setActive(!editor.readonly && !!Utils.getAnchorElement(editor, e.element)); + }; + editor.on('NodeChange', nodeChangeHandler); + return function () { + return editor.off('NodeChange', nodeChangeHandler); + }; + }; + }; + var toggleEnabledState = function (editor) { + return function (api) { + api.setDisabled(!Utils.hasLinks(editor.dom.getParents(editor.selection.getStart()))); + var nodeChangeHandler = function (e) { + return api.setDisabled(!Utils.hasLinks(e.parents)); + }; + editor.on('NodeChange', nodeChangeHandler); + return function () { + return editor.off('NodeChange', nodeChangeHandler); + }; + }; + }; + var Actions = { + openDialog: openDialog, + gotoSelectedLink: gotoSelectedLink, + leftClickedOnAHref: leftClickedOnAHref, + setupGotoLinks: setupGotoLinks, + toggleActiveState: toggleActiveState, + toggleEnabledState: toggleEnabledState + }; + + var register = function (editor) { + editor.addCommand('mceLink', function () { + if (Settings.useQuickLink(editor)) { + editor.fire('contexttoolbar-show', { toolbarKey: 'quicklink' }); + } else { + Actions.openDialog(editor)(); + } + }); + }; + var Commands = { register: register }; + + var setup = function (editor) { + editor.addShortcut('Meta+K', '', function () { + editor.execCommand('mceLink'); + }); + }; + var Keyboard = { setup: setup }; + + var setupButtons = function (editor) { + editor.ui.registry.addToggleButton('link', { + icon: 'link', + tooltip: 'Insert/edit link', + onAction: Actions.openDialog(editor), + onSetup: Actions.toggleActiveState(editor) + }); + editor.ui.registry.addButton('openlink', { + icon: 'new-tab', + tooltip: 'Open link', + onAction: Actions.gotoSelectedLink(editor), + onSetup: Actions.toggleEnabledState(editor) + }); + editor.ui.registry.addButton('unlink', { + icon: 'unlink', + tooltip: 'Remove link', + onAction: function () { + return Utils.unlink(editor); + }, + onSetup: Actions.toggleEnabledState(editor) + }); + }; + var setupMenuItems = function (editor) { + editor.ui.registry.addMenuItem('openlink', { + text: 'Open link', + icon: 'new-tab', + onAction: Actions.gotoSelectedLink(editor), + onSetup: Actions.toggleEnabledState(editor) + }); + editor.ui.registry.addMenuItem('link', { + icon: 'link', + text: 'Link...', + shortcut: 'Meta+K', + onAction: Actions.openDialog(editor) + }); + editor.ui.registry.addMenuItem('unlink', { + icon: 'unlink', + text: 'Remove link', + onAction: function () { + return Utils.unlink(editor); + }, + onSetup: Actions.toggleEnabledState(editor) + }); + }; + var setupContextMenu = function (editor) { + var inLink = 'link unlink openlink'; + var noLink = 'link'; + editor.ui.registry.addContextMenu('link', { + update: function (element) { + return Utils.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(!Utils.getAnchorElement(editor, node)); + return function () { + }; + }; + editor.ui.registry.addContextForm('quicklink', { + launch: { + type: 'contextformtogglebutton', + icon: 'link', + tooltip: 'Link', + onSetup: Actions.toggleActiveState(editor) + }, + label: 'Link', + predicate: function (node) { + return !!Utils.getAnchorElement(editor, node) && Settings.hasContextToolbar(editor); + }, + initValue: function () { + var elm = Utils.getAnchorElement(editor); + return !!elm ? Utils.getHref(elm) : ''; + }, + commands: [ + { + type: 'contextformtogglebutton', + icon: 'link', + tooltip: 'Link', + primary: true, + onSetup: function (buttonApi) { + var node = editor.selection.getNode(); + buttonApi.setActive(!!Utils.getAnchorElement(editor, node)); + return Actions.toggleActiveState(editor)(buttonApi); + }, + onAction: function (formApi) { + var anchor = Utils.getAnchorElement(editor); + var value = formApi.getValue(); + if (!anchor) { + var attachState = { + href: value, + attach: function () { + } + }; + var onlyText = Utils.isOnlyTextSelected(editor.selection.getContent()); + var text = onlyText ? Option.some(Utils.getAnchorText(editor.selection, anchor)).filter(function (t) { + return t.length > 0; + }).or(Option.from(value)) : Option.none(); + Utils.link(editor, attachState, { + href: value, + text: text, + title: Option.none(), + rel: Option.none(), + target: Option.none(), + class: Option.none() + }); + formApi.hide(); + } else { + editor.dom.setAttrib(anchor, 'href', value); + collapseSelectionToEnd(editor); + formApi.hide(); + } + } + }, + { + type: 'contextformbutton', + icon: 'unlink', + tooltip: 'Remove link', + onSetup: onSetupLink, + onAction: function (formApi) { + Utils.unlink(editor); + formApi.hide(); + } + }, + { + type: 'contextformbutton', + icon: 'new-tab', + tooltip: 'Open link', + onSetup: onSetupLink, + onAction: function (formApi) { + Actions.gotoSelectedLink(editor)(); + formApi.hide(); + } + } + ] + }); + }; + var Controls = { + setupButtons: setupButtons, + setupMenuItems: setupMenuItems, + setupContextMenu: setupContextMenu, + setupContextToolbars: setupContextToolbars + }; + + function Plugin () { + global$1.add('link', function (editor) { + Controls.setupButtons(editor); + Controls.setupMenuItems(editor); + Controls.setupContextMenu(editor); + Controls.setupContextToolbars(editor); + Actions.setupGotoLinks(editor); + Commands.register(editor); + Keyboard.setup(editor); + }); + } + + Plugin(); -/*global tinymce:true */ - -tinymce.PluginManager.add('link', function(editor) { - function showDialog() { - var data = {}, selection = editor.selection, dom = editor.dom, selectedElm, anchorElm, initialText; - - function updateText() { - if (!initialText && data.text.length === 0) { - this.parent().parent().find('#text')[0].value(this.value()); - } - } - - selectedElm = selection.getNode(); - anchorElm = dom.getParent(selectedElm, 'a[href]'); - if (anchorElm) { - selection.select(anchorElm); - } - - data.text = initialText = selection.getContent({format: 'text'}); - data.href = anchorElm ? dom.getAttrib(anchorElm, 'href') : ''; - data.target = anchorElm ? dom.getAttrib(anchorElm, 'target') : ''; - - if (selectedElm.nodeName == "IMG") { - data.text = initialText = " "; - } - - editor.windowManager.open({ - title: 'Insert link', - data: data, - body: [ - {name: 'text', type: 'textbox', size: 40, label: 'Text to display', onchange: function() { - initialText = this.value(); - }}, - { - name: 'href', - type: 'filepicker', - filetype: 'file', - size: 40, - autofocus: true, - label: 'Url', - onchange: updateText, - onkeyup: updateText - }, - {name: 'target', type: 'listbox', label: 'Target', values: [ - {text: 'None', value: ''}, - {text: 'New window', value: '_blank'} - ]} - ], - onSubmit: function(e) { - var data = e.data; - - if (!data.href) { - editor.execCommand('unlink'); - return; - } - - if (data.text != initialText) { - if (anchorElm) { - editor.focus(); - anchorElm.innerHTML = data.text; - - dom.setAttribs(anchorElm, { - href: data.href, - target: data.target - }); - - selection.select(anchorElm); - } else { - editor.insertContent(dom.createHTML('a', { - href: data.href, - target: data.target - }, data.text)); - } - } else { - editor.execCommand('mceInsertLink', false, { - href: data.href, - target: data.target - }); - } - } - }); - } - - editor.addButton('link', { - icon: 'link', - tooltip: 'Insert/edit link', - shortcut: 'Ctrl+K', - onclick: showDialog, - stateSelector: 'a[href]' - }); - - editor.addButton('unlink', { - icon: 'unlink', - tooltip: 'Remove link(s)', - cmd: 'unlink', - stateSelector: 'a[href]' - }); - - editor.addShortcut('Ctrl+K', '', showDialog); - - this.showDialog = showDialog; - - editor.addMenuItem('link', { - icon: 'link', - text: 'Insert link', - shortcut: 'Ctrl+K', - onclick: showDialog, - stateSelector: 'a[href]', - context: 'insert', - prependToContext: true - }); -}); \ No newline at end of file +}(window)); diff --git a/lib/tinymce/js/tinymce/plugins/link/plugin.min.js b/lib/tinymce/js/tinymce/plugins/link/plugin.min.js index 3370a477..fc8162d3 100644 --- a/lib/tinymce/js/tinymce/plugins/link/plugin.min.js +++ b/lib/tinymce/js/tinymce/plugins/link/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("link",function(e){function t(){function t(){o||0!==a.text.length||this.parent().parent().find("#text")[0].value(this.value())}var n,i,o,a={},r=e.selection,l=e.dom;n=r.getNode(),i=l.getParent(n,"a[href]"),i&&r.select(i),a.text=o=r.getContent({format:"text"}),a.href=i?l.getAttrib(i,"href"):"",a.target=i?l.getAttrib(i,"target"):"","IMG"==n.nodeName&&(a.text=o=" "),e.windowManager.open({title:"Insert link",data:a,body:[{name:"text",type:"textbox",size:40,label:"Text to display",onchange:function(){o=this.value()}},{name:"href",type:"filepicker",filetype:"file",size:40,autofocus:!0,label:"Url",onchange:t,onkeyup:t},{name:"target",type:"listbox",label:"Target",values:[{text:"None",value:""},{text:"New window",value:"_blank"}]}],onSubmit:function(t){var n=t.data;return n.href?(n.text!=o?i?(e.focus(),i.innerHTML=n.text,l.setAttribs(i,{href:n.href,target:n.target}),r.select(i)):e.insertContent(l.createHTML("a",{href:n.href,target:n.target},n.text)):e.execCommand("mceInsertLink",!1,{href:n.href,target:n.target}),void 0):(e.execCommand("unlink"),void 0)}})}e.addButton("link",{icon:"link",tooltip:"Insert/edit link",shortcut:"Ctrl+K",onclick:t,stateSelector:"a[href]"}),e.addButton("unlink",{icon:"unlink",tooltip:"Remove link(s)",cmd:"unlink",stateSelector:"a[href]"}),e.addShortcut("Ctrl+K","",t),this.showDialog=t,e.addMenuItem("link",{icon:"link",text:"Insert link",shortcut:"Ctrl+K",onclick:t,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.1.6 (2020-01-28) + */ +!function(c){"use strict";function n(t){return function(n){return function(n){if(null===n)return"null";var t=typeof n;return"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}(n)===t}}function u(){}function i(n){return function(){return n}}function t(){return A}var e,r=tinymce.util.Tools.resolve("tinymce.PluginManager"),o=tinymce.util.Tools.resolve("tinymce.util.VK"),a=n("string"),f=n("array"),l=n("boolean"),s=n("function"),d=function(n){var t=n.getParam("link_assume_external_targets",!1);return l(t)&&t?1:!a(t)||"http"!==t&&"https"!==t?0:t},m=function(n){return n.getParam("link_context_toolbar",!1,"boolean")},h=function(n){return n.getParam("link_list")},p=function(n){return n.getParam("default_link_target")},g=function(n){return n.getParam("target_list",!0)},v=function(n){return n.getParam("rel_list",[],"array")},y=function(n){return n.getParam("link_class_list",[],"array")},w=function(n){return n.getParam("link_title",!0,"boolean")},x=function(n){return n.getParam("allow_unsafe_link_target",!1,"boolean")},k=function(n){return n.getParam("link_quicklink",!1,"boolean")},b=function(n){var t=c.document.createElement("a");t.target="_blank",t.href=n,t.rel="noreferrer noopener";var e=c.document.createEvent("MouseEvents");e.initMouseEvent("click",!0,!0,c.window,0,0,0,0,0,!1,!1,!1,!1,0,null),function(n,t){c.document.body.appendChild(n),n.dispatchEvent(t),c.document.body.removeChild(n)}(t,e)},_=function(){return(_=Object.assign||function(n){for(var t,e=1,r=arguments.length;e]+>[^<]+<\/a>$/.test(n)||-1===n.indexOf("href=")))},fn=R,ln=function(n,t){return function(n){return n.replace(/\uFEFF/g,"")}(t?t.innerText||t.textContent:n.getContent({format:"text"}))},sn=L,dn=F,mn={sanitize:function(n){return K(q)(n)},sanitizeWith:K,createUi:function(t,e){return function(n){return{name:t,type:"selectbox",label:e,items:n}}},getValue:q},hn=function(n){function t(){return e}var e=n;return{get:t,set:function(n){e=n},clone:function(){return hn(t())}}},pn=function(n,r){function e(n,t){var e=function(n,t){return"link"===t?n.catalogs.link:"anchor"===t?n.catalogs.anchor:J.none()}(r,t.name).getOr([]);return B(o.get(),t.name,e,n)}var o=hn(n.text);return{onChange:function(n,t){return"url"===t.name?function(n){if(o.get().length<=0){var t=n.url.meta.text!==undefined?n.url.meta.text:n.url.value;return J.some({text:t})}return J.none()}(n()):E(["anchor","link"],t.name)?e(n(),t):("text"===t.name&&o.set(n().text),J.none())}}},gn={},vn={exports:gn};V=undefined,W=gn,H=vn,$=undefined,function(n){"object"==typeof W&&void 0!==H?H.exports=n():"function"==typeof V&&V.amd?V([],n):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).EphoxContactWrapper=n()}(function(){return function l(i,u,c){function a(t,n){if(!u[t]){if(!i[t]){var e="function"==typeof $&&$;if(!n&&e)return e(t,!0);if(f)return f(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var o=u[t]={exports:{}};i[t][0].call(o.exports,function(n){return a(i[t][1][n]||n)},o,o.exports,l,i,u,c)}return u[t].exports}for(var f="function"==typeof $&&$,n=0;n||

    - * 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); - container.insertBefore(offsetNode, container.childNodes[offset]); - } else { - container.appendChild(offsetNode); - } - - container = offsetNode; - offset = 0; - } - - bookmark[start ? 'startContainer' : 'endContainer'] = container; - bookmark[start ? 'startOffset' : 'endOffset'] = offset; - } - - setupEndPoint(true); - 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.nodeType == 1) { - if (start) { - offset = nodeIndex(container); - container = container.parentNode; - } else { - 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); - rng.setEnd(bookmark.endContainer, bookmark.endOffset); - - selection.setRng(rng); - } - - function isListNode(node) { - return node && (/^(OL|UL)$/).test(node.nodeName); - } - - function isFirstChild(node) { - return node.parentNode.firstChild == node; - } - - function isLastChild(node) { - return node.parentNode.lastChild == node; - } - - function isTextBlock(node) { - return node && !!editor.schema.getTextBlockElements()[node.nodeName]; - } - - function createNewTextBlock(contentNode, blockName) { - var node, textBlock; - - if (editor.settings.forced_root_block) { - blockName = blockName || editor.settings.forced_root_block; - } - - if (blockName) { - textBlock = dom.create(blockName); - } else { - textBlock = dom.createFragment(); - } - - if (contentNode) { - while ((node = contentNode.firstChild)) { - textBlock.appendChild(node); - } - } - - if (!editor.settings.forced_root_block) { - textBlock.appendChild(dom.create('br')); - } - - // BR is needed in empty blocks on non IE browsers - if (!textBlock.hasChildNodes() && !tinymce.isIE) { - textBlock.innerHTML = '
    '; - } - - return textBlock; - } - - function getSelectedListItems() { - return tinymce.grep(selection.getSelectedBlocks(), function(block) { - return block.nodeName == 'LI'; - }); - } - - function getSelectedTextBlocks() { - return tinymce.grep(selection.getSelectedBlocks(), isTextBlock); - } - - function splitList(ul, li, newBlock) { - var tmpRng, fragment; - - newBlock = newBlock || createNewTextBlock(li); - tmpRng = dom.createRng(); - tmpRng.setStartAfter(li); - tmpRng.setEndAfter(ul); - fragment = tmpRng.extractContents(); - - if (!dom.isEmpty(fragment)) { - dom.insertAfter(fragment, ul); - } - - if (!dom.isEmpty(newBlock)) { - dom.insertAfter(newBlock, ul); - } - - if (dom.isEmpty(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 indent() { - var state, bookmark = createBookmark(selection.getRng(true)); - - tinymce.each(getSelectedListItems(), function(li) { - var sibling, newList; - - sibling = li.previousSibling; - - if (sibling && sibling.nodeName == 'UL') { - sibling.appendChild(li); - return; - } - - if (sibling && sibling.nodeName == 'LI' && isListNode(sibling.lastChild)) { - sibling.lastChild.appendChild(li); - return; - } - - sibling = li.nextSibling; - - if (sibling && sibling.nodeName == 'UL') { - sibling.insertBefore(li, sibling.firstChild); - return; - } - - if (sibling && sibling.nodeName == 'LI' && isListNode(li.lastChild)) { - return; - } - - sibling = li.previousSibling; - if (sibling && sibling.nodeName == 'LI') { - newList = dom.create(li.parentNode.nodeName); - sibling.appendChild(newList); - newList.appendChild(li); - } - - /*sibling = li.nextSibling; - if (sibling && sibling.nodeName == 'LI') { - newList = dom.create(li.parentNode.nodeName); - sibling.insertBefore(newList, sibling.firstChild); - newList.appendChild(li); - }*/ - - state = true; - }); - - moveToBookmark(bookmark); - - return state; - } - - function outdent() { - var state, bookmark = createBookmark(selection.getRng(true)); - - tinymce.each(getSelectedListItems(), function(li) { - var ul = li.parentNode, ulParent = ul.parentNode, newBlock; - - if (isFirstChild(li) && isLastChild(li)) { - if (ulParent.nodeName == "LI") { - dom.insertAfter(li, ulParent); - } else if (isListNode(ulParent)) { - dom.remove(ul, true); - } else { - return; - } - } else if (isFirstChild(li)) { - if (ulParent.nodeName == "LI") { - dom.insertAfter(li, ulParent); - newBlock = dom.create("LI"); - newBlock.appendChild(ul); - dom.insertAfter(newBlock, li); - } else if (isListNode(ulParent)) { - ulParent.insertBefore(li, ul); - } else { - return; - } - } else if (isLastChild(li)) { - if (ulParent.nodeName == "LI") { - dom.insertAfter(li, ulParent); - } else if (isListNode(ulParent)) { - dom.insertAfter(li, ul); - } else { - return; - } - } else { - if (ulParent.nodeName == 'LI') { - ul = ulParent; - newBlock = createNewTextBlock(li, 'LI'); - } else if (isListNode(ulParent)) { - newBlock = createNewTextBlock(li, 'LI'); - } else { - return; - } - - splitList(ul, li, newBlock); - normalizeList(ul.parentNode); - } - - state = true; - }); - - moveToBookmark(bookmark); - - return state; - } - - function applyList(listName) { - var rng = selection.getRng(true), bookmark = createBookmark(rng), textBlocks = getSelectedTextBlocks(); - - function convertNonBlockLines() { - function getEndPointNode(start) { - var container, offset, root = editor.getBody(); - - 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; - } - - function getAllSiblings(node, isForward) { - var sibling, siblings = []; - - if (!isTextBlock(node)) { - // Walk to start/end of line - while (node) { - sibling = node[isForward ? 'previousSibling' : 'nextSibling']; - if (dom.isBlock(sibling) || !sibling) { - break; - } - - node = sibling; - } - - while (node) { - siblings.push(node); - node = node[isForward ? 'nextSibling' : 'previousSibling']; - } - } - - return siblings; - } - - var startNode = getEndPointNode(true); - var endNode = getEndPointNode(); - var block, siblings; - - siblings = getAllSiblings(startNode, true); - - if (startNode != endNode) { - siblings = siblings.concat(getAllSiblings(endNode).reverse()); - } - - tinymce.each(siblings, function(node) { - if (dom.isBlock(node) && node.nodeName != 'BR') { - return; - } - - if (!block || node.nodeName == 'BR') { - if (node.nodeName == 'BR') { - if (!node.nextSibling || (dom.isBlock(node.nextSibling) && node.nextSibling.nodeName != "BR")) { - dom.remove(node); - return false; - } - } - - block = dom.create('p'); - textBlocks.push(block); - node.parentNode.insertBefore(block, node); - } - - if (node.nodeName != 'BR') { - block.appendChild(node); - } else { - dom.remove(node); - } - - if (node == endNode) { - return false; - } - }); - } - - convertNonBlockLines(); - - 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)); - - tinymce.each(getSelectedListItems(), function(li) { - var node, rootList; - - for (node = li; node; 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); - } - } - - plugin.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 (!indent()) { - return true; - } - }); - - editor.addCommand('Outdent', function() { - if (!outdent()) { - return true; - } - }); - - editor.addCommand('InsertUnorderedList', function() { - toggleList('UL'); - }); - - editor.addCommand('InsertOrderedList', function() { - toggleList('OL'); - }); - }); - - editor.on('keydown', function(e) { - if (e.keyCode == tinymce.util.VK.BACKSPACE) { - if (plugin.backspaceDelete()) { - e.preventDefault(); - } - } else if (e.keyCode == tinymce.util.VK.DELETE) { - if (plugin.backspaceDelete(true)) { - e.preventDefault(); - } - } - }); -}); +(function (domGlobals) { + '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 () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return !f.apply(null, args); + }; + }; + 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()') + }; + if (Object.freeze) { + Object.freeze(me); + } + 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 Option = { + some: some, + none: none, + from: from + }; + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + 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 isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isString = isType('string'); + var isArray = isType('array'); + var isBoolean = isType('boolean'); + var isFunction = isType('function'); + var isNumber = isType('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 find = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Option.some(x); + } + } + return Option.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) { + var output = map(xs, f); + return flatten(output); + }; + var reverse = function (xs) { + var r = nativeSlice.call(xs, 0); + r.reverse(); + return r; + }; + var head = function (xs) { + return xs.length === 0 ? Option.none() : Option.some(xs[0]); + }; + var last = function (xs) { + return xs.length === 0 ? Option.none() : Option.some(xs[xs.length - 1]); + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + var compareDocumentPosition = function (a, b, match) { + return (a.compareDocumentPosition(b) & match) !== 0; + }; + var documentPositionPreceding = function (a, b) { + return compareDocumentPosition(a, b, domGlobals.Node.DOCUMENT_POSITION_PRECEDING); + }; + var documentPositionContainedBy = function (a, b) { + return compareDocumentPosition(a, b, domGlobals.Node.DOCUMENT_POSITION_CONTAINED_BY); + }; + var Node = { + documentPositionPreceding: documentPositionPreceding, + documentPositionContainedBy: documentPositionContainedBy + }; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + 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 edge = 'Edge'; + var chrome = 'Chrome'; + var ie = 'IE'; + var opera = 'Opera'; + var firefox = 'Firefox'; + var safari = 'Safari'; + var isBrowser = function (name, current) { + return function () { + return current === name; + }; + }; + 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; + return { + current: current, + version: version, + isEdge: isBrowser(edge, current), + isChrome: isBrowser(chrome, current), + isIE: isBrowser(ie, current), + isOpera: isBrowser(opera, current), + isFirefox: isBrowser(firefox, current), + isSafari: isBrowser(safari, current) + }; + }; + 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 isOS = function (name, current) { + return function () { + return current === name; + }; + }; + 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; + return { + current: current, + version: version, + isWindows: isOS(windows, current), + isiOS: isOS(ios, current), + isAndroid: isOS(android, current), + isOSX: isOS(osx, current), + isLinux: isOS(linux, current), + isSolaris: isOS(solaris, current), + isFreeBSD: isOS(freebsd, current), + isChromeOS: isOS(chromeos, current) + }; + }; + 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 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 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 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 domGlobals.window.matchMedia(query).matches; + }; + var platform = Cell(PlatformDetection.detect(domGlobals.navigator.userAgent, mediaMatch)); + var detect$3 = function () { + return platform.get(); + }; + + var fromHtml = function (html, scope) { + var doc = scope || domGlobals.document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + domGlobals.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 || domGlobals.document; + var node = doc.createElement(tag); + return fromDom(node); + }; + var fromText = function (text, scope) { + var doc = scope || domGlobals.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: constant(node) }; + }; + var fromPoint = function (docElm, x, y) { + var doc = docElm.dom(); + return Option.from(doc.elementFromPoint(x, y)).map(fromDom); + }; + var Element = { + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint + }; + + var ATTRIBUTE = domGlobals.Node.ATTRIBUTE_NODE; + var CDATA_SECTION = domGlobals.Node.CDATA_SECTION_NODE; + var COMMENT = domGlobals.Node.COMMENT_NODE; + var DOCUMENT = domGlobals.Node.DOCUMENT_NODE; + var DOCUMENT_TYPE = domGlobals.Node.DOCUMENT_TYPE_NODE; + var DOCUMENT_FRAGMENT = domGlobals.Node.DOCUMENT_FRAGMENT_NODE; + var ELEMENT = domGlobals.Node.ELEMENT_NODE; + var TEXT = domGlobals.Node.TEXT_NODE; + var PROCESSING_INSTRUCTION = domGlobals.Node.PROCESSING_INSTRUCTION_NODE; + var ENTITY_REFERENCE = domGlobals.Node.ENTITY_REFERENCE_NODE; + var ENTITY = domGlobals.Node.ENTITY_NODE; + var NOTATION = domGlobals.Node.NOTATION_NODE; + + var ELEMENT$1 = ELEMENT; + var is = function (element, selector) { + var dom = element.dom(); + if (dom.nodeType !== ELEMENT$1) { + 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 Node.documentPositionContainedBy(e1.dom(), e2.dom()); + }; + var browser = detect$3().browser; + var contains$1 = browser.isIE() ? ieContains : regularContains; + 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 lift2 = function (oa, ob, f) { + return oa.isSome() && ob.isSome() ? Option.some(f(oa.getOrDie(), ob.getOrDie())) : Option.none(); + }; + + var fromElements = function (elements, scope) { + var doc = scope || domGlobals.document; + var fragment = doc.createDocumentFragment(); + each(elements, function (element) { + fragment.appendChild(element.dom()); + }); + return Element.fromDom(fragment); + }; + + var Immutable = function () { + var fields = []; + for (var _i = 0; _i < arguments.length; _i++) { + fields[_i] = arguments[_i]; + } + return function () { + var values = []; + for (var _i = 0; _i < arguments.length; _i++) { + values[_i] = arguments[_i]; + } + if (fields.length !== values.length) { + throw new Error('Wrong number of arguments to struct. Expected "[' + fields.length + ']", got ' + values.length + ' arguments'); + } + var struct = {}; + each(fields, function (name, i) { + struct[name] = constant(values[i]); + }); + return struct; + }; + }; + + 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 parent = function (element) { + return Option.from(element.dom().parentNode).map(Element.fromDom); + }; + var children = function (element) { + return map(element.dom().childNodes, Element.fromDom); + }; + var child = function (element, index) { + var cs = element.dom().childNodes; + return Option.from(cs[index]).map(Element.fromDom); + }; + var firstChild = function (element) { + return child(element, 0); + }; + var lastChild = function (element) { + return child(element, element.dom().childNodes.length - 1); + }; + var spot = Immutable('element', 'offset'); + + 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 fireListEvent = function (editor, action, element) { + return editor.fire('ListMutation', { + action: action, + element: element + }); + }; + + var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')(); + + var path = function (parts, scope) { + var o = scope !== undefined && scope !== null ? scope : Global; + for (var i = 0; i < parts.length && o !== undefined && o !== null; ++i) { + o = o[parts[i]]; + } + return o; + }; + var resolve = function (p, scope) { + var parts = p.split('.'); + return path(parts, scope); + }; + + var unsafe = function (name, scope) { + return resolve(name, scope); + }; + var getOrDie = function (name, scope) { + var actual = unsafe(name, scope); + if (actual === undefined || actual === null) { + throw new Error(name + ' not available on this browser'); + } + return actual; + }; + var Global$1 = { getOrDie: getOrDie }; + + var htmlElement = function (scope) { + return Global$1.getOrDie('HTMLElement', scope); + }; + var isPrototypeOf = function (x) { + var scope = resolve('ownerDocument.defaultView', x); + return htmlElement(scope).prototype.isPrototypeOf(x); + }; + var HTMLElement = { isPrototypeOf: isPrototypeOf }; + + var global$4 = tinymce.util.Tools.resolve('tinymce.dom.DomQuery'); + + var global$5 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var isTextNode = function (node) { + return node && node.nodeType === 3; + }; + var isListNode = function (node) { + return node && /^(OL|UL|DL)$/.test(node.nodeName); + }; + var isOlUlNode = function (node) { + return node && /^(OL|UL)$/.test(node.nodeName); + }; + var isListItemNode = function (node) { + return node && /^(LI|DT|DD)$/.test(node.nodeName); + }; + var isDlItemNode = function (node) { + return node && /^(DT|DD)$/.test(node.nodeName); + }; + var isTableCellNode = function (node) { + return node && /^(TH|TD)$/.test(node.nodeName); + }; + var isBr = function (node) { + return node && node.nodeName === 'BR'; + }; + var isFirstChild = function (node) { + return node.parentNode.firstChild === node; + }; + var isLastChild = function (node) { + return node.parentNode.lastChild === 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; + } + if (dom.isBlock(node.nextSibling) && !isBr(node.previousSibling)) { + return true; + } + return false; + }; + 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 NodeType = { + isTextNode: isTextNode, + isListNode: isListNode, + isOlUlNode: isOlUlNode, + isDlItemNode: isDlItemNode, + isListItemNode: isListItemNode, + isTableCellNode: isTableCellNode, + isBr: isBr, + isFirstChild: isFirstChild, + isLastChild: isLastChild, + isTextBlock: isTextBlock, + isBlock: isBlock, + isBogusBr: isBogusBr, + isEmpty: isEmpty, + isChildOfBody: isChildOfBody + }; + + var getParentList = function (editor) { + var selectionStart = 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 NodeType.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 NodeType.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$4.unique(listItemsElms); + }; + var getSelectedListItems = function (editor) { + var selectedBlocks = editor.selection.getSelectedBlocks(); + return global$5.grep(findParentListItemsNodes(editor, selectedBlocks), function (block) { + return NodeType.isListItemNode(block); + }); + }; + var getSelectedDlItems = function (editor) { + return filter(getSelectedListItems(editor), NodeType.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(), NodeType.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$4.unique(listRoots); + }; + var isList = function (editor) { + var list = getParentList(editor); + return HTMLElement.isPrototypeOf(list); + }; + var Selection = { + isList: isList, + getParentList: getParentList, + getSelectedSubLists: getSelectedSubLists, + getSelectedListItems: getSelectedListItems, + getClosestListRootElm: getClosestListRootElm, + getSelectedDlItems: getSelectedDlItems, + getSelectedListRoots: getSelectedListRoots + }; + + var createTextBlock = function (editor, contentNode) { + var dom = editor.dom; + var blockElements = editor.schema.getBlockElements(); + var fragment = dom.createFragment(); + var node, textBlock, blockName, hasContentNode; + if (editor.settings.forced_root_block) { + 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); + } + if (!NodeType.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 (NodeType.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 (!editor.settings.forced_root_block) { + fragment.appendChild(dom.create('br')); + } else { + if (!hasContentNode) { + textBlock.appendChild(dom.create('br', { 'data-mce-bogus': '1' })); + } + } + return fragment; + }; + + 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 { + domGlobals.console.error('Invalid call to Attr.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 isSupported = function (dom) { + return dom.style !== undefined && isFunction(dom.style.getPropertyValue); + }; + + var internalSet = function (dom, property, value) { + if (!isString(value)) { + domGlobals.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 clone$1 = function (original, isDeep) { + return Element.fromDom(original.dom().cloneNode(isDeep)); + }; + var deep = function (original) { + return clone$1(original, true); + }; + var shallowAs = function (original, tag) { + var nu = Element.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 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: Element.fromTag(listType, scope), + item: Element.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 = Element.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$1 = function (el) { + return is$1(el, 'OL,UL'); + }; + var hasFirstChildList = function (el) { + return firstChild(el).map(isList$1).getOr(false); + }; + var hasLastChildList = function (el) { + return lastChild(el).map(isList$1).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, + 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; + } + }; + + var hasOwnProperty = Object.prototype.hasOwnProperty; + var shallow = function (old, nu) { + return 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 merge = baseMerge(shallow); + + var cloneListProperties = function (target, source) { + target.listType = source.listType; + target.listAttributes = merge({}, source.listAttributes); + }; + var previousSiblingEntry = function (entries, start) { + var depth = entries[start].depth; + for (var i = start - 1; i >= 0; i--) { + if (entries[i].depth === depth) { + return Option.some(entries[i]); + } + if (entries[i].depth < depth) { + break; + } + } + return Option.none(); + }; + var normalizeEntries = function (entries) { + each(entries, function (entry, i) { + previousSiblingEntry(entries, i).each(function (matchingEntry) { + cloneListProperties(entry, matchingEntry); + }); + }); + }; + + var parseItem = function (depth, itemSelection, selectionState, item) { + return firstChild(item).filter(isList$1).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$1).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$1(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) { + return map(entries, function (entry) { + var content = fromElements(entry.content); + return Element.fromDom(createTextBlock(editor, content.dom())); + }); + }; + var indentedComposer = function (editor, entries) { + normalizeEntries(entries); + return composeList(editor.contentDocument, entries).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(Selection.getSelectedListItems(editor), Element.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 global$6 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); + + var DOM = global$6.DOM; + var splitList = function (editor, ul, li) { + var tmpRng, fragment, bookmarks, node, newBlock; + var removeAndKeepBookmarks = function (targetNode) { + global$5.each(bookmarks, function (node) { + targetNode.parentNode.insertBefore(node, li.parentNode); + }); + DOM.remove(targetNode); + }; + bookmarks = DOM.select('span[data-mce-type="bookmark"]', ul); + newBlock = createTextBlock(editor, li); + tmpRng = DOM.createRng(); + tmpRng.setStartAfter(li); + tmpRng.setEndAfter(ul); + fragment = tmpRng.extractContents(); + for (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 (NodeType.isEmpty(editor.dom, li.parentNode)) { + removeAndKeepBookmarks(li.parentNode); + } + DOM.remove(li); + if (NodeType.isEmpty(editor.dom, ul)) { + DOM.remove(ul); + } + }; + var SplitList = { splitList: splitList }; + + 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.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 (NodeType.isTextNode(container)) { + return { + container: container, + offset: offset + }; + } + var node = global$1.getNode(container, offset); + if (NodeType.isTextNode(node)) { + return { + container: node, + offset: offset >= container.childNodes.length ? node.data.length : 0 + }; + } else if (node.previousSibling && NodeType.isTextNode(node.previousSibling)) { + return { + container: node.previousSibling, + offset: node.previousSibling.data.length + }; + } else if (node.nextSibling && NodeType.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 Range = { + getNormalizedPoint: getNormalizedPoint, + normalizeRange: normalizeRange + }; + + var selectionIndentation = function (editor, indentation) { + var lists = map(Selection.getSelectedListRoots(editor), Element.fromDom); + var dlItems = map(Selection.getSelectedDlItems(editor), Element.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(Range.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$6.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 Range.normalizeRange(rng); + }; + var Bookmark = { + createBookmark: createBookmark, + resolveBookmark: resolveBookmark + }; + + var isCustomList = function (list) { + return /\btox\-/.test(list.className); + }; + + var listToggleActionFromListName = function (listName) { + switch (listName) { + case 'UL': + return 'ToggleUlList'; + case 'OL': + return 'ToggleOlList'; + case 'DL': + return 'ToggleDLList'; + } + }; + + 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, offset; + container = rng[start ? 'startContainer' : 'endContainer']; + offset = rng[start ? 'startOffset' : 'endOffset']; + if (container.nodeType === 1) { + container = container.childNodes[Math.min(offset, container.childNodes.length - 1)] || container; + } + if (!start && NodeType.isBr(container.nextSibling)) { + container = container.nextSibling; + } + while (container.parentNode !== root) { + if (NodeType.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 (NodeType.isTextBlock(editor, node)) { + textBlocks.push(node); + block = null; + return; + } + if (dom.isBlock(node) || NodeType.isBr(node)) { + if (NodeType.isBr(node)) { + dom.remove(node); + } + block = null; + return; + } + var nextSibling = node.nextSibling; + if (global$7.isBookmarkNode(node)) { + if (NodeType.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(true); + var bookmark; + var listItemName = 'LI'; + var root = Selection.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'; + } + bookmark = Bookmark.createBookmark(rng); + global$5.each(getSelectedTextBlocks(editor, rng, root), function (block) { + var listBlock, sibling; + sibling = block.previousSibling; + if (sibling && NodeType.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(Bookmark.resolveBookmark(bookmark)); + }; + var isValidLists = function (list1, list2) { + return list1 && list2 && NodeType.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 = Bookmark.createBookmark(editor.selection.getRng(true)); + global$5.each([parentList].concat(lists), function (elm) { + updateList(editor, elm, listName, detail); + }); + editor.selection.setRng(Bookmark.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 = 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(Bookmark.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 = Selection.getParentList(editor); + var selectedSubLists = Selection.getSelectedSubLists(editor); + detail = detail ? detail : {}; + if (parentList && selectedSubLists.length > 0) { + toggleMultipleLists(editor, parentList, selectedSubLists, listName, detail); + } else { + toggleSingleList(editor, parentList, listName, detail); + } + }; + var ToggleList = { + toggleList: toggleList, + mergeWithAdjacentLists: mergeWithAdjacentLists + }; + + var DOM$2 = global$6.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 (NodeType.isEmpty(dom, parentNode)) { + DOM$2.remove(parentNode); + } + } else { + DOM$2.setStyle(parentNode, 'listStyleType', 'none'); + } + } + if (NodeType.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 NormalizeLists = { + normalizeList: normalizeList, + normalizeLists: normalizeLists + }; + + var findNextCaretContainer = function (editor, rng, isForward, root) { + var node = rng.startContainer; + var offset = rng.startOffset; + if (NodeType.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 (NodeType.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 (NodeType.isTextNode(node) && node.data.length > 0) { + return node; + } + } + }; + var hasOnlyOneBlockChild = function (dom, elm) { + var childNodes = elm.childNodes; + return childNodes.length === 1 && !NodeType.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, targetElm; + targetElm = hasOnlyOneBlockChild(dom, toElm) ? toElm.firstChild : toElm; + unwrapSingleBlockChild(dom, fromElm); + if (!NodeType.isEmpty(dom, fromElm, true)) { + while (node = fromElm.firstChild) { + targetElm.appendChild(node); + } + } + }; + var mergeLiElements = function (dom, fromElm, toElm) { + var node, listNode; + var ul = fromElm.parentNode; + if (!NodeType.isChildOfBody(dom, fromElm) || !NodeType.isChildOfBody(dom, toElm)) { + return; + } + if (NodeType.isListNode(toElm.lastChild)) { + listNode = toElm.lastChild; + } + if (ul === toElm.lastChild) { + if (NodeType.isBr(ul.previousSibling)) { + dom.remove(ul.previousSibling); + } + } + node = toElm.lastChild; + if (node && NodeType.isBr(node) && fromElm.hasChildNodes()) { + dom.remove(node); + } + if (NodeType.isEmpty(dom, toElm, true)) { + dom.$(toElm).empty(); + } + moveChildren(dom, fromElm, toElm); + if (listNode) { + toElm.appendChild(listNode); + } + var contains = contains$1(Element.fromDom(toElm), Element.fromDom(fromElm)); + var nestedLists = contains ? dom.getParents(fromElm, NodeType.isListNode, toElm) : []; + dom.remove(fromElm); + each(nestedLists, function (list) { + if (NodeType.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 = Bookmark.createBookmark(rng); + mergeLiElements(dom, fromLi, toLi); + editor.selection.setRng(Bookmark.resolveBookmark(bookmark)); + } + }; + var mergeBackward = function (editor, rng, fromLi, toLi) { + var bookmark = Bookmark.createBookmark(rng); + mergeLiElements(editor.dom, fromLi, toLi); + var resolvedBookmark = Bookmark.resolveBookmark(bookmark); + editor.selection.setRng(resolvedBookmark); + }; + var backspaceDeleteFromListToListCaret = function (editor, isForward) { + var dom = editor.dom, selection = editor.selection; + var selectionStartElm = selection.getStart(); + var root = Selection.getClosestListRootElm(editor, selectionStartElm); + var li = dom.getParent(selection.getStart(), 'LI', root); + if (li) { + var ul = li.parentNode; + if (ul === editor.getBody() && NodeType.isEmpty(dom, ul)) { + return true; + } + var rng_1 = Range.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 (NodeType.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 = Selection.getClosestListRootElm(editor, selectionStartElm); + var block = dom.getParent(selectionStartElm, dom.isBlock, root); + if (block && dom.isEmpty(block)) { + var rng = Range.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); + ToggleList.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 = Selection.getClosestListRootElm(editor, selectionStartElm); + var startListParent = editor.dom.getParent(selectionStartElm, 'LI,DT,DD', root); + if (startListParent || Selection.getSelectedListItems(editor).length > 0) { + editor.undoManager.transact(function () { + editor.execCommand('Delete'); + NormalizeLists.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 Delete = { + setup: setup, + backspaceDelete: backspaceDelete + }; + + var get = function (editor) { + return { + backspaceDelete: function (isForward) { + Delete.backspaceDelete(editor, isForward); + } + }; + }; + var Api = { get: get }; + + 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.toggleList(editor, 'UL', detail); + }); + editor.addCommand('InsertOrderedList', function (ui, detail) { + ToggleList.toggleList(editor, 'OL', detail); + }); + editor.addCommand('InsertDefinitionList', function (ui, detail) { + ToggleList.toggleList(editor, 'DL', detail); + }); + editor.addCommand('RemoveList', function () { + flattenListSelection(editor); + }); + editor.addQueryStateHandler('InsertUnorderedList', queryListCommandState(editor, 'UL')); + editor.addQueryStateHandler('InsertOrderedList', queryListCommandState(editor, 'OL')); + editor.addQueryStateHandler('InsertDefinitionList', queryListCommandState(editor, 'DL')); + }; + var Commands = { register: register }; + + var shouldIndentOnTab = function (editor) { + return editor.getParam('lists_indent_on_tab', true); + }; + var Settings = { shouldIndentOnTab: shouldIndentOnTab }; + + 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 (Settings.shouldIndentOnTab(editor)) { + setupTabKey(editor); + } + Delete.setup(editor); + }; + var Keyboard = { setup: setup$1 }; + + 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 listState = function (editor, listName) { + return function (buttonApi) { + var nodeChangeHandler = function (e) { + var tableCellIndex = findIndex(e.parents, NodeType.isTableCellNode); + var parents = tableCellIndex !== -1 ? e.parents.slice(0, tableCellIndex) : e.parents; + var lists = global$5.grep(parents, NodeType.isListNode); + buttonApi.setActive(lists.length > 0 && lists[0].nodeName === listName && !isCustomList(lists[0])); + }; + editor.on('NodeChange', nodeChangeHandler); + return function () { + return editor.off('NodeChange', nodeChangeHandler); + }; + }; + }; + var register$1 = function (editor) { + var hasPlugin = function (editor, plugin) { + var plugins = editor.settings.plugins ? editor.settings.plugins : ''; + return global$5.inArray(plugins.split(/[ ,]/), plugin) !== -1; + }; + var exec = function (command) { + return function () { + return editor.execCommand(command); + }; + }; + if (!hasPlugin(editor, 'advlist')) { + editor.ui.registry.addToggleButton('numlist', { + icon: 'ordered-list', + active: false, + tooltip: 'Numbered list', + onAction: exec('InsertOrderedList'), + onSetup: listState(editor, 'OL') + }); + editor.ui.registry.addToggleButton('bullist', { + icon: 'unordered-list', + active: false, + tooltip: 'Bullet list', + onAction: exec('InsertUnorderedList'), + onSetup: listState(editor, 'UL') + }); + } + }; + var Buttons = { register: register$1 }; + + function Plugin () { + global.add('lists', function (editor) { + Keyboard.setup(editor); + Buttons.register(editor); + Commands.register(editor); + return Api.get(editor); + }); + } + + Plugin(); + +}(window)); diff --git a/lib/tinymce/js/tinymce/plugins/lists/plugin.min.js b/lib/tinymce/js/tinymce/plugins/lists/plugin.min.js index 41279bed..5ed2fc42 100644 --- a/lib/tinymce/js/tinymce/plugins/lists/plugin.min.js +++ b/lib/tinymce/js/tinymce/plugins/lists/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("lists",function(e){var t=this;e.on("init",function(){function n(e){function t(t){var i,o,a;o=e[t?"startContainer":"endContainer"],a=e[t?"startOffset":"endOffset"],1==o.nodeType&&(i=b.create("span",{"data-mce-type":"bookmark"}),o.hasChildNodes()?(a=Math.min(a,o.childNodes.length-1),o.insertBefore(i,o.childNodes[a])):o.appendChild(i),o=i,a=0),n[t?"startContainer":"endContainer"]=o,n[t?"startOffset":"endOffset"]=a}var n={};return t(!0),t(),n}function i(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 i,o,a;i=a=e[t?"startContainer":"endContainer"],o=e[t?"startOffset":"endOffset"],1==i.nodeType&&(t?(o=n(i),i=i.parentNode):(o=n(i),i=i.parentNode),b.remove(a)),e[t?"startContainer":"endContainer"]=i,e[t?"startOffset":"endOffset"]=o}t(!0),t();var n=b.createRng();n.setStart(e.startContainer,e.startOffset),n.setEnd(e.endContainer,e.endOffset),C.setRng(n)}function o(e){return e&&/^(OL|UL)$/.test(e.nodeName)}function a(e){return e.parentNode.firstChild==e}function r(e){return e.parentNode.lastChild==e}function l(t){return t&&!!e.schema.getTextBlockElements()[t.nodeName]}function s(t,n){var i,o;if(e.settings.forced_root_block&&(n=n||e.settings.forced_root_block),o=n?b.create(n):b.createFragment(),t)for(;i=t.firstChild;)o.appendChild(i);return e.settings.forced_root_block||o.appendChild(b.create("br")),o.hasChildNodes()||tinymce.isIE||(o.innerHTML='
    '),o}function c(){return tinymce.grep(C.getSelectedBlocks(),function(e){return"LI"==e.nodeName})}function d(){return tinymce.grep(C.getSelectedBlocks(),l)}function u(e,t,n){var i,o;n=n||s(t),i=b.createRng(),i.setStartAfter(t),i.setEndAfter(e),o=i.extractContents(),b.isEmpty(o)||b.insertAfter(o,e),b.isEmpty(n)||b.insertAfter(n,e),b.isEmpty(t.parentNode)&&b.remove(t.parentNode),b.remove(t)}function m(e){var t,n;if(t=e.nextSibling,t&&o(t)&&t.nodeName==e.nodeName){for(;n=t.firstChild;)e.appendChild(n);b.remove(t)}if(t=e.previousSibling,t&&o(t)&&t.nodeName==e.nodeName){for(;n=t.firstChild;)e.insertBefore(n,e.firstChild);b.remove(t)}}function g(e){tinymce.each(tinymce.grep(b.select("ol,ul",e)),function(e){var t,n=e.parentNode;"LI"==n.nodeName&&n.firstChild==e&&(t=n.previousSibling,t&&"LI"==t.nodeName&&(t.appendChild(e),b.isEmpty(n)&&b.remove(n))),o(n)&&(t=n.previousSibling,t&&"LI"==t.nodeName&&t.appendChild(e))})}function f(){var e,t=n(C.getRng(!0));return tinymce.each(c(),function(t){var n,i;return n=t.previousSibling,n&&"UL"==n.nodeName?(n.appendChild(t),void 0):n&&"LI"==n.nodeName&&o(n.lastChild)?(n.lastChild.appendChild(t),void 0):(n=t.nextSibling,n&&"UL"==n.nodeName?(n.insertBefore(t,n.firstChild),void 0):(n&&"LI"==n.nodeName&&o(t.lastChild)||(n=t.previousSibling,n&&"LI"==n.nodeName&&(i=b.create(t.parentNode.nodeName),n.appendChild(i),i.appendChild(t)),e=!0),void 0))}),i(t),e}function h(){var e,t=n(C.getRng(!0));return tinymce.each(c(),function(t){var n,i=t.parentNode,l=i.parentNode;if(a(t)&&r(t))if("LI"==l.nodeName)b.insertAfter(t,l);else{if(!o(l))return;b.remove(i,!0)}else if(a(t))if("LI"==l.nodeName)b.insertAfter(t,l),n=b.create("LI"),n.appendChild(i),b.insertAfter(n,t);else{if(!o(l))return;l.insertBefore(t,i)}else if(r(t))if("LI"==l.nodeName)b.insertAfter(t,l);else{if(!o(l))return;b.insertAfter(t,i)}else{if("LI"==l.nodeName)i=l,n=s(t,"LI");else{if(!o(l))return;n=s(t,"LI")}u(i,t,n),g(i.parentNode)}e=!0}),i(t),e}function p(t){function a(){function t(t){var n,i,o=e.getBody();for(n=r[t?"startContainer":"endContainer"],i=r[t?"startOffset":"endOffset"],1==n.nodeType&&(n=n.childNodes[Math.min(i,n.childNodes.length-1)]||n);n.parentNode!=o;){if(l(n))return n;if(/^(TD|TH)$/.test(n.parentNode.nodeName))return n;n=n.parentNode}return n}function n(e,t){var n,i=[];if(!l(e)){for(;e&&(n=e[t?"previousSibling":"nextSibling"],!b.isBlock(n)&&n);)e=n;for(;e;)i.push(e),e=e[t?"nextSibling":"previousSibling"]}return i}var i,o,a=t(!0),s=t();o=n(a,!0),a!=s&&(o=o.concat(n(s).reverse())),tinymce.each(o,function(e){if(!b.isBlock(e)||"BR"==e.nodeName){if(!i||"BR"==e.nodeName){if("BR"==e.nodeName&&(!e.nextSibling||b.isBlock(e.nextSibling)&&"BR"!=e.nextSibling.nodeName))return b.remove(e),!1;i=b.create("p"),c.push(i),e.parentNode.insertBefore(i,e)}return"BR"!=e.nodeName?i.appendChild(e):b.remove(e),e==s?!1:void 0}})}var r=C.getRng(!0),s=n(r),c=d();a(),tinymce.each(c,function(e){var n,i;i=e.previousSibling,i&&o(i)&&i.nodeName==t?(n=i,e=b.rename(e,"LI"),i.appendChild(e)):(n=b.create(t),e.parentNode.insertBefore(n,e),n.appendChild(e),e=b.rename(e,"LI")),m(n)}),i(s)}function y(){var e=n(C.getRng(!0));tinymce.each(c(),function(e){var t,n;for(t=e;t;t=t.parentNode)o(t)&&(n=t);u(n,e)}),i(e)}function v(e){var t=b.getParent(C.getStart(),"OL,UL");if(t)if(t.nodeName==e)y(e);else{var o=n(C.getRng(!0));m(b.rename(t,e)),i(o)}else p(e)}var b=e.dom,C=e.selection;t.backspaceDelete=function(e){function t(e,t){var n=e.startContainer,i=e.startOffset;if(3==n.nodeType&&(t?n.data.length>i:i>0))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 a(e,t){var n,i,a=e.parentNode;for(o(t.lastChild)&&(i=t.lastChild),n=t.lastChild,n&&"BR"==n.nodeName&&e.hasChildNodes()&&b.remove(n);n=e.firstChild;)t.appendChild(n);i&&t.appendChild(i),b.remove(e),b.isEmpty(a)&&b.remove(a)}if(C.isCollapsed()){var r=b.getParent(C.getStart(),"LI");if(r){var l=C.getRng(!0),s=b.getParent(t(l,e),"LI");if(s&&s!=r){var c=n(l);return e?a(s,r):a(r,s),i(c),!0}if(!s&&!e&&y(r.parentNode.nodeName))return!0}}},e.addCommand("Indent",function(){return f()?void 0:!0}),e.addCommand("Outdent",function(){return h()?void 0:!0}),e.addCommand("InsertUnorderedList",function(){v("UL")}),e.addCommand("InsertOrderedList",function(){v("OL")})}),e.on("keydown",function(e){e.keyCode==tinymce.util.VK.BACKSPACE?t.backspaceDelete()&&e.preventDefault():e.keyCode==tinymce.util.VK.DELETE&&t.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.1.6 (2020-01-28) + */ +!function(r){"use strict";function e(){}function l(e){return function(){return e}}function t(t){return function(){for(var e=[],n=0;ne.length?ne(t,e,n):ee(t,e,n)},[]);return S(n).map(function(e){return e.list})}(e.contentDocument,n).toArray()}function de(e){var n=g(Zn.getSelectedListItems(e),Ln.fromDom);return A(N(n,t(re)),N(function(e){var n=Xe.call(e,0);return n.reverse(),n}(n),t(re)),function(e,n){return{start:e,end:n}})}function le(t,e,r){var n=function(e,n){var t=Ge(!1);return g(e,function(e){return{sourceList:e,entries:rt(0,n,t,e)}})}(e,de(t));p(n,function(e){!function(e,n){p(v(e,ie),function(e){return function(e,n){switch(e){case"Indent":n.depth++;break;case"Outdent":n.depth--;break;case"Flatten":n.depth=0}}(n,e)})}(e.entries,r);var n=function(n,e){return y(function(e,n){if(0===e.length)return[];for(var t=n(e[0]),r=[],o=[],i=0,u=e.length;i=e.childNodes.length?t.data.length:0}:t.previousSibling&&Un(t.previousSibling)?{container:t.previousSibling,offset:t.previousSibling.data.length}:t.nextSibling&&Un(t.nextSibling)?{container:t.nextSibling,offset:0}:{container:e,offset:n}}function ve(e,n){var t=g(Zn.getSelectedListRoots(e),Ln.fromDom),r=g(Zn.getSelectedDlItems(e),Ln.fromDom),o=!1;if(t.length||r.length){var i=e.selection.getBookmark();le(e,t,n),ge(e,n,r),e.selection.moveToBookmark(i),e.selection.setRng(st(e.selection.getRng())),e.nodeChanged(),o=!0}return o}function he(e){return ve(e,"Indent")}function Ne(e){return ve(e,"Outdent")}function ye(e){return ve(e,"Flatten")}function Se(e){return/\btox\-/.test(e.className)}function Oe(e){switch(e){case"UL":return"ToggleUlList";case"OL":return"ToggleOlList";case"DL":return"ToggleDLList"}}function Ce(t,e){Mn.each(e,function(e,n){t.setAttribute(n,e)})}function be(e,n,t){!function(e,n,t){var r=t["list-style-type"]?t["list-style-type"]:null;e.setStyle(n,"list-style-type",r)}(e,n,t),function(e,n,t){Ce(n,t["list-attributes"]),Mn.each(e.select("li",n),function(e){Ce(e,t["list-item-attributes"])})}(e,n,t)}function Le(e,n,t,r){var o,i;for(o=n[t?"startContainer":"endContainer"],i=n[t?"startOffset":"endOffset"],1===o.nodeType&&(o=o.childNodes[Math.min(i,o.childNodes.length-1)]||o),!t&&Wn(o.nextSibling)&&(o=o.nextSibling);o.parentNode!==r;){if(zn(e,o))return o;if(/^(TD|TH)$/.test(o.parentNode.nodeName))return o;o=o.parentNode}return o}function Te(r,o,i){void 0===i&&(i={});var e,n=r.selection.getRng(!0),u="LI",t=Zn.getClosestListRootElm(r,r.selection.getStart(!0)),s=r.dom;"false"!==s.getContentEditable(r.selection.getNode())&&("DL"===(o=o.toUpperCase())&&(u="DT"),e=ft(n),Mn.each(function(t,e,r){for(var o,i=[],u=t.dom,n=Le(t,e,!0,r),s=Le(t,e,!1,r),a=[],c=n;c&&(a.push(c),c!==s);c=c.nextSibling);return Mn.each(a,function(e){if(zn(t,e))return i.push(e),void(o=null);if(u.isBlock(e)||Wn(e))return Wn(e)&&u.remove(e),void(o=null);var n=e.nextSibling;at.isBookmarkNode(e)&&(zn(t,n)||!n&&e.parentNode===r)?o=null:(o||(o=u.create("p"),e.parentNode.insertBefore(o,e),i.push(o)),o.appendChild(e))}),i}(r,n,t),function(e){var n,t;(t=e.previousSibling)&&Fn(t)&&t.nodeName===o&&function(e,n,t){var r=e.getStyle(n,"list-style-type"),o=t?t["list-style-type"]:"";return r===(o=null===o?"":o)}(s,t,i)?(n=t,e=s.rename(e,u),t.appendChild(e)):(n=s.create(o),e.parentNode.insertBefore(n,e),n.appendChild(e),e=s.rename(e,u)),function(t,r,e){Mn.each(e,function(e){var n;return t.setStyle(r,((n={})[e]="",n))})}(s,e,["margin","margin-right","margin-bottom","margin-left","margin-top","padding","padding-right","padding-bottom","padding-left","padding-top"]),be(s,n,i),lt(r.dom,n)}),r.selection.setRng(dt(e)))}function De(e,n,t){return function(e,n){return e&&n&&Fn(e)&&e.nodeName===n.nodeName}(n,t)&&function(e,n,t){return e.getStyle(n,"list-style-type",!0)===e.getStyle(t,"list-style-type",!0)}(e,n,t)&&function(e,n){return e.className===n.className}(n,t)}function Ee(n,e,t,r,o){if(e.nodeName!==r||mt(o)){var i=ft(n.selection.getRng(!0));Mn.each([e].concat(t),function(e){!function(e,n,t,r){if(n.nodeName!==t){var o=e.dom.rename(n,t);be(e.dom,o,r),j(e,Oe(t),o)}else be(e.dom,n,r),j(e,Oe(t),n)}(n,e,r,o)}),n.selection.setRng(dt(i))}else ye(n)}function we(e,n){var t,r=n.parentNode;"LI"===r.nodeName&&r.firstChild===n&&((t=r.previousSibling)&&"LI"===t.nodeName?(t.appendChild(n),Qn(e,r)&&pt.remove(r)):pt.setStyle(r,"listStyleType","none")),Fn(r)&&(t=r.previousSibling)&&"LI"===t.nodeName&&t.appendChild(n)}function ke(e,n,t,r){var o=n.startContainer,i=n.startOffset;if(Un(o)&&(t?i'; - } else if (data.source1mime.indexOf('audio') != -1) { - if (editor.settings.audio_template_callback) { - html = editor.settings.audio_template_callback(data); - } else { - html += ( - '' - ); - } - } else { - if (editor.settings.video_template_callback) { - html = editor.settings.video_template_callback(data); - } else { - html = ( - '' - ); - } - } - } - - return html; - } - - function htmlToData(html) { - var data = {}; - - new tinymce.html.SaxParser({ - validate: false, - special: 'script,noscript', - start: function(name, attrs) { - if (!data.source1 && name == "param") { - data.source1 = attrs.map.movie; - } - - if (name == "iframe" || name == "object" || name == "embed" || name == "video" || name == "audio") { - data = tinymce.extend(attrs.map, data); - } - - if (name == "source") { - if (!data.source1) { - data.source1 = attrs.map.src; - } else if (!data.source2) { - data.source2 = attrs.map.src; - } - } - } - }).parse(html); - - data.source1 = data.source1 || data.src || data.data; - data.source2 = data.source2 || ''; - data.poster = data.poster || ''; - - return data; - } - - function getData(element) { - if (element.getAttribute('data-mce-object')) { - return htmlToData(editor.serializer.serialize(element, {selection: true})); - } - - return {}; - } - - function updateHtml(html, data, updateAll) { - var writer = new tinymce.html.Writer(); - var sourceCount = 0; - - function setAttributes(attrs, updatedAttrs) { - var name, i, value, attr; - - for (name in updatedAttrs) { - value = "" + updatedAttrs[name]; - - if (attrs.map[name]) { - i = attrs.length; - while (i--) { - attr = attrs[i]; - - if (attr.name == name) { - if (value) { - attrs.map[name] = value; - attr.value = value; - } else { - delete attrs.map[name]; - attrs.splice(i, 1); - } - } - } - } else if (value) { - attrs.push({ - name: name, - value: value - }); - - attrs.map[name] = value; - } - } - } - - new tinymce.html.SaxParser({ - validate: false, - special: 'script,noscript', - - 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) { - switch (name) { - case "video": - case "object": - case "img": - case "iframe": - setAttributes(attrs, { - width: data.width, - height: data.height - }); - break; - } - - if (updateAll) { - switch (name) { - case "video": - setAttributes(attrs, { - poster: data.poster, - src: "" - }); - - if (data.source2) { - setAttributes(attrs, { - src: "" - }); - } - break; - - case "iframe": - setAttributes(attrs, { - src: data.source1 - }); - break; - - case "source": - sourceCount++; - - if (sourceCount <= 2) { - setAttributes(attrs, { - src: data["source" + sourceCount], - type: data["source" + sourceCount + "mime"] - }); - - if (!data["source" + sourceCount]) { - return; - } - } - break; - } - } - - writer.start(name, attrs, empty); - }, - - end: function(name) { - if (name == "video" && updateAll) { - for (var index = 1; index <= 2; index++) { - if (data["source" + index]) { - var attrs = []; - attrs.map = {}; - - if (sourceCount < index) { - setAttributes(attrs, { - src: data["source" + index], - type: data["source" + index + "mime"] - }); - - writer.start("source", attrs, true); - } - } - } - } - - writer.end(name); - } - }, new tinymce.html.Schema({})).parse(html); - - return writer.getContent(); - } - - editor.on('ResolveName', function(e) { - var name; - - if ((name = e.target.getAttribute("data-mce-object"))) { - e.name = name; - } - }); - - editor.on('preInit', function() { - // Make sure that any messy HTML is retained inside these - var specialElements = editor.schema.getSpecialElements(); - tinymce.each('video audio iframe object'.split(' '), function(name) { - specialElements[name] = new RegExp('<\/' + name + '[^>]*>','gi'); - }); - - // Allow elements - editor.schema.addValidElements('object[id|style|width|height|classid|codebase|*],embed[id|style|width|height|type|src|*],video[*],audio[*]'); - - // Set allowFullscreen attribs as boolean - var boolAttrs = editor.schema.getBoolAttrs(); - tinymce.each('webkitallowfullscreen mozallowfullscreen allowfullscreen'.split(' '), function(name) { - boolAttrs[name] = {}; - }); - - // Converts iframe, video etc into placeholder images - editor.parser.addNodeFilter('iframe,video,audio,object,embed', function(nodes, name) { - var i = nodes.length, ai, node, placeHolder, attrName, attrValue, attribs, innerHtml; - - while (i--) { - node = nodes[i]; - placeHolder = new tinymce.html.Node('img', 1); - placeHolder.shortEnded = true; - - // Prefix all attributes except width, height and style since we - // will add these to the placeholder - attribs = node.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); - } - - placeHolder.attr('data-mce-p-' + attrName, attrValue); - } - } - - // Place the inner HTML contents inside an escaped attribute - // This enables us to copy/paste the fake object - innerHtml = node.firstChild && node.firstChild.value; - if (innerHtml) { - placeHolder.attr("data-mce-html", escape(innerHtml)); - placeHolder.firstChild = null; - } - - placeHolder.attr({ - width: node.attr('width') || "300", - height: node.attr('height') || (name == "audio" ? "30" : "150"), - style: node.attr('style'), - src: tinymce.Env.transparentSrc, - "data-mce-object": name, - "class": "mce-object mce-object-" + name - }); - - node.replace(placeHolder); - } - }); - - // Replaces placeholder images with real elements for video, object, iframe etc - editor.serializer.addAttributeFilter('data-mce-object', function(nodes, name) { - var i = nodes.length, node, realElm, ai, attribs, innerHtml, innerNode; - - while (i--) { - node = nodes[i]; - realElm = new tinymce.html.Node(node.attr(name), 1); - - // Add width/height to everything but audio - if (node.attr(name) != "audio") { - realElm.attr({ - width: node.attr('width'), - height: node.attr('height') - }); - } - - realElm.attr({ - style: node.attr('style') - }); - - // Unprefix all placeholder attributes - 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); - } - } - - // Inject innerhtml - innerHtml = node.attr('data-mce-html'); - if (innerHtml) { - innerNode = new tinymce.html.Node('#text', 3); - innerNode.raw = true; - innerNode.value = unescape(innerHtml); - realElm.append(innerNode); - } - - node.replace(realElm); - } - }); - - }); - - editor.on('ObjectSelected', function(e) { - if (e.target.getAttribute('data-mce-object') == "audio") { - e.preventDefault(); - } - }); - - editor.on('objectResized', function(e) { - var target = e.target, 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: e.width, - height: e.height - }) - )); - } - } - }); - - editor.addButton('media', { - tooltip: 'Insert/edit video', - onclick: showDialog, - stateSelector: 'img[data-mce-object=video]' - }); - - editor.addMenuItem('media', { - icon: 'media', - text: 'Insert video', - onclick: showDialog, - context: 'insert', - prependToContext: true - }); -}); \ No newline at end of file +(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 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()') + }; + if (Object.freeze) { + Object.freeze(me); + } + 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 Option = { + some: some, + none: none, + from: from + }; + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + 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 isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isString = isType('string'); + var isArray = isType('array'); + var isFunction = isType('function'); + + var nativeSlice = Array.prototype.slice; + var nativePush = Array.prototype.push; + var each = function (xs, f) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + f(x, i); + } + }; + 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 from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + var hasOwnProperty = Object.prototype.hasOwnProperty; + var shallow = function (old, nu) { + return 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 merge = baseMerge(shallow); + + var hasOwnProperty$1 = Object.hasOwnProperty; + var get = function (obj, key) { + return has(obj, key) ? Option.from(obj[key]) : Option.none(); + }; + var has = function (obj, key) { + return hasOwnProperty$1.call(obj, key); + }; + + var getScripts = function (editor) { + return editor.getParam('media_scripts'); + }; + var getAudioTemplateCallback = function (editor) { + return editor.getParam('audio_template_callback'); + }; + var getVideoTemplateCallback = function (editor) { + return editor.getParam('video_template_callback'); + }; + var hasLiveEmbeds = function (editor) { + return editor.getParam('media_live_embeds', true); + }; + var shouldFilterHtml = function (editor) { + return editor.getParam('media_filter_html', true); + }; + var getUrlResolver = function (editor) { + return editor.getParam('media_url_resolver'); + }; + var hasAltSource = function (editor) { + return editor.getParam('media_alt_source', true); + }; + var hasPoster = function (editor) { + return editor.getParam('media_poster', true); + }; + var hasDimensions = function (editor) { + return editor.getParam('media_dimensions', true); + }; + var Settings = { + getScripts: getScripts, + getAudioTemplateCallback: getAudioTemplateCallback, + getVideoTemplateCallback: getVideoTemplateCallback, + hasLiveEmbeds: hasLiveEmbeds, + shouldFilterHtml: shouldFilterHtml, + getUrlResolver: getUrlResolver, + hasAltSource: hasAltSource, + hasPoster: hasPoster, + hasDimensions: hasDimensions + }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.html.SaxParser'); + + var global$3 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); + + var trimPx = function (value) { + return value.replace(/px$/, ''); + }; + var addPx = function (value) { + return /^[0-9.]+$/.test(value) ? value + 'px' : value; + }; + var getSize = function (name) { + return function (elm) { + return elm ? trimPx(elm.style[name]) : ''; + }; + }; + var setSize = function (name) { + return function (elm, value) { + if (elm) { + elm.style[name] = addPx(value); + } + }; + }; + var Size = { + getMaxWidth: getSize('maxWidth'), + getMaxHeight: getSize('maxHeight'), + setMaxWidth: setSize('maxWidth'), + setMaxHeight: setSize('maxHeight') + }; + + var getVideoScriptMatch = function (prefixes, src) { + if (prefixes) { + for (var i = 0; i < prefixes.length; i++) { + if (src.indexOf(prefixes[i].filter) !== -1) { + return prefixes[i]; + } + } + } + }; + + var DOM = global$3.DOM; + var getEphoxEmbedIri = function (elm) { + return DOM.getAttrib(elm, 'data-ephox-embed-iri'); + }; + var isEphoxEmbed = function (html) { + var fragment = DOM.createFragment(html); + return getEphoxEmbedIri(fragment.firstChild) !== ''; + }; + var htmlToDataSax = function (prefixes, html) { + var data = {}; + global$2({ + validate: false, + allow_conditional_comments: true, + start: function (name, attrs) { + if (!data.source1 && name === 'param') { + data.source1 = attrs.map.movie; + } + if (name === 'iframe' || name === 'object' || name === 'embed' || name === 'video' || name === 'audio') { + if (!data.type) { + data.type = name; + } + data = global$1.extend(attrs.map, data); + } + if (name === 'script') { + var videoScript = getVideoScriptMatch(prefixes, attrs.map.src); + if (!videoScript) { + return; + } + data = { + type: 'script', + source1: attrs.map.src, + width: String(videoScript.width), + height: String(videoScript.height) + }; + } + if (name === 'source') { + if (!data.source1) { + data.source1 = attrs.map.src; + } else if (!data.source2) { + data.source2 = attrs.map.src; + } + } + if (name === 'img' && !data.poster) { + data.poster = attrs.map.src; + } + } + }).parse(html); + data.source1 = data.source1 || data.src || data.data; + data.source2 = data.source2 || ''; + data.poster = data.poster || ''; + return data; + }; + var ephoxEmbedHtmlToData = function (html) { + var fragment = DOM.createFragment(html); + var div = fragment.firstChild; + return { + type: 'ephox-embed-iri', + source1: getEphoxEmbedIri(div), + source2: '', + poster: '', + width: Size.getMaxWidth(div), + height: Size.getMaxHeight(div) + }; + }; + var htmlToData = function (prefixes, html) { + return isEphoxEmbed(html) ? ephoxEmbedHtmlToData(html) : htmlToDataSax(prefixes, html); + }; + + var global$4 = tinymce.util.Tools.resolve('tinymce.util.Promise'); + + var guess = function (url) { + var mimes = { + mp3: 'audio/mpeg', + m4a: 'audio/x-m4a', + wav: 'audio/wav', + mp4: 'video/mp4', + webm: 'video/webm', + ogg: 'video/ogg', + swf: 'application/x-shockwave-flash' + }; + var fileEnd = url.toLowerCase().split('.').pop(); + var mime = mimes[fileEnd]; + return mime ? mime : ''; + }; + var Mime = { guess: guess }; + + var global$5 = tinymce.util.Tools.resolve('tinymce.html.Writer'); + + var global$6 = tinymce.util.Tools.resolve('tinymce.html.Schema'); + + var DOM$1 = global$3.DOM; + var setAttributes = function (attrs, updatedAttrs) { + var name; + var i; + var value; + var attr; + for (name in updatedAttrs) { + value = '' + updatedAttrs[name]; + if (attrs.map[name]) { + i = attrs.length; + while (i--) { + attr = attrs[i]; + if (attr.name === name) { + if (value) { + attrs.map[name] = value; + attr.value = value; + } else { + delete attrs.map[name]; + attrs.splice(i, 1); + } + } + } + } else if (value) { + attrs.push({ + name: name, + value: value + }); + attrs.map[name] = value; + } + } + }; + var normalizeHtml = function (html) { + var writer = global$5(); + var parser = global$2(writer); + parser.parse(html); + return writer.getContent(); + }; + var updateHtmlSax = function (html, data, updateAll) { + var writer = global$5(); + var sourceCount = 0; + var hasImage; + global$2({ + validate: false, + allow_conditional_comments: true, + 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) { + switch (name) { + case 'video': + case 'object': + case 'embed': + case 'img': + case 'iframe': + if (data.height !== undefined && data.width !== undefined) { + setAttributes(attrs, { + width: data.width, + height: data.height + }); + } + break; + } + if (updateAll) { + switch (name) { + case 'video': + setAttributes(attrs, { + poster: data.poster, + src: '' + }); + if (data.source2) { + setAttributes(attrs, { src: '' }); + } + break; + case 'iframe': + setAttributes(attrs, { src: data.source1 }); + break; + case 'source': + sourceCount++; + if (sourceCount <= 2) { + setAttributes(attrs, { + src: data['source' + sourceCount], + type: data['source' + sourceCount + 'mime'] + }); + if (!data['source' + sourceCount]) { + return; + } + } + break; + case 'img': + if (!data.poster) { + return; + } + hasImage = true; + break; + } + } + writer.start(name, attrs, empty); + }, + end: function (name) { + if (name === 'video' && updateAll) { + for (var index = 1; index <= 2; index++) { + if (data['source' + index]) { + var attrs = []; + attrs.map = {}; + if (sourceCount < index) { + setAttributes(attrs, { + src: data['source' + index], + type: data['source' + index + 'mime'] + }); + writer.start('source', attrs, true); + } + } + } + } + if (data.poster && name === 'object' && updateAll && !hasImage) { + var imgAttrs = []; + imgAttrs.map = {}; + setAttributes(imgAttrs, { + src: data.poster, + width: data.width, + height: data.height + }); + writer.start('img', imgAttrs, true); + } + writer.end(name); + } + }, global$6({})).parse(html); + return writer.getContent(); + }; + var isEphoxEmbed$1 = function (html) { + var fragment = DOM$1.createFragment(html); + return DOM$1.getAttrib(fragment.firstChild, 'data-ephox-embed-iri') !== ''; + }; + var updateEphoxEmbed = function (html, data) { + var fragment = DOM$1.createFragment(html); + var div = fragment.firstChild; + Size.setMaxWidth(div, data.width); + Size.setMaxHeight(div, data.height); + return normalizeHtml(div.outerHTML); + }; + var updateHtml = function (html, data, updateAll) { + return isEphoxEmbed$1(html) ? updateEphoxEmbed(html, data) : updateHtmlSax(html, data, updateAll); + }; + var UpdateHtml = { updateHtml: updateHtml }; + + var urlPatterns = [ + { + regex: /youtu\.be\/([\w\-_\?&=.]+)/i, + type: 'iframe', + w: 560, + h: 314, + url: '//www.youtube.com/embed/$1', + allowFullscreen: true + }, + { + regex: /youtube\.com(.+)v=([^&]+)(&([a-z0-9&=\-_]+))?/i, + type: 'iframe', + w: 560, + h: 314, + url: '//www.youtube.com/embed/$2?$4', + allowFullscreen: true + }, + { + regex: /youtube.com\/embed\/([a-z0-9\?&=\-_]+)/i, + type: 'iframe', + w: 560, + h: 314, + url: '//www.youtube.com/embed/$1', + allowFullscreen: true + }, + { + 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', + allowFullscreen: true + }, + { + regex: /vimeo\.com\/(.*)\/([0-9]+)/, + type: 'iframe', + w: 425, + h: 350, + url: '//player.vimeo.com/video/$2?title=0&byline=0', + allowFullscreen: true + }, + { + 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"', + allowFullscreen: false + }, + { + regex: /dailymotion\.com\/video\/([^_]+)/, + type: 'iframe', + w: 480, + h: 270, + url: '//www.dailymotion.com/embed/video/$1', + allowFullscreen: true + }, + { + regex: /dai\.ly\/([^_]+)/, + type: 'iframe', + w: 480, + h: 270, + url: '//www.dailymotion.com/embed/video/$1', + allowFullscreen: true + } + ]; + var getUrl = function (pattern, url) { + var match = pattern.regex.exec(url); + var newUrl = 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 pattern = urlPatterns.filter(function (pattern) { + return pattern.regex.test(url); + }); + if (pattern.length > 0) { + return global$1.extend({}, pattern[0], { url: getUrl(pattern[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.source1) { + global$1.extend(data, htmlToData(Settings.getScripts(editor), data.embed)); + if (!data.source1) { + return ''; + } + } + if (!data.source2) { + data.source2 = ''; + } + if (!data.poster) { + data.poster = ''; + } + data.source1 = editor.convertURL(data.source1, 'source'); + data.source2 = editor.convertURL(data.source2, 'source'); + data.source1mime = Mime.guess(data.source1); + data.source2mime = Mime.guess(data.source2); + data.poster = editor.convertURL(data.poster, 'poster'); + var pattern = matchPattern(data.source1); + if (pattern) { + data.source1 = 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.updateHtml(data.embed, data, true); + } else { + var videoScript = getVideoScriptMatch(Settings.getScripts(editor), data.source1); + if (videoScript) { + data.type = 'script'; + data.width = String(videoScript.width); + data.height = String(videoScript.height); + } + var audioTemplateCallback = Settings.getAudioTemplateCallback(editor); + var videoTemplateCallback = Settings.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.source1mime === 'application/x-shockwave-flash') { + return getFlashHtml(data); + } else if (data.source1mime.indexOf('audio') !== -1) { + return getAudioHtml(data, audioTemplateCallback); + } else if (data.type === 'script') { + return getScriptHtml(data); + } else { + return getVideoHtml(data, videoTemplateCallback); + } + } + }; + + var cache = {}; + var embedPromise = function (data, dataToHtml, handler) { + return new global$4(function (res, rej) { + var wrappedResolve = function (response) { + if (response.html) { + cache[data.source1] = response; + } + return res({ + url: data.source1, + html: response.html ? response.html : dataToHtml(data) + }); + }; + if (cache[data.source1]) { + wrappedResolve(cache[data.source1]); + } else { + handler({ url: data.source1 }, wrappedResolve, rej); + } + }); + }; + var defaultPromise = function (data, dataToHtml) { + return new global$4(function (res) { + res({ + html: dataToHtml(data), + url: data.source1 + }); + }); + }; + var loadedData = function (editor) { + return function (data) { + return dataToHtml(editor, data); + }; + }; + var getEmbedHtml = function (editor, data) { + var embedHandler = Settings.getUrlResolver(editor); + return embedHandler ? embedPromise(data, loadedData(editor), embedHandler) : defaultPromise(data, loadedData(editor)); + }; + var isCached = function (url) { + return cache.hasOwnProperty(url); + }; + var Service = { + getEmbedHtml: getEmbedHtml, + isCached: isCached + }; + + var unwrap = function (data) { + var unwrapped = merge(data, { + source1: data.source1.value, + source2: get(data, 'source2').bind(function (source2) { + return get(source2, 'value'); + }).getOr(''), + poster: get(data, 'poster').bind(function (poster) { + return get(poster, 'value'); + }).getOr('') + }); + get(data, 'dimensions').each(function (dimensions) { + each([ + 'width', + 'height' + ], function (prop) { + get(dimensions, prop).each(function (value) { + return unwrapped[prop] = value; + }); + }); + }); + return unwrapped; + }; + var wrap = function (data) { + var wrapped = merge(data, { + source1: { value: get(data, 'source1').getOr('') }, + source2: { value: get(data, 'source2').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(Settings.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 merge({ embed: snippet }, htmlToData(Settings.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), { + source1: 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.updateHtml(newData.embed, newData); + if (newData.embed && (prevData.source1 === newData.source1 || Service.isCached(newData.source1))) { + handleInsert(editor, newData.embed); + } else { + Service.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 getSourceData = function (api) { + return unwrap(api.getData()); + }; + var handleSource1 = function (prevData, api) { + var serviceData = getSourceData(api); + if (prevData.source1 !== serviceData.source1) { + addEmbedHtml(win, editor)({ + url: serviceData.source1, + html: '' + }); + Service.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) { + var data = getSourceData(api); + var embed = dataToHtml(editor, data); + api.setData(wrap(__assign(__assign({}, data), { embed: embed }))); + }; + var mediaInput = [{ + name: 'source1', + type: 'urlinput', + filetype: 'media', + label: 'Source' + }]; + var sizeInput = !Settings.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 (Settings.hasAltSource(editor)) { + advancedFormItems.push({ + name: 'source2', + type: 'urlinput', + filetype: 'media', + label: 'Alternative source URL' + }); + } + if (Settings.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 = getSourceData(api); + submitForm(currentData.get(), serviceData, editor); + api.close(); + }, + onChange: function (api, detail) { + switch (detail.name) { + case 'source1': + handleSource1(currentData.get(), api); + break; + case 'embed': + handleEmbed(api); + break; + case 'dimensions': + case 'poster': + handleUpdate(api); + break; + default: + break; + } + currentData.set(getSourceData(api)); + }, + initialData: initialData + }); + }; + var Dialog = { showDialog: showDialog }; + + var get$1 = function (editor) { + var showDialog = function () { + Dialog.showDialog(editor); + }; + return { showDialog: showDialog }; + }; + var Api = { get: get$1 }; + + var register = function (editor) { + var showDialog = function () { + Dialog.showDialog(editor); + }; + editor.addCommand('mceMedia', showDialog); + }; + var Commands = { register: register }; + + 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 (Settings.shouldFilterHtml(editor) === false) { + return html; + } + var writer = global$5(); + var blocked; + global$2({ + 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') { + return; + } + for (var i = 0; i < attrs.length; i++) { + if (attrs[i].name.indexOf('on') === 0) { + return; + } + if (attrs[i].name === '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$6({})).parse(html); + return writer.getContent(); + }; + var Sanitize = { sanitize: sanitize }; + + var createPlaceholderNode = function (editor, node) { + var placeHolder; + var name = node.name; + 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 previewWrapper; + var previewNode; + var shimNode; + var name = node.name; + 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); + 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' + }); + 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 attribs; + var ai; + var innerHtml; + 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); + } + } + innerHtml = sourceNode.firstChild && sourceNode.firstChild.value; + if (innerHtml) { + targetNode.attr('data-mce-html', escape(Sanitize.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(Settings.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' && Settings.hasLiveEmbeds(editor) && global$8.ceFalse) { + if (!isWithinEmbedWrapper(node)) { + node.replace(createPreviewIframeNode(editor, node)); + } + } else { + if (!isWithinEmbedWrapper(node)) { + node.replace(createPlaceholderNode(editor, node)); + } + } + } + }; + }; + var Nodes = { + createPreviewIframeNode: createPreviewIframeNode, + createPlaceholderNode: createPlaceholderNode, + placeHolderConverter: placeHolderConverter + }; + + 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', Nodes.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.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 FilterContent = { setup: setup }; + + 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 ResolveName = { setup: setup$1 }; + + 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.updateHtml(html, { + width: String(e.width), + height: String(e.height) + }))); + } + } + }); + }; + var Selection = { setup: setup$2 }; + + 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'); + } + }); + }; + var Buttons = { register: register$1 }; + + function Plugin () { + global.add('media', function (editor) { + Commands.register(editor); + Buttons.register(editor); + ResolveName.setup(editor); + FilterContent.setup(editor); + Selection.setup(editor); + return Api.get(editor); + }); + } + + Plugin(); + +}()); diff --git a/lib/tinymce/js/tinymce/plugins/media/plugin.min.js b/lib/tinymce/js/tinymce/plugins/media/plugin.min.js index 02b3407f..f362c1c7 100644 --- a/lib/tinymce/js/tinymce/plugins/media/plugin.min.js +++ b/lib/tinymce/js/tinymce/plugins/media/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("media",function(e,t){function n(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":""}function i(){function t(e){var t,o,a,r;t=n.find("#width")[0],o=n.find("#height")[0],a=t.value(),r=o.value(),n.find("#constrain")[0].checked()&&i&&c&&a&&r&&(e.control==t?(r=Math.round(a/i*r),o.value(r)):(a=Math.round(r/c*a),t.value(a))),i=a,c=r}var n,i,c,s;s=l(e.selection.getNode()),i=s.width,c=s.height,n=e.windowManager.open({title:"Insert media",data:s,bodyType:"tabpanel",body:[{title:"General",type:"form",onShowTab:function(){this.fromJSON(r(this.next().find("#embed").value()))},items:[{name:"source1",type:"filepicker",filetype:"image",size:40,autofocus:!0,label:"Source"},{name:"source2",type:"filepicker",filetype:"image",size:40,label:"Alternative source"},{name:"poster",type:"filepicker",filetype:"image",size:40,label:"Poster"},{type:"container",label:"Dimensions",layout:"flex",direction:"row",align:"center",spacing:5,items:[{name:"width",type:"textbox",maxLength:3,size:3,onchange:t},{type:"label",text:"x"},{name:"height",type:"textbox",maxLength:3,size:3,onchange:t},{name:"constrain",type:"checkbox",checked:!0,text:"Constrain proportions"}]}]},{title:"Embed",type:"panel",layout:"flex",direction:"column",align:"stretch",padding:10,spacing:10,onShowTab:function(){this.find("#embed").value(a(this.parent().toJSON()))},items:[{type:"label",text:"Paste your embed code below:"},{type:"textbox",flex:1,name:"embed",value:o(),multiline:!0,label:"Source"}]}],onSubmit:function(){e.insertContent(a(this.toJSON()))}})}function o(){var t=e.selection.getNode();return t.getAttribute("data-mce-object")?e.selection.getContent():void 0}function a(i){var o="";return i.source1||(tinymce.extend(i,r(i.embed)),i.source1)?(i.source1=e.convertURL(i.source1,"source"),i.source2=e.convertURL(i.source2,"source"),i.source1mime=n(i.source1),i.source2mime=n(i.source2),i.poster=e.convertURL(i.poster,"poster"),i.flashPlayerUrl=e.convertURL(t+"/moxieplayer.swf","movie"),i.embed?o=c(i.embed,i,!0):(tinymce.each(s,function(e){var t,n,o;if(t=e.regex.exec(i.source1)){for(o=e.url,n=0;t[n];n++)o=o.replace("$"+n,function(){return t[n]});i.source1=o,i.type=e.type,i.width=e.w,i.height=e.h}}),i.width=i.width||300,i.height=i.height||150,tinymce.each(i,function(t,n){i[n]=e.dom.encode(t)}),"iframe"==i.type?o+='':-1!=i.source1mime.indexOf("audio")?e.settings.audio_template_callback?o=e.settings.audio_template_callback(i):o+='":o=e.settings.video_template_callback?e.settings.video_template_callback(i):'"),o):""}function r(e){var t={};return new tinymce.html.SaxParser({validate:!1,special:"script,noscript",start:function(e,n){t.source1||"param"!=e||(t.source1=n.map.movie),("iframe"==e||"object"==e||"embed"==e||"video"==e||"audio"==e)&&(t=tinymce.extend(n.map,t)),"source"==e&&(t.source1?t.source2||(t.source2=n.map.src):t.source1=n.map.src)}}).parse(e),t.source1=t.source1||t.src||t.data,t.source2=t.source2||"",t.poster=t.poster||"",t}function l(t){return t.getAttribute("data-mce-object")?r(e.serializer.serialize(t,{selection:!0})):{}}function c(e,t,n){function i(e,t){var n,i,o,a;for(n in t)if(o=""+t[n],e.map[n])for(i=e.length;i--;)a=e[i],a.name==n&&(o?(e.map[n]=o,a.value=o):(delete e.map[n],e.splice(i,1)));else o&&(e.push({name:n,value:o}),e.map[n]=o)}var o=new tinymce.html.Writer,a=0;return new tinymce.html.SaxParser({validate:!1,special:"script,noscript",comment:function(e){o.comment(e)},cdata:function(e){o.cdata(e)},text:function(e,t){o.text(e,t)},start:function(e,r,l){switch(e){case"video":case"object":case"img":case"iframe":i(r,{width:t.width,height:t.height})}if(n)switch(e){case"video":i(r,{poster:t.poster,src:""}),t.source2&&i(r,{src:""});break;case"iframe":i(r,{src:t.source1});break;case"source":if(a++,2>=a&&(i(r,{src:t["source"+a],type:t["source"+a+"mime"]}),!t["source"+a]))return}o.start(e,r,l)},end:function(e){if("video"==e&&n)for(var r=1;2>=r;r++)if(t["source"+r]){var l=[];l.map={},r>a&&(i(l,{src:t["source"+r],type:t["source"+r+"mime"]}),o.start("source",l,!0))}o.end(e)}},new tinymce.html.Schema({})).parse(e),o.getContent()}var s=[{regex:/youtu\.be\/([a-z1-9.-_]+)/,type:"iframe",w:425,h:350,url:"http://www.youtube.com/embed/$1"},{regex:/youtube\.com(.+)v=([^&]+)/,type:"iframe",w:425,h:350,url:"http://www.youtube.com/embed/$2"},{regex:/vimeo\.com\/([0-9]+)/,type:"iframe",w:425,h:350,url:"http://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:'http://maps.google.com/maps/ms?msid=$2&output=embed"'}];e.on("ResolveName",function(e){var t;(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]=RegExp("]*>","gi")}),e.schema.addValidElements("object[id|style|width|height|classid|codebase|*],embed[id|style|width|height|type|src|*],video[*],audio[*]");var n=e.schema.getBoolAttrs();tinymce.each("webkitallowfullscreen mozallowfullscreen allowfullscreen".split(" "),function(e){n[e]={}}),e.parser.addNodeFilter("iframe,video,audio,object,embed",function(t,n){for(var i,o,a,r,l,c,s,d=t.length;d--;){for(o=t[d],a=new tinymce.html.Node("img",1),a.shortEnded=!0,c=o.attributes,i=c.length;i--;)r=c[i].name,l=c[i].value,"width"!==r&&"height"!==r&&"style"!==r&&(("data"==r||"src"==r)&&(l=e.convertURL(l,r)),a.attr("data-mce-p-"+r,l));s=o.firstChild&&o.firstChild.value,s&&(a.attr("data-mce-html",escape(s)),a.firstChild=null),a.attr({width:o.attr("width")||"300",height:o.attr("height")||("audio"==n?"30":"150"),style:o.attr("style"),src:tinymce.Env.transparentSrc,"data-mce-object":n,"class":"mce-object mce-object-"+n}),o.replace(a)}}),e.serializer.addAttributeFilter("data-mce-object",function(e,t){for(var n,i,o,a,r,l,c=e.length;c--;){for(n=e[c],i=new tinymce.html.Node(n.attr(t),1),"audio"!=n.attr(t)&&i.attr({width:n.attr("width"),height:n.attr("height")}),i.attr({style:n.attr("style")}),a=n.attributes,o=a.length;o--;){var s=a[o].name;0===s.indexOf("data-mce-p-")&&i.attr(s.substr(11),a[o].value)}r=n.attr("data-mce-html"),r&&(l=new tinymce.html.Node("#text",3),l.raw=!0,l.value=unescape(r),i.append(l)),n.replace(i)}})}),e.on("ObjectSelected",function(e){"audio"==e.target.getAttribute("data-mce-object")&&e.preventDefault()}),e.on("objectResized",function(e){var t,n=e.target;n.getAttribute("data-mce-object")&&(t=n.getAttribute("data-mce-html"),t&&(t=unescape(t),n.setAttribute("data-mce-html",escape(c(t,{width:e.width,height:e.height})))))}),e.addButton("media",{tooltip:"Insert/edit video",onclick:i,stateSelector:"img[data-mce-object=video]"}),e.addMenuItem("media",{icon:"media",text:"Insert video",onclick: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.1.6 (2020-01-28) + */ +!function(){"use strict";function e(){}function o(e){return function(){return e}}function t(){return u}var r,n=tinymce.util.Tools.resolve("tinymce.PluginManager"),d=function(){return(d=Object.assign||function(e){for(var t,r=1,n=arguments.length;r"}(n):"application/x-shockwave-flash"===n.source1mime?function(e){var t='';return e.poster&&(t+=''),t+=""}(n):-1!==n.source1mime.indexOf("audio")?function(e,t){return t?t(e):'"}(n,o):"script"===n.type?function(e){return'\n'; - moduleCount++; - } - - // Expose globally - exports.define = define; - exports.require = require; - - expose(["tinymce/pasteplugin/Clipboard","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Quirks","tinymce/pasteplugin/Plugin"]); - - load('classes/Clipboard.js'); - load('classes/WordFilter.js'); - load('classes/Quirks.js'); - load('classes/Plugin.js'); - - writeScripts(); -})(this); - -// $hash: 85a116a5099f2fb1f017e02daac61c63 \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/plugins/paste/plugin.js b/lib/tinymce/js/tinymce/plugins/paste/plugin.js index 53d02d2f..586ae0af 100644 --- a/lib/tinymce/js/tinymce/plugins/paste/plugin.js +++ b/lib/tinymce/js/tinymce/plugins/paste/plugin.js @@ -1,721 +1,2398 @@ /** - * 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/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. - * - * @class tinymce.pasteplugin.Clipboard - * @private - */ -define("tinymce/pasteplugin/Clipboard", [ - "tinymce/Env", - "tinymce/util/Tools", - "tinymce/util/VK" -], function(Env, Tools, VK) { - function hasClipboardData() { - // Gecko is excluded until the fix: https://bugzilla.mozilla.org/show_bug.cgi?id=850663 - return !Env.gecko && (("ClipboardEvent" in window) || (Env.webkit && "FocusEvent" in window)); - } - - return function(editor) { - var plainTextPasteTime; - - function shouldPasteAsPlainText() { - return new Date().getTime() - plainTextPasteTime < 100; - } - - // TODO: Move this to a class? - function process(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; - } - - function processHtml(html) { - var args = editor.fire('PastePreProcess', {content: html}); - - if (editor.settings.paste_remove_styles || (editor.settings.paste_remove_styles_if_webkit !== false && Env.webkit)) { - args.content = args.content.replace(/ style=\"[^\"]+\"/g, ''); - } - - if (!args.isDefaultPrevented()) { - editor.insertContent(args.content); - } - } - - function processText(text) { - text = editor.dom.encode(text); - - text = process(text, [ - [/\n\n/g, "

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

    )$/, '

    $1'], - [/\n/g, "
    "] - ]); - - var args = editor.fire('PastePreProcess', {content: text}); - - if (!args.isDefaultPrevented()) { - editor.insertContent(args.content); - } - } - - function createPasteBin() { - var scrollTop = (editor.inline ? editor.getBody() : editor.getDoc().documentElement).scrollTop; - - // Create a pastebin and move the selection into the bin - var pastebinElm = editor.dom.add(editor.getBody(), 'div', { - id: 'mcePasteBin', - contentEditable: false, - style: 'position: absolute; top: ' + scrollTop + 'px; left: 0; background: red; width: 1px; height: 1px; overflow: hidden' - }, '

    X
    '); - - return pastebinElm; - } - - function removePasteBin() { - var pastebinElm = editor.dom.get('mcePasteBin'); - - editor.dom.unbind(pastebinElm); - editor.dom.remove(pastebinElm); - } - - editor.on('keydown', function(e) { - // Shift+Ctrl+V - if (e.shiftKey && e.keyCode == 86) { - plainTextPasteTime = new Date().getTime(); - } - }); - - // Use Clipboard API if it's available - if (hasClipboardData()) { - editor.on('paste', function(e) { - var clipboardData = e.clipboardData; - - function processByContentType(contentType, processFunc) { - for (var ti = 0; ti < clipboardData.types.length; ti++) { - if (clipboardData.types[ti] == contentType) { - processFunc(clipboardData.getData(contentType)); - //clipboardData.items[ti].getAsString(processFunc); - return true; - } - } - } - - if (clipboardData) { - e.preventDefault(); - - if (shouldPasteAsPlainText()) { - // First look for HTML then look for plain text - if (!processByContentType('text/plain', processText)) { - processByContentType('text/html', processHtml); - } - } else { - // First look for HTML then look for plain text - if (!processByContentType('text/html', processHtml)) { - processByContentType('text/plain', processText); - } - } - } - }); - } else { - if (Env.ie) { - // Explorer fallback - editor.on('init', function() { - var dom = editor.dom; - - editor.dom.bind(editor.getBody(), 'paste', function(e) { - var gotPasteEvent; - - e.preventDefault(); - - if (shouldPasteAsPlainText() && dom.doc.dataTransfer) { - processText(dom.doc.dataTransfer.getData('Text')); - return; - } - - var pastebinElm = createPasteBin(); - - dom.bind(pastebinElm, 'paste', function(e) { - e.stopPropagation(); - gotPasteEvent = true; - }); - - var lastRng = editor.selection.getRng(); - - // Select the container - var rng = dom.doc.body.createTextRange(); - rng.moveToElementText(pastebinElm.firstChild); - rng.execCommand('Paste'); - removePasteBin(); - - if (!gotPasteEvent) { - editor.windowManager.alert('Clipboard access not possible.'); - return; - } - - var html = pastebinElm.firstChild.innerHTML; - editor.selection.setRng(lastRng); - processHtml(html); - }); - }); - } else { - editor.on('init', function() { - editor.dom.bind(editor.getBody(), 'paste', function(e) { - e.preventDefault(); - editor.windowManager.alert('Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.'); - }); - }); - - // Old Gecko/WebKit/Opera fallback - editor.on('keydown', function(e) { - if (VK.metaKeyPressed(e) && e.keyCode == 86 && !e.isDefaultPrevented()) { - var pastebinElm = createPasteBin(); - var lastRng = editor.selection.getRng(); - - editor.selection.select(pastebinElm, true); - - editor.dom.bind(pastebinElm, 'paste', function(e) { - e.stopPropagation(); - - setTimeout(function() { - removePasteBin(); - editor.lastRng = lastRng; - editor.selection.setRng(lastRng); - processHtml(pastebinElm.firstChild.innerHTML); - }, 0); - }); - } - }); - } - } - - // Block all drag/drop events - if (editor.paste_block_drop) { - editor.on('dragend dragover draggesture dragdrop drop drag', function(e) { - e.preventDefault(); - e.stopPropagation(); - }); - } - - this.paste = processHtml; - this.pasteText = processText; - }; -}); - -// Included from: js/tinymce/plugins/paste/classes/WordFilter.js - -/** - * WordFilter.js - * - * Copyright, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing - */ - -/** - * 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" -], function(Tools, DomParser, Schema, Serializer, Node) { - return function(editor) { - var each = Tools.each; - - editor.on('PastePreProcess', function(e) { - var content = e.content, retainStyleProperties, validStyles; - - retainStyleProperties = editor.settings.paste_retain_style_properties; - if (retainStyleProperties) { - validStyles = Tools.makeMap(retainStyleProperties); - } - - function process(items) { - each(items, function(v) { - if (v.constructor == RegExp) { - content = content.replace(v, ''); - } else { - content = content.replace(v[0], v[1]); - } - }); - } - - /** - * Converts fake bullet and numbered lists to real semantic OL/UL. - * - * @param {tinymce.html.Node} node Root node to convert children of. - */ - function convertFakeListsToProperLists(node) { - var currentListNode, prevListNode, lastLevel = 1; - - function convertParagraphToLi(paragraphNode, listStartTextNode, listName, start) { - var level = paragraphNode._listLevel || lastLevel; - - // Handle list nesting - if (level != lastLevel) { - if (level < lastLevel) { - // Move to parent list - if (currentListNode) { - currentListNode = currentListNode.parent.parent; - } - } else { - // Create new list - prevListNode = currentListNode; - currentListNode = null; - } - } - - if (!currentListNode || currentListNode.name != listName) { - prevListNode = prevListNode || currentListNode; - currentListNode = new Node(listName, 1); - - if (start > 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 (level > lastLevel) { - 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\u00d8o\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 (editor.settings.paste_enable_default_filters === false) { - return; - } - - // Detect is the contents is Word junk HTML - if (/class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(e.content)) { - e.wordContent = true; // Mark it for other processors - - // Remove basic Word junk - process([ - // 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") : ""; - } - ] - ]); - - // Setup strict schema - var schema = new Schema({ - valid_elements: '@[style],-strong/b,-em/i,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-table,' + - '-tr,-td[colspan|rowspan],-th,-thead,-tfoot,-tbody,-a[!href]' - }); - - // Parse HTML into DOM structure - var domParser = new DomParser({}, schema); - - // Filte element style attributes - 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(); - } - } - }); - - // 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); - } - }); - }; -}); - -// 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" -], function(Env, Tools) { - return function(editor) { - function addPreProcessFilter(filterFunc) { - editor.on('PastePreProcess', function(e) { - e.content = filterFunc(e.content); - }); - } - - function process(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; - } - - /** - * Removes WebKit fragment comments and converted-space spans. - * - * This: - * a b - * - * Becomes: - * a b - */ - function removeWebKitFragments(html) { - html = process(html, [ - /^[\s\S]*|[\s\S]*$/g, // WebKit fragment - [/\u00a0<\/span>/g, '\u00a0'], // WebKit   - /
    $/ // 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) { - // Produce block regexp based on the block elements in schema - if (!this.explorerBlocksRegExp) { - var blockElements = []; - - Tools.each(editor.schema.getBlockElements(), function(block, blockName) { - blockElements.push(blockName); - }); - - this.explorerBlocksRegExp = new RegExp( - '(?:
     [\\s\\r\\n]+|
    )*(<\/?(' + blockElements.join('|') + ')[^>]*>)(?:
     [\\s\\r\\n]+|
    )*', - 'g' - ); - } - - // Remove BR:s from: X
    - html = process(html, [ - [this.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 = process(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; - } - - // Sniff browsers and apply fixes since we can't feature detect - if (Env.webkit) { - 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. + * 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.pasteplugin.Plugin - * @private + * Version: 5.1.6 (2020-01-28) */ -define("tinymce/pasteplugin/Plugin", [ - "tinymce/PluginManager", - "tinymce/pasteplugin/Clipboard", - "tinymce/pasteplugin/WordFilter", - "tinymce/pasteplugin/Quirks" -], function(PluginManager, Clipboard, WordFilter, Quirks) { - PluginManager.add('paste', function(editor) { - var self = this; - - self.clipboard = new Clipboard(editor); - self.quirks = new Quirks(editor); - self.wordFilter = new WordFilter(editor); - - editor.addCommand('mceInsertClipboardContent', function(ui, value) { - if (value.content) { - self.clipboard.paste(value.content); - } - - if (value.text) { - self.clipboard.pasteText(value.text); - } - }); - }); -}); - -expose(["tinymce/pasteplugin/Clipboard","tinymce/pasteplugin/WordFilter","tinymce/pasteplugin/Quirks","tinymce/pasteplugin/Plugin"]); -})(this); \ No newline at end of file +(function (domGlobals) { + 'use strict'; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var hasProPlugin = function (editor) { + if (/(^|[ ,])powerpaste([, ]|$)/.test(editor.settings.plugins) && global$1.get('powerpaste')) { + if (typeof domGlobals.window.console !== 'undefined' && domGlobals.window.console.log) { + domGlobals.window.console.log('PowerPaste is incompatible with Paste plugin! Remove \'paste\' from the \'plugins\' option.'); + } + return true; + } else { + return false; + } + }; + var DetectProPlugin = { hasProPlugin: hasProPlugin }; + + var get = function (clipboard, quirks) { + return { + clipboard: clipboard, + quirks: quirks + }; + }; + var Api = { get: get }; + + 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 Events = { + firePastePreProcess: firePastePreProcess, + firePastePostProcess: firePastePostProcess, + firePastePlainTextToggle: firePastePlainTextToggle, + firePaste: firePaste + }; + + var togglePlainTextPaste = function (editor, clipboard) { + if (clipboard.pasteFormat.get() === 'text') { + clipboard.pasteFormat.set('html'); + Events.firePastePlainTextToggle(editor, false); + } else { + clipboard.pasteFormat.set('text'); + Events.firePastePlainTextToggle(editor, true); + } + editor.focus(); + }; + var Actions = { togglePlainTextPaste: togglePlainTextPaste }; + + var register = function (editor, clipboard) { + editor.addCommand('mceTogglePlainTextPaste', function () { + Actions.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 Commands = { register: register }; + + 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()') + }; + if (Object.freeze) { + Object.freeze(me); + } + 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 Option = { + some: some, + none: none, + from: from + }; + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + 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 isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isFunction = isType('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 exports$1 = {}, module = { 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, undefined)); + var Promise = module.exports.boltExport; + + var nu = function (baseFn) { + var data = Option.none(); + var callbacks = []; + var map = function (f) { + return nu(function (nCallback) { + get(function (data) { + nCallback(f(data)); + }); + }); + }; + var get = function (nCallback) { + if (isReady()) { + call(nCallback); + } else { + callbacks.push(nCallback); + } + }; + var set = function (x) { + data = Option.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) { + domGlobals.setTimeout(function () { + cb(x); + }, 0); + }); + }; + baseFn(set); + return { + get: get, + map: map, + isReady: isReady + }; + }; + var pure = function (a) { + return nu(function (callback) { + callback(a); + }); + }; + var LazyValue = { + nu: nu, + pure: pure + }; + + var errorReporter = function (err) { + domGlobals.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$1 = 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$1, + 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 traverse = function (array, fn) { + return par$1(map(array, fn)); + }; + + var value = function () { + var subject = Cell(Option.none()); + var clear = function () { + subject.set(Option.none()); + }; + var set = function (s) { + subject.set(Option.some(s)); + }; + var on = function (f) { + subject.get().each(f); + }; + var isSet = function () { + return subject.get().isSome(); + }; + return { + clear: clear, + set: set, + isSet: isSet, + on: on + }; + }; + + var global$2 = tinymce.util.Tools.resolve('tinymce.Env'); + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.Delay'); + + var global$4 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var global$5 = tinymce.util.Tools.resolve('tinymce.util.VK'); + + 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 InternalHtml = { + mark: mark, + unmark: unmark, + isMarked: isMarked, + internalHtmlMime: function () { + return internalMimeType; + } + }; + + var global$6 = tinymce.util.Tools.resolve('tinymce.html.Entities'); + + 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$6.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$4.map(blocks, function (p) { + return p.split(/\n/).join('
    '); + }); + var stitch = function (p) { + return tagOpen + p + tagClose; + }; + return paragraphs.length === 1 ? paragraphs[0] : global$4.map(paragraphs, stitch).join(''); + }; + var convert = function (text, rootTag, rootAttrs) { + return rootTag ? toBlockElements(text, rootTag === true ? 'p' : rootTag, rootAttrs) : toBRs(text); + }; + var Newlines = { + isPlainText: isPlainText, + convert: convert, + toBRs: toBRs, + toBlockElements: toBlockElements + }; + + var global$7 = tinymce.util.Tools.resolve('tinymce.html.DomParser'); + + var global$8 = tinymce.util.Tools.resolve('tinymce.html.Serializer'); + + var global$9 = tinymce.util.Tools.resolve('tinymce.html.Node'); + + var global$a = tinymce.util.Tools.resolve('tinymce.html.Schema'); + + 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 Settings = { + shouldBlockDrop: shouldBlockDrop, + shouldPasteDataImages: shouldPasteDataImages, + shouldFilterDrop: shouldFilterDrop, + getPreProcess: getPreProcess, + getPostProcess: getPostProcess, + getWebkitStyles: getWebkitStyles, + shouldRemoveWebKitStyles: shouldRemoveWebKitStyles, + shouldMergeFormats: shouldMergeFormats, + isSmartPasteEnabled: isSmartPasteEnabled, + isPasteAsTextEnabled: isPasteAsTextEnabled, + getRetainStyleProps: getRetainStyleProps, + getWordValidElements: getWordValidElements, + shouldConvertWordFakeLists: shouldConvertWordFakeLists, + shouldUseDefaultFilters: shouldUseDefaultFilters + }; + + function filter$1(content, items) { + global$4.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$4.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 '\xA0'; + } + 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++; + }; + } + var isMsEdge = function () { + return domGlobals.navigator.userAgent.indexOf(' Edge/') !== -1; + }; + var Utils = { + filter: filter$1, + innerText: innerText, + trimHtml: trimHtml, + createIdGenerator: createIdGenerator, + isMsEdge: isMsEdge + }; + + 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$4.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 (Settings.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 retainStyleProperties, validStyles; + retainStyleProperties = Settings.getRetainStyleProps(editor); + if (retainStyleProperties) { + validStyles = global$4.makeMap(retainStyleProperties.split(/[, ]/)); + } + content = Utils.filter(content, [ + /
    /gi, + /]+id="?docs-internal-[^>]*>/gi, + //gi, + /<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi, + [ + /<(\/?)s>/gi, + '<$1strike>' + ], + [ + / /gi, + '\xA0' + ], + [ + /([\s\u00a0]*)<\/span>/gi, + function (str, spaces) { + return spaces.length > 0 ? spaces.replace(/./, ' ').slice(Math.floor(spaces.length / 2)).split('').join('\xA0') : ''; + } + ] + ]); + var validElements = Settings.getWordValidElements(editor); + var schema = global$a({ + valid_elements: validElements, + valid_children: '-li[p]' + }); + global$4.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 (Settings.shouldConvertWordFakeLists(editor)) { + convertFakeListsToProperLists(rootNode); + } + content = global$8({ validate: editor.settings.validate }, schema).serialize(rootNode); + return content; + }; + var preProcess = function (editor, content) { + return Settings.shouldUseDefaultFilters(editor) ? filterWordContent(editor, content) : content; + }; + var WordFilter = { + preProcess: preProcess, + isWordContent: isWordContent + }; + + var preProcess$1 = function (editor, html) { + var parser = global$7({}, editor.schema); + parser.addNodeFilter('meta', function (nodes) { + global$4.each(nodes, function (node) { + return node.remove(); + }); + }); + var fragment = parser.parse(html, { + forced_root_block: false, + isRootContent: true + }); + return global$8({ validate: editor.settings.validate }, 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 = Events.firePastePostProcess(editor, tempBody, internal, isWordHtml); + return processResult(postProcessArgs.node.innerHTML, postProcessArgs.isDefaultPrevented()); + }; + var filterContent = function (editor, content, internal, isWordHtml) { + var preProcessArgs = Events.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 = WordFilter.isWordContent(html); + var content = isWordHtml ? WordFilter.preProcess(editor, html) : html; + return filterContent(editor, content, internal, isWordHtml); + }; + var ProcessFilters = { process: process }; + + var pasteHtml = function (editor, html) { + editor.insertContent(html, { + merge: Settings.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$4.each([ + linkSelection, + insertImage, + pasteHtml + ], function (action) { + return action(editor, html, pasteHtml) !== true; + }); + }; + var insertContent = function (editor, html, pasteAsText) { + if (pasteAsText || Settings.isSmartPasteEnabled(editor) === false) { + pasteHtml(editor, html); + } else { + smartInsertContent(editor, html); + } + }; + var SmartPaste = { + isImageUrl: isImageUrl, + isAbsoluteUrl: isAbsoluteUrl, + insertContent: insertContent + }; + + 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 (text) { + var result = foldl(text, function (acc, c) { + if (isCollapsibleWhitespace(c) || c === '\xA0') { + if (acc.pcIsSpace || acc.str === '' || acc.str.length === text.length - 1 || isNewline(text, acc.str.length + 1)) { + return { + pcIsSpace: false, + str: acc.str + '\xA0' + }; + } 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 = ProcessFilters.process(editor, content, internal); + if (args.cancelled === false) { + SmartPaste.insertContent(editor, args.content, pasteAsText); + } + }; + var pasteHtml$1 = function (editor, html, internalFlag) { + var internal = internalFlag ? internalFlag : InternalHtml.isMarked(html); + doPaste(editor, InternalHtml.unmark(html), internal, false); + }; + var pasteText = function (editor, text) { + var encodedText = editor.dom.encode(text).replace(/\r\n/g, '\n'); + var normalizedText = normalizeWhitespace(encodedText); + var html = Newlines.convert(normalizedText, editor.settings.forced_root_block, editor.settings.forced_root_block_attrs); + 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) { + var content = getDataTransferItems(clipboardEvent.clipboardData || editor.getDoc().dataTransfer); + return Utils.isMsEdge() ? global$4.extend(content, { 'text/html': '' }) : content; + }; + 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 getBase64FromUri = function (uri) { + var idx; + idx = uri.indexOf(','); + if (idx !== -1) { + return uri.substr(idx + 1); + } + return null; + }; + var isValidDataUriImage = function (settings, imgElm) { + return settings.images_dataimg_filter ? settings.images_dataimg_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 = Utils.createIdGenerator('mceclip'); + var pasteImage = function (editor, imageItem) { + var base64 = getBase64FromUri(imageItem.uri); + var id = uniqueId(); + var name = editor.settings.images_reuse_filename && imageItem.blob.name ? extractFilename(editor, imageItem.blob.name) : id; + var img = new domGlobals.Image(); + img.src = imageItem.uri; + if (isValidDataUriImage(editor.settings, img)) { + var blobCache = editor.editorUpload.blobCache; + var blobInfo = void 0, existingBlobInfo = void 0; + existingBlobInfo = blobCache.findFirst(function (cachedBlobInfo) { + return cachedBlobInfo.base64() === base64; + }); + 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 traverse(items, function (item) { + return Future.nu(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 (editor.settings.paste_data_images && dataTransfer) { + var images = getImagesFromDataTransfer(dataTransfer); + if (images.length > 0) { + e.preventDefault(); + readBlobsAsDataUris(images).get(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 domGlobals.navigator.userAgent.indexOf('Android') !== -1 && clipboardData && clipboardData.items && clipboardData.items.length === 0; + }; + var isKeyboardPasteEvent = function (e) { + return global$5.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$2.webkit && domGlobals.navigator.userAgent.indexOf('Version/') !== -1) { + return; + } + e.stopImmediatePropagation(); + keyboardPasteEvent.set(e); + window.setTimeout(function () { + keyboardPasteEvent.clear(); + }, 100); + if (global$2.ie && keyboardPastePlainTextState) { + e.preventDefault(); + Events.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, isPlainTextHtml, isImage; + if (hasContentType(clipboardContent, 'text/html')) { + content = clipboardContent['text/html']; + } else { + content = pasteBin.getHtml(); + internal = internal ? internal : InternalHtml.isMarked(content); + if (pasteBin.isDefaultContent(content)) { + plainTextMode = true; + } + } + content = Utils.trimHtml(content); + pasteBin.remove(); + isPlainTextHtml = internal === false && Newlines.isPlainText(content); + isImage = SmartPaste.isImageUrl(content); + if (!content.length || isPlainTextHtml && !isImage) { + plainTextMode = true; + } + if (plainTextMode || isImage) { + if (hasContentType(clipboardContent, 'text/plain') && isPlainTextHtml) { + content = clipboardContent['text/plain']; + } else { + content = Utils.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, InternalHtml.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$2.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 = InternalHtml.isMarked(clipboardContent['text/html']); + } + insertClipboardContent(clipboardContent, isKeyBoardPaste, plainTextMode, internal); + } else { + global$3.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$2.transparentSrc) { + node.remove(); + } + }; + var isWebKitFakeUrl = function (src) { + return src.indexOf('webkit-fake-url') === 0; + }; + var isDataUri = function (src) { + return src.indexOf('data:') === 0; + }; + if (!editor.settings.paste_data_images && isPasteInsert(args)) { + var i = nodes.length; + while (i--) { + src = nodes[i].attr('src'); + if (!src) { + continue; + } + if (isWebKitFakeUrl(src)) { + remove(nodes[i]); + } else if (!editor.settings.allow_html_data_urls && isDataUri(src)) { + remove(nodes[i]); + } + } + } + }); + }; + + var getPasteBinParent = function (editor) { + return global$2.ie && editor.inline ? domGlobals.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(); + var pasteBinElm; + lastRngCell.set(editor.selection.getRng()); + 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$2.ie || global$2.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 pasteBinElm, pasteBinClones, i, dirtyWrappers, cleanWrapper; + var copyAndRemove = function (toElm, fromElm) { + toElm.appendChild(fromElm); + editor.dom.remove(fromElm, true); + }; + pasteBinClones = global$4.grep(getPasteBinParent(editor).childNodes, function (elm) { + return elm.id === 'mcepastebin'; + }); + pasteBinElm = pasteBinClones.shift(); + global$4.each(pasteBinClones, function (pasteBinClone) { + copyAndRemove(pasteBinElm, pasteBinClone); + }); + dirtyWrappers = editor.dom.select('div[id=mcepastebin]', pasteBinElm); + for (i = dirtyWrappers.length - 1; i >= 0; i--) { + 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 hasWorkingClipboardApi = function (clipboardData) { + return global$2.iOS === false && clipboardData !== undefined && typeof clipboardData.setData === 'function' && Utils.isMsEdge() !== true; + }; + var setHtml5Clipboard = function (clipboardData, html, text) { + if (hasWorkingClipboardApi(clipboardData)) { + try { + clipboardData.clearData(); + clipboardData.setData('text/html', html); + clipboardData.setData('text/plain', text); + clipboardData.setData(InternalHtml.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 = InternalHtml.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$3.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$2.browser.isChrome()) { + var rng_1 = editor.selection.getRng(); + global$3.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 CutCopy = { register: register$1 }; + + 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 (Settings.shouldBlockDrop(editor)) { + editor.on('dragend dragover draggesture dragdrop drop drag', function (e) { + e.preventDefault(); + e.stopPropagation(); + }); + } + if (!Settings.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 dropContent, rng; + rng = getCaretRangeFromEvent(editor, e); + if (e.isDefaultPrevented() || draggingInternallyState.get()) { + return; + } + dropContent = clipboard.getDataTransferItems(e.dataTransfer); + var internal = clipboard.hasContentType(dropContent, InternalHtml.internalHtmlMime()); + if ((!clipboard.hasHtmlOrText(dropContent) || isPlainTextFileUrl(dropContent)) && clipboard.pasteImageData(e, rng)) { + return; + } + if (rng && Settings.shouldFilterDrop(editor)) { + var content_1 = dropContent['mce-internal'] || dropContent['text/html'] || dropContent['text/plain']; + if (content_1) { + e.preventDefault(); + global$3.setEditorTimeout(editor, function () { + editor.undoManager.transact(function () { + if (dropContent['mce-internal']) { + editor.execCommand('Delete'); + } + setFocusedRange(editor, rng); + content_1 = Utils.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 (Settings.shouldPasteDataImages(editor) && draggingInternallyState.get() === false) { + e.preventDefault(); + setFocusedRange(editor, getCaretRangeFromEvent(editor, e)); + } + if (e.type === 'dragend') { + draggingInternallyState.set(false); + } + }); + }; + var DragDrop = { setup: setup }; + + var setup$1 = function (editor) { + var plugin = editor.plugins.paste; + var preProcess = Settings.getPreProcess(editor); + if (preProcess) { + editor.on('PastePreProcess', function (e) { + preProcess.call(plugin, plugin, e); + }); + } + var postProcess = Settings.getPostProcess(editor); + if (postProcess) { + editor.on('PastePostProcess', function (e) { + postProcess.call(plugin, plugin, e); + }); + } + }; + var PrePostProcess = { setup: setup$1 }; + + 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 (!WordFilter.isWordContent(html)) { + return html; + } + var blockElements = []; + global$4.each(editor.schema.getBlockElements(), function (block, blockName) { + blockElements.push(blockName); + }); + var explorerBlocksRegExp = new RegExp('(?:
     [\\s\\r\\n]+|
    )*(<\\/?(' + blockElements.join('|') + ')[^>]*>)(?:
     [\\s\\r\\n]+|
    )*', 'g'); + html = Utils.filter(html, [[ + explorerBlocksRegExp, + '$1' + ]]); + html = Utils.filter(html, [ + [ + /

    /g, + '

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

    /g, + '
    ' + ] + ]); + return html; + } + function removeWebKitStyles(editor, content, internal, isWordHtml) { + if (isWordHtml || internal) { + return content; + } + var webKitStylesSetting = Settings.getWebkitStyles(editor); + var webKitStyles; + if (Settings.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$2.webkit) { + addPreProcessFilter(editor, removeWebKitStyles); + } + if (global$2.ie) { + addPreProcessFilter(editor, removeExplorerBrElementsAfterBlocks); + addPostProcessFilter(editor, removeUnderlineAndFontInAnchor); + } + }; + var Quirks = { setup: setup$2 }; + + 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', + onAction: function () { + return editor.execCommand('mceTogglePlainTextPaste'); + }, + onSetup: makeSetupHandler(editor, clipboard) + }); + }; + var Buttons = { register: register$2 }; + + function Plugin () { + global$1.add('paste', function (editor) { + if (DetectProPlugin.hasProPlugin(editor) === false) { + var draggingInternallyState = Cell(false); + var pasteFormat = Cell(Settings.isPasteAsTextEnabled(editor) ? 'text' : 'html'); + var clipboard = Clipboard(editor, pasteFormat); + var quirks = Quirks.setup(editor); + Buttons.register(editor, clipboard); + Commands.register(editor, clipboard); + PrePostProcess.setup(editor); + CutCopy.register(editor); + DragDrop.setup(editor, clipboard, draggingInternallyState); + return Api.get(clipboard, quirks); + } + }); + } + + Plugin(); + +}(window)); diff --git a/lib/tinymce/js/tinymce/plugins/paste/plugin.min.js b/lib/tinymce/js/tinymce/plugins/paste/plugin.min.js index a99a1322..9a87548c 100644 --- a/lib/tinymce/js/tinymce/plugins/paste/plugin.min.js +++ b/lib/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;e.length>r;++r){if(n=s[e[r]]||o(e[r]),!n)throw"module definition dependecy not found: "+e[r];i.push(n)}t.apply(null,i)}function i(e,i,r){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(i===t)throw"invalid module definition, dependencies must be specified";if(r===t)throw"invalid module definition, definition function must be specified";n(i,function(){s[e]=r.apply(null,arguments)})}function r(e){return!!s[e]}function o(t){for(var n=e,i=t.split(/[.\/]/),r=0;i.length>r;++r){if(!n[i[r]])return;n=n[i[r]]}return n}function a(n){for(var i=0;n.length>i;i++){for(var r=e,o=n[i],a=o.split(/[.\/]/),l=0;a.length-1>l;++l)r[a[l]]===t&&(r[a[l]]={}),r=r[a[l]];r[a[a.length-1]]=s[o]}}var s={},l="tinymce/pasteplugin/Clipboard",c="tinymce/Env",u="tinymce/util/Tools",p="tinymce/util/VK",d="tinymce/pasteplugin/WordFilter",f="tinymce/html/DomParser",g="tinymce/html/Schema",m="tinymce/html/Serializer",h="tinymce/html/Node",v="tinymce/pasteplugin/Quirks",b="tinymce/pasteplugin/Plugin",y="tinymce/PluginManager";i(l,[c,u,p],function(e,n,i){function r(){return!e.gecko&&("ClipboardEvent"in window||e.webkit&&"FocusEvent"in window)}return function(o){function a(){return 100>(new Date).getTime()-d}function s(e,t){return n.each(t,function(t){e=t.constructor==RegExp?e.replace(t,""):e.replace(t[0],t[1])}),e}function l(t){var n=o.fire("PastePreProcess",{content:t});(o.settings.paste_remove_styles||o.settings.paste_remove_styles_if_webkit!==!1&&e.webkit)&&(n.content=n.content.replace(/ style=\"[^\"]+\"/g,"")),n.isDefaultPrevented()||o.insertContent(n.content)}function c(e){e=o.dom.encode(e),e=s(e,[[/\n\n/g,"

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

    )$/,"

    $1"],[/\n/g,"
    "]]);var t=o.fire("PastePreProcess",{content:e});t.isDefaultPrevented()||o.insertContent(t.content)}function u(){var e=(o.inline?o.getBody():o.getDoc().documentElement).scrollTop,t=o.dom.add(o.getBody(),"div",{id:"mcePasteBin",contentEditable:!1,style:"position: absolute; top: "+e+"px; left: 0; background: red; width: 1px; height: 1px; overflow: hidden"},'

    X
    ');return t}function p(){var e=o.dom.get("mcePasteBin");o.dom.unbind(e),o.dom.remove(e)}var d;o.on("keydown",function(e){e.shiftKey&&86==e.keyCode&&(d=(new Date).getTime())}),r()?o.on("paste",function(e){function t(e,t){for(var i=0;n.types.length>i;i++)if(n.types[i]==e)return t(n.getData(e)),!0}var n=e.clipboardData;n&&(e.preventDefault(),a()?t("text/plain",c)||t("text/html",l):t("text/html",l)||t("text/plain",c))}):e.ie?o.on("init",function(){var e=o.dom;o.dom.bind(o.getBody(),"paste",function(n){var i;if(n.preventDefault(),a()&&e.doc.dataTransfer)return c(e.doc.dataTransfer.getData("Text")),t;var r=u();e.bind(r,"paste",function(e){e.stopPropagation(),i=!0});var s=o.selection.getRng(),d=e.doc.body.createTextRange();if(d.moveToElementText(r.firstChild),d.execCommand("Paste"),p(),!i)return o.windowManager.alert("Clipboard access not possible."),t;var f=r.firstChild.innerHTML;o.selection.setRng(s),l(f)})}):(o.on("init",function(){o.dom.bind(o.getBody(),"paste",function(e){e.preventDefault(),o.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents.")})}),o.on("keydown",function(e){if(i.metaKeyPressed(e)&&86==e.keyCode&&!e.isDefaultPrevented()){var t=u(),n=o.selection.getRng();o.selection.select(t,!0),o.dom.bind(t,"paste",function(e){e.stopPropagation(),setTimeout(function(){p(),o.lastRng=n,o.selection.setRng(n),l(t.firstChild.innerHTML)},0)})}})),o.paste_block_drop&&o.on("dragend dragover draggesture dragdrop drop drag",function(e){e.preventDefault(),e.stopPropagation()}),this.paste=l,this.pasteText=c}}),i(d,[u,f,g,m,h],function(e,n,i,r,o){return function(a){var s=e.each;a.on("PastePreProcess",function(l){function c(e){s(e,function(e){d=e.constructor==RegExp?d.replace(e,""):d.replace(e[0],e[1])})}function u(e){function t(e,t,a,s){var l=e._listLevel||r;l!=r&&(r>l?n&&(n=n.parent.parent):(i=n,n=null)),n&&n.name==a?n.append(e):(i=i||n,n=new o(a,1),s>1&&n.attr("start",""+s),e.wrap(n)),e.name="li",t.value="";var c=t.next;c&&3==c.type&&(c.value=c.value.replace(/^\u00a0+/,"")),l>r&&i.lastChild.append(n),r=l}for(var n,i,r=1,a=e.getAll("p"),s=0;a.length>s;s++)if(e=a[s],"p"==e.name&&e.firstChild){for(var l="",c=e.firstChild;c&&!(l=c.value);)c=c.firstChild;if(/^\s*[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*$/.test(l)){t(e,c,"ul");continue}if(/^\s*\w+\./.test(l)){var u=/([0-9])\./.exec(l),p=1;u&&(p=parseInt(u[1],10)),t(e,c,"ol",p);continue}n=null}}function p(n,i){if("p"===n.name){var r=/mso-list:\w+ \w+([0-9]+)/.exec(i);r&&(n._listLevel=parseInt(r[1],10))}if(a.getParam("paste_retain_style_properties","none")){var o="";if(e.each(a.dom.parseStyle(i),function(e,n){switch(n){case"horiz-align":return n="text-align",t;case"vert-align":return n="vertical-align",t;case"font-color":case"mso-foreground":return n="color",t;case"mso-background":case"mso-highlight":n="background"}("all"==f||g&&g[n])&&(o+=n+":"+e+";")}),o)return o}return null}var d=l.content,f,g;if(f=a.settings.paste_retain_style_properties,f&&(g=e.makeMap(f)),a.settings.paste_enable_default_filters!==!1&&/class="?Mso|style="[^"]*\bmso-|style='[^'']*\bmso-|w:WordDocument/i.test(l.content)){l.wordContent=!0,c([//gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\u00a0"],[/([\s\u00a0]*)<\/span>/gi,function(e,t){return t.length>0?t.replace(/./," ").slice(Math.floor(t.length/2)).split("").join("\u00a0"):""}]]);var m=new i({valid_elements:"@[style],-strong/b,-em/i,-span,-p,-ol,-ul,-li,-h1,-h2,-h3,-h4,-h5,-h6,-table,-tr,-td[colspan|rowspan],-th,-thead,-tfoot,-tbody,-a[!href]"}),h=new n({},m);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()});var v=h.parse(d);u(v),l.content=new r({},m).serialize(v)}})}}),i(v,[c,u],function(e,t){return function(n){function i(e){n.on("PastePreProcess",function(t){t.content=e(t.content)})}function r(e,n){return t.each(n,function(t){e=t.constructor==RegExp?e.replace(t,""):e.replace(t[0],t[1])}),e}function o(e){return e=r(e,[/^[\s\S]*|[\s\S]*$/g,[/\u00a0<\/span>/g,"\u00a0"],/
    $/])}function a(e){if(!this.explorerBlocksRegExp){var i=[];t.each(n.schema.getBlockElements(),function(e,t){i.push(t)}),this.explorerBlocksRegExp=RegExp("(?:
     [\\s\\r\\n]+|
    )*(]*>)(?:
     [\\s\\r\\n]+|
    )*","g")}return e=r(e,[[this.explorerBlocksRegExp,"$1"]]),e=r(e,[[/

    /g,"

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

    /g,"
    "]])}e.webkit&&i(o),e.ie&&i(a)}}),i(b,[y,l,d,v],function(e,t,n,i){e.add("paste",function(e){var r=this;r.clipboard=new t(e),r.quirks=new i(e),r.wordFilter=new n(e),e.addCommand("mceInsertClipboardContent",function(e,t){t.content&&r.clipboard.paste(t.content),t.text&&r.clipboard.pasteText(t.text)})})}),a([l,d,v,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.1.6 (2020-01-28) + */ +!function(f){"use strict";function t(){}function i(t){return function(){return t}}function e(){return v}var n,d=function(t){function e(){return n}var n=t;return{get:e,set:function(t){n=t},clone:function(){return d(e())}}},r=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(t){return!(!/(^|[ ,])powerpaste([, ]|$)/.test(t.settings.plugins)||!r.get("powerpaste"))&&("undefined"!=typeof f.window.console&&f.window.console.log&&f.window.console.log("PowerPaste is incompatible with Paste plugin! Remove 'paste' from the 'plugins' option."),!0)},a=function(t,e){return{clipboard:t,quirks:e}},s=function(t,e,n,r){return t.fire("PastePreProcess",{content:e,internal:n,wordContent:r})},c=function(t,e,n,r){return t.fire("PastePostProcess",{node:e,internal:n,wordContent:r})},o=function(t,e){return t.fire("PastePlainTextToggle",{state:e})},m=function(t,e){return t.fire("paste",{ieFake:e})},l=function(t,e){"text"===e.pasteFormat.get()?(e.pasteFormat.set("html"),o(t,!1)):(e.pasteFormat.set("text"),o(t,!0)),t.focus()},p=function(t,n){t.addCommand("mceTogglePlainTextPaste",function(){l(t,n)}),t.addCommand("mceInsertClipboardContent",function(t,e){e.content&&n.pasteHtml(e.content,e.internal),e.text&&n.pasteText(e.text)})},g=i(!1),h=i(!0),v=(n={fold:function(t,e){return t()},is:g,isSome:g,isNone:h,getOr:w,getOrThunk:b,getOrDie:function(t){throw new Error(t||"error: getOrDie called on none.")},getOrNull:i(null),getOrUndefined:i(undefined),or:w,orThunk:b,map:e,each:t,bind:e,exists:g,forall:h,filter:e,equals:y,equals_:y,toArray:function(){return[]},toString:i("none()")},Object.freeze&&Object.freeze(n),n);function y(t){return t.isNone()}function b(t){return t()}function w(t){return t}function x(t,e){for(var n=t.length,r=new Array(n),o=0;o=i.length&&n(r)}}(e))})})}function L(t,e){return function(t){return M(t,z)}(x(t,e))}function N(t){return t.replace(/\r?\n/g,"
    ")}function B(t,e,n){var r=t.split(/\n\n/),o=function(t,e){var n,r=[],o="<"+t;if("object"==typeof e){for(n in e)e.hasOwnProperty(n)&&r.push(n+'="'+et.encodeAllRaw(e[n])+'"');r.length&&(o+=" "+r.join(" "))}return o+">"}(e,n),i="",u=q.map(r,function(t){return t.split(/\n/).join("
    ")});return 1===u.length?u[0]:q.map(u,function(t){return o+t+i}).join("")}var H=A.exports.boltExport,$=function(t){var n=S.none(),e=[],r=function(t){o()?u(t):e.push(t)},o=function(){return n.isSome()},i=function(t){_(t,u)},u=function(e){n.each(function(t){f.setTimeout(function(){e(t)},0)})};return t(function(t){n=S.some(t),i(e),e=[]}),{get:r,map:function(n){return $(function(e){r(function(t){e(n(t))})})},isReady:o}},W={nu:$,pure:function(e){return $(function(t){t(e)})}},U=function(n){function t(t){n().then(t,j)}return{map:function(t){return U(function(){return n().then(t)})},bind:function(e){return U(function(){return n().then(function(t){return e(t).toPromise()})})},anonBind:function(t){return U(function(){return n().then(function(){return t.toPromise()})})},toLazy:function(){return W.nu(t)},toCached:function(){var t=null;return U(function(){return null===t&&(t=n()),t})},toPromise:n,get:t}},z=function(t){return U(function(){return new H(t)})},V=tinymce.util.Tools.resolve("tinymce.Env"),K=tinymce.util.Tools.resolve("tinymce.util.Delay"),q=tinymce.util.Tools.resolve("tinymce.util.Tools"),G=tinymce.util.Tools.resolve("tinymce.util.VK"),X="x-tinymce/html",Y="\x3c!-- "+X+" --\x3e",Z=function(t){return Y+t},J=function(t){return t.replace(Y,"")},Q=function(t){return-1!==t.indexOf(Y)},tt=function(){return X},et=tinymce.util.Tools.resolve("tinymce.html.Entities"),nt=function(t){return!/<(?:\/?(?!(?:div|p|br|span)>)\w+|(?:(?!(?:span style="white-space:\s?pre;?">)|br\s?\/>))\w+\s[^>]+)>/i.test(t)},rt=function(t,e,n){return e?B(t,!0===e?"p":e,n):N(t)},ot=tinymce.util.Tools.resolve("tinymce.html.DomParser"),it=tinymce.util.Tools.resolve("tinymce.html.Serializer"),ut=tinymce.util.Tools.resolve("tinymce.html.Node"),at=tinymce.util.Tools.resolve("tinymce.html.Schema"),st={shouldBlockDrop:function(t){return t.getParam("paste_block_drop",!1)},shouldPasteDataImages:function(t){return t.getParam("paste_data_images",!1)},shouldFilterDrop:function(t){return t.getParam("paste_filter_drop",!0)},getPreProcess:function(t){return t.getParam("paste_preprocess")},getPostProcess:function(t){return t.getParam("paste_postprocess")},getWebkitStyles:function(t){return t.getParam("paste_webkit_styles")},shouldRemoveWebKitStyles:function(t){return t.getParam("paste_remove_styles_if_webkit",!0)},shouldMergeFormats:function(t){return t.getParam("paste_merge_formats",!0)},isSmartPasteEnabled:function(t){return t.getParam("smart_paste",!0)},isPasteAsTextEnabled:function(t){return t.getParam("paste_as_text",!1)},getRetainStyleProps:function(t){return t.getParam("paste_retain_style_properties")},getWordValidElements:function(t){return t.getParam("paste_word_valid_elements","-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")},shouldConvertWordFakeLists:function(t){return t.getParam("paste_convert_word_fake_lists",!0)},shouldUseDefaultFilters:function(t){return t.getParam("paste_enable_default_filters",!0)}};function ct(e,t){return q.each(t,function(t){e=t.constructor===RegExp?e.replace(t,""):e.replace(t[0],t[1])}),e}var lt={filter:ct,innerText:function se(t){var e=at(),n=ot({},e),r="",o=e.getShortEndedElements(),i=q.makeMap("script noscript style textarea video audio iframe object"," "),u=e.getBlockElements();return t=ct(t,[//g]),function a(t){var e=t.name,n=t;if("br"!==e){if("wbr"!==e)if(o[e]&&(r+=" "),i[e])r+=" ";else{if(3===t.type&&(r+=t.value),!t.shortEnded&&(t=t.firstChild))for(;a(t),t=t.next;);u[e]&&n.next&&(r+="\n","p"===e&&(r+="\n"))}}else r+="\n"}(n.parse(t)),r},trimHtml:function ce(t){return t=ct(t,[/^[\s\S]*]*>\s*|\s*<\/body[^>]*>[\s\S]*$/gi,/|/g,[/( ?)\u00a0<\/span>( ?)/g,function r(t,e,n){return e||n?"\xa0":" "}],/
    /g,/
    $/i])},createIdGenerator:function le(t){var e=0;return function(){return t+e++}},isMsEdge:function(){return-1!==f.navigator.userAgent.indexOf(" Edge/")}};function ft(e){var n,t;return t=[/^[IVXLMCD]{1,2}\.[ \u00a0]/,/^[ivxlmcd]{1,2}\.[ \u00a0]/,/^[a-z]{1,2}[\.\)][ \u00a0]/,/^[A-Z]{1,2}[\.\)][ \u00a0]/,/^[0-9]+\.[ \u00a0]/,/^[\u3007\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d]+\.[ \u00a0]/,/^[\u58f1\u5f10\u53c2\u56db\u4f0d\u516d\u4e03\u516b\u4e5d\u62fe]+\.[ \u00a0]/],e=e.replace(/^[\u00a0 ]+/,""),q.each(t,function(t){if(t.test(e))return!(n=!0)}),n}function dt(t){var i,u,a=1;function n(t){var e="";if(3===t.type)return t.value;if(t=t.firstChild)for(;e+=n(t),t=t.next;);return e}function s(t,e){if(3===t.type&&e.test(t.value))return t.value=t.value.replace(e,""),!1;if(t=t.firstChild)do{if(!s(t,e))return!1}while(t=t.next);return!0}function e(t,e,n){var r=t._listLevel||a;r!==a&&(i=r')}),!0}(t,e,n)}function xt(t){return"\n"===t||"\r"===t}function _t(n){return function(t,e,n){return _(t,function(t){n=e(n,t)}),n}(n,function(t,e){return function(t){return-1!==" \f\t\x0B".indexOf(t)}(e)||"\xa0"===e?t.pcIsSpace||""===t.str||t.str.length===n.length-1||function(t,e){return e',!1)}else Tt(t,'',!1)}(e,t)})}),!0}return!1}function Et(t){return G.metaKeyPressed(t)&&86===t.keyCode||t.shiftKey&&45===t.keyCode}function It(a,s,i){var u,c=function(){var e=d(S.none());return{clear:function(){e.set(S.none())},set:function(t){e.set(S.some(t))},isSet:function(){return e.get().isSome()},on:function(t){e.get().each(t)}}}();function l(t,e,n,r){var o,i,u;kt(t,"text/html")?o=t["text/html"]:(o=s.getHtml(),r=r||Q(o),s.isDefaultContent(o)&&(n=!0)),o=lt.trimHtml(o),s.remove(),i=!1===r&&nt(o),u=Kt(o),o.length&&(!i||u)||(n=!0),(n||u)&&(o=kt(t,"text/plain")&&i?t["text/plain"]:lt.innerText(o)),s.isDefaultContent(o)?e||a.windowManager.alert("Please use Ctrl+V/Cmd+V keyboard shortcuts to paste contents."):n?Dt(a,o):Tt(a,o,r)}a.on("keydown",function(t){function e(t){Et(t)&&!t.isDefaultPrevented()&&s.remove()}if(Et(t)&&!t.isDefaultPrevented()){if((u=t.shiftKey&&86===t.keyCode)&&V.webkit&&-1!==f.navigator.userAgent.indexOf("Version/"))return;if(t.stopImmediatePropagation(),c.set(t),window.setTimeout(function(){c.clear()},100),V.ie&&u)return t.preventDefault(),void m(a,!0);s.remove(),s.create(),a.once("keyup",e),a.once("paste",function(){a.off("keyup",e)})}}),a.on("paste",function(t){var e=c.isSet(),n=function(t,e){var n=Ct(e.clipboardData||t.getDoc().dataTransfer);return lt.isMsEdge()?q.extend(n,{"text/html":""}):n}(a,t),r="text"===i.get()||u,o=kt(n,tt());u=!1,t.isDefaultPrevented()||function(t){var e=t.clipboardData;return-1!==f.navigator.userAgent.indexOf("Android")&&e&&e.items&&0===e.items.length}(t)?s.remove():Ft(n)||!St(a,t,s.getLastRng()||a.selection.getRng())?(e||t.preventDefault(),!V.ie||e&&!t.ieFake||kt(n,"text/html")||(s.create(),a.dom.bind(s.getEl(),"paste",function(t){t.stopPropagation()}),a.getDoc().execCommand("Paste",!1,null),n["text/html"]=s.getHtml()),kt(n,"text/html")?(t.preventDefault(),o=o||Q(n["text/html"]),l(n,e,r,o)):K.setEditorTimeout(a,function(){l(n,e,r,o)},0)):s.remove()})}function Rt(t){return V.ie&&t.inline?f.document.body:t.getBody()}function Ot(e,t,n){!function(t){return Rt(t)!==t.getBody()}(e)||e.dom.bind(t,"paste keyup",function(t){Yt(e,n)||e.fire("paste")})}function At(t,e){return e===t}function jt(t){var e=d(null),n="%MCEPASTEBIN%";return{create:function(){return function(t,e,n){var r,o=t.dom,i=t.getBody();e.set(t.selection.getRng()),r=t.dom.add(Rt(t),"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),(V.ie||V.gecko)&&o.setStyle(r,"left","rtl"===o.getStyle(i,"direction",!0)?65535:-65535),o.bind(r,"beforedeactivate focusin focusout",function(t){t.stopPropagation()}),Ot(t,r,n),r.focus(),t.selection.select(r,!0)}(t,e,n)},remove:function(){return function(t,e){if(Xt(t)){for(var n=void 0,r=e.get();n=t.dom.get("mcepastebin");)t.dom.remove(n),t.dom.unbind(n);r&&t.selection.setRng(r)}e.set(null)}(t,e)},getEl:function(){return Xt(t)},getHtml:function(){return function(n){function e(t,e){t.appendChild(e),n.dom.remove(e,!0)}var r,t,o,i,u;for(t=q.grep(Rt(n).childNodes,function(t){return"mcepastebin"===t.id}),r=t.shift(),q.each(t,function(t){e(r,t)}),o=(i=n.dom.select("div[id=mcepastebin]",r)).length-1;0<=o;o--)u=n.dom.create("div"),r.insertBefore(u,i[o]),e(u,i[o]);return r?r.innerHTML:""}(t)},getLastRng:function(){return function(t){return t.get()}(e)},isDefault:function(){return Yt(t,n)},isDefaultContent:function(t){return At(n,t)}}}function Mt(n,t){var e=jt(n);return n.on("PreInit",function(){return function(u,t,e){var a;It(u,t,e),u.parser.addNodeFilter("img",function(t,e,n){function r(t){t.attr("data-mce-object")||a===V.transparentSrc||t.remove()}var o;if(!u.settings.paste_data_images&&((o=n).data&&!0===o.data.paste))for(var i=t.length;i--;)(a=t[i].attr("src"))&&(0===a.indexOf("webkit-fake-url")?r(t[i]):u.settings.allow_html_data_urls||0!==a.indexOf("data:")||r(t[i]))})}(n,e,t)}),{pasteFormat:t,pasteHtml:function(t,e){return Tt(n,t,e)},pasteText:function(t){return Dt(n,t)},pasteImageData:function(t,e){return St(n,t,e)},getDataTransferItems:Ct,hasHtmlOrText:Ft,hasContentType:kt}}function Lt(t,e,n){if(!function(t){return!1===V.iOS&&t!==undefined&&"function"==typeof t.setData&&!0!==lt.isMsEdge()}(t))return!1;try{return t.clearData(),t.setData("text/html",e),t.setData("text/plain",n),t.setData(tt(),e),!0}catch(r){return!1}}function Nt(t,e,n,r){Lt(t.clipboardData,e.html,e.text)?(t.preventDefault(),r()):n(e.html,r)}function Bt(a){return function(t,e){var n=Z(t),r=a.dom.create("div",{contenteditable:"false","data-mce-bogus":"all"}),o=a.dom.create("div",{contenteditable:"true"},n);a.dom.setStyles(r,{position:"fixed",top:"0",left:"-3000px",width:"1000px",overflow:"hidden"}),r.appendChild(o),a.dom.add(a.getBody(),r);var i=a.selection.getRng();o.focus();var u=a.dom.createRng();u.selectNodeContents(o),a.selection.setRng(u),K.setTimeout(function(){a.selection.setRng(i),r.parentNode.removeChild(r),e()},0)}}function Ht(t){return{html:t.selection.getContent({contextual:!0}),text:t.selection.getContent({format:"text"})}}function $t(t){return!t.selection.isCollapsed()||function(t){return!!t.dom.getParent(t.selection.getStart(),"td[data-mce-selected],th[data-mce-selected]",t.getBody())}(t)}function Wt(t,e){return Jt.getCaretRangeFromPoint(e.clientX,e.clientY,t.getDoc())}function Ut(t,e){t.focus(),t.selection.setRng(e)}var zt={preProcess:function(t,e){return st.shouldUseDefaultFilters(t)?function(r,t){var e,o;(e=st.getRetainStyleProps(r))&&(o=q.makeMap(e.split(/[, ]/))),t=lt.filter(t,[/
    /gi,/]+id="?docs-internal-[^>]*>/gi,//gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/ /gi,"\xa0"],[/([\s\u00a0]*)<\/span>/gi,function(t,e){return 0 [\\s\\r\\n]+|
    )*(<\\/?("+n.join("|")+")[^>]*>)(?:
     [\\s\\r\\n]+|
    )*","g");return e=lt.filter(e,[[r,"$1"]]),e=lt.filter(e,[[/

    /g,"

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

    /g,"
    "]])}function re(t,e,n,r){if(r||n)return e;var c,o=st.getWebkitStyles(t);if(!1===st.shouldRemoveWebKitStyles(t)||"all"===o)return e;if(o&&(c=o.split(/[, ]/)),c){var l=t.dom,f=t.selection.getNode();e=e.replace(/(<[^>]+) style="([^"]*)"([^>]*>)/gi,function(t,e,n,r){var o=l.parseStyle(l.decode(n)),i={};if("none"===c)return e+r;for(var u=0;u]+) style="([^"]*)"([^>]*>)/gi,"$1$3");return e=e.replace(/(<[^>]+) data-mce-style="([^"]+)"([^>]*>)/gi,function(t,e,n,r){return e+' style="'+n+'"'+r})}function oe(n,t){n.$("a",t).find("font,u").each(function(t,e){n.dom.remove(e,!0)})}function ie(n,r){return function(e){e.setActive("text"===r.pasteFormat.get());function t(t){return e.setActive(t.state)}return n.on("PastePlainTextToggle",t),function(){return n.off("PastePlainTextToggle",t)}}}var ue=function(t){V.webkit&&ee(t,re),V.ie&&(ee(t,ne),function r(e,n){e.on("PastePostProcess",function(t){n(e,t.node)})}(t,oe))},ae=function(t,e){t.ui.registry.addToggleButton("pastetext",{active:!1,icon:"paste-text",tooltip:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:ie(t,e)}),t.ui.registry.addToggleMenuItem("pastetext",{text:"Paste as text",onAction:function(){return t.execCommand("mceTogglePlainTextPaste")},onSetup:ie(t,e)})};!function de(){r.add("paste",function(t){if(!1===u(t)){var e=d(!1),n=d(st.isPasteAsTextEnabled(t)?"text":"html"),r=Mt(t,n),o=ue(t);return ae(t,r),p(t,r),te(t),Zt(t),Qt(t,r,e),a(r,o)}})}()}(window); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/plugins/preview/plugin.js b/lib/tinymce/js/tinymce/plugins/preview/plugin.js index 42b28fb0..5687c604 100644 --- a/lib/tinymce/js/tinymce/plugins/preview/plugin.js +++ b/lib/tinymce/js/tinymce/plugins/preview/plugin.js @@ -1,62 +1,126 @@ /** - * 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.1.6 (2020-01-28) */ +(function () { + 'use strict'; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var getPreviewDialogWidth = function (editor) { + return parseInt(editor.getParam('plugin_preview_width', '650'), 10); + }; + var getPreviewDialogHeight = function (editor) { + return parseInt(editor.getParam('plugin_preview_height', '500'), 10); + }; + var getContentStyle = function (editor) { + return editor.getParam('content_style', ''); + }; + var shouldUseContentCssCors = function (editor) { + return editor.getParam('content_css_cors', false, 'boolean'); + }; + var Settings = { + getPreviewDialogWidth: getPreviewDialogWidth, + getPreviewDialogHeight: getPreviewDialogHeight, + getContentStyle: getContentStyle, + shouldUseContentCssCors: shouldUseContentCssCors + }; + + var global$2 = tinymce.util.Tools.resolve('tinymce.Env'); + + var getPreviewHtml = function (editor) { + var headHtml = ''; + var encode = editor.dom.encode; + var contentStyle = Settings.getContentStyle(editor); + headHtml += ''; + if (contentStyle) { + headHtml += ''; + } + var cors = Settings.shouldUseContentCssCors(editor) ? ' crossorigin="anonymous"' : ''; + global$1.each(editor.contentCSS, function (url) { + headHtml += ''; + }); + var bodyId = editor.settings.body_id || 'tinymce'; + if (bodyId.indexOf('=') !== -1) { + bodyId = editor.getParam('body_id', '', 'hash'); + bodyId = bodyId[editor.id] || bodyId; + } + var bodyClass = editor.settings.body_class || ''; + if (bodyClass.indexOf('=') !== -1) { + bodyClass = editor.getParam('body_class', '', 'hash'); + bodyClass = bodyClass[editor.id] || ''; + } + var isMetaKeyPressed = global$2.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 IframeContent = { getPreviewHtml: getPreviewHtml }; + + var open = function (editor) { + var content = IframeContent.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 Commands = { register: register }; + + 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'); + } + }); + }; + var Buttons = { register: register$1 }; + + function Plugin () { + global.add('preview', function (editor) { + Commands.register(editor); + Buttons.register(editor); + }); + } + + Plugin(); -/*global tinymce:true */ - -tinymce.PluginManager.add('preview', function(editor) { - editor.addCommand('mcePreview', function() { - editor.windowManager.open({ - title: 'Preview', - width : parseInt(editor.getParam("plugin_preview_width", "650"), 10), - height : parseInt(editor.getParam("plugin_preview_height", "500"), 10), - html: '', - buttons: { - text: 'Close', - onclick: function() { - this.parent().parent().close(); - } - }, - onPostRender: function() { - var doc = this.getEl('body').firstChild.contentWindow.document, previewHtml, headHtml = ''; - - tinymce.each(tinymce.explode(editor.settings.content_css), function(url) { - headHtml += ''; - }); - - previewHtml = ( - '' + - '' + - '' + - headHtml + - '' + - '' + - editor.getContent() + - '' + - '' - ); - - doc.open(); - doc.write(previewHtml); - doc.close(); - } - }); - }); - - editor.addButton('preview', { - title : 'Preview', - cmd : 'mcePreview' - }); - - editor.addMenuItem('preview', { - text : 'Preview', - cmd : 'mcePreview', - context: 'view' - }); -}); +}()); diff --git a/lib/tinymce/js/tinymce/plugins/preview/plugin.min.js b/lib/tinymce/js/tinymce/plugins/preview/plugin.min.js index a16b2593..df7741df 100644 --- a/lib/tinymce/js/tinymce/plugins/preview/plugin.min.js +++ b/lib/tinymce/js/tinymce/plugins/preview/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("preview",function(e){e.addCommand("mcePreview",function(){e.windowManager.open({title:"Preview",width:parseInt(e.getParam("plugin_preview_width","650"),10),height:parseInt(e.getParam("plugin_preview_height","500"),10),html:"",buttons:{text:"Close",onclick:function(){this.parent().parent().close()}},onPostRender:function(){var t,n=this.getEl("body").firstChild.contentWindow.document,i="";tinymce.each(tinymce.explode(e.settings.content_css),function(t){i+=''}),t=""+i+""+""+e.getContent()+""+"",n.open(),n.write(t),n.close()}})}),e.addButton("preview",{title:"Preview",cmd:"mcePreview"}),e.addMenuItem("preview",{text:"Preview",cmd:"mcePreview",context:"view"})}); \ 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.1.6 (2020-01-28) + */ +!function(){"use strict";var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),l=tinymce.util.Tools.resolve("tinymce.util.Tools"),m=function(e){return e.getParam("content_style","")},u=function(e){return e.getParam("content_css_cors",!1,"boolean")},y=tinymce.util.Tools.resolve("tinymce.Env"),n=function(t){var n="",i=t.dom.encode,e=m(t);n+='',e&&(n+='");var o=u(t)?' crossorigin="anonymous"':"";l.each(t.contentCSS,function(e){n+='"});var r=t.settings.body_id||"tinymce";-1!==r.indexOf("=")&&(r=(r=t.getParam("body_id","","hash"))[t.id]||r);var a=t.settings.body_class||"";-1!==a.indexOf("=")&&(a=(a=t.getParam("body_class","","hash"))[t.id]||"");var c='\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: b7c8d0a3a68383a9664606d506fd504a \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/plugins/spellchecker/plugin.js b/lib/tinymce/js/tinymce/plugins/spellchecker/plugin.js index f3c46ef1..f046b672 100644 --- a/lib/tinymce/js/tinymce/plugins/spellchecker/plugin.js +++ b/lib/tinymce/js/tinymce/plugins/spellchecker/plugin.js @@ -1,630 +1,761 @@ /** - * 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 (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.1.6 (2020-01-28) */ - -/** - * 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(regex, node, schema) { - var m, matches = [], text, count = 0, doc; - var blockElementsMap, hiddenTextElementsMap, shortEndedElementsMap; - - doc = node.ownerDocument; - blockElementsMap = schema.getBlockElements(); // H1-H6, P, TD etc - hiddenTextElementsMap = schema.getWhiteSpaceElements(); // TEXTAREA, PRE, STYLE, SCRIPT - shortEndedElementsMap = schema.getShortEndedElements(); // BR, IMG, INPUT - - function getMatchIndexes(m) { - if (!m[0]) { - throw 'findAndReplaceDOMText cannot handle zero-length matches'; - } - - var index = m.index; - - return [index, index + m[0].length, [m[0]]]; - } - - function getText(node) { - var txt; - - if (node.nodeType === 3) { - return node.data; - } - - if (hiddenTextElementsMap[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 = matches.shift(), matchIndex = 0; - - out: while (true) { - if (blockElementsMap[curNode.nodeName] || shortEndedElementsMap[curNode.nodeName]) { - atIndex++; - } - - if (curNode.nodeType === 3) { - if (!endNode && curNode.length + atIndex >= matchLocation[1]) { - // We've found the ending - endNode = curNode; - endNodeIndex = matchLocation[1] - atIndex; - } else if (startNode) { - // Intersecting node - innerNodes.push(curNode); - } - - if (!startNode && curNode.length + atIndex > matchLocation[0]) { - // We've found the match start - startNode = curNode; - startNodeIndex = matchLocation[0] - atIndex; - } - - atIndex += curNode.length; - } - - if (startNode && endNode) { - curNode = replaceFn({ - startNode: startNode, - startNodeIndex: startNodeIndex, - endNode: endNode, - endNodeIndex: endNodeIndex, - innerNodes: innerNodes, - match: matchLocation[2], - 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] && 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(nodeName) { - var makeReplacementNode; - - if (typeof nodeName != 'function') { - var stencilNode = nodeName.nodeType ? nodeName : doc.createElement(nodeName); - - makeReplacementNode = function(fill, matchIndex) { - var clone = stencilNode.cloneNode(false); - - clone.setAttribute('data-mce-index', matchIndex); - - if (fill) { - clone.appendChild(doc.createTextNode(fill)); - } - - return clone; - }; - } else { - makeReplacementNode = nodeName; - } - - return function replace(range) { - var before, after, parentNode, startNode = range.startNode, - endNode = range.endNode, matchIndex = range.matchIndex; - - 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[0], 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; - } - }; - } - - text = getText(node); - if (text && regex.global) { - while ((m = regex.exec(text))) { - matches.push(getMatchIndexes(m)); - } - } - - function filter(callback) { - var filteredMatches = []; - - each(function(match, i) { - if (callback(match, i)) { - filteredMatches.push(match); - } - }); - - matches = filteredMatches; - - /*jshint validthis:true*/ - return this; - } - - 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; - } - - function mark(replacementNode) { - if (matches.length) { - count = matches.length; - stepThroughMatches(node, matches, genReplacer(replacementNode)); - } - - /*jshint validthis:true*/ - return this; - } - - return { - text: text, - count: count, - matches: matches, - each: each, - filter: filter, - mark: mark - }; - }; -}); - -// Included from: js/tinymce/plugins/spellchecker/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 - */ - -/*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" -], function(DomTextMatcher, PluginManager, Tools, Menu, DOMUtils, JSONRequest) { - PluginManager.add('spellchecker', function(editor) { - var lastSuggestions, started; - - function isEmpty(obj) { - /*jshint unused:false*/ - for (var name in obj) { - return false; - } - - return true; - } - - function showSuggestions(target, word) { - var items = [], suggestions = lastSuggestions[word]; - - Tools.each(suggestions, function(suggestion) { - items.push({ - text: suggestion, - onclick: function() { - editor.insertContent(suggestion); - checkIfFinished(); - } - }); - }); - - items.push.apply(items, [ - {text: '-'}, - - {text: 'Ignore', onclick: function() { - ignoreWord(target, word); - }}, - - {text: 'Ignore all', onclick: function() { - ignoreWord(target, word, true); - }}, - - {text: 'Finish', onclick: finish} - ]); - - // Render menu - var menu = new Menu({ - items: items, - context: 'contextmenu', - onhide: function() { - menu.remove(); - } - }); - - menu.renderTo(document.body); - - // Position menu - var pos = DOMUtils.DOM.getPos(editor.getContentAreaContainer()); - var targetPos = editor.dom.getPos(target); - - pos.x += targetPos.x; - pos.y += targetPos.y; - - menu.moveTo(pos.x, pos.y + target.offsetHeight); - } - - function spellcheck() { - var textFilter, words = [], uniqueWords = {}; - - if (started) { - finish(); - return; - } - - started = true; - - function doneCallback(suggestions) { - editor.setProgressState(false); - - if (isEmpty(suggestions)) { - editor.windowManager.alert('No misspellings found'); - return; - } - - lastSuggestions = suggestions; - - textFilter.filter(function(match) { - return !!suggestions[match[2][0]]; - }).mark(editor.dom.create('span', { - "class": 'mce-spellchecker-word', - "data-mce-bogus": 1 - })); - - textFilter = null; - editor.fire('SpellcheckStart'); - } - - // Find all words and make an unique words array - textFilter = new DomTextMatcher(/\w+/g, editor.getBody(), editor.schema).each(function(match) { - if (!uniqueWords[match[2][0]]) { - words.push(match[2][0]); - uniqueWords[match[2][0]] = true; - } - }); - - editor.settings.spellcheck_callback = function(method, words, doneCallback) { - JSONRequest.sendRPC({ - url: editor.settings.spellchecker_rpc_url, - method: method, - params: { - lang: "en", - words: words - }, - success: function(result) { - doneCallback(result); - }, - error: function(result, xhr) { - editor.windowManager.alert("Error: " + result + "\nData:" + xhr.responseText); - editor.setProgressState(false); - textFilter = null; - } - }); - }; - - editor.setProgressState(true); - editor.settings.spellcheck_callback("spellcheck", words, doneCallback); - } - - function checkIfFinished() { - if (!editor.dom.select('span.mce-spellchecker-word').length) { - finish(); - } - } - - function unwrap(node) { - var parentNode = node.parentNode; - parentNode.insertBefore(node.firstChild, node); - node.parentNode.removeChild(node); - } - - function ignoreWord(target, word, all) { - if (all) { - Tools.each(editor.dom.select('span.mce-spellchecker-word'), function(item) { - var text = item.innerText || item.textContent; - - if (text == word) { - unwrap(item); - } - }); - } else { - unwrap(target); - } - - checkIfFinished(); - } - - function finish() { - var i, nodes, node; - - started = false; - node = editor.getBody(); - nodes = node.getElementsByTagName('span'); - i = nodes.length; - while (i--) { - node = nodes[i]; - if (node.getAttribute('data-mce-index')) { - unwrap(node); - } - } - - editor.fire('SpellcheckEnd'); - } - - function selectMatch(index) { - var nodes, i, spanElm, spanIndex = -1, startContainer, endContainer; - - index = "" + index; - nodes = editor.getBody().getElementsByTagName("span"); - for (i = 0; i < nodes.length; i++) { - spanElm = nodes[i]; - if (spanElm.className == "mce-spellchecker-word") { - spanIndex = spanElm.getAttribute('data-mce-index'); - if (spanIndex === index) { - spanIndex = index; - - if (!startContainer) { - startContainer = spanElm.firstChild; - } - - endContainer = spanElm.firstChild; - } - - if (spanIndex !== index && endContainer) { - break; - } - } - } - - var rng = editor.dom.createRng(); - rng.setStart(startContainer, 0); - rng.setEnd(endContainer, endContainer.length); - editor.selection.setRng(rng); - - return rng; - } - - editor.on('click', function(e) { - if (e.target.className == "mce-spellchecker-word") { - e.preventDefault(); - - var rng = selectMatch(e.target.getAttribute('data-mce-index')); - showSuggestions(e.target, rng.toString()); - } - }); - - editor.addMenuItem('spellchecker', { - text: 'Spellcheck', - context: 'tools', - onclick: spellcheck, - selectable: true, - onPostRender: function() { - var self = this; - - editor.on('SpellcheckStart SpellcheckEnd', function() { - self.active(started); - }); - } - }); - - editor.addButton('spellchecker', { - tooltip: 'Spellcheck', - onclick: spellcheck, - onPostRender: function() { - var self = this; - - editor.on('SpellcheckStart SpellcheckEnd', function() { - self.active(started); - }); - } - }); - }); -}); - -expose(["tinymce/spellcheckerplugin/DomTextMatcher","tinymce/spellcheckerplugin/Plugin"]); -})(this); \ No newline at end of file +(function (domGlobals) { + 'use strict'; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var hasProPlugin = function (editor) { + if (/(^|[ ,])tinymcespellchecker([, ]|$)/.test(editor.settings.plugins) && global.get('tinymcespellchecker')) { + if (typeof domGlobals.window.console !== 'undefined' && domGlobals.window.console.log) { + domGlobals.window.console.log('Spell Checker Pro is incompatible with Spell Checker plugin! ' + 'Remove \'spellchecker\' from the \'plugins\' option.'); + } + return true; + } else { + return false; + } + }; + var DetectProPlugin = { hasProPlugin: hasProPlugin }; + + 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 Events = { + fireSpellcheckStart: fireSpellcheckStart, + fireSpellcheckEnd: fireSpellcheckEnd + }; + + 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); + }; + var Settings = { + getLanguages: getLanguages, + getLanguage: getLanguage, + getRpcUrl: getRpcUrl, + getSpellcheckerCallback: getSpellcheckerCallback, + getSpellcheckerWordcharPattern: getSpellcheckerWordcharPattern + }; + + function isContentEditableFalse(node) { + return node && node.nodeType === 1 && node.contentEditable === 'false'; + } + var DomTextMatcher = function (node, editor) { + var m, matches = [], text; + var dom = editor.dom; + var blockElementsMap, hiddenTextElementsMap, shortEndedElementsMap; + blockElementsMap = editor.schema.getBlockElements(); + hiddenTextElementsMap = editor.schema.getWhiteSpaceElements(); + 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; + parentNode.insertBefore(element.firstChild, element); + 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; + } + 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 isEmpty = function (obj) { + for (var _ in obj) { + return false; + } + return true; + }; + 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(Settings.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: (') + Settings.getRpcUrl(editor) + editor.translate(')'); + errorCallback(message); + } + }); + }; + }; + var sendRpcCall = function (editor, pluginUrl, currentLanguageState, name, data, successCallback, errorCallback) { + var userSpellcheckCallback = Settings.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); + Events.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 nodes; + var spans = []; + 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(Settings.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); + Events.fireSpellcheckStart(editor); + }; + var Actions = { + spellcheck: spellcheck, + checkIfFinished: checkIfFinished, + addToDictionary: addToDictionary, + ignoreWord: ignoreWord, + findSpansByIndex: findSpansByIndex, + getElmIndex: getElmIndex, + markErrors: markErrors + }; + + var get = function (editor, startedState, lastSuggestionsState, textMatcherState, currentLanguageState, url) { + var getLanguage = function () { + return currentLanguageState.get(); + }; + var getWordCharPattern = function () { + return Settings.getSpellcheckerWordcharPattern(editor); + }; + var markErrors = function (data) { + Actions.markErrors(editor, startedState, textMatcherState, lastSuggestionsState, data); + }; + var getTextMatcher = function () { + return textMatcherState.get(); + }; + return { + getTextMatcher: getTextMatcher, + getWordCharPattern: getWordCharPattern, + markErrors: markErrors, + getLanguage: getLanguage + }; + }; + var Api = { get: get }; + + var register = function (editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState) { + editor.addCommand('mceSpellCheck', function () { + Actions.spellcheck(editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState); + }); + }; + var Commands = { register: register }; + + 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(Settings.getLanguages(editor).split(','), function (langPair) { + langPair = langPair.split('='); + return { + name: langPair[0], + value: langPair[1] + }; + }); + }; + var register$1 = function (editor, pluginUrl, startedState, textMatcherState, currentLanguageState, lastSuggestionsState) { + var languageMenuItems = buildMenuItems('Language', getItems(editor)); + var startSpellchecking = function () { + Actions.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', + 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 Buttons = { register: register$1 }; + + 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); + Actions.checkIfFinished(editor, startedState, textMatcherState); + } + }); + }); + var hasDictionarySupport = lastSuggestionsState.get().hasDictionarySupport; + if (hasDictionarySupport) { + items.push({ type: 'separator' }); + items.push({ + text: 'Add to dictionary', + onAction: function () { + Actions.addToDictionary(editor, pluginUrl, startedState, textMatcherState, currentLanguageState, word, spans); + } + }); + } + items.push.apply(items, [ + { type: 'separator' }, + { + text: 'Ignore', + onAction: function () { + Actions.ignoreWord(editor, startedState, textMatcherState, word, spans); + } + }, + { + text: 'Ignore all', + onAction: function () { + Actions.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 = Actions.findSpansByIndex(editor, Actions.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 }); + }; + var SuggestionsMenu = { setup: setup }; + + function Plugin () { + global.add('spellchecker', function (editor, pluginUrl) { + if (DetectProPlugin.hasProPlugin(editor) === false) { + var startedState = Cell(false); + var currentLanguageState = Cell(Settings.getLanguage(editor)); + var textMatcherState = Cell(null); + var lastSuggestionsState = Cell(null); + Buttons.register(editor, pluginUrl, startedState, textMatcherState, currentLanguageState, lastSuggestionsState); + SuggestionsMenu.setup(editor, pluginUrl, lastSuggestionsState, startedState, textMatcherState, currentLanguageState); + Commands.register(editor, pluginUrl, startedState, textMatcherState, lastSuggestionsState, currentLanguageState); + return Api.get(editor, startedState, lastSuggestionsState, textMatcherState, currentLanguageState, pluginUrl); + } + }); + } + + Plugin(); + +}(window)); diff --git a/lib/tinymce/js/tinymce/plugins/spellchecker/plugin.min.js b/lib/tinymce/js/tinymce/plugins/spellchecker/plugin.min.js index 88cecedf..88ec2491 100644 --- a/lib/tinymce/js/tinymce/plugins/spellchecker/plugin.min.js +++ b/lib/tinymce/js/tinymce/plugins/spellchecker/plugin.min.js @@ -1 +1,9 @@ -(function(e,t){"use strict";function n(e,t){for(var n,r=[],i=0;e.length>i;++i){if(n=s[e[i]]||o(e[i]),!n)throw"module definition dependecy not found: "+e[i];r.push(n)}t.apply(null,r)}function r(e,r,i){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(r===t)throw"invalid module definition, dependencies must be specified";if(i===t)throw"invalid module definition, definition function must be specified";n(r,function(){s[e]=i.apply(null,arguments)})}function i(e){return!!s[e]}function o(t){for(var n=e,r=t.split(/[.\/]/),i=0;r.length>i;++i){if(!n[r[i]])return;n=n[r[i]]}return n}function a(n){for(var r=0;n.length>r;r++){for(var i=e,o=n[r],a=o.split(/[.\/]/),l=0;a.length-1>l;++l)i[a[l]]===t&&(i[a[l]]={}),i=i[a[l]];i[a[a.length-1]]=s[o]}}var s={},l="tinymce/spellcheckerplugin/DomTextMatcher",c="tinymce/spellcheckerplugin/Plugin",u="tinymce/PluginManager",d="tinymce/util/Tools",f="tinymce/ui/Menu",p="tinymce/dom/DOMUtils",h="tinymce/util/JSONRequest";r(l,[],function(){return function(e,t,n){function r(e){if(!e[0])throw"findAndReplaceDOMText cannot handle zero-length matches";var t=e.index;return[t,t+e[0].length,[e[0]]]}function i(e){var t;if(3===e.nodeType)return e.data;if(g[e.nodeName])return"";if(t="",(m[e.nodeName]||v[e.nodeName])&&(t+="\n"),e=e.firstChild)do t+=i(e);while(e=e.nextSibling);return t}function o(e,t,n){var r,i,o,a,s=[],l=0,c=e,u=t.shift(),d=0;e:for(;;){if((m[c.nodeName]||v[c.nodeName])&&l++,3===c.nodeType&&(!i&&c.length+l>=u[1]?(i=c,a=u[1]-l):r&&s.push(c),!r&&c.length+l>u[0]&&(r=c,o=u[0]-l),l+=c.length),r&&i){if(c=n({startNode:r,startNodeIndex:o,endNode:i,endNodeIndex:a,innerNodes:s,match:u[2],matchIndex:d}),l-=i.length-a,r=null,i=null,s=[],u=t.shift(),d++,!u)break}else{if(!g[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 a(e){var t;if("function"!=typeof e){var n=e.nodeType?e:h.createElement(e);t=function(e,t){var r=n.cloneNode(!1);return r.setAttribute("data-mce-index",t),e&&r.appendChild(h.createTextNode(e)),r}}else t=e;return function r(e){var n,r,i,o=e.startNode,a=e.endNode,s=e.matchIndex;if(o===a){var l=o;i=l.parentNode,e.startNodeIndex>0&&(n=h.createTextNode(l.data.substring(0,e.startNodeIndex)),i.insertBefore(n,l));var c=t(e.match[0],s);return i.insertBefore(c,l),e.endNodeIndexf;++f){var m=e.innerNodes[f],g=t(m.data,s);m.parentNode.replaceChild(g,m),d.push(g)}var v=t(a.data.substring(0,e.endNodeIndex),s);return i=o.parentNode,i.insertBefore(n,o),i.insertBefore(u,o),i.removeChild(o),i=a.parentNode,i.insertBefore(v,a),i.insertBefore(r,a),i.removeChild(a),v}}function s(e){var t=[];return l(function(n,r){e(n,r)&&t.push(n)}),d=t,this}function l(e){for(var t=0,n=d.length;n>t&&e(d[t],t)!==!1;t++);return this}function c(e){return d.length&&(p=d.length,o(t,d,a(e))),this}var u,d=[],f,p=0,h,m,g,v;if(h=t.ownerDocument,m=n.getBlockElements(),g=n.getWhiteSpaceElements(),v=n.getShortEndedElements(),f=i(t),f&&e.global)for(;u=e.exec(f);)d.push(r(u));return{text:f,count:p,matches:d,each:l,filter:s,mark:c}}}),r(c,[l,u,d,f,p,h],function(e,n,r,i,o,a){n.add("spellchecker",function(n){function s(e){for(var t in e)return!1;return!0}function l(e,t){var a=[],s=m[t];r.each(s,function(e){a.push({text:e,onclick:function(){n.insertContent(e),u()}})}),a.push.apply(a,[{text:"-"},{text:"Ignore",onclick:function(){f(e,t)}},{text:"Ignore all",onclick:function(){f(e,t,!0)}},{text:"Finish",onclick:p}]);var l=new i({items:a,context:"contextmenu",onhide:function(){l.remove()}});l.renderTo(document.body);var c=o.DOM.getPos(n.getContentAreaContainer()),d=n.dom.getPos(e);c.x+=d.x,c.y+=d.y,l.moveTo(c.x,c.y+e.offsetHeight)}function c(){function r(e){return n.setProgressState(!1),s(e)?(n.windowManager.alert("No misspellings found"),t):(m=e,i.filter(function(t){return!!e[t[2][0]]}).mark(n.dom.create("span",{"class":"mce-spellchecker-word","data-mce-bogus":1})),i=null,n.fire("SpellcheckStart"),t)}var i,o=[],l={};return g?(p(),t):(g=!0,i=new e(/\w+/g,n.getBody(),n.schema).each(function(e){l[e[2][0]]||(o.push(e[2][0]),l[e[2][0]]=!0)}),n.settings.spellcheck_callback=function(e,t,r){a.sendRPC({url:n.settings.spellchecker_rpc_url,method:e,params:{lang:"en",words:t},success:function(e){r(e)},error:function(e,t){n.windowManager.alert("Error: "+e+"\nData:"+t.responseText),n.setProgressState(!1),i=null}})},n.setProgressState(!0),n.settings.spellcheck_callback("spellcheck",o,r),t)}function u(){n.dom.select("span.mce-spellchecker-word").length||p()}function d(e){var t=e.parentNode;t.insertBefore(e.firstChild,e),e.parentNode.removeChild(e)}function f(e,t,i){i?r.each(n.dom.select("span.mce-spellchecker-word"),function(e){var n=e.innerText||e.textContent;n==t&&d(e)}):d(e),u()}function p(){var e,t,r;for(g=!1,r=n.getBody(),t=r.getElementsByTagName("span"),e=t.length;e--;)r=t[e],r.getAttribute("data-mce-index")&&d(r);n.fire("SpellcheckEnd")}function h(e){var t,r,i,o=-1,a,s;for(e=""+e,t=n.getBody().getElementsByTagName("span"),r=0;t.length>r&&(i=t[r],"mce-spellchecker-word"!=i.className||(o=i.getAttribute("data-mce-index"),o===e&&(o=e,a||(a=i.firstChild),s=i.firstChild),o===e||!s));r++);var l=n.dom.createRng();return l.setStart(a,0),l.setEnd(s,s.length),n.selection.setRng(l),l}var m,g;n.on("click",function(e){if("mce-spellchecker-word"==e.target.className){e.preventDefault();var t=h(e.target.getAttribute("data-mce-index"));l(e.target,""+t)}}),n.addMenuItem("spellchecker",{text:"Spellcheck",context:"tools",onclick:c,selectable:!0,onPostRender:function(){var e=this;n.on("SpellcheckStart SpellcheckEnd",function(){e.active(g)})}}),n.addButton("spellchecker",{tooltip:"Spellcheck",onclick:c,onPostRender:function(){var e=this;n.on("SpellcheckStart SpellcheckEnd",function(){e.active(g)})}})})}),a([l,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.1.6 (2020-01-28) + */ +!function(t){"use strict";var a=function(e){function t(){return n}var n=e;return{get:t,set:function(e){n=e},clone:function(){return a(t())}}},n=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(e){return!(!/(^|[ ,])tinymcespellchecker([, ]|$)/.test(e.settings.plugins)||!n.get("tinymcespellchecker"))&&("undefined"!=typeof t.window.console&&t.window.console.log&&t.window.console.log("Spell Checker Pro is incompatible with Spell Checker plugin! Remove 'spellchecker' from the 'plugins' option."),!0)},l=tinymce.util.Tools.resolve("tinymce.util.Tools"),u=tinymce.util.Tools.resolve("tinymce.util.URI"),d=tinymce.util.Tools.resolve("tinymce.util.XHR"),f=function(e){return e.fire("SpellcheckStart")},o=function(e){return e.fire("SpellcheckEnd")},g=function(e){return e.getParam("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")},s=function(e){var t=e.getParam("language","en");return e.getParam("spellchecker_language",t)},h=function(e){return e.getParam("spellchecker_rpc_url")},p=function(e){return e.getParam("spellchecker_callback")},m=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 b(e){return e&&1===e.nodeType&&"false"===e.contentEditable}function r(a,r){var n,o,g,h,p,i=[],v=r.dom;function c(e,t){if(!e[0])throw new Error("findAndReplaceDOMText cannot handle zero-length matches");return{start:e.index,end:e.index+e[0].length,text:e[0],data:t}}function s(e){var t=a.getElementsByTagName("*"),n=[];e="number"==typeof e?""+e:null;for(var r=0;r=c.end?(o=l,a=c.end-u):r&&s.push(l),!r&&l.length+u>c.start&&(r=l,i=c.start-u),u+=l.length),r&&o){if(l=n({startNode:r,startNodeIndex:i,endNode:o,endNodeIndex:a,innerNodes:s,match:c.text,matchIndex:d}),u-=o.length-a,o=r=null,s=[],d++,!(c=t.shift()))break}else if(h[l.nodeName]&&!g[l.nodeName]||!l.firstChild){if(l.nextSibling){l=l.nextSibling;continue}}else if(!b(l)){l=l.firstChild;continue}for(;;){if(l.nextSibling){l=l.nextSibling;break}if(l.parentNode===e)break e;l=l.parentNode}}}(a,i,function t(o){function m(e,t){var n=i[t];n.stencil||(n.stencil=o(n));var r=n.stencil.cloneNode(!1);return r.setAttribute("data-mce-index",t),e&&r.appendChild(v.doc.createTextNode(e)),r}return function(e){var t,n,r,o=e.startNode,i=e.endNode,a=e.matchIndex,c=v.doc;if(o===i){var s=o;r=s.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; - } - - if (e.keyCode === 9) { - v = explode(editor.getParam('tab_focus', editor.getParam('tabfocus_elements', ':prev,:next'))); - - if (v.length == 1) { - v[1] = v[0]; - v[0] = ':prev'; - } - - // Find element to focus - 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) { - if (el.id && (editor = tinymce.get(el.id || el.name))) { - editor.focus(); - } else { - window.setTimeout(function() { - if (!tinymce.Env.webkit) { - window.focus(); - } - - el.focus(); - }, 10); - } - - e.preventDefault(); - } - } - } - - editor.on('keyup', tabCancel); - - if (tinymce.Env.gecko) { - editor.on('keypress keydown', tabHandler); - } else { - editor.on('keydown', tabHandler); - } -}); +(function (domGlobals) { + 'use strict'; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.EditorManager'); + + var global$3 = tinymce.util.Tools.resolve('tinymce.Env'); + + var global$4 = tinymce.util.Tools.resolve('tinymce.util.Delay'); + + var global$5 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var global$6 = tinymce.util.Tools.resolve('tinymce.util.VK'); + + var getTabFocusElements = function (editor) { + return editor.getParam('tabfocus_elements', ':prev,:next'); + }; + var getTabFocus = function (editor) { + return editor.getParam('tab_focus', getTabFocusElements(editor)); + }; + var Settings = { getTabFocus: getTabFocus }; + + var DOM = global$1.DOM; + var tabCancel = function (e) { + if (e.keyCode === global$6.TAB && !e.ctrlKey && !e.altKey && !e.metaKey) { + e.preventDefault(); + } + }; + var setup = function (editor) { + function tabHandler(e) { + var x, el, v, i; + if (e.keyCode !== global$6.TAB || e.ctrlKey || e.altKey || e.metaKey || e.isDefaultPrevented()) { + return; + } + function find(direction) { + el = DOM.select(':input:enabled,*[tabindex]:not(iframe)'); + function canSelectRecursive(e) { + return e.nodeName === 'BODY' || e.type !== 'hidden' && e.style.display !== 'none' && e.style.visibility !== 'hidden' && canSelectRecursive(e.parentNode); + } + function canSelect(el) { + return /INPUT|TEXTAREA|BUTTON/.test(el.tagName) && global$2.get(e.id) && el.tabIndex !== -1 && canSelectRecursive(el); + } + global$5.each(el, function (e, i) { + if (e.id === editor.id) { + x = i; + return false; + } + }); + if (direction > 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; + } + v = global$5.explode(Settings.getTabFocus(editor)); + if (v.length === 1) { + v[1] = v[0]; + v[0] = ':prev'; + } + 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) { + domGlobals.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); + } + }); + }; + var Keyboard = { setup: setup }; + + function Plugin () { + global.add('tabfocus', function (editor) { + Keyboard.setup(editor); + }); + } + + Plugin(); + +}(window)); diff --git a/lib/tinymce/js/tinymce/plugins/tabfocus/plugin.min.js b/lib/tinymce/js/tinymce/plugins/tabfocus/plugin.min.js index 68e9223c..51b9bd5b 100644 --- a/lib/tinymce/js/tinymce/plugins/tabfocus/plugin.min.js +++ b/lib/tinymce/js/tinymce/plugins/tabfocus/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("tabfocus",function(e){function t(e){9===e.keyCode&&e.preventDefault()}function n(t){function n(t){function n(e){return"BODY"===e.nodeName||"hidden"!=e.type&&"none"!=e.style.display&&"hidden"!=e.style.visibility&&n(e.parentNode)}function o(e){return e.attributes.tabIndex.specified||"INPUT"==e.nodeName||"TEXTAREA"==e.nodeName}function c(e){return!o(e)&&"-1"!=e.getAttribute("tabindex")&&n(e)}if(l=i.select(":input:enabled,*[tabindex]:not(iframe)"),a(l,function(t,n){return t.id==e.id?(r=n,!1):void 0}),t>0){for(s=r+1;l.length>s;s++)if(c(l[s]))return l[s]}else for(s=r-1;s>=0;s--)if(c(l[s]))return l[s];return null}var r,l,c,s;9===t.keyCode&&(c=o(e.getParam("tab_focus",e.getParam("tabfocus_elements",":prev,:next"))),1==c.length&&(c[1]=c[0],c[0]=":prev"),l=t.shiftKey?":prev"==c[0]?n(-1):i.get(c[0]):":next"==c[1]?n(1):i.get(c[1]),l&&(l.id&&(e=tinymce.get(l.id||l.name))?e.focus():window.setTimeout(function(){tinymce.Env.webkit||window.focus(),l.focus()},10),t.preventDefault()))}var i=tinymce.DOM,a=tinymce.each,o=tinymce.explode;e.on("keyup",t),tinymce.Env.gecko?e.on("keypress keydown",n):e.on("keydown",n)}); \ 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.1.6 (2020-01-28) + */ +!function(c){"use strict";function t(e){e.keyCode!==d.TAB||e.ctrlKey||e.altKey||e.metaKey||e.preventDefault()}var e=tinymce.util.Tools.resolve("tinymce.PluginManager"),n=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),s=tinymce.util.Tools.resolve("tinymce.EditorManager"),a=tinymce.util.Tools.resolve("tinymce.Env"),y=tinymce.util.Tools.resolve("tinymce.util.Delay"),f=tinymce.util.Tools.resolve("tinymce.util.Tools"),d=tinymce.util.Tools.resolve("tinymce.util.VK"),m=function(e){return e.getParam("tab_focus",function(e){return e.getParam("tabfocus_elements",":prev,:next")}(e))},v=n.DOM,i=function(r){function e(n){var i,o,e,l;if(!(n.keyCode!==d.TAB||n.ctrlKey||n.altKey||n.metaKey||n.isDefaultPrevented())&&(1===(e=f.explode(m(r))).length&&(e[1]=e[0],e[0]=":prev"),o=n.shiftKey?":prev"===e[0]?u(-1):v.get(e[0]):":next"===e[1]?u(1):v.get(e[1]))){var t=s.get(o.id||o.name);o.id&&t?t.focus():y.setTimeout(function(){a.webkit||c.window.focus(),o.focus()},10),n.preventDefault()}function u(e){function t(e){return/INPUT|TEXTAREA|BUTTON/.test(e.tagName)&&s.get(n.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(o=v.select(":input:enabled,*[tabindex]:not(iframe)"),f.each(o,function(e,t){if(e.id===r.id)return i=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/lib/tinymce/js/tinymce/plugins/table/classes/Plugin.js b/lib/tinymce/js/tinymce/plugins/table/classes/Plugin.js deleted file mode 100644 index 66e4d704..00000000 --- a/lib/tinymce/js/tinymce/plugins/table/classes/Plugin.js +++ /dev/null @@ -1,706 +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 tableDialog() { - var dom = editor.dom, tableElm, data; - - tableElm = editor.dom.getParent(editor.selection.getNode(), '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: 'Cols', name: 'cols'}, - {label: 'Rows', name: 'rows'}, - {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'); - - if (!Env.ie) { - captionElm.innerHTML = '
    '; - } - - tableElm.insertBefore(captionElm, tableElm.firstChild); - } - - // Apply/remove alignment - if (data.align) { - editor.formatter.apply('align' + data.align, {}, tableElm); - } else { - each('left center right'.split(' '), function(name) { - editor.formatter.remove('align' + name, {}, tableElm); - }); - } - - editor.focus(); - editor.addVisual(); - }); - } - }); - } - - function mergeDialog(grid, cell) { - editor.windowManager.open({ - title: "Merge cells", - body: [ - {label: 'Columns', name: 'cols', type: 'textbox', size: 5}, - {label: 'Rows', name: 'rows', type: 'textbox', size: 5} - ], - 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.getNode(), 'td,th'); - if (!cells.length && cellElm) { - cells.push(cellElm); - } - - cellElm = cellElm || cells[0]; - - 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, - menu: [ - {text: 'Cell', value: 'td'}, - {text: 'Header cell', value: 'th'} - ] - }, - { - label: 'Scope', - name: 'scope', - type: 'listbox', - text: 'None', - minWidth: 90, - maxWidth: null, - menu: [ - {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 - if (data.align) { - editor.formatter.apply('align' + data.align, {}, cellElm); - } else { - each('left center right'.split(' '), function(name) { - editor.formatter.remove('align' + name, {}, cellElm); - }); - } - }); - - editor.focus(); - }); - } - }); - } - - function rowDialog() { - var dom = editor.dom, tableElm, cellElm, rowElm, data, rows = []; - - tableElm = editor.dom.getParent(editor.selection.getNode(), 'table'); - cellElm = editor.dom.getParent(editor.selection.getNode(), '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]; - - 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, - menu: [ - {text: 'header', value: 'thead'}, - {text: 'body', value: 'tbody'}, - {text: 'footer', value: 'tfoot'} - ] - }, - { - type: 'listbox', - name: 'align', - label: 'Alignment', - text: 'None', - maxWidth: null, - menu: [ - {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() { - each(rows, function(rowElm) { - editor.dom.setAttrib(rowElm, 'scope', data.scope); - - editor.dom.setStyles(rowElm, { - height: addSizeSuffix(data.height) - }); - - if (data.type != rowElm.parentNode.nodeName.toLowerCase()) { - tableElm = dom.getParent(rowElm, 'table'); - - oldParentElm = rowElm.parentNode; - parentElm = dom.select(tableElm, data.type)[0]; - if (!parentElm) { - parentElm = dom.create(data.type); - if (tableElm.firstChild) { - tableElm.insertBefore(parentElm, tableElm.firstChild); - } else { - tableElm.appendChild(parentElm); - } - } - - parentElm.insertBefore(rowElm, parentElm.firstChild); - - if (!oldParentElm.hasChildNodes()) { - dom.remove(oldParentElm); - } - } - - // Apply/remove alignment - if (data.align) { - editor.formatter.apply('align' + data.align, {}, rowElm); - } else { - each('left center right'.split(' '), function(name) { - editor.formatter.remove('align' + name, {}, 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 postRender() { - /*jshint validthis:true*/ - var self = this; - - function bindStateListener() { - self.disabled(!editor.dom.getParent(editor.selection.getNode(), 'table')); - - editor.selection.selectorChanged('table', function(state) { - self.disabled(!state); - }); - } - - if (editor.initialized) { - bindStateListener(); - } else { - editor.on('init', bindStateListener); - } - } - - // Register buttons - each([ - ['table', 'Insert/edit table', 'mceInsertTable'], - ['delete_table', 'Delete table', 'mceTableDelete'], - ['delete_col', 'Delete column', 'mceTableDeleteCol'], - ['delete_row', 'Delete row', 'mceTableDeleteRow'], - ['col_after', 'Insert column after', 'mceTableInsertColAfter'], - ['col_before', 'Insert column before', 'mceTableInsertColBefore'], - ['row_after', 'Insert row after', 'mceTableInsertRowAfter'], - ['row_before', 'Insert row before', 'mceTableInsertRowBefore'], - ['row_props', 'Row properties', 'mceTableRowProps'], - ['cell_props', 'Cell properties', 'mceTableCellProps'], - ['split_cells', 'Split cells', 'mceTableSplitCells'], - ['merge_cells', 'Merge cells', 'mceTableMergeCells'] - ], function(c) { - editor.addButton(c[0], { - title : c[1], - cmd : c[2], - onPostRender: postRender - }); - }); - - function generateTableGrid() { - var html = ''; - - html = ''; - - for (var y = 0; y < 10; y++) { - html += ''; - - for (var x = 0; x < 10; x++) { - html += ''; - } - - html += ''; - } - - html += ''; - - html += '
    0 x 0
    '; - - return html; - } - - editor.addMenuItem('inserttable', { - text: 'Insert table', - icon: 'table', - context: 'table', - onhide: function() { - editor.dom.removeClass(this.menu.items()[0].getEl().getElementsByTagName('a'), 'mce-active'); - }, - menu: [ - { - type: 'container', - html: generateTableGrid(), - - onmousemove: function(e) { - var target = e.target; - - if (target.nodeName == 'A') { - var table = editor.dom.getParent(target, 'table'); - var pos = target.getAttribute('data-mce-index'); - - if (pos != this.lastPos) { - pos = pos.split(','); - - pos[0] = parseInt(pos[0], 10); - pos[1] = parseInt(pos[1], 10); - - for (var y = 0; y < 10; y++) { - for (var x = 0; x < 10; x++) { - editor.dom.toggleClass( - table.rows[y].childNodes[x].firstChild, - 'mce-active', - x <= pos[0] && y <= pos[1] - ); - } - } - - table.nextSibling.innerHTML = (pos[0] + 1) + ' x '+ (pos[1] + 1); - this.lastPos = pos; - } - } - }, - - onclick: function(e) { - if (e.target.nodeName == 'A' && this.lastPos) { - e.preventDefault(); - - insertTable(this.lastPos[0] + 1, this.lastPos[1] + 1); - - // TODO: Maybe rework this? - this.parent().cancel(); // Close parent menu as if it was a click - } - } - } - ] - }); - - 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: postRender}, - {text: 'Merge cells', onclick: cmd('mceTableMergeCells'), onPostRender: postRender}, - {text: 'Split cell', onclick: cmd('mceTableSplitCells'), onPostRender: postRender} - ] - }); - - editor.addMenuItem('row', { - text: 'Row', - context: 'table', - menu: [ - {text: 'Insert row before', onclick: cmd('mceTableInsertRowBefore'), onPostRender: postRender}, - {text: 'Insert row after', onclick: cmd('mceTableInsertRowAfter'), onPostRender: postRender}, - {text: 'Delete row', onclick: cmd('mceTableDeleteRow'), onPostRender: postRender}, - {text: 'Row properties', onclick: cmd('mceTableRowProps'), onPostRender: postRender}, - {text: '-'}, - {text: 'Cut row', onclick: cmd('mceTableCutRow'), onPostRender: postRender}, - {text: 'Copy row', onclick: cmd('mceTableCopyRow'), onPostRender: postRender}, - {text: 'Paste row before', onclick: cmd('mceTablePasteRowBefore'), onPostRender: postRender}, - {text: 'Paste row after', onclick: cmd('mceTablePasteRowAfter'), onPostRender: postRender} - ] - }); - - editor.addMenuItem('column', { - text: 'Column', - context: 'table', - menu: [ - {text: 'Insert column before', onclick: cmd('mceTableInsertColBefore'), onPostRender: postRender}, - {text: 'Insert column after', onclick: cmd('mceTableInsertColAfter'), onPostRender: postRender}, - {text: 'Delete column', onclick: cmd('mceTableDeleteCol'), onPostRender: postRender} - ] - }); - - // 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.getNode(), '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.selection); - - 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/lib/tinymce/js/tinymce/plugins/table/classes/Quirks.js b/lib/tinymce/js/tinymce/plugins/table/classes/Quirks.js deleted file mode 100644 index dec47aff..00000000 --- a/lib/tinymce/js/tinymce/plugins/table/classes/Quirks.js +++ /dev/null @@ -1,340 +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, - null, - Env.ie ? ' ' : '
    ' - ); - } 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(); - } - }); - } - - if (Env.webkit) { - moveWebKitSelection(); - fixTableCellSelection(); - } - - if (Env.gecko) { - fixBeforeTableCaretBug(); - fixTableCaretPos(); - } - }; -}); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/plugins/table/classes/TableGrid.js b/lib/tinymce/js/tinymce/plugins/table/classes/TableGrid.js deleted file mode 100644 index 40950fa2..00000000 --- a/lib/tinymce/js/tinymce/plugins/table/classes/TableGrid.js +++ /dev/null @@ -1,811 +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(selection, table) { - var grid, startPos, endPos, selectedCell, 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') || 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; - - // Clone formats - Tools.walk(cell, function(node) { - var curNode; - - if (node.nodeType == 3) { - each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) { - 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.setStartAfter(table); - rng.setEndAfter(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(); - - // 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 - 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 */ - 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; - } - }); - - 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.getNode(), '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/lib/tinymce/js/tinymce/plugins/table/plugin.dev.js b/lib/tinymce/js/tinymce/plugins/table/plugin.dev.js deleted file mode 100644 index 83da5cea..00000000 --- a/lib/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: e4bdae6ca54498d0dabca12fdf4a2caf \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/plugins/table/plugin.js b/lib/tinymce/js/tinymce/plugins/table/plugin.js index e7bbfe4d..29638341 100644 --- a/lib/tinymce/js/tinymce/plugins/table/plugin.js +++ b/lib/tinymce/js/tinymce/plugins/table/plugin.js @@ -1,2114 +1,9499 @@ /** - * 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(selection, table) { - var grid, startPos, endPos, selectedCell, 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') || 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; - - // Clone formats - Tools.walk(cell, function(node) { - var curNode; - - if (node.nodeType == 3) { - each(dom.getParents(node.parentNode, null, cell).reverse(), function(node) { - 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.setStartAfter(table); - rng.setEndAfter(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(); - - // 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 - 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 */ - 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; - } - }); - - 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.getNode(), '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, - null, - Env.ie ? ' ' : '
    ' - ); - } 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(); - } - }); - } - - if (Env.webkit) { - moveWebKitSelection(); - fixTableCellSelection(); - } - - if (Env.gecko) { - 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; - } - } - - // 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'); - } - }); - - dom.bind(editor.getDoc(), 'mouseover', function(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.selection, 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(); - } - }); - - 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.1.6 (2020-01-28) */ -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 tableDialog() { - var dom = editor.dom, tableElm, data; - - tableElm = editor.dom.getParent(editor.selection.getNode(), '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: 'Cols', name: 'cols'}, - {label: 'Rows', name: 'rows'}, - {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'); - - if (!Env.ie) { - captionElm.innerHTML = '
    '; - } - - tableElm.insertBefore(captionElm, tableElm.firstChild); - } - - // Apply/remove alignment - if (data.align) { - editor.formatter.apply('align' + data.align, {}, tableElm); - } else { - each('left center right'.split(' '), function(name) { - editor.formatter.remove('align' + name, {}, tableElm); - }); - } - - editor.focus(); - editor.addVisual(); - }); - } - }); - } - - function mergeDialog(grid, cell) { - editor.windowManager.open({ - title: "Merge cells", - body: [ - {label: 'Columns', name: 'cols', type: 'textbox', size: 5}, - {label: 'Rows', name: 'rows', type: 'textbox', size: 5} - ], - 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.getNode(), 'td,th'); - if (!cells.length && cellElm) { - cells.push(cellElm); - } - - cellElm = cellElm || cells[0]; - - 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, - menu: [ - {text: 'Cell', value: 'td'}, - {text: 'Header cell', value: 'th'} - ] - }, - { - label: 'Scope', - name: 'scope', - type: 'listbox', - text: 'None', - minWidth: 90, - maxWidth: null, - menu: [ - {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 - if (data.align) { - editor.formatter.apply('align' + data.align, {}, cellElm); - } else { - each('left center right'.split(' '), function(name) { - editor.formatter.remove('align' + name, {}, cellElm); - }); - } - }); - - editor.focus(); - }); - } - }); - } - - function rowDialog() { - var dom = editor.dom, tableElm, cellElm, rowElm, data, rows = []; - - tableElm = editor.dom.getParent(editor.selection.getNode(), 'table'); - cellElm = editor.dom.getParent(editor.selection.getNode(), '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]; - - 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, - menu: [ - {text: 'header', value: 'thead'}, - {text: 'body', value: 'tbody'}, - {text: 'footer', value: 'tfoot'} - ] - }, - { - type: 'listbox', - name: 'align', - label: 'Alignment', - text: 'None', - maxWidth: null, - menu: [ - {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() { - each(rows, function(rowElm) { - editor.dom.setAttrib(rowElm, 'scope', data.scope); - - editor.dom.setStyles(rowElm, { - height: addSizeSuffix(data.height) - }); - - if (data.type != rowElm.parentNode.nodeName.toLowerCase()) { - tableElm = dom.getParent(rowElm, 'table'); - - oldParentElm = rowElm.parentNode; - parentElm = dom.select(tableElm, data.type)[0]; - if (!parentElm) { - parentElm = dom.create(data.type); - if (tableElm.firstChild) { - tableElm.insertBefore(parentElm, tableElm.firstChild); - } else { - tableElm.appendChild(parentElm); - } - } - - parentElm.insertBefore(rowElm, parentElm.firstChild); - - if (!oldParentElm.hasChildNodes()) { - dom.remove(oldParentElm); - } - } - - // Apply/remove alignment - if (data.align) { - editor.formatter.apply('align' + data.align, {}, rowElm); - } else { - each('left center right'.split(' '), function(name) { - editor.formatter.remove('align' + name, {}, 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 postRender() { - /*jshint validthis:true*/ - var self = this; - - function bindStateListener() { - self.disabled(!editor.dom.getParent(editor.selection.getNode(), 'table')); - - editor.selection.selectorChanged('table', function(state) { - self.disabled(!state); - }); - } - - if (editor.initialized) { - bindStateListener(); - } else { - editor.on('init', bindStateListener); - } - } - - // Register buttons - each([ - ['table', 'Insert/edit table', 'mceInsertTable'], - ['delete_table', 'Delete table', 'mceTableDelete'], - ['delete_col', 'Delete column', 'mceTableDeleteCol'], - ['delete_row', 'Delete row', 'mceTableDeleteRow'], - ['col_after', 'Insert column after', 'mceTableInsertColAfter'], - ['col_before', 'Insert column before', 'mceTableInsertColBefore'], - ['row_after', 'Insert row after', 'mceTableInsertRowAfter'], - ['row_before', 'Insert row before', 'mceTableInsertRowBefore'], - ['row_props', 'Row properties', 'mceTableRowProps'], - ['cell_props', 'Cell properties', 'mceTableCellProps'], - ['split_cells', 'Split cells', 'mceTableSplitCells'], - ['merge_cells', 'Merge cells', 'mceTableMergeCells'] - ], function(c) { - editor.addButton(c[0], { - title : c[1], - cmd : c[2], - onPostRender: postRender - }); - }); - - function generateTableGrid() { - var html = ''; - - html = ''; - - for (var y = 0; y < 10; y++) { - html += ''; - - for (var x = 0; x < 10; x++) { - html += ''; - } - - html += ''; - } - - html += ''; - - html += '
    0 x 0
    '; - - return html; - } - - editor.addMenuItem('inserttable', { - text: 'Insert table', - icon: 'table', - context: 'table', - onhide: function() { - editor.dom.removeClass(this.menu.items()[0].getEl().getElementsByTagName('a'), 'mce-active'); - }, - menu: [ - { - type: 'container', - html: generateTableGrid(), - - onmousemove: function(e) { - var target = e.target; - - if (target.nodeName == 'A') { - var table = editor.dom.getParent(target, 'table'); - var pos = target.getAttribute('data-mce-index'); - - if (pos != this.lastPos) { - pos = pos.split(','); - - pos[0] = parseInt(pos[0], 10); - pos[1] = parseInt(pos[1], 10); - - for (var y = 0; y < 10; y++) { - for (var x = 0; x < 10; x++) { - editor.dom.toggleClass( - table.rows[y].childNodes[x].firstChild, - 'mce-active', - x <= pos[0] && y <= pos[1] - ); - } - } - - table.nextSibling.innerHTML = (pos[0] + 1) + ' x '+ (pos[1] + 1); - this.lastPos = pos; - } - } - }, - - onclick: function(e) { - if (e.target.nodeName == 'A' && this.lastPos) { - e.preventDefault(); - - insertTable(this.lastPos[0] + 1, this.lastPos[1] + 1); - - // TODO: Maybe rework this? - this.parent().cancel(); // Close parent menu as if it was a click - } - } - } - ] - }); - - 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: postRender}, - {text: 'Merge cells', onclick: cmd('mceTableMergeCells'), onPostRender: postRender}, - {text: 'Split cell', onclick: cmd('mceTableSplitCells'), onPostRender: postRender} - ] - }); - - editor.addMenuItem('row', { - text: 'Row', - context: 'table', - menu: [ - {text: 'Insert row before', onclick: cmd('mceTableInsertRowBefore'), onPostRender: postRender}, - {text: 'Insert row after', onclick: cmd('mceTableInsertRowAfter'), onPostRender: postRender}, - {text: 'Delete row', onclick: cmd('mceTableDeleteRow'), onPostRender: postRender}, - {text: 'Row properties', onclick: cmd('mceTableRowProps'), onPostRender: postRender}, - {text: '-'}, - {text: 'Cut row', onclick: cmd('mceTableCutRow'), onPostRender: postRender}, - {text: 'Copy row', onclick: cmd('mceTableCopyRow'), onPostRender: postRender}, - {text: 'Paste row before', onclick: cmd('mceTablePasteRowBefore'), onPostRender: postRender}, - {text: 'Paste row after', onclick: cmd('mceTablePasteRowAfter'), onPostRender: postRender} - ] - }); - - editor.addMenuItem('column', { - text: 'Column', - context: 'table', - menu: [ - {text: 'Insert column before', onclick: cmd('mceTableInsertColBefore'), onPostRender: postRender}, - {text: 'Insert column after', onclick: cmd('mceTableInsertColAfter'), onPostRender: postRender}, - {text: 'Delete column', onclick: cmd('mceTableDeleteCol'), onPostRender: postRender} - ] - }); - - // 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.getNode(), '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.selection); - - 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 (domGlobals) { + 'use strict'; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + 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 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 () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return !f.apply(null, args); + }; + }; + 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()') + }; + if (Object.freeze) { + Object.freeze(me); + } + 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 Option = { + some: some, + none: none, + from: from + }; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + 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 isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isString = isType('string'); + var isArray = isType('array'); + var isBoolean = isType('boolean'); + var isFunction = isType('function'); + var isNumber = isType('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 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 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 find = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Option.some(x); + } + } + return Option.none(); + }; + var findIndex = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Option.some(i); + } + } + return Option.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) { + var output = map(xs, f); + return flatten(output); + }; + 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 last = function (xs) { + return xs.length === 0 ? Option.none() : Option.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 get = function (obj, key) { + return has(obj, key) ? Option.from(obj[key]) : Option.none(); + }; + var has = function (obj, key) { + return hasOwnProperty.call(obj, key); + }; + + var Immutable = function () { + var fields = []; + for (var _i = 0; _i < arguments.length; _i++) { + fields[_i] = arguments[_i]; + } + return function () { + var values = []; + for (var _i = 0; _i < arguments.length; _i++) { + values[_i] = arguments[_i]; + } + if (fields.length !== values.length) { + throw new Error('Wrong number of arguments to struct. Expected "[' + fields.length + ']", got ' + values.length + ' arguments'); + } + var struct = {}; + each(fields, function (name, i) { + struct[name] = constant(values[i]); + }); + return struct; + }; + }; + + 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 MixedBag = function (required, optional) { + var everything = required.concat(optional); + if (everything.length === 0) { + throw new Error('You must specify at least one required or optional field.'); + } + validateStrArr('required', required); + validateStrArr('optional', optional); + checkDupes(everything); + 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); + } + var unsupported = filter(keys$1, function (key) { + return !contains(everything, key); + }); + if (unsupported.length > 0) { + unsuppMessage(unsupported); + } + var r = {}; + each(required, function (req) { + r[req] = constant(obj[req]); + }); + each(optional, function (opt) { + r[opt] = constant(Object.prototype.hasOwnProperty.call(obj, opt) ? Option.some(obj[opt]) : Option.none()); + }); + return r; + }; + }; + + var ATTRIBUTE = domGlobals.Node.ATTRIBUTE_NODE; + var CDATA_SECTION = domGlobals.Node.CDATA_SECTION_NODE; + var COMMENT = domGlobals.Node.COMMENT_NODE; + var DOCUMENT = domGlobals.Node.DOCUMENT_NODE; + var DOCUMENT_TYPE = domGlobals.Node.DOCUMENT_TYPE_NODE; + var DOCUMENT_FRAGMENT = domGlobals.Node.DOCUMENT_FRAGMENT_NODE; + var ELEMENT = domGlobals.Node.ELEMENT_NODE; + var TEXT = domGlobals.Node.TEXT_NODE; + var PROCESSING_INSTRUCTION = domGlobals.Node.PROCESSING_INSTRUCTION_NODE; + var ENTITY_REFERENCE = domGlobals.Node.ENTITY_REFERENCE_NODE; + var ENTITY = domGlobals.Node.ENTITY_NODE; + var NOTATION = domGlobals.Node.NOTATION_NODE; + + var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.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 rawSet = function (dom, key, value) { + if (isString(value) || isBoolean(value) || isNumber(value)) { + dom.setAttribute(key, value + ''); + } else { + domGlobals.console.error('Invalid call to Attr.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 has$1 = function (element, key) { + var dom = element.dom(); + return dom && dom.hasAttribute ? dom.hasAttribute(key) : false; + }; + 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 checkRange = function (str, substr, start) { + if (substr === '') { + return true; + } + if (str.length < substr.length) { + return false; + } + var x = str.substr(start, start + substr.length); + return x === 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 trim = function (str) { + return str.replace(/^\s+|\s+$/g, ''); + }; + + var isSupported = function (dom) { + return dom.style !== undefined && isFunction(dom.style.getPropertyValue); + }; + + 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 fromHtml = function (html, scope) { + var doc = scope || domGlobals.document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + domGlobals.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 || domGlobals.document; + var node = doc.createElement(tag); + return fromDom(node); + }; + var fromText = function (text, scope) { + var doc = scope || domGlobals.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: constant(node) }; + }; + var fromPoint = function (docElm, x, y) { + var doc = docElm.dom(); + return Option.from(doc.elementFromPoint(x, y)).map(fromDom); + }; + var Element = { + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint + }; + + var inBody = function (element) { + var dom = isText(element) ? element.dom().parentNode : element.dom(); + return dom !== undefined && dom !== null && dom.ownerDocument.body.contains(dom); + }; + var body = cached(function () { + return getBody(Element.fromDom(domGlobals.document)); + }); + var getBody = function (doc) { + var b = doc.dom().body; + if (b === null || b === undefined) { + throw new Error('Body is not available yet'); + } + return Element.fromDom(b); + }; + + var internalSet = function (dom, property, value) { + if (!isString(value)) { + domGlobals.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 internalRemove = function (dom, property) { + if (isSupported(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 = domGlobals.window.getComputedStyle(dom); + var r = styles.getPropertyValue(property); + var v = r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r; + return v === null ? undefined : v; + }; + var getUnsafeProperty = function (dom, property) { + return isSupported(dom) ? dom.style.getPropertyValue(property) : ''; + }; + var getRaw = function (element, property) { + var dom = element.dom(); + var raw = getUnsafeProperty(dom, property); + return Option.from(raw).filter(function (r) { + return r.length > 0; + }); + }; + var remove$1 = function (element, property) { + var dom = element.dom(); + internalRemove(dom, property); + if (has$1(element, 'style') && trim(get$1(element, 'style')) === '') { + remove(element, 'style'); + } + }; + var copy = function (source, target) { + var sourceDom = source.dom(); + var targetDom = target.dom(); + if (isSupported(sourceDom) && isSupported(targetDom)) { + targetDom.style.cssText = sourceDom.style.cssText; + } + }; + + var compareDocumentPosition = function (a, b, match) { + return (a.compareDocumentPosition(b) & match) !== 0; + }; + var documentPositionPreceding = function (a, b) { + return compareDocumentPosition(a, b, domGlobals.Node.DOCUMENT_POSITION_PRECEDING); + }; + var documentPositionContainedBy = function (a, b) { + return compareDocumentPosition(a, b, domGlobals.Node.DOCUMENT_POSITION_CONTAINED_BY); + }; + var Node = { + documentPositionPreceding: documentPositionPreceding, + documentPositionContainedBy: documentPositionContainedBy + }; + + 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 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 edge = 'Edge'; + var chrome = 'Chrome'; + var ie = 'IE'; + var opera = 'Opera'; + var firefox = 'Firefox'; + var safari = 'Safari'; + var isBrowser = function (name, current) { + return function () { + return current === name; + }; + }; + 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; + return { + current: current, + version: version, + isEdge: isBrowser(edge, current), + isChrome: isBrowser(chrome, current), + isIE: isBrowser(ie, current), + isOpera: isBrowser(opera, current), + isFirefox: isBrowser(firefox, current), + isSafari: isBrowser(safari, current) + }; + }; + 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 isOS = function (name, current) { + return function () { + return current === name; + }; + }; + 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; + return { + current: current, + version: version, + isWindows: isOS(windows, current), + isiOS: isOS(ios, current), + isAndroid: isOS(android, current), + isOSX: isOS(osx, current), + isLinux: isOS(linux, current), + isSolaris: isOS(solaris, current), + isFreeBSD: isOS(freebsd, current), + isChromeOS: isOS(chromeos, current) + }; + }; + 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 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 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 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 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 domGlobals.window.matchMedia(query).matches; + }; + var platform = Cell(PlatformDetection.detect(domGlobals.navigator.userAgent, mediaMatch)); + var detect$3 = function () { + return platform.get(); + }; + + var ELEMENT$1 = ELEMENT; + var DOCUMENT$1 = DOCUMENT; + var is = function (element, selector) { + var dom = element.dom(); + if (dom.nodeType !== ELEMENT$1) { + 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$1 && dom.nodeType !== DOCUMENT$1 || dom.childElementCount === 0; + }; + var all = function (selector, scope) { + var base = scope === undefined ? domGlobals.document : scope.dom(); + return bypassSelector(base) ? [] : map(base.querySelectorAll(selector), Element.fromDom); + }; + var one = function (selector, scope) { + var base = scope === undefined ? domGlobals.document : scope.dom(); + return bypassSelector(base) ? Option.none() : Option.from(base.querySelector(selector)).map(Element.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 Node.documentPositionContainedBy(e1.dom(), e2.dom()); + }; + var browser = detect$3().browser; + var contains$2 = browser.isIE() ? ieContains : regularContains; + var is$1 = is; + + var owner = function (element) { + return Element.fromDom(element.dom().ownerDocument); + }; + var defaultView = function (element) { + return Element.fromDom(element.dom().ownerDocument.defaultView); + }; + var parent = function (element) { + return Option.from(element.dom().parentNode).map(Element.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 = Element.fromDom(rawParent); + ret.push(p); + if (stop(p) === true) { + break; + } else { + dom = rawParent; + } + } + return ret; + }; + var prevSibling = function (element) { + return Option.from(element.dom().previousSibling).map(Element.fromDom); + }; + var nextSibling = function (element) { + return Option.from(element.dom().nextSibling).map(Element.fromDom); + }; + var children = function (element) { + return map(element.dom().childNodes, Element.fromDom); + }; + var child = function (element, index) { + var cs = element.dom().childNodes; + return Option.from(cs[index]).map(Element.fromDom); + }; + var firstChild = function (element) { + return child(element, 0); + }; + var spot = Immutable('element', 'offset'); + + 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); + }; + + var dimension = Immutable('width', 'height'); + var dimensions = Immutable('width', 'height'); + var grid = Immutable('rows', 'columns'); + var address = Immutable('row', 'column'); + var coords = Immutable('x', 'y'); + var detail = Immutable('element', 'rowspan', 'colspan'); + var detailnew = Immutable('element', 'rowspan', 'colspan', 'isNew'); + var extended = Immutable('element', 'rowspan', 'colspan', 'row', 'column'); + var rowdata = Immutable('element', 'cells', 'section'); + var elementnew = Immutable('element', 'isNew'); + var rowdatanew = Immutable('element', 'cells', 'section', 'isNew'); + var rowcells = Immutable('cells', 'section'); + var rowdetails = Immutable('details', 'section'); + var bounds = Immutable('startRow', 'startCol', 'finishRow', 'finishCol'); + + 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) ? Option.some(scope) : isFunction(isRoot) && isRoot(scope) ? Option.none() : ancestor(scope, a, isRoot); + } + + var ancestor = function (scope, predicate, isRoot) { + var element = scope.dom(); + var stop = isFunction(isRoot) ? isRoot : constant(false); + while (element.parentNode) { + element = element.parentNode; + var el = Element.fromDom(element); + if (predicate(el)) { + return Option.some(el); + } else if (stop(el)) { + break; + } + } + return Option.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(Element.fromDom(node)); + }; + var result = find(scope.dom().childNodes, pred); + return result.map(Element.fromDom); + }; + var descendant = function (scope, predicate) { + var descend = function (node) { + for (var i = 0; i < node.childNodes.length; i++) { + var child_1 = Element.fromDom(node.childNodes[i]); + if (predicate(child_1)) { + return Option.some(child_1); + } + var res = descend(node.childNodes[i]); + if (res.isSome()) { + return res; + } + } + return Option.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) { + return ClosestOrAncestor(is, ancestor$1, scope, selector, isRoot); + }; + + var firstLayer = function (scope, selector) { + return filterFirstLayer(scope, selector, constant(true)); + }; + var filterFirstLayer = function (scope, selector, predicate) { + return bind(children(scope), function (x) { + return is(x, selector) ? predicate(x) ? [x] : [] : filterFirstLayer(x, selector, predicate); + }); + }; + var LayerSelector = { + firstLayer: firstLayer, + filterFirstLayer: filterFirstLayer + }; + + var lookup = function (tags, element, isRoot) { + if (isRoot === void 0) { + isRoot = never; + } + if (isRoot(element)) { + return Option.none(); + } + if (contains(tags, name(element))) { + return Option.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 LayerSelector.firstLayer(ancestor, 'th,td'); + }; + var notCell = function (element, isRoot) { + return lookup([ + 'caption', + 'tr', + 'tbody', + 'tfoot', + 'thead' + ], element, isRoot); + }; + var neighbours = function (selector, element) { + return parent(element).map(function (parent) { + return children$2(parent, selector); + }); + }; + var neighbourCells = curry(neighbours, 'th,td'); + var neighbourRows = curry(neighbours, 'tr'); + var firstCell = function (ancestor) { + return descendant$1(ancestor, 'th,td'); + }; + var table = function (element, isRoot) { + return closest$1(element, 'table', isRoot); + }; + var row = function (element, isRoot) { + return lookup(['tr'], element, isRoot); + }; + var rows = function (ancestor) { + return LayerSelector.firstLayer(ancestor, 'tr'); + }; + var attr = function (element, property) { + return parseInt(get$1(element, property), 10); + }; + var grid$1 = function (element, rowProp, colProp) { + var rowsCount = attr(element, rowProp); + var cols = attr(element, colProp); + return grid(rowsCount, cols); + }; + var TableLookup = { + cell: cell, + firstCell: firstCell, + cells: cells, + neighbourCells: neighbourCells, + table: table, + row: row, + rows: rows, + notCell: notCell, + neighbourRows: neighbourRows, + attr: attr, + grid: grid$1 + }; + + var fromTable = function (table) { + var rows = TableLookup.rows(table); + return map(rows, function (row) { + var element = row; + var parent$1 = parent(element); + var parentSection = parent$1.map(function (p) { + var parentName = name(p); + return parentName === 'tfoot' || parentName === 'thead' || parentName === 'tbody' ? parentName : 'tbody'; + }).getOr('tbody'); + var cells = map(TableLookup.cells(row), function (cell) { + var rowspan = has$1(cell, 'rowspan') ? parseInt(get$1(cell, 'rowspan'), 10) : 1; + var colspan = has$1(cell, 'colspan') ? parseInt(get$1(cell, 'colspan'), 10) : 1; + return detail(cell, rowspan, colspan); + }); + return rowdata(element, cells, parentSection); + }); + }; + var fromPastedRows = function (rows, example) { + return map(rows, function (row) { + var cells = map(TableLookup.cells(row), function (cell) { + var rowspan = has$1(cell, 'rowspan') ? parseInt(get$1(cell, 'rowspan'), 10) : 1; + var colspan = has$1(cell, 'colspan') ? parseInt(get$1(cell, 'colspan'), 10) : 1; + return detail(cell, rowspan, colspan); + }); + return rowdata(row, cells, example.section()); + }); + }; + var DetailsList = { + fromTable: fromTable, + fromPastedRows: fromPastedRows + }; + + var key = function (row, column) { + return row + ',' + column; + }; + var getAt = function (warehouse, row, column) { + var raw = warehouse.access()[key(row, column)]; + return raw !== undefined ? Option.some(raw) : Option.none(); + }; + var findItem = function (warehouse, item, comparator) { + var filtered = filterItems(warehouse, function (detail) { + return comparator(item, detail.element()); + }); + return filtered.length > 0 ? Option.some(filtered[0]) : Option.none(); + }; + var filterItems = function (warehouse, predicate) { + var all = bind(warehouse.all(), function (r) { + return r.cells(); + }); + return filter(all, predicate); + }; + var generate = function (list) { + var access = {}; + var cells = []; + var maxRows = list.length; + var maxColumns = 0; + each(list, function (details, r) { + var currentRow = []; + each(details.cells(), function (detail) { + var start = 0; + while (access[key(r, start)] !== undefined) { + start++; + } + var current = extended(detail.element(), detail.rowspan(), detail.colspan(), r, start); + for (var i = 0; i < detail.colspan(); i++) { + for (var j = 0; j < detail.rowspan(); j++) { + var cr = r + j; + var cc = start + i; + var newpos = key(cr, cc); + access[newpos] = current; + maxColumns = Math.max(maxColumns, cc + 1); + } + } + currentRow.push(current); + }); + cells.push(rowdata(details.element(), currentRow, details.section())); + }); + var grid$1 = grid(maxRows, maxColumns); + return { + grid: constant(grid$1), + access: constant(access), + all: constant(cells) + }; + }; + var justCells = function (warehouse) { + var rows = map(warehouse.all(), function (w) { + return w.cells(); + }); + return flatten(rows); + }; + var Warehouse = { + generate: generate, + getAt: getAt, + findItem: findItem, + filterItems: filterItems, + justCells: justCells + }; + + var statsStruct = Immutable('minRow', 'minCol', 'maxRow', '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 = Element.fromTag('td'); + append(td, Element.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(LayerSelector.firstLayer(table, 'tr'), function (row) { + return row.dom().childElementCount === 0; + }); + each(emptyRows, remove$2); + if (stats.minCol() === stats.maxCol() || stats.minRow() === stats.maxRow()) { + each(LayerSelector.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 = DetailsList.fromTable(table); + var house = Warehouse.generate(list); + var stats = findSelectedStats(house, isSelected); + var selector = 'th:not(' + selectedSelector + ')' + ',td:not(' + selectedSelector + ')'; + var unselectedCells = LayerSelector.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 CopySelected = { extract: extract }; + + 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) ? Option.from(element.dom().nodeValue) : Option.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) { + api.set(element, value); + }; + + var getEnd = function (element) { + return name(element) === 'img' ? 1 : getOption(element).fold(function () { + return children(element).length; + }, function (v) { + return v.length; + }); + }; + var NBSP = '\xA0'; + 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 Option.some(child); + } + var res = descend(child); + if (res.isSome()) { + return res; + } + } + return Option.none(); + }; + return descend(scope); + }; + + var clone$1 = function (original, isDeep) { + return Element.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 = Element.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 = Element.fromTag('td'); + append(td, Element.fromTag('br')); + return td; + }; + 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 Element.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 newCell = function (prev) { + var docu = owner(prev.element()); + var td = Element.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, Element.fromTag('br')); + copy(prev.element(), td); + remove$1(td, 'height'); + if (prev.colspan() !== 1) { + remove$1(prev.element(), 'width'); + } + mutate(prev.element(), td); + return td; + }; + return { + row: newRow(doc), + cell: newCell, + replace: replace, + gap: createCell + }; + }; + var paste = function (doc) { + return { + row: newRow(doc), + cell: createCell, + replace: pasteReplace, + gap: createCell + }; + }; + var TableFill = { + cellOperations: cellOperations, + paste: paste + }; + + var fromHtml$1 = function (html, scope) { + var doc = scope || domGlobals.document; + var div = doc.createElement('div'); + div.innerHTML = html; + return children(Element.fromDom(div)); + }; + + 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 ? Option.some(bounds) : Option.none(); + }; + var CellBounds = { + inSelection: inSelection, + isWithin: isWithin, + isRectangular: isRectangular + }; + + 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 CellBounds.isRectangular(warehouse, bounds); + }); + }; + var CellGroup = { + getAnyBox: getAnyBox, + getBox: getBox + }; + + 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 CellGroup.getAnyBox(warehouse, start, finish).map(function (bounds) { + var inside = Warehouse.filterItems(warehouse, curry(CellBounds.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 CellFinder = { + moveBy: moveBy, + intercepts: intercepts, + parentCell: parentCell + }; + + var moveBy$1 = function (cell, deltaRow, deltaColumn) { + return TableLookup.table(cell).bind(function (table) { + var warehouse = getWarehouse(table); + return CellFinder.moveBy(warehouse, cell, deltaRow, deltaColumn); + }); + }; + var intercepts$1 = function (table, first, last) { + var warehouse = getWarehouse(table); + return CellFinder.intercepts(warehouse, first, last); + }; + var nestedIntercepts = function (table, first, firstTable, last, lastTable) { + var warehouse = getWarehouse(table); + var optStartCell = eq(table, firstTable) ? Option.some(first) : CellFinder.parentCell(warehouse, first); + var optLastCell = eq(table, lastTable) ? Option.some(last) : CellFinder.parentCell(warehouse, last); + return optStartCell.bind(function (startCell) { + return optLastCell.bind(function (lastCell) { + return CellFinder.intercepts(warehouse, startCell, lastCell); + }); + }); + }; + var getBox$1 = function (table, first, last) { + var warehouse = getWarehouse(table); + return CellGroup.getBox(warehouse, first, last); + }; + var getWarehouse = function (table) { + var list = DetailsList.fromTable(table); + return Warehouse.generate(list); + }; + var TablePositions = { + moveBy: moveBy$1, + intercepts: intercepts$1, + nestedIntercepts: nestedIntercepts, + getBox: getBox$1 + }; + + 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 Element.fromDom(element.dom().cloneNode(false)); + }; + var document = function (element) { + return element.dom().ownerDocument; + }; + 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 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: Element.fromTag, + clone: clone$1, + text: Element.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 + }), + eq: eq, + is: is$1 + }; + } + + var leftRight = Immutable('left', 'right'); + var brokenPath = Immutable('first', 'second', 'splits'); + var bisect = function (universe, parent, child) { + var children = universe.property().children(parent); + var index = findIndex(children, curry(universe.eq, child)); + return index.map(function (ind) { + return { + before: constant(children.slice(0, ind)), + after: constant(children.slice(ind + 1)) + }; + }); + }; + var breakToRight = function (universe, parent, child) { + return bisect(universe, parent, child).map(function (parts) { + var second = universe.create().clone(parent); + universe.insert().appendAll(second, parts.after()); + universe.insert().after(parent, second); + return leftRight(parent, second); + }); + }; + var breakToLeft = function (universe, parent, child) { + return bisect(universe, parent, child).map(function (parts) { + var prior = universe.create().clone(parent); + universe.insert().appendAll(prior, parts.before().concat([child])); + universe.insert().appendAll(parent, parts.after()); + universe.insert().before(parent, prior); + return leftRight(prior, parent); + }); + }; + var breakPath = function (universe, item, isTop, breaker) { + var next = function (child, group, splits) { + var fallback = brokenPath(child, Option.none(), splits); + if (isTop(child)) { + return brokenPath(child, group, splits); + } else { + return universe.property().parent(child).bind(function (parent) { + return breaker(universe, parent, child).map(function (breakage) { + var extra = [{ + first: breakage.left, + second: breakage.right + }]; + var nextChild = isTop(parent) ? parent : breakage.left(); + return next(nextChild, Option.some(breakage.right()), splits.concat(extra)); + }); + }).getOr(fallback); + } + }; + return next(item, Option.none(), []); + }; + + 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) : Option.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 unsafeSubset = function (universe, common, ps1, ps2) { + var children = universe.property().children(common); + if (universe.eq(common, ps1[0])) { + return Option.some([ps1[0]]); + } + if (universe.eq(common, ps2[0])) { + return Option.some([ps2[0]]); + } + var finder = function (ps) { + var topDown = reverse(ps); + var index = findIndex(topDown, eq$1(universe, common)).getOr(-1); + var item = index < topDown.length - 1 ? topDown[index + 1] : topDown[index]; + return findIndex(children, eq$1(universe, item)); + }; + var startIndex = finder(ps1); + var endIndex = finder(ps2); + return startIndex.bind(function (sIndex) { + return endIndex.map(function (eIndex) { + var first = Math.min(sIndex, eIndex); + var last = Math.max(sIndex, eIndex); + return children.slice(first, last + 1); + }); + }); + }; + 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: constant(pruned1), + secondpath: constant(pruned2), + shared: constant(shared) + }; + }; + var subset = function (universe, start, end) { + var ancs = ancestors$2(universe, start, end); + return ancs.shared().bind(function (shared) { + return unsafeSubset(universe, shared, ancs.firstpath(), ancs.secondpath()); + }); + }; + var SubsetFn = { + subset: subset, + ancestors: ancestors$2 + }; + + var sharedOne = oneAll; + var subset$1 = SubsetFn.subset; + var ancestors$3 = SubsetFn.ancestors; + var breakToLeft$1 = breakToLeft; + var breakToRight$1 = breakToRight; + var breakPath$1 = breakPath; + var Parent = { + sharedOne: sharedOne, + subset: subset$1, + ancestors: ancestors$3, + breakToLeft: breakToLeft$1, + breakToRight: breakToRight$1, + breakPath: breakPath$1 + }; + + var universe = DomUniverse(); + var sharedOne$1 = function (look, elements) { + return Parent.sharedOne(universe, function (_universe, element) { + return look(element); + }, elements); + }; + var subset$2 = function (start, finish) { + return Parent.subset(universe, start, finish); + }; + var ancestors$4 = function (start, finish, isRoot) { + return Parent.ancestors(universe, start, finish, isRoot); + }; + var breakToLeft$2 = function (parent, child) { + return Parent.breakToLeft(universe, parent, child); + }; + var breakToRight$2 = function (parent, child) { + return Parent.breakToRight(universe, parent, child); + }; + var breakPath$2 = function (child, isTop, breaker) { + return Parent.breakPath(universe, child, isTop, function (u, p, c) { + return breaker(p, c); + }); + }; + var DomParent = { + sharedOne: sharedOne$1, + subset: subset$2, + ancestors: ancestors$4, + breakToLeft: breakToLeft$2, + breakToRight: breakToRight$2, + breakPath: breakPath$2 + }; + + var create = MixedBag([ + 'boxes', + 'start', + 'finish' + ], []); + var Identified = { create: create }; + + 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 Option.some(Identified.create({ + boxes: Option.some([start]), + start: start, + finish: finish + })); + } else { + return lookupTable(start).bind(function (startTable) { + return lookupTable(finish).bind(function (finishTable) { + if (eq(startTable, finishTable)) { + return Option.some(Identified.create({ + boxes: TablePositions.intercepts(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 Option.some(Identified.create({ + boxes: TablePositions.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 Option.some(Identified.create({ + boxes: TablePositions.nestedIntercepts(finishTable, start, startTable, finish, finishTable), + start: start, + finish: startCell + })); + } else { + return DomParent.ancestors(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 Option.some(Identified.create({ + boxes: TablePositions.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 ? Option.some(sels) : Option.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 DomParent.sharedOne(lookupTable, [ + first, + last + ]).map(function (tbl) { + return { + first: constant(first), + last: constant(last), + table: constant(tbl) + }; + }); + }); + }); + }; + 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: constant(boxes), + start: constant(identified.start()), + finish: constant(identified.finish()) + }; + }); + }); + }); + }); + }; + var shiftSelection = function (boxes, deltaRow, deltaColumn, firstSelectedSelector, lastSelectedSelector) { + return getLast(boxes, lastSelectedSelector).bind(function (last) { + return TablePositions.moveBy(last, deltaRow, deltaColumn).bind(function (finish) { + return expandTo(finish, firstSelectedSelector); + }); + }); + }; + var CellSelection = { + identify: identify, + retrieve: retrieve, + shiftSelection: shiftSelection, + getEdges: getEdges + }; + + var retrieve$1 = function (container, selector) { + return CellSelection.retrieve(container, selector); + }; + var retrieveBox = function (container, firstSelectedSelector, lastSelectedSelector) { + return CellSelection.getEdges(container, firstSelectedSelector, lastSelectedSelector).bind(function (edges) { + var isRoot = function (ancestor) { + return eq(container, ancestor); + }; + var firstAncestor = ancestor$1(edges.first(), 'thead,tfoot,tbody,table', isRoot); + var lastAncestor = ancestor$1(edges.last(), 'thead,tfoot,tbody,table', isRoot); + return firstAncestor.bind(function (fA) { + return lastAncestor.bind(function (lA) { + return eq(fA, lA) ? TablePositions.getBox(edges.table(), edges.first(), edges.last()) : Option.none(); + }); + }); + }); + }; + var TableSelection = { + retrieve: retrieve$1, + retrieveBox: retrieveBox + }; + + var selected = 'data-mce-selected'; + var selectedSelector = 'td[' + selected + '],th[' + selected + ']'; + var attributeSelector = '[' + selected + ']'; + var firstSelected = 'data-mce-first-selected'; + var firstSelectedSelector = 'td[' + firstSelected + '],th[' + firstSelected + ']'; + var lastSelected = 'data-mce-last-selected'; + var lastSelectedSelector = 'td[' + lastSelected + '],th[' + lastSelected + ']'; + var Ephemera = { + selected: constant(selected), + selectedSelector: constant(selectedSelector), + attributeSelector: constant(attributeSelector), + firstSelected: constant(firstSelected), + firstSelectedSelector: constant(firstSelectedSelector), + lastSelected: constant(lastSelected), + lastSelectedSelector: constant(lastSelectedSelector) + }; + + 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) { + domGlobals.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: ['selection'] } + ]); + var cata = function (subject, onNone, onMultiple, onSingle) { + return subject.fold(onNone, onMultiple, onSingle); + }; + var SelectionTypes = { + cata: cata, + none: type$1.none, + multiple: type$1.multiple, + single: type$1.single + }; + + var selection = function (cell, selections) { + return SelectionTypes.cata(selections.get(), constant([]), identity, constant([cell])); + }; + var unmergable = function (cell, selections) { + var hasSpan = function (elem) { + return has$1(elem, 'rowspan') && parseInt(get$1(elem, 'rowspan'), 10) > 1 || has$1(elem, 'colspan') && parseInt(get$1(elem, 'colspan'), 10) > 1; + }; + var candidates = selection(cell, selections); + return candidates.length > 0 && forall(candidates, hasSpan) ? Option.some(candidates) : Option.none(); + }; + var mergable = function (table, selections) { + return SelectionTypes.cata(selections.get(), Option.none, function (cells, _env) { + if (cells.length === 0) { + return Option.none(); + } + return TableSelection.retrieveBox(table, Ephemera.firstSelectedSelector(), Ephemera.lastSelectedSelector()).bind(function (bounds) { + return cells.length > 1 ? Option.some({ + bounds: constant(bounds), + cells: constant(cells) + }) : Option.none(); + }); + }, Option.none); + }; + var CellOperations = { + mergable: mergable, + unmergable: unmergable, + selection: selection + }; + + var noMenu = function (cell) { + return { + element: constant(cell), + mergable: Option.none, + unmergable: Option.none, + selection: constant([cell]) + }; + }; + var forMenu = function (selections, table, cell) { + return { + element: constant(cell), + mergable: constant(CellOperations.mergable(table, selections)), + unmergable: constant(CellOperations.unmergable(cell, selections)), + selection: constant(CellOperations.selection(cell, selections)) + }; + }; + var notCell$1 = function (element) { + return noMenu(element); + }; + var paste$1 = Immutable('element', 'clipboard', 'generators'); + var pasteRows = function (selections, table, cell, clipboard, generators) { + return { + element: constant(cell), + mergable: Option.none, + unmergable: Option.none, + selection: constant(CellOperations.selection(cell, selections)), + clipboard: constant(clipboard), + generators: constant(generators) + }; + }; + var TableTargets = { + noMenu: noMenu, + forMenu: forMenu, + notCell: notCell$1, + paste: paste$1, + pasteRows: pasteRows + }; + + var extractSelected = function (cells) { + return TableLookup.table(cells[0]).map(deep).map(function (replica) { + return [CopySelected.extract(replica, Ephemera.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) { + SelectionTypes.cata(selections.get(), noop, multiCellContext, noop); + } + }); + editor.on('BeforeSetContent', function (e) { + if (e.selection === true && e.paste === true) { + var cellOpt = Option.from(editor.dom.getParent(editor.selection.getStart(), 'th,td')); + cellOpt.each(function (domCell) { + var cell = Element.fromDom(domCell); + TableLookup.table(cell).each(function (table) { + var elements = filter(fromHtml$1(e.content), function (content) { + return name(content) !== 'meta'; + }); + if (elements.length === 1 && name(elements[0]) === 'table') { + e.preventDefault(); + var doc = Element.fromDom(editor.getDoc()); + var generators = TableFill.paste(doc); + var targets = TableTargets.paste(cell, elements[0], generators); + actions.pasteCells(table, targets).each(function (rng) { + editor.selection.setRng(rng); + editor.focus(); + cellSelection.clear(table); + }); + } + }); + }); + } + }); + }; + var Clipboard = { registerEvents: registerEvents }; + + 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(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 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 platform$1 = detect$3(); + var needManualCalc = function () { + return platform$1.browser.isIE() || platform$1.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 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 height = cell.dom().getBoundingClientRect().height; + var boxSizing = get$2(cell, 'box-sizing'); + var borders = borderTop + borderBottom; + return boxSizing === 'border-box' ? height : height - paddingTop - paddingBottom - borders; + }; + var getWidth = function (cell) { + return getProp(cell, 'width', get$5(cell)); + }; + var getHeight = function (cell) { + return needManualCalc() ? getCalculatedHeight(cell) : getProp(cell, 'height', get$4(cell)); + }; + var RuntimeSize = { + getWidth: getWidth, + getHeight: getHeight + }; + + var genericSizeRegex = /(\d+(\.\d+)?)(\w|%)*/; + var percentageBasedSizeRegex = /(\d+(\.\d+)?)%/; + var pixelBasedSizeRegex = /(\d+(\.\d+)?)px|em/; + 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 RuntimeSize.getHeight(cell) + 'px'; + }); + }; + var convert = function (cell, number, getter, setter) { + var newSize = TableLookup.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 getSpan = function (cell, type) { + return has$1(cell, type) ? parseInt(get$1(cell, type), 10) : 1; + }; + var getRawWidth = function (element) { + var cssWidth = getRaw(element, 'width'); + return cssWidth.fold(function () { + return Option.from(get$1(element, 'width')); + }, function (width) { + return Option.some(width); + }); + }; + var normalizePercentageWidth = function (cellWidth, tableSize) { + return cellWidth / tableSize.pixelWidth() * 100; + }; + var choosePercentageSize = function (element, width, tableSize) { + var percentMatch = percentageBasedSizeRegex.exec(width); + if (percentMatch !== null) { + return parseFloat(percentMatch[1]); + } else { + var intWidth = get$5(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 = pixelBasedSizeRegex.exec(width); + if (pixelMatch !== null) { + return parseInt(pixelMatch[1], 10); + } + var percentMatch = percentageBasedSizeRegex.exec(width); + if (percentMatch !== null) { + var floatWidth = parseFloat(percentMatch[1]); + return normalizePixelWidth(floatWidth, tableSize); + } + return get$5(element); + }; + var getPixelWidth = function (cell, tableSize) { + var width = getRawWidth(cell); + return width.fold(function () { + return get$5(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) { + var match = genericSizeRegex.exec(w); + if (match !== null) { + return Option.some({ + width: constant(parseFloat(match[1])), + unit: constant(match[3]) + }); + } else { + return Option.none(); + } + }); + }; + var setGenericWidth = function (cell, amount, unit) { + set$1(cell, 'width', amount + unit); + }; + var Sizes = { + percentageBasedSizeRegex: constant(percentageBasedSizeRegex), + pixelBasedSizeRegex: constant(pixelBasedSizeRegex), + setPixelWidth: setPixelWidth, + setPercentageWidth: setPercentageWidth, + setHeight: setHeight, + getPixelWidth: getPixelWidth, + getPercentageWidth: getPercentageWidth, + getGenericWidth: getGenericWidth, + setGenericWidth: setGenericWidth, + getHeight: getHeight$1, + getRawWidth: getRawWidth + }; + + var halve = function (main, other) { + var width = Sizes.getGenericWidth(main); + width.each(function (w) { + var newWidth = w.width() / 2; + Sizes.setGenericWidth(main, newWidth, w.unit()); + Sizes.setGenericWidth(other, newWidth, w.unit()); + }); + }; + var CellMutations = { halve: halve }; + + var r = function (left, top) { + var translate = function (x, y) { + return r(left + x, top + y); + }; + return { + left: constant(left), + top: constant(top), + translate: translate + }; + }; + var Position = r; + + var boxPosition = function (dom) { + var box = dom.getBoundingClientRect(); + return Position(box.left, box.top); + }; + var firstDefinedOrZero = function (a, b) { + return a !== undefined ? a : 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 Position(body.offsetLeft, body.offsetTop); + } + var scrollTop = firstDefinedOrZero(win.pageYOffset, html.scrollTop); + var scrollLeft = firstDefinedOrZero(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 Position(body.offsetLeft, body.offsetTop); + } + if (!inBody(element)) { + return Position(0, 0); + } + return boxPosition(dom); + }; + + var rowInfo = Immutable('row', 'y'); + var colInfo = Immutable('col', '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 BarPositions = { + height: height, + rtl: rtl, + ltr: ltr + }; + + var ResizeDirection = { + ltr: BarPositions.ltr, + rtl: BarPositions.rtl + }; + + function TableDirection (directionAt) { + var auto = function (table) { + return directionAt(table).isRtl() ? ResizeDirection.rtl : ResizeDirection.ltr; + }; + var delta = function (amount, table) { + return auto(table).delta(amount, table); + }; + var positions = function (cols, table) { + return auto(table).positions(cols, table); + }; + var edge = function (cell) { + return auto(cell).edge(cell); + }; + return { + delta: delta, + edge: edge, + positions: positions + }; + } + + var getGridSize = function (table) { + var input = DetailsList.fromTable(table); + var warehouse = Warehouse.generate(input); + return warehouse.grid(); + }; + var TableGridSize = { getGridSize: getGridSize }; + + 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 findMap = function (arr, f) { + for (var i = 0; i < arr.length; i++) { + var r = f(arr[i], i); + if (r.isSome()) { + return r; + } + } + return Option.none(); + }; + + var setIfNot = function (element, property, value, ignore) { + if (value === ignore) { + remove(element, property); + } else { + set(element, property, value); + } + }; + var render = function (table, grid) { + var newRows = []; + var newCells = []; + var renderSection = function (gridSection, sectionName) { + var section = child$2(table, sectionName).getOrThunk(function () { + var tb = Element.fromTag(sectionName, owner(table).dom()); + append(table, tb); + return tb; + }); + empty(section); + var rows = 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; + }); + append$1(section, rows); + }; + 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 = []; + 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; + } + }); + renderOrRemoveSection(headSection, 'thead'); + renderOrRemoveSection(bodySection, 'tbody'); + renderOrRemoveSection(footSection, 'tfoot'); + return { + newRows: constant(newRows), + newCells: constant(newCells) + }; + }; + var copy$2 = function (grid) { + var rows = 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; + }); + return rows; + }; + var Redraw = { + render: render, + copy: copy$2 + }; + + var read = function (element, attr) { + var value = get$1(element, attr); + return value === undefined || value === '' ? [] : value.split(' '); + }; + var add = 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$1 = function (element, clazz) { + return add(element, 'class', clazz); + }; + var remove$4 = function (element, clazz) { + return remove$3(element, 'class', clazz); + }; + + var add$2 = function (element, clazz) { + if (supports(element)) { + element.dom().classList.add(clazz); + } else { + add$1(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$2 = function (element, clazz) { + return supports(element) && element.dom().classList.contains(clazz); + }; + + var repeat = function (repititions, f) { + var r = []; + for (var i = 0; i < repititions; i++) { + r.push(f(i)); + } + return r; + }; + var range = function (start, end) { + var r = []; + for (var i = start; i < end; i++) { + r.push(i); + } + return r; + }; + var deduce = function (xs, index) { + if (index < 0 || index >= xs.length - 1) { + return Option.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 Option.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 Option.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 columns = function (warehouse) { + var grid = warehouse.grid(); + var cols = range(0, grid.columns()); + var rowsArr = range(0, grid.rows()); + 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; + }).fold(constant([]), function (detail) { + return [detail]; + }); + }); + }; + 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 Option.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(0, grid.rows()); + var cols = range(0, grid.columns()); + 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 Blocks = { + columns: columns, + rows: rows$1 + }; + + var css = function (namespace) { + var dashNamespace = namespace.replace(/\./g, '-'); + var resolve = function (str) { + return dashNamespace + '-' + str; + }; + return { resolve: resolve }; + }; + + var styles = css('ephox-snooker'); + var Styles = { resolve: styles.resolve }; + + var col = function (column, x, y, w, h) { + var blocker = Element.fromTag('div'); + setAll$1(blocker, { + position: 'absolute', + left: x - w / 2 + 'px', + top: y + 'px', + height: h + 'px', + width: w + 'px' + }); + setAll(blocker, { + 'data-column': column, + 'role': 'presentation' + }); + return blocker; + }; + var row$1 = function (r, x, y, w, h) { + var blocker = Element.fromTag('div'); + setAll$1(blocker, { + position: 'absolute', + left: x + 'px', + top: y - h / 2 + 'px', + height: h + 'px', + width: w + 'px' + }); + setAll(blocker, { + 'data-row': r, + 'role': 'presentation' + }); + return blocker; + }; + var Bar = { + col: col, + row: row$1 + }; + + var resizeBar = Styles.resolve('resizer-bar'); + var resizeRowBar = Styles.resolve('resizer-rows'); + var resizeColBar = Styles.resolve('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, i) { + cpOption.each(function (cp) { + var bar = create(origin, cp); + add$2(bar, resizeBar); + append(wire.parent(), bar); + }); + }); + }; + var refreshCol = function (wire, colPositions, position, tableHeight) { + drawBar(wire, colPositions, function (origin, cp) { + var colBar = Bar.col(cp.col(), cp.x() - origin.left(), position.top() - origin.top(), BAR_THICKNESS, tableHeight); + add$2(colBar, resizeColBar); + return colBar; + }); + }; + var refreshRow = function (wire, rowPositions, position, tableWidth) { + drawBar(wire, rowPositions, function (origin, cp) { + var rowBar = Bar.row(cp.row(), position.left() - origin.left(), cp.y() - origin.top(), tableWidth, BAR_THICKNESS); + add$2(rowBar, resizeRowBar); + return rowBar; + }); + }; + var refreshGrid = function (wire, table, rows, cols, hdirection, vdirection) { + var position = absolute(table); + var rowPositions = rows.length > 0 ? hdirection.positions(rows, table) : []; + refreshRow(wire, rowPositions, position, getOuter$1(table)); + var colPositions = cols.length > 0 ? vdirection.positions(cols, table) : []; + refreshCol(wire, colPositions, position, getOuter(table)); + }; + var refresh = function (wire, table, hdirection, vdirection) { + destroy(wire); + var list = DetailsList.fromTable(table); + var warehouse = Warehouse.generate(list); + var rows = Blocks.rows(warehouse); + var cols = Blocks.columns(warehouse); + refreshGrid(wire, table, rows, cols, hdirection, vdirection); + }; + 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$2(element, resizeRowBar); + }; + var isColBar = function (element) { + return has$2(element, resizeColBar); + }; + var Bars = { + refresh: refresh, + hide: hide, + show: show, + destroy: destroy, + isRowBar: isRowBar, + isColBar: isColBar + }; + + 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 GridRow = { + addCell: addCell, + setCells: setCells, + mutateCell: mutateCell, + getCell: getCell, + getCellElement: getCellElement, + mapCells: mapCells, + cellLength: cellLength + }; + + var getColumn = function (grid, index) { + return map(grid, function (row) { + return GridRow.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: constant(endColIndex), + rowspan: constant(endRowIndex) + }; + }; + var TableGrid = { subgrid: subgrid }; + + var toDetails = function (grid, comparator) { + var seen = map(grid, function (row, ri) { + return map(row.cells(), function (col, ci) { + return false; + }); + }); + var updateSeen = function (ri, ci, rowspan, colspan) { + for (var r = ri; r < ri + rowspan; r++) { + for (var c = ci; c < ci + colspan; c++) { + seen[r][c] = true; + } + } + }; + return map(grid, function (row, ri) { + var details = bind(row.cells(), function (cell, ci) { + if (seen[ri][ci] === false) { + var result = TableGrid.subgrid(grid, ri, ci, comparator); + updateSeen(ri, ci, 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 = []; + for (var i = 0; i < warehouse.grid().rows(); i++) { + var rowCells = []; + for (var j = 0; j < warehouse.grid().columns(); j++) { + var element = Warehouse.getAt(warehouse, i, j).map(function (item) { + return elementnew(item.element(), isNew); + }).getOrThunk(function () { + return elementnew(generators.gap(), true); + }); + rowCells.push(element); + } + var row = rowcells(rowCells, warehouse.all()[i].section()); + grid.push(row); + } + return grid; + }; + var Transitions = { + toDetails: toDetails, + toGrid: toGrid + }; + + var fromWarehouse = function (warehouse, generators) { + return Transitions.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 = Transitions.toDetails(grid, eq); + return deriveRows(rendered, generators); + }; + var findInWarehouse = function (warehouse, element) { + var all = flatten(map(warehouse.all(), function (r) { + return r.cells(); + })); + return find(all, function (e) { + return eq(element, e.element()); + }); + }; + var run = function (operation, extract, adjustment, postAction, genWrappers) { + return function (wire, table, target, generators, direction) { + var input = DetailsList.fromTable(table); + var warehouse = Warehouse.generate(input); + 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: constant(grid), + cursor: result.cursor + }; + }); + return output.fold(function () { + return Option.none(); + }, function (out) { + var newElements = Redraw.render(table, out.grid()); + adjustment(table, out.grid(), direction); + postAction(table); + Bars.refresh(wire, table, BarPositions.height, direction); + return Option.some({ + cursor: out.cursor, + newRows: newElements.newRows, + newCells: newElements.newCells + }); + }); + }; + }; + var onCell = function (warehouse, target) { + return TableLookup.cell(target.element()).bind(function (cell) { + return findInWarehouse(warehouse, cell); + }); + }; + var onPaste = function (warehouse, target) { + return TableLookup.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 onPasteRows = function (warehouse, target) { + var details = map(target.selection(), function (cell) { + return TableLookup.cell(cell).bind(function (lc) { + return findInWarehouse(warehouse, lc); + }); + }); + var cells = cat(details); + return cells.length > 0 ? Option.some({ + cells: cells, + generators: target.generators, + clipboard: target.clipboard + }) : Option.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) { + return TableLookup.cell(cell).bind(function (lc) { + return findInWarehouse(warehouse, lc); + }); + }); + var cells = cat(details); + return cells.length > 0 ? Option.some(cells) : Option.none(); + }; + + 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 toOption = function () { + return Option.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, + toOption: toOption + }; + }; + 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, + toOption: Option.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() > GridRow.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 = GridRow.cellLength(gridB[0]); + var rowRequired = gridB.length; + return Result.value({ + rowDelta: constant(rowRemainder.length - rowRequired), + colDelta: constant(colRemainder.length - colRequired) + }); + }; + var measureWidth = function (gridA, gridB) { + var colLengthA = GridRow.cellLength(gridA[0]); + var colLengthB = GridRow.cellLength(gridB[0]); + return { + rowDelta: constant(0), + colDelta: constant(colLengthA - colLengthB) + }; + }; + var fill = function (cells, generator) { + return map(cells, function () { + return elementnew(generator.cell(), true); + }); + }; + var rowFill = function (grid, amount, generator) { + return grid.concat(repeat(amount, function (_row) { + return GridRow.setCells(grid[grid.length - 1], fill(grid[grid.length - 1].cells(), generator)); + })); + }; + var colFill = function (grid, amount, generator) { + return map(grid, function (row) { + return GridRow.setCells(row, row.cells().concat(fill(range(0, amount), generator))); + }); + }; + var tailor = function (gridA, delta, generator) { + var fillCols = delta.colDelta() < 0 ? colFill : identity; + var fillRows = delta.rowDelta() < 0 ? rowFill : identity; + var modifiedCols = fillCols(gridA, Math.abs(delta.colDelta()), generator); + var tailoredGrid = fillRows(modifiedCols, Math.abs(delta.rowDelta()), generator); + return tailoredGrid; + }; + var Fitment = { + measure: measure, + measureWidth: measureWidth, + tailor: tailor + }; + + var merge = function (grid, bounds, comparator, substitution) { + if (grid.length === 0) { + return grid; + } + for (var i = bounds.startRow(); i <= bounds.finishRow(); i++) { + for (var j = bounds.startCol(); j <= bounds.finishCol(); j++) { + GridRow.mutateCell(grid[i], j, elementnew(substitution(), false)); + } + } + return grid; + }; + var unmerge = function (grid, target, comparator, substitution) { + var first = true; + for (var i = 0; i < grid.length; i++) { + for (var j = 0; j < GridRow.cellLength(grid[0]); j++) { + var current = GridRow.getCellElement(grid[i], j); + var isToReplace = comparator(current, target); + if (isToReplace === true && first === false) { + GridRow.mutateCell(grid[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 splitRows = function (grid, index, comparator, substitution) { + if (index > 0 && index < grid.length) { + var rowPrevCells = grid[index - 1].cells(); + var cells = uniqueCells(rowPrevCells, comparator); + each(cells, function (cell) { + var replacement = Option.none(); + var _loop_1 = function (i) { + var _loop_2 = function (j) { + var current = grid[i].cells()[j]; + var isToReplace = comparator(current.element(), cell.element()); + if (isToReplace) { + if (replacement.isNone()) { + replacement = Option.some(substitution()); + } + replacement.each(function (sub) { + GridRow.mutateCell(grid[i], j, elementnew(sub, true)); + }); + } + }; + for (var j = 0; j < GridRow.cellLength(grid[0]); j++) { + _loop_2(j); + } + }; + for (var i = index; i < grid.length; i++) { + _loop_1(i); + } + }); + } + return grid; + }; + var MergingOperations = { + merge: merge, + unmerge: unmerge, + splitRows: splitRows + }; + + var isSpanning = function (grid, row, col, comparator) { + var candidate = GridRow.getCell(grid[row], col); + var matching = curry(comparator, candidate.element()); + var currentRow = grid[row]; + return grid.length > 1 && GridRow.cellLength(currentRow) > 1 && (col > 0 && matching(GridRow.getCellElement(currentRow, col - 1)) || col < currentRow.cells().length - 1 && matching(GridRow.getCellElement(currentRow, col + 1)) || row > 0 && matching(GridRow.getCellElement(grid[row - 1], col)) || row < grid.length - 1 && matching(GridRow.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 = GridRow.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)) { + MergingOperations.unmerge(gridA, GridRow.getCellElement(gridA[r], c), comparator, generator.cell); + } + var newCell = GridRow.getCellElement(gridB[r - startRow], c - startCol); + var replacement = generator.replace(newCell); + GridRow.mutateCell(gridA[r], c, elementnew(replacement, true)); + } + } + return gridA; + }; + var merge$1 = function (startAddress, gridA, gridB, generator, comparator) { + var result = Fitment.measure(startAddress, gridA, gridB); + return result.map(function (delta) { + var fittedGrid = Fitment.tailor(gridA, delta, generator); + return mergeTables(startAddress, fittedGrid, gridB, generator, comparator); + }); + }; + var insert = function (index, gridA, gridB, generator, comparator) { + MergingOperations.splitRows(gridA, index, comparator, generator.cell); + var delta = Fitment.measureWidth(gridB, gridA); + var fittedNewGrid = Fitment.tailor(gridB, delta, generator); + var secondDelta = Fitment.measureWidth(gridA, fittedNewGrid); + var fittedOldGrid = Fitment.tailor(gridA, secondDelta, generator); + return fittedOldGrid.slice(0, index).concat(fittedNewGrid).concat(fittedOldGrid.slice(index, fittedOldGrid.length)); + }; + var TableMerge = { + merge: merge$1, + insert: insert + }; + + var insertRowAt = function (grid, index, example, comparator, substitution) { + var before = grid.slice(0, index); + var after = grid.slice(index); + var between = GridRow.mapCells(grid[example], function (ex, c) { + var withinSpan = index > 0 && index < grid.length && comparator(GridRow.getCellElement(grid[index - 1], c), GridRow.getCellElement(grid[index], c)); + var ret = withinSpan ? GridRow.getCell(grid[index], c) : elementnew(substitution(ex.element(), comparator), true); + return ret; + }); + return before.concat([between]).concat(after); + }; + var insertColumnAt = function (grid, index, example, comparator, substitution) { + return map(grid, function (row) { + var withinSpan = index > 0 && index < GridRow.cellLength(row) && comparator(GridRow.getCellElement(row, index - 1), GridRow.getCellElement(row, index)); + var sub = withinSpan ? GridRow.getCell(row, index) : elementnew(substitution(GridRow.getCellElement(row, example), comparator), true); + return GridRow.addCell(row, index, sub); + }); + }; + var splitCellIntoColumns = function (grid, exampleRow, exampleCol, comparator, substitution) { + var index = exampleCol + 1; + return map(grid, function (row, i) { + var isTargetCell = i === exampleRow; + var sub = isTargetCell ? elementnew(substitution(GridRow.getCellElement(row, exampleCol), comparator), true) : GridRow.getCell(row, exampleCol); + return GridRow.addCell(row, index, sub); + }); + }; + var splitCellIntoRows = function (grid, exampleRow, exampleCol, comparator, substitution) { + var index = exampleRow + 1; + var before = grid.slice(0, index); + var after = grid.slice(index); + var between = GridRow.mapCells(grid[exampleRow], function (ex, i) { + var isTargetCell = i === exampleCol; + return isTargetCell ? elementnew(substitution(ex.element(), comparator), true) : ex; + }); + return before.concat([between]).concat(after); + }; + 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) { + return grid.slice(0, start).concat(grid.slice(finish + 1)); + }; + var ModificationOperations = { + insertRowAt: insertRowAt, + insertColumnAt: insertColumnAt, + splitCellIntoColumns: splitCellIntoColumns, + splitCellIntoRows: splitCellIntoRows, + deleteRowsAt: deleteRowsAt, + deleteColumnsAt: deleteColumnsAt + }; + + 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 GridRow.mapCells(row, function (cell) { + return isTarget(cell) ? elementnew(substitution(cell.element(), comparator), true) : cell; + }); + }); + }; + var notStartRow = function (grid, rowIndex, colIndex, comparator) { + return GridRow.getCellElement(grid[rowIndex], colIndex) !== undefined && (rowIndex > 0 && comparator(GridRow.getCellElement(grid[rowIndex - 1], colIndex), GridRow.getCellElement(grid[rowIndex], colIndex))); + }; + var notStartColumn = function (row, index, comparator) { + return index > 0 && comparator(GridRow.getCellElement(row, index - 1), GridRow.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 ? [] : [GridRow.getCell(row, index)]; + }); + return replaceIn(grid, targets, comparator, substitution); + }; + var replaceRow = function (grid, index, comparator, substitution) { + var targetRow = grid[index]; + var targets = bind(targetRow.cells(), function (item, i) { + var alreadyAdded = notStartRow(grid, index, i, comparator) || notStartColumn(targetRow, i, comparator); + return alreadyAdded ? [] : [item]; + }); + return replaceIn(grid, targets, comparator, substitution); + }; + var TransformOperations = { + replaceColumn: replaceColumn, + replaceRow: replaceRow + }; + + var adt = Adt.generate([ + { none: [] }, + { only: ['index'] }, + { + left: [ + 'index', + 'next' + ] + }, + { + middle: [ + 'prev', + 'index', + 'next' + ] + }, + { + right: [ + 'prev', + 'index' + ] + } + ]); + var ColumnContext = __assign({}, adt); + + var neighbours$1 = 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) { + var result = input.slice(0); + var context = neighbours$1(input, column); + var zero = function (array) { + return map(array, constant(0)); + }; + var onNone = constant(zero(result)); + var onOnly = function (index) { + return tableSize.singleColumnWidth(result[index], step); + }; + var onChange = function (index, next) { + if (step >= 0) { + var newNext = Math.max(tableSize.minCellWidth(), result[next] - step); + return zero(result.slice(0, index)).concat([ + step, + newNext - result[next] + ]).concat(zero(result.slice(next + 1))); + } else { + var newThis = Math.max(tableSize.minCellWidth(), result[index] + step); + var diffx = result[index] - newThis; + return zero(result.slice(0, index)).concat([ + newThis - result[index], + diffx + ]).concat(zero(result.slice(next + 1))); + } + }; + var onLeft = onChange; + var onMiddle = function (_prev, index, next) { + return onChange(index, next); + }; + var onRight = function (_prev, index) { + if (step >= 0) { + return zero(result.slice(0, index)).concat([step]); + } else { + var size = Math.max(tableSize.minCellWidth(), result[index] + step); + return zero(result.slice(0, index)).concat([size - result[index]]); + } + }; + return context.fold(onNone, onOnly, onLeft, onMiddle, onRight); + }; + var Deltas = { determine: determine }; + + var getSpan$1 = function (cell, type) { + return has$1(cell, type) && parseInt(get$1(cell, type), 10) > 1; + }; + var hasColspan = function (cell) { + return getSpan$1(cell, 'colspan'); + }; + var hasRowspan = function (cell) { + return getSpan$1(cell, 'rowspan'); + }; + var getInt = function (element, property) { + return parseInt(get$2(element, property), 10); + }; + var CellUtils = { + hasColspan: hasColspan, + hasRowspan: hasRowspan, + minWidth: constant(10), + minHeight: constant(10), + getInt: getInt + }; + + 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 Sizes.getPixelWidth(e, tableSize); + }); + }; + var getRawH = function (cell) { + return getRaw$1(cell, 'height', Sizes.getHeight); + }; + var getWidthFrom = function (warehouse, direction, getWidth, fallback, tableSize) { + var columns = Blocks.columns(warehouse); + var backups = map(columns, function (cellOption) { + return cellOption.map(direction.edge); + }); + return map(columns, function (cellOption, c) { + var columnCell = cellOption.filter(not(CellUtils.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, direction, tableSize) { + return getWidthFrom(warehouse, direction, getRawW, getDeduced, tableSize); + }; + var getPercentageWidths = function (warehouse, direction, tableSize) { + return getWidthFrom(warehouse, direction, Sizes.getPercentageWidth, function (deduced) { + return deduced.fold(function () { + return tableSize.minCellWidth(); + }, function (cellWidth) { + return cellWidth / tableSize.pixelWidth() * 100; + }); + }, tableSize); + }; + var getPixelWidths = function (warehouse, direction, tableSize) { + return getWidthFrom(warehouse, direction, Sizes.getPixelWidth, function (deduced) { + return deduced.getOrThunk(tableSize.minCellWidth); + }, tableSize); + }; + var getHeightFrom = function (warehouse, direction, getHeight, fallback) { + var rows = Blocks.rows(warehouse); + var backups = map(rows, function (cellOption) { + return cellOption.map(direction.edge); + }); + return map(rows, function (cellOption, c) { + var rowCell = cellOption.filter(not(CellUtils.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, Sizes.getHeight, function (deduced) { + return deduced.getOrThunk(CellUtils.minHeight); + }); + }; + var getRawHeights = function (warehouse, direction) { + return getHeightFrom(warehouse, direction, getRawH, getDeduced); + }; + var ColumnSizes = { + getRawWidths: getRawWidths, + getPixelWidths: getPixelWidths, + getPercentageWidths: getPercentageWidths, + getPixelHeights: getPixelHeights, + getRawHeights: getRawHeights + }; + + 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 recalculateWidth = 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: constant(width), + colspan: cell.colspan + }; + }); + }; + var recalculateHeight = 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: constant(height), + rowspan: cell.rowspan + }; + }); + }; + var matchRowHeight = function (warehouse, heights) { + return map(warehouse.all(), function (row, i) { + return { + element: row.element, + height: constant(heights[i]) + }; + }); + }; + var Recalculations = { + recalculateWidth: recalculateWidth, + recalculateHeight: recalculateHeight, + matchRowHeight: matchRowHeight + }; + + var percentageSize = function (width, element) { + var floatWidth = parseFloat(width); + var pixelWidth = get$5(element); + var getCellDelta = function (delta) { + return delta / pixelWidth * 100; + }; + var singleColumnWidth = function (w, _delta) { + return [100 - w]; + }; + var minCellWidth = function () { + return CellUtils.minWidth() / pixelWidth * 100; + }; + var setTableWidth = function (table, _newWidths, delta) { + var ratio = delta / 100; + var change = ratio * floatWidth; + Sizes.setPercentageWidth(table, floatWidth + change); + }; + return { + width: constant(floatWidth), + pixelWidth: constant(pixelWidth), + getWidths: ColumnSizes.getPercentageWidths, + getCellDelta: getCellDelta, + singleColumnWidth: singleColumnWidth, + minCellWidth: minCellWidth, + setElementWidth: Sizes.setPercentageWidth, + setTableWidth: setTableWidth + }; + }; + var pixelSize = function (width) { + var getCellDelta = identity; + var singleColumnWidth = function (w, delta) { + var newNext = Math.max(CellUtils.minWidth(), w + delta); + return [newNext - w]; + }; + var setTableWidth = function (table, newWidths, _delta) { + var total = foldr(newWidths, function (b, a) { + return b + a; + }, 0); + Sizes.setPixelWidth(table, total); + }; + return { + width: constant(width), + pixelWidth: constant(width), + getWidths: ColumnSizes.getPixelWidths, + getCellDelta: getCellDelta, + singleColumnWidth: singleColumnWidth, + minCellWidth: CellUtils.minWidth, + setElementWidth: Sizes.setPixelWidth, + setTableWidth: setTableWidth + }; + }; + var chooseSize = function (element, width) { + var percentMatch = Sizes.percentageBasedSizeRegex().exec(width); + if (percentMatch !== null) { + return percentageSize(percentMatch[1], element); + } + var pixelMatch = Sizes.pixelBasedSizeRegex().exec(width); + if (pixelMatch !== null) { + var intWidth = parseInt(pixelMatch[1], 10); + return pixelSize(intWidth); + } + var fallbackWidth = get$5(element); + return pixelSize(fallbackWidth); + }; + var getTableSize = function (element) { + var width = Sizes.getRawWidth(element); + return width.fold(function () { + var fallbackWidth = get$5(element); + return pixelSize(fallbackWidth); + }, function (w) { + return chooseSize(element, w); + }); + }; + var TableSize = { getTableSize: getTableSize }; + + var getWarehouse$1 = function (list) { + return Warehouse.generate(list); + }; + var sumUp = function (newSize) { + return foldr(newSize, function (b, a) { + return b + a; + }, 0); + }; + var getTableWarehouse = function (table) { + var list = DetailsList.fromTable(table); + return getWarehouse$1(list); + }; + var adjustWidth = function (table, delta, index, direction) { + var tableSize = TableSize.getTableSize(table); + var step = tableSize.getCellDelta(delta); + var warehouse = getTableWarehouse(table); + var widths = tableSize.getWidths(warehouse, direction, tableSize); + var deltas = Deltas.determine(widths, index, step, tableSize); + var newWidths = map(deltas, function (dx, i) { + return dx + widths[i]; + }); + var newSizes = Recalculations.recalculateWidth(warehouse, newWidths); + each(newSizes, function (cell) { + tableSize.setElementWidth(cell.element(), cell.width()); + }); + if (index === warehouse.grid().columns() - 1) { + tableSize.setTableWidth(table, newWidths, step); + } + }; + var adjustHeight = function (table, delta, index, direction) { + var warehouse = getTableWarehouse(table); + var heights = ColumnSizes.getPixelHeights(warehouse, direction); + var newHeights = map(heights, function (dy, i) { + return index === i ? Math.max(delta + dy, CellUtils.minHeight()) : dy; + }); + var newCellSizes = Recalculations.recalculateHeight(warehouse, newHeights); + var newRowSizes = Recalculations.matchRowHeight(warehouse, newHeights); + each(newRowSizes, function (row) { + Sizes.setHeight(row.element(), row.height()); + }); + each(newCellSizes, function (cell) { + Sizes.setHeight(cell.element(), cell.height()); + }); + var total = sumUp(newHeights); + Sizes.setHeight(table, total); + }; + var adjustWidthTo = function (table, list, direction) { + var tableSize = TableSize.getTableSize(table); + var warehouse = getWarehouse$1(list); + var widths = tableSize.getWidths(warehouse, direction, tableSize); + var newSizes = Recalculations.recalculateWidth(warehouse, widths); + each(newSizes, function (cell) { + tableSize.setElementWidth(cell.element(), cell.width()); + }); + if (newSizes.length > 0) { + tableSize.setTableWidth(table, widths, tableSize.getCellDelta(0)); + } + }; + var Adjustments = { + adjustWidth: adjustWidth, + adjustHeight: adjustHeight, + adjustWidthTo: adjustWidthTo + }; + + 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 verifyGenerators = exactly([ + 'cell', + 'row', + 'replace', + 'gap' + ]); + var elementToData = function (element) { + var colspan = has$1(element, 'colspan') ? parseInt(get$1(element, 'colspan'), 10) : 1; + var rowspan = has$1(element, 'rowspan') ? parseInt(get$1(element, 'rowspan'), 10) : 1; + return { + element: constant(element), + colspan: constant(colspan), + rowspan: constant(rowspan) + }; + }; + var modification = function (generators, toData) { + if (toData === void 0) { + toData = elementToData; + } + verifyGenerators(generators); + var position = Cell(Option.none()); + var nu = function (data) { + 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(Option.some(replacement)); + } + recent = Option.some({ + item: element, + replacement: replacement + }); + return replacement; + }; + var recent = Option.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 = function (scope, tag) { + return function (generators) { + var position = Cell(Option.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(Option.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(Option.none()); + var combine = function (cell) { + if (position.get().isNone()) { + position.set(Option.some(cell)); + } + return function () { + var raw = generators.cell({ + element: constant(cell), + colspan: constant(1), + rowspan: constant(1) + }); + remove$1(raw, 'width'); + remove$1(cell, 'width'); + return raw; + }; + }; + return { + combine: combine, + cursor: position.get + }; + }; + var Generators = { + modification: modification, + transform: transform, + 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 isFormatting = function (universe, item) { + var tagName = universe.property().name(item); + return contains([ + 'address', + 'pre', + 'p', + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6' + ], tagName); + }; + var isHeading = function (universe, item) { + var tagName = universe.property().name(item); + return contains([ + 'h1', + 'h2', + 'h3', + 'h4', + 'h5', + 'h6' + ], tagName); + }; + var isContainer = function (universe, item) { + return contains([ + 'div', + 'li', + 'td', + 'th', + 'blockquote', + 'body', + 'caption' + ], universe.property().name(item)); + }; + var isEmptyTag = function (universe, item) { + return contains([ + 'br', + 'img', + 'hr', + 'input' + ], universe.property().name(item)); + }; + var isFrame = function (universe, item) { + return universe.property().name(item) === 'iframe'; + }; + var isInline = function (universe, item) { + return !(isBlock(universe, item) || isEmptyTag(universe, item)) && universe.property().name(item) !== 'li'; + }; + var Structure = { + isBlock: isBlock, + isList: isList, + isFormatting: isFormatting, + isHeading: isHeading, + isContainer: isContainer, + isEmptyTag: isEmptyTag, + isFrame: isFrame, + isInline: isInline + }; + + var universe$1 = DomUniverse(); + var isBlock$1 = function (element) { + return Structure.isBlock(universe$1, element); + }; + var isList$1 = function (element) { + return Structure.isList(universe$1, element); + }; + var isFormatting$1 = function (element) { + return Structure.isFormatting(universe$1, element); + }; + var isHeading$1 = function (element) { + return Structure.isHeading(universe$1, element); + }; + var isContainer$1 = function (element) { + return Structure.isContainer(universe$1, element); + }; + var isEmptyTag$1 = function (element) { + return Structure.isEmptyTag(universe$1, element); + }; + var isFrame$1 = function (element) { + return Structure.isFrame(universe$1, element); + }; + var isInline$1 = function (element) { + return Structure.isInline(universe$1, element); + }; + var DomStructure = { + isBlock: isBlock$1, + isList: isList$1, + isFormatting: isFormatting$1, + isHeading: isHeading$1, + isContainer: isContainer$1, + isEmptyTag: isEmptyTag$1, + isFrame: isFrame$1, + isInline: isInline$1 + }; + + 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, DomStructure.isList).isSome(); + }; + var siblingIsBlock = function (el) { + return nextSibling(el).map(function (rightSibling) { + if (DomStructure.isBlock(rightSibling)) { + return true; + } + if (DomStructure.isEmptyTag(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) || DomStructure.isBlock(parent) && !eq(cell, parent) ? [] : [Element.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 ? [Element.fromTag('br')] : content; + }; + var contents = markContent(); + empty(cells[0]); + append$1(cells[0], contents); + }; + var TableContent = { merge: merge$2 }; + + var prune = function (table) { + var cells = TableLookup.cells(table); + if (cells.length === 0) { + remove$2(table); + } + }; + var outcome = Immutable('grid', 'cursor'); + var elementFromGrid = function (grid, row, column) { + return findIn(grid, row, column).orThunk(function () { + return findIn(grid, 0, 0); + }); + }; + var findIn = function (grid, row, column) { + return Option.from(grid[row]).bind(function (r) { + return Option.from(r.cells()[column]).bind(function (c) { + return Option.from(c.element()); + }); + }); + }; + var bundle = function (grid, row, column) { + return outcome(grid, findIn(grid, 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 insertRowBefore = function (grid, detail, comparator, genWrappers) { + var example = detail.row(); + var targetIndex = detail.row(); + var newGrid = ModificationOperations.insertRowAt(grid, targetIndex, example, comparator, genWrappers.getOrInit); + return bundle(newGrid, targetIndex, detail.column()); + }; + var insertRowsBefore = 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 ModificationOperations.insertRowAt(newG, targetIndex, example, comparator, genWrappers.getOrInit); + }, grid); + return bundle(newGrid, targetIndex, details[0].column()); + }; + var insertRowAfter = function (grid, detail, comparator, genWrappers) { + var example = detail.row(); + var targetIndex = detail.row() + detail.rowspan(); + var newGrid = ModificationOperations.insertRowAt(grid, targetIndex, example, comparator, genWrappers.getOrInit); + return bundle(newGrid, targetIndex, detail.column()); + }; + var insertRowsAfter = 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 ModificationOperations.insertRowAt(newG, targetIndex, example, comparator, genWrappers.getOrInit); + }, grid); + return bundle(newGrid, targetIndex, details[0].column()); + }; + var insertColumnBefore = function (grid, detail, comparator, genWrappers) { + var example = detail.column(); + var targetIndex = detail.column(); + var newGrid = ModificationOperations.insertColumnAt(grid, targetIndex, example, comparator, genWrappers.getOrInit); + return bundle(newGrid, detail.row(), targetIndex); + }; + var insertColumnsBefore = 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 ModificationOperations.insertColumnAt(newG, targetIndex, example, comparator, genWrappers.getOrInit); + }, grid); + return bundle(newGrid, details[0].row(), targetIndex); + }; + var insertColumnAfter = function (grid, detail, comparator, genWrappers) { + var example = detail.column(); + var targetIndex = detail.column() + detail.colspan(); + var newGrid = ModificationOperations.insertColumnAt(grid, targetIndex, example, comparator, genWrappers.getOrInit); + return bundle(newGrid, detail.row(), targetIndex); + }; + var insertColumnsAfter = 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 ModificationOperations.insertColumnAt(newG, targetIndex, example, comparator, genWrappers.getOrInit); + }, grid); + return bundle(newGrid, details[0].row(), targetIndex); + }; + var makeRowHeader = function (grid, detail, comparator, genWrappers) { + var newGrid = TransformOperations.replaceRow(grid, detail.row(), comparator, genWrappers.replaceOrInit); + return bundle(newGrid, detail.row(), detail.column()); + }; + var makeColumnHeader = function (grid, detail, comparator, genWrappers) { + var newGrid = TransformOperations.replaceColumn(grid, detail.column(), comparator, genWrappers.replaceOrInit); + return bundle(newGrid, detail.row(), detail.column()); + }; + var unmakeRowHeader = function (grid, detail, comparator, genWrappers) { + var newGrid = TransformOperations.replaceRow(grid, detail.row(), comparator, genWrappers.replaceOrInit); + return bundle(newGrid, detail.row(), detail.column()); + }; + var unmakeColumnHeader = function (grid, detail, comparator, genWrappers) { + var newGrid = TransformOperations.replaceColumn(grid, detail.column(), comparator, genWrappers.replaceOrInit); + return bundle(newGrid, detail.row(), detail.column()); + }; + var splitCellIntoColumns$1 = function (grid, detail, comparator, genWrappers) { + var newGrid = ModificationOperations.splitCellIntoColumns(grid, detail.row(), detail.column(), comparator, genWrappers.getOrInit); + return bundle(newGrid, detail.row(), detail.column()); + }; + var splitCellIntoRows$1 = function (grid, detail, comparator, genWrappers) { + var newGrid = ModificationOperations.splitCellIntoRows(grid, detail.row(), detail.column(), comparator, genWrappers.getOrInit); + return bundle(newGrid, detail.row(), detail.column()); + }; + var eraseColumns = function (grid, details, _comparator, _genWrappers) { + var columns = uniqueColumns(details); + var newGrid = ModificationOperations.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 eraseRows = function (grid, details, _comparator, _genWrappers) { + var rows = uniqueRows(details); + var newGrid = ModificationOperations.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 mergeCells = function (grid, mergable, comparator, _genWrappers) { + var cells = mergable.cells(); + TableContent.merge(cells); + var newGrid = MergingOperations.merge(grid, mergable.bounds(), comparator, constant(cells[0])); + return outcome(newGrid, Option.from(cells[0])); + }; + var unmergeCells = function (grid, unmergable, comparator, genWrappers) { + var newGrid = foldr(unmergable, function (b, cell) { + return MergingOperations.unmerge(b, cell, comparator, genWrappers.combine(cell)); + }, grid); + return outcome(newGrid, Option.from(unmergable[0])); + }; + var pasteCells = function (grid, pasteDetails, comparator, _genWrappers) { + var gridify = function (table, generators) { + var list = DetailsList.fromTable(table); + var wh = Warehouse.generate(list); + return Transitions.toGrid(wh, generators, true); + }; + var gridB = gridify(pasteDetails.clipboard(), pasteDetails.generators()); + var startAddress = address(pasteDetails.row(), pasteDetails.column()); + var mergedGrid = TableMerge.merge(startAddress, grid, gridB, pasteDetails.generators(), comparator); + return mergedGrid.fold(function () { + return outcome(grid, Option.some(pasteDetails.element())); + }, function (nuGrid) { + var cursor = elementFromGrid(nuGrid, pasteDetails.row(), pasteDetails.column()); + return outcome(nuGrid, cursor); + }); + }; + var gridifyRows = function (rows, generators, example) { + var pasteDetails = DetailsList.fromPastedRows(rows, example); + var wh = Warehouse.generate(pasteDetails); + return Transitions.toGrid(wh, generators, true); + }; + var pasteRowsBefore = function (grid, pasteDetails, comparator, _genWrappers) { + var example = grid[pasteDetails.cells[0].row()]; + var index = pasteDetails.cells[0].row(); + var gridB = gridifyRows(pasteDetails.clipboard(), pasteDetails.generators(), example); + var mergedGrid = TableMerge.insert(index, grid, gridB, pasteDetails.generators(), comparator); + var cursor = elementFromGrid(mergedGrid, pasteDetails.cells[0].row(), pasteDetails.cells[0].column()); + return outcome(mergedGrid, cursor); + }; + var pasteRowsAfter = function (grid, pasteDetails, comparator, _genWrappers) { + var example = grid[pasteDetails.cells[0].row()]; + var index = pasteDetails.cells[pasteDetails.cells.length - 1].row() + pasteDetails.cells[pasteDetails.cells.length - 1].rowspan(); + var gridB = gridifyRows(pasteDetails.clipboard(), pasteDetails.generators(), example); + var mergedGrid = TableMerge.insert(index, grid, gridB, pasteDetails.generators(), comparator); + var cursor = elementFromGrid(mergedGrid, pasteDetails.cells[0].row(), pasteDetails.cells[0].column()); + return outcome(mergedGrid, cursor); + }; + var resize = Adjustments.adjustWidthTo; + var TableOperations = { + insertRowBefore: run(insertRowBefore, onCell, noop, noop, Generators.modification), + insertRowsBefore: run(insertRowsBefore, onCells, noop, noop, Generators.modification), + insertRowAfter: run(insertRowAfter, onCell, noop, noop, Generators.modification), + insertRowsAfter: run(insertRowsAfter, onCells, noop, noop, Generators.modification), + insertColumnBefore: run(insertColumnBefore, onCell, resize, noop, Generators.modification), + insertColumnsBefore: run(insertColumnsBefore, onCells, resize, noop, Generators.modification), + insertColumnAfter: run(insertColumnAfter, onCell, resize, noop, Generators.modification), + insertColumnsAfter: run(insertColumnsAfter, onCells, resize, noop, Generators.modification), + splitCellIntoColumns: run(splitCellIntoColumns$1, onCell, resize, noop, Generators.modification), + splitCellIntoRows: run(splitCellIntoRows$1, onCell, noop, noop, Generators.modification), + eraseColumns: run(eraseColumns, onCells, resize, prune, Generators.modification), + eraseRows: run(eraseRows, onCells, noop, prune, Generators.modification), + makeColumnHeader: run(makeColumnHeader, onCell, noop, noop, Generators.transform('row', 'th')), + unmakeColumnHeader: run(unmakeColumnHeader, onCell, noop, noop, Generators.transform(null, 'td')), + makeRowHeader: run(makeRowHeader, onCell, noop, noop, Generators.transform('col', 'th')), + unmakeRowHeader: run(unmakeRowHeader, onCell, noop, noop, Generators.transform(null, 'td')), + mergeCells: run(mergeCells, onMergable, noop, noop, Generators.merging), + unmergeCells: run(unmergeCells, onUnmergable, resize, noop, Generators.merging), + pasteCells: run(pasteCells, onPaste, resize, noop, Generators.modification), + pasteRowsBefore: run(pasteRowsBefore, onPasteRows, noop, noop, Generators.modification), + pasteRowsAfter: run(pasteRowsAfter, onPasteRows, noop, noop, Generators.modification) + }; + + var getBody$1 = function (editor) { + return Element.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 addSizeSuffix = function (size) { + if (/^[0-9]+$/.test(size)) { + size += 'px'; + } + return size; + }; + var removeDataStyle = function (table) { + var dataStyleCells = descendants$1(table, 'td[data-mce-style],th[data-mce-style]'); + remove(table, 'data-mce-style'); + each(dataStyleCells, function (cell) { + remove(cell, 'data-mce-style'); + }); + }; + + var getDirection = function (element) { + return get$2(element, 'direction') === 'rtl' ? 'rtl' : 'ltr'; + }; + + var ltr$1 = { isRtl: constant(false) }; + var rtl$1 = { isRtl: constant(true) }; + var directionAt = function (element) { + var dir = getDirection(element); + return dir === 'rtl' ? rtl$1 : ltr$1; + }; + var Direction = { directionAt: directionAt }; + + var defaultTableToolbar = 'tableprops tabledelete | tableinsertrowbefore tableinsertrowafter tabledeleterow | tableinsertcolbefore tableinsertcolafter tabledeletecol'; + var defaultStyles = { + 'border-collapse': 'collapse', + 'width': '100%' + }; + var defaultAttributes = { border: '1' }; + var getDefaultAttributes = function (editor) { + return editor.getParam('table_default_attributes', defaultAttributes, 'object'); + }; + var getDefaultStyles = function (editor) { + return editor.getParam('table_default_styles', defaultStyles, '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 editor.getParam('table_responsive_width') === true; + }; + var isPixelsForced = function (editor) { + return editor.getParam('table_responsive_width') === false; + }; + var getToolbar = function (editor) { + return editor.getParam('table_toolbar', defaultTableToolbar); + }; + var getCloneElements = function (editor) { + var cloneElements = editor.getParam('table_clone_elements'); + if (isString(cloneElements)) { + return Option.some(cloneElements.split(/[ ,]/)); + } else if (Array.isArray(cloneElements)) { + return Option.some(cloneElements); + } else { + return Option.none(); + } + }; + var hasObjectResizing = function (editor) { + var objectResizing = editor.getParam('object_resizing', true); + return isString(objectResizing) ? objectResizing === 'table' : objectResizing; + }; + + 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) { + editor.fire('ObjectResizeStart', { + target: target, + width: width, + height: height + }); + }; + var fireObjectResized = function (editor, target, width, height) { + editor.fire('ObjectResized', { + target: target, + width: width, + height: height + }); + }; + 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 TableActions = function (editor, lazyWire) { + var isTableBody = function (editor) { + return name(getBody$1(editor)) === 'table'; + }; + var lastRowGuard = function (table) { + var size = TableGridSize.getGridSize(table); + return isTableBody(editor) === false || size.rows() > 1; + }; + var lastColumnGuard = function (table) { + var size = TableGridSize.getGridSize(table); + return isTableBody(editor) === false || size.columns() > 1; + }; + var cloneFormats = getCloneElements(editor); + var execute = function (operation, guard, mutate, lazyWire) { + return function (table, target) { + removeDataStyle(table); + var wire = lazyWire(); + var doc = Element.fromDom(editor.getDoc()); + var direction = TableDirection(Direction.directionAt); + var generators = TableFill.cellOperations(mutate, doc, cloneFormats); + return guard(table) ? operation(wire, table, target, generators, direction).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 rng = editor.dom.createRng(); + rng.setStart(cell.dom(), 0); + rng.setEnd(cell.dom(), 0); + return rng; + }); + }) : Option.none(); + }; + }; + var deleteRow = execute(TableOperations.eraseRows, lastRowGuard, noop, lazyWire); + var deleteColumn = execute(TableOperations.eraseColumns, lastColumnGuard, noop, lazyWire); + var insertRowsBefore = execute(TableOperations.insertRowsBefore, always, noop, lazyWire); + var insertRowsAfter = execute(TableOperations.insertRowsAfter, always, noop, lazyWire); + var insertColumnsBefore = execute(TableOperations.insertColumnsBefore, always, CellMutations.halve, lazyWire); + var insertColumnsAfter = execute(TableOperations.insertColumnsAfter, always, CellMutations.halve, lazyWire); + var mergeCells = execute(TableOperations.mergeCells, always, noop, lazyWire); + var unmergeCells = execute(TableOperations.unmergeCells, always, noop, lazyWire); + var pasteRowsBefore = execute(TableOperations.pasteRowsBefore, always, noop, lazyWire); + var pasteRowsAfter = execute(TableOperations.pasteRowsAfter, always, noop, lazyWire); + var pasteCells = execute(TableOperations.pasteCells, always, noop, lazyWire); + return { + deleteRow: deleteRow, + deleteColumn: deleteColumn, + insertRowsBefore: insertRowsBefore, + insertRowsAfter: insertRowsAfter, + insertColumnsBefore: insertColumnsBefore, + insertColumnsAfter: insertColumnsAfter, + mergeCells: mergeCells, + unmergeCells: unmergeCells, + pasteRowsBefore: pasteRowsBefore, + pasteRowsAfter: pasteRowsAfter, + pasteCells: pasteCells + }; + }; + + var copyRows = function (table, target, generators) { + var list = DetailsList.fromTable(table); + var house = Warehouse.generate(list); + var details = onCells(house, target); + return details.map(function (selectedCells) { + var grid = Transitions.toGrid(house, generators, false); + var slicedGrid = grid.slice(selectedCells[0].row(), selectedCells[selectedCells.length - 1].row() + selectedCells[selectedCells.length - 1].rowspan()); + var slicedDetails = toDetailList(slicedGrid, generators); + return Redraw.copy(slicedDetails); + }); + }; + var CopyRows = { copyRows: copyRows }; + + 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; + }; + firstChildStyle = checkChildren(firstChildStyle, cells); + return firstChildStyle; + }; + 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 Styles$1 = { + applyAlign: applyAlign, + applyVAlign: applyVAlign, + unApplyAlign: unApplyAlign, + unApplyVAlign: unApplyVAlign, + getTDTHOverallStyle: getTDTHOverallStyle + }; + + var buildListItems = function (inputList, itemCallback, startItems) { + var appendItems = function (values, output) { + output = output || []; + global$1.each(values, function (item) { + var menuItem = { text: item.text || item.title }; + if (item.menu) { + menuItem.menu = appendItems(item.menu); + } else { + menuItem.value = item.value; + if (itemCallback) { + itemCallback(menuItem); + } + } + output.push(menuItem); + }); + return output; + }; + return appendItems(inputList, startItems || []); + }; + var extractAdvancedStyles = function (dom, elm) { + var rgbToHex = function (value) { + return startsWith(value, 'rgb') ? dom.toHex(value) : value; + }; + var borderWidth = getRaw(Element.fromDom(elm), 'border-width').getOr(''); + var borderStyle = getRaw(Element.fromDom(elm), 'border-style').getOr(''); + var borderColor = getRaw(Element.fromDom(elm), 'border-color').map(rgbToHex).getOr(''); + var bgColor = getRaw(Element.fromDom(elm), 'background-color').map(rgbToHex).getOr(''); + return { + borderwidth: borderWidth, + borderstyle: borderStyle, + bordercolor: borderColor, + backgroundcolor: bgColor + }; + }; + var getSharedValues = function (data) { + var baseData = data[0]; + var comparisonData = data.slice(1); + var keys$1 = keys(baseData); + each(comparisonData, function (items) { + each(keys$1, 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: 'selectbox', + 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 (alignments, formatName, dataName, editor, elm) { + var alignmentData = {}; + global$1.each(alignments.split(' '), function (name) { + if (editor.formatter.matchNode(elm, formatName + name)) { + alignmentData[dataName] = name; + } + }); + if (!alignmentData[dataName]) { + alignmentData[dataName] = ''; + } + return alignmentData; + }; + var getHAlignment = curry(getAlignment, 'left center right'); + var getVAlignment = curry(getAlignment, 'top middle bottom'); + var extractDataFromSettings = function (editor, hasAdvTableTab) { + var style = getDefaultStyles(editor); + var attrs = getDefaultAttributes(editor); + var extractAdvancedStyleData = function (dom) { + var rgbToHex = function (value) { + return startsWith(value, 'rgb') ? dom.toHex(value) : value; + }; + var borderStyle = get(style, 'border-style').getOr(''); + var borderColor = get(style, 'border-color').getOr(''); + var bgColor = get(style, 'background-color').getOr(''); + return { + borderstyle: borderStyle, + bordercolor: rgbToHex(borderColor), + backgroundcolor: rgbToHex(bgColor) + }; + }; + 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 dom = editor.dom; + var advStyle = hasAdvTableTab ? extractAdvancedStyleData(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(Element.fromDom(elm), 'border-width'); + if (shouldStyleWithCss(editor) && optBorderWidth.isSome()) { + return optBorderWidth.getOr(''); + } + return dom.getAttrib(elm, 'border') || Styles$1.getTDTHOverallStyle(editor.dom, elm, 'border-width') || Styles$1.getTDTHOverallStyle(editor.dom, elm, 'border'); + }; + var dom = editor.dom; + var data = __assign(__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') || Styles$1.getTDTHOverallStyle(editor.dom, elm, 'padding'), + border: getBorder(dom, elm), + caption: !!dom.select('caption', elm)[0], + class: dom.getAttrib(elm, 'class', '') + }, getHAlignment('align', 'align', editor, elm)), hasAdvTableTab ? extractAdvancedStyles(dom, elm) : {}); + return data; + }; + var extractDataFromRowElement = function (editor, elm, hasAdvancedRowTab) { + var dom = editor.dom; + var data = __assign(__assign({ + height: dom.getStyle(elm, 'height') || dom.getAttrib(elm, 'height'), + scope: dom.getAttrib(elm, 'scope'), + class: dom.getAttrib(elm, 'class', ''), + align: '', + type: elm.parentNode.nodeName.toLowerCase() + }, getHAlignment('align', 'align', editor, elm)), hasAdvancedRowTab ? extractAdvancedStyles(dom, elm) : {}); + return data; + }; + var extractDataFromCellElement = function (editor, elm, hasAdvancedCellTab) { + var dom = editor.dom; + var data = __assign(__assign(__assign({ + width: dom.getStyle(elm, 'width') || dom.getAttrib(elm, 'width'), + height: dom.getStyle(elm, 'height') || dom.getAttrib(elm, 'height'), + scope: dom.getAttrib(elm, 'scope'), + celltype: elm.nodeName.toLowerCase(), + class: dom.getAttrib(elm, 'class', '') + }, getHAlignment('align', 'halign', editor, elm)), getVAlignment('valign', 'valign', editor, elm)), hasAdvancedCellTab ? extractAdvancedStyles(dom, elm) : {}); + return data; + }; + var Helpers = { + buildListItems: buildListItems, + extractAdvancedStyles: extractAdvancedStyles, + getSharedValues: getSharedValues, + getAdvancedTab: getAdvancedTab, + extractDataFromTableElement: extractDataFromTableElement, + extractDataFromRowElement: extractDataFromRowElement, + extractDataFromCellElement: extractDataFromCellElement, + extractDataFromSettings: extractDataFromSettings + }; + + var getClassList = function (editor) { + var rowClassList = getCellClassList(editor); + var classes = Helpers.buildListItems(rowClassList, function (item) { + if (item.value) { + item.textStyle = function () { + return editor.formatter.getCssText({ + block: 'tr', + classes: [item.value] + }); + }; + } + }); + if (rowClassList.length > 0) { + return Option.some({ + name: 'class', + type: 'selectbox', + label: 'Class', + items: classes + }); + } + return Option.none(); + }; + var children$3 = [ + { + name: 'width', + type: 'input', + label: 'Width' + }, + { + name: 'height', + type: 'input', + label: 'Height' + }, + { + name: 'celltype', + type: 'selectbox', + label: 'Cell type', + items: [ + { + text: 'Cell', + value: 'td' + }, + { + text: 'Header cell', + value: 'th' + } + ] + }, + { + name: 'scope', + type: 'selectbox', + 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: 'selectbox', + label: 'H Align', + items: [ + { + text: 'None', + value: '' + }, + { + text: 'Left', + value: 'left' + }, + { + text: 'Center', + value: 'center' + }, + { + text: 'Right', + value: 'right' + } + ] + }, + { + name: 'valign', + type: 'selectbox', + label: 'V Align', + items: [ + { + text: 'None', + value: '' + }, + { + text: 'Top', + value: 'top' + }, + { + text: 'Middle', + value: 'middle' + }, + { + text: 'Bottom', + value: 'bottom' + } + ] + } + ]; + var getItems = function (editor) { + return getClassList(editor).fold(function () { + return children$3; + }, function (classlist) { + return children$3.concat(classlist); + }); + }; + var CellDialogGeneralTab = { getItems: getItems }; + + var normal = function (dom, node) { + var setAttrib = function (attr, value) { + dom.setAttrib(node, attr, value); + }; + var setStyle = function (prop, value) { + dom.setStyle(node, prop, value); + }; + return { + setAttrib: setAttrib, + setStyle: setStyle + }; + }; + var ifTruthy = function (dom, node) { + var setAttrib = function (attr, value) { + if (value) { + dom.setAttrib(node, attr, value); + } + }; + var setStyle = function (prop, value) { + if (value) { + dom.setStyle(node, prop, value); + } + }; + return { + setAttrib: setAttrib, + setStyle: setStyle + }; + }; + var DomModifier = { + normal: normal, + ifTruthy: ifTruthy + }; + + var updateSimpleProps = function (modifiers, data) { + modifiers.setAttrib('scope', data.scope); + modifiers.setAttrib('class', data.class); + modifiers.setStyle('width', addSizeSuffix(data.width)); + modifiers.setStyle('height', addSizeSuffix(data.height)); + }; + var updateAdvancedProps = function (modifiers, data) { + modifiers.setStyle('background-color', data.backgroundcolor); + modifiers.setStyle('border-color', data.bordercolor); + modifiers.setStyle('border-style', data.borderstyle); + modifiers.setStyle('border-width', addSizeSuffix(data.borderwidth)); + }; + var applyToSingle = function (editor, cells, data) { + var dom = editor.dom; + var cellElm = data.celltype && cells[0].nodeName.toLowerCase() !== data.celltype ? dom.rename(cells[0], data.celltype) : cells[0]; + var modifiers = DomModifier.normal(dom, cellElm); + updateSimpleProps(modifiers, data); + if (hasAdvancedCellTab(editor)) { + updateAdvancedProps(modifiers, data); + } + Styles$1.unApplyAlign(editor, cellElm); + Styles$1.unApplyVAlign(editor, cellElm); + if (data.halign) { + Styles$1.applyAlign(editor, cellElm, data.halign); + } + if (data.valign) { + Styles$1.applyVAlign(editor, cellElm, data.valign); + } + }; + var applyToMultiple = function (editor, cells, data) { + var dom = editor.dom; + global$1.each(cells, function (cellElm) { + if (data.celltype && cellElm.nodeName.toLowerCase() !== data.celltype) { + cellElm = dom.rename(cellElm, data.celltype); + } + var modifiers = DomModifier.ifTruthy(dom, cellElm); + updateSimpleProps(modifiers, data); + if (hasAdvancedCellTab(editor)) { + updateAdvancedProps(modifiers, data); + } + if (data.halign) { + Styles$1.applyAlign(editor, cellElm, data.halign); + } + if (data.valign) { + Styles$1.applyVAlign(editor, cellElm, data.valign); + } + }); + }; + var onSubmitCellForm = function (editor, cells, api) { + var data = api.getData(); + api.close(); + editor.undoManager.transact(function () { + var applicator = cells.length === 1 ? applyToSingle : applyToMultiple; + applicator(editor, cells, data); + editor.focus(); + }); + }; + var open = function (editor) { + var cellElm, cells = []; + cells = editor.dom.select('td[data-mce-selected],th[data-mce-selected]'); + cellElm = editor.dom.getParent(editor.selection.getStart(), 'td,th'); + if (!cells.length && cellElm) { + cells.push(cellElm); + } + cellElm = cellElm || cells[0]; + if (!cellElm) { + return; + } + var cellsData = global$1.map(cells, function (cellElm) { + return Helpers.extractDataFromCellElement(editor, cellElm, hasAdvancedCellTab(editor)); + }); + var data = Helpers.getSharedValues(cellsData); + var dialogTabPanel = { + type: 'tabpanel', + tabs: [ + { + title: 'General', + name: 'general', + items: CellDialogGeneralTab.getItems(editor) + }, + Helpers.getAdvancedTab('cell') + ] + }; + var dialogPanel = { + type: 'panel', + items: [{ + type: 'grid', + columns: 2, + items: CellDialogGeneralTab.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 CellDialog = { open: open }; + + var getClassList$1 = function (editor) { + var rowClassList = getRowClassList(editor); + var classes = Helpers.buildListItems(rowClassList, function (item) { + if (item.value) { + item.textStyle = function () { + return editor.formatter.getCssText({ + block: 'tr', + classes: [item.value] + }); + }; + } + }); + if (rowClassList.length > 0) { + return Option.some({ + name: 'class', + type: 'selectbox', + label: 'Class', + items: classes + }); + } + return Option.none(); + }; + var formChildren = [ + { + type: 'selectbox', + name: 'type', + label: 'Row type', + items: [ + { + text: 'Header', + value: 'thead' + }, + { + text: 'Body', + value: 'tbody' + }, + { + text: 'Footer', + value: 'tfoot' + } + ] + }, + { + type: 'selectbox', + 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 getClassList$1(editor).fold(function () { + return formChildren; + }, function (classes) { + return formChildren.concat(classes); + }); + }; + var RowDialogGeneralTab = { getItems: getItems$1 }; + + var switchRowType = function (dom, rowElm, toType) { + var tableElm = dom.getParent(rowElm, 'table'); + var oldParentElm = rowElm.parentNode; + var parentElm = dom.select(toType, tableElm)[0]; + if (!parentElm) { + parentElm = dom.create(toType); + if (tableElm.firstChild) { + if (tableElm.firstChild.nodeName === 'CAPTION') { + dom.insertAfter(parentElm, tableElm.firstChild); + } else { + tableElm.insertBefore(parentElm, tableElm.firstChild); + } + } else { + tableElm.appendChild(parentElm); + } + } + if (toType === 'tbody' && oldParentElm.nodeName === 'THEAD' && parentElm.firstChild) { + parentElm.insertBefore(rowElm, parentElm.firstChild); + } else { + parentElm.appendChild(rowElm); + } + if (!oldParentElm.hasChildNodes()) { + dom.remove(oldParentElm); + } + }; + 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 onSubmitRowForm = function (editor, rows, oldData, api) { + var dom = editor.dom; + var data = api.getData(); + api.close(); + var createModifier = rows.length === 1 ? DomModifier.normal : DomModifier.ifTruthy; + editor.undoManager.transact(function () { + global$1.each(rows, function (rowElm) { + if (data.type !== rowElm.parentNode.nodeName.toLowerCase()) { + switchRowType(editor.dom, rowElm, data.type); + } + var modifier = createModifier(dom, rowElm); + modifier.setAttrib('scope', data.scope); + modifier.setAttrib('class', data.class); + modifier.setStyle('height', addSizeSuffix(data.height)); + if (hasAdvancedRowTab(editor)) { + updateAdvancedProps$1(modifier, data); + } + if (data.align !== oldData.align) { + Styles$1.unApplyAlign(editor, rowElm); + Styles$1.applyAlign(editor, rowElm, data.align); + } + }); + editor.focus(); + }); + }; + var open$1 = function (editor) { + var dom = editor.dom; + var tableElm, cellElm, rowElm; + var rows = []; + tableElm = dom.getParent(editor.selection.getStart(), 'table'); + if (!tableElm) { + return; + } + cellElm = dom.getParent(editor.selection.getStart(), 'td,th'); + global$1.each(tableElm.rows, function (row) { + global$1.each(row.cells, function (cell) { + if ((dom.getAttrib(cell, 'data-mce-selected') || cell === cellElm) && rows.indexOf(row) < 0) { + rows.push(row); + return false; + } + }); + }); + rowElm = rows[0]; + if (!rowElm) { + return; + } + var rowsData = global$1.map(rows, function (rowElm) { + return Helpers.extractDataFromRowElement(editor, rowElm, hasAdvancedRowTab(editor)); + }); + var data = Helpers.getSharedValues(rowsData); + var dialogTabPanel = { + type: 'tabpanel', + tabs: [ + { + title: 'General', + name: 'general', + items: RowDialogGeneralTab.getItems(editor) + }, + Helpers.getAdvancedTab('row') + ] + }; + var dialogPanel = { + type: 'panel', + items: [{ + type: 'grid', + columns: 2, + items: RowDialogGeneralTab.getItems(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, rows, data) + }); + }; + var RowDialog = { open: open$1 }; + + var hasOwnProperty$1 = Object.prototype.hasOwnProperty; + var shallow$1 = function (old, nu) { + return 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$1.call(curObject, key)) { + ret[key] = merger(ret[key], curObject[key]); + } + } + } + return ret; + }; + }; + var merge$3 = baseMerge(shallow$1); + + var global$2 = tinymce.util.Tools.resolve('tinymce.Env'); + + var DefaultRenderOptions = { + styles: { + 'border-collapse': 'collapse', + 'width': '100%' + }, + attributes: { border: '1' }, + percentages: true + }; + var makeTable = function () { + return Element.fromTag('table'); + }; + var tableBody = function () { + return Element.fromTag('tbody'); + }; + var tableRow = function () { + return Element.fromTag('tr'); + }; + var tableHeaderCell = function () { + return Element.fromTag('th'); + }; + var tableCell = function () { + return Element.fromTag('td'); + }; + var render$1 = function (rows, columns, rowHeaders, columnHeaders, renderOpts) { + if (renderOpts === void 0) { + renderOpts = DefaultRenderOptions; + } + var table = makeTable(); + setAll$1(table, renderOpts.styles); + setAll(table, renderOpts.attributes); + var tbody = tableBody(); + append(table, tbody); + var trs = []; + for (var i = 0; i < rows; i++) { + var tr = tableRow(); + for (var j = 0; j < columns; j++) { + var td = i < rowHeaders || j < columnHeaders ? tableHeaderCell() : tableCell(); + if (j < columnHeaders) { + set(td, 'scope', 'row'); + } + if (i < rowHeaders) { + set(td, 'scope', 'col'); + } + append(td, Element.fromTag('br')); + if (renderOpts.percentages) { + set$1(td, 'width', 100 / columns + '%'); + } + append(tr, td); + } + trs.push(tr); + } + append$1(tbody, trs); + return table; + }; + + var get$8 = function (element) { + return element.dom().innerHTML; + }; + var getOuter$2 = function (element) { + var container = Element.fromTag('div'); + var clone = Element.fromDom(element.dom().cloneNode(true)); + append(container, clone); + return get$8(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 = function (width) { + return isString(width) && width.indexOf('%') !== -1; + }; + var insert$1 = function (editor, columns, rows) { + var defaultStyles = getDefaultStyles(editor); + var options = { + styles: defaultStyles, + attributes: getDefaultAttributes(editor), + percentages: isPercentage(defaultStyles.width) && !isPixelsForced(editor) + }; + var table = render$1(rows, columns, 0, 0, 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)) { + set$1(table, 'width', get$2(table, 'width')); + } + remove(table, 'data-mce-id'); + fireEvents(editor, table); + selectFirstCellInTable(editor, table); + return table.dom(); + }).getOr(null); + }; + var InsertTable = { insert: insert$1 }; + + var getItems$2 = function (editor, hasClasses, 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: 'selectbox', + name: 'align', + label: 'Alignment', + items: [ + { + text: 'None', + value: '' + }, + { + text: 'Left', + value: 'left' + }, + { + text: 'Center', + value: 'center' + }, + { + text: 'Right', + value: 'right' + } + ] + }]; + var classListItem = hasClasses ? [{ + type: 'selectbox', + name: 'class', + label: 'Class', + items: Helpers.buildListItems(getTableClassList(editor), function (item) { + if (item.value) { + item.textStyle = function () { + return editor.formatter.getCssText({ + block: 'table', + classes: [item.value] + }); + }; + } + }) + }] : []; + return rowColCountItems.concat(alwaysItems).concat(appearanceItems).concat(alignmentItem).concat(classListItem); + }; + var TableDialogGeneralTab = { getItems: getItems$2 }; + + 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 = addSizeSuffix(data.height); + if (dom.getAttrib(tableElm, 'width') && !shouldStyleWithCss(editor)) { + attrs.width = removePxSuffix(data.width); + } else { + styles.width = addSizeSuffix(data.width); + } + if (shouldStyleWithCss(editor)) { + styles['border-width'] = addSizeSuffix(data.border); + styles['border-spacing'] = addSizeSuffix(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': addSizeSuffix(data.border), + 'padding': addSizeSuffix(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(merge$3(getDefaultStyles(editor), styles)); + dom.setAttribs(tableElm, merge$3(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 = InsertTable.insert(editor, cols, rows); + } + 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 ? '
    ' : '\xA0'; + tableElm.insertBefore(captionElm, tableElm.firstChild); + } + if (data.align === '') { + Styles$1.unApplyAlign(editor, tableElm); + } else { + Styles$1.applyAlign(editor, tableElm, data.align); + } + editor.focus(); + editor.addVisual(); + }); + }; + var open$2 = function (editor, insertNewTable) { + var dom = editor.dom; + var tableElm; + var data = Helpers.extractDataFromSettings(editor, hasAdvancedTableTab(editor)); + if (insertNewTable === false) { + tableElm = dom.getParent(editor.selection.getStart(), 'table'); + if (tableElm) { + data = Helpers.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 hasClasses = getTableClassList(editor).length > 0; + if (hasClasses) { + if (data.class) { + data.class = data.class.replace(/\s*mce\-item\-table\s*/g, ''); + } + } + var generalPanel = { + type: 'grid', + columns: 2, + items: TableDialogGeneralTab.getItems(editor, hasClasses, insertNewTable) + }; + var nonAdvancedForm = function () { + return { + type: 'panel', + items: [generalPanel] + }; + }; + var advancedForm = function () { + return { + type: 'tabpanel', + tabs: [ + { + title: 'General', + name: 'general', + items: [generalPanel] + }, + Helpers.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 TableDialog = { open: open$2 }; + + var getSelectionStartFromSelector = function (selector) { + return function (editor) { + return Option.from(editor.dom.getParent(editor.selection.getStart(), selector)).map(Element.fromDom); + }; + }; + var getSelectionStartCell = getSelectionStartFromSelector('th,td'); + var getSelectionStartCellOrCaption = getSelectionStartFromSelector('th,td,caption'); + + var each$3 = global$1.each; + var registerCommands = function (editor, actions, cellSelection, selections, clipboardRows) { + var isRoot = getIsRoot(editor); + var eraseTable = function () { + getSelectionStartCellOrCaption(editor).each(function (cellOrCaption) { + var tableOpt = TableLookup.table(cellOrCaption, isRoot); + tableOpt.filter(not(isRoot)).each(function (table) { + var cursor = Element.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 getTableFromCell = function (cell) { + return TableLookup.table(cell, isRoot); + }; + var getSize = function (table) { + return { + width: getPixelWidth$1(table.dom()), + height: getPixelWidth$1(table.dom()) + }; + }; + var resizeChange = function (editor, oldSize, table) { + var newSize = getSize(table); + if (oldSize.width !== newSize.width || oldSize.height !== newSize.height) { + fireObjectResizeStart(editor, table.dom(), oldSize.width, oldSize.height); + fireObjectResized(editor, table.dom(), newSize.width, newSize.height); + } + }; + var actOnSelection = function (execute) { + getSelectionStartCell(editor).each(function (cell) { + getTableFromCell(cell).each(function (table) { + var targets = TableTargets.forMenu(selections, table, cell); + var beforeSize = getSize(table); + execute(table, targets).each(function (rng) { + resizeChange(editor, beforeSize, table); + editor.selection.setRng(rng); + editor.focus(); + cellSelection.clear(table); + removeDataStyle(table); + }); + }); + }); + }; + var copyRowSelection = function (execute) { + return getSelectionStartCell(editor).map(function (cell) { + return getTableFromCell(cell).bind(function (table) { + var doc = Element.fromDom(editor.getDoc()); + var targets = TableTargets.forMenu(selections, table, cell); + var generators = TableFill.cellOperations(noop, doc, Option.none()); + return CopyRows.copyRows(table, targets, generators); + }); + }); + }; + var pasteOnSelection = function (execute) { + clipboardRows.get().each(function (rows) { + var clonedRows = map(rows, function (row) { + return deep(row); + }); + getSelectionStartCell(editor).each(function (cell) { + getTableFromCell(cell).each(function (table) { + var doc = Element.fromDom(editor.getDoc()); + var generators = TableFill.paste(doc); + var targets = TableTargets.pasteRows(selections, table, cell, clonedRows, generators); + execute(table, targets).each(function (rng) { + editor.selection.setRng(rng); + editor.focus(); + cellSelection.clear(table); + }); + }); + }); + }); + }; + each$3({ + mceTableSplitCells: function () { + actOnSelection(actions.unmergeCells); + }, + mceTableMergeCells: function () { + actOnSelection(actions.mergeCells); + }, + mceTableInsertRowBefore: function () { + actOnSelection(actions.insertRowsBefore); + }, + mceTableInsertRowAfter: function () { + actOnSelection(actions.insertRowsAfter); + }, + mceTableInsertColBefore: function () { + actOnSelection(actions.insertColumnsBefore); + }, + mceTableInsertColAfter: function () { + actOnSelection(actions.insertColumnsAfter); + }, + mceTableDeleteCol: function () { + actOnSelection(actions.deleteColumn); + }, + mceTableDeleteRow: function () { + actOnSelection(actions.deleteRow); + }, + mceTableCutRow: function (grid) { + copyRowSelection().each(function (selection) { + clipboardRows.set(selection); + actOnSelection(actions.deleteRow); + }); + }, + mceTableCopyRow: function (grid) { + copyRowSelection().each(function (selection) { + clipboardRows.set(selection); + }); + }, + mceTablePasteRowBefore: function (grid) { + pasteOnSelection(actions.pasteRowsBefore); + }, + mceTablePasteRowAfter: function (grid) { + pasteOnSelection(actions.pasteRowsAfter); + }, + mceTableDelete: eraseTable + }, function (func, name) { + editor.addCommand(name, func); + }); + each$3({ + mceInsertTable: curry(TableDialog.open, editor, true), + mceTableProps: curry(TableDialog.open, editor, false), + mceTableRowProps: curry(RowDialog.open, editor), + mceTableCellProps: curry(CellDialog.open, editor) + }, function (func, name) { + editor.addCommand(name, function () { + func(); + }); + }); + }; + var Commands = { registerCommands: registerCommands }; + + var only = function (element) { + var parent = Option.from(element.dom().documentElement).map(Element.fromDom).getOr(element); + return { + parent: constant(parent), + view: constant(element), + origin: constant(Position(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(Position(0, 0)) + }; + }; + var ResizeWire = { + only: only, + detached: detached, + body: body$1 + }; + + var Event = function (fields) { + var struct = Immutable.apply(null, 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 = struct.apply(null, args); + each(handlers, function (handler) { + handler(event); + }); + }; + return { + bind: bind, + unbind: unbind, + trigger: trigger + }; + }; + + var create$1 = 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 Events = { create: create$1 }; + + var mkEvent = function (target, x, y, stop, prevent, kill, raw) { + return { + target: constant(target), + x: constant(x), + y: constant(y), + stop: stop, + prevent: prevent, + kill: kill, + raw: constant(raw) + }; + }; + var fromRawEvent = function (rawEvent) { + var target = Element.fromDom(rawEvent.target); + var stop = function () { + rawEvent.stopPropagation(); + }; + var prevent = function () { + 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)) { + return; + } + 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 = constant(true); + var bind$2 = function (element, event, handler) { + return bind$1(element, event, filter$1, handler); + }; + + var styles$1 = css('ephox-dragster'); + var Styles$2 = { resolve: styles$1.resolve }; + + var Blocker = function (options) { + var settings = merge$3({ layerClass: Styles$2.resolve('blocker') }, options); + var div = Element.fromTag('div'); + set(div, 'role', 'presentation'); + setAll$1(div, { + position: 'fixed', + left: '0px', + top: '0px', + width: '100%', + height: '100%' + }); + add$2(div, Styles$2.resolve('blocker')); + add$2(div, settings.layerClass); + var element = function () { + return div; + }; + var destroy = function () { + remove$2(div); + }; + return { + element: element, + destroy: destroy + }; + }; + + var DragMode = exactly([ + 'compare', + 'extract', + 'mutate', + 'sink' + ]); + var DragSink = exactly([ + 'element', + 'start', + 'stop', + 'destroy' + ]); + var DragApi = exactly([ + 'forceDrop', + 'drop', + 'move', + 'delayDrop' + ]); + + var compare = function (old, nu) { + return Position(nu.left() - old.left(), nu.top() - old.top()); + }; + var extract$1 = function (event) { + return Option.some(Position(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 last$2 = function (fn, rate) { + var timer = null; + var cancel = function () { + if (timer !== null) { + domGlobals.clearTimeout(timer); + timer = null; + } + }; + var throttle = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (timer !== null) { + domGlobals.clearTimeout(timer); + } + timer = domGlobals.setTimeout(function () { + fn.apply(null, args); + timer = null; + }, rate); + }; + return { + cancel: cancel, + throttle: throttle + }; + }; + + function InDrag () { + var previous = Option.none(); + var reset = function () { + previous = Option.none(); + }; + var update = function (mode, nu) { + var result = previous.map(function (old) { + return mode.compare(old, nu); + }); + previous = Option.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 = 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 = 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 Dragging = { setup: setup }; + + var transform$1 = function (mutation, settings) { + if (settings === void 0) { + settings = {}; + } + var mode = settings.mode !== undefined ? settings.mode : MouseDrag; + return Dragging.setup(mutation, mode, settings); + }; + var Dragger = { transform: transform$1 }; + + var Mutation = function () { + var events = 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 = Events.create({ + drag: Event([ + 'xDelta', + 'yDelta', + 'target' + ]) + }); + var target = Option.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 = Option.some(t); + }; + var get = function () { + return target; + }; + return { + assign: assign, + get: get, + mutate: delegate.mutate, + events: events.registry + }; + }; + + var isContentEditableTrue = function (elm) { + return get$1(elm, 'contenteditable') === 'true'; + }; + var findClosestContentEditable = function (target, isRoot) { + return closest$1(target, '[contenteditable]', isRoot); + }; + + var resizeBarDragging = Styles.resolve('resizer-bar-dragging'); + var BarManager = function (wire, direction, hdirection) { + var mutation = BarMutation(); + var resizing = Dragger.transform(mutation, {}); + var hoverTable = Option.none(); + var getResizer = function (element, type) { + return Option.from(get$1(element, type)); + }; + mutation.events.drag.bind(function (event) { + getResizer(event.target(), 'data-row').each(function (_dataRow) { + var currentRow = CellUtils.getInt(event.target(), 'top'); + set$1(event.target(), 'top', currentRow + event.yDelta() + 'px'); + }); + getResizer(event.target(), 'data-column').each(function (_dataCol) { + var currentCol = CellUtils.getInt(event.target(), 'left'); + set$1(event.target(), 'left', currentCol + event.xDelta() + 'px'); + }); + }); + var getDelta = function (target, dir) { + var newX = CellUtils.getInt(target, dir); + var oldX = parseInt(get$1(target, 'data-initial-' + dir), 10); + 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)); + }); + Bars.refresh(wire, table, hdirection, direction); + }); + }); + }); + var handler = function (target, dir) { + events.trigger.startAdjust(); + mutation.assign(target); + set(target, 'data-initial-' + dir, parseInt(get$2(target, dir), 10)); + add$2(target, resizeBarDragging); + set$1(target, 'opacity', '0.2'); + resizing.go(wire.parent()); + }; + var mousedown = bind$2(wire.parent(), 'mousedown', function (event) { + if (Bars.isRowBar(event.target())) { + handler(event.target(), 'top'); + } + if (Bars.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())) { + Bars.destroy(wire); + } + }, function (table) { + hoverTable = Option.some(table); + Bars.refresh(wire, table, hdirection, direction); + }); + }); + var destroy = function () { + mousedown.unbind(); + mouseover.unbind(); + resizing.destroy(); + Bars.destroy(wire); + }; + var refresh = function (tbl) { + Bars.refresh(wire, tbl, hdirection, direction); + }; + var events = Events.create({ + adjustHeight: Event([ + 'table', + 'delta', + 'row' + ]), + adjustWidth: Event([ + 'table', + 'delta', + 'column' + ]), + startAdjust: Event([]) + }); + return { + destroy: destroy, + refresh: refresh, + on: resizing.on, + off: resizing.off, + hideBars: curry(Bars.hide, wire), + showBars: curry(Bars.show, wire), + events: events.registry + }; + }; + + var create$2 = function (wire, vdirection) { + var hdirection = BarPositions.height; + var manager = BarManager(wire, vdirection, hdirection); + var events = Events.create({ + beforeResize: Event(['table']), + afterResize: Event(['table']), + startDrag: Event([]) + }); + manager.events.adjustHeight.bind(function (event) { + events.trigger.beforeResize(event.table()); + var delta = hdirection.delta(event.delta(), event.table()); + Adjustments.adjustHeight(event.table(), delta, event.row(), hdirection); + events.trigger.afterResize(event.table()); + }); + manager.events.startAdjust.bind(function (event) { + events.trigger.startDrag(); + }); + manager.events.adjustWidth.bind(function (event) { + events.trigger.beforeResize(event.table()); + var delta = vdirection.delta(event.delta(), event.table()); + Adjustments.adjustWidth(event.table(), delta, event.column(), vdirection); + events.trigger.afterResize(event.table()); + }); + return { + on: manager.on, + off: manager.off, + hideBars: manager.hideBars, + showBars: manager.showBars, + destroy: manager.destroy, + events: events.registry + }; + }; + var TableResize = { create: create$2 }; + + var createContainer = function () { + var container = Element.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(Element.fromDom(editor.getDoc())); + }; + var remove$6 = function (editor, wire) { + if (editor.inline) { + remove$2(wire.parent()); + } + }; + var TableWire = { + get: get$9, + remove: remove$6 + }; + + var calculatePercentageWidth = function (element, parent) { + return getPixelWidth$1(element.dom()) / getPixelWidth$1(parent.dom()) * 100 + '%'; + }; + var enforcePercentage = function (rawTable) { + var table = Element.fromDom(rawTable); + parent(table).map(function (parent) { + return calculatePercentageWidth(table, parent); + }).each(function (tablePercentage) { + set$1(table, 'width', tablePercentage); + each(descendants$1(table, 'tr'), function (tr) { + each(children(tr), function (td) { + set$1(td, 'width', calculatePercentageWidth(td, tr)); + }); + }); + }); + }; + var enforcePixels = function (table) { + set$1(Element.fromDom(table), 'width', getPixelWidth$1(table).toString() + 'px'); + }; + + var getResizeHandler = function (editor) { + var selectionRng = Option.none(); + var resize = Option.none(); + var wire = Option.none(); + var percentageBasedSizeRegex = /(\d+(\.\d+)?)%/; + var startW; + var startRawW; + var isTable = function (elm) { + return elm.nodeName === 'TABLE'; + }; + var getRawWidth = function (elm) { + var raw = editor.dom.getStyle(elm, 'width') || editor.dom.getAttrib(elm, 'width'); + return Option.from(raw).filter(function (s) { + return s.length > 0; + }); + }; + var lazyResize = function () { + return resize; + }; + var lazyWire = function () { + return wire.getOr(ResizeWire.only(Element.fromDom(editor.getBody()))); + }; + var destroy = function () { + resize.each(function (sz) { + sz.destroy(); + }); + wire.each(function (w) { + TableWire.remove(editor, w); + }); + }; + editor.on('init', function () { + var direction = TableDirection(Direction.directionAt); + var rawWire = TableWire.get(editor); + wire = Option.some(rawWire); + if (hasObjectResizing(editor) && hasTableResizeBars(editor)) { + var sz = TableResize.create(rawWire, direction); + sz.on(); + sz.events.startDrag.bind(function (event) { + selectionRng = Option.some(editor.selection.getRng()); + }); + sz.events.beforeResize.bind(function (event) { + var rawTable = event.table().dom(); + fireObjectResizeStart(editor, rawTable, getPixelWidth$1(rawTable), getPixelHeight(rawTable)); + }); + 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)); + editor.undoManager.add(); + }); + resize = Option.some(sz); + } + }); + editor.on('ObjectResizeStart', function (e) { + var targetElm = e.target; + if (isTable(targetElm)) { + var tableHasPercentage = getRawWidth(targetElm).map(function (w) { + return percentageBasedSizeRegex.test(w); + }).getOr(false); + if (tableHasPercentage && isPixelsForced(editor)) { + enforcePixels(targetElm); + } else if (!tableHasPercentage && isPercentagesForced(editor)) { + enforcePercentage(targetElm); + } + startW = e.width; + startRawW = getRawWidth(targetElm).getOr(''); + } + }); + editor.on('ObjectResized', function (e) { + var targetElm = e.target; + if (isTable(targetElm)) { + var table = targetElm; + if (percentageBasedSizeRegex.test(startRawW)) { + var percentW = parseFloat(percentageBasedSizeRegex.exec(startRawW)[1]); + var targetPercentW = e.width * percentW / startW; + editor.dom.setStyle(table, 'width', targetPercentW + '%'); + } else { + var newCellSizes_1 = []; + global$1.each(table.rows, function (row) { + global$1.each(row.cells, function (cell) { + var width = editor.dom.getStyle(cell, 'width', true); + newCellSizes_1.push({ + cell: cell, + width: width + }); + }); + }); + global$1.each(newCellSizes_1, function (newCellSize) { + editor.dom.setStyle(newCellSize.cell, 'width', newCellSize.width); + editor.dom.setAttrib(newCellSize.cell, 'width', null); + }); + } + } + }); + editor.on('SwitchMode', function () { + lazyResize().each(function (resize) { + if (editor.readonly) { + resize.hideBars(); + } else { + resize.showBars(); + } + }); + }); + return { + lazyResize: lazyResize, + lazyWire: lazyWire, + destroy: destroy + }; + }; + + var adt$1 = Adt.generate([ + { none: ['current'] }, + { first: ['current'] }, + { + middle: [ + 'current', + 'target' + ] + }, + { last: ['current'] } + ]); + var none$1 = function (current) { + if (current === void 0) { + current = undefined; + } + return adt$1.none(current); + }; + var CellLocation = __assign(__assign({}, adt$1), { none: none$1 }); + + var detect$4 = function (current, isRoot) { + return TableLookup.table(current, isRoot).bind(function (table) { + var all = TableLookup.cells(table); + var index = findIndex(all, function (x) { + return eq(current, x); + }); + return index.map(function (ind) { + return { + index: constant(ind), + all: constant(all) + }; + }); + }); + }; + var next = function (current, isRoot) { + var detection = detect$4(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$4(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 CellNavigation = { + next: next, + prev: prev + }; + + var create$3 = Immutable('start', 'soffset', 'finish', 'foffset'); + var SimRange = { create: create$3 }; + + var adt$2 = 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$2.before; + var on = adt$2.on; + var after$2 = adt$2.after; + var Situ = { + before: before$2, + on: on, + after: after$2, + cata: cata$1, + getStart: getStart + }; + + var adt$3 = Adt.generate([ + { domRange: ['rng'] }, + { + relative: [ + 'startSitu', + 'finishSitu' + ] + }, + { + exact: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + } + ]); + var exactFromRange = function (simRange) { + return adt$3.exact(simRange.start(), simRange.soffset(), simRange.finish(), simRange.foffset()); + }; + var getStart$1 = function (selection) { + return selection.match({ + domRange: function (rng) { + return Element.fromDom(rng.startContainer); + }, + relative: function (startSitu, finishSitu) { + return Situ.getStart(startSitu); + }, + exact: function (start, soffset, finish, foffset) { + return start; + } + }); + }; + var domRange = adt$3.domRange; + var relative = adt$3.relative; + var exact = adt$3.exact; + var getWin = function (selection) { + var start = getStart$1(selection); + return defaultView(start); + }; + var range$1 = SimRange.create; + var Selection = { + 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) { + 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: constant(rect.left), + top: constant(rect.top), + right: constant(rect.right), + bottom: constant(rect.bottom), + width: constant(rect.width), + height: constant(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 ? Option.some(rect).map(toRect) : Option.none(); + }; + + var adt$4 = Adt.generate([ + { + ltr: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + }, + { + rtl: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + } + ]); + var fromRange = function (win, type, range) { + return type(Element.fromDom(range.startContainer), range.startOffset, Element.fromDom(range.endContainer), range.endOffset); + }; + var getRanges = function (win, selection) { + return selection.match({ + domRange: function (rng) { + return { + ltr: constant(rng), + rtl: Option.none + }; + }, + relative: function (startSitu, finishSitu) { + return { + ltr: cached(function () { + return relativeToNative(win, startSitu, finishSitu); + }), + rtl: cached(function () { + return Option.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 Option.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$4.rtl(Element.fromDom(rev.endContainer), rev.endOffset, Element.fromDom(rev.startContainer), rev.startOffset); + }).getOrThunk(function () { + return fromRange(win, adt$4.ltr, rng); + }); + } else { + return fromRange(win, adt$4.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 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) ? Option.some(rect) : Option.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) : Option.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 Option.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 Option.from(doc.dom().caretPositionFromPoint(x, y)).bind(function (pos) { + if (pos.offsetNode === null) { + return Option.none(); + } + var r = doc.dom().createRange(); + r.setStart(pos.offsetNode, pos.offset); + r.collapse(); + return Option.some(r); + }); + }; + var caretRangeFromPoint = function (doc, x, y) { + return Option.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 Element.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 = Element.fromDom(win.document); + return availableSearch(doc, x, y).map(function (rng) { + return SimRange.create(Element.fromDom(rng.startContainer), rng.startOffset, Element.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 Selection.relative(start, finish); + }; + var preprocessExact = function (start, soffset, finish, foffset) { + var startSitu = beforeSpecial(start, soffset); + var finishSitu = beforeSpecial(finish, foffset); + return Selection.relative(startSitu, finishSitu); + }; + var preprocess = function (selection) { + return selection.match({ + domRange: function (rng) { + var start = Element.fromDom(rng.startContainer); + var finish = Element.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 doSetNativeRange = function (win, rng) { + Option.from(win.getSelection()).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) { + var selection = win.getSelection(); + 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 = Selection.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 Option.some(SimRange.create(Element.fromDom(firstRng.startContainer), firstRng.startOffset, Element.fromDom(lastRng.endContainer), lastRng.endOffset)); + } else { + return Option.none(); + } + }; + var doGetExact = function (selection) { + var anchor = Element.fromDom(selection.anchorNode); + var focus = Element.fromDom(selection.focusNode); + return after$3(anchor, selection.anchorOffset, focus, selection.focusOffset) ? Option.some(SimRange.create(anchor, selection.anchorOffset, focus, selection.focusOffset)) : readRange(selection); + }; + var setToElement = function (win, element) { + var rng = selectNodeContents(win, element); + doSetNativeRange(win, rng); + }; + var getExact = function (win) { + return Option.from(win.getSelection()).filter(function (sel) { + return sel.rangeCount > 0; + }).bind(doGetExact); + }; + var get$a = function (win) { + return getExact(win).map(function (range) { + return Selection.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) { + var selection = win.getSelection(); + selection.removeAllRanges(); + }; + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.VK'); + + var forward = function (editor, isRoot, cell, lazyWire) { + return go(editor, isRoot, CellNavigation.next(cell), lazyWire); + }; + var backward = function (editor, isRoot, cell, lazyWire) { + return go(editor, isRoot, CellNavigation.prev(cell), lazyWire); + }; + var getCellFirstCursorPosition = function (editor, cell) { + var selection = Selection.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, lazyWire) { + return cell.fold(Option.none, Option.none, function (current, next) { + return first(next).map(function (cell) { + return getCellFirstCursorPosition(editor, cell); + }); + }, function (current) { + return TableLookup.table(current, isRoot).bind(function (table) { + var targets = TableTargets.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, lazyWire) { + 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 = Element.fromDom(rng.startContainer); + TableLookup.cell(start, isRoot_1).each(function (cell) { + event.preventDefault(); + var navigation = event.shiftKey ? backward : forward; + var rng = navigation(editor, isRoot_1, cell, actions, lazyWire); + rng.each(function (range) { + editor.selection.setRng(range); + }); + }); + } + } + }; + var TabContext = { handle: handle$1 }; + + var create$4 = Immutable('selection', 'kill'); + var Response = { create: create$4 }; + + var create$5 = function (start, soffset, finish, foffset) { + return { + start: constant(Situ.on(start, soffset)), + finish: constant(Situ.on(finish, foffset)) + }; + }; + var Situs = { create: create$5 }; + + var convertToRange = function (win, selection) { + var rng = asLtrRange(win, selection); + return SimRange.create(Element.fromDom(rng.startContainer), rng.startOffset, Element.fromDom(rng.endContainer), rng.endOffset); + }; + var makeSitus = Situs.create; + var Util = { + convertToRange: convertToRange, + makeSitus: makeSitus + }; + + 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$5(container, isRoot, s, f, selectRange); + }); + }); + } else { + return Option.none(); + } + }; + var detect$5 = function (container, isRoot, start, finish, selectRange) { + if (!eq(start, finish)) { + return CellSelection.identify(start, finish, isRoot).bind(function (cellSel) { + var boxes = cellSel.boxes().getOr([]); + if (boxes.length > 0) { + selectRange(container, boxes, cellSel.start(), cellSel.finish()); + return Option.some(Response.create(Option.some(Util.makeSitus(start, 0, start, getEnd(start))), true)); + } else { + return Option.none(); + } + }); + } else { + return Option.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 CellSelection.shiftSelection(selected, rows, columns, annotations.firstSelectedSelector(), annotations.lastSelectedSelector()).map(updateSelection); + }; + var KeySelection = { + sync: sync, + detect: detect$5, + update: update + }; + + var traverse = Immutable('item', '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: Option.none() + }, + { + current: sidestep, + next: advance, + fallback: Option.some(backtrack) + }, + { + current: advance, + next: advance, + fallback: Option.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 ? Option.some(children[children.length - 1]) : Option.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 ? Option.some(children[0]) : Option.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 Option.none(); + } else { + return predicate(n.item()) ? Option.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$2 = DomUniverse(); + var before$4 = function (element, isRoot) { + return before$3(universe$2, element, isRoot); + }; + var after$5 = function (element, isRoot) { + return after$4(universe$2, element, isRoot); + }; + var seekLeft$1 = function (element, predicate, isRoot) { + return seekLeft(universe$2, element, predicate, isRoot); + }; + var seekRight$1 = function (element, predicate, isRoot) { + return seekRight(universe$2, element, predicate, isRoot); + }; + + var ancestor$2 = function (scope, predicate, isRoot) { + return ancestor(scope, predicate, isRoot).isSome(); + }; + + var point = Immutable('element', 'offset'); + var delta = Immutable('element', 'deltaOffset'); + var range$2 = Immutable('element', 'start', 'finish'); + var points = Immutable('begin', 'end'); + var text = Immutable('element', 'text'); + + var adt$5 = 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 DomParent.sharedOne(isRow, [ + afterCell, + beforeCell + ]).fold(function () { + return isOverlapping(bridge, beforeCell, afterCell) ? adt$5.success() : failure(beforeCell); + }, function (_sharedRow) { + return failure(beforeCell); + }); + } else { + return eq(after, afterCell) && getEnd(afterCell) === afterOffset ? failure(beforeCell) : adt$5.none('in same cell'); + } + }); + }).getOr(adt$5.none('default')); + }; + var cata$2 = function (subject, onNone, onSuccess, onFailedUp, onFailedDown) { + return subject.fold(onNone, onSuccess, onFailedUp, onFailedDown); + }; + var BeforeAfter = __assign(__assign({}, adt$5), { + verify: verify, + cata: cata$2 + }); + + var inAncestor = Immutable('ancestor', 'descendants', 'element', 'index'); + var inParent = Immutable('parent', 'children', 'element', '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) : Option.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: constant(tgt), + finish: constant(tgt) + }; + }); + }; + var process = function (analysis) { + return BeforeAfter.cata(analysis, function (message) { + return Option.none(); + }, function () { + return Option.none(); + }, function (cell) { + return Option.some(point(cell, 0)); + }, function (cell) { + return Option.some(point(cell, getEnd(cell))); + }); + }; + var BrTags = { + tryBr: tryBr, + process: process + }; + + var nu$3 = MixedBag([ + 'left', + 'top', + 'right', + 'bottom' + ], []); + var moveDown = function (caret, amount) { + return nu$3({ + left: caret.left(), + top: caret.top() + amount, + right: caret.right(), + bottom: caret.bottom() + amount + }); + }; + var moveUp = function (caret, amount) { + return nu$3({ + left: caret.left(), + top: caret.top() - amount, + right: caret.right(), + bottom: caret.bottom() - amount + }); + }; + var moveBottomTo = function (caret, bottom) { + var height = caret.bottom() - caret.top(); + return nu$3({ + left: caret.left(), + top: bottom - height, + right: caret.right(), + bottom: bottom + }); + }; + var moveTopTo = function (caret, top) { + var height = caret.bottom() - caret.top(); + return nu$3({ + left: caret.left(), + top: top, + right: caret.right(), + bottom: top + height + }); + }; + var translate = function (caret, xDelta, yDelta) { + return nu$3({ + 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 toString = function (caret) { + return '(' + caret.left() + ', ' + caret.top() + ') -> (' + caret.right() + ', ' + caret.bottom() + ')'; + }; + var Carets = { + nu: nu$3, + moveUp: moveUp, + moveDown: moveDown, + moveBottomTo: moveBottomTo, + moveTopTo: moveTopTo, + getTop: getTop$1, + getBottom: getBottom, + translate: translate, + toString: toString + }; + + 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 Option.none(); + }; + var toCaret = function (rect) { + return Carets.nu({ + left: rect.left, + top: rect.top, + right: rect.right, + bottom: rect.bottom + }); + }; + var getElemBox = function (bridge, element) { + return Option.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 Option.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 Option.none(); + } + }; + var Rectangles = { + getBoxAt: getBoxAt, + getEntireBox: getEntireBox + }; + + var JUMP_SIZE = 5; + var NUM_RETRIES = 100; + var adt$6 = 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, DomStructure.isBlock).fold(constant(false), function (cell) { + return Rectangles.getEntireBox(bridge, cell).exists(function (box) { + return isOutside(caret, box); + }); + }); + }; + var adjustDown = function (bridge, element, guessBox, original, caret) { + var lowerCaret = Carets.moveDown(caret, JUMP_SIZE); + if (Math.abs(guessBox.bottom() - original.bottom()) < 1) { + return adt$6.retry(lowerCaret); + } else if (guessBox.top() > caret.bottom()) { + return adt$6.retry(lowerCaret); + } else if (guessBox.top() === caret.bottom()) { + return adt$6.retry(Carets.moveDown(caret, 1)); + } else { + return inOutsideBlock(bridge, element, caret) ? adt$6.retry(Carets.translate(lowerCaret, JUMP_SIZE, 0)) : adt$6.none(); + } + }; + var adjustUp = function (bridge, element, guessBox, original, caret) { + var higherCaret = Carets.moveUp(caret, JUMP_SIZE); + if (Math.abs(guessBox.top() - original.top()) < 1) { + return adt$6.retry(higherCaret); + } else if (guessBox.bottom() < caret.top()) { + return adt$6.retry(higherCaret); + } else if (guessBox.bottom() === caret.top()) { + return adt$6.retry(Carets.moveUp(caret, 1)); + } else { + return inOutsideBlock(bridge, element, caret) ? adt$6.retry(Carets.translate(higherCaret, JUMP_SIZE, 0)) : adt$6.none(); + } + }; + var upMovement = { + point: Carets.getTop, + adjuster: adjustUp, + move: Carets.moveUp, + gather: before$4 + }; + var downMovement = { + point: Carets.getBottom, + adjuster: adjustDown, + move: Carets.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 Option.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(Option.none, function (element) { + return Rectangles.getEntireBox(bridge, element).bind(function (guessBox) { + return movement.adjuster(bridge, element, guessBox, original, caret).fold(Option.none, function (newCaret) { + return adjustTil(bridge, movement, original, newCaret, numRetries - 1); + }); + }).orThunk(function () { + return Option.some(caret); + }); + }, Option.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 Option.some(movement.point(adjusted) - bridge.getInnerHeight()); + } else if (movement.point(adjusted) < 0) { + return Option.some(-movement.point(adjusted)); + } else { + return Option.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 platform$2 = detect$3(); + var findSpot = function (bridge, isRoot, direction) { + return bridge.getSelection().bind(function (sel) { + return BrTags.tryBr(isRoot, sel.finish(), sel.foffset(), direction).fold(function () { + return Option.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 BrTags.process(analysis); + }); + }); + }; + var scan = function (bridge, isRoot, element, offset, direction, numRetries) { + if (numRetries === 0) { + return Option.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 Option.none(); + }, function () { + return Option.some(situs); + }, function (cell) { + if (eq(element, cell) && offset === 0) { + return tryAgain(bridge, element, offset, Carets.moveUp, direction); + } else { + return scan(bridge, isRoot, cell, 0, direction, numRetries - 1); + } + }, function (cell) { + if (eq(element, cell) && offset === getEnd(cell)) { + return tryAgain(bridge, element, offset, Carets.moveDown, direction); + } else { + return scan(bridge, isRoot, cell, getEnd(cell), direction, numRetries - 1); + } + }); + }); + }; + var tryAgain = function (bridge, element, offset, move, direction) { + return Rectangles.getBoxAt(bridge, element, offset).bind(function (box) { + return tryAt(bridge, direction, move(box, Retries.getJumpSize())); + }); + }; + var tryAt = function (bridge, direction, box) { + if (platform$2.browser.isChrome() || platform$2.browser.isSafari() || platform$2.browser.isFirefox() || platform$2.browser.isEdge()) { + return direction.otherRetry(bridge, box); + } else if (platform$2.browser.isIE()) { + return direction.ieRetry(bridge, box); + } else { + return Option.none(); + } + }; + var tryCursor = function (bridge, isRoot, element, offset, direction) { + return Rectangles.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(bridge, isRoot, spot.element(), spot.offset(), direction, MAX_RETRIES).map(bridge.fromSitus); + }); + }; + var TableKeys = { handle: handle$2 }; + + var detection = detect$3(); + 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 Option.none(); + } + return TableKeys.handle(bridge, isRoot, direction).bind(function (range) { + return closest$1(range.finish(), 'td,th', isRoot).map(function (finish) { + return { + start: constant(start), + finish: constant(finish), + range: constant(range) + }; + }); + }); + }); + }); + }; + var navigate = function (bridge, isRoot, direction, initial, anchor, precheck) { + if (detection.browser.isIE()) { + return Option.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(Option.some(Util.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(Option.some(Util.makeSitus(last, lastOffset, last, lastOffset)), true); + }); + } else { + return Option.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(Option.some(Util.makeSitus(first, 0, first, 0)), true); + }); + } else { + return Option.none(); + } + }); + }); + }; + var select = function (bridge, container, isRoot, direction, initial, anchor, selectRange) { + return simulate(bridge, isRoot, direction, initial, anchor).bind(function (info) { + return KeySelection.detect(container, isRoot, info.start(), info.finish(), selectRange); + }); + }; + var VerticalMovement = { + navigate: navigate, + select: select, + firstUpCheck: firstUpCheck, + lastDownCheck: lastDownCheck + }; + + var findCell = function (target, isRoot) { + return closest$1(target, 'td,th', isRoot); + }; + function MouseSelection (bridge, container, isRoot, annotations) { + var cursor = Option.none(); + var clearState = function () { + cursor = Option.none(); + }; + var mousedown = function (event) { + annotations.clear(container); + cursor = findCell(event.target(), isRoot); + }; + var mouseover = function (event) { + cursor.each(function (start) { + annotations.clearBeforeUpdate(container); + findCell(event.target(), isRoot).each(function (finish) { + CellSelection.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) { + cursor.each(clearState); + }; + return { + 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 KeyDirection = { + down: down, + up: up + }; + + 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 SelectionKeys = { + ltr: { + isBackward: isKey(37), + isForward: isKey(39) + }, + rtl: { + isBackward: isKey(39), + isForward: isKey(37) + }, + isUp: isUp, + isDown: isDown, + isNavigation: isNavigation + }; + + var toRaw = function (sr) { + return { + left: sr.left(), + top: sr.top(), + right: sr.right(), + bottom: sr.bottom(), + width: sr.width(), + height: sr.height() + }; + }; + var Rect = { toRaw: toRaw }; + + var isSafari = detect$3().browser.isSafari(); + var get$b = function (_DOC) { + var doc = _DOC !== undefined ? _DOC.dom() : domGlobals.document; + var x = doc.body.scrollLeft || doc.documentElement.scrollLeft; + var y = doc.body.scrollTop || doc.documentElement.scrollTop; + return Position(x, y); + }; + var by = function (x, y, _DOC) { + var doc = _DOC !== undefined ? _DOC.dom() : domGlobals.document; + var win = doc.defaultView; + win.scrollBy(x, y); + }; + + var WindowBridge = function (win) { + var elementFromPoint = function (x, y) { + return Element.fromPoint(Element.fromDom(win.document), x, y); + }; + var getRect = function (element) { + return element.dom().getBoundingClientRect(); + }; + var getRangedRect = function (start, soffset, finish, foffset) { + var sel = Selection.exact(start, soffset, finish, foffset); + return getFirstRect$1(win, sel).map(Rect.toRaw); + }; + var getSelection = function () { + return get$a(win).map(function (exactAdt) { + return Util.convertToRange(win, exactAdt); + }); + }; + var fromSitus = function (situs) { + var relative = Selection.relative(situs.start(), situs.finish()); + return Util.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$a(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$b(Element.fromDom(win.document)); + return pos.top(); + }; + var scrollBy = function (x, y) { + by(x, y, Element.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 = Immutable('rows', 'cols'); + var mouse = function (win, container, isRoot, annotations) { + var bridge = WindowBridge(win); + var handlers = MouseSelection(bridge, container, isRoot, annotations); + return { + 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 Option.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 = CellSelection.retrieve(container, annotations.selectedSelector()).fold(function () { + if (SelectionKeys.isDown(keycode) && shiftKey) { + return curry(VerticalMovement.select, bridge, container, isRoot, KeyDirection.down, finish, start, annotations.selectRange); + } else if (SelectionKeys.isUp(keycode) && shiftKey) { + return curry(VerticalMovement.select, bridge, container, isRoot, KeyDirection.up, finish, start, annotations.selectRange); + } else if (SelectionKeys.isDown(keycode)) { + return curry(VerticalMovement.navigate, bridge, isRoot, KeyDirection.down, finish, start, VerticalMovement.lastDownCheck); + } else if (SelectionKeys.isUp(keycode)) { + return curry(VerticalMovement.navigate, bridge, isRoot, KeyDirection.up, finish, start, VerticalMovement.firstUpCheck); + } else { + return Option.none; + } + }, function (selected) { + var update = function (attempts) { + return function () { + var navigation = findMap(attempts, function (delta) { + return KeySelection.update(delta.rows(), delta.cols(), container, selected, annotations); + }); + return navigation.fold(function () { + return CellSelection.getEdges(container, annotations.firstSelectedSelector(), annotations.lastSelectedSelector()).map(function (edges) { + var relative = SelectionKeys.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(Option.none(), true); + }); + }, function (_) { + return Option.some(Response.create(Option.none(), true)); + }); + }; + }; + if (SelectionKeys.isDown(keycode) && shiftKey) { + return update([rc(+1, 0)]); + } else if (SelectionKeys.isUp(keycode) && shiftKey) { + return update([rc(-1, 0)]); + } else if (direction.isBackward(keycode) && shiftKey) { + return update([ + rc(0, -1), + rc(-1, 0) + ]); + } else if (direction.isForward(keycode) && shiftKey) { + return update([ + rc(0, +1), + rc(+1, 0) + ]); + } else if (SelectionKeys.isNavigation(keycode) && shiftKey === false) { + return clearToNavigate; + } else { + return Option.none; + } + }); + return handler(); + }; + var keyup = function (event, start, soffset, finish, foffset) { + return CellSelection.retrieve(container, annotations.selectedSelector()).fold(function () { + var realEvent = event.raw(); + var keycode = realEvent.which; + var shiftKey = realEvent.shiftKey === true; + if (shiftKey === false) { + return Option.none(); + } + if (SelectionKeys.isNavigation(keycode)) { + return KeySelection.sync(container, isRoot, start, soffset, finish, foffset, annotations.selectRange); + } else { + return Option.none(); + } + }, Option.none); + }; + return { + keydown: keydown, + keyup: keyup + }; + }; + var external = function (win, container, isRoot, annotations) { + var bridge = WindowBridge(win); + return function (start, finish) { + annotations.clearBeforeUpdate(container); + CellSelection.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 InputHandlers = { + mouse: mouse, + keyboard: keyboard, + external: external + }; + + var remove$7 = function (element, classes) { + each(classes, function (x) { + remove$5(element, x); + }); + }; + + var addClass = function (clazz) { + return function (element) { + add$2(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$2(start, ephemera.firstSelected()); + add$2(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 list = DetailsList.fromTable(table); + var house = Warehouse.generate(list); + var details = onCells(house, target); + return details.map(function (selectedCells) { + var grid = Transitions.toGrid(house, generators, false); + var upOrLeftCells = getUpOrLeftCells(grid, selectedCells, generators); + var downOrRightCells = getDownOrRightCells(grid, selectedCells, generators); + return { + upOrLeftCells: upOrLeftCells, + downOrRightCells: downOrRightCells + }; + }); + }; + var OtherCells = { getOtherCells: getOtherCells }; + + var hasInternalTarget = function (e) { + return has$2(Element.fromDom(e.target), 'ephox-snooker-resizer-bar') === false; + }; + function CellSelection$1 (editor, lazyResize, selectionTargets) { + var handlerStruct = MixedBag([ + 'mousedown', + 'mouseover', + 'mouseup', + 'keyup', + 'keydown' + ], []); + var handlers = Option.none(); + var cloneFormats = getCloneElements(editor); + var onSelection = function (cells, start, finish) { + selectionTargets.targets().each(function (targets) { + var tableOpt = TableLookup.table(start); + tableOpt.each(function (table) { + var doc = Element.fromDom(editor.getDoc()); + var generators = TableFill.cellOperations(noop, doc, cloneFormats); + var otherCells = OtherCells.getOtherCells(table, targets, generators); + fireTableSelectionChange(editor, cells, start, finish, otherCells); + }); + }); + }; + var onClear = function () { + 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 = Element.fromDom(sel.getStart()); + var end = Element.fromDom(sel.getEnd()); + var shared = DomParent.sharedOne(TableLookup.table, [ + start, + end + ]); + shared.fold(function () { + annotations.clear(body); + }, noop); + }; + var mouseHandlers = InputHandlers.mouse(win, body, isRoot, annotations); + var keyHandlers = InputHandlers.keyboard(win, body, isRoot, annotations); + var external = InputHandlers.external(win, body, isRoot, annotations); + var hasShiftKey = function (event) { + return event.raw().shiftKey === true; + }; + editor.on('TableSelectorChange', function (e) { + external(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 = Selection.relative(ns.start(), ns.finish()); + var rng = asLtrRange(win, relative); + editor.selection.setRng(rng); + }); + }; + var keyup = function (event) { + var wrappedEvent = wrapEvent(event); + if (wrappedEvent.raw().shiftKey && SelectionKeys.isNavigation(wrappedEvent.raw().which)) { + var rng = editor.selection.getRng(); + var start = Element.fromDom(rng.startContainer); + var end = Element.fromDom(rng.endContainer); + keyHandlers.keyup(wrappedEvent, start, rng.startOffset, end, rng.endOffset).each(function (response) { + handleResponse(wrappedEvent, response); + }); + } + }; + var keydown = function (event) { + var wrappedEvent = wrapEvent(event); + lazyResize().each(function (resize) { + resize.hideBars(); + }); + var rng = editor.selection.getRng(); + var startContainer = Element.fromDom(editor.selection.getStart()); + var start = Element.fromDom(rng.startContainer); + var end = Element.fromDom(rng.endContainer); + var direction = Direction.directionAt(startContainer).isRtl() ? SelectionKeys.rtl : SelectionKeys.ltr; + keyHandlers.keydown(wrappedEvent, start, rng.startOffset, end, rng.endOffset, direction).each(function (response) { + handleResponse(wrappedEvent, response); + }); + lazyResize().each(function (resize) { + resize.showBars(); + }); + }; + var isMouseEvent = function (event) { + return event.hasOwnProperty('x') && event.hasOwnProperty('y'); + }; + var wrapEvent = function (event) { + var target = Element.fromDom(event.target); + var stop = function () { + event.stopPropagation(); + }; + var prevent = function () { + event.preventDefault(); + }; + var kill = compose(prevent, stop); + return { + target: constant(target), + x: constant(isMouseEvent(event) ? event.x : null), + y: constant(isMouseEvent(event) ? event.y : null), + stop: stop, + prevent: prevent, + kill: kill, + raw: constant(event) + }; + }; + var isLeftMouse = function (raw) { + return raw.button === 0; + }; + var isLeftButtonPressed = function (raw) { + if (raw.buttons === undefined) { + return true; + } + return (raw.buttons & 1) !== 0; + }; + var mouseDown = function (e) { + if (isLeftMouse(e) && hasInternalTarget(e)) { + mouseHandlers.mousedown(wrapEvent(e)); + } + }; + var mouseOver = function (e) { + if (isLeftButtonPressed(e) && hasInternalTarget(e)) { + mouseHandlers.mouseover(wrapEvent(e)); + } + }; + var mouseUp = function (e) { + if (isLeftMouse(e) && hasInternalTarget(e)) { + mouseHandlers.mouseup(wrapEvent(e)); + } + }; + var getDoubleTap = function () { + var lastTarget = Cell(Element.fromDom(body)); + var lastTimeStamp = Cell(0); + var touchEnd = function (t) { + var target = Element.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(target, target); + } + } + lastTarget.set(target); + lastTimeStamp.set(t.timeStamp); + }; + return { touchEnd: touchEnd }; + }; + var doubleTap = getDoubleTap(); + 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); + handlers = Option.some(handlerStruct({ + mousedown: mouseDown, + mouseover: mouseOver, + mouseup: mouseUp, + keyup: keyup, + keydown: keydown + })); + }); + var destroy = function () { + handlers.each(function (handlers) { + }); + }; + return { + clear: annotations.clear, + destroy: destroy + }; + } + + var Selections = function (editor) { + var get = function () { + var body = getBody$1(editor); + return TableSelection.retrieve(body, Ephemera.selectedSelector()).fold(function () { + if (editor.selection.getStart() === undefined) { + return SelectionTypes.none(); + } else { + return SelectionTypes.single(editor.selection); + } + }, function (cells) { + return SelectionTypes.multiple(cells); + }); + }; + return { get: get }; + }; + + var getSelectionTargets = function (editor, selections) { + var targets = Cell(Option.none()); + var changeHandlers = Cell([]); + var findTargets = function () { + return getSelectionStartCellOrCaption(editor).bind(function (cellOrCaption) { + var table = TableLookup.table(cellOrCaption); + return table.map(function (table) { + if (name(cellOrCaption) === 'caption') { + return TableTargets.notCell(cellOrCaption); + } else { + return TableTargets.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 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 TableSelectorChange', resetTargets); + return { + onSetupTable: onSetupTable, + onSetupCellOrRow: onSetupCellOrRow, + onSetupMergeable: onSetupMergeable, + onSetupUnmergeable: onSetupUnmergeable, + resetTargets: resetTargets, + targets: function () { + return targets.get(); + } + }; + }; + + var addButtons = function (editor, selectionTargets) { + 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', + onAction: cmd('mceTableCutRow'), + icon: 'temporary-placeholder', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tablecopyrow', { + tooltip: 'Copy row', + onAction: cmd('mceTableCopyRow'), + icon: 'temporary-placeholder', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tablepasterowbefore', { + tooltip: 'Paste row before', + onAction: cmd('mceTablePasteRowBefore'), + icon: 'temporary-placeholder', + onSetup: selectionTargets.onSetupCellOrRow + }); + editor.ui.registry.addButton('tablepasterowafter', { + tooltip: 'Paste row after', + onAction: cmd('mceTablePasteRowAfter'), + icon: 'temporary-placeholder', + onSetup: selectionTargets.onSetupCellOrRow + }); + 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 Buttons = { + addButtons: addButtons, + addToolbars: addToolbars + }; + + var addMenuItems = function (editor, selectionTargets) { + 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 () { + InsertTable.insert(editor, numColumns, numRows); + }); + 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') + }; + var rowItems = [ + { + type: 'menuitem', + text: 'Insert row before', + icon: 'table-insert-row-above', + onAction: cmd('mceTableInsertRowBefore'), + onSetup: selectionTargets.onSetupCellOrRow + }, + { + type: 'menuitem', + text: 'Insert row after', + icon: 'table-insert-row-after', + onAction: cmd('mceTableInsertRowAfter'), + onSetup: selectionTargets.onSetupCellOrRow + }, + { + type: 'menuitem', + text: 'Delete row', + icon: 'table-delete-row', + onAction: cmd('mceTableDeleteRow'), + onSetup: selectionTargets.onSetupCellOrRow + }, + { + type: 'menuitem', + text: 'Row properties', + icon: 'table-row-properties', + onAction: cmd('mceTableRowProps'), + onSetup: selectionTargets.onSetupCellOrRow + }, + { type: 'separator' }, + { + type: 'menuitem', + text: 'Cut row', + onAction: cmd('mceTableCutRow'), + onSetup: selectionTargets.onSetupCellOrRow + }, + { + type: 'menuitem', + text: 'Copy row', + onAction: cmd('mceTableCopyRow'), + onSetup: selectionTargets.onSetupCellOrRow + }, + { + type: 'menuitem', + text: 'Paste row before', + onAction: cmd('mceTablePasteRowBefore'), + onSetup: selectionTargets.onSetupCellOrRow + }, + { + type: 'menuitem', + text: 'Paste row after', + onAction: cmd('mceTablePasteRowAfter'), + onSetup: selectionTargets.onSetupCellOrRow + } + ]; + var row = { + type: 'nestedmenuitem', + text: 'Row', + getSubmenuItems: function () { + return rowItems; + } + }; + var columnItems = [ + { + type: 'menuitem', + text: 'Insert column before', + icon: 'table-insert-column-before', + onAction: cmd('mceTableInsertColBefore'), + onSetup: selectionTargets.onSetupCellOrRow + }, + { + type: 'menuitem', + text: 'Insert column after', + icon: 'table-insert-column-after', + onAction: cmd('mceTableInsertColAfter'), + onSetup: selectionTargets.onSetupCellOrRow + }, + { + type: 'menuitem', + text: 'Delete column', + icon: 'table-delete-column', + onAction: cmd('mceTableDeleteCol'), + onSetup: selectionTargets.onSetupCellOrRow + } + ]; + var column = { + type: 'nestedmenuitem', + text: 'Column', + getSubmenuItems: function () { + return columnItems; + } + }; + var cellItems = [ + { + type: 'menuitem', + text: 'Cell properties', + icon: 'table-cell-properties', + onAction: cmd('mceTableCellProps'), + onSetup: selectionTargets.onSetupCellOrRow + }, + { + type: 'menuitem', + text: 'Merge cells', + icon: 'table-merge-cells', + onAction: cmd('mceTableMergeCells'), + onSetup: selectionTargets.onSetupMergeable + }, + { + type: 'menuitem', + text: 'Split cell', + icon: 'table-split-cells', + onAction: cmd('mceTableSplitCells'), + onSetup: selectionTargets.onSetupUnmergeable + } + ]; + var cell = { + type: 'nestedmenuitem', + text: 'Cell', + getSubmenuItems: function () { + return cellItems; + } + }; + 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'; + } + }); + } + }); + }; + var MenuItems = { addMenuItems: addMenuItems }; + + var getClipboardRows = function (clipboardRows) { + return clipboardRows.get().fold(function () { + return; + }, function (rows) { + return map(rows, function (row) { + return row.dom(); + }); + }); + }; + var setClipboardRows = function (rows, clipboardRows) { + var sugarRows = map(rows, Element.fromDom); + clipboardRows.set(Option.from(sugarRows)); + }; + var getApi = function (editor, clipboardRows, resizeHandler, selectionTargets) { + return { + insertTable: function (columns, rows) { + return InsertTable.insert(editor, columns, rows); + }, + setClipboardRows: function (rows) { + return setClipboardRows(rows, clipboardRows); + }, + getClipboardRows: function () { + return getClipboardRows(clipboardRows); + }, + resizeHandler: resizeHandler, + selectionTargets: selectionTargets + }; + }; + + function Plugin(editor) { + var selections = Selections(editor); + var selectionTargets = getSelectionTargets(editor, selections); + var resizeHandler = getResizeHandler(editor); + var cellSelection = CellSelection$1(editor, resizeHandler.lazyResize, selectionTargets); + var actions = TableActions(editor, resizeHandler.lazyWire); + var clipboardRows = Cell(Option.none()); + Commands.registerCommands(editor, actions, cellSelection, selections, clipboardRows); + Clipboard.registerEvents(editor, selections, actions, cellSelection); + MenuItems.addMenuItems(editor, selectionTargets); + Buttons.addButtons(editor, selectionTargets); + Buttons.addToolbars(editor); + editor.on('PreInit', function () { + editor.serializer.addTempAttr(Ephemera.firstSelected()); + editor.serializer.addTempAttr(Ephemera.lastSelected()); + }); + if (hasTabNavigation(editor)) { + editor.on('keydown', function (e) { + TabContext.handle(e, editor, actions, resizeHandler.lazyWire); + }); + } + editor.on('remove', function () { + resizeHandler.destroy(); + cellSelection.destroy(); + }); + return getApi(editor, clipboardRows, resizeHandler, selectionTargets); + } + function Plugin$1 () { + global.add('table', Plugin); + } + + Plugin$1(); + +}(window)); diff --git a/lib/tinymce/js/tinymce/plugins/table/plugin.min.js b/lib/tinymce/js/tinymce/plugins/table/plugin.min.js index fb6152f9..a6780939 100644 --- a/lib/tinymce/js/tinymce/plugins/table/plugin.min.js +++ b/lib/tinymce/js/tinymce/plugins/table/plugin.min.js @@ -1 +1,9 @@ -(function(e,t){"use strict";function n(e,t){for(var n,o=[],r=0;e.length>r;++r){if(n=i[e[r]]||l(e[r]),!n)throw"module definition dependecy not found: "+e[r];o.push(n)}t.apply(null,o)}function o(e,o,r){if("string"!=typeof e)throw"invalid module definition, module id must be defined and be a string";if(o===t)throw"invalid module definition, dependencies must be specified";if(r===t)throw"invalid module definition, definition function must be specified";n(o,function(){i[e]=r.apply(null,arguments)})}function r(e){return!!i[e]}function l(t){for(var n=e,o=t.split(/[.\/]/),r=0;o.length>r;++r){if(!n[o[r]])return;n=n[o[r]]}return n}function a(n){for(var o=0;n.length>o;o++){for(var r=e,l=n[o],a=l.split(/[.\/]/),c=0;a.length-1>c;++c)r[a[c]]===t&&(r[a[c]]={}),r=r[a[c]];r[a[a.length-1]]=i[l]}}var i={},c="tinymce/tableplugin/TableGrid",s="tinymce/util/Tools",d="tinymce/Env",u="tinymce/tableplugin/Quirks",f="tinymce/util/VK",m="tinymce/tableplugin/CellSelection",g="tinymce/dom/TreeWalker",p="tinymce/tableplugin/Plugin",h="tinymce/PluginManager";o(c,[s,d],function(e,n){function o(e,t){return parseInt(e.getAttribute(t)||1,10)}var r=e.each;return function(l,a){function i(){var e=0;I=[],r(["thead","tbody","tfoot"],function(t){var n=E.select("> "+t+" tr",a);r(n,function(n,l){l+=e,r(E.select("> td, > th",n),function(e,n){var r,a,i,c;if(I[l])for(;I[l][n];)n++;for(i=o(e,"rowspan"),c=o(e,"colspan"),a=l;l+i>a;a++)for(I[a]||(I[a]=[]),r=n;n+c>r;r++)I[a][r]={part:t,real:a==l&&r==n,elm:e,rowspan:i,colspan:c}})}),e+=n.length})}function c(e,t){return e=e.cloneNode(t),e.removeAttribute("id"),e}function s(e,n){var o;return o=I[n],o?o[e]:t}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&&(E.hasClass(e.elm,"mce-item-selected")||e==D)}function f(){var e=[];return r(a.rows,function(n){r(n.cells,function(o){return E.hasClass(o,"mce-item-selected")||o==D.elm?(e.push(n),!1):t})}),e}function m(){var e=E.createRng();e.setStartAfter(a),e.setEndAfter(a),l.setRng(e),E.remove(a)}function g(o){var l;return e.walk(o,function(e){var a;return 3==e.nodeType?(r(E.getParents(e.parentNode,null,o).reverse(),function(e){e=c(e,!1),l?a&&a.appendChild(e):l=a=e,a=e}),a&&(a.innerHTML=n.ie?" ":'
    '),!1):t},"childNodes"),o=c(o,!1),d(o,"rowSpan",1),d(o,"colSpan",1),l?o.appendChild(l):n.ie||(o.innerHTML='
    '),o}function p(){var e=E.createRng(),n;return r(E.select("tr",a),function(e){0===e.cells.length&&E.remove(e)}),0===E.select("tr",a).length?(e.setStartAfter(a),e.setEndAfter(a),l.setRng(e),E.remove(a),t):(r(E.select("thead,tbody,tfoot",a),function(e){0===e.rows.length&&E.remove(e)}),i(),n=I[Math.min(I.length-1,k.y)],n&&(l.select(n[Math.min(n.length-1,k.x)].elm,!0),l.collapse(!0)),t)}function h(e,t,n,o){var r,l,a,i,c;for(r=I[t][e].elm.parentNode,a=1;n>=a;a++)if(r=E.getNext(r,"tr")){for(l=e;l>=0;l--)if(c=I[t+a][l].elm,c.parentNode==r){for(i=1;o>=i;i++)E.insertAfter(g(c),c);break}if(-1==l)for(i=1;o>=i;i++)r.insertBefore(g(r.cells[0]),r.cells[0])}}function b(){r(I,function(e,t){r(e,function(e,n){var r,l,a;if(u(e)&&(e=e.elm,r=o(e,"colspan"),l=o(e,"rowspan"),r>1||l>1)){for(d(e,"rowSpan",1),d(e,"colSpan",1),a=0;r-1>a;a++)E.insertAfter(g(e),e);h(n,t,l-1,r)}})})}function v(t,n,o){var l,a,c,f,m,g,h,v,w,x,y;if(t?(l=P(t),a=l.x,c=l.y,f=a+(n-1),m=c+(o-1)):(k=M=null,r(I,function(e,t){r(e,function(e,n){u(e)&&(k||(k={x:n,y:t}),M={x:n,y:t})})}),a=k.x,c=k.y,f=M.x,m=M.y),v=s(a,c),w=s(f,m),v&&w&&v.part==w.part){for(b(),i(),v=s(a,c).elm,d(v,"colSpan",f-a+1),d(v,"rowSpan",m-c+1),h=c;m>=h;h++)for(g=a;f>=g;g++)I[h]&&I[h][g]&&(t=I[h][g].elm,t!=v&&(x=e.grep(t.childNodes),r(x,function(e){v.appendChild(e)}),x.length&&(x=e.grep(v.childNodes),y=0,r(x,function(e){"BR"==e.nodeName&&E.getAttrib(e,"data-mce-bogus")&&y++i;i++)if(I[n][i]&&(l=I[n][i].elm,l!=a)){if(e){if(n>0&&I[n-1][i]&&(p=I[n-1][i].elm,h=o(p,"rowSpan"),h>1)){d(p,"rowSpan",h+1);continue}}else if(h=o(l,"rowspan"),h>1){d(l,"rowSpan",h+1);continue}m=g(l),d(m,"colSpan",l.colSpan),f.appendChild(m),a=l}f.hasChildNodes()&&(e?s.parentNode.insertBefore(f,s):E.insertAfter(f,s))}function x(e){var n,l;r(I,function(o){return r(o,function(o,r){return u(o)&&(n=r,e)?!1:t}),e?!n:t}),r(I,function(t,r){var a,i,c;t[n]&&(a=t[n].elm,a!=l&&(c=o(a,"colspan"),i=o(a,"rowspan"),1==c?e?(a.parentNode.insertBefore(g(a),a),h(n,r,i-1,c)):(E.insertAfter(g(a),a),h(n,r,i-1,c)):d(a,"colSpan",a.colSpan+1),l=a))})}function y(){var t=[];r(I,function(n){r(n,function(n,l){u(n)&&-1===e.inArray(t,l)&&(r(I,function(e){var t=e[l].elm,n;n=o(t,"colSpan"),n>1?d(t,"colSpan",n-1):E.remove(t)}),t.push(l))})}),p()}function C(){function e(e){var t,n,l;t=E.getNext(e,"tr"),r(e.cells,function(e){var t=o(e,"rowSpan");t>1&&(d(e,"rowSpan",t-1),n=P(e),h(n.x,n.y,1,1))}),n=P(e.cells[0]),r(I[n.y],function(e){var t;e=e.elm,e!=l&&(t=o(e,"rowSpan"),1>=t?E.remove(e):d(e,"rowSpan",t-1),l=e)})}var t;t=f(),r(t.reverse(),function(t){e(t)}),p()}function R(){var e=f();return E.remove(e),p(),e}function N(){var e=f();return r(e,function(t,n){e[n]=c(t,!0)}),e}function T(e,n){var o=f(),l=o[n?0:o.length-1],a=l.cells.length;e&&(r(I,function(e){var n;return a=0,r(e,function(e){e.real&&(a+=e.colspan),e.elm.parentNode==l&&(n=1)}),n?!1:t}),n||e.reverse(),r(e,function(e){var t,o=e.cells.length,r;for(t=0;o>t;t++)r=e.cells[t],d(r,"colSpan",1),d(r,"rowSpan",1);for(t=o;a>t;t++)e.appendChild(g(e.cells[o-1]));for(t=a;o>t;t++)E.remove(e.cells[t]);n?l.parentNode.insertBefore(e,l):E.insertAfter(e,l)}),E.removeClass(E.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"))}function P(e){var n;return r(I,function(o,l){return r(o,function(o,r){return o.elm==e?(n={x:r,y:l},!1):t}),!n}),n}function S(e){k=P(e)}function A(){var e,t;return e=t=0,r(I,function(n,o){r(n,function(n,r){var l,a;u(n)&&(n=I[o][r],r>e&&(e=r),o>t&&(t=o),n.real&&(l=n.colspan-1,a=n.rowspan-1,l&&r+l>e&&(e=r+l),a&&o+a>t&&(t=o+a)))})}),{x:e,y:t}}function B(e){var t,n,o,r,l,a,i,c,s,d;if(M=P(e),k&&M){for(t=Math.min(k.x,M.x),n=Math.min(k.y,M.y),o=Math.max(k.x,M.x),r=Math.max(k.y,M.y),l=o,a=r,d=n;a>=d;d++)e=I[d][t],e.real||t>t-(e.colspan-1)&&(t-=e.colspan-1);for(s=t;l>=s;s++)e=I[n][s],e.real||n>n-(e.rowspan-1)&&(n-=e.rowspan-1);for(d=n;r>=d;d++)for(s=t;o>=s;s++)e=I[d][s],e.real&&(i=e.colspan-1,c=e.rowspan-1,i&&s+i>l&&(l=s+i),c&&d+c>a&&(a=d+c));for(E.removeClass(E.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),d=n;a>=d;d++)for(s=t;l>=s;s++)I[d][s]&&E.addClass(I[d][s].elm,"mce-item-selected")}}var I,k,M,D,E=l.dom;a=a||E.getParent(l.getNode(),"table"),i(),D=E.getParent(l.getStart(),"th,td"),D&&(k=P(D),M=A(),D=s(k.x,k.y)),e.extend(this,{deleteTable:m,split:b,merge:v,insertRow:w,insertCol:x,deleteCols:y,deleteRows:C,cutRows:R,copyRows:N,pasteRows:T,getPos:P,setStartCell:S,setEndCell:B})}}),o(u,[f,d,s],function(e,n,o){function r(e,t){return parseInt(e.getAttribute(t)||1,10)}var l=o.each;return function(o){function a(){function n(n){function a(e,t){var r=e?"previousSibling":"nextSibling",l=o.dom.getParent(t,"tr"),a=l[r];if(a)return b(o,t,a,e),n.preventDefault(),!0;var c=o.dom.getParent(l,"table"),u=l.parentNode,f=u.nodeName.toLowerCase();if("tbody"===f||f===(e?"tfoot":"thead")){var m=i(e,c,u,"tbody");if(null!==m)return s(e,m,t)}return d(e,l,r,c)}function i(e,t,n,r){var l=o.dom.select(">"+r,t),a=l.indexOf(n);if(e&&0===a||!e&&a===l.length-1)return c(e,t);if(-1===a){var i="thead"===n.tagName.toLowerCase()?0:l.length-1;return l[i]}return l[a+(e?-1:1)]}function c(e,t){var n=e?"thead":"tfoot",r=o.dom.select(">"+n,t);return 0!==r.length?r[0]:null}function s(e,t,r){var l=u(t,e);return l&&b(o,r,l,e),n.preventDefault(),!0}function d(e,t,r,l){var i=l[r];if(i)return f(i),!0;var c=o.dom.getParent(l,"td,th");if(c)return a(e,c,n);var s=u(t,!e);return f(s),n.preventDefault(),!1}function u(e,t){var n=e&&e[t?"lastChild":"firstChild"];return n&&"BR"===n.nodeName?o.dom.getParent(n,"td,th"):n}function f(e){o.selection.setCursorLocation(e,0)}function m(){return x==e.UP||x==e.DOWN}function g(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+=r(n,"colspan");return t}function h(e,n){var o=0,a=0;return l(e.children,function(e,l){return o+=r(e,"colspan"),a=l,o>n?!1:t}),a}function b(e,t,n,r){var l=p(o.dom.getParent(t,"td,th")),a=h(n,l),i=n.childNodes[a],c=u(i,r);f(c||i)}function v(e){var t=o.selection.getNode(),n=o.dom.getParent(t,"td,th"),r=o.dom.getParent(e,"td,th");return n&&n!==r&&w(n,r)}function w(e,t){return o.dom.getParent(e,"TABLE")===o.dom.getParent(t,"TABLE")}var x=n.keyCode;if(m()&&g(o)){var y=o.selection.getNode();setTimeout(function(){v(y)&&a(!n.shiftKey&&x===e.UP,y,n)},0)}}o.on("KeyDown",function(e){n(e)})}function i(){function e(e,t){var n=t.ownerDocument,o=n.createRange(),r;return o.setStartBefore(t),o.setEnd(e.endContainer,e.endOffset),r=n.createElement("body"),r.appendChild(o.cloneContents()),0===r.innerHTML.replace(/<(br|img|object|embed|input|textarea)[^>]*>/gi,"-").replace(/<[^>]+>/g,"").length}o.on("KeyDown",function(t){var n,r,l=o.dom;(37==t.keyCode||38==t.keyCode)&&(n=o.selection.getRng(),r=l.getParent(n.startContainer,"table"),r&&o.getBody().firstChild==r&&e(n,r)&&(n=l.createRng(),n.setStartBefore(r),n.setEndBefore(r),o.selection.setRng(n),t.preventDefault()))})}function c(){o.on("KeyDown SetContent VisualAid",function(){var e;for(e=o.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&&(o.settings.forced_root_block?o.dom.add(o.getBody(),o.settings.forced_root_block,null,n.ie?" ":'
    '):o.dom.add(o.getBody(),"br",{"data-mce-bogus":"1"}))}),o.on("PreProcess",function(e){var t=e.node.lastChild;t&&("BR"==t.nodeName||1==t.childNodes.length&&("BR"==t.firstChild.nodeName||"\u00a0"==t.firstChild.nodeValue))&&t.previousSibling&&"TABLE"==t.previousSibling.nodeName&&o.dom.remove(t)})}function s(){function e(e,t,n,o){var r=3,l=e.dom.getParent(t.startContainer,"TABLE"),a,i,c;return l&&(a=l.parentNode),i=t.startContainer.nodeType==r&&0===t.startOffset&&0===t.endOffset&&o&&("TR"==n.nodeName||n==a),c=("TD"==n.nodeName||"TH"==n.nodeName)&&!o,i||c}function t(){var t=o.selection.getRng(),n=o.selection.getNode(),r=o.dom.getParent(t.startContainer,"TD,TH");if(e(o,t,n,r)){r||(r=n);for(var l=r.lastChild;l.lastChild;)l=l.lastChild;t.setEnd(l,l.nodeValue.length),o.selection.setRng(t)}}o.on("KeyDown",function(){t()}),o.on("MouseDown",function(e){2!=e.button&&t()})}n.webkit&&(a(),s()),n.gecko&&(i(),c())}}),o(m,[c,g,s],function(e,n,o){return function(r){function l(){r.getBody().style.webkitUserSelect="",d&&(r.dom.removeClass(r.dom.select("td.mce-item-selected,th.mce-item-selected"),"mce-item-selected"),d=!1)}var a=r.dom,i,c,s,d=!0;return r.on("MouseDown",function(e){2!=e.button&&(l(),c=a.getParent(e.target,"td,th"),s=a.getParent(c,"table"))}),a.bind(r.getDoc(),"mouseover",function(t){var n,o,l=t.target;if(c&&(i||l!=c)&&("TD"==l.nodeName||"TH"==l.nodeName)){o=a.getParent(l,"table"),o==s&&(i||(i=new e(r.selection,o),i.setStartCell(c),r.getBody().style.webkitUserSelect="none"),i.setEndCell(l),d=!0),n=r.selection.getSel();try{n.removeAllRanges?n.removeAllRanges():n.empty()}catch(u){}t.preventDefault()}}),r.on("MouseUp",function(){function e(e,r){var a=new n(e,e);do{if(3==e.nodeType&&0!==o.trim(e.nodeValue).length)return r?l.setStart(e,0):l.setEnd(e,e.nodeValue.length),t;if("BR"==e.nodeName)return r?l.setStartBefore(e):l.setEndBefore(e),t}while(e=r?a.next():a.prev())}var l,d=r.selection,u,f,m,g,p;if(c){if(i&&(r.getBody().style.webkitUserSelect=""),u=a.select("td.mce-item-selected,th.mce-item-selected"),u.length>0){l=a.createRng(),m=u[0],p=u[u.length-1],l.setStartBefore(m),l.setEndAfter(m),e(m,1),f=new n(m,a.getParent(u[0],"table"));do if("TD"==m.nodeName||"TH"==m.nodeName){if(!a.hasClass(m,"mce-item-selected"))break;g=m}while(m=f.next());e(g),d.setRng(l)}r.nodeChanged(),c=i=s=null}}),r.on("KeyUp",function(){l()}),{clear:l}}}),o(p,[c,u,m,s,g,d,h],function(e,n,o,r,l,a,i){function c(r){function l(e){return e?e.replace(/px$/,""):""}function i(e){return/^[0-9]+$/.test(e)&&(e+="px"),e}function c(){var e=r.dom,t,n;t=r.dom.getParent(r.selection.getNode(),"table"),n={width:l(e.getStyle(t,"width")||e.getAttrib(t,"width")),height:l(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){r.formatter.matchNode(t,"align"+e)&&(n.align=e)}),r.windowManager.open({title:"Table properties",items:{type:"form",layout:"grid",columns:2,data:n,defaults:{type:"textbox",maxWidth:50},items:[{label:"Cols",name:"cols"},{label:"Rows",name:"rows"},{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(),o;r.undoManager.transact(function(){r.dom.setAttribs(t,{cellspacing:n.cellspacing,cellpadding:n.cellpadding,border:n.border}),r.dom.setStyles(t,{width:i(n.width),height:i(n.height)}),o=e.select("caption",t)[0],o&&!n.caption&&e.remove(o),!o&&n.caption&&(o=e.create("caption"),a.ie||(o.innerHTML='
    '),t.insertBefore(o,t.firstChild)),n.align?r.formatter.apply("align"+n.align,{},t):s("left center right".split(" "),function(e){r.formatter.remove("align"+e,{},t)}),r.focus(),r.addVisual()})}})}function d(e,t){r.windowManager.open({title:"Merge cells",body:[{label:"Columns",name:"cols",type:"textbox",size:5},{label:"Rows",name:"rows",type:"textbox",size:5}],onsubmit:function(){var n=this.toJSON();r.undoManager.transact(function(){e.merge(t,n.cols,n.rows)})}})}function u(){var e=r.dom,t,n,o=[];o=r.dom.select("td.mce-item-selected,th.mce-item-selected"),t=r.dom.getParent(r.selection.getNode(),"td,th"),!o.length&&t&&o.push(t),t=t||o[0],n={width:l(e.getStyle(t,"width")||e.getAttrib(t,"width")),height:l(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){r.formatter.matchNode(t,"align"+e)&&(n.align=e)}),r.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,menu:[{text:"Cell",value:"td"},{text:"Header cell",value:"th"}]},{label:"Scope",name:"scope",type:"listbox",text:"None",minWidth:90,maxWidth:null,menu:[{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();r.undoManager.transact(function(){s(o,function(n){r.dom.setAttrib(n,"scope",t.scope),r.dom.setStyles(n,{width:i(t.width),height:i(t.height)}),t.type&&n.nodeName.toLowerCase()!=t.type&&(n=e.rename(n,t.type)),t.align?r.formatter.apply("align"+t.align,{},n):s("left center right".split(" "),function(e){r.formatter.remove("align"+e,{},n)})}),r.focus()})}})}function f(){var e=r.dom,n,o,a,c,d=[];n=r.dom.getParent(r.selection.getNode(),"table"),o=r.dom.getParent(r.selection.getNode(),"td,th"),s(n.rows,function(n){s(n.cells,function(r){return e.hasClass(r,"mce-item-selected")||r==o?(d.push(n),!1):t})}),a=d[0],c={height:l(e.getStyle(a,"height")||e.getAttrib(a,"height")),scope:e.getAttrib(a,"scope")},c.type=a.parentNode.nodeName.toLowerCase(),s("left center right".split(" "),function(e){r.formatter.matchNode(a,"align"+e)&&(c.align=e)}),r.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,menu:[{text:"header",value:"thead"},{text:"body",value:"tbody"},{text:"footer",value:"tfoot"}]},{type:"listbox",name:"align",label:"Alignment",text:"None",maxWidth:null,menu:[{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,o,l;r.undoManager.transact(function(){s(d,function(a){r.dom.setAttrib(a,"scope",t.scope),r.dom.setStyles(a,{height:i(t.height)}),t.type!=a.parentNode.nodeName.toLowerCase()&&(n=e.getParent(a,"table"),o=a.parentNode,l=e.select(n,t.type)[0],l||(l=e.create(t.type),n.firstChild?n.insertBefore(l,n.firstChild):n.appendChild(l)),l.insertBefore(a,l.firstChild),o.hasChildNodes()||e.remove(o)),t.align?r.formatter.apply("align"+t.align,{},a):s("left center right".split(" "),function(e){r.formatter.remove("align"+e,{},a)})}),r.focus()})}})}function m(e){return function(){r.execCommand(e)}}function g(e,t){var n,o,l;for(l="",n=0;t>n;n++){for(l+="",o=0;e>o;o++)l+="";l+=""}l+="
    "+(a.ie?" ":"
    ")+"
    ",r.insertContent(l)}function p(){function e(){t.disabled(!r.dom.getParent(r.selection.getNode(),"table")),r.selection.selectorChanged("table",function(e){t.disabled(!e)})}var t=this;r.initialized?e():r.on("init",e)}function h(){var e="";e='';for(var t=0;10>t;t++){e+="";for(var n=0;10>n;n++)e+='';e+=""}return e+="",e+='
    0 x 0
    '}var b,v,w=this;s([["table","Insert/edit table","mceInsertTable"],["delete_table","Delete table","mceTableDelete"],["delete_col","Delete column","mceTableDeleteCol"],["delete_row","Delete row","mceTableDeleteRow"],["col_after","Insert column after","mceTableInsertColAfter"],["col_before","Insert column before","mceTableInsertColBefore"],["row_after","Insert row after","mceTableInsertRowAfter"],["row_before","Insert row before","mceTableInsertRowBefore"],["row_props","Row properties","mceTableRowProps"],["cell_props","Cell properties","mceTableCellProps"],["split_cells","Split cells","mceTableSplitCells"],["merge_cells","Merge cells","mceTableMergeCells"]],function(e){r.addButton(e[0],{title:e[1],cmd:e[2],onPostRender:p})}),r.addMenuItem("inserttable",{text:"Insert table",icon:"table",context:"table",onhide:function(){r.dom.removeClass(this.menu.items()[0].getEl().getElementsByTagName("a"),"mce-active")},menu:[{type:"container",html:h(),onmousemove:function(e){var t=e.target;if("A"==t.nodeName){var n=r.dom.getParent(t,"table"),o=t.getAttribute("data-mce-index");if(o!=this.lastPos){o=o.split(","),o[0]=parseInt(o[0],10),o[1]=parseInt(o[1],10);for(var l=0;10>l;l++)for(var a=0;10>a;a++)r.dom.toggleClass(n.rows[l].childNodes[a].firstChild,"mce-active",o[0]>=a&&o[1]>=l);n.nextSibling.innerHTML=o[0]+1+" x "+(o[1]+1),this.lastPos=o}}},onclick:function(e){"A"==e.target.nodeName&&this.lastPos&&(e.preventDefault(),g(this.lastPos[0]+1,this.lastPos[1]+1),this.parent().cancel())}}]}),r.addMenuItem("tableprops",{text:"Table properties",context:"table",onPostRender:p,onclick:c}),r.addMenuItem("deletetable",{text:"Delete table",context:"table",onPostRender:p,cmd:"mceTableDelete"}),r.addMenuItem("cell",{separator:"before",text:"Cell",context:"table",menu:[{text:"Cell properties",onclick:m("mceTableCellProps"),onPostRender:p},{text:"Merge cells",onclick:m("mceTableMergeCells"),onPostRender:p},{text:"Split cell",onclick:m("mceTableSplitCells"),onPostRender:p}]}),r.addMenuItem("row",{text:"Row",context:"table",menu:[{text:"Insert row before",onclick:m("mceTableInsertRowBefore"),onPostRender:p},{text:"Insert row after",onclick:m("mceTableInsertRowAfter"),onPostRender:p},{text:"Delete row",onclick:m("mceTableDeleteRow"),onPostRender:p},{text:"Row properties",onclick:m("mceTableRowProps"),onPostRender:p},{text:"-"},{text:"Cut row",onclick:m("mceTableCutRow"),onPostRender:p},{text:"Copy row",onclick:m("mceTableCopyRow"),onPostRender:p},{text:"Paste row before",onclick:m("mceTablePasteRowBefore"),onPostRender:p},{text:"Paste row after",onclick:m("mceTablePasteRowAfter"),onPostRender:p}]}),r.addMenuItem("column",{text:"Column",context:"table",menu:[{text:"Insert column before",onclick:m("mceTableInsertColBefore"),onPostRender:p},{text:"Insert column after",onclick:m("mceTableInsertColAfter"),onPostRender:p},{text:"Delete column",onclick:m("mceTableDeleteCol"),onPostRender:p}]}),a.isIE||r.on("click",function(e){e=e.target,"TABLE"===e.nodeName&&(r.selection.select(e),r.nodeChanged())}),w.quirks=new n(r),r.on("Init",function(){b=r.windowManager,w.cellSelection=new o(r)}),s({mceTableSplitCells:function(e){e.split()},mceTableMergeCells:function(e){var t,n,o;o=r.dom.getParent(r.selection.getNode(),"th,td"),o&&(t=o.rowSpan,n=o.colSpan),r.dom.select("td.mce-item-selected,th.mce-item-selected").length?e.merge():d(e,o)},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){v=e.cutRows()},mceTableCopyRow:function(e){v=e.copyRows()},mceTablePasteRowBefore:function(e){e.pasteRows(v,!0)},mceTablePasteRowAfter:function(e){e.pasteRows(v)},mceTableDelete:function(e){e.deleteTable()}},function(t,n){r.addCommand(n,function(){var n=new e(r.selection);n&&(t(n),r.execCommand("mceRepaint"),w.cellSelection.clear())})}),s({mceInsertTable:function(){c()},mceTableRowProps:f,mceTableCellProps:u},function(e,t){r.addCommand(t,function(t,n){e(n)})})}var s=r.each;i.add("table",c)}),a([c,u,m,p])})(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.1.6 (2020-01-28) + */ +!function(f){"use strict";function o(e){return e}var R=function(e){function n(){return t}var t=e;return{get:n,set:function(e){t=e},clone:function(){return R(n())}}},T=function(){},O=function(t,r){return function(){for(var e=[],n=0;nt.maxRow()||st.maxCol()))gt.getAt(n,l,s).filter(r).isNone()?(o=f,void 0,i=e[l].element(),u=on.fromTag("td"),Wn(u,on.fromTag("br")),(o?Wn:Te)(i,u)):f=!0}}(r,o,i,t),function(e,n){var t=h(ct.firstLayer(e,"tr"),function(e){return 0===e.dom().childElementCount});p(t,_n),n.minCol()!==n.maxCol()&&n.minRow()!==n.maxRow()||p(ct.firstLayer(e,"th,td"),function(e){Y(e,"rowspan"),Y(e,"colspan")}),Y(e,"width"),Y(e,"height"),ue(e,"width"),ue(e,"height")}(e,i),e};function vt(e){return Pt.get(e)}function bt(e){return Pt.getOption(e)}function wt(e,n){Pt.set(e,n)}function yt(e){return"img"===en(e)?1:bt(e).fold(function(){return Ce(e).length},function(e){return e.length})}function Ct(e){return function(e){return bt(e).filter(function(e){return 0!==e.trim().length||-1=e.startCol()&&n.column()+n.colspan()-1<=e.finishCol()&&n.row()>=e.startRow()&&n.row()+n.rowspan()-1<=e.finishRow()}function Bt(e,n,t){var r=gt.findItem(e,n,Bn),o=gt.findItem(e,t,Bn);return r.bind(function(n){return o.map(function(e){return function(e,n){return Kn(Math.min(e.row(),n.row()),Math.min(e.column(),n.column()),Math.max(e.row()+e.rowspan()-1,n.row()+n.rowspan()-1),Math.max(e.column()+e.colspan()-1,n.column()+n.colspan()-1))}(n,e)})})}var Pt=function Zf(t,r){var n=function(e){return t(e)?Me.from(e.dom().nodeValue):Me.none()};return{get:function(e){if(!t(e))throw new Error("Can only get "+r+" value of a "+r+" node");return n(e).getOr("")},getOption:n,set:function(e,n){if(!t(e))throw new Error("Can only set raw "+r+" value of a "+r+" node");e.dom().nodeValue=n}}}(tn,"text"),Mt=["img","br"],Wt=function(e,i){var u=function(e){for(var n=Ce(e),t=n.length-1;0<=t;t--){var r=n[t];if(i(r))return Me.some(r);var o=u(r);if(o.isSome())return o}return Me.none()};return u(e)},_t={cellOperations:function(i,e,u){return{row:kt(e),cell:function(e){var n=he(e.element()),t=on.fromTag(en(e.element()),n.dom()),r=u.getOr(["strong","em","b","i","span","font","h1","h2","h3","h4","h5","h6","p","div"]),o=0=e.startCol()&&o<=e.finishRow()&&i>=e.startRow()},jt=function(e,n){for(var t=!0,r=b(It,n),o=n.startRow();o<=n.finishRow();o++)for(var i=n.startCol();i<=n.finishCol();i++)t=t&>.getAt(e,o,i).exists(r);return t?Me.some(n):Me.none()},zt=Bt,Ht=function(n,e,t){return Bt(n,e,t).bind(function(e){return jt(n,e)})},Ft=function(r,e,o,i){return gt.findItem(r,e,Bn).bind(function(e){var n=0=n.length-1)return Me.none();var e=n[t].fold(function(){var e=E(n.slice(0,t));return wo(e,function(e,n){return e.map(function(e){return{value:e,delta:n+1}})})},function(e){return Me.some({value:e,delta:0})}),r=n[t+1].fold(function(){var e=n.slice(t+1);return wo(e,function(e,n){return e.map(function(e){return{value:e,delta:n+1}})})},function(e){return Me.some({value:e,delta:1})});return e.bind(function(t){return r.map(function(e){var n=e.delta+t.delta;return Math.abs(e.value-t.value)/n})})}function No(e){var n=e.replace(/\./g,"-");return{resolve:function(e){return n+"-"+e}}}function ko(e){var n=Be(e.parent(),"."+uu);p(n,_n)}function Io(t,e,r){var o=t.origin();p(e,function(e,n){e.each(function(e){var n=r(o,e);To(n,uu),Wn(t.parent(),n)})})}function Bo(e,n,t,r,o,i){var u=qr(n);!function(e,n,r,o){Io(e,n,function(e,n){var t=iu(n.row(),r.left()-e.left(),n.y()-e.top(),o,7);return To(t,cu),t})}(e,0',r.insertBefore(o,r.firstChild)),""===u.align?kc(t,r):Ec(t,r,u.align),t.focus(),t.addVisual()})}function Gi(n){return function(e){return Me.from(e.dom.getParent(e.selection.getStart(),n)).map(on.fromDom)}}function Yi(e){function n(){e.stopPropagation()}function t(){e.preventDefault()}var r=on.fromDom(e.target),o=O(t,n);return function(e,n,t,r,o,i,u){return{target:D(e),x:D(n),y:D(t),stop:r,prevent:o,kill:i,raw:D(u)}}(r,e.clientX,e.clientY,n,t,o,e)}function Ki(e,n,t,r,o){var i=function(n,t){return function(e){n(e)&&t(Yi(e))}}(t,r);return e.dom().addEventListener(n,i,o),{unbind:b(da,e,n,i,o)}}function Xi(e,n,t){return function(e,n,t,r){return Ki(e,n,t,r,!1)}(e,n,ma,t)}var $i,Ji=function(e){var n=st(e);return gt.generate(n).grid()},Qi=function(o,e){function n(e,n){0=n.length||e.column()>hu.cellLength(n[0]))return Su.error("invalid start address out of table bounds, row: "+e.row()+", column: "+e.column());var r=n.slice(e.row()),o=r[0].cells().slice(e.column()),i=hu.cellLength(t[0]),u=t.length;return Su.value({rowDelta:D(r.length-u),colDelta:D(o.length-i)})},Ru=function(e,n){var t=hu.cellLength(e[0]),r=hu.cellLength(n[0]);return{rowDelta:D(0),colDelta:D(t-r)}},Tu=function(e,n,t){var r=n.colDelta()<0?Go:o;return(n.rowDelta()<0?Vo:o)(r(e,Math.abs(n.colDelta()),t),Math.abs(n.rowDelta()),t)},Ou=function(e,n,t,r){if(0===e.length)return e;for(var o=n.startRow();o<=n.finishRow();o++)for(var i=n.startCol();i<=n.finishCol();i++)hu.mutateCell(e[o],i,qn(r(),!1));return e},Du=function(e,n,t,r){for(var o=!0,i=0;i=e.left&&n<=e.right&&t>=e.top&&t<=e.bottom}function Ia(t,r,e,n,o){function i(e){var n=t.dom().createRange();return n.setStart(r.dom(),e),n.collapse(!0),n}var u=vt(r).length,c=function(e,n,t,r,o){if(0===o)return 0;if(n===r)return o-1;for(var i=r,u=1;un.right()}(t,e)})})}function ml(n,t,e){var r=n.move(e,5),o=yf(t,n,e,r,100).getOr(r);return function(e,n,t){return e.point(n)>t.getInnerHeight()?Me.some(e.point(n)-t.getInnerHeight()):e.point(n)<0?Me.some(-e.point(n)):Me.none()}(n,o,t).fold(function(){return t.situsFromPoint(o.left(),n.point(o))},function(e){return t.scrollBy(0,e),t.situsFromPoint(o.left(),n.point(o)-e)})}function gl(e,n){return function(e,n,t){return Jn(e,n,t).isSome()}(e,function(e){return ve(e).exists(function(e){return Bn(e,n)})})}function pl(n,r,o,e,i){return nt(e,"td,th",r).bind(function(t){return nt(t,"table",r).bind(function(e){return gl(i,e)?Df(n,r,o).bind(function(n){return nt(n.finish(),"td,th",r).map(function(e){return{start:D(t),finish:D(e),range:D(n)}})}):Me.none()})})}function hl(e,n){return nt(e,"td,th",n)}var vl=function(n,t,e){function r(){l.stop(),u.isOn()&&(u.off(),i.trigger.stop())}var o=!1,i=sa.create({start:fa([]),stop:fa([])}),u=ya(),c=function(t,r){var o=null;return{cancel:function(){null!==o&&(f.clearTimeout(o),o=null)},throttle:function(){for(var e=[],n=0;nr.left&&o.left ("+e.right()+", "+e.bottom()+")"}},pf=function(e,n,t){return nn(n)?sl(e,n).map(fl):tn(n)?function(e,n,t){return 0<=t&&to.bottom()?vf.retry(i):t.top()===o.bottom()?vf.retry(gf.moveDown(o,1)):dl(e,n,o)?vf.retry(gf.translate(i,5,0)):vf.none()},move:gf.moveDown,gather:ul},yf=function(t,r,o,i,u){return 0===u?Me.some(i):function(e,n,t){return e.elementFromPoint(n,t).filter(function(e){return"table"===en(e)}).isSome()}(t,i.left(),r.point(i))?function(e,n,t,r,o){return yf(e,n,t,n.move(r,5),o)}(t,r,o,i,u-1):t.situsFromPoint(i.left(),r.point(i)).bind(function(e){return e.start().fold(Me.none,function(n){return hf(t,n).bind(function(e){return r.adjuster(t,n,e,o,i).fold(Me.none,function(e){return yf(t,r,o,e,u-1)})}).orThunk(function(){return Me.some(i)})},Me.none)})},Cf={tryUp:b(ml,bf),tryDown:b(ml,wf),ieTryUp:function(e,n){return e.situsFromPoint(n.left(),n.top()-5)},ieTryDown:function(e,n){return e.situsFromPoint(n.left(),n.bottom()+5)},getJumpSize:D(5)},Sf=me(),xf=function(r,o,i,u,c,a){return 0===a?Me.none():Of(r,o,i,u,c).bind(function(e){var n=r.fromSitus(e),t=cf.verify(r,i,u,n.finish(),n.foffset(),c.failure,o);return cf.cata(t,function(){return Me.none()},function(){return Me.some(e)},function(e){return Bn(i,e)&&0===u?Rf(r,i,u,gf.moveUp,c):xf(r,o,e,0,c,a-1)},function(e){return Bn(i,e)&&u===yt(e)?Rf(r,i,u,gf.moveDown,c):xf(r,o,e,yt(e),c,a-1)})})},Rf=function(n,e,t,r,o){return pf(n,e,t).bind(function(e){return Tf(n,o,r(e,Cf.getJumpSize()))})},Tf=function(e,n,t){return Sf.browser.isChrome()||Sf.browser.isSafari()||Sf.browser.isFirefox()||Sf.browser.isEdge()?n.otherRetry(e,t):Sf.browser.isIE()?n.ieRetry(e,t):Me.none()},Of=function(n,e,t,r,o){return pf(n,t,r).bind(function(e){return Tf(n,o,e)})},Df=function(n,t,r){return function(o,i,u){return o.getSelection().bind(function(r){return sf(i,r.finish(),r.foffset(),u).fold(function(){return Me.some(of(r.finish(),r.foffset()))},function(e){var n=o.fromSitus(e),t=cf.verify(o,r.finish(),r.foffset(),n.finish(),n.foffset(),u.failure,i);return df(t)})})}(n,t,r).bind(function(e){return xf(n,t,e.element(),e.offset(),r,20).map(n.fromSitus)})},Af=me(),Ef=function(e,n,t,r,o,i){return Af.browser.isIE()?Me.none():i(r,n).orThunk(function(){return pl(e,n,t,r,o).map(function(e){var n=e.range();return Fl.create(Me.some(ql.makeSitus(n.start(),n.soffset(),n.finish(),n.foffset())),!0)})})},Nf=function(e,n,t,r,o,i,u){return pl(e,t,r,o,i).bind(function(e){return Gl.detect(n,t,e.start(),e.finish(),u)})},kf=function(e,r){return nt(e,"tr",r).bind(function(t){return nt(t,"table",r).bind(function(e){var n=Be(e,"tr");return Bn(t,n[0])?function(e,n,t){return nf(rf,e,n,t)}(e,function(e){return xt(e).isSome()},r).map(function(e){var n=yt(e);return Fl.create(Me.some(ql.makeSitus(e,n,e,n)),!0)}):Me.none()})})},If=function(e,r){return nt(e,"tr",r).bind(function(t){return nt(t,"table",r).bind(function(e){var n=Be(e,"tr");return Bn(t,n[n.length-1])?function(e,n,t){return tf(rf,e,n,t)}(e,function(e){return St(e).isSome()},r).map(function(e){return Fl.create(Me.some(ql.makeSitus(e,0,e,0)),!0)}):Me.none()})})};function Bf(n){return function(e){return e===n}}function Pf(c){return{elementFromPoint:function(e,n){return on.fromPoint(on.fromDom(c.document),e,n)},getRect:function(e){return e.dom().getBoundingClientRect()},getRangedRect:function(e,n,t,r){var o=Il.exact(e,n,t,r);return Ja(c,o).map(zf)},getSelection:function(){return $a(c).map(function(e){return ql.convertToRange(c,e)})},fromSitus:function(e){var n=Il.relative(e.start(),e.finish());return ql.convertToRange(c,n)},situsFromPoint:function(e,n){return Qa(c,e,n).map(function(e){return Ul(e.start(),e.soffset(),e.finish(),e.foffset())})},clearSelection:function(){!function(e){e.getSelection().removeAllRanges()}(c)},collapseSelection:function(u){void 0===u&&(u=!1),$a(c).each(function(e){return e.fold(function(e){return e.collapse(u)},function(e,n){var t=u?e:n;Ga(c,t,t)},function(e,n,t,r){var o=u?e:t,i=u?n:r;Va(c,o,i,o,i)})})},setSelection:function(e){Va(c,e.start(),e.soffset(),e.finish(),e.foffset())},setRelativeSelection:function(e,n){Ga(c,e,n)},selectContents:function(e){Xa(c,e)},getInnerHeight:function(){return c.innerHeight},getScrollY:function(){return function(e){var n=e!==undefined?e.dom():f.document,t=n.body.scrollLeft||n.documentElement.scrollLeft,r=n.body.scrollTop||n.documentElement.scrollTop;return fo(t,r)}(on.fromDom(c.document)).top()},scrollBy:function(e,n){!function(e,n,t){(t!==undefined?t.dom():f.document).defaultView.scrollBy(e,n)}(e,n,on.fromDom(c.document))}}}function Mf(n,e){p(e,function(e){!function(e,n){So(e)?e.dom().classList.remove(n):Ro(e,n);Oo(e)}(n,e)})}var Wf={down:{traverse:ye,gather:ul,relative:Nl.before,otherRetry:Cf.tryDown,ieRetry:Cf.ieTryDown,failure:cf.failedDown},up:{traverse:we,gather:il,relative:Nl.before,otherRetry:Cf.tryUp,ieRetry:Cf.ieTryUp,failure:cf.failedUp}},_f=Bf(38),Lf=Bf(40),jf={ltr:{isBackward:Bf(37),isForward:Bf(39)},rtl:{isBackward:Bf(39),isForward:Bf(37)},isUp:_f,isDown:Lf,isNavigation:function(e){return 37<=e&&e<=40}},zf=function(e){return{left:e.left(),top:e.top(),right:e.right(),bottom:e.bottom(),width:e.width(),height:e.height()}},Hf=(me().browser.isSafari(),B("rows","cols")),Ff={mouse:function(e,n,t,r){var o=function c(o,i,n,u){function t(){r=Me.none()}var r=Me.none();return{mousedown:function(e){u.clear(i),r=hl(e.target(),n)},mouseover:function(e){r.each(function(r){u.clearBeforeUpdate(i),hl(e.target(),n).each(function(t){mr(r,t,n).each(function(e){var n=e.boxes().getOr([]);(1 0) { - el = dom.create('div', null); - el.appendChild(n[0].cloneNode(true)); - } - - function hasClass(n, c) { - return new RegExp('\\b' + c + '\\b', 'g').test(n.className); - } - - each(dom.select('*', el), function(n) { - // Replace cdate - if (hasClass(n, editor.getParam('template_cdate_classes', 'cdate').replace(/\s+/g, '|'))) { - n.innerHTML = getDateTime(editor.getParam("template_cdate_format", editor.getLang("template.cdate_format"))); - } - - // Replace mdate - if (hasClass(n, editor.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) { - n.innerHTML = getDateTime(editor.getParam("template_mdate_format", editor.getLang("template.mdate_format"))); - } - - // Replace selection - if (hasClass(n, editor.getParam('template_selected_content_classes', 'selcontent').replace(/\s+/g, '|'))) { - n.innerHTML = sel; - } - }); - - replaceVals(el); - - editor.execCommand('mceInsertContent', false, el.innerHTML); - editor.addVisual(); - } - - editor.addCommand('mceInsertTemplate', insertTemplate); - - editor.addButton('template', { - title: 'Insert template', - onclick: showDialog - }); - - editor.addMenuItem('image', { - text: 'Insert template', - onclick: showDialog, - context: 'insert' - }); - - editor.on('PreProcess', function(o) { - var dom = editor.dom; - - each(dom.select('div', o.node), function(e) { - if (dom.hasClass(e, 'mceTmpl')) { - each(dom.select('*', e), function(e) { - if (dom.hasClass(e, editor.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) { - e.innerHTML = getDateTime(editor.getParam("template_mdate_format", editor.getLang("template.mdate_format"))); - } - }); - - replaceVals(e); - } - }); - }); -}); \ No newline at end of file +(function () { + 'use strict'; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var noop = function () { + }; + 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 global$1 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.util.XHR'); + + var getCreationDateClasses = function (editor) { + return editor.getParam('template_cdate_classes', 'cdate'); + }; + var getModificationDateClasses = function (editor) { + return editor.getParam('template_mdate_classes', 'mdate'); + }; + var getSelectedContentClasses = function (editor) { + return editor.getParam('template_selected_content_classes', 'selcontent'); + }; + var getPreviewReplaceValues = function (editor) { + return editor.getParam('template_preview_replace_values'); + }; + var getTemplateReplaceValues = function (editor) { + return editor.getParam('template_replace_values'); + }; + var getTemplates = function (editorSettings) { + return editorSettings.templates; + }; + var getCdateFormat = function (editor) { + return editor.getParam('template_cdate_format', editor.translate('%Y-%m-%d')); + }; + var getMdateFormat = function (editor) { + return editor.getParam('template_mdate_format', editor.translate('%Y-%m-%d')); + }; + var Settings = { + getCreationDateClasses: getCreationDateClasses, + getModificationDateClasses: getModificationDateClasses, + getSelectedContentClasses: getSelectedContentClasses, + getPreviewReplaceValues: getPreviewReplaceValues, + getTemplateReplaceValues: getTemplateReplaceValues, + getTemplates: getTemplates, + getCdateFormat: getCdateFormat, + getMdateFormat: getMdateFormat + }; + + 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) { + 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(' '); + 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 DateTimeHelper = { getDateTime: getDateTime }; + + var createTemplateList = function (editorSettings, callback) { + return function () { + var templateList = Settings.getTemplates(editorSettings); + if (typeof templateList === 'function') { + templateList(callback); + return; + } + if (typeof templateList === 'string') { + global$2.send({ + url: templateList, + success: function (text) { + callback(JSON.parse(text)); + } + }); + } else { + callback(templateList); + } + }; + }; + var replaceTemplateValues = function (html, templateValues) { + global$1.each(templateValues, function (v, k) { + if (typeof v === 'function') { + v = v(k); + } + html = html.replace(new RegExp('\\{\\$' + k + '\\}', 'g'), v); + }); + return html; + }; + var replaceVals = function (editor, e) { + var dom = editor.dom, vl = Settings.getTemplateReplaceValues(editor); + global$1.each(dom.select('*', e), function (e) { + global$1.each(vl, function (v, k) { + if (dom.hasClass(e, k)) { + if (typeof vl[k] === 'function') { + vl[k](e); + } + } + }); + }); + }; + var hasClass = function (n, c) { + return new RegExp('\\b' + c + '\\b', 'g').test(n.className); + }; + var insertTemplate = function (editor, ui, html) { + var el; + var n; + var dom = editor.dom; + var sel = editor.selection.getContent(); + html = replaceTemplateValues(html, Settings.getTemplateReplaceValues(editor)); + el = dom.create('div', null, html); + n = dom.select('.mceTmpl', el); + if (n && n.length > 0) { + el = dom.create('div', null); + el.appendChild(n[0].cloneNode(true)); + } + global$1.each(dom.select('*', el), function (n) { + if (hasClass(n, Settings.getCreationDateClasses(editor).replace(/\s+/g, '|'))) { + n.innerHTML = DateTimeHelper.getDateTime(editor, Settings.getCdateFormat(editor)); + } + if (hasClass(n, Settings.getModificationDateClasses(editor).replace(/\s+/g, '|'))) { + n.innerHTML = DateTimeHelper.getDateTime(editor, Settings.getMdateFormat(editor)); + } + if (hasClass(n, Settings.getSelectedContentClasses(editor).replace(/\s+/g, '|'))) { + n.innerHTML = sel; + } + }); + replaceVals(editor, el); + editor.execCommand('mceInsertContent', false, el.innerHTML); + editor.addVisual(); + }; + var Templates = { + createTemplateList: createTemplateList, + replaceTemplateValues: replaceTemplateValues, + replaceVals: replaceVals, + insertTemplate: insertTemplate + }; + + var register = function (editor) { + editor.addCommand('mceInsertTemplate', curry(Templates.insertTemplate, editor)); + }; + var Commands = { register: register }; + + var setup = function (editor) { + editor.on('PreProcess', function (o) { + var dom = editor.dom, dateFormat = Settings.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, editor.getParam('template_mdate_classes', 'mdate').replace(/\s+/g, '|'))) { + e.innerHTML = DateTimeHelper.getDateTime(editor, dateFormat); + } + }); + Templates.replaceVals(editor, e); + } + }); + }); + }; + var FilterContent = { setup: setup }; + + 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()') + }; + if (Object.freeze) { + Object.freeze(me); + } + 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 Option = { + some: some, + none: none, + from: from + }; + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + 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 isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isFunction = isType('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 find = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Option.some(x); + } + } + return Option.none(); + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.Promise'); + + var hasOwnProperty = Object.hasOwnProperty; + var get = function (obj, key) { + return has(obj, key) ? Option.from(obj[key]) : Option.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 contentCssLinks_1 = ''; + global$1.each(editor.contentCSS, function (url) { + contentCssLinks_1 += ''; + }); + var bodyClass = editor.settings.body_class || ''; + if (bodyClass.indexOf('=') !== -1) { + bodyClass = editor.getParam('body_class', '', 'hash'); + bodyClass = bodyClass[editor.id] || ''; + } + var encode = editor.dom.encode; + var directionality = editor.getBody().dir; + var dirAttr = directionality ? ' dir="' + encode(directionality) + '"' : ''; + html = '' + '' + '' + contentCssLinks_1 + '' + '' + html + '' + ''; + } + return Templates.replaceTemplateValues(html, Settings.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 Option.none(); + } + return Option.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) ? Option.from(template.url) : Option.none(), + content: !isUrlTemplate(template) ? Option.from(template.content) : Option.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 getTemplateContent = function (t) { + return new global$3(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); + api.unblock(); + }); + }); + } + }; + }; + var onSubmit = function (templates) { + return function (api) { + var data = api.getData(); + findTemplate(templates, data.template).each(function (t) { + getTemplateContent(t).then(function (previewHtml) { + Templates.insertTemplate(editor, false, previewHtml); + api.close(); + }); + }); + }; + }; + 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); + }); + }; + var optTemplates = createTemplates(); + optTemplates.each(openDialog); + }; + var Dialog = { open: open }; + + var showDialog = function (editor) { + return function (templates) { + Dialog.open(editor, templates); + }; + }; + var register$1 = function (editor) { + editor.ui.registry.addButton('template', { + icon: 'template', + tooltip: 'Insert template', + onAction: Templates.createTemplateList(editor.settings, showDialog(editor)) + }); + editor.ui.registry.addMenuItem('template', { + icon: 'template', + text: 'Insert template...', + onAction: Templates.createTemplateList(editor.settings, showDialog(editor)) + }); + }; + var Buttons = { register: register$1 }; + + function Plugin () { + global.add('template', function (editor) { + Buttons.register(editor); + Commands.register(editor); + FilterContent.setup(editor); + }); + } + + Plugin(); + +}()); diff --git a/lib/tinymce/js/tinymce/plugins/template/plugin.min.js b/lib/tinymce/js/tinymce/plugins/template/plugin.min.js index bde4dbb4..14057a09 100644 --- a/lib/tinymce/js/tinymce/plugins/template/plugin.min.js +++ b/lib/tinymce/js/tinymce/plugins/template/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("template",function(e){function t(){function t(e){var t=e.control.value();t.url?tinymce.util.XHR.send({url:t.url,success:function(e){a=e,n.find("iframe")[0].html(e)}}):(a=t.content,n.find("iframe")[0].html(t.content)),n.find("#description")[0].text(e.control.value().description)}var n,a,r=[];return e.settings.templates?(tinymce.each(e.settings.templates,function(e){r.push({text:e.title,value:{url:e.url,content:e.content,description:e.description}})}),n=e.windowManager.open({title:"Insert template",body:[{type:"listbox",name:"template",flex:0,label:"Templates",values:r,onselect:t},{type:"label",name:"description",label:"Description",text:""},{type:"iframe",minWidth:600,minHeight:400,border:1}],onsubmit:function(){i(!1,a)}}),void 0):(e.windowManager.alert("No templates defined"),void 0)}function n(t,n){function a(e,t){if(e=""+e,t>e.length)for(var n=0;t-e.length>n;n++)e="0"+e;return e}var i="Sun Mon Tue Wed Thu Fri Sat Sun".split(" "),r="Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sunday".split(" "),o="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),l="January February March April May June July August September October November December".split(" ");return n=n||new Date,t=t.replace("%D","%m/%d/%Y"),t=t.replace("%r","%I:%M:%S %p"),t=t.replace("%Y",""+n.getFullYear()),t=t.replace("%y",""+n.getYear()),t=t.replace("%m",a(n.getMonth()+1,2)),t=t.replace("%d",a(n.getDate(),2)),t=t.replace("%H",""+a(n.getHours(),2)),t=t.replace("%M",""+a(n.getMinutes(),2)),t=t.replace("%S",""+a(n.getSeconds(),2)),t=t.replace("%I",""+((n.getHours()+11)%12+1)),t=t.replace("%p",""+(12>n.getHours()?"AM":"PM")),t=t.replace("%B",""+e.translate(l[n.getMonth()])),t=t.replace("%b",""+e.translate(o[n.getMonth()])),t=t.replace("%A",""+e.translate(r[n.getDay()])),t=t.replace("%a",""+e.translate(i[n.getDay()])),t=t.replace("%%","%")}function a(t){var n=e.dom,a=e.getParam("template_replace_values");r(n.select("*",t),function(e){r(a,function(t,i){n.hasClass(e,i)&&"function"==typeof a[i]&&a[i](e)})})}function i(t,i){function o(e,t){return RegExp("\\b"+t+"\\b","g").test(e.className)}var l,c,s=e.dom,d=e.selection.getContent();r(e.getParam("template_replace_values"),function(e,t){"function"!=typeof e&&(i=i.replace(RegExp("\\{\\$"+t+"\\}","g"),e))}),l=s.create("div",null,i),c=s.select(".mceTmpl",l),c&&c.length>0&&(l=s.create("div",null),l.appendChild(c[0].cloneNode(!0))),r(s.select("*",l),function(t){o(t,e.getParam("template_cdate_classes","cdate").replace(/\s+/g,"|"))&&(t.innerHTML=n(e.getParam("template_cdate_format",e.getLang("template.cdate_format")))),o(t,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(t.innerHTML=n(e.getParam("template_mdate_format",e.getLang("template.mdate_format")))),o(t,e.getParam("template_selected_content_classes","selcontent").replace(/\s+/g,"|"))&&(t.innerHTML=d)}),a(l),e.execCommand("mceInsertContent",!1,l.innerHTML),e.addVisual()}var r=tinymce.each;e.addCommand("mceInsertTemplate",i),e.addButton("template",{title:"Insert template",onclick:t}),e.addMenuItem("image",{text:"Insert template",onclick:t,context:"insert"}),e.on("PreProcess",function(t){var i=e.dom;r(i.select("div",t.node),function(t){i.hasClass(t,"mceTmpl")&&(r(i.select("*",t),function(t){i.hasClass(t,e.getParam("template_mdate_classes","mdate").replace(/\s+/g,"|"))&&(t.innerHTML=n(e.getParam("template_mdate_format",e.getLang("template.mdate_format"))))}),a(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.1.6 (2020-01-28) + */ +!function(){"use strict";function e(){}function a(e){return function(){return e}}var t=tinymce.util.Tools.resolve("tinymce.PluginManager");function c(e,t){if((e=""+e).length&]/g,function(e){return function(e,t){return B(e,t)?L.from(e[t]):L.none()}(E,e).getOr(e)})}function k(t){return function(e){R(t,e)}}var I,J=function(n){function e(){return o}function t(e){return e(n)}var r=a(n),o={fold:function(e,t){return t(n)},is:function(e){return n===e},isSome:f,isNone:u,getOr:r,getOrThunk:r,getOrDie:r,getOrNull:r,getOrUndefined:r,or:e,orThunk:e,map:function(e){return J(e(n))},each:function(e){e(n)},bind:t,exists:t,forall:t,filter:function(e){return e(n)?o:w},toArray:function(){return[n]},toString:function(){return"some("+n+")"},equals:function(e){return e.is(n)},equals_:function(e,t){return e.fold(u,function(e){return t(n,e)})}};return o},L={some:J,none:n,from:function(e){return null===e||e===undefined?w:J(e)}},Y=(I="function",function(e){return function(e){if(null===e)return"null";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}(e)===I}),j=Array.prototype.slice,q=(Y(Array.from)&&Array.from,tinymce.util.Tools.resolve("tinymce.util.Promise")),F=Object.hasOwnProperty,B=function(e,t){return F.call(e,t)},E={'"':""","<":"<",">":">","&":"&","'":"'"},R=function(i,t){function e(e){return function(e,t){for(var n=e.length,r=new Array(n),o=0;o")){var n="";p.each(t.contentCSS,function(e){n+=''});var r=t.settings.body_class||"";-1!==r.indexOf("=")&&(r=(r=t.getParam("body_class","","hash"))[t.id]||"");var o=t.dom.encode,a=t.getBody().dir,u=a?' dir="'+o(a)+'"':"";e=""+n+'"+e+""}return S(e,y(t))}(i,n),o=[{type:"selectbox",name:"template",label:"Templates",items:c},{type:"htmlpanel",html:'

    '+H(t.value.description)+"

    "},{label:"Preview",type:"iframe",name:"preview",sandboxed:!1}],a={template:t.text,preview:r};e.unblock(),e.redial(u(o,a)),e.focus("template")},t=i.windowManager.open(u([],{template:"",preview:""}));t.block("Loading..."),l(n[0]).then(function(e){r(t,n[0],e)})})},z=function(e){e.ui.registry.addButton("template",{icon:"template",tooltip:"Insert template",onAction:M(e.settings,k(e))}),e.ui.registry.addMenuItem("template",{icon:"template",text:"Insert template...",onAction:M(e.settings,k(e))})};!function U(){t.add("template",function(e){z(e),P(e),A(e)})}()}(); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/plugins/textcolor/plugin.js b/lib/tinymce/js/tinymce/plugins/textcolor/plugin.js new file mode 100644 index 00000000..2114d83c --- /dev/null +++ b/lib/tinymce/js/tinymce/plugins/textcolor/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.1.6 (2020-01-28) + */ +(function (domGlobals) { + 'use strict'; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + function Plugin () { + global.add('textcolor', function () { + domGlobals.console.warn('Text color plugin is now built in to the core editor, please remove it from your editor configuration'); + }); + } + + Plugin(); + +}(window)); diff --git a/lib/tinymce/js/tinymce/plugins/textcolor/plugin.min.js b/lib/tinymce/js/tinymce/plugins/textcolor/plugin.min.js new file mode 100644 index 00000000..ee182849 --- /dev/null +++ b/lib/tinymce/js/tinymce/plugins/textcolor/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.1.6 (2020-01-28) + */ +!function(o){"use strict";var i=tinymce.util.Tools.resolve("tinymce.PluginManager");!function n(){i.add("textcolor",function(){o.console.warn("Text color plugin is now built in to the core editor, please remove it from your editor configuration")})}()}(window); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/plugins/textpattern/plugin.js b/lib/tinymce/js/tinymce/plugins/textpattern/plugin.js new file mode 100644 index 00000000..24fcbb78 --- /dev/null +++ b/lib/tinymce/js/tinymce/plugins/textpattern/plugin.js @@ -0,0 +1,1444 @@ +/** + * 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.1.6 (2020-01-28) + */ +(function (domGlobals) { + 'use strict'; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + 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); + }; + 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 noop = function () { + }; + var constant = function (value) { + return function () { + return value; + }; + }; + var identity = function (x) { + return x; + }; + 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()') + }; + if (Object.freeze) { + Object.freeze(me); + } + 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 Option = { + some: some, + none: none, + from: from + }; + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + 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 isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isString = isType('string'); + var isObject = isType('object'); + var isArray = isType('array'); + var isFunction = isType('function'); + + var nativeSlice = Array.prototype.slice; + var nativeIndexOf = Array.prototype.indexOf; + var rawIndexOf = function (ts, t) { + return nativeIndexOf.call(ts, t); + }; + var contains = function (xs, x) { + return rawIndexOf(xs, x) > -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 eachr = function (xs, f) { + for (var i = xs.length - 1; i >= 0; 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 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 find = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Option.some(x); + } + } + return Option.none(); + }; + 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 sort = function (xs, comparator) { + var copy = nativeSlice.call(xs, 0); + copy.sort(comparator); + return copy; + }; + var head = function (xs) { + return xs.length === 0 ? Option.none() : Option.some(xs[0]); + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + var keys = Object.keys; + var hasOwnProperty = Object.hasOwnProperty; + var get = function (obj, key) { + return has(obj, key) ? Option.from(obj[key]) : Option.none(); + }; + var has = function (obj, key) { + return hasOwnProperty.call(obj, key); + }; + + 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) { + domGlobals.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 partition = function (results) { + var errors = []; + var values = []; + each(results, function (result) { + result.fold(function (err) { + errors.push(err); + }, function (value) { + values.push(value); + }); + }); + return { + errors: errors, + values: values + }; + }; + + 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 toOption = function () { + return Option.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, + toOption: toOption + }; + }; + 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, + toOption: Option.none + }; + }; + var fromOption = function (opt, err) { + return opt.fold(function () { + return error(err); + }, value); + }; + var Result = { + value: value, + error: error, + fromOption: fromOption + }; + + var isInlinePattern = function (pattern) { + return pattern.type === 'inline-command' || pattern.type === 'inline-format'; + }; + var isBlockPattern = function (pattern) { + return pattern.type === 'block-command' || pattern.type === 'block-format'; + }; + var sortPatterns = function (patterns) { + return sort(patterns, function (a, b) { + if (a.start.length === b.start.length) { + return 0; + } + return a.start.length > b.start.length ? -1 : 1; + }); + }; + var normalizePattern = function (pattern) { + var err = function (message) { + return Result.error({ + message: message, + pattern: pattern + }); + }; + var formatOrCmd = function (name, onFormat, onCommand) { + if (pattern.format !== undefined) { + var formats = void 0; + if (isArray(pattern.format)) { + if (!forall(pattern.format, isString)) { + return err(name + ' pattern has non-string items in the `format` array'); + } + formats = pattern.format; + } else if (isString(pattern.format)) { + formats = [pattern.format]; + } else { + return err(name + ' pattern has non-string `format` parameter'); + } + return Result.value(onFormat(formats)); + } else if (pattern.cmd !== undefined) { + if (!isString(pattern.cmd)) { + return err(name + ' pattern has non-string `cmd` parameter'); + } + return Result.value(onCommand(pattern.cmd, pattern.value)); + } else { + return err(name + ' pattern is missing both `format` and `cmd` parameters'); + } + }; + if (!isObject(pattern)) { + return err('Raw pattern is not an object'); + } + if (!isString(pattern.start)) { + return err('Raw pattern is missing `start` parameter'); + } + if (pattern.end !== undefined) { + if (!isString(pattern.end)) { + return err('Inline pattern has non-string `end` parameter'); + } + if (pattern.start.length === 0 && pattern.end.length === 0) { + return err('Inline pattern has empty `start` and `end` parameters'); + } + var start_1 = pattern.start; + var end_1 = pattern.end; + if (end_1.length === 0) { + end_1 = start_1; + start_1 = ''; + } + return formatOrCmd('Inline', function (format) { + return { + type: 'inline-format', + start: start_1, + end: end_1, + format: format + }; + }, function (cmd, value) { + return { + type: 'inline-command', + start: start_1, + end: end_1, + cmd: cmd, + value: value + }; + }); + } else if (pattern.replacement !== undefined) { + if (!isString(pattern.replacement)) { + return err('Replacement pattern has non-string `replacement` parameter'); + } + if (pattern.start.length === 0) { + return err('Replacement pattern has empty `start` parameter'); + } + return Result.value({ + type: 'inline-command', + start: '', + end: pattern.start, + cmd: 'mceInsertContent', + value: pattern.replacement + }); + } else { + if (pattern.start.length === 0) { + return err('Block pattern has empty `start` parameter'); + } + return formatOrCmd('Block', function (formats) { + return { + type: 'block-format', + start: pattern.start, + format: formats[0] + }; + }, function (command, commandValue) { + return { + type: 'block-command', + start: pattern.start, + cmd: command, + value: commandValue + }; + }); + } + }; + var denormalizePattern = function (pattern) { + if (pattern.type === 'block-command') { + return { + start: pattern.start, + cmd: pattern.cmd, + value: pattern.value + }; + } else if (pattern.type === 'block-format') { + return { + start: pattern.start, + format: pattern.format + }; + } else if (pattern.type === 'inline-command') { + if (pattern.cmd === 'mceInsertContent' && pattern.start === '') { + return { + start: pattern.end, + replacement: pattern.value + }; + } else { + return { + start: pattern.start, + end: pattern.end, + cmd: pattern.cmd, + value: pattern.value + }; + } + } else if (pattern.type === 'inline-format') { + return { + start: pattern.start, + end: pattern.end, + format: pattern.format.length === 1 ? pattern.format[0] : pattern.format + }; + } + }; + var createPatternSet = function (patterns) { + return { + inlinePatterns: filter(patterns, isInlinePattern), + blockPatterns: sortPatterns(filter(patterns, isBlockPattern)) + }; + }; + + var get$1 = function (patternsState) { + var setPatterns = function (newPatterns) { + var normalized = partition(map(newPatterns, normalizePattern)); + if (normalized.errors.length > 0) { + var firstError = normalized.errors[0]; + throw new Error(firstError.message + ':\n' + JSON.stringify(firstError.pattern, null, 2)); + } + patternsState.set(createPatternSet(normalized.values)); + }; + var getPatterns = function () { + return __spreadArrays(map(patternsState.get().inlinePatterns, denormalizePattern), map(patternsState.get().blockPatterns, denormalizePattern)); + }; + return { + setPatterns: setPatterns, + getPatterns: getPatterns + }; + }; + var Api = { get: get$1 }; + + var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')(); + + var error$1 = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + var console = Global.console; + if (console) { + if (console.error) { + console.error.apply(console, args); + } else { + console.log.apply(console, args); + } + } + }; + var defaultPatterns = [ + { + start: '*', + end: '*', + format: 'italic' + }, + { + start: '**', + end: '**', + format: 'bold' + }, + { + start: '#', + format: 'h1' + }, + { + start: '##', + format: 'h2' + }, + { + start: '###', + format: 'h3' + }, + { + start: '####', + format: 'h4' + }, + { + start: '#####', + format: 'h5' + }, + { + start: '######', + format: 'h6' + }, + { + start: '1. ', + cmd: 'InsertOrderedList' + }, + { + start: '* ', + cmd: 'InsertUnorderedList' + }, + { + start: '- ', + cmd: 'InsertUnorderedList' + } + ]; + var getPatternSet = function (editorSettings) { + var patterns = get(editorSettings, 'textpattern_patterns').getOr(defaultPatterns); + if (!isArray(patterns)) { + error$1('The setting textpattern_patterns should be an array'); + return { + inlinePatterns: [], + blockPatterns: [] + }; + } + var normalized = partition(map(patterns, normalizePattern)); + each(normalized.errors, function (err) { + return error$1(err.message, err.pattern); + }); + return createPatternSet(normalized.values); + }; + 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 global$1 = tinymce.util.Tools.resolve('tinymce.util.Delay'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.util.VK'); + + var zeroWidth = function () { + return '\uFEFF'; + }; + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.Tools'); + + var global$4 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker'); + + var isText = function (node) { + return node.nodeType === domGlobals.Node.TEXT_NODE; + }; + var cleanEmptyNodes = function (dom, node, isRoot) { + if (node && dom.isEmpty(node) && !isRoot(node)) { + var parent = node.parentNode; + dom.remove(node); + cleanEmptyNodes(dom, parent, isRoot); + } + }; + var deleteRng = function (dom, rng, isRoot, clean) { + if (clean === void 0) { + clean = true; + } + var startParent = rng.startContainer.parentNode; + var endParent = rng.endContainer.parentNode; + rng.deleteContents(); + if (clean && !isRoot(rng.startContainer)) { + if (isText(rng.startContainer) && rng.startContainer.data.length === 0) { + dom.remove(rng.startContainer); + } + if (isText(rng.endContainer) && rng.endContainer.data.length === 0) { + dom.remove(rng.endContainer); + } + cleanEmptyNodes(dom, startParent, isRoot); + if (startParent !== endParent) { + cleanEmptyNodes(dom, endParent, isRoot); + } + } + }; + var isBlockFormatName = function (name, formatter) { + var formatSet = formatter.get(name); + return isArray(formatSet) && head(formatSet).exists(function (format) { + return has(format, 'block'); + }); + }; + var isReplacementPattern = function (pattern) { + return pattern.start.length === 0; + }; + var getParentBlock = function (editor, rng) { + var parentBlockOpt = Option.from(editor.dom.getParent(rng.startContainer, editor.dom.isBlock)); + if (getForcedRootBlock(editor) === '') { + return parentBlockOpt.orThunk(function () { + return Option.some(editor.getBody()); + }); + } else { + return parentBlockOpt; + } + }; + + var point = function (element, offset) { + return { + element: element, + offset: offset + }; + }; + + var TextWalker = function (startNode, rootNode) { + var walker = new global$4(startNode, rootNode); + var walk = function (direction) { + var next = walker[direction](); + while (next && next.nodeType !== domGlobals.Node.TEXT_NODE) { + next = walker[direction](); + } + return next && next.nodeType === domGlobals.Node.TEXT_NODE ? Option.some(next) : Option.none(); + }; + return { + next: function () { + return walk('next'); + }, + prev: function () { + return walk('prev'); + }, + prev2: function () { + return walk('prev2'); + } + }; + }; + + var textBefore = function (node, offset, rootNode) { + if (isText(node) && offset >= 0) { + return Option.some(point(node, offset)); + } else { + var textWalker = TextWalker(node, rootNode); + return textWalker.prev().map(function (prev) { + return point(prev, prev.data.length); + }); + } + }; + var scanLeft = function (node, offset, rootNode) { + if (!isText(node)) { + return Option.none(); + } + var text = node.textContent; + if (offset >= 0 && offset <= text.length) { + return Option.some(point(node, offset)); + } else { + var textWalker = TextWalker(node, rootNode); + return textWalker.prev().bind(function (prev) { + var prevText = prev.textContent; + return scanLeft(prev, offset + prevText.length, rootNode); + }); + } + }; + var scanRight = function (node, offset, rootNode) { + if (!isText(node)) { + return Option.none(); + } + var text = node.textContent; + if (offset <= text.length) { + return Option.some(point(node, offset)); + } else { + var textWalker = TextWalker(node, rootNode); + return textWalker.next().bind(function (next) { + return scanRight(next, offset - text.length, rootNode); + }); + } + }; + var isBoundary = function (dom, node) { + return dom.isBlock(node) || contains([ + 'BR', + 'IMG', + 'HR', + 'INPUT' + ], node.nodeName) || dom.getContentEditable(node) === 'false'; + }; + var outcome = Adt.generate([ + { aborted: [] }, + { edge: ['element'] }, + { success: ['info'] } + ]); + var phase = Adt.generate([ + { abort: [] }, + { kontinue: [] }, + { finish: ['info'] } + ]); + var repeat = function (dom, node, offset, process, walker, recent) { + var terminate = function () { + return recent.fold(outcome.aborted, outcome.edge); + }; + var recurse = function () { + var next = walker(); + if (next) { + return repeat(dom, next, Option.none(), process, walker, Option.some(node)); + } else { + return terminate(); + } + }; + if (isBoundary(dom, node)) { + return terminate(); + } else if (!isText(node)) { + return recurse(); + } else { + var text = node.textContent; + return process(phase, node, text, offset).fold(outcome.aborted, function () { + return recurse(); + }, outcome.success); + } + }; + var repeatLeft = function (dom, node, offset, process, rootNode) { + var walker = new global$4(node, rootNode); + return repeat(dom, node, Option.some(offset), process, walker.prev, Option.none()); + }; + + var generatePath = function (root, node, offset) { + if (isText(node) && (offset < 0 || offset > node.data.length)) { + return []; + } + var p = [offset]; + var current = node; + while (current !== root && current.parentNode) { + var parent = current.parentNode; + for (var i = 0; i < parent.childNodes.length; i++) { + if (parent.childNodes[i] === current) { + p.push(i); + break; + } + } + current = parent; + } + return current === root ? p.reverse() : []; + }; + var generatePathRange = function (root, startNode, startOffset, endNode, endOffset) { + var start = generatePath(root, startNode, startOffset); + var end = generatePath(root, endNode, endOffset); + return { + start: start, + end: end + }; + }; + var resolvePath = function (root, path) { + var nodePath = path.slice(); + var offset = nodePath.pop(); + return foldl(nodePath, function (optNode, index) { + return optNode.bind(function (node) { + return Option.from(node.childNodes[index]); + }); + }, Option.some(root)).bind(function (node) { + if (isText(node) && offset >= 0 && offset <= node.data.length) { + return Option.some({ + node: node, + offset: offset + }); + } else { + return Option.some({ + node: node, + offset: offset + }); + } + }); + }; + var resolvePathRange = function (root, range) { + return resolvePath(root, range.start).bind(function (_a) { + var startNode = _a.node, startOffset = _a.offset; + return resolvePath(root, range.end).map(function (_a) { + var endNode = _a.node, endOffset = _a.offset; + var rng = domGlobals.document.createRange(); + rng.setStart(startNode, startOffset); + rng.setEnd(endNode, endOffset); + return rng; + }); + }); + }; + var generatePathRangeFromRange = function (root, range) { + return generatePathRange(root, range.startContainer, range.startOffset, range.endContainer, range.endOffset); + }; + + var stripPattern = function (dom, block, pattern) { + var firstTextNode = TextWalker(block, block).next(); + firstTextNode.each(function (node) { + scanRight(node, pattern.start.length, block).each(function (end) { + var rng = dom.createRng(); + rng.setStart(node, 0); + rng.setEnd(end.element, end.offset); + deleteRng(dom, rng, function (e) { + return e === block; + }); + }); + }); + }; + var applyPattern = function (editor, match) { + var dom = editor.dom; + var pattern = match.pattern; + var rng = resolvePathRange(dom.getRoot(), match.range).getOrDie('Unable to resolve path range'); + getParentBlock(editor, rng).each(function (block) { + if (pattern.type === 'block-format') { + if (isBlockFormatName(pattern.format, editor.formatter)) { + editor.undoManager.transact(function () { + stripPattern(editor.dom, block, pattern); + editor.formatter.apply(pattern.format); + }); + } + } else if (pattern.type === 'block-command') { + editor.undoManager.transact(function () { + stripPattern(editor.dom, block, pattern); + editor.execCommand(pattern.cmd, false, pattern.value); + }); + } + }); + return true; + }; + var findPattern = function (patterns, text) { + var nuText = text.replace('\xA0', ' '); + return find(patterns, function (pattern) { + if (text.indexOf(pattern.start) !== 0 && nuText.indexOf(pattern.start) !== 0) { + return false; + } + return true; + }); + }; + var findPatterns = function (editor, patterns) { + var dom = editor.dom; + var rng = editor.selection.getRng(); + return getParentBlock(editor, rng).filter(function (block) { + var forcedRootBlock = getForcedRootBlock(editor); + var matchesForcedRootBlock = forcedRootBlock === '' && dom.is(block, 'body') || dom.is(block, forcedRootBlock); + return block !== null && matchesForcedRootBlock; + }).bind(function (block) { + var blockText = block.textContent; + var matchedPattern = findPattern(patterns, blockText); + return matchedPattern.map(function (pattern) { + if (global$3.trim(blockText).length === pattern.start.length) { + return []; + } + return [{ + pattern: pattern, + range: generatePathRange(dom.getRoot(), block, 0, block, 0) + }]; + }); + }).getOr([]); + }; + var applyMatches = function (editor, matches) { + if (matches.length === 0) { + return; + } + var bookmark = editor.selection.getBookmark(); + each(matches, function (match) { + return applyPattern(editor, match); + }); + editor.selection.moveToBookmark(bookmark); + }; + + 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 checkRange = function (str, substr, start) { + if (substr === '') { + return true; + } + if (str.length < substr.length) { + return false; + } + var x = str.substr(start, start + substr.length); + return x === substr; + }; + var endsWith = function (str, suffix) { + return checkRange(str, suffix, str.length - suffix.length); + }; + + var newMarker = function (dom, id) { + return dom.create('span', { + 'data-mce-type': 'bookmark', + 'id': id + }); + }; + var rangeFromMarker = function (dom, marker) { + var rng = dom.createRng(); + rng.setStartAfter(marker.start); + rng.setEndBefore(marker.end); + return rng; + }; + var createMarker = function (dom, markerPrefix, pathRange) { + var rng = resolvePathRange(dom.getRoot(), pathRange).getOrDie('Unable to resolve path range'); + var startNode = rng.startContainer; + var endNode = rng.endContainer; + var textEnd = rng.endOffset === 0 ? endNode : endNode.splitText(rng.endOffset); + var textStart = rng.startOffset === 0 ? startNode : startNode.splitText(rng.startOffset); + return { + prefix: markerPrefix, + end: textEnd.parentNode.insertBefore(newMarker(dom, markerPrefix + '-end'), textEnd), + start: textStart.parentNode.insertBefore(newMarker(dom, markerPrefix + '-start'), textStart) + }; + }; + var removeMarker = function (dom, marker, isRoot) { + cleanEmptyNodes(dom, dom.get(marker.prefix + '-end'), isRoot); + cleanEmptyNodes(dom, dom.get(marker.prefix + '-start'), isRoot); + }; + + var nodeMatchesPattern = function (dom, block, content) { + return function (phase, element, text, optOffset) { + if (element === block) { + return phase.abort(); + } + var searchText = text.substring(0, optOffset.getOr(text.length)); + var startEndIndex = searchText.lastIndexOf(content.charAt(content.length - 1)); + var startIndex = searchText.lastIndexOf(content); + if (startIndex !== -1) { + var rng = dom.createRng(); + rng.setStart(element, startIndex); + rng.setEnd(element, startIndex + content.length); + return phase.finish(rng); + } else if (startEndIndex !== -1) { + return scanLeft(element, startEndIndex + 1 - content.length, block).fold(function () { + return phase.kontinue(); + }, function (spot) { + var rng = dom.createRng(); + rng.setStart(spot.element, spot.offset); + rng.setEnd(element, startEndIndex + 1); + if (rng.toString() === content) { + return phase.finish(rng); + } else { + return phase.kontinue(); + } + }); + } else { + return phase.kontinue(); + } + }; + }; + var findPatternStart = function (dom, pattern, node, offset, block, requireGap) { + if (requireGap === void 0) { + requireGap = false; + } + if (pattern.start.length === 0 && !requireGap) { + var rng = dom.createRng(); + rng.setStart(node, offset); + rng.setEnd(node, offset); + return Option.some(rng); + } + return textBefore(node, offset, block).bind(function (spot) { + var outcome = repeatLeft(dom, spot.element, spot.offset, nodeMatchesPattern(dom, block, pattern.start), block); + var start = outcome.fold(Option.none, Option.none, Option.some); + return start.bind(function (startRange) { + if (requireGap) { + if (startRange.endContainer === spot.element && startRange.endOffset === spot.offset) { + return Option.none(); + } else if (spot.offset === 0 && startRange.endContainer.textContent.length === startRange.endOffset) { + return Option.none(); + } + } + return Option.some(startRange); + }); + }); + }; + var findPattern$1 = function (editor, block, details) { + var dom = editor.dom; + var root = dom.getRoot(); + var pattern = details.pattern; + var endNode = details.position.element; + var endOffset = details.position.offset; + return scanLeft(endNode, endOffset - details.pattern.end.length, block).bind(function (spot) { + var endPathRng = generatePathRange(root, spot.element, spot.offset, endNode, endOffset); + if (isReplacementPattern(pattern)) { + return Option.some({ + matches: [{ + pattern: pattern, + startRng: endPathRng, + endRng: endPathRng + }], + position: spot + }); + } else { + var resultsOpt = findPatternsRec(editor, details.remainingPatterns, spot.element, spot.offset, block); + var results_1 = resultsOpt.getOr({ + matches: [], + position: spot + }); + var pos = results_1.position; + var start = findPatternStart(dom, pattern, pos.element, pos.offset, block, resultsOpt.isNone()); + return start.map(function (startRng) { + var startPathRng = generatePathRangeFromRange(root, startRng); + return { + matches: results_1.matches.concat([{ + pattern: pattern, + startRng: startPathRng, + endRng: endPathRng + }]), + position: point(startRng.startContainer, startRng.startOffset) + }; + }); + } + }); + }; + var findPatternsRec = function (editor, patterns, node, offset, block) { + var dom = editor.dom; + return textBefore(node, offset, dom.getRoot()).bind(function (endSpot) { + var rng = dom.createRng(); + rng.setStart(block, 0); + rng.setEnd(node, offset); + var text = rng.toString(); + for (var i = 0; i < patterns.length; i++) { + var pattern = patterns[i]; + if (!endsWith(text, pattern.end)) { + continue; + } + var patternsWithoutCurrent = patterns.slice(); + patternsWithoutCurrent.splice(i, 1); + var result = findPattern$1(editor, block, { + pattern: pattern, + remainingPatterns: patternsWithoutCurrent, + position: endSpot + }); + if (result.isSome()) { + return result; + } + } + return Option.none(); + }); + }; + var applyPattern$1 = function (editor, pattern, patternRange) { + editor.selection.setRng(patternRange); + if (pattern.type === 'inline-format') { + each(pattern.format, function (format) { + editor.formatter.apply(format); + }); + } else { + editor.execCommand(pattern.cmd, false, pattern.value); + } + }; + var applyReplacementPattern = function (editor, pattern, marker, isRoot) { + var markerRange = rangeFromMarker(editor.dom, marker); + deleteRng(editor.dom, markerRange, isRoot); + applyPattern$1(editor, pattern, markerRange); + }; + var applyPatternWithContent = function (editor, pattern, startMarker, endMarker, isRoot) { + var dom = editor.dom; + var markerEndRange = rangeFromMarker(dom, endMarker); + var markerStartRange = rangeFromMarker(dom, startMarker); + deleteRng(dom, markerStartRange, isRoot); + deleteRng(dom, markerEndRange, isRoot); + var patternMarker = { + prefix: startMarker.prefix, + start: startMarker.end, + end: endMarker.start + }; + var patternRange = rangeFromMarker(dom, patternMarker); + applyPattern$1(editor, pattern, patternRange); + }; + var addMarkers = function (dom, matches) { + var markerPrefix = generate$1('mce_textpattern'); + var matchesWithEnds = foldr(matches, function (acc, match) { + var endMarker = createMarker(dom, markerPrefix + ('_end' + acc.length), match.endRng); + return acc.concat([__assign(__assign({}, match), { endMarker: endMarker })]); + }, []); + return foldr(matchesWithEnds, function (acc, match) { + var idx = matchesWithEnds.length - acc.length - 1; + var startMarker = isReplacementPattern(match.pattern) ? match.endMarker : createMarker(dom, markerPrefix + ('_start' + idx), match.startRng); + return acc.concat([__assign(__assign({}, match), { startMarker: startMarker })]); + }, []); + }; + var findPatterns$1 = function (editor, patterns, space) { + var rng = editor.selection.getRng(); + if (rng.collapsed === false) { + return []; + } + return getParentBlock(editor, rng).bind(function (block) { + var offset = rng.startOffset - (space ? 1 : 0); + return findPatternsRec(editor, patterns, rng.startContainer, offset, block); + }).fold(function () { + return []; + }, function (result) { + return result.matches; + }); + }; + var applyMatches$1 = function (editor, matches) { + if (matches.length === 0) { + return; + } + var dom = editor.dom; + var bookmark = editor.selection.getBookmark(); + var matchesWithMarkers = addMarkers(dom, matches); + each(matchesWithMarkers, function (match) { + var block = dom.getParent(match.startMarker.start, dom.isBlock); + var isRoot = function (node) { + return node === block; + }; + if (isReplacementPattern(match.pattern)) { + applyReplacementPattern(editor, match.pattern, match.endMarker, isRoot); + } else { + applyPatternWithContent(editor, match.pattern, match.startMarker, match.endMarker, isRoot); + } + removeMarker(dom, match.endMarker, isRoot); + removeMarker(dom, match.startMarker, isRoot); + }); + editor.selection.moveToBookmark(bookmark); + }; + + var handleEnter = function (editor, patternSet) { + if (!editor.selection.isCollapsed()) { + return false; + } + var inlineMatches = findPatterns$1(editor, patternSet.inlinePatterns, false); + var blockMatches = findPatterns(editor, patternSet.blockPatterns); + if (blockMatches.length > 0 || inlineMatches.length > 0) { + editor.undoManager.add(); + editor.undoManager.extra(function () { + editor.execCommand('mceInsertNewLine'); + }, function () { + editor.insertContent(zeroWidth()); + applyMatches$1(editor, inlineMatches); + applyMatches(editor, blockMatches); + var range = editor.selection.getRng(); + var spot = textBefore(range.startContainer, range.startOffset, editor.dom.getRoot()); + editor.execCommand('mceInsertNewLine'); + spot.each(function (s) { + if (s.element.data.charAt(s.offset - 1) === zeroWidth()) { + s.element.deleteData(s.offset - 1, 1); + cleanEmptyNodes(editor.dom, s.element.parentNode, function (e) { + return e === editor.dom.getRoot(); + }); + } + }); + }); + return true; + } + return false; + }; + var handleInlineKey = function (editor, patternSet) { + var inlineMatches = findPatterns$1(editor, patternSet.inlinePatterns, true); + if (inlineMatches.length > 0) { + editor.undoManager.transact(function () { + applyMatches$1(editor, inlineMatches); + }); + } + }; + var checkKeyEvent = function (codes, event, predicate) { + for (var i = 0; i < codes.length; i++) { + if (predicate(codes[i], event)) { + return true; + } + } + }; + var checkKeyCode = function (codes, event) { + return checkKeyEvent(codes, event, function (code, event) { + return code === event.keyCode && global$2.modifierPressed(event) === false; + }); + }; + var checkCharCode = function (chars, event) { + return checkKeyEvent(chars, event, function (chr, event) { + return chr.charCodeAt(0) === event.charCode; + }); + }; + var KeyHandler = { + handleEnter: handleEnter, + handleInlineKey: handleInlineKey, + checkCharCode: checkCharCode, + checkKeyCode: checkKeyCode + }; + + var setup = function (editor, patternsState) { + var charCodes = [ + ',', + '.', + ';', + ':', + '!', + '?' + ]; + var keyCodes = [32]; + editor.on('keydown', function (e) { + if (e.keyCode === 13 && !global$2.modifierPressed(e)) { + if (KeyHandler.handleEnter(editor, patternsState.get())) { + e.preventDefault(); + } + } + }, true); + editor.on('keyup', function (e) { + if (KeyHandler.checkKeyCode(keyCodes, e)) { + KeyHandler.handleInlineKey(editor, patternsState.get()); + } + }); + editor.on('keypress', function (e) { + if (KeyHandler.checkCharCode(charCodes, e)) { + global$1.setEditorTimeout(editor, function () { + KeyHandler.handleInlineKey(editor, patternsState.get()); + }); + } + }); + }; + var Keyboard = { setup: setup }; + + function Plugin () { + global.add('textpattern', function (editor) { + var patternsState = Cell(getPatternSet(editor.settings)); + Keyboard.setup(editor, patternsState); + return Api.get(patternsState); + }); + } + + Plugin(); + +}(window)); diff --git a/lib/tinymce/js/tinymce/plugins/textpattern/plugin.min.js b/lib/tinymce/js/tinymce/plugins/textpattern/plugin.min.js new file mode 100644 index 00000000..256cb544 --- /dev/null +++ b/lib/tinymce/js/tinymce/plugins/textpattern/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.1.6 (2020-01-28) + */ +!function(f){"use strict";var r=function(t){function n(){return e}var e=t;return{get:n,set:function(t){e=t},clone:function(){return r(n())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=function(){return(u=Object.assign||function(t){for(var n,e=1,r=arguments.length;en.start.length?-1:1})}function T(o){function a(t){return yt.error({message:t,pattern:o})}function t(t,n,e){if(o.format===undefined)return o.cmd!==undefined?it(o.cmd)?yt.value(e(o.cmd,o.value)):a(t+" pattern has non-string `cmd` parameter"):a(t+" pattern is missing both `format` and `cmd` parameters");var r=void 0;if(ft(o.format)){if(!O(o.format,it))return a(t+" pattern has non-string items in the `format` array");r=o.format}else{if(!it(o.format))return a(t+" pattern has non-string `format` parameter");r=[o.format]}return yt.value(n(r))}if(!ut(o))return a("Raw pattern is not an object");if(!it(o.start))return a("Raw pattern is missing `start` parameter");if(o.end===undefined)return o.replacement!==undefined?it(o.replacement)?0===o.start.length?a("Replacement pattern has empty `start` parameter"):yt.value({type:"inline-command",start:"",end:o.start,cmd:"mceInsertContent",value:o.replacement}):a("Replacement pattern has non-string `replacement` parameter"):0===o.start.length?a("Block pattern has empty `start` parameter"):t("Block",function(t){return{type:"block-format",start:o.start,format:t[0]}},function(t,n){return{type:"block-command",start:o.start,cmd:t,value:n}});if(!it(o.end))return a("Inline pattern has non-string `end` parameter");if(0===o.start.length&&0===o.end.length)return a("Inline pattern has empty `start` and `end` parameters");var e=o.start,r=o.end;return 0===r.length&&(r=e,e=""),t("Inline",function(t){return{type:"inline-format",start:e,end:r,format:t}},function(t,n){return{type:"inline-command",start:e,end:r,cmd:t,value:n}})}function R(t){return"block-command"===t.type?{start:t.start,cmd:t.cmd,value:t.value}:"block-format"===t.type?{start:t.start,format:t.format}:"inline-command"===t.type?"mceInsertContent"===t.cmd&&""===t.start?{start:t.end,replacement:t.value}:{start:t.start,end:t.end,cmd:t.cmd,value:t.value}:"inline-format"===t.type?{start:t.start,end:t.end,format:1===t.format.length?t.format[0]:t.format}:void 0}function N(t){return{inlinePatterns:b(t,x),blockPatterns:E(b(t,C))}}function P(){for(var t=[],n=0;nn.data.length))return[];for(var r=[e],o=n;o!==t&&o.parentNode;){for(var a=o.parentNode,i=0;i= 1 && depth <= 9 ? depth : 3; + }; + var Settings = { + getTocClass: getTocClass, + getTocHeader: getTocHeader, + getTocDepth: getTocDepth + }; + + var create = function (prefix) { + var counter = 0; + return function () { + var guid = new Date().getTime().toString(32); + return prefix + guid + (counter++).toString(32); + }; + }; + var Guid = { create: create }; + + var tocId = Guid.create('mcetoc_'); + var generateSelector = function generateSelector(depth) { + var i; + var selector = []; + for (i = 1; i <= depth; i++) { + selector.push('h' + i); + } + return selector.join(','); + }; + var hasHeaders = function (editor) { + return readHeaders(editor).length > 0; + }; + var readHeaders = function (editor) { + var tocClass = Settings.getTocClass(editor); + var headerTag = Settings.getTocHeader(editor); + var selector = generateSelector(Settings.getTocDepth(editor)); + var headers = editor.$(selector); + if (headers.length && /^h[1-9]$/i.test(headerTag)) { + headers = headers.filter(function (i, el) { + return !editor.dom.hasClass(el.parentNode, tocClass); + }); + } + return global$3.map(headers, function (h) { + return { + id: h.id ? h.id : tocId(), + level: parseInt(h.nodeName.replace(/^H/i, ''), 10), + title: editor.$.text(h), + element: h + }; + }); + }; + var getMinLevel = function (headers) { + var i, minLevel = 9; + for (i = 0; i < headers.length; i++) { + if (headers[i].level < minLevel) { + minLevel = headers[i].level; + } + if (minLevel === 1) { + return minLevel; + } + } + return minLevel; + }; + var generateTitle = function (tag, title) { + var openTag = '<' + tag + ' contenteditable="true">'; + var closeTag = ''; + return openTag + global$1.DOM.encode(title) + closeTag; + }; + var generateTocHtml = function (editor) { + var html = generateTocContentHtml(editor); + return '
    ' + html + '
    '; + }; + var generateTocContentHtml = function (editor) { + var html = ''; + var headers = readHeaders(editor); + var prevLevel = getMinLevel(headers) - 1; + var i, ii, h, nextLevel; + if (!headers.length) { + return ''; + } + html += generateTitle(Settings.getTocHeader(editor), global$2.translate('Table of Contents')); + for (i = 0; i < headers.length; i++) { + h = headers[i]; + h.element.id = h.id; + nextLevel = headers[i + 1] && headers[i + 1].level; + if (prevLevel === h.level) { + html += '
  • '; + } else { + for (ii = prevLevel; ii < h.level; ii++) { + html += '
    • '; + } + } + html += '' + h.title + ''; + if (nextLevel === h.level || !nextLevel) { + html += '
    • '; + if (!nextLevel) { + html += '
    '; + } + } else { + for (ii = h.level; ii > nextLevel; ii--) { + html += '
  • '; + } + } + prevLevel = h.level; + } + return html; + }; + var isEmptyOrOffscren = function (editor, nodes) { + return !nodes.length || editor.dom.getParents(nodes[0], '.mce-offscreen-selection').length > 0; + }; + var insertToc = function (editor) { + var tocClass = Settings.getTocClass(editor); + var $tocElm = editor.$('.' + tocClass); + if (isEmptyOrOffscren(editor, $tocElm)) { + editor.insertContent(generateTocHtml(editor)); + } else { + updateToc(editor); + } + }; + var updateToc = function (editor) { + var tocClass = Settings.getTocClass(editor); + var $tocElm = editor.$('.' + tocClass); + if ($tocElm.length) { + editor.undoManager.transact(function () { + $tocElm.html(generateTocContentHtml(editor)); + }); + } + }; + var Toc = { + hasHeaders: hasHeaders, + insertToc: insertToc, + updateToc: updateToc + }; + + var register = function (editor) { + editor.addCommand('mceInsertToc', function () { + Toc.insertToc(editor); + }); + editor.addCommand('mceUpdateToc', function () { + Toc.updateToc(editor); + }); + }; + var Commands = { register: register }; + + var setup = function (editor) { + var $ = editor.$, tocClass = Settings.getTocClass(editor); + editor.on('PreProcess', function (e) { + var $tocElm = $('.' + tocClass, e.node); + if ($tocElm.length) { + $tocElm.removeAttr('contentEditable'); + $tocElm.find('[contenteditable]').removeAttr('contentEditable'); + } + }); + editor.on('SetContent', function () { + var $tocElm = $('.' + tocClass); + if ($tocElm.length) { + $tocElm.attr('contentEditable', false); + $tocElm.children(':first-child').attr('contentEditable', true); + } + }); + }; + var FilterContent = { setup: setup }; + + var toggleState = function (editor) { + return function (api) { + var toggleDisabledState = function () { + return api.setDisabled(editor.readonly || !Toc.hasHeaders(editor)); + }; + toggleDisabledState(); + editor.on('LoadContent SetContent change', toggleDisabledState); + return function () { + return editor.on('LoadContent SetContent change', toggleDisabledState); + }; + }; + }; + var isToc = function (editor) { + return function (elm) { + return elm && editor.dom.is(elm, '.' + Settings.getTocClass(editor)) && editor.getBody().contains(elm); + }; + }; + var register$1 = function (editor) { + editor.ui.registry.addButton('toc', { + icon: 'toc', + tooltip: 'Table of contents', + onAction: function () { + return editor.execCommand('mceInsertToc'); + }, + onSetup: toggleState(editor) + }); + editor.ui.registry.addButton('tocupdate', { + icon: 'reload', + tooltip: 'Update', + onAction: function () { + return editor.execCommand('mceUpdateToc'); + } + }); + editor.ui.registry.addMenuItem('toc', { + icon: 'toc', + text: 'Table of contents', + onAction: function () { + return editor.execCommand('mceInsertToc'); + }, + onSetup: toggleState(editor) + }); + editor.ui.registry.addContextToolbar('toc', { + items: 'tocupdate', + predicate: isToc(editor), + scope: 'node', + position: 'node' + }); + }; + var Buttons = { register: register$1 }; + + function Plugin () { + global.add('toc', function (editor) { + Commands.register(editor); + Buttons.register(editor); + FilterContent.setup(editor); + }); + } + + Plugin(); + +}()); diff --git a/lib/tinymce/js/tinymce/plugins/toc/plugin.min.js b/lib/tinymce/js/tinymce/plugins/toc/plugin.min.js new file mode 100644 index 00000000..02548c4b --- /dev/null +++ b/lib/tinymce/js/tinymce/plugins/toc/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.1.6 (2020-01-28) + */ +!function(){"use strict";function e(n){return function(t){function e(){return t.setDisabled(n.readonly||!v.hasHeaders(n))}return e(),n.on("LoadContent SetContent change",e),function(){return n.on("LoadContent SetContent change",e)}}}var t=tinymce.util.Tools.resolve("tinymce.PluginManager"),u=tinymce.util.Tools.resolve("tinymce.dom.DOMUtils"),l=tinymce.util.Tools.resolve("tinymce.util.I18n"),i=tinymce.util.Tools.resolve("tinymce.util.Tools"),c=function(t){return t.getParam("toc_class","mce-toc")},d=function(t){var e=t.getParam("toc_header","h2");return/^h[1-6]$/.test(e)?e:"h2"},a=function(t){var e=parseInt(t.getParam("toc_depth","3"),10);return 1<=e&&e<=9?e:3},s=function(e){var n=0;return function(){var t=(new Date).getTime().toString(32);return e+t+(n++).toString(32)}}("mcetoc_"),f=function f(t){var e,n=[];for(e=1;e<=t;e++)n.push("h"+e);return n.join(",")},m=function(n){var o=c(n),t=d(n),e=f(a(n)),r=n.$(e);return r.length&&/^h[1-9]$/i.test(t)&&(r=r.filter(function(t,e){return!n.dom.hasClass(e.parentNode,o)})),i.map(r,function(t){return{id:t.id?t.id:s(),level:parseInt(t.nodeName.replace(/^H/i,""),10),title:n.$.text(t),element:t}})},o=function(t){var e,n,o,r,i="",c=m(t),a=function(t){var e,n=9;for(e=0;e";return"<"+t+' contenteditable="true">'+u.DOM.encode(e)+n}(d(t),l.translate("Table of Contents")),e=0;e";else for(n=a;n
  • ";if(i+=''+o.title+"",r!==o.level&&r)for(n=o.level;r
  • ";else i+="
  • ",r||(i+="");a=o.level}return i},r=function(t){var e=c(t),n=t.$("."+e);n.length&&t.undoManager.transact(function(){n.html(o(t))})},v={hasHeaders:function(t){return 0'+e+""}(t))},updateToc:r},n=function(t){t.addCommand("mceInsertToc",function(){v.insertToc(t)}),t.addCommand("mceUpdateToc",function(){v.updateToc(t)})},g=function(t){var n=t.$,o=c(t);t.on("PreProcess",function(t){var e=n("."+o,t.node);e.length&&(e.removeAttr("contentEditable"),e.find("[contenteditable]").removeAttr("contentEditable"))}),t.on("SetContent",function(){var t=n("."+o);t.length&&(t.attr("contentEditable",!1),t.children(":first-child").attr("contentEditable",!0))})},h=function(t){t.ui.registry.addButton("toc",{icon:"toc",tooltip:"Table of contents",onAction:function(){return t.execCommand("mceInsertToc")},onSetup:e(t)}),t.ui.registry.addButton("tocupdate",{icon:"reload",tooltip:"Update",onAction:function(){return t.execCommand("mceUpdateToc")}}),t.ui.registry.addMenuItem("toc",{icon:"toc",text:"Table of contents",onAction:function(){return t.execCommand("mceInsertToc")},onSetup:e(t)}),t.ui.registry.addContextToolbar("toc",{items:"tocupdate",predicate:function(e){return function(t){return t&&e.dom.is(t,"."+c(e))&&e.getBody().contains(t)}}(t),scope:"node",position:"node"})};!function p(){t.add("toc",function(t){n(t),h(t),g(t)})}()}(); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/plugins/visualblocks/css/visualblocks.css b/lib/tinymce/js/tinymce/plugins/visualblocks/css/visualblocks.css deleted file mode 100644 index 7a3a47a3..00000000 --- a/lib/tinymce/js/tinymce/plugins/visualblocks/css/visualblocks.css +++ /dev/null @@ -1,114 +0,0 @@ -.mce-visualblocks p { - padding-top: 10px; - border: 1px dashed #BBB; - margin-left: 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhCQAJAJEAAAAAAP///7u7u////yH5BAEAAAMALAAAAAAJAAkAAAIQnG+CqCN/mlyvsRUpThG6AgA7); -} - -.mce-visualblocks h1 { - padding-top: 10px; - border: 1px dashed #BBB; - margin-left: 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDQAKAIABALu7u////yH5BAEAAAEALAAAAAANAAoAAAIXjI8GybGu1JuxHoAfRNRW3TWXyF2YiRUAOw==); -} - -.mce-visualblocks h2 { - padding-top: 10px; - border: 1px dashed #BBB; - margin-left: 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8Hybbx4oOuqgTynJd6bGlWg3DkJzoaUAAAOw==); -} - -.mce-visualblocks h3 { - padding-top: 10px; - border: 1px dashed #BBB; - margin-left: 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIZjI8Hybbx4oOuqgTynJf2Ln2NOHpQpmhAAQA7); -} - -.mce-visualblocks h4 { - padding-top: 10px; - border: 1px dashed #BBB; - margin-left: 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxInR0zqeAdhtJlXwV1oCll2HaWgAAOw==); -} - -.mce-visualblocks h5 { - padding-top: 10px; - border: 1px dashed #BBB; - margin-left: 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjane4iq5GlW05GgIkIZUAAAOw==); -} - -.mce-visualblocks h6 { - padding-top: 10px; - border: 1px dashed #BBB; - margin-left: 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhDgAKAIABALu7u////yH5BAEAAAEALAAAAAAOAAoAAAIajI8HybbxIoiuwjan04jep1iZ1XRlAo5bVgAAOw==); -} - -.mce-visualblocks div { - padding-top: 10px; - border: 1px dashed #BBB; - margin-left: 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhEgAKAIABALu7u////yH5BAEAAAEALAAAAAASAAoAAAIfjI9poI0cgDywrhuxfbrzDEbQM2Ei5aRjmoySW4pAAQA7); -} - -.mce-visualblocks section { - padding-top: 10px; - border: 1px dashed #BBB; - margin: 0 0 1em 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhKAAKAIABALu7u////yH5BAEAAAEALAAAAAAoAAoAAAI5jI+pywcNY3sBWHdNrplytD2ellDeSVbp+GmWqaDqDMepc8t17Y4vBsK5hDyJMcI6KkuYU+jpjLoKADs=); -} - -.mce-visualblocks article { - padding-top: 10px; - border: 1px dashed #BBB; - margin: 0 0 1em 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhKgAKAIABALu7u////yH5BAEAAAEALAAAAAAqAAoAAAI6jI+pywkNY3wG0GBvrsd2tXGYSGnfiF7ikpXemTpOiJScasYoDJJrjsG9gkCJ0ag6KhmaIe3pjDYBBQA7); -} - -.mce-visualblocks blockquote { - padding-top: 10px; - border: 1px dashed #BBB; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhPgAKAIABALu7u////yH5BAEAAAEALAAAAAA+AAoAAAJPjI+py+0Knpz0xQDyuUhvfoGgIX5iSKZYgq5uNL5q69asZ8s5rrf0yZmpNkJZzFesBTu8TOlDVAabUyatguVhWduud3EyiUk45xhTTgMBBQA7); -} - -.mce-visualblocks address { - padding-top: 10px; - border: 1px dashed #BBB; - margin: 0 0 1em 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhLQAKAIABALu7u////yH5BAEAAAEALAAAAAAtAAoAAAI/jI+pywwNozSP1gDyyZcjb3UaRpXkWaXmZW4OqKLhBmLs+K263DkJK7OJeifh7FicKD9A1/IpGdKkyFpNmCkAADs=); -} - -.mce-visualblocks pre { - padding-top: 10px; - border: 1px dashed #BBB; - margin-left: 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhFQAKAIABALu7uwAAACH5BAEAAAEALAAAAAAVAAoAAAIjjI+ZoN0cgDwSmnpz1NCueYERhnibZVKLNnbOq8IvKpJtVQAAOw==); -} - -.mce-visualblocks figure { - padding-top: 10px; - border: 1px dashed #BBB; - margin: 0 0 1em 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhJAAKAIAAALu7u////yH5BAEAAAEALAAAAAAkAAoAAAI0jI+py+2fwAHUSFvD3RlvG4HIp4nX5JFSpnZUJ6LlrM52OE7uSWosBHScgkSZj7dDKnWAAgA7); -} - -.mce-visualblocks hgroup { - padding-top: 10px; - border: 1px dashed #BBB; - margin: 0 0 1em 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhJwAKAIABALu7uwAAACH5BAEAAAEALAAAAAAnAAoAAAI3jI+pywYNI3uB0gpsRtt5fFnfNZaVSYJil4Wo03Hv6Z62uOCgiXH1kZIIJ8NiIxRrAZNMZAtQAAA7); -} - -.mce-visualblocks aside { - padding-top: 10px; - border: 1px dashed #BBB; - margin: 0 0 1em 3px; - background: transparent no-repeat url(data:image/gif;base64,R0lGODlhHgAKAIABAKqqqv///yH5BAEAAAEALAAAAAAeAAoAAAItjI+pG8APjZOTzgtqy7I3f1yehmQcFY4WKZbqByutmW4aHUd6vfcVbgudgpYCADs=); -} - -.mce-visualblocks figcaption { - border: 1px dashed #BBB; -} diff --git a/lib/tinymce/js/tinymce/plugins/visualblocks/img/address.gif b/lib/tinymce/js/tinymce/plugins/visualblocks/img/address.gif deleted file mode 100644 index 87c4bff9..00000000 Binary files a/lib/tinymce/js/tinymce/plugins/visualblocks/img/address.gif and /dev/null differ diff --git a/lib/tinymce/js/tinymce/plugins/visualblocks/img/article.gif b/lib/tinymce/js/tinymce/plugins/visualblocks/img/article.gif deleted file mode 100644 index da2dbde7..00000000 Binary files a/lib/tinymce/js/tinymce/plugins/visualblocks/img/article.gif and /dev/null differ diff --git a/lib/tinymce/js/tinymce/plugins/visualblocks/img/aside.gif b/lib/tinymce/js/tinymce/plugins/visualblocks/img/aside.gif deleted file mode 100644 index 5f034c65..00000000 Binary files a/lib/tinymce/js/tinymce/plugins/visualblocks/img/aside.gif and /dev/null differ diff --git a/lib/tinymce/js/tinymce/plugins/visualblocks/img/blockquote.gif b/lib/tinymce/js/tinymce/plugins/visualblocks/img/blockquote.gif deleted file mode 100644 index a9ae9118..00000000 Binary files a/lib/tinymce/js/tinymce/plugins/visualblocks/img/blockquote.gif and /dev/null differ diff --git a/lib/tinymce/js/tinymce/plugins/visualblocks/img/div.gif b/lib/tinymce/js/tinymce/plugins/visualblocks/img/div.gif deleted file mode 100644 index 41754ae4..00000000 Binary files a/lib/tinymce/js/tinymce/plugins/visualblocks/img/div.gif and /dev/null differ diff --git a/lib/tinymce/js/tinymce/plugins/visualblocks/img/figure.gif b/lib/tinymce/js/tinymce/plugins/visualblocks/img/figure.gif deleted file mode 100644 index 88e7b35f..00000000 Binary files a/lib/tinymce/js/tinymce/plugins/visualblocks/img/figure.gif and /dev/null differ diff --git a/lib/tinymce/js/tinymce/plugins/visualblocks/img/h1.gif b/lib/tinymce/js/tinymce/plugins/visualblocks/img/h1.gif deleted file mode 100644 index a0507101..00000000 Binary files a/lib/tinymce/js/tinymce/plugins/visualblocks/img/h1.gif and /dev/null differ diff --git a/lib/tinymce/js/tinymce/plugins/visualblocks/img/h2.gif b/lib/tinymce/js/tinymce/plugins/visualblocks/img/h2.gif deleted file mode 100644 index 75d8f54a..00000000 Binary files a/lib/tinymce/js/tinymce/plugins/visualblocks/img/h2.gif and /dev/null differ diff --git a/lib/tinymce/js/tinymce/plugins/visualblocks/img/h3.gif b/lib/tinymce/js/tinymce/plugins/visualblocks/img/h3.gif deleted file mode 100644 index 11a1054b..00000000 Binary files a/lib/tinymce/js/tinymce/plugins/visualblocks/img/h3.gif and /dev/null differ diff --git a/lib/tinymce/js/tinymce/plugins/visualblocks/img/h4.gif b/lib/tinymce/js/tinymce/plugins/visualblocks/img/h4.gif deleted file mode 100644 index c6f2a762..00000000 Binary files a/lib/tinymce/js/tinymce/plugins/visualblocks/img/h4.gif and /dev/null differ diff --git a/lib/tinymce/js/tinymce/plugins/visualblocks/img/h5.gif b/lib/tinymce/js/tinymce/plugins/visualblocks/img/h5.gif deleted file mode 100644 index e2cc8c74..00000000 Binary files a/lib/tinymce/js/tinymce/plugins/visualblocks/img/h5.gif and /dev/null differ diff --git a/lib/tinymce/js/tinymce/plugins/visualblocks/img/h6.gif b/lib/tinymce/js/tinymce/plugins/visualblocks/img/h6.gif deleted file mode 100644 index 5ea288fb..00000000 Binary files a/lib/tinymce/js/tinymce/plugins/visualblocks/img/h6.gif and /dev/null differ diff --git a/lib/tinymce/js/tinymce/plugins/visualblocks/img/hgroup.gif b/lib/tinymce/js/tinymce/plugins/visualblocks/img/hgroup.gif deleted file mode 100644 index 71519190..00000000 Binary files a/lib/tinymce/js/tinymce/plugins/visualblocks/img/hgroup.gif and /dev/null differ diff --git a/lib/tinymce/js/tinymce/plugins/visualblocks/img/p.gif b/lib/tinymce/js/tinymce/plugins/visualblocks/img/p.gif deleted file mode 100644 index 04645bf4..00000000 Binary files a/lib/tinymce/js/tinymce/plugins/visualblocks/img/p.gif and /dev/null differ diff --git a/lib/tinymce/js/tinymce/plugins/visualblocks/img/pre.gif b/lib/tinymce/js/tinymce/plugins/visualblocks/img/pre.gif deleted file mode 100644 index 0699b515..00000000 Binary files a/lib/tinymce/js/tinymce/plugins/visualblocks/img/pre.gif and /dev/null differ diff --git a/lib/tinymce/js/tinymce/plugins/visualblocks/img/section.gif b/lib/tinymce/js/tinymce/plugins/visualblocks/img/section.gif deleted file mode 100644 index 7e2ebe81..00000000 Binary files a/lib/tinymce/js/tinymce/plugins/visualblocks/img/section.gif and /dev/null differ diff --git a/lib/tinymce/js/tinymce/plugins/visualblocks/plugin.js b/lib/tinymce/js/tinymce/plugins/visualblocks/plugin.js index 9edf59c5..2249b11d 100644 --- a/lib/tinymce/js/tinymce/plugins/visualblocks/plugin.js +++ b/lib/tinymce/js/tinymce/plugins/visualblocks/plugin.js @@ -1,72 +1,116 @@ /** - * 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 2012, Moxiecode Systems AB - * Released under LGPL License. - * - * License: http://www.tinymce.com/license - * Contributing: http://www.tinymce.com/contributing + * Version: 5.1.6 (2020-01-28) */ +(function () { + 'use strict'; -/*global tinymce:true */ - -tinymce.PluginManager.add('visualblocks', function(editor, url) { - var cssId, visualBlocksMenuItem, enabled; + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; - // We don't support older browsers like IE6/7 and they don't provide prototypes for DOM objects - if (!window.NodeList) { - return; - } + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); - editor.addCommand('mceVisualBlocks', function() { - var dom = editor.dom, linkElm; + var fireVisualBlocks = function (editor, state) { + editor.fire('VisualBlocks', { state: state }); + }; + var Events = { fireVisualBlocks: fireVisualBlocks }; - if (!cssId) { - cssId = dom.uniqueId(); - linkElm = dom.create('link', { - id: cssId, - rel: 'stylesheet', - href: url + '/css/visualblocks.css' - }); + var toggleVisualBlocks = function (editor, pluginUrl, enabledState) { + var dom = editor.dom; + dom.toggleClass(editor.getBody(), 'mce-visualblocks'); + enabledState.set(!enabledState.get()); + Events.fireVisualBlocks(editor, enabledState.get()); + }; + var VisualBlocks = { toggleVisualBlocks: toggleVisualBlocks }; - editor.getDoc().getElementsByTagName('head')[0].appendChild(linkElm); - } + var register = function (editor, pluginUrl, enabledState) { + editor.addCommand('mceVisualBlocks', function () { + VisualBlocks.toggleVisualBlocks(editor, pluginUrl, enabledState); + }); + }; + var Commands = { register: register }; - // Toggle on/off visual blocks while computing previews - editor.on("PreviewFormats AfterPreviewFormats", function(e) { - if (enabled) { - dom.toggleClass(editor.getBody(), 'mce-visualblocks', e.type == "afterpreviewformats"); - } - }); + var isEnabledByDefault = function (editor) { + return editor.getParam('visualblocks_default_state', false, 'boolean'); + }; + var Settings = { isEnabledByDefault: isEnabledByDefault }; - dom.toggleClass(editor.getBody(), 'mce-visualblocks'); - enabled = editor.dom.hasClass(editor.getBody(), 'mce-visualblocks'); + var setup = function (editor, pluginUrl, enabledState) { + editor.on('PreviewFormats AfterPreviewFormats', function (e) { + if (enabledState.get()) { + editor.dom.toggleClass(editor.getBody(), 'mce-visualblocks', e.type === 'afterpreviewformats'); + } + }); + editor.on('init', function () { + if (Settings.isEnabledByDefault(editor)) { + VisualBlocks.toggleVisualBlocks(editor, pluginUrl, enabledState); + } + }); + editor.on('remove', function () { + editor.dom.removeClass(editor.getBody(), 'mce-visualblocks'); + }); + }; + var Bindings = { setup: setup }; - if (visualBlocksMenuItem) { - visualBlocksMenuItem.active(dom.hasClass(editor.getBody(), 'mce-visualblocks')); - } - }); + var toggleActiveState = function (editor, enabledState) { + return function (api) { + api.setActive(enabledState.get()); + var editorEventCallback = function (e) { + return api.setActive(e.state); + }; + editor.on('VisualBlocks', editorEventCallback); + return function () { + return editor.off('VisualBlocks', editorEventCallback); + }; + }; + }; + var register$1 = function (editor, enabledState) { + editor.ui.registry.addToggleButton('visualblocks', { + icon: 'visualblocks', + tooltip: 'Show blocks', + onAction: function () { + return editor.execCommand('mceVisualBlocks'); + }, + onSetup: toggleActiveState(editor, enabledState) + }); + editor.ui.registry.addToggleMenuItem('visualblocks', { + text: 'Show blocks', + onAction: function () { + return editor.execCommand('mceVisualBlocks'); + }, + onSetup: toggleActiveState(editor, enabledState) + }); + }; + var Buttons = { register: register$1 }; - editor.addButton('visualblocks', { - title: 'visualblocks.desc', - cmd: 'mceVisualBlocks' - }); + function Plugin () { + global.add('visualblocks', function (editor, pluginUrl) { + var enabledState = Cell(false); + Commands.register(editor, pluginUrl, enabledState); + Buttons.register(editor, enabledState); + Bindings.setup(editor, pluginUrl, enabledState); + }); + } - editor.addMenuItem('visualblocks', { - text: 'Show blocks', - cmd: 'mceVisualBlocks', - onPostRender: function() { - visualBlocksMenuItem = this; - visualBlocksMenuItem.active(editor.dom.hasClass(editor.getBody(), 'mce-visualblocks')); - }, - selectable: true, - context: 'view', - prependToContext: true - }); + Plugin(); - editor.on('init', function() { - if (editor.settings.visualblocks_default_state) { - editor.execCommand('mceVisualBlocks', false, null, {skip_focus: true}); - } - }); -}); +}()); diff --git a/lib/tinymce/js/tinymce/plugins/visualblocks/plugin.min.js b/lib/tinymce/js/tinymce/plugins/visualblocks/plugin.min.js index ced2d5a3..15614517 100644 --- a/lib/tinymce/js/tinymce/plugins/visualblocks/plugin.min.js +++ b/lib/tinymce/js/tinymce/plugins/visualblocks/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("visualblocks",function(e,t){var n,a,i;window.NodeList&&(e.addCommand("mceVisualBlocks",function(){var o,r=e.dom;n||(n=r.uniqueId(),o=r.create("link",{id:n,rel:"stylesheet",href:t+"/css/visualblocks.css"}),e.getDoc().getElementsByTagName("head")[0].appendChild(o)),e.on("PreviewFormats AfterPreviewFormats",function(t){i&&r.toggleClass(e.getBody(),"mce-visualblocks","afterpreviewformats"==t.type)}),r.toggleClass(e.getBody(),"mce-visualblocks"),i=e.dom.hasClass(e.getBody(),"mce-visualblocks"),a&&a.active(r.hasClass(e.getBody(),"mce-visualblocks"))}),e.addButton("visualblocks",{title:"visualblocks.desc",cmd:"mceVisualBlocks"}),e.addMenuItem("visualblocks",{text:"Show blocks",cmd:"mceVisualBlocks",onPostRender:function(){a=this,a.active(e.dom.hasClass(e.getBody(),"mce-visualblocks"))},selectable:!0,context:"view",prependToContext:!0}),e.on("init",function(){e.settings.visualblocks_default_state&&e.execCommand("mceVisualBlocks",!1,null,{skip_focus:!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.1.6 (2020-01-28) + */ +!function(){"use strict";function n(n,e){return function(o){o.setActive(e.get());function t(t){return o.setActive(t.state)}return n.on("VisualBlocks",t),function(){return n.off("VisualBlocks",t)}}}var e=function(t){function o(){return n}var n=t;return{get:o,set:function(t){n=t},clone:function(){return e(o())}}},t=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=function(t,o){t.fire("VisualBlocks",{state:o})},u=function(t,o,n){t.dom.toggleClass(t.getBody(),"mce-visualblocks"),n.set(!n.get()),i(t,n.get())},c=function(t,o,n){t.addCommand("mceVisualBlocks",function(){u(t,o,n)})},s=function(t){return t.getParam("visualblocks_default_state",!1,"boolean")},l=function(o,t,n){o.on("PreviewFormats AfterPreviewFormats",function(t){n.get()&&o.dom.toggleClass(o.getBody(),"mce-visualblocks","afterpreviewformats"===t.type)}),o.on("init",function(){s(o)&&u(o,t,n)}),o.on("remove",function(){o.dom.removeClass(o.getBody(),"mce-visualblocks")})},r=function(t,o){t.ui.registry.addToggleButton("visualblocks",{icon:"visualblocks",tooltip:"Show blocks",onAction:function(){return t.execCommand("mceVisualBlocks")},onSetup:n(t,o)}),t.ui.registry.addToggleMenuItem("visualblocks",{text:"Show blocks",onAction:function(){return t.execCommand("mceVisualBlocks")},onSetup:n(t,o)})};!function o(){t.add("visualblocks",function(t,o){var n=e(!1);c(t,o,n),r(t,n),l(t,o,n)})}()}(); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/plugins/visualchars/plugin.js b/lib/tinymce/js/tinymce/plugins/visualchars/plugin.js index 77f9413e..481d42ff 100644 --- a/lib/tinymce/js/tinymce/plugins/visualchars/plugin.js +++ b/lib/tinymce/js/tinymce/plugins/visualchars/plugin.js @@ -1,80 +1,571 @@ /** - * 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.1.6 (2020-01-28) */ +(function (domGlobals) { + 'use strict'; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + var global = tinymce.util.Tools.resolve('tinymce.PluginManager'); + + var get = function (toggleState) { + var isEnabled = function () { + return toggleState.get(); + }; + return { isEnabled: isEnabled }; + }; + var Api = { get: get }; + + var fireVisualChars = function (editor, state) { + return editor.fire('VisualChars', { state: state }); + }; + var Events = { fireVisualChars: fireVisualChars }; + + 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()') + }; + if (Object.freeze) { + Object.freeze(me); + } + 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 Option = { + some: some, + none: none, + from: from + }; + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + 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 isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isString = isType('string'); + var isBoolean = isType('boolean'); + var isFunction = isType('function'); + var isNumber = isType('number'); + + 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 from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + var ATTRIBUTE = domGlobals.Node.ATTRIBUTE_NODE; + var CDATA_SECTION = domGlobals.Node.CDATA_SECTION_NODE; + var COMMENT = domGlobals.Node.COMMENT_NODE; + var DOCUMENT = domGlobals.Node.DOCUMENT_NODE; + var DOCUMENT_TYPE = domGlobals.Node.DOCUMENT_TYPE_NODE; + var DOCUMENT_FRAGMENT = domGlobals.Node.DOCUMENT_FRAGMENT_NODE; + var ELEMENT = domGlobals.Node.ELEMENT_NODE; + var TEXT = domGlobals.Node.TEXT_NODE; + var PROCESSING_INSTRUCTION = domGlobals.Node.PROCESSING_INSTRUCTION_NODE; + var ENTITY_REFERENCE = domGlobals.Node.ENTITY_REFERENCE_NODE; + var ENTITY = domGlobals.Node.ENTITY_NODE; + var NOTATION = domGlobals.Node.NOTATION_NODE; + + var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.window : Function('return this;')(); + + var type = function (element) { + return element.dom().nodeType; + }; + var value = function (element) { + return element.dom().nodeValue; + }; + var isType$1 = function (t) { + return function (element) { + return type(element) === t; + }; + }; + var isText = isType$1(TEXT); + + var rawSet = function (dom, key, value) { + if (isString(value) || isBoolean(value) || isNumber(value)) { + dom.setAttribute(key, value + ''); + } else { + domGlobals.console.error('Invalid call to Attr.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 read = function (element, attr) { + var value = get$1(element, attr); + return value === undefined || value === '' ? [] : value.split(' '); + }; + var add = function (element, attr, id) { + var old = read(element, attr); + var nu = old.concat([id]); + set(element, attr, nu.join(' ')); + return true; + }; + var remove$1 = 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$2 = function (element) { + return read(element, 'class'); + }; + var add$1 = function (element, clazz) { + return add(element, 'class', clazz); + }; + var remove$2 = function (element, clazz) { + return remove$1(element, 'class', clazz); + }; + + var add$2 = function (element, clazz) { + if (supports(element)) { + element.dom().classList.add(clazz); + } else { + add$1(element, clazz); + } + }; + var cleanClass = function (element) { + var classList = supports(element) ? element.dom().classList : get$2(element); + if (classList.length === 0) { + remove(element, 'class'); + } + }; + var remove$3 = function (element, clazz) { + if (supports(element)) { + var classList = element.dom().classList; + classList.remove(clazz); + } else { + remove$2(element, clazz); + } + cleanClass(element); + }; + + var fromHtml = function (html, scope) { + var doc = scope || domGlobals.document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + domGlobals.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 || domGlobals.document; + var node = doc.createElement(tag); + return fromDom(node); + }; + var fromText = function (text, scope) { + var doc = scope || domGlobals.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: constant(node) }; + }; + var fromPoint = function (docElm, x, y) { + var doc = docElm.dom(); + return Option.from(doc.elementFromPoint(x, y)).map(fromDom); + }; + var Element = { + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint + }; + + var charMap = { + '\xA0': 'nbsp', + '\xAD': 'shy' + }; + var charMapToRegExp = function (charMap, global) { + var key, regExp = ''; + for (key in charMap) { + regExp += key; + } + return new RegExp('[' + regExp + ']', global ? 'g' : ''); + }; + var charMapToSelector = function (charMap) { + var key, selector = ''; + for (key in charMap) { + if (selector) { + selector += ','; + } + selector += 'span.mce-' + charMap[key]; + } + return selector; + }; + var Data = { + charMap: charMap, + regExp: charMapToRegExp(charMap), + regExpGlobal: charMapToRegExp(charMap, true), + selector: charMapToSelector(charMap), + nbspClass: 'mce-nbsp', + charMapToRegExp: charMapToRegExp, + charMapToSelector: charMapToSelector + }; + + var wrapCharWithSpan = function (value) { + return '' + value + ''; + }; + var Html = { wrapCharWithSpan: wrapCharWithSpan }; + + var isMatch = function (n) { + var value$1 = value(n); + return isText(n) && value$1 !== undefined && Data.regExp.test(value$1); + }; + var filterDescendants = function (scope, predicate) { + var result = []; + var dom = scope.dom(); + var children = map(dom.childNodes, Element.fromDom); + each(children, function (x) { + if (predicate(x)) { + result = result.concat([x]); + } + result = result.concat(filterDescendants(x, predicate)); + }); + return result; + }; + var findParentElm = function (elm, rootElm) { + while (elm.parentNode) { + if (elm.parentNode === rootElm) { + return elm; + } + elm = elm.parentNode; + } + }; + var replaceWithSpans = function (text) { + return text.replace(Data.regExpGlobal, Html.wrapCharWithSpan); + }; + var Nodes = { + isMatch: isMatch, + filterDescendants: filterDescendants, + findParentElm: findParentElm, + replaceWithSpans: replaceWithSpans + }; + + var isWrappedNbsp = function (node) { + return node.nodeName.toLowerCase() === 'span' && node.classList.contains('mce-nbsp-wrap'); + }; + var show = function (editor, rootElm) { + var nodeList = Nodes.filterDescendants(Element.fromDom(rootElm), Nodes.isMatch); + each(nodeList, function (n) { + var parent = n.dom().parentNode; + if (isWrappedNbsp(parent)) { + add$2(Element.fromDom(parent), Data.nbspClass); + } else { + var withSpans = Nodes.replaceWithSpans(editor.dom.encode(value(n))); + var div = editor.dom.create('div', null, withSpans); + var node = void 0; + while (node = div.lastChild) { + editor.dom.insertAfter(node, n.dom()); + } + editor.dom.remove(n.dom()); + } + }); + }; + var hide = function (editor, rootElm) { + var nodeList = editor.dom.select(Data.selector, rootElm); + each(nodeList, function (node) { + if (isWrappedNbsp(node)) { + remove$3(Element.fromDom(node), Data.nbspClass); + } else { + editor.dom.remove(node, true); + } + }); + }; + var toggle = function (editor) { + var body = editor.getBody(); + var bookmark = editor.selection.getBookmark(); + var parentNode = Nodes.findParentElm(editor.selection.getNode(), body); + parentNode = parentNode !== undefined ? parentNode : body; + hide(editor, parentNode); + show(editor, parentNode); + editor.selection.moveToBookmark(bookmark); + }; + var VisualChars = { + show: show, + hide: hide, + toggle: toggle + }; + + var toggleVisualChars = function (editor, toggleState) { + var body = editor.getBody(); + var selection = editor.selection; + var bookmark; + toggleState.set(!toggleState.get()); + Events.fireVisualChars(editor, toggleState.get()); + bookmark = selection.getBookmark(); + if (toggleState.get() === true) { + VisualChars.show(editor, body); + } else { + VisualChars.hide(editor, body); + } + selection.moveToBookmark(bookmark); + }; + var Actions = { toggleVisualChars: toggleVisualChars }; + + var register = function (editor, toggleState) { + editor.addCommand('mceVisualChars', function () { + Actions.toggleVisualChars(editor, toggleState); + }); + }; + var Commands = { register: register }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.util.Delay'); + + var setup = function (editor, toggleState) { + var debouncedToggle = global$1.debounce(function () { + VisualChars.toggle(editor); + }, 300); + if (editor.settings.forced_root_block !== false) { + editor.on('keydown', function (e) { + if (toggleState.get() === true) { + e.keyCode === 13 ? VisualChars.toggle(editor) : debouncedToggle(); + } + }); + } + }; + var Keyboard = { setup: setup }; + + var isEnabledByDefault = function (editor) { + return editor.getParam('visualchars_default_state', false); + }; + var Settings = { isEnabledByDefault: isEnabledByDefault }; + + var setup$1 = function (editor, toggleState) { + editor.on('init', function () { + var valueForToggling = !Settings.isEnabledByDefault(editor); + toggleState.set(valueForToggling); + Actions.toggleVisualChars(editor, toggleState); + }); + }; + var Bindings = { setup: setup$1 }; + + var toggleActiveState = function (editor, enabledStated) { + return function (api) { + api.setActive(enabledStated.get()); + var editorEventCallback = function (e) { + return api.setActive(e.state); + }; + editor.on('VisualChars', editorEventCallback); + return function () { + return editor.off('VisualChars', editorEventCallback); + }; + }; + }; + var register$1 = function (editor, toggleState) { + editor.ui.registry.addToggleButton('visualchars', { + tooltip: 'Show invisible characters', + icon: 'visualchars', + onAction: function () { + return editor.execCommand('mceVisualChars'); + }, + onSetup: toggleActiveState(editor, toggleState) + }); + editor.ui.registry.addToggleMenuItem('visualchars', { + text: 'Show invisible characters', + onAction: function () { + return editor.execCommand('mceVisualChars'); + }, + onSetup: toggleActiveState(editor, toggleState) + }); + }; + + function Plugin () { + global.add('visualchars', function (editor) { + var toggleState = Cell(false); + Commands.register(editor, toggleState); + register$1(editor, toggleState); + Keyboard.setup(editor, toggleState); + Bindings.setup(editor, toggleState); + return Api.get(toggleState); + }); + } + + Plugin(); -/*global tinymce:true */ - -tinymce.PluginManager.add('visualchars', function(editor) { - var state, visualCharsMenuItem; - - function toggleVisualChars(addBookmark) { - var node, nodeList, i, body = editor.getBody(), nodeValue, selection = editor.selection, div, bookmark; - - state = !state; - visualCharsMenuItem.active(state); - - if (addBookmark) { - bookmark = selection.getBookmark(); - } - - if (state) { - nodeList = []; - tinymce.walk(body, function(n) { - if (n.nodeType == 3 && n.nodeValue && n.nodeValue.indexOf('\u00a0') != -1) { - nodeList.push(n); - } - }, 'childNodes'); - - for (i = 0; i < nodeList.length; i++) { - nodeValue = nodeList[i].nodeValue; - nodeValue = nodeValue.replace(/(\u00a0)/g, '$1'); - - div = editor.dom.create('div', null, nodeValue); - while ((node = div.lastChild)) { - editor.dom.insertAfter(node, nodeList[i]); - } - - editor.dom.remove(nodeList[i]); - } - } else { - nodeList = editor.dom.select('span.mce-nbsp', body); - - for (i = nodeList.length - 1; i >= 0; i--) { - editor.dom.remove(nodeList[i], 1); - } - } - - selection.moveToBookmark(bookmark); - } - - editor.addCommand('mceVisualChars', toggleVisualChars); - - editor.addButton('visualchars', { - title: 'Show invisible characters', - cmd: 'mceVisualChars' - }); - - editor.addMenuItem('visualchars', { - text: 'Show invisible characters', - cmd: 'mceVisualChars', - onPostRender: function() { - visualCharsMenuItem = this; - }, - selectable: true, - context: 'view', - prependToContext: true - }); - - editor.on('beforegetcontent', function(e) { - if (state && e.format != 'raw' && !e.draft) { - state = true; - toggleVisualChars(false); - } - }); -}); +}(window)); diff --git a/lib/tinymce/js/tinymce/plugins/visualchars/plugin.min.js b/lib/tinymce/js/tinymce/plugins/visualchars/plugin.min.js index 64cb837e..9c8ae13b 100644 --- a/lib/tinymce/js/tinymce/plugins/visualchars/plugin.min.js +++ b/lib/tinymce/js/tinymce/plugins/visualchars/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("visualchars",function(e){function t(t){var i,o,r,l,c,s,d=e.getBody(),u=e.selection;if(n=!n,a.active(n),t&&(s=u.getBookmark()),n)for(o=[],tinymce.walk(d,function(e){3==e.nodeType&&e.nodeValue&&-1!=e.nodeValue.indexOf(" ")&&o.push(e)},"childNodes"),r=0;o.length>r;r++){for(l=o[r].nodeValue,l=l.replace(/(\u00a0)/g,'$1'),c=e.dom.create("div",null,l);i=c.lastChild;)e.dom.insertAfter(i,o[r]);e.dom.remove(o[r])}else for(o=e.dom.select("span.mce-nbsp",d),r=o.length-1;r>=0;r--)e.dom.remove(o[r],1);u.moveToBookmark(s)}var n,a;e.addCommand("mceVisualChars",t),e.addButton("visualchars",{title:"Show invisible characters",cmd:"mceVisualChars"}),e.addMenuItem("visualchars",{text:"Show invisible characters",cmd:"mceVisualChars",onPostRender:function(){a=this},selectable:!0,context:"view",prependToContext:!0}),e.on("beforegetcontent",function(e){n&&"raw"!=e.format&&!e.draft&&(n=!0,t(!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.1.6 (2020-01-28) + */ +!function(r){"use strict";function n(){}function u(n){return function(){return n}}function e(){return l}var t,o=function(n){function e(){return t}var t=n;return{get:e,set:function(n){t=n},clone:function(){return o(e())}}},i=tinymce.util.Tools.resolve("tinymce.PluginManager"),c=function(n){return{isEnabled:function(){return n.get()}}},a=function(n,e){return n.fire("VisualChars",{state:e})},f=u(!1),s=u(!0),l=(t={fold:function(n,e){return n()},is:f,isSome:f,isNone:s,getOr:g,getOrThunk:m,getOrDie:function(n){throw new Error(n||"error: getOrDie called on none.")},getOrNull:u(null),getOrUndefined:u(undefined),or:g,orThunk:m,map:e,each:n,bind:e,exists:f,forall:s,filter:e,equals:d,equals_:d,toArray:function(){return[]},toString:u("none()")},Object.freeze&&Object.freeze(t),t);function d(n){return n.isNone()}function m(n){return n()}function g(n){return n}function N(e){return function(n){return function(n){if(null===n)return"null";var e=typeof n;return"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}(n)===e}}function v(n,e){for(var t=0,r=n.length;t'+n+"
    "},z=function(n,e){var t=[],r=function(n,e){for(var t=n.length,r=new Array(t),o=0;o]', + punctuation: '[!-#%-*,-\\/:;?@\\[-\\]_{}\xA1\xAB\xB7\xBB\xBF;\xB7\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1361-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u3008\u3009\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30\u2E31\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uff3f\uFF5B\uFF5D\uFF5F-\uFF65]' + }; + var characterIndices = { + ALETTER: 0, + MIDNUMLET: 1, + MIDLETTER: 2, + MIDNUM: 3, + NUMERIC: 4, + CR: 5, + LF: 6, + NEWLINE: 7, + EXTEND: 8, + FORMAT: 9, + KATAKANA: 10, + EXTENDNUMLET: 11, + AT: 12, + OTHER: 13 + }; + var SETS = [ + new RegExp(regExps.aletter), + new RegExp(regExps.midnumlet), + new RegExp(regExps.midletter), + new RegExp(regExps.midnum), + new RegExp(regExps.numeric), + new RegExp(regExps.cr), + new RegExp(regExps.lf), + new RegExp(regExps.newline), + new RegExp(regExps.extend), + new RegExp(regExps.format), + new RegExp(regExps.katakana), + new RegExp(regExps.extendnumlet), + new RegExp('@') + ]; + var EMPTY_STRING = ''; + var PUNCTUATION = new RegExp('^' + regExps.punctuation + '$'); + var WHITESPACE = /^\s+$/; + + 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()') + }; + if (Object.freeze) { + Object.freeze(me); + } + return me; + }(); + + var typeOf = function (x) { + if (x === null) { + return 'null'; + } + 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 isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isFunction = isType('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 from = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + var SETS$1 = SETS; + var OTHER = characterIndices.OTHER; + var getType = function (char) { + var type = OTHER; + var setsLength = SETS$1.length; + for (var j = 0; j < setsLength; ++j) { + var set = SETS$1[j]; + if (set && set.test(char)) { + type = j; + break; + } + } + return type; + }; + var memoize = function (func) { + var cache = {}; + return function (char) { + if (cache[char]) { + return cache[char]; + } else { + var result = func(char); + cache[char] = result; + return result; + } + }; + }; + var classify = function (characters) { + var memoized = memoize(getType); + return map(characters, memoized); + }; + + var isWordBoundary = function (map, index) { + var prevType; + var type = map[index]; + var nextType = map[index + 1]; + var nextNextType; + if (index < 0 || index > map.length - 1 && index !== 0) { + return false; + } + if (type === characterIndices.ALETTER && nextType === characterIndices.ALETTER) { + return false; + } + nextNextType = map[index + 2]; + if (type === characterIndices.ALETTER && (nextType === characterIndices.MIDLETTER || nextType === characterIndices.MIDNUMLET || nextType === characterIndices.AT) && nextNextType === characterIndices.ALETTER) { + return false; + } + prevType = map[index - 1]; + if ((type === characterIndices.MIDLETTER || type === characterIndices.MIDNUMLET || nextType === characterIndices.AT) && nextType === characterIndices.ALETTER && prevType === characterIndices.ALETTER) { + return false; + } + if ((type === characterIndices.NUMERIC || type === characterIndices.ALETTER) && (nextType === characterIndices.NUMERIC || nextType === characterIndices.ALETTER)) { + return false; + } + if ((type === characterIndices.MIDNUM || type === characterIndices.MIDNUMLET) && nextType === characterIndices.NUMERIC && prevType === characterIndices.NUMERIC) { + return false; + } + if (type === characterIndices.NUMERIC && (nextType === characterIndices.MIDNUM || nextType === characterIndices.MIDNUMLET) && nextNextType === characterIndices.NUMERIC) { + return false; + } + if (type === characterIndices.EXTEND || type === characterIndices.FORMAT || prevType === characterIndices.EXTEND || prevType === characterIndices.FORMAT || nextType === characterIndices.EXTEND || nextType === characterIndices.FORMAT) { + return false; + } + if (type === characterIndices.CR && nextType === characterIndices.LF) { + return false; + } + if (type === characterIndices.NEWLINE || type === characterIndices.CR || type === characterIndices.LF) { + return true; + } + if (nextType === characterIndices.NEWLINE || nextType === characterIndices.CR || nextType === characterIndices.LF) { + return true; + } + if (type === characterIndices.KATAKANA && nextType === characterIndices.KATAKANA) { + return false; + } + if (nextType === characterIndices.EXTENDNUMLET && (type === characterIndices.ALETTER || type === characterIndices.NUMERIC || type === characterIndices.KATAKANA || type === characterIndices.EXTENDNUMLET)) { + return false; + } + if (type === characterIndices.EXTENDNUMLET && (nextType === characterIndices.ALETTER || nextType === characterIndices.NUMERIC || nextType === characterIndices.KATAKANA)) { + return false; + } + if (type === characterIndices.AT) { + return false; + } + return true; + }; + + var EMPTY_STRING$1 = EMPTY_STRING; + var WHITESPACE$1 = WHITESPACE; + var PUNCTUATION$1 = PUNCTUATION; + var isProtocol = function (str) { + return str === 'http' || str === 'https'; + }; + var findWordEnd = function (characters, startIndex) { + var i; + for (i = startIndex; i < characters.length; i++) { + if (WHITESPACE$1.test(characters[i])) { + break; + } + } + return i; + }; + var findUrlEnd = function (characters, startIndex) { + var endIndex = findWordEnd(characters, startIndex + 1); + var peakedWord = characters.slice(startIndex + 1, endIndex).join(EMPTY_STRING$1); + return peakedWord.substr(0, 3) === '://' ? endIndex : startIndex; + }; + var findWords = function (chars, sChars, characterMap, options) { + var words = []; + var word = []; + for (var i = 0; i < characterMap.length; ++i) { + word.push(chars[i]); + if (isWordBoundary(characterMap, i)) { + var ch = sChars[i]; + if ((options.includeWhitespace || !WHITESPACE$1.test(ch)) && (options.includePunctuation || !PUNCTUATION$1.test(ch))) { + var startOfWord = i - word.length + 1; + var endOfWord = i + 1; + var str = sChars.slice(startOfWord, endOfWord).join(EMPTY_STRING$1); + if (isProtocol(str)) { + var endOfUrl = findUrlEnd(sChars, i); + var url = chars.slice(endOfWord, endOfUrl); + Array.prototype.push.apply(word, url); + i = endOfUrl; + } + words.push(word); + } + word = []; + } + } + return words; + }; + var getDefaultOptions = function () { + return { + includeWhitespace: false, + includePunctuation: false + }; + }; + var getWords = function (chars, extract, options) { + options = __assign(__assign({}, getDefaultOptions()), options); + var filteredChars = []; + var extractedChars = []; + for (var i = 0; i < chars.length; i++) { + var ch = extract(chars[i]); + if (ch !== '\uFEFF') { + filteredChars.push(chars[i]); + extractedChars.push(ch); + } + } + var characterMap = classify(extractedChars); + return findWords(filteredChars, extractedChars, characterMap, options); + }; -/*global tinymce:true */ + var getWords$1 = getWords; -tinymce.PluginManager.add('wordcount', function(editor) { - var self = this, countre, cleanre; + var global$1 = tinymce.util.Tools.resolve('tinymce.dom.TreeWalker'); - countre = editor.getParam('wordcount_countregex', /[\w\u2019\x27\-]+/g); // u2019 == ’ - cleanre = editor.getParam('wordcount_cleanregex', /[0-9.(),;:!?%#$?\x27\x22_+=\\\/\-]*/g); + var getText = function (node, schema) { + var blockElements = schema.getBlockElements(); + var shortEndedElements = schema.getShortEndedElements(); + var isNewline = function (node) { + return blockElements[node.nodeName] || shortEndedElements[node.nodeName]; + }; + var textBlocks = []; + var txt = ''; + var treeWalker = new global$1(node, node); + while (node = treeWalker.next()) { + if (node.nodeType === 3) { + txt += node.data; + } else if (isNewline(node) && txt.length) { + textBlocks.push(txt); + txt = ''; + } + } + if (txt.length) { + textBlocks.push(txt); + } + return textBlocks; + }; - function update() { - editor.theme.panel.find('#wordcount').text(['Words: %d', self.getCount()]); - } + var strLen = function (str) { + return str.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, '_').length; + }; + var countWords = function (node, schema) { + var text = getText(node, schema).join('\n'); + return getWords$1(text.split(''), identity).length; + }; + var countCharacters = function (node, schema) { + var text = getText(node, schema).join(''); + return strLen(text); + }; + var countCharactersWithoutSpaces = function (node, schema) { + var text = getText(node, schema).join('').replace(/\s/g, ''); + return strLen(text); + }; - editor.on('init', function() { - var statusbar = editor.theme.panel && editor.theme.panel.find('#statusbar')[0]; + var createBodyCounter = function (editor, count) { + return function () { + return count(editor.getBody(), editor.schema); + }; + }; + var createSelectionCounter = function (editor, count) { + return function () { + return count(editor.selection.getRng().cloneContents(), editor.schema); + }; + }; + var createBodyWordCounter = function (editor) { + return createBodyCounter(editor, countWords); + }; + var get = function (editor) { + return { + body: { + getWordCount: createBodyWordCounter(editor), + getCharacterCount: createBodyCounter(editor, countCharacters), + getCharacterCountWithoutSpaces: createBodyCounter(editor, countCharactersWithoutSpaces) + }, + selection: { + getWordCount: createSelectionCounter(editor, countWords), + getCharacterCount: createSelectionCounter(editor, countCharacters), + getCharacterCountWithoutSpaces: createSelectionCounter(editor, countCharactersWithoutSpaces) + }, + getCount: createBodyWordCounter(editor) + }; + }; - if (statusbar) { - statusbar.insert({ - type: 'label', - name: 'wordcount', - text: ['Words: %d', self.getCount()], - classes: 'wordcount' - }, 0); + var global$2 = tinymce.util.Tools.resolve('tinymce.util.Delay'); - editor.on('setcontent beforeaddundo', update); + var fireWordCountUpdate = function (editor, api) { + editor.fire('wordCountUpdate', { + wordCount: { + words: api.body.getWordCount(), + characters: api.body.getCharacterCount(), + charactersWithoutSpaces: api.body.getCharacterCountWithoutSpaces() + } + }); + }; - editor.on('keyup', function(e) { - if (e.keyCode == 32) { - update(); - } - }); - } - }); + var updateCount = function (editor, api) { + fireWordCountUpdate(editor, api); + }; + var setup = function (editor, api, delay) { + var debouncedUpdate = global$2.debounce(function () { + return updateCount(editor, api); + }, delay); + editor.on('init', function () { + updateCount(editor, api); + global$2.setEditorTimeout(editor, function () { + editor.on('SetContent BeforeAddUndo Undo Redo keyup', debouncedUpdate); + }, 0); + }); + }; - self.getCount = function() { - var tx = editor.getContent({format: 'raw'}); - var tc = 0; + var open = function (editor, api) { + editor.windowManager.open({ + title: 'Word Count', + body: { + type: 'panel', + items: [{ + type: 'table', + header: [ + 'Count', + 'Document', + 'Selection' + ], + cells: [ + [ + 'Words', + String(api.body.getWordCount()), + String(api.selection.getWordCount()) + ], + [ + 'Characters (no spaces)', + String(api.body.getCharacterCountWithoutSpaces()), + String(api.selection.getCharacterCountWithoutSpaces()) + ], + [ + 'Characters', + String(api.body.getCharacterCount()), + String(api.selection.getCharacterCount()) + ] + ] + }] + }, + buttons: [{ + type: 'cancel', + name: 'close', + text: 'Close', + primary: true + }] + }); + }; - if (tx) { - tx = tx.replace(/\.\.\./g, ' '); // convert ellipses to spaces - tx = tx.replace(/<.[^<>]*?>/g, ' ').replace(/ | /gi, ' '); // remove html tags and space chars + var register = function (editor, api) { + editor.ui.registry.addButton('wordcount', { + tooltip: 'Word count', + icon: 'character-count', + onAction: function () { + return open(editor, api); + } + }); + editor.ui.registry.addMenuItem('wordcount', { + text: 'Word count', + icon: 'character-count', + onAction: function () { + return open(editor, api); + } + }); + }; - // deal with html entities - tx = tx.replace(/(\w+)(&.+?;)+(\w+)/, "$1$3").replace(/&.+?;/g, ' '); - tx = tx.replace(cleanre, ''); // remove numbers and punctuation + function Plugin (delay) { + if (delay === void 0) { + delay = 300; + } + global.add('wordcount', function (editor) { + var api = get(editor); + register(editor, api); + setup(editor, api, delay); + return api; + }); + } - var wordArray = tx.match(countre); - if (wordArray) { - tc = wordArray.length; - } - } + Plugin(); - return tc; - }; -}); \ No newline at end of file +}()); diff --git a/lib/tinymce/js/tinymce/plugins/wordcount/plugin.min.js b/lib/tinymce/js/tinymce/plugins/wordcount/plugin.min.js index 7b2386cc..9de34da2 100644 --- a/lib/tinymce/js/tinymce/plugins/wordcount/plugin.min.js +++ b/lib/tinymce/js/tinymce/plugins/wordcount/plugin.min.js @@ -1 +1,9 @@ -tinymce.PluginManager.add("wordcount",function(e){function t(){e.theme.panel.find("#wordcount").text(["Words: %d",i.getCount()])}var n,a,i=this;n=e.getParam("wordcount_countregex",/[\w\u2019\x27\-]+/g),a=e.getParam("wordcount_cleanregex",/[0-9.(),;:!?%#$?\x27\x22_+=\\\/\-]*/g),e.on("init",function(){var n=e.theme.panel&&e.theme.panel.find("#statusbar")[0];n&&(n.insert({type:"label",name:"wordcount",text:["Words: %d",i.getCount()],classes:"wordcount"},0),e.on("setcontent beforeaddundo",t),e.on("keyup",function(e){32==e.keyCode&&t()}))}),i.getCount=function(){var t=e.getContent({format:"raw"}),i=0;if(t){t=t.replace(/\.\.\./g," "),t=t.replace(/<.[^<>]*?>/g," ").replace(/ | /gi," "),t=t.replace(/(\w+)(&.+?;)+(\w+)/,"$1$3").replace(/&.+?;/g," "),t=t.replace(a,"");var o=t.match(n);o&&(i=o.length)}return i}}); \ 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.1.6 (2020-01-28) + */ +!function(){"use strict";function t(){}function n(t){return function(){return t}}function r(t){return t}function e(){return U}var o,u=tinymce.util.Tools.resolve("tinymce.PluginManager"),i=n(!1),c=n(!0),a=function(){return(a=Object.assign||function(t){for(var n,e=1,r=arguments.length;eu.length-1&&0!==i||f===b&&s===b||(a=u[i+2],f===b&&(s===S||s===E||s===P)&&a===b||(c=u[i-1],(f===S||f===E||s===P)&&s===b&&c===b||!(f!==W&&f!==b||s!==W&&s!==b)||(f===x||f===E)&&s===W&&c===W||f===W&&(s===x||s===E)&&a===W||f===j||f===D||c===j||c===D||s===j||s===D||f===R&&s===O||f!==A&&f!==R&&f!==O&&s!==A&&s!==R&&s!==O&&(f===T&&s===T||s===k&&(f===b||f===W||f===T||f===k)||f===k&&(s===b||s===W||s===T)||f===P))))){var d=n[p];if((r.includeWhitespace||!ut.test(d))&&(r.includePunctuation||!it.test(d))){var h=p-g.length+1,y=p+1,C=n.slice(h,y).join("");if("http"===(o=C)||"https"===o){var v=I(n,p),w=t.slice(y,v);Array.prototype.push.apply(g,w),p=v}l.push(g)}g=[]}return l}(r,o,$(o),e)},at=tinymce.util.Tools.resolve("tinymce.dom.TreeWalker"),ft=tinymce.util.Tools.resolve("tinymce.util.Delay");!function st(e){void 0===e&&(e=300),u.add("wordcount",function(t){var n=function(t){return{body:{getWordCount:V(t),getCharacterCount:L(t,J),getCharacterCountWithoutSpaces:L(t,K)},selection:{getWordCount:Q(t,H),getCharacterCount:Q(t,J),getCharacterCountWithoutSpaces:Q(t,K)},getCount:V(t)}}(t);return function(t,n){t.ui.registry.addButton("wordcount",{tooltip:"Word count",icon:"character-count",onAction:function(){return Y(t,n)}}),t.ui.registry.addMenuItem("wordcount",{text:"Word count",icon:"character-count",onAction:function(){return Y(t,n)}})}(t,n),function(t,n,e){var r=ft.debounce(function(){return X(t,n)},e);t.on("init",function(){X(t,n),ft.setEditorTimeout(t,function(){t.on("SetContent BeforeAddUndo Undo Redo keyup",r)},0)})}(t,n,e),n})}()}(); \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/readme.md b/lib/tinymce/js/tinymce/readme.md new file mode 100644 index 00000000..a812cbbb --- /dev/null +++ b/lib/tinymce/js/tinymce/readme.md @@ -0,0 +1,77 @@ +# TinyMCE + +TinyMCE is the world’s most popular open source web-based WYSIWYG editor. + +Trusted and loved by millions of developers, and integrated into thousands of applications, such as: + +- Content management systems (CMSs) +- Learning management systems (LMSs) +- Customer relationship management (CRM) and marketing automation systems +- Email marketing systems +- Content creation in SaaS systems + +

    + Screenshot of the TinyMCE Editor +

    + +## Our Tiny contribution + +Content is powerful. It can be used to inform, educate, connect, learn, and inspire change. + +More online applications are providing a platform for people to benefit from the transformational power of content. + +With this in mind, as technology continues to advance and evolve, we want to make sure people will always have access to the best tools for creating content, enabling them to participate freely and seamlessly without barriers. + +TinyMCE easily integrates into applications of all types and sizes, to provide the best content creation experience possible. + +

    + Tiny Technologies Logo +

    + +## Try the demo + +You can access a [full featured demo of TinyMCE](https://www.tiny.cloud/docs/demo/full-featured/) in the docs on the Tiny website. + +## Get started with TinyMCE + +Get an instance of TinyMCE up and running quickly with the [TinyMCE quick start guide](https://www.tiny.cloud/docs/quick-start/). + +TinyMCE provides a range of configuration options that allow you to integrate it into your application. Start customizing with a [basic setup](https://www.tiny.cloud/docs/general-configuration-guide/basic-setup/). + +Configure it for one of three modes of editing: + +- [TinyMCE classic editing mode](https://www.tiny.cloud/docs/general-configuration-guide/use-tinymce-classic/). +- [TinyMCE inline editing mode](https://www.tiny.cloud/docs/general-configuration-guide/use-tinymce-inline/). +- [TinyMCE distraction-free editing mode](https://www.tiny.cloud/docs/general-configuration-guide/use-tinymce-distraction-free/). + +## Features + +### Integration + +TinyMCE is easily integrated into your projects with the help of components such as: + +- [tinymce-react](https://github.com/tinymce/tinymce-react) +- [tinymce-vue](https://github.com/tinymce/tinymce-vue) +- [tinymce-angular](https://github.com/tinymce/tinymce-angular) + +See the Tiny docs for a full list of [integration components](https://www.tiny.cloud/docs/integrations/). + +### Customization + +It is easy to [configure the UI](https://www.tiny.cloud/docs/general-configuration-guide/customize-ui/) to match the design of your site and applications, and you can [configure the editor](https://www.tiny.cloud/docs/general-configuration-guide/basic-setup/) with as much or as little functionality as you like, depending on your users and requirements. + +With [50+ powerful plugins available](https://www.tiny.cloud/apps/), adding additional functionality is as simple as including a single line of code. Realizing the full power of most plugins requires only a few lines more. + +### Extensibility + +Sometimes your business requirements can be quite unique, and you need the freedom and flexibility to innovate. View the source code and develop your own extensions for custom functionality to meet your own requirements. The [API](https://www.tiny.cloud/docs/api/) is exposed to make it easier for you to write custom functionality that fits within the existing framework of TinyMCE [UI components](https://www.tiny.cloud/docs/ui-components/). + +## Compiling and contributing + +As TinyMCE transitioned to a modern codebase through 2017 and 2018, many external dependencies were added from previously closed-source projects. This became unwieldy to develop, so in June 2019 the decision was made to bring those projects together in a monorepo. + +For information on compiling and contributing, see: [contribution guidelines](https://github.com/tinymce/tinymce/blob/master/CONTRIBUTING.md). + +## Want more information? + +Visit the [TinyMCE home page](https://tiny.cloud/) and check out the [TinyMCE documentation](https://www.tiny.cloud/docs/). diff --git a/lib/tinymce/js/tinymce/skins/content/dark/content.css b/lib/tinymce/js/tinymce/skins/content/dark/content.css new file mode 100644 index 00000000..10ce487b --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/content/dark/content.css @@ -0,0 +1,59 @@ +/** + * 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 th, +table td { + border: 1px solid #6d737b; + padding: 0.4rem; +} +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; +} +/* Make text in selected cells in tables dark and readable */ +td[data-mce-selected], +th[data-mce-selected] { + color: #333; +} +.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/lib/tinymce/js/tinymce/skins/content/dark/content.min.css b/lib/tinymce/js/tinymce/skins/content/dark/content.min.css new file mode 100644 index 00000000..545b2659 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/content/dark/content.min.css @@ -0,0 +1,8 @@ +/** + * 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 td,table th{border:1px solid #6d737b;padding:.4rem}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}td[data-mce-selected],th[data-mce-selected]{color:#333}.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/lib/tinymce/js/tinymce/skins/content/dark/content.min.css.map b/lib/tinymce/js/tinymce/skins/content/dark/content.min.css.map new file mode 100644 index 00000000..f5916cd2 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/content/dark/content.min.css.map @@ -0,0 +1 @@ +{"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,SAGnB,SADA,SAEE,OAAQ,IAAI,MAAM,QAClB,QAAS,MAEX,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,MAGlB,sBACA,sBACE,MAAO,KAET,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}\ntable th,\ntable td {\n border: 1px solid #6d737b;\n padding: 0.4rem;\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/* Make text in selected cells in tables dark and readable */\ntd[data-mce-selected],\nth[data-mce-selected] {\n color: #333;\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/lib/tinymce/js/tinymce/skins/content/default/content.css b/lib/tinymce/js/tinymce/skins/content/default/content.css new file mode 100644 index 00000000..e57e8398 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/content/default/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/lib/tinymce/js/tinymce/skins/content/default/content.min.css b/lib/tinymce/js/tinymce/skins/content/default/content.min.css new file mode 100644 index 00000000..91346410 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/content/default/content.min.css @@ -0,0 +1,8 @@ +/** + * 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} +/*# sourceMappingURL=content.min.css.map */ diff --git a/lib/tinymce/js/tinymce/skins/content/default/content.min.css.map b/lib/tinymce/js/tinymce/skins/content/default/content.min.css.map new file mode 100644 index 00000000..04d6f9df --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/content/default/content.min.css.map @@ -0,0 +1 @@ +{"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,SAGnB,SADA,SAEE,OAAQ,IAAI,MAAM,KAClB,QAAS,MAEX,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}\ntable th,\ntable td {\n border: 1px solid #ccc;\n padding: 0.4rem;\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/lib/tinymce/js/tinymce/skins/content/document/content.css b/lib/tinymce/js/tinymce/skins/content/document/content.css new file mode 100644 index 00000000..5c5eb76e --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/content/document/content.css @@ -0,0 +1,53 @@ +/** + * 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; + } +} +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; +} +table th, +table td { + border: 1px solid #ccc; + padding: 0.4rem; +} +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/lib/tinymce/js/tinymce/skins/content/document/content.min.css b/lib/tinymce/js/tinymce/skins/content/document/content.min.css new file mode 100644 index 00000000..f28c378d --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/content/document/content.min.css @@ -0,0 +1,8 @@ +/** + * 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}}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 td,table th{border:1px solid #ccc;padding:.4rem}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/lib/tinymce/js/tinymce/skins/content/document/content.min.css.map b/lib/tinymce/js/tinymce/skins/content/document/content.min.css.map new file mode 100644 index 00000000..22481bd5 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/content/document/content.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["content/document/content.css"],"names":[],"mappings":";;;;;;AAMA,cACE,KACE,WAAY,SAGhB,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,SAGnB,SADA,SAEE,OAAQ,IAAI,MAAM,KAClB,QAAS,MAEX,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 }\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}\ntable th,\ntable td {\n border: 1px solid #ccc;\n padding: 0.4rem;\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/lib/tinymce/js/tinymce/skins/content/writer/content.css b/lib/tinymce/js/tinymce/skins/content/writer/content.css new file mode 100644 index 00000000..00ae0fb6 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/content/writer/content.css @@ -0,0 +1,50 @@ +/** + * 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 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/lib/tinymce/js/tinymce/skins/content/writer/content.min.css b/lib/tinymce/js/tinymce/skins/content/writer/content.min.css new file mode 100644 index 00000000..549450d4 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/content/writer/content.min.css @@ -0,0 +1,8 @@ +/** + * 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 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} +/*# sourceMappingURL=content.min.css.map */ diff --git a/lib/tinymce/js/tinymce/skins/content/writer/content.min.css.map b/lib/tinymce/js/tinymce/skins/content/writer/content.min.css.map new file mode 100644 index 00000000..d71d03b9 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/content/writer/content.min.css.map @@ -0,0 +1 @@ +{"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,SAGnB,SADA,SAEE,OAAQ,IAAI,MAAM,KAClB,QAAS,MAEX,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}\ntable th,\ntable td {\n border: 1px solid #ccc;\n padding: 0.4rem;\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/lib/tinymce/js/tinymce/skins/lightgray/AbsoluteLayout.less b/lib/tinymce/js/tinymce/skins/lightgray/AbsoluteLayout.less deleted file mode 100644 index 5b030970..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/AbsoluteLayout.less +++ /dev/null @@ -1,17 +0,0 @@ -// AbsoluteLayout - -.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; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/Animations.less b/lib/tinymce/js/tinymce/skins/lightgray/Animations.less deleted file mode 100644 index 4b38cf15..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/Animations.less +++ /dev/null @@ -1,10 +0,0 @@ -// Animations - -.mce-fade { - opacity: 0; - .transition(opacity .15s linear); - - &.mce-in { - opacity: 1; - } -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/Button.less b/lib/tinymce/js/tinymce/skins/lightgray/Button.less deleted file mode 100644 index fc941015..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/Button.less +++ /dev/null @@ -1,115 +0,0 @@ -// Button - -.mce-btn { - border: 1px solid @btn-border-color; - position: relative; - text-shadow: @textShadow; - .button-background(@btn-background, @btn-background-highlight, @btn-text-color, 0 1px 1px rgba(255, 255, 255, .75)); - .inline-block(); - - .border-radius(3px); - .box-shadow(inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(0, 0, 0, .05)); - - &:hover, &:focus { - color: @btn-text-color; - text-decoration: none; - .button-background(darken(@btn-background, 5%), darken(@btn-background-highlight, 5%), @btn-text-color, 0 1px 1px rgba(255, 255, 255, .75)); - } - - &.mce-disabled, &.mce-disabled:hover { - cursor: default; - background-image: none; - .box-shadow(none); - .opacity(0.65); - } - - &.mce-active, &.mce-active:hover { - .button-background(darken(@btn-background, 10%), darken(@btn-background-highlight, 10%), @btn-text-color, 0 1px 1px rgba(255, 255, 255, .75)); - .box-shadow(inset 0 2px 4px rgba(0, 0, 0, .15), 0 1px 2px rgba(0, 0, 0 ,.05)); - } -} - -.mce-btn button { - padding: 4px 10px; - font-size: @font-size; - line-height: @line-height; - *line-height: @line-height - 4px; - cursor: pointer; - color: @btn-text-color; - - // Fixes for default inner padding of button - overflow: visible; // IE7 - -webkit-appearance: none; // WebKit - &::-moz-focus-inner { // Gecko - border: 0; - padding: 0; - } -} - -.mce-btn i { - text-shadow: 1px 1px @btn-text-shadow; -} - -.mce-primary { - .button-background(@btn-background-primary, @btn-background-primary-highlight, white, 0 1px 1px rgba(255, 255, 255, .75)); - - &:hover, &:focus { - .button-background(darken(#0088cc, 5%), darken(#0044cc, 5%), white, 0 1px 1px rgba(255, 255, 255, .75)); - } -} - -.mce-primary button { - color: @btn-text-color-primary; -} - -.mce-btn-large button { - padding: 9px 14px; - font-size: @font-size + 2px; - line-height: normal; - .border-radius(5px); -} - -.mce-btn-large i { - margin-top: 2px; -} - -.mce-btn-small button { - padding: 3px 5px; - font-size: @font-size - 2px; - line-height: @line-height - 5px; -} - -.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 { - .inline-block(); - width: 0; height: 0; - vertical-align: top; - border-top: 4px solid @btn-caret-color; - border-right: 4px solid transparent; - border-left: 4px solid transparent; - content: ""; -} - -.mce-disabled .mce-caret { - border-top-color: @text-color-disabled; -} - -.mce-caret.mce-up { - border-bottom: 4px solid @btn-caret-color; - border-top: 0; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/ButtonGroup.less b/lib/tinymce/js/tinymce/skins/lightgray/ButtonGroup.less deleted file mode 100644 index c8852d12..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/ButtonGroup.less +++ /dev/null @@ -1,44 +0,0 @@ -// ButtonGroup - -.mce-btn-group .mce-btn { - border-width: 1px 0 1px 0; - margin: 0; - .border-radius(0); - - &:hover, &:focus { - .button-background(darken(@btn-background, 5%), darken(@btn-background-highlight, 5%), @btn-text-color, 0 1px 1px rgba(255, 255, 255, .75)); - } - - &.mce-disabled, &.mce-disabled:hover { - .box-shadow(inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(0, 0, 0, .05)); - .button-background(@btn-background, @btn-background-highlight, @btn-text-color, 0 1px 1px rgba(255, 255, 255, .75)); - .opacity(1); - } - - &.mce-active, &.mce-active:hover, &:active { - .button-background(darken(@btn-background, 10%), darken(@btn-background-highlight, 10%), @btn-text-color, 0 1px 1px rgba(255, 255, 255, .75)); - .box-shadow(inset 0 2px 4px rgba(0, 0, 0, .15), 0 1px 2px rgba(0, 0, 0 ,.05)); - } - - &.mce-disabled button { - .opacity(0.65); - } -} - -.mce-btn-group .mce-first { - border-left: 1px solid @btn-border-color; - .border-radius(3px 0 0 3px); -} - -.mce-btn-group .mce-last { - border-right: 1px solid @btn-border-color; - .border-radius(0 3px 3px 0); -} - -.mce-btn-group .mce-first.mce-last { - .border-radius(3px); -} - -.mce-btn-group .mce-btn.mce-flow-layout-item { - margin: 0; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/Checkbox.less b/lib/tinymce/js/tinymce/skins/lightgray/Checkbox.less deleted file mode 100644 index 484e4c01..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/Checkbox.less +++ /dev/null @@ -1,27 +0,0 @@ -// Checkbox - -.mce-checkbox { - cursor: pointer; -} - -i.mce-i-checkbox { - margin: 0 3px 0 0; - border: 1px solid @btn-border-color; - .border-radius(3px); - .box-shadow(inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(0, 0, 0, .05)); - .vertical-gradient; - font-size: 0; - line-height: 0; -} - -.mce-checked i.mce-i-checkbox { - color: @text-color; - font-size: 16px; - line-height: 16px; -} - -.mce-checkbox:focus i.mce-i-checkbox { - border: 1px solid red; - border: 1px solid rgba(82, 168, 236, .8); - .box-shadow(inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(82, 168, 236, .6)); -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/ColorButton.less b/lib/tinymce/js/tinymce/skins/lightgray/ColorButton.less deleted file mode 100644 index 86e09cca..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/ColorButton.less +++ /dev/null @@ -1,44 +0,0 @@ -// ColorButton - -.mce-colorbutton .mce-ico { - position: relative; -} - -.mce-colorpicker { - background: #FFF; -} - -.mce-colorbutton-grid { - margin: 4px; -} - -.mce-grid td div { - border: 1px solid #808080; - width: 12px; height: 12px; - margin: 2px; - cursor: pointer; - &:hover { - border-color: black; - } - &:focus { - border-color: red; - outline: 1px solid rgba(82, 168, 236, .8); - border-color: rgba(82, 168, 236, .8) - } -} - -.mce-colorbutton { - position: relative; -} - -.mce-colorbutton .mce-preview { - display: block; - position: absolute; - left: 50%; top: 50%; - margin-left: -8px; - margin-top: 7px; - background: gray; - width: 16px; - height: 2px; - overflow: hidden; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/ComboBox.less b/lib/tinymce/js/tinymce/skins/lightgray/ComboBox.less deleted file mode 100644 index 65c6bc1b..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/ComboBox.less +++ /dev/null @@ -1,34 +0,0 @@ -// ComboBox - -.mce-combobox { - .inline-block(); - .border-radius(); - width: 100px; - .box-shadow(inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(0, 0, 0, .05)); -} - -.mce-combobox input { - border-color: 1px solid @btn-border-color; - border-right-color: rgba(0, 0, 0, .15); - height: 28px; -} - -.mce-combobox.mce-has-open input { - .border-radius(4px 0 0 4px); -} - -.mce-combobox .mce-btn { - border-left: 0; - .border-radius(0 4px 4px 0); -} - -.mce-combobox button { - padding-right: 8px; - padding-left: 8px; -} - -.mce-combobox *:focus { - border-color: red; - border-color: rgba(82, 168, 236, .8); - .box-shadow(inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(82, 168, 236, .6)); -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/Container.less b/lib/tinymce/js/tinymce/skins/lightgray/Container.less deleted file mode 100644 index 55cc7923..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/Container.less +++ /dev/null @@ -1,9 +0,0 @@ -// Container - -.mce-container, .mce-container-body { - display: block; -} - -.mce-autoscroll { - overflow: hidden; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/Content.less b/lib/tinymce/js/tinymce/skins/lightgray/Content.less deleted file mode 100644 index f587864f..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/Content.less +++ /dev/null @@ -1,81 +0,0 @@ -/* Content.less */ - -@font-family: Verdana, Arial, Helvetica, sans-serif; -@font-size: 11px; - -body.mce-content-body { - background-color: #FFFFFF; - font-family: @font-family; - font-size: @font-size; - scrollbar-3dlight-color: #F0F0EE; - scrollbar-arrow-color: #676662; - scrollbar-base-color: #F0F0EE; - scrollbar-darkshadow-color: #DDDDDD; - scrollbar-face-color: #E0E0DD; - scrollbar-highlight-color: #F0F0EE; - scrollbar-shadow-color: #F0F0EE; - scrollbar-track-color: #F5F5F5; -} - -td, th { - font-family: @font-family; - font-size: @font-size; -} - -.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; - 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: green; - 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: #3399ff !important; -} - -.mce-edit-focus { - outline: 1px dotted #333; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/FieldSet.less b/lib/tinymce/js/tinymce/skins/lightgray/FieldSet.less deleted file mode 100644 index 2844eb77..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/FieldSet.less +++ /dev/null @@ -1,15 +0,0 @@ -// FieldSet - -.mce-fieldset { - border: 0 solid #9E9E9E; - .border-radius(3px); -} - -.mce-fieldset > .mce-container-body { - margin-top: -15px; -} - -.mce-fieldset-title { - margin-left: 5px; - padding: 0 5px 0 5px; -} \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/skins/lightgray/FitLayout.less b/lib/tinymce/js/tinymce/skins/lightgray/FitLayout.less deleted file mode 100644 index f2c0f66f..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/FitLayout.less +++ /dev/null @@ -1,9 +0,0 @@ -// FitLayout - -.mce-fit-layout { - .inline-block(); -} - -.mce-fit-layout-item { - position: absolute; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/FloatPanel.less b/lib/tinymce/js/tinymce/skins/lightgray/FloatPanel.less deleted file mode 100644 index 2e731edb..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/FloatPanel.less +++ /dev/null @@ -1,67 +0,0 @@ -// FloatPanel - -.mce-floatpanel { - position: absolute; - .box-shadow(#ccc 5px 5px 5px); -} - -// Popover panel - -.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: @popover-arrow-outer-width; -} - -.mce-floatpanel .mce-arrow:after { - border-width: @popover-arrow-width; - content: ""; -} - -.mce-floatpanel.mce-popover { - position: absolute; - top: 0; - left: 0; - background: @popover-background; - -webkit-background-clip: padding-box; - -moz-background-clip: padding; - background-clip: padding-box; - border: 1px solid #ccc; - border: 1px solid rgba(0,0,0,.2); - .border-radius(6px); - .box-shadow(0 5px 10px rgba(0,0,0,.2)); - - &.mce-bottom { - margin-top: 10px; - - & > .mce-arrow { - left: 50%; - margin-left: -@popover-arrow-outer-width; - border-top-width: 0; - border-bottom-color: #999; // IE8 fallback - border-bottom-color: @popover-arrow-outer-color; - top: -@popover-arrow-outer-width; - - &:after { - top: 1px; - margin-left: -@popover-arrow-width; - border-top-width: 0; - border-bottom-color: @popover-arrow-color; - } - } - - &.mce-start { margin-left: -22px; } - &.mce-start > .mce-arrow { left: 20px; } - - &.mce-end { margin-left: 22px; } - &.mce-end > .mce-arrow { right: 10px; left: auto; } - } -} \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/skins/lightgray/FlowLayout.less b/lib/tinymce/js/tinymce/skins/lightgray/FlowLayout.less deleted file mode 100644 index ca54fb16..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/FlowLayout.less +++ /dev/null @@ -1,17 +0,0 @@ -// FlowLayout - -.mce-flow-layout-item { - .inline-block(); -} - -.mce-flow-layout-item { - margin: 2px 0 2px 2px; -} - -.mce-flow-layout-item.mce-last { - margin-right: 2px; -} - -.mce-flow-layout { - white-space: normal; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/Icons.Ie7.less b/lib/tinymce/js/tinymce/skins/lightgray/Icons.Ie7.less deleted file mode 100644 index 2485466f..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/Icons.Ie7.less +++ /dev/null @@ -1,97 +0,0 @@ -/* Icons IE7 */ - -@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; -} - -@iconSize: 16px; - -.mce-ico { - font-family: 'icomoon'; - font-style: normal; - font-weight: normal; - font-size: @iconSize; - line-height: 16px; - vertical-align: text-top; - -webkit-font-smoothing: antialiased; - - display: inline-block; - background: transparent center center; - width: 16px; - height: 16px; - color: #333; - -ie7-icon: ' '; -} - -// .mce-i-checkbox needs to have zoom overridden since it's set by the gradient mixin -.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; } diff --git a/lib/tinymce/js/tinymce/skins/lightgray/Icons.less b/lib/tinymce/js/tinymce/skins/lightgray/Icons.less deleted file mode 100644 index 75e17ef9..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/Icons.less +++ /dev/null @@ -1,91 +0,0 @@ -/* Icons */ - -@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; -} - -@iconSize: 16px; - -.mce-ico { - font-family: 'tinymce', Arial; - font-style: normal; - font-weight: normal; - font-size: @iconSize; - line-height: 16px; - vertical-align: text-top; - -webkit-font-smoothing: antialiased; - - display: inline-block; - background: transparent center center; - width: 16px; - height: 16px; - color: @btn-text-color; -} - -.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-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-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/lib/tinymce/js/tinymce/skins/lightgray/Iframe.less b/lib/tinymce/js/tinymce/skins/lightgray/Iframe.less deleted file mode 100644 index 5338f6e1..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/Iframe.less +++ /dev/null @@ -1,6 +0,0 @@ -// Iframe - -.mce-iframe { - border: 0 solid @btn-border-color; - width: 100%; height: 100%; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/Label.less b/lib/tinymce/js/tinymce/skins/lightgray/Label.less deleted file mode 100644 index c9aa6fbe..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/Label.less +++ /dev/null @@ -1,20 +0,0 @@ -// Label - -.mce-label { - .inline-block(); - text-shadow: @textShadow; - border: 0 solid @btn-border-color; - overflow: hidden; -} - -.mce-label.mce-autoscroll { - overflow: auto; -} - -.mce-label-disabled .mce-text { - color: @text-color-disabled; -} - -.mce-label.mce-multiline { - white-space: pre-wrap; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/ListBox.less b/lib/tinymce/js/tinymce/skins/lightgray/ListBox.less deleted file mode 100644 index 877840cb..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/ListBox.less +++ /dev/null @@ -1,20 +0,0 @@ -// ListBox - -.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-listbox span { - width: 100%; - display: block; - overflow: hidden; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/Menu.less b/lib/tinymce/js/tinymce/skins/lightgray/Menu.less deleted file mode 100644 index 80c977ea..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/Menu.less +++ /dev/null @@ -1,29 +0,0 @@ -// Menu - -.mce-menu { - .reset-gradient(); - z-index: 1000; - padding: 5px 0 5px 0; - margin: 2px 0 0; - min-width: 160px; - background: #FFF; - border: 1px solid #CCC; - border: 1px solid rgba(0, 0, 0, 0.2); - z-index: 1002; - .border-radius(6px); - .box-shadow(0 5px 10px rgba(0,0,0,.2)); -} - -.mce-menu i { - display: none; -} - -.mce-menu-has-icons i { - .inline-block(); -} - -.mce-menu-sub { - margin-top: -6px; - margin-left: -1px; - .border-radius(0 6px 6px 6px); -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/MenuBar.less b/lib/tinymce/js/tinymce/skins/lightgray/MenuBar.less deleted file mode 100644 index 0a4d09f7..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/MenuBar.less +++ /dev/null @@ -1,23 +0,0 @@ -/* MenuBar */ - -.mce-menubar .mce-menubtn { - border-color: transparent; - background: transparent; - .border-radius(0); - .box-shadow(none); - filter: none; -} - -.mce-menubar { - border: 1px solid @menubar-border; -} - -.mce-menubar .mce-menubtn button { - color: @text-color; -} - -.mce-menubar .mce-menubtn:hover, .mce-menubar .mce-menubtn.mce-active, .mce-menubtn:focus { - border-color: transparent; - background: @menubar-background-active; - filter: none; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/MenuButton.less b/lib/tinymce/js/tinymce/skins/lightgray/MenuButton.less deleted file mode 100644 index 80123995..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/MenuButton.less +++ /dev/null @@ -1,5 +0,0 @@ -/* MenuButton */ - -.mce-menubtn.mce-disabled span { - color: @text-color-disabled; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/MenuItem.less b/lib/tinymce/js/tinymce/skins/lightgray/MenuItem.less deleted file mode 100644 index c0beffe7..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/MenuItem.less +++ /dev/null @@ -1,89 +0,0 @@ -// MenuItem - -.mce-menu-item { - display: block; - padding: 6px 20px; - clear: both; - font-weight: normal; - line-height: 20px; - color: @btn-text-color; - white-space: nowrap; - cursor: pointer; - line-height: normal; -} - -.mce-menu-item.mce-disabled .mce-text { - color: @text-color-disabled; -} - -.mce-menu-item:hover, .mce-menu-item.mce-selected, .mce-menu-item:focus { - text-decoration: none; - color: @text-color-inverse; - background-color: @menuitem-background-hover; - .vertical-gradient(#08C, #0077B3); -} - -.mce-menu-item:hover .mce-text, .mce-menu-item.mce-selected .mce-text { - color: @text-color-inverse; -} - -.mce-menu-item:hover .mce-ico, .mce-menu-item.mce-selected .mce-ico, .mce-menu-item:focus .mce-ico { - color: white; -} - -.mce-menu-shortcut { - display: inline-block; - color: @text-color-disabled; -} - -.mce-menu-shortcut { - .inline-block(); - padding: 0 20px 0 20px; -} - -.mce-menu-item .mce-caret { - margin-top: 6px; - *margin-top: 3px; - margin-right: 6px; - border-top: 4px solid transparent; - border-bottom: 4px solid transparent; - border-left: 4px solid #666; -} - -.mce-menu-item.mce-selected .mce-caret, .mce-menu-item:focus .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-sep, .mce-menu-item-sep:hover { - padding: 0; - height: 1px; - margin: 9px 1px; - overflow: hidden; - background: #E5E5E5; - border-bottom: 1px solid white; - cursor: default; - filter: none; -} - -.mce-menu-item.mce-active i { - visibility: visible; -} - -.mce-menu-item.mce-active { - background-color: #C8DEF4; - outline: 1px solid @btn-border-color; -} - -.mce-menu-item-checkbox.mce-active { - background-color: #FFF; - outline: 0; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/Mixins.less b/lib/tinymce/js/tinymce/skins/lightgray/Mixins.less deleted file mode 100644 index bff6c495..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/Mixins.less +++ /dev/null @@ -1,60 +0,0 @@ -// Mixins - -.opacity(@opacity:0.5) { - opacity: @opacity; - @opacityie: @opacity * 100; - filter: ~"alpha(opacity=@{opacityie})"; - zoom: 1; -} - -.vertical-gradient(@startColor: #FDFDFD, @endColor: #DDD) { - background-color: mix(@startColor, @endColor, 60%); - background-image: -moz-linear-gradient(top, @startColor, @endColor); // FF 3.6+ - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+ - background-image: -webkit-linear-gradient(top, @startColor, @endColor); // Safari 5.1+, Chrome 10+ - background-image: -o-linear-gradient(top, @startColor, @endColor); // Opera 11.10 - background-image: linear-gradient(to bottom, @startColor, @endColor); // Standard, IE10 - background-repeat: repeat-x; - filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor))); - zoom: 1; -} - -.border-radius(@radius:3px) { - -webkit-border-radius: @radius; - -moz-border-radius: @radius; - border-radius: @radius; -} - -.box-shadow(@shadowA:#ccc 5px 5px 5px, @shadowB:X, ...){ - // Multiple shadow solution from http://toekneestuck.com/blog/2012/05/15/less-css-arguments-variable/ - @props: ~`"@{arguments}".replace(/[\[\]]|\,\sX/g, '')`; - -webkit-box-shadow: @props; - -moz-box-shadow: @props; - box-shadow: @props; -} - -.transition(@transition) { - -webkit-transition: @transition; - transition: @transition; -} - -.inline-block() { - display: inline-block; - - // IE7 - *display: inline; - *zoom: 1; -} - -.reset-gradient() { - filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)")); - background: transparent; -} - -.button-background(@startColor, @endColor, @textColor: #fff, @textShadow: 0 -1px 0 rgba(0,0,0,.25)) { - color: @textColor; - text-shadow: @textShadow; - .vertical-gradient(@startColor, @endColor); - border-color: @endColor @endColor darken(@endColor, 15%); - border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fadein(rgba(0,0,0,.1), 15%); -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/Panel.less b/lib/tinymce/js/tinymce/skins/lightgray/Panel.less deleted file mode 100644 index d5fc6da4..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/Panel.less +++ /dev/null @@ -1,6 +0,0 @@ -// Panel - -.mce-panel { - border: 0 solid @panel-border; - .vertical-gradient(@panel-background, @panel-background-highlight); -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/Path.less b/lib/tinymce/js/tinymce/skins/lightgray/Path.less deleted file mode 100644 index 9a9a1f12..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/Path.less +++ /dev/null @@ -1,39 +0,0 @@ -// Path - -.mce-path { - .inline-block(); - 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 { - .inline-block(); - cursor: pointer; - color: @text-color; -} - -.mce-path .mce-last { - //color: @text-color-disabled; -} - -.mce-path-item:hover { - text-decoration: underline; -} - -.mce-path-item:focus { - background: gray; - color: white; -} - -.mce-path .mce-divider { - display: inline; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/Radio.less b/lib/tinymce/js/tinymce/skins/lightgray/Radio.less deleted file mode 100644 index 8b085710..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/Radio.less +++ /dev/null @@ -1,19 +0,0 @@ -// Radio - -i.mce-radio { - padding: 1px; - margin: 0 3px 0 0; - background-color: #fafafa; - border: 1px solid #cacece; - - .border-radius(8px); - .box-shadow(inset 0 1px 0 rgba(255, 255, 255, .2), 0 1px 2px rgba(0, 0, 0, .05)); - .vertical-gradient; -} - -i.mce-radio:after { - font-family: Arial; - font-size: 12px; - color: @text-color; - content: '\25cf'; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/Reset.less b/lib/tinymce/js/tinymce/skins/lightgray/Reset.less deleted file mode 100644 index 6c4e0ecd..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/Reset.less +++ /dev/null @@ -1,36 +0,0 @@ -// Reset - -.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: @text-color; - font-family: @font-family; - font-size: @font-size; text-shadow: none; float: none; - position: static; width: auto; height: auto; - white-space: nowrap; cursor: inherit; - -webkit-tap-highlight-color: transparent; - line-height: normal; -} - -.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(053, 057, 071, 0.3); - width: 6px; height: 6px; - -webkit-border-radius: 4px; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/ResizeHandle.less b/lib/tinymce/js/tinymce/skins/lightgray/ResizeHandle.less deleted file mode 100644 index 54ae025e..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/ResizeHandle.less +++ /dev/null @@ -1,18 +0,0 @@ -.mce-container-body .mce-resizehandle { - position: absolute; - right: 0; - bottom: 0; - width: 16px; - height: 16px; - visibility: visible; - cursor: s-resize; - margin: 0; -} - -.mce-resizehandle-both { - cursor: se-resize; -} - -i.mce-i-resize { - color: @text-color; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/Scrollable.less b/lib/tinymce/js/tinymce/skins/lightgray/Scrollable.less deleted file mode 100644 index d627eb8c..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/Scrollable.less +++ /dev/null @@ -1,44 +0,0 @@ -// Scrollbar - -.mce-scrollbar { - position: absolute; - width: 7px; - height: 100%; - top: 2px; - right: 2px; - .opacity(0.4); -} - -.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, .6); - width: 5px; - height: 100%; - .border-radius(7px); -} - -.mce-scrollbar-h .mce-scrollbar-thumb { - width: 100%; - height: 5px; -} - -.mce-scrollbar:hover, .mce-scrollbar.mce-active { - background-color: #AAA; - .opacity(0.6); - .border-radius(7px); -} - -.mce-scroll { - position: relative; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/Select.less b/lib/tinymce/js/tinymce/skins/lightgray/Select.less deleted file mode 100644 index 22be7295..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/Select.less +++ /dev/null @@ -1,6 +0,0 @@ -/* Select */ - -.mce-select { - border: 1px solid #AAA; - height: 30px; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/Spacer.less b/lib/tinymce/js/tinymce/skins/lightgray/Spacer.less deleted file mode 100644 index 0871105c..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/Spacer.less +++ /dev/null @@ -1,5 +0,0 @@ -// Spacer - -.mce-spacer { - visibility: hidden; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/SplitButton.less b/lib/tinymce/js/tinymce/skins/lightgray/SplitButton.less deleted file mode 100644 index c1ee3e4d..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/SplitButton.less +++ /dev/null @@ -1,23 +0,0 @@ -// SplitButton - -.mce-splitbtn .mce-open { - border-left: 1px solid transparent; - border-right: 1px solid transparent; -} - -.mce-splitbtn:hover .mce-open { - border-left-color: @btn-border-color; - border-right-color: @btn-border-color; -} - -.mce-splitbtn button { - padding-right: 4px; -} - -.mce-splitbtn .mce-open { - padding-left: 4px; -} - -.mce-splitbtn .mce-open.mce-active { - .box-shadow(inset 0 2px 4px rgba(0, 0, 0, .15), 0 1px 2px rgba(0, 0, 0 ,.05)); -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/StackLayout.less b/lib/tinymce/js/tinymce/skins/lightgray/StackLayout.less deleted file mode 100644 index dff0a08e..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/StackLayout.less +++ /dev/null @@ -1,5 +0,0 @@ -// StackLayout - -.mce-stack-layout-item { - display: block; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/TabPanel.less b/lib/tinymce/js/tinymce/skins/lightgray/TabPanel.less deleted file mode 100644 index 12743ad3..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/TabPanel.less +++ /dev/null @@ -1,28 +0,0 @@ -// TabPanel - -.mce-tabs { - display: block; - border-bottom: 1px solid @tab-border; -} - -.mce-tab { - .inline-block(); - border: 1px solid @tab-border; - border-width: 1px 1px 0 0; - background: @tab-background; - padding: 8px; - text-shadow: @textShadow; - height: 13px; - cursor: pointer; -} - -.mce-tab:hover { - background: @tab-background-hover; -} - -.mce-tab.mce-active { - background: @tab-background-active; - border-bottom-color: transparent; - margin-bottom: -1px; - height: 14px; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/TextBox.less b/lib/tinymce/js/tinymce/skins/lightgray/TextBox.less deleted file mode 100644 index 49cbcf42..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/TextBox.less +++ /dev/null @@ -1,28 +0,0 @@ -// TextBox - -.mce-textbox { - background: #FFF; - border: 1px solid @btn-border-color; - .border-radius(); - .box-shadow(inset 0 1px 1px rgba(0, 0, 0, 0.075)); - display: inline-block; - .transition(~"border linear .2s, box-shadow linear .2s"); - height: 28px; - resize: none; - padding: 0 4px 0 4px; - white-space: normal; - color: @black; -} - -.mce-textbox:focus { - border-color: rgba(82, 168, 236, .8); - .box-shadow(inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 8px rgba(82, 168, 236, .6)); -} - -.mce-placeholder .mce-textbox { - color: #aaa; -} - -.mce-textbox.mce-multiline { - padding: 4px; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/Throbber.less b/lib/tinymce/js/tinymce/skins/lightgray/Throbber.less deleted file mode 100644 index d9a8752c..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/Throbber.less +++ /dev/null @@ -1,9 +0,0 @@ -// Throbber - -.mce-throbber { - position: absolute; - top: 0; left: 0; - width: 100%; height: 100%; - .opacity(0.6); - background: #FFFFFF url('img/loader.gif') no-repeat center center; -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/TinyMCE.less b/lib/tinymce/js/tinymce/skins/lightgray/TinyMCE.less deleted file mode 100644 index 12a8af31..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/TinyMCE.less +++ /dev/null @@ -1,105 +0,0 @@ -.mce-tinymce { - // Avoid FOUC - visibility: visible !important; - position: relative; -} - -.mce-fullscreen { - border: 0; padding: 0; margin: 0; - overflow: hidden; - background: #FFF; - height: 100%; - z-index: 100; -} - -div.mce-fullscreen { - position: fixed; - top: 0; left: 0; - width: 100%; - height: auto; -} - -.mce-tinymce { - display: block; - border-radius: 2px; -} - -.mce-wordcount { - float: right; - padding: 8px; -} - -.mce-edit-area { - background: #FFF; - filter: none; -} - -.mce-statusbar { - position: relative; -} - -.mce-statusbar .mce-container-body { - position: relative; -} - -.mce-fullscreen .mce-resizehandle { - display: none; -} - -// Charmap - -.mce-charmap { - border-collapse: collapse; -} - -.mce-charmap td { - cursor: default; - border: 1px solid @btn-border-color; - width: 20px; - height: 20px; - line-height: 20px; - text-align: center; - vertical-align: center; - padding: 2px; -} - -.mce-charmap td:hover { - background: @btn-background-highlight; -} - -.mce-grid { - border-spacing: 2px; - border-collapse: separate; - - a { - display: block; - border: 1px solid transparent; - - &:hover { - border-color: @btn-border-color; - } - } -} - -.mce-grid-border { - margin: 0 4px 0 4px; - - a { - border-color: #e8e8e8; - width: 13px; height: 13px; - } - - a:hover, a.mce-active { - border-color: #c4daff; - background: #deeafa; - } -} - -.mce-text-center { - text-align: center; -} - -div.mce-tinymce-inline { - width: 100%; - .box-shadow(none); -} diff --git a/lib/tinymce/js/tinymce/skins/lightgray/ToolTip.less b/lib/tinymce/js/tinymce/skins/lightgray/ToolTip.less deleted file mode 100644 index da83202d..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/ToolTip.less +++ /dev/null @@ -1,135 +0,0 @@ -// Tooltip - -.mce-tooltip { - position: absolute; - padding: 5px; - .opacity(0.8); -} - -.mce-tooltip-inner { - font-size: 11px; - background-color: @tooltip-background; - color: @tooltip-text-color; - max-width: 200px; - padding: 5px 8px 4px 8px; - text-align: center; - white-space: normal; -} - -.mce-tooltip-inner { - .border-radius(3px); -} - -.mce-tooltip-inner { - .box-shadow(0 0 5px @tooltip-background); -} - -.mce-tooltip-arrow { - position: absolute; - width: 0; - height: 0; - line-height: 0; - border: 5px dashed @tooltip-background; -} - -.mce-tooltip-arrow-n { - border-bottom-color: @tooltip-background; -} - -.mce-tooltip-arrow-s { - border-top-color: @tooltip-background; -} - -.mce-tooltip-arrow-e { - border-left-color: @tooltip-background; -} - -.mce-tooltip-arrow-w { - border-right-color: @tooltip-background; -} - -.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; -} - -// Invalid field tooltip -/* -.mce-tooltip-inner { background: #aa0000; } -.mce-tooltip-arrow-n { border-bottom-color: #aa0000; } -.mce-tooltip-arrow-s { border-top-color: #aa0000; } -.mce-tooltip-arrow-e { border-left-color: #aa0000; } -.mce-tooltip-arrow-w { border-right-color: #aa0000; } -.mce-tooltip-arrow { border: 5px dashed #aa0000; } -*/ diff --git a/lib/tinymce/js/tinymce/skins/lightgray/Variables.less b/lib/tinymce/js/tinymce/skins/lightgray/Variables.less deleted file mode 100644 index 3a8d9189..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/Variables.less +++ /dev/null @@ -1,123 +0,0 @@ -// Variables - -@black: #000; -@white: #fff; -@grayDark: #333; -@gray: #aaa; - -// Default font -@font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -@font-size: 14px; -@line-height: 20px; - -// Text colors -@text-color: @black; -@text-color-inverse: @white; -@text-color-disabled: lighten(@text-color, 60%); - -@textShadow: 0 1px 1px hsla(hue(@text-color-inverse), saturation(@text-color-inverse), lightness(@text-color-inverse), 0.75); -@invertedTextShadow: 0 1px 1px hsla(hue(@text-color), saturation(@text-color), lightness(@text-color), 0.75); - -// Button -@btn-text-color: #333; -@btn-text-shadow: #fff; -@btn-border-color: #c5c5c5; -@btn-caret-color: #444; -@btn-text-color-disabled: @text-color-disabled; - -@btn-background: @white; -@btn-background-highlight: darken(@white, 15%); -@btn-background-hover: darken(@btn-background, 5%); -@btn-background-highlight-hover: darken(@btn-background-highlight, 5%); - -@btn-background-primary: #0088cc; -@btn-background-primary-highlight: #0044cc; -@btn-background-primary-hover: darken(#0088cc, 5%); -@btn-background-primary-highlight-hover: darken(#0044cc, 5%); -@btn-text-color-primary: #fff; - -// Menu -@menubar-border: #ddd; -@menubar-background-active: #ddd; -@menuitem-background-hover: #0081C2; - -// Panel -@panel-border: #9E9E9E; -@panel-background: #FDFDFD; -@panel-background-highlight: #DDD; - -// Tabs -@tab-border: #ccc; -@tab-background: #e3e3e3; -@tab-background-hover: #FDFDFD; -@tab-background-active: #FDFDFD; - -// Tooltip -@tooltip-background: #000; -@tooltip-text-color: @white; - -// Popover -@popover-background: @white; -@popover-arrow-width: 10px; -@popover-arrow-color: @white; -@popover-arrow-outer-width: @popover-arrow-width + 1; -@popover-arrow-outer-color: rgba(0, 0, 0, 0.25); - -// ------ -/* -@black: #000; -@white: #fff; -@grayDark: #333; -@gray: #aaa; - -// Default font -@font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; -@font-size: 14px; -@line-height: 20px; - -// Text colors -@text-color: #aaa; -@text-color-inverse: @black; -@text-color-disabled: lighten(@text-color, 50%); - -@textShadow: 0 1px 1px hsla(hue(@text-color-inverse), saturation(@text-color-inverse), lightness(@text-color-inverse), 0.75); -@invertedTextShadow: 0 1px 1px hsla(hue(@text-color), saturation(@text-color), lightness(@text-color), 0.75); - -// Button -@btn-text-color: #333; -@btn-text-shadow: #aaa; -@btn-text-color-disabled: #888; -@btn-border-color: #666; -@btn-caret-color: #444; - -@btn-background: #ddd; -@btn-background-highlight: #888; -@btn-background-hover: #eee; -@btn-background-highlight-hover: #777; - -@btn-background-primary: #0088cc; -@btn-background-primary-highlight: #0044cc; -@btn-background-primary-hover: #0088cc; -@btn-background-primary-highlight-hover: #0044cc; -@btn-text-color-primary: #fff; - -// Menu -@menubar-border: #333; -@menubar-background-active: #333; -@menuitem-background-hover: #0081C2; - -// Panel -@panel-border: #9E9E9E; -@panel-background: #777; -@panel-background-highlight: #444; - -// Tabs -@tab-border: #ccc; -@tab-background: #e3e3e3; -@tab-background-hover: #FDFDFD; -@tab-background-active: #FDFDFD; - -// Tooltip -@tooltip-background: #000; -@tooltip-text-color: @white; -*/ \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/skins/lightgray/Window.less b/lib/tinymce/js/tinymce/skins/lightgray/Window.less deleted file mode 100644 index 867f3dc4..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/Window.less +++ /dev/null @@ -1,108 +0,0 @@ -// Window - -.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); - position: fixed; - left: 0; top: 0; - width: 100%; height: 100%; - background: #000; -} - -#mce-modal-block.mce-in { - .opacity(0.3); -} - -.mce-window-move { - cursor: move; -} - -.mce-window { - .border-radius(6px); - .box-shadow(0 3px 7px rgba(0,0,0,0.3)); - .reset-gradient(); - background: #FFF; - position: fixed; - top: 0; left: 0; - opacity: 0; - .transition(opacity 150ms ease-in); -} - -.mce-window.mce-in { - opacity: 1; -} - -.mce-window-head { - padding: 9px 15px; - border-bottom: 1px solid #EEE; - position: relative; -} - -.mce-window-head .mce-close { - position: absolute; - right: 15px; - top: 9px; - font-size: 20px; - font-weight: bold; - line-height: 20px; - color: #CCC; - text-shadow: 0 1px 0 white; - cursor: pointer; - - // IE7 - height: 20px; - overflow: hidden; -} - -.mce-close:hover { - color: #AAA; -} - -.mce-window-head .mce-title { - .inline-block(); - 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: whiteSmoke; - border-top: 1px solid #DDD; - .border-radius(0 0 6px 6px); - .box-shadow(inset 0 1px 0 white); -} - -.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 { - .border-radius(0); -} \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/skins/lightgray/content.min.css b/lib/tinymce/js/tinymce/skins/lightgray/content.min.css deleted file mode 100644 index 0b272601..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/content.min.css +++ /dev/null @@ -1 +0,0 @@ -body.mce-content-body{background-color:#fff;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px;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}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:11px}.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;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:green;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/lib/tinymce/js/tinymce/skins/lightgray/fonts/icomoon.dev.svg b/lib/tinymce/js/tinymce/skins/lightgray/fonts/icomoon.dev.svg deleted file mode 100644 index 262c21e2..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/fonts/icomoon.dev.svg +++ /dev/null @@ -1,150 +0,0 @@ - - - - -This is a custom SVG font generated by IcoMoon. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/skins/lightgray/fonts/icomoon.eot b/lib/tinymce/js/tinymce/skins/lightgray/fonts/icomoon.eot deleted file mode 100644 index 0350809a..00000000 Binary files a/lib/tinymce/js/tinymce/skins/lightgray/fonts/icomoon.eot and /dev/null differ diff --git a/lib/tinymce/js/tinymce/skins/lightgray/fonts/icomoon.svg b/lib/tinymce/js/tinymce/skins/lightgray/fonts/icomoon.svg deleted file mode 100644 index fa1d05f6..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/fonts/icomoon.svg +++ /dev/null @@ -1,150 +0,0 @@ - - - - -This is a custom SVG font generated by IcoMoon. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/skins/lightgray/fonts/icomoon.ttf b/lib/tinymce/js/tinymce/skins/lightgray/fonts/icomoon.ttf deleted file mode 100644 index 4529badb..00000000 Binary files a/lib/tinymce/js/tinymce/skins/lightgray/fonts/icomoon.ttf and /dev/null differ diff --git a/lib/tinymce/js/tinymce/skins/lightgray/fonts/icomoon.woff b/lib/tinymce/js/tinymce/skins/lightgray/fonts/icomoon.woff deleted file mode 100644 index 33eea8ea..00000000 Binary files a/lib/tinymce/js/tinymce/skins/lightgray/fonts/icomoon.woff and /dev/null differ diff --git a/lib/tinymce/js/tinymce/skins/lightgray/fonts/readme.md b/lib/tinymce/js/tinymce/skins/lightgray/fonts/readme.md deleted file mode 100644 index fa5d6394..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/fonts/readme.md +++ /dev/null @@ -1 +0,0 @@ -Icons are generated and provided by the http://icomoon.io service. diff --git a/lib/tinymce/js/tinymce/skins/lightgray/img/anchor.gif b/lib/tinymce/js/tinymce/skins/lightgray/img/anchor.gif deleted file mode 100644 index 606348c7..00000000 Binary files a/lib/tinymce/js/tinymce/skins/lightgray/img/anchor.gif and /dev/null differ diff --git a/lib/tinymce/js/tinymce/skins/lightgray/img/loader.gif b/lib/tinymce/js/tinymce/skins/lightgray/img/loader.gif deleted file mode 100644 index c69e9372..00000000 Binary files a/lib/tinymce/js/tinymce/skins/lightgray/img/loader.gif and /dev/null differ diff --git a/lib/tinymce/js/tinymce/skins/lightgray/img/object.gif b/lib/tinymce/js/tinymce/skins/lightgray/img/object.gif deleted file mode 100644 index cccd7f02..00000000 Binary files a/lib/tinymce/js/tinymce/skins/lightgray/img/object.gif and /dev/null differ diff --git a/lib/tinymce/js/tinymce/skins/lightgray/img/trans.gif b/lib/tinymce/js/tinymce/skins/lightgray/img/trans.gif deleted file mode 100644 index 38848651..00000000 Binary files a/lib/tinymce/js/tinymce/skins/lightgray/img/trans.gif and /dev/null differ diff --git a/lib/tinymce/js/tinymce/skins/lightgray/img/wline.gif b/lib/tinymce/js/tinymce/skins/lightgray/img/wline.gif deleted file mode 100644 index 7d0a4dbc..00000000 Binary files a/lib/tinymce/js/tinymce/skins/lightgray/img/wline.gif and /dev/null differ diff --git a/lib/tinymce/js/tinymce/skins/lightgray/skin.classic.min.css b/lib/tinymce/js/tinymce/skins/lightgray/skin.classic.min.css deleted file mode 100644 index d5c50b76..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/skin.classic.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:#000;font-family:"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}.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;background:#FFF;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;border-radius:2px}.mce-wordcount{float:right;padding:8px}.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 #c5c5c5;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:center;padding:2px}.mce-charmap td:hover{background:#d9d9d9}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover{border-color:#c5c5c5}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#e8e8e8;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#c4daff;background:#deeafa}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.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;background-image:-moz-linear-gradient(top,#fdfdfd,#ddd);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdfdfd),to(#ddd));background-image:-webkit-linear-gradient(top,#fdfdfd,#ddd);background-image:-o-linear-gradient(top,#fdfdfd,#ddd);background-image:linear-gradient(to bottom,#fdfdfd,#ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd',endColorstr='#ffdddddd',GradientType=0);zoom:1}.mce-floatpanel{position:absolute;-webkit-box-shadow:#ccc 5px 5px 5px;-moz-box-shadow:#ccc 5px 5px 5px;box-shadow:#ccc 5px 5px 5px}.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{position:absolute;top:0;left:0;background:#fff;-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-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)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;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 #EEE;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:bold;line-height:20px;color:#CCC;text-shadow:0 1px 0 white;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#AAA}.mce-window-head .mce-title{display:inline-block;*display:inline;*zoom:1;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:whiteSmoke;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;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.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-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 #000;-moz-box-shadow:0 0 5px #000;box-shadow:0 0 5px #000}.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-n .mce-tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:0;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:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:0;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:0;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 #c5c5c5;position:relative;color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fff,#d9d9d9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#d9d9d9));background-image:-webkit-linear-gradient(top,#fff,#d9d9d9);background-image:-o-linear-gradient(top,#fff,#d9d9d9);background-image:linear-gradient(to bottom,#fff,#d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffd9d9d9',GradientType=0);zoom:1;border-color:#d9d9d9 #d9d9d9 #b3b3b3;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);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)}.mce-btn:hover,.mce-btn:focus{text-decoration:none;color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#e3e3e3;background-image:-moz-linear-gradient(top,#f2f2f2,#ccc);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#ccc));background-image:-webkit-linear-gradient(top,#f2f2f2,#ccc);background-image:-o-linear-gradient(top,#f2f2f2,#ccc);background-image:linear-gradient(to bottom,#f2f2f2,#ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffcccccc',GradientType=0);zoom:1;border-color:#ccc #ccc #a6a6a6;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-btn.mce-disabled,.mce-btn.mce-disabled:hover{cursor:default;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.65;filter:alpha(opacity=65);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#d6d6d6;background-image:-moz-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-webkit-gradient(linear,0 0,0 100%,from(#e6e6e6),to(#bfbfbf));background-image:-webkit-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-o-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:linear-gradient(to bottom,#e6e6e6,#bfbfbf);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6',endColorstr='#ffbfbfbf',GradientType=0);zoom:1;border-color:#bfbfbf #bfbfbf #999;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);-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:#333;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px #fff}.mce-primary{color:#fff;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);zoom:1;border-color:#04c #04c #002b80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-primary:hover,.mce-primary:focus{color:#fff;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#005fb3;background-image:-moz-linear-gradient(top,#0077b3,#003cb3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#0077b3),to(#003cb3));background-image:-webkit-linear-gradient(top,#0077b3,#003cb3);background-image:-o-linear-gradient(top,#0077b3,#003cb3);background-image:linear-gradient(to bottom,#0077b3,#003cb3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0077b3',endColorstr='#ff003cb3',GradientType=0);zoom:1;border-color:#003cb3 #003cb3 #026;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-primary button{color:#fff}.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 #444;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#999}.mce-caret.mce-up{border-bottom:4px solid #444;border-top:0}.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-btn:hover,.mce-btn-group .mce-btn:focus{color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#e3e3e3;background-image:-moz-linear-gradient(top,#f2f2f2,#ccc);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#ccc));background-image:-webkit-linear-gradient(top,#f2f2f2,#ccc);background-image:-o-linear-gradient(top,#f2f2f2,#ccc);background-image:linear-gradient(to bottom,#f2f2f2,#ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffcccccc',GradientType=0);zoom:1;border-color:#ccc #ccc #a6a6a6;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-btn-group .mce-btn.mce-disabled,.mce-btn-group .mce-btn.mce-disabled:hover{-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);color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fff,#d9d9d9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#d9d9d9));background-image:-webkit-linear-gradient(top,#fff,#d9d9d9);background-image:-o-linear-gradient(top,#fff,#d9d9d9);background-image:linear-gradient(to bottom,#fff,#d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffd9d9d9',GradientType=0);border-color:#d9d9d9 #d9d9d9 #b3b3b3;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);opacity:1;filter:alpha(opacity=100);zoom:1}.mce-btn-group .mce-btn.mce-active,.mce-btn-group .mce-btn.mce-active:hover,.mce-btn-group .mce-btn:active{color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#d6d6d6;background-image:-moz-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-webkit-gradient(linear,0 0,0 100%,from(#e6e6e6),to(#bfbfbf));background-image:-webkit-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-o-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:linear-gradient(to bottom,#e6e6e6,#bfbfbf);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6',endColorstr='#ffbfbfbf',GradientType=0);zoom:1;border-color:#bfbfbf #bfbfbf #999;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);-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-group .mce-btn.mce-disabled button{opacity:.65;filter:alpha(opacity=65);zoom:1}.mce-btn-group .mce-first{border-left:1px solid #c5c5c5;-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 #c5c5c5;-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:#f0f0f0;background-image:-moz-linear-gradient(top,#fdfdfd,#ddd);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdfdfd),to(#ddd));background-image:-webkit-linear-gradient(top,#fdfdfd,#ddd);background-image:-o-linear-gradient(top,#fdfdfd,#ddd);background-image:linear-gradient(to bottom,#fdfdfd,#ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd',endColorstr='#ffdddddd',GradientType=0);zoom:1;font-size:0;line-height:0}.mce-checked i.mce-i-checkbox{color:#000;font-size:16px;line-height:16px}.mce-checkbox:focus i.mce-i-checkbox{border:1px solid red;border:1px solid rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}.mce-colorbutton .mce-ico{position:relative}.mce-colorpicker{background:#FFF}.mce-colorbutton-grid{margin:4px}.mce-grid td div{border:1px solid #808080;width:12px;height:12px;margin:2px;cursor:pointer}.mce-grid td div:hover{border-color:black}.mce-grid td div:focus{border-color:red;outline:1px solid rgba(82,168,236,0.8);border-color:rgba(82,168,236,0.8)}.mce-colorbutton{position:relative}.mce-colorbutton .mce-preview{display:block;position:absolute;left:50%;top:50%;margin-left:-8px;margin-top:7px;background:gray;width:16px;height:2px;overflow:hidden}.mce-combobox{display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;width:100px;-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)}.mce-combobox input{border-color:1px solid #c5c5c5;border-right-color:rgba(0,0,0,0.15);height:28px}.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 *:focus{border-color:red;border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}.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:#000}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:gray;color:white}.mce-path .mce-divider{display:inline}.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-iframe{border:0 solid #c5c5c5;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 solid #c5c5c5;overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label-disabled .mce-text{color:#999}.mce-label.mce-multiline{white-space:pre-wrap}.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 #ddd}.mce-menubar .mce-menubtn button{color:#000}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubtn:focus{border-color:transparent;background:#ddd;filter:none}.mce-menubtn.mce-disabled span{color:#999}.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-listbox span{width:100%;display:block;overflow:hidden}.mce-menu-item{display:block;padding:6px 20px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal}.mce-menu-item.mce-disabled .mce-text{color:#999}.mce-menu-item:hover,.mce-menu-item.mce-selected,.mce-menu-item:focus{text-decoration:none;color:#fff;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0);zoom:1}.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:white}.mce-menu-shortcut{display:inline-block;color:#999}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 20px 0 20px}.mce-menu-item .mce-caret{margin-top:6px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #666}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .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-sep,.mce-menu-item-sep:hover{padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#e5e5e5;border-bottom:1px solid white;cursor:default;filter:none}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item.mce-active{background-color:#c8def4;outline:1px solid #c5c5c5}.mce-menu-item-checkbox.mce-active{background-color:#FFF;outline:0}.mce-menu{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 #CCC;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)}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline;*zoom:1}.mce-menu-sub{margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px}i.mce-radio{padding:1px;margin:0 3px 0 0;background-color:#fafafa;border:1px solid #cacece;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;-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:#f0f0f0;background-image:-moz-linear-gradient(top,#fdfdfd,#ddd);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdfdfd),to(#ddd));background-image:-webkit-linear-gradient(top,#fdfdfd,#ddd);background-image:-o-linear-gradient(top,#fdfdfd,#ddd);background-image:linear-gradient(to bottom,#fdfdfd,#ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd',endColorstr='#ffdddddd',GradientType=0);zoom:1}i.mce-radio:after{font-family:Arial;font-size:12px;color:#000;content:'\25cf'}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#000}.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:#c5c5c5;border-right-color:#c5c5c5}.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-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #ccc}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #ccc;border-width:1px 1px 0 0;background:#e3e3e3;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-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:normal;color:#000}.mce-textbox:focus{border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.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}.mce-ico{font-family:'tinymce',Arial;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:#333}.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-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-checkbox:before,.mce-i-selected:before{content:"\e033"}.mce-i-selected{visibility:hidden}i.mce-i-backcolor{text-shadow:none;background:#BBB} \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/skins/lightgray/skin.ie7.min.css b/lib/tinymce/js/tinymce/skins/lightgray/skin.ie7.min.css deleted file mode 100644 index 8a845d58..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/skin.ie7.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:#000;font-family:"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}.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;background:#FFF;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;border-radius:2px}.mce-wordcount{float:right;padding:8px}.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 #c5c5c5;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:center;padding:2px}.mce-charmap td:hover{background:#d9d9d9}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover{border-color:#c5c5c5}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#e8e8e8;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#c4daff;background:#deeafa}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.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;background-image:-moz-linear-gradient(top,#fdfdfd,#ddd);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdfdfd),to(#ddd));background-image:-webkit-linear-gradient(top,#fdfdfd,#ddd);background-image:-o-linear-gradient(top,#fdfdfd,#ddd);background-image:linear-gradient(to bottom,#fdfdfd,#ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd',endColorstr='#ffdddddd',GradientType=0);zoom:1}.mce-floatpanel{position:absolute;-webkit-box-shadow:#ccc 5px 5px 5px;-moz-box-shadow:#ccc 5px 5px 5px;box-shadow:#ccc 5px 5px 5px}.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{position:absolute;top:0;left:0;background:#fff;-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-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)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;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 #EEE;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:bold;line-height:20px;color:#CCC;text-shadow:0 1px 0 white;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#AAA}.mce-window-head .mce-title{display:inline-block;*display:inline;*zoom:1;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:whiteSmoke;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;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.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-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 #000;-moz-box-shadow:0 0 5px #000;box-shadow:0 0 5px #000}.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-n .mce-tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:0;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:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:0;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:0;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 #c5c5c5;position:relative;color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fff,#d9d9d9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#d9d9d9));background-image:-webkit-linear-gradient(top,#fff,#d9d9d9);background-image:-o-linear-gradient(top,#fff,#d9d9d9);background-image:linear-gradient(to bottom,#fff,#d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffd9d9d9',GradientType=0);zoom:1;border-color:#d9d9d9 #d9d9d9 #b3b3b3;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);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)}.mce-btn:hover,.mce-btn:focus{text-decoration:none;color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#e3e3e3;background-image:-moz-linear-gradient(top,#f2f2f2,#ccc);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#ccc));background-image:-webkit-linear-gradient(top,#f2f2f2,#ccc);background-image:-o-linear-gradient(top,#f2f2f2,#ccc);background-image:linear-gradient(to bottom,#f2f2f2,#ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffcccccc',GradientType=0);zoom:1;border-color:#ccc #ccc #a6a6a6;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-btn.mce-disabled,.mce-btn.mce-disabled:hover{cursor:default;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.65;filter:alpha(opacity=65);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#d6d6d6;background-image:-moz-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-webkit-gradient(linear,0 0,0 100%,from(#e6e6e6),to(#bfbfbf));background-image:-webkit-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-o-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:linear-gradient(to bottom,#e6e6e6,#bfbfbf);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6',endColorstr='#ffbfbfbf',GradientType=0);zoom:1;border-color:#bfbfbf #bfbfbf #999;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);-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:#333;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px #fff}.mce-primary{color:#fff;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);zoom:1;border-color:#04c #04c #002b80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-primary:hover,.mce-primary:focus{color:#fff;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#005fb3;background-image:-moz-linear-gradient(top,#0077b3,#003cb3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#0077b3),to(#003cb3));background-image:-webkit-linear-gradient(top,#0077b3,#003cb3);background-image:-o-linear-gradient(top,#0077b3,#003cb3);background-image:linear-gradient(to bottom,#0077b3,#003cb3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0077b3',endColorstr='#ff003cb3',GradientType=0);zoom:1;border-color:#003cb3 #003cb3 #026;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-primary button{color:#fff}.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 #444;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#999}.mce-caret.mce-up{border-bottom:4px solid #444;border-top:0}.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-btn:hover,.mce-btn-group .mce-btn:focus{color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#e3e3e3;background-image:-moz-linear-gradient(top,#f2f2f2,#ccc);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#ccc));background-image:-webkit-linear-gradient(top,#f2f2f2,#ccc);background-image:-o-linear-gradient(top,#f2f2f2,#ccc);background-image:linear-gradient(to bottom,#f2f2f2,#ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffcccccc',GradientType=0);zoom:1;border-color:#ccc #ccc #a6a6a6;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-btn-group .mce-btn.mce-disabled,.mce-btn-group .mce-btn.mce-disabled:hover{-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);color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fff,#d9d9d9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#d9d9d9));background-image:-webkit-linear-gradient(top,#fff,#d9d9d9);background-image:-o-linear-gradient(top,#fff,#d9d9d9);background-image:linear-gradient(to bottom,#fff,#d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffd9d9d9',GradientType=0);border-color:#d9d9d9 #d9d9d9 #b3b3b3;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);opacity:1;filter:alpha(opacity=100);zoom:1}.mce-btn-group .mce-btn.mce-active,.mce-btn-group .mce-btn.mce-active:hover,.mce-btn-group .mce-btn:active{color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#d6d6d6;background-image:-moz-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-webkit-gradient(linear,0 0,0 100%,from(#e6e6e6),to(#bfbfbf));background-image:-webkit-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-o-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:linear-gradient(to bottom,#e6e6e6,#bfbfbf);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6',endColorstr='#ffbfbfbf',GradientType=0);zoom:1;border-color:#bfbfbf #bfbfbf #999;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);-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-group .mce-btn.mce-disabled button{opacity:.65;filter:alpha(opacity=65);zoom:1}.mce-btn-group .mce-first{border-left:1px solid #c5c5c5;-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 #c5c5c5;-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:#f0f0f0;background-image:-moz-linear-gradient(top,#fdfdfd,#ddd);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdfdfd),to(#ddd));background-image:-webkit-linear-gradient(top,#fdfdfd,#ddd);background-image:-o-linear-gradient(top,#fdfdfd,#ddd);background-image:linear-gradient(to bottom,#fdfdfd,#ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd',endColorstr='#ffdddddd',GradientType=0);zoom:1;font-size:0;line-height:0}.mce-checked i.mce-i-checkbox{color:#000;font-size:16px;line-height:16px}.mce-checkbox:focus i.mce-i-checkbox{border:1px solid red;border:1px solid rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}.mce-colorbutton .mce-ico{position:relative}.mce-colorpicker{background:#FFF}.mce-colorbutton-grid{margin:4px}.mce-grid td div{border:1px solid #808080;width:12px;height:12px;margin:2px;cursor:pointer}.mce-grid td div:hover{border-color:black}.mce-grid td div:focus{border-color:red;outline:1px solid rgba(82,168,236,0.8);border-color:rgba(82,168,236,0.8)}.mce-colorbutton{position:relative}.mce-colorbutton .mce-preview{display:block;position:absolute;left:50%;top:50%;margin-left:-8px;margin-top:7px;background:gray;width:16px;height:2px;overflow:hidden}.mce-combobox{display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;width:100px;-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)}.mce-combobox input{border-color:1px solid #c5c5c5;border-right-color:rgba(0,0,0,0.15);height:28px}.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 *:focus{border-color:red;border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}.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:#000}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:gray;color:white}.mce-path .mce-divider{display:inline}.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-iframe{border:0 solid #c5c5c5;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 solid #c5c5c5;overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label-disabled .mce-text{color:#999}.mce-label.mce-multiline{white-space:pre-wrap}.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 #ddd}.mce-menubar .mce-menubtn button{color:#000}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubtn:focus{border-color:transparent;background:#ddd;filter:none}.mce-menubtn.mce-disabled span{color:#999}.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-listbox span{width:100%;display:block;overflow:hidden}.mce-menu-item{display:block;padding:6px 20px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal}.mce-menu-item.mce-disabled .mce-text{color:#999}.mce-menu-item:hover,.mce-menu-item.mce-selected,.mce-menu-item:focus{text-decoration:none;color:#fff;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0);zoom:1}.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:white}.mce-menu-shortcut{display:inline-block;color:#999}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 20px 0 20px}.mce-menu-item .mce-caret{margin-top:6px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #666}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .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-sep,.mce-menu-item-sep:hover{padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#e5e5e5;border-bottom:1px solid white;cursor:default;filter:none}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item.mce-active{background-color:#c8def4;outline:1px solid #c5c5c5}.mce-menu-item-checkbox.mce-active{background-color:#FFF;outline:0}.mce-menu{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 #CCC;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)}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline;*zoom:1}.mce-menu-sub{margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px}i.mce-radio{padding:1px;margin:0 3px 0 0;background-color:#fafafa;border:1px solid #cacece;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;-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:#f0f0f0;background-image:-moz-linear-gradient(top,#fdfdfd,#ddd);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdfdfd),to(#ddd));background-image:-webkit-linear-gradient(top,#fdfdfd,#ddd);background-image:-o-linear-gradient(top,#fdfdfd,#ddd);background-image:linear-gradient(to bottom,#fdfdfd,#ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd',endColorstr='#ffdddddd',GradientType=0);zoom:1}i.mce-radio:after{font-family:Arial;font-size:12px;color:#000;content:'\25cf'}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#000}.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:#c5c5c5;border-right-color:#c5c5c5}.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-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #ccc}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #ccc;border-width:1px 1px 0 0;background:#e3e3e3;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-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:normal;color:#000}.mce-textbox:focus{border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.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}.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:#333;-ie7-icon:' '}.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/lib/tinymce/js/tinymce/skins/lightgray/skin.less b/lib/tinymce/js/tinymce/skins/lightgray/skin.less deleted file mode 100644 index fc54c090..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/skin.less +++ /dev/null @@ -1,37 +0,0 @@ -@import "Reset.less"; -@import "Variables.less"; -@import "Mixins.less"; -@import "Animations.less"; -@import "TinyMCE.less"; -@import "Container.less"; -@import "Scrollable.less"; -@import "Panel.less"; -@import "FloatPanel.less"; -@import "Window.less"; -@import "AbsoluteLayout.less"; -@import "ToolTip.less"; -@import "Button.less"; -@import "ButtonGroup.less"; -@import "Checkbox.less"; -@import "ColorButton.less"; -@import "ComboBox.less"; -@import "Path.less"; -@import "FieldSet.less"; -@import "FitLayout.less"; -@import "FlowLayout.less"; -@import "Iframe.less"; -@import "Label.less"; -@import "MenuBar.less"; -@import "MenuButton.less"; -@import "ListBox.less"; -@import "MenuItem.less"; -@import "Menu.less"; -@import "Radio.less"; -@import "ResizeHandle.less"; -@import "Spacer.less"; -@import "SplitButton.less"; -@import "StackLayout.less"; -@import "TabPanel.less"; -@import "TextBox.less"; -@import "Throbber.less"; -@import "Icons.less"; diff --git a/lib/tinymce/js/tinymce/skins/lightgray/skin.min.css b/lib/tinymce/js/tinymce/skins/lightgray/skin.min.css deleted file mode 100644 index d5c50b76..00000000 --- a/lib/tinymce/js/tinymce/skins/lightgray/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:#000;font-family:"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}.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;background:#FFF;height:100%;z-index:100}div.mce-fullscreen{position:fixed;top:0;left:0;width:100%;height:auto}.mce-tinymce{display:block;border-radius:2px}.mce-wordcount{float:right;padding:8px}.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 #c5c5c5;width:20px;height:20px;line-height:20px;text-align:center;vertical-align:center;padding:2px}.mce-charmap td:hover{background:#d9d9d9}.mce-grid{border-spacing:2px;border-collapse:separate}.mce-grid a{display:block;border:1px solid transparent}.mce-grid a:hover{border-color:#c5c5c5}.mce-grid-border{margin:0 4px 0 4px}.mce-grid-border a{border-color:#e8e8e8;width:13px;height:13px}.mce-grid-border a:hover,.mce-grid-border a.mce-active{border-color:#c4daff;background:#deeafa}.mce-text-center{text-align:center}div.mce-tinymce-inline{width:100%;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.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;background-image:-moz-linear-gradient(top,#fdfdfd,#ddd);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdfdfd),to(#ddd));background-image:-webkit-linear-gradient(top,#fdfdfd,#ddd);background-image:-o-linear-gradient(top,#fdfdfd,#ddd);background-image:linear-gradient(to bottom,#fdfdfd,#ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd',endColorstr='#ffdddddd',GradientType=0);zoom:1}.mce-floatpanel{position:absolute;-webkit-box-shadow:#ccc 5px 5px 5px;-moz-box-shadow:#ccc 5px 5px 5px;box-shadow:#ccc 5px 5px 5px}.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{position:absolute;top:0;left:0;background:#fff;-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-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)}.mce-floatpanel.mce-popover.mce-bottom{margin-top:10px}.mce-floatpanel.mce-popover.mce-bottom>.mce-arrow{left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;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 #EEE;position:relative}.mce-window-head .mce-close{position:absolute;right:15px;top:9px;font-size:20px;font-weight:bold;line-height:20px;color:#CCC;text-shadow:0 1px 0 white;cursor:pointer;height:20px;overflow:hidden}.mce-close:hover{color:#AAA}.mce-window-head .mce-title{display:inline-block;*display:inline;*zoom:1;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:whiteSmoke;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;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.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-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 #000;-moz-box-shadow:0 0 5px #000;box-shadow:0 0 5px #000}.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-n .mce-tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-nw .mce-tooltip-arrow{top:0;left:10px;border-bottom-style:solid;border-top:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-ne .mce-tooltip-arrow{top:0;right:10px;border-bottom-style:solid;border-top:0;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:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-sw .mce-tooltip-arrow{bottom:0;left:10px;border-top-style:solid;border-bottom:0;border-left-color:transparent;border-right-color:transparent}.mce-tooltip-se .mce-tooltip-arrow{bottom:0;right:10px;border-top-style:solid;border-bottom:0;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:0;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 #c5c5c5;position:relative;color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fff,#d9d9d9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#d9d9d9));background-image:-webkit-linear-gradient(top,#fff,#d9d9d9);background-image:-o-linear-gradient(top,#fff,#d9d9d9);background-image:linear-gradient(to bottom,#fff,#d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffd9d9d9',GradientType=0);zoom:1;border-color:#d9d9d9 #d9d9d9 #b3b3b3;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);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)}.mce-btn:hover,.mce-btn:focus{text-decoration:none;color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#e3e3e3;background-image:-moz-linear-gradient(top,#f2f2f2,#ccc);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#ccc));background-image:-webkit-linear-gradient(top,#f2f2f2,#ccc);background-image:-o-linear-gradient(top,#f2f2f2,#ccc);background-image:linear-gradient(to bottom,#f2f2f2,#ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffcccccc',GradientType=0);zoom:1;border-color:#ccc #ccc #a6a6a6;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-btn.mce-disabled,.mce-btn.mce-disabled:hover{cursor:default;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none;opacity:.65;filter:alpha(opacity=65);zoom:1}.mce-btn.mce-active,.mce-btn.mce-active:hover{color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#d6d6d6;background-image:-moz-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-webkit-gradient(linear,0 0,0 100%,from(#e6e6e6),to(#bfbfbf));background-image:-webkit-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-o-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:linear-gradient(to bottom,#e6e6e6,#bfbfbf);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6',endColorstr='#ffbfbfbf',GradientType=0);zoom:1;border-color:#bfbfbf #bfbfbf #999;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);-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:#333;overflow:visible;-webkit-appearance:none}.mce-btn button::-moz-focus-inner{border:0;padding:0}.mce-btn i{text-shadow:1px 1px #fff}.mce-primary{color:#fff;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#006dcc;background-image:-moz-linear-gradient(top,#08c,#04c);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);zoom:1;border-color:#04c #04c #002b80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-primary:hover,.mce-primary:focus{color:#fff;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#005fb3;background-image:-moz-linear-gradient(top,#0077b3,#003cb3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#0077b3),to(#003cb3));background-image:-webkit-linear-gradient(top,#0077b3,#003cb3);background-image:-o-linear-gradient(top,#0077b3,#003cb3);background-image:linear-gradient(to bottom,#0077b3,#003cb3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0077b3',endColorstr='#ff003cb3',GradientType=0);zoom:1;border-color:#003cb3 #003cb3 #026;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-primary button{color:#fff}.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 #444;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.mce-disabled .mce-caret{border-top-color:#999}.mce-caret.mce-up{border-bottom:4px solid #444;border-top:0}.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-btn:hover,.mce-btn-group .mce-btn:focus{color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#e3e3e3;background-image:-moz-linear-gradient(top,#f2f2f2,#ccc);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#ccc));background-image:-webkit-linear-gradient(top,#f2f2f2,#ccc);background-image:-o-linear-gradient(top,#f2f2f2,#ccc);background-image:linear-gradient(to bottom,#f2f2f2,#ccc);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffcccccc',GradientType=0);zoom:1;border-color:#ccc #ccc #a6a6a6;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25)}.mce-btn-group .mce-btn.mce-disabled,.mce-btn-group .mce-btn.mce-disabled:hover{-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);color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#f0f0f0;background-image:-moz-linear-gradient(top,#fff,#d9d9d9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#d9d9d9));background-image:-webkit-linear-gradient(top,#fff,#d9d9d9);background-image:-o-linear-gradient(top,#fff,#d9d9d9);background-image:linear-gradient(to bottom,#fff,#d9d9d9);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffd9d9d9',GradientType=0);border-color:#d9d9d9 #d9d9d9 #b3b3b3;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);opacity:1;filter:alpha(opacity=100);zoom:1}.mce-btn-group .mce-btn.mce-active,.mce-btn-group .mce-btn.mce-active:hover,.mce-btn-group .mce-btn:active{color:#333;text-shadow:0 1px 1px rgba(255,255,255,0.75);background-color:#d6d6d6;background-image:-moz-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-webkit-gradient(linear,0 0,0 100%,from(#e6e6e6),to(#bfbfbf));background-image:-webkit-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:-o-linear-gradient(top,#e6e6e6,#bfbfbf);background-image:linear-gradient(to bottom,#e6e6e6,#bfbfbf);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffe6e6e6',endColorstr='#ffbfbfbf',GradientType=0);zoom:1;border-color:#bfbfbf #bfbfbf #999;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);-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-group .mce-btn.mce-disabled button{opacity:.65;filter:alpha(opacity=65);zoom:1}.mce-btn-group .mce-first{border-left:1px solid #c5c5c5;-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 #c5c5c5;-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:#f0f0f0;background-image:-moz-linear-gradient(top,#fdfdfd,#ddd);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdfdfd),to(#ddd));background-image:-webkit-linear-gradient(top,#fdfdfd,#ddd);background-image:-o-linear-gradient(top,#fdfdfd,#ddd);background-image:linear-gradient(to bottom,#fdfdfd,#ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd',endColorstr='#ffdddddd',GradientType=0);zoom:1;font-size:0;line-height:0}.mce-checked i.mce-i-checkbox{color:#000;font-size:16px;line-height:16px}.mce-checkbox:focus i.mce-i-checkbox{border:1px solid red;border:1px solid rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}.mce-colorbutton .mce-ico{position:relative}.mce-colorpicker{background:#FFF}.mce-colorbutton-grid{margin:4px}.mce-grid td div{border:1px solid #808080;width:12px;height:12px;margin:2px;cursor:pointer}.mce-grid td div:hover{border-color:black}.mce-grid td div:focus{border-color:red;outline:1px solid rgba(82,168,236,0.8);border-color:rgba(82,168,236,0.8)}.mce-colorbutton{position:relative}.mce-colorbutton .mce-preview{display:block;position:absolute;left:50%;top:50%;margin-left:-8px;margin-top:7px;background:gray;width:16px;height:2px;overflow:hidden}.mce-combobox{display:inline-block;*display:inline;*zoom:1;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;width:100px;-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)}.mce-combobox input{border-color:1px solid #c5c5c5;border-right-color:rgba(0,0,0,0.15);height:28px}.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 *:focus{border-color:red;border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}.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:#000}.mce-path-item:hover{text-decoration:underline}.mce-path-item:focus{background:gray;color:white}.mce-path .mce-divider{display:inline}.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-iframe{border:0 solid #c5c5c5;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 solid #c5c5c5;overflow:hidden}.mce-label.mce-autoscroll{overflow:auto}.mce-label-disabled .mce-text{color:#999}.mce-label.mce-multiline{white-space:pre-wrap}.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 #ddd}.mce-menubar .mce-menubtn button{color:#000}.mce-menubar .mce-menubtn:hover,.mce-menubar .mce-menubtn.mce-active,.mce-menubtn:focus{border-color:transparent;background:#ddd;filter:none}.mce-menubtn.mce-disabled span{color:#999}.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-listbox span{width:100%;display:block;overflow:hidden}.mce-menu-item{display:block;padding:6px 20px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap;cursor:pointer;line-height:normal}.mce-menu-item.mce-disabled .mce-text{color:#999}.mce-menu-item:hover,.mce-menu-item.mce-selected,.mce-menu-item:focus{text-decoration:none;color:#fff;background-color:#0081c2;background-image:-moz-linear-gradient(top,#08c,#0077b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#0077b3));background-image:-webkit-linear-gradient(top,#08c,#0077b3);background-image:-o-linear-gradient(top,#08c,#0077b3);background-image:linear-gradient(to bottom,#08c,#0077b3);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0077b3',GradientType=0);zoom:1}.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:white}.mce-menu-shortcut{display:inline-block;color:#999}.mce-menu-shortcut{display:inline-block;*display:inline;*zoom:1;padding:0 20px 0 20px}.mce-menu-item .mce-caret{margin-top:6px;*margin-top:3px;margin-right:6px;border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid #666}.mce-menu-item.mce-selected .mce-caret,.mce-menu-item:focus .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-sep,.mce-menu-item-sep:hover{padding:0;height:1px;margin:9px 1px;overflow:hidden;background:#e5e5e5;border-bottom:1px solid white;cursor:default;filter:none}.mce-menu-item.mce-active i{visibility:visible}.mce-menu-item.mce-active{background-color:#c8def4;outline:1px solid #c5c5c5}.mce-menu-item-checkbox.mce-active{background-color:#FFF;outline:0}.mce-menu{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 #CCC;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)}.mce-menu i{display:none}.mce-menu-has-icons i{display:inline-block;*display:inline;*zoom:1}.mce-menu-sub{margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px}i.mce-radio{padding:1px;margin:0 3px 0 0;background-color:#fafafa;border:1px solid #cacece;-webkit-border-radius:8px;-moz-border-radius:8px;border-radius:8px;-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:#f0f0f0;background-image:-moz-linear-gradient(top,#fdfdfd,#ddd);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fdfdfd),to(#ddd));background-image:-webkit-linear-gradient(top,#fdfdfd,#ddd);background-image:-o-linear-gradient(top,#fdfdfd,#ddd);background-image:linear-gradient(to bottom,#fdfdfd,#ddd);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#fffdfdfd',endColorstr='#ffdddddd',GradientType=0);zoom:1}i.mce-radio:after{font-family:Arial;font-size:12px;color:#000;content:'\25cf'}.mce-container-body .mce-resizehandle{position:absolute;right:0;bottom:0;width:16px;height:16px;visibility:visible;cursor:s-resize;margin:0}.mce-resizehandle-both{cursor:se-resize}i.mce-i-resize{color:#000}.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:#c5c5c5;border-right-color:#c5c5c5}.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-stack-layout-item{display:block}.mce-tabs{display:block;border-bottom:1px solid #ccc}.mce-tab{display:inline-block;*display:inline;*zoom:1;border:1px solid #ccc;border-width:1px 1px 0 0;background:#e3e3e3;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-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:normal;color:#000}.mce-textbox:focus{border-color:rgba(82,168,236,0.8);-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}.mce-placeholder .mce-textbox{color:#aaa}.mce-textbox.mce-multiline{padding:4px}.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}.mce-ico{font-family:'tinymce',Arial;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:#333}.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-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-checkbox:before,.mce-i-selected:before{content:"\e033"}.mce-i-selected{visibility:hidden}i.mce-i-backcolor{text-shadow:none;background:#BBB} \ No newline at end of file diff --git a/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.css b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.css new file mode 100644 index 00000000..3aecca72 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.css @@ -0,0 +1,589 @@ +/** + * 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 { + background-image: 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"); + background-size: 100%; + content: ''; + 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 { + background-image: 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: -9999999999px; + 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::before, +.tiny-pageembed--16by9::before, +.tiny-pageembed--4by3::before, +.tiny-pageembed--1by1::before { + content: ""; + display: block; +} +.tiny-pageembed--21by9::before { + padding-top: 42.857143%; +} +.tiny-pageembed--16by9::before { + padding-top: 56.25%; +} +.tiny-pageembed--4by3::before { + padding-top: 75%; +} +.tiny-pageembed--1by1::before { + 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 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-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; +} +.mce-match-marker { + background: #aaa; + color: #fff; +} +.mce-match-marker-selected { + background: #39f; + color: #fff; +} +.mce-content-body img[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] { + background-color: #b4d7ff !important; +} +.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] * { + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.mce-content-body img::-moz-selection { + background: none; +} +.mce-content-body img::selection { + background: none; +} +.ephox-snooker-resizer-bar { + background-color: #4099ff; + opacity: 0; +} +.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, +.mce-item-table td, +.mce-item-table th, +.mce-item-table 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/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.css b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.css new file mode 100644 index 00000000..30924b13 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.css @@ -0,0 +1,601 @@ +/** + * 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 { + background-image: 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"); + background-size: 100%; + content: ''; + 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 { + background-image: 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: -9999999999px; + 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::before, +.tiny-pageembed--16by9::before, +.tiny-pageembed--4by3::before, +.tiny-pageembed--1by1::before { + content: ""; + display: block; +} +.tiny-pageembed--21by9::before { + padding-top: 42.857143%; +} +.tiny-pageembed--16by9::before { + padding-top: 56.25%; +} +.tiny-pageembed--4by3::before { + padding-top: 75%; +} +.tiny-pageembed--1by1::before { + 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 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-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; +} +.mce-match-marker { + background: #aaa; + color: #fff; +} +.mce-match-marker-selected { + background: #39f; + color: #fff; +} +.mce-content-body img[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] { + background-color: #b4d7ff !important; +} +.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] * { + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.mce-content-body img::-moz-selection { + background: none; +} +.mce-content-body img::selection { + background: none; +} +.ephox-snooker-resizer-bar { + background-color: #b4d7ff; + opacity: 0; +} +.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, +.mce-item-table td, +.mce-item-table th, +.mce-item-table 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: '-'; +} diff --git a/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.min.css b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.min.css new file mode 100644 index 00000000..c9b65c91 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.min.css @@ -0,0 +1,8 @@ +/** + * 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{background-image: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");background-size:100%;content:'';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{background-image: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:-9999999999px;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--16by9::before,.tiny-pageembed--1by1::before,.tiny-pageembed--21by9::before,.tiny-pageembed--4by3::before{content:"";display:block}.tiny-pageembed--21by9::before{padding-top:42.857143%}.tiny-pageembed--16by9::before{padding-top:56.25%}.tiny-pageembed--4by3::before{padding-top:75%}.tiny-pageembed--1by1::before{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 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-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}.mce-match-marker{background:#aaa;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-content-body img[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: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]{background-color:#b4d7ff!important}.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] *{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.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}.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,.mce-item-table caption,.mce-item-table td,.mce-item-table 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/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.min.css.map b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.min.css.map new file mode 100644 index 00000000..812d14c8 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.inline.min.css.map @@ -0,0 +1 @@ +{"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,iBAAkB,gdAClB,gBAAiB,KACjB,QAAS,GACT,OAAQ,QACR,OAAQ,IACR,YAAa,OACb,WAAY,OACZ,SAAU,SACV,MAAO,IAET,6EACE,iBAAkB,shCAEpB,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,cACN,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,KAGT,+BAEA,8BAHA,+BAEA,8BAEE,QAAS,GACT,QAAS,MAEX,+BACE,YAAa,WAEf,+BACE,YAAa,OAEf,8BACE,YAAa,IAEf,8BACE,YAAa,KAGf,8BAEA,6BAHA,8BAEA,6BAEE,OAAQ,EACR,OAAQ,KACR,KAAM,EACN,SAAU,SACV,IAAK,EACL,MAAO,KAET,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,MAEX,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,kBACE,WAAY,KACZ,MAAO,KAET,2BACE,WAAY,KACZ,MAAO,KAET,yCACA,2CACE,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,iBAAkB,kBAEpB,wDACA,wDACE,WAAY,IAEd,mDACA,mDACE,WAAY,IAEd,0CACA,0CACE,sBAAuB,KACvB,oBAAqB,KAClB,iBAAkB,KACjB,gBAAiB,KACb,YAAa,KAEvB,sCACE,WAAY,IAEd,iCACE,WAAY,IAEd,2BACE,iBAAkB,QAClB,QAAS,EAEX,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,KAEnB,gBAGA,wBAFA,mBACA,mBAEE,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 background-image: 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 background-size: 100%;\n content: '';\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 background-image: 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: -9999999999px;\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::before,\n.tiny-pageembed--16by9::before,\n.tiny-pageembed--4by3::before,\n.tiny-pageembed--1by1::before {\n content: \"\";\n display: block;\n}\n.tiny-pageembed--21by9::before {\n padding-top: 42.857143%;\n}\n.tiny-pageembed--16by9::before {\n padding-top: 56.25%;\n}\n.tiny-pageembed--4by3::before {\n padding-top: 75%;\n}\n.tiny-pageembed--1by1::before {\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 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-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.mce-match-marker {\n background: #aaa;\n color: #fff;\n}\n.mce-match-marker-selected {\n background: #39f;\n color: #fff;\n}\n.mce-content-body img[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 background-color: #b4d7ff !important;\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 -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 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}\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}\n.mce-item-table,\n.mce-item-table td,\n.mce-item-table th,\n.mce-item-table 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/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.min.css b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.min.css new file mode 100644 index 00000000..688424c8 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.min.css @@ -0,0 +1,8 @@ +/** + * 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{background-image: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");background-size:100%;content:'';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{background-image: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:-9999999999px;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--16by9::before,.tiny-pageembed--1by1::before,.tiny-pageembed--21by9::before,.tiny-pageembed--4by3::before{content:"";display:block}.tiny-pageembed--21by9::before{padding-top:42.857143%}.tiny-pageembed--16by9::before{padding-top:56.25%}.tiny-pageembed--4by3::before{padding-top:75%}.tiny-pageembed--1by1::before{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 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-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}.mce-match-marker{background:#aaa;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-content-body img[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: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]{background-color:#b4d7ff!important}.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] *{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.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}.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,.mce-item-table caption,.mce-item-table td,.mce-item-table 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/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.min.css.map b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.min.css.map new file mode 100644 index 00000000..df30fe36 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.min.css.map @@ -0,0 +1 @@ +{"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,iBAAkB,gdAClB,gBAAiB,KACjB,QAAS,GACT,OAAQ,QACR,OAAQ,IACR,YAAa,OACb,WAAY,OACZ,SAAU,SACV,MAAO,IAET,6EACE,iBAAkB,shCAEpB,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,cACN,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,KAGT,+BAEA,8BAHA,+BAEA,8BAEE,QAAS,GACT,QAAS,MAEX,+BACE,YAAa,WAEf,+BACE,YAAa,OAEf,8BACE,YAAa,IAEf,8BACE,YAAa,KAGf,8BAEA,6BAHA,8BAEA,6BAEE,OAAQ,EACR,OAAQ,KACR,KAAM,EACN,SAAU,SACV,IAAK,EACL,MAAO,KAET,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,MAEX,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,kBACE,WAAY,KACZ,MAAO,KAET,2BACE,WAAY,KACZ,MAAO,KAET,yCACA,2CACE,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,iBAAkB,kBAEpB,wDACA,wDACE,WAAY,IAEd,mDACA,mDACE,WAAY,IAEd,0CACA,0CACE,sBAAuB,KACvB,oBAAqB,KAClB,iBAAkB,KACjB,gBAAiB,KACb,YAAa,KAEvB,sCACE,WAAY,IAEd,iCACE,WAAY,IAEd,2BACE,iBAAkB,QAClB,QAAS,EAEX,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,KAEnB,gBAGA,wBAFA,mBACA,mBAEE,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 background-image: 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 background-size: 100%;\n content: '';\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 background-image: 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: -9999999999px;\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::before,\n.tiny-pageembed--16by9::before,\n.tiny-pageembed--4by3::before,\n.tiny-pageembed--1by1::before {\n content: \"\";\n display: block;\n}\n.tiny-pageembed--21by9::before {\n padding-top: 42.857143%;\n}\n.tiny-pageembed--16by9::before {\n padding-top: 56.25%;\n}\n.tiny-pageembed--4by3::before {\n padding-top: 75%;\n}\n.tiny-pageembed--1by1::before {\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 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-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.mce-match-marker {\n background: #aaa;\n color: #fff;\n}\n.mce-match-marker-selected {\n background: #39f;\n color: #fff;\n}\n.mce-content-body img[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 background-color: #b4d7ff !important;\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 -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 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}\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}\n.mce-item-table,\n.mce-item-table td,\n.mce-item-table th,\n.mce-item-table 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/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.mobile.css b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.mobile.css new file mode 100644 index 00000000..4bdb8bab --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.mobile.css @@ -0,0 +1,29 @@ +/** + * 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/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.mobile.min.css b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.mobile.min.css new file mode 100644 index 00000000..627f6934 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.mobile.min.css @@ -0,0 +1,8 @@ +/** + * 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/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.mobile.min.css.map b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.mobile.min.css.map new file mode 100644 index 00000000..6d8e69f3 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/content.mobile.min.css.map @@ -0,0 +1 @@ +{"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/lib/tinymce/js/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff new file mode 100644 index 00000000..1e3be038 Binary files /dev/null and b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff differ diff --git a/lib/tinymce/js/tinymce/skins/ui/oxide-dark/skin.css b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/skin.css new file mode 100644 index 00000000..5c91f2ef --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/skin.css @@ -0,0 +1,2831 @@ +/** + * 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) { + 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) { + /* 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-bottom: 0; + 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 .accessibility-issue--info .accessibility-issue__description { + background-color: rgba(32, 122, 183, 0.5); + border-color: #207ab7; + color: #fff; +} +.tox .accessibility-issue--info .accessibility-issue__description > *:last-child { + border-color: #207ab7; +} +.tox .accessibility-issue--info h2 { + color: #fff; +} +.tox .accessibility-issue--info .tox-icon svg { + fill: #fff; +} +.tox .accessibility-issue--info a .tox-icon { + color: #fff; +} +.tox .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 .accessibility-issue--warn .accessibility-issue__description > *:last-child { + border-color: rgba(255, 165, 0, 0.8); +} +.tox .accessibility-issue--warn h2 { + color: #fff; +} +.tox .accessibility-issue--warn .tox-icon svg { + fill: #fff; +} +.tox .accessibility-issue--warn a .tox-icon { + color: #fff; +} +.tox .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 .accessibility-issue--error .accessibility-issue__description > *:last-child { + border-color: rgba(204, 0, 0, 0.8); +} +.tox .accessibility-issue--error h2 { + color: #fff; +} +.tox .accessibility-issue--error .tox-icon svg { + fill: #fff; +} +.tox .accessibility-issue--error a .tox-icon { + color: #fff; +} +.tox .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 .accessibility-issue--success .accessibility-issue__description > *:last-child { + border-color: rgba(120, 171, 70, 0.8); +} +.tox .accessibility-issue--success h2 { + color: #fff; +} +.tox .accessibility-issue--success .tox-icon svg { + fill: #fff; +} +.tox .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]) .accessibility-issue__header .tox-button { + margin-left: 4px; +} +.tox:not([dir=rtl]) .accessibility-issue__header > *:nth-last-child(2) { + margin-left: auto; +} +.tox:not([dir=rtl]) .accessibility-issue__description { + padding: 4px 4px 4px 8px; +} +.tox:not([dir=rtl]) .accessibility-issue__description > *:last-child { + border-left-width: 1px; + padding-left: 4px; +} +.tox[dir=rtl] .accessibility-issue__header .tox-button { + margin-right: 4px; +} +.tox[dir=rtl] .accessibility-issue__header > *:nth-last-child(2) { + margin-right: auto; +} +.tox[dir=rtl] .accessibility-issue__description { + padding: 4px 8px 4px 4px; +} +.tox[dir=rtl] .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: none; + background-repeat: none; + 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-weight: bold; + letter-spacing: 1; + 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: none; + background-repeat: none; + border-color: #3d546f; + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: none; + color: #fff; + 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: inherit; + color: contrast(inherit, #2A3746, #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 { + background-color: #4a5562; +} +.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--grid .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 { + align-items: center; + display: flex; + height: 24px; + justify-content: center; + width: 24px; +} +.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: 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: normal; +} +.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__item[role="menuitemcheckbox"]:not(.tox-collection__item--enabled) .tox-collection__item-checkmark svg { + 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: normal; +} +.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: normal; +} +@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 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 { + font-size: 20px; + font-weight: bold; + margin-bottom: 16px; + margin-top: 2rem; +} +.tox .tox-dialog__body-content .tox-form__group h2 { + font-size: 16px; + font-weight: bold; + margin-bottom: 16px; + margin-top: 2rem; +} +.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-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; +} +.tox .tox-color-input .tox-textfield { + border-radius: 3px 0 0 3px; + display: flex; +} +.tox .tox-color-input span { + border-color: rgba(42, 55, 70, 0.2); + border-radius: 0 3px 3px 0; + border-style: solid; + border-width: 1px 1px 1px 0; + box-shadow: none; + box-sizing: border-box; + cursor: pointer; + display: flex; + width: 35px; +} +.tox .tox-color-input span:focus { + border-color: #207ab7; +} +.tox[dir="rtl"] .tox-color-input .tox-textfield { + border-radius: 0 3px 3px 0; +} +.tox[dir="rtl"] .tox-color-input span { + border-radius: 3px 0 0 3px; + border-width: 1px 0 1px 1px; +} +.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: normal; + 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-selectfield 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; + 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-selectfield select:focus, +.tox .tox-textarea:focus { + 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-selectfield { + cursor: pointer; + position: relative; +} +.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 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-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: 169px; +} +.tox .tox-insert-table-picker > div { + border-color: #000000; + border-style: solid; + border-width: 0 1px 1px 0; + box-sizing: content-box; + height: 16px; + width: 16px; +} +.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; +} +/* Deprecated. Remove in next major release */ +.tox .tox-mbtn { + align-items: center; + background: none; + 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: normal; + width: auto; +} +.tox .tox-mbtn[disabled] { + background-color: none; + 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, +.tox .tox-statusbar__path-item:hover, +.tox .tox-statusbar__wordcount:hover, +.tox .tox-statusbar a:focus, +.tox .tox-statusbar__path-item:focus, +.tox .tox-statusbar__wordcount:focus { + 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: none; + 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: normal; + 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: none; + 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: none; + 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-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.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: normal; +} +.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/lib/tinymce/js/tinymce/skins/ui/oxide-dark/skin.min.css b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/skin.min.css new file mode 100644 index 00000000..00bfb54f --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/skin.min.css @@ -0,0 +1,8 @@ +/** + * 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){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){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-bottom:0;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 .accessibility-issue--info .accessibility-issue__description{background-color:rgba(32,122,183,.5);border-color:#207ab7;color:#fff}.tox .accessibility-issue--info .accessibility-issue__description>:last-child{border-color:#207ab7}.tox .accessibility-issue--info h2{color:#fff}.tox .accessibility-issue--info .tox-icon svg{fill:#fff}.tox .accessibility-issue--info a .tox-icon{color:#fff}.tox .accessibility-issue--warn .accessibility-issue__description{background-color:rgba(255,165,0,.5);border-color:rgba(255,165,0,.8);color:#fff}.tox .accessibility-issue--warn .accessibility-issue__description>:last-child{border-color:rgba(255,165,0,.8)}.tox .accessibility-issue--warn h2{color:#fff}.tox .accessibility-issue--warn .tox-icon svg{fill:#fff}.tox .accessibility-issue--warn a .tox-icon{color:#fff}.tox .accessibility-issue--error .accessibility-issue__description{background-color:rgba(204,0,0,.5);border-color:rgba(204,0,0,.8);color:#fff}.tox .accessibility-issue--error .accessibility-issue__description>:last-child{border-color:rgba(204,0,0,.8)}.tox .accessibility-issue--error h2{color:#fff}.tox .accessibility-issue--error .tox-icon svg{fill:#fff}.tox .accessibility-issue--error a .tox-icon{color:#fff}.tox .accessibility-issue--success .accessibility-issue__description{background-color:rgba(120,171,70,.5);border-color:rgba(120,171,70,.8);color:#fff}.tox .accessibility-issue--success .accessibility-issue__description>:last-child{border-color:rgba(120,171,70,.8)}.tox .accessibility-issue--success h2{color:#fff}.tox .accessibility-issue--success .tox-icon svg{fill:#fff}.tox .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]) .accessibility-issue__header .tox-button{margin-left:4px}.tox:not([dir=rtl]) .accessibility-issue__header>:nth-last-child(2){margin-left:auto}.tox:not([dir=rtl]) .accessibility-issue__description{padding:4px 4px 4px 8px}.tox:not([dir=rtl]) .accessibility-issue__description>:last-child{border-left-width:1px;padding-left:4px}.tox[dir=rtl] .accessibility-issue__header .tox-button{margin-right:4px}.tox[dir=rtl] .accessibility-issue__header>:nth-last-child(2){margin-right:auto}.tox[dir=rtl] .accessibility-issue__description{padding:4px 8px 4px 4px}.tox[dir=rtl] .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:none;background-repeat:none;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-weight:700;letter-spacing:1;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:none;background-repeat:none;border-color:#3d546f;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;color:#fff;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:inherit;color:contrast(inherit,#2a3746,#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{background-color:#4a5562}.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--grid .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-icon{align-items:center;display:flex;height:24px;justify-content:center;width:24px}.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:normal}.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__item[role=menuitemcheckbox]:not(.tox-collection__item--enabled) .tox-collection__item-checkmark svg{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:normal}.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:normal}@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 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{font-size:20px;font-weight:700;margin-bottom:16px;margin-top:2rem}.tox .tox-dialog__body-content .tox-form__group h2{font-size:16px;font-weight:700;margin-bottom:16px;margin-top:2rem}.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-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}.tox .tox-color-input .tox-textfield{border-radius:3px 0 0 3px;display:flex}.tox .tox-color-input span{border-color:rgba(42,55,70,.2);border-radius:0 3px 3px 0;border-style:solid;border-width:1px 1px 1px 0;box-shadow:none;box-sizing:border-box;cursor:pointer;display:flex;width:35px}.tox .tox-color-input span:focus{border-color:#207ab7}.tox[dir=rtl] .tox-color-input .tox-textfield{border-radius:0 3px 3px 0}.tox[dir=rtl] .tox-color-input span{border-radius:3px 0 0 3px;border-width:1px 0 1px 1px}.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:normal;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-selectfield 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;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-selectfield select:focus,.tox .tox-textarea:focus,.tox .tox-textfield:focus{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-selectfield{cursor:pointer;position:relative}.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 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-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:169px}.tox .tox-insert-table-picker>div{border-color:#000;border-style:solid;border-width:0 1px 1px 0;box-sizing:content-box;height:16px;width:16px}.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-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:normal;width:auto}.tox .tox-mbtn[disabled]{background-color:none;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,.tox .tox-statusbar a:hover,.tox .tox-statusbar__path-item:focus,.tox .tox-statusbar__path-item:hover,.tox .tox-statusbar__wordcount:focus,.tox .tox-statusbar__wordcount:hover{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:normal;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-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.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:normal}.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/lib/tinymce/js/tinymce/skins/ui/oxide-dark/skin.min.css.map b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/skin.min.css.map new file mode 100644 index 00000000..c241d05b --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/skin.min.css.map @@ -0,0 +1 @@ +{"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,eACE,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,eAEE,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,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,kEACE,iBAAkB,oBAClB,aAAc,QACd,MAAO,KAET,8EACE,aAAc,QAEhB,mCACE,MAAO,KAET,8CACE,KAAM,KAER,4CACE,MAAO,KAET,kEACE,iBAAkB,mBAClB,aAAc,mBACd,MAAO,KAET,8EACE,aAAc,mBAEhB,mCACE,MAAO,KAET,8CACE,KAAM,KAER,4CACE,MAAO,KAET,mEACE,iBAAkB,iBAClB,aAAc,iBACd,MAAO,KAET,+EACE,aAAc,iBAEhB,oCACE,MAAO,KAET,+CACE,KAAM,KAER,6CACE,MAAO,KAET,qEACE,iBAAkB,oBAClB,aAAc,oBACd,MAAO,KAET,iFACE,aAAc,oBAEhB,sCACE,MAAO,KAET,iDACE,KAAM,KAER,+CACE,MAAO,KAET,+DACA,qFACE,WAAY,EAEd,6DACE,YAAa,IAEf,oEACE,YAAa,KAEf,sDACE,QAAS,IAAI,IAAI,IAAI,IAEvB,kEACE,kBAAmB,IACnB,aAAc,IAEhB,uDACE,aAAc,IAEhB,8DACE,aAAc,KAEhB,gDACE,QAAS,IAAI,IAAI,IAAI,IAEvB,4DACE,mBAAoB,IACpB,cAAe,IAEjB,oBACE,QAAS,KACT,KAAM,EAAE,EAAE,KAEZ,cACE,QAAS,KACT,KAAM,EAAE,EAAE,KAEZ,iBACE,iBAAkB,QAClB,iBAAkB,KAClB,oBAAqB,KACrB,kBAAmB,KACnB,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,YAAa,IACb,eAAgB,EAChB,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,KACrB,kBAAmB,KACnB,aAAc,QACd,cAAe,IACf,aAAc,MACd,aAAc,IACd,WAAY,KACZ,MAAO,KACP,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,+BAET,yDACE,iBAAkB,QAEpB,6DACE,iBAAkB,QAClB,MAAO,KAET,4DACE,iBAAkB,QAEpB,0DACE,iBAAkB,QAClB,MAAO,KAET,yDACE,iBAAkB,QAEpB,oGACE,MAAO,KAET,uGACE,MAAO,KAET,oGACE,MAAO,KAET,2CACE,iBAAkB,YAClB,MAAO,qBACP,OAAQ,YAEV,gCACE,YAAa,OACb,QAAS,KACT,OAAQ,KACR,gBAAiB,OACjB,MAAO,KAET,oCACE,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,OAElB,iCACE,YAAa,OACb,QAAS,KACT,WAAY,KAEd,wCACE,QAAS,GACT,UAAW,EACX,WAAY,QAEd,qCACE,KAAM,KAER,0HACE,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,OAElB,uBACE,MAAO,KACP,QAAS,KACT,KAAM,EACN,wBAAyB,KACzB,UAAW,KACX,WAAY,OACZ,YAAa,IACb,YAAa,IACb,UAAW,EACX,WAAY,KACZ,eAAgB,OAElB,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,kCACE,QAAS,MACT,gBAAiB,KACjB,cAAe,KACf,mBAAoB,EACZ,kBAAmB,EAC3B,qBAAsB,EACd,oBAAqB,EAC7B,sBAAuB,OACf,qBAAsB,OAEhC,mDACE,UAAW,KACX,YAAa,IACb,cAAe,KACf,WAAY,KAEd,mDACE,UAAW,KACX,YAAa,IACb,cAAe,KACf,WAAY,KAEd,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,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,KAEX,qCACE,cAAe,IAAI,EAAE,EAAE,IACvB,QAAS,KAEX,2BACE,aAAc,kBACd,cAAe,EAAE,IAAI,IAAI,EACzB,aAAc,MACd,aAAc,IAAI,IAAI,IAAI,EAC1B,WAAY,KACZ,WAAY,WACZ,OAAQ,QACR,QAAS,KACT,MAAO,KAET,iCACE,aAAc,QAEhB,8CACE,cAAe,EAAE,IAAI,IAAI,EAE3B,oCACE,cAAe,IAAI,EAAE,EAAE,IACvB,aAAc,IAAI,EAAE,IAAI,IAE1B,gBACA,wBACE,MAAO,qBACP,QAAS,MACT,UAAW,KACX,WAAY,OACZ,YAAa,IACb,YAAa,IACb,QAAS,EAAE,IAAI,EAAE,EACjB,eAAgB,OAChB,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,6BACA,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,QAAS,EACT,QAAS,IAAI,OACb,OAAQ,KACR,MAAO,KAGT,6BADA,8BAEE,iBAAkB,QAClB,MAAO,sBACP,OAAQ,YAGV,mCACA,yBAFA,0BAGE,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,sBACE,OAAQ,QACR,SAAU,SAEZ,uCACE,iBAAkB,QAClB,MAAO,sBACP,OAAQ,YAEV,yCACE,QAAS,KAEX,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,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,YACZ,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,IAGnB,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,OAChB,MAAO,KAET,yBACE,iBAAkB,KAClB,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,4BAHA,4BAIA,qCAHA,qCAIA,qCAHA,qCAIE,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,OAChB,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,6BACE,UAAW,OACX,WAAY,KAEd,2BACE,aAAc,EAEhB,8BACE,iBAAkB,KAEpB,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,OAElB,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) {\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) {\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-bottom: 0;\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 .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 .accessibility-issue--info .accessibility-issue__description > *:last-child {\n border-color: #207ab7;\n}\n.tox .accessibility-issue--info h2 {\n color: #fff;\n}\n.tox .accessibility-issue--info .tox-icon svg {\n fill: #fff;\n}\n.tox .accessibility-issue--info a .tox-icon {\n color: #fff;\n}\n.tox .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 .accessibility-issue--warn .accessibility-issue__description > *:last-child {\n border-color: rgba(255, 165, 0, 0.8);\n}\n.tox .accessibility-issue--warn h2 {\n color: #fff;\n}\n.tox .accessibility-issue--warn .tox-icon svg {\n fill: #fff;\n}\n.tox .accessibility-issue--warn a .tox-icon {\n color: #fff;\n}\n.tox .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 .accessibility-issue--error .accessibility-issue__description > *:last-child {\n border-color: rgba(204, 0, 0, 0.8);\n}\n.tox .accessibility-issue--error h2 {\n color: #fff;\n}\n.tox .accessibility-issue--error .tox-icon svg {\n fill: #fff;\n}\n.tox .accessibility-issue--error a .tox-icon {\n color: #fff;\n}\n.tox .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 .accessibility-issue--success .accessibility-issue__description > *:last-child {\n border-color: rgba(120, 171, 70, 0.8);\n}\n.tox .accessibility-issue--success h2 {\n color: #fff;\n}\n.tox .accessibility-issue--success .tox-icon svg {\n fill: #fff;\n}\n.tox .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]) .accessibility-issue__header .tox-button {\n margin-left: 4px;\n}\n.tox:not([dir=rtl]) .accessibility-issue__header > *:nth-last-child(2) {\n margin-left: auto;\n}\n.tox:not([dir=rtl]) .accessibility-issue__description {\n padding: 4px 4px 4px 8px;\n}\n.tox:not([dir=rtl]) .accessibility-issue__description > *:last-child {\n border-left-width: 1px;\n padding-left: 4px;\n}\n.tox[dir=rtl] .accessibility-issue__header .tox-button {\n margin-right: 4px;\n}\n.tox[dir=rtl] .accessibility-issue__header > *:nth-last-child(2) {\n margin-right: auto;\n}\n.tox[dir=rtl] .accessibility-issue__description {\n padding: 4px 8px 4px 4px;\n}\n.tox[dir=rtl] .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: none;\n background-repeat: none;\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-weight: bold;\n letter-spacing: 1;\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: none;\n background-repeat: none;\n border-color: #3d546f;\n border-radius: 3px;\n border-style: solid;\n border-width: 1px;\n box-shadow: none;\n color: #fff;\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: inherit;\n color: contrast(inherit, #2A3746, #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 {\n background-color: #4a5562;\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--grid .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 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 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: normal;\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__item[role=\"menuitemcheckbox\"]:not(.tox-collection__item--enabled) .tox-collection__item-checkmark svg {\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: normal;\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: normal;\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 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 font-size: 20px;\n font-weight: bold;\n margin-bottom: 16px;\n margin-top: 2rem;\n}\n.tox .tox-dialog__body-content .tox-form__group h2 {\n font-size: 16px;\n font-weight: bold;\n margin-bottom: 16px;\n margin-top: 2rem;\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-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}\n.tox .tox-color-input .tox-textfield {\n border-radius: 3px 0 0 3px;\n display: flex;\n}\n.tox .tox-color-input span {\n border-color: rgba(42, 55, 70, 0.2);\n border-radius: 0 3px 3px 0;\n border-style: solid;\n border-width: 1px 1px 1px 0;\n box-shadow: none;\n box-sizing: border-box;\n cursor: pointer;\n display: flex;\n width: 35px;\n}\n.tox .tox-color-input span:focus {\n border-color: #207ab7;\n}\n.tox[dir=\"rtl\"] .tox-color-input .tox-textfield {\n border-radius: 0 3px 3px 0;\n}\n.tox[dir=\"rtl\"] .tox-color-input span {\n border-radius: 3px 0 0 3px;\n border-width: 1px 0 1px 1px;\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: normal;\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-selectfield 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 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-selectfield select:focus,\n.tox .tox-textarea:focus {\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-selectfield {\n cursor: pointer;\n position: relative;\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 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-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: 169px;\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: content-box;\n height: 16px;\n width: 16px;\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/* Deprecated. Remove in next major release */\n.tox .tox-mbtn {\n align-items: center;\n background: none;\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: normal;\n width: auto;\n}\n.tox .tox-mbtn[disabled] {\n background-color: none;\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,\n.tox .tox-statusbar__path-item:hover,\n.tox .tox-statusbar__wordcount:hover,\n.tox .tox-statusbar a:focus,\n.tox .tox-statusbar__path-item:focus,\n.tox .tox-statusbar__wordcount:focus {\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: none;\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: normal;\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: none;\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: none;\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-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.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: normal;\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/lib/tinymce/js/tinymce/skins/ui/oxide-dark/skin.mobile.css b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/skin.mobile.css new file mode 100644 index 00000000..875721a2 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/skin.mobile.css @@ -0,0 +1,673 @@ +/** + * 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/lib/tinymce/js/tinymce/skins/ui/oxide-dark/skin.mobile.min.css b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/skin.mobile.min.css new file mode 100644 index 00000000..15555127 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/skin.mobile.min.css @@ -0,0 +1,8 @@ +/** + * 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/lib/tinymce/js/tinymce/skins/ui/oxide-dark/skin.mobile.min.css.map b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/skin.mobile.min.css.map new file mode 100644 index 00000000..bd4e3c31 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide-dark/skin.mobile.min.css.map @@ -0,0 +1 @@ +{"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/lib/tinymce/js/tinymce/skins/ui/oxide/content.css b/lib/tinymce/js/tinymce/skins/ui/oxide/content.css new file mode 100644 index 00000000..00ffda1c --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide/content.css @@ -0,0 +1,607 @@ +/** + * 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 { + background-image: 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"); + background-size: 100%; + content: ''; + 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 { + background-image: 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: -9999999999px; + 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::before, +.tiny-pageembed--16by9::before, +.tiny-pageembed--4by3::before, +.tiny-pageembed--1by1::before { + content: ""; + display: block; +} +.tiny-pageembed--21by9::before { + padding-top: 42.857143%; +} +.tiny-pageembed--16by9::before { + padding-top: 56.25%; +} +.tiny-pageembed--4by3::before { + padding-top: 75%; +} +.tiny-pageembed--1by1::before { + 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 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-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; +} +.mce-match-marker { + background: #aaa; + color: #fff; +} +.mce-match-marker-selected { + background: #39f; + color: #fff; +} +.mce-content-body img[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] { + background-color: #b4d7ff !important; +} +.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] * { + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.mce-content-body img::-moz-selection { + background: none; +} +.mce-content-body img::selection { + background: none; +} +.ephox-snooker-resizer-bar { + background-color: #b4d7ff; + opacity: 0; +} +.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, +.mce-item-table td, +.mce-item-table th, +.mce-item-table 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/lib/tinymce/js/tinymce/skins/ui/oxide/content.inline.css b/lib/tinymce/js/tinymce/skins/ui/oxide/content.inline.css new file mode 100644 index 00000000..30924b13 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide/content.inline.css @@ -0,0 +1,601 @@ +/** + * 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 { + background-image: 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"); + background-size: 100%; + content: ''; + 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 { + background-image: 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: -9999999999px; + 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::before, +.tiny-pageembed--16by9::before, +.tiny-pageembed--4by3::before, +.tiny-pageembed--1by1::before { + content: ""; + display: block; +} +.tiny-pageembed--21by9::before { + padding-top: 42.857143%; +} +.tiny-pageembed--16by9::before { + padding-top: 56.25%; +} +.tiny-pageembed--4by3::before { + padding-top: 75%; +} +.tiny-pageembed--1by1::before { + 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 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-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; +} +.mce-match-marker { + background: #aaa; + color: #fff; +} +.mce-match-marker-selected { + background: #39f; + color: #fff; +} +.mce-content-body img[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] { + background-color: #b4d7ff !important; +} +.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] * { + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} +.mce-content-body img::-moz-selection { + background: none; +} +.mce-content-body img::selection { + background: none; +} +.ephox-snooker-resizer-bar { + background-color: #b4d7ff; + opacity: 0; +} +.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, +.mce-item-table td, +.mce-item-table th, +.mce-item-table 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: '-'; +} diff --git a/lib/tinymce/js/tinymce/skins/ui/oxide/content.inline.min.css b/lib/tinymce/js/tinymce/skins/ui/oxide/content.inline.min.css new file mode 100644 index 00000000..c9b65c91 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide/content.inline.min.css @@ -0,0 +1,8 @@ +/** + * 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{background-image: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");background-size:100%;content:'';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{background-image: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:-9999999999px;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--16by9::before,.tiny-pageembed--1by1::before,.tiny-pageembed--21by9::before,.tiny-pageembed--4by3::before{content:"";display:block}.tiny-pageembed--21by9::before{padding-top:42.857143%}.tiny-pageembed--16by9::before{padding-top:56.25%}.tiny-pageembed--4by3::before{padding-top:75%}.tiny-pageembed--1by1::before{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 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-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}.mce-match-marker{background:#aaa;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-content-body img[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: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]{background-color:#b4d7ff!important}.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] *{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.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}.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,.mce-item-table caption,.mce-item-table td,.mce-item-table 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/lib/tinymce/js/tinymce/skins/ui/oxide/content.inline.min.css.map b/lib/tinymce/js/tinymce/skins/ui/oxide/content.inline.min.css.map new file mode 100644 index 00000000..0e63096a --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide/content.inline.min.css.map @@ -0,0 +1 @@ +{"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,iBAAkB,gdAClB,gBAAiB,KACjB,QAAS,GACT,OAAQ,QACR,OAAQ,IACR,YAAa,OACb,WAAY,OACZ,SAAU,SACV,MAAO,IAET,6EACE,iBAAkB,shCAEpB,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,cACN,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,KAGT,+BAEA,8BAHA,+BAEA,8BAEE,QAAS,GACT,QAAS,MAEX,+BACE,YAAa,WAEf,+BACE,YAAa,OAEf,8BACE,YAAa,IAEf,8BACE,YAAa,KAGf,8BAEA,6BAHA,8BAEA,6BAEE,OAAQ,EACR,OAAQ,KACR,KAAM,EACN,SAAU,SACV,IAAK,EACL,MAAO,KAET,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,MAEX,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,kBACE,WAAY,KACZ,MAAO,KAET,2BACE,WAAY,KACZ,MAAO,KAET,yCACA,2CACE,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,iBAAkB,kBAEpB,wDACA,wDACE,WAAY,IAEd,mDACA,mDACE,WAAY,IAEd,0CACA,0CACE,sBAAuB,KACvB,oBAAqB,KAClB,iBAAkB,KACjB,gBAAiB,KACb,YAAa,KAEvB,sCACE,WAAY,IAEd,iCACE,WAAY,IAEd,2BACE,iBAAkB,QAClB,QAAS,EAEX,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,KAEnB,gBAGA,wBAFA,mBACA,mBAEE,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 background-image: 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 background-size: 100%;\n content: '';\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 background-image: 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: -9999999999px;\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::before,\n.tiny-pageembed--16by9::before,\n.tiny-pageembed--4by3::before,\n.tiny-pageembed--1by1::before {\n content: \"\";\n display: block;\n}\n.tiny-pageembed--21by9::before {\n padding-top: 42.857143%;\n}\n.tiny-pageembed--16by9::before {\n padding-top: 56.25%;\n}\n.tiny-pageembed--4by3::before {\n padding-top: 75%;\n}\n.tiny-pageembed--1by1::before {\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 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-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.mce-match-marker {\n background: #aaa;\n color: #fff;\n}\n.mce-match-marker-selected {\n background: #39f;\n color: #fff;\n}\n.mce-content-body img[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 background-color: #b4d7ff !important;\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 -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 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}\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}\n.mce-item-table,\n.mce-item-table td,\n.mce-item-table th,\n.mce-item-table 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/lib/tinymce/js/tinymce/skins/ui/oxide/content.min.css b/lib/tinymce/js/tinymce/skins/ui/oxide/content.min.css new file mode 100644 index 00000000..081f80d4 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide/content.min.css @@ -0,0 +1,8 @@ +/** + * 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{background-image: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");background-size:100%;content:'';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{background-image: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:-9999999999px;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--16by9::before,.tiny-pageembed--1by1::before,.tiny-pageembed--21by9::before,.tiny-pageembed--4by3::before{content:"";display:block}.tiny-pageembed--21by9::before{padding-top:42.857143%}.tiny-pageembed--16by9::before{padding-top:56.25%}.tiny-pageembed--4by3::before{padding-top:75%}.tiny-pageembed--1by1::before{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 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-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}.mce-match-marker{background:#aaa;color:#fff}.mce-match-marker-selected{background:#39f;color:#fff}.mce-content-body img[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: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]{background-color:#b4d7ff!important}.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] *{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.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}.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,.mce-item-table caption,.mce-item-table td,.mce-item-table 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/lib/tinymce/js/tinymce/skins/ui/oxide/content.min.css.map b/lib/tinymce/js/tinymce/skins/ui/oxide/content.min.css.map new file mode 100644 index 00000000..0842c6ac --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide/content.min.css.map @@ -0,0 +1 @@ +{"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,iBAAkB,gdAClB,gBAAiB,KACjB,QAAS,GACT,OAAQ,QACR,OAAQ,IACR,YAAa,OACb,WAAY,OACZ,SAAU,SACV,MAAO,IAET,6EACE,iBAAkB,shCAEpB,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,cACN,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,KAGT,+BAEA,8BAHA,+BAEA,8BAEE,QAAS,GACT,QAAS,MAEX,+BACE,YAAa,WAEf,+BACE,YAAa,OAEf,8BACE,YAAa,IAEf,8BACE,YAAa,KAGf,8BAEA,6BAHA,8BAEA,6BAEE,OAAQ,EACR,OAAQ,KACR,KAAM,EACN,SAAU,SACV,IAAK,EACL,MAAO,KAET,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,MAEX,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,kBACE,WAAY,KACZ,MAAO,KAET,2BACE,WAAY,KACZ,MAAO,KAET,yCACA,2CACE,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,iBAAkB,kBAEpB,wDACA,wDACE,WAAY,IAEd,mDACA,mDACE,WAAY,IAEd,0CACA,0CACE,sBAAuB,KACvB,oBAAqB,KAClB,iBAAkB,KACjB,gBAAiB,KACb,YAAa,KAEvB,sCACE,WAAY,IAEd,iCACE,WAAY,IAEd,2BACE,iBAAkB,QAClB,QAAS,EAEX,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,KAEnB,gBAGA,wBAFA,mBACA,mBAEE,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 background-image: 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 background-size: 100%;\n content: '';\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 background-image: 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: -9999999999px;\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::before,\n.tiny-pageembed--16by9::before,\n.tiny-pageembed--4by3::before,\n.tiny-pageembed--1by1::before {\n content: \"\";\n display: block;\n}\n.tiny-pageembed--21by9::before {\n padding-top: 42.857143%;\n}\n.tiny-pageembed--16by9::before {\n padding-top: 56.25%;\n}\n.tiny-pageembed--4by3::before {\n padding-top: 75%;\n}\n.tiny-pageembed--1by1::before {\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 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-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.mce-match-marker {\n background: #aaa;\n color: #fff;\n}\n.mce-match-marker-selected {\n background: #39f;\n color: #fff;\n}\n.mce-content-body img[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 background-color: #b4d7ff !important;\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 -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 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}\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}\n.mce-item-table,\n.mce-item-table td,\n.mce-item-table th,\n.mce-item-table 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/lib/tinymce/js/tinymce/skins/ui/oxide/content.mobile.css b/lib/tinymce/js/tinymce/skins/ui/oxide/content.mobile.css new file mode 100644 index 00000000..4bdb8bab --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide/content.mobile.css @@ -0,0 +1,29 @@ +/** + * 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/lib/tinymce/js/tinymce/skins/ui/oxide/content.mobile.min.css b/lib/tinymce/js/tinymce/skins/ui/oxide/content.mobile.min.css new file mode 100644 index 00000000..627f6934 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide/content.mobile.min.css @@ -0,0 +1,8 @@ +/** + * 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/lib/tinymce/js/tinymce/skins/ui/oxide/content.mobile.min.css.map b/lib/tinymce/js/tinymce/skins/ui/oxide/content.mobile.min.css.map new file mode 100644 index 00000000..2a1b98a7 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide/content.mobile.min.css.map @@ -0,0 +1 @@ +{"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/lib/tinymce/js/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff b/lib/tinymce/js/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff new file mode 100644 index 00000000..1e3be038 Binary files /dev/null and b/lib/tinymce/js/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff differ diff --git a/lib/tinymce/js/tinymce/skins/ui/oxide/skin.css b/lib/tinymce/js/tinymce/skins/ui/oxide/skin.css new file mode 100644 index 00000000..6e205c85 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide/skin.css @@ -0,0 +1,2831 @@ +/** + * 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: #222f3e; + 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) { + 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) { + /* 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 #cccccc; + 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 #cccccc; + border-bottom: 0; + 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 #cccccc; + 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: #cccccc; + border-style: solid; +} +.tox .accessibility-issue__repair { + margin-top: 16px; +} +.tox .accessibility-issue--info .accessibility-issue__description { + background-color: rgba(32, 122, 183, 0.1); + border-color: rgba(32, 122, 183, 0.4); + color: #222f3e; +} +.tox .accessibility-issue--info .accessibility-issue__description > *:last-child { + border-color: rgba(32, 122, 183, 0.4); +} +.tox .accessibility-issue--info h2 { + color: #207ab7; +} +.tox .accessibility-issue--info .tox-icon svg { + fill: #207ab7; +} +.tox .accessibility-issue--info a .tox-icon { + color: #207ab7; +} +.tox .accessibility-issue--warn .accessibility-issue__description { + background-color: rgba(255, 165, 0, 0.1); + border-color: rgba(255, 165, 0, 0.5); + color: #222f3e; +} +.tox .accessibility-issue--warn .accessibility-issue__description > *:last-child { + border-color: rgba(255, 165, 0, 0.5); +} +.tox .accessibility-issue--warn h2 { + color: #cc8500; +} +.tox .accessibility-issue--warn .tox-icon svg { + fill: #cc8500; +} +.tox .accessibility-issue--warn a .tox-icon { + color: #cc8500; +} +.tox .accessibility-issue--error .accessibility-issue__description { + background-color: rgba(204, 0, 0, 0.1); + border-color: rgba(204, 0, 0, 0.4); + color: #222f3e; +} +.tox .accessibility-issue--error .accessibility-issue__description > *:last-child { + border-color: rgba(204, 0, 0, 0.4); +} +.tox .accessibility-issue--error h2 { + color: #c00; +} +.tox .accessibility-issue--error .tox-icon svg { + fill: #c00; +} +.tox .accessibility-issue--error a .tox-icon { + color: #c00; +} +.tox .accessibility-issue--success .accessibility-issue__description { + background-color: rgba(120, 171, 70, 0.1); + border-color: rgba(120, 171, 70, 0.4); + color: #222f3e; +} +.tox .accessibility-issue--success .accessibility-issue__description > *:last-child { + border-color: rgba(120, 171, 70, 0.4); +} +.tox .accessibility-issue--success h2 { + color: #78AB46; +} +.tox .accessibility-issue--success .tox-icon svg { + fill: #78AB46; +} +.tox .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]) .accessibility-issue__header .tox-button { + margin-left: 4px; +} +.tox:not([dir=rtl]) .accessibility-issue__header > *:nth-last-child(2) { + margin-left: auto; +} +.tox:not([dir=rtl]) .accessibility-issue__description { + padding: 4px 4px 4px 8px; +} +.tox:not([dir=rtl]) .accessibility-issue__description > *:last-child { + border-left-width: 1px; + padding-left: 4px; +} +.tox[dir=rtl] .accessibility-issue__header .tox-button { + margin-right: 4px; +} +.tox[dir=rtl] .accessibility-issue__header > *:nth-last-child(2) { + margin-right: auto; +} +.tox[dir=rtl] .accessibility-issue__description { + padding: 4px 8px 4px 4px; +} +.tox[dir=rtl] .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: none; + background-repeat: none; + 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-weight: bold; + letter-spacing: 1; + 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: #f0f0f0; + background-image: none; + background-position: none; + background-repeat: none; + border-color: #f0f0f0; + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: none; + color: #222f3e; + outline: none; + 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, 0.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: 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: #222f3e; +} +.tox .tox-button--naked[disabled] { + background-color: #f0f0f0; + border-color: #f0f0f0; + box-shadow: none; + color: rgba(34, 47, 62, 0.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 { + /* 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(34, 47, 62, 0.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, 0.5); + cursor: not-allowed; +} +.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__checked svg { + fill: rgba(34, 47, 62, 0.5); +} +.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__unchecked svg { + fill: rgba(34, 47, 62, 0.5); +} +.tox .tox-checkbox--disabled .tox-checkbox__icons .tox-checkbox-icon__indeterminate svg { + fill: rgba(34, 47, 62, 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: #cccccc; + 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, 0.7); + 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: #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: inherit; + color: contrast(inherit, #222f3e, #fff); +} +.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 { + background-color: #dee0e2; +} +.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--grid .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 { + align-items: center; + display: flex; + height: 24px; + justify-content: center; + width: 24px; +} +.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: normal; + line-height: 24px; + text-transform: none; + word-break: break-all; +} +.tox .tox-collection__item-accessory { + color: rgba(34, 47, 62, 0.7); + display: inline-block; + font-size: 14px; + height: 24px; + line-height: 24px; + text-transform: normal; +} +.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[role="menuitemcheckbox"]:not(.tox-collection__item--enabled) .tox-collection__item-checkmark svg { + display: none; +} +.tox .tox-collection--horizontal { + background-color: #fff; + border: 1px solid #cccccc; + 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 #cccccc; +} +.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 #cccccc; +} +.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: #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 #cccccc; + border-radius: 3px; + box-shadow: 0 4px 8px 0 rgba(34, 47, 62, 0.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, 0.7); + font-size: 12px; +} +.tox .tox-comment__body { + color: #222f3e; + 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(34, 47, 62, 0.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: 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(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: 0.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: 0.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, 0.7); +} +.tox .tox-user__name { + color: rgba(34, 47, 62, 0.7); + 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(255, 255, 255, 0.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: #cccccc; + border-radius: 3px; + border-style: solid; + border-width: 1px; + box-shadow: 0 16px 16px -10px rgba(34, 47, 62, 0.15), 0 0 40px 1px rgba(34, 47, 62, 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: #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: normal; + line-height: 1.3; + margin: 0; + text-transform: normal; +} +.tox .tox-dialog__body { + color: #222f3e; + 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: normal; +} +@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, 0.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, 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 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 { + font-size: 20px; + font-weight: bold; + margin-bottom: 16px; + margin-top: 2rem; +} +.tox .tox-dialog__body-content .tox-form__group h2 { + font-size: 16px; + font-weight: bold; + margin-bottom: 16px; + margin-top: 2rem; +} +.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 #cccccc; + 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(255, 255, 255, 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 #cccccc; +} +.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 #cccccc; + 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, 0.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 #cccccc; +} +.tox .tox-editor-container { + display: flex; + flex: 1 1 auto; + flex-direction: column; + overflow: hidden; +} +.tox .tox-editor-header { + z-index: 1; +} +.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; +} +.tox .tox-color-input .tox-textfield { + border-radius: 3px 0 0 3px; + display: flex; +} +.tox .tox-color-input span { + border-color: rgba(34, 47, 62, 0.2); + border-radius: 0 3px 3px 0; + border-style: solid; + border-width: 1px 1px 1px 0; + box-shadow: none; + box-sizing: border-box; + cursor: pointer; + display: flex; + width: 35px; +} +.tox .tox-color-input span:focus { + border-color: #207ab7; +} +.tox[dir="rtl"] .tox-color-input .tox-textfield { + border-radius: 0 3px 3px 0; +} +.tox[dir="rtl"] .tox-color-input span { + border-radius: 3px 0 0 3px; + border-width: 1px 0 1px 1px; +} +.tox .tox-label, +.tox .tox-toolbar-label { + color: rgba(34, 47, 62, 0.7); + display: block; + font-size: 14px; + font-style: normal; + font-weight: normal; + line-height: 1.3; + padding: 0 8px 0 0; + text-transform: normal; + 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-selectfield select, +.tox .tox-textarea { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background-color: #fff; + border-color: #cccccc; + 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; + outline: none; + padding: 5px 4.75px; + resize: none; + width: 100%; +} +.tox .tox-textfield[disabled], +.tox .tox-textarea[disabled] { + background-color: #f2f2f2; + color: rgba(34, 47, 62, 0.85); + cursor: not-allowed; +} +.tox .tox-textfield:focus, +.tox .tox-selectfield select:focus, +.tox .tox-textarea:focus { + 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: #222f3e; +} +.tox:not([dir=rtl]) .tox-toolbar-textfield + * { + margin-left: 4px; +} +.tox[dir=rtl] .tox-toolbar-textfield + * { + margin-right: 4px; +} +.tox .tox-selectfield { + cursor: pointer; + position: relative; +} +.tox .tox-selectfield select[disabled] { + background-color: #f2f2f2; + color: rgba(34, 47, 62, 0.85); + cursor: not-allowed; +} +.tox .tox-selectfield select::-ms-expand { + display: 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-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: 169px; +} +.tox .tox-insert-table-picker > div { + border-color: #cccccc; + border-style: solid; + border-width: 0 1px 1px 0; + box-sizing: content-box; + height: 16px; + width: 16px; +} +.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: rgba(34, 47, 62, 0.7); + 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: #fff; + border: 1px solid #cccccc; + border-radius: 3px; + box-shadow: 0 4px 8px 0 rgba(34, 47, 62, 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='%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; +} +/* Deprecated. Remove in next major release */ +.tox .tox-mbtn { + align-items: center; + background: none; + border: 0; + border-radius: 3px; + box-shadow: none; + color: #222f3e; + 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: normal; + width: auto; +} +.tox .tox-mbtn[disabled] { + background-color: none; + border: 0; + box-shadow: none; + color: rgba(34, 47, 62, 0.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: 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: #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 0.1s ease; +} +.tox .tox-pop--resizing .tox-toolbar { + flex-wrap: nowrap; +} +.tox .tox-pop__dialog { + background-color: #fff; + border: 1px solid #cccccc; + 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: #fff transparent transparent transparent; + border-width: 8px; + margin-left: -8px; + margin-top: -1px; +} +.tox .tox-pop.tox-pop--bottom::before { + border-color: #cccccc 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 #fff transparent; + border-width: 8px; + margin-left: -8px; + margin-top: 1px; +} +.tox .tox-pop.tox-pop--top::before { + border-color: transparent transparent #cccccc 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 #fff transparent transparent; + border-width: 8px; + margin-left: -15px; +} +.tox .tox-pop.tox-pop--left::before { + border-color: transparent #cccccc 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 #fff; + border-width: 8px; + margin-left: -1px; +} +.tox .tox-pop.tox-pop--right::before { + border-color: transparent transparent transparent #cccccc; + 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: #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 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 #cccccc; + 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, 0.7); + 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: #fff; + border-top: 1px solid #cccccc; + color: rgba(34, 47, 62, 0.7); + 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: rgba(34, 47, 62, 0.7); + text-decoration: none; +} +.tox .tox-statusbar a:hover, +.tox .tox-statusbar__path-item:hover, +.tox .tox-statusbar__wordcount:hover, +.tox .tox-statusbar a:focus, +.tox .tox-statusbar__path-item:focus, +.tox .tox-statusbar__wordcount:focus { + 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, 0.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, 0.6); + bottom: 0; + display: flex; + justify-content: center; + left: 0; + position: absolute; + right: 0; + top: 0; +} +.tox .tox-tbtn { + align-items: center; + background: none; + border: 0; + border-radius: 3px; + box-shadow: none; + color: #222f3e; + 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: normal; + 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: none; + border: 0; + box-shadow: none; + color: rgba(34, 47, 62, 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(34, 47, 62, 0.5); +} +.tox .tox-tbtn--enabled, +.tox .tox-tbtn--enabled:hover { + background: #c8cbcf; + border: 0; + box-shadow: none; + color: #222f3e; +} +.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: #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: 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(34, 47, 62, 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 #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, 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: none; + box-shadow: none; + color: rgba(34, 47, 62, 0.5); +} +.tox .tox-toolbar-overlord { + background-color: #fff; +} +.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; + 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-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.tox-tinymce-aux .tox-toolbar__overflow { + background-color: #fff; + border: 1px solid #cccccc; + 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 #cccccc; +} +.tox[dir=rtl] .tox-toolbar__group:not(:last-of-type) { + border-left: 1px solid #cccccc; +} +.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, 0.3); + color: rgba(255, 255, 255, 0.75); + font-size: 14px; + font-style: normal; + font-weight: normal; + padding: 4px 8px; + text-transform: normal; +} +.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 #cccccc; + 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 #cccccc; + 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/lib/tinymce/js/tinymce/skins/ui/oxide/skin.min.css b/lib/tinymce/js/tinymce/skins/ui/oxide/skin.min.css new file mode 100644 index 00000000..45a5dc3b --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide/skin.min.css @@ -0,0 +1,8 @@ +/** + * 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:#222f3e;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){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){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 #ccc;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 #ccc;border-bottom:0;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 #ccc;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:#ccc;border-style:solid}.tox .accessibility-issue__repair{margin-top:16px}.tox .accessibility-issue--info .accessibility-issue__description{background-color:rgba(32,122,183,.1);border-color:rgba(32,122,183,.4);color:#222f3e}.tox .accessibility-issue--info .accessibility-issue__description>:last-child{border-color:rgba(32,122,183,.4)}.tox .accessibility-issue--info h2{color:#207ab7}.tox .accessibility-issue--info .tox-icon svg{fill:#207ab7}.tox .accessibility-issue--info a .tox-icon{color:#207ab7}.tox .accessibility-issue--warn .accessibility-issue__description{background-color:rgba(255,165,0,.1);border-color:rgba(255,165,0,.5);color:#222f3e}.tox .accessibility-issue--warn .accessibility-issue__description>:last-child{border-color:rgba(255,165,0,.5)}.tox .accessibility-issue--warn h2{color:#cc8500}.tox .accessibility-issue--warn .tox-icon svg{fill:#cc8500}.tox .accessibility-issue--warn a .tox-icon{color:#cc8500}.tox .accessibility-issue--error .accessibility-issue__description{background-color:rgba(204,0,0,.1);border-color:rgba(204,0,0,.4);color:#222f3e}.tox .accessibility-issue--error .accessibility-issue__description>:last-child{border-color:rgba(204,0,0,.4)}.tox .accessibility-issue--error h2{color:#c00}.tox .accessibility-issue--error .tox-icon svg{fill:#c00}.tox .accessibility-issue--error a .tox-icon{color:#c00}.tox .accessibility-issue--success .accessibility-issue__description{background-color:rgba(120,171,70,.1);border-color:rgba(120,171,70,.4);color:#222f3e}.tox .accessibility-issue--success .accessibility-issue__description>:last-child{border-color:rgba(120,171,70,.4)}.tox .accessibility-issue--success h2{color:#78ab46}.tox .accessibility-issue--success .tox-icon svg{fill:#78ab46}.tox .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]) .accessibility-issue__header .tox-button{margin-left:4px}.tox:not([dir=rtl]) .accessibility-issue__header>:nth-last-child(2){margin-left:auto}.tox:not([dir=rtl]) .accessibility-issue__description{padding:4px 4px 4px 8px}.tox:not([dir=rtl]) .accessibility-issue__description>:last-child{border-left-width:1px;padding-left:4px}.tox[dir=rtl] .accessibility-issue__header .tox-button{margin-right:4px}.tox[dir=rtl] .accessibility-issue__header>:nth-last-child(2){margin-right:auto}.tox[dir=rtl] .accessibility-issue__description{padding:4px 8px 4px 4px}.tox[dir=rtl] .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:none;background-repeat:none;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-weight:700;letter-spacing:1;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:none;background-repeat:none;border-color:#f0f0f0;border-radius:3px;border-style:solid;border-width:1px;box-shadow:none;color:#222f3e;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:inherit;color:contrast(inherit,#222f3e,#fff)}.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{background-color:#dee0e2}.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--grid .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-icon{align-items:center;display:flex;height:24px;justify-content:center;width:24px}.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:normal}.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[role=menuitemcheckbox]:not(.tox-collection__item--enabled) .tox-collection__item-checkmark svg{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:normal}.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:normal}@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 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{font-size:20px;font-weight:700;margin-bottom:16px;margin-top:2rem}.tox .tox-dialog__body-content .tox-form__group h2{font-size:16px;font-weight:700;margin-bottom:16px;margin-top:2rem}.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-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}.tox .tox-color-input .tox-textfield{border-radius:3px 0 0 3px;display:flex}.tox .tox-color-input span{border-color:rgba(34,47,62,.2);border-radius:0 3px 3px 0;border-style:solid;border-width:1px 1px 1px 0;box-shadow:none;box-sizing:border-box;cursor:pointer;display:flex;width:35px}.tox .tox-color-input span:focus{border-color:#207ab7}.tox[dir=rtl] .tox-color-input .tox-textfield{border-radius:0 3px 3px 0}.tox[dir=rtl] .tox-color-input span{border-radius:3px 0 0 3px;border-width:1px 0 1px 1px}.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:normal;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-selectfield 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;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-selectfield select:focus,.tox .tox-textarea:focus,.tox .tox-textfield:focus{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-selectfield{cursor:pointer;position:relative}.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 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-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:169px}.tox .tox-insert-table-picker>div{border-color:#ccc;border-style:solid;border-width:0 1px 1px 0;box-sizing:content-box;height:16px;width:16px}.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-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:normal;width:auto}.tox .tox-mbtn[disabled]{background-color:none;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,.tox .tox-statusbar a:hover,.tox .tox-statusbar__path-item:focus,.tox .tox-statusbar__path-item:hover,.tox .tox-statusbar__wordcount:focus,.tox .tox-statusbar__wordcount:hover{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:normal;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-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.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:normal}.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/lib/tinymce/js/tinymce/skins/ui/oxide/skin.min.css.map b/lib/tinymce/js/tinymce/skins/ui/oxide/skin.min.css.map new file mode 100644 index 00000000..833b4627 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide/skin.min.css.map @@ -0,0 +1 @@ +{"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,eACE,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,eAEE,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,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,kEACE,iBAAkB,oBAClB,aAAc,oBACd,MAAO,QAET,8EACE,aAAc,oBAEhB,mCACE,MAAO,QAET,8CACE,KAAM,QAER,4CACE,MAAO,QAET,kEACE,iBAAkB,mBAClB,aAAc,mBACd,MAAO,QAET,8EACE,aAAc,mBAEhB,mCACE,MAAO,QAET,8CACE,KAAM,QAER,4CACE,MAAO,QAET,mEACE,iBAAkB,iBAClB,aAAc,iBACd,MAAO,QAET,+EACE,aAAc,iBAEhB,oCACE,MAAO,KAET,+CACE,KAAM,KAER,6CACE,MAAO,KAET,qEACE,iBAAkB,oBAClB,aAAc,oBACd,MAAO,QAET,iFACE,aAAc,oBAEhB,sCACE,MAAO,QAET,iDACE,KAAM,QAER,+CACE,MAAO,QAET,+DACA,qFACE,WAAY,EAEd,6DACE,YAAa,IAEf,oEACE,YAAa,KAEf,sDACE,QAAS,IAAI,IAAI,IAAI,IAEvB,kEACE,kBAAmB,IACnB,aAAc,IAEhB,uDACE,aAAc,IAEhB,8DACE,aAAc,KAEhB,gDACE,QAAS,IAAI,IAAI,IAAI,IAEvB,4DACE,mBAAoB,IACpB,cAAe,IAEjB,oBACE,QAAS,KACT,KAAM,EAAE,EAAE,KAEZ,cACE,QAAS,KACT,KAAM,EAAE,EAAE,KAEZ,iBACE,iBAAkB,QAClB,iBAAkB,KAClB,oBAAqB,KACrB,kBAAmB,KACnB,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,YAAa,IACb,eAAgB,EAChB,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,KACrB,kBAAmB,KACnB,aAAc,QACd,cAAe,IACf,aAAc,MACd,aAAc,IACd,WAAY,KACZ,MAAO,QACP,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,QAClB,MAAO,+BAET,yDACE,iBAAkB,QAEpB,6DACE,iBAAkB,QAClB,MAAO,QAET,4DACE,iBAAkB,QAEpB,0DACE,iBAAkB,QAClB,MAAO,QAET,yDACE,iBAAkB,QAEpB,oGACE,MAAO,QAET,uGACE,MAAO,QAET,oGACE,MAAO,QAET,2CACE,iBAAkB,YAClB,MAAO,kBACP,OAAQ,YAEV,gCACE,YAAa,OACb,QAAS,KACT,OAAQ,KACR,gBAAiB,OACjB,MAAO,KAET,oCACE,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,OAElB,iCACE,YAAa,OACb,QAAS,KACT,WAAY,KAEd,wCACE,QAAS,GACT,UAAW,EACX,WAAY,QAEd,qCACE,KAAM,QAER,0HACE,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,OAElB,uBACE,MAAO,QACP,QAAS,KACT,KAAM,EACN,wBAAyB,KACzB,UAAW,KACX,WAAY,OACZ,YAAa,IACb,YAAa,IACb,UAAW,EACX,WAAY,KACZ,eAAgB,OAElB,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,kCACE,QAAS,MACT,gBAAiB,KACjB,cAAe,KACf,mBAAoB,EACZ,kBAAmB,EAC3B,qBAAsB,EACd,oBAAqB,EAC7B,sBAAuB,OACf,qBAAsB,OAEhC,mDACE,UAAW,KACX,YAAa,IACb,cAAe,KACf,WAAY,KAEd,mDACE,UAAW,KACX,YAAa,IACb,cAAe,KACf,WAAY,KAEd,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,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,KAEX,qCACE,cAAe,IAAI,EAAE,EAAE,IACvB,QAAS,KAEX,2BACE,aAAc,kBACd,cAAe,EAAE,IAAI,IAAI,EACzB,aAAc,MACd,aAAc,IAAI,IAAI,IAAI,EAC1B,WAAY,KACZ,WAAY,WACZ,OAAQ,QACR,QAAS,KACT,MAAO,KAET,iCACE,aAAc,QAEhB,8CACE,cAAe,EAAE,IAAI,IAAI,EAE3B,oCACE,cAAe,IAAI,EAAE,EAAE,IACvB,aAAc,IAAI,EAAE,IAAI,IAE1B,gBACA,wBACE,MAAO,kBACP,QAAS,MACT,UAAW,KACX,WAAY,OACZ,YAAa,IACb,YAAa,IACb,QAAS,EAAE,IAAI,EAAE,EACjB,eAAgB,OAChB,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,6BACA,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,QAAS,EACT,QAAS,IAAI,OACb,OAAQ,KACR,MAAO,KAGT,6BADA,8BAEE,iBAAkB,QAClB,MAAO,mBACP,OAAQ,YAGV,mCACA,yBAFA,0BAGE,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,sBACE,OAAQ,QACR,SAAU,SAEZ,uCACE,iBAAkB,QAClB,MAAO,mBACP,OAAQ,YAEV,yCACE,QAAS,KAEX,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,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,YACZ,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,IAGnB,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,OAChB,MAAO,KAET,yBACE,iBAAkB,KAClB,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,4BAHA,4BAIA,qCAHA,qCAIA,qCAHA,qCAIE,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,OAChB,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,6BACE,UAAW,OACX,WAAY,KAEd,2BACE,aAAc,EAEhB,8BACE,iBAAkB,KAEpB,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,OAElB,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) {\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) {\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-bottom: 0;\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 .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 .accessibility-issue--info .accessibility-issue__description > *:last-child {\n border-color: rgba(32, 122, 183, 0.4);\n}\n.tox .accessibility-issue--info h2 {\n color: #207ab7;\n}\n.tox .accessibility-issue--info .tox-icon svg {\n fill: #207ab7;\n}\n.tox .accessibility-issue--info a .tox-icon {\n color: #207ab7;\n}\n.tox .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 .accessibility-issue--warn .accessibility-issue__description > *:last-child {\n border-color: rgba(255, 165, 0, 0.5);\n}\n.tox .accessibility-issue--warn h2 {\n color: #cc8500;\n}\n.tox .accessibility-issue--warn .tox-icon svg {\n fill: #cc8500;\n}\n.tox .accessibility-issue--warn a .tox-icon {\n color: #cc8500;\n}\n.tox .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 .accessibility-issue--error .accessibility-issue__description > *:last-child {\n border-color: rgba(204, 0, 0, 0.4);\n}\n.tox .accessibility-issue--error h2 {\n color: #c00;\n}\n.tox .accessibility-issue--error .tox-icon svg {\n fill: #c00;\n}\n.tox .accessibility-issue--error a .tox-icon {\n color: #c00;\n}\n.tox .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 .accessibility-issue--success .accessibility-issue__description > *:last-child {\n border-color: rgba(120, 171, 70, 0.4);\n}\n.tox .accessibility-issue--success h2 {\n color: #78AB46;\n}\n.tox .accessibility-issue--success .tox-icon svg {\n fill: #78AB46;\n}\n.tox .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]) .accessibility-issue__header .tox-button {\n margin-left: 4px;\n}\n.tox:not([dir=rtl]) .accessibility-issue__header > *:nth-last-child(2) {\n margin-left: auto;\n}\n.tox:not([dir=rtl]) .accessibility-issue__description {\n padding: 4px 4px 4px 8px;\n}\n.tox:not([dir=rtl]) .accessibility-issue__description > *:last-child {\n border-left-width: 1px;\n padding-left: 4px;\n}\n.tox[dir=rtl] .accessibility-issue__header .tox-button {\n margin-right: 4px;\n}\n.tox[dir=rtl] .accessibility-issue__header > *:nth-last-child(2) {\n margin-right: auto;\n}\n.tox[dir=rtl] .accessibility-issue__description {\n padding: 4px 8px 4px 4px;\n}\n.tox[dir=rtl] .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: none;\n background-repeat: none;\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-weight: bold;\n letter-spacing: 1;\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: none;\n background-repeat: none;\n border-color: #f0f0f0;\n border-radius: 3px;\n border-style: solid;\n border-width: 1px;\n box-shadow: none;\n color: #222f3e;\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: inherit;\n color: contrast(inherit, #222f3e, #fff);\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 {\n background-color: #dee0e2;\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--grid .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 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 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: normal;\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__item[role=\"menuitemcheckbox\"]:not(.tox-collection__item--enabled) .tox-collection__item-checkmark svg {\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: normal;\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: normal;\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 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 font-size: 20px;\n font-weight: bold;\n margin-bottom: 16px;\n margin-top: 2rem;\n}\n.tox .tox-dialog__body-content .tox-form__group h2 {\n font-size: 16px;\n font-weight: bold;\n margin-bottom: 16px;\n margin-top: 2rem;\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-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}\n.tox .tox-color-input .tox-textfield {\n border-radius: 3px 0 0 3px;\n display: flex;\n}\n.tox .tox-color-input span {\n border-color: rgba(34, 47, 62, 0.2);\n border-radius: 0 3px 3px 0;\n border-style: solid;\n border-width: 1px 1px 1px 0;\n box-shadow: none;\n box-sizing: border-box;\n cursor: pointer;\n display: flex;\n width: 35px;\n}\n.tox .tox-color-input span:focus {\n border-color: #207ab7;\n}\n.tox[dir=\"rtl\"] .tox-color-input .tox-textfield {\n border-radius: 0 3px 3px 0;\n}\n.tox[dir=\"rtl\"] .tox-color-input span {\n border-radius: 3px 0 0 3px;\n border-width: 1px 0 1px 1px;\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: normal;\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-selectfield 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 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-selectfield select:focus,\n.tox .tox-textarea:focus {\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-selectfield {\n cursor: pointer;\n position: relative;\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 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-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: 169px;\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: content-box;\n height: 16px;\n width: 16px;\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/* Deprecated. Remove in next major release */\n.tox .tox-mbtn {\n align-items: center;\n background: none;\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: normal;\n width: auto;\n}\n.tox .tox-mbtn[disabled] {\n background-color: none;\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,\n.tox .tox-statusbar__path-item:hover,\n.tox .tox-statusbar__wordcount:hover,\n.tox .tox-statusbar a:focus,\n.tox .tox-statusbar__path-item:focus,\n.tox .tox-statusbar__wordcount:focus {\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: none;\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: normal;\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: none;\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: none;\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-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.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: normal;\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/lib/tinymce/js/tinymce/skins/ui/oxide/skin.mobile.css b/lib/tinymce/js/tinymce/skins/ui/oxide/skin.mobile.css new file mode 100644 index 00000000..875721a2 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide/skin.mobile.css @@ -0,0 +1,673 @@ +/** + * 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/lib/tinymce/js/tinymce/skins/ui/oxide/skin.mobile.min.css b/lib/tinymce/js/tinymce/skins/ui/oxide/skin.mobile.min.css new file mode 100644 index 00000000..15555127 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide/skin.mobile.min.css @@ -0,0 +1,8 @@ +/** + * 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/lib/tinymce/js/tinymce/skins/ui/oxide/skin.mobile.min.css.map b/lib/tinymce/js/tinymce/skins/ui/oxide/skin.mobile.min.css.map new file mode 100644 index 00000000..ed893bc5 --- /dev/null +++ b/lib/tinymce/js/tinymce/skins/ui/oxide/skin.mobile.min.css.map @@ -0,0 +1 @@ +{"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/lib/tinymce/js/tinymce/themes/mobile/theme.js b/lib/tinymce/js/tinymce/themes/mobile/theme.js new file mode 100644 index 00000000..1b1cbded --- /dev/null +++ b/lib/tinymce/js/tinymce/themes/mobile/theme.js @@ -0,0 +1,14008 @@ +/** + * 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.1.6 (2020-01-28) + */ +(function (domGlobals) { + 'use strict'; + + 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 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 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 () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return !f.apply(null, args); + }; + }; + var die = function (msg) { + return function () { + throw new Error(msg); + }; + }; + var apply = function (f) { + return f(); + }; + 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()') + }; + if (Object.freeze) { + Object.freeze(me); + } + 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 Option = { + some: some, + none: none, + from: from + }; + + var keys = Object.keys; + var hasOwnProperty = Object.hasOwnProperty; + var each = 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 = function (obj, f) { + return tupleMap(obj, function (x, i) { + return { + k: i, + v: f(x, i) + }; + }); + }; + var tupleMap = function (obj, f) { + var r = {}; + each(obj, function (x, i) { + var tuple = f(x, i); + r[tuple.k] = tuple.v; + }); + return r; + }; + var mapToArray = function (obj, f) { + var r = []; + each(obj, function (value, name) { + r.push(f(value, name)); + }); + return r; + }; + var find = function (obj, pred) { + var props = keys(obj); + for (var k = 0, len = props.length; k < len; k++) { + var i = props[k]; + var x = obj[i]; + if (pred(x, i, obj)) { + return Option.some(x); + } + } + return Option.none(); + }; + var values = function (obj) { + return mapToArray(obj, function (v) { + return v; + }); + }; + var has = function (obj, key) { + return hasOwnProperty.call(obj, key); + }; + + var Cell = function (initial) { + var value = initial; + var get = function () { + return value; + }; + var set = function (v) { + value = v; + }; + var clone = function () { + return Cell(get()); + }; + return { + get: get, + set: set, + clone: clone + }; + }; + + 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 edge = 'Edge'; + var chrome = 'Chrome'; + var ie = 'IE'; + var opera = 'Opera'; + var firefox = 'Firefox'; + var safari = 'Safari'; + var isBrowser = function (name, current) { + return function () { + return current === name; + }; + }; + 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; + return { + current: current, + version: version, + isEdge: isBrowser(edge, current), + isChrome: isBrowser(chrome, current), + isIE: isBrowser(ie, current), + isOpera: isBrowser(opera, current), + isFirefox: isBrowser(firefox, current), + isSafari: isBrowser(safari, current) + }; + }; + 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 isOS = function (name, current) { + return function () { + return current === name; + }; + }; + 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; + return { + current: current, + version: version, + isWindows: isOS(windows, current), + isiOS: isOS(ios, current), + isAndroid: isOS(android, current), + isOSX: isOS(osx, current), + isLinux: isOS(linux, current), + isSolaris: isOS(solaris, current), + isFreeBSD: isOS(freebsd, current), + isChromeOS: isOS(chromeos, current) + }; + }; + 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 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 typeOf = function (x) { + if (x === null) { + return 'null'; + } + 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 isType = function (type) { + return function (value) { + return typeOf(value) === type; + }; + }; + var isString = isType('string'); + var isObject = isType('object'); + var isArray = isType('array'); + var isBoolean = isType('boolean'); + var isFunction = isType('function'); + var isNumber = isType('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 map$1 = 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$1 = 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 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$1(xs, function (x) { + acc = f(acc, x); + }); + return acc; + }; + var find$2 = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Option.some(x); + } + } + return Option.none(); + }; + var findIndex = function (xs, pred) { + for (var i = 0, len = xs.length; i < len; i++) { + var x = xs[i]; + if (pred(x, i)) { + return Option.some(i); + } + } + return Option.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) { + var output = map$1(xs, f); + return flatten(output); + }; + 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 pure = function (x) { + return [x]; + }; + var from$1 = isFunction(Array.from) ? Array.from : function (x) { + return nativeSlice.call(x); + }; + + var detect$1 = function (candidates, userAgent) { + var agent = String(userAgent).toLowerCase(); + return find$2(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) { + if (substr === '') { + return true; + } + if (str.length < substr.length) { + return false; + } + var x = str.substr(start, start + substr.length); + return x === substr; + }; + var supplant = function (str, obj) { + var isStringOrNumber = function (a) { + var t = typeof a; + return t === 'string' || t === 'number'; + }; + return str.replace(/\$\{([^{}]*)\}/g, function (fullMatch, key) { + var value = obj[key]; + return isStringOrNumber(value) ? value.toString() : fullMatch; + }); + }; + var contains$1 = function (str, substr) { + return str.indexOf(substr) !== -1; + }; + var endsWith = function (str, suffix) { + return checkRange(str, suffix, str.length - suffix.length); + }; + var trim = function (str) { + return str.replace(/^\s+|\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 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 domGlobals.window.matchMedia(query).matches; + }; + var platform = Cell(PlatformDetection.detect(domGlobals.navigator.userAgent, mediaMatch)); + var detect$3 = function () { + return platform.get(); + }; + + var touchstart = constant('touchstart'); + var touchmove = constant('touchmove'); + var touchend = constant('touchend'); + var mousedown = constant('mousedown'); + var mousemove = constant('mousemove'); + var mouseup = constant('mouseup'); + var mouseover = constant('mouseover'); + var keydown = constant('keydown'); + var keyup = constant('keyup'); + var input = constant('input'); + var change = constant('change'); + var click = constant('click'); + var transitionend = constant('transitionend'); + var selectstart = constant('selectstart'); + + var alloy = { tap: constant('alloy.tap') }; + var focus = constant('alloy.focus'); + var postBlur = constant('alloy.blur.post'); + var postPaste = constant('alloy.paste.post'); + var receive = constant('alloy.receive'); + var execute = constant('alloy.execute'); + var focusItem = constant('alloy.focus.item'); + var tap = alloy.tap; + var longpress = constant('alloy.longpress'); + var systemInit = constant('alloy.system.init'); + var attachedToDom = constant('alloy.system.attached'); + var detachedFromDom = constant('alloy.system.detached'); + var focusShifted = constant('alloy.focusmanager.shifted'); + var highlight = constant('alloy.highlight'); + var dehighlight = constant('alloy.dehighlight'); + + var emit = function (component, event) { + dispatchWith(component, component.element(), event, {}); + }; + var emitWith = function (component, event, properties) { + dispatchWith(component, component.element(), event, properties); + }; + var emitExecute = function (component) { + emit(component, execute()); + }; + var dispatch = function (component, target, event) { + dispatchWith(component, target, event, {}); + }; + var dispatchWith = function (component, target, event, properties) { + var data = __assign({ target: target }, properties); + component.getSystem().triggerEvent(event, target, map(data, constant)); + }; + var dispatchEvent = function (component, target, event, simulatedEvent) { + component.getSystem().triggerEvent(event, target, simulatedEvent.event()); + }; + var dispatchFocus = function (component, target) { + component.getSystem().triggerFocus(target, component.element()); + }; + + 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 fromHtml = function (html, scope) { + var doc = scope || domGlobals.document; + var div = doc.createElement('div'); + div.innerHTML = html; + if (!div.hasChildNodes() || div.childNodes.length > 1) { + domGlobals.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 || domGlobals.document; + var node = doc.createElement(tag); + return fromDom(node); + }; + var fromText = function (text, scope) { + var doc = scope || domGlobals.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: constant(node) }; + }; + var fromPoint = function (docElm, x, y) { + var doc = docElm.dom(); + return Option.from(doc.elementFromPoint(x, y)).map(fromDom); + }; + var Element = { + fromHtml: fromHtml, + fromTag: fromTag, + fromText: fromText, + fromDom: fromDom, + fromPoint: fromPoint + }; + + var ATTRIBUTE = domGlobals.Node.ATTRIBUTE_NODE; + var CDATA_SECTION = domGlobals.Node.CDATA_SECTION_NODE; + var COMMENT = domGlobals.Node.COMMENT_NODE; + var DOCUMENT = domGlobals.Node.DOCUMENT_NODE; + var DOCUMENT_TYPE = domGlobals.Node.DOCUMENT_TYPE_NODE; + var DOCUMENT_FRAGMENT = domGlobals.Node.DOCUMENT_FRAGMENT_NODE; + var ELEMENT = domGlobals.Node.ELEMENT_NODE; + var TEXT = domGlobals.Node.TEXT_NODE; + var PROCESSING_INSTRUCTION = domGlobals.Node.PROCESSING_INSTRUCTION_NODE; + var ENTITY_REFERENCE = domGlobals.Node.ENTITY_REFERENCE_NODE; + var ENTITY = domGlobals.Node.ENTITY_NODE; + var NOTATION = domGlobals.Node.NOTATION_NODE; + + var Global = typeof domGlobals.window !== 'undefined' ? domGlobals.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 isText = isType$1(TEXT); + + var inBody = function (element) { + var dom = isText(element) ? element.dom().parentNode : element.dom(); + return dom !== undefined && dom !== null && dom.ownerDocument.body.contains(dom); + }; + var body = cached(function () { + return getBody(Element.fromDom(domGlobals.document)); + }); + var getBody = function (doc) { + var b = doc.dom().body; + if (b === null || b === undefined) { + throw new Error('Body is not available yet'); + } + return Element.fromDom(b); + }; + + var Immutable = function () { + var fields = []; + for (var _i = 0; _i < arguments.length; _i++) { + fields[_i] = arguments[_i]; + } + return function () { + var values = []; + for (var _i = 0; _i < arguments.length; _i++) { + values[_i] = arguments[_i]; + } + if (fields.length !== values.length) { + throw new Error('Wrong number of arguments to struct. Expected "[' + fields.length + ']", got ' + values.length + ' arguments'); + } + var struct = {}; + each$1(fields, function (name, i) { + struct[name] = constant(values[i]); + }); + return struct; + }; + }; + + 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$1(array, function (a) { + if (!isString(a)) { + throw new Error('The value ' + a + ' in the ' + label + ' fields was not a string.'); + } + }); + }; + var checkDupes = function (everything) { + var sorted = sort(everything); + var dupe = find$2(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 MixedBag = function (required, optional) { + var everything = required.concat(optional); + if (everything.length === 0) { + throw new Error('You must specify at least one required or optional field.'); + } + validateStrArr('required', required); + validateStrArr('optional', optional); + checkDupes(everything); + 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); + } + var unsupported = filter(keys$1, function (key) { + return !contains(everything, key); + }); + if (unsupported.length > 0) { + unsuppMessage(unsupported); + } + var r = {}; + each$1(required, function (req) { + r[req] = constant(obj[req]); + }); + each$1(optional, function (opt) { + r[opt] = constant(Object.prototype.hasOwnProperty.call(obj, opt) ? Option.some(obj[opt]) : Option.none()); + }); + return r; + }; + }; + + var compareDocumentPosition = function (a, b, match) { + return (a.compareDocumentPosition(b) & match) !== 0; + }; + var documentPositionPreceding = function (a, b) { + return compareDocumentPosition(a, b, domGlobals.Node.DOCUMENT_POSITION_PRECEDING); + }; + var documentPositionContainedBy = function (a, b) { + return compareDocumentPosition(a, b, domGlobals.Node.DOCUMENT_POSITION_CONTAINED_BY); + }; + var Node = { + documentPositionPreceding: documentPositionPreceding, + documentPositionContainedBy: documentPositionContainedBy + }; + + var ELEMENT$1 = ELEMENT; + var DOCUMENT$1 = DOCUMENT; + var is = function (element, selector) { + var dom = element.dom(); + if (dom.nodeType !== ELEMENT$1) { + 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$1 && dom.nodeType !== DOCUMENT$1 || dom.childElementCount === 0; + }; + var all = function (selector, scope) { + var base = scope === undefined ? domGlobals.document : scope.dom(); + return bypassSelector(base) ? [] : map$1(base.querySelectorAll(selector), Element.fromDom); + }; + var one = function (selector, scope) { + var base = scope === undefined ? domGlobals.document : scope.dom(); + return bypassSelector(base) ? Option.none() : Option.from(base.querySelector(selector)).map(Element.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 Node.documentPositionContainedBy(e1.dom(), e2.dom()); + }; + var browser = detect$3().browser; + var contains$2 = browser.isIE() ? ieContains : regularContains; + + var owner = function (element) { + return Element.fromDom(element.dom().ownerDocument); + }; + var defaultView = function (element) { + return Element.fromDom(element.dom().ownerDocument.defaultView); + }; + var parent = function (element) { + return Option.from(element.dom().parentNode).map(Element.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 = Element.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 nextSibling = function (element) { + return Option.from(element.dom().nextSibling).map(Element.fromDom); + }; + var children = function (element) { + return map$1(element.dom().childNodes, Element.fromDom); + }; + var child = function (element, index) { + var cs = element.dom().childNodes; + return Option.from(cs[index]).map(Element.fromDom); + }; + var firstChild = function (element) { + return child(element, 0); + }; + var spot = Immutable('element', 'offset'); + + 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 appendAt = function (parent, element, index) { + child(parent, index).fold(function () { + append(parent, element); + }, function (v) { + before(v, element); + }); + }; + + var append$1 = function (parent, elements) { + each$1(elements, function (x) { + append(parent, x); + }); + }; + + var empty = function (element) { + element.dom().textContent = ''; + each$1(children(element), function (rogue) { + remove(rogue); + }); + }; + var remove = function (element) { + var dom = element.dom(); + if (dom.parentNode !== null) { + dom.parentNode.removeChild(dom); + } + }; + + var fireDetaching = function (component) { + emit(component, detachedFromDom()); + var children = component.components(); + each$1(children, fireDetaching); + }; + var fireAttaching = function (component) { + var children = component.components(); + each$1(children, fireAttaching); + emit(component, attachedToDom()); + }; + var attach = function (parent, child) { + append(parent.element(), child.element()); + }; + var detachChildren = function (component) { + each$1(component.components(), function (childComp) { + return remove(childComp.element()); + }); + empty(component.element()); + component.syncComponents(); + }; + var replaceChildren = function (component, newChildren) { + var subs = component.components(); + detachChildren(component); + var deleted = difference(subs, newChildren); + each$1(deleted, function (comp) { + fireDetaching(comp); + component.getSystem().removeFromWorld(comp); + }); + each$1(newChildren, function (childComp) { + if (!childComp.getSystem().isConnected()) { + component.getSystem().addToWorld(childComp); + attach(component, childComp); + if (inBody(component.element())) { + fireAttaching(childComp); + } + } else { + attach(component, childComp); + } + component.syncComponents(); + }); + }; + + var attach$1 = function (parent, child) { + attachWith(parent, child, append); + }; + var attachWith = function (parent, child, insertion) { + parent.getSystem().addToWorld(child); + insertion(parent.element(), child.element()); + if (inBody(parent.element())) { + fireAttaching(child); + } + parent.syncComponents(); + }; + var doDetach = function (component) { + fireDetaching(component); + remove(component.element()); + component.getSystem().removeFromWorld(component); + }; + var detach = function (component) { + var parent$1 = parent(component.element()).bind(function (p) { + return component.getSystem().getByDom(p).toOption(); + }); + doDetach(component); + parent$1.each(function (p) { + p.syncComponents(); + }); + }; + var attachSystemAfter = function (element, guiSystem) { + attachSystemWith(element, guiSystem, after); + }; + var attachSystemWith = function (element, guiSystem, inserter) { + inserter(element, guiSystem.element()); + var children$1 = children(guiSystem.element()); + each$1(children$1, function (child) { + guiSystem.getByDom(child).each(fireAttaching); + }); + }; + var detachSystem = function (guiSystem) { + var children$1 = children(guiSystem.element()); + each$1(children$1, function (child) { + guiSystem.getByDom(child).each(fireDetaching); + }); + remove(guiSystem.element()); + }; + + 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 toOption = function () { + return Option.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, + toOption: toOption + }; + }; + 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, + toOption: Option.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$1(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) { + domGlobals.console.log(label, { + constructors: constructors, + constructor: key, + params: args + }); + } + }; + }; + }); + return adt; + }; + var Adt = { generate: generate }; + + var hasOwnProperty$1 = Object.prototype.hasOwnProperty; + var shallow = function (old, nu) { + return nu; + }; + 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$1.call(curObject, key)) { + ret[key] = merger(ret[key], curObject[key]); + } + } + } + return ret; + }; + }; + var deepMerge = baseMerge(deep); + var merge = baseMerge(shallow); + + var adt = Adt.generate([ + { strict: [] }, + { defaultedThunk: ['fallbackThunk'] }, + { asOption: [] }, + { asDefaultedOptionThunk: ['fallbackThunk'] }, + { mergeWithThunk: ['baseThunk'] } + ]); + var defaulted = function (fallback) { + return adt.defaultedThunk(constant(fallback)); + }; + var mergeWith = function (base) { + return adt.mergeWithThunk(constant(base)); + }; + var strict = adt.strict; + var asOption = adt.asOption; + var defaultedThunk = adt.defaultedThunk; + var mergeWithThunk = adt.mergeWithThunk; + + var exclude = function (obj, fields) { + var r = {}; + each(obj, function (v, k) { + if (!contains(fields, k)) { + r[k] = v; + } + }); + return r; + }; + + var readOpt = function (key) { + return function (obj) { + return has(obj, key) ? Option.from(obj[key]) : Option.none(); + }; + }; + var readOr = function (key, fallback) { + return function (obj) { + return has(obj, key) ? obj[key] : fallback; + }; + }; + var readOptFrom = function (obj, key) { + return readOpt(key)(obj); + }; + var hasKey = function (obj, key) { + return has(obj, key) && obj[key] !== undefined && obj[key] !== null; + }; + + var wrap = function (key, value) { + var r = {}; + r[key] = value; + return r; + }; + var wrapAll = function (keyvalues) { + var r = {}; + each$1(keyvalues, function (kv) { + r[kv.key] = kv.value; + }); + return r; + }; + + var comparison = Adt.generate([ + { + bothErrors: [ + 'error1', + 'error2' + ] + }, + { + firstError: [ + 'error1', + 'value2' + ] + }, + { + secondError: [ + 'value1', + 'error2' + ] + }, + { + bothValues: [ + 'value1', + 'value2' + ] + } + ]); + var partition = function (results) { + var errors = []; + var values = []; + each$1(results, function (result) { + result.fold(function (err) { + errors.push(err); + }, function (value) { + values.push(value); + }); + }); + return { + errors: errors, + values: values + }; + }; + + var exclude$1 = function (obj, fields) { + return exclude(obj, fields); + }; + var readOpt$1 = function (key) { + return readOpt(key); + }; + var readOr$1 = function (key, fallback) { + return readOr(key, fallback); + }; + var readOptFrom$1 = function (obj, key) { + return readOptFrom(obj, key); + }; + var wrap$1 = function (key, value) { + return wrap(key, value); + }; + var wrapAll$1 = function (keyvalues) { + return wrapAll(keyvalues); + }; + var mergeValues = function (values, base) { + return values.length === 0 ? Result.value(base) : Result.value(deepMerge(base, merge.apply(undefined, values))); + }; + var mergeErrors = function (errors) { + return Result.error(flatten(errors)); + }; + var consolidate = function (objs, base) { + var partitions = partition(objs); + return partitions.errors.length > 0 ? mergeErrors(partitions.errors) : mergeValues(partitions.values, base); + }; + var hasKey$1 = function (obj, key) { + return hasKey(obj, key); + }; + + var SimpleResultType; + (function (SimpleResultType) { + SimpleResultType[SimpleResultType['Error'] = 0] = 'Error'; + SimpleResultType[SimpleResultType['Value'] = 1] = 'Value'; + }(SimpleResultType || (SimpleResultType = {}))); + var fold = function (res, onError, onValue) { + return res.stype === SimpleResultType.Error ? onError(res.serror) : onValue(res.svalue); + }; + var partition$1 = function (results) { + var values = []; + var errors = []; + each$1(results, function (obj) { + fold(obj, function (err) { + return errors.push(err); + }, function (val) { + return values.push(val); + }); + }); + return { + values: values, + errors: errors + }; + }; + var mapError = function (res, f) { + if (res.stype === SimpleResultType.Error) { + return { + stype: SimpleResultType.Error, + serror: f(res.serror) + }; + } else { + return res; + } + }; + var map$2 = function (res, f) { + if (res.stype === SimpleResultType.Value) { + return { + stype: SimpleResultType.Value, + svalue: f(res.svalue) + }; + } else { + return res; + } + }; + var bind$1 = function (res, f) { + if (res.stype === SimpleResultType.Value) { + return f(res.svalue); + } else { + return res; + } + }; + var bindError = function (res, f) { + if (res.stype === SimpleResultType.Error) { + return f(res.serror); + } else { + return res; + } + }; + var svalue = function (v) { + return { + stype: SimpleResultType.Value, + svalue: v + }; + }; + var serror = function (e) { + return { + stype: SimpleResultType.Error, + serror: e + }; + }; + var toResult = function (res) { + return fold(res, Result.error, Result.value); + }; + var fromResult = function (res) { + return res.fold(serror, svalue); + }; + var SimpleResult = { + fromResult: fromResult, + toResult: toResult, + svalue: svalue, + partition: partition$1, + serror: serror, + bind: bind$1, + bindError: bindError, + map: map$2, + mapError: mapError, + fold: fold + }; + + var mergeValues$1 = function (values, base) { + return values.length > 0 ? SimpleResult.svalue(deepMerge(base, merge.apply(undefined, values))) : SimpleResult.svalue(base); + }; + var mergeErrors$1 = function (errors) { + return compose(SimpleResult.serror, flatten)(errors); + }; + var consolidateObj = function (objects, base) { + var partition = SimpleResult.partition(objects); + return partition.errors.length > 0 ? mergeErrors$1(partition.errors) : mergeValues$1(partition.values, base); + }; + var consolidateArr = function (objects) { + var partitions = SimpleResult.partition(objects); + return partitions.errors.length > 0 ? mergeErrors$1(partitions.errors) : SimpleResult.svalue(partitions.values); + }; + var ResultCombine = { + consolidateObj: consolidateObj, + consolidateArr: consolidateArr + }; + + var typeAdt = Adt.generate([ + { + setOf: [ + 'validator', + 'valueType' + ] + }, + { arrOf: ['valueType'] }, + { objOf: ['fields'] }, + { itemOf: ['validator'] }, + { + choiceOf: [ + 'key', + 'branches' + ] + }, + { thunk: ['description'] }, + { + func: [ + 'args', + 'outputSchema' + ] + } + ]); + var fieldAdt = Adt.generate([ + { + field: [ + 'name', + 'presence', + 'type' + ] + }, + { state: ['name'] } + ]); + + var formatObj = function (input) { + return isObject(input) && keys(input).length > 100 ? ' removed due to size' : JSON.stringify(input, null, 2); + }; + var formatErrors = function (errors) { + var es = errors.length > 10 ? errors.slice(0, 10).concat([{ + path: [], + getErrorInfo: function () { + return '... (only showing first ten failures)'; + } + }]) : errors; + return map$1(es, function (e) { + return 'Failed path: (' + e.path.join(' > ') + ')\n' + e.getErrorInfo(); + }); + }; + + var nu$3 = function (path, getErrorInfo) { + return SimpleResult.serror([{ + path: path, + getErrorInfo: getErrorInfo + }]); + }; + var missingStrict = function (path, key, obj) { + return nu$3(path, function () { + return 'Could not find valid *strict* value for "' + key + '" in ' + formatObj(obj); + }); + }; + var missingKey = function (path, key) { + return nu$3(path, function () { + return 'Choice schema did not contain choice key: "' + key + '"'; + }); + }; + var missingBranch = function (path, branches, branch) { + return nu$3(path, function () { + return 'The chosen schema: "' + branch + '" did not exist in branches: ' + formatObj(branches); + }); + }; + var unsupportedFields = function (path, unsupported) { + return nu$3(path, function () { + return 'There are unsupported fields: [' + unsupported.join(', ') + '] specified'; + }); + }; + var custom = function (path, err) { + return nu$3(path, function () { + return err; + }); + }; + + var adt$1 = Adt.generate([ + { + field: [ + 'key', + 'okey', + 'presence', + 'prop' + ] + }, + { + state: [ + 'okey', + 'instantiator' + ] + } + ]); + var strictAccess = function (path, obj, key) { + return readOptFrom(obj, key).fold(function () { + return missingStrict(path, key, obj); + }, SimpleResult.svalue); + }; + var fallbackAccess = function (obj, key, fallbackThunk) { + var v = readOptFrom(obj, key).fold(function () { + return fallbackThunk(obj); + }, identity); + return SimpleResult.svalue(v); + }; + var optionAccess = function (obj, key) { + return SimpleResult.svalue(readOptFrom(obj, key)); + }; + var optionDefaultedAccess = function (obj, key, fallback) { + var opt = readOptFrom(obj, key).map(function (val) { + return val === true ? fallback(obj) : val; + }); + return SimpleResult.svalue(opt); + }; + var cExtractOne = function (path, obj, field, strength) { + return field.fold(function (key, okey, presence, prop) { + var bundle = function (av) { + var result = prop.extract(path.concat([key]), strength, av); + return SimpleResult.map(result, function (res) { + return wrap(okey, strength(res)); + }); + }; + var bundleAsOption = function (optValue) { + return optValue.fold(function () { + var outcome = wrap(okey, strength(Option.none())); + return SimpleResult.svalue(outcome); + }, function (ov) { + var result = prop.extract(path.concat([key]), strength, ov); + return SimpleResult.map(result, function (res) { + return wrap(okey, strength(Option.some(res))); + }); + }); + }; + return function () { + return presence.fold(function () { + return SimpleResult.bind(strictAccess(path, obj, key), bundle); + }, function (fallbackThunk) { + return SimpleResult.bind(fallbackAccess(obj, key, fallbackThunk), bundle); + }, function () { + return SimpleResult.bind(optionAccess(obj, key), bundleAsOption); + }, function (fallbackThunk) { + return SimpleResult.bind(optionDefaultedAccess(obj, key, fallbackThunk), bundleAsOption); + }, function (baseThunk) { + var base = baseThunk(obj); + var result = SimpleResult.map(fallbackAccess(obj, key, constant({})), function (v) { + return deepMerge(base, v); + }); + return SimpleResult.bind(result, bundle); + }); + }(); + }, function (okey, instantiator) { + var state = instantiator(obj); + return SimpleResult.svalue(wrap(okey, strength(state))); + }); + }; + var cExtract = function (path, obj, fields, strength) { + var results = map$1(fields, function (field) { + return cExtractOne(path, obj, field, strength); + }); + return ResultCombine.consolidateObj(results, {}); + }; + var value$1 = function (validator) { + var extract = function (path, strength, val) { + return SimpleResult.bindError(validator(val, strength), function (err) { + return custom(path, err); + }); + }; + var toString = function () { + return 'val'; + }; + var toDsl = function () { + return typeAdt.itemOf(validator); + }; + return { + extract: extract, + toString: toString, + toDsl: toDsl + }; + }; + var getSetKeys = function (obj) { + var keys$1 = keys(obj); + return filter(keys$1, function (k) { + return hasKey$1(obj, k); + }); + }; + var objOfOnly = function (fields) { + var delegate = objOf(fields); + var fieldNames = foldr(fields, function (acc, f) { + return f.fold(function (key) { + return deepMerge(acc, wrap$1(key, true)); + }, constant(acc)); + }, {}); + var extract = function (path, strength, o) { + var keys = isBoolean(o) ? [] : getSetKeys(o); + var extra = filter(keys, function (k) { + return !hasKey$1(fieldNames, k); + }); + return extra.length === 0 ? delegate.extract(path, strength, o) : unsupportedFields(path, extra); + }; + return { + extract: extract, + toString: delegate.toString, + toDsl: delegate.toDsl + }; + }; + var objOf = function (fields) { + var extract = function (path, strength, o) { + return cExtract(path, o, fields, strength); + }; + var toString = function () { + var fieldStrings = map$1(fields, function (field) { + return field.fold(function (key, okey, presence, prop) { + return key + ' -> ' + prop.toString(); + }, function (okey, instantiator) { + return 'state(' + okey + ')'; + }); + }); + return 'obj{\n' + fieldStrings.join('\n') + '}'; + }; + var toDsl = function () { + return typeAdt.objOf(map$1(fields, function (f) { + return f.fold(function (key, okey, presence, prop) { + return fieldAdt.field(key, presence, prop); + }, function (okey, instantiator) { + return fieldAdt.state(okey); + }); + })); + }; + return { + extract: extract, + toString: toString, + toDsl: toDsl + }; + }; + var arrOf = function (prop) { + var extract = function (path, strength, array) { + var results = map$1(array, function (a, i) { + return prop.extract(path.concat(['[' + i + ']']), strength, a); + }); + return ResultCombine.consolidateArr(results); + }; + var toString = function () { + return 'array(' + prop.toString() + ')'; + }; + var toDsl = function () { + return typeAdt.arrOf(prop); + }; + return { + extract: extract, + toString: toString, + toDsl: toDsl + }; + }; + var setOf = function (validator, prop) { + var validateKeys = function (path, keys) { + return arrOf(value$1(validator)).extract(path, identity, keys); + }; + var extract = function (path, strength, o) { + var keys$1 = keys(o); + var validatedKeys = validateKeys(path, keys$1); + return SimpleResult.bind(validatedKeys, function (validKeys) { + var schema = map$1(validKeys, function (vk) { + return adt$1.field(vk, vk, strict(), prop); + }); + return objOf(schema).extract(path, strength, o); + }); + }; + var toString = function () { + return 'setOf(' + prop.toString() + ')'; + }; + var toDsl = function () { + return typeAdt.setOf(validator, prop); + }; + return { + extract: extract, + toString: toString, + toDsl: toDsl + }; + }; + var anyValue = constant(value$1(SimpleResult.svalue)); + var state = adt$1.state; + var field = adt$1.field; + + var chooseFrom = function (path, strength, input, branches, ch) { + var fields = readOptFrom$1(branches, ch); + return fields.fold(function () { + return missingBranch(path, branches, ch); + }, function (vp) { + return vp.extract(path.concat(['branch: ' + ch]), strength, input); + }); + }; + var choose = function (key, branches) { + var extract = function (path, strength, input) { + var choice = readOptFrom$1(input, key); + return choice.fold(function () { + return missingKey(path, key); + }, function (chosen) { + return chooseFrom(path, strength, input, branches, chosen); + }); + }; + var toString = function () { + return 'chooseOn(' + key + '). Possible values: ' + keys(branches); + }; + var toDsl = function () { + return typeAdt.choiceOf(key, branches); + }; + return { + extract: extract, + toString: toString, + toDsl: toDsl + }; + }; + + var _anyValue = value$1(SimpleResult.svalue); + var valueOf = function (validator) { + return value$1(function (v) { + return validator(v).fold(SimpleResult.serror, SimpleResult.svalue); + }); + }; + var setOf$1 = function (validator, prop) { + return setOf(function (v) { + return SimpleResult.fromResult(validator(v)); + }, prop); + }; + var extract = function (label, prop, strength, obj) { + var res = prop.extract([label], strength, obj); + return SimpleResult.mapError(res, function (errs) { + return { + input: obj, + errors: errs + }; + }); + }; + var asRaw = function (label, prop, obj) { + return SimpleResult.toResult(extract(label, prop, identity, obj)); + }; + var getOrDie = function (extraction) { + return extraction.fold(function (errInfo) { + throw new Error(formatError(errInfo)); + }, identity); + }; + var asRawOrDie = function (label, prop, obj) { + return getOrDie(asRaw(label, prop, obj)); + }; + var formatError = function (errInfo) { + return 'Errors: \n' + formatErrors(errInfo.errors) + '\n\nInput object: ' + formatObj(errInfo.input); + }; + var choose$1 = function (key, branches) { + return choose(key, map(branches, objOf)); + }; + var anyValue$1 = constant(_anyValue); + var typedValue = function (validator, expectedType) { + return value$1(function (a) { + var actualType = typeof a; + return validator(a) ? SimpleResult.svalue(a) : SimpleResult.serror('Expected type: ' + expectedType + ' but got: ' + actualType); + }); + }; + var functionProcessor = typedValue(isFunction, 'function'); + + var strict$1 = function (key) { + return field(key, key, strict(), anyValue()); + }; + var strictOf = function (key, schema) { + return field(key, key, strict(), schema); + }; + var strictFunction = function (key) { + return strictOf(key, functionProcessor); + }; + var forbid = function (key, message) { + return field(key, key, asOption(), value$1(function (v) { + return SimpleResult.serror('The field: ' + key + ' is forbidden. ' + message); + })); + }; + var strictObjOf = function (key, objSchema) { + return field(key, key, strict(), objOf(objSchema)); + }; + var option = function (key) { + return field(key, key, asOption(), anyValue()); + }; + var optionOf = function (key, schema) { + return field(key, key, asOption(), schema); + }; + var optionObjOf = function (key, objSchema) { + return optionOf(key, objOf(objSchema)); + }; + var optionObjOfOnly = function (key, objSchema) { + return optionOf(key, objOfOnly(objSchema)); + }; + var defaulted$1 = function (key, fallback) { + return field(key, key, defaulted(fallback), anyValue()); + }; + var defaultedOf = function (key, fallback, schema) { + return field(key, key, defaulted(fallback), schema); + }; + var defaultedObjOf = function (key, fallback, objSchema) { + return defaultedOf(key, fallback, objOf(objSchema)); + }; + var state$1 = function (okey, instantiator) { + return state(okey, instantiator); + }; + + var isSource = function (component, simulatedEvent) { + return eq(component.element(), simulatedEvent.event().target()); + }; + + function ClosestOrAncestor (is, ancestor, scope, a, isRoot) { + return is(scope, a) ? Option.some(scope) : isFunction(isRoot) && isRoot(scope) ? Option.none() : ancestor(scope, a, isRoot); + } + + var ancestor = function (scope, predicate, isRoot) { + var element = scope.dom(); + var stop = isFunction(isRoot) ? isRoot : constant(false); + while (element.parentNode) { + element = element.parentNode; + var el = Element.fromDom(element); + if (predicate(el)) { + return Option.some(el); + } else if (stop(el)) { + break; + } + } + return Option.none(); + }; + var closest = function (scope, predicate, isRoot) { + var is = function (s, test) { + return test(s); + }; + return ClosestOrAncestor(is, ancestor, scope, predicate, isRoot); + }; + var descendant = function (scope, predicate) { + var descend = function (node) { + for (var i = 0; i < node.childNodes.length; i++) { + var child_1 = Element.fromDom(node.childNodes[i]); + if (predicate(child_1)) { + return Option.some(child_1); + } + var res = descend(node.childNodes[i]); + if (res.isSome()) { + return res; + } + } + return Option.none(); + }; + return descend(scope.dom()); + }; + + var closest$1 = function (target, transform, isRoot) { + var delegate = closest(target, function (elem) { + return transform(elem).isSome(); + }, isRoot); + return delegate.bind(transform); + }; + + var nu$4 = function (parts) { + if (!hasKey$1(parts, 'can') && !hasKey$1(parts, 'abort') && !hasKey$1(parts, 'run')) { + throw new Error('EventHandler defined by: ' + JSON.stringify(parts, null, 2) + ' does not have can, abort, or run!'); + } + return asRawOrDie('Extracting event.handler', objOfOnly([ + defaulted$1('can', constant(true)), + defaulted$1('abort', constant(false)), + defaulted$1('run', noop) + ]), parts); + }; + var all$1 = function (handlers, f) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return foldl(handlers, function (acc, handler) { + return acc && f(handler).apply(undefined, args); + }, true); + }; + }; + var any = function (handlers, f) { + return function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return foldl(handlers, function (acc, handler) { + return acc || f(handler).apply(undefined, args); + }, false); + }; + }; + var read = function (handler) { + return isFunction(handler) ? { + can: constant(true), + abort: constant(false), + run: handler + } : handler; + }; + var fuse = function (handlers) { + var can = all$1(handlers, function (handler) { + return handler.can; + }); + var abort = any(handlers, function (handler) { + return handler.abort; + }); + var run = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + each$1(handlers, function (handler) { + handler.run.apply(undefined, args); + }); + }; + return nu$4({ + can: can, + abort: abort, + run: run + }); + }; + + var derive = function (configs) { + return wrapAll$1(configs); + }; + var abort = function (name, predicate) { + return { + key: name, + value: nu$4({ abort: predicate }) + }; + }; + var can = function (name, predicate) { + return { + key: name, + value: nu$4({ can: predicate }) + }; + }; + var run = function (name, handler) { + return { + key: name, + value: nu$4({ run: handler }) + }; + }; + var runActionExtra = function (name, action, extra) { + return { + key: name, + value: nu$4({ + run: function (component, simulatedEvent) { + action.apply(undefined, [ + component, + simulatedEvent + ].concat(extra)); + } + }) + }; + }; + var runOnName = function (name) { + return function (handler) { + return run(name, handler); + }; + }; + var runOnSourceName = function (name) { + return function (handler) { + return { + key: name, + value: nu$4({ + run: function (component, simulatedEvent) { + if (isSource(component, simulatedEvent)) { + handler(component, simulatedEvent); + } + } + }) + }; + }; + }; + var redirectToUid = function (name, uid) { + return run(name, function (component, simulatedEvent) { + component.getSystem().getByUid(uid).each(function (redirectee) { + dispatchEvent(redirectee, redirectee.element(), name, simulatedEvent); + }); + }); + }; + var redirectToPart = function (name, detail, partName) { + var uid = detail.partUids[partName]; + return redirectToUid(name, uid); + }; + var cutter = function (name) { + return run(name, function (component, simulatedEvent) { + simulatedEvent.cut(); + }); + }; + var stopper = function (name) { + return run(name, function (component, simulatedEvent) { + simulatedEvent.stop(); + }); + }; + var runOnSource = function (name, f) { + return runOnSourceName(name)(f); + }; + var runOnAttached = runOnSourceName(attachedToDom()); + var runOnDetached = runOnSourceName(detachedFromDom()); + var runOnInit = runOnSourceName(systemInit()); + var runOnExecute = runOnName(execute()); + + var markAsBehaviourApi = function (f, apiName, apiFunction) { + var delegate = apiFunction.toString(); + var endIndex = delegate.indexOf(')') + 1; + var openBracketIndex = delegate.indexOf('('); + var parameters = delegate.substring(openBracketIndex + 1, endIndex - 1).split(/,\s*/); + f.toFunctionAnnotation = function () { + return { + name: apiName, + parameters: cleanParameters(parameters.slice(0, 1).concat(parameters.slice(3))) + }; + }; + return f; + }; + var cleanParameters = function (parameters) { + return map$1(parameters, function (p) { + return endsWith(p, '/*') ? p.substring(0, p.length - '/*'.length) : p; + }); + }; + var markAsExtraApi = function (f, extraName) { + var delegate = f.toString(); + var endIndex = delegate.indexOf(')') + 1; + var openBracketIndex = delegate.indexOf('('); + var parameters = delegate.substring(openBracketIndex + 1, endIndex - 1).split(/,\s*/); + f.toFunctionAnnotation = function () { + return { + name: extraName, + parameters: cleanParameters(parameters) + }; + }; + return f; + }; + var markAsSketchApi = function (f, apiFunction) { + var delegate = apiFunction.toString(); + var endIndex = delegate.indexOf(')') + 1; + var openBracketIndex = delegate.indexOf('('); + var parameters = delegate.substring(openBracketIndex + 1, endIndex - 1).split(/,\s*/); + f.toFunctionAnnotation = function () { + return { + name: 'OVERRIDE', + parameters: cleanParameters(parameters.slice(1)) + }; + }; + return f; + }; + + var nu$5 = function (s) { + return { + classes: s.classes !== undefined ? s.classes : [], + attributes: s.attributes !== undefined ? s.attributes : {}, + styles: s.styles !== undefined ? s.styles : {} + }; + }; + var merge$1 = function (defnA, mod) { + return __assign(__assign({}, defnA), { + attributes: __assign(__assign({}, defnA.attributes), mod.attributes), + styles: __assign(__assign({}, defnA.styles), mod.styles), + classes: defnA.classes.concat(mod.classes) + }); + }; + + var executeEvent = function (bConfig, bState, executor) { + return runOnExecute(function (component) { + executor(component, bConfig, bState); + }); + }; + var loadEvent = function (bConfig, bState, f) { + return runOnInit(function (component, simulatedEvent) { + f(component, bConfig, bState); + }); + }; + var create = function (schema, name, active, apis, extra, state) { + var configSchema = objOfOnly(schema); + var schemaSchema = optionObjOf(name, [optionObjOfOnly('config', schema)]); + return doCreate(configSchema, schemaSchema, name, active, apis, extra, state); + }; + var createModes = function (modes, name, active, apis, extra, state) { + var configSchema = modes; + var schemaSchema = optionObjOf(name, [optionOf('config', modes)]); + return doCreate(configSchema, schemaSchema, name, active, apis, extra, state); + }; + var wrapApi = function (bName, apiFunction, apiName) { + var f = function (component) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + var args = [component].concat(rest); + return component.config({ name: constant(bName) }).fold(function () { + throw new Error('We could not find any behaviour configuration for: ' + bName + '. Using API: ' + apiName); + }, function (info) { + var rest = Array.prototype.slice.call(args, 1); + return apiFunction.apply(undefined, [ + component, + info.config, + info.state + ].concat(rest)); + }); + }; + return markAsBehaviourApi(f, apiName, apiFunction); + }; + var revokeBehaviour = function (name) { + return { + key: name, + value: undefined + }; + }; + var doCreate = function (configSchema, schemaSchema, name, active, apis, extra, state) { + var getConfig = function (info) { + return hasKey$1(info, name) ? info[name]() : Option.none(); + }; + var wrappedApis = map(apis, function (apiF, apiName) { + return wrapApi(name, apiF, apiName); + }); + var wrappedExtra = map(extra, function (extraF, extraName) { + return markAsExtraApi(extraF, extraName); + }); + var me = __assign(__assign(__assign({}, wrappedExtra), wrappedApis), { + revoke: curry(revokeBehaviour, name), + config: function (spec) { + var prepared = asRawOrDie(name + '-config', configSchema, spec); + return { + key: name, + value: { + config: prepared, + me: me, + configAsRaw: cached(function () { + return asRawOrDie(name + '-config', configSchema, spec); + }), + initialConfig: spec, + state: state + } + }; + }, + schema: function () { + return schemaSchema; + }, + exhibit: function (info, base) { + return getConfig(info).bind(function (behaviourInfo) { + return readOptFrom$1(active, 'exhibit').map(function (exhibitor) { + return exhibitor(base, behaviourInfo.config, behaviourInfo.state); + }); + }).getOr(nu$5({})); + }, + name: function () { + return name; + }, + handlers: function (info) { + return getConfig(info).map(function (behaviourInfo) { + var getEvents = readOr$1('events', function (a, b) { + return {}; + })(active); + return getEvents(behaviourInfo.config, behaviourInfo.state); + }).getOr({}); + } + }); + return me; + }; + + var NoState = { + init: function () { + return nu$6({ + readState: function () { + return 'No State required'; + } + }); + } + }; + var nu$6 = function (spec) { + return spec; + }; + + var derive$1 = function (capabilities) { + return wrapAll$1(capabilities); + }; + var simpleSchema = objOfOnly([ + strict$1('fields'), + strict$1('name'), + defaulted$1('active', {}), + defaulted$1('apis', {}), + defaulted$1('state', NoState), + defaulted$1('extra', {}) + ]); + var create$1 = function (data) { + var value = asRawOrDie('Creating behaviour: ' + data.name, simpleSchema, data); + return create(value.fields, value.name, value.active, value.apis, value.extra, value.state); + }; + var modeSchema = objOfOnly([ + strict$1('branchKey'), + strict$1('branches'), + strict$1('name'), + defaulted$1('active', {}), + defaulted$1('apis', {}), + defaulted$1('state', NoState), + defaulted$1('extra', {}) + ]); + var createModes$1 = function (data) { + var value = asRawOrDie('Creating behaviour: ' + data.name, modeSchema, data); + return createModes(choose$1(value.branchKey, value.branches), value.name, value.active, value.apis, value.extra, value.state); + }; + var revoke = constant(undefined); + + var rawSet = function (dom, key, value) { + if (isString(value) || isBoolean(value) || isNumber(value)) { + dom.setAttribute(key, value + ''); + } else { + domGlobals.console.error('Invalid call to Attr.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(attrs, function (v, k) { + rawSet(dom, k, v); + }); + }; + var get = function (element, key) { + var v = element.dom().getAttribute(key); + return v === null ? undefined : v; + }; + 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 read$1 = function (element, attr) { + var value = get(element, attr); + return value === undefined || value === '' ? [] : value.split(' '); + }; + var add = function (element, attr, id) { + var old = read$1(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$1(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$1 = function (element) { + return read$1(element, 'class'); + }; + var add$1 = function (element, clazz) { + return add(element, 'class', clazz); + }; + var remove$3 = function (element, clazz) { + return remove$2(element, 'class', clazz); + }; + + var add$2 = function (element, clazz) { + if (supports(element)) { + element.dom().classList.add(clazz); + } else { + add$1(element, clazz); + } + }; + var cleanClass = function (element) { + var classList = supports(element) ? element.dom().classList : get$1(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 swap = function (element, addCls, removeCls) { + remove$4(element, removeCls); + add$2(element, addCls); + }; + var toAlpha = function (component, swapConfig, swapState) { + swap(component.element(), swapConfig.alpha, swapConfig.omega); + }; + var toOmega = function (component, swapConfig, swapState) { + swap(component.element(), swapConfig.omega, swapConfig.alpha); + }; + var clear = function (component, swapConfig, swapState) { + remove$4(component.element(), swapConfig.alpha); + remove$4(component.element(), swapConfig.omega); + }; + var isAlpha = function (component, swapConfig, swapState) { + return has$2(component.element(), swapConfig.alpha); + }; + var isOmega = function (component, swapConfig, swapState) { + return has$2(component.element(), swapConfig.omega); + }; + + var SwapApis = /*#__PURE__*/Object.freeze({ + toAlpha: toAlpha, + toOmega: toOmega, + isAlpha: isAlpha, + isOmega: isOmega, + clear: clear + }); + + var SwapSchema = [ + strict$1('alpha'), + strict$1('omega') + ]; + + var Swapping = create$1({ + fields: SwapSchema, + name: 'swapping', + apis: SwapApis + }); + + var focus$1 = function (element) { + element.dom().focus(); + }; + var blur = function (element) { + element.dom().blur(); + }; + var hasFocus = function (element) { + var doc = owner(element).dom(); + return element.dom() === doc.activeElement; + }; + var active = function (_doc) { + var doc = _doc !== undefined ? _doc.dom() : domGlobals.document; + return Option.from(doc.activeElement).map(Element.fromDom); + }; + var search = function (element) { + return active(owner(element)).filter(function (e) { + return element.dom().contains(e.dom()); + }); + }; + + var global$1 = tinymce.util.Tools.resolve('tinymce.dom.DOMUtils'); + + var global$2 = tinymce.util.Tools.resolve('tinymce.ThemeManager'); + + var openLink = function (target) { + var link = domGlobals.document.createElement('a'); + link.target = '_blank'; + link.href = target.href; + link.rel = 'noreferrer noopener'; + var nuEvt = domGlobals.document.createEvent('MouseEvents'); + nuEvt.initMouseEvent('click', true, true, domGlobals.window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); + domGlobals.document.body.appendChild(link); + link.dispatchEvent(nuEvt); + domGlobals.document.body.removeChild(link); + }; + var TinyCodeDupe = { openLink: openLink }; + + var isSkinDisabled = function (editor) { + return editor.settings.skin === false; + }; + var readOnlyOnInit = function (editor) { + return false; + }; + + var formatChanged = 'formatChanged'; + var orientationChanged = 'orientationChanged'; + var dropupDismissed = 'dropupDismissed'; + var TinyChannels = { + formatChanged: constant(formatChanged), + orientationChanged: constant(orientationChanged), + dropupDismissed: constant(dropupDismissed) + }; + + var fromHtml$1 = function (html, scope) { + var doc = scope || domGlobals.document; + var div = doc.createElement('div'); + div.innerHTML = html; + return children(Element.fromDom(div)); + }; + + var get$2 = function (element) { + return element.dom().innerHTML; + }; + var set$1 = function (element, content) { + var owner$1 = owner(element); + var docDom = owner$1.dom(); + var fragment = Element.fromDom(docDom.createDocumentFragment()); + var contentElements = fromHtml$1(content, docDom); + append$1(fragment, contentElements); + empty(element); + append(element, fragment); + }; + var getOuter = function (element) { + var container = Element.fromTag('div'); + var clone = Element.fromDom(element.dom().cloneNode(true)); + append(container, clone); + return get$2(container); + }; + + var clone = function (original, isDeep) { + return Element.fromDom(original.dom().cloneNode(isDeep)); + }; + var shallow$1 = function (original) { + return clone(original, false); + }; + + var getHtml = function (element) { + var clone = shallow$1(element); + return getOuter(clone); + }; + + var element = function (elem) { + return getHtml(elem); + }; + + var chooseChannels = function (channels, message) { + return message.universal() ? channels : filter(channels, function (ch) { + return contains(message.channels(), ch); + }); + }; + var events = function (receiveConfig) { + return derive([run(receive(), function (component, message) { + var channelMap = receiveConfig.channels; + var channels = keys(channelMap); + var targetChannels = chooseChannels(channels, message); + each$1(targetChannels, function (ch) { + var channelInfo = channelMap[ch]; + var channelSchema = channelInfo.schema; + var data = asRawOrDie('channel[' + ch + '] data\nReceiver: ' + element(component.element()), channelSchema, message.data()); + channelInfo.onReceive(component, data); + }); + })]); + }; + + var ActiveReceiving = /*#__PURE__*/Object.freeze({ + events: events + }); + + 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 sequence = function (arr) { + var r = []; + for (var i = 0; i < arr.length; i++) { + var x = arr[i]; + if (x.isSome()) { + r.push(x.getOrDie()); + } else { + return Option.none(); + } + } + return Option.some(r); + }; + 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 Option.none(); + }; + var someIf = function (b, a) { + return b ? Option.some(a) : Option.none(); + }; + + var unknown$3 = 'unknown'; + var EventConfiguration; + (function (EventConfiguration) { + EventConfiguration[EventConfiguration['STOP'] = 0] = 'STOP'; + EventConfiguration[EventConfiguration['NORMAL'] = 1] = 'NORMAL'; + EventConfiguration[EventConfiguration['LOGGING'] = 2] = 'LOGGING'; + }(EventConfiguration || (EventConfiguration = {}))); + var eventConfig = Cell({}); + var makeEventLogger = function (eventName, initialTarget) { + var sequence = []; + var startTime = new Date().getTime(); + return { + logEventCut: function (name, target, purpose) { + sequence.push({ + outcome: 'cut', + target: target, + purpose: purpose + }); + }, + logEventStopped: function (name, target, purpose) { + sequence.push({ + outcome: 'stopped', + target: target, + purpose: purpose + }); + }, + logNoParent: function (name, target, purpose) { + sequence.push({ + outcome: 'no-parent', + target: target, + purpose: purpose + }); + }, + logEventNoHandlers: function (name, target) { + sequence.push({ + outcome: 'no-handlers-left', + target: target + }); + }, + logEventResponse: function (name, target, purpose) { + sequence.push({ + outcome: 'response', + purpose: purpose, + target: target + }); + }, + write: function () { + var finishTime = new Date().getTime(); + if (contains([ + 'mousemove', + 'mouseover', + 'mouseout', + systemInit() + ], eventName)) { + return; + } + domGlobals.console.log(eventName, { + event: eventName, + time: finishTime - startTime, + target: initialTarget.dom(), + sequence: map$1(sequence, function (s) { + if (!contains([ + 'cut', + 'stopped', + 'response' + ], s.outcome)) { + return s.outcome; + } else { + return '{' + s.purpose + '} ' + s.outcome + ' at (' + element(s.target) + ')'; + } + }) + }); + } + }; + }; + var processEvent = function (eventName, initialTarget, f) { + var status = readOptFrom$1(eventConfig.get(), eventName).orThunk(function () { + var patterns = keys(eventConfig.get()); + return findMap(patterns, function (p) { + return eventName.indexOf(p) > -1 ? Option.some(eventConfig.get()[p]) : Option.none(); + }); + }).getOr(EventConfiguration.NORMAL); + switch (status) { + case EventConfiguration.NORMAL: + return f(noLogger()); + case EventConfiguration.LOGGING: { + var logger = makeEventLogger(eventName, initialTarget); + var output = f(logger); + logger.write(); + return output; + } + case EventConfiguration.STOP: + return true; + } + }; + var path = [ + 'alloy/data/Fields', + 'alloy/debugging/Debugging' + ]; + var getTrace = function () { + var err = new Error(); + if (err.stack !== undefined) { + var lines = err.stack.split('\n'); + return find$2(lines, function (line) { + return line.indexOf('alloy') > 0 && !exists(path, function (p) { + return line.indexOf(p) > -1; + }); + }).getOr(unknown$3); + } else { + return unknown$3; + } + }; + var ignoreEvent = { + logEventCut: noop, + logEventStopped: noop, + logNoParent: noop, + logEventNoHandlers: noop, + logEventResponse: noop, + write: noop + }; + var monitorEvent = function (eventName, initialTarget, f) { + return processEvent(eventName, initialTarget, f); + }; + var noLogger = constant(ignoreEvent); + + var menuFields = constant([ + strict$1('menu'), + strict$1('selectedMenu') + ]); + var itemFields = constant([ + strict$1('item'), + strict$1('selectedItem') + ]); + var schema = constant(objOf(itemFields().concat(menuFields()))); + var itemSchema = constant(objOf(itemFields())); + + var _initSize = strictObjOf('initSize', [ + strict$1('numColumns'), + strict$1('numRows') + ]); + var itemMarkers = function () { + return strictOf('markers', itemSchema()); + }; + var tieredMenuMarkers = function () { + return strictObjOf('markers', [strict$1('backgroundMenu')].concat(menuFields()).concat(itemFields())); + }; + var markers = function (required) { + return strictObjOf('markers', map$1(required, strict$1)); + }; + var onPresenceHandler = function (label, fieldName, presence) { + var trace = getTrace(); + return field(fieldName, fieldName, presence, valueOf(function (f) { + return Result.value(function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + return f.apply(undefined, args); + }); + })); + }; + var onHandler = function (fieldName) { + return onPresenceHandler('onHandler', fieldName, defaulted(noop)); + }; + var onKeyboardHandler = function (fieldName) { + return onPresenceHandler('onKeyboardHandler', fieldName, defaulted(Option.none)); + }; + var onStrictHandler = function (fieldName) { + return onPresenceHandler('onHandler', fieldName, strict()); + }; + var onStrictKeyboardHandler = function (fieldName) { + return onPresenceHandler('onKeyboardHandler', fieldName, strict()); + }; + var output = function (name, value) { + return state$1(name, constant(value)); + }; + var snapshot = function (name) { + return state$1(name, identity); + }; + var initSize = constant(_initSize); + + var ReceivingSchema = [strictOf('channels', setOf$1(Result.value, objOfOnly([ + onStrictHandler('onReceive'), + defaulted$1('schema', anyValue$1()) + ])))]; + + var Receiving = create$1({ + fields: ReceivingSchema, + name: 'receiving', + active: ActiveReceiving + }); + + var updateAriaState = function (component, toggleConfig, toggleState) { + var ariaInfo = toggleConfig.aria; + ariaInfo.update(component, ariaInfo, toggleState.get()); + }; + var updateClass = function (component, toggleConfig, toggleState) { + toggleConfig.toggleClass.each(function (toggleClass) { + if (toggleState.get()) { + add$2(component.element(), toggleClass); + } else { + remove$4(component.element(), toggleClass); + } + }); + }; + var toggle = function (component, toggleConfig, toggleState) { + set$2(component, toggleConfig, toggleState, !toggleState.get()); + }; + var on = function (component, toggleConfig, toggleState) { + toggleState.set(true); + updateClass(component, toggleConfig, toggleState); + updateAriaState(component, toggleConfig, toggleState); + }; + var off = function (component, toggleConfig, toggleState) { + toggleState.set(false); + updateClass(component, toggleConfig, toggleState); + updateAriaState(component, toggleConfig, toggleState); + }; + var set$2 = function (component, toggleConfig, toggleState, state) { + var action = state ? on : off; + action(component, toggleConfig, toggleState); + }; + var isOn = function (component, toggleConfig, toggleState) { + return toggleState.get(); + }; + var onLoad = function (component, toggleConfig, toggleState) { + set$2(component, toggleConfig, toggleState, toggleConfig.selected); + }; + + var ToggleApis = /*#__PURE__*/Object.freeze({ + onLoad: onLoad, + toggle: toggle, + isOn: isOn, + on: on, + off: off, + set: set$2 + }); + + var exhibit = function (base, toggleConfig, toggleState) { + return nu$5({}); + }; + var events$1 = function (toggleConfig, toggleState) { + var execute = executeEvent(toggleConfig, toggleState, toggle); + var load = loadEvent(toggleConfig, toggleState, onLoad); + return derive(flatten([ + toggleConfig.toggleOnExecute ? [execute] : [], + [load] + ])); + }; + + var ActiveToggle = /*#__PURE__*/Object.freeze({ + exhibit: exhibit, + events: events$1 + }); + + var SetupBehaviourCellState = function (initialState) { + var init = function () { + var cell = Cell(initialState); + var get = function () { + return cell.get(); + }; + var set = function (newState) { + return cell.set(newState); + }; + var clear = function () { + return cell.set(initialState); + }; + var readState = function () { + return cell.get(); + }; + return { + get: get, + set: set, + clear: clear, + readState: readState + }; + }; + return { init: init }; + }; + + var updatePressed = function (component, ariaInfo, status) { + set(component.element(), 'aria-pressed', status); + if (ariaInfo.syncWithExpanded) { + updateExpanded(component, ariaInfo, status); + } + }; + var updateSelected = function (component, ariaInfo, status) { + set(component.element(), 'aria-selected', status); + }; + var updateChecked = function (component, ariaInfo, status) { + set(component.element(), 'aria-checked', status); + }; + var updateExpanded = function (component, ariaInfo, status) { + set(component.element(), 'aria-expanded', status); + }; + + var ToggleSchema = [ + defaulted$1('selected', false), + option('toggleClass'), + defaulted$1('toggleOnExecute', true), + defaultedOf('aria', { mode: 'none' }, choose$1('mode', { + pressed: [ + defaulted$1('syncWithExpanded', false), + output('update', updatePressed) + ], + checked: [output('update', updateChecked)], + expanded: [output('update', updateExpanded)], + selected: [output('update', updateSelected)], + none: [output('update', noop)] + })) + ]; + + var Toggling = create$1({ + fields: ToggleSchema, + name: 'toggling', + active: ActiveToggle, + apis: ToggleApis, + state: SetupBehaviourCellState(false) + }); + + var format = function (command, update) { + return Receiving.config({ + channels: wrap$1(TinyChannels.formatChanged(), { + onReceive: function (button, data) { + if (data.command === command) { + update(button, data.state); + } + } + }) + }); + }; + var orientation = function (onReceive) { + return Receiving.config({ channels: wrap$1(TinyChannels.orientationChanged(), { onReceive: onReceive }) }); + }; + var receive$1 = function (channel, onReceive) { + return { + key: channel, + value: { onReceive: onReceive } + }; + }; + var Receivers = { + format: format, + orientation: orientation, + receive: receive$1 + }; + + var prefix = 'tinymce-mobile'; + var resolve = function (p) { + return prefix + '-' + p; + }; + var Styles = { + resolve: resolve, + prefix: constant(prefix) + }; + + var pointerEvents = function () { + var onClick = function (component, simulatedEvent) { + simulatedEvent.stop(); + emitExecute(component); + }; + return [ + run(click(), onClick), + run(tap(), onClick), + cutter(touchstart()), + cutter(mousedown()) + ]; + }; + var events$2 = function (optAction) { + var executeHandler = function (action) { + return runOnExecute(function (component, simulatedEvent) { + action(component); + simulatedEvent.stop(); + }); + }; + return derive(flatten([ + optAction.map(executeHandler).toArray(), + pointerEvents() + ])); + }; + + var focus$2 = function (component, focusConfig) { + if (!focusConfig.ignore) { + focus$1(component.element()); + focusConfig.onFocus(component); + } + }; + var blur$1 = function (component, focusConfig) { + if (!focusConfig.ignore) { + blur(component.element()); + } + }; + var isFocused = function (component) { + return hasFocus(component.element()); + }; + + var FocusApis = /*#__PURE__*/Object.freeze({ + focus: focus$2, + blur: blur$1, + isFocused: isFocused + }); + + var exhibit$1 = function (base, focusConfig) { + var mod = focusConfig.ignore ? {} : { attributes: { tabindex: '-1' } }; + return nu$5(mod); + }; + var events$3 = function (focusConfig) { + return derive([run(focus(), function (component, simulatedEvent) { + focus$2(component, focusConfig); + simulatedEvent.stop(); + })].concat(focusConfig.stopMousedown ? [run(mousedown(), function (_, simulatedEvent) { + simulatedEvent.event().prevent(); + })] : [])); + }; + + var ActiveFocus = /*#__PURE__*/Object.freeze({ + exhibit: exhibit$1, + events: events$3 + }); + + var FocusSchema = [ + onHandler('onFocus'), + defaulted$1('stopMousedown', false), + defaulted$1('ignore', false) + ]; + + var Focusing = create$1({ + fields: FocusSchema, + name: 'focusing', + active: ActiveFocus, + apis: FocusApis + }); + + var isSupported = function (dom) { + return dom.style !== undefined && isFunction(dom.style.getPropertyValue); + }; + + var internalSet = function (dom, property, value) { + if (!isString(value)) { + domGlobals.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 internalRemove = function (dom, property) { + if (isSupported(dom)) { + dom.style.removeProperty(property); + } + }; + var set$3 = function (element, property, value) { + var dom = element.dom(); + internalSet(dom, property, value); + }; + var setAll$1 = function (element, css) { + var dom = element.dom(); + each(css, function (v, k) { + internalSet(dom, k, v); + }); + }; + var get$3 = function (element, property) { + var dom = element.dom(); + var styles = domGlobals.window.getComputedStyle(dom); + var r = styles.getPropertyValue(property); + var v = r === '' && !inBody(element) ? getUnsafeProperty(dom, property) : r; + return v === null ? undefined : v; + }; + var getUnsafeProperty = function (dom, property) { + return isSupported(dom) ? dom.style.getPropertyValue(property) : ''; + }; + var getRaw = function (element, property) { + var dom = element.dom(); + var raw = getUnsafeProperty(dom, property); + return Option.from(raw).filter(function (r) { + return r.length > 0; + }); + }; + var remove$5 = function (element, property) { + var dom = element.dom(); + internalRemove(dom, property); + if (has$1(element, 'style') && trim(get(element, 'style')) === '') { + remove$1(element, 'style'); + } + }; + var reflow = function (e) { + return e.dom().offsetWidth; + }; + + 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(dom)) { + dom.style[name] = h + 'px'; + } + }; + var get = function (element) { + var r = getOffset(element); + if (r <= 0 || r === null) { + var css = get$3(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$3(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 = Dimension('height', function (element) { + var dom = element.dom(); + return inBody(element) ? dom.getBoundingClientRect().height : dom.offsetHeight; + }); + var get$4 = function (element) { + return api.get(element); + }; + + 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$2 = 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 descendants = function (scope, selector) { + return all(selector, scope); + }; + + var first = function (selector) { + return one(selector); + }; + var ancestor$1 = function (scope, selector, isRoot) { + return ancestor(scope, function (e) { + return is(e, selector); + }, isRoot); + }; + var descendant$1 = function (scope, selector) { + return one(selector, scope); + }; + var closest$2 = function (scope, selector, isRoot) { + return ClosestOrAncestor(is, ancestor$1, scope, selector, isRoot); + }; + + var BACKSPACE = function () { + return [8]; + }; + var TAB = function () { + return [9]; + }; + var ENTER = function () { + return [13]; + }; + var ESCAPE = function () { + return [27]; + }; + var SPACE = function () { + return [32]; + }; + var LEFT = function () { + return [37]; + }; + var UP = function () { + return [38]; + }; + var RIGHT = function () { + return [39]; + }; + var DOWN = function () { + return [40]; + }; + + var cyclePrev = function (values, index, predicate) { + var before = reverse(values.slice(0, index)); + var after = reverse(values.slice(index + 1)); + return find$2(before.concat(after), predicate); + }; + var tryPrev = function (values, index, predicate) { + var before = reverse(values.slice(0, index)); + return find$2(before, predicate); + }; + var cycleNext = function (values, index, predicate) { + var before = values.slice(0, index); + var after = values.slice(index + 1); + return find$2(after.concat(before), predicate); + }; + var tryNext = function (values, index, predicate) { + var after = values.slice(index + 1); + return find$2(after, predicate); + }; + + var inSet = function (keys) { + return function (event) { + var raw = event.raw(); + return contains(keys, raw.which); + }; + }; + var and = function (preds) { + return function (event) { + return forall(preds, function (pred) { + return pred(event); + }); + }; + }; + var isShift = function (event) { + var raw = event.raw(); + return raw.shiftKey === true; + }; + var isControl = function (event) { + var raw = event.raw(); + return raw.ctrlKey === true; + }; + var isNotShift = not(isShift); + + var rule = function (matches, action) { + return { + matches: matches, + classification: action + }; + }; + var choose$2 = function (transitions, event) { + var transition = find$2(transitions, function (t) { + return t.matches(event); + }); + return transition.map(function (t) { + return t.classification; + }); + }; + + var cycleBy = function (value, delta, min, max) { + var r = value + delta; + if (r > max) { + return min; + } else { + return r < min ? max : r; + } + }; + var cap = function (value, min, max) { + if (value <= min) { + return min; + } else { + return value >= max ? max : value; + } + }; + + var dehighlightAllExcept = function (component, hConfig, hState, skip) { + var highlighted = descendants(component.element(), '.' + hConfig.highlightClass); + each$1(highlighted, function (h) { + if (!exists(skip, function (skipComp) { + return skipComp.element() === h; + })) { + remove$4(h, hConfig.highlightClass); + component.getSystem().getByDom(h).each(function (target) { + hConfig.onDehighlight(component, target); + emit(target, dehighlight()); + }); + } + }); + }; + var dehighlightAll = function (component, hConfig, hState) { + return dehighlightAllExcept(component, hConfig, hState, []); + }; + var dehighlight$1 = function (component, hConfig, hState, target) { + if (isHighlighted(component, hConfig, hState, target)) { + remove$4(target.element(), hConfig.highlightClass); + hConfig.onDehighlight(component, target); + emit(target, dehighlight()); + } + }; + var highlight$1 = function (component, hConfig, hState, target) { + dehighlightAllExcept(component, hConfig, hState, [target]); + if (!isHighlighted(component, hConfig, hState, target)) { + add$2(target.element(), hConfig.highlightClass); + hConfig.onHighlight(component, target); + emit(target, highlight()); + } + }; + var highlightFirst = function (component, hConfig, hState) { + getFirst(component, hConfig).each(function (firstComp) { + highlight$1(component, hConfig, hState, firstComp); + }); + }; + var highlightLast = function (component, hConfig, hState) { + getLast(component, hConfig).each(function (lastComp) { + highlight$1(component, hConfig, hState, lastComp); + }); + }; + var highlightAt = function (component, hConfig, hState, index) { + getByIndex(component, hConfig, hState, index).fold(function (err) { + throw new Error(err); + }, function (firstComp) { + highlight$1(component, hConfig, hState, firstComp); + }); + }; + var highlightBy = function (component, hConfig, hState, predicate) { + var candidates = getCandidates(component, hConfig); + var targetComp = find$2(candidates, predicate); + targetComp.each(function (c) { + highlight$1(component, hConfig, hState, c); + }); + }; + var isHighlighted = function (component, hConfig, hState, queryTarget) { + return has$2(queryTarget.element(), hConfig.highlightClass); + }; + var getHighlighted = function (component, hConfig, hState) { + return descendant$1(component.element(), '.' + hConfig.highlightClass).bind(function (e) { + return component.getSystem().getByDom(e).toOption(); + }); + }; + var getByIndex = function (component, hConfig, hState, index) { + var items = descendants(component.element(), '.' + hConfig.itemClass); + return Option.from(items[index]).fold(function () { + return Result.error('No element found with index ' + index); + }, component.getSystem().getByDom); + }; + var getFirst = function (component, hConfig, hState) { + return descendant$1(component.element(), '.' + hConfig.itemClass).bind(function (e) { + return component.getSystem().getByDom(e).toOption(); + }); + }; + var getLast = function (component, hConfig, hState) { + var items = descendants(component.element(), '.' + hConfig.itemClass); + var last = items.length > 0 ? Option.some(items[items.length - 1]) : Option.none(); + return last.bind(function (c) { + return component.getSystem().getByDom(c).toOption(); + }); + }; + var getDelta = function (component, hConfig, hState, delta) { + var items = descendants(component.element(), '.' + hConfig.itemClass); + var current = findIndex(items, function (item) { + return has$2(item, hConfig.highlightClass); + }); + return current.bind(function (selected) { + var dest = cycleBy(selected, delta, 0, items.length - 1); + return component.getSystem().getByDom(items[dest]).toOption(); + }); + }; + var getPrevious = function (component, hConfig, hState) { + return getDelta(component, hConfig, hState, -1); + }; + var getNext = function (component, hConfig, hState) { + return getDelta(component, hConfig, hState, +1); + }; + var getCandidates = function (component, hConfig, hState) { + var items = descendants(component.element(), '.' + hConfig.itemClass); + return cat(map$1(items, function (i) { + return component.getSystem().getByDom(i).toOption(); + })); + }; + + var HighlightApis = /*#__PURE__*/Object.freeze({ + dehighlightAll: dehighlightAll, + dehighlight: dehighlight$1, + highlight: highlight$1, + highlightFirst: highlightFirst, + highlightLast: highlightLast, + highlightAt: highlightAt, + highlightBy: highlightBy, + isHighlighted: isHighlighted, + getHighlighted: getHighlighted, + getFirst: getFirst, + getLast: getLast, + getPrevious: getPrevious, + getNext: getNext, + getCandidates: getCandidates + }); + + var HighlightSchema = [ + strict$1('highlightClass'), + strict$1('itemClass'), + onHandler('onHighlight'), + onHandler('onDehighlight') + ]; + + var Highlighting = create$1({ + fields: HighlightSchema, + name: 'highlighting', + apis: HighlightApis + }); + + var reportFocusShifting = function (component, prevFocus, newFocus) { + var noChange = prevFocus.exists(function (p) { + return newFocus.exists(function (n) { + return eq(n, p); + }); + }); + if (!noChange) { + emitWith(component, focusShifted(), { + prevFocus: prevFocus, + newFocus: newFocus + }); + } + }; + var dom = function () { + var get = function (component) { + return search(component.element()); + }; + var set = function (component, focusee) { + var prevFocus = get(component); + component.getSystem().triggerFocus(focusee, component.element()); + var newFocus = get(component); + reportFocusShifting(component, prevFocus, newFocus); + }; + return { + get: get, + set: set + }; + }; + var highlights = function () { + var get = function (component) { + return Highlighting.getHighlighted(component).map(function (item) { + return item.element(); + }); + }; + var set = function (component, element) { + var prevFocus = get(component); + component.getSystem().getByDom(element).fold(noop, function (item) { + Highlighting.highlight(component, item); + }); + var newFocus = get(component); + reportFocusShifting(component, prevFocus, newFocus); + }; + return { + get: get, + set: set + }; + }; + + var FocusInsideModes; + (function (FocusInsideModes) { + FocusInsideModes['OnFocusMode'] = 'onFocus'; + FocusInsideModes['OnEnterOrSpaceMode'] = 'onEnterOrSpace'; + FocusInsideModes['OnApiMode'] = 'onApi'; + }(FocusInsideModes || (FocusInsideModes = {}))); + + var typical = function (infoSchema, stateInit, getKeydownRules, getKeyupRules, optFocusIn) { + var schema = function () { + return infoSchema.concat([ + defaulted$1('focusManager', dom()), + defaultedOf('focusInside', 'onFocus', valueOf(function (val) { + return contains([ + 'onFocus', + 'onEnterOrSpace', + 'onApi' + ], val) ? Result.value(val) : Result.error('Invalid value for focusInside'); + })), + output('handler', me), + output('state', stateInit), + output('sendFocusIn', optFocusIn) + ]); + }; + var processKey = function (component, simulatedEvent, getRules, keyingConfig, keyingState) { + var rules = getRules(component, simulatedEvent, keyingConfig, keyingState); + return choose$2(rules, simulatedEvent.event()).bind(function (rule) { + return rule(component, simulatedEvent, keyingConfig, keyingState); + }); + }; + var toEvents = function (keyingConfig, keyingState) { + var onFocusHandler = keyingConfig.focusInside !== FocusInsideModes.OnFocusMode ? Option.none() : optFocusIn(keyingConfig).map(function (focusIn) { + return run(focus(), function (component, simulatedEvent) { + focusIn(component, keyingConfig, keyingState); + simulatedEvent.stop(); + }); + }); + var tryGoInsideComponent = function (component, simulatedEvent) { + var isEnterOrSpace = inSet(SPACE().concat(ENTER()))(simulatedEvent.event()); + if (keyingConfig.focusInside === FocusInsideModes.OnEnterOrSpaceMode && isEnterOrSpace && isSource(component, simulatedEvent)) { + optFocusIn(keyingConfig).each(function (focusIn) { + focusIn(component, keyingConfig, keyingState); + simulatedEvent.stop(); + }); + } + }; + return derive(onFocusHandler.toArray().concat([ + run(keydown(), function (component, simulatedEvent) { + processKey(component, simulatedEvent, getKeydownRules, keyingConfig, keyingState).fold(function () { + tryGoInsideComponent(component, simulatedEvent); + }, function (_) { + simulatedEvent.stop(); + }); + }), + run(keyup(), function (component, simulatedEvent) { + processKey(component, simulatedEvent, getKeyupRules, keyingConfig, keyingState).each(function (_) { + simulatedEvent.stop(); + }); + }) + ])); + }; + var me = { + schema: schema, + processKey: processKey, + toEvents: toEvents + }; + return me; + }; + + var create$2 = function (cyclicField) { + var schema = [ + option('onEscape'), + option('onEnter'), + defaulted$1('selector', '[data-alloy-tabstop="true"]:not(:disabled)'), + defaulted$1('firstTabstop', 0), + defaulted$1('useTabstopAt', constant(true)), + option('visibilitySelector') + ].concat([cyclicField]); + var isVisible = function (tabbingConfig, element) { + var target = tabbingConfig.visibilitySelector.bind(function (sel) { + return closest$2(element, sel); + }).getOr(element); + return get$4(target) > 0; + }; + var findInitial = function (component, tabbingConfig) { + var tabstops = descendants(component.element(), tabbingConfig.selector); + var visibles = filter(tabstops, function (elem) { + return isVisible(tabbingConfig, elem); + }); + return Option.from(visibles[tabbingConfig.firstTabstop]); + }; + var findCurrent = function (component, tabbingConfig) { + return tabbingConfig.focusManager.get(component).bind(function (elem) { + return closest$2(elem, tabbingConfig.selector); + }); + }; + var isTabstop = function (tabbingConfig, element) { + return isVisible(tabbingConfig, element) && tabbingConfig.useTabstopAt(element); + }; + var focusIn = function (component, tabbingConfig) { + findInitial(component, tabbingConfig).each(function (target) { + tabbingConfig.focusManager.set(component, target); + }); + }; + var goFromTabstop = function (component, tabstops, stopIndex, tabbingConfig, cycle) { + return cycle(tabstops, stopIndex, function (elem) { + return isTabstop(tabbingConfig, elem); + }).fold(function () { + return tabbingConfig.cyclic ? Option.some(true) : Option.none(); + }, function (target) { + tabbingConfig.focusManager.set(component, target); + return Option.some(true); + }); + }; + var go = function (component, simulatedEvent, tabbingConfig, cycle) { + var tabstops = descendants(component.element(), tabbingConfig.selector); + return findCurrent(component, tabbingConfig).bind(function (tabstop) { + var optStopIndex = findIndex(tabstops, curry(eq, tabstop)); + return optStopIndex.bind(function (stopIndex) { + return goFromTabstop(component, tabstops, stopIndex, tabbingConfig, cycle); + }); + }); + }; + var goBackwards = function (component, simulatedEvent, tabbingConfig, tabbingState) { + var navigate = tabbingConfig.cyclic ? cyclePrev : tryPrev; + return go(component, simulatedEvent, tabbingConfig, navigate); + }; + var goForwards = function (component, simulatedEvent, tabbingConfig, tabbingState) { + var navigate = tabbingConfig.cyclic ? cycleNext : tryNext; + return go(component, simulatedEvent, tabbingConfig, navigate); + }; + var execute = function (component, simulatedEvent, tabbingConfig, tabbingState) { + return tabbingConfig.onEnter.bind(function (f) { + return f(component, simulatedEvent); + }); + }; + var exit = function (component, simulatedEvent, tabbingConfig, tabbingState) { + return tabbingConfig.onEscape.bind(function (f) { + return f(component, simulatedEvent); + }); + }; + var getKeydownRules = constant([ + rule(and([ + isShift, + inSet(TAB()) + ]), goBackwards), + rule(inSet(TAB()), goForwards), + rule(inSet(ESCAPE()), exit), + rule(and([ + isNotShift, + inSet(ENTER()) + ]), execute) + ]); + var getKeyupRules = constant([]); + return typical(schema, NoState.init, getKeydownRules, getKeyupRules, function () { + return Option.some(focusIn); + }); + }; + + var AcyclicType = create$2(state$1('cyclic', constant(false))); + + var CyclicType = create$2(state$1('cyclic', constant(true))); + + var inside = function (target) { + return name(target) === 'input' && get(target, 'type') !== 'radio' || name(target) === 'textarea'; + }; + + var doDefaultExecute = function (component, simulatedEvent, focused) { + dispatch(component, focused, execute()); + return Option.some(true); + }; + var defaultExecute = function (component, simulatedEvent, focused) { + return inside(focused) && inSet(SPACE())(simulatedEvent.event()) ? Option.none() : doDefaultExecute(component, simulatedEvent, focused); + }; + var stopEventForFirefox = function (component, simulatedEvent) { + return Option.some(true); + }; + + var schema$1 = [ + defaulted$1('execute', defaultExecute), + defaulted$1('useSpace', false), + defaulted$1('useEnter', true), + defaulted$1('useControlEnter', false), + defaulted$1('useDown', false) + ]; + var execute$1 = function (component, simulatedEvent, executeConfig) { + return executeConfig.execute(component, simulatedEvent, component.element()); + }; + var getKeydownRules = function (component, simulatedEvent, executeConfig, executeState) { + var spaceExec = executeConfig.useSpace && !inside(component.element()) ? SPACE() : []; + var enterExec = executeConfig.useEnter ? ENTER() : []; + var downExec = executeConfig.useDown ? DOWN() : []; + var execKeys = spaceExec.concat(enterExec).concat(downExec); + return [rule(inSet(execKeys), execute$1)].concat(executeConfig.useControlEnter ? [rule(and([ + isControl, + inSet(ENTER()) + ]), execute$1)] : []); + }; + var getKeyupRules = function (component, simulatedEvent, executeConfig, executeState) { + return executeConfig.useSpace && !inside(component.element()) ? [rule(inSet(SPACE()), stopEventForFirefox)] : []; + }; + var ExecutionType = typical(schema$1, NoState.init, getKeydownRules, getKeyupRules, function () { + return Option.none(); + }); + + var flatgrid = function (spec) { + var dimensions = Cell(Option.none()); + var setGridSize = function (numRows, numColumns) { + dimensions.set(Option.some({ + numRows: constant(numRows), + numColumns: constant(numColumns) + })); + }; + var getNumRows = function () { + return dimensions.get().map(function (d) { + return d.numRows(); + }); + }; + var getNumColumns = function () { + return dimensions.get().map(function (d) { + return d.numColumns(); + }); + }; + return nu$6({ + readState: function () { + return dimensions.get().map(function (d) { + return { + numRows: d.numRows(), + numColumns: d.numColumns() + }; + }).getOr({ + numRows: '?', + numColumns: '?' + }); + }, + setGridSize: setGridSize, + getNumRows: getNumRows, + getNumColumns: getNumColumns + }); + }; + var init = function (spec) { + return spec.state(spec); + }; + + var KeyingState = /*#__PURE__*/Object.freeze({ + flatgrid: flatgrid, + init: init + }); + + var onDirection = function (isLtr, isRtl) { + return function (element) { + return getDirection(element) === 'rtl' ? isRtl : isLtr; + }; + }; + var getDirection = function (element) { + return get$3(element, 'direction') === 'rtl' ? 'rtl' : 'ltr'; + }; + + var useH = function (movement) { + return function (component, simulatedEvent, config, state) { + var move = movement(component.element()); + return use(move, component, simulatedEvent, config, state); + }; + }; + var west = function (moveLeft, moveRight) { + var movement = onDirection(moveLeft, moveRight); + return useH(movement); + }; + var east = function (moveLeft, moveRight) { + var movement = onDirection(moveRight, moveLeft); + return useH(movement); + }; + var useV = function (move) { + return function (component, simulatedEvent, config, state) { + return use(move, component, simulatedEvent, config, state); + }; + }; + var use = function (move, component, simulatedEvent, config, state) { + var outcome = config.focusManager.get(component).bind(function (focused) { + return move(component.element(), focused, config, state); + }); + return outcome.map(function (newFocus) { + config.focusManager.set(component, newFocus); + return true; + }); + }; + var north = useV; + var south = useV; + var move = useV; + + var isHidden = function (dom) { + return dom.offsetWidth <= 0 && dom.offsetHeight <= 0; + }; + var isVisible = function (element) { + var dom = element.dom(); + return !isHidden(dom); + }; + + var indexInfo = MixedBag([ + 'index', + 'candidates' + ], []); + var locate = function (candidates, predicate) { + return findIndex(candidates, predicate).map(function (index) { + return indexInfo({ + index: index, + candidates: candidates + }); + }); + }; + + var locateVisible = function (container, current, selector) { + var predicate = curry(eq, current); + var candidates = descendants(container, selector); + var visible = filter(candidates, isVisible); + return locate(visible, predicate); + }; + var findIndex$1 = function (elements, target) { + return findIndex(elements, function (elem) { + return eq(target, elem); + }); + }; + + var withGrid = function (values, index, numCols, f) { + var oldRow = Math.floor(index / numCols); + var oldColumn = index % numCols; + return f(oldRow, oldColumn).bind(function (address) { + var newIndex = address.row() * numCols + address.column(); + return newIndex >= 0 && newIndex < values.length ? Option.some(values[newIndex]) : Option.none(); + }); + }; + var cycleHorizontal = function (values, index, numRows, numCols, delta) { + return withGrid(values, index, numCols, function (oldRow, oldColumn) { + var onLastRow = oldRow === numRows - 1; + var colsInRow = onLastRow ? values.length - oldRow * numCols : numCols; + var newColumn = cycleBy(oldColumn, delta, 0, colsInRow - 1); + return Option.some({ + row: constant(oldRow), + column: constant(newColumn) + }); + }); + }; + var cycleVertical = function (values, index, numRows, numCols, delta) { + return withGrid(values, index, numCols, function (oldRow, oldColumn) { + var newRow = cycleBy(oldRow, delta, 0, numRows - 1); + var onLastRow = newRow === numRows - 1; + var colsInRow = onLastRow ? values.length - newRow * numCols : numCols; + var newCol = cap(oldColumn, 0, colsInRow - 1); + return Option.some({ + row: constant(newRow), + column: constant(newCol) + }); + }); + }; + var cycleRight = function (values, index, numRows, numCols) { + return cycleHorizontal(values, index, numRows, numCols, +1); + }; + var cycleLeft = function (values, index, numRows, numCols) { + return cycleHorizontal(values, index, numRows, numCols, -1); + }; + var cycleUp = function (values, index, numRows, numCols) { + return cycleVertical(values, index, numRows, numCols, -1); + }; + var cycleDown = function (values, index, numRows, numCols) { + return cycleVertical(values, index, numRows, numCols, +1); + }; + + var schema$2 = [ + strict$1('selector'), + defaulted$1('execute', defaultExecute), + onKeyboardHandler('onEscape'), + defaulted$1('captureTab', false), + initSize() + ]; + var focusIn = function (component, gridConfig, gridState) { + descendant$1(component.element(), gridConfig.selector).each(function (first) { + gridConfig.focusManager.set(component, first); + }); + }; + var findCurrent = function (component, gridConfig) { + return gridConfig.focusManager.get(component).bind(function (elem) { + return closest$2(elem, gridConfig.selector); + }); + }; + var execute$2 = function (component, simulatedEvent, gridConfig, gridState) { + return findCurrent(component, gridConfig).bind(function (focused) { + return gridConfig.execute(component, simulatedEvent, focused); + }); + }; + var doMove = function (cycle) { + return function (element, focused, gridConfig, gridState) { + return locateVisible(element, focused, gridConfig.selector).bind(function (identified) { + return cycle(identified.candidates(), identified.index(), gridState.getNumRows().getOr(gridConfig.initSize.numRows), gridState.getNumColumns().getOr(gridConfig.initSize.numColumns)); + }); + }; + }; + var handleTab = function (component, simulatedEvent, gridConfig, gridState) { + return gridConfig.captureTab ? Option.some(true) : Option.none(); + }; + var doEscape = function (component, simulatedEvent, gridConfig, gridState) { + return gridConfig.onEscape(component, simulatedEvent); + }; + var moveLeft = doMove(cycleLeft); + var moveRight = doMove(cycleRight); + var moveNorth = doMove(cycleUp); + var moveSouth = doMove(cycleDown); + var getKeydownRules$1 = constant([ + rule(inSet(LEFT()), west(moveLeft, moveRight)), + rule(inSet(RIGHT()), east(moveLeft, moveRight)), + rule(inSet(UP()), north(moveNorth)), + rule(inSet(DOWN()), south(moveSouth)), + rule(and([ + isShift, + inSet(TAB()) + ]), handleTab), + rule(and([ + isNotShift, + inSet(TAB()) + ]), handleTab), + rule(inSet(ESCAPE()), doEscape), + rule(inSet(SPACE().concat(ENTER())), execute$2) + ]); + var getKeyupRules$1 = constant([rule(inSet(SPACE()), stopEventForFirefox)]); + var FlatgridType = typical(schema$2, flatgrid, getKeydownRules$1, getKeyupRules$1, function () { + return Option.some(focusIn); + }); + + var horizontal = function (container, selector, current, delta) { + var isDisabledButton = function (candidate) { + return name(candidate) === 'button' && get(candidate, 'disabled') === 'disabled'; + }; + var tryCycle = function (initial, index, candidates) { + var newIndex = cycleBy(index, delta, 0, candidates.length - 1); + if (newIndex === initial) { + return Option.none(); + } else { + return isDisabledButton(candidates[newIndex]) ? tryCycle(initial, newIndex, candidates) : Option.from(candidates[newIndex]); + } + }; + return locateVisible(container, current, selector).bind(function (identified) { + var index = identified.index(); + var candidates = identified.candidates(); + return tryCycle(index, index, candidates); + }); + }; + + var schema$3 = [ + strict$1('selector'), + defaulted$1('getInitial', Option.none), + defaulted$1('execute', defaultExecute), + onKeyboardHandler('onEscape'), + defaulted$1('executeOnMove', false), + defaulted$1('allowVertical', true) + ]; + var findCurrent$1 = function (component, flowConfig) { + return flowConfig.focusManager.get(component).bind(function (elem) { + return closest$2(elem, flowConfig.selector); + }); + }; + var execute$3 = function (component, simulatedEvent, flowConfig) { + return findCurrent$1(component, flowConfig).bind(function (focused) { + return flowConfig.execute(component, simulatedEvent, focused); + }); + }; + var focusIn$1 = function (component, flowConfig) { + flowConfig.getInitial(component).orThunk(function () { + return descendant$1(component.element(), flowConfig.selector); + }).each(function (first) { + flowConfig.focusManager.set(component, first); + }); + }; + var moveLeft$1 = function (element, focused, info) { + return horizontal(element, info.selector, focused, -1); + }; + var moveRight$1 = function (element, focused, info) { + return horizontal(element, info.selector, focused, +1); + }; + var doMove$1 = function (movement) { + return function (component, simulatedEvent, flowConfig) { + return movement(component, simulatedEvent, flowConfig).bind(function () { + return flowConfig.executeOnMove ? execute$3(component, simulatedEvent, flowConfig) : Option.some(true); + }); + }; + }; + var doEscape$1 = function (component, simulatedEvent, flowConfig, _flowState) { + return flowConfig.onEscape(component, simulatedEvent); + }; + var getKeydownRules$2 = function (_component, _se, flowConfig, _flowState) { + var westMovers = LEFT().concat(flowConfig.allowVertical ? UP() : []); + var eastMovers = RIGHT().concat(flowConfig.allowVertical ? DOWN() : []); + return [ + rule(inSet(westMovers), doMove$1(west(moveLeft$1, moveRight$1))), + rule(inSet(eastMovers), doMove$1(east(moveLeft$1, moveRight$1))), + rule(inSet(ENTER()), execute$3), + rule(inSet(SPACE()), execute$3), + rule(inSet(ESCAPE()), doEscape$1) + ]; + }; + var getKeyupRules$2 = constant([rule(inSet(SPACE()), stopEventForFirefox)]); + var FlowType = typical(schema$3, NoState.init, getKeydownRules$2, getKeyupRules$2, function () { + return Option.some(focusIn$1); + }); + + var outcome = MixedBag([ + 'rowIndex', + 'columnIndex', + 'cell' + ], []); + var toCell = function (matrix, rowIndex, columnIndex) { + return Option.from(matrix[rowIndex]).bind(function (row) { + return Option.from(row[columnIndex]).map(function (cell) { + return outcome({ + rowIndex: rowIndex, + columnIndex: columnIndex, + cell: cell + }); + }); + }); + }; + var cycleHorizontal$1 = function (matrix, rowIndex, startCol, deltaCol) { + var row = matrix[rowIndex]; + var colsInRow = row.length; + var newColIndex = cycleBy(startCol, deltaCol, 0, colsInRow - 1); + return toCell(matrix, rowIndex, newColIndex); + }; + var cycleVertical$1 = function (matrix, colIndex, startRow, deltaRow) { + var nextRowIndex = cycleBy(startRow, deltaRow, 0, matrix.length - 1); + var colsInNextRow = matrix[nextRowIndex].length; + var nextColIndex = cap(colIndex, 0, colsInNextRow - 1); + return toCell(matrix, nextRowIndex, nextColIndex); + }; + var moveHorizontal = function (matrix, rowIndex, startCol, deltaCol) { + var row = matrix[rowIndex]; + var colsInRow = row.length; + var newColIndex = cap(startCol + deltaCol, 0, colsInRow - 1); + return toCell(matrix, rowIndex, newColIndex); + }; + var moveVertical = function (matrix, colIndex, startRow, deltaRow) { + var nextRowIndex = cap(startRow + deltaRow, 0, matrix.length - 1); + var colsInNextRow = matrix[nextRowIndex].length; + var nextColIndex = cap(colIndex, 0, colsInNextRow - 1); + return toCell(matrix, nextRowIndex, nextColIndex); + }; + var cycleRight$1 = function (matrix, startRow, startCol) { + return cycleHorizontal$1(matrix, startRow, startCol, +1); + }; + var cycleLeft$1 = function (matrix, startRow, startCol) { + return cycleHorizontal$1(matrix, startRow, startCol, -1); + }; + var cycleUp$1 = function (matrix, startRow, startCol) { + return cycleVertical$1(matrix, startCol, startRow, -1); + }; + var cycleDown$1 = function (matrix, startRow, startCol) { + return cycleVertical$1(matrix, startCol, startRow, +1); + }; + var moveLeft$2 = function (matrix, startRow, startCol) { + return moveHorizontal(matrix, startRow, startCol, -1); + }; + var moveRight$2 = function (matrix, startRow, startCol) { + return moveHorizontal(matrix, startRow, startCol, +1); + }; + var moveUp = function (matrix, startRow, startCol) { + return moveVertical(matrix, startCol, startRow, -1); + }; + var moveDown = function (matrix, startRow, startCol) { + return moveVertical(matrix, startCol, startRow, +1); + }; + + var schema$4 = [ + strictObjOf('selectors', [ + strict$1('row'), + strict$1('cell') + ]), + defaulted$1('cycles', true), + defaulted$1('previousSelector', Option.none), + defaulted$1('execute', defaultExecute) + ]; + var focusIn$2 = function (component, matrixConfig) { + var focused = matrixConfig.previousSelector(component).orThunk(function () { + var selectors = matrixConfig.selectors; + return descendant$1(component.element(), selectors.cell); + }); + focused.each(function (cell) { + matrixConfig.focusManager.set(component, cell); + }); + }; + var execute$4 = function (component, simulatedEvent, matrixConfig) { + return search(component.element()).bind(function (focused) { + return matrixConfig.execute(component, simulatedEvent, focused); + }); + }; + var toMatrix = function (rows, matrixConfig) { + return map$1(rows, function (row) { + return descendants(row, matrixConfig.selectors.cell); + }); + }; + var doMove$2 = function (ifCycle, ifMove) { + return function (element, focused, matrixConfig) { + var move = matrixConfig.cycles ? ifCycle : ifMove; + return closest$2(focused, matrixConfig.selectors.row).bind(function (inRow) { + var cellsInRow = descendants(inRow, matrixConfig.selectors.cell); + return findIndex$1(cellsInRow, focused).bind(function (colIndex) { + var allRows = descendants(element, matrixConfig.selectors.row); + return findIndex$1(allRows, inRow).bind(function (rowIndex) { + var matrix = toMatrix(allRows, matrixConfig); + return move(matrix, rowIndex, colIndex).map(function (next) { + return next.cell(); + }); + }); + }); + }); + }; + }; + var moveLeft$3 = doMove$2(cycleLeft$1, moveLeft$2); + var moveRight$3 = doMove$2(cycleRight$1, moveRight$2); + var moveNorth$1 = doMove$2(cycleUp$1, moveUp); + var moveSouth$1 = doMove$2(cycleDown$1, moveDown); + var getKeydownRules$3 = constant([ + rule(inSet(LEFT()), west(moveLeft$3, moveRight$3)), + rule(inSet(RIGHT()), east(moveLeft$3, moveRight$3)), + rule(inSet(UP()), north(moveNorth$1)), + rule(inSet(DOWN()), south(moveSouth$1)), + rule(inSet(SPACE().concat(ENTER())), execute$4) + ]); + var getKeyupRules$3 = constant([rule(inSet(SPACE()), stopEventForFirefox)]); + var MatrixType = typical(schema$4, NoState.init, getKeydownRules$3, getKeyupRules$3, function () { + return Option.some(focusIn$2); + }); + + var schema$5 = [ + strict$1('selector'), + defaulted$1('execute', defaultExecute), + defaulted$1('moveOnTab', false) + ]; + var execute$5 = function (component, simulatedEvent, menuConfig) { + return menuConfig.focusManager.get(component).bind(function (focused) { + return menuConfig.execute(component, simulatedEvent, focused); + }); + }; + var focusIn$3 = function (component, menuConfig) { + descendant$1(component.element(), menuConfig.selector).each(function (first) { + menuConfig.focusManager.set(component, first); + }); + }; + var moveUp$1 = function (element, focused, info) { + return horizontal(element, info.selector, focused, -1); + }; + var moveDown$1 = function (element, focused, info) { + return horizontal(element, info.selector, focused, +1); + }; + var fireShiftTab = function (component, simulatedEvent, menuConfig) { + return menuConfig.moveOnTab ? move(moveUp$1)(component, simulatedEvent, menuConfig) : Option.none(); + }; + var fireTab = function (component, simulatedEvent, menuConfig) { + return menuConfig.moveOnTab ? move(moveDown$1)(component, simulatedEvent, menuConfig) : Option.none(); + }; + var getKeydownRules$4 = constant([ + rule(inSet(UP()), move(moveUp$1)), + rule(inSet(DOWN()), move(moveDown$1)), + rule(and([ + isShift, + inSet(TAB()) + ]), fireShiftTab), + rule(and([ + isNotShift, + inSet(TAB()) + ]), fireTab), + rule(inSet(ENTER()), execute$5), + rule(inSet(SPACE()), execute$5) + ]); + var getKeyupRules$4 = constant([rule(inSet(SPACE()), stopEventForFirefox)]); + var MenuType = typical(schema$5, NoState.init, getKeydownRules$4, getKeyupRules$4, function () { + return Option.some(focusIn$3); + }); + + var schema$6 = [ + onKeyboardHandler('onSpace'), + onKeyboardHandler('onEnter'), + onKeyboardHandler('onShiftEnter'), + onKeyboardHandler('onLeft'), + onKeyboardHandler('onRight'), + onKeyboardHandler('onTab'), + onKeyboardHandler('onShiftTab'), + onKeyboardHandler('onUp'), + onKeyboardHandler('onDown'), + onKeyboardHandler('onEscape'), + defaulted$1('stopSpaceKeyup', false), + option('focusIn') + ]; + var getKeydownRules$5 = function (component, simulatedEvent, specialInfo) { + return [ + rule(inSet(SPACE()), specialInfo.onSpace), + rule(and([ + isNotShift, + inSet(ENTER()) + ]), specialInfo.onEnter), + rule(and([ + isShift, + inSet(ENTER()) + ]), specialInfo.onShiftEnter), + rule(and([ + isShift, + inSet(TAB()) + ]), specialInfo.onShiftTab), + rule(and([ + isNotShift, + inSet(TAB()) + ]), specialInfo.onTab), + rule(inSet(UP()), specialInfo.onUp), + rule(inSet(DOWN()), specialInfo.onDown), + rule(inSet(LEFT()), specialInfo.onLeft), + rule(inSet(RIGHT()), specialInfo.onRight), + rule(inSet(SPACE()), specialInfo.onSpace), + rule(inSet(ESCAPE()), specialInfo.onEscape) + ]; + }; + var getKeyupRules$5 = function (component, simulatedEvent, specialInfo) { + return specialInfo.stopSpaceKeyup ? [rule(inSet(SPACE()), stopEventForFirefox)] : []; + }; + var SpecialType = typical(schema$6, NoState.init, getKeydownRules$5, getKeyupRules$5, function (specialInfo) { + return specialInfo.focusIn; + }); + + var acyclic = AcyclicType.schema(); + var cyclic = CyclicType.schema(); + var flow = FlowType.schema(); + var flatgrid$1 = FlatgridType.schema(); + var matrix = MatrixType.schema(); + var execution = ExecutionType.schema(); + var menu = MenuType.schema(); + var special = SpecialType.schema(); + + var KeyboardBranches = /*#__PURE__*/Object.freeze({ + acyclic: acyclic, + cyclic: cyclic, + flow: flow, + flatgrid: flatgrid$1, + matrix: matrix, + execution: execution, + menu: menu, + special: special + }); + + var Keying = createModes$1({ + branchKey: 'mode', + branches: KeyboardBranches, + name: 'keying', + active: { + events: function (keyingConfig, keyingState) { + var handler = keyingConfig.handler; + return handler.toEvents(keyingConfig, keyingState); + } + }, + apis: { + focusIn: function (component, keyConfig, keyState) { + keyConfig.sendFocusIn(keyConfig).fold(function () { + component.getSystem().triggerFocus(component.element(), component.element()); + }, function (sendFocusIn) { + sendFocusIn(component, keyConfig, keyState); + }); + }, + setGridSize: function (component, keyConfig, keyState, numRows, numColumns) { + if (!hasKey$1(keyState, 'setGridSize')) { + domGlobals.console.error('Layout does not support setGridSize'); + } else { + keyState.setGridSize(numRows, numColumns); + } + } + }, + state: KeyingState + }); + + var field$1 = function (name, forbidden) { + return defaultedObjOf(name, {}, map$1(forbidden, function (f) { + return forbid(f.name(), 'Cannot configure ' + f.name() + ' for ' + name); + }).concat([state$1('dump', identity)])); + }; + var get$5 = function (data) { + return data.dump; + }; + var augment = function (data, original) { + return __assign(__assign({}, data.dump), derive$1(original)); + }; + var SketchBehaviours = { + field: field$1, + augment: augment, + get: get$5 + }; + + var _placeholder = 'placeholder'; + var adt$2 = Adt.generate([ + { + single: [ + 'required', + 'valueThunk' + ] + }, + { + multiple: [ + 'required', + 'valueThunks' + ] + } + ]); + var subPlaceholder = function (owner, detail, compSpec, placeholders) { + if (owner.exists(function (o) { + return o !== compSpec.owner; + })) { + return adt$2.single(true, constant(compSpec)); + } + return readOptFrom$1(placeholders, compSpec.name).fold(function () { + throw new Error('Unknown placeholder component: ' + compSpec.name + '\nKnown: [' + keys(placeholders) + ']\nNamespace: ' + owner.getOr('none') + '\nSpec: ' + JSON.stringify(compSpec, null, 2)); + }, function (newSpec) { + return newSpec.replace(); + }); + }; + var scan = function (owner, detail, compSpec, placeholders) { + if (compSpec.uiType === _placeholder) { + return subPlaceholder(owner, detail, compSpec, placeholders); + } else { + return adt$2.single(false, constant(compSpec)); + } + }; + var substitute = function (owner, detail, compSpec, placeholders) { + var base = scan(owner, detail, compSpec, placeholders); + return base.fold(function (req, valueThunk) { + var value = valueThunk(detail, compSpec.config, compSpec.validated); + var childSpecs = readOptFrom$1(value, 'components').getOr([]); + var substituted = bind(childSpecs, function (c) { + return substitute(owner, detail, c, placeholders); + }); + return [__assign(__assign({}, value), { components: substituted })]; + }, function (req, valuesThunk) { + var values = valuesThunk(detail, compSpec.config, compSpec.validated); + var preprocessor = compSpec.validated.preprocess.getOr(identity); + return preprocessor(values); + }); + }; + var substituteAll = function (owner, detail, components, placeholders) { + return bind(components, function (c) { + return substitute(owner, detail, c, placeholders); + }); + }; + var oneReplace = function (label, replacements) { + var called = false; + var used = function () { + return called; + }; + var replace = function () { + if (called === true) { + throw new Error('Trying to use the same placeholder more than once: ' + label); + } + called = true; + return replacements; + }; + var required = function () { + return replacements.fold(function (req, _) { + return req; + }, function (req, _) { + return req; + }); + }; + return { + name: constant(label), + required: required, + used: used, + replace: replace + }; + }; + var substitutePlaces = function (owner, detail, components, placeholders) { + var ps = map(placeholders, function (ph, name) { + return oneReplace(name, ph); + }); + var outcome = substituteAll(owner, detail, components, ps); + each(ps, function (p) { + if (p.used() === false && p.required()) { + throw new Error('Placeholder: ' + p.name() + ' was not found in components list\nNamespace: ' + owner.getOr('none') + '\nComponents: ' + JSON.stringify(detail.components, null, 2)); + } + }); + return outcome; + }; + var single = adt$2.single; + var multiple = adt$2.multiple; + var placeholder = constant(_placeholder); + + 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 adt$3 = Adt.generate([ + { required: ['data'] }, + { external: ['data'] }, + { optional: ['data'] }, + { group: ['data'] } + ]); + var fFactory = defaulted$1('factory', { sketch: identity }); + var fSchema = defaulted$1('schema', []); + var fName = strict$1('name'); + var fPname = field('pname', 'pname', defaultedThunk(function (typeSpec) { + return ''; + }), anyValue$1()); + var fGroupSchema = state$1('schema', function () { + return [option('preprocess')]; + }); + var fDefaults = defaulted$1('defaults', constant({})); + var fOverrides = defaulted$1('overrides', constant({})); + var requiredSpec = objOf([ + fFactory, + fSchema, + fName, + fPname, + fDefaults, + fOverrides + ]); + var optionalSpec = objOf([ + fFactory, + fSchema, + fName, + fPname, + fDefaults, + fOverrides + ]); + var groupSpec = objOf([ + fFactory, + fGroupSchema, + fName, + strict$1('unit'), + fPname, + fDefaults, + fOverrides + ]); + var asNamedPart = function (part) { + return part.fold(Option.some, Option.none, Option.some, Option.some); + }; + var name$1 = function (part) { + var get = function (data) { + return data.name; + }; + return part.fold(get, get, get, get); + }; + var convert = function (adtConstructor, partSchema) { + return function (spec) { + var data = asRawOrDie('Converting part type', partSchema, spec); + return adtConstructor(data); + }; + }; + var required = convert(adt$3.required, requiredSpec); + var optional = convert(adt$3.optional, optionalSpec); + var group = convert(adt$3.group, groupSpec); + var original = constant('entirety'); + + var combine = function (detail, data, partSpec, partValidated) { + return deepMerge(data.defaults(detail, partSpec, partValidated), partSpec, { uid: detail.partUids[data.name] }, data.overrides(detail, partSpec, partValidated)); + }; + var subs = function (owner, detail, parts) { + var internals = {}; + var externals = {}; + each$1(parts, function (part) { + part.fold(function (data) { + internals[data.pname] = single(true, function (detail, partSpec, partValidated) { + return data.factory.sketch(combine(detail, data, partSpec, partValidated)); + }); + }, function (data) { + var partSpec = detail.parts[data.name]; + externals[data.name] = constant(data.factory.sketch(combine(detail, data, partSpec[original()]), partSpec)); + }, function (data) { + internals[data.pname] = single(false, function (detail, partSpec, partValidated) { + return data.factory.sketch(combine(detail, data, partSpec, partValidated)); + }); + }, function (data) { + internals[data.pname] = multiple(true, function (detail, _partSpec, _partValidated) { + var units = detail[data.name]; + return map$1(units, function (u) { + return data.factory.sketch(deepMerge(data.defaults(detail, u, _partValidated), u, data.overrides(detail, u))); + }); + }); + }); + }); + return { + internals: constant(internals), + externals: constant(externals) + }; + }; + + var generate$2 = function (owner, parts) { + var r = {}; + each$1(parts, function (part) { + asNamedPart(part).each(function (np) { + var g = doGenerateOne(owner, np.pname); + r[np.name] = function (config) { + var validated = asRawOrDie('Part: ' + np.name + ' in ' + owner, objOf(np.schema), config); + return __assign(__assign({}, g), { + config: config, + validated: validated + }); + }; + }); + }); + return r; + }; + var doGenerateOne = function (owner, pname) { + return { + uiType: placeholder(), + owner: owner, + name: pname + }; + }; + var generateOne = function (owner, pname, config) { + return { + uiType: placeholder(), + owner: owner, + name: pname, + config: config, + validated: {} + }; + }; + var schemas = function (parts) { + return bind(parts, function (part) { + return part.fold(Option.none, Option.some, Option.none, Option.none).map(function (data) { + return strictObjOf(data.name, data.schema.concat([snapshot(original())])); + }).toArray(); + }); + }; + var names = function (parts) { + return map$1(parts, name$1); + }; + var substitutes = function (owner, detail, parts) { + return subs(owner, detail, parts); + }; + var components = function (owner, detail, internals) { + return substitutePlaces(Option.some(owner), detail, detail.components, internals); + }; + var getPart = function (component, detail, partKey) { + var uid = detail.partUids[partKey]; + return component.getSystem().getByUid(uid).toOption(); + }; + var getPartOrDie = function (component, detail, partKey) { + return getPart(component, detail, partKey).getOrDie('Could not find part: ' + partKey); + }; + var getAllParts = function (component, detail) { + var system = component.getSystem(); + return map(detail.partUids, function (pUid, k) { + return constant(system.getByUid(pUid)); + }); + }; + var defaultUids = function (baseUid, partTypes) { + var partNames = names(partTypes); + return wrapAll$1(map$1(partNames, function (pn) { + return { + key: pn, + value: baseUid + '-' + pn + }; + })); + }; + var defaultUidsSchema = function (partTypes) { + return field('partUids', 'partUids', mergeWithThunk(function (spec) { + return defaultUids(spec.uid, partTypes); + }), anyValue$1()); + }; + + var premadeTag = generate$1('alloy-premade'); + var premade = function (comp) { + return wrap$1(premadeTag, comp); + }; + var getPremade = function (spec) { + return readOptFrom$1(spec, premadeTag); + }; + var makeApi = function (f) { + return markAsSketchApi(function (component) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + return f.apply(undefined, [component.getApis()].concat([component].concat(rest))); + }, f); + }; + + var prefix$1 = constant('alloy-id-'); + var idAttr = constant('data-alloy-id'); + + var prefix$2 = prefix$1(); + var idAttr$1 = idAttr(); + var write = function (label, elem) { + var id = generate$1(prefix$2 + label); + writeOnly(elem, id); + return id; + }; + var writeOnly = function (elem, uid) { + Object.defineProperty(elem.dom(), idAttr$1, { + value: uid, + writable: true + }); + }; + var read$2 = function (elem) { + var id = isElement(elem) ? elem.dom()[idAttr$1] : null; + return Option.from(id); + }; + var generate$3 = function (prefix) { + return generate$1(prefix); + }; + + var base = function (partSchemas, partUidsSchemas) { + var ps = partSchemas.length > 0 ? [strictObjOf('parts', partSchemas)] : []; + return ps.concat([ + strict$1('uid'), + defaulted$1('dom', {}), + defaulted$1('components', []), + snapshot('originalSpec'), + defaulted$1('debug.sketcher', {}) + ]).concat(partUidsSchemas); + }; + var asRawOrDie$1 = function (label, schema, spec, partSchemas, partUidsSchemas) { + var baseS = base(partSchemas, partUidsSchemas); + return asRawOrDie(label + ' [SpecSchema]', objOfOnly(baseS.concat(schema)), spec); + }; + + var single$1 = function (owner, schema, factory, spec) { + var specWithUid = supplyUid(spec); + var detail = asRawOrDie$1(owner, schema, specWithUid, [], []); + return factory(detail, specWithUid); + }; + var composite = function (owner, schema, partTypes, factory, spec) { + var specWithUid = supplyUid(spec); + var partSchemas = schemas(partTypes); + var partUidsSchema = defaultUidsSchema(partTypes); + var detail = asRawOrDie$1(owner, schema, specWithUid, partSchemas, [partUidsSchema]); + var subs = substitutes(owner, detail, partTypes); + var components$1 = components(owner, detail, subs.internals()); + return factory(detail, components$1, specWithUid, subs.externals()); + }; + var supplyUid = function (spec) { + return spec.hasOwnProperty('uid') ? spec : __assign(__assign({}, spec), { uid: generate$3('uid') }); + }; + + function isSketchSpec(spec) { + return spec.uid !== undefined; + } + var singleSchema = objOfOnly([ + strict$1('name'), + strict$1('factory'), + strict$1('configFields'), + defaulted$1('apis', {}), + defaulted$1('extraApis', {}) + ]); + var compositeSchema = objOfOnly([ + strict$1('name'), + strict$1('factory'), + strict$1('configFields'), + strict$1('partFields'), + defaulted$1('apis', {}), + defaulted$1('extraApis', {}) + ]); + var single$2 = function (rawConfig) { + var config = asRawOrDie('Sketcher for ' + rawConfig.name, singleSchema, rawConfig); + var sketch = function (spec) { + return single$1(config.name, config.configFields, config.factory, spec); + }; + var apis = map(config.apis, makeApi); + var extraApis = map(config.extraApis, function (f, k) { + return markAsExtraApi(f, k); + }); + return __assign(__assign({ + name: constant(config.name), + partFields: constant([]), + configFields: constant(config.configFields), + sketch: sketch + }, apis), extraApis); + }; + var composite$1 = function (rawConfig) { + var config = asRawOrDie('Sketcher for ' + rawConfig.name, compositeSchema, rawConfig); + var sketch = function (spec) { + return composite(config.name, config.configFields, config.partFields, config.factory, spec); + }; + var parts = generate$2(config.name, config.partFields); + var apis = map(config.apis, makeApi); + var extraApis = map(config.extraApis, function (f, k) { + return markAsExtraApi(f, k); + }); + return __assign(__assign({ + name: constant(config.name), + partFields: constant(config.partFields), + configFields: constant(config.configFields), + sketch: sketch, + parts: constant(parts) + }, apis), extraApis); + }; + + var factory = function (detail) { + var events = events$2(detail.action); + var tag = detail.dom.tag; + var lookupAttr = function (attr) { + return readOptFrom$1(detail.dom, 'attributes').bind(function (attrs) { + return readOptFrom$1(attrs, attr); + }); + }; + var getModAttributes = function () { + if (tag === 'button') { + var type = lookupAttr('type').getOr('button'); + var roleAttrs = lookupAttr('role').map(function (role) { + return { role: role }; + }).getOr({}); + return __assign({ type: type }, roleAttrs); + } else { + var role = lookupAttr('role').getOr('button'); + return { role: role }; + } + }; + return { + uid: detail.uid, + dom: detail.dom, + components: detail.components, + events: events, + behaviours: SketchBehaviours.augment(detail.buttonBehaviours, [ + Focusing.config({}), + Keying.config({ + mode: 'execution', + useSpace: true, + useEnter: true + }) + ]), + domModification: { attributes: getModAttributes() }, + eventOrder: detail.eventOrder + }; + }; + var Button = single$2({ + name: 'Button', + factory: factory, + configFields: [ + defaulted$1('uid', undefined), + strict$1('dom'), + defaulted$1('components', []), + SketchBehaviours.field('buttonBehaviours', [ + Focusing, + Keying + ]), + option('action'), + option('role'), + defaulted$1('eventOrder', {}) + ] + }); + + var exhibit$2 = function (base, unselectConfig) { + return nu$5({ + styles: { + '-webkit-user-select': 'none', + 'user-select': 'none', + '-ms-user-select': 'none', + '-moz-user-select': '-moz-none' + }, + attributes: { unselectable: 'on' } + }); + }; + var events$4 = function (unselectConfig) { + return derive([abort(selectstart(), constant(true))]); + }; + + var ActiveUnselecting = /*#__PURE__*/Object.freeze({ + events: events$4, + exhibit: exhibit$2 + }); + + var Unselecting = create$1({ + fields: [], + name: 'unselecting', + active: ActiveUnselecting + }); + + var getAttrs = function (elem) { + var attributes = elem.dom().attributes !== undefined ? elem.dom().attributes : []; + return foldl(attributes, function (b, attr) { + var _a; + if (attr.name === 'class') { + return b; + } else { + return __assign(__assign({}, b), (_a = {}, _a[attr.name] = attr.value, _a)); + } + }, {}); + }; + var getClasses = function (elem) { + return Array.prototype.slice.call(elem.dom().classList, 0); + }; + var fromHtml$2 = function (html) { + var elem = Element.fromHtml(html); + var children$1 = children(elem); + var attrs = getAttrs(elem); + var classes = getClasses(elem); + var contents = children$1.length === 0 ? {} : { innerHtml: get$2(elem) }; + return __assign({ + tag: name(elem), + classes: classes, + attributes: attrs + }, contents); + }; + + var dom$1 = function (rawHtml) { + var html = supplant(rawHtml, { prefix: Styles.prefix() }); + return fromHtml$2(html); + }; + var spec = function (rawHtml) { + var sDom = dom$1(rawHtml); + return { dom: sDom }; + }; + + var forToolbarCommand = function (editor, command) { + return forToolbar(command, function () { + editor.execCommand(command); + }, {}, editor); + }; + var getToggleBehaviours = function (command) { + return derive$1([ + Toggling.config({ + toggleClass: Styles.resolve('toolbar-button-selected'), + toggleOnExecute: false, + aria: { mode: 'pressed' } + }), + Receivers.format(command, function (button, status) { + var toggle = status ? Toggling.on : Toggling.off; + toggle(button); + }) + ]); + }; + var forToolbarStateCommand = function (editor, command) { + var extraBehaviours = getToggleBehaviours(command); + return forToolbar(command, function () { + editor.execCommand(command); + }, extraBehaviours, editor); + }; + var forToolbarStateAction = function (editor, clazz, command, action) { + var extraBehaviours = getToggleBehaviours(command); + return forToolbar(clazz, action, extraBehaviours, editor); + }; + var getToolbarIconButton = function (clazz, editor) { + var icons = editor.ui.registry.getAll().icons; + var optOxideIcon = Option.from(icons[clazz]); + return optOxideIcon.fold(function () { + return dom$1(''); + }, function (icon) { + return dom$1('' + icon + ''); + }); + }; + var forToolbar = function (clazz, action, extraBehaviours, editor) { + return Button.sketch({ + dom: getToolbarIconButton(clazz, editor), + action: action, + buttonBehaviours: deepMerge(derive$1([Unselecting.config({})]), extraBehaviours) + }); + }; + var Buttons = { + forToolbar: forToolbar, + forToolbarCommand: forToolbarCommand, + forToolbarStateAction: forToolbarStateAction, + forToolbarStateCommand: forToolbarStateCommand, + getToolbarIconButton: getToolbarIconButton + }; + + var labelPart = optional({ + schema: [strict$1('dom')], + name: 'label' + }); + var edgePart = function (name) { + return optional({ + name: '' + name + '-edge', + overrides: function (detail) { + var action = detail.model.manager.edgeActions[name]; + return action.fold(function () { + return {}; + }, function (a) { + return { + events: derive([ + runActionExtra(touchstart(), a, [detail]), + runActionExtra(mousedown(), a, [detail]), + runActionExtra(mousemove(), function (l, se, det) { + if (det.mouseIsDown.get()) { + a(l, det); + } + }, [detail]) + ]) + }; + }); + } + }); + }; + var tlEdgePart = edgePart('top-left'); + var tedgePart = edgePart('top'); + var trEdgePart = edgePart('top-right'); + var redgePart = edgePart('right'); + var brEdgePart = edgePart('bottom-right'); + var bedgePart = edgePart('bottom'); + var blEdgePart = edgePart('bottom-left'); + var ledgePart = edgePart('left'); + var thumbPart = required({ + name: 'thumb', + defaults: constant({ dom: { styles: { position: 'absolute' } } }), + overrides: function (detail) { + return { + events: derive([ + redirectToPart(touchstart(), detail, 'spectrum'), + redirectToPart(touchmove(), detail, 'spectrum'), + redirectToPart(touchend(), detail, 'spectrum'), + redirectToPart(mousedown(), detail, 'spectrum'), + redirectToPart(mousemove(), detail, 'spectrum'), + redirectToPart(mouseup(), detail, 'spectrum') + ]) + }; + } + }); + var spectrumPart = required({ + schema: [state$1('mouseIsDown', function () { + return Cell(false); + })], + name: 'spectrum', + overrides: function (detail) { + var modelDetail = detail.model; + var model = modelDetail.manager; + var setValueFrom = function (component, simulatedEvent) { + return model.getValueFromEvent(simulatedEvent).map(function (value) { + return model.setValueFrom(component, detail, value); + }); + }; + return { + behaviours: derive$1([ + Keying.config({ + mode: 'special', + onLeft: function (spectrum) { + return model.onLeft(spectrum, detail); + }, + onRight: function (spectrum) { + return model.onRight(spectrum, detail); + }, + onUp: function (spectrum) { + return model.onUp(spectrum, detail); + }, + onDown: function (spectrum) { + return model.onDown(spectrum, detail); + } + }), + Focusing.config({}) + ]), + events: derive([ + run(touchstart(), setValueFrom), + run(touchmove(), setValueFrom), + run(mousedown(), setValueFrom), + run(mousemove(), function (spectrum, se) { + if (detail.mouseIsDown.get()) { + setValueFrom(spectrum, se); + } + }) + ]) + }; + } + }); + var SliderParts = [ + labelPart, + ledgePart, + redgePart, + tedgePart, + bedgePart, + tlEdgePart, + trEdgePart, + blEdgePart, + brEdgePart, + thumbPart, + spectrumPart + ]; + + var onLoad$1 = function (component, repConfig, repState) { + repConfig.store.manager.onLoad(component, repConfig, repState); + }; + var onUnload = function (component, repConfig, repState) { + repConfig.store.manager.onUnload(component, repConfig, repState); + }; + var setValue = function (component, repConfig, repState, data) { + repConfig.store.manager.setValue(component, repConfig, repState, data); + }; + var getValue = function (component, repConfig, repState) { + return repConfig.store.manager.getValue(component, repConfig, repState); + }; + var getState = function (component, repConfig, repState) { + return repState; + }; + + var RepresentApis = /*#__PURE__*/Object.freeze({ + onLoad: onLoad$1, + onUnload: onUnload, + setValue: setValue, + getValue: getValue, + getState: getState + }); + + var events$5 = function (repConfig, repState) { + var es = repConfig.resetOnDom ? [ + runOnAttached(function (comp, se) { + onLoad$1(comp, repConfig, repState); + }), + runOnDetached(function (comp, se) { + onUnload(comp, repConfig, repState); + }) + ] : [loadEvent(repConfig, repState, onLoad$1)]; + return derive(es); + }; + + var ActiveRepresenting = /*#__PURE__*/Object.freeze({ + events: events$5 + }); + + var memory = function () { + var data = Cell(null); + var readState = function () { + return { + mode: 'memory', + value: data.get() + }; + }; + var isNotSet = function () { + return data.get() === null; + }; + var clear = function () { + data.set(null); + }; + return nu$6({ + set: data.set, + get: data.get, + isNotSet: isNotSet, + clear: clear, + readState: readState + }); + }; + var manual = function () { + var readState = function () { + }; + return nu$6({ readState: readState }); + }; + var dataset = function () { + var dataByValue = Cell({}); + var dataByText = Cell({}); + var readState = function () { + return { + mode: 'dataset', + dataByValue: dataByValue.get(), + dataByText: dataByText.get() + }; + }; + var clear = function () { + dataByValue.set({}); + dataByText.set({}); + }; + var lookup = function (itemString) { + return readOptFrom$1(dataByValue.get(), itemString).orThunk(function () { + return readOptFrom$1(dataByText.get(), itemString); + }); + }; + var update = function (items) { + var currentDataByValue = dataByValue.get(); + var currentDataByText = dataByText.get(); + var newDataByValue = {}; + var newDataByText = {}; + each$1(items, function (item) { + newDataByValue[item.value] = item; + readOptFrom$1(item, 'meta').each(function (meta) { + readOptFrom$1(meta, 'text').each(function (text) { + newDataByText[text] = item; + }); + }); + }); + dataByValue.set(__assign(__assign({}, currentDataByValue), newDataByValue)); + dataByText.set(__assign(__assign({}, currentDataByText), newDataByText)); + }; + return nu$6({ + readState: readState, + lookup: lookup, + update: update, + clear: clear + }); + }; + var init$1 = function (spec) { + return spec.store.manager.state(spec); + }; + + var RepresentState = /*#__PURE__*/Object.freeze({ + memory: memory, + dataset: dataset, + manual: manual, + init: init$1 + }); + + var setValue$1 = function (component, repConfig, repState, data) { + var store = repConfig.store; + repState.update([data]); + store.setValue(component, data); + repConfig.onSetValue(component, data); + }; + var getValue$1 = function (component, repConfig, repState) { + var store = repConfig.store; + var key = store.getDataKey(component); + return repState.lookup(key).fold(function () { + return store.getFallbackEntry(key); + }, function (data) { + return data; + }); + }; + var onLoad$2 = function (component, repConfig, repState) { + var store = repConfig.store; + store.initialValue.each(function (data) { + setValue$1(component, repConfig, repState, data); + }); + }; + var onUnload$1 = function (component, repConfig, repState) { + repState.clear(); + }; + var DatasetStore = [ + option('initialValue'), + strict$1('getFallbackEntry'), + strict$1('getDataKey'), + strict$1('setValue'), + output('manager', { + setValue: setValue$1, + getValue: getValue$1, + onLoad: onLoad$2, + onUnload: onUnload$1, + state: dataset + }) + ]; + + var getValue$2 = function (component, repConfig, repState) { + return repConfig.store.getValue(component); + }; + var setValue$2 = function (component, repConfig, repState, data) { + repConfig.store.setValue(component, data); + repConfig.onSetValue(component, data); + }; + var onLoad$3 = function (component, repConfig, repState) { + repConfig.store.initialValue.each(function (data) { + repConfig.store.setValue(component, data); + }); + }; + var ManualStore = [ + strict$1('getValue'), + defaulted$1('setValue', noop), + option('initialValue'), + output('manager', { + setValue: setValue$2, + getValue: getValue$2, + onLoad: onLoad$3, + onUnload: noop, + state: NoState.init + }) + ]; + + var setValue$3 = function (component, repConfig, repState, data) { + repState.set(data); + repConfig.onSetValue(component, data); + }; + var getValue$3 = function (component, repConfig, repState) { + return repState.get(); + }; + var onLoad$4 = function (component, repConfig, repState) { + repConfig.store.initialValue.each(function (initVal) { + if (repState.isNotSet()) { + repState.set(initVal); + } + }); + }; + var onUnload$2 = function (component, repConfig, repState) { + repState.clear(); + }; + var MemoryStore = [ + option('initialValue'), + output('manager', { + setValue: setValue$3, + getValue: getValue$3, + onLoad: onLoad$4, + onUnload: onUnload$2, + state: memory + }) + ]; + + var RepresentSchema = [ + defaultedOf('store', { mode: 'memory' }, choose$1('mode', { + memory: MemoryStore, + manual: ManualStore, + dataset: DatasetStore + })), + onHandler('onSetValue'), + defaulted$1('resetOnDom', false) + ]; + + var Representing = create$1({ + fields: RepresentSchema, + name: 'representing', + active: ActiveRepresenting, + apis: RepresentApis, + extra: { + setValueFrom: function (component, source) { + var value = Representing.getValue(source); + Representing.setValue(component, value); + } + }, + state: RepresentState + }); + + var api$1 = Dimension('width', function (element) { + return element.dom().offsetWidth; + }); + var set$4 = function (element, h) { + api$1.set(element, h); + }; + var get$6 = function (element) { + return api$1.get(element); + }; + + var r = function (left, top) { + var translate = function (x, y) { + return r(left + x, top + y); + }; + return { + left: constant(left), + top: constant(top), + translate: translate + }; + }; + var Position = r; + + var _sliderChangeEvent = 'slider.change.value'; + var sliderChangeEvent = constant(_sliderChangeEvent); + var isTouchEvent = function (evt) { + return evt.type.indexOf('touch') !== -1; + }; + var getEventSource = function (simulatedEvent) { + var evt = simulatedEvent.event().raw(); + if (isTouchEvent(evt)) { + var touchEvent = evt; + return touchEvent.touches !== undefined && touchEvent.touches.length === 1 ? Option.some(touchEvent.touches[0]).map(function (t) { + return Position(t.clientX, t.clientY); + }) : Option.none(); + } else { + var mouseEvent = evt; + return mouseEvent.clientX !== undefined ? Option.some(mouseEvent).map(function (me) { + return Position(me.clientX, me.clientY); + }) : Option.none(); + } + }; + + var t = 'top', r$1 = 'right', b = 'bottom', l = 'left'; + var minX = function (detail) { + return detail.model.minX; + }; + var minY = function (detail) { + return detail.model.minY; + }; + var min1X = function (detail) { + return detail.model.minX - 1; + }; + var min1Y = function (detail) { + return detail.model.minY - 1; + }; + var maxX = function (detail) { + return detail.model.maxX; + }; + var maxY = function (detail) { + return detail.model.maxY; + }; + var max1X = function (detail) { + return detail.model.maxX + 1; + }; + var max1Y = function (detail) { + return detail.model.maxY + 1; + }; + var range = function (detail, max, min) { + return max(detail) - min(detail); + }; + var xRange = function (detail) { + return range(detail, maxX, minX); + }; + var yRange = function (detail) { + return range(detail, maxY, minY); + }; + var halfX = function (detail) { + return xRange(detail) / 2; + }; + var halfY = function (detail) { + return yRange(detail) / 2; + }; + var step = function (detail) { + return detail.stepSize; + }; + var snap = function (detail) { + return detail.snapToGrid; + }; + var snapStart = function (detail) { + return detail.snapStart; + }; + var rounded = function (detail) { + return detail.rounded; + }; + var hasEdge = function (detail, edgeName) { + return detail[edgeName + '-edge'] !== undefined; + }; + var hasLEdge = function (detail) { + return hasEdge(detail, l); + }; + var hasREdge = function (detail) { + return hasEdge(detail, r$1); + }; + var hasTEdge = function (detail) { + return hasEdge(detail, t); + }; + var hasBEdge = function (detail) { + return hasEdge(detail, b); + }; + var currentValue = function (detail) { + return detail.model.value.get(); + }; + + var xValue = function (x) { + return { x: constant(x) }; + }; + var yValue = function (y) { + return { y: constant(y) }; + }; + var xyValue = function (x, y) { + return { + x: constant(x), + y: constant(y) + }; + }; + var fireSliderChange = function (component, value) { + emitWith(component, sliderChangeEvent(), { value: value }); + }; + var setToTLEdgeXY = function (edge, detail) { + fireSliderChange(edge, xyValue(min1X(detail), min1Y(detail))); + }; + var setToTEdge = function (edge, detail) { + fireSliderChange(edge, yValue(min1Y(detail))); + }; + var setToTEdgeXY = function (edge, detail) { + fireSliderChange(edge, xyValue(halfX(detail), min1Y(detail))); + }; + var setToTREdgeXY = function (edge, detail) { + fireSliderChange(edge, xyValue(max1X(detail), min1Y(detail))); + }; + var setToREdge = function (edge, detail) { + fireSliderChange(edge, xValue(max1X(detail))); + }; + var setToREdgeXY = function (edge, detail) { + fireSliderChange(edge, xyValue(max1X(detail), halfY(detail))); + }; + var setToBREdgeXY = function (edge, detail) { + fireSliderChange(edge, xyValue(max1X(detail), max1Y(detail))); + }; + var setToBEdge = function (edge, detail) { + fireSliderChange(edge, yValue(max1Y(detail))); + }; + var setToBEdgeXY = function (edge, detail) { + fireSliderChange(edge, xyValue(halfX(detail), max1Y(detail))); + }; + var setToBLEdgeXY = function (edge, detail) { + fireSliderChange(edge, xyValue(min1X(detail), max1Y(detail))); + }; + var setToLEdge = function (edge, detail) { + fireSliderChange(edge, xValue(min1X(detail))); + }; + var setToLEdgeXY = function (edge, detail) { + fireSliderChange(edge, xyValue(min1X(detail), halfY(detail))); + }; + + var reduceBy = function (value, min, max, step) { + if (value < min) { + return value; + } else if (value > max) { + return max; + } else if (value === min) { + return min - 1; + } else { + return Math.max(min, value - step); + } + }; + var increaseBy = function (value, min, max, step) { + if (value > max) { + return value; + } else if (value < min) { + return min; + } else if (value === max) { + return max + 1; + } else { + return Math.min(max, value + step); + } + }; + var capValue = function (value, min, max) { + return Math.max(min, Math.min(max, value)); + }; + var snapValueOf = function (value, min, max, step, snapStart) { + return snapStart.fold(function () { + var initValue = value - min; + var extraValue = Math.round(initValue / step) * step; + return capValue(min + extraValue, min - 1, max + 1); + }, function (start) { + var remainder = (value - start) % step; + var adjustment = Math.round(remainder / step); + var rawSteps = Math.floor((value - start) / step); + var maxSteps = Math.floor((max - start) / step); + var numSteps = Math.min(maxSteps, rawSteps + adjustment); + var r = start + numSteps * step; + return Math.max(start, r); + }); + }; + var findOffsetOf = function (value, min, max) { + return Math.min(max, Math.max(value, min)) - min; + }; + var findValueOf = function (args) { + var min = args.min, max = args.max, range = args.range, value = args.value, step = args.step, snap = args.snap, snapStart = args.snapStart, rounded = args.rounded, hasMinEdge = args.hasMinEdge, hasMaxEdge = args.hasMaxEdge, minBound = args.minBound, maxBound = args.maxBound, screenRange = args.screenRange; + var capMin = hasMinEdge ? min - 1 : min; + var capMax = hasMaxEdge ? max + 1 : max; + if (value < minBound) { + return capMin; + } else if (value > maxBound) { + return capMax; + } else { + var offset = findOffsetOf(value, minBound, maxBound); + var newValue = capValue(offset / screenRange * range + min, capMin, capMax); + if (snap && newValue >= min && newValue <= max) { + return snapValueOf(newValue, min, max, step, snapStart); + } else if (rounded) { + return Math.round(newValue); + } else { + return newValue; + } + } + }; + var findOffsetOfValue = function (args) { + var min = args.min, max = args.max, range = args.range, value = args.value, hasMinEdge = args.hasMinEdge, hasMaxEdge = args.hasMaxEdge, maxBound = args.maxBound, maxOffset = args.maxOffset, centerMinEdge = args.centerMinEdge, centerMaxEdge = args.centerMaxEdge; + if (value < min) { + return hasMinEdge ? 0 : centerMinEdge; + } else if (value > max) { + return hasMaxEdge ? maxBound : centerMaxEdge; + } else { + return (value - min) / range * maxOffset; + } + }; + + var top = 'top', right = 'right', bottom = 'bottom', left = 'left', width = 'width', height = 'height'; + var getBounds = function (component) { + return component.element().dom().getBoundingClientRect(); + }; + var getBoundsProperty = function (bounds, property) { + return bounds[property]; + }; + var getMinXBounds = function (component) { + var bounds = getBounds(component); + return getBoundsProperty(bounds, left); + }; + var getMaxXBounds = function (component) { + var bounds = getBounds(component); + return getBoundsProperty(bounds, right); + }; + var getMinYBounds = function (component) { + var bounds = getBounds(component); + return getBoundsProperty(bounds, top); + }; + var getMaxYBounds = function (component) { + var bounds = getBounds(component); + return getBoundsProperty(bounds, bottom); + }; + var getXScreenRange = function (component) { + var bounds = getBounds(component); + return getBoundsProperty(bounds, width); + }; + var getYScreenRange = function (component) { + var bounds = getBounds(component); + return getBoundsProperty(bounds, height); + }; + var getCenterOffsetOf = function (componentMinEdge, componentMaxEdge, spectrumMinEdge) { + return (componentMinEdge + componentMaxEdge) / 2 - spectrumMinEdge; + }; + var getXCenterOffSetOf = function (component, spectrum) { + var componentBounds = getBounds(component); + var spectrumBounds = getBounds(spectrum); + var componentMinEdge = getBoundsProperty(componentBounds, left); + var componentMaxEdge = getBoundsProperty(componentBounds, right); + var spectrumMinEdge = getBoundsProperty(spectrumBounds, left); + return getCenterOffsetOf(componentMinEdge, componentMaxEdge, spectrumMinEdge); + }; + var getYCenterOffSetOf = function (component, spectrum) { + var componentBounds = getBounds(component); + var spectrumBounds = getBounds(spectrum); + var componentMinEdge = getBoundsProperty(componentBounds, top); + var componentMaxEdge = getBoundsProperty(componentBounds, bottom); + var spectrumMinEdge = getBoundsProperty(spectrumBounds, top); + return getCenterOffsetOf(componentMinEdge, componentMaxEdge, spectrumMinEdge); + }; + + var fireSliderChange$1 = function (spectrum, value) { + emitWith(spectrum, sliderChangeEvent(), { value: value }); + }; + var sliderValue = function (x) { + return { x: constant(x) }; + }; + var findValueOfOffset = function (spectrum, detail, left) { + var args = { + min: minX(detail), + max: maxX(detail), + range: xRange(detail), + value: left, + step: step(detail), + snap: snap(detail), + snapStart: snapStart(detail), + rounded: rounded(detail), + hasMinEdge: hasLEdge(detail), + hasMaxEdge: hasREdge(detail), + minBound: getMinXBounds(spectrum), + maxBound: getMaxXBounds(spectrum), + screenRange: getXScreenRange(spectrum) + }; + return findValueOf(args); + }; + var setValueFrom = function (spectrum, detail, value) { + var xValue = findValueOfOffset(spectrum, detail, value); + var sliderVal = sliderValue(xValue); + fireSliderChange$1(spectrum, sliderVal); + return xValue; + }; + var setToMin = function (spectrum, detail) { + var min = minX(detail); + fireSliderChange$1(spectrum, sliderValue(min)); + }; + var setToMax = function (spectrum, detail) { + var max = maxX(detail); + fireSliderChange$1(spectrum, sliderValue(max)); + }; + var moveBy = function (direction, spectrum, detail) { + var f = direction > 0 ? increaseBy : reduceBy; + var xValue = f(currentValue(detail).x(), minX(detail), maxX(detail), step(detail)); + fireSliderChange$1(spectrum, sliderValue(xValue)); + return Option.some(xValue); + }; + var handleMovement = function (direction) { + return function (spectrum, detail) { + return moveBy(direction, spectrum, detail).map(function () { + return true; + }); + }; + }; + var getValueFromEvent = function (simulatedEvent) { + var pos = getEventSource(simulatedEvent); + return pos.map(function (p) { + return p.left(); + }); + }; + var findOffsetOfValue$1 = function (spectrum, detail, value, minEdge, maxEdge) { + var minOffset = 0; + var maxOffset = getXScreenRange(spectrum); + var centerMinEdge = minEdge.bind(function (edge) { + return Option.some(getXCenterOffSetOf(edge, spectrum)); + }).getOr(minOffset); + var centerMaxEdge = maxEdge.bind(function (edge) { + return Option.some(getXCenterOffSetOf(edge, spectrum)); + }).getOr(maxOffset); + var args = { + min: minX(detail), + max: maxX(detail), + range: xRange(detail), + value: value, + hasMinEdge: hasLEdge(detail), + hasMaxEdge: hasREdge(detail), + minBound: getMinXBounds(spectrum), + minOffset: minOffset, + maxBound: getMaxXBounds(spectrum), + maxOffset: maxOffset, + centerMinEdge: centerMinEdge, + centerMaxEdge: centerMaxEdge + }; + return findOffsetOfValue(args); + }; + var findPositionOfValue = function (slider, spectrum, value, minEdge, maxEdge, detail) { + var offset = findOffsetOfValue$1(spectrum, detail, value, minEdge, maxEdge); + return getMinXBounds(spectrum) - getMinXBounds(slider) + offset; + }; + var setPositionFromValue = function (slider, thumb, detail, edges) { + var value = currentValue(detail); + var pos = findPositionOfValue(slider, edges.getSpectrum(slider), value.x(), edges.getLeftEdge(slider), edges.getRightEdge(slider), detail); + var thumbRadius = get$6(thumb.element()) / 2; + set$3(thumb.element(), 'left', pos - thumbRadius + 'px'); + }; + var onLeft = handleMovement(-1); + var onRight = handleMovement(1); + var onUp = Option.none; + var onDown = Option.none; + var edgeActions = { + 'top-left': Option.none(), + 'top': Option.none(), + 'top-right': Option.none(), + 'right': Option.some(setToREdge), + 'bottom-right': Option.none(), + 'bottom': Option.none(), + 'bottom-left': Option.none(), + 'left': Option.some(setToLEdge) + }; + + var HorizontalModel = /*#__PURE__*/Object.freeze({ + setValueFrom: setValueFrom, + setToMin: setToMin, + setToMax: setToMax, + findValueOfOffset: findValueOfOffset, + getValueFromEvent: getValueFromEvent, + findPositionOfValue: findPositionOfValue, + setPositionFromValue: setPositionFromValue, + onLeft: onLeft, + onRight: onRight, + onUp: onUp, + onDown: onDown, + edgeActions: edgeActions + }); + + var fireSliderChange$2 = function (spectrum, value) { + emitWith(spectrum, sliderChangeEvent(), { value: value }); + }; + var sliderValue$1 = function (y) { + return { y: constant(y) }; + }; + var findValueOfOffset$1 = function (spectrum, detail, top) { + var args = { + min: minY(detail), + max: maxY(detail), + range: yRange(detail), + value: top, + step: step(detail), + snap: snap(detail), + snapStart: snapStart(detail), + rounded: rounded(detail), + hasMinEdge: hasTEdge(detail), + hasMaxEdge: hasBEdge(detail), + minBound: getMinYBounds(spectrum), + maxBound: getMaxYBounds(spectrum), + screenRange: getYScreenRange(spectrum) + }; + return findValueOf(args); + }; + var setValueFrom$1 = function (spectrum, detail, value) { + var yValue = findValueOfOffset$1(spectrum, detail, value); + var sliderVal = sliderValue$1(yValue); + fireSliderChange$2(spectrum, sliderVal); + return yValue; + }; + var setToMin$1 = function (spectrum, detail) { + var min = minY(detail); + fireSliderChange$2(spectrum, sliderValue$1(min)); + }; + var setToMax$1 = function (spectrum, detail) { + var max = maxY(detail); + fireSliderChange$2(spectrum, sliderValue$1(max)); + }; + var moveBy$1 = function (direction, spectrum, detail) { + var f = direction > 0 ? increaseBy : reduceBy; + var yValue = f(currentValue(detail).y(), minY(detail), maxY(detail), step(detail)); + fireSliderChange$2(spectrum, sliderValue$1(yValue)); + return Option.some(yValue); + }; + var handleMovement$1 = function (direction) { + return function (spectrum, detail) { + return moveBy$1(direction, spectrum, detail).map(function () { + return true; + }); + }; + }; + var getValueFromEvent$1 = function (simulatedEvent) { + var pos = getEventSource(simulatedEvent); + return pos.map(function (p) { + return p.top(); + }); + }; + var findOffsetOfValue$2 = function (spectrum, detail, value, minEdge, maxEdge) { + var minOffset = 0; + var maxOffset = getYScreenRange(spectrum); + var centerMinEdge = minEdge.bind(function (edge) { + return Option.some(getYCenterOffSetOf(edge, spectrum)); + }).getOr(minOffset); + var centerMaxEdge = maxEdge.bind(function (edge) { + return Option.some(getYCenterOffSetOf(edge, spectrum)); + }).getOr(maxOffset); + var args = { + min: minY(detail), + max: maxY(detail), + range: yRange(detail), + value: value, + hasMinEdge: hasTEdge(detail), + hasMaxEdge: hasBEdge(detail), + minBound: getMinYBounds(spectrum), + minOffset: minOffset, + maxBound: getMaxYBounds(spectrum), + maxOffset: maxOffset, + centerMinEdge: centerMinEdge, + centerMaxEdge: centerMaxEdge + }; + return findOffsetOfValue(args); + }; + var findPositionOfValue$1 = function (slider, spectrum, value, minEdge, maxEdge, detail) { + var offset = findOffsetOfValue$2(spectrum, detail, value, minEdge, maxEdge); + return getMinYBounds(spectrum) - getMinYBounds(slider) + offset; + }; + var setPositionFromValue$1 = function (slider, thumb, detail, edges) { + var value = currentValue(detail); + var pos = findPositionOfValue$1(slider, edges.getSpectrum(slider), value.y(), edges.getTopEdge(slider), edges.getBottomEdge(slider), detail); + var thumbRadius = get$4(thumb.element()) / 2; + set$3(thumb.element(), 'top', pos - thumbRadius + 'px'); + }; + var onLeft$1 = Option.none; + var onRight$1 = Option.none; + var onUp$1 = handleMovement$1(-1); + var onDown$1 = handleMovement$1(1); + var edgeActions$1 = { + 'top-left': Option.none(), + 'top': Option.some(setToTEdge), + 'top-right': Option.none(), + 'right': Option.none(), + 'bottom-right': Option.none(), + 'bottom': Option.some(setToBEdge), + 'bottom-left': Option.none(), + 'left': Option.none() + }; + + var VerticalModel = /*#__PURE__*/Object.freeze({ + setValueFrom: setValueFrom$1, + setToMin: setToMin$1, + setToMax: setToMax$1, + findValueOfOffset: findValueOfOffset$1, + getValueFromEvent: getValueFromEvent$1, + findPositionOfValue: findPositionOfValue$1, + setPositionFromValue: setPositionFromValue$1, + onLeft: onLeft$1, + onRight: onRight$1, + onUp: onUp$1, + onDown: onDown$1, + edgeActions: edgeActions$1 + }); + + var fireSliderChange$3 = function (spectrum, value) { + emitWith(spectrum, sliderChangeEvent(), { value: value }); + }; + var sliderValue$2 = function (x, y) { + return { + x: constant(x), + y: constant(y) + }; + }; + var setValueFrom$2 = function (spectrum, detail, value) { + var xValue = findValueOfOffset(spectrum, detail, value.left()); + var yValue = findValueOfOffset$1(spectrum, detail, value.top()); + var val = sliderValue$2(xValue, yValue); + fireSliderChange$3(spectrum, val); + return val; + }; + var moveBy$2 = function (direction, isVerticalMovement, spectrum, detail) { + var f = direction > 0 ? increaseBy : reduceBy; + var xValue = isVerticalMovement ? currentValue(detail).x() : f(currentValue(detail).x(), minX(detail), maxX(detail), step(detail)); + var yValue = !isVerticalMovement ? currentValue(detail).y() : f(currentValue(detail).y(), minY(detail), maxY(detail), step(detail)); + fireSliderChange$3(spectrum, sliderValue$2(xValue, yValue)); + return Option.some(xValue); + }; + var handleMovement$2 = function (direction, isVerticalMovement) { + return function (spectrum, detail) { + return moveBy$2(direction, isVerticalMovement, spectrum, detail).map(function () { + return true; + }); + }; + }; + var setToMin$2 = function (spectrum, detail) { + var mX = minX(detail); + var mY = minY(detail); + fireSliderChange$3(spectrum, sliderValue$2(mX, mY)); + }; + var setToMax$2 = function (spectrum, detail) { + var mX = maxX(detail); + var mY = maxY(detail); + fireSliderChange$3(spectrum, sliderValue$2(mX, mY)); + }; + var getValueFromEvent$2 = function (simulatedEvent) { + return getEventSource(simulatedEvent); + }; + var setPositionFromValue$2 = function (slider, thumb, detail, edges) { + var value = currentValue(detail); + var xPos = findPositionOfValue(slider, edges.getSpectrum(slider), value.x(), edges.getLeftEdge(slider), edges.getRightEdge(slider), detail); + var yPos = findPositionOfValue$1(slider, edges.getSpectrum(slider), value.y(), edges.getTopEdge(slider), edges.getBottomEdge(slider), detail); + var thumbXRadius = get$6(thumb.element()) / 2; + var thumbYRadius = get$4(thumb.element()) / 2; + set$3(thumb.element(), 'left', xPos - thumbXRadius + 'px'); + set$3(thumb.element(), 'top', yPos - thumbYRadius + 'px'); + }; + var onLeft$2 = handleMovement$2(-1, false); + var onRight$2 = handleMovement$2(1, false); + var onUp$2 = handleMovement$2(-1, true); + var onDown$2 = handleMovement$2(1, true); + var edgeActions$2 = { + 'top-left': Option.some(setToTLEdgeXY), + 'top': Option.some(setToTEdgeXY), + 'top-right': Option.some(setToTREdgeXY), + 'right': Option.some(setToREdgeXY), + 'bottom-right': Option.some(setToBREdgeXY), + 'bottom': Option.some(setToBEdgeXY), + 'bottom-left': Option.some(setToBLEdgeXY), + 'left': Option.some(setToLEdgeXY) + }; + + var TwoDModel = /*#__PURE__*/Object.freeze({ + setValueFrom: setValueFrom$2, + setToMin: setToMin$2, + setToMax: setToMax$2, + getValueFromEvent: getValueFromEvent$2, + setPositionFromValue: setPositionFromValue$2, + onLeft: onLeft$2, + onRight: onRight$2, + onUp: onUp$2, + onDown: onDown$2, + edgeActions: edgeActions$2 + }); + + var SliderSchema = [ + defaulted$1('stepSize', 1), + defaulted$1('onChange', noop), + defaulted$1('onChoose', noop), + defaulted$1('onInit', noop), + defaulted$1('onDragStart', noop), + defaulted$1('onDragEnd', noop), + defaulted$1('snapToGrid', false), + defaulted$1('rounded', true), + option('snapStart'), + strictOf('model', choose$1('mode', { + x: [ + defaulted$1('minX', 0), + defaulted$1('maxX', 100), + state$1('value', function (spec) { + return Cell(spec.mode.minX); + }), + strict$1('getInitialValue'), + output('manager', HorizontalModel) + ], + y: [ + defaulted$1('minY', 0), + defaulted$1('maxY', 100), + state$1('value', function (spec) { + return Cell(spec.mode.minY); + }), + strict$1('getInitialValue'), + output('manager', VerticalModel) + ], + xy: [ + defaulted$1('minX', 0), + defaulted$1('maxX', 100), + defaulted$1('minY', 0), + defaulted$1('maxY', 100), + state$1('value', function (spec) { + return Cell({ + x: constant(spec.mode.minX), + y: constant(spec.mode.minY) + }); + }), + strict$1('getInitialValue'), + output('manager', TwoDModel) + ] + })), + field$1('sliderBehaviours', [ + Keying, + Representing + ]), + state$1('mouseIsDown', function () { + return Cell(false); + }) + ]; + + var mouseReleased = constant('mouse.released'); + + var sketch = function (detail, components, _spec, _externals) { + var _a; + var getThumb = function (component) { + return getPartOrDie(component, detail, 'thumb'); + }; + var getSpectrum = function (component) { + return getPartOrDie(component, detail, 'spectrum'); + }; + var getLeftEdge = function (component) { + return getPart(component, detail, 'left-edge'); + }; + var getRightEdge = function (component) { + return getPart(component, detail, 'right-edge'); + }; + var getTopEdge = function (component) { + return getPart(component, detail, 'top-edge'); + }; + var getBottomEdge = function (component) { + return getPart(component, detail, 'bottom-edge'); + }; + var modelDetail = detail.model; + var model = modelDetail.manager; + var refresh = function (slider, thumb) { + model.setPositionFromValue(slider, thumb, detail, { + getLeftEdge: getLeftEdge, + getRightEdge: getRightEdge, + getTopEdge: getTopEdge, + getBottomEdge: getBottomEdge, + getSpectrum: getSpectrum + }); + }; + var changeValue = function (slider, newValue) { + modelDetail.value.set(newValue); + var thumb = getThumb(slider); + refresh(slider, thumb); + detail.onChange(slider, thumb, newValue); + return Option.some(true); + }; + var resetToMin = function (slider) { + model.setToMin(slider, detail); + }; + var resetToMax = function (slider) { + model.setToMax(slider, detail); + }; + var choose = function (slider) { + var fireOnChoose = function () { + getPart(slider, detail, 'thumb').each(function (thumb) { + var value = modelDetail.value.get(); + detail.onChoose(slider, thumb, value); + }); + }; + var wasDown = detail.mouseIsDown.get(); + detail.mouseIsDown.set(false); + if (wasDown) { + fireOnChoose(); + } + }; + var onDragStart = function (slider, simulatedEvent) { + simulatedEvent.stop(); + detail.mouseIsDown.set(true); + detail.onDragStart(slider, getThumb(slider)); + }; + var onDragEnd = function (slider, simulatedEvent) { + simulatedEvent.stop(); + detail.onDragEnd(slider, getThumb(slider)); + choose(slider); + }; + return { + uid: detail.uid, + dom: detail.dom, + components: components, + behaviours: augment(detail.sliderBehaviours, [ + Keying.config({ + mode: 'special', + focusIn: function (slider) { + return getPart(slider, detail, 'spectrum').map(Keying.focusIn).map(constant(true)); + } + }), + Representing.config({ + store: { + mode: 'manual', + getValue: function (_) { + return modelDetail.value.get(); + } + } + }), + Receiving.config({ channels: (_a = {}, _a[mouseReleased()] = { onReceive: choose }, _a) }) + ]), + events: derive([ + run(sliderChangeEvent(), function (slider, simulatedEvent) { + changeValue(slider, simulatedEvent.event().value()); + }), + runOnAttached(function (slider, simulatedEvent) { + var getInitial = modelDetail.getInitialValue(); + modelDetail.value.set(getInitial); + var thumb = getThumb(slider); + refresh(slider, thumb); + var spectrum = getSpectrum(slider); + detail.onInit(slider, thumb, spectrum, modelDetail.value.get()); + }), + run(touchstart(), onDragStart), + run(touchend(), onDragEnd), + run(mousedown(), onDragStart), + run(mouseup(), onDragEnd) + ]), + apis: { + resetToMin: resetToMin, + resetToMax: resetToMax, + changeValue: changeValue, + refresh: refresh + }, + domModification: { styles: { position: 'relative' } } + }; + }; + + var Slider = composite$1({ + name: 'Slider', + configFields: SliderSchema, + partFields: SliderParts, + factory: sketch, + apis: { + resetToMin: function (apis, slider) { + apis.resetToMin(slider); + }, + resetToMax: function (apis, slider) { + apis.resetToMax(slider); + }, + refresh: function (apis, slider) { + apis.refresh(slider); + } + } + }); + + var button = function (realm, clazz, makeItems, editor) { + return Buttons.forToolbar(clazz, function () { + var items = makeItems(); + realm.setContextToolbar([{ + label: clazz + ' group', + items: items + }]); + }, {}, editor); + }; + + var BLACK = -1; + var makeSlider = function (spec$1) { + var getColor = function (hue) { + if (hue < 0) { + return 'black'; + } else if (hue > 360) { + return 'white'; + } else { + return 'hsl(' + hue + ', 100%, 50%)'; + } + }; + var onInit = function (slider, thumb, spectrum, value) { + var color = getColor(value.x()); + set$3(thumb.element(), 'background-color', color); + }; + var onChange = function (slider, thumb, value) { + var color = getColor(value.x()); + set$3(thumb.element(), 'background-color', color); + spec$1.onChange(slider, thumb, color); + }; + return Slider.sketch({ + dom: dom$1('
    '), + components: [ + Slider.parts()['left-edge'](spec('
    ')), + Slider.parts().spectrum({ + dom: dom$1('
    '), + components: [spec('
    ')], + behaviours: derive$1([Toggling.config({ toggleClass: Styles.resolve('thumb-active') })]) + }), + Slider.parts()['right-edge'](spec('
    ')), + Slider.parts().thumb({ + dom: dom$1('
    '), + behaviours: derive$1([Toggling.config({ toggleClass: Styles.resolve('thumb-active') })]) + }) + ], + onChange: onChange, + onDragStart: function (slider, thumb) { + Toggling.on(thumb); + }, + onDragEnd: function (slider, thumb) { + Toggling.off(thumb); + }, + onInit: onInit, + stepSize: 10, + model: { + mode: 'x', + minX: 0, + maxX: 360, + getInitialValue: function () { + return { + x: function () { + return spec$1.getInitialValue(); + } + }; + } + }, + sliderBehaviours: derive$1([Receivers.orientation(Slider.refresh)]) + }); + }; + var makeItems = function (spec) { + return [makeSlider(spec)]; + }; + var sketch$1 = function (realm, editor) { + var spec = { + onChange: function (slider, thumb, color) { + editor.undoManager.transact(function () { + editor.formatter.apply('forecolor', { value: color }); + editor.nodeChanged(); + }); + }, + getInitialValue: function () { + return BLACK; + } + }; + return button(realm, 'color-levels', function () { + return makeItems(spec); + }, editor); + }; + var ColorSlider = { + makeItems: makeItems, + sketch: sketch$1 + }; + + var schema$7 = objOfOnly([ + strict$1('getInitialValue'), + strict$1('onChange'), + strict$1('category'), + strict$1('sizes') + ]); + var sketch$2 = function (rawSpec) { + var spec$1 = asRawOrDie('SizeSlider', schema$7, rawSpec); + var isValidValue = function (valueIndex) { + return valueIndex >= 0 && valueIndex < spec$1.sizes.length; + }; + var onChange = function (slider, thumb, valueIndex) { + var index = valueIndex.x(); + if (isValidValue(index)) { + spec$1.onChange(index); + } + }; + return Slider.sketch({ + dom: { + tag: 'div', + classes: [ + Styles.resolve('slider-' + spec$1.category + '-size-container'), + Styles.resolve('slider'), + Styles.resolve('slider-size-container') + ] + }, + onChange: onChange, + onDragStart: function (slider, thumb) { + Toggling.on(thumb); + }, + onDragEnd: function (slider, thumb) { + Toggling.off(thumb); + }, + model: { + mode: 'x', + minX: 0, + maxX: spec$1.sizes.length - 1, + getInitialValue: function () { + return { + x: function () { + return spec$1.getInitialValue(); + } + }; + } + }, + stepSize: 1, + snapToGrid: true, + sliderBehaviours: derive$1([Receivers.orientation(Slider.refresh)]), + components: [ + Slider.parts().spectrum({ + dom: dom$1('
    '), + components: [spec('
    ')] + }), + Slider.parts().thumb({ + dom: dom$1('
    '), + behaviours: derive$1([Toggling.config({ toggleClass: Styles.resolve('thumb-active') })]) + }) + ] + }); + }; + var SizeSlider = { sketch: sketch$2 }; + + var candidates = [ + '9px', + '10px', + '11px', + '12px', + '14px', + '16px', + '18px', + '20px', + '24px', + '32px', + '36px' + ]; + var defaultSize = 'medium'; + var defaultIndex = 2; + var indexToSize = function (index) { + return Option.from(candidates[index]); + }; + var sizeToIndex = function (size) { + return findIndex(candidates, function (v) { + return v === size; + }); + }; + var getRawOrComputed = function (isRoot, rawStart) { + var optStart = isElement(rawStart) ? Option.some(rawStart) : parent(rawStart).filter(isElement); + return optStart.map(function (start) { + var inline = closest(start, function (elem) { + return getRaw(elem, 'font-size').isSome(); + }, isRoot).bind(function (elem) { + return getRaw(elem, 'font-size'); + }); + return inline.getOrThunk(function () { + return get$3(start, 'font-size'); + }); + }).getOr(''); + }; + var getSize = function (editor) { + var node = editor.selection.getStart(); + var elem = Element.fromDom(node); + var root = Element.fromDom(editor.getBody()); + var isRoot = function (e) { + return eq(root, e); + }; + var elemSize = getRawOrComputed(isRoot, elem); + return find$2(candidates, function (size) { + return elemSize === size; + }).getOr(defaultSize); + }; + var applySize = function (editor, value) { + var currentValue = getSize(editor); + if (currentValue !== value) { + editor.execCommand('fontSize', false, value); + } + }; + var get$7 = function (editor) { + var size = getSize(editor); + return sizeToIndex(size).getOr(defaultIndex); + }; + var apply$1 = function (editor, index) { + indexToSize(index).each(function (size) { + applySize(editor, size); + }); + }; + var FontSizes = { + candidates: constant(candidates), + get: get$7, + apply: apply$1 + }; + + var sizes = FontSizes.candidates(); + var makeSlider$1 = function (spec) { + return SizeSlider.sketch({ + onChange: spec.onChange, + sizes: sizes, + category: 'font', + getInitialValue: spec.getInitialValue + }); + }; + var makeItems$1 = function (spec$1) { + return [ + spec(''), + makeSlider$1(spec$1), + spec('') + ]; + }; + var sketch$3 = function (realm, editor) { + var spec = { + onChange: function (value) { + FontSizes.apply(editor, value); + }, + getInitialValue: function () { + return FontSizes.get(editor); + } + }; + return button(realm, 'font-size', function () { + return makeItems$1(spec); + }, editor); + }; + + var record = function (spec) { + var uid = isSketchSpec(spec) && hasKey$1(spec, 'uid') ? spec.uid : generate$3('memento'); + var get = function (anyInSystem) { + return anyInSystem.getSystem().getByUid(uid).getOrDie(); + }; + var getOpt = function (anyInSystem) { + return anyInSystem.getSystem().getByUid(uid).toOption(); + }; + var asSpec = function () { + return __assign(__assign({}, spec), { uid: uid }); + }; + return { + get: get, + getOpt: getOpt, + asSpec: asSpec + }; + }; + + var promise = function () { + 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 window.setImmediate === 'function' && window.setImmediate || function (fn) { + domGlobals.setTimeout(fn, 1); + }; + function bind(fn, thisArg) { + return function () { + return fn.apply(thisArg, arguments); + }; + } + var isArray = Array.isArray || function (value) { + return Object.prototype.toString.call(value) === '[object Array]'; + }; + 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, _a = this._deferreds; _i < _a.length; _i++) { + var deferred = _a[_i]; + handle.call(this, deferred); + } + this._deferreds = []; + } + 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 values = []; + for (var _i = 0; _i < arguments.length; _i++) { + values[_i] = arguments[_i]; + } + var args = Array.prototype.slice.call(values.length === 1 && isArray(values[0]) ? values[0] : values); + 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 (reason) { + return new Promise(function (resolve, reject) { + reject(reason); + }); + }; + Promise.race = function (values) { + return new Promise(function (resolve, reject) { + for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { + var value = values_1[_i]; + value.then(resolve, reject); + } + }); + }; + return Promise; + }; + var Promise = window.Promise ? window.Promise : promise(); + + function blobToDataUri(blob) { + return new Promise(function (resolve) { + var reader = new domGlobals.FileReader(); + reader.onloadend = function () { + resolve(reader.result); + }; + reader.readAsDataURL(blob); + }); + } + function blobToBase64(blob) { + return blobToDataUri(blob).then(function (dataUri) { + return dataUri.split(',')[1]; + }); + } + + var blobToBase64$1 = function (blob) { + return blobToBase64(blob); + }; + + var addImage = function (editor, blob) { + blobToBase64$1(blob).then(function (base64) { + editor.undoManager.transact(function () { + var cache = editor.editorUpload.blobCache; + var info = cache.create(generate$1('mceu'), blob, base64); + cache.add(info); + var img = editor.dom.createHTML('img', { src: info.blobUri() }); + editor.insertContent(img); + }); + }); + }; + var extractBlob = function (simulatedEvent) { + var event = simulatedEvent.event(); + var files = event.raw().target.files || event.raw().dataTransfer.files; + return Option.from(files[0]); + }; + var sketch$4 = function (editor) { + var pickerDom = { + tag: 'input', + attributes: { + accept: 'image/*', + type: 'file', + title: '' + }, + styles: { + visibility: 'hidden', + position: 'absolute' + } + }; + var memPicker = record({ + dom: pickerDom, + events: derive([ + cutter(click()), + run(change(), function (picker, simulatedEvent) { + extractBlob(simulatedEvent).each(function (blob) { + addImage(editor, blob); + }); + }) + ]) + }); + return Button.sketch({ + dom: Buttons.getToolbarIconButton('image', editor), + components: [memPicker.asSpec()], + action: function (button) { + var picker = memPicker.get(button); + picker.element().dom().click(); + } + }); + }; + + var get$8 = function (element) { + return element.dom().textContent; + }; + var set$5 = function (element, value) { + element.dom().textContent = value; + }; + + var isNotEmpty = function (val) { + return val.length > 0; + }; + var defaultToEmpty = function (str) { + return str === undefined || str === null ? '' : str; + }; + var noLink = function (editor) { + var text = editor.selection.getContent({ format: 'text' }); + return { + url: '', + text: text, + title: '', + target: '', + link: Option.none() + }; + }; + var fromLink = function (link) { + var text = get$8(link); + var url = get(link, 'href'); + var title = get(link, 'title'); + var target = get(link, 'target'); + return { + url: defaultToEmpty(url), + text: text !== url ? defaultToEmpty(text) : '', + title: defaultToEmpty(title), + target: defaultToEmpty(target), + link: Option.some(link) + }; + }; + var getInfo = function (editor) { + return query(editor).fold(function () { + return noLink(editor); + }, function (link) { + return fromLink(link); + }); + }; + var wasSimple = function (link) { + var prevHref = get(link, 'href'); + var prevText = get$8(link); + return prevHref === prevText; + }; + var getTextToApply = function (link, url, info) { + return info.text.toOption().filter(isNotEmpty).fold(function () { + return wasSimple(link) ? Option.some(url) : Option.none(); + }, Option.some); + }; + var unlinkIfRequired = function (editor, info) { + var activeLink = info.link.bind(identity); + activeLink.each(function (link) { + editor.execCommand('unlink'); + }); + }; + var getAttrs$1 = function (url, info) { + var attrs = {}; + attrs.href = url; + info.title.toOption().filter(isNotEmpty).each(function (title) { + attrs.title = title; + }); + info.target.toOption().filter(isNotEmpty).each(function (target) { + attrs.target = target; + }); + return attrs; + }; + var applyInfo = function (editor, info) { + info.url.toOption().filter(isNotEmpty).fold(function () { + unlinkIfRequired(editor, info); + }, function (url) { + var attrs = getAttrs$1(url, info); + var activeLink = info.link.bind(identity); + activeLink.fold(function () { + var text = info.text.toOption().filter(isNotEmpty).getOr(url); + editor.insertContent(editor.dom.createHTML('a', attrs, editor.dom.encode(text))); + }, function (link) { + var text = getTextToApply(link, url, info); + setAll(link, attrs); + text.each(function (newText) { + set$5(link, newText); + }); + }); + }); + }; + var query = function (editor) { + var start = Element.fromDom(editor.selection.getStart()); + return closest$2(start, 'a'); + }; + var LinkBridge = { + getInfo: getInfo, + applyInfo: applyInfo, + query: query + }; + + var platform$1 = detect$3(); + var preserve = function (f, editor) { + var rng = editor.selection.getRng(); + f(); + editor.selection.setRng(rng); + }; + var forAndroid = function (editor, f) { + var wrapper = platform$1.os.isAndroid() ? preserve : apply; + wrapper(f, editor); + }; + var RangePreserver = { forAndroid: forAndroid }; + + var events$6 = function (name, eventHandlers) { + var events = derive(eventHandlers); + return create$1({ + fields: [strict$1('enabled')], + name: name, + active: { events: constant(events) } + }); + }; + var config = function (name, eventHandlers) { + var me = events$6(name, eventHandlers); + return { + key: name, + value: { + config: {}, + me: me, + configAsRaw: constant({}), + initialConfig: {}, + state: NoState + } + }; + }; + + var getCurrent = function (component, composeConfig, composeState) { + return composeConfig.find(component); + }; + + var ComposeApis = /*#__PURE__*/Object.freeze({ + getCurrent: getCurrent + }); + + var ComposeSchema = [strict$1('find')]; + + var Composing = create$1({ + fields: ComposeSchema, + name: 'composing', + apis: ComposeApis + }); + + var factory$1 = function (detail) { + var _a = detail.dom, attributes = _a.attributes, domWithoutAttributes = __rest(_a, ['attributes']); + return { + uid: detail.uid, + dom: __assign({ + tag: 'div', + attributes: __assign({ role: 'presentation' }, attributes) + }, domWithoutAttributes), + components: detail.components, + behaviours: get$5(detail.containerBehaviours), + events: detail.events, + domModification: detail.domModification, + eventOrder: detail.eventOrder + }; + }; + var Container = single$2({ + name: 'Container', + factory: factory$1, + configFields: [ + defaulted$1('components', []), + field$1('containerBehaviours', []), + defaulted$1('events', {}), + defaulted$1('domModification', {}), + defaulted$1('eventOrder', {}) + ] + }); + + var factory$2 = function (detail) { + return { + uid: detail.uid, + dom: detail.dom, + behaviours: SketchBehaviours.augment(detail.dataBehaviours, [ + Representing.config({ + store: { + mode: 'memory', + initialValue: detail.getInitialValue() + } + }), + Composing.config({ find: Option.some }) + ]), + events: derive([runOnAttached(function (component, simulatedEvent) { + Representing.setValue(component, detail.getInitialValue()); + })]) + }; + }; + var DataField = single$2({ + name: 'DataField', + factory: factory$2, + configFields: [ + strict$1('uid'), + strict$1('dom'), + strict$1('getInitialValue'), + SketchBehaviours.field('dataBehaviours', [ + Representing, + Composing + ]) + ] + }); + + var get$9 = function (element) { + return element.dom().value; + }; + var set$6 = function (element, value) { + if (value === undefined) { + throw new Error('Value.set was undefined'); + } + element.dom().value = value; + }; + + var schema$8 = constant([ + option('data'), + defaulted$1('inputAttributes', {}), + defaulted$1('inputStyles', {}), + defaulted$1('tag', 'input'), + defaulted$1('inputClasses', []), + onHandler('onSetValue'), + defaulted$1('styles', {}), + defaulted$1('eventOrder', {}), + field$1('inputBehaviours', [ + Representing, + Focusing + ]), + defaulted$1('selectOnFocus', true) + ]); + var focusBehaviours = function (detail) { + return derive$1([Focusing.config({ + onFocus: detail.selectOnFocus === false ? noop : function (component) { + var input = component.element(); + var value = get$9(input); + input.dom().setSelectionRange(0, value.length); + } + })]); + }; + var behaviours = function (detail) { + return __assign(__assign({}, focusBehaviours(detail)), augment(detail.inputBehaviours, [Representing.config({ + store: { + mode: 'manual', + initialValue: detail.data.getOr(undefined), + getValue: function (input) { + return get$9(input.element()); + }, + setValue: function (input, data) { + var current = get$9(input.element()); + if (current !== data) { + set$6(input.element(), data); + } + } + }, + onSetValue: detail.onSetValue + })])); + }; + var dom$2 = function (detail) { + return { + tag: detail.tag, + attributes: __assign({ type: 'text' }, detail.inputAttributes), + styles: detail.inputStyles, + classes: detail.inputClasses + }; + }; + + var factory$3 = function (detail, spec) { + return { + uid: detail.uid, + dom: dom$2(detail), + components: [], + behaviours: behaviours(detail), + eventOrder: detail.eventOrder + }; + }; + var Input = single$2({ + name: 'Input', + configFields: schema$8(), + factory: factory$3 + }); + + var exhibit$3 = function (base, tabConfig) { + return nu$5({ + attributes: wrapAll$1([{ + key: tabConfig.tabAttr, + value: 'true' + }]) + }); + }; + + var ActiveTabstopping = /*#__PURE__*/Object.freeze({ + exhibit: exhibit$3 + }); + + var TabstopSchema = [defaulted$1('tabAttr', 'data-alloy-tabstop')]; + + var Tabstopping = create$1({ + fields: TabstopSchema, + name: 'tabstopping', + active: ActiveTabstopping + }); + + var global$3 = tinymce.util.Tools.resolve('tinymce.util.I18n'); + + var clearInputBehaviour = 'input-clearing'; + var field$2 = function (name, placeholder) { + var inputSpec = record(Input.sketch({ + inputAttributes: { placeholder: global$3.translate(placeholder) }, + onSetValue: function (input$1, data) { + emit(input$1, input()); + }, + inputBehaviours: derive$1([ + Composing.config({ find: Option.some }), + Tabstopping.config({}), + Keying.config({ mode: 'execution' }) + ]), + selectOnFocus: false + })); + var buttonSpec = record(Button.sketch({ + dom: dom$1(''), + action: function (button) { + var input = inputSpec.get(button); + Representing.setValue(input, ''); + } + })); + return { + name: name, + spec: Container.sketch({ + dom: dom$1('
    '), + components: [ + inputSpec.asSpec(), + buttonSpec.asSpec() + ], + containerBehaviours: derive$1([ + Toggling.config({ toggleClass: Styles.resolve('input-container-empty') }), + Composing.config({ + find: function (comp) { + return Option.some(inputSpec.get(comp)); + } + }), + config(clearInputBehaviour, [run(input(), function (iContainer) { + var input = inputSpec.get(iContainer); + var val = Representing.getValue(input); + var f = val.length > 0 ? Toggling.off : Toggling.on; + f(iContainer); + })]) + ]) + }) + }; + }; + var hidden = function (name) { + return { + name: name, + spec: DataField.sketch({ + dom: { + tag: 'span', + styles: { display: 'none' } + }, + getInitialValue: function () { + return Option.none(); + } + }) + }; + }; + + var nativeDisabled = [ + 'input', + 'button', + 'textarea', + 'select' + ]; + var onLoad$5 = function (component, disableConfig, disableState) { + if (disableConfig.disabled) { + disable(component, disableConfig); + } + }; + var hasNative = function (component, config) { + return config.useNative === true && contains(nativeDisabled, name(component.element())); + }; + var nativeIsDisabled = function (component) { + return has$1(component.element(), 'disabled'); + }; + var nativeDisable = function (component) { + set(component.element(), 'disabled', 'disabled'); + }; + var nativeEnable = function (component) { + remove$1(component.element(), 'disabled'); + }; + var ariaIsDisabled = function (component) { + return get(component.element(), 'aria-disabled') === 'true'; + }; + var ariaDisable = function (component) { + set(component.element(), 'aria-disabled', 'true'); + }; + var ariaEnable = function (component) { + set(component.element(), 'aria-disabled', 'false'); + }; + var disable = function (component, disableConfig, disableState) { + disableConfig.disableClass.each(function (disableClass) { + add$2(component.element(), disableClass); + }); + var f = hasNative(component, disableConfig) ? nativeDisable : ariaDisable; + f(component); + disableConfig.onDisabled(component); + }; + var enable = function (component, disableConfig, disableState) { + disableConfig.disableClass.each(function (disableClass) { + remove$4(component.element(), disableClass); + }); + var f = hasNative(component, disableConfig) ? nativeEnable : ariaEnable; + f(component); + disableConfig.onEnabled(component); + }; + var isDisabled = function (component, disableConfig) { + return hasNative(component, disableConfig) ? nativeIsDisabled(component) : ariaIsDisabled(component); + }; + var set$7 = function (component, disableConfig, disableState, disabled) { + var f = disabled ? disable : enable; + f(component, disableConfig, disableState); + }; + + var DisableApis = /*#__PURE__*/Object.freeze({ + enable: enable, + disable: disable, + isDisabled: isDisabled, + onLoad: onLoad$5, + set: set$7 + }); + + var exhibit$4 = function (base, disableConfig, disableState) { + return nu$5({ classes: disableConfig.disabled ? disableConfig.disableClass.map(pure).getOr([]) : [] }); + }; + var events$7 = function (disableConfig, disableState) { + return derive([ + abort(execute(), function (component, simulatedEvent) { + return isDisabled(component, disableConfig); + }), + loadEvent(disableConfig, disableState, onLoad$5) + ]); + }; + + var ActiveDisable = /*#__PURE__*/Object.freeze({ + exhibit: exhibit$4, + events: events$7 + }); + + var DisableSchema = [ + defaulted$1('disabled', false), + defaulted$1('useNative', true), + option('disableClass'), + onHandler('onDisabled'), + onHandler('onEnabled') + ]; + + var Disabling = create$1({ + fields: DisableSchema, + name: 'disabling', + active: ActiveDisable, + apis: DisableApis + }); + + var owner$1 = 'form'; + var schema$9 = [field$1('formBehaviours', [Representing])]; + var getPartName = function (name) { + return ''; + }; + var sketch$5 = function (fSpec) { + var parts = function () { + var record = []; + var field = function (name, config) { + record.push(name); + return generateOne(owner$1, getPartName(name), config); + }; + return { + field: field, + record: function () { + return record; + } + }; + }(); + var spec = fSpec(parts); + var partNames = parts.record(); + var fieldParts = map$1(partNames, function (n) { + return required({ + name: n, + pname: getPartName(n) + }); + }); + return composite(owner$1, schema$9, fieldParts, make, spec); + }; + var toResult$1 = function (o, e) { + return o.fold(function () { + return Result.error(e); + }, Result.value); + }; + var make = function (detail, components, spec) { + return { + uid: detail.uid, + dom: detail.dom, + components: components, + behaviours: augment(detail.formBehaviours, [Representing.config({ + store: { + mode: 'manual', + getValue: function (form) { + var resPs = getAllParts(form, detail); + return map(resPs, function (resPThunk, pName) { + return resPThunk().bind(function (v) { + var opt = Composing.getCurrent(v); + return toResult$1(opt, 'missing current'); + }).map(Representing.getValue); + }); + }, + setValue: function (form, values) { + each(values, function (newValue, key) { + getPart(form, detail, key).each(function (wrapper) { + Composing.getCurrent(wrapper).each(function (field) { + Representing.setValue(field, newValue); + }); + }); + }); + } + } + })]), + apis: { + getField: function (form, key) { + return getPart(form, detail, key).bind(Composing.getCurrent); + } + } + }; + }; + var Form = { + getField: makeApi(function (apis, component, key) { + return apis.getField(component, key); + }), + sketch: sketch$5 + }; + + var api$2 = function () { + var subject = Cell(Option.none()); + var revoke = function () { + subject.get().each(function (s) { + s.destroy(); + }); + }; + var clear = function () { + revoke(); + subject.set(Option.none()); + }; + var set = function (s) { + revoke(); + subject.set(Option.some(s)); + }; + var run = function (f) { + subject.get().each(f); + }; + var isSet = function () { + return subject.get().isSome(); + }; + return { + clear: clear, + isSet: isSet, + set: set, + run: run + }; + }; + var value$2 = function () { + var subject = Cell(Option.none()); + var clear = function () { + subject.set(Option.none()); + }; + var set = function (s) { + subject.set(Option.some(s)); + }; + var on = function (f) { + subject.get().each(f); + }; + var isSet = function () { + return subject.get().isSome(); + }; + return { + clear: clear, + set: set, + isSet: isSet, + on: on + }; + }; + + var SWIPING_LEFT = 1; + var SWIPING_RIGHT = -1; + var SWIPING_NONE = 0; + var init$2 = function (xValue) { + return { + xValue: xValue, + points: [] + }; + }; + var move$1 = function (model, xValue) { + if (xValue === model.xValue) { + return model; + } + var currentDirection = xValue - model.xValue > 0 ? SWIPING_LEFT : SWIPING_RIGHT; + var newPoint = { + direction: currentDirection, + xValue: xValue + }; + var priorPoints = function () { + if (model.points.length === 0) { + return []; + } else { + var prev = model.points[model.points.length - 1]; + return prev.direction === currentDirection ? model.points.slice(0, model.points.length - 1) : model.points; + } + }(); + return { + xValue: xValue, + points: priorPoints.concat([newPoint]) + }; + }; + var complete = function (model) { + if (model.points.length === 0) { + return SWIPING_NONE; + } else { + var firstDirection = model.points[0].direction; + var lastDirection = model.points[model.points.length - 1].direction; + return firstDirection === SWIPING_RIGHT && lastDirection === SWIPING_RIGHT ? SWIPING_RIGHT : firstDirection === SWIPING_LEFT && lastDirection === SWIPING_LEFT ? SWIPING_LEFT : SWIPING_NONE; + } + }; + var SwipingModel = { + init: init$2, + move: move$1, + complete: complete + }; + + var sketch$6 = function (rawSpec) { + var navigateEvent = 'navigateEvent'; + var wrapperAdhocEvents = 'serializer-wrapper-events'; + var formAdhocEvents = 'form-events'; + var schema = objOf([ + strict$1('fields'), + defaulted$1('maxFieldIndex', rawSpec.fields.length - 1), + strict$1('onExecute'), + strict$1('getInitialValue'), + state$1('state', function () { + return { + dialogSwipeState: value$2(), + currentScreen: Cell(0) + }; + }) + ]); + var spec$1 = asRawOrDie('SerialisedDialog', schema, rawSpec); + var navigationButton = function (direction, directionName, enabled) { + return Button.sketch({ + dom: dom$1(''), + action: function (button) { + emitWith(button, navigateEvent, { direction: direction }); + }, + buttonBehaviours: derive$1([Disabling.config({ + disableClass: Styles.resolve('toolbar-navigation-disabled'), + disabled: !enabled + })]) + }); + }; + var reposition = function (dialog, message) { + descendant$1(dialog.element(), '.' + Styles.resolve('serialised-dialog-chain')).each(function (parent) { + set$3(parent, 'left', -spec$1.state.currentScreen.get() * message.width + 'px'); + }); + }; + var navigate = function (dialog, direction) { + var screens = descendants(dialog.element(), '.' + Styles.resolve('serialised-dialog-screen')); + descendant$1(dialog.element(), '.' + Styles.resolve('serialised-dialog-chain')).each(function (parent) { + if (spec$1.state.currentScreen.get() + direction >= 0 && spec$1.state.currentScreen.get() + direction < screens.length) { + getRaw(parent, 'left').each(function (left) { + var currentLeft = parseInt(left, 10); + var w = get$6(screens[0]); + set$3(parent, 'left', currentLeft - direction * w + 'px'); + }); + spec$1.state.currentScreen.set(spec$1.state.currentScreen.get() + direction); + } + }); + }; + var focusInput = function (dialog) { + var inputs = descendants(dialog.element(), 'input'); + var optInput = Option.from(inputs[spec$1.state.currentScreen.get()]); + optInput.each(function (input) { + dialog.getSystem().getByDom(input).each(function (inputComp) { + dispatchFocus(dialog, inputComp.element()); + }); + }); + var dotitems = memDots.get(dialog); + Highlighting.highlightAt(dotitems, spec$1.state.currentScreen.get()); + }; + var resetState = function () { + spec$1.state.currentScreen.set(0); + spec$1.state.dialogSwipeState.clear(); + }; + var memForm = record(Form.sketch(function (parts) { + return { + dom: dom$1('
    '), + components: [Container.sketch({ + dom: dom$1('
    '), + components: map$1(spec$1.fields, function (field, i) { + return i <= spec$1.maxFieldIndex ? Container.sketch({ + dom: dom$1('
    '), + components: [ + navigationButton(-1, 'previous', i > 0), + parts.field(field.name, field.spec), + navigationButton(+1, 'next', i < spec$1.maxFieldIndex) + ] + }) : parts.field(field.name, field.spec); + }) + })], + formBehaviours: derive$1([ + Receivers.orientation(function (dialog, message) { + reposition(dialog, message); + }), + Keying.config({ + mode: 'special', + focusIn: function (dialog) { + focusInput(dialog); + }, + onTab: function (dialog) { + navigate(dialog, +1); + return Option.some(true); + }, + onShiftTab: function (dialog) { + navigate(dialog, -1); + return Option.some(true); + } + }), + config(formAdhocEvents, [ + runOnAttached(function (dialog, simulatedEvent) { + resetState(); + var dotitems = memDots.get(dialog); + Highlighting.highlightFirst(dotitems); + spec$1.getInitialValue(dialog).each(function (v) { + Representing.setValue(dialog, v); + }); + }), + runOnExecute(spec$1.onExecute), + run(transitionend(), function (dialog, simulatedEvent) { + var event = simulatedEvent.event(); + if (event.raw().propertyName === 'left') { + focusInput(dialog); + } + }), + run(navigateEvent, function (dialog, simulatedEvent) { + var event = simulatedEvent.event(); + var direction = event.direction(); + navigate(dialog, direction); + }) + ]) + ]) + }; + })); + var memDots = record({ + dom: dom$1('
    '), + behaviours: derive$1([Highlighting.config({ + highlightClass: Styles.resolve('dot-active'), + itemClass: Styles.resolve('dot-item') + })]), + components: bind(spec$1.fields, function (_f, i) { + return i <= spec$1.maxFieldIndex ? [spec('
    ')] : []; + }) + }); + return { + dom: dom$1('
    '), + components: [ + memForm.asSpec(), + memDots.asSpec() + ], + behaviours: derive$1([ + Keying.config({ + mode: 'special', + focusIn: function (wrapper) { + var form = memForm.get(wrapper); + Keying.focusIn(form); + } + }), + config(wrapperAdhocEvents, [ + run(touchstart(), function (wrapper, simulatedEvent) { + var event = simulatedEvent.event(); + spec$1.state.dialogSwipeState.set(SwipingModel.init(event.raw().touches[0].clientX)); + }), + run(touchmove(), function (wrapper, simulatedEvent) { + var event = simulatedEvent.event(); + spec$1.state.dialogSwipeState.on(function (state) { + simulatedEvent.event().prevent(); + spec$1.state.dialogSwipeState.set(SwipingModel.move(state, event.raw().touches[0].clientX)); + }); + }), + run(touchend(), function (wrapper) { + spec$1.state.dialogSwipeState.on(function (state) { + var dialog = memForm.get(wrapper); + var direction = -1 * SwipingModel.complete(state); + navigate(dialog, direction); + }); + }) + ]) + ]) + }; + }; + + var getGroups = cached(function (realm, editor) { + return [{ + label: 'the link group', + items: [sketch$6({ + fields: [ + field$2('url', 'Type or paste URL'), + field$2('text', 'Link text'), + field$2('title', 'Link title'), + field$2('target', 'Link target'), + hidden('link') + ], + maxFieldIndex: [ + 'url', + 'text', + 'title', + 'target' + ].length - 1, + getInitialValue: function () { + return Option.some(LinkBridge.getInfo(editor)); + }, + onExecute: function (dialog) { + var info = Representing.getValue(dialog); + LinkBridge.applyInfo(editor, info); + realm.restoreToolbar(); + editor.focus(); + } + })] + }]; + }); + var sketch$7 = function (realm, editor) { + return Buttons.forToolbarStateAction(editor, 'link', 'link', function () { + var groups = getGroups(realm, editor); + realm.setContextToolbar(groups); + RangePreserver.forAndroid(editor, function () { + realm.focusToolbar(); + }); + LinkBridge.query(editor).each(function (link) { + editor.selection.select(link.dom()); + }); + }); + }; + + var DefaultStyleFormats = [ + { + title: 'Headings', + items: [ + { + title: 'Heading 1', + format: 'h1' + }, + { + title: 'Heading 2', + format: 'h2' + }, + { + title: 'Heading 3', + format: 'h3' + }, + { + title: 'Heading 4', + format: 'h4' + }, + { + title: 'Heading 5', + format: 'h5' + }, + { + title: 'Heading 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' + } + ] + } + ]; + + var isRecursive = function (component, originator, target) { + return eq(originator, component.element()) && !eq(originator, target); + }; + var events$8 = derive([can(focus(), function (component, simulatedEvent) { + var originator = simulatedEvent.event().originator(); + var target = simulatedEvent.event().target(); + if (isRecursive(component, originator, target)) { + domGlobals.console.warn(focus() + ' did not get interpreted by the desired target. ' + '\nOriginator: ' + element(originator) + '\nTarget: ' + element(target) + '\nCheck the ' + focus() + ' event handlers'); + return false; + } else { + return true; + } + })]); + + var DefaultEvents = /*#__PURE__*/Object.freeze({ + events: events$8 + }); + + var make$1 = identity; + + var NoContextApi = function (getComp) { + var fail = function (event) { + return function () { + throw new Error('The component must be in a context to send: ' + event + '\n' + element(getComp().element()) + ' is not in context.'); + }; + }; + return { + debugInfo: constant('fake'), + triggerEvent: fail('triggerEvent'), + triggerFocus: fail('triggerFocus'), + triggerEscape: fail('triggerEscape'), + build: fail('build'), + addToWorld: fail('addToWorld'), + removeFromWorld: fail('removeFromWorld'), + addToGui: fail('addToGui'), + removeFromGui: fail('removeFromGui'), + getByUid: fail('getByUid'), + getByDom: fail('getByDom'), + broadcast: fail('broadcast'), + broadcastOn: fail('broadcastOn'), + broadcastEvent: fail('broadcastEvent'), + isConnected: constant(false) + }; + }; + var singleton = NoContextApi(); + + var generateFrom = function (spec, all) { + var schema = map$1(all, function (a) { + return optionObjOf(a.name(), [ + strict$1('config'), + defaulted$1('state', NoState) + ]); + }); + var validated = asRaw('component.behaviours', objOf(schema), spec.behaviours).fold(function (errInfo) { + throw new Error(formatError(errInfo) + '\nComplete spec:\n' + JSON.stringify(spec, null, 2)); + }, function (v) { + return v; + }); + return { + list: all, + data: map(validated, function (optBlobThunk) { + var optBlob = optBlobThunk; + var output = optBlob.map(function (blob) { + return { + config: blob.config, + state: blob.state.init(blob.config) + }; + }); + return function () { + return output; + }; + }) + }; + }; + var getBehaviours = function (bData) { + return bData.list; + }; + var getData = function (bData) { + return bData.data; + }; + + var byInnerKey = function (data, tuple) { + var r = {}; + each(data, function (detail, key) { + each(detail, function (value, indexKey) { + var chain = readOr$1(indexKey, [])(r); + r[indexKey] = chain.concat([tuple(key, value)]); + }); + }); + return r; + }; + + var combine$1 = function (info, baseMod, behaviours, base) { + var modsByBehaviour = __assign({}, baseMod); + each$1(behaviours, function (behaviour) { + modsByBehaviour[behaviour.name()] = behaviour.exhibit(info, base); + }); + var nameAndMod = function (name, modification) { + return { + name: name, + modification: modification + }; + }; + var byAspect = byInnerKey(modsByBehaviour, nameAndMod); + var combineObjects = function (objects) { + return foldr(objects, function (b, a) { + return __assign(__assign({}, a.modification), b); + }, {}); + }; + var combinedClasses = foldr(byAspect.classes, function (b, a) { + return a.modification.concat(b); + }, []); + var combinedAttributes = combineObjects(byAspect.attributes); + var combinedStyles = combineObjects(byAspect.styles); + return nu$5({ + classes: combinedClasses, + attributes: combinedAttributes, + styles: combinedStyles + }); + }; + + var sortKeys = function (label, keyName, array, order) { + var sliced = array.slice(0); + try { + var sorted = sliced.sort(function (a, b) { + var aKey = a[keyName](); + var bKey = b[keyName](); + var aIndex = order.indexOf(aKey); + var bIndex = order.indexOf(bKey); + if (aIndex === -1) { + throw new Error('The ordering for ' + label + ' does not have an entry for ' + aKey + '.\nOrder specified: ' + JSON.stringify(order, null, 2)); + } + if (bIndex === -1) { + throw new Error('The ordering for ' + label + ' does not have an entry for ' + bKey + '.\nOrder specified: ' + JSON.stringify(order, null, 2)); + } + if (aIndex < bIndex) { + return -1; + } else if (bIndex < aIndex) { + return 1; + } else { + return 0; + } + }); + return Result.value(sorted); + } catch (err) { + return Result.error([err]); + } + }; + + var uncurried = function (handler, purpose) { + return { + handler: handler, + purpose: constant(purpose) + }; + }; + var curried = function (handler, purpose) { + return { + cHandler: handler, + purpose: constant(purpose) + }; + }; + var curryArgs = function (descHandler, extraArgs) { + return curried(curry.apply(undefined, [descHandler.handler].concat(extraArgs)), descHandler.purpose()); + }; + var getCurried = function (descHandler) { + return descHandler.cHandler; + }; + + var behaviourTuple = function (name, handler) { + return { + name: constant(name), + handler: constant(handler) + }; + }; + var nameToHandlers = function (behaviours, info) { + var r = {}; + each$1(behaviours, function (behaviour) { + r[behaviour.name()] = behaviour.handlers(info); + }); + return r; + }; + var groupByEvents = function (info, behaviours, base) { + var behaviourEvents = __assign(__assign({}, base), nameToHandlers(behaviours, info)); + return byInnerKey(behaviourEvents, behaviourTuple); + }; + var combine$2 = function (info, eventOrder, behaviours, base) { + var byEventName = groupByEvents(info, behaviours, base); + return combineGroups(byEventName, eventOrder); + }; + var assemble = function (rawHandler) { + var handler = read(rawHandler); + return function (component, simulatedEvent) { + var rest = []; + for (var _i = 2; _i < arguments.length; _i++) { + rest[_i - 2] = arguments[_i]; + } + var args = [ + component, + simulatedEvent + ].concat(rest); + if (handler.abort.apply(undefined, args)) { + simulatedEvent.stop(); + } else if (handler.can.apply(undefined, args)) { + handler.run.apply(undefined, args); + } + }; + }; + var missingOrderError = function (eventName, tuples) { + return Result.error(['The event (' + eventName + ') has more than one behaviour that listens to it.\nWhen this occurs, you must ' + 'specify an event ordering for the behaviours in your spec (e.g. [ "listing", "toggling" ]).\nThe behaviours that ' + 'can trigger it are: ' + JSON.stringify(map$1(tuples, function (c) { + return c.name(); + }), null, 2)]); + }; + var fuse$1 = function (tuples, eventOrder, eventName) { + var order = eventOrder[eventName]; + if (!order) { + return missingOrderError(eventName, tuples); + } else { + return sortKeys('Event: ' + eventName, 'name', tuples, order).map(function (sortedTuples) { + var handlers = map$1(sortedTuples, function (tuple) { + return tuple.handler(); + }); + return fuse(handlers); + }); + } + }; + var combineGroups = function (byEventName, eventOrder) { + var r = mapToArray(byEventName, function (tuples, eventName) { + var combined = tuples.length === 1 ? Result.value(tuples[0].handler()) : fuse$1(tuples, eventOrder, eventName); + return combined.map(function (handler) { + var assembled = assemble(handler); + var purpose = tuples.length > 1 ? filter(eventOrder[eventName], function (o) { + return exists(tuples, function (t) { + return t.name() === o; + }); + }).join(' > ') : tuples[0].name(); + return wrap$1(eventName, uncurried(assembled, purpose)); + }); + }); + return consolidate(r, {}); + }; + + var toInfo = function (spec) { + return asRaw('custom.definition', objOf([ + field('dom', 'dom', strict(), objOf([ + strict$1('tag'), + defaulted$1('styles', {}), + defaulted$1('classes', []), + defaulted$1('attributes', {}), + option('value'), + option('innerHtml') + ])), + strict$1('components'), + strict$1('uid'), + defaulted$1('events', {}), + defaulted$1('apis', {}), + field('eventOrder', 'eventOrder', mergeWith({ + 'alloy.execute': [ + 'disabling', + 'alloy.base.behaviour', + 'toggling', + 'typeaheadevents' + ], + 'alloy.focus': [ + 'alloy.base.behaviour', + 'focusing', + 'keying' + ], + 'alloy.system.init': [ + 'alloy.base.behaviour', + 'disabling', + 'toggling', + 'representing' + ], + 'input': [ + 'alloy.base.behaviour', + 'representing', + 'streaming', + 'invalidating' + ], + 'alloy.system.detached': [ + 'alloy.base.behaviour', + 'representing', + 'item-events', + 'tooltipping' + ], + 'mousedown': [ + 'focusing', + 'alloy.base.behaviour', + 'item-type-events' + ], + 'touchstart': [ + 'focusing', + 'alloy.base.behaviour', + 'item-type-events' + ], + 'mouseover': [ + 'item-type-events', + 'tooltipping' + ] + }), anyValue$1()), + option('domModification') + ]), spec); + }; + var toDefinition = function (detail) { + return __assign(__assign({}, detail.dom), { + uid: detail.uid, + domChildren: map$1(detail.components, function (comp) { + return comp.element(); + }) + }); + }; + var toModification = function (detail) { + return detail.domModification.fold(function () { + return nu$5({}); + }, nu$5); + }; + var toEvents = function (info) { + return info.events; + }; + + var add$3 = function (element, classes) { + each$1(classes, function (x) { + add$2(element, x); + }); + }; + var remove$6 = function (element, classes) { + each$1(classes, function (x) { + remove$4(element, x); + }); + }; + + var renderToDom = function (definition) { + var subject = Element.fromTag(definition.tag); + setAll(subject, definition.attributes); + add$3(subject, definition.classes); + setAll$1(subject, definition.styles); + definition.innerHtml.each(function (html) { + return set$1(subject, html); + }); + var children = definition.domChildren; + append$1(subject, children); + definition.value.each(function (value) { + set$6(subject, value); + }); + if (!definition.uid) { + debugger; + } + writeOnly(subject, definition.uid); + return subject; + }; + + var getBehaviours$1 = function (spec) { + var behaviours = readOr$1('behaviours', {})(spec); + var keys$1 = filter(keys(behaviours), function (k) { + return behaviours[k] !== undefined; + }); + return map$1(keys$1, function (k) { + return behaviours[k].me; + }); + }; + var generateFrom$1 = function (spec, all) { + return generateFrom(spec, all); + }; + var generate$4 = function (spec) { + var all = getBehaviours$1(spec); + return generateFrom$1(spec, all); + }; + + var getDomDefinition = function (info, bList, bData) { + var definition = toDefinition(info); + var infoModification = toModification(info); + var baseModification = { 'alloy.base.modification': infoModification }; + var modification = bList.length > 0 ? combine$1(bData, baseModification, bList, definition) : infoModification; + return merge$1(definition, modification); + }; + var getEvents = function (info, bList, bData) { + var baseEvents = { 'alloy.base.behaviour': toEvents(info) }; + return combine$2(bData, info.eventOrder, bList, baseEvents).getOrDie(); + }; + var build = function (spec) { + var getMe = function () { + return me; + }; + var systemApi = Cell(singleton); + var info = getOrDie(toInfo(spec)); + var bBlob = generate$4(spec); + var bList = getBehaviours(bBlob); + var bData = getData(bBlob); + var modDefinition = getDomDefinition(info, bList, bData); + var item = renderToDom(modDefinition); + var events = getEvents(info, bList, bData); + var subcomponents = Cell(info.components); + var connect = function (newApi) { + systemApi.set(newApi); + }; + var disconnect = function () { + systemApi.set(NoContextApi(getMe)); + }; + var syncComponents = function () { + var children$1 = children(item); + var subs = bind(children$1, function (child) { + return systemApi.get().getByDom(child).fold(function () { + return []; + }, function (c) { + return [c]; + }); + }); + subcomponents.set(subs); + }; + var config = function (behaviour) { + var b = bData; + var f = isFunction(b[behaviour.name()]) ? b[behaviour.name()] : function () { + throw new Error('Could not find ' + behaviour.name() + ' in ' + JSON.stringify(spec, null, 2)); + }; + return f(); + }; + var hasConfigured = function (behaviour) { + return isFunction(bData[behaviour.name()]); + }; + var getApis = function () { + return info.apis; + }; + var readState = function (behaviourName) { + return bData[behaviourName]().map(function (b) { + return b.state.readState(); + }).getOr('not enabled'); + }; + var me = { + getSystem: systemApi.get, + config: config, + hasConfigured: hasConfigured, + spec: constant(spec), + readState: readState, + getApis: getApis, + connect: connect, + disconnect: disconnect, + element: constant(item), + syncComponents: syncComponents, + components: subcomponents.get, + events: constant(events) + }; + return me; + }; + + var buildSubcomponents = function (spec) { + var components = readOr$1('components', [])(spec); + return map$1(components, build$1); + }; + var buildFromSpec = function (userSpec) { + var _a = make$1(userSpec), specEvents = _a.events, spec = __rest(_a, ['events']); + var components = buildSubcomponents(spec); + var completeSpec = __assign(__assign({}, spec), { + events: __assign(__assign({}, DefaultEvents), specEvents), + components: components + }); + return Result.value(build(completeSpec)); + }; + var text = function (textContent) { + var element = Element.fromText(textContent); + return external({ element: element }); + }; + var external = function (spec) { + var extSpec = asRawOrDie('external.component', objOfOnly([ + strict$1('element'), + option('uid') + ]), spec); + var systemApi = Cell(NoContextApi()); + var connect = function (newApi) { + systemApi.set(newApi); + }; + var disconnect = function () { + systemApi.set(NoContextApi(function () { + return me; + })); + }; + extSpec.uid.each(function (uid) { + writeOnly(extSpec.element, uid); + }); + var me = { + getSystem: systemApi.get, + config: Option.none, + hasConfigured: constant(false), + connect: connect, + disconnect: disconnect, + getApis: function () { + return {}; + }, + element: constant(extSpec.element), + spec: constant(spec), + readState: constant('No state'), + syncComponents: noop, + components: constant([]), + events: constant({}) + }; + return premade(me); + }; + var uids = generate$3; + var build$1 = function (spec) { + return getPremade(spec).fold(function () { + var userSpecWithUid = spec.hasOwnProperty('uid') ? spec : __assign({ uid: uids('') }, spec); + return buildFromSpec(userSpecWithUid).getOrDie(); + }, function (prebuilt) { + return prebuilt; + }); + }; + var premade$1 = premade; + + var hoverEvent = 'alloy.item-hover'; + var focusEvent = 'alloy.item-focus'; + var onHover = function (item) { + if (search(item.element()).isNone() || Focusing.isFocused(item)) { + if (!Focusing.isFocused(item)) { + Focusing.focus(item); + } + emitWith(item, hoverEvent, { item: item }); + } + }; + var onFocus = function (item) { + emitWith(item, focusEvent, { item: item }); + }; + var hover = constant(hoverEvent); + var focus$3 = constant(focusEvent); + + var builder = function (detail) { + return { + dom: detail.dom, + domModification: __assign(__assign({}, detail.domModification), { attributes: __assign(__assign(__assign({ 'role': detail.toggling.isSome() ? 'menuitemcheckbox' : 'menuitem' }, detail.domModification.attributes), { 'aria-haspopup': detail.hasSubmenu }), detail.hasSubmenu ? { 'aria-expanded': false } : {}) }), + behaviours: SketchBehaviours.augment(detail.itemBehaviours, [ + detail.toggling.fold(Toggling.revoke, function (tConfig) { + return Toggling.config(__assign({ aria: { mode: 'checked' } }, tConfig)); + }), + Focusing.config({ + ignore: detail.ignoreFocus, + stopMousedown: detail.ignoreFocus, + onFocus: function (component) { + onFocus(component); + } + }), + Keying.config({ mode: 'execution' }), + Representing.config({ + store: { + mode: 'memory', + initialValue: detail.data + } + }), + config('item-type-events', __spreadArrays(pointerEvents(), [ + run(mouseover(), onHover), + run(focusItem(), Focusing.focus) + ])) + ]), + components: detail.components, + eventOrder: detail.eventOrder + }; + }; + var schema$a = [ + strict$1('data'), + strict$1('components'), + strict$1('dom'), + defaulted$1('hasSubmenu', false), + option('toggling'), + SketchBehaviours.field('itemBehaviours', [ + Toggling, + Focusing, + Keying, + Representing + ]), + defaulted$1('ignoreFocus', false), + defaulted$1('domModification', {}), + output('builder', builder), + defaulted$1('eventOrder', {}) + ]; + + var builder$1 = function (detail) { + return { + dom: detail.dom, + components: detail.components, + events: derive([stopper(focusItem())]) + }; + }; + var schema$b = [ + strict$1('dom'), + strict$1('components'), + output('builder', builder$1) + ]; + + var owner$2 = function () { + return 'item-widget'; + }; + var parts = constant([required({ + name: 'widget', + overrides: function (detail) { + return { + behaviours: derive$1([Representing.config({ + store: { + mode: 'manual', + getValue: function (component) { + return detail.data; + }, + setValue: function () { + } + } + })]) + }; + } + })]); + + var builder$2 = function (detail) { + var subs = substitutes(owner$2(), detail, parts()); + var components$1 = components(owner$2(), detail, subs.internals()); + var focusWidget = function (component) { + return getPart(component, detail, 'widget').map(function (widget) { + Keying.focusIn(widget); + return widget; + }); + }; + var onHorizontalArrow = function (component, simulatedEvent) { + return inside(simulatedEvent.event().target()) ? Option.none() : function () { + if (detail.autofocus) { + simulatedEvent.setSource(component.element()); + return Option.none(); + } else { + return Option.none(); + } + }(); + }; + return { + dom: detail.dom, + components: components$1, + domModification: detail.domModification, + events: derive([ + runOnExecute(function (component, simulatedEvent) { + focusWidget(component).each(function (widget) { + simulatedEvent.stop(); + }); + }), + run(mouseover(), onHover), + run(focusItem(), function (component, simulatedEvent) { + if (detail.autofocus) { + focusWidget(component); + } else { + Focusing.focus(component); + } + }) + ]), + behaviours: SketchBehaviours.augment(detail.widgetBehaviours, [ + Representing.config({ + store: { + mode: 'memory', + initialValue: detail.data + } + }), + Focusing.config({ + ignore: detail.ignoreFocus, + onFocus: function (component) { + onFocus(component); + } + }), + Keying.config({ + mode: 'special', + focusIn: detail.autofocus ? function (component) { + focusWidget(component); + } : revoke(), + onLeft: onHorizontalArrow, + onRight: onHorizontalArrow, + onEscape: function (component, simulatedEvent) { + if (!Focusing.isFocused(component) && !detail.autofocus) { + Focusing.focus(component); + return Option.some(true); + } else if (detail.autofocus) { + simulatedEvent.setSource(component.element()); + return Option.none(); + } else { + return Option.none(); + } + } + }) + ]) + }; + }; + var schema$c = [ + strict$1('uid'), + strict$1('data'), + strict$1('components'), + strict$1('dom'), + defaulted$1('autofocus', false), + defaulted$1('ignoreFocus', false), + SketchBehaviours.field('widgetBehaviours', [ + Representing, + Focusing, + Keying + ]), + defaulted$1('domModification', {}), + defaultUidsSchema(parts()), + output('builder', builder$2) + ]; + + var itemSchema$1 = choose$1('type', { + widget: schema$c, + item: schema$a, + separator: schema$b + }); + var configureGrid = function (detail, movementInfo) { + return { + mode: 'flatgrid', + selector: '.' + detail.markers.item, + initSize: { + numColumns: movementInfo.initSize.numColumns, + numRows: movementInfo.initSize.numRows + }, + focusManager: detail.focusManager + }; + }; + var configureMatrix = function (detail, movementInfo) { + return { + mode: 'matrix', + selectors: { + row: movementInfo.rowSelector, + cell: '.' + detail.markers.item + }, + focusManager: detail.focusManager + }; + }; + var configureMenu = function (detail, movementInfo) { + return { + mode: 'menu', + selector: '.' + detail.markers.item, + moveOnTab: movementInfo.moveOnTab, + focusManager: detail.focusManager + }; + }; + var parts$1 = constant([group({ + factory: { + sketch: function (spec) { + var itemInfo = asRawOrDie('menu.spec item', itemSchema$1, spec); + return itemInfo.builder(itemInfo); + } + }, + name: 'items', + unit: 'item', + defaults: function (detail, u) { + return u.hasOwnProperty('uid') ? u : __assign(__assign({}, u), { uid: generate$3('item') }); + }, + overrides: function (detail, u) { + return { + type: u.type, + ignoreFocus: detail.fakeFocus, + domModification: { classes: [detail.markers.item] } + }; + } + })]); + var schema$d = constant([ + strict$1('value'), + strict$1('items'), + strict$1('dom'), + strict$1('components'), + defaulted$1('eventOrder', {}), + field$1('menuBehaviours', [ + Highlighting, + Representing, + Composing, + Keying + ]), + defaultedOf('movement', { + mode: 'menu', + moveOnTab: true + }, choose$1('mode', { + grid: [ + initSize(), + output('config', configureGrid) + ], + matrix: [ + output('config', configureMatrix), + strict$1('rowSelector') + ], + menu: [ + defaulted$1('moveOnTab', true), + output('config', configureMenu) + ] + })), + itemMarkers(), + defaulted$1('fakeFocus', false), + defaulted$1('focusManager', dom()), + onHandler('onHighlight') + ]); + + var focus$4 = constant('alloy.menu-focus'); + + var make$2 = function (detail, components, spec, externals) { + return { + uid: detail.uid, + dom: detail.dom, + markers: detail.markers, + behaviours: augment(detail.menuBehaviours, [ + Highlighting.config({ + highlightClass: detail.markers.selectedItem, + itemClass: detail.markers.item, + onHighlight: detail.onHighlight + }), + Representing.config({ + store: { + mode: 'memory', + initialValue: detail.value + } + }), + Composing.config({ find: Option.some }), + Keying.config(detail.movement.config(detail, detail.movement)) + ]), + events: derive([ + run(focus$3(), function (menu, simulatedEvent) { + var event = simulatedEvent.event(); + menu.getSystem().getByDom(event.target()).each(function (item) { + Highlighting.highlight(menu, item); + simulatedEvent.stop(); + emitWith(menu, focus$4(), { + menu: menu, + item: item + }); + }); + }), + run(hover(), function (menu, simulatedEvent) { + var item = simulatedEvent.event().item(); + Highlighting.highlight(menu, item); + }) + ]), + components: components, + eventOrder: detail.eventOrder, + domModification: { attributes: { role: 'menu' } } + }; + }; + + var Menu = composite$1({ + name: 'Menu', + configFields: schema$d(), + partFields: parts$1(), + factory: make$2 + }); + + var preserve$1 = function (f, container) { + var ownerDoc = owner(container); + var refocus = active(ownerDoc).bind(function (focused) { + var hasFocus = function (elem) { + return eq(focused, elem); + }; + return hasFocus(container) ? Option.some(container) : descendant(container, hasFocus); + }); + var result = f(container); + refocus.each(function (oldFocus) { + active(ownerDoc).filter(function (newFocus) { + return eq(newFocus, oldFocus); + }).fold(function () { + focus$1(oldFocus); + }, noop); + }); + return result; + }; + + var set$8 = function (component, replaceConfig, replaceState, data) { + preserve$1(function () { + var newChildren = map$1(data, component.getSystem().build); + replaceChildren(component, newChildren); + }, component.element()); + }; + var insert = function (component, replaceConfig, insertion, childSpec) { + var child = component.getSystem().build(childSpec); + attachWith(component, child, insertion); + }; + var append$2 = function (component, replaceConfig, replaceState, appendee) { + insert(component, replaceConfig, append, appendee); + }; + var prepend$1 = function (component, replaceConfig, replaceState, prependee) { + insert(component, replaceConfig, prepend, prependee); + }; + var remove$7 = function (component, replaceConfig, replaceState, removee) { + var children = contents(component); + var foundChild = find$2(children, function (child) { + return eq(removee.element(), child.element()); + }); + foundChild.each(detach); + }; + var contents = function (component, replaceConfig) { + return component.components(); + }; + var replaceAt = function (component, replaceConfig, replaceState, replaceeIndex, replacer) { + var children = contents(component); + return Option.from(children[replaceeIndex]).map(function (replacee) { + remove$7(component, replaceConfig, replaceState, replacee); + replacer.each(function (r) { + insert(component, replaceConfig, function (p, c) { + appendAt(p, c, replaceeIndex); + }, r); + }); + return replacee; + }); + }; + var replaceBy = function (component, replaceConfig, replaceState, replaceePred, replacer) { + var children = contents(component); + return findIndex(children, replaceePred).bind(function (replaceeIndex) { + return replaceAt(component, replaceConfig, replaceState, replaceeIndex, replacer); + }); + }; + + var ReplaceApis = /*#__PURE__*/Object.freeze({ + append: append$2, + prepend: prepend$1, + remove: remove$7, + replaceAt: replaceAt, + replaceBy: replaceBy, + set: set$8, + contents: contents + }); + + var Replacing = create$1({ + fields: [], + name: 'replacing', + apis: ReplaceApis + }); + + var transpose = function (obj) { + return tupleMap(obj, function (v, k) { + return { + k: v, + v: k + }; + }); + }; + var trace = function (items, byItem, byMenu, finish) { + return readOptFrom$1(byMenu, finish).bind(function (triggerItem) { + return readOptFrom$1(items, triggerItem).bind(function (triggerMenu) { + var rest = trace(items, byItem, byMenu, triggerMenu); + return Option.some([triggerMenu].concat(rest)); + }); + }).getOr([]); + }; + var generate$5 = function (menus, expansions) { + var items = {}; + each(menus, function (menuItems, menu) { + each$1(menuItems, function (item) { + items[item] = menu; + }); + }); + var byItem = expansions; + var byMenu = transpose(expansions); + var menuPaths = map(byMenu, function (_triggerItem, submenu) { + return [submenu].concat(trace(items, byItem, byMenu, submenu)); + }); + return map(items, function (menu) { + return readOptFrom$1(menuPaths, menu).getOr([menu]); + }); + }; + + var init$3 = function () { + var expansions = Cell({}); + var menus = Cell({}); + var paths = Cell({}); + var primary = Cell(Option.none()); + var directory = Cell({}); + var clear = function () { + expansions.set({}); + menus.set({}); + paths.set({}); + primary.set(Option.none()); + }; + var isClear = function () { + return primary.get().isNone(); + }; + var setMenuBuilt = function (menuName, built) { + var _a; + menus.set(__assign(__assign({}, menus.get()), (_a = {}, _a[menuName] = { + type: 'prepared', + menu: built + }, _a))); + }; + var setContents = function (sPrimary, sMenus, sExpansions, dir) { + primary.set(Option.some(sPrimary)); + expansions.set(sExpansions); + menus.set(sMenus); + directory.set(dir); + var sPaths = generate$5(dir, sExpansions); + paths.set(sPaths); + }; + var getTriggeringItem = function (menuValue) { + return find(expansions.get(), function (v, k) { + return v === menuValue; + }); + }; + var getTriggerData = function (menuValue, getItemByValue, path) { + return getPreparedMenu(menuValue).bind(function (menu) { + return getTriggeringItem(menuValue).bind(function (triggeringItemValue) { + return getItemByValue(triggeringItemValue).map(function (triggeredItem) { + return { + triggeredMenu: menu, + triggeringItem: triggeredItem, + triggeringPath: path + }; + }); + }); + }); + }; + var getTriggeringPath = function (itemValue, getItemByValue) { + var extraPath = filter(lookupItem(itemValue).toArray(), function (menuValue) { + return getPreparedMenu(menuValue).isSome(); + }); + return readOptFrom$1(paths.get(), itemValue).bind(function (path) { + var revPath = reverse(extraPath.concat(path)); + var triggers = bind(revPath, function (menuValue, menuIndex) { + return getTriggerData(menuValue, getItemByValue, revPath.slice(0, menuIndex + 1)).fold(function () { + return primary.get().is(menuValue) ? [] : [Option.none()]; + }, function (data) { + return [Option.some(data)]; + }); + }); + return sequence(triggers); + }); + }; + var expand = function (itemValue) { + return readOptFrom$1(expansions.get(), itemValue).map(function (menu) { + var current = readOptFrom$1(paths.get(), itemValue).getOr([]); + return [menu].concat(current); + }); + }; + var collapse = function (itemValue) { + return readOptFrom$1(paths.get(), itemValue).bind(function (path) { + return path.length > 1 ? Option.some(path.slice(1)) : Option.none(); + }); + }; + var refresh = function (itemValue) { + return readOptFrom$1(paths.get(), itemValue); + }; + var getPreparedMenu = function (menuValue) { + return lookupMenu(menuValue).bind(extractPreparedMenu); + }; + var lookupMenu = function (menuValue) { + return readOptFrom$1(menus.get(), menuValue); + }; + var lookupItem = function (itemValue) { + return readOptFrom$1(expansions.get(), itemValue); + }; + var otherMenus = function (path) { + var menuValues = directory.get(); + return difference(keys(menuValues), path); + }; + var getPrimary = function () { + return primary.get().bind(getPreparedMenu); + }; + var getMenus = function () { + return menus.get(); + }; + return { + setMenuBuilt: setMenuBuilt, + setContents: setContents, + expand: expand, + refresh: refresh, + collapse: collapse, + lookupMenu: lookupMenu, + lookupItem: lookupItem, + otherMenus: otherMenus, + getPrimary: getPrimary, + getMenus: getMenus, + clear: clear, + isClear: isClear, + getTriggeringPath: getTriggeringPath + }; + }; + var extractPreparedMenu = function (prep) { + return prep.type === 'prepared' ? Option.some(prep.menu) : Option.none(); + }; + var LayeredState = { + init: init$3, + extractPreparedMenu: extractPreparedMenu + }; + + var make$3 = function (detail, rawUiSpec) { + var submenuParentItems = Cell(Option.none()); + var buildMenus = function (container, primaryName, menus) { + return map(menus, function (spec, name) { + var makeSketch = function () { + return Menu.sketch(__assign(__assign({ dom: spec.dom }, spec), { + value: name, + items: spec.items, + markers: detail.markers, + fakeFocus: detail.fakeFocus, + onHighlight: detail.onHighlight, + focusManager: detail.fakeFocus ? highlights() : dom() + })); + }; + return name === primaryName ? { + type: 'prepared', + menu: container.getSystem().build(makeSketch()) + } : { + type: 'notbuilt', + nbMenu: makeSketch + }; + }); + }; + var layeredState = LayeredState.init(); + var setup = function (container) { + var componentMap = buildMenus(container, detail.data.primary, detail.data.menus); + var directory = toDirectory(); + layeredState.setContents(detail.data.primary, componentMap, detail.data.expansions, directory); + return layeredState.getPrimary(); + }; + var getItemValue = function (item) { + return Representing.getValue(item).value; + }; + var getItemByValue = function (container, menus, itemValue) { + return findMap(menus, function (menu) { + if (!menu.getSystem().isConnected()) { + return Option.none(); + } + var candidates = Highlighting.getCandidates(menu); + return find$2(candidates, function (c) { + return getItemValue(c) === itemValue; + }); + }); + }; + var toDirectory = function (container) { + return map(detail.data.menus, function (data, menuName) { + return bind(data.items, function (item) { + return item.type === 'separator' ? [] : [item.data.value]; + }); + }); + }; + var setActiveMenu = function (container, menu) { + Highlighting.highlight(container, menu); + Highlighting.getHighlighted(menu).orThunk(function () { + return Highlighting.getFirst(menu); + }).each(function (item) { + dispatch(container, item.element(), focusItem()); + }); + }; + var getMenus = function (state, menuValues) { + return cat(map$1(menuValues, function (mv) { + return state.lookupMenu(mv).bind(function (prep) { + return prep.type === 'prepared' ? Option.some(prep.menu) : Option.none(); + }); + })); + }; + var closeOthers = function (container, state, path) { + var others = getMenus(state, state.otherMenus(path)); + each$1(others, function (o) { + remove$6(o.element(), [detail.markers.backgroundMenu]); + if (!detail.stayInDom) { + Replacing.remove(container, o); + } + }); + }; + var getSubmenuParents = function (container) { + return submenuParentItems.get().getOrThunk(function () { + var r = {}; + var items = descendants(container.element(), '.' + detail.markers.item); + var parentItems = filter(items, function (i) { + return get(i, 'aria-haspopup') === 'true'; + }); + each$1(parentItems, function (i) { + container.getSystem().getByDom(i).each(function (itemComp) { + var key = getItemValue(itemComp); + r[key] = itemComp; + }); + }); + submenuParentItems.set(Option.some(r)); + return r; + }); + }; + var updateAriaExpansions = function (container, path) { + var parentItems = getSubmenuParents(container); + each(parentItems, function (v, k) { + var expanded = contains(path, k); + set(v.element(), 'aria-expanded', expanded); + }); + }; + var updateMenuPath = function (container, state, path) { + return Option.from(path[0]).bind(function (latestMenuName) { + return state.lookupMenu(latestMenuName).bind(function (menuPrep) { + if (menuPrep.type === 'notbuilt') { + return Option.none(); + } else { + var activeMenu = menuPrep.menu; + var rest = getMenus(state, path.slice(1)); + each$1(rest, function (r) { + add$2(r.element(), detail.markers.backgroundMenu); + }); + if (!inBody(activeMenu.element())) { + Replacing.append(container, premade$1(activeMenu)); + } + remove$6(activeMenu.element(), [detail.markers.backgroundMenu]); + setActiveMenu(container, activeMenu); + closeOthers(container, state, path); + return Option.some(activeMenu); + } + }); + }); + }; + var ExpandHighlightDecision; + (function (ExpandHighlightDecision) { + ExpandHighlightDecision[ExpandHighlightDecision['HighlightSubmenu'] = 0] = 'HighlightSubmenu'; + ExpandHighlightDecision[ExpandHighlightDecision['HighlightParent'] = 1] = 'HighlightParent'; + }(ExpandHighlightDecision || (ExpandHighlightDecision = {}))); + var buildIfRequired = function (container, menuName, menuPrep) { + if (menuPrep.type === 'notbuilt') { + var menu = container.getSystem().build(menuPrep.nbMenu()); + layeredState.setMenuBuilt(menuName, menu); + return menu; + } else { + return menuPrep.menu; + } + }; + var expandRight = function (container, item, decision) { + if (decision === void 0) { + decision = ExpandHighlightDecision.HighlightSubmenu; + } + var value = getItemValue(item); + return layeredState.expand(value).bind(function (path) { + updateAriaExpansions(container, path); + return Option.from(path[0]).bind(function (menuName) { + return layeredState.lookupMenu(menuName).bind(function (activeMenuPrep) { + var activeMenu = buildIfRequired(container, menuName, activeMenuPrep); + if (!inBody(activeMenu.element())) { + Replacing.append(container, premade$1(activeMenu)); + } + detail.onOpenSubmenu(container, item, activeMenu, reverse(path)); + if (decision === ExpandHighlightDecision.HighlightSubmenu) { + Highlighting.highlightFirst(activeMenu); + return updateMenuPath(container, layeredState, path); + } else { + Highlighting.dehighlightAll(activeMenu); + return Option.some(item); + } + }); + }); + }); + }; + var collapseLeft = function (container, item) { + var value = getItemValue(item); + return layeredState.collapse(value).bind(function (path) { + updateAriaExpansions(container, path); + return updateMenuPath(container, layeredState, path).map(function (activeMenu) { + detail.onCollapseMenu(container, item, activeMenu); + return activeMenu; + }); + }); + }; + var updateView = function (container, item) { + var value = getItemValue(item); + return layeredState.refresh(value).bind(function (path) { + updateAriaExpansions(container, path); + return updateMenuPath(container, layeredState, path); + }); + }; + var onRight = function (container, item) { + return inside(item.element()) ? Option.none() : expandRight(container, item, ExpandHighlightDecision.HighlightSubmenu); + }; + var onLeft = function (container, item) { + return inside(item.element()) ? Option.none() : collapseLeft(container, item); + }; + var onEscape = function (container, item) { + return collapseLeft(container, item).orThunk(function () { + return detail.onEscape(container, item).map(function () { + return container; + }); + }); + }; + var keyOnItem = function (f) { + return function (container, simulatedEvent) { + return closest$2(simulatedEvent.getSource(), '.' + detail.markers.item).bind(function (target) { + return container.getSystem().getByDom(target).toOption().bind(function (item) { + return f(container, item).map(function () { + return true; + }); + }); + }); + }; + }; + var events = derive([ + run(focus$4(), function (sandbox, simulatedEvent) { + var item = simulatedEvent.event().item(); + layeredState.lookupItem(getItemValue(item)).each(function () { + var menu = simulatedEvent.event().menu(); + Highlighting.highlight(sandbox, menu); + var value = getItemValue(simulatedEvent.event().item()); + layeredState.refresh(value).each(function (path) { + return closeOthers(sandbox, layeredState, path); + }); + }); + }), + runOnExecute(function (component, simulatedEvent) { + var target = simulatedEvent.event().target(); + component.getSystem().getByDom(target).each(function (item) { + var itemValue = getItemValue(item); + if (itemValue.indexOf('collapse-item') === 0) { + collapseLeft(component, item); + } + expandRight(component, item, ExpandHighlightDecision.HighlightSubmenu).fold(function () { + detail.onExecute(component, item); + }, function () { + }); + }); + }), + runOnAttached(function (container, simulatedEvent) { + setup(container).each(function (primary) { + Replacing.append(container, premade$1(primary)); + detail.onOpenMenu(container, primary); + if (detail.highlightImmediately) { + setActiveMenu(container, primary); + } + }); + }) + ].concat(detail.navigateOnHover ? [run(hover(), function (sandbox, simulatedEvent) { + var item = simulatedEvent.event().item(); + updateView(sandbox, item); + expandRight(sandbox, item, ExpandHighlightDecision.HighlightParent); + detail.onHover(sandbox, item); + })] : [])); + var getActiveItem = function (container) { + return Highlighting.getHighlighted(container).bind(Highlighting.getHighlighted); + }; + var collapseMenuApi = function (container) { + getActiveItem(container).each(function (currentItem) { + collapseLeft(container, currentItem); + }); + }; + var highlightPrimary = function (container) { + layeredState.getPrimary().each(function (primary) { + setActiveMenu(container, primary); + }); + }; + var extractMenuFromContainer = function (container) { + return Option.from(container.components()[0]).filter(function (comp) { + return get(comp.element(), 'role') === 'menu'; + }); + }; + var repositionMenus = function (container) { + var maybeActivePrimary = layeredState.getPrimary().bind(function (primary) { + return getActiveItem(container).bind(function (currentItem) { + var itemValue = getItemValue(currentItem); + var allMenus = values(layeredState.getMenus()); + var preparedMenus = cat(map$1(allMenus, LayeredState.extractPreparedMenu)); + return layeredState.getTriggeringPath(itemValue, function (v) { + return getItemByValue(container, preparedMenus, v); + }); + }).map(function (triggeringPath) { + return { + primary: primary, + triggeringPath: triggeringPath + }; + }); + }); + maybeActivePrimary.fold(function () { + extractMenuFromContainer(container).each(function (primaryMenu) { + detail.onRepositionMenu(container, primaryMenu, []); + }); + }, function (_a) { + var primary = _a.primary, triggeringPath = _a.triggeringPath; + detail.onRepositionMenu(container, primary, triggeringPath); + }); + }; + var apis = { + collapseMenu: collapseMenuApi, + highlightPrimary: highlightPrimary, + repositionMenus: repositionMenus + }; + return { + uid: detail.uid, + dom: detail.dom, + markers: detail.markers, + behaviours: augment(detail.tmenuBehaviours, [ + Keying.config({ + mode: 'special', + onRight: keyOnItem(onRight), + onLeft: keyOnItem(onLeft), + onEscape: keyOnItem(onEscape), + focusIn: function (container, keyInfo) { + layeredState.getPrimary().each(function (primary) { + dispatch(container, primary.element(), focusItem()); + }); + } + }), + Highlighting.config({ + highlightClass: detail.markers.selectedMenu, + itemClass: detail.markers.menu + }), + Composing.config({ + find: function (container) { + return Highlighting.getHighlighted(container); + } + }), + Replacing.config({}) + ]), + eventOrder: detail.eventOrder, + apis: apis, + events: events + }; + }; + var collapseItem = constant('collapse-item'); + + var tieredData = function (primary, menus, expansions) { + return { + primary: primary, + menus: menus, + expansions: expansions + }; + }; + var singleData = function (name, menu) { + return { + primary: name, + menus: wrap$1(name, menu), + expansions: {} + }; + }; + var collapseItem$1 = function (text) { + return { + value: generate$1(collapseItem()), + meta: { text: text } + }; + }; + var tieredMenu = single$2({ + name: 'TieredMenu', + configFields: [ + onStrictKeyboardHandler('onExecute'), + onStrictKeyboardHandler('onEscape'), + onStrictHandler('onOpenMenu'), + onStrictHandler('onOpenSubmenu'), + onStrictHandler('onRepositionMenu'), + onHandler('onCollapseMenu'), + defaulted$1('highlightImmediately', true), + strictObjOf('data', [ + strict$1('primary'), + strict$1('menus'), + strict$1('expansions') + ]), + defaulted$1('fakeFocus', false), + onHandler('onHighlight'), + onHandler('onHover'), + tieredMenuMarkers(), + strict$1('dom'), + defaulted$1('navigateOnHover', true), + defaulted$1('stayInDom', false), + field$1('tmenuBehaviours', [ + Keying, + Highlighting, + Composing, + Replacing + ]), + defaulted$1('eventOrder', {}) + ], + apis: { + collapseMenu: function (apis, tmenu) { + apis.collapseMenu(tmenu); + }, + highlightPrimary: function (apis, tmenu) { + apis.highlightPrimary(tmenu); + }, + repositionMenus: function (apis, tmenu) { + apis.repositionMenus(tmenu); + } + }, + factory: make$3, + extraApis: { + tieredData: tieredData, + singleData: singleData, + collapseItem: collapseItem$1 + } + }); + + var findRoute = function (component, transConfig, transState, route) { + return readOptFrom$1(transConfig.routes, route.start).bind(function (sConfig) { + return readOptFrom$1(sConfig, route.destination); + }); + }; + var getTransition = function (comp, transConfig, transState) { + var route = getCurrentRoute(comp, transConfig); + return route.bind(function (r) { + return getTransitionOf(comp, transConfig, transState, r); + }); + }; + var getTransitionOf = function (comp, transConfig, transState, route) { + return findRoute(comp, transConfig, transState, route).bind(function (r) { + return r.transition.map(function (t) { + return { + transition: t, + route: r + }; + }); + }); + }; + var disableTransition = function (comp, transConfig, transState) { + getTransition(comp, transConfig, transState).each(function (routeTransition) { + var t = routeTransition.transition; + remove$4(comp.element(), t.transitionClass); + remove$1(comp.element(), transConfig.destinationAttr); + }); + }; + var getNewRoute = function (comp, transConfig, transState, destination) { + return { + start: get(comp.element(), transConfig.stateAttr), + destination: destination + }; + }; + var getCurrentRoute = function (comp, transConfig, transState) { + var el = comp.element(); + return has$1(el, transConfig.destinationAttr) ? Option.some({ + start: get(comp.element(), transConfig.stateAttr), + destination: get(comp.element(), transConfig.destinationAttr) + }) : Option.none(); + }; + var jumpTo = function (comp, transConfig, transState, destination) { + disableTransition(comp, transConfig, transState); + if (has$1(comp.element(), transConfig.stateAttr) && get(comp.element(), transConfig.stateAttr) !== destination) { + transConfig.onFinish(comp, destination); + } + set(comp.element(), transConfig.stateAttr, destination); + }; + var fasttrack = function (comp, transConfig, transState, destination) { + if (has$1(comp.element(), transConfig.destinationAttr)) { + set(comp.element(), transConfig.stateAttr, get(comp.element(), transConfig.destinationAttr)); + remove$1(comp.element(), transConfig.destinationAttr); + } + }; + var progressTo = function (comp, transConfig, transState, destination) { + fasttrack(comp, transConfig); + var route = getNewRoute(comp, transConfig, transState, destination); + getTransitionOf(comp, transConfig, transState, route).fold(function () { + jumpTo(comp, transConfig, transState, destination); + }, function (routeTransition) { + disableTransition(comp, transConfig, transState); + var t = routeTransition.transition; + add$2(comp.element(), t.transitionClass); + set(comp.element(), transConfig.destinationAttr, destination); + }); + }; + var getState$1 = function (comp, transConfig, transState) { + var e = comp.element(); + return has$1(e, transConfig.stateAttr) ? Option.some(get(e, transConfig.stateAttr)) : Option.none(); + }; + + var TransitionApis = /*#__PURE__*/Object.freeze({ + findRoute: findRoute, + disableTransition: disableTransition, + getCurrentRoute: getCurrentRoute, + jumpTo: jumpTo, + progressTo: progressTo, + getState: getState$1 + }); + + var events$9 = function (transConfig, transState) { + return derive([ + run(transitionend(), function (component, simulatedEvent) { + var raw = simulatedEvent.event().raw(); + getCurrentRoute(component, transConfig).each(function (route) { + findRoute(component, transConfig, transState, route).each(function (rInfo) { + rInfo.transition.each(function (rTransition) { + if (raw.propertyName === rTransition.property) { + jumpTo(component, transConfig, transState, route.destination); + transConfig.onTransition(component, route); + } + }); + }); + }); + }), + runOnAttached(function (comp, se) { + jumpTo(comp, transConfig, transState, transConfig.initialState); + }) + ]); + }; + + var ActiveTransitioning = /*#__PURE__*/Object.freeze({ + events: events$9 + }); + + var TransitionSchema = [ + defaulted$1('destinationAttr', 'data-transitioning-destination'), + defaulted$1('stateAttr', 'data-transitioning-state'), + strict$1('initialState'), + onHandler('onTransition'), + onHandler('onFinish'), + strictOf('routes', setOf$1(Result.value, setOf$1(Result.value, objOfOnly([optionObjOfOnly('transition', [ + strict$1('property'), + strict$1('transitionClass') + ])])))) + ]; + + var createRoutes = function (routes) { + var r = {}; + each(routes, function (v, k) { + var waypoints = k.split('<->'); + r[waypoints[0]] = wrap$1(waypoints[1], v); + r[waypoints[1]] = wrap$1(waypoints[0], v); + }); + return r; + }; + var createBistate = function (first, second, transitions) { + return wrapAll$1([ + { + key: first, + value: wrap$1(second, transitions) + }, + { + key: second, + value: wrap$1(first, transitions) + } + ]); + }; + var createTristate = function (first, second, third, transitions) { + return wrapAll$1([ + { + key: first, + value: wrapAll$1([ + { + key: second, + value: transitions + }, + { + key: third, + value: transitions + } + ]) + }, + { + key: second, + value: wrapAll$1([ + { + key: first, + value: transitions + }, + { + key: third, + value: transitions + } + ]) + }, + { + key: third, + value: wrapAll$1([ + { + key: first, + value: transitions + }, + { + key: second, + value: transitions + } + ]) + } + ]); + }; + var Transitioning = create$1({ + fields: TransitionSchema, + name: 'transitioning', + active: ActiveTransitioning, + apis: TransitionApis, + extra: { + createRoutes: createRoutes, + createBistate: createBistate, + createTristate: createTristate + } + }); + + var scrollable = Styles.resolve('scrollable'); + var register = function (element) { + add$2(element, scrollable); + }; + var deregister = function (element) { + remove$4(element, scrollable); + }; + var Scrollable = { + register: register, + deregister: deregister, + scrollable: constant(scrollable) + }; + + var getValue$4 = function (item) { + return readOptFrom$1(item, 'format').getOr(item.title); + }; + var convert$1 = function (formats, memMenuThunk) { + var mainMenu = makeMenu('Styles', [].concat(map$1(formats.items, function (k) { + return makeItem(getValue$4(k), k.title, k.isSelected(), k.getPreview(), hasKey$1(formats.expansions, getValue$4(k))); + })), memMenuThunk, false); + var submenus = map(formats.menus, function (menuItems, menuName) { + var items = map$1(menuItems, function (item) { + return makeItem(getValue$4(item), item.title, item.isSelected !== undefined ? item.isSelected() : false, item.getPreview !== undefined ? item.getPreview() : '', hasKey$1(formats.expansions, getValue$4(item))); + }); + return makeMenu(menuName, items, memMenuThunk, true); + }); + var menus = deepMerge(submenus, wrap$1('styles', mainMenu)); + var tmenu = tieredMenu.tieredData('styles', menus, formats.expansions); + return { tmenu: tmenu }; + }; + var makeItem = function (value, text, selected, preview, isMenu) { + return { + data: { + value: value, + text: text + }, + type: 'item', + dom: { + tag: 'div', + classes: isMenu ? [Styles.resolve('styles-item-is-menu')] : [] + }, + toggling: { + toggleOnExecute: false, + toggleClass: Styles.resolve('format-matches'), + selected: selected + }, + itemBehaviours: derive$1(isMenu ? [] : [Receivers.format(value, function (comp, status) { + var toggle = status ? Toggling.on : Toggling.off; + toggle(comp); + })]), + components: [{ + dom: { + tag: 'div', + attributes: { style: preview }, + innerHtml: text + } + }] + }; + }; + var makeMenu = function (value, items, memMenuThunk, collapsable) { + return { + value: value, + dom: { tag: 'div' }, + components: [ + Button.sketch({ + dom: { + tag: 'div', + classes: [Styles.resolve('styles-collapser')] + }, + components: collapsable ? [ + { + dom: { + tag: 'span', + classes: [Styles.resolve('styles-collapse-icon')] + } + }, + text(value) + ] : [text(value)], + action: function (item) { + if (collapsable) { + var comp = memMenuThunk().get(item); + tieredMenu.collapseMenu(comp); + } + } + }), + { + dom: { + tag: 'div', + classes: [Styles.resolve('styles-menu-items-container')] + }, + components: [Menu.parts().items({})], + behaviours: derive$1([config('adhoc-scrollable-menu', [ + runOnAttached(function (component, simulatedEvent) { + set$3(component.element(), 'overflow-y', 'auto'); + set$3(component.element(), '-webkit-overflow-scrolling', 'touch'); + Scrollable.register(component.element()); + }), + runOnDetached(function (component) { + remove$5(component.element(), 'overflow-y'); + remove$5(component.element(), '-webkit-overflow-scrolling'); + Scrollable.deregister(component.element()); + }) + ])]) + } + ], + items: items, + menuBehaviours: derive$1([Transitioning.config({ + initialState: 'after', + routes: Transitioning.createTristate('before', 'current', 'after', { + transition: { + property: 'transform', + transitionClass: 'transitioning' + } + }) + })]) + }; + }; + var sketch$8 = function (settings) { + var dataset = convert$1(settings.formats, function () { + return memMenu; + }); + var memMenu = record(tieredMenu.sketch({ + dom: { + tag: 'div', + classes: [Styles.resolve('styles-menu')] + }, + components: [], + fakeFocus: true, + stayInDom: true, + onExecute: function (tmenu, item) { + var v = Representing.getValue(item); + settings.handle(item, v.value); + return Option.none(); + }, + onEscape: function () { + return Option.none(); + }, + onOpenMenu: function (container, menu) { + var w = get$6(container.element()); + set$4(menu.element(), w); + Transitioning.jumpTo(menu, 'current'); + }, + onOpenSubmenu: function (container, item, submenu) { + var w = get$6(container.element()); + var menu = ancestor$1(item.element(), '[role="menu"]').getOrDie('hacky'); + var menuComp = container.getSystem().getByDom(menu).getOrDie(); + set$4(submenu.element(), w); + Transitioning.progressTo(menuComp, 'before'); + Transitioning.jumpTo(submenu, 'after'); + Transitioning.progressTo(submenu, 'current'); + }, + onCollapseMenu: function (container, item, menu) { + var submenu = ancestor$1(item.element(), '[role="menu"]').getOrDie('hacky'); + var submenuComp = container.getSystem().getByDom(submenu).getOrDie(); + Transitioning.progressTo(submenuComp, 'after'); + Transitioning.progressTo(menu, 'current'); + }, + navigateOnHover: false, + highlightImmediately: true, + data: dataset.tmenu, + markers: { + backgroundMenu: Styles.resolve('styles-background-menu'), + menu: Styles.resolve('styles-menu'), + selectedMenu: Styles.resolve('styles-selected-menu'), + item: Styles.resolve('styles-item'), + selectedItem: Styles.resolve('styles-selected-item') + } + })); + return memMenu.asSpec(); + }; + var StylesMenu = { sketch: sketch$8 }; + + var getFromExpandingItem = function (item) { + var newItem = deepMerge(exclude$1(item, ['items']), { menu: true }); + var rest = expand(item.items); + var newMenus = deepMerge(rest.menus, wrap$1(item.title, rest.items)); + var newExpansions = deepMerge(rest.expansions, wrap$1(item.title, item.title)); + return { + item: newItem, + menus: newMenus, + expansions: newExpansions + }; + }; + var getFromItem = function (item) { + return hasKey$1(item, 'items') ? getFromExpandingItem(item) : { + item: item, + menus: {}, + expansions: {} + }; + }; + var expand = function (items) { + return foldr(items, function (acc, item) { + var newData = getFromItem(item); + return { + menus: deepMerge(acc.menus, newData.menus), + items: [newData.item].concat(acc.items), + expansions: deepMerge(acc.expansions, newData.expansions) + }; + }, { + menus: {}, + expansions: {}, + items: [] + }); + }; + var StyleConversions = { expand: expand }; + + var register$1 = function (editor, settings) { + var isSelectedFor = function (format) { + return function () { + return editor.formatter.match(format); + }; + }; + var getPreview = function (format) { + return function () { + var styles = editor.formatter.getCssText(format); + return styles; + }; + }; + var enrichSupported = function (item) { + return deepMerge(item, { + isSelected: isSelectedFor(item.format), + getPreview: getPreview(item.format) + }); + }; + var enrichMenu = function (item) { + return deepMerge(item, { + isSelected: constant(false), + getPreview: constant('') + }); + }; + var enrichCustom = function (item) { + var formatName = generate$1(item.title); + var newItem = deepMerge(item, { + format: formatName, + isSelected: isSelectedFor(formatName), + getPreview: getPreview(formatName) + }); + editor.formatter.register(formatName, newItem); + return newItem; + }; + var formats = readOptFrom$1(settings, 'style_formats').getOr(DefaultStyleFormats); + var doEnrich = function (items) { + return map$1(items, function (item) { + if (hasKey$1(item, 'items')) { + var newItems = doEnrich(item.items); + return deepMerge(enrichMenu(item), { items: newItems }); + } else if (hasKey$1(item, 'format')) { + return enrichSupported(item); + } else { + return enrichCustom(item); + } + }); + }; + return doEnrich(formats); + }; + var prune = function (editor, formats) { + var doPrune = function (items) { + return bind(items, function (item) { + if (item.items !== undefined) { + var newItems = doPrune(item.items); + return newItems.length > 0 ? [item] : []; + } else { + var keep = hasKey$1(item, 'format') ? editor.formatter.canApply(item.format) : true; + return keep ? [item] : []; + } + }); + }; + var prunedItems = doPrune(formats); + return StyleConversions.expand(prunedItems); + }; + var ui = function (editor, formats, onDone) { + var pruned = prune(editor, formats); + return StylesMenu.sketch({ + formats: pruned, + handle: function (item, value) { + editor.undoManager.transact(function () { + if (Toggling.isOn(item)) { + editor.formatter.remove(value); + } else { + editor.formatter.apply(value); + } + }); + onDone(); + } + }); + }; + var StyleFormats = { + register: register$1, + ui: ui + }; + + var defaults = [ + 'undo', + 'bold', + 'italic', + 'link', + 'image', + 'bullist', + 'styleselect' + ]; + var extract$1 = function (rawToolbar) { + var toolbar = rawToolbar.replace(/\|/g, ' ').trim(); + return toolbar.length > 0 ? toolbar.split(/\s+/) : []; + }; + var identifyFromArray = function (toolbar) { + return bind(toolbar, function (item) { + return isArray(item) ? identifyFromArray(item) : extract$1(item); + }); + }; + var identify = function (settings) { + var toolbar = settings.toolbar !== undefined ? settings.toolbar : defaults; + return isArray(toolbar) ? identifyFromArray(toolbar) : extract$1(toolbar); + }; + var setup = function (realm, editor) { + var commandSketch = function (name) { + return function () { + return Buttons.forToolbarCommand(editor, name); + }; + }; + var stateCommandSketch = function (name) { + return function () { + return Buttons.forToolbarStateCommand(editor, name); + }; + }; + var actionSketch = function (name, query, action) { + return function () { + return Buttons.forToolbarStateAction(editor, name, query, action); + }; + }; + var undo = commandSketch('undo'); + var redo = commandSketch('redo'); + var bold = stateCommandSketch('bold'); + var italic = stateCommandSketch('italic'); + var underline = stateCommandSketch('underline'); + var removeformat = commandSketch('removeformat'); + var link = function () { + return sketch$7(realm, editor); + }; + var unlink = actionSketch('unlink', 'link', function () { + editor.execCommand('unlink', null, false); + }); + var image = function () { + return sketch$4(editor); + }; + var bullist = actionSketch('unordered-list', 'ul', function () { + editor.execCommand('InsertUnorderedList', null, false); + }); + var numlist = actionSketch('ordered-list', 'ol', function () { + editor.execCommand('InsertOrderedList', null, false); + }); + var fontsizeselect = function () { + return sketch$3(realm, editor); + }; + var forecolor = function () { + return ColorSlider.sketch(realm, editor); + }; + var styleFormats = StyleFormats.register(editor, editor.settings); + var styleFormatsMenu = function () { + return StyleFormats.ui(editor, styleFormats, function () { + editor.fire('scrollIntoView'); + }); + }; + var styleselect = function () { + return Buttons.forToolbar('style-formats', function (button) { + editor.fire('toReading'); + realm.dropup().appear(styleFormatsMenu, Toggling.on, button); + }, derive$1([ + Toggling.config({ + toggleClass: Styles.resolve('toolbar-button-selected'), + toggleOnExecute: false, + aria: { mode: 'pressed' } + }), + Receiving.config({ + channels: wrapAll$1([ + Receivers.receive(TinyChannels.orientationChanged(), Toggling.off), + Receivers.receive(TinyChannels.dropupDismissed(), Toggling.off) + ]) + }) + ]), editor); + }; + var feature = function (prereq, sketch) { + return { + isSupported: function () { + var buttons = editor.ui.registry.getAll().buttons; + return prereq.forall(function (p) { + return hasKey$1(buttons, p); + }); + }, + sketch: sketch + }; + }; + return { + undo: feature(Option.none(), undo), + redo: feature(Option.none(), redo), + bold: feature(Option.none(), bold), + italic: feature(Option.none(), italic), + underline: feature(Option.none(), underline), + removeformat: feature(Option.none(), removeformat), + link: feature(Option.none(), link), + unlink: feature(Option.none(), unlink), + image: feature(Option.none(), image), + bullist: feature(Option.some('bullist'), bullist), + numlist: feature(Option.some('numlist'), numlist), + fontsizeselect: feature(Option.none(), fontsizeselect), + forecolor: feature(Option.none(), forecolor), + styleselect: feature(Option.none(), styleselect) + }; + }; + var detect$4 = function (settings, features) { + var itemNames = identify(settings); + var present = {}; + return bind(itemNames, function (iName) { + var r = !hasKey$1(present, iName) && hasKey$1(features, iName) && features[iName].isSupported() ? [features[iName].sketch()] : []; + present[iName] = true; + return r; + }); + }; + var Features = { + identify: identify, + setup: setup, + detect: detect$4 + }; + + var mkEvent = function (target, x, y, stop, prevent, kill, raw) { + return { + target: constant(target), + x: constant(x), + y: constant(y), + stop: stop, + prevent: prevent, + kill: kill, + raw: constant(raw) + }; + }; + var fromRawEvent = function (rawEvent) { + var target = Element.fromDom(rawEvent.target); + var stop = function () { + rawEvent.stopPropagation(); + }; + var prevent = function () { + 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)) { + return; + } + 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$2 = function (element, event, filter, handler) { + return binder(element, event, filter, handler, false); + }; + var capture = function (element, event, filter, handler) { + return binder(element, event, filter, handler, true); + }; + var unbind = function (element, event, handler, useCapture) { + element.dom().removeEventListener(event, handler, useCapture); + }; + + var filter$1 = constant(true); + var bind$3 = function (element, event, handler) { + return bind$2(element, event, filter$1, handler); + }; + var capture$1 = function (element, event, handler) { + return capture(element, event, filter$1, handler); + }; + + var global$4 = tinymce.util.Tools.resolve('tinymce.util.Delay'); + + var INTERVAL = 50; + var INSURANCE = 1000 / INTERVAL; + var get$a = function (outerWindow) { + var isPortrait = outerWindow.matchMedia('(orientation: portrait)').matches; + return { isPortrait: constant(isPortrait) }; + }; + var getActualWidth = function (outerWindow) { + var isIos = detect$3().os.isiOS(); + var isPortrait = get$a(outerWindow).isPortrait(); + return isIos && !isPortrait ? outerWindow.screen.height : outerWindow.screen.width; + }; + var onChange = function (outerWindow, listeners) { + var win = Element.fromDom(outerWindow); + var poller = null; + var change = function () { + global$4.clearInterval(poller); + var orientation = get$a(outerWindow); + listeners.onChange(orientation); + onAdjustment(function () { + listeners.onReady(orientation); + }); + }; + var orientationHandle = bind$3(win, 'orientationchange', change); + var onAdjustment = function (f) { + global$4.clearInterval(poller); + var flag = outerWindow.innerHeight; + var insurance = 0; + poller = global$4.setInterval(function () { + if (flag !== outerWindow.innerHeight) { + global$4.clearInterval(poller); + f(Option.some(outerWindow.innerHeight)); + } else if (insurance > INSURANCE) { + global$4.clearInterval(poller); + f(Option.none()); + } + insurance++; + }, INTERVAL); + }; + var destroy = function () { + orientationHandle.unbind(); + }; + return { + onAdjustment: onAdjustment, + destroy: destroy + }; + }; + var Orientation = { + get: get$a, + onChange: onChange, + getActualWidth: getActualWidth + }; + + function DelayedFunction (fun, delay) { + var ref = null; + var schedule = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + ref = domGlobals.setTimeout(function () { + fun.apply(null, args); + ref = null; + }, delay); + }; + var cancel = function () { + if (ref !== null) { + domGlobals.clearTimeout(ref); + ref = null; + } + }; + return { + cancel: cancel, + schedule: schedule + }; + } + + var SIGNIFICANT_MOVE = 5; + var LONGPRESS_DELAY = 400; + var getTouch = function (event) { + var raw = event.raw(); + if (raw.touches === undefined || raw.touches.length !== 1) { + return Option.none(); + } + return Option.some(raw.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 monitor = function (settings) { + var startData = Cell(Option.none()); + var longpressFired = Cell(false); + var longpress$1 = DelayedFunction(function (event) { + settings.triggerEvent(longpress(), event); + longpressFired.set(true); + }, LONGPRESS_DELAY); + var handleTouchstart = function (event) { + getTouch(event).each(function (touch) { + longpress$1.cancel(); + var data = { + x: constant(touch.clientX), + y: constant(touch.clientY), + target: event.target + }; + longpress$1.schedule(event); + longpressFired.set(false); + startData.set(Option.some(data)); + }); + return Option.none(); + }; + var handleTouchmove = function (event) { + longpress$1.cancel(); + getTouch(event).each(function (touch) { + startData.get().each(function (data) { + if (isFarEnough(touch, data)) { + startData.set(Option.none()); + } + }); + }); + return Option.none(); + }; + var handleTouchend = function (event) { + longpress$1.cancel(); + var isSame = function (data) { + return eq(data.target(), event.target()); + }; + return startData.get().filter(isSame).map(function (data) { + if (longpressFired.get()) { + event.prevent(); + return false; + } else { + return settings.triggerEvent(tap(), event); + } + }); + }; + var handlers = wrapAll$1([ + { + key: touchstart(), + value: handleTouchstart + }, + { + key: touchmove(), + value: handleTouchmove + }, + { + key: touchend(), + value: handleTouchend + } + ]); + var fireIfReady = function (event, type) { + return readOptFrom$1(handlers, type).bind(function (handler) { + return handler(event); + }); + }; + return { fireIfReady: fireIfReady }; + }; + + var monitor$1 = function (editorApi) { + var tapEvent = monitor({ + triggerEvent: function (type, evt) { + editorApi.onTapContent(evt); + } + }); + var onTouchend = function () { + return bind$3(editorApi.body(), 'touchend', function (evt) { + tapEvent.fireIfReady(evt, 'touchend'); + }); + }; + var onTouchmove = function () { + return bind$3(editorApi.body(), 'touchmove', function (evt) { + tapEvent.fireIfReady(evt, 'touchmove'); + }); + }; + var fireTouchstart = function (evt) { + tapEvent.fireIfReady(evt, 'touchstart'); + }; + return { + fireTouchstart: fireTouchstart, + onTouchend: onTouchend, + onTouchmove: onTouchmove + }; + }; + var TappingEvent = { monitor: monitor$1 }; + + var isAndroid6 = detect$3().os.version.major >= 6; + var initEvents = function (editorApi, toolstrip, alloy) { + var tapping = TappingEvent.monitor(editorApi); + var outerDoc = owner(toolstrip); + var isRanged = function (sel) { + return !eq(sel.start(), sel.finish()) || sel.soffset() !== sel.foffset(); + }; + var hasRangeInUi = function () { + return active(outerDoc).filter(function (input) { + return name(input) === 'input'; + }).exists(function (input) { + return input.dom().selectionStart !== input.dom().selectionEnd; + }); + }; + var updateMargin = function () { + var rangeInContent = editorApi.doc().dom().hasFocus() && editorApi.getSelection().exists(isRanged); + alloy.getByDom(toolstrip).each((rangeInContent || hasRangeInUi()) === true ? Toggling.on : Toggling.off); + }; + var listeners = [ + bind$3(editorApi.body(), 'touchstart', function (evt) { + editorApi.onTouchContent(); + tapping.fireTouchstart(evt); + }), + tapping.onTouchmove(), + tapping.onTouchend(), + bind$3(toolstrip, 'touchstart', function (evt) { + editorApi.onTouchToolstrip(); + }), + editorApi.onToReading(function () { + blur(editorApi.body()); + }), + editorApi.onToEditing(noop), + editorApi.onScrollToCursor(function (tinyEvent) { + tinyEvent.preventDefault(); + editorApi.getCursorBox().each(function (bounds) { + var cWin = editorApi.win(); + var isOutside = bounds.top() > cWin.innerHeight || bounds.bottom() > cWin.innerHeight; + var cScrollBy = isOutside ? bounds.bottom() - cWin.innerHeight + 50 : 0; + if (cScrollBy !== 0) { + cWin.scrollTo(cWin.pageXOffset, cWin.pageYOffset + cScrollBy); + } + }); + }) + ].concat(isAndroid6 === true ? [] : [ + bind$3(Element.fromDom(editorApi.win()), 'blur', function () { + alloy.getByDom(toolstrip).each(Toggling.off); + }), + bind$3(outerDoc, 'select', updateMargin), + bind$3(editorApi.doc(), 'selectionchange', updateMargin) + ]); + var destroy = function () { + each$1(listeners, function (l) { + l.unbind(); + }); + }; + return { destroy: destroy }; + }; + var AndroidEvents = { initEvents: initEvents }; + + var safeParse = function (element, attribute) { + var parsed = parseInt(get(element, attribute), 10); + return isNaN(parsed) ? 0 : parsed; + }; + var DataAttributes = { safeParse: safeParse }; + + 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) ? Option.from(element.dom().nodeValue) : Option.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$3 = NodeValue(isText, 'text'); + var get$b = function (element) { + return api$3.get(element); + }; + var getOption = function (element) { + return api$3.getOption(element); + }; + + var getEnd = function (element) { + return name(element) === 'img' ? 1 : getOption(element).fold(function () { + return children(element).length; + }, function (v) { + return v.length; + }); + }; + var NBSP = '\xA0'; + 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 create$3 = Immutable('start', 'soffset', 'finish', 'foffset'); + var SimRange = { create: create$3 }; + + var adt$4 = 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$1 = adt$4.before; + var on$1 = adt$4.on; + var after$1 = adt$4.after; + var Situ = { + before: before$1, + on: on$1, + after: after$1, + cata: cata, + getStart: getStart + }; + + var adt$5 = Adt.generate([ + { domRange: ['rng'] }, + { + relative: [ + 'startSitu', + 'finishSitu' + ] + }, + { + exact: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + } + ]); + var exactFromRange = function (simRange) { + return adt$5.exact(simRange.start(), simRange.soffset(), simRange.finish(), simRange.foffset()); + }; + var getStart$1 = function (selection) { + return selection.match({ + domRange: function (rng) { + return Element.fromDom(rng.startContainer); + }, + relative: function (startSitu, finishSitu) { + return Situ.getStart(startSitu); + }, + exact: function (start, soffset, finish, foffset) { + return start; + } + }); + }; + var domRange = adt$5.domRange; + var relative = adt$5.relative; + var exact = adt$5.exact; + var getWin = function (selection) { + var start = getStart$1(selection); + return defaultView(start); + }; + var range$1 = SimRange.create; + var Selection = { + domRange: domRange, + relative: relative, + exact: exact, + exactFromRange: exactFromRange, + getWin: getWin, + range: range$1 + }; + + 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: constant(rect.left), + top: constant(rect.top), + right: constant(rect.right), + bottom: constant(rect.bottom), + width: constant(rect.width), + height: constant(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 ? Option.some(rect).map(toRect) : Option.none(); + }; + + var adt$6 = Adt.generate([ + { + ltr: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + }, + { + rtl: [ + 'start', + 'soffset', + 'finish', + 'foffset' + ] + } + ]); + var fromRange = function (win, type, range) { + return type(Element.fromDom(range.startContainer), range.startOffset, Element.fromDom(range.endContainer), range.endOffset); + }; + var getRanges = function (win, selection) { + return selection.match({ + domRange: function (rng) { + return { + ltr: constant(rng), + rtl: Option.none + }; + }, + relative: function (startSitu, finishSitu) { + return { + ltr: cached(function () { + return relativeToNative(win, startSitu, finishSitu); + }), + rtl: cached(function () { + return Option.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 Option.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$6.rtl(Element.fromDom(rev.endContainer), rev.endOffset, Element.fromDom(rev.startContainer), rev.startOffset); + }).getOrThunk(function () { + return fromRange(win, adt$6.ltr, rng); + }); + } else { + return fromRange(win, adt$6.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 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$b(textnode).length; + var offset = searchForPoint(rectForOffset, x, y, rect.right, length); + return rangeForOffset(offset); + }; + var locate$1 = 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) ? Option.some(rect) : Option.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) : Option.none(); + }); + }; + var locateNode = function (doc, node, x, y) { + return isText(node) ? locate$1(doc, node, x, y) : searchInChildren(doc, node, x, y); + }; + var locate$2 = 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 first$1 = function (element) { + return descendant(element, isCursorPosition); + }; + var last = 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 Option.some(child); + } + var res = descend(child); + if (res.isSome()) { + return res; + } + } + return Option.none(); + }; + return descend(scope); + }; + + 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$1 : last; + 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 Option.some(createCollapsedNode(doc, node, collapseDirection)); + }; + var search$1 = function (doc, node, x) { + var f = children(node).length === 0 ? locateInEmpty : locateInElement; + return f(doc, node, x); + }; + + var caretPositionFromPoint = function (doc, x, y) { + return Option.from(doc.dom().caretPositionFromPoint(x, y)).bind(function (pos) { + if (pos.offsetNode === null) { + return Option.none(); + } + var r = doc.dom().createRange(); + r.setStart(pos.offsetNode, pos.offset); + r.collapse(); + return Option.some(r); + }); + }; + var caretRangeFromPoint = function (doc, x, y) { + return Option.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$2(doc, node, boundedX, boundedY); + }; + var searchFromPoint = function (doc, x, y) { + return Element.fromPoint(doc, x, y).bind(function (elem) { + var fallback = function () { + return search$1(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 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 preprocessExact = function (start, soffset, finish, foffset) { + var startSitu = beforeSpecial(start, soffset); + var finishSitu = beforeSpecial(finish, foffset); + return Selection.relative(startSitu, finishSitu); + }; + + 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$2 = function (start, soffset, finish, foffset) { + var r = makeRange(start, soffset, finish, foffset); + var same = eq(start, finish) && soffset === foffset; + return r.collapsed && !same; + }; + + var doSetNativeRange = function (win, rng) { + Option.from(win.getSelection()).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) { + var selection = win.getSelection(); + 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 readRange = function (selection) { + if (selection.rangeCount > 0) { + var firstRng = selection.getRangeAt(0); + var lastRng = selection.getRangeAt(selection.rangeCount - 1); + return Option.some(SimRange.create(Element.fromDom(firstRng.startContainer), firstRng.startOffset, Element.fromDom(lastRng.endContainer), lastRng.endOffset)); + } else { + return Option.none(); + } + }; + var doGetExact = function (selection) { + var anchor = Element.fromDom(selection.anchorNode); + var focus = Element.fromDom(selection.focusNode); + return after$2(anchor, selection.anchorOffset, focus, selection.focusOffset) ? Option.some(SimRange.create(anchor, selection.anchorOffset, focus, selection.focusOffset)) : readRange(selection); + }; + var getExact = function (win) { + return Option.from(win.getSelection()).filter(function (sel) { + return sel.rangeCount > 0; + }).bind(doGetExact); + }; + var get$c = function (win) { + return getExact(win).map(function (range) { + return Selection.exact(range.start(), range.soffset(), range.finish(), range.foffset()); + }); + }; + var getFirstRect$1 = function (win, selection) { + var rng = asLtrRange(win, selection); + return getFirstRect(rng); + }; + var clear$1 = function (win) { + var selection = win.getSelection(); + selection.removeAllRanges(); + }; + + var COLLAPSED_WIDTH = 2; + var collapsedRect = function (rect) { + return { + left: rect.left, + top: rect.top, + right: rect.right, + bottom: rect.bottom, + width: constant(COLLAPSED_WIDTH), + height: rect.height + }; + }; + var toRect$1 = function (rawRect) { + return { + left: constant(rawRect.left), + top: constant(rawRect.top), + right: constant(rawRect.right), + bottom: constant(rawRect.bottom), + width: constant(rawRect.width), + height: constant(rawRect.height) + }; + }; + var getRectsFromRange = function (range) { + if (!range.collapsed) { + return map$1(range.getClientRects(), toRect$1); + } else { + var start_1 = Element.fromDom(range.startContainer); + return parent(start_1).bind(function (parent) { + var selection = Selection.exact(start_1, range.startOffset, parent, getEnd(parent)); + var optRect = getFirstRect$1(range.startContainer.ownerDocument.defaultView, selection); + return optRect.map(collapsedRect).map(pure); + }).getOr([]); + } + }; + var getRectangles = function (cWin) { + var sel = cWin.getSelection(); + return sel !== undefined && sel.rangeCount > 0 ? getRectsFromRange(sel.getRangeAt(0)) : []; + }; + var Rectangles = { getRectangles: getRectangles }; + + var autocompleteHack = function () { + return function (f) { + global$4.setTimeout(function () { + f(); + }, 0); + }; + }; + var resume = function (cWin) { + cWin.focus(); + var iBody = Element.fromDom(cWin.document.body); + var inInput = active().exists(function (elem) { + return contains([ + 'input', + 'textarea' + ], name(elem)); + }); + var transaction = inInput ? autocompleteHack() : apply; + transaction(function () { + active().each(blur); + focus$1(iBody); + }); + }; + var ResumeEditing = { resume: resume }; + + var EXTRA_SPACING = 50; + var data = 'data-' + Styles.resolve('last-outer-height'); + var setLastHeight = function (cBody, value) { + set(cBody, data, value); + }; + var getLastHeight = function (cBody) { + return DataAttributes.safeParse(cBody, data); + }; + var getBoundsFrom = function (rect) { + return { + top: constant(rect.top()), + bottom: constant(rect.top() + rect.height()) + }; + }; + var getBounds$1 = function (cWin) { + var rects = Rectangles.getRectangles(cWin); + return rects.length > 0 ? Option.some(rects[0]).map(getBoundsFrom) : Option.none(); + }; + var findDelta = function (outerWindow, cBody) { + var last = getLastHeight(cBody); + var current = outerWindow.innerHeight; + return last > current ? Option.some(last - current) : Option.none(); + }; + var calculate = function (cWin, bounds, delta) { + var isOutside = bounds.top() > cWin.innerHeight || bounds.bottom() > cWin.innerHeight; + return isOutside ? Math.min(delta, bounds.bottom() - cWin.innerHeight + EXTRA_SPACING) : 0; + }; + var setup$1 = function (outerWindow, cWin) { + var cBody = Element.fromDom(cWin.document.body); + var toEditing = function () { + ResumeEditing.resume(cWin); + }; + var onResize = bind$3(Element.fromDom(outerWindow), 'resize', function () { + findDelta(outerWindow, cBody).each(function (delta) { + getBounds$1(cWin).each(function (bounds) { + var cScrollBy = calculate(cWin, bounds, delta); + if (cScrollBy !== 0) { + cWin.scrollTo(cWin.pageXOffset, cWin.pageYOffset + cScrollBy); + } + }); + }); + setLastHeight(cBody, outerWindow.innerHeight); + }); + setLastHeight(cBody, outerWindow.innerHeight); + var destroy = function () { + onResize.unbind(); + }; + return { + toEditing: toEditing, + destroy: destroy + }; + }; + var AndroidSetup = { setup: setup$1 }; + + var getBodyFromFrame = function (frame) { + return Option.some(Element.fromDom(frame.dom().contentWindow.document.body)); + }; + var getDocFromFrame = function (frame) { + return Option.some(Element.fromDom(frame.dom().contentWindow.document)); + }; + var getWinFromFrame = function (frame) { + return Option.from(frame.dom().contentWindow); + }; + var getSelectionFromFrame = function (frame) { + var optWin = getWinFromFrame(frame); + return optWin.bind(getExact); + }; + var getFrame = function (editor) { + return editor.getFrame(); + }; + var getOrDerive = function (name, f) { + return function (editor) { + var g = editor[name].getOrThunk(function () { + var frame = getFrame(editor); + return function () { + return f(frame); + }; + }); + return g(); + }; + }; + var getOrListen = function (editor, doc, name, type) { + return editor[name].getOrThunk(function () { + return function (handler) { + return bind$3(doc, type, handler); + }; + }); + }; + var toRect$2 = function (rect) { + return { + left: constant(rect.left), + top: constant(rect.top), + right: constant(rect.right), + bottom: constant(rect.bottom), + width: constant(rect.width), + height: constant(rect.height) + }; + }; + var getActiveApi = function (editor) { + var frame = getFrame(editor); + var tryFallbackBox = function (win) { + var isCollapsed = function (sel) { + return eq(sel.start(), sel.finish()) && sel.soffset() === sel.foffset(); + }; + var toStartRect = function (sel) { + var rect = sel.start().dom().getBoundingClientRect(); + return rect.width > 0 || rect.height > 0 ? Option.some(rect).map(toRect$2) : Option.none(); + }; + return getExact(win).filter(isCollapsed).bind(toStartRect); + }; + return getBodyFromFrame(frame).bind(function (body) { + return getDocFromFrame(frame).bind(function (doc) { + return getWinFromFrame(frame).map(function (win) { + var html = Element.fromDom(doc.dom().documentElement); + var getCursorBox = editor.getCursorBox.getOrThunk(function () { + return function () { + return get$c(win).bind(function (sel) { + return getFirstRect$1(win, sel).orThunk(function () { + return tryFallbackBox(win); + }); + }); + }; + }); + var setSelection = editor.setSelection.getOrThunk(function () { + return function (start, soffset, finish, foffset) { + setExact(win, start, soffset, finish, foffset); + }; + }); + var clearSelection = editor.clearSelection.getOrThunk(function () { + return function () { + clear$1(win); + }; + }); + return { + body: constant(body), + doc: constant(doc), + win: constant(win), + html: constant(html), + getSelection: curry(getSelectionFromFrame, frame), + setSelection: setSelection, + clearSelection: clearSelection, + frame: constant(frame), + onKeyup: getOrListen(editor, doc, 'onKeyup', 'keyup'), + onNodeChanged: getOrListen(editor, doc, 'onNodeChanged', 'SelectionChange'), + onDomChanged: editor.onDomChanged, + onScrollToCursor: editor.onScrollToCursor, + onScrollToElement: editor.onScrollToElement, + onToReading: editor.onToReading, + onToEditing: editor.onToEditing, + onToolbarScrollStart: editor.onToolbarScrollStart, + onTouchContent: editor.onTouchContent, + onTapContent: editor.onTapContent, + onTouchToolstrip: editor.onTouchToolstrip, + getCursorBox: getCursorBox + }; + }); + }); + }); + }; + var PlatformEditor = { + getBody: getOrDerive('getBody', getBodyFromFrame), + getDoc: getOrDerive('getDoc', getDocFromFrame), + getWin: getOrDerive('getWin', getWinFromFrame), + getSelection: getOrDerive('getSelection', getSelectionFromFrame), + getFrame: getFrame, + getActiveApi: getActiveApi + }; + + 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 = detect$3().os.isAndroid(); + var matchColor = function (editorBody) { + var color = get$3(editorBody, 'background-color'); + return color !== undefined && color !== '' ? 'background-color:' + color + '!important' : bgFallback; + }; + var clobberStyles = function (container, editorBody) { + var gatherSibilings = function (element) { + var siblings = siblings$2(element, '*'); + return siblings; + }; + var clobber = function (clobberStyle) { + return function (element) { + var styles = get(element, 'style'); + var backup = styles === undefined ? 'no-styles' : styles.trim(); + if (backup === clobberStyle) { + return; + } else { + set(element, attr, backup); + set(element, 'style', clobberStyle); + } + }; + }; + var ancestors = ancestors$1(container, '*'); + var siblings = bind(ancestors, gatherSibilings); + var bgColor = matchColor(editorBody); + each$1(siblings, clobber(siblingStyles)); + each$1(ancestors, clobber(ancestorPosition + ancestorStyles + bgColor)); + var containerStyles = isAndroid === true ? '' : ancestorPosition; + clobber(containerStyles + ancestorStyles + bgColor)(container); + }; + var restoreStyles = function () { + var clobberedEls = all$2('[' + attr + ']'); + each$1(clobberedEls, function (element) { + var restore = get(element, attr); + if (restore !== 'no-styles') { + set(element, 'style', restore); + } else { + remove$1(element, 'style'); + } + remove$1(element, attr); + }); + }; + var Thor = { + clobberStyles: clobberStyles, + restoreStyles: restoreStyles + }; + + var tag = function () { + var head = first('head').getOrDie(); + var nu = function () { + var meta = Element.fromTag('meta'); + set(meta, 'name', 'viewport'); + append(head, meta); + return meta; + }; + var element = first('meta[name="viewport"]').getOrThunk(nu); + var backup = get(element, 'content'); + var maximize = function () { + set(element, 'content', 'width=device-width, initial-scale=1.0, user-scalable=no, maximum-scale=1.0'); + }; + var restore = function () { + if (backup !== undefined && backup !== null && backup.length > 0) { + set(element, 'content', backup); + } else { + set(element, 'content', 'user-scalable=yes'); + } + }; + return { + maximize: maximize, + restore: restore + }; + }; + var MetaViewport = { tag: tag }; + + var create$4 = function (platform, mask) { + var meta = MetaViewport.tag(); + var androidApi = api$2(); + var androidEvents = api$2(); + var enter = function () { + mask.hide(); + add$2(platform.container, Styles.resolve('fullscreen-maximized')); + add$2(platform.container, Styles.resolve('android-maximized')); + meta.maximize(); + add$2(platform.body, Styles.resolve('android-scroll-reload')); + androidApi.set(AndroidSetup.setup(platform.win, PlatformEditor.getWin(platform.editor).getOrDie('no'))); + PlatformEditor.getActiveApi(platform.editor).each(function (editorApi) { + Thor.clobberStyles(platform.container, editorApi.body()); + androidEvents.set(AndroidEvents.initEvents(editorApi, platform.toolstrip, platform.alloy)); + }); + }; + var exit = function () { + meta.restore(); + mask.show(); + remove$4(platform.container, Styles.resolve('fullscreen-maximized')); + remove$4(platform.container, Styles.resolve('android-maximized')); + Thor.restoreStyles(); + remove$4(platform.body, Styles.resolve('android-scroll-reload')); + androidEvents.clear(); + androidApi.clear(); + }; + return { + enter: enter, + exit: exit + }; + }; + var AndroidMode = { create: create$4 }; + + var first$2 = function (fn, rate) { + var timer = null; + var cancel = function () { + if (timer !== null) { + domGlobals.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 = domGlobals.setTimeout(function () { + fn.apply(null, args); + timer = null; + }, rate); + } + }; + return { + cancel: cancel, + throttle: throttle + }; + }; + var last$1 = function (fn, rate) { + var timer = null; + var cancel = function () { + if (timer !== null) { + domGlobals.clearTimeout(timer); + timer = null; + } + }; + var throttle = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i] = arguments[_i]; + } + if (timer !== null) { + domGlobals.clearTimeout(timer); + } + timer = domGlobals.setTimeout(function () { + fn.apply(null, args); + timer = null; + }, rate); + }; + return { + cancel: cancel, + throttle: throttle + }; + }; + + var sketch$9 = function (onView, translate) { + var memIcon = record(Container.sketch({ + dom: dom$1(''), + containerBehaviours: derive$1([Toggling.config({ + toggleClass: Styles.resolve('mask-tap-icon-selected'), + toggleOnExecute: false + })]) + })); + var onViewThrottle = first$2(onView, 200); + return Container.sketch({ + dom: dom$1('
    '), + components: [Container.sketch({ + dom: dom$1('
    '), + components: [Button.sketch({ + dom: dom$1('
    '), + components: [memIcon.asSpec()], + action: function (button) { + onViewThrottle.throttle(); + }, + buttonBehaviours: derive$1([Toggling.config({ toggleClass: Styles.resolve('mask-tap-icon-selected') })]) + })] + })] + }); + }; + var TapToEditMask = { sketch: sketch$9 }; + + var MobileSchema = objOf([ + strictObjOf('editor', [ + strict$1('getFrame'), + option('getBody'), + option('getDoc'), + option('getWin'), + option('getSelection'), + option('setSelection'), + option('clearSelection'), + option('cursorSaver'), + option('onKeyup'), + option('onNodeChanged'), + option('getCursorBox'), + strict$1('onDomChanged'), + defaulted$1('onTouchContent', noop), + defaulted$1('onTapContent', noop), + defaulted$1('onTouchToolstrip', noop), + defaulted$1('onScrollToCursor', constant({ unbind: noop })), + defaulted$1('onScrollToElement', constant({ unbind: noop })), + defaulted$1('onToEditing', constant({ unbind: noop })), + defaulted$1('onToReading', constant({ unbind: noop })), + defaulted$1('onToolbarScrollStart', identity) + ]), + strict$1('socket'), + strict$1('toolstrip'), + strict$1('dropup'), + strict$1('toolbar'), + strict$1('container'), + strict$1('alloy'), + state$1('win', function (spec) { + return owner(spec.socket).dom().defaultView; + }), + state$1('body', function (spec) { + return Element.fromDom(spec.socket.dom().ownerDocument.body); + }), + defaulted$1('translate', identity), + defaulted$1('setReadOnly', noop), + defaulted$1('readOnlyOnInit', constant(true)) + ]); + + var produce = function (raw) { + var mobile = asRawOrDie('Getting AndroidWebapp schema', MobileSchema, raw); + set$3(mobile.toolstrip, 'width', '100%'); + var onTap = function () { + mobile.setReadOnly(mobile.readOnlyOnInit()); + mode.enter(); + }; + var mask = build$1(TapToEditMask.sketch(onTap, mobile.translate)); + mobile.alloy.add(mask); + var maskApi = { + show: function () { + mobile.alloy.add(mask); + }, + hide: function () { + mobile.alloy.remove(mask); + } + }; + append(mobile.container, mask.element()); + var mode = AndroidMode.create(mobile, maskApi); + return { + setReadOnly: mobile.setReadOnly, + refreshStructure: noop, + enter: mode.enter, + exit: mode.exit, + destroy: noop + }; + }; + var AndroidWebapp = { produce: produce }; + + var schema$e = constant([ + strict$1('dom'), + defaulted$1('shell', true), + field$1('toolbarBehaviours', [Replacing]) + ]); + var enhanceGroups = function (detail) { + return { behaviours: derive$1([Replacing.config({})]) }; + }; + var parts$2 = constant([optional({ + name: 'groups', + overrides: enhanceGroups + })]); + + var factory$4 = function (detail, components, spec, _externals) { + var setGroups = function (toolbar, groups) { + getGroupContainer(toolbar).fold(function () { + domGlobals.console.error('Toolbar was defined to not be a shell, but no groups container was specified in components'); + throw new Error('Toolbar was defined to not be a shell, but no groups container was specified in components'); + }, function (container) { + Replacing.set(container, groups); + }); + }; + var getGroupContainer = function (component) { + return detail.shell ? Option.some(component) : getPart(component, detail, 'groups'); + }; + var extra = detail.shell ? { + behaviours: [Replacing.config({})], + components: [] + } : { + behaviours: [], + components: components + }; + return { + uid: detail.uid, + dom: detail.dom, + components: extra.components, + behaviours: augment(detail.toolbarBehaviours, extra.behaviours), + apis: { setGroups: setGroups }, + domModification: { attributes: { role: 'group' } } + }; + }; + var Toolbar = composite$1({ + name: 'Toolbar', + configFields: schema$e(), + partFields: parts$2(), + factory: factory$4, + apis: { + setGroups: function (apis, toolbar, groups) { + apis.setGroups(toolbar, groups); + } + } + }); + + var schema$f = constant([ + strict$1('items'), + markers(['itemSelector']), + field$1('tgroupBehaviours', [Keying]) + ]); + var parts$3 = constant([group({ + name: 'items', + unit: 'item' + })]); + + var factory$5 = function (detail, components, spec, _externals) { + return { + uid: detail.uid, + dom: detail.dom, + components: components, + behaviours: augment(detail.tgroupBehaviours, [Keying.config({ + mode: 'flow', + selector: detail.markers.itemSelector + })]), + domModification: { attributes: { role: 'toolbar' } } + }; + }; + var ToolbarGroup = composite$1({ + name: 'ToolbarGroup', + configFields: schema$f(), + partFields: parts$3(), + factory: factory$5 + }); + + var dataHorizontal = 'data-' + Styles.resolve('horizontal-scroll'); + var canScrollVertically = function (container) { + container.dom().scrollTop = 1; + var result = container.dom().scrollTop !== 0; + container.dom().scrollTop = 0; + return result; + }; + var canScrollHorizontally = function (container) { + container.dom().scrollLeft = 1; + var result = container.dom().scrollLeft !== 0; + container.dom().scrollLeft = 0; + return result; + }; + var hasVerticalScroll = function (container) { + return container.dom().scrollTop > 0 || canScrollVertically(container); + }; + var hasHorizontalScroll = function (container) { + return container.dom().scrollLeft > 0 || canScrollHorizontally(container); + }; + var markAsHorizontal = function (container) { + set(container, dataHorizontal, 'true'); + }; + var hasScroll = function (container) { + return get(container, dataHorizontal) === 'true' ? hasHorizontalScroll(container) : hasVerticalScroll(container); + }; + var exclusive = function (scope, selector) { + return bind$3(scope, 'touchmove', function (event) { + closest$2(event.target(), selector).filter(hasScroll).fold(function () { + event.raw().preventDefault(); + }, noop); + }); + }; + var Scrollables = { + exclusive: exclusive, + markAsHorizontal: markAsHorizontal + }; + + function ScrollingToolbar () { + var makeGroup = function (gSpec) { + var scrollClass = gSpec.scrollable === true ? '${prefix}-toolbar-scrollable-group' : ''; + return { + dom: dom$1('
    '), + tgroupBehaviours: derive$1([config('adhoc-scrollable-toolbar', gSpec.scrollable === true ? [runOnInit(function (component, simulatedEvent) { + set$3(component.element(), 'overflow-x', 'auto'); + Scrollables.markAsHorizontal(component.element()); + Scrollable.register(component.element()); + })] : [])]), + components: [Container.sketch({ components: [ToolbarGroup.parts().items({})] })], + markers: { itemSelector: '.' + Styles.resolve('toolbar-group-item') }, + items: gSpec.items + }; + }; + var toolbar = build$1(Toolbar.sketch({ + dom: dom$1('
    '), + components: [Toolbar.parts().groups({})], + toolbarBehaviours: derive$1([ + Toggling.config({ + toggleClass: Styles.resolve('context-toolbar'), + toggleOnExecute: false, + aria: { mode: 'none' } + }), + Keying.config({ mode: 'cyclic' }) + ]), + shell: true + })); + var wrapper = build$1(Container.sketch({ + dom: { classes: [Styles.resolve('toolstrip')] }, + components: [premade$1(toolbar)], + containerBehaviours: derive$1([Toggling.config({ + toggleClass: Styles.resolve('android-selection-context-toolbar'), + toggleOnExecute: false + })]) + })); + var resetGroups = function () { + Toolbar.setGroups(toolbar, initGroups.get()); + Toggling.off(toolbar); + }; + var initGroups = Cell([]); + var setGroups = function (gs) { + initGroups.set(gs); + resetGroups(); + }; + var createGroups = function (gs) { + return map$1(gs, compose(ToolbarGroup.sketch, makeGroup)); + }; + var refresh = function () { + }; + var setContextToolbar = function (gs) { + Toggling.on(toolbar); + Toolbar.setGroups(toolbar, gs); + }; + var restoreToolbar = function () { + if (Toggling.isOn(toolbar)) { + resetGroups(); + } + }; + var focus = function () { + Keying.focusIn(toolbar); + }; + return { + wrapper: constant(wrapper), + toolbar: constant(toolbar), + createGroups: createGroups, + setGroups: setGroups, + setContextToolbar: setContextToolbar, + restoreToolbar: restoreToolbar, + refresh: refresh, + focus: focus + }; + } + + var makeEditSwitch = function (webapp) { + return build$1(Button.sketch({ + dom: dom$1('
    '), + action: function () { + webapp.run(function (w) { + w.setReadOnly(false); + }); + } + })); + }; + var makeSocket = function () { + return build$1(Container.sketch({ + dom: dom$1('
    '), + components: [], + containerBehaviours: derive$1([Replacing.config({})]) + })); + }; + var showEdit = function (socket, switchToEdit) { + Replacing.append(socket, premade$1(switchToEdit)); + }; + var hideEdit = function (socket, switchToEdit) { + Replacing.remove(socket, switchToEdit); + }; + var updateMode = function (socket, switchToEdit, readOnly, root) { + var swap = readOnly === true ? Swapping.toAlpha : Swapping.toOmega; + swap(root); + var f = readOnly ? showEdit : hideEdit; + f(socket, switchToEdit); + }; + var CommonRealm = { + makeEditSwitch: makeEditSwitch, + makeSocket: makeSocket, + updateMode: updateMode + }; + + var getAnimationRoot = function (component, slideConfig) { + return slideConfig.getAnimationRoot.fold(function () { + return component.element(); + }, function (get) { + return get(component); + }); + }; + + var getDimensionProperty = function (slideConfig) { + return slideConfig.dimension.property; + }; + var getDimension = function (slideConfig, elem) { + return slideConfig.dimension.getDimension(elem); + }; + var disableTransitions = function (component, slideConfig) { + var root = getAnimationRoot(component, slideConfig); + remove$6(root, [ + slideConfig.shrinkingClass, + slideConfig.growingClass + ]); + }; + var setShrunk = function (component, slideConfig) { + remove$4(component.element(), slideConfig.openClass); + add$2(component.element(), slideConfig.closedClass); + set$3(component.element(), getDimensionProperty(slideConfig), '0px'); + reflow(component.element()); + }; + var setGrown = function (component, slideConfig) { + remove$4(component.element(), slideConfig.closedClass); + add$2(component.element(), slideConfig.openClass); + remove$5(component.element(), getDimensionProperty(slideConfig)); + }; + var doImmediateShrink = function (component, slideConfig, slideState, _calculatedSize) { + slideState.setCollapsed(); + set$3(component.element(), getDimensionProperty(slideConfig), getDimension(slideConfig, component.element())); + reflow(component.element()); + disableTransitions(component, slideConfig); + setShrunk(component, slideConfig); + slideConfig.onStartShrink(component); + slideConfig.onShrunk(component); + }; + var doStartShrink = function (component, slideConfig, slideState, calculatedSize) { + var size = calculatedSize.getOrThunk(function () { + return getDimension(slideConfig, component.element()); + }); + slideState.setCollapsed(); + set$3(component.element(), getDimensionProperty(slideConfig), size); + reflow(component.element()); + var root = getAnimationRoot(component, slideConfig); + remove$4(root, slideConfig.growingClass); + add$2(root, slideConfig.shrinkingClass); + setShrunk(component, slideConfig); + slideConfig.onStartShrink(component); + }; + var doStartSmartShrink = function (component, slideConfig, slideState) { + var size = getDimension(slideConfig, component.element()); + var shrinker = size === '0px' ? doImmediateShrink : doStartShrink; + shrinker(component, slideConfig, slideState, Option.some(size)); + }; + var doStartGrow = function (component, slideConfig, slideState) { + var root = getAnimationRoot(component, slideConfig); + var wasShrinking = has$2(root, slideConfig.shrinkingClass); + var beforeSize = getDimension(slideConfig, component.element()); + setGrown(component, slideConfig); + var fullSize = getDimension(slideConfig, component.element()); + var startPartialGrow = function () { + set$3(component.element(), getDimensionProperty(slideConfig), beforeSize); + reflow(component.element()); + }; + var startCompleteGrow = function () { + setShrunk(component, slideConfig); + }; + var setStartSize = wasShrinking ? startPartialGrow : startCompleteGrow; + setStartSize(); + remove$4(root, slideConfig.shrinkingClass); + add$2(root, slideConfig.growingClass); + setGrown(component, slideConfig); + set$3(component.element(), getDimensionProperty(slideConfig), fullSize); + slideState.setExpanded(); + slideConfig.onStartGrow(component); + }; + var refresh = function (component, slideConfig, slideState) { + if (slideState.isExpanded()) { + remove$5(component.element(), getDimensionProperty(slideConfig)); + var fullSize = getDimension(slideConfig, component.element()); + set$3(component.element(), getDimensionProperty(slideConfig), fullSize); + } + }; + var grow = function (component, slideConfig, slideState) { + if (!slideState.isExpanded()) { + doStartGrow(component, slideConfig, slideState); + } + }; + var shrink = function (component, slideConfig, slideState) { + if (slideState.isExpanded()) { + doStartSmartShrink(component, slideConfig, slideState); + } + }; + var immediateShrink = function (component, slideConfig, slideState) { + if (slideState.isExpanded()) { + doImmediateShrink(component, slideConfig, slideState); + } + }; + var hasGrown = function (component, slideConfig, slideState) { + return slideState.isExpanded(); + }; + var hasShrunk = function (component, slideConfig, slideState) { + return slideState.isCollapsed(); + }; + var isGrowing = function (component, slideConfig, slideState) { + var root = getAnimationRoot(component, slideConfig); + return has$2(root, slideConfig.growingClass) === true; + }; + var isShrinking = function (component, slideConfig, slideState) { + var root = getAnimationRoot(component, slideConfig); + return has$2(root, slideConfig.shrinkingClass) === true; + }; + var isTransitioning = function (component, slideConfig, slideState) { + return isGrowing(component, slideConfig) === true || isShrinking(component, slideConfig) === true; + }; + var toggleGrow = function (component, slideConfig, slideState) { + var f = slideState.isExpanded() ? doStartSmartShrink : doStartGrow; + f(component, slideConfig, slideState); + }; + + var SlidingApis = /*#__PURE__*/Object.freeze({ + refresh: refresh, + grow: grow, + shrink: shrink, + immediateShrink: immediateShrink, + hasGrown: hasGrown, + hasShrunk: hasShrunk, + isGrowing: isGrowing, + isShrinking: isShrinking, + isTransitioning: isTransitioning, + toggleGrow: toggleGrow, + disableTransitions: disableTransitions + }); + + var exhibit$5 = function (base, slideConfig) { + var expanded = slideConfig.expanded; + return expanded ? nu$5({ + classes: [slideConfig.openClass], + styles: {} + }) : nu$5({ + classes: [slideConfig.closedClass], + styles: wrap$1(slideConfig.dimension.property, '0px') + }); + }; + var events$a = function (slideConfig, slideState) { + return derive([runOnSource(transitionend(), function (component, simulatedEvent) { + var raw = simulatedEvent.event().raw(); + if (raw.propertyName === slideConfig.dimension.property) { + disableTransitions(component, slideConfig); + if (slideState.isExpanded()) { + remove$5(component.element(), slideConfig.dimension.property); + } + var notify = slideState.isExpanded() ? slideConfig.onGrown : slideConfig.onShrunk; + notify(component); + } + })]); + }; + + var ActiveSliding = /*#__PURE__*/Object.freeze({ + exhibit: exhibit$5, + events: events$a + }); + + var SlidingSchema = [ + strict$1('closedClass'), + strict$1('openClass'), + strict$1('shrinkingClass'), + strict$1('growingClass'), + option('getAnimationRoot'), + onHandler('onShrunk'), + onHandler('onStartShrink'), + onHandler('onGrown'), + onHandler('onStartGrow'), + defaulted$1('expanded', false), + strictOf('dimension', choose$1('property', { + width: [ + output('property', 'width'), + output('getDimension', function (elem) { + return get$6(elem) + 'px'; + }) + ], + height: [ + output('property', 'height'), + output('getDimension', function (elem) { + return get$4(elem) + 'px'; + }) + ] + })) + ]; + + var init$4 = function (spec) { + var state = Cell(spec.expanded); + var readState = function () { + return 'expanded: ' + state.get(); + }; + return nu$6({ + isExpanded: function () { + return state.get() === true; + }, + isCollapsed: function () { + return state.get() === false; + }, + setCollapsed: curry(state.set, false), + setExpanded: curry(state.set, true), + readState: readState + }); + }; + + var SlidingState = /*#__PURE__*/Object.freeze({ + init: init$4 + }); + + var Sliding = create$1({ + fields: SlidingSchema, + name: 'sliding', + active: ActiveSliding, + apis: SlidingApis, + state: SlidingState + }); + + var build$2 = function (refresh, scrollIntoView) { + var dropup = build$1(Container.sketch({ + dom: { + tag: 'div', + classes: [Styles.resolve('dropup')] + }, + components: [], + containerBehaviours: derive$1([ + Replacing.config({}), + Sliding.config({ + closedClass: Styles.resolve('dropup-closed'), + openClass: Styles.resolve('dropup-open'), + shrinkingClass: Styles.resolve('dropup-shrinking'), + growingClass: Styles.resolve('dropup-growing'), + dimension: { property: 'height' }, + onShrunk: function (component) { + refresh(); + scrollIntoView(); + Replacing.set(component, []); + }, + onGrown: function (component) { + refresh(); + scrollIntoView(); + } + }), + Receivers.orientation(function (component, data) { + disappear(noop); + }) + ]) + })); + var appear = function (menu, update, component) { + if (Sliding.hasShrunk(dropup) === true && Sliding.isTransitioning(dropup) === false) { + domGlobals.window.requestAnimationFrame(function () { + update(component); + Replacing.set(dropup, [menu()]); + Sliding.grow(dropup); + }); + } + }; + var disappear = function (onReadyToShrink) { + domGlobals.window.requestAnimationFrame(function () { + onReadyToShrink(); + Sliding.shrink(dropup); + }); + }; + return { + appear: appear, + disappear: disappear, + component: constant(dropup), + element: dropup.element + }; + }; + + var closest$3 = function (scope, selector, isRoot) { + return closest$2(scope, selector, isRoot).isSome(); + }; + + var isDangerous = function (event) { + var keyEv = event.raw(); + return keyEv.which === BACKSPACE()[0] && !contains([ + 'input', + 'textarea' + ], name(event.target())) && !closest$3(event.target(), '[contenteditable="true"]'); + }; + var isFirefox = detect$3().browser.isFirefox(); + var settingsSchema = objOfOnly([ + strictFunction('triggerEvent'), + defaulted$1('stopBackspace', true) + ]); + var bindFocus = function (container, handler) { + if (isFirefox) { + return capture$1(container, 'focus', handler); + } else { + return bind$3(container, 'focusin', handler); + } + }; + var bindBlur = function (container, handler) { + if (isFirefox) { + return capture$1(container, 'blur', handler); + } else { + return bind$3(container, 'focusout', handler); + } + }; + var setup$2 = function (container, rawSettings) { + var settings = asRawOrDie('Getting GUI events settings', settingsSchema, rawSettings); + var pointerEvents = [ + 'touchstart', + 'touchmove', + 'touchend', + 'touchcancel', + 'gesturestart', + 'mousedown', + 'mouseup', + 'mouseover', + 'mousemove', + 'mouseout', + 'click' + ]; + var tapEvent = monitor(settings); + var simpleEvents = map$1(pointerEvents.concat([ + 'selectstart', + 'input', + 'contextmenu', + 'change', + 'transitionend', + 'drag', + 'dragstart', + 'dragend', + 'dragenter', + 'dragleave', + 'dragover', + 'drop', + 'keyup' + ]), function (type) { + return bind$3(container, type, function (event) { + tapEvent.fireIfReady(event, type).each(function (tapStopped) { + if (tapStopped) { + event.kill(); + } + }); + var stopped = settings.triggerEvent(type, event); + if (stopped) { + event.kill(); + } + }); + }); + var pasteTimeout = Cell(Option.none()); + var onPaste = bind$3(container, 'paste', function (event) { + tapEvent.fireIfReady(event, 'paste').each(function (tapStopped) { + if (tapStopped) { + event.kill(); + } + }); + var stopped = settings.triggerEvent('paste', event); + if (stopped) { + event.kill(); + } + pasteTimeout.set(Option.some(domGlobals.setTimeout(function () { + settings.triggerEvent(postPaste(), event); + }, 0))); + }); + var onKeydown = bind$3(container, 'keydown', function (event) { + var stopped = settings.triggerEvent('keydown', event); + if (stopped) { + event.kill(); + } else if (settings.stopBackspace === true && isDangerous(event)) { + event.prevent(); + } + }); + var onFocusIn = bindFocus(container, function (event) { + var stopped = settings.triggerEvent('focusin', event); + if (stopped) { + event.kill(); + } + }); + var focusoutTimeout = Cell(Option.none()); + var onFocusOut = bindBlur(container, function (event) { + var stopped = settings.triggerEvent('focusout', event); + if (stopped) { + event.kill(); + } + focusoutTimeout.set(Option.some(domGlobals.setTimeout(function () { + settings.triggerEvent(postBlur(), event); + }, 0))); + }); + var unbind = function () { + each$1(simpleEvents, function (e) { + e.unbind(); + }); + onKeydown.unbind(); + onFocusIn.unbind(); + onFocusOut.unbind(); + onPaste.unbind(); + pasteTimeout.get().each(domGlobals.clearTimeout); + focusoutTimeout.get().each(domGlobals.clearTimeout); + }; + return { unbind: unbind }; + }; + + var derive$2 = function (rawEvent, rawTarget) { + var source = readOptFrom$1(rawEvent, 'target').map(function (getTarget) { + return getTarget(); + }).getOr(rawTarget); + return Cell(source); + }; + + var fromSource = function (event, source) { + var stopper = Cell(false); + var cutter = Cell(false); + var stop = function () { + stopper.set(true); + }; + var cut = function () { + cutter.set(true); + }; + return { + stop: stop, + cut: cut, + isStopped: stopper.get, + isCut: cutter.get, + event: constant(event), + setSource: source.set, + getSource: source.get + }; + }; + var fromExternal = function (event) { + var stopper = Cell(false); + var stop = function () { + stopper.set(true); + }; + return { + stop: stop, + cut: noop, + isStopped: stopper.get, + isCut: constant(false), + event: constant(event), + setSource: die('Cannot set source of a broadcasted event'), + getSource: die('Cannot get source of a broadcasted event') + }; + }; + + var adt$7 = Adt.generate([ + { stopped: [] }, + { resume: ['element'] }, + { complete: [] } + ]); + var doTriggerHandler = function (lookup, eventType, rawEvent, target, source, logger) { + var handler = lookup(eventType, target); + var simulatedEvent = fromSource(rawEvent, source); + return handler.fold(function () { + logger.logEventNoHandlers(eventType, target); + return adt$7.complete(); + }, function (handlerInfo) { + var descHandler = handlerInfo.descHandler(); + var eventHandler = getCurried(descHandler); + eventHandler(simulatedEvent); + if (simulatedEvent.isStopped()) { + logger.logEventStopped(eventType, handlerInfo.element(), descHandler.purpose()); + return adt$7.stopped(); + } else if (simulatedEvent.isCut()) { + logger.logEventCut(eventType, handlerInfo.element(), descHandler.purpose()); + return adt$7.complete(); + } else { + return parent(handlerInfo.element()).fold(function () { + logger.logNoParent(eventType, handlerInfo.element(), descHandler.purpose()); + return adt$7.complete(); + }, function (parent) { + logger.logEventResponse(eventType, handlerInfo.element(), descHandler.purpose()); + return adt$7.resume(parent); + }); + } + }); + }; + var doTriggerOnUntilStopped = function (lookup, eventType, rawEvent, rawTarget, source, logger) { + return doTriggerHandler(lookup, eventType, rawEvent, rawTarget, source, logger).fold(function () { + return true; + }, function (parent) { + return doTriggerOnUntilStopped(lookup, eventType, rawEvent, parent, source, logger); + }, function () { + return false; + }); + }; + var triggerHandler = function (lookup, eventType, rawEvent, target, logger) { + var source = derive$2(rawEvent, target); + return doTriggerHandler(lookup, eventType, rawEvent, target, source, logger); + }; + var broadcast = function (listeners, rawEvent, logger) { + var simulatedEvent = fromExternal(rawEvent); + each$1(listeners, function (listener) { + var descHandler = listener.descHandler(); + var handler = getCurried(descHandler); + handler(simulatedEvent); + }); + return simulatedEvent.isStopped(); + }; + var triggerUntilStopped = function (lookup, eventType, rawEvent, logger) { + var rawTarget = rawEvent.target(); + return triggerOnUntilStopped(lookup, eventType, rawEvent, rawTarget, logger); + }; + var triggerOnUntilStopped = function (lookup, eventType, rawEvent, rawTarget, logger) { + var source = derive$2(rawEvent, rawTarget); + return doTriggerOnUntilStopped(lookup, eventType, rawEvent, rawTarget, source, logger); + }; + + var eventHandler = Immutable('element', 'descHandler'); + var broadcastHandler = function (id, handler) { + return { + id: constant(id), + descHandler: constant(handler) + }; + }; + function EventRegistry () { + var registry = {}; + var registerId = function (extraArgs, id, events) { + each(events, function (v, k) { + var handlers = registry[k] !== undefined ? registry[k] : {}; + handlers[id] = curryArgs(v, extraArgs); + registry[k] = handlers; + }); + }; + var findHandler = function (handlers, elem) { + return read$2(elem).fold(function () { + return Option.none(); + }, function (id) { + var reader = readOpt$1(id); + return handlers.bind(reader).map(function (descHandler) { + return eventHandler(elem, descHandler); + }); + }); + }; + var filterByType = function (type) { + return readOptFrom$1(registry, type).map(function (handlers) { + return mapToArray(handlers, function (f, id) { + return broadcastHandler(id, f); + }); + }).getOr([]); + }; + var find = function (isAboveRoot, type, target) { + var readType = readOpt$1(type); + var handlers = readType(registry); + return closest$1(target, function (elem) { + return findHandler(handlers, elem); + }, isAboveRoot); + }; + var unregisterId = function (id) { + each(registry, function (handlersById, eventName) { + if (handlersById.hasOwnProperty(id)) { + delete handlersById[id]; + } + }); + }; + return { + registerId: registerId, + unregisterId: unregisterId, + filterByType: filterByType, + find: find + }; + } + + function Registry () { + var events = EventRegistry(); + var components = {}; + var readOrTag = function (component) { + var elem = component.element(); + return read$2(elem).fold(function () { + return write('uid-', component.element()); + }, function (uid) { + return uid; + }); + }; + var failOnDuplicate = function (component, tagId) { + var conflict = components[tagId]; + if (conflict === component) { + unregister(component); + } else { + throw new Error('The tagId "' + tagId + '" is already used by: ' + element(conflict.element()) + '\nCannot use it for: ' + element(component.element()) + '\n' + 'The conflicting element is' + (inBody(conflict.element()) ? ' ' : ' not ') + 'already in the DOM'); + } + }; + var register = function (component) { + var tagId = readOrTag(component); + if (hasKey$1(components, tagId)) { + failOnDuplicate(component, tagId); + } + var extraArgs = [component]; + events.registerId(extraArgs, tagId, component.events()); + components[tagId] = component; + }; + var unregister = function (component) { + read$2(component.element()).each(function (tagId) { + delete components[tagId]; + events.unregisterId(tagId); + }); + }; + var filter = function (type) { + return events.filterByType(type); + }; + var find = function (isAboveRoot, type, target) { + return events.find(isAboveRoot, type, target); + }; + var getById = function (id) { + return readOpt$1(id)(components); + }; + return { + find: find, + filter: filter, + register: register, + unregister: unregister, + getById: getById + }; + } + + var takeover = function (root) { + var isAboveRoot = function (el) { + return parent(root.element()).fold(function () { + return true; + }, function (parent) { + return eq(el, parent); + }); + }; + var registry = Registry(); + var lookup = function (eventName, target) { + return registry.find(isAboveRoot, eventName, target); + }; + var domEvents = setup$2(root.element(), { + triggerEvent: function (eventName, event) { + return monitorEvent(eventName, event.target(), function (logger) { + return triggerUntilStopped(lookup, eventName, event, logger); + }); + } + }); + var systemApi = { + debugInfo: constant('real'), + triggerEvent: function (eventName, target, data) { + monitorEvent(eventName, target, function (logger) { + triggerOnUntilStopped(lookup, eventName, data, target, logger); + }); + }, + triggerFocus: function (target, originator) { + read$2(target).fold(function () { + focus$1(target); + }, function (_alloyId) { + monitorEvent(focus(), target, function (logger) { + triggerHandler(lookup, focus(), { + originator: constant(originator), + kill: noop, + prevent: noop, + target: constant(target) + }, target, logger); + }); + }); + }, + triggerEscape: function (comp, simulatedEvent) { + systemApi.triggerEvent('keydown', comp.element(), simulatedEvent.event()); + }, + getByUid: function (uid) { + return getByUid(uid); + }, + getByDom: function (elem) { + return getByDom(elem); + }, + build: build$1, + addToGui: function (c) { + add(c); + }, + removeFromGui: function (c) { + remove$1(c); + }, + addToWorld: function (c) { + addToWorld(c); + }, + removeFromWorld: function (c) { + removeFromWorld(c); + }, + broadcast: function (message) { + broadcast$1(message); + }, + broadcastOn: function (channels, message) { + broadcastOn(channels, message); + }, + broadcastEvent: function (eventName, event) { + broadcastEvent(eventName, event); + }, + isConnected: constant(true) + }; + var addToWorld = function (component) { + component.connect(systemApi); + if (!isText(component.element())) { + registry.register(component); + each$1(component.components(), addToWorld); + systemApi.triggerEvent(systemInit(), component.element(), { target: constant(component.element()) }); + } + }; + var removeFromWorld = function (component) { + if (!isText(component.element())) { + each$1(component.components(), removeFromWorld); + registry.unregister(component); + } + component.disconnect(); + }; + var add = function (component) { + attach$1(root, component); + }; + var remove$1 = function (component) { + detach(component); + }; + var destroy = function () { + domEvents.unbind(); + remove(root.element()); + }; + var broadcastData = function (data) { + var receivers = registry.filter(receive()); + each$1(receivers, function (receiver) { + var descHandler = receiver.descHandler(); + var handler = getCurried(descHandler); + handler(data); + }); + }; + var broadcast$1 = function (message) { + broadcastData({ + universal: constant(true), + data: constant(message) + }); + }; + var broadcastOn = function (channels, message) { + broadcastData({ + universal: constant(false), + channels: constant(channels), + data: constant(message) + }); + }; + var broadcastEvent = function (eventName, event) { + var listeners = registry.filter(eventName); + return broadcast(listeners, event); + }; + var getByUid = function (uid) { + return registry.getById(uid).fold(function () { + return Result.error(new Error('Could not find component with uid: "' + uid + '" in system.')); + }, Result.value); + }; + var getByDom = function (elem) { + var uid = read$2(elem).getOr('not found'); + return getByUid(uid); + }; + addToWorld(root); + return { + root: constant(root), + element: root.element, + destroy: destroy, + add: add, + remove: remove$1, + getByUid: getByUid, + getByDom: getByDom, + addToWorld: addToWorld, + removeFromWorld: removeFromWorld, + broadcast: broadcast$1, + broadcastOn: broadcastOn, + broadcastEvent: broadcastEvent + }; + }; + + var READ_ONLY_MODE_CLASS = constant(Styles.resolve('readonly-mode')); + var EDIT_MODE_CLASS = constant(Styles.resolve('edit-mode')); + function OuterContainer (spec) { + var root = build$1(Container.sketch({ + dom: { classes: [Styles.resolve('outer-container')].concat(spec.classes) }, + containerBehaviours: derive$1([Swapping.config({ + alpha: READ_ONLY_MODE_CLASS(), + omega: EDIT_MODE_CLASS() + })]) + })); + return takeover(root); + } + + function AndroidRealm (scrollIntoView) { + var alloy = OuterContainer({ classes: [Styles.resolve('android-container')] }); + var toolbar = ScrollingToolbar(); + var webapp = api$2(); + var switchToEdit = CommonRealm.makeEditSwitch(webapp); + var socket = CommonRealm.makeSocket(); + var dropup = build$2(noop, scrollIntoView); + alloy.add(toolbar.wrapper()); + alloy.add(socket); + alloy.add(dropup.component()); + var setToolbarGroups = function (rawGroups) { + var groups = toolbar.createGroups(rawGroups); + toolbar.setGroups(groups); + }; + var setContextToolbar = function (rawGroups) { + var groups = toolbar.createGroups(rawGroups); + toolbar.setContextToolbar(groups); + }; + var focusToolbar = function () { + toolbar.focus(); + }; + var restoreToolbar = function () { + toolbar.restoreToolbar(); + }; + var init = function (spec) { + webapp.set(AndroidWebapp.produce(spec)); + }; + var exit = function () { + webapp.run(function (w) { + w.exit(); + Replacing.remove(socket, switchToEdit); + }); + }; + var updateMode = function (readOnly) { + CommonRealm.updateMode(socket, switchToEdit, readOnly, alloy.root()); + }; + return { + system: constant(alloy), + element: alloy.element, + init: init, + exit: exit, + setToolbarGroups: setToolbarGroups, + setContextToolbar: setContextToolbar, + focusToolbar: focusToolbar, + restoreToolbar: restoreToolbar, + updateMode: updateMode, + socket: constant(socket), + dropup: constant(dropup) + }; + } + + var input$1 = function (parent, operation) { + var input = Element.fromTag('input'); + setAll$1(input, { + opacity: '0', + position: 'absolute', + top: '-1000px', + left: '-1000px' + }); + append(parent, input); + focus$1(input); + operation(input); + remove(input); + }; + var CaptureBin = { input: input$1 }; + + var refreshInput = function (input) { + var start = input.dom().selectionStart; + var end = input.dom().selectionEnd; + var dir = input.dom().selectionDirection; + global$4.setTimeout(function () { + input.dom().setSelectionRange(start, end, dir); + focus$1(input); + }, 50); + }; + var refresh$1 = function (winScope) { + var sel = winScope.getSelection(); + if (sel.rangeCount > 0) { + var br = sel.getRangeAt(0); + var r = winScope.document.createRange(); + r.setStart(br.startContainer, br.startOffset); + r.setEnd(br.endContainer, br.endOffset); + sel.removeAllRanges(); + sel.addRange(r); + } + }; + var CursorRefresh = { + refreshInput: refreshInput, + refresh: refresh$1 + }; + + var resume$1 = function (cWin, frame) { + active().each(function (active) { + if (!eq(active, frame)) { + blur(active); + } + }); + cWin.focus(); + focus$1(Element.fromDom(cWin.document.body)); + CursorRefresh.refresh(cWin); + }; + var ResumeEditing$1 = { resume: resume$1 }; + + var stubborn = function (outerBody, cWin, page, frame) { + var toEditing = function () { + ResumeEditing$1.resume(cWin, frame); + }; + var toReading = function () { + CaptureBin.input(outerBody, blur); + }; + var captureInput = bind$3(page, 'keydown', function (evt) { + if (!contains([ + 'input', + 'textarea' + ], name(evt.target()))) { + toEditing(); + } + }); + var onToolbarTouch = function () { + }; + var destroy = function () { + captureInput.unbind(); + }; + return { + toReading: toReading, + toEditing: toEditing, + onToolbarTouch: onToolbarTouch, + destroy: destroy + }; + }; + var timid = function (outerBody, cWin, page, frame) { + var dismissKeyboard = function () { + blur(frame); + }; + var onToolbarTouch = function () { + dismissKeyboard(); + }; + var toReading = function () { + dismissKeyboard(); + }; + var toEditing = function () { + ResumeEditing$1.resume(cWin, frame); + }; + return { + toReading: toReading, + toEditing: toEditing, + onToolbarTouch: onToolbarTouch, + destroy: noop + }; + }; + var IosKeyboard = { + stubborn: stubborn, + timid: timid + }; + + var initEvents$1 = function (editorApi, iosApi, toolstrip, socket, dropup) { + var saveSelectionFirst = function () { + iosApi.run(function (api) { + api.highlightSelection(); + }); + }; + var refreshIosSelection = function () { + iosApi.run(function (api) { + api.refreshSelection(); + }); + }; + var scrollToY = function (yTop, height) { + var y = yTop - socket.dom().scrollTop; + iosApi.run(function (api) { + api.scrollIntoView(y, y + height); + }); + }; + var scrollToElement = function (target) { + scrollToY(iosApi, socket); + }; + var scrollToCursor = function () { + editorApi.getCursorBox().each(function (box) { + scrollToY(box.top(), box.height()); + }); + }; + var clearSelection = function () { + iosApi.run(function (api) { + api.clearSelection(); + }); + }; + var clearAndRefresh = function () { + clearSelection(); + refreshThrottle.throttle(); + }; + var refreshView = function () { + scrollToCursor(); + iosApi.run(function (api) { + api.syncHeight(); + }); + }; + var reposition = function () { + var toolbarHeight = get$4(toolstrip); + iosApi.run(function (api) { + api.setViewportOffset(toolbarHeight); + }); + refreshIosSelection(); + refreshView(); + }; + var toEditing = function () { + iosApi.run(function (api) { + api.toEditing(); + }); + }; + var toReading = function () { + iosApi.run(function (api) { + api.toReading(); + }); + }; + var onToolbarTouch = function (event) { + iosApi.run(function (api) { + api.onToolbarTouch(event); + }); + }; + var tapping = TappingEvent.monitor(editorApi); + var refreshThrottle = last$1(refreshView, 300); + var listeners = [ + editorApi.onKeyup(clearAndRefresh), + editorApi.onNodeChanged(refreshIosSelection), + editorApi.onDomChanged(refreshThrottle.throttle), + editorApi.onDomChanged(refreshIosSelection), + editorApi.onScrollToCursor(function (tinyEvent) { + tinyEvent.preventDefault(); + refreshThrottle.throttle(); + }), + editorApi.onScrollToElement(function (event) { + scrollToElement(event.element()); + }), + editorApi.onToEditing(toEditing), + editorApi.onToReading(toReading), + bind$3(editorApi.doc(), 'touchend', function (touchEvent) { + if (eq(editorApi.html(), touchEvent.target()) || eq(editorApi.body(), touchEvent.target())) ; + }), + bind$3(toolstrip, 'transitionend', function (transitionEvent) { + if (transitionEvent.raw().propertyName === 'height') { + reposition(); + } + }), + capture$1(toolstrip, 'touchstart', function (touchEvent) { + saveSelectionFirst(); + onToolbarTouch(touchEvent); + editorApi.onTouchToolstrip(); + }), + bind$3(editorApi.body(), 'touchstart', function (evt) { + clearSelection(); + editorApi.onTouchContent(); + tapping.fireTouchstart(evt); + }), + tapping.onTouchmove(), + tapping.onTouchend(), + bind$3(editorApi.body(), 'click', function (event) { + event.kill(); + }), + bind$3(toolstrip, 'touchmove', function () { + editorApi.onToolbarScrollStart(); + }) + ]; + var destroy = function () { + each$1(listeners, function (l) { + l.unbind(); + }); + }; + return { destroy: destroy }; + }; + var IosEvents = { initEvents: initEvents$1 }; + + function FakeSelection (win, frame) { + var doc = win.document; + var container = Element.fromTag('div'); + add$2(container, Styles.resolve('unfocused-selections')); + append(Element.fromDom(doc.documentElement), container); + var onTouch = bind$3(container, 'touchstart', function (event) { + event.prevent(); + ResumeEditing$1.resume(win, frame); + clear(); + }); + var make = function (rectangle) { + var span = Element.fromTag('span'); + add$3(span, [ + Styles.resolve('layer-editor'), + Styles.resolve('unfocused-selection') + ]); + setAll$1(span, { + left: rectangle.left() + 'px', + top: rectangle.top() + 'px', + width: rectangle.width() + 'px', + height: rectangle.height() + 'px' + }); + return span; + }; + var update = function () { + clear(); + var rectangles = Rectangles.getRectangles(win); + var spans = map$1(rectangles, make); + append$1(container, spans); + }; + var clear = function () { + empty(container); + }; + var destroy = function () { + onTouch.unbind(); + remove(container); + }; + var isActive = function () { + return children(container).length > 0; + }; + return { + update: update, + isActive: isActive, + destroy: destroy, + clear: clear + }; + } + + var exports$1 = {}, module = { 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, undefined)); + var Promise$1 = module.exports.boltExport; + + var nu$7 = function (baseFn) { + var data = Option.none(); + var callbacks = []; + var map = function (f) { + return nu$7(function (nCallback) { + get(function (data) { + nCallback(f(data)); + }); + }); + }; + var get = function (nCallback) { + if (isReady()) { + call(nCallback); + } else { + callbacks.push(nCallback); + } + }; + var set = function (x) { + data = Option.some(x); + run(callbacks); + callbacks = []; + }; + var isReady = function () { + return data.isSome(); + }; + var run = function (cbs) { + each$1(cbs, call); + }; + var call = function (cb) { + data.each(function (x) { + domGlobals.setTimeout(function () { + cb(x); + }, 0); + }); + }; + baseFn(set); + return { + get: get, + map: map, + isReady: isReady + }; + }; + var pure$1 = function (a) { + return nu$7(function (callback) { + callback(a); + }); + }; + var LazyValue = { + nu: nu$7, + pure: pure$1 + }; + + var errorReporter = function (err) { + domGlobals.setTimeout(function () { + throw err; + }, 0); + }; + var make$4 = function (run) { + var get = function (callback) { + run().then(callback, errorReporter); + }; + var map = function (fab) { + return make$4(function () { + return run().then(fab); + }); + }; + var bind = function (aFutureB) { + return make$4(function () { + return run().then(function (v) { + return aFutureB(v).toPromise(); + }); + }); + }; + var anonBind = function (futureB) { + return make$4(function () { + return run().then(function () { + return futureB.toPromise(); + }); + }); + }; + var toLazy = function () { + return LazyValue.nu(get); + }; + var toCached = function () { + var cache = null; + return make$4(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$8 = function (baseFn) { + return make$4(function () { + return new Promise$1(baseFn); + }); + }; + var pure$2 = function (a) { + return make$4(function () { + return Promise$1.resolve(a); + }); + }; + var Future = { + nu: nu$8, + pure: pure$2 + }; + + var adjust = function (value, destination, amount) { + if (Math.abs(value - destination) <= amount) { + return Option.none(); + } else if (value < destination) { + return Option.some(value + amount); + } else { + return Option.some(value - amount); + } + }; + var create$5 = function () { + var interval = null; + var animate = function (getCurrent, destination, amount, increment, doFinish, rate) { + var finished = false; + var finish = function (v) { + finished = true; + doFinish(v); + }; + global$4.clearInterval(interval); + var abort = function (v) { + global$4.clearInterval(interval); + finish(v); + }; + interval = global$4.setInterval(function () { + var value = getCurrent(); + adjust(value, destination, amount).fold(function () { + global$4.clearInterval(interval); + finish(destination); + }, function (s) { + increment(s, abort); + if (!finished) { + var newValue = getCurrent(); + if (newValue !== s || Math.abs(newValue - destination) > Math.abs(value - destination)) { + global$4.clearInterval(interval); + finish(destination); + } + } + }); + }, rate); + }; + return { animate: animate }; + }; + var SmoothAnimation = { + create: create$5, + adjust: adjust + }; + + var findDevice = function (deviceWidth, deviceHeight) { + var devices = [ + { + width: 320, + height: 480, + keyboard: { + portrait: 300, + landscape: 240 + } + }, + { + width: 320, + height: 568, + keyboard: { + portrait: 300, + landscape: 240 + } + }, + { + width: 375, + height: 667, + keyboard: { + portrait: 305, + landscape: 240 + } + }, + { + width: 414, + height: 736, + keyboard: { + portrait: 320, + landscape: 240 + } + }, + { + width: 768, + height: 1024, + keyboard: { + portrait: 320, + landscape: 400 + } + }, + { + width: 1024, + height: 1366, + keyboard: { + portrait: 380, + landscape: 460 + } + } + ]; + return findMap(devices, function (device) { + return someIf(deviceWidth <= device.width && deviceHeight <= device.height, device.keyboard); + }).getOr({ + portrait: deviceHeight / 5, + landscape: deviceWidth / 4 + }); + }; + + var softKeyboardLimits = function (outerWindow) { + return findDevice(outerWindow.screen.width, outerWindow.screen.height); + }; + var accountableKeyboardHeight = function (outerWindow) { + var portrait = Orientation.get(outerWindow).isPortrait(); + var limits = softKeyboardLimits(outerWindow); + var keyboard = portrait ? limits.portrait : limits.landscape; + var visualScreenHeight = portrait ? outerWindow.screen.height : outerWindow.screen.width; + return visualScreenHeight - outerWindow.innerHeight > keyboard ? 0 : keyboard; + }; + var getGreenzone = function (socket, dropup) { + var outerWindow = owner(socket).dom().defaultView; + var viewportHeight = get$4(socket) + get$4(dropup); + var acc = accountableKeyboardHeight(outerWindow); + return viewportHeight - acc; + }; + var updatePadding = function (contentBody, socket, dropup) { + var greenzoneHeight = getGreenzone(socket, dropup); + var deltaHeight = get$4(socket) + get$4(dropup) - greenzoneHeight; + set$3(contentBody, 'padding-bottom', deltaHeight + 'px'); + }; + var DeviceZones = { + getGreenzone: getGreenzone, + updatePadding: updatePadding + }; + + var fixture = Adt.generate([ + { + fixed: [ + 'element', + 'property', + 'offsetY' + ] + }, + { + scroller: [ + 'element', + 'offsetY' + ] + } + ]); + var yFixedData = 'data-' + Styles.resolve('position-y-fixed'); + var yFixedProperty = 'data-' + Styles.resolve('y-property'); + var yScrollingData = 'data-' + Styles.resolve('scrolling'); + var windowSizeData = 'data-' + Styles.resolve('last-window-height'); + var getYFixedData = function (element) { + return DataAttributes.safeParse(element, yFixedData); + }; + var getYFixedProperty = function (element) { + return get(element, yFixedProperty); + }; + var getLastWindowSize = function (element) { + return DataAttributes.safeParse(element, windowSizeData); + }; + var classifyFixed = function (element, offsetY) { + var prop = getYFixedProperty(element); + return fixture.fixed(element, prop, offsetY); + }; + var classifyScrolling = function (element, offsetY) { + return fixture.scroller(element, offsetY); + }; + var classify = function (element) { + var offsetY = getYFixedData(element); + var classifier = get(element, yScrollingData) === 'true' ? classifyScrolling : classifyFixed; + return classifier(element, offsetY); + }; + var findFixtures = function (container) { + var candidates = descendants(container, '[' + yFixedData + ']'); + return map$1(candidates, classify); + }; + var takeoverToolbar = function (toolbar) { + var oldToolbarStyle = get(toolbar, 'style'); + setAll$1(toolbar, { + position: 'absolute', + top: '0px' + }); + set(toolbar, yFixedData, '0px'); + set(toolbar, yFixedProperty, 'top'); + var restore = function () { + set(toolbar, 'style', oldToolbarStyle || ''); + remove$1(toolbar, yFixedData); + remove$1(toolbar, yFixedProperty); + }; + return { restore: restore }; + }; + var takeoverViewport = function (toolbarHeight, height, viewport) { + var oldViewportStyle = get(viewport, 'style'); + Scrollable.register(viewport); + setAll$1(viewport, { + position: 'absolute', + height: height + 'px', + width: '100%', + top: toolbarHeight + 'px' + }); + set(viewport, yFixedData, toolbarHeight + 'px'); + set(viewport, yScrollingData, 'true'); + set(viewport, yFixedProperty, 'top'); + var restore = function () { + Scrollable.deregister(viewport); + set(viewport, 'style', oldViewportStyle || ''); + remove$1(viewport, yFixedData); + remove$1(viewport, yScrollingData); + remove$1(viewport, yFixedProperty); + }; + return { restore: restore }; + }; + var takeoverDropup = function (dropup, toolbarHeight, viewportHeight) { + var oldDropupStyle = get(dropup, 'style'); + setAll$1(dropup, { + position: 'absolute', + bottom: '0px' + }); + set(dropup, yFixedData, '0px'); + set(dropup, yFixedProperty, 'bottom'); + var restore = function () { + set(dropup, 'style', oldDropupStyle || ''); + remove$1(dropup, yFixedData); + remove$1(dropup, yFixedProperty); + }; + return { restore: restore }; + }; + var deriveViewportHeight = function (viewport, toolbarHeight, dropupHeight) { + var outerWindow = owner(viewport).dom().defaultView; + var winH = outerWindow.innerHeight; + set(viewport, windowSizeData, winH + 'px'); + return winH - toolbarHeight - dropupHeight; + }; + var takeover$1 = function (viewport, contentBody, toolbar, dropup) { + var outerWindow = owner(viewport).dom().defaultView; + var toolbarSetup = takeoverToolbar(toolbar); + var toolbarHeight = get$4(toolbar); + var dropupHeight = get$4(dropup); + var viewportHeight = deriveViewportHeight(viewport, toolbarHeight, dropupHeight); + var viewportSetup = takeoverViewport(toolbarHeight, viewportHeight, viewport); + var dropupSetup = takeoverDropup(dropup); + var isActive = true; + var restore = function () { + isActive = false; + toolbarSetup.restore(); + viewportSetup.restore(); + dropupSetup.restore(); + }; + var isExpanding = function () { + var currentWinHeight = outerWindow.innerHeight; + var lastWinHeight = getLastWindowSize(viewport); + return currentWinHeight > lastWinHeight; + }; + var refresh = function () { + if (isActive) { + var newToolbarHeight = get$4(toolbar); + var dropupHeight_1 = get$4(dropup); + var newHeight = deriveViewportHeight(viewport, newToolbarHeight, dropupHeight_1); + set(viewport, yFixedData, newToolbarHeight + 'px'); + set$3(viewport, 'height', newHeight + 'px'); + DeviceZones.updatePadding(contentBody, viewport, dropup); + } + }; + var setViewportOffset = function (newYOffset) { + var offsetPx = newYOffset + 'px'; + set(viewport, yFixedData, offsetPx); + refresh(); + }; + DeviceZones.updatePadding(contentBody, viewport, dropup); + return { + setViewportOffset: setViewportOffset, + isExpanding: isExpanding, + isShrinking: not(isExpanding), + refresh: refresh, + restore: restore + }; + }; + var IosViewport = { + findFixtures: findFixtures, + takeover: takeover$1, + getYFixedData: getYFixedData + }; + + var animator = SmoothAnimation.create(); + var ANIMATION_STEP = 15; + var NUM_TOP_ANIMATION_FRAMES = 10; + var ANIMATION_RATE = 10; + var lastScroll = 'data-' + Styles.resolve('last-scroll-top'); + var getTop = function (element) { + var raw = getRaw(element, 'top').getOr('0'); + return parseInt(raw, 10); + }; + var getScrollTop = function (element) { + return parseInt(element.dom().scrollTop, 10); + }; + var moveScrollAndTop = function (element, destination, finalTop) { + return Future.nu(function (callback) { + var getCurrent = curry(getScrollTop, element); + var update = function (newScroll) { + element.dom().scrollTop = newScroll; + set$3(element, 'top', getTop(element) + ANIMATION_STEP + 'px'); + }; + var finish = function () { + element.dom().scrollTop = destination; + set$3(element, 'top', finalTop + 'px'); + callback(destination); + }; + animator.animate(getCurrent, destination, ANIMATION_STEP, update, finish, ANIMATION_RATE); + }); + }; + var moveOnlyScroll = function (element, destination) { + return Future.nu(function (callback) { + var getCurrent = curry(getScrollTop, element); + set(element, lastScroll, getCurrent()); + var update = function (newScroll, abort) { + var previous = DataAttributes.safeParse(element, lastScroll); + if (previous !== element.dom().scrollTop) { + abort(element.dom().scrollTop); + } else { + element.dom().scrollTop = newScroll; + set(element, lastScroll, newScroll); + } + }; + var finish = function () { + element.dom().scrollTop = destination; + set(element, lastScroll, destination); + callback(destination); + }; + var distance = Math.abs(destination - getCurrent()); + var step = Math.ceil(distance / NUM_TOP_ANIMATION_FRAMES); + animator.animate(getCurrent, destination, step, update, finish, ANIMATION_RATE); + }); + }; + var moveOnlyTop = function (element, destination) { + return Future.nu(function (callback) { + var getCurrent = curry(getTop, element); + var update = function (newTop) { + set$3(element, 'top', newTop + 'px'); + }; + var finish = function () { + update(destination); + callback(destination); + }; + var distance = Math.abs(destination - getCurrent()); + var step = Math.ceil(distance / NUM_TOP_ANIMATION_FRAMES); + animator.animate(getCurrent, destination, step, update, finish, ANIMATION_RATE); + }); + }; + var updateTop = function (element, amount) { + var newTop = amount + IosViewport.getYFixedData(element) + 'px'; + set$3(element, 'top', newTop); + }; + var moveWindowScroll = function (toolbar, viewport, destY) { + var outerWindow = owner(toolbar).dom().defaultView; + return Future.nu(function (callback) { + updateTop(toolbar, destY); + updateTop(viewport, destY); + outerWindow.scrollTo(0, destY); + callback(destY); + }); + }; + var IosScrolling = { + moveScrollAndTop: moveScrollAndTop, + moveOnlyScroll: moveOnlyScroll, + moveOnlyTop: moveOnlyTop, + moveWindowScroll: moveWindowScroll + }; + + function BackgroundActivity (doAction) { + var action = Cell(LazyValue.pure({})); + var start = function (value) { + var future = LazyValue.nu(function (callback) { + return doAction(value).get(callback); + }); + action.set(future); + }; + var idle = function (g) { + action.get().get(function () { + g(); + }); + }; + return { + start: start, + idle: idle + }; + } + + var scrollIntoView = function (cWin, socket, dropup, top, bottom) { + var greenzone = DeviceZones.getGreenzone(socket, dropup); + var refreshCursor = curry(CursorRefresh.refresh, cWin); + if (top > greenzone || bottom > greenzone) { + IosScrolling.moveOnlyScroll(socket, socket.dom().scrollTop - greenzone + bottom).get(refreshCursor); + } else if (top < 0) { + IosScrolling.moveOnlyScroll(socket, socket.dom().scrollTop + top).get(refreshCursor); + } + }; + var Greenzone = { scrollIntoView: scrollIntoView }; + + 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$1(asyncValues, function (asyncValue, i) { + asyncValue.get(cb(i)); + }); + } + }); + }; + + var par$1 = function (futures) { + return par(futures, Future.nu); + }; + + var updateFixed = function (element, property, winY, offsetY) { + var destination = winY + offsetY; + set$3(element, property, destination + 'px'); + return Future.pure(offsetY); + }; + var updateScrollingFixed = function (element, winY, offsetY) { + var destTop = winY + offsetY; + var oldProp = getRaw(element, 'top').getOr(offsetY); + var delta = destTop - parseInt(oldProp, 10); + var destScroll = element.dom().scrollTop + delta; + return IosScrolling.moveScrollAndTop(element, destScroll, destTop); + }; + var updateFixture = function (fixture, winY) { + return fixture.fold(function (element, property, offsetY) { + return updateFixed(element, property, winY, offsetY); + }, function (element, offsetY) { + return updateScrollingFixed(element, winY, offsetY); + }); + }; + var updatePositions = function (container, winY) { + var fixtures = IosViewport.findFixtures(container); + var updates = map$1(fixtures, function (fixture) { + return updateFixture(fixture, winY); + }); + return par$1(updates); + }; + var IosUpdates = { updatePositions: updatePositions }; + + var VIEW_MARGIN = 5; + var register$2 = function (toolstrip, socket, container, outerWindow, structure, cWin) { + var scroller = BackgroundActivity(function (y) { + return IosScrolling.moveWindowScroll(toolstrip, socket, y); + }); + var scrollBounds = function () { + var rects = Rectangles.getRectangles(cWin); + return Option.from(rects[0]).bind(function (rect) { + var viewTop = rect.top() - socket.dom().scrollTop; + var outside = viewTop > outerWindow.innerHeight + VIEW_MARGIN || viewTop < -VIEW_MARGIN; + return outside ? Option.some({ + top: constant(viewTop), + bottom: constant(viewTop + rect.height()) + }) : Option.none(); + }); + }; + var scrollThrottle = last$1(function () { + scroller.idle(function () { + IosUpdates.updatePositions(container, outerWindow.pageYOffset).get(function () { + var extraScroll = scrollBounds(); + extraScroll.each(function (extra) { + socket.dom().scrollTop = socket.dom().scrollTop + extra.top(); + }); + scroller.start(0); + structure.refresh(); + }); + }); + }, 1000); + var onScroll = bind$3(Element.fromDom(outerWindow), 'scroll', function () { + if (outerWindow.pageYOffset < 0) { + return; + } + scrollThrottle.throttle(); + }); + IosUpdates.updatePositions(container, outerWindow.pageYOffset).get(identity); + return { unbind: onScroll.unbind }; + }; + var setup$3 = function (bag) { + var cWin = bag.cWin(); + var ceBody = bag.ceBody(); + var socket = bag.socket(); + var toolstrip = bag.toolstrip(); + var toolbar = bag.toolbar(); + var contentElement = bag.contentElement(); + var keyboardType = bag.keyboardType(); + var outerWindow = bag.outerWindow(); + var dropup = bag.dropup(); + var structure = IosViewport.takeover(socket, ceBody, toolstrip, dropup); + var keyboardModel = keyboardType(bag.outerBody(), cWin, body(), contentElement, toolstrip, toolbar); + var toEditing = function () { + keyboardModel.toEditing(); + clearSelection(); + }; + var toReading = function () { + keyboardModel.toReading(); + }; + var onToolbarTouch = function (event) { + keyboardModel.onToolbarTouch(event); + }; + var onOrientation = Orientation.onChange(outerWindow, { + onChange: noop, + onReady: structure.refresh + }); + onOrientation.onAdjustment(function () { + structure.refresh(); + }); + var onResize = bind$3(Element.fromDom(outerWindow), 'resize', function () { + if (structure.isExpanding()) { + structure.refresh(); + } + }); + var onScroll = register$2(toolstrip, socket, bag.outerBody(), outerWindow, structure, cWin); + var unfocusedSelection = FakeSelection(cWin, contentElement); + var refreshSelection = function () { + if (unfocusedSelection.isActive()) { + unfocusedSelection.update(); + } + }; + var highlightSelection = function () { + unfocusedSelection.update(); + }; + var clearSelection = function () { + unfocusedSelection.clear(); + }; + var scrollIntoView = function (top, bottom) { + Greenzone.scrollIntoView(cWin, socket, dropup, top, bottom); + }; + var syncHeight = function () { + set$3(contentElement, 'height', contentElement.dom().contentWindow.document.body.scrollHeight + 'px'); + }; + var setViewportOffset = function (newYOffset) { + structure.setViewportOffset(newYOffset); + IosScrolling.moveOnlyTop(socket, newYOffset).get(identity); + }; + var destroy = function () { + structure.restore(); + onOrientation.destroy(); + onScroll.unbind(); + onResize.unbind(); + keyboardModel.destroy(); + unfocusedSelection.destroy(); + CaptureBin.input(body(), blur); + }; + return { + toEditing: toEditing, + toReading: toReading, + onToolbarTouch: onToolbarTouch, + refreshSelection: refreshSelection, + clearSelection: clearSelection, + highlightSelection: highlightSelection, + scrollIntoView: scrollIntoView, + updateToolbarPadding: noop, + setViewportOffset: setViewportOffset, + syncHeight: syncHeight, + refreshStructure: structure.refresh, + destroy: destroy + }; + }; + var IosSetup = { setup: setup$3 }; + + var create$6 = function (platform, mask) { + var meta = MetaViewport.tag(); + var priorState = value$2(); + var scrollEvents = value$2(); + var iosApi = api$2(); + var iosEvents = api$2(); + var enter = function () { + mask.hide(); + var doc = Element.fromDom(domGlobals.document); + PlatformEditor.getActiveApi(platform.editor).each(function (editorApi) { + priorState.set({ + socketHeight: getRaw(platform.socket, 'height'), + iframeHeight: getRaw(editorApi.frame(), 'height'), + outerScroll: domGlobals.document.body.scrollTop + }); + scrollEvents.set({ exclusives: Scrollables.exclusive(doc, '.' + Scrollable.scrollable()) }); + add$2(platform.container, Styles.resolve('fullscreen-maximized')); + Thor.clobberStyles(platform.container, editorApi.body()); + meta.maximize(); + set$3(platform.socket, 'overflow', 'scroll'); + set$3(platform.socket, '-webkit-overflow-scrolling', 'touch'); + focus$1(editorApi.body()); + var setupBag = MixedBag([ + 'cWin', + 'ceBody', + 'socket', + 'toolstrip', + 'toolbar', + 'dropup', + 'contentElement', + 'cursor', + 'keyboardType', + 'isScrolling', + 'outerWindow', + 'outerBody' + ], []); + iosApi.set(IosSetup.setup(setupBag({ + cWin: editorApi.win(), + ceBody: editorApi.body(), + socket: platform.socket, + toolstrip: platform.toolstrip, + toolbar: platform.toolbar, + dropup: platform.dropup.element(), + contentElement: editorApi.frame(), + cursor: noop, + outerBody: platform.body, + outerWindow: platform.win, + keyboardType: IosKeyboard.stubborn, + isScrolling: function () { + var scrollValue = scrollEvents; + return scrollValue.get().exists(function (s) { + return s.socket.isScrolling(); + }); + } + }))); + iosApi.run(function (api) { + api.syncHeight(); + }); + iosEvents.set(IosEvents.initEvents(editorApi, iosApi, platform.toolstrip, platform.socket, platform.dropup)); + }); + }; + var exit = function () { + meta.restore(); + iosEvents.clear(); + iosApi.clear(); + mask.show(); + priorState.on(function (s) { + s.socketHeight.each(function (h) { + set$3(platform.socket, 'height', h); + }); + s.iframeHeight.each(function (h) { + set$3(platform.editor.getFrame(), 'height', h); + }); + domGlobals.document.body.scrollTop = s.scrollTop; + }); + priorState.clear(); + scrollEvents.on(function (s) { + s.exclusives.unbind(); + }); + scrollEvents.clear(); + remove$4(platform.container, Styles.resolve('fullscreen-maximized')); + Thor.restoreStyles(); + Scrollable.deregister(platform.toolbar); + remove$5(platform.socket, 'overflow'); + remove$5(platform.socket, '-webkit-overflow-scrolling'); + blur(platform.editor.getFrame()); + PlatformEditor.getActiveApi(platform.editor).each(function (editorApi) { + editorApi.clearSelection(); + }); + }; + var refreshStructure = function () { + iosApi.run(function (api) { + api.refreshStructure(); + }); + }; + return { + enter: enter, + refreshStructure: refreshStructure, + exit: exit + }; + }; + var IosMode = { create: create$6 }; + + var produce$1 = function (raw) { + var mobile = asRawOrDie('Getting IosWebapp schema', MobileSchema, raw); + set$3(mobile.toolstrip, 'width', '100%'); + set$3(mobile.container, 'position', 'relative'); + var onView = function () { + mobile.setReadOnly(mobile.readOnlyOnInit()); + mode.enter(); + }; + var mask = build$1(TapToEditMask.sketch(onView, mobile.translate)); + mobile.alloy.add(mask); + var maskApi = { + show: function () { + mobile.alloy.add(mask); + }, + hide: function () { + mobile.alloy.remove(mask); + } + }; + var mode = IosMode.create(mobile, maskApi); + return { + setReadOnly: mobile.setReadOnly, + refreshStructure: mode.refreshStructure, + enter: mode.enter, + exit: mode.exit, + destroy: noop + }; + }; + var IosWebapp = { produce: produce$1 }; + + function IosRealm (scrollIntoView) { + var alloy = OuterContainer({ classes: [Styles.resolve('ios-container')] }); + var toolbar = ScrollingToolbar(); + var webapp = api$2(); + var switchToEdit = CommonRealm.makeEditSwitch(webapp); + var socket = CommonRealm.makeSocket(); + var dropup = build$2(function () { + webapp.run(function (w) { + w.refreshStructure(); + }); + }, scrollIntoView); + alloy.add(toolbar.wrapper()); + alloy.add(socket); + alloy.add(dropup.component()); + var setToolbarGroups = function (rawGroups) { + var groups = toolbar.createGroups(rawGroups); + toolbar.setGroups(groups); + }; + var setContextToolbar = function (rawGroups) { + var groups = toolbar.createGroups(rawGroups); + toolbar.setContextToolbar(groups); + }; + var focusToolbar = function () { + toolbar.focus(); + }; + var restoreToolbar = function () { + toolbar.restoreToolbar(); + }; + var init = function (spec) { + webapp.set(IosWebapp.produce(spec)); + }; + var exit = function () { + webapp.run(function (w) { + Replacing.remove(socket, switchToEdit); + w.exit(); + }); + }; + var updateMode = function (readOnly) { + CommonRealm.updateMode(socket, switchToEdit, readOnly, alloy.root()); + }; + return { + system: constant(alloy), + element: alloy.element, + init: init, + exit: exit, + setToolbarGroups: setToolbarGroups, + setContextToolbar: setContextToolbar, + focusToolbar: focusToolbar, + restoreToolbar: restoreToolbar, + updateMode: updateMode, + socket: constant(socket), + dropup: constant(dropup) + }; + } + + var global$5 = tinymce.util.Tools.resolve('tinymce.EditorManager'); + + var derive$3 = function (editor) { + var base = readOptFrom$1(editor.settings, 'skin_url').fold(function () { + return global$5.baseURL + '/skins/ui/oxide'; + }, function (url) { + return url; + }); + return { + content: base + '/content.mobile.min.css', + ui: base + '/skin.mobile.min.css' + }; + }; + var CssUrls = { derive: derive$3 }; + + var fontSizes = [ + 'x-small', + 'small', + 'medium', + 'large', + 'x-large' + ]; + var fireChange = function (realm, command, state) { + realm.system().broadcastOn([TinyChannels.formatChanged()], { + command: command, + state: state + }); + }; + var init$5 = function (realm, editor) { + var allFormats = keys(editor.formatter.get()); + each$1(allFormats, function (command) { + editor.formatter.formatChanged(command, function (state) { + fireChange(realm, command, state); + }); + }); + each$1([ + 'ul', + 'ol' + ], function (command) { + editor.selection.selectorChanged(command, function (state, data) { + fireChange(realm, command, state); + }); + }); + }; + var FormatChangers = { + init: init$5, + fontSizes: constant(fontSizes) + }; + + var fireSkinLoaded = function (editor) { + var done = function () { + editor._skinLoaded = true; + editor.fire('SkinLoaded'); + }; + return function () { + if (editor.initialized) { + done(); + } else { + editor.on('init', done); + } + }; + }; + var SkinLoaded = { fireSkinLoaded: fireSkinLoaded }; + + var READING = constant('toReading'); + var EDITING = constant('toEditing'); + var renderMobileTheme = function (editor) { + var renderUI = function () { + var targetNode = editor.getElement(); + var cssUrls = CssUrls.derive(editor); + if (isSkinDisabled(editor) === false) { + editor.contentCSS.push(cssUrls.content); + global$1.DOM.styleSheetLoader.load(cssUrls.ui, SkinLoaded.fireSkinLoaded(editor)); + } else { + SkinLoaded.fireSkinLoaded(editor)(); + } + var doScrollIntoView = function () { + editor.fire('ScrollIntoView'); + }; + var realm = detect$3().os.isAndroid() ? AndroidRealm(doScrollIntoView) : IosRealm(doScrollIntoView); + var original = Element.fromDom(targetNode); + attachSystemAfter(original, realm.system()); + var findFocusIn = function (elem) { + return search(elem).bind(function (focused) { + return realm.system().getByDom(focused).toOption(); + }); + }; + var outerWindow = targetNode.ownerDocument.defaultView; + var orientation = Orientation.onChange(outerWindow, { + onChange: function () { + var alloy = realm.system(); + alloy.broadcastOn([TinyChannels.orientationChanged()], { width: Orientation.getActualWidth(outerWindow) }); + }, + onReady: noop + }); + var setReadOnly = function (dynamicGroup, readOnlyGroups, mainGroups, ro) { + if (ro === false) { + editor.selection.collapse(); + } + var toolbars = configureToolbar(dynamicGroup, readOnlyGroups, mainGroups); + realm.setToolbarGroups(ro === true ? toolbars.readOnly : toolbars.main); + editor.setMode(ro === true ? 'readonly' : 'design'); + editor.fire(ro === true ? READING() : EDITING()); + realm.updateMode(ro); + }; + var configureToolbar = function (dynamicGroup, readOnlyGroups, mainGroups) { + var dynamic = dynamicGroup.get(); + var toolbars = { + readOnly: dynamic.backToMask.concat(readOnlyGroups.get()), + main: dynamic.backToMask.concat(mainGroups.get()) + }; + return toolbars; + }; + var bindHandler = function (label, handler) { + editor.on(label, handler); + return { + unbind: function () { + editor.off(label); + } + }; + }; + editor.on('init', function () { + realm.init({ + editor: { + getFrame: function () { + return Element.fromDom(editor.contentAreaContainer.querySelector('iframe')); + }, + onDomChanged: function () { + return { unbind: noop }; + }, + onToReading: function (handler) { + return bindHandler(READING(), handler); + }, + onToEditing: function (handler) { + return bindHandler(EDITING(), handler); + }, + onScrollToCursor: function (handler) { + editor.on('ScrollIntoView', function (tinyEvent) { + handler(tinyEvent); + }); + var unbind = function () { + editor.off('ScrollIntoView'); + orientation.destroy(); + }; + return { unbind: unbind }; + }, + onTouchToolstrip: function () { + hideDropup(); + }, + onTouchContent: function () { + var toolbar = Element.fromDom(editor.editorContainer.querySelector('.' + Styles.resolve('toolbar'))); + findFocusIn(toolbar).each(emitExecute); + realm.restoreToolbar(); + hideDropup(); + }, + onTapContent: function (evt) { + var target = evt.target(); + if (name(target) === 'img') { + editor.selection.select(target.dom()); + evt.kill(); + } else if (name(target) === 'a') { + var component = realm.system().getByDom(Element.fromDom(editor.editorContainer)); + component.each(function (container) { + if (Swapping.isAlpha(container)) { + TinyCodeDupe.openLink(target.dom()); + } + }); + } + } + }, + container: Element.fromDom(editor.editorContainer), + socket: Element.fromDom(editor.contentAreaContainer), + toolstrip: Element.fromDom(editor.editorContainer.querySelector('.' + Styles.resolve('toolstrip'))), + toolbar: Element.fromDom(editor.editorContainer.querySelector('.' + Styles.resolve('toolbar'))), + dropup: realm.dropup(), + alloy: realm.system(), + translate: noop, + setReadOnly: function (ro) { + setReadOnly(dynamicGroup, readOnlyGroups, mainGroups, ro); + }, + readOnlyOnInit: function () { + return readOnlyOnInit(); + } + }); + var hideDropup = function () { + realm.dropup().disappear(function () { + realm.system().broadcastOn([TinyChannels.dropupDismissed()], {}); + }); + }; + var backToMaskGroup = { + label: 'The first group', + scrollable: false, + items: [Buttons.forToolbar('back', function () { + editor.selection.collapse(); + realm.exit(); + }, {}, editor)] + }; + var backToReadOnlyGroup = { + label: 'Back to read only', + scrollable: false, + items: [Buttons.forToolbar('readonly-back', function () { + setReadOnly(dynamicGroup, readOnlyGroups, mainGroups, true); + }, {}, editor)] + }; + var readOnlyGroup = { + label: 'The read only mode group', + scrollable: true, + items: [] + }; + var features = Features.setup(realm, editor); + var items = Features.detect(editor.settings, features); + var actionGroup = { + label: 'the action group', + scrollable: true, + items: items + }; + var extraGroup = { + label: 'The extra group', + scrollable: false, + items: [] + }; + var mainGroups = Cell([ + actionGroup, + extraGroup + ]); + var readOnlyGroups = Cell([ + readOnlyGroup, + extraGroup + ]); + var dynamicGroup = Cell({ + backToMask: [backToMaskGroup], + backToReadOnly: [backToReadOnlyGroup] + }); + FormatChangers.init(realm, editor); + }); + editor.on('remove', function () { + realm.exit(); + }); + editor.on('detach', function () { + detachSystem(realm.system()); + realm.system().destroy(); + }); + return { + iframeContainer: realm.socket().element().dom(), + editorContainer: realm.element().dom() + }; + }; + return { + getNotificationManagerImpl: function () { + return { + open: constant({ + progressBar: { value: noop }, + close: noop, + text: noop, + getEl: constant(null), + moveTo: noop, + moveRel: noop, + settings: {} + }), + close: noop, + reposition: noop, + getArgs: constant({}) + }; + }, + renderUI: renderUI + }; + }; + function Theme () { + global$2.add('mobile', renderMobileTheme); + } + + Theme(); + +}(window)); diff --git a/lib/tinymce/js/tinymce/themes/mobile/theme.min.js b/lib/tinymce/js/tinymce/themes/mobile/theme.min.js new file mode 100644 index 00000000..3c615669 --- /dev/null +++ b/lib/tinymce/js/tinymce/themes/mobile/theme.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.1.6 (2020-01-28) + */ +!function(l){"use strict";var x=function(){return(x=Object.assign||function(n){for(var e,t=1,r=arguments.length;t "+r.toString()},function(n,e){return"state("+n+")"})}).join("\n")+"}"},toDsl:function(){return xr.objOf(me(r,function(n){return n.fold(function(n,e,t,r){return wr.field(n,t,r)},function(n,e){return wr.state(n)})}))}}},Tr=b(Pt(lr)),kr=Sr.state,Er=Sr.field,Cr=Pt(lr),Dr=function(n){return"Errors: \n"+function(n){var e=10 ")+")\n"+n.getErrorInfo()})}(n.errors)+"\n\nInput object: "+Bt(n.input)},Mr=b(Cr),Ir=(cr=ae,ar="function",Pt(function(n){var e=typeof n;return cr(n)?lr(n):mr("Expected type: "+ar+" but got: "+e)}));function Rr(n,e,t,r,o){return n(t,r)?Fn.some(t):ae(o)&&o(t)?Fn.none():e(t,r,o)}function Ar(n,e,t){for(var r=n.dom(),o=ae(t)?t:b(!1);r.parentNode;){r=r.parentNode;var i=Qe.fromDom(r);if(e(i))return Fn.some(i);if(o(i))break}return Fn.none()}function Fr(n,e,t){return Rr(function(n,e){return e(n)},Ar,n,e,t)}function Br(n,o){var i=function(n){for(var e=0;e"}),Mr()),Ja=ir("schema",function(){return[Zt("preprocess")]}),Qa=rr("defaults",b({})),Za=rr("overrides",b({})),nf=Or([Xa,qa,Ya,Ka,Qa,Za]),ef=Or([Xa,qa,Ya,Ka,Qa,Za]),tf=Or([Xa,Ja,Ya,Kt("unit"),Ka,Qa,Za]),rf=wc(Wa.required,nf),of=wc(Wa.optional,ef),uf=wc(Wa.group,tf),cf=b("entirety"),af=function(n,e){return{uiType:Ua(),owner:n,name:e}},ff=bc("alloy-premade"),sf=b("alloy-id-"),lf=b("data-alloy-id"),df=sf(),mf=lf(),gf=function(n,e){Object.defineProperty(n.dom(),mf,{value:e,writable:!0})},pf=function(n){var e=tt(n)?n.dom()[mf]:null;return Fn.from(e)},hf=function(n){return n.hasOwnProperty("uid")?n:x(x({},n),{uid:Ac("uid")})};function vf(n){var e=qt("Sketcher for "+n.name,zs,n),t=S(e.apis,Rc),r=S(e.extraApis,function(n,e){return Ur(n,e)});return x(x({name:b(e.name),partFields:b([]),configFields:b(e.configFields),sketch:function(n){return function(n,e,t,r){var o=hf(r);return t(Fc(n,e,o,[],[]),o)}(e.name,e.configFields,e.factory,n)}},t),r)}function yf(n){var e=qt("Sketcher for "+n.name,Ls,n),t=Oc(e.name,e.partFields),r=S(e.apis,Rc),o=S(e.extraApis,function(n,e){return Ur(n,e)});return x(x({name:b(e.name),partFields:b(e.partFields),configFields:b(e.configFields),sketch:function(n){return Bc(e.name,e.configFields,e.partFields,e.factory,n)},parts:b(t)},r),o)}function bf(n){var e=Qe.fromHtml(n),t=ft(e),r=function(n){var e=n.dom().attributes!==undefined?n.dom().attributes:[];return I(e,function(n,e){var t;return"class"===e.name?n:x(x({},n),((t={})[e.name]=e.value,t))},{})}(e),o=function(n){return Array.prototype.slice.call(n.dom().classList,0)}(e),i=0===t.length?{}:{innerHtml:ho(e)};return x({tag:q(e),classes:o,attributes:r},i)}function xf(n){return{dom:$s(n)}}function wf(n){return Vo([Bi.config({toggleClass:Pi.resolve("toolbar-button-selected"),toggleOnExecute:!1,aria:{mode:"pressed"}}),Vi(n,function(n,e){(e?Bi.on:Bi.off)(n)})])}function Sf(n,e){var t=e.ui.registry.getAll().icons;return Fn.from(t[n]).fold(function(){return $s('')},function(n){return $s(''+n+"")})}function Of(e){return of({name:e+"-edge",overrides:function(n){return n.model.manager.edgeActions[e].fold(function(){return{}},function(r){return{events:jr([Hr(we(),r,[n]),Hr(Te(),r,[n]),Hr(ke(),function(n,e,t){t.mouseIsDown.get()&&r(n,t)},[n])])}})}})}function Tf(n,e,t){e.store.manager.onLoad(n,e,t)}function kf(n,e,t){e.store.manager.onUnload(n,e,t)}function Ef(){var n=Pn(null);return Bo({set:n.set,get:n.get,isNotSet:function(){return null===n.get()},clear:function(){n.set(null)},readState:function(){return{mode:"memory",value:n.get()}}})}function Cf(){var i=Pn({}),u=Pn({});return Bo({readState:function(){return{mode:"dataset",dataByValue:i.get(),dataByText:u.get()}},lookup:function(n){return Mt(i.get(),n).orThunk(function(){return Mt(u.get(),n)})},update:function(n){var e=i.get(),t=u.get(),r={},o={};C(n,function(e){r[e.value]=e,Mt(e,"meta").each(function(n){Mt(n,"text").each(function(n){o[n]=e})})}),i.set(x(x({},e),r)),u.set(x(x({},t),o))},clear:function(){i.set({}),u.set({})}})}function Df(n,e,t,r){var o=e.store;t.update([r]),o.setValue(n,r),e.onSetValue(n,r)}function Mf(n,e){ll.set(n,e)}function If(n){return ll.get(n)}function Rf(n){var e=n.event().raw();if(function(n){return-1!==n.type.indexOf("touch")}(e)){var t=e;return t.touches!==undefined&&1===t.touches.length?Fn.some(t.touches[0]).map(function(n){return ml(n.clientX,n.clientY)}):Fn.none()}var r=e;return r.clientX!==undefined?Fn.some(r).map(function(n){return ml(n.clientX,n.clientY)}):Fn.none()}function Af(n){return n.model.minX}function Ff(n){return n.model.minY}function Bf(n){return n.model.minX-1}function Vf(n){return n.model.minY-1}function Nf(n){return n.model.maxX}function jf(n){return n.model.maxY}function _f(n){return n.model.maxX+1}function Pf(n){return n.model.maxY+1}function Hf(n,e,t){return e(n)-t(n)}function zf(n){return Hf(n,Nf,Af)}function Lf(n){return Hf(n,jf,Ff)}function Gf(n){return zf(n)/2}function Uf(n){return Lf(n)/2}function $f(n){return n.stepSize}function Wf(n){return n.snapToGrid}function Xf(n){return n.snapStart}function qf(n){return n.rounded}function Yf(n,e){return n[e+"-edge"]!==undefined}function Kf(n){return Yf(n,"left")}function Jf(n){return Yf(n,"right")}function Qf(n){return Yf(n,"top")}function Zf(n){return Yf(n,"bottom")}function ns(n){return n.model.value.get()}function es(n){return{x:b(n)}}function ts(n){return{y:b(n)}}function rs(n,e){return{x:b(n),y:b(e)}}function os(n,e){U(n,gl(),{value:e})}function is(n,e,t,r){return n'),components:[Nl.parts()["left-edge"](xf('
    ')),Nl.parts().spectrum({dom:$s('
    '),components:[xf('
    ')],behaviours:Vo([Bi.config({toggleClass:Pi.resolve("thumb-active")})])}),Nl.parts()["right-edge"](xf('
    ')),Nl.parts().thumb({dom:$s('
    '),behaviours:Vo([Bi.config({toggleClass:Pi.resolve("thumb-active")})])})],onChange:function(n,e,t){var r=i(t.x());Ui(e.element(),"background-color",r),o.onChange(n,e,r)},onDragStart:function(n,e){Bi.on(e)},onDragEnd:function(n,e){Bi.off(e)},onInit:function(n,e,t,r){var o=i(r.x());Ui(e.element(),"background-color",o)},stepSize:10,model:{mode:"x",minX:0,maxX:360,getInitialValue:function(){return{x:function(){return o.getInitialValue()}}}},sliderBehaviours:Vo([Ni(Nl.refresh)])})}(n)]}function Ns(n){var e=n.selection.getStart(),t=Qe.fromDom(e),r=Qe.fromDom(n.getBody()),o=function(e,n){return(tt(n)?Fn.some(n):fn(n).filter(tt)).map(function(n){return Fr(n,function(n){return pi(n,"font-size").isSome()},e).bind(function(n){return pi(n,"font-size")}).getOrThunk(function(){return gi(n,"font-size")})}).getOr("")}(function(n){return cn(r,n)},t);return R(Hl,function(n){return o===n}).getOr("medium")}function js(n){return[xf(''),function(n){return Pl({onChange:n.onChange,sizes:Ll,category:"font",getInitialValue:n.getInitialValue})}(n),xf('')]}function _s(n){var e=function t(n){return n.uid!==undefined}(n)&&Mn(n,"uid")?n.uid:Ac("memento");return{get:function(n){return n.getSystem().getByUid(e).getOrDie()},getOpt:function(n){return n.getSystem().getByUid(e).toOption()},asSpec:function(){return x(x({},n),{uid:e})}}}var Ps,Hs,zs=Ht([Kt("name"),Kt("factory"),Kt("configFields"),rr("apis",{}),rr("extraApis",{})]),Ls=Ht([Kt("name"),Kt("factory"),Kt("configFields"),Kt("partFields"),rr("apis",{}),rr("extraApis",{})]),Gs=vf({name:"Button",factory:function(n){function t(e){return Mt(n.dom,"attributes").bind(function(n){return Mt(n,e)})}var e=function(n){return jr(F([n.map(function(t){return Io(function(n,e){t(n),e.stop()})}).toArray(),fi()]))}(n.action),r=n.dom.tag;return{uid:n.uid,dom:n.dom,components:n.components,events:e,behaviours:_a(n.buttonBehaviours,[Gi.config({}),Na.config({mode:"execution",useSpace:!0,useEnter:!0})]),domModification:{attributes:function(){if("button"!==r)return{role:t("role").getOr("button")};var n=t("type").getOr("button"),e=t("role").map(function(n){return{role:n}}).getOr({});return x({type:n},e)}()},eventOrder:n.eventOrder}},configFields:[rr("uid",undefined),Kt("dom"),rr("components",[]),ja("buttonBehaviours",[Gi,Na]),Zt("action"),Zt("role"),rr("eventOrder",{})]}),Us=Yr({fields:[],name:"unselecting",active:/* */Object.freeze({events:function(n){return jr([_r(Be(),b(!0))])},exhibit:function(n,e){return $r({styles:{"-webkit-user-select":"none","user-select":"none","-ms-user-select":"none","-moz-user-select":"-moz-none"},attributes:{unselectable:"on"}})}})}),$s=function(n){var e=function(n,r){return n.replace(/\$\{([^{}]*)\}/g,function(n,e){var t=r[e];return function(n){var e=typeof n;return"string"==e||"number"==e}(t)?t.toString():n})}(n,{prefix:Pi.prefix()});return bf(e)},Ws=function(n,e,t,r){return Gs.sketch({dom:Sf(n,r),action:e,buttonBehaviours:wt(Vo([Us.config({})]),t)})},Xs={forToolbar:Ws,forToolbarCommand:function(n,e){return Ws(e,function(){n.execCommand(e)},{},n)},forToolbarStateAction:function(n,e,t,r){var o=wf(t);return Ws(e,r,o,n)},forToolbarStateCommand:function(n,e){var t=wf(e);return Ws(e,function(){n.execCommand(e)},t,n)},getToolbarIconButton:Sf},qs=of({schema:[Kt("dom")],name:"label"}),Ys=Of("top-left"),Ks=Of("top"),Js=Of("top-right"),Qs=Of("right"),Zs=Of("bottom-right"),nl=Of("bottom"),el=Of("bottom-left"),tl=[qs,Of("left"),Qs,Ks,nl,Ys,Js,el,Zs,rf({name:"thumb",defaults:b({dom:{styles:{position:"absolute"}}}),overrides:function(n){return{events:jr([Lr(we(),n,"spectrum"),Lr(Se(),n,"spectrum"),Lr(Oe(),n,"spectrum"),Lr(Te(),n,"spectrum"),Lr(ke(),n,"spectrum"),Lr(Ee(),n,"spectrum")])}}}),rf({schema:[ir("mouseIsDown",function(){return Pn(!1)})],name:"spectrum",overrides:function(t){function r(e,n){return o.getValueFromEvent(n).map(function(n){return o.setValueFrom(e,t,n)})}var o=t.model.manager;return{behaviours:Vo([Na.config({mode:"special",onLeft:function(n){return o.onLeft(n,t)},onRight:function(n){return o.onRight(n,t)},onUp:function(n){return o.onUp(n,t)},onDown:function(n){return o.onDown(n,t)}}),Gi.config({})]),events:jr([Pr(we(),r),Pr(Se(),r),Pr(Te(),r),Pr(ke(),function(n,e){t.mouseIsDown.get()&&r(n,e)})])}}})],rl=/* */Object.freeze({onLoad:Tf,onUnload:kf,setValue:function(n,e,t,r){e.store.manager.setValue(n,e,t,r)},getValue:function(n,e,t){return e.store.manager.getValue(n,e,t)},getState:function(n,e,t){return t}}),ol=/* */Object.freeze({events:function(t,r){var n=t.resetOnDom?[Co(function(n,e){Tf(n,t,r)}),Do(function(n,e){kf(n,t,r)})]:[Wr(t,r,Tf)];return jr(n)}}),il=/* */Object.freeze({memory:Ef,dataset:Cf,manual:function(){return Bo({readState:function(){}})},init:function(n){return n.store.manager.state(n)}}),ul=[Zt("initialValue"),Kt("getFallbackEntry"),Kt("getDataKey"),Kt("setValue"),ei("manager",{setValue:Df,getValue:function(n,e,t){var r=e.store,o=r.getDataKey(n);return t.lookup(o).fold(function(){return r.getFallbackEntry(o)},function(n){return n})},onLoad:function(e,t,r){t.store.initialValue.each(function(n){Df(e,t,r,n)})},onUnload:function(n,e,t){t.clear()},state:Cf})],cl=[Kt("getValue"),rr("setValue",w),Zt("initialValue"),ei("manager",{setValue:function(n,e,t,r){e.store.setValue(n,r),e.onSetValue(n,r)},getValue:function(n,e,t){return e.store.getValue(n)},onLoad:function(e,t,n){t.store.initialValue.each(function(n){t.store.setValue(e,n)})},onUnload:w,state:Fo.init})],al=[Zt("initialValue"),ei("manager",{setValue:function(n,e,t,r){t.set(r),e.onSetValue(n,r)},getValue:function(n,e,t){return t.get()},onLoad:function(n,e,t){e.store.initialValue.each(function(n){t.isNotSet()&&t.set(n)})},onUnload:function(n,e,t){t.clear()},state:Ef})],fl=[or("store",{mode:"memory"},Yt("mode",{memory:al,manual:cl,dataset:ul})),Jo("onSetValue"),rr("resetOnDom",!1)],sl=Yr({fields:fl,name:"representing",active:ol,apis:rl,extra:{setValueFrom:function(n,e){var t=sl.getValue(e);sl.setValue(n,t)}},state:il}),ll=Wi("width",function(n){return n.dom().offsetWidth}),dl=function(t,r){return{left:b(t),top:b(r),translate:function(n,e){return dl(t+n,r+e)}}},ml=dl,gl=b("slider.change.value"),pl="left",hl=Ts(-1),vl=Ts(1),yl=Fn.none,bl=Fn.none,xl={"top-left":Fn.none(),top:Fn.none(),"top-right":Fn.none(),right:Fn.some(function(n,e){os(n,es(_f(e)))}),"bottom-right":Fn.none(),bottom:Fn.none(),"bottom-left":Fn.none(),left:Fn.some(function(n,e){os(n,es(Bf(e)))})},wl=/* */Object.freeze({setValueFrom:function(n,e,t){var r=Os(n,e,t),o=Ss(r);return ws(n,o),r},setToMin:function(n,e){var t=Af(e);ws(n,Ss(t))},setToMax:function(n,e){var t=Nf(e);ws(n,Ss(t))},findValueOfOffset:Os,getValueFromEvent:function(n){return Rf(n).map(function(n){return n.left()})},findPositionOfValue:ks,setPositionFromValue:function(n,e,t,r){var o=ns(t),i=ks(n,r.getSpectrum(n),o.x(),r.getLeftEdge(n),r.getRightEdge(n),t),u=If(e.element())/2;Ui(e.element(),"left",i-u+"px")},onLeft:hl,onRight:vl,onUp:yl,onDown:bl,edgeActions:xl}),Sl=Fn.none,Ol=Fn.none,Tl=Ms(-1),kl=Ms(1),El={"top-left":Fn.none(),top:Fn.some(function(n,e){os(n,ts(Vf(e)))}),"top-right":Fn.none(),right:Fn.none(),"bottom-right":Fn.none(),bottom:Fn.some(function(n,e){os(n,ts(Pf(e)))}),"bottom-left":Fn.none(),left:Fn.none()},Cl=/* */Object.freeze({setValueFrom:function(n,e,t){var r=Ds(n,e,t),o=Cs(r);return Es(n,o),r},setToMin:function(n,e){var t=Ff(e);Es(n,Cs(t))},setToMax:function(n,e){var t=jf(e);Es(n,Cs(t))},findValueOfOffset:Ds,getValueFromEvent:function(n){return Rf(n).map(function(n){return n.top()})},findPositionOfValue:Is,setPositionFromValue:function(n,e,t,r){var o=ns(t),i=Is(n,r.getSpectrum(n),o.y(),r.getTopEdge(n),r.getBottomEdge(n),t),u=Xi(e.element())/2;Ui(e.element(),"top",i-u+"px")},onLeft:Sl,onRight:Ol,onUp:Tl,onDown:kl,edgeActions:El}),Dl=Fs(-1,!1),Ml=Fs(1,!1),Il=Fs(-1,!0),Rl=Fs(1,!0),Al={"top-left":Fn.some(function(n,e){os(n,rs(Bf(e),Vf(e)))}),top:Fn.some(function(n,e){os(n,rs(Gf(e),Vf(e)))}),"top-right":Fn.some(function(n,e){os(n,rs(_f(e),Vf(e)))}),right:Fn.some(function(n,e){os(n,rs(_f(e),Uf(e)))}),"bottom-right":Fn.some(function(n,e){os(n,rs(_f(e),Pf(e)))}),bottom:Fn.some(function(n,e){os(n,rs(Gf(e),Pf(e)))}),"bottom-left":Fn.some(function(n,e){os(n,rs(Bf(e),Pf(e)))}),left:Fn.some(function(n,e){os(n,rs(Bf(e),Uf(e)))})},Fl=/* */Object.freeze({setValueFrom:function(n,e,t){var r=Os(n,e,t.left()),o=Ds(n,e,t.top()),i=As(r,o);return Rs(n,i),i},setToMin:function(n,e){var t=Af(e),r=Ff(e);Rs(n,As(t,r))},setToMax:function(n,e){var t=Nf(e),r=jf(e);Rs(n,As(t,r))},getValueFromEvent:function(n){return Rf(n)},setPositionFromValue:function(n,e,t,r){var o=ns(t),i=ks(n,r.getSpectrum(n),o.x(),r.getLeftEdge(n),r.getRightEdge(n),t),u=Is(n,r.getSpectrum(n),o.y(),r.getTopEdge(n),r.getBottomEdge(n),t),c=If(e.element())/2,a=Xi(e.element())/2;Ui(e.element(),"left",i-c+"px"),Ui(e.element(),"top",u-a+"px")},onLeft:Dl,onRight:Ml,onUp:Il,onDown:Rl,edgeActions:Al}),Bl=[rr("stepSize",1),rr("onChange",w),rr("onChoose",w),rr("onInit",w),rr("onDragStart",w),rr("onDragEnd",w),rr("snapToGrid",!1),rr("rounded",!0),Zt("snapStart"),Jt("model",Yt("mode",{x:[rr("minX",0),rr("maxX",100),ir("value",function(n){return Pn(n.mode.minX)}),Kt("getInitialValue"),ei("manager",wl)],y:[rr("minY",0),rr("maxY",100),ir("value",function(n){return Pn(n.mode.minY)}),Kt("getInitialValue"),ei("manager",Cl)],xy:[rr("minX",0),rr("maxX",100),rr("minY",0),rr("maxY",100),ir("value",function(n){return Pn({x:b(n.mode.minX),y:b(n.mode.minY)})}),Kt("getInitialValue"),ei("manager",Fl)]})),gc("sliderBehaviours",[Na,sl]),ir("mouseIsDown",function(){return Pn(!1)})],Vl=b("mouse.released"),Nl=yf({name:"Slider",configFields:Bl,partFields:tl,factory:function(i,n,e,t){function u(n){return Cc(n,i,"thumb")}function c(n){return Cc(n,i,"spectrum")}function r(n){return Ec(n,i,"left-edge")}function o(n){return Ec(n,i,"right-edge")}function a(n){return Ec(n,i,"top-edge")}function f(n){return Ec(n,i,"bottom-edge")}function s(n,e){v.setPositionFromValue(n,e,i,{getLeftEdge:r,getRightEdge:o,getTopEdge:a,getBottomEdge:f,getSpectrum:c})}function l(n,e){h.value.set(e);var t=u(n);return s(n,t),i.onChange(n,t,e),Fn.some(!0)}function d(t){var n=i.mouseIsDown.get();i.mouseIsDown.set(!1),n&&Ec(t,i,"thumb").each(function(n){var e=h.value.get();i.onChoose(t,n,e)})}function m(n,e){e.stop(),i.mouseIsDown.set(!0),i.onDragStart(n,u(n))}function g(n,e){e.stop(),i.onDragEnd(n,u(n)),d(n)}var p,h=i.model,v=h.manager;return{uid:i.uid,dom:i.dom,components:n,behaviours:hc(i.sliderBehaviours,[Na.config({mode:"special",focusIn:function(n){return Ec(n,i,"spectrum").map(Na.focusIn).map(b(!0))}}),sl.config({store:{mode:"manual",getValue:function(n){return h.value.get()}}}),Di.config({channels:(p={},p[Vl()]={onReceive:d},p)})]),events:jr([Pr(gl(),function(n,e){l(n,e.event().value())}),Co(function(n,e){var t=h.getInitialValue();h.value.set(t);var r=u(n);s(n,r);var o=c(n);i.onInit(n,r,o,h.value.get())}),Pr(we(),m),Pr(Oe(),g),Pr(Te(),m),Pr(Ee(),g)]),apis:{resetToMin:function(n){v.setToMin(n,i)},resetToMax:function(n){v.setToMax(n,i)},changeValue:l,refresh:s},domModification:{styles:{position:"relative"}}}},apis:{resetToMin:function(n,e){n.resetToMin(e)},resetToMax:function(n,e){n.resetToMax(e)},refresh:function(n,e){n.refresh(e)}}}),jl=function(n,r){var e={onChange:function(n,e,t){r.undoManager.transact(function(){r.formatter.apply("forecolor",{value:t}),r.nodeChanged()})},getInitialValue:function(){return-1}};return Bs(n,"color-levels",function(){return Vs(e)},r)},_l=Ht([Kt("getInitialValue"),Kt("onChange"),Kt("category"),Kt("sizes")]),Pl=function(n){var o=qt("SizeSlider",_l,n);return Nl.sketch({dom:{tag:"div",classes:[Pi.resolve("slider-"+o.category+"-size-container"),Pi.resolve("slider"),Pi.resolve("slider-size-container")]},onChange:function(n,e,t){var r=t.x();!function(n){return 0<=n&&n'),components:[xf('
    ')]}),Nl.parts().thumb({dom:$s('
    '),behaviours:Vo([Bi.config({toggleClass:Pi.resolve("thumb-active")})])})]})},Hl=["9px","10px","11px","12px","14px","16px","18px","20px","24px","32px","36px"],zl={candidates:b(Hl),get:function(n){return function(e){return A(Hl,function(n){return n===e})}(Ns(n)).getOr(2)},apply:function(e,n){(function(n){return Fn.from(Hl[n])})(n).each(function(n){!function(n,e){Ns(n)!==e&&n.execCommand("fontSize",!1,e)}(e,n)})}},Ll=zl.candidates(),Gl=window.Promise?window.Promise:(Ps=Ul.immediateFn||"function"==typeof window.setImmediate&&window.setImmediate||function(n){l.setTimeout(n,1)},Hs=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)},Ul.prototype["catch"]=function(n){return this.then(null,n)},Ul.prototype.then=function(t,r){var o=this;return new Ul(function(n,e){Wl.call(o,new Kl(t,r,n,e))})},Ul.all=function(){for(var n=[],e=0;e'),action:function(n){var e=t.get(n);sl.setValue(e,"")}}));return{name:n,spec:mm.sketch({dom:$s('
    '),components:[t.asSpec(),r.asSpec()],containerBehaviours:Vo([Bi.config({toggleClass:Pi.resolve("input-container-empty")}),dm.config({find:function(n){return Fn.some(t.get(n))}}),fm("input-clearing",[Pr(Ie(),function(n){var e=t.get(n);(0"}function bd(){function e(){t.get().each(function(n){n.destroy()})}var t=Pn(Fn.none());return{clear:function(){e(),t.set(Fn.none())},isSet:function(){return t.get().isSome()},set:function(n){e(),t.set(Fn.some(n))},run:function(n){t.get().each(n)}}}function xd(){var e=Pn(Fn.none());return{clear:function(){e.set(Fn.none())},set:function(n){e.set(Fn.some(n))},isSet:function(){return e.get().isSome()},on:function(n){e.get().each(n)}}}function wd(n){function r(e,n,t){return Gs.sketch({dom:$s(''),action:function(n){U(n,u,{direction:e})},buttonBehaviours:Vo([Em.config({disableClass:Pi.resolve("toolbar-navigation-disabled"),disabled:!t})])})}function o(n,o){var i=Ki(n.element(),"."+Pi.resolve("serialised-dialog-screen"));Zi(n.element(),"."+Pi.resolve("serialised-dialog-chain")).each(function(r){0<=c.state.currentScreen.get()+o&&c.state.currentScreen.get()+o'),components:[mm.sketch({dom:$s('
    '),components:me(c.fields,function(n,e){return e<=c.maxFieldIndex?mm.sketch({dom:$s('
    '),components:[r(-1,"previous",0'),behaviours:Vo([Du.config({highlightClass:Pi.resolve("dot-active"),itemClass:Pi.resolve("dot-item")})]),components:B(c.fields,function(n,e){return e<=c.maxFieldIndex?[xf('
    ')]:[]})});return{dom:$s('
    '),components:[a.asSpec(),f.asSpec()],behaviours:Vo([Na.config({mode:"special",focusIn:function(n){var e=a.get(n);Na.focusIn(e)}}),fm("serializer-wrapper-events",[Pr(we(),function(n,e){var t=e.event();c.state.dialogSwipeState.set(Im(t.raw().touches[0].clientX))}),Pr(Se(),function(n,e){var t=e.event();c.state.dialogSwipeState.on(function(n){e.event().prevent(),c.state.dialogSwipeState.set(Rm(n,t.raw().touches[0].clientX))})}),Pr(Oe(),function(r){c.state.dialogSwipeState.on(function(n){var e=a.get(r),t=-1*Am(n);o(e,t)})})])])}}function Sd(e){function n(n){return function(){throw new Error("The component must be in a context to send: "+n+"\n"+xo(e().element())+" is not in context.")}}return{debugInfo:b("fake"),triggerEvent:n("triggerEvent"),triggerFocus:n("triggerFocus"),triggerEscape:n("triggerEscape"),build:n("build"),addToWorld:n("addToWorld"),removeFromWorld:n("removeFromWorld"),addToGui:n("addToGui"),removeFromGui:n("removeFromGui"),getByUid:n("getByUid"),getByDom:n("getByDom"),broadcast:n("broadcast"),broadcastOn:n("broadcastOn"),broadcastEvent:n("broadcastEvent"),isConnected:b(!1)}}function Od(n,o){var i={};return Nn(n,function(n,r){Nn(n,function(n,e){var t=kn(e,[])(i);i[e]=t.concat([o(r,n)])})}),i}function Td(n){return n.cHandler}function kd(n,e){return{name:b(n),handler:b(e)}}function Ed(n,e,t){var r=x(x({},t),function(n,e){var t={};return C(n,function(n){t[n.name()]=n.handlers(e)}),t}(e,n));return Od(r,kd)}function Cd(n){var i=function(n){return ae(n)?{can:b(!0),abort:b(!1),run:n}:n}(n);return function(n,e){for(var t=[],r=2;r "):r[0].name();return En(o,function(n,e){return{handler:n,purpose:b(e)}}(e,t))})});return Dn(e,{})},zm=function(n){var e=qt("external.component",Ht([Kt("element"),Zt("uid")]),n),t=Pn(Sd());e.uid.each(function(n){gf(e.element,n)});var r={getSystem:t.get,config:Fn.none,hasConfigured:b(!1),connect:function(n){t.set(n)},disconnect:function(){t.set(Sd(function(){return r}))},getApis:function(){return{}},element:b(e.element),spec:b(n),readState:b("No state"),syncComponents:w,components:b([]),events:b({})};return Ic(r)},Lm=Ac,Gm=function(e){return function(n){return Mt(n,ff)}(e).fold(function(){var n=e.hasOwnProperty("uid")?e:x({uid:Lm("")},e);return jd(n).getOrDie()},function(n){return n})},Um=Ic,$m="alloy.item-hover",Wm="alloy.item-focus",Xm=b($m),qm=b(Wm),Ym=[Kt("data"),Kt("components"),Kt("dom"),rr("hasSubmenu",!1),Zt("toggling"),ja("itemBehaviours",[Bi,Gi,Na,sl]),rr("ignoreFocus",!1),rr("domModification",{}),ei("builder",function(n){return{dom:n.dom,domModification:x(x({},n.domModification),{attributes:x(x(x({role:n.toggling.isSome()?"menuitemcheckbox":"menuitem"},n.domModification.attributes),{"aria-haspopup":n.hasSubmenu}),n.hasSubmenu?{"aria-expanded":!1}:{})}),behaviours:_a(n.itemBehaviours,[n.toggling.fold(Bi.revoke,function(n){return Bi.config(x({aria:{mode:"checked"}},n))}),Gi.config({ignore:n.ignoreFocus,stopMousedown:n.ignoreFocus,onFocus:function(n){Hd(n)}}),Na.config({mode:"execution"}),sl.config({store:{mode:"memory",initialValue:n.data}}),fm("item-type-events",function a(){for(var n=0,e=0,t=arguments.length;e");r[t[0]]=En(t[1],n),r[t[1]]=En(t[0],n)}),r},createBistate:function(n,e,t){return Cn([{key:n,value:En(e,t)},{key:e,value:En(n,t)}])},createTristate:function(n,e,t,r){return Cn([{key:n,value:Cn([{key:e,value:r},{key:t,value:r}])},{key:e,value:Cn([{key:n,value:r},{key:t,value:r}])},{key:t,value:Cn([{key:n,value:r},{key:e,value:r}])}])}}}),vg=Pi.resolve("scrollable"),yg={register:function(n){uo(n,vg)},deregister:function(n){ao(n,vg)},scrollable:b(vg)},bg=function(n,e,t,r,o){return{data:{value:n,text:e},type:"item",dom:{tag:"div",classes:o?[Pi.resolve("styles-item-is-menu")]:[]},toggling:{toggleOnExecute:!1,toggleClass:Pi.resolve("format-matches"),selected:t},itemBehaviours:Vo(o?[]:[Vi(n,function(n,e){(e?Bi.on:Bi.off)(n)})]),components:[{dom:{tag:"div",attributes:{style:r},innerHtml:e}}]}},xg=function(n,e,t,r){return{value:n,dom:{tag:"div"},components:[Gs.sketch({dom:{tag:"div",classes:[Pi.resolve("styles-collapser")]},components:r?[{dom:{tag:"span",classes:[Pi.resolve("styles-collapse-icon")]}},_d(n)]:[_d(n)],action:function(n){if(r){var e=t().get(n);sg.collapseMenu(e)}}}),{dom:{tag:"div",classes:[Pi.resolve("styles-menu-items-container")]},components:[rg.parts().items({})],behaviours:Vo([fm("adhoc-scrollable-menu",[Co(function(n,e){Ui(n.element(),"overflow-y","auto"),Ui(n.element(),"-webkit-overflow-scrolling","touch"),yg.register(n.element())}),Do(function(n){hi(n.element(),"overflow-y"),hi(n.element(),"-webkit-overflow-scrolling"),yg.deregister(n.element())})])])}],items:e,menuBehaviours:Vo([hg.config({initialState:"after",routes:hg.createTristate("before","current","after",{transition:{property:"transform",transitionClass:"transitioning"}})})])}},wg=function(r){var n=function(r,o){var n=xg("Styles",[].concat(me(r.items,function(n){return bg(qd(n),n.title,n.isSelected(),n.getPreview(),Mn(r.expansions,qd(n)))})),o,!1),e=S(r.menus,function(n,e){var t=me(n,function(n){return bg(qd(n),n.title,n.isSelected!==undefined&&n.isSelected(),n.getPreview!==undefined?n.getPreview():"",Mn(r.expansions,qd(n)))});return xg(e,t,o,!0)}),t=wt(e,En("styles",n));return{tmenu:sg.tieredData("styles",t,r.expansions)}}(r.formats,function(){return e}),e=_s(sg.sketch({dom:{tag:"div",classes:[Pi.resolve("styles-menu")]},components:[],fakeFocus:!0,stayInDom:!0,onExecute:function(n,e){var t=sl.getValue(e);return r.handle(e,t.value),Fn.none()},onEscape:function(){return Fn.none()},onOpenMenu:function(n,e){var t=If(n.element());Mf(e.element(),t),hg.jumpTo(e,"current")},onOpenSubmenu:function(n,e,t){var r=If(n.element()),o=Qi(e.element(),'[role="menu"]').getOrDie("hacky"),i=n.getSystem().getByDom(o).getOrDie();Mf(t.element(),r),hg.progressTo(i,"before"),hg.jumpTo(t,"after"),hg.progressTo(t,"current")},onCollapseMenu:function(n,e,t){var r=Qi(e.element(),'[role="menu"]').getOrDie("hacky"),o=n.getSystem().getByDom(r).getOrDie();hg.progressTo(o,"after"),hg.progressTo(t,"current")},navigateOnHover:!1,highlightImmediately:!0,data:n.tmenu,markers:{backgroundMenu:Pi.resolve("styles-background-menu"),menu:Pi.resolve("styles-menu"),selectedMenu:Pi.resolve("styles-selected-menu"),item:Pi.resolve("styles-item"),selectedItem:Pi.resolve("styles-selected-item")}}));return e.asSpec()},Sg=function(n){return M(n,function(n,e){var t=Yd(e);return{menus:wt(n.menus,t.menus),items:[t.item].concat(n.items),expansions:wt(n.expansions,t.expansions)}},{menus:{},expansions:{},items:[]})},Og={expand:Sg},Tg=function(r,n){function o(n){return function(){return r.formatter.match(n)}}function i(n){return function(){return r.formatter.getCssText(n)}}var e=Mt(n,"style_formats").getOr(Bm),t=function(n){return me(n,function(n){if(Mn(n,"items")){var e=t(n.items);return wt(function(n){return wt(n,{isSelected:b(!1),getPreview:b("")})}(n),{items:e})}return Mn(n,"format")?function(n){return wt(n,{isSelected:o(n.format),getPreview:i(n.format)})}(n):function(n){var e=bc(n.title),t=wt(n,{format:e,isSelected:o(e),getPreview:i(e)});return r.formatter.register(e,t),t}(n)})};return t(e)},kg=function(t,n,r){var e=function(e,n){var t=function(n){return B(n,function(n){return n.items===undefined?!Mn(n,"format")||e.formatter.canApply(n.format)?[n]:[]:0e.innerHeight||n.bottom()>e.innerHeight?n.bottom()-e.innerHeight+50:0;0!=t&&e.scrollTo(e.pageXOffset,e.pageYOffset+t)})})].concat(!0==Pg?[]:[nm(Qe.fromDom(r.win()),"blur",function(){t.getByDom(e).each(Bi.off)}),nm(u,"select",n),nm(r.doc(),"selectionchange",n)]);return{destroy:function(){C(c,function(n){n.unbind()})}}},zg=function(n,e){var t=parseInt(Zr(n,e),10);return isNaN(t)?0:t};function Lg(n){return Dp.getOption(n)}function Gg(n){return function(n){return Lg(n).filter(function(n){return 0!==n.trim().length||-1=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom}function Kg(t,r,n,e,o){function i(n){var e=t.dom().createRange();return e.setStart(r.dom(),n),e.collapse(!0),e}var u=function(n){return Dp.get(n)}(r).length,c=function(n,e,t,r,o){if(0===o)return 0;if(e===r)return o-1;for(var i=r,u=1;un.innerHeight||e.bottom()>n.innerHeight?Math.min(t,e.bottom()-n.innerHeight+50):0}(r,n,t);0!==e&&r.scrollTo(r.pageXOffset,r.pageYOffset+e)})}),gp(e,n.innerHeight)});gp(e,n.innerHeight);return{toEditing:function(){Pp(r)},destroy:function(){t.unbind()}}},Lp={getBody:Sp("getBody",vp),getDoc:Sp("getDoc",yp),getWin:Sp("getWin",bp),getSelection:Sp("getSelection",xp),getFrame:wp,getActiveApi:function(c){var a=wp(c);return vp(a).bind(function(u){return yp(a).bind(function(i){return bp(a).map(function(o){var n=Qe.fromDom(i.dom().documentElement),e=c.getCursorBox.getOrThunk(function(){return function(){return function(n){return fp(n).map(function(n){return Bp.exact(n.start(),n.soffset(),n.finish(),n.foffset())})}(o).bind(function(n){return sp(o,n).orThunk(function(){return function(n){return fp(n).filter(function(n){return cn(n.start(),n.finish())&&n.soffset()===n.foffset()}).bind(function(n){var e=n.start().dom().getBoundingClientRect();return 0